camunda-bpmn-js 3.10.2 → 3.12.0
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/dist/assets/properties-panel.css +0 -4
- package/dist/base-modeler.development.js +1781 -1244
- package/dist/base-modeler.production.min.js +33 -33
- package/dist/base-navigated-viewer.development.js +257 -119
- package/dist/base-navigated-viewer.production.min.js +1 -1
- package/dist/base-viewer.development.js +257 -119
- package/dist/base-viewer.production.min.js +1 -1
- package/dist/camunda-cloud-modeler.development.js +9233 -8479
- package/dist/camunda-cloud-modeler.production.min.js +34 -34
- package/dist/camunda-cloud-navigated-viewer.development.js +257 -119
- package/dist/camunda-cloud-navigated-viewer.production.min.js +1 -1
- package/dist/camunda-cloud-viewer.development.js +257 -119
- package/dist/camunda-cloud-viewer.production.min.js +1 -1
- package/dist/camunda-platform-modeler.development.js +2234 -1606
- package/dist/camunda-platform-modeler.production.min.js +36 -36
- package/dist/camunda-platform-navigated-viewer.development.js +257 -119
- package/dist/camunda-platform-navigated-viewer.production.min.js +1 -1
- package/dist/camunda-platform-viewer.development.js +257 -119
- package/dist/camunda-platform-viewer.production.min.js +1 -1
- package/package.json +20 -20
|
@@ -27,6 +27,10 @@
|
|
|
27
27
|
return obj !== undefined;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
function isNil(obj) {
|
|
31
|
+
return obj == null;
|
|
32
|
+
}
|
|
33
|
+
|
|
30
34
|
function isArray$2(obj) {
|
|
31
35
|
return nativeToString$1.call(obj) === '[object Array]';
|
|
32
36
|
}
|
|
@@ -475,6 +479,58 @@
|
|
|
475
479
|
return Object.assign(target, ...others);
|
|
476
480
|
}
|
|
477
481
|
|
|
482
|
+
/**
|
|
483
|
+
* Sets a nested property of a given object to the specified value.
|
|
484
|
+
*
|
|
485
|
+
* This mutates the object and returns it.
|
|
486
|
+
*
|
|
487
|
+
* @template T
|
|
488
|
+
*
|
|
489
|
+
* @param {T} target The target of the set operation.
|
|
490
|
+
* @param {(string|number)[]} path The path to the nested value.
|
|
491
|
+
* @param {any} value The value to set.
|
|
492
|
+
*
|
|
493
|
+
* @return {T}
|
|
494
|
+
*/
|
|
495
|
+
function set$1(target, path, value) {
|
|
496
|
+
|
|
497
|
+
let currentTarget = target;
|
|
498
|
+
|
|
499
|
+
forEach$1(path, function(key, idx) {
|
|
500
|
+
|
|
501
|
+
if (typeof key !== 'number' && typeof key !== 'string') {
|
|
502
|
+
throw new Error('illegal key type: ' + typeof key + '. Key should be of type number or string.');
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
if (key === 'constructor') {
|
|
506
|
+
throw new Error('illegal key: constructor');
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
if (key === '__proto__') {
|
|
510
|
+
throw new Error('illegal key: __proto__');
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
let nextKey = path[idx + 1];
|
|
514
|
+
let nextTarget = currentTarget[key];
|
|
515
|
+
|
|
516
|
+
if (isDefined(nextKey) && isNil(nextTarget)) {
|
|
517
|
+
nextTarget = currentTarget[key] = isNaN(+nextKey) ? {} : [];
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
if (isUndefined$2(nextKey)) {
|
|
521
|
+
if (isUndefined$2(value)) {
|
|
522
|
+
delete currentTarget[key];
|
|
523
|
+
} else {
|
|
524
|
+
currentTarget[key] = value;
|
|
525
|
+
}
|
|
526
|
+
} else {
|
|
527
|
+
currentTarget = nextTarget;
|
|
528
|
+
}
|
|
529
|
+
});
|
|
530
|
+
|
|
531
|
+
return target;
|
|
532
|
+
}
|
|
533
|
+
|
|
478
534
|
/**
|
|
479
535
|
* Pick properties from the given target.
|
|
480
536
|
*
|
|
@@ -713,6 +769,26 @@
|
|
|
713
769
|
return true;
|
|
714
770
|
}
|
|
715
771
|
|
|
772
|
+
/**
|
|
773
|
+
* @param {Element} element
|
|
774
|
+
*
|
|
775
|
+
* @return {boolean}
|
|
776
|
+
*/
|
|
777
|
+
function isHorizontal(element) {
|
|
778
|
+
|
|
779
|
+
if (!is$1(element, 'bpmn:Participant') && !is$1(element, 'bpmn:Lane')) {
|
|
780
|
+
return undefined;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
var isHorizontal = getDi(element).isHorizontal;
|
|
784
|
+
|
|
785
|
+
if (isHorizontal === undefined) {
|
|
786
|
+
return true;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
return isHorizontal;
|
|
790
|
+
}
|
|
791
|
+
|
|
716
792
|
/**
|
|
717
793
|
* @param {Element} element
|
|
718
794
|
*
|
|
@@ -3772,10 +3848,12 @@
|
|
|
3772
3848
|
}
|
|
3773
3849
|
|
|
3774
3850
|
function renderLaneLabel(parentGfx, text, element, attrs = {}) {
|
|
3851
|
+
var isHorizontalLane = isHorizontal(element);
|
|
3852
|
+
|
|
3775
3853
|
var textBox = renderLabel(parentGfx, text, {
|
|
3776
3854
|
box: {
|
|
3777
3855
|
height: 30,
|
|
3778
|
-
width: getHeight(element, attrs),
|
|
3856
|
+
width: isHorizontalLane ? getHeight(element, attrs) : getWidth(element, attrs),
|
|
3779
3857
|
},
|
|
3780
3858
|
align: 'center-middle',
|
|
3781
3859
|
style: {
|
|
@@ -3783,9 +3861,10 @@
|
|
|
3783
3861
|
}
|
|
3784
3862
|
});
|
|
3785
3863
|
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3864
|
+
if (isHorizontalLane) {
|
|
3865
|
+
var top = -1 * getHeight(element, attrs);
|
|
3866
|
+
transform(textBox, 0, -top, 270);
|
|
3867
|
+
}
|
|
3789
3868
|
}
|
|
3790
3869
|
|
|
3791
3870
|
function renderActivity(parentGfx, element, attrs = {}) {
|
|
@@ -4503,12 +4582,13 @@
|
|
|
4503
4582
|
var participant = renderLane(parentGfx, element, attrs);
|
|
4504
4583
|
|
|
4505
4584
|
var expandedParticipant = isExpanded(element);
|
|
4585
|
+
var horizontalParticipant = isHorizontal(element);
|
|
4506
4586
|
|
|
4507
4587
|
var semantic = getBusinessObject(element),
|
|
4508
4588
|
name = semantic.get('name');
|
|
4509
4589
|
|
|
4510
4590
|
if (expandedParticipant) {
|
|
4511
|
-
|
|
4591
|
+
var waypoints = horizontalParticipant ? [
|
|
4512
4592
|
{
|
|
4513
4593
|
x: 30,
|
|
4514
4594
|
y: 0
|
|
@@ -4517,20 +4597,43 @@
|
|
|
4517
4597
|
x: 30,
|
|
4518
4598
|
y: getHeight(element, attrs)
|
|
4519
4599
|
}
|
|
4520
|
-
]
|
|
4600
|
+
] : [
|
|
4601
|
+
{
|
|
4602
|
+
x: 0,
|
|
4603
|
+
y: 30
|
|
4604
|
+
},
|
|
4605
|
+
{
|
|
4606
|
+
x: getWidth(element, attrs),
|
|
4607
|
+
y: 30
|
|
4608
|
+
}
|
|
4609
|
+
];
|
|
4610
|
+
|
|
4611
|
+
drawLine(parentGfx, waypoints, {
|
|
4521
4612
|
stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
|
|
4522
4613
|
strokeWidth: PARTICIPANT_STROKE_WIDTH
|
|
4523
4614
|
});
|
|
4524
4615
|
|
|
4525
4616
|
renderLaneLabel(parentGfx, name, element, attrs);
|
|
4526
4617
|
} else {
|
|
4527
|
-
|
|
4528
|
-
|
|
4618
|
+
var bounds = getBounds(element, attrs);
|
|
4619
|
+
|
|
4620
|
+
if (!horizontalParticipant) {
|
|
4621
|
+
bounds.height = getWidth(element, attrs);
|
|
4622
|
+
bounds.width = getHeight(element, attrs);
|
|
4623
|
+
}
|
|
4624
|
+
|
|
4625
|
+
var textBox = renderLabel(parentGfx, name, {
|
|
4626
|
+
box: bounds,
|
|
4529
4627
|
align: 'center-middle',
|
|
4530
4628
|
style: {
|
|
4531
4629
|
fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke)
|
|
4532
4630
|
}
|
|
4533
4631
|
});
|
|
4632
|
+
|
|
4633
|
+
if (!horizontalParticipant) {
|
|
4634
|
+
var top = -1 * getHeight(element, attrs);
|
|
4635
|
+
transform(textBox, 0, -top, 270);
|
|
4636
|
+
}
|
|
4534
4637
|
}
|
|
4535
4638
|
|
|
4536
4639
|
if (semantic.get('participantMultiplicity')) {
|
|
@@ -6117,10 +6220,6 @@
|
|
|
6117
6220
|
translate: [ 'value', translate ]
|
|
6118
6221
|
};
|
|
6119
6222
|
|
|
6120
|
-
function getDefaultExportFromCjs (x) {
|
|
6121
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
6122
|
-
}
|
|
6123
|
-
|
|
6124
6223
|
/**
|
|
6125
6224
|
* @param {Point} point
|
|
6126
6225
|
*
|
|
@@ -9805,7 +9904,7 @@
|
|
|
9805
9904
|
}
|
|
9806
9905
|
|
|
9807
9906
|
/**
|
|
9808
|
-
* @typedef {import('./index').InjectAnnotated } InjectAnnotated
|
|
9907
|
+
* @typedef {import('./index.js').InjectAnnotated } InjectAnnotated
|
|
9809
9908
|
*/
|
|
9810
9909
|
|
|
9811
9910
|
/**
|
|
@@ -9875,9 +9974,9 @@
|
|
|
9875
9974
|
}
|
|
9876
9975
|
|
|
9877
9976
|
/**
|
|
9878
|
-
* @typedef { import('./index').ModuleDeclaration } ModuleDeclaration
|
|
9879
|
-
* @typedef { import('./index').ModuleDefinition } ModuleDefinition
|
|
9880
|
-
* @typedef { import('./index').InjectorContext } InjectorContext
|
|
9977
|
+
* @typedef { import('./index.js').ModuleDeclaration } ModuleDeclaration
|
|
9978
|
+
* @typedef { import('./index.js').ModuleDefinition } ModuleDefinition
|
|
9979
|
+
* @typedef { import('./index.js').InjectorContext } InjectorContext
|
|
9881
9980
|
*/
|
|
9882
9981
|
|
|
9883
9982
|
/**
|
|
@@ -9980,11 +10079,20 @@
|
|
|
9980
10079
|
};
|
|
9981
10080
|
}
|
|
9982
10081
|
|
|
9983
|
-
|
|
10082
|
+
/**
|
|
10083
|
+
* Instantiate the given type, injecting dependencies.
|
|
10084
|
+
*
|
|
10085
|
+
* @template T
|
|
10086
|
+
*
|
|
10087
|
+
* @param { Function | [...string[], Function ]} type
|
|
10088
|
+
*
|
|
10089
|
+
* @return T
|
|
10090
|
+
*/
|
|
10091
|
+
function instantiate(type) {
|
|
9984
10092
|
const {
|
|
9985
10093
|
fn,
|
|
9986
10094
|
dependencies
|
|
9987
|
-
} = fnDef(
|
|
10095
|
+
} = fnDef(type);
|
|
9988
10096
|
|
|
9989
10097
|
// instantiate var args constructor
|
|
9990
10098
|
const Constructor = Function.prototype.bind.apply(fn, [ null ].concat(dependencies));
|
|
@@ -9992,6 +10100,17 @@
|
|
|
9992
10100
|
return new Constructor();
|
|
9993
10101
|
}
|
|
9994
10102
|
|
|
10103
|
+
/**
|
|
10104
|
+
* Invoke the given function, injecting dependencies. Return the result.
|
|
10105
|
+
*
|
|
10106
|
+
* @template T
|
|
10107
|
+
*
|
|
10108
|
+
* @param { Function | [...string[], Function ]} func
|
|
10109
|
+
* @param { Object } [context]
|
|
10110
|
+
* @param { Object } [locals]
|
|
10111
|
+
*
|
|
10112
|
+
* @return {T} invocation result
|
|
10113
|
+
*/
|
|
9995
10114
|
function invoke(func, context, locals) {
|
|
9996
10115
|
const {
|
|
9997
10116
|
fn,
|
|
@@ -12260,32 +12379,17 @@
|
|
|
12260
12379
|
}
|
|
12261
12380
|
};
|
|
12262
12381
|
|
|
12263
|
-
var objectRefs = {exports: {}};
|
|
12264
|
-
|
|
12265
|
-
var collection = {};
|
|
12266
|
-
|
|
12267
|
-
/**
|
|
12268
|
-
* An empty collection stub. Use {@link RefsCollection.extend} to extend a
|
|
12269
|
-
* collection with ref semantics.
|
|
12270
|
-
*
|
|
12271
|
-
* @class RefsCollection
|
|
12272
|
-
*/
|
|
12273
|
-
|
|
12274
12382
|
/**
|
|
12275
12383
|
* Extends a collection with {@link Refs} aware methods
|
|
12276
12384
|
*
|
|
12277
|
-
* @
|
|
12278
|
-
* @
|
|
12279
|
-
*
|
|
12280
|
-
* @param
|
|
12281
|
-
* @param {Refs} refs instance
|
|
12282
|
-
* @param {Object} property represented by the collection
|
|
12283
|
-
* @param {Object} target object the collection is attached to
|
|
12385
|
+
* @param {Array<Object>} collection
|
|
12386
|
+
* @param {Refs} refs instance
|
|
12387
|
+
* @param {Object} property represented by the collection
|
|
12388
|
+
* @param {Object} target object the collection is attached to
|
|
12284
12389
|
*
|
|
12285
12390
|
* @return {RefsCollection<Object>} the extended array
|
|
12286
12391
|
*/
|
|
12287
12392
|
function extend(collection, refs, property, target) {
|
|
12288
|
-
|
|
12289
12393
|
var inverseProperty = property.inverse;
|
|
12290
12394
|
|
|
12291
12395
|
/**
|
|
@@ -12296,7 +12400,7 @@
|
|
|
12296
12400
|
* @param {Object} element the element to remove
|
|
12297
12401
|
*/
|
|
12298
12402
|
Object.defineProperty(collection, 'remove', {
|
|
12299
|
-
value: function(element) {
|
|
12403
|
+
value: function (element) {
|
|
12300
12404
|
var idx = this.indexOf(element);
|
|
12301
12405
|
if (idx !== -1) {
|
|
12302
12406
|
this.splice(idx, 1);
|
|
@@ -12304,7 +12408,6 @@
|
|
|
12304
12408
|
// unset inverse
|
|
12305
12409
|
refs.unset(element, inverseProperty, target);
|
|
12306
12410
|
}
|
|
12307
|
-
|
|
12308
12411
|
return element;
|
|
12309
12412
|
}
|
|
12310
12413
|
});
|
|
@@ -12317,7 +12420,7 @@
|
|
|
12317
12420
|
* @param {Object} element the element to check for
|
|
12318
12421
|
*/
|
|
12319
12422
|
Object.defineProperty(collection, 'contains', {
|
|
12320
|
-
value: function(element) {
|
|
12423
|
+
value: function (element) {
|
|
12321
12424
|
return this.indexOf(element) !== -1;
|
|
12322
12425
|
}
|
|
12323
12426
|
});
|
|
@@ -12332,12 +12435,9 @@
|
|
|
12332
12435
|
* (possibly moving other elements around)
|
|
12333
12436
|
*/
|
|
12334
12437
|
Object.defineProperty(collection, 'add', {
|
|
12335
|
-
value: function(element, idx) {
|
|
12336
|
-
|
|
12438
|
+
value: function (element, idx) {
|
|
12337
12439
|
var currentIdx = this.indexOf(element);
|
|
12338
|
-
|
|
12339
12440
|
if (typeof idx === 'undefined') {
|
|
12340
|
-
|
|
12341
12441
|
if (currentIdx !== -1) {
|
|
12342
12442
|
// element already in collection (!)
|
|
12343
12443
|
return;
|
|
@@ -12349,14 +12449,12 @@
|
|
|
12349
12449
|
|
|
12350
12450
|
// handle already in collection
|
|
12351
12451
|
if (currentIdx !== -1) {
|
|
12352
|
-
|
|
12353
12452
|
// remove element from currentIdx
|
|
12354
12453
|
this.splice(currentIdx, 1);
|
|
12355
12454
|
}
|
|
12356
12455
|
|
|
12357
12456
|
// add element at idx
|
|
12358
12457
|
this.splice(idx, 0, element);
|
|
12359
|
-
|
|
12360
12458
|
if (currentIdx === -1) {
|
|
12361
12459
|
// set inverse, unless element was
|
|
12362
12460
|
// in collection already
|
|
@@ -12370,69 +12468,53 @@
|
|
|
12370
12468
|
Object.defineProperty(collection, '__refs_collection', {
|
|
12371
12469
|
value: true
|
|
12372
12470
|
});
|
|
12373
|
-
|
|
12374
12471
|
return collection;
|
|
12375
12472
|
}
|
|
12376
12473
|
|
|
12377
|
-
|
|
12474
|
+
/**
|
|
12475
|
+
* Checks if a given collection is extended
|
|
12476
|
+
*
|
|
12477
|
+
* @param {Array<Object>} collection
|
|
12478
|
+
*
|
|
12479
|
+
* @return {boolean}
|
|
12480
|
+
*/
|
|
12378
12481
|
function isExtended(collection) {
|
|
12379
12482
|
return collection.__refs_collection === true;
|
|
12380
12483
|
}
|
|
12381
12484
|
|
|
12382
|
-
collection.extend = extend;
|
|
12383
|
-
|
|
12384
|
-
collection.isExtended = isExtended;
|
|
12385
|
-
|
|
12386
|
-
var Collection = collection;
|
|
12387
|
-
|
|
12388
12485
|
function hasOwnProperty$1(e, property) {
|
|
12389
12486
|
return Object.prototype.hasOwnProperty.call(e, property.name || property);
|
|
12390
12487
|
}
|
|
12391
|
-
|
|
12392
12488
|
function defineCollectionProperty(ref, property, target) {
|
|
12393
|
-
|
|
12394
|
-
var collection = Collection.extend(target[property.name] || [], ref, property, target);
|
|
12395
|
-
|
|
12489
|
+
var collection = extend(target[property.name] || [], ref, property, target);
|
|
12396
12490
|
Object.defineProperty(target, property.name, {
|
|
12397
12491
|
enumerable: property.enumerable,
|
|
12398
12492
|
value: collection
|
|
12399
12493
|
});
|
|
12400
|
-
|
|
12401
12494
|
if (collection.length) {
|
|
12402
|
-
|
|
12403
|
-
collection.forEach(function(o) {
|
|
12495
|
+
collection.forEach(function (o) {
|
|
12404
12496
|
ref.set(o, property.inverse, target);
|
|
12405
12497
|
});
|
|
12406
12498
|
}
|
|
12407
12499
|
}
|
|
12408
|
-
|
|
12409
|
-
|
|
12410
12500
|
function defineProperty$1(ref, property, target) {
|
|
12411
|
-
|
|
12412
12501
|
var inverseProperty = property.inverse;
|
|
12413
|
-
|
|
12414
12502
|
var _value = target[property.name];
|
|
12415
|
-
|
|
12416
12503
|
Object.defineProperty(target, property.name, {
|
|
12417
12504
|
configurable: property.configurable,
|
|
12418
12505
|
enumerable: property.enumerable,
|
|
12419
|
-
|
|
12420
|
-
get: function() {
|
|
12506
|
+
get: function () {
|
|
12421
12507
|
return _value;
|
|
12422
12508
|
},
|
|
12423
|
-
|
|
12424
|
-
set: function(value) {
|
|
12425
|
-
|
|
12509
|
+
set: function (value) {
|
|
12426
12510
|
// return if we already performed all changes
|
|
12427
12511
|
if (value === _value) {
|
|
12428
12512
|
return;
|
|
12429
12513
|
}
|
|
12430
|
-
|
|
12431
12514
|
var old = _value;
|
|
12432
12515
|
|
|
12433
12516
|
// temporary set null
|
|
12434
12517
|
_value = null;
|
|
12435
|
-
|
|
12436
12518
|
if (old) {
|
|
12437
12519
|
ref.unset(old, inverseProperty, target);
|
|
12438
12520
|
}
|
|
@@ -12444,7 +12526,6 @@
|
|
|
12444
12526
|
ref.set(_value, inverseProperty, target);
|
|
12445
12527
|
}
|
|
12446
12528
|
});
|
|
12447
|
-
|
|
12448
12529
|
}
|
|
12449
12530
|
|
|
12450
12531
|
/**
|
|
@@ -12490,16 +12571,14 @@
|
|
|
12490
12571
|
*
|
|
12491
12572
|
* wheels[0].car // undefined
|
|
12492
12573
|
*/
|
|
12493
|
-
function Refs
|
|
12494
|
-
|
|
12495
|
-
|
|
12496
|
-
return new Refs$1(a, b);
|
|
12574
|
+
function Refs(a, b) {
|
|
12575
|
+
if (!(this instanceof Refs)) {
|
|
12576
|
+
return new Refs(a, b);
|
|
12497
12577
|
}
|
|
12498
12578
|
|
|
12499
12579
|
// link
|
|
12500
12580
|
a.inverse = b;
|
|
12501
12581
|
b.inverse = a;
|
|
12502
|
-
|
|
12503
12582
|
this.props = {};
|
|
12504
12583
|
this.props[a.name] = a;
|
|
12505
12584
|
this.props[b.name] = b;
|
|
@@ -12514,43 +12593,34 @@
|
|
|
12514
12593
|
* @param {Object} target
|
|
12515
12594
|
* @param {String} property
|
|
12516
12595
|
*/
|
|
12517
|
-
Refs
|
|
12596
|
+
Refs.prototype.bind = function (target, property) {
|
|
12518
12597
|
if (typeof property === 'string') {
|
|
12519
12598
|
if (!this.props[property]) {
|
|
12520
12599
|
throw new Error('no property <' + property + '> in ref');
|
|
12521
12600
|
}
|
|
12522
12601
|
property = this.props[property];
|
|
12523
12602
|
}
|
|
12524
|
-
|
|
12525
12603
|
if (property.collection) {
|
|
12526
12604
|
defineCollectionProperty(this, property, target);
|
|
12527
12605
|
} else {
|
|
12528
12606
|
defineProperty$1(this, property, target);
|
|
12529
12607
|
}
|
|
12530
12608
|
};
|
|
12531
|
-
|
|
12532
|
-
Refs$1.prototype.ensureRefsCollection = function(target, property) {
|
|
12533
|
-
|
|
12609
|
+
Refs.prototype.ensureRefsCollection = function (target, property) {
|
|
12534
12610
|
var collection = target[property.name];
|
|
12535
|
-
|
|
12536
|
-
if (!Collection.isExtended(collection)) {
|
|
12611
|
+
if (!isExtended(collection)) {
|
|
12537
12612
|
defineCollectionProperty(this, property, target);
|
|
12538
12613
|
}
|
|
12539
|
-
|
|
12540
12614
|
return collection;
|
|
12541
12615
|
};
|
|
12542
|
-
|
|
12543
|
-
Refs$1.prototype.ensureBound = function(target, property) {
|
|
12616
|
+
Refs.prototype.ensureBound = function (target, property) {
|
|
12544
12617
|
if (!hasOwnProperty$1(target, property)) {
|
|
12545
12618
|
this.bind(target, property);
|
|
12546
12619
|
}
|
|
12547
12620
|
};
|
|
12548
|
-
|
|
12549
|
-
Refs$1.prototype.unset = function(target, property, value) {
|
|
12550
|
-
|
|
12621
|
+
Refs.prototype.unset = function (target, property, value) {
|
|
12551
12622
|
if (target) {
|
|
12552
12623
|
this.ensureBound(target, property);
|
|
12553
|
-
|
|
12554
12624
|
if (property.collection) {
|
|
12555
12625
|
this.ensureRefsCollection(target, property).remove(value);
|
|
12556
12626
|
} else {
|
|
@@ -12558,12 +12628,9 @@
|
|
|
12558
12628
|
}
|
|
12559
12629
|
}
|
|
12560
12630
|
};
|
|
12561
|
-
|
|
12562
|
-
Refs$1.prototype.set = function(target, property, value) {
|
|
12563
|
-
|
|
12631
|
+
Refs.prototype.set = function (target, property, value) {
|
|
12564
12632
|
if (target) {
|
|
12565
12633
|
this.ensureBound(target, property);
|
|
12566
|
-
|
|
12567
12634
|
if (property.collection) {
|
|
12568
12635
|
this.ensureRefsCollection(target, property).add(value);
|
|
12569
12636
|
} else {
|
|
@@ -12572,15 +12639,6 @@
|
|
|
12572
12639
|
}
|
|
12573
12640
|
};
|
|
12574
12641
|
|
|
12575
|
-
var refs = Refs$1;
|
|
12576
|
-
|
|
12577
|
-
objectRefs.exports = refs;
|
|
12578
|
-
|
|
12579
|
-
objectRefs.exports.Collection = collection;
|
|
12580
|
-
|
|
12581
|
-
var objectRefsExports = objectRefs.exports;
|
|
12582
|
-
var Refs = /*@__PURE__*/getDefaultExportFromCjs(objectRefsExports);
|
|
12583
|
-
|
|
12584
12642
|
var parentRefs = new Refs({ name: 'children', enumerable: true, collection: true }, { name: 'parent' }),
|
|
12585
12643
|
labelRefs = new Refs({ name: 'labels', enumerable: true, collection: true }, { name: 'labelTarget' }),
|
|
12586
12644
|
attacherRefs = new Refs({ name: 'attachers', collection: true }, { name: 'host' }),
|
|
@@ -14397,6 +14455,17 @@
|
|
|
14397
14455
|
this.idProperty = p;
|
|
14398
14456
|
};
|
|
14399
14457
|
|
|
14458
|
+
DescriptorBuilder.prototype.assertNotTrait = function(typeDescriptor) {
|
|
14459
|
+
|
|
14460
|
+
const _extends = typeDescriptor.extends || [];
|
|
14461
|
+
|
|
14462
|
+
if (_extends.length) {
|
|
14463
|
+
throw new Error(
|
|
14464
|
+
`cannot create <${ typeDescriptor.name }> extending <${ typeDescriptor.extends }>`
|
|
14465
|
+
);
|
|
14466
|
+
}
|
|
14467
|
+
};
|
|
14468
|
+
|
|
14400
14469
|
DescriptorBuilder.prototype.assertNotDefined = function(p, name) {
|
|
14401
14470
|
var propertyName = p.name,
|
|
14402
14471
|
definedProperty = this.propertiesByName[propertyName];
|
|
@@ -14415,6 +14484,10 @@
|
|
|
14415
14484
|
|
|
14416
14485
|
DescriptorBuilder.prototype.addTrait = function(t, inherited) {
|
|
14417
14486
|
|
|
14487
|
+
if (inherited) {
|
|
14488
|
+
this.assertNotTrait(t);
|
|
14489
|
+
}
|
|
14490
|
+
|
|
14418
14491
|
var typesByName = this.allTypesByName,
|
|
14419
14492
|
types = this.allTypes;
|
|
14420
14493
|
|
|
@@ -14548,7 +14621,9 @@
|
|
|
14548
14621
|
});
|
|
14549
14622
|
|
|
14550
14623
|
forEach$1(type.extends, bind$2(function(extendsName) {
|
|
14551
|
-
var
|
|
14624
|
+
var extendsNameNs = parseName(extendsName, ns.prefix);
|
|
14625
|
+
|
|
14626
|
+
var extended = this.typeMap[extendsNameNs.name];
|
|
14552
14627
|
|
|
14553
14628
|
extended.traits = extended.traits || [];
|
|
14554
14629
|
extended.traits.push(name);
|
|
@@ -14577,24 +14652,33 @@
|
|
|
14577
14652
|
|
|
14578
14653
|
var self = this;
|
|
14579
14654
|
|
|
14655
|
+
/**
|
|
14656
|
+
* Traverse the selected super type or trait
|
|
14657
|
+
*
|
|
14658
|
+
* @param {String} cls
|
|
14659
|
+
* @param {Boolean} [trait=false]
|
|
14660
|
+
*/
|
|
14661
|
+
function traverse(cls, trait) {
|
|
14662
|
+
var parentNs = parseName(cls, isBuiltIn(cls) ? '' : nsName.prefix);
|
|
14663
|
+
self.mapTypes(parentNs, iterator, trait);
|
|
14664
|
+
}
|
|
14665
|
+
|
|
14580
14666
|
/**
|
|
14581
14667
|
* Traverse the selected trait.
|
|
14582
14668
|
*
|
|
14583
14669
|
* @param {String} cls
|
|
14584
14670
|
*/
|
|
14585
14671
|
function traverseTrait(cls) {
|
|
14586
|
-
return
|
|
14672
|
+
return traverse(cls, true);
|
|
14587
14673
|
}
|
|
14588
14674
|
|
|
14589
14675
|
/**
|
|
14590
|
-
* Traverse the selected super type
|
|
14676
|
+
* Traverse the selected super type
|
|
14591
14677
|
*
|
|
14592
14678
|
* @param {String} cls
|
|
14593
|
-
* @param {Boolean} [trait=false]
|
|
14594
14679
|
*/
|
|
14595
|
-
function traverseSuper(cls
|
|
14596
|
-
|
|
14597
|
-
self.mapTypes(parentNs, iterator, trait);
|
|
14680
|
+
function traverseSuper(cls) {
|
|
14681
|
+
return traverse(cls, false);
|
|
14598
14682
|
}
|
|
14599
14683
|
|
|
14600
14684
|
if (!type) {
|
|
@@ -14677,7 +14761,7 @@
|
|
|
14677
14761
|
throw new TypeError('property name must be a non-empty string');
|
|
14678
14762
|
}
|
|
14679
14763
|
|
|
14680
|
-
var property = this.
|
|
14764
|
+
var property = this.getProperty(target, name);
|
|
14681
14765
|
|
|
14682
14766
|
var propertyName = property && property.name;
|
|
14683
14767
|
|
|
@@ -14688,7 +14772,7 @@
|
|
|
14688
14772
|
if (property) {
|
|
14689
14773
|
delete target[propertyName];
|
|
14690
14774
|
} else {
|
|
14691
|
-
delete target.$attrs[name];
|
|
14775
|
+
delete target.$attrs[stripGlobal(name)];
|
|
14692
14776
|
}
|
|
14693
14777
|
} else {
|
|
14694
14778
|
|
|
@@ -14701,7 +14785,7 @@
|
|
|
14701
14785
|
defineProperty(target, property, value);
|
|
14702
14786
|
}
|
|
14703
14787
|
} else {
|
|
14704
|
-
target.$attrs[name] = value;
|
|
14788
|
+
target.$attrs[stripGlobal(name)] = value;
|
|
14705
14789
|
}
|
|
14706
14790
|
}
|
|
14707
14791
|
};
|
|
@@ -14716,10 +14800,10 @@
|
|
|
14716
14800
|
*/
|
|
14717
14801
|
Properties.prototype.get = function(target, name) {
|
|
14718
14802
|
|
|
14719
|
-
var property = this.
|
|
14803
|
+
var property = this.getProperty(target, name);
|
|
14720
14804
|
|
|
14721
14805
|
if (!property) {
|
|
14722
|
-
return target.$attrs[name];
|
|
14806
|
+
return target.$attrs[stripGlobal(name)];
|
|
14723
14807
|
}
|
|
14724
14808
|
|
|
14725
14809
|
var propertyName = property.name;
|
|
@@ -14773,6 +14857,44 @@
|
|
|
14773
14857
|
this.define(target, '$model', { value: model });
|
|
14774
14858
|
};
|
|
14775
14859
|
|
|
14860
|
+
/**
|
|
14861
|
+
* Return property with the given name on the element.
|
|
14862
|
+
*
|
|
14863
|
+
* @param {any} target
|
|
14864
|
+
* @param {string} name
|
|
14865
|
+
*
|
|
14866
|
+
* @return {object | null} property
|
|
14867
|
+
*/
|
|
14868
|
+
Properties.prototype.getProperty = function(target, name) {
|
|
14869
|
+
|
|
14870
|
+
var model = this.model;
|
|
14871
|
+
|
|
14872
|
+
var property = model.getPropertyDescriptor(target, name);
|
|
14873
|
+
|
|
14874
|
+
if (property) {
|
|
14875
|
+
return property;
|
|
14876
|
+
}
|
|
14877
|
+
|
|
14878
|
+
if (name.includes(':')) {
|
|
14879
|
+
return null;
|
|
14880
|
+
}
|
|
14881
|
+
|
|
14882
|
+
const strict = model.config.strict;
|
|
14883
|
+
|
|
14884
|
+
if (typeof strict !== 'undefined') {
|
|
14885
|
+
const error = new TypeError(`unknown property <${ name }> on <${ target.$type }>`);
|
|
14886
|
+
|
|
14887
|
+
if (strict) {
|
|
14888
|
+
throw error;
|
|
14889
|
+
} else {
|
|
14890
|
+
|
|
14891
|
+
// eslint-disable-next-line no-undef
|
|
14892
|
+
typeof console !== 'undefined' && console.warn(error);
|
|
14893
|
+
}
|
|
14894
|
+
}
|
|
14895
|
+
|
|
14896
|
+
return null;
|
|
14897
|
+
};
|
|
14776
14898
|
|
|
14777
14899
|
function isUndefined(val) {
|
|
14778
14900
|
return typeof val === 'undefined';
|
|
@@ -14787,6 +14909,10 @@
|
|
|
14787
14909
|
});
|
|
14788
14910
|
}
|
|
14789
14911
|
|
|
14912
|
+
function stripGlobal(name) {
|
|
14913
|
+
return name.replace(/^:/, '');
|
|
14914
|
+
}
|
|
14915
|
+
|
|
14790
14916
|
// Moddle implementation /////////////////////////////////////////////////
|
|
14791
14917
|
|
|
14792
14918
|
/**
|
|
@@ -14809,8 +14935,10 @@
|
|
|
14809
14935
|
* var moddle = new Moddle([pkg]);
|
|
14810
14936
|
*
|
|
14811
14937
|
* @param {Array<Package>} packages the packages to contain
|
|
14938
|
+
*
|
|
14939
|
+
* @param { { strict?: boolean } } [config] moddle configuration
|
|
14812
14940
|
*/
|
|
14813
|
-
function Moddle(packages) {
|
|
14941
|
+
function Moddle(packages, config = {}) {
|
|
14814
14942
|
|
|
14815
14943
|
this.properties = new Properties(this);
|
|
14816
14944
|
|
|
@@ -14818,6 +14946,8 @@
|
|
|
14818
14946
|
this.registry = new Registry(packages, this.properties);
|
|
14819
14947
|
|
|
14820
14948
|
this.typeCache = {};
|
|
14949
|
+
|
|
14950
|
+
this.config = config;
|
|
14821
14951
|
}
|
|
14822
14952
|
|
|
14823
14953
|
|
|
@@ -14911,6 +15041,12 @@
|
|
|
14911
15041
|
$type: name,
|
|
14912
15042
|
$instanceOf: function(type) {
|
|
14913
15043
|
return type === this.$type;
|
|
15044
|
+
},
|
|
15045
|
+
get: function(key) {
|
|
15046
|
+
return this[key];
|
|
15047
|
+
},
|
|
15048
|
+
set: function(key, value) {
|
|
15049
|
+
set$1(this, [ key ], value);
|
|
14914
15050
|
}
|
|
14915
15051
|
};
|
|
14916
15052
|
|
|
@@ -14926,6 +15062,8 @@
|
|
|
14926
15062
|
|
|
14927
15063
|
this.properties.defineDescriptor(element, descriptor);
|
|
14928
15064
|
this.properties.defineModel(element, this);
|
|
15065
|
+
this.properties.define(element, 'get', { enumerable: false, writable: true });
|
|
15066
|
+
this.properties.define(element, 'set', { enumerable: false, writable: true });
|
|
14929
15067
|
this.properties.define(element, '$parent', { enumerable: false, writable: true });
|
|
14930
15068
|
this.properties.define(element, '$instanceOf', { enumerable: false, writable: true });
|
|
14931
15069
|
|