@metadev/daga-angular 5.0.3 → 5.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@metadev/daga-angular",
3
3
  "description": "Diagramming engine for editing models on the Web. Made by Metadev.",
4
- "version": "5.0.3",
4
+ "version": "5.0.4",
5
5
  "author": "Metadev (https://metadev.pro)",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
7
7
  "repository": "git+https://github.com/metadevpro/daga-tutorial.git",
@@ -21,15 +21,15 @@
21
21
  "@angular/common": ">= 21.0.7 < 23",
22
22
  "@angular/core": ">= 21.0.7 < 23",
23
23
  "@angular/forms": ">= 21.0.7 < 23",
24
- "@metadev/daga": "^5.0.3",
24
+ "@metadev/daga": "^5.0.4",
25
25
  "d3": "^7.9.0",
26
- "rxjs": "~7.8.1"
26
+ "rxjs": "~7.8.2"
27
27
  },
28
28
  "sideEffects": false,
29
29
  "files": [
30
30
  "/assets",
31
31
  "/fesm2022",
32
- "/lib",
32
+ "/types",
33
33
  "index.d.ts",
34
34
  "package.json",
35
35
  "README.md",
@@ -47,6 +47,7 @@
47
47
  "default": "./fesm2022/metadev-daga-angular.mjs"
48
48
  }
49
49
  },
50
+ "type": "module",
50
51
  "dependencies": {
51
52
  "tslib": "^2.3.0"
52
53
  }
