-
Notifications
You must be signed in to change notification settings - Fork 155
/
Copy pathsymbol-palette-model.d.ts
323 lines (280 loc) · 8.49 KB
/
symbol-palette-model.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
import { Component, Property, Complex, CollectionFactory, ChildProperty, Event } from '@syncfusion/ej2-base';import { isBlazor, BlazorDragEventArgs } from '@syncfusion/ej2-base';import { Browser, EventHandler, Draggable, INotifyPropertyChanged, Collection, ModuleDeclaration } from '@syncfusion/ej2-base';import { remove, EmitType } from '@syncfusion/ej2-base';import { Accordion, AccordionItemModel, ExpandMode, ExpandEventArgs } from '@syncfusion/ej2-navigations';import { NodeModel, ConnectorModel, Node, Connector, Shape, Size } from '../diagram/index';import { Transform, SwimLane, PathModel, IPaletteExpandArgs } from '../diagram/index';import { DiagramRenderer, Container, StackPanel, Margin, BpmnDiagrams, ShapeStyleModel, TextStyleModel } from '../diagram/index';import { DiagramElement, TextElement, MarginModel, Canvas, PointModel, IElement } from '../diagram/index';import { TextWrap, TextOverflow, IPaletteSelectionChangeArgs, HeaderModel, SwimLaneModel } from '../diagram/index';import { SvgRenderer } from '../diagram/rendering/svg-renderer';import { parentsUntil, createSvgElement, createHtmlElement, createMeasureElements } from '../diagram/utility/dom-util';import { removeElementsByClass, applyStyleAgainstCsp } from '../diagram/utility/dom-util';import { scaleElement, arrangeChild, groupHasType, setUMLActivityDefaults, updateDefaultValues } from '../diagram/utility/diagram-util';import { getFunction, randomId, cloneObject } from '../diagram/utility/base-util';import { getOuterBounds } from '../diagram/utility/connector';import { Point } from '../diagram/primitives/point';import { CanvasRenderer } from '../diagram/rendering/canvas-renderer';import { Rect } from '../diagram/primitives/rect';import { SymbolSizeModel, SymbolPaletteInfoModel } from '../diagram/objects/preview-model';
import {SymbolInfo} from "./symbol-palette";
import {ComponentModel} from '@syncfusion/ej2-base';
/**
* Interface for a class Palette
*/
export interface PaletteModel {
/**
* Defines the unique id of a symbol group
*
* @default ''
*/
id?: string;
/**
* Sets the height of the symbol group
*
* @aspDefaultValueIgnore
* @default undefined
*/
height?: number;
/**
* Sets whether the palette items to be expanded or not
*
* @default true
*/
expanded?: boolean;
/**
* Defines the content of the symbol group
*
* @default ''
*/
iconCss?: string;
/**
* Defines the title of the symbol group
*
* @default ''
*/
title?: string;
/**
* Defines the collection of predefined symbols
*
* @aspType object
*/
symbols?: (NodeModel | ConnectorModel)[];
}
/**
* Interface for a class SymbolDragSize
*/
export interface SymbolDragSizeModel {
/**
* Sets the drag width of the symbols
*
* @aspDefaultValueIgnore
* @default undefined
*/
width?: number;
/**
* Sets the drag height of the symbols
*
* @aspDefaultValueIgnore
* @default undefined
*/
height?: number;
}
/**
* Interface for a class SymbolPreview
*/
export interface SymbolPreviewModel {
/**
* Sets the preview width of the symbols
*
* @aspDefaultValueIgnore
* @default undefined
*/
width?: number;
/**
* Sets the preview height of the symbols
*
* @aspDefaultValueIgnore
* @default undefined
*/
height?: number;
/**
* Defines the distance to be left between the cursor and symbol
*
* @default {}
*/
offset?: PointModel;
}
/**
* Interface for a class SymbolPalette
*/
export interface SymbolPaletteModel extends ComponentModel{
/**
* Configures the key, when it pressed the symbol palette will be focused
*
* @default 'S'
*/
accessKey?: string;
/**
* Defines the width of the symbol palette
*
* @default '100%'
*/
width?: string | number;
/**
* Defines the height of the symbol palette
*
* @default '100%'
*/
height?: string | number;
/**
* Defines the collection of symbol groups
*
* @default []
*/
palettes?: PaletteModel[];
/**
* ```html
* <div id="symbolpalette"></div>
* ```
* ```typescript
* let palette: SymbolPalette = new SymbolPalette({
* expandMode: 'Multiple',
* palettes: [
* { id: 'flow', expanded: false, symbols: getFlowShapes(), title: 'Flow Shapes' },
* ],
* width: '100%', height: '100%', symbolHeight: 50, symbolWidth: 50,
* symbolPreview: { height: 100, width: 100 },
* enableSearch: true,
* getNodeDefaults: setPaletteNodeDefaults,
* symbolMargin: { left: 12, right: 12, top: 12, bottom: 12 },
* getSymbolInfo: (symbol: NodeModel): SymbolInfo => {
* return { fit: true };
* }
* });
* palette.appendTo('#symbolpalette');
* export function getFlowShapes(): NodeModel[] {
* let flowShapes: NodeModel[] = [
* { id: 'Terminator', shape: { type: 'Flow', shape: 'Terminator' }, style: { strokeWidth: 2 } },
* { id: 'Process', shape: { type: 'Flow', shape: 'Process' }, style: { strokeWidth: 2 } },
* { id: 'Decision', shape: { type: 'Flow', shape: 'Decision' }, style: { strokeWidth: 2 } }
* ];
* return flowShapes;
* }
* function setPaletteNodeDefaults(node: NodeModel): void {
* if (node.id === 'Terminator' || node.id === 'Process') {
* node.width = 130;
* node.height = 65;
* } else {
* node.width = 50;
* node.height = 50;
* }
* node.style.strokeColor = '#3A3A3A';
* }
* ```
*
* @deprecated
*/
getSymbolInfo?: Function | string;
/**
* Defines the size, appearance and description of a symbol
*
*/
symbolInfo?: SymbolInfo;
/**
* Defines the symbols to be added in search palette
*
* @aspDefaultValueIgnore
* @default undefined
* @deprecated
*/
filterSymbols?: Function | string;
/**
* Defines the symbols to be added in search palette
*
*/
ignoreSymbolsOnSearch?: string[];
/**
* Defines the content of a symbol
*
* @aspDefaultValueIgnore
* @default undefined
* @deprecated
*/
getSymbolTemplate?: Function | string;
/**
* Defines the width of the symbol
*
* @aspDefaultValueIgnore
* @default undefined
*/
symbolWidth?: number;
/**
* Defines the height of the symbol
*
* @aspDefaultValueIgnore
* @default undefined
*/
symbolHeight?: number;
/**
* Defines the space to be left around a symbol
*
* @default {left:10,right:10,top:10,bottom:10}
*/
symbolMargin?: MarginModel;
/**
* Defines whether the symbols can be dragged from palette or not
*
* @default true
*/
allowDrag?: boolean;
/**
* Defines the size and position of the symbol preview
*
* @aspDefaultValueIgnore
* @default undefined
*/
symbolPreview?: SymbolPreviewModel;
/**
* Defines the size of a drop symbol
*
* @aspDefaultValueIgnore
* @default undefined
*/
symbolDragSize?: SymbolDragSizeModel;
/**
* Enables/Disables search option in symbol palette
*
* @default false
*/
enableSearch?: boolean;
/**
* Enables/Disables animation when the palette header is expanded/collapsed
*
*/
enableAnimation?: boolean;
/**
* Defines how many palettes can be at expanded mode at a time
*
* @default 'Multiple'
* @aspDefaultValueIgnore
* @isEnumeration true
*/
expandMode?: ExpandMode;
/**
* Triggers after the selection changes in the symbol palette
*
* @event
*/
paletteSelectionChange?: EmitType<IPaletteSelectionChangeArgs>;
/**
* Triggers when the icon is expanded
*
* @event
*/
paletteExpanding?: EmitType<IPaletteExpandArgs>;
/**
* Helps to return the default properties of node
*
* @deprecated
*/
getNodeDefaults?: Function | string;
/**
* Helps to return the default properties of node
*
*/
nodeDefaults?: NodeModel;
/**
* Helps to return the default properties of connector
*
* @deprecated
*/
getConnectorDefaults?: Function | string;
/**
* Helps to return the default properties of connectors
*
*/
connectorDefaults?: ConnectorModel;
}