@metadev/daga 4.2.8 → 4.2.9
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/Changelog.md +6 -0
- package/index.cjs.js +159 -67
- package/index.esm.js +159 -67
- package/package.json +1 -1
- package/src/lib/diagram/canvas/diagram-user-selection.d.ts +4 -3
- package/src/lib/diagram/config/diagram-components-config.d.ts +5 -0
- package/src/lib/diagram/model/diagram-connection.d.ts +36 -3
- package/src/lib/diagram/model/diagram-node.d.ts +12 -1
- package/src/lib/diagram/model/diagram-port.d.ts +12 -1
- package/src/lib/diagram/model/diagram-section.d.ts +12 -1
package/Changelog.md
CHANGED
|
@@ -6,6 +6,12 @@ List of releases and changes.
|
|
|
6
6
|
|
|
7
7
|
## Next release Joyeuse
|
|
8
8
|
|
|
9
|
+
## v. 4.2.9
|
|
10
|
+
|
|
11
|
+
- Enable configuring the text heading the diagram properties component to values other than `'Diagram properties'` [#341](https://github.com/metadevpro/daga/pull/341)
|
|
12
|
+
- Enable opening diagram properties in property editor even without involving a deselection [#342](https://github.com/metadevpro/daga/pull/342)
|
|
13
|
+
- Enable binding properties of diagram elements to the element's `lookConfig` when applicable [#343](https://github.com/metadevpro/daga/pull/343)
|
|
14
|
+
|
|
9
15
|
## v. 4.2.8
|
|
10
16
|
|
|
11
17
|
- Add a snap to grid offset to node types [#337](https://github.com/metadevpro/daga/pull/337)
|
package/index.cjs.js
CHANGED
|
@@ -2248,23 +2248,38 @@ class DiagramConnection extends DiagramElement {
|
|
|
2248
2248
|
}
|
|
2249
2249
|
}
|
|
2250
2250
|
}
|
|
2251
|
+
/**
|
|
2252
|
+
* An alias for the `lookConfig` attribute.
|
|
2253
|
+
* @private
|
|
2254
|
+
*/
|
|
2255
|
+
set look(look) {
|
|
2256
|
+
this.lookConfig = look;
|
|
2257
|
+
}
|
|
2258
|
+
/**
|
|
2259
|
+
* Look configuration used to derive the current look of this connection.
|
|
2260
|
+
* @private
|
|
2261
|
+
*/
|
|
2262
|
+
get lookConfig() {
|
|
2263
|
+
return this._lookConfig;
|
|
2264
|
+
}
|
|
2251
2265
|
/**
|
|
2252
2266
|
* Sets the look configuration of the connection to override the one determined by the type.
|
|
2253
2267
|
* `undefined` resets it to the one determined by the type.
|
|
2254
2268
|
* @private
|
|
2255
2269
|
*/
|
|
2256
|
-
set
|
|
2257
|
-
|
|
2258
|
-
|
|
2270
|
+
set lookConfig(lookConfig) {
|
|
2271
|
+
this._lookConfig = lookConfig;
|
|
2272
|
+
if (lookConfig) {
|
|
2273
|
+
const looks = extractLooksFromConfig(lookConfig);
|
|
2259
2274
|
this._defaultLook = Object.assign(Object.assign({}, this._defaultLook), looks.defaultLook);
|
|
2260
2275
|
this._selectedLook = Object.assign(Object.assign({}, this._selectedLook), looks.selectedLook);
|
|
2261
2276
|
this._highlightedLook = Object.assign(Object.assign({}, this._highlightedLook), looks.highlightedLook);
|
|
2262
2277
|
this._selectedAndHighlightedLook = Object.assign(Object.assign({}, this._selectedAndHighlightedLook), looks.selectedAndHighlightedLook);
|
|
2263
2278
|
} else {
|
|
2264
|
-
this._defaultLook =
|
|
2265
|
-
this._selectedLook =
|
|
2266
|
-
this._highlightedLook =
|
|
2267
|
-
this._selectedAndHighlightedLook =
|
|
2279
|
+
this._defaultLook = lookConfig;
|
|
2280
|
+
this._selectedLook = lookConfig;
|
|
2281
|
+
this._highlightedLook = lookConfig;
|
|
2282
|
+
this._selectedAndHighlightedLook = lookConfig;
|
|
2268
2283
|
}
|
|
2269
2284
|
}
|
|
2270
2285
|
/**
|
|
@@ -2286,23 +2301,38 @@ class DiagramConnection extends DiagramElement {
|
|
|
2286
2301
|
}
|
|
2287
2302
|
}
|
|
2288
2303
|
}
|
|
2304
|
+
/**
|
|
2305
|
+
* An alias for the `lookConfig` attribute.
|
|
2306
|
+
* @private
|
|
2307
|
+
*/
|
|
2308
|
+
set startMarkerLook(startMarkerLook) {
|
|
2309
|
+
this.startMarkerLookConfig = startMarkerLook;
|
|
2310
|
+
}
|
|
2311
|
+
/**
|
|
2312
|
+
* Look configuration used to derive the current look of the start marker of this connection.
|
|
2313
|
+
* @private
|
|
2314
|
+
*/
|
|
2315
|
+
get startMarkerLookConfig() {
|
|
2316
|
+
return this._startMarkerLookConfig;
|
|
2317
|
+
}
|
|
2289
2318
|
/**
|
|
2290
2319
|
* Sets the look configuration of the start marker to override the one determined by the type.
|
|
2291
2320
|
* `null` stands for no marker and `undefined` resets it to the one determined by the type.
|
|
2292
2321
|
* @private
|
|
2293
2322
|
*/
|
|
2294
|
-
set
|
|
2295
|
-
|
|
2296
|
-
|
|
2323
|
+
set startMarkerLookConfig(startMarkerLookConfig) {
|
|
2324
|
+
this._startMarkerLookConfig = startMarkerLookConfig;
|
|
2325
|
+
if (startMarkerLookConfig) {
|
|
2326
|
+
const looks = extractLooksFromConfig(startMarkerLookConfig);
|
|
2297
2327
|
this._defaultStartMarkerLook = Object.assign(Object.assign({}, this._defaultStartMarkerLook), looks.defaultLook);
|
|
2298
2328
|
this._selectedStartMarkerLook = Object.assign(Object.assign({}, this._selectedStartMarkerLook), looks.selectedLook);
|
|
2299
2329
|
this._highlightedStartMarkerLook = Object.assign(Object.assign({}, this._highlightedStartMarkerLook), looks.highlightedLook);
|
|
2300
2330
|
this._selectedAndHighlightedStartMarkerLook = Object.assign(Object.assign({}, this._selectedAndHighlightedStartMarkerLook), looks.selectedAndHighlightedLook);
|
|
2301
2331
|
} else {
|
|
2302
|
-
this._defaultStartMarkerLook =
|
|
2303
|
-
this._selectedStartMarkerLook =
|
|
2304
|
-
this._highlightedStartMarkerLook =
|
|
2305
|
-
this._selectedAndHighlightedStartMarkerLook =
|
|
2332
|
+
this._defaultStartMarkerLook = startMarkerLookConfig;
|
|
2333
|
+
this._selectedStartMarkerLook = startMarkerLookConfig;
|
|
2334
|
+
this._highlightedStartMarkerLook = startMarkerLookConfig;
|
|
2335
|
+
this._selectedAndHighlightedStartMarkerLook = startMarkerLookConfig;
|
|
2306
2336
|
}
|
|
2307
2337
|
}
|
|
2308
2338
|
/**
|
|
@@ -2324,23 +2354,38 @@ class DiagramConnection extends DiagramElement {
|
|
|
2324
2354
|
}
|
|
2325
2355
|
}
|
|
2326
2356
|
}
|
|
2357
|
+
/**
|
|
2358
|
+
* An alias for the `lookConfig` attribute.
|
|
2359
|
+
* @private
|
|
2360
|
+
*/
|
|
2361
|
+
set endMarkerLook(endMarkerLook) {
|
|
2362
|
+
this.endMarkerLookConfig = endMarkerLook;
|
|
2363
|
+
}
|
|
2364
|
+
/**
|
|
2365
|
+
* Look configuration used to derive the current look of the end marker of this connection.
|
|
2366
|
+
* @private
|
|
2367
|
+
*/
|
|
2368
|
+
get endMarkerLookConfig() {
|
|
2369
|
+
return this._endMarkerLookConfig;
|
|
2370
|
+
}
|
|
2327
2371
|
/**
|
|
2328
2372
|
* Sets the look configuration of the end marker to override the one determined by the type.
|
|
2329
2373
|
* `null` stands for no marker and `undefined` resets it to the one determined by the type.
|
|
2330
2374
|
* @private
|
|
2331
2375
|
*/
|
|
2332
|
-
set
|
|
2333
|
-
|
|
2334
|
-
|
|
2376
|
+
set endMarkerLookConfig(endMarkerLookConfig) {
|
|
2377
|
+
this._endMarkerLookConfig = endMarkerLookConfig;
|
|
2378
|
+
if (endMarkerLookConfig) {
|
|
2379
|
+
const looks = extractLooksFromConfig(endMarkerLookConfig);
|
|
2335
2380
|
this._defaultEndMarkerLook = Object.assign(Object.assign({}, this._defaultEndMarkerLook), looks.defaultLook);
|
|
2336
2381
|
this._selectedEndMarkerLook = Object.assign(Object.assign({}, this._selectedEndMarkerLook), looks.selectedLook);
|
|
2337
2382
|
this._highlightedEndMarkerLook = Object.assign(Object.assign({}, this._highlightedEndMarkerLook), looks.highlightedLook);
|
|
2338
2383
|
this._selectedAndHighlightedEndMarkerLook = Object.assign(Object.assign({}, this._selectedAndHighlightedEndMarkerLook), looks.selectedAndHighlightedLook);
|
|
2339
2384
|
} else {
|
|
2340
|
-
this._defaultEndMarkerLook =
|
|
2341
|
-
this._selectedEndMarkerLook =
|
|
2342
|
-
this._highlightedEndMarkerLook =
|
|
2343
|
-
this._selectedAndHighlightedEndMarkerLook =
|
|
2385
|
+
this._defaultEndMarkerLook = endMarkerLookConfig;
|
|
2386
|
+
this._selectedEndMarkerLook = endMarkerLookConfig;
|
|
2387
|
+
this._highlightedEndMarkerLook = endMarkerLookConfig;
|
|
2388
|
+
this._selectedAndHighlightedEndMarkerLook = endMarkerLookConfig;
|
|
2344
2389
|
}
|
|
2345
2390
|
}
|
|
2346
2391
|
constructor(model, type, start, end, id) {
|
|
@@ -3015,23 +3060,38 @@ class DiagramSection extends DiagramElement {
|
|
|
3015
3060
|
}
|
|
3016
3061
|
}
|
|
3017
3062
|
}
|
|
3063
|
+
/**
|
|
3064
|
+
* An alias for the `lookConfig` attribute.
|
|
3065
|
+
* @private
|
|
3066
|
+
*/
|
|
3067
|
+
set look(look) {
|
|
3068
|
+
this.lookConfig = look;
|
|
3069
|
+
}
|
|
3070
|
+
/**
|
|
3071
|
+
* Look configuration used to derive the current look of this section.
|
|
3072
|
+
* @private
|
|
3073
|
+
*/
|
|
3074
|
+
get lookConfig() {
|
|
3075
|
+
return this._lookConfig;
|
|
3076
|
+
}
|
|
3018
3077
|
/**
|
|
3019
3078
|
* Sets the look configuration of the look to override the one determined by the type.
|
|
3020
3079
|
* `undefined` resets it to the one determined by the type.
|
|
3021
3080
|
* @private
|
|
3022
3081
|
*/
|
|
3023
|
-
set
|
|
3024
|
-
|
|
3025
|
-
|
|
3082
|
+
set lookConfig(lookConfig) {
|
|
3083
|
+
this._lookConfig = lookConfig;
|
|
3084
|
+
if (lookConfig) {
|
|
3085
|
+
const looks = extractLooksFromConfig(lookConfig);
|
|
3026
3086
|
this._defaultLook = Object.assign(Object.assign({}, this._defaultLook), looks.defaultLook);
|
|
3027
3087
|
this._selectedLook = Object.assign(Object.assign({}, this._selectedLook), looks.selectedLook);
|
|
3028
3088
|
this._highlightedLook = Object.assign(Object.assign({}, this._highlightedLook), looks.highlightedLook);
|
|
3029
3089
|
this._selectedAndHighlightedLook = Object.assign(Object.assign({}, this._selectedAndHighlightedLook), looks.selectedAndHighlightedLook);
|
|
3030
3090
|
} else {
|
|
3031
|
-
this._defaultLook =
|
|
3032
|
-
this._selectedLook =
|
|
3033
|
-
this._highlightedLook =
|
|
3034
|
-
this._selectedAndHighlightedLook =
|
|
3091
|
+
this._defaultLook = lookConfig;
|
|
3092
|
+
this._selectedLook = lookConfig;
|
|
3093
|
+
this._highlightedLook = lookConfig;
|
|
3094
|
+
this._selectedAndHighlightedLook = lookConfig;
|
|
3035
3095
|
}
|
|
3036
3096
|
}
|
|
3037
3097
|
constructor(model, node, indexXInNode, indexYInNode, coords, width, height, id) {
|
|
@@ -3529,23 +3589,38 @@ class DiagramNode extends DiagramElement {
|
|
|
3529
3589
|
}
|
|
3530
3590
|
}
|
|
3531
3591
|
}
|
|
3592
|
+
/**
|
|
3593
|
+
* An alias for the `lookConfig` attribute.
|
|
3594
|
+
* @private
|
|
3595
|
+
*/
|
|
3596
|
+
set look(look) {
|
|
3597
|
+
this.lookConfig = look;
|
|
3598
|
+
}
|
|
3599
|
+
/**
|
|
3600
|
+
* Look configuration used to derive the current look of this node.
|
|
3601
|
+
* @private
|
|
3602
|
+
*/
|
|
3603
|
+
get lookConfig() {
|
|
3604
|
+
return this._lookConfig;
|
|
3605
|
+
}
|
|
3532
3606
|
/**
|
|
3533
3607
|
* Sets the look configuration of the look to override the one determined by the type.
|
|
3534
3608
|
* `undefined` resets it to the one determined by the type.
|
|
3535
3609
|
* @private
|
|
3536
3610
|
*/
|
|
3537
|
-
set
|
|
3538
|
-
|
|
3539
|
-
|
|
3611
|
+
set lookConfig(lookConfig) {
|
|
3612
|
+
this._lookConfig = lookConfig;
|
|
3613
|
+
if (lookConfig) {
|
|
3614
|
+
const looks = extractLooksFromConfig(lookConfig);
|
|
3540
3615
|
this._defaultLook = Object.assign(Object.assign({}, this._defaultLook), looks.defaultLook);
|
|
3541
3616
|
this._selectedLook = Object.assign(Object.assign({}, this._selectedLook), looks.selectedLook);
|
|
3542
3617
|
this._highlightedLook = Object.assign(Object.assign({}, this._highlightedLook), looks.highlightedLook);
|
|
3543
3618
|
this._selectedAndHighlightedLook = Object.assign(Object.assign({}, this._selectedAndHighlightedLook), looks.selectedAndHighlightedLook);
|
|
3544
3619
|
} else {
|
|
3545
|
-
this._defaultLook =
|
|
3546
|
-
this._selectedLook =
|
|
3547
|
-
this._highlightedLook =
|
|
3548
|
-
this._selectedAndHighlightedLook =
|
|
3620
|
+
this._defaultLook = lookConfig;
|
|
3621
|
+
this._selectedLook = lookConfig;
|
|
3622
|
+
this._highlightedLook = lookConfig;
|
|
3623
|
+
this._selectedAndHighlightedLook = lookConfig;
|
|
3549
3624
|
}
|
|
3550
3625
|
}
|
|
3551
3626
|
constructor(model, type, coords = [0, 0], id) {
|
|
@@ -4557,23 +4632,38 @@ class DiagramPort extends DiagramElement {
|
|
|
4557
4632
|
}
|
|
4558
4633
|
}
|
|
4559
4634
|
}
|
|
4635
|
+
/**
|
|
4636
|
+
* An alias for the `lookConfig` attribute.
|
|
4637
|
+
* @private
|
|
4638
|
+
*/
|
|
4639
|
+
set look(look) {
|
|
4640
|
+
this.lookConfig = look;
|
|
4641
|
+
}
|
|
4642
|
+
/**
|
|
4643
|
+
* Look configuration used to derive the current look of this port.
|
|
4644
|
+
* @private
|
|
4645
|
+
*/
|
|
4646
|
+
get lookConfig() {
|
|
4647
|
+
return this._lookConfig;
|
|
4648
|
+
}
|
|
4560
4649
|
/**
|
|
4561
4650
|
* Sets the look configuration of the look to override the one determined by the type.
|
|
4562
4651
|
* `undefined` resets it to the one determined by the type.
|
|
4563
4652
|
* @private
|
|
4564
4653
|
*/
|
|
4565
|
-
set
|
|
4566
|
-
|
|
4567
|
-
|
|
4654
|
+
set lookConfig(lookConfig) {
|
|
4655
|
+
this._lookConfig = lookConfig;
|
|
4656
|
+
if (lookConfig) {
|
|
4657
|
+
const looks = extractLooksFromConfig(lookConfig);
|
|
4568
4658
|
this._defaultLook = Object.assign(Object.assign({}, this._defaultLook), looks.defaultLook);
|
|
4569
4659
|
this._selectedLook = Object.assign(Object.assign({}, this._selectedLook), looks.selectedLook);
|
|
4570
4660
|
this._highlightedLook = Object.assign(Object.assign({}, this._highlightedLook), looks.highlightedLook);
|
|
4571
4661
|
this._selectedAndHighlightedLook = Object.assign(Object.assign({}, this._selectedAndHighlightedLook), looks.selectedAndHighlightedLook);
|
|
4572
4662
|
} else {
|
|
4573
|
-
this._defaultLook =
|
|
4574
|
-
this._selectedLook =
|
|
4575
|
-
this._highlightedLook =
|
|
4576
|
-
this._selectedAndHighlightedLook =
|
|
4663
|
+
this._defaultLook = lookConfig;
|
|
4664
|
+
this._selectedLook = lookConfig;
|
|
4665
|
+
this._highlightedLook = lookConfig;
|
|
4666
|
+
this._selectedAndHighlightedLook = lookConfig;
|
|
4577
4667
|
}
|
|
4578
4668
|
}
|
|
4579
4669
|
/**
|
|
@@ -7015,12 +7105,12 @@ class DagaExporter {
|
|
|
7015
7105
|
}
|
|
7016
7106
|
|
|
7017
7107
|
/**
|
|
7018
|
-
* Text to display as the title of the property editor when editing the properties of a diagram's value set.
|
|
7108
|
+
* Text to display by default as the title of the property editor when editing the properties of a diagram's value set.
|
|
7019
7109
|
* @private
|
|
7020
7110
|
* @see PropertyEditorComponent
|
|
7021
7111
|
* @see ValueSet
|
|
7022
7112
|
*/
|
|
7023
|
-
const
|
|
7113
|
+
const DIAGRAM_PROPERTIES_DEFAULT_TEXT = 'Diagram properties';
|
|
7024
7114
|
/**
|
|
7025
7115
|
* Stores the functionality regarding the user highlight of a diagram canvas.
|
|
7026
7116
|
* @public
|
|
@@ -7032,12 +7122,14 @@ class DiagramUserSelection extends DiagramElementSet {
|
|
|
7032
7122
|
* @public
|
|
7033
7123
|
* @param canvas A canvas.
|
|
7034
7124
|
*/
|
|
7035
|
-
constructor(canvas) {
|
|
7125
|
+
constructor(canvas, diagramPropertiesText) {
|
|
7036
7126
|
super();
|
|
7037
7127
|
this.canvas = canvas;
|
|
7038
7128
|
this.canvas.propertyEditorChanges$.pipe(rxjs.debounceTime(2000)).subscribe(() => {
|
|
7039
7129
|
this.makeUpdateValuesAction();
|
|
7040
7130
|
});
|
|
7131
|
+
console.log(diagramPropertiesText);
|
|
7132
|
+
this.diagramPropertiesText = diagramPropertiesText !== undefined ? diagramPropertiesText : DIAGRAM_PROPERTIES_DEFAULT_TEXT;
|
|
7041
7133
|
}
|
|
7042
7134
|
add(element) {
|
|
7043
7135
|
if (this.contains(element.id)) {
|
|
@@ -7232,7 +7324,7 @@ class DiagramUserSelection extends DiagramElementSet {
|
|
|
7232
7324
|
propertyEditor.valueSet = undefined;
|
|
7233
7325
|
propertyEditor.valueSet = selectedValueSet;
|
|
7234
7326
|
} else {
|
|
7235
|
-
propertyEditor.title =
|
|
7327
|
+
propertyEditor.title = this.diagramPropertiesText;
|
|
7236
7328
|
// force the update of the valueSet
|
|
7237
7329
|
propertyEditor.valueSet = undefined;
|
|
7238
7330
|
propertyEditor.valueSet = selectedValueSet;
|
|
@@ -7322,7 +7414,7 @@ class DiagramCanvas {
|
|
|
7322
7414
|
* @param config The configuration object used to set the parameters of this canvas.
|
|
7323
7415
|
*/
|
|
7324
7416
|
constructor(parentComponent, config) {
|
|
7325
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
|
|
7417
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
|
|
7326
7418
|
this.backgroundPatternId = `daga-background-pattern-id-${DiagramCanvas.canvasCount++}`;
|
|
7327
7419
|
this.zoomTransform = d3__namespace.zoomIdentity;
|
|
7328
7420
|
// used to distinguish drags from clicks when dragging elements and during multiple selection
|
|
@@ -7337,25 +7429,25 @@ class DiagramCanvas {
|
|
|
7337
7429
|
this.propertyEditorChanges$ = new rxjs.Subject();
|
|
7338
7430
|
this.parentComponent = parentComponent;
|
|
7339
7431
|
this.model = new DiagramModel(this, undefined, config.name || 'unnamed', '', config.type || '', config.properties || []);
|
|
7340
|
-
this.userSelection = new DiagramUserSelection(this);
|
|
7341
|
-
this.userHighlight = new DiagramUserHighlight(this, ((
|
|
7342
|
-
this.contextMenu = new DiagramContextMenu(this, (
|
|
7343
|
-
this.backgroundColor = ((
|
|
7344
|
-
this.gridStyle = (
|
|
7345
|
-
this.gridSize = ((
|
|
7346
|
-
this.gridThickness = Math.abs(((
|
|
7347
|
-
this.gridColor = ((
|
|
7348
|
-
this.snapToGrid = ((
|
|
7349
|
-
this.zoomFactor = ((
|
|
7350
|
-
this.panRate = ((
|
|
7351
|
-
this.inferConnectionType = ((
|
|
7352
|
-
this.autoTightenConnections = ((
|
|
7353
|
-
this.allowConnectionLoops = ((
|
|
7354
|
-
this.allowSharingPorts = ((
|
|
7355
|
-
this.allowSharingBothPorts = ((
|
|
7356
|
-
this.portHighlightRadius = ((
|
|
7432
|
+
this.userSelection = new DiagramUserSelection(this, (_b = (_a = config.components) === null || _a === void 0 ? void 0 : _a.propertyEditor) === null || _b === void 0 ? void 0 : _b.title);
|
|
7433
|
+
this.userHighlight = new DiagramUserHighlight(this, ((_c = config.canvas) === null || _c === void 0 ? void 0 : _c.highlightSections) !== false);
|
|
7434
|
+
this.contextMenu = new DiagramContextMenu(this, (_d = config.canvas) === null || _d === void 0 ? void 0 : _d.contextMenu);
|
|
7435
|
+
this.backgroundColor = ((_e = config.canvas) === null || _e === void 0 ? void 0 : _e.backgroundColor) || '#FFFFFF';
|
|
7436
|
+
this.gridStyle = (_h = (_g = (_f = config.canvas) === null || _f === void 0 ? void 0 : _f.grid) === null || _g === void 0 ? void 0 : _g.style) !== null && _h !== void 0 ? _h : GRID_DEFAULTS.style;
|
|
7437
|
+
this.gridSize = ((_k = (_j = config.canvas) === null || _j === void 0 ? void 0 : _j.grid) === null || _k === void 0 ? void 0 : _k.enabled) === false || ((_l = config.canvas) === null || _l === void 0 ? void 0 : _l.grid) === undefined ? 0 : Math.abs(((_o = (_m = config.canvas) === null || _m === void 0 ? void 0 : _m.grid) === null || _o === void 0 ? void 0 : _o.spacing) || GRID_DEFAULTS.spacing);
|
|
7438
|
+
this.gridThickness = Math.abs(((_q = (_p = config.canvas) === null || _p === void 0 ? void 0 : _p.grid) === null || _q === void 0 ? void 0 : _q.thickness) || GRID_DEFAULTS.thickness);
|
|
7439
|
+
this.gridColor = ((_s = (_r = config.canvas) === null || _r === void 0 ? void 0 : _r.grid) === null || _s === void 0 ? void 0 : _s.color) || GRID_DEFAULTS.color;
|
|
7440
|
+
this.snapToGrid = ((_u = (_t = config.canvas) === null || _t === void 0 ? void 0 : _t.grid) === null || _u === void 0 ? void 0 : _u.enabled) === false || ((_v = config.canvas) === null || _v === void 0 ? void 0 : _v.grid) === undefined ? false : ((_x = (_w = config.canvas) === null || _w === void 0 ? void 0 : _w.grid) === null || _x === void 0 ? void 0 : _x.snap) || GRID_DEFAULTS.snap;
|
|
7441
|
+
this.zoomFactor = ((_y = config.canvas) === null || _y === void 0 ? void 0 : _y.zoomFactor) || 2;
|
|
7442
|
+
this.panRate = ((_z = config.canvas) === null || _z === void 0 ? void 0 : _z.panRate) || 100;
|
|
7443
|
+
this.inferConnectionType = ((_0 = config.connectionSettings) === null || _0 === void 0 ? void 0 : _0.inferConnectionType) || false;
|
|
7444
|
+
this.autoTightenConnections = ((_1 = config.connectionSettings) === null || _1 === void 0 ? void 0 : _1.autoTighten) !== false;
|
|
7445
|
+
this.allowConnectionLoops = ((_2 = config.connectionSettings) === null || _2 === void 0 ? void 0 : _2.allowLoops) || false;
|
|
7446
|
+
this.allowSharingPorts = ((_3 = config.connectionSettings) === null || _3 === void 0 ? void 0 : _3.sharePorts) !== false;
|
|
7447
|
+
this.allowSharingBothPorts = ((_4 = config.connectionSettings) === null || _4 === void 0 ? void 0 : _4.shareBothPorts) || false;
|
|
7448
|
+
this.portHighlightRadius = ((_5 = config.connectionSettings) === null || _5 === void 0 ? void 0 : _5.portHighlightRadius) || 100;
|
|
7357
7449
|
this.multipleSelectionOn = false;
|
|
7358
|
-
this.priorityThresholds = ((
|
|
7450
|
+
this.priorityThresholds = ((_6 = config.canvas) === null || _6 === void 0 ? void 0 : _6.priorityThresholds) || [];
|
|
7359
7451
|
this.priorityThreshold = this.priorityThresholds ? this.priorityThresholds[0] : undefined;
|
|
7360
7452
|
this.layoutFormat = config.layoutFormat;
|
|
7361
7453
|
this.userActions = config.userActions || {};
|
|
@@ -7382,7 +7474,7 @@ class DiagramCanvas {
|
|
|
7382
7474
|
const connectionType = new DiagramConnectionType(Object.assign(Object.assign({}, config.connectionTypeDefaults), connectionTypeConfig));
|
|
7383
7475
|
this.model.connections.types.add(connectionType);
|
|
7384
7476
|
}
|
|
7385
|
-
this._connectionType = ((
|
|
7477
|
+
this._connectionType = ((_7 = config === null || config === void 0 ? void 0 : config.connectionSettings) === null || _7 === void 0 ? void 0 : _7.defaultConnection) !== undefined ? this.model.connections.types.get(config.connectionSettings.defaultConnection) : undefined;
|
|
7386
7478
|
}
|
|
7387
7479
|
}
|
|
7388
7480
|
addValidator(validator) {
|
|
@@ -7609,8 +7701,8 @@ class DiagramCanvas {
|
|
|
7609
7701
|
const deselectedElements = this.userSelection.all();
|
|
7610
7702
|
this.userSelection.clear();
|
|
7611
7703
|
this.diagramEvent$.next(new DiagramSelectionEvent(deselectedElements, false));
|
|
7612
|
-
this.userSelection.openInPropertyEditor(this.model);
|
|
7613
7704
|
}
|
|
7705
|
+
this.userSelection.openInPropertyEditor(this.model);
|
|
7614
7706
|
}).call(d3__namespace.drag().filter(event => {
|
|
7615
7707
|
return this.multipleSelectionOn || isSecondaryButton(event);
|
|
7616
7708
|
}).on(exports.DragEvents.Start, event => {
|
package/index.esm.js
CHANGED
|
@@ -2227,23 +2227,38 @@ class DiagramConnection extends DiagramElement {
|
|
|
2227
2227
|
}
|
|
2228
2228
|
}
|
|
2229
2229
|
}
|
|
2230
|
+
/**
|
|
2231
|
+
* An alias for the `lookConfig` attribute.
|
|
2232
|
+
* @private
|
|
2233
|
+
*/
|
|
2234
|
+
set look(look) {
|
|
2235
|
+
this.lookConfig = look;
|
|
2236
|
+
}
|
|
2237
|
+
/**
|
|
2238
|
+
* Look configuration used to derive the current look of this connection.
|
|
2239
|
+
* @private
|
|
2240
|
+
*/
|
|
2241
|
+
get lookConfig() {
|
|
2242
|
+
return this._lookConfig;
|
|
2243
|
+
}
|
|
2230
2244
|
/**
|
|
2231
2245
|
* Sets the look configuration of the connection to override the one determined by the type.
|
|
2232
2246
|
* `undefined` resets it to the one determined by the type.
|
|
2233
2247
|
* @private
|
|
2234
2248
|
*/
|
|
2235
|
-
set
|
|
2236
|
-
|
|
2237
|
-
|
|
2249
|
+
set lookConfig(lookConfig) {
|
|
2250
|
+
this._lookConfig = lookConfig;
|
|
2251
|
+
if (lookConfig) {
|
|
2252
|
+
const looks = extractLooksFromConfig(lookConfig);
|
|
2238
2253
|
this._defaultLook = Object.assign(Object.assign({}, this._defaultLook), looks.defaultLook);
|
|
2239
2254
|
this._selectedLook = Object.assign(Object.assign({}, this._selectedLook), looks.selectedLook);
|
|
2240
2255
|
this._highlightedLook = Object.assign(Object.assign({}, this._highlightedLook), looks.highlightedLook);
|
|
2241
2256
|
this._selectedAndHighlightedLook = Object.assign(Object.assign({}, this._selectedAndHighlightedLook), looks.selectedAndHighlightedLook);
|
|
2242
2257
|
} else {
|
|
2243
|
-
this._defaultLook =
|
|
2244
|
-
this._selectedLook =
|
|
2245
|
-
this._highlightedLook =
|
|
2246
|
-
this._selectedAndHighlightedLook =
|
|
2258
|
+
this._defaultLook = lookConfig;
|
|
2259
|
+
this._selectedLook = lookConfig;
|
|
2260
|
+
this._highlightedLook = lookConfig;
|
|
2261
|
+
this._selectedAndHighlightedLook = lookConfig;
|
|
2247
2262
|
}
|
|
2248
2263
|
}
|
|
2249
2264
|
/**
|
|
@@ -2265,23 +2280,38 @@ class DiagramConnection extends DiagramElement {
|
|
|
2265
2280
|
}
|
|
2266
2281
|
}
|
|
2267
2282
|
}
|
|
2283
|
+
/**
|
|
2284
|
+
* An alias for the `lookConfig` attribute.
|
|
2285
|
+
* @private
|
|
2286
|
+
*/
|
|
2287
|
+
set startMarkerLook(startMarkerLook) {
|
|
2288
|
+
this.startMarkerLookConfig = startMarkerLook;
|
|
2289
|
+
}
|
|
2290
|
+
/**
|
|
2291
|
+
* Look configuration used to derive the current look of the start marker of this connection.
|
|
2292
|
+
* @private
|
|
2293
|
+
*/
|
|
2294
|
+
get startMarkerLookConfig() {
|
|
2295
|
+
return this._startMarkerLookConfig;
|
|
2296
|
+
}
|
|
2268
2297
|
/**
|
|
2269
2298
|
* Sets the look configuration of the start marker to override the one determined by the type.
|
|
2270
2299
|
* `null` stands for no marker and `undefined` resets it to the one determined by the type.
|
|
2271
2300
|
* @private
|
|
2272
2301
|
*/
|
|
2273
|
-
set
|
|
2274
|
-
|
|
2275
|
-
|
|
2302
|
+
set startMarkerLookConfig(startMarkerLookConfig) {
|
|
2303
|
+
this._startMarkerLookConfig = startMarkerLookConfig;
|
|
2304
|
+
if (startMarkerLookConfig) {
|
|
2305
|
+
const looks = extractLooksFromConfig(startMarkerLookConfig);
|
|
2276
2306
|
this._defaultStartMarkerLook = Object.assign(Object.assign({}, this._defaultStartMarkerLook), looks.defaultLook);
|
|
2277
2307
|
this._selectedStartMarkerLook = Object.assign(Object.assign({}, this._selectedStartMarkerLook), looks.selectedLook);
|
|
2278
2308
|
this._highlightedStartMarkerLook = Object.assign(Object.assign({}, this._highlightedStartMarkerLook), looks.highlightedLook);
|
|
2279
2309
|
this._selectedAndHighlightedStartMarkerLook = Object.assign(Object.assign({}, this._selectedAndHighlightedStartMarkerLook), looks.selectedAndHighlightedLook);
|
|
2280
2310
|
} else {
|
|
2281
|
-
this._defaultStartMarkerLook =
|
|
2282
|
-
this._selectedStartMarkerLook =
|
|
2283
|
-
this._highlightedStartMarkerLook =
|
|
2284
|
-
this._selectedAndHighlightedStartMarkerLook =
|
|
2311
|
+
this._defaultStartMarkerLook = startMarkerLookConfig;
|
|
2312
|
+
this._selectedStartMarkerLook = startMarkerLookConfig;
|
|
2313
|
+
this._highlightedStartMarkerLook = startMarkerLookConfig;
|
|
2314
|
+
this._selectedAndHighlightedStartMarkerLook = startMarkerLookConfig;
|
|
2285
2315
|
}
|
|
2286
2316
|
}
|
|
2287
2317
|
/**
|
|
@@ -2303,23 +2333,38 @@ class DiagramConnection extends DiagramElement {
|
|
|
2303
2333
|
}
|
|
2304
2334
|
}
|
|
2305
2335
|
}
|
|
2336
|
+
/**
|
|
2337
|
+
* An alias for the `lookConfig` attribute.
|
|
2338
|
+
* @private
|
|
2339
|
+
*/
|
|
2340
|
+
set endMarkerLook(endMarkerLook) {
|
|
2341
|
+
this.endMarkerLookConfig = endMarkerLook;
|
|
2342
|
+
}
|
|
2343
|
+
/**
|
|
2344
|
+
* Look configuration used to derive the current look of the end marker of this connection.
|
|
2345
|
+
* @private
|
|
2346
|
+
*/
|
|
2347
|
+
get endMarkerLookConfig() {
|
|
2348
|
+
return this._endMarkerLookConfig;
|
|
2349
|
+
}
|
|
2306
2350
|
/**
|
|
2307
2351
|
* Sets the look configuration of the end marker to override the one determined by the type.
|
|
2308
2352
|
* `null` stands for no marker and `undefined` resets it to the one determined by the type.
|
|
2309
2353
|
* @private
|
|
2310
2354
|
*/
|
|
2311
|
-
set
|
|
2312
|
-
|
|
2313
|
-
|
|
2355
|
+
set endMarkerLookConfig(endMarkerLookConfig) {
|
|
2356
|
+
this._endMarkerLookConfig = endMarkerLookConfig;
|
|
2357
|
+
if (endMarkerLookConfig) {
|
|
2358
|
+
const looks = extractLooksFromConfig(endMarkerLookConfig);
|
|
2314
2359
|
this._defaultEndMarkerLook = Object.assign(Object.assign({}, this._defaultEndMarkerLook), looks.defaultLook);
|
|
2315
2360
|
this._selectedEndMarkerLook = Object.assign(Object.assign({}, this._selectedEndMarkerLook), looks.selectedLook);
|
|
2316
2361
|
this._highlightedEndMarkerLook = Object.assign(Object.assign({}, this._highlightedEndMarkerLook), looks.highlightedLook);
|
|
2317
2362
|
this._selectedAndHighlightedEndMarkerLook = Object.assign(Object.assign({}, this._selectedAndHighlightedEndMarkerLook), looks.selectedAndHighlightedLook);
|
|
2318
2363
|
} else {
|
|
2319
|
-
this._defaultEndMarkerLook =
|
|
2320
|
-
this._selectedEndMarkerLook =
|
|
2321
|
-
this._highlightedEndMarkerLook =
|
|
2322
|
-
this._selectedAndHighlightedEndMarkerLook =
|
|
2364
|
+
this._defaultEndMarkerLook = endMarkerLookConfig;
|
|
2365
|
+
this._selectedEndMarkerLook = endMarkerLookConfig;
|
|
2366
|
+
this._highlightedEndMarkerLook = endMarkerLookConfig;
|
|
2367
|
+
this._selectedAndHighlightedEndMarkerLook = endMarkerLookConfig;
|
|
2323
2368
|
}
|
|
2324
2369
|
}
|
|
2325
2370
|
constructor(model, type, start, end, id) {
|
|
@@ -2994,23 +3039,38 @@ class DiagramSection extends DiagramElement {
|
|
|
2994
3039
|
}
|
|
2995
3040
|
}
|
|
2996
3041
|
}
|
|
3042
|
+
/**
|
|
3043
|
+
* An alias for the `lookConfig` attribute.
|
|
3044
|
+
* @private
|
|
3045
|
+
*/
|
|
3046
|
+
set look(look) {
|
|
3047
|
+
this.lookConfig = look;
|
|
3048
|
+
}
|
|
3049
|
+
/**
|
|
3050
|
+
* Look configuration used to derive the current look of this section.
|
|
3051
|
+
* @private
|
|
3052
|
+
*/
|
|
3053
|
+
get lookConfig() {
|
|
3054
|
+
return this._lookConfig;
|
|
3055
|
+
}
|
|
2997
3056
|
/**
|
|
2998
3057
|
* Sets the look configuration of the look to override the one determined by the type.
|
|
2999
3058
|
* `undefined` resets it to the one determined by the type.
|
|
3000
3059
|
* @private
|
|
3001
3060
|
*/
|
|
3002
|
-
set
|
|
3003
|
-
|
|
3004
|
-
|
|
3061
|
+
set lookConfig(lookConfig) {
|
|
3062
|
+
this._lookConfig = lookConfig;
|
|
3063
|
+
if (lookConfig) {
|
|
3064
|
+
const looks = extractLooksFromConfig(lookConfig);
|
|
3005
3065
|
this._defaultLook = Object.assign(Object.assign({}, this._defaultLook), looks.defaultLook);
|
|
3006
3066
|
this._selectedLook = Object.assign(Object.assign({}, this._selectedLook), looks.selectedLook);
|
|
3007
3067
|
this._highlightedLook = Object.assign(Object.assign({}, this._highlightedLook), looks.highlightedLook);
|
|
3008
3068
|
this._selectedAndHighlightedLook = Object.assign(Object.assign({}, this._selectedAndHighlightedLook), looks.selectedAndHighlightedLook);
|
|
3009
3069
|
} else {
|
|
3010
|
-
this._defaultLook =
|
|
3011
|
-
this._selectedLook =
|
|
3012
|
-
this._highlightedLook =
|
|
3013
|
-
this._selectedAndHighlightedLook =
|
|
3070
|
+
this._defaultLook = lookConfig;
|
|
3071
|
+
this._selectedLook = lookConfig;
|
|
3072
|
+
this._highlightedLook = lookConfig;
|
|
3073
|
+
this._selectedAndHighlightedLook = lookConfig;
|
|
3014
3074
|
}
|
|
3015
3075
|
}
|
|
3016
3076
|
constructor(model, node, indexXInNode, indexYInNode, coords, width, height, id) {
|
|
@@ -3508,23 +3568,38 @@ class DiagramNode extends DiagramElement {
|
|
|
3508
3568
|
}
|
|
3509
3569
|
}
|
|
3510
3570
|
}
|
|
3571
|
+
/**
|
|
3572
|
+
* An alias for the `lookConfig` attribute.
|
|
3573
|
+
* @private
|
|
3574
|
+
*/
|
|
3575
|
+
set look(look) {
|
|
3576
|
+
this.lookConfig = look;
|
|
3577
|
+
}
|
|
3578
|
+
/**
|
|
3579
|
+
* Look configuration used to derive the current look of this node.
|
|
3580
|
+
* @private
|
|
3581
|
+
*/
|
|
3582
|
+
get lookConfig() {
|
|
3583
|
+
return this._lookConfig;
|
|
3584
|
+
}
|
|
3511
3585
|
/**
|
|
3512
3586
|
* Sets the look configuration of the look to override the one determined by the type.
|
|
3513
3587
|
* `undefined` resets it to the one determined by the type.
|
|
3514
3588
|
* @private
|
|
3515
3589
|
*/
|
|
3516
|
-
set
|
|
3517
|
-
|
|
3518
|
-
|
|
3590
|
+
set lookConfig(lookConfig) {
|
|
3591
|
+
this._lookConfig = lookConfig;
|
|
3592
|
+
if (lookConfig) {
|
|
3593
|
+
const looks = extractLooksFromConfig(lookConfig);
|
|
3519
3594
|
this._defaultLook = Object.assign(Object.assign({}, this._defaultLook), looks.defaultLook);
|
|
3520
3595
|
this._selectedLook = Object.assign(Object.assign({}, this._selectedLook), looks.selectedLook);
|
|
3521
3596
|
this._highlightedLook = Object.assign(Object.assign({}, this._highlightedLook), looks.highlightedLook);
|
|
3522
3597
|
this._selectedAndHighlightedLook = Object.assign(Object.assign({}, this._selectedAndHighlightedLook), looks.selectedAndHighlightedLook);
|
|
3523
3598
|
} else {
|
|
3524
|
-
this._defaultLook =
|
|
3525
|
-
this._selectedLook =
|
|
3526
|
-
this._highlightedLook =
|
|
3527
|
-
this._selectedAndHighlightedLook =
|
|
3599
|
+
this._defaultLook = lookConfig;
|
|
3600
|
+
this._selectedLook = lookConfig;
|
|
3601
|
+
this._highlightedLook = lookConfig;
|
|
3602
|
+
this._selectedAndHighlightedLook = lookConfig;
|
|
3528
3603
|
}
|
|
3529
3604
|
}
|
|
3530
3605
|
constructor(model, type, coords = [0, 0], id) {
|
|
@@ -4536,23 +4611,38 @@ class DiagramPort extends DiagramElement {
|
|
|
4536
4611
|
}
|
|
4537
4612
|
}
|
|
4538
4613
|
}
|
|
4614
|
+
/**
|
|
4615
|
+
* An alias for the `lookConfig` attribute.
|
|
4616
|
+
* @private
|
|
4617
|
+
*/
|
|
4618
|
+
set look(look) {
|
|
4619
|
+
this.lookConfig = look;
|
|
4620
|
+
}
|
|
4621
|
+
/**
|
|
4622
|
+
* Look configuration used to derive the current look of this port.
|
|
4623
|
+
* @private
|
|
4624
|
+
*/
|
|
4625
|
+
get lookConfig() {
|
|
4626
|
+
return this._lookConfig;
|
|
4627
|
+
}
|
|
4539
4628
|
/**
|
|
4540
4629
|
* Sets the look configuration of the look to override the one determined by the type.
|
|
4541
4630
|
* `undefined` resets it to the one determined by the type.
|
|
4542
4631
|
* @private
|
|
4543
4632
|
*/
|
|
4544
|
-
set
|
|
4545
|
-
|
|
4546
|
-
|
|
4633
|
+
set lookConfig(lookConfig) {
|
|
4634
|
+
this._lookConfig = lookConfig;
|
|
4635
|
+
if (lookConfig) {
|
|
4636
|
+
const looks = extractLooksFromConfig(lookConfig);
|
|
4547
4637
|
this._defaultLook = Object.assign(Object.assign({}, this._defaultLook), looks.defaultLook);
|
|
4548
4638
|
this._selectedLook = Object.assign(Object.assign({}, this._selectedLook), looks.selectedLook);
|
|
4549
4639
|
this._highlightedLook = Object.assign(Object.assign({}, this._highlightedLook), looks.highlightedLook);
|
|
4550
4640
|
this._selectedAndHighlightedLook = Object.assign(Object.assign({}, this._selectedAndHighlightedLook), looks.selectedAndHighlightedLook);
|
|
4551
4641
|
} else {
|
|
4552
|
-
this._defaultLook =
|
|
4553
|
-
this._selectedLook =
|
|
4554
|
-
this._highlightedLook =
|
|
4555
|
-
this._selectedAndHighlightedLook =
|
|
4642
|
+
this._defaultLook = lookConfig;
|
|
4643
|
+
this._selectedLook = lookConfig;
|
|
4644
|
+
this._highlightedLook = lookConfig;
|
|
4645
|
+
this._selectedAndHighlightedLook = lookConfig;
|
|
4556
4646
|
}
|
|
4557
4647
|
}
|
|
4558
4648
|
/**
|
|
@@ -6994,12 +7084,12 @@ class DagaExporter {
|
|
|
6994
7084
|
}
|
|
6995
7085
|
|
|
6996
7086
|
/**
|
|
6997
|
-
* Text to display as the title of the property editor when editing the properties of a diagram's value set.
|
|
7087
|
+
* Text to display by default as the title of the property editor when editing the properties of a diagram's value set.
|
|
6998
7088
|
* @private
|
|
6999
7089
|
* @see PropertyEditorComponent
|
|
7000
7090
|
* @see ValueSet
|
|
7001
7091
|
*/
|
|
7002
|
-
const
|
|
7092
|
+
const DIAGRAM_PROPERTIES_DEFAULT_TEXT = 'Diagram properties';
|
|
7003
7093
|
/**
|
|
7004
7094
|
* Stores the functionality regarding the user highlight of a diagram canvas.
|
|
7005
7095
|
* @public
|
|
@@ -7011,12 +7101,14 @@ class DiagramUserSelection extends DiagramElementSet {
|
|
|
7011
7101
|
* @public
|
|
7012
7102
|
* @param canvas A canvas.
|
|
7013
7103
|
*/
|
|
7014
|
-
constructor(canvas) {
|
|
7104
|
+
constructor(canvas, diagramPropertiesText) {
|
|
7015
7105
|
super();
|
|
7016
7106
|
this.canvas = canvas;
|
|
7017
7107
|
this.canvas.propertyEditorChanges$.pipe(debounceTime(2000)).subscribe(() => {
|
|
7018
7108
|
this.makeUpdateValuesAction();
|
|
7019
7109
|
});
|
|
7110
|
+
console.log(diagramPropertiesText);
|
|
7111
|
+
this.diagramPropertiesText = diagramPropertiesText !== undefined ? diagramPropertiesText : DIAGRAM_PROPERTIES_DEFAULT_TEXT;
|
|
7020
7112
|
}
|
|
7021
7113
|
add(element) {
|
|
7022
7114
|
if (this.contains(element.id)) {
|
|
@@ -7211,7 +7303,7 @@ class DiagramUserSelection extends DiagramElementSet {
|
|
|
7211
7303
|
propertyEditor.valueSet = undefined;
|
|
7212
7304
|
propertyEditor.valueSet = selectedValueSet;
|
|
7213
7305
|
} else {
|
|
7214
|
-
propertyEditor.title =
|
|
7306
|
+
propertyEditor.title = this.diagramPropertiesText;
|
|
7215
7307
|
// force the update of the valueSet
|
|
7216
7308
|
propertyEditor.valueSet = undefined;
|
|
7217
7309
|
propertyEditor.valueSet = selectedValueSet;
|
|
@@ -7301,7 +7393,7 @@ class DiagramCanvas {
|
|
|
7301
7393
|
* @param config The configuration object used to set the parameters of this canvas.
|
|
7302
7394
|
*/
|
|
7303
7395
|
constructor(parentComponent, config) {
|
|
7304
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
|
|
7396
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
|
|
7305
7397
|
this.backgroundPatternId = `daga-background-pattern-id-${DiagramCanvas.canvasCount++}`;
|
|
7306
7398
|
this.zoomTransform = d3.zoomIdentity;
|
|
7307
7399
|
// used to distinguish drags from clicks when dragging elements and during multiple selection
|
|
@@ -7316,25 +7408,25 @@ class DiagramCanvas {
|
|
|
7316
7408
|
this.propertyEditorChanges$ = new Subject();
|
|
7317
7409
|
this.parentComponent = parentComponent;
|
|
7318
7410
|
this.model = new DiagramModel(this, undefined, config.name || 'unnamed', '', config.type || '', config.properties || []);
|
|
7319
|
-
this.userSelection = new DiagramUserSelection(this);
|
|
7320
|
-
this.userHighlight = new DiagramUserHighlight(this, ((
|
|
7321
|
-
this.contextMenu = new DiagramContextMenu(this, (
|
|
7322
|
-
this.backgroundColor = ((
|
|
7323
|
-
this.gridStyle = (
|
|
7324
|
-
this.gridSize = ((
|
|
7325
|
-
this.gridThickness = Math.abs(((
|
|
7326
|
-
this.gridColor = ((
|
|
7327
|
-
this.snapToGrid = ((
|
|
7328
|
-
this.zoomFactor = ((
|
|
7329
|
-
this.panRate = ((
|
|
7330
|
-
this.inferConnectionType = ((
|
|
7331
|
-
this.autoTightenConnections = ((
|
|
7332
|
-
this.allowConnectionLoops = ((
|
|
7333
|
-
this.allowSharingPorts = ((
|
|
7334
|
-
this.allowSharingBothPorts = ((
|
|
7335
|
-
this.portHighlightRadius = ((
|
|
7411
|
+
this.userSelection = new DiagramUserSelection(this, (_b = (_a = config.components) === null || _a === void 0 ? void 0 : _a.propertyEditor) === null || _b === void 0 ? void 0 : _b.title);
|
|
7412
|
+
this.userHighlight = new DiagramUserHighlight(this, ((_c = config.canvas) === null || _c === void 0 ? void 0 : _c.highlightSections) !== false);
|
|
7413
|
+
this.contextMenu = new DiagramContextMenu(this, (_d = config.canvas) === null || _d === void 0 ? void 0 : _d.contextMenu);
|
|
7414
|
+
this.backgroundColor = ((_e = config.canvas) === null || _e === void 0 ? void 0 : _e.backgroundColor) || '#FFFFFF';
|
|
7415
|
+
this.gridStyle = (_h = (_g = (_f = config.canvas) === null || _f === void 0 ? void 0 : _f.grid) === null || _g === void 0 ? void 0 : _g.style) !== null && _h !== void 0 ? _h : GRID_DEFAULTS.style;
|
|
7416
|
+
this.gridSize = ((_k = (_j = config.canvas) === null || _j === void 0 ? void 0 : _j.grid) === null || _k === void 0 ? void 0 : _k.enabled) === false || ((_l = config.canvas) === null || _l === void 0 ? void 0 : _l.grid) === undefined ? 0 : Math.abs(((_o = (_m = config.canvas) === null || _m === void 0 ? void 0 : _m.grid) === null || _o === void 0 ? void 0 : _o.spacing) || GRID_DEFAULTS.spacing);
|
|
7417
|
+
this.gridThickness = Math.abs(((_q = (_p = config.canvas) === null || _p === void 0 ? void 0 : _p.grid) === null || _q === void 0 ? void 0 : _q.thickness) || GRID_DEFAULTS.thickness);
|
|
7418
|
+
this.gridColor = ((_s = (_r = config.canvas) === null || _r === void 0 ? void 0 : _r.grid) === null || _s === void 0 ? void 0 : _s.color) || GRID_DEFAULTS.color;
|
|
7419
|
+
this.snapToGrid = ((_u = (_t = config.canvas) === null || _t === void 0 ? void 0 : _t.grid) === null || _u === void 0 ? void 0 : _u.enabled) === false || ((_v = config.canvas) === null || _v === void 0 ? void 0 : _v.grid) === undefined ? false : ((_x = (_w = config.canvas) === null || _w === void 0 ? void 0 : _w.grid) === null || _x === void 0 ? void 0 : _x.snap) || GRID_DEFAULTS.snap;
|
|
7420
|
+
this.zoomFactor = ((_y = config.canvas) === null || _y === void 0 ? void 0 : _y.zoomFactor) || 2;
|
|
7421
|
+
this.panRate = ((_z = config.canvas) === null || _z === void 0 ? void 0 : _z.panRate) || 100;
|
|
7422
|
+
this.inferConnectionType = ((_0 = config.connectionSettings) === null || _0 === void 0 ? void 0 : _0.inferConnectionType) || false;
|
|
7423
|
+
this.autoTightenConnections = ((_1 = config.connectionSettings) === null || _1 === void 0 ? void 0 : _1.autoTighten) !== false;
|
|
7424
|
+
this.allowConnectionLoops = ((_2 = config.connectionSettings) === null || _2 === void 0 ? void 0 : _2.allowLoops) || false;
|
|
7425
|
+
this.allowSharingPorts = ((_3 = config.connectionSettings) === null || _3 === void 0 ? void 0 : _3.sharePorts) !== false;
|
|
7426
|
+
this.allowSharingBothPorts = ((_4 = config.connectionSettings) === null || _4 === void 0 ? void 0 : _4.shareBothPorts) || false;
|
|
7427
|
+
this.portHighlightRadius = ((_5 = config.connectionSettings) === null || _5 === void 0 ? void 0 : _5.portHighlightRadius) || 100;
|
|
7336
7428
|
this.multipleSelectionOn = false;
|
|
7337
|
-
this.priorityThresholds = ((
|
|
7429
|
+
this.priorityThresholds = ((_6 = config.canvas) === null || _6 === void 0 ? void 0 : _6.priorityThresholds) || [];
|
|
7338
7430
|
this.priorityThreshold = this.priorityThresholds ? this.priorityThresholds[0] : undefined;
|
|
7339
7431
|
this.layoutFormat = config.layoutFormat;
|
|
7340
7432
|
this.userActions = config.userActions || {};
|
|
@@ -7361,7 +7453,7 @@ class DiagramCanvas {
|
|
|
7361
7453
|
const connectionType = new DiagramConnectionType(Object.assign(Object.assign({}, config.connectionTypeDefaults), connectionTypeConfig));
|
|
7362
7454
|
this.model.connections.types.add(connectionType);
|
|
7363
7455
|
}
|
|
7364
|
-
this._connectionType = ((
|
|
7456
|
+
this._connectionType = ((_7 = config === null || config === void 0 ? void 0 : config.connectionSettings) === null || _7 === void 0 ? void 0 : _7.defaultConnection) !== undefined ? this.model.connections.types.get(config.connectionSettings.defaultConnection) : undefined;
|
|
7365
7457
|
}
|
|
7366
7458
|
}
|
|
7367
7459
|
addValidator(validator) {
|
|
@@ -7588,8 +7680,8 @@ class DiagramCanvas {
|
|
|
7588
7680
|
const deselectedElements = this.userSelection.all();
|
|
7589
7681
|
this.userSelection.clear();
|
|
7590
7682
|
this.diagramEvent$.next(new DiagramSelectionEvent(deselectedElements, false));
|
|
7591
|
-
this.userSelection.openInPropertyEditor(this.model);
|
|
7592
7683
|
}
|
|
7684
|
+
this.userSelection.openInPropertyEditor(this.model);
|
|
7593
7685
|
}).call(d3.drag().filter(event => {
|
|
7594
7686
|
return this.multipleSelectionOn || isSecondaryButton(event);
|
|
7595
7687
|
}).on(DragEvents.Start, event => {
|
package/package.json
CHANGED
|
@@ -4,12 +4,12 @@ import { DiagramElement, DiagramElementSet } from '../model/diagram-element';
|
|
|
4
4
|
import { DiagramModel } from '../model/diagram-model';
|
|
5
5
|
import { ValueSet } from '../property/value';
|
|
6
6
|
/**
|
|
7
|
-
* Text to display as the title of the property editor when editing the properties of a diagram's value set.
|
|
7
|
+
* Text to display by default as the title of the property editor when editing the properties of a diagram's value set.
|
|
8
8
|
* @private
|
|
9
9
|
* @see PropertyEditorComponent
|
|
10
10
|
* @see ValueSet
|
|
11
11
|
*/
|
|
12
|
-
export declare const
|
|
12
|
+
export declare const DIAGRAM_PROPERTIES_DEFAULT_TEXT = "Diagram properties";
|
|
13
13
|
/**
|
|
14
14
|
* Stores the functionality regarding the user highlight of a diagram canvas.
|
|
15
15
|
* @public
|
|
@@ -17,6 +17,7 @@ export declare const DIAGRAM_PROPERTIES_TEXT = "Diagram properties";
|
|
|
17
17
|
*/
|
|
18
18
|
export declare class DiagramUserSelection extends DiagramElementSet<DiagramElement> {
|
|
19
19
|
private readonly canvas;
|
|
20
|
+
private readonly diagramPropertiesText;
|
|
20
21
|
private propertyEditorSelection?;
|
|
21
22
|
private propertyEditorValues?;
|
|
22
23
|
/**
|
|
@@ -24,7 +25,7 @@ export declare class DiagramUserSelection extends DiagramElementSet<DiagramEleme
|
|
|
24
25
|
* @public
|
|
25
26
|
* @param canvas A canvas.
|
|
26
27
|
*/
|
|
27
|
-
constructor(canvas: Canvas);
|
|
28
|
+
constructor(canvas: Canvas, diagramPropertiesText: string | undefined);
|
|
28
29
|
add(element: DiagramElement): void;
|
|
29
30
|
remove(id: string): void;
|
|
30
31
|
/**
|
|
@@ -163,6 +163,11 @@ export interface PropertyEditorComponentConfig {
|
|
|
163
163
|
* @default undefined
|
|
164
164
|
*/
|
|
165
165
|
height?: string;
|
|
166
|
+
/**
|
|
167
|
+
* Title that appears heading this component.
|
|
168
|
+
* @default 'Diagram properties'
|
|
169
|
+
*/
|
|
170
|
+
title?: string;
|
|
166
171
|
}
|
|
167
172
|
/**
|
|
168
173
|
* Configuration for a palette.
|
|
@@ -148,6 +148,7 @@ export declare class DiagramConnection extends DiagramElement {
|
|
|
148
148
|
*/
|
|
149
149
|
get name(): string;
|
|
150
150
|
set name(name: string);
|
|
151
|
+
private _lookConfig?;
|
|
151
152
|
private _defaultLook?;
|
|
152
153
|
private _selectedLook?;
|
|
153
154
|
private _highlightedLook?;
|
|
@@ -157,12 +158,23 @@ export declare class DiagramConnection extends DiagramElement {
|
|
|
157
158
|
* @private
|
|
158
159
|
*/
|
|
159
160
|
get look(): ConnectionLook;
|
|
161
|
+
/**
|
|
162
|
+
* An alias for the `lookConfig` attribute.
|
|
163
|
+
* @private
|
|
164
|
+
*/
|
|
165
|
+
set look(look: ConnectionLookConfig | undefined);
|
|
166
|
+
/**
|
|
167
|
+
* Look configuration used to derive the current look of this connection.
|
|
168
|
+
* @private
|
|
169
|
+
*/
|
|
170
|
+
get lookConfig(): ConnectionLookConfig | undefined;
|
|
160
171
|
/**
|
|
161
172
|
* Sets the look configuration of the connection to override the one determined by the type.
|
|
162
173
|
* `undefined` resets it to the one determined by the type.
|
|
163
174
|
* @private
|
|
164
175
|
*/
|
|
165
|
-
set
|
|
176
|
+
set lookConfig(lookConfig: ConnectionLookConfig | undefined);
|
|
177
|
+
private _startMarkerLookConfig?;
|
|
166
178
|
private _defaultStartMarkerLook?;
|
|
167
179
|
private _selectedStartMarkerLook?;
|
|
168
180
|
private _highlightedStartMarkerLook?;
|
|
@@ -172,12 +184,23 @@ export declare class DiagramConnection extends DiagramElement {
|
|
|
172
184
|
* @private
|
|
173
185
|
*/
|
|
174
186
|
get startMarkerLook(): MarkerImageLook | null;
|
|
187
|
+
/**
|
|
188
|
+
* An alias for the `lookConfig` attribute.
|
|
189
|
+
* @private
|
|
190
|
+
*/
|
|
191
|
+
set startMarkerLook(startMarkerLook: MarkerImageLookConfig | null | undefined);
|
|
192
|
+
/**
|
|
193
|
+
* Look configuration used to derive the current look of the start marker of this connection.
|
|
194
|
+
* @private
|
|
195
|
+
*/
|
|
196
|
+
get startMarkerLookConfig(): MarkerImageLookConfig | null | undefined;
|
|
175
197
|
/**
|
|
176
198
|
* Sets the look configuration of the start marker to override the one determined by the type.
|
|
177
199
|
* `null` stands for no marker and `undefined` resets it to the one determined by the type.
|
|
178
200
|
* @private
|
|
179
201
|
*/
|
|
180
|
-
set
|
|
202
|
+
set startMarkerLookConfig(startMarkerLookConfig: MarkerImageLookConfig | null | undefined);
|
|
203
|
+
private _endMarkerLookConfig?;
|
|
181
204
|
private _defaultEndMarkerLook?;
|
|
182
205
|
private _selectedEndMarkerLook?;
|
|
183
206
|
private _highlightedEndMarkerLook?;
|
|
@@ -187,12 +210,22 @@ export declare class DiagramConnection extends DiagramElement {
|
|
|
187
210
|
* @private
|
|
188
211
|
*/
|
|
189
212
|
get endMarkerLook(): MarkerImageLook | null;
|
|
213
|
+
/**
|
|
214
|
+
* An alias for the `lookConfig` attribute.
|
|
215
|
+
* @private
|
|
216
|
+
*/
|
|
217
|
+
set endMarkerLook(endMarkerLook: MarkerImageLookConfig | null | undefined);
|
|
218
|
+
/**
|
|
219
|
+
* Look configuration used to derive the current look of the end marker of this connection.
|
|
220
|
+
* @private
|
|
221
|
+
*/
|
|
222
|
+
get endMarkerLookConfig(): MarkerImageLookConfig | null | undefined;
|
|
190
223
|
/**
|
|
191
224
|
* Sets the look configuration of the end marker to override the one determined by the type.
|
|
192
225
|
* `null` stands for no marker and `undefined` resets it to the one determined by the type.
|
|
193
226
|
* @private
|
|
194
227
|
*/
|
|
195
|
-
set
|
|
228
|
+
set endMarkerLookConfig(endMarkerLookConfig: MarkerImageLookConfig | null | undefined);
|
|
196
229
|
constructor(model: DiagramModel, type: DiagramConnectionType, start: DiagramPort | undefined, end: DiagramPort | undefined, id: string);
|
|
197
230
|
get removed(): boolean;
|
|
198
231
|
updateInView(): void;
|
|
@@ -176,6 +176,7 @@ export declare class DiagramNode extends DiagramElement implements LabeledElemen
|
|
|
176
176
|
*/
|
|
177
177
|
get name(): string;
|
|
178
178
|
set name(name: string);
|
|
179
|
+
private _lookConfig?;
|
|
179
180
|
private _defaultLook?;
|
|
180
181
|
private _selectedLook?;
|
|
181
182
|
private _highlightedLook?;
|
|
@@ -185,12 +186,22 @@ export declare class DiagramNode extends DiagramElement implements LabeledElemen
|
|
|
185
186
|
* @private
|
|
186
187
|
*/
|
|
187
188
|
get look(): NodeLook;
|
|
189
|
+
/**
|
|
190
|
+
* An alias for the `lookConfig` attribute.
|
|
191
|
+
* @private
|
|
192
|
+
*/
|
|
193
|
+
set look(look: ShapedLookConfig | ImageLookConfig | StretchableImageLookConfig | undefined);
|
|
194
|
+
/**
|
|
195
|
+
* Look configuration used to derive the current look of this node.
|
|
196
|
+
* @private
|
|
197
|
+
*/
|
|
198
|
+
get lookConfig(): ShapedLookConfig | ImageLookConfig | StretchableImageLookConfig | undefined;
|
|
188
199
|
/**
|
|
189
200
|
* Sets the look configuration of the look to override the one determined by the type.
|
|
190
201
|
* `undefined` resets it to the one determined by the type.
|
|
191
202
|
* @private
|
|
192
203
|
*/
|
|
193
|
-
set
|
|
204
|
+
set lookConfig(lookConfig: ShapedLookConfig | ImageLookConfig | StretchableImageLookConfig | undefined);
|
|
194
205
|
constructor(model: DiagramModel, type: DiagramNodeType, coords: Point | undefined, id: string);
|
|
195
206
|
get removed(): boolean;
|
|
196
207
|
updateInView(): void;
|
|
@@ -134,6 +134,7 @@ export declare class DiagramPort extends DiagramElement implements LabeledElemen
|
|
|
134
134
|
*/
|
|
135
135
|
get name(): string;
|
|
136
136
|
set name(name: string);
|
|
137
|
+
private _lookConfig?;
|
|
137
138
|
private _defaultLook?;
|
|
138
139
|
private _selectedLook?;
|
|
139
140
|
private _highlightedLook?;
|
|
@@ -143,12 +144,22 @@ export declare class DiagramPort extends DiagramElement implements LabeledElemen
|
|
|
143
144
|
* @private
|
|
144
145
|
*/
|
|
145
146
|
get look(): PortLook;
|
|
147
|
+
/**
|
|
148
|
+
* An alias for the `lookConfig` attribute.
|
|
149
|
+
* @private
|
|
150
|
+
*/
|
|
151
|
+
set look(look: ShapedLookConfig | ImageLookConfig | undefined);
|
|
152
|
+
/**
|
|
153
|
+
* Look configuration used to derive the current look of this port.
|
|
154
|
+
* @private
|
|
155
|
+
*/
|
|
156
|
+
get lookConfig(): ShapedLookConfig | ImageLookConfig | undefined;
|
|
146
157
|
/**
|
|
147
158
|
* Sets the look configuration of the look to override the one determined by the type.
|
|
148
159
|
* `undefined` resets it to the one determined by the type.
|
|
149
160
|
* @private
|
|
150
161
|
*/
|
|
151
|
-
set
|
|
162
|
+
set lookConfig(lookConfig: ShapedLookConfig | ImageLookConfig | undefined);
|
|
152
163
|
/**
|
|
153
164
|
* Current width of this port.
|
|
154
165
|
* @private
|
|
@@ -122,6 +122,7 @@ export declare class DiagramSection extends DiagramElement implements LabeledEle
|
|
|
122
122
|
*/
|
|
123
123
|
get name(): string;
|
|
124
124
|
set name(name: string);
|
|
125
|
+
private _lookConfig?;
|
|
125
126
|
private _defaultLook?;
|
|
126
127
|
private _selectedLook?;
|
|
127
128
|
private _highlightedLook?;
|
|
@@ -131,12 +132,22 @@ export declare class DiagramSection extends DiagramElement implements LabeledEle
|
|
|
131
132
|
* @private
|
|
132
133
|
*/
|
|
133
134
|
get look(): NodeLook;
|
|
135
|
+
/**
|
|
136
|
+
* An alias for the `lookConfig` attribute.
|
|
137
|
+
* @private
|
|
138
|
+
*/
|
|
139
|
+
set look(look: ShapedLookConfig | ImageLookConfig | StretchableImageLookConfig | undefined);
|
|
140
|
+
/**
|
|
141
|
+
* Look configuration used to derive the current look of this section.
|
|
142
|
+
* @private
|
|
143
|
+
*/
|
|
144
|
+
get lookConfig(): ShapedLookConfig | ImageLookConfig | StretchableImageLookConfig | undefined;
|
|
134
145
|
/**
|
|
135
146
|
* Sets the look configuration of the look to override the one determined by the type.
|
|
136
147
|
* `undefined` resets it to the one determined by the type.
|
|
137
148
|
* @private
|
|
138
149
|
*/
|
|
139
|
-
set
|
|
150
|
+
set lookConfig(lookConfig: ShapedLookConfig | ImageLookConfig | StretchableImageLookConfig | undefined);
|
|
140
151
|
constructor(model: DiagramModel, node: DiagramNode | undefined, indexXInNode: number, indexYInNode: number, coords: Point, width: number, height: number, id: string);
|
|
141
152
|
get removed(): boolean;
|
|
142
153
|
updateInView(): void;
|