@@ -0,0 +1,403 @@
1
+ import { Side, DiagramButtons, Canvas, Corner, DiagramActions, DiagramConfig, Palette, PaletteSectionConfig, PropertyEditor, ValueSet, DiagramEditor, DagaModel, DiagramEvent, DiagramError, Type, Property } from '@metadev/daga';
2
+ export { ACTION_STACK_SIZE, ActionStack, AddConnectionAction, AddNodeAction, AdjacencyLayout, ApplyLayoutAction, BreadthAdjacencyLayout, BreadthLayout, ButtonsComponentConfig, Canvas, CanvasConfig, ClosedShape, CollabAction, CollabActionSerialized, CollabClient, CollabTimestamp, CollabTimestampSet, ComponentsConfig, ConnectionLook, ConnectionLookConfig, ConnectionTemplateConfig, ConnectionTypeConfig, Corner, DagaExporter, DagaImporter, DagaModel, DiagramAction, DiagramActionMethod, DiagramActions, DiagramButtons, DiagramCanvas, DiagramConfig, DiagramConnection, DiagramConnectionSet, DiagramConnectionType, DiagramDecorator, DiagramDecoratorSet, DiagramDoubleClickEvent, DiagramDraggingNodeEvent, DiagramEditor, DiagramElement, DiagramElementSet, DiagramEntity, DiagramEntitySet, DiagramError, DiagramEvent, DiagramEvents, DiagramField, DiagramFieldSet, DiagramHighlightedEvent, DiagramLayout, DiagramModel, DiagramModelExporter, DiagramModelImporter, DiagramNode, DiagramNodeGeometry, DiagramNodeSet, DiagramNodeType, DiagramObject, DiagramObjectSet, DiagramPort, DiagramPortSet, DiagramPortType, DiagramSecondaryClickEvent, DiagramSection, DiagramSectionGeometry, DiagramSectionSet, DiagramSelectionEvent, DiagramValidator, DiagramZoomEvent, EditFieldAction, ErrorsComponentConfig, FieldConfig, ForceLayout, GridConfig, GridStyle, HorizontalAlign, HorizontalLayout, ImageLook, ImageLookConfig, Line, LineShape, LineStyle, Look, LookConfig, MarkerImageLook, MarkerImageLookConfig, MoveAction, NodeTemplateConfig, NodeTypeConfig, Palette, PaletteComponentConfig, PaletteSectionConfig, PasteAction, Point, PortConfig, PortTypeConfig, PriorityLayout, Property, PropertyEditor, PropertyEditorComponentConfig, PropertySet, Rectangle, RemoveAction, ResizableMode, SectionConfig, SectionGridConfig, SetGeometryAction, SetParentAction, ShapedLook, ShapedLookConfig, Side, StretchableImageLook, StretchableImageLookConfig, TreeLayout, Type, UpdateValuesAction, UserActionConfig, ValueSet, VerticalAlign, VerticalLayout, getLocationsOfNodes, layouts } from '@metadev/daga';
3
+ import * as i0 from '@angular/core';
4
+ import { ElementRef, OnInit, AfterViewInit, OnDestroy, EventEmitter } from '@angular/core';
5
+ import * as rxjs from 'rxjs';
6
+ import { Observable } from 'rxjs';
7
+ import * as d3 from 'd3';
8
+ import * as i10 from '@angular/common';
9
+ import * as i11 from '@angular/forms';
10
+
11
+ /**
12
+ * Button used to collapse components that implement it.
13
+ * @private
14
+ */
15
+ declare class CollapseButtonComponent {
16
+ collapsableSelector: string | ElementRef | HTMLElement;
17
+ collapsableAdditionalSelector: string;
18
+ collapsed: boolean;
19
+ disabled: boolean;
20
+ direction: Side;
21
+ rule: string;
22
+ collapsedValue: string;
23
+ visibleValue: string;
24
+ Side: typeof Side;
25
+ toggleCollapse(): void;
26
+ getClass(): string;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<CollapseButtonComponent, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<CollapseButtonComponent, "daga-collapse-button", never, { "collapsableSelector": { "alias": "collapsableSelector"; "required": false; }; "collapsableAdditionalSelector": { "alias": "collapsableAdditionalSelector"; "required": false; }; "collapsed": { "alias": "collapsed"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "direction": { "alias": "direction"; "required": false; }; "rule": { "alias": "rule"; "required": false; }; "collapsedValue": { "alias": "collapsedValue"; "required": false; }; "visibleValue": { "alias": "visibleValue"; "required": false; }; }, {}, never, never, true, never>;
29
+ }
30
+
31
+ /**
32
+ * Buttons used to trigger diagram functionalities by the user.
33
+ * @private
34
+ */
35
+ declare class DiagramButtonsComponent implements DiagramButtons, OnInit, AfterViewInit, OnDestroy {
36
+ #private;
37
+ get canvas(): Canvas;
38
+ collapsableButtons: ElementRef<HTMLDivElement>;
39
+ location: Corner;
40
+ direction: Side;
41
+ centerAnimationDuration: number | undefined;
42
+ enableAction: boolean;
43
+ enableFilter: boolean;
44
+ enableLayout: boolean;
45
+ enableSelection: boolean;
46
+ enableZoom: boolean;
47
+ filterOn: boolean;
48
+ collapsed: boolean;
49
+ animationOngoing: boolean;
50
+ private sizeAttribute;
51
+ private transformFunction;
52
+ private transformOrigin;
53
+ private marginSide;
54
+ private collapsableButtonsSize;
55
+ private sub?;
56
+ DiagramActions: typeof DiagramActions;
57
+ ngOnInit(): void;
58
+ ngAfterViewInit(): void;
59
+ ngOnDestroy(): void;
60
+ init(config: DiagramConfig): void;
61
+ recalculateSizeOfButtons(): void;
62
+ toggleCollapse(): Promise<void>;
63
+ zoomIn(): void;
64
+ zoomOut(): void;
65
+ center(): void;
66
+ layout(): void;
67
+ filter(): void;
68
+ undo(): void;
69
+ redo(): void;
70
+ copySelection(): void;
71
+ cutSelection(): void;
72
+ pasteSelection(): void;
73
+ deleteSelection(): void;
74
+ startMultipleSelection(): void;
75
+ static ɵfac: i0.ɵɵFactoryDeclaration<DiagramButtonsComponent, never>;
76
+ static ɵcmp: i0.ɵɵComponentDeclaration<DiagramButtonsComponent, "daga-diagram-buttons", never, { "location": { "alias": "location"; "required": false; }; "direction": { "alias": "direction"; "required": false; }; "centerAnimationDuration": { "alias": "centerAnimationDuration"; "required": false; }; "enableAction": { "alias": "enableAction"; "required": false; }; "enableFilter": { "alias": "enableFilter"; "required": false; }; "enableLayout": { "alias": "enableLayout"; "required": false; }; "enableSelection": { "alias": "enableSelection"; "required": false; }; "enableZoom": { "alias": "enableZoom"; "required": false; }; }, {}, never, never, true, never>;
77
+ }
78
+
79
+ /**
80
+ * Palette that the user can drag and drop nodes from.
81
+ * @private
82
+ * @see DiagramConfig
83
+ * @see DiagramNode
84
+ */
85
+ declare class PaletteComponent implements Palette, OnInit, AfterViewInit, OnDestroy {
86
+ #private;
87
+ get canvas(): Canvas;
88
+ panel: ElementRef<HTMLDivElement>;
89
+ palettes: PaletteSectionConfig[];
90
+ currentPalette: PaletteSectionConfig;
91
+ currentCategory: string;
92
+ location: Corner;
93
+ direction: Side;
94
+ width: string;
95
+ height?: string;
96
+ gap: string;
97
+ private priorityThreshold?;
98
+ private sub?;
99
+ ngOnInit(): void;
100
+ ngAfterViewInit(): void;
101
+ ngOnDestroy(): void;
102
+ init(config: DiagramConfig): void;
103
+ refreshPalette(): void;
104
+ switchPalette(palette: PaletteSectionConfig): void;
105
+ selectPanel(): d3.Selection<HTMLDivElement, unknown, null, undefined>;
106
+ selectPalette(): d3.Selection<HTMLDivElement, unknown, null, undefined>;
107
+ private appendCategories;
108
+ private appendTemplate;
109
+ private appendNodeTemplate;
110
+ private appendConnectionTemplate;
111
+ static ɵfac: i0.ɵɵFactoryDeclaration<PaletteComponent, never>;
112
+ static ɵcmp: i0.ɵɵComponentDeclaration<PaletteComponent, "daga-palette", never, { "palettes": { "alias": "palettes"; "required": false; }; "currentPalette": { "alias": "currentPalette"; "required": false; }; "currentCategory": { "alias": "currentCategory"; "required": false; }; "location": { "alias": "location"; "required": false; }; "direction": { "alias": "direction"; "required": false; }; "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; "gap": { "alias": "gap"; "required": false; }; }, {}, never, never, true, never>;
113
+ }
114
+
115
+ /**
116
+ * Editor of the values of a value set.
117
+ * @private
118
+ * @see ValueSet
119
+ */
120
+ declare class PropertyEditorComponent implements PropertyEditor, OnInit, AfterViewInit, OnDestroy {
121
+ #private;
122
+ panel: ElementRef<HTMLDivElement>;
123
+ location: Corner;
124
+ direction: Side;
125
+ width: string;
126
+ height?: string;
127
+ title?: string;
128
+ _valueSet: ValueSet | undefined;
129
+ get valueSet(): ValueSet | undefined;
130
+ set valueSet(valueSet: ValueSet | undefined);
131
+ settings?: boolean;
132
+ private sub?;
133
+ ngOnInit(): void;
134
+ ngAfterViewInit(): void;
135
+ ngOnDestroy(): void;
136
+ init(config: DiagramConfig): void;
137
+ setPanelWidth(): void;
138
+ selectPanel(): d3.Selection<HTMLDivElement, unknown, null, undefined>;
139
+ highlightProperty(...propertyNames: string[]): void;
140
+ static ɵfac: i0.ɵɵFactoryDeclaration<PropertyEditorComponent, never>;
141
+ static ɵcmp: i0.ɵɵComponentDeclaration<PropertyEditorComponent, "daga-property-editor", never, { "valueSet": { "alias": "valueSet"; "required": false; }; }, {}, never, never, true, never>;
142
+ }
143
+
144
+ /**
145
+ * The context of a diagram. Every separate diagram must be contained within its own {@link DiagramComponent} and every {@link DiagramComponent} must contain its own {@link DiagramEditorComponent}.
146
+ * This component defines a {@link DagaConfigurationService} and a {@link CanvasProviderService}, which is shared by all the components within and allows accessing the configuration and the canvas of this component's diagram, respectively.
147
+ * @public
148
+ */
149
+ declare class DiagramComponent implements DiagramEditor, OnInit, AfterViewInit, OnDestroy {
150
+ #private;
151
+ appendTo: ElementRef<HTMLDivElement>;
152
+ diagramButtons: DiagramButtonsComponent;
153
+ palette: PaletteComponent;
154
+ propertyEditor: PropertyEditorComponent;
155
+ private importer;
156
+ private exporter;
157
+ private _model;
158
+ /**
159
+ * Getter for the configuration of this diagram.
160
+ * @public
161
+ */
162
+ get config(): DiagramConfig;
163
+ /**
164
+ * Setter for the configuration for the diagram.
165
+ * @public
166
+ */
167
+ set config(config: DiagramConfig);
168
+ /**
169
+ * Subject used to track when the diagram configuration has been updated.
170
+ * @public
171
+ */
172
+ get config$(): Observable<DiagramConfig>;
173
+ /**
174
+ * Getter for the canvas of this diagram.
175
+ * @public
176
+ */
177
+ get canvas(): Canvas;
178
+ /**
179
+ * Subject used to track when the canvas has been updated.
180
+ * @public
181
+ */
182
+ get canvas$(): Observable<Canvas>;
183
+ /**
184
+ * Subject used to track when the view has been initialized after updating the canvas.
185
+ * @public
186
+ */
187
+ get viewInitialized$(): Observable<Canvas>;
188
+ /**
189
+ * Serialized model for the diagram. Used for data binding to the model.
190
+ * @public
191
+ */
192
+ get model(): DagaModel;
193
+ /**
194
+ * Serialized model for the diagram. Used for data binding to the model.
195
+ * @public
196
+ */
197
+ set model(model: DagaModel);
198
+ /**
199
+ * Output for changes to the diagram's model.
200
+ * @public
201
+ */
202
+ modelChange: EventEmitter<DagaModel>;
203
+ /**
204
+ * Output for user events on the diagram.
205
+ * @public
206
+ */
207
+ diagramEvent: EventEmitter<DiagramEvent>;
208
+ private configurationSub?;
209
+ private canvasSub?;
210
+ Corner: typeof Corner;
211
+ Side: typeof Side;
212
+ ngOnInit(): void;
213
+ ngAfterViewInit(): void;
214
+ ngOnDestroy(): void;
215
+ private setUpCanvas;
216
+ static ɵfac: i0.ɵɵFactoryDeclaration<DiagramComponent, never>;
217
+ static ɵcmp: i0.ɵɵComponentDeclaration<DiagramComponent, "daga-diagram", never, { "config": { "alias": "config"; "required": false; }; "model": { "alias": "model"; "required": false; }; }, { "modelChange": "modelChange"; "diagramEvent": "diagramEvent"; }, never, ["*"], true, never>;
218
+ }
219
+
220
+ /**
221
+ * Displays the errors detected by a diagram's validators.
222
+ * @private
223
+ * @see DiagramValidator
224
+ */
225
+ declare class ErrorsComponent implements AfterViewInit, OnDestroy {
226
+ #private;
227
+ get canvas(): Canvas;
228
+ errorsContainer: ElementRef<HTMLDivElement>;
229
+ errors: DiagramError[];
230
+ private canvasSub?;
231
+ private validationSub?;
232
+ Side: typeof Side;
233
+ ngAfterViewInit(): void;
234
+ ngOnDestroy(): void;
235
+ selectPanel(): d3.Selection<d3.BaseType, unknown, null, unknown>;
236
+ private updateCanvas;
237
+ validate(): void;
238
+ showError(error: DiagramError): void;
239
+ static ɵfac: i0.ɵɵFactoryDeclaration<ErrorsComponent, never>;
240
+ static ɵcmp: i0.ɵɵComponentDeclaration<ErrorsComponent, "daga-errors", never, {}, {}, never, never, true, never>;
241
+ }
242
+
243
+ /**
244
+ * Editor of a value set within a property editor.
245
+ * @private
246
+ * @see PropertyEditor
247
+ * @see ValueSet
248
+ */
249
+ declare class ObjectEditorComponent {
250
+ #private;
251
+ get canvas(): Canvas;
252
+ get userCanEdit(): boolean;
253
+ _valueSet?: ValueSet;
254
+ get valueSet(): ValueSet | undefined;
255
+ set valueSet(valueSet: ValueSet | undefined);
256
+ /** How many object-editor elements are parents of this object-editor element. @private */
257
+ depth: number;
258
+ Type: typeof Type;
259
+ getStyleClassName: (s: string) => string;
260
+ setValue(property: Property, value: unknown): void;
261
+ dateToLocalDatetimeString(date: string | number | Date | null | undefined): string;
262
+ localDatetimeStringToDate(string: string): Date;
263
+ static ɵfac: i0.ɵɵFactoryDeclaration<ObjectEditorComponent, never>;
264
+ static ɵcmp: i0.ɵɵComponentDeclaration<ObjectEditorComponent, "daga-object-editor", never, { "valueSet": { "alias": "valueSet"; "required": false; }; "depth": { "alias": "depth"; "required": false; }; }, {}, never, never, true, never>;
265
+ }
266
+
267
+ /**
268
+ * Editor of a property of text list type within a property editor.
269
+ * @private
270
+ * @see Type.TextList
271
+ * @see PropertyEditor
272
+ * @see ValueSet
273
+ */
274
+ declare class TextListEditorComponent {
275
+ #private;
276
+ private _value;
277
+ set value(value: string[]);
278
+ get value(): string[];
279
+ valueInput: string;
280
+ allowRepeats: boolean;
281
+ disabled: boolean;
282
+ valueChange: EventEmitter<string[]>;
283
+ getValueFromEvent(event: Event): string;
284
+ hasValue(value: string): boolean;
285
+ removeFromValue(index: number): void;
286
+ editFromValue(item: string, index: number): void;
287
+ addToValue(): void;
288
+ clearInput(): void;
289
+ onKeyUp(event: KeyboardEvent): void;
290
+ static ɵfac: i0.ɵɵFactoryDeclaration<TextListEditorComponent, never>;
291
+ static ɵcmp: i0.ɵɵComponentDeclaration<TextListEditorComponent, "daga-text-list-editor", never, { "value": { "alias": "value"; "required": false; }; "valueInput": { "alias": "valueInput"; "required": false; }; "allowRepeats": { "alias": "allowRepeats"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
292
+ }
293
+
294
+ /**
295
+ * Editor of a property of text map type within a property editor.
296
+ * @private
297
+ * @see Type.TextMap
298
+ * @see PropertyEditor
299
+ * @see ValueSet
300
+ */
301
+ declare class TextMapEditorComponent {
302
+ #private;
303
+ private _value;
304
+ set value(value: {
305
+ [name: string]: string;
306
+ });
307
+ get value(): {
308
+ [name: string]: string;
309
+ };
310
+ keyInput: string;
311
+ valueInput: string;
312
+ disabled: boolean;
313
+ valueChange: EventEmitter<{
314
+ [name: string]: string;
315
+ }>;
316
+ getValueFromEvent(event: Event): string;
317
+ removeFromValue(key: string): void;
318
+ editKey(oldKey: string, newKey: string): void;
319
+ editValue(key: string, value: string): void;
320
+ addToValue(): void;
321
+ clearKeyInput(): void;
322
+ clearValueInput(): void;
323
+ onKeyUp(event: KeyboardEvent): void;
324
+ static ɵfac: i0.ɵɵFactoryDeclaration<TextMapEditorComponent, never>;
325
+ static ɵcmp: i0.ɵɵComponentDeclaration<TextMapEditorComponent, "daga-text-map-editor", never, { "value": { "alias": "value"; "required": false; }; "keyInput": { "alias": "keyInput"; "required": false; }; "valueInput": { "alias": "valueInput"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
326
+ }
327
+
328
+ declare class DagaModule {
329
+ static ɵfac: i0.ɵɵFactoryDeclaration<DagaModule, never>;
330
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DagaModule, never, [typeof CollapseButtonComponent, typeof DiagramButtonsComponent, typeof DiagramComponent, typeof ErrorsComponent, typeof ObjectEditorComponent, typeof PaletteComponent, typeof TextListEditorComponent, typeof TextMapEditorComponent, typeof PropertyEditorComponent, typeof i10.CommonModule, typeof i11.FormsModule], [typeof DiagramComponent]>;
331
+ static ɵinj: i0.ɵɵInjectorDeclaration<DagaModule>;
332
+ }
333
+
334
+ /**
335
+ * A provider for the {@link Canvas} associated with a {@link DiagramComponent} context.
336
+ * @public
337
+ */
338
+ declare class CanvasProviderService {
339
+ private _canvas;
340
+ private canvasSubject$;
341
+ /**
342
+ * Subject used to track when the canvas has been updated.
343
+ * @public
344
+ */
345
+ canvas$: rxjs.Observable<Canvas>;
346
+ private viewInitializedSubject$;
347
+ /**
348
+ * Subject used to track when the view of the canvas has been updated after updating the canvas.
349
+ * @public
350
+ */
351
+ viewInitialized$: rxjs.Observable<Canvas>;
352
+ /**
353
+ * Initialize the diagram canvas object of this context using the given diagram configuration.
354
+ * @private
355
+ * @param parentComponent A diagram editor.
356
+ * @param config A diagram configuration.
357
+ */
358
+ initCanvas(parentComponent: DiagramEditor, config: DiagramConfig): void;
359
+ /**
360
+ * Attach the canvas of this context to an HTML element to render it there.
361
+ * @private
362
+ * @param appendTo An HTML element.
363
+ */
364
+ initCanvasView(appendTo: HTMLElement): void;
365
+ /**
366
+ * Get the current canvas of this context.
367
+ * @public
368
+ * @returns A canvas.
369
+ */
370
+ getCanvas(): Canvas;
371
+ static ɵfac: i0.ɵɵFactoryDeclaration<CanvasProviderService, never>;
372
+ static ɵprov: i0.ɵɵInjectableDeclaration<CanvasProviderService>;
373
+ }
374
+
375
+ /**
376
+ * A provider for the {@link DiagramConfig} associated with a {@link DiagramComponent} context.
377
+ * @public
378
+ */
379
+ declare class DagaConfigurationService {
380
+ private _config;
381
+ private configSubject$;
382
+ /**
383
+ * Subject used to track when the diagram configuration has been updated.
384
+ * @public
385
+ */
386
+ config$: rxjs.Observable<DiagramConfig>;
387
+ /**
388
+ * Set the diagram configuration of this context.
389
+ * @private
390
+ * @param config A diagram configuration.
391
+ */
392
+ init(config: DiagramConfig): void;
393
+ /**
394
+ * Get the current diagram configuration of this context.
395
+ * @public
396
+ * @returns A diagram configuration.
397
+ */
398
+ getConfig(): DiagramConfig;
399
+ static ɵfac: i0.ɵɵFactoryDeclaration<DagaConfigurationService, never>;
400
+ static ɵprov: i0.ɵɵInjectableDeclaration<DagaConfigurationService>;
401
+ }
402
+
403
+ export { CanvasProviderService, CollapseButtonComponent, DagaConfigurationService, DagaModule, DiagramButtonsComponent, DiagramComponent, ErrorsComponent, ObjectEditorComponent, PaletteComponent, PropertyEditorComponent, TextListEditorComponent, TextMapEditorComponent };