bpmn-js 10.0.0 → 10.1.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/bpmn-modeler.development.js +1633 -1345
- package/dist/bpmn-modeler.production.min.js +8 -8
- package/dist/bpmn-navigated-viewer.development.js +1001 -779
- package/dist/bpmn-navigated-viewer.production.min.js +6 -6
- package/dist/bpmn-viewer.development.js +981 -759
- package/dist/bpmn-viewer.production.min.js +6 -6
- package/package.json +9 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* bpmn-js - bpmn-navigated-viewer v10.
|
|
2
|
+
* bpmn-js - bpmn-navigated-viewer v10.1.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) 2014-present, camunda Services GmbH
|
|
5
5
|
*
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Source Code: https://github.com/bpmn-io/bpmn-js
|
|
10
10
|
*
|
|
11
|
-
* Date: 2022-09-
|
|
11
|
+
* Date: 2022-09-30
|
|
12
12
|
*/
|
|
13
13
|
(function (global, factory) {
|
|
14
14
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
@@ -26,30 +26,45 @@
|
|
|
26
26
|
* @return {Array<?>}
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
const nativeToString$4 = Object.prototype.toString;
|
|
30
|
+
const nativeHasOwnProperty$3 = Object.prototype.hasOwnProperty;
|
|
31
|
+
|
|
32
|
+
function isUndefined$4(obj) {
|
|
32
33
|
return obj === undefined;
|
|
33
34
|
}
|
|
35
|
+
|
|
34
36
|
function isDefined(obj) {
|
|
35
37
|
return obj !== undefined;
|
|
36
38
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
|
|
40
|
+
function isArray$4(obj) {
|
|
41
|
+
return nativeToString$4.call(obj) === '[object Array]';
|
|
39
42
|
}
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
|
|
44
|
+
function isObject$1(obj) {
|
|
45
|
+
return nativeToString$4.call(obj) === '[object Object]';
|
|
42
46
|
}
|
|
47
|
+
|
|
43
48
|
function isNumber(obj) {
|
|
44
|
-
return nativeToString$
|
|
49
|
+
return nativeToString$4.call(obj) === '[object Number]';
|
|
45
50
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
51
|
+
|
|
52
|
+
function isFunction$1(obj) {
|
|
53
|
+
const tag = nativeToString$4.call(obj);
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
tag === '[object Function]' ||
|
|
57
|
+
tag === '[object AsyncFunction]' ||
|
|
58
|
+
tag === '[object GeneratorFunction]' ||
|
|
59
|
+
tag === '[object AsyncGeneratorFunction]' ||
|
|
60
|
+
tag === '[object Proxy]'
|
|
61
|
+
);
|
|
49
62
|
}
|
|
50
|
-
|
|
51
|
-
|
|
63
|
+
|
|
64
|
+
function isString$3(obj) {
|
|
65
|
+
return nativeToString$4.call(obj) === '[object String]';
|
|
52
66
|
}
|
|
67
|
+
|
|
53
68
|
/**
|
|
54
69
|
* Return true, if target owns a property with the given key.
|
|
55
70
|
*
|
|
@@ -58,9 +73,8 @@
|
|
|
58
73
|
*
|
|
59
74
|
* @return {Boolean}
|
|
60
75
|
*/
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return nativeHasOwnProperty$1.call(target, key);
|
|
76
|
+
function has$3(target, key) {
|
|
77
|
+
return nativeHasOwnProperty$3.call(target, key);
|
|
64
78
|
}
|
|
65
79
|
|
|
66
80
|
/**
|
|
@@ -71,38 +85,25 @@
|
|
|
71
85
|
*
|
|
72
86
|
* @return {Object}
|
|
73
87
|
*/
|
|
88
|
+
function find$1(collection, matcher) {
|
|
74
89
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
90
|
+
matcher = toMatcher$1(matcher);
|
|
91
|
+
|
|
92
|
+
let match;
|
|
93
|
+
|
|
94
|
+
forEach$3(collection, function(val, key) {
|
|
79
95
|
if (matcher(val, key)) {
|
|
80
96
|
match = val;
|
|
97
|
+
|
|
81
98
|
return false;
|
|
82
99
|
}
|
|
83
100
|
});
|
|
101
|
+
|
|
84
102
|
return match;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Find element index in collection.
|
|
88
|
-
*
|
|
89
|
-
* @param {Array|Object} collection
|
|
90
|
-
* @param {Function} matcher
|
|
91
|
-
*
|
|
92
|
-
* @return {Object}
|
|
93
|
-
*/
|
|
94
103
|
|
|
95
|
-
function findIndex(collection, matcher) {
|
|
96
|
-
matcher = toMatcher(matcher);
|
|
97
|
-
var idx = isArray$2(collection) ? -1 : undefined;
|
|
98
|
-
forEach$1(collection, function (val, key) {
|
|
99
|
-
if (matcher(val, key)) {
|
|
100
|
-
idx = key;
|
|
101
|
-
return false;
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
return idx;
|
|
105
104
|
}
|
|
105
|
+
|
|
106
|
+
|
|
106
107
|
/**
|
|
107
108
|
* Find element in collection.
|
|
108
109
|
*
|
|
@@ -111,16 +112,20 @@
|
|
|
111
112
|
*
|
|
112
113
|
* @return {Array} result
|
|
113
114
|
*/
|
|
115
|
+
function filter$1(collection, matcher) {
|
|
114
116
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
forEach$
|
|
117
|
+
let result = [];
|
|
118
|
+
|
|
119
|
+
forEach$3(collection, function(val, key) {
|
|
118
120
|
if (matcher(val, key)) {
|
|
119
121
|
result.push(val);
|
|
120
122
|
}
|
|
121
123
|
});
|
|
124
|
+
|
|
122
125
|
return result;
|
|
123
126
|
}
|
|
127
|
+
|
|
128
|
+
|
|
124
129
|
/**
|
|
125
130
|
* Iterate over collection; returning something
|
|
126
131
|
* (non-undefined) will stop iteration.
|
|
@@ -130,19 +135,22 @@
|
|
|
130
135
|
*
|
|
131
136
|
* @return {Object} return result that stopped the iteration
|
|
132
137
|
*/
|
|
138
|
+
function forEach$3(collection, iterator) {
|
|
133
139
|
|
|
134
|
-
|
|
135
|
-
|
|
140
|
+
let val,
|
|
141
|
+
result;
|
|
136
142
|
|
|
137
|
-
if (isUndefined$
|
|
143
|
+
if (isUndefined$4(collection)) {
|
|
138
144
|
return;
|
|
139
145
|
}
|
|
140
146
|
|
|
141
|
-
|
|
147
|
+
const convertKey = isArray$4(collection) ? toNum$3 : identity$3;
|
|
142
148
|
|
|
143
|
-
for (
|
|
144
|
-
|
|
149
|
+
for (let key in collection) {
|
|
150
|
+
|
|
151
|
+
if (has$3(collection, key)) {
|
|
145
152
|
val = collection[key];
|
|
153
|
+
|
|
146
154
|
result = iterator(val, convertKey(key));
|
|
147
155
|
|
|
148
156
|
if (result === false) {
|
|
@@ -151,6 +159,8 @@
|
|
|
151
159
|
}
|
|
152
160
|
}
|
|
153
161
|
}
|
|
162
|
+
|
|
163
|
+
|
|
154
164
|
/**
|
|
155
165
|
* Reduce collection, returning a single result.
|
|
156
166
|
*
|
|
@@ -160,13 +170,16 @@
|
|
|
160
170
|
*
|
|
161
171
|
* @return {Any} result returned from last iterator
|
|
162
172
|
*/
|
|
163
|
-
|
|
164
173
|
function reduce(collection, iterator, result) {
|
|
165
|
-
|
|
174
|
+
|
|
175
|
+
forEach$3(collection, function(value, idx) {
|
|
166
176
|
result = iterator(result, value, idx);
|
|
167
177
|
});
|
|
178
|
+
|
|
168
179
|
return result;
|
|
169
180
|
}
|
|
181
|
+
|
|
182
|
+
|
|
170
183
|
/**
|
|
171
184
|
* Return true if every element in the collection
|
|
172
185
|
* matches the criteria.
|
|
@@ -176,12 +189,14 @@
|
|
|
176
189
|
*
|
|
177
190
|
* @return {Boolean}
|
|
178
191
|
*/
|
|
179
|
-
|
|
180
192
|
function every(collection, matcher) {
|
|
181
|
-
|
|
193
|
+
|
|
194
|
+
return !!reduce(collection, function(matches, val, key) {
|
|
182
195
|
return matches && matcher(val, key);
|
|
183
196
|
}, true);
|
|
184
197
|
}
|
|
198
|
+
|
|
199
|
+
|
|
185
200
|
/**
|
|
186
201
|
* Return true if some elements in the collection
|
|
187
202
|
* match the criteria.
|
|
@@ -191,10 +206,12 @@
|
|
|
191
206
|
*
|
|
192
207
|
* @return {Boolean}
|
|
193
208
|
*/
|
|
194
|
-
|
|
195
209
|
function some(collection, matcher) {
|
|
196
|
-
|
|
210
|
+
|
|
211
|
+
return !!find$1(collection, matcher);
|
|
197
212
|
}
|
|
213
|
+
|
|
214
|
+
|
|
198
215
|
/**
|
|
199
216
|
* Transform a collection into another collection
|
|
200
217
|
* by piping each member through the given fn.
|
|
@@ -204,14 +221,18 @@
|
|
|
204
221
|
*
|
|
205
222
|
* @return {Array} transformed collection
|
|
206
223
|
*/
|
|
224
|
+
function map$1(collection, fn) {
|
|
207
225
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
forEach$
|
|
226
|
+
let result = [];
|
|
227
|
+
|
|
228
|
+
forEach$3(collection, function(val, key) {
|
|
211
229
|
result.push(fn(val, key));
|
|
212
230
|
});
|
|
231
|
+
|
|
213
232
|
return result;
|
|
214
233
|
}
|
|
234
|
+
|
|
235
|
+
|
|
215
236
|
/**
|
|
216
237
|
* Create an object pattern matcher.
|
|
217
238
|
*
|
|
@@ -225,26 +246,30 @@
|
|
|
225
246
|
*
|
|
226
247
|
* @return {Function} matcherFn
|
|
227
248
|
*/
|
|
228
|
-
|
|
229
249
|
function matchPattern(pattern) {
|
|
230
|
-
|
|
231
|
-
|
|
250
|
+
|
|
251
|
+
return function(el) {
|
|
252
|
+
|
|
253
|
+
return every(pattern, function(val, key) {
|
|
232
254
|
return el[key] === val;
|
|
233
255
|
});
|
|
256
|
+
|
|
234
257
|
};
|
|
235
258
|
}
|
|
236
259
|
|
|
237
|
-
|
|
238
|
-
|
|
260
|
+
|
|
261
|
+
function toMatcher$1(matcher) {
|
|
262
|
+
return isFunction$1(matcher) ? matcher : (e) => {
|
|
239
263
|
return e === matcher;
|
|
240
264
|
};
|
|
241
265
|
}
|
|
242
266
|
|
|
243
|
-
|
|
267
|
+
|
|
268
|
+
function identity$3(arg) {
|
|
244
269
|
return arg;
|
|
245
270
|
}
|
|
246
271
|
|
|
247
|
-
function toNum$
|
|
272
|
+
function toNum$3(arg) {
|
|
248
273
|
return Number(arg);
|
|
249
274
|
}
|
|
250
275
|
|
|
@@ -261,20 +286,26 @@
|
|
|
261
286
|
* @return {Function} debounced function
|
|
262
287
|
*/
|
|
263
288
|
function debounce(fn, timeout) {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
289
|
+
|
|
290
|
+
let timer;
|
|
291
|
+
|
|
292
|
+
let lastArgs;
|
|
293
|
+
let lastThis;
|
|
294
|
+
|
|
295
|
+
let lastNow;
|
|
268
296
|
|
|
269
297
|
function fire(force) {
|
|
270
|
-
|
|
271
|
-
|
|
298
|
+
|
|
299
|
+
let now = Date.now();
|
|
300
|
+
|
|
301
|
+
let scheduledDiff = force ? 0 : (lastNow + timeout) - now;
|
|
272
302
|
|
|
273
303
|
if (scheduledDiff > 0) {
|
|
274
304
|
return schedule(scheduledDiff);
|
|
275
305
|
}
|
|
276
306
|
|
|
277
307
|
fn.apply(lastThis, lastArgs);
|
|
308
|
+
|
|
278
309
|
clear();
|
|
279
310
|
}
|
|
280
311
|
|
|
@@ -298,16 +329,13 @@
|
|
|
298
329
|
clear();
|
|
299
330
|
}
|
|
300
331
|
|
|
301
|
-
function callback() {
|
|
332
|
+
function callback(...args) {
|
|
302
333
|
lastNow = Date.now();
|
|
303
334
|
|
|
304
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
305
|
-
args[_key] = arguments[_key];
|
|
306
|
-
}
|
|
307
|
-
|
|
308
335
|
lastArgs = args;
|
|
309
|
-
lastThis = this;
|
|
336
|
+
lastThis = this;
|
|
310
337
|
|
|
338
|
+
// ensure an execution is scheduled
|
|
311
339
|
if (!timer) {
|
|
312
340
|
schedule(timeout);
|
|
313
341
|
}
|
|
@@ -315,8 +343,10 @@
|
|
|
315
343
|
|
|
316
344
|
callback.flush = flush;
|
|
317
345
|
callback.cancel = clear;
|
|
346
|
+
|
|
318
347
|
return callback;
|
|
319
348
|
}
|
|
349
|
+
|
|
320
350
|
/**
|
|
321
351
|
* Bind function against target <this>.
|
|
322
352
|
*
|
|
@@ -325,29 +355,10 @@
|
|
|
325
355
|
*
|
|
326
356
|
* @return {Function} bound function
|
|
327
357
|
*/
|
|
328
|
-
|
|
329
|
-
function bind(fn, target) {
|
|
358
|
+
function bind$3(fn, target) {
|
|
330
359
|
return fn.bind(target);
|
|
331
360
|
}
|
|
332
361
|
|
|
333
|
-
function _extends() {
|
|
334
|
-
_extends = Object.assign || function (target) {
|
|
335
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
336
|
-
var source = arguments[i];
|
|
337
|
-
|
|
338
|
-
for (var key in source) {
|
|
339
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
340
|
-
target[key] = source[key];
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
return target;
|
|
346
|
-
};
|
|
347
|
-
|
|
348
|
-
return _extends.apply(this, arguments);
|
|
349
|
-
}
|
|
350
|
-
|
|
351
362
|
/**
|
|
352
363
|
* Convenience wrapper for `Object.assign`.
|
|
353
364
|
*
|
|
@@ -356,33 +367,10 @@
|
|
|
356
367
|
*
|
|
357
368
|
* @return {Object} the target
|
|
358
369
|
*/
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
for (var _len = arguments.length, others = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
362
|
-
others[_key - 1] = arguments[_key];
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
return _extends.apply(void 0, [target].concat(others));
|
|
370
|
+
function assign$4(target, ...others) {
|
|
371
|
+
return Object.assign(target, ...others);
|
|
366
372
|
}
|
|
367
|
-
/**
|
|
368
|
-
* Pick given properties from the target object.
|
|
369
|
-
*
|
|
370
|
-
* @param {Object} target
|
|
371
|
-
* @param {Array} properties
|
|
372
|
-
*
|
|
373
|
-
* @return {Object} target
|
|
374
|
-
*/
|
|
375
373
|
|
|
376
|
-
function pick(target, properties) {
|
|
377
|
-
var result = {};
|
|
378
|
-
var obj = Object(target);
|
|
379
|
-
forEach$1(properties, function (prop) {
|
|
380
|
-
if (prop in obj) {
|
|
381
|
-
result[prop] = target[prop];
|
|
382
|
-
}
|
|
383
|
-
});
|
|
384
|
-
return result;
|
|
385
|
-
}
|
|
386
374
|
/**
|
|
387
375
|
* Pick all target properties, excluding the given ones.
|
|
388
376
|
*
|
|
@@ -391,15 +379,19 @@
|
|
|
391
379
|
*
|
|
392
380
|
* @return {Object} target
|
|
393
381
|
*/
|
|
394
|
-
|
|
395
382
|
function omit(target, properties) {
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
383
|
+
|
|
384
|
+
let result = {};
|
|
385
|
+
|
|
386
|
+
let obj = Object(target);
|
|
387
|
+
|
|
388
|
+
forEach$3(obj, function(prop, key) {
|
|
389
|
+
|
|
399
390
|
if (properties.indexOf(key) === -1) {
|
|
400
391
|
result[key] = prop;
|
|
401
392
|
}
|
|
402
393
|
});
|
|
394
|
+
|
|
403
395
|
return result;
|
|
404
396
|
}
|
|
405
397
|
|
|
@@ -620,9 +612,11 @@
|
|
|
620
612
|
|
|
621
613
|
if (element.ownerDocument !== target.ownerDocument) {
|
|
622
614
|
try {
|
|
615
|
+
|
|
623
616
|
// may fail on webkit
|
|
624
617
|
return target.ownerDocument.importNode(element, true);
|
|
625
618
|
} catch (e) {
|
|
619
|
+
|
|
626
620
|
// ignore
|
|
627
621
|
}
|
|
628
622
|
}
|
|
@@ -748,6 +742,7 @@
|
|
|
748
742
|
var type = CSS_PROPERTIES[hyphenated];
|
|
749
743
|
|
|
750
744
|
if (type) {
|
|
745
|
+
|
|
751
746
|
// append pixel unit, unless present
|
|
752
747
|
if (type === LENGTH_ATTR && typeof value === 'number') {
|
|
753
748
|
value = String(value) + 'px';
|
|
@@ -793,38 +788,24 @@
|
|
|
793
788
|
}
|
|
794
789
|
|
|
795
790
|
/**
|
|
796
|
-
*
|
|
791
|
+
* Taken from https://github.com/component/classes
|
|
792
|
+
*
|
|
793
|
+
* Without the component bits.
|
|
797
794
|
*/
|
|
798
|
-
function index(arr, obj) {
|
|
799
|
-
if (arr.indexOf) {
|
|
800
|
-
return arr.indexOf(obj);
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
for (var i = 0; i < arr.length; ++i) {
|
|
805
|
-
if (arr[i] === obj) {
|
|
806
|
-
return i;
|
|
807
|
-
}
|
|
808
|
-
}
|
|
809
|
-
|
|
810
|
-
return -1;
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
var re$1 = /\s+/;
|
|
814
795
|
|
|
815
|
-
|
|
796
|
+
/**
|
|
797
|
+
* toString reference.
|
|
798
|
+
*/
|
|
816
799
|
|
|
817
|
-
|
|
818
|
-
return typeof o !== 'undefined';
|
|
819
|
-
}
|
|
800
|
+
const toString$1 = Object.prototype.toString;
|
|
820
801
|
|
|
821
802
|
/**
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
803
|
+
* Wrap `el` in a `ClassList`.
|
|
804
|
+
*
|
|
805
|
+
* @param {Element} el
|
|
806
|
+
* @return {ClassList}
|
|
807
|
+
* @api public
|
|
808
|
+
*/
|
|
828
809
|
|
|
829
810
|
function classes$1(el) {
|
|
830
811
|
return new ClassList$1(el);
|
|
@@ -839,79 +820,48 @@
|
|
|
839
820
|
}
|
|
840
821
|
|
|
841
822
|
/**
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
823
|
+
* Add class `name` if not already present.
|
|
824
|
+
*
|
|
825
|
+
* @param {String} name
|
|
826
|
+
* @return {ClassList}
|
|
827
|
+
* @api public
|
|
828
|
+
*/
|
|
848
829
|
|
|
849
830
|
ClassList$1.prototype.add = function(name) {
|
|
850
|
-
|
|
851
|
-
// classList
|
|
852
|
-
if (this.list) {
|
|
853
|
-
this.list.add(name);
|
|
854
|
-
return this;
|
|
855
|
-
}
|
|
856
|
-
|
|
857
|
-
// fallback
|
|
858
|
-
var arr = this.array();
|
|
859
|
-
var i = index(arr, name);
|
|
860
|
-
if (!~i) {
|
|
861
|
-
arr.push(name);
|
|
862
|
-
}
|
|
863
|
-
|
|
864
|
-
if (defined(this.el.className.baseVal)) {
|
|
865
|
-
this.el.className.baseVal = arr.join(' ');
|
|
866
|
-
} else {
|
|
867
|
-
this.el.className = arr.join(' ');
|
|
868
|
-
}
|
|
869
|
-
|
|
831
|
+
this.list.add(name);
|
|
870
832
|
return this;
|
|
871
833
|
};
|
|
872
834
|
|
|
873
835
|
/**
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
836
|
+
* Remove class `name` when present, or
|
|
837
|
+
* pass a regular expression to remove
|
|
838
|
+
* any which match.
|
|
839
|
+
*
|
|
840
|
+
* @param {String|RegExp} name
|
|
841
|
+
* @return {ClassList}
|
|
842
|
+
* @api public
|
|
843
|
+
*/
|
|
882
844
|
|
|
883
845
|
ClassList$1.prototype.remove = function(name) {
|
|
884
|
-
if ('[object RegExp]'
|
|
846
|
+
if ('[object RegExp]' == toString$1.call(name)) {
|
|
885
847
|
return this.removeMatching(name);
|
|
886
848
|
}
|
|
887
849
|
|
|
888
|
-
|
|
889
|
-
if (this.list) {
|
|
890
|
-
this.list.remove(name);
|
|
891
|
-
return this;
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
// fallback
|
|
895
|
-
var arr = this.array();
|
|
896
|
-
var i = index(arr, name);
|
|
897
|
-
if (~i) {
|
|
898
|
-
arr.splice(i, 1);
|
|
899
|
-
}
|
|
900
|
-
this.el.className.baseVal = arr.join(' ');
|
|
850
|
+
this.list.remove(name);
|
|
901
851
|
return this;
|
|
902
852
|
};
|
|
903
853
|
|
|
904
854
|
/**
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
855
|
+
* Remove all classes matching `re`.
|
|
856
|
+
*
|
|
857
|
+
* @param {RegExp} re
|
|
858
|
+
* @return {ClassList}
|
|
859
|
+
* @api private
|
|
860
|
+
*/
|
|
911
861
|
|
|
912
862
|
ClassList$1.prototype.removeMatching = function(re) {
|
|
913
|
-
|
|
914
|
-
for (
|
|
863
|
+
const arr = this.array();
|
|
864
|
+
for (let i = 0; i < arr.length; i++) {
|
|
915
865
|
if (re.test(arr[i])) {
|
|
916
866
|
this.remove(arr[i]);
|
|
917
867
|
}
|
|
@@ -920,81 +870,51 @@
|
|
|
920
870
|
};
|
|
921
871
|
|
|
922
872
|
/**
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
873
|
+
* Toggle class `name`, can force state via `force`.
|
|
874
|
+
*
|
|
875
|
+
* For browsers that support classList, but do not support `force` yet,
|
|
876
|
+
* the mistake will be detected and corrected.
|
|
877
|
+
*
|
|
878
|
+
* @param {String} name
|
|
879
|
+
* @param {Boolean} force
|
|
880
|
+
* @return {ClassList}
|
|
881
|
+
* @api public
|
|
882
|
+
*/
|
|
933
883
|
|
|
934
884
|
ClassList$1.prototype.toggle = function(name, force) {
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
if (force !== this.list.toggle(name, force)) {
|
|
939
|
-
this.list.toggle(name); // toggle again to correct
|
|
940
|
-
}
|
|
941
|
-
} else {
|
|
942
|
-
this.list.toggle(name);
|
|
943
|
-
}
|
|
944
|
-
return this;
|
|
945
|
-
}
|
|
946
|
-
|
|
947
|
-
// fallback
|
|
948
|
-
if (defined(force)) {
|
|
949
|
-
if (!force) {
|
|
950
|
-
this.remove(name);
|
|
951
|
-
} else {
|
|
952
|
-
this.add(name);
|
|
885
|
+
if ('undefined' !== typeof force) {
|
|
886
|
+
if (force !== this.list.toggle(name, force)) {
|
|
887
|
+
this.list.toggle(name); // toggle again to correct
|
|
953
888
|
}
|
|
954
889
|
} else {
|
|
955
|
-
|
|
956
|
-
this.remove(name);
|
|
957
|
-
} else {
|
|
958
|
-
this.add(name);
|
|
959
|
-
}
|
|
890
|
+
this.list.toggle(name);
|
|
960
891
|
}
|
|
961
|
-
|
|
962
892
|
return this;
|
|
963
893
|
};
|
|
964
894
|
|
|
965
895
|
/**
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
896
|
+
* Return an array of classes.
|
|
897
|
+
*
|
|
898
|
+
* @return {Array}
|
|
899
|
+
* @api public
|
|
900
|
+
*/
|
|
971
901
|
|
|
972
902
|
ClassList$1.prototype.array = function() {
|
|
973
|
-
|
|
974
|
-
var str = className.replace(/^\s+|\s+$/g, '');
|
|
975
|
-
var arr = str.split(re$1);
|
|
976
|
-
if ('' === arr[0]) {
|
|
977
|
-
arr.shift();
|
|
978
|
-
}
|
|
979
|
-
return arr;
|
|
903
|
+
return Array.from(this.list);
|
|
980
904
|
};
|
|
981
905
|
|
|
982
906
|
/**
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
907
|
+
* Check if class `name` is present.
|
|
908
|
+
*
|
|
909
|
+
* @param {String} name
|
|
910
|
+
* @return {ClassList}
|
|
911
|
+
* @api public
|
|
912
|
+
*/
|
|
989
913
|
|
|
990
914
|
ClassList$1.prototype.has =
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
this.list.contains(name) :
|
|
995
|
-
!! ~index(this.array(), name)
|
|
996
|
-
);
|
|
997
|
-
};
|
|
915
|
+
ClassList$1.prototype.contains = function(name) {
|
|
916
|
+
return this.list.contains(name);
|
|
917
|
+
};
|
|
998
918
|
|
|
999
919
|
function remove$2(element) {
|
|
1000
920
|
var parent = element.parentNode;
|
|
@@ -1046,6 +966,7 @@
|
|
|
1046
966
|
svg = SVG_START + svg.substring(4);
|
|
1047
967
|
}
|
|
1048
968
|
} else {
|
|
969
|
+
|
|
1049
970
|
// namespace svg
|
|
1050
971
|
svg = SVG_START + '>' + svg + '</svg>';
|
|
1051
972
|
unwrap = true;
|
|
@@ -1201,8 +1122,10 @@
|
|
|
1201
1122
|
var i, len, attrMap, attrNode, childNodes;
|
|
1202
1123
|
|
|
1203
1124
|
switch (node.nodeType) {
|
|
1125
|
+
|
|
1204
1126
|
// TEXT
|
|
1205
1127
|
case 3:
|
|
1128
|
+
|
|
1206
1129
|
// replace special XML characters
|
|
1207
1130
|
output.push(escape$1(node.textContent, TEXT_ENTITIES));
|
|
1208
1131
|
break;
|
|
@@ -1266,6 +1189,7 @@
|
|
|
1266
1189
|
}
|
|
1267
1190
|
|
|
1268
1191
|
if (!isFragment(parsed)) {
|
|
1192
|
+
|
|
1269
1193
|
// extract <svg> from parsed document
|
|
1270
1194
|
parsed = parsed.documentElement;
|
|
1271
1195
|
}
|
|
@@ -1536,6 +1460,21 @@
|
|
|
1536
1460
|
return componentsToPath(rectPath);
|
|
1537
1461
|
}
|
|
1538
1462
|
|
|
1463
|
+
function _mergeNamespaces$1(n, m) {
|
|
1464
|
+
m.forEach(function (e) {
|
|
1465
|
+
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
1466
|
+
if (k !== 'default' && !(k in n)) {
|
|
1467
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
1468
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
1469
|
+
enumerable: true,
|
|
1470
|
+
get: function () { return e[k]; }
|
|
1471
|
+
});
|
|
1472
|
+
}
|
|
1473
|
+
});
|
|
1474
|
+
});
|
|
1475
|
+
return Object.freeze(n);
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1539
1478
|
/**
|
|
1540
1479
|
* Flatten array, one level deep.
|
|
1541
1480
|
*
|
|
@@ -1544,13 +1483,13 @@
|
|
|
1544
1483
|
* @return {Array<?>}
|
|
1545
1484
|
*/
|
|
1546
1485
|
|
|
1547
|
-
var nativeToString = Object.prototype.toString;
|
|
1548
|
-
var nativeHasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1549
|
-
function isUndefined$
|
|
1486
|
+
var nativeToString$3 = Object.prototype.toString;
|
|
1487
|
+
var nativeHasOwnProperty$2 = Object.prototype.hasOwnProperty;
|
|
1488
|
+
function isUndefined$3(obj) {
|
|
1550
1489
|
return obj === undefined;
|
|
1551
1490
|
}
|
|
1552
|
-
function isArray$
|
|
1553
|
-
return nativeToString.call(obj) === '[object Array]';
|
|
1491
|
+
function isArray$3(obj) {
|
|
1492
|
+
return nativeToString$3.call(obj) === '[object Array]';
|
|
1554
1493
|
}
|
|
1555
1494
|
/**
|
|
1556
1495
|
* Return true, if target owns a property with the given key.
|
|
@@ -1561,8 +1500,8 @@
|
|
|
1561
1500
|
* @return {Boolean}
|
|
1562
1501
|
*/
|
|
1563
1502
|
|
|
1564
|
-
function has(target, key) {
|
|
1565
|
-
return nativeHasOwnProperty.call(target, key);
|
|
1503
|
+
function has$2(target, key) {
|
|
1504
|
+
return nativeHasOwnProperty$2.call(target, key);
|
|
1566
1505
|
}
|
|
1567
1506
|
/**
|
|
1568
1507
|
* Iterate over collection; returning something
|
|
@@ -1574,17 +1513,17 @@
|
|
|
1574
1513
|
* @return {Object} return result that stopped the iteration
|
|
1575
1514
|
*/
|
|
1576
1515
|
|
|
1577
|
-
function forEach(collection, iterator) {
|
|
1516
|
+
function forEach$2(collection, iterator) {
|
|
1578
1517
|
var val, result;
|
|
1579
1518
|
|
|
1580
|
-
if (isUndefined$
|
|
1519
|
+
if (isUndefined$3(collection)) {
|
|
1581
1520
|
return;
|
|
1582
1521
|
}
|
|
1583
1522
|
|
|
1584
|
-
var convertKey = isArray$
|
|
1523
|
+
var convertKey = isArray$3(collection) ? toNum$2 : identity$2;
|
|
1585
1524
|
|
|
1586
1525
|
for (var key in collection) {
|
|
1587
|
-
if (has(collection, key)) {
|
|
1526
|
+
if (has$2(collection, key)) {
|
|
1588
1527
|
val = collection[key];
|
|
1589
1528
|
result = iterator(val, convertKey(key));
|
|
1590
1529
|
|
|
@@ -1595,11 +1534,11 @@
|
|
|
1595
1534
|
}
|
|
1596
1535
|
}
|
|
1597
1536
|
|
|
1598
|
-
function identity(arg) {
|
|
1537
|
+
function identity$2(arg) {
|
|
1599
1538
|
return arg;
|
|
1600
1539
|
}
|
|
1601
1540
|
|
|
1602
|
-
function toNum(arg) {
|
|
1541
|
+
function toNum$2(arg) {
|
|
1603
1542
|
return Number(arg);
|
|
1604
1543
|
}
|
|
1605
1544
|
|
|
@@ -1611,19 +1550,15 @@
|
|
|
1611
1550
|
*
|
|
1612
1551
|
* @return {Element} the element
|
|
1613
1552
|
*/
|
|
1614
|
-
function assign$
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
for (var _len = arguments.length, styleSources = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
1618
|
-
styleSources[_key - 1] = arguments[_key];
|
|
1619
|
-
}
|
|
1553
|
+
function assign$3(element, ...styleSources) {
|
|
1554
|
+
const target = element.style;
|
|
1620
1555
|
|
|
1621
|
-
forEach(styleSources, function
|
|
1556
|
+
forEach$2(styleSources, function(style) {
|
|
1622
1557
|
if (!style) {
|
|
1623
1558
|
return;
|
|
1624
1559
|
}
|
|
1625
1560
|
|
|
1626
|
-
forEach(style, function
|
|
1561
|
+
forEach$2(style, function(value, key) {
|
|
1627
1562
|
target[key] = value;
|
|
1628
1563
|
});
|
|
1629
1564
|
});
|
|
@@ -1640,6 +1575,7 @@
|
|
|
1640
1575
|
* @api public
|
|
1641
1576
|
*/
|
|
1642
1577
|
function attr(el, name, val) {
|
|
1578
|
+
|
|
1643
1579
|
// get
|
|
1644
1580
|
if (arguments.length == 2) {
|
|
1645
1581
|
return el.getAttribute(name);
|
|
@@ -1656,33 +1592,17 @@
|
|
|
1656
1592
|
return el;
|
|
1657
1593
|
}
|
|
1658
1594
|
|
|
1659
|
-
var indexOf = [].indexOf;
|
|
1660
|
-
|
|
1661
|
-
var indexof = function(arr, obj){
|
|
1662
|
-
if (indexOf) return arr.indexOf(obj);
|
|
1663
|
-
for (var i = 0; i < arr.length; ++i) {
|
|
1664
|
-
if (arr[i] === obj) return i;
|
|
1665
|
-
}
|
|
1666
|
-
return -1;
|
|
1667
|
-
};
|
|
1668
|
-
|
|
1669
1595
|
/**
|
|
1670
1596
|
* Taken from https://github.com/component/classes
|
|
1671
1597
|
*
|
|
1672
1598
|
* Without the component bits.
|
|
1673
1599
|
*/
|
|
1674
1600
|
|
|
1675
|
-
/**
|
|
1676
|
-
* Whitespace regexp.
|
|
1677
|
-
*/
|
|
1678
|
-
|
|
1679
|
-
var re = /\s+/;
|
|
1680
|
-
|
|
1681
1601
|
/**
|
|
1682
1602
|
* toString reference.
|
|
1683
1603
|
*/
|
|
1684
1604
|
|
|
1685
|
-
|
|
1605
|
+
const toString = Object.prototype.toString;
|
|
1686
1606
|
|
|
1687
1607
|
/**
|
|
1688
1608
|
* Wrap `el` in a `ClassList`.
|
|
@@ -1719,18 +1639,8 @@
|
|
|
1719
1639
|
* @api public
|
|
1720
1640
|
*/
|
|
1721
1641
|
|
|
1722
|
-
ClassList.prototype.add = function
|
|
1723
|
-
|
|
1724
|
-
if (this.list) {
|
|
1725
|
-
this.list.add(name);
|
|
1726
|
-
return this;
|
|
1727
|
-
}
|
|
1728
|
-
|
|
1729
|
-
// fallback
|
|
1730
|
-
var arr = this.array();
|
|
1731
|
-
var i = indexof(arr, name);
|
|
1732
|
-
if (!~i) arr.push(name);
|
|
1733
|
-
this.el.className = arr.join(' ');
|
|
1642
|
+
ClassList.prototype.add = function(name) {
|
|
1643
|
+
this.list.add(name);
|
|
1734
1644
|
return this;
|
|
1735
1645
|
};
|
|
1736
1646
|
|
|
@@ -1744,22 +1654,12 @@
|
|
|
1744
1654
|
* @api public
|
|
1745
1655
|
*/
|
|
1746
1656
|
|
|
1747
|
-
ClassList.prototype.remove = function
|
|
1657
|
+
ClassList.prototype.remove = function(name) {
|
|
1748
1658
|
if ('[object RegExp]' == toString.call(name)) {
|
|
1749
1659
|
return this.removeMatching(name);
|
|
1750
1660
|
}
|
|
1751
1661
|
|
|
1752
|
-
|
|
1753
|
-
if (this.list) {
|
|
1754
|
-
this.list.remove(name);
|
|
1755
|
-
return this;
|
|
1756
|
-
}
|
|
1757
|
-
|
|
1758
|
-
// fallback
|
|
1759
|
-
var arr = this.array();
|
|
1760
|
-
var i = indexof(arr, name);
|
|
1761
|
-
if (~i) arr.splice(i, 1);
|
|
1762
|
-
this.el.className = arr.join(' ');
|
|
1662
|
+
this.list.remove(name);
|
|
1763
1663
|
return this;
|
|
1764
1664
|
};
|
|
1765
1665
|
|
|
@@ -1771,9 +1671,9 @@
|
|
|
1771
1671
|
* @api private
|
|
1772
1672
|
*/
|
|
1773
1673
|
|
|
1774
|
-
ClassList.prototype.removeMatching = function
|
|
1775
|
-
|
|
1776
|
-
for (
|
|
1674
|
+
ClassList.prototype.removeMatching = function(re) {
|
|
1675
|
+
const arr = this.array();
|
|
1676
|
+
for (let i = 0; i < arr.length; i++) {
|
|
1777
1677
|
if (re.test(arr[i])) {
|
|
1778
1678
|
this.remove(arr[i]);
|
|
1779
1679
|
}
|
|
@@ -1793,34 +1693,14 @@
|
|
|
1793
1693
|
* @api public
|
|
1794
1694
|
*/
|
|
1795
1695
|
|
|
1796
|
-
ClassList.prototype.toggle = function
|
|
1797
|
-
// classList
|
|
1798
|
-
if (this.list) {
|
|
1799
|
-
if ('undefined' !== typeof force) {
|
|
1800
|
-
if (force !== this.list.toggle(name, force)) {
|
|
1801
|
-
this.list.toggle(name); // toggle again to correct
|
|
1802
|
-
}
|
|
1803
|
-
} else {
|
|
1804
|
-
this.list.toggle(name);
|
|
1805
|
-
}
|
|
1806
|
-
return this;
|
|
1807
|
-
}
|
|
1808
|
-
|
|
1809
|
-
// fallback
|
|
1696
|
+
ClassList.prototype.toggle = function(name, force) {
|
|
1810
1697
|
if ('undefined' !== typeof force) {
|
|
1811
|
-
if (
|
|
1812
|
-
this.
|
|
1813
|
-
} else {
|
|
1814
|
-
this.add(name);
|
|
1698
|
+
if (force !== this.list.toggle(name, force)) {
|
|
1699
|
+
this.list.toggle(name); // toggle again to correct
|
|
1815
1700
|
}
|
|
1816
1701
|
} else {
|
|
1817
|
-
|
|
1818
|
-
this.remove(name);
|
|
1819
|
-
} else {
|
|
1820
|
-
this.add(name);
|
|
1821
|
-
}
|
|
1702
|
+
this.list.toggle(name);
|
|
1822
1703
|
}
|
|
1823
|
-
|
|
1824
1704
|
return this;
|
|
1825
1705
|
};
|
|
1826
1706
|
|
|
@@ -1831,12 +1711,8 @@
|
|
|
1831
1711
|
* @api public
|
|
1832
1712
|
*/
|
|
1833
1713
|
|
|
1834
|
-
ClassList.prototype.array = function
|
|
1835
|
-
|
|
1836
|
-
var str = className.replace(/^\s+|\s+$/g, '');
|
|
1837
|
-
var arr = str.split(re);
|
|
1838
|
-
if ('' === arr[0]) arr.shift();
|
|
1839
|
-
return arr;
|
|
1714
|
+
ClassList.prototype.array = function() {
|
|
1715
|
+
return Array.from(this.list);
|
|
1840
1716
|
};
|
|
1841
1717
|
|
|
1842
1718
|
/**
|
|
@@ -1847,8 +1723,9 @@
|
|
|
1847
1723
|
* @api public
|
|
1848
1724
|
*/
|
|
1849
1725
|
|
|
1850
|
-
ClassList.prototype.has =
|
|
1851
|
-
|
|
1726
|
+
ClassList.prototype.has =
|
|
1727
|
+
ClassList.prototype.contains = function(name) {
|
|
1728
|
+
return this.list.contains(name);
|
|
1852
1729
|
};
|
|
1853
1730
|
|
|
1854
1731
|
/**
|
|
@@ -1866,33 +1743,14 @@
|
|
|
1866
1743
|
return el;
|
|
1867
1744
|
}
|
|
1868
1745
|
|
|
1869
|
-
var proto = typeof Element !== 'undefined' ? Element.prototype : {};
|
|
1870
|
-
var vendor = proto.matches
|
|
1871
|
-
|| proto.matchesSelector
|
|
1872
|
-
|| proto.webkitMatchesSelector
|
|
1873
|
-
|| proto.mozMatchesSelector
|
|
1874
|
-
|| proto.msMatchesSelector
|
|
1875
|
-
|| proto.oMatchesSelector;
|
|
1876
|
-
|
|
1877
|
-
var matchesSelector = match;
|
|
1878
|
-
|
|
1879
1746
|
/**
|
|
1880
|
-
*
|
|
1747
|
+
* @param { HTMLElement } element
|
|
1748
|
+
* @param { String } selector
|
|
1881
1749
|
*
|
|
1882
|
-
* @
|
|
1883
|
-
* @param {String} selector
|
|
1884
|
-
* @return {Boolean}
|
|
1885
|
-
* @api public
|
|
1750
|
+
* @return { boolean }
|
|
1886
1751
|
*/
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
if (!el || el.nodeType !== 1) return false;
|
|
1890
|
-
if (vendor) return vendor.call(el, selector);
|
|
1891
|
-
var nodes = el.parentNode.querySelectorAll(selector);
|
|
1892
|
-
for (var i = 0; i < nodes.length; i++) {
|
|
1893
|
-
if (nodes[i] == el) return true;
|
|
1894
|
-
}
|
|
1895
|
-
return false;
|
|
1752
|
+
function matches(element, selector) {
|
|
1753
|
+
return element && typeof element.matches === 'function' && element.matches(selector);
|
|
1896
1754
|
}
|
|
1897
1755
|
|
|
1898
1756
|
/**
|
|
@@ -1902,23 +1760,26 @@
|
|
|
1902
1760
|
* @param {String} selector
|
|
1903
1761
|
* @param {Boolean} checkYourSelf (optional)
|
|
1904
1762
|
*/
|
|
1905
|
-
function closest
|
|
1763
|
+
function closest(element, selector, checkYourSelf) {
|
|
1906
1764
|
var currentElem = checkYourSelf ? element : element.parentNode;
|
|
1907
1765
|
|
|
1908
|
-
while (currentElem && currentElem.nodeType !== document.DOCUMENT_NODE &&
|
|
1766
|
+
while (currentElem && currentElem.nodeType !== document.DOCUMENT_NODE &&
|
|
1767
|
+
currentElem.nodeType !== document.DOCUMENT_FRAGMENT_NODE) {
|
|
1909
1768
|
|
|
1910
|
-
if (
|
|
1769
|
+
if (matches(currentElem, selector)) {
|
|
1911
1770
|
return currentElem;
|
|
1912
1771
|
}
|
|
1913
1772
|
|
|
1914
1773
|
currentElem = currentElem.parentNode;
|
|
1915
1774
|
}
|
|
1916
1775
|
|
|
1917
|
-
return
|
|
1776
|
+
return matches(currentElem, selector) ? currentElem : null;
|
|
1918
1777
|
}
|
|
1919
1778
|
|
|
1779
|
+
var componentEvent = {};
|
|
1780
|
+
|
|
1920
1781
|
var bind$1 = window.addEventListener ? 'addEventListener' : 'attachEvent',
|
|
1921
|
-
unbind = window.removeEventListener ? 'removeEventListener' : 'detachEvent',
|
|
1782
|
+
unbind$1 = window.removeEventListener ? 'removeEventListener' : 'detachEvent',
|
|
1922
1783
|
prefix$6 = bind$1 !== 'addEventListener' ? 'on' : '';
|
|
1923
1784
|
|
|
1924
1785
|
/**
|
|
@@ -1932,7 +1793,7 @@
|
|
|
1932
1793
|
* @api public
|
|
1933
1794
|
*/
|
|
1934
1795
|
|
|
1935
|
-
var bind_1 = function(el, type, fn, capture){
|
|
1796
|
+
var bind_1 = componentEvent.bind = function(el, type, fn, capture){
|
|
1936
1797
|
el[bind$1](prefix$6 + type, fn, capture || false);
|
|
1937
1798
|
return fn;
|
|
1938
1799
|
};
|
|
@@ -1948,15 +1809,17 @@
|
|
|
1948
1809
|
* @api public
|
|
1949
1810
|
*/
|
|
1950
1811
|
|
|
1951
|
-
var unbind_1 = function(el, type, fn, capture){
|
|
1952
|
-
el[unbind](prefix$6 + type, fn, capture || false);
|
|
1812
|
+
var unbind_1 = componentEvent.unbind = function(el, type, fn, capture){
|
|
1813
|
+
el[unbind$1](prefix$6 + type, fn, capture || false);
|
|
1953
1814
|
return fn;
|
|
1954
1815
|
};
|
|
1955
1816
|
|
|
1956
|
-
var
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1817
|
+
var event = /*#__PURE__*/_mergeNamespaces$1({
|
|
1818
|
+
__proto__: null,
|
|
1819
|
+
bind: bind_1,
|
|
1820
|
+
unbind: unbind_1,
|
|
1821
|
+
'default': componentEvent
|
|
1822
|
+
}, [componentEvent]);
|
|
1960
1823
|
|
|
1961
1824
|
/**
|
|
1962
1825
|
* Module dependencies.
|
|
@@ -1978,14 +1841,14 @@
|
|
|
1978
1841
|
|
|
1979
1842
|
// Some events don't bubble, so we want to bind to the capture phase instead
|
|
1980
1843
|
// when delegating.
|
|
1981
|
-
var forceCaptureEvents = ['focus', 'blur'];
|
|
1844
|
+
var forceCaptureEvents = [ 'focus', 'blur' ];
|
|
1982
1845
|
|
|
1983
1846
|
function bind$2(el, selector, type, fn, capture) {
|
|
1984
1847
|
if (forceCaptureEvents.indexOf(type) !== -1) {
|
|
1985
1848
|
capture = true;
|
|
1986
1849
|
}
|
|
1987
1850
|
|
|
1988
|
-
return
|
|
1851
|
+
return event.bind(el, type, function(e) {
|
|
1989
1852
|
var target = e.target || e.srcElement;
|
|
1990
1853
|
e.delegateTarget = closest(target, selector, true);
|
|
1991
1854
|
if (e.delegateTarget) {
|
|
@@ -2003,17 +1866,17 @@
|
|
|
2003
1866
|
* @param {Boolean} capture
|
|
2004
1867
|
* @api public
|
|
2005
1868
|
*/
|
|
2006
|
-
function unbind
|
|
1869
|
+
function unbind(el, type, fn, capture) {
|
|
2007
1870
|
if (forceCaptureEvents.indexOf(type) !== -1) {
|
|
2008
1871
|
capture = true;
|
|
2009
1872
|
}
|
|
2010
1873
|
|
|
2011
|
-
return
|
|
1874
|
+
return event.unbind(el, type, fn, capture);
|
|
2012
1875
|
}
|
|
2013
1876
|
|
|
2014
1877
|
var delegate = {
|
|
2015
1878
|
bind: bind$2,
|
|
2016
|
-
unbind
|
|
1879
|
+
unbind
|
|
2017
1880
|
};
|
|
2018
1881
|
|
|
2019
1882
|
/**
|
|
@@ -2042,7 +1905,7 @@
|
|
|
2042
1905
|
* Wrap map from jquery.
|
|
2043
1906
|
*/
|
|
2044
1907
|
|
|
2045
|
-
var map
|
|
1908
|
+
var map = {
|
|
2046
1909
|
legend: [1, '<fieldset>', '</fieldset>'],
|
|
2047
1910
|
tr: [2, '<table><tbody>', '</tbody></table>'],
|
|
2048
1911
|
col: [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
|
|
@@ -2051,27 +1914,27 @@
|
|
|
2051
1914
|
_default: innerHTMLBug ? [1, 'X<div>', '</div>'] : [0, '', '']
|
|
2052
1915
|
};
|
|
2053
1916
|
|
|
2054
|
-
map
|
|
2055
|
-
map
|
|
1917
|
+
map.td =
|
|
1918
|
+
map.th = [3, '<table><tbody><tr>', '</tr></tbody></table>'];
|
|
2056
1919
|
|
|
2057
|
-
map
|
|
2058
|
-
map
|
|
1920
|
+
map.option =
|
|
1921
|
+
map.optgroup = [1, '<select multiple="multiple">', '</select>'];
|
|
2059
1922
|
|
|
2060
|
-
map
|
|
2061
|
-
map
|
|
2062
|
-
map
|
|
2063
|
-
map
|
|
2064
|
-
map
|
|
1923
|
+
map.thead =
|
|
1924
|
+
map.tbody =
|
|
1925
|
+
map.colgroup =
|
|
1926
|
+
map.caption =
|
|
1927
|
+
map.tfoot = [1, '<table>', '</table>'];
|
|
2065
1928
|
|
|
2066
|
-
map
|
|
2067
|
-
map
|
|
2068
|
-
map
|
|
2069
|
-
map
|
|
2070
|
-
map
|
|
2071
|
-
map
|
|
2072
|
-
map
|
|
2073
|
-
map
|
|
2074
|
-
map
|
|
1929
|
+
map.polyline =
|
|
1930
|
+
map.ellipse =
|
|
1931
|
+
map.polygon =
|
|
1932
|
+
map.circle =
|
|
1933
|
+
map.text =
|
|
1934
|
+
map.line =
|
|
1935
|
+
map.path =
|
|
1936
|
+
map.rect =
|
|
1937
|
+
map.g = [1, '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">','</svg>'];
|
|
2075
1938
|
|
|
2076
1939
|
/**
|
|
2077
1940
|
* Parse `html` and return a DOM Node instance, which could be a TextNode,
|
|
@@ -2106,7 +1969,7 @@
|
|
|
2106
1969
|
}
|
|
2107
1970
|
|
|
2108
1971
|
// wrap map
|
|
2109
|
-
var wrap = map
|
|
1972
|
+
var wrap = Object.prototype.hasOwnProperty.call(map, tag) ? map[tag] : map._default;
|
|
2110
1973
|
var depth = wrap[0];
|
|
2111
1974
|
var prefix = wrap[1];
|
|
2112
1975
|
var suffix = wrap[2];
|
|
@@ -2128,6 +1991,8 @@
|
|
|
2128
1991
|
return fragment;
|
|
2129
1992
|
}
|
|
2130
1993
|
|
|
1994
|
+
var domify$1 = domify;
|
|
1995
|
+
|
|
2131
1996
|
function query(selector, el) {
|
|
2132
1997
|
el = el || document;
|
|
2133
1998
|
|
|
@@ -2379,7 +2244,7 @@
|
|
|
2379
2244
|
var computeStyle = styles.computeStyle;
|
|
2380
2245
|
|
|
2381
2246
|
function addMarker(id, options) {
|
|
2382
|
-
var attrs = assign({
|
|
2247
|
+
var attrs = assign$4({
|
|
2383
2248
|
fill: black,
|
|
2384
2249
|
strokeWidth: 1,
|
|
2385
2250
|
strokeLinecap: 'round',
|
|
@@ -2551,7 +2416,7 @@
|
|
|
2551
2416
|
|
|
2552
2417
|
function drawCircle(parentGfx, width, height, offset, attrs) {
|
|
2553
2418
|
|
|
2554
|
-
if (isObject(offset)) {
|
|
2419
|
+
if (isObject$1(offset)) {
|
|
2555
2420
|
attrs = offset;
|
|
2556
2421
|
offset = 0;
|
|
2557
2422
|
}
|
|
@@ -2586,7 +2451,7 @@
|
|
|
2586
2451
|
|
|
2587
2452
|
function drawRect(parentGfx, width, height, r, offset, attrs) {
|
|
2588
2453
|
|
|
2589
|
-
if (isObject(offset)) {
|
|
2454
|
+
if (isObject$1(offset)) {
|
|
2590
2455
|
attrs = offset;
|
|
2591
2456
|
offset = 0;
|
|
2592
2457
|
}
|
|
@@ -2674,7 +2539,7 @@
|
|
|
2674
2539
|
}
|
|
2675
2540
|
|
|
2676
2541
|
function drawMarker(type, parentGfx, path, attrs) {
|
|
2677
|
-
return drawPath(parentGfx, path, assign({ 'data-marker': type }, attrs));
|
|
2542
|
+
return drawPath(parentGfx, path, assign$4({ 'data-marker': type }, attrs));
|
|
2678
2543
|
}
|
|
2679
2544
|
|
|
2680
2545
|
function renderer(type) {
|
|
@@ -2746,7 +2611,7 @@
|
|
|
2746
2611
|
|
|
2747
2612
|
function renderLabel(parentGfx, label, options) {
|
|
2748
2613
|
|
|
2749
|
-
options = assign({
|
|
2614
|
+
options = assign$4({
|
|
2750
2615
|
size: {
|
|
2751
2616
|
width: 100
|
|
2752
2617
|
}
|
|
@@ -2786,7 +2651,7 @@
|
|
|
2786
2651
|
return renderLabel(parentGfx, getLabel(element), {
|
|
2787
2652
|
box: box,
|
|
2788
2653
|
fitBox: true,
|
|
2789
|
-
style: assign(
|
|
2654
|
+
style: assign$4(
|
|
2790
2655
|
{},
|
|
2791
2656
|
textRenderer.getExternalStyle(),
|
|
2792
2657
|
{
|
|
@@ -3388,7 +3253,7 @@
|
|
|
3388
3253
|
return task;
|
|
3389
3254
|
},
|
|
3390
3255
|
'bpmn:SubProcess': function(parentGfx, element, attrs) {
|
|
3391
|
-
attrs = assign({
|
|
3256
|
+
attrs = assign$4({
|
|
3392
3257
|
fill: getFillColor(element, defaultFillColor),
|
|
3393
3258
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
3394
3259
|
}, attrs);
|
|
@@ -3474,7 +3339,7 @@
|
|
|
3474
3339
|
return lane;
|
|
3475
3340
|
},
|
|
3476
3341
|
'bpmn:Lane': function(parentGfx, element, attrs) {
|
|
3477
|
-
var rect = drawRect(parentGfx, element.width, element.height, 0, assign({
|
|
3342
|
+
var rect = drawRect(parentGfx, element.width, element.height, 0, assign$4({
|
|
3478
3343
|
fill: getFillColor(element, defaultFillColor),
|
|
3479
3344
|
fillOpacity: HIGH_FILL_OPACITY,
|
|
3480
3345
|
stroke: getStrokeColor(element, defaultStrokeColor)
|
|
@@ -3696,7 +3561,7 @@
|
|
|
3696
3561
|
var fill = getFillColor(element, defaultFillColor),
|
|
3697
3562
|
stroke = getStrokeColor(element, defaultStrokeColor);
|
|
3698
3563
|
|
|
3699
|
-
attrs = assign({
|
|
3564
|
+
attrs = assign$4({
|
|
3700
3565
|
strokeDasharray: '0.5, 5',
|
|
3701
3566
|
strokeLinecap: 'round',
|
|
3702
3567
|
strokeLinejoin: 'round',
|
|
@@ -3884,12 +3749,12 @@
|
|
|
3884
3749
|
}
|
|
3885
3750
|
|
|
3886
3751
|
// apply fillOpacity
|
|
3887
|
-
var outerAttrs = assign({}, attrs, {
|
|
3752
|
+
var outerAttrs = assign$4({}, attrs, {
|
|
3888
3753
|
fillOpacity: 1
|
|
3889
3754
|
});
|
|
3890
3755
|
|
|
3891
3756
|
// apply no-fill
|
|
3892
|
-
var innerAttrs = assign({}, attrs, {
|
|
3757
|
+
var innerAttrs = assign$4({}, attrs, {
|
|
3893
3758
|
fill: 'none'
|
|
3894
3759
|
});
|
|
3895
3760
|
|
|
@@ -4112,7 +3977,7 @@
|
|
|
4112
3977
|
};
|
|
4113
3978
|
}
|
|
4114
3979
|
|
|
4115
|
-
forEach$
|
|
3980
|
+
forEach$3(taskMarkers, function(marker) {
|
|
4116
3981
|
renderer(marker)(parentGfx, element, position);
|
|
4117
3982
|
});
|
|
4118
3983
|
|
|
@@ -4240,8 +4105,8 @@
|
|
|
4240
4105
|
|
|
4241
4106
|
function parsePadding(padding) {
|
|
4242
4107
|
|
|
4243
|
-
if (isObject(padding)) {
|
|
4244
|
-
return assign({ top: 0, left: 0, right: 0, bottom: 0 }, padding);
|
|
4108
|
+
if (isObject$1(padding)) {
|
|
4109
|
+
return assign$4({ top: 0, left: 0, right: 0, bottom: 0 }, padding);
|
|
4245
4110
|
} else {
|
|
4246
4111
|
return {
|
|
4247
4112
|
top: padding,
|
|
@@ -4405,7 +4270,7 @@
|
|
|
4405
4270
|
id: 'helper-svg'
|
|
4406
4271
|
});
|
|
4407
4272
|
|
|
4408
|
-
assign$
|
|
4273
|
+
assign$3(helperSvg, {
|
|
4409
4274
|
visibility: 'hidden',
|
|
4410
4275
|
position: 'fixed',
|
|
4411
4276
|
width: 0,
|
|
@@ -4430,7 +4295,7 @@
|
|
|
4430
4295
|
*/
|
|
4431
4296
|
function Text(config) {
|
|
4432
4297
|
|
|
4433
|
-
this._config = assign({}, {
|
|
4298
|
+
this._config = assign$4({}, {
|
|
4434
4299
|
size: DEFAULT_LABEL_SIZE$1,
|
|
4435
4300
|
padding: DEFAULT_BOX_PADDING,
|
|
4436
4301
|
style: {},
|
|
@@ -4479,8 +4344,8 @@
|
|
|
4479
4344
|
* @return {Object} { element, dimensions }
|
|
4480
4345
|
*/
|
|
4481
4346
|
Text.prototype.layoutText = function(text, options) {
|
|
4482
|
-
var box = assign({}, this._config.size, options.box),
|
|
4483
|
-
style = assign({}, this._config.style, options.style),
|
|
4347
|
+
var box = assign$4({}, this._config.size, options.box),
|
|
4348
|
+
style = assign$4({}, this._config.style, options.style),
|
|
4484
4349
|
align = parseAlign(options.align || this._config.align),
|
|
4485
4350
|
padding = parsePadding(options.padding !== undefined ? options.padding : this._config.padding),
|
|
4486
4351
|
fitBox = options.fitBox || false;
|
|
@@ -4536,7 +4401,7 @@
|
|
|
4536
4401
|
|
|
4537
4402
|
// layout each line taking into account that parent
|
|
4538
4403
|
// shape might resize to fit text size
|
|
4539
|
-
forEach$
|
|
4404
|
+
forEach$3(layouted, function(line) {
|
|
4540
4405
|
|
|
4541
4406
|
var x;
|
|
4542
4407
|
|
|
@@ -4595,7 +4460,7 @@
|
|
|
4595
4460
|
|
|
4596
4461
|
function TextRenderer(config) {
|
|
4597
4462
|
|
|
4598
|
-
var defaultStyle = assign({
|
|
4463
|
+
var defaultStyle = assign$4({
|
|
4599
4464
|
fontFamily: 'Arial, sans-serif',
|
|
4600
4465
|
fontSize: DEFAULT_FONT_SIZE,
|
|
4601
4466
|
fontWeight: 'normal',
|
|
@@ -4604,7 +4469,7 @@
|
|
|
4604
4469
|
|
|
4605
4470
|
var fontSize = parseInt(defaultStyle.fontSize, 10) - 1;
|
|
4606
4471
|
|
|
4607
|
-
var externalStyle = assign({}, defaultStyle, {
|
|
4472
|
+
var externalStyle = assign$4({}, defaultStyle, {
|
|
4608
4473
|
fontSize: fontSize
|
|
4609
4474
|
}, config && config.externalStyle || {});
|
|
4610
4475
|
|
|
@@ -5340,7 +5205,7 @@
|
|
|
5340
5205
|
size = DEFAULT_LABEL_SIZE;
|
|
5341
5206
|
}
|
|
5342
5207
|
|
|
5343
|
-
return assign({
|
|
5208
|
+
return assign$4({
|
|
5344
5209
|
x: mid.x - size.width / 2,
|
|
5345
5210
|
y: mid.y - size.height / 2
|
|
5346
5211
|
}, size);
|
|
@@ -5510,7 +5375,7 @@
|
|
|
5510
5375
|
* @return {Object}
|
|
5511
5376
|
*/
|
|
5512
5377
|
function elementData(semantic, di, attrs) {
|
|
5513
|
-
return assign({
|
|
5378
|
+
return assign$4({
|
|
5514
5379
|
id: semantic.id,
|
|
5515
5380
|
type: semantic.$type,
|
|
5516
5381
|
businessObject: semantic,
|
|
@@ -6065,13 +5930,13 @@
|
|
|
6065
5930
|
}
|
|
6066
5931
|
|
|
6067
5932
|
function registerEvents(svg) {
|
|
6068
|
-
forEach$
|
|
5933
|
+
forEach$3(bindings, function(val, key) {
|
|
6069
5934
|
registerEvent(svg, key, val);
|
|
6070
5935
|
});
|
|
6071
5936
|
}
|
|
6072
5937
|
|
|
6073
5938
|
function unregisterEvents(svg) {
|
|
6074
|
-
forEach$
|
|
5939
|
+
forEach$3(bindings, function(val, key) {
|
|
6075
5940
|
unregisterEvent(svg, key, val);
|
|
6076
5941
|
});
|
|
6077
5942
|
}
|
|
@@ -6142,7 +6007,7 @@
|
|
|
6142
6007
|
|
|
6143
6008
|
function createHitStyle(classNames, attrs) {
|
|
6144
6009
|
|
|
6145
|
-
attrs = assign({
|
|
6010
|
+
attrs = assign$4({
|
|
6146
6011
|
stroke: 'white',
|
|
6147
6012
|
strokeWidth: 15
|
|
6148
6013
|
}, attrs || {});
|
|
@@ -6181,7 +6046,7 @@
|
|
|
6181
6046
|
this.removeHits = function(gfx) {
|
|
6182
6047
|
var hits = all('.djs-hit', gfx);
|
|
6183
6048
|
|
|
6184
|
-
forEach$
|
|
6049
|
+
forEach$3(hits, remove$2);
|
|
6185
6050
|
};
|
|
6186
6051
|
|
|
6187
6052
|
/**
|
|
@@ -6240,7 +6105,7 @@
|
|
|
6240
6105
|
*/
|
|
6241
6106
|
this.createBoxHit = function(gfx, type, attrs) {
|
|
6242
6107
|
|
|
6243
|
-
attrs = assign({
|
|
6108
|
+
attrs = assign$4({
|
|
6244
6109
|
x: 0,
|
|
6245
6110
|
y: 0
|
|
6246
6111
|
}, attrs);
|
|
@@ -6397,7 +6262,7 @@
|
|
|
6397
6262
|
function getBBox(elements, stopRecursion) {
|
|
6398
6263
|
|
|
6399
6264
|
stopRecursion = !!stopRecursion;
|
|
6400
|
-
if (!isArray$
|
|
6265
|
+
if (!isArray$4(elements)) {
|
|
6401
6266
|
elements = [ elements ];
|
|
6402
6267
|
}
|
|
6403
6268
|
|
|
@@ -6406,7 +6271,7 @@
|
|
|
6406
6271
|
maxX,
|
|
6407
6272
|
maxY;
|
|
6408
6273
|
|
|
6409
|
-
forEach$
|
|
6274
|
+
forEach$3(elements, function(element) {
|
|
6410
6275
|
|
|
6411
6276
|
// If element is a connection the bbox must be computed first
|
|
6412
6277
|
var bbox = element;
|
|
@@ -6485,7 +6350,7 @@
|
|
|
6485
6350
|
function createOutline(gfx, bounds) {
|
|
6486
6351
|
var outline = create$1('rect');
|
|
6487
6352
|
|
|
6488
|
-
attr$1(outline, assign({
|
|
6353
|
+
attr$1(outline, assign$4({
|
|
6489
6354
|
x: 10,
|
|
6490
6355
|
y: 10,
|
|
6491
6356
|
rx: 3,
|
|
@@ -6644,7 +6509,7 @@
|
|
|
6644
6509
|
var selectedElements = this._selectedElements,
|
|
6645
6510
|
oldSelection = selectedElements.slice();
|
|
6646
6511
|
|
|
6647
|
-
if (!isArray$
|
|
6512
|
+
if (!isArray$4(elements)) {
|
|
6648
6513
|
elements = elements ? [ elements ] : [];
|
|
6649
6514
|
}
|
|
6650
6515
|
|
|
@@ -6661,7 +6526,7 @@
|
|
|
6661
6526
|
// selection may be cleared by passing an empty array or null
|
|
6662
6527
|
// to the method
|
|
6663
6528
|
if (add) {
|
|
6664
|
-
forEach$
|
|
6529
|
+
forEach$3(elements, function(element) {
|
|
6665
6530
|
if (selectedElements.indexOf(element) !== -1) {
|
|
6666
6531
|
|
|
6667
6532
|
// already selected
|
|
@@ -6730,13 +6595,13 @@
|
|
|
6730
6595
|
var oldSelection = event.oldSelection,
|
|
6731
6596
|
newSelection = event.newSelection;
|
|
6732
6597
|
|
|
6733
|
-
forEach$
|
|
6598
|
+
forEach$3(oldSelection, function(e) {
|
|
6734
6599
|
if (newSelection.indexOf(e) === -1) {
|
|
6735
6600
|
deselect(e);
|
|
6736
6601
|
}
|
|
6737
6602
|
});
|
|
6738
6603
|
|
|
6739
|
-
forEach$
|
|
6604
|
+
forEach$3(newSelection, function(e) {
|
|
6740
6605
|
if (oldSelection.indexOf(e) === -1) {
|
|
6741
6606
|
select(e);
|
|
6742
6607
|
}
|
|
@@ -6778,7 +6643,7 @@
|
|
|
6778
6643
|
|
|
6779
6644
|
var rect = create$1('rect');
|
|
6780
6645
|
|
|
6781
|
-
attr$1(rect, assign({
|
|
6646
|
+
attr$1(rect, assign$4({
|
|
6782
6647
|
rx: 3
|
|
6783
6648
|
}, bBox));
|
|
6784
6649
|
|
|
@@ -6815,7 +6680,7 @@
|
|
|
6815
6680
|
return;
|
|
6816
6681
|
}
|
|
6817
6682
|
|
|
6818
|
-
if (isArray$
|
|
6683
|
+
if (isArray$4(autoSelect)) {
|
|
6819
6684
|
selection.select(autoSelect);
|
|
6820
6685
|
} else {
|
|
6821
6686
|
|
|
@@ -6842,7 +6707,7 @@
|
|
|
6842
6707
|
var shape = elementRegistry.get(event.context.shape.id);
|
|
6843
6708
|
|
|
6844
6709
|
// Always select main shape on move
|
|
6845
|
-
var isSelected = find(previousSelection, function(selectedShape) {
|
|
6710
|
+
var isSelected = find$1(previousSelection, function(selectedShape) {
|
|
6846
6711
|
return shape.id === selectedShape.id;
|
|
6847
6712
|
});
|
|
6848
6713
|
|
|
@@ -7021,7 +6886,7 @@
|
|
|
7021
6886
|
|
|
7022
6887
|
this._ids = ids;
|
|
7023
6888
|
|
|
7024
|
-
this._overlayDefaults = assign({
|
|
6889
|
+
this._overlayDefaults = assign$4({
|
|
7025
6890
|
|
|
7026
6891
|
// no show constraints
|
|
7027
6892
|
show: null,
|
|
@@ -7083,11 +6948,11 @@
|
|
|
7083
6948
|
*/
|
|
7084
6949
|
Overlays.prototype.get = function(search) {
|
|
7085
6950
|
|
|
7086
|
-
if (isString(search)) {
|
|
6951
|
+
if (isString$3(search)) {
|
|
7087
6952
|
search = { id: search };
|
|
7088
6953
|
}
|
|
7089
6954
|
|
|
7090
|
-
if (isString(search.element)) {
|
|
6955
|
+
if (isString$3(search.element)) {
|
|
7091
6956
|
search.element = this._elementRegistry.get(search.element);
|
|
7092
6957
|
}
|
|
7093
6958
|
|
|
@@ -7096,13 +6961,13 @@
|
|
|
7096
6961
|
|
|
7097
6962
|
// return a list of overlays when searching by element (+type)
|
|
7098
6963
|
if (container) {
|
|
7099
|
-
return search.type ? filter(container.overlays, matchPattern({ type: search.type })) : container.overlays.slice();
|
|
6964
|
+
return search.type ? filter$1(container.overlays, matchPattern({ type: search.type })) : container.overlays.slice();
|
|
7100
6965
|
} else {
|
|
7101
6966
|
return [];
|
|
7102
6967
|
}
|
|
7103
6968
|
} else
|
|
7104
6969
|
if (search.type) {
|
|
7105
|
-
return filter(this._overlays, matchPattern({ type: search.type }));
|
|
6970
|
+
return filter$1(this._overlays, matchPattern({ type: search.type }));
|
|
7106
6971
|
} else {
|
|
7107
6972
|
|
|
7108
6973
|
// return single element when searching by id
|
|
@@ -7135,7 +7000,7 @@
|
|
|
7135
7000
|
*/
|
|
7136
7001
|
Overlays.prototype.add = function(element, type, overlay) {
|
|
7137
7002
|
|
|
7138
|
-
if (isObject(type)) {
|
|
7003
|
+
if (isObject$1(type)) {
|
|
7139
7004
|
overlay = type;
|
|
7140
7005
|
type = null;
|
|
7141
7006
|
}
|
|
@@ -7158,7 +7023,7 @@
|
|
|
7158
7023
|
|
|
7159
7024
|
var id = this._ids.next();
|
|
7160
7025
|
|
|
7161
|
-
overlay = assign({}, this._overlayDefaults, overlay, {
|
|
7026
|
+
overlay = assign$4({}, this._overlayDefaults, overlay, {
|
|
7162
7027
|
id: id,
|
|
7163
7028
|
type: type,
|
|
7164
7029
|
element: element,
|
|
@@ -7182,13 +7047,13 @@
|
|
|
7182
7047
|
|
|
7183
7048
|
var overlays = this.get(filter) || [];
|
|
7184
7049
|
|
|
7185
|
-
if (!isArray$
|
|
7050
|
+
if (!isArray$4(overlays)) {
|
|
7186
7051
|
overlays = [ overlays ];
|
|
7187
7052
|
}
|
|
7188
7053
|
|
|
7189
7054
|
var self = this;
|
|
7190
7055
|
|
|
7191
|
-
forEach$
|
|
7056
|
+
forEach$3(overlays, function(overlay) {
|
|
7192
7057
|
|
|
7193
7058
|
var container = self._getOverlayContainer(overlay.element, true);
|
|
7194
7059
|
|
|
@@ -7297,8 +7162,8 @@
|
|
|
7297
7162
|
|
|
7298
7163
|
|
|
7299
7164
|
Overlays.prototype._createOverlayContainer = function(element) {
|
|
7300
|
-
var html = domify('<div class="djs-overlays" />');
|
|
7301
|
-
assign$
|
|
7165
|
+
var html = domify$1('<div class="djs-overlays" />');
|
|
7166
|
+
assign$3(html, { position: 'absolute' });
|
|
7302
7167
|
|
|
7303
7168
|
this._overlayRoot.appendChild(html);
|
|
7304
7169
|
|
|
@@ -7335,7 +7200,7 @@
|
|
|
7335
7200
|
|
|
7336
7201
|
|
|
7337
7202
|
Overlays.prototype._getOverlayContainer = function(element, raw) {
|
|
7338
|
-
var container = find(this._overlayContainers, function(c) {
|
|
7203
|
+
var container = find$1(this._overlayContainers, function(c) {
|
|
7339
7204
|
return c.element === element;
|
|
7340
7205
|
});
|
|
7341
7206
|
|
|
@@ -7363,14 +7228,14 @@
|
|
|
7363
7228
|
|
|
7364
7229
|
// create proper html elements from
|
|
7365
7230
|
// overlay HTML strings
|
|
7366
|
-
if (isString(html)) {
|
|
7367
|
-
html = domify(html);
|
|
7231
|
+
if (isString$3(html)) {
|
|
7232
|
+
html = domify$1(html);
|
|
7368
7233
|
}
|
|
7369
7234
|
|
|
7370
7235
|
overlayContainer = this._getOverlayContainer(element);
|
|
7371
7236
|
|
|
7372
|
-
htmlContainer = domify('<div class="djs-overlay" data-overlay-id="' + id + '">');
|
|
7373
|
-
assign$
|
|
7237
|
+
htmlContainer = domify$1('<div class="djs-overlay" data-overlay-id="' + id + '">');
|
|
7238
|
+
assign$3(htmlContainer, { position: 'absolute' });
|
|
7374
7239
|
|
|
7375
7240
|
htmlContainer.appendChild(html);
|
|
7376
7241
|
|
|
@@ -7460,7 +7325,7 @@
|
|
|
7460
7325
|
|
|
7461
7326
|
var self = this;
|
|
7462
7327
|
|
|
7463
|
-
forEach$
|
|
7328
|
+
forEach$3(this._overlays, function(overlay) {
|
|
7464
7329
|
self._updateOverlayVisibilty(overlay, viewbox);
|
|
7465
7330
|
});
|
|
7466
7331
|
};
|
|
@@ -7497,7 +7362,7 @@
|
|
|
7497
7362
|
var element = e.element;
|
|
7498
7363
|
var overlays = self.get({ element: element });
|
|
7499
7364
|
|
|
7500
|
-
forEach$
|
|
7365
|
+
forEach$3(overlays, function(o) {
|
|
7501
7366
|
self.remove(o.id);
|
|
7502
7367
|
});
|
|
7503
7368
|
|
|
@@ -7521,7 +7386,7 @@
|
|
|
7521
7386
|
var container = self._getOverlayContainer(element, true);
|
|
7522
7387
|
|
|
7523
7388
|
if (container) {
|
|
7524
|
-
forEach$
|
|
7389
|
+
forEach$3(container.overlays, function(overlay) {
|
|
7525
7390
|
self._updateOverlay(overlay);
|
|
7526
7391
|
});
|
|
7527
7392
|
|
|
@@ -7554,11 +7419,11 @@
|
|
|
7554
7419
|
// helpers /////////////////////////////
|
|
7555
7420
|
|
|
7556
7421
|
function createRoot(parentNode) {
|
|
7557
|
-
var root = domify(
|
|
7422
|
+
var root = domify$1(
|
|
7558
7423
|
'<div class="djs-overlay-container" />'
|
|
7559
7424
|
);
|
|
7560
7425
|
|
|
7561
|
-
assign$
|
|
7426
|
+
assign$3(root, {
|
|
7562
7427
|
position: 'absolute',
|
|
7563
7428
|
width: 0,
|
|
7564
7429
|
height: 0
|
|
@@ -7570,7 +7435,7 @@
|
|
|
7570
7435
|
}
|
|
7571
7436
|
|
|
7572
7437
|
function setPosition(el, x, y) {
|
|
7573
|
-
assign$
|
|
7438
|
+
assign$3(el, { left: x + 'px', top: y + 'px' });
|
|
7574
7439
|
}
|
|
7575
7440
|
|
|
7576
7441
|
/**
|
|
@@ -7716,7 +7581,7 @@
|
|
|
7716
7581
|
*/
|
|
7717
7582
|
CommandInterceptor.prototype.on = function(events, hook, priority, handlerFn, unwrap, that) {
|
|
7718
7583
|
|
|
7719
|
-
if (isFunction(hook) || isNumber(hook)) {
|
|
7584
|
+
if (isFunction$1(hook) || isNumber(hook)) {
|
|
7720
7585
|
that = unwrap;
|
|
7721
7586
|
unwrap = handlerFn;
|
|
7722
7587
|
handlerFn = priority;
|
|
@@ -7724,29 +7589,29 @@
|
|
|
7724
7589
|
hook = null;
|
|
7725
7590
|
}
|
|
7726
7591
|
|
|
7727
|
-
if (isFunction(priority)) {
|
|
7592
|
+
if (isFunction$1(priority)) {
|
|
7728
7593
|
that = unwrap;
|
|
7729
7594
|
unwrap = handlerFn;
|
|
7730
7595
|
handlerFn = priority;
|
|
7731
7596
|
priority = DEFAULT_PRIORITY$2;
|
|
7732
7597
|
}
|
|
7733
7598
|
|
|
7734
|
-
if (isObject(unwrap)) {
|
|
7599
|
+
if (isObject$1(unwrap)) {
|
|
7735
7600
|
that = unwrap;
|
|
7736
7601
|
unwrap = false;
|
|
7737
7602
|
}
|
|
7738
7603
|
|
|
7739
|
-
if (!isFunction(handlerFn)) {
|
|
7604
|
+
if (!isFunction$1(handlerFn)) {
|
|
7740
7605
|
throw new Error('handlerFn must be a function');
|
|
7741
7606
|
}
|
|
7742
7607
|
|
|
7743
|
-
if (!isArray$
|
|
7608
|
+
if (!isArray$4(events)) {
|
|
7744
7609
|
events = [ events ];
|
|
7745
7610
|
}
|
|
7746
7611
|
|
|
7747
7612
|
var eventBus = this._eventBus;
|
|
7748
7613
|
|
|
7749
|
-
forEach$
|
|
7614
|
+
forEach$3(events, function(event) {
|
|
7750
7615
|
|
|
7751
7616
|
// concat commandStack(.event)?(.hook)?
|
|
7752
7617
|
var fullEvent = [ 'commandStack', event, hook ].filter(function(e) { return e; }).join('.');
|
|
@@ -7774,7 +7639,7 @@
|
|
|
7774
7639
|
* This will generate the CommandInterceptor#(preExecute|...|reverted) methods
|
|
7775
7640
|
* which will in term forward to CommandInterceptor#on.
|
|
7776
7641
|
*/
|
|
7777
|
-
forEach$
|
|
7642
|
+
forEach$3(hooks, function(hook) {
|
|
7778
7643
|
|
|
7779
7644
|
/**
|
|
7780
7645
|
* {canExecute|preExecute|preExecuted|execute|executed|postExecute|postExecuted|revert|reverted}
|
|
@@ -7790,7 +7655,7 @@
|
|
|
7790
7655
|
*/
|
|
7791
7656
|
CommandInterceptor.prototype[hook] = function(events, priority, handlerFn, unwrap, that) {
|
|
7792
7657
|
|
|
7793
|
-
if (isFunction(events) || isNumber(events)) {
|
|
7658
|
+
if (isFunction$1(events) || isNumber(events)) {
|
|
7794
7659
|
that = unwrap;
|
|
7795
7660
|
unwrap = handlerFn;
|
|
7796
7661
|
handlerFn = priority;
|
|
@@ -7998,7 +7863,7 @@
|
|
|
7998
7863
|
* @param {canvas} canvas
|
|
7999
7864
|
*/
|
|
8000
7865
|
function DrilldownBreadcrumbs(eventBus, elementRegistry, overlays, canvas) {
|
|
8001
|
-
var breadcrumbs = domify('<ul class="bjs-breadcrumbs"></ul>');
|
|
7866
|
+
var breadcrumbs = domify$1('<ul class="bjs-breadcrumbs"></ul>');
|
|
8002
7867
|
var container = canvas.getContainer();
|
|
8003
7868
|
var containerClasses = classes(container);
|
|
8004
7869
|
container.appendChild(breadcrumbs);
|
|
@@ -8010,7 +7875,7 @@
|
|
|
8010
7875
|
var shape = e.element,
|
|
8011
7876
|
bo = getBusinessObject(shape);
|
|
8012
7877
|
|
|
8013
|
-
var isPresent = find(boParents, function(el) {
|
|
7878
|
+
var isPresent = find$1(boParents, function(el) {
|
|
8014
7879
|
return el === bo;
|
|
8015
7880
|
});
|
|
8016
7881
|
|
|
@@ -8034,7 +7899,7 @@
|
|
|
8034
7899
|
|
|
8035
7900
|
var path = boParents.map(function(parent) {
|
|
8036
7901
|
var title = escapeHTML(parent.name || parent.id);
|
|
8037
|
-
var link = domify('<li><span class="bjs-crumb"><a title="' + title + '">' + title + '</a></span></li>');
|
|
7902
|
+
var link = domify$1('<li><span class="bjs-crumb"><a title="' + title + '">' + title + '</a></span></li>');
|
|
8038
7903
|
|
|
8039
7904
|
var parentPlane = canvas.findRoot(getPlaneIdFromShape(parent)) || canvas.findRoot(parent.id);
|
|
8040
7905
|
|
|
@@ -8574,7 +8439,7 @@
|
|
|
8574
8439
|
this.removeOverlay(element);
|
|
8575
8440
|
}
|
|
8576
8441
|
|
|
8577
|
-
var button = domify('<button class="bjs-drilldown">' + ARROW_DOWN_SVG + '</button>');
|
|
8442
|
+
var button = domify$1('<button class="bjs-drilldown">' + ARROW_DOWN_SVG + '</button>');
|
|
8578
8443
|
|
|
8579
8444
|
button.addEventListener('click', function() {
|
|
8580
8445
|
canvas.setRootElement(canvas.findRoot(getPlaneIdFromShape(element)));
|
|
@@ -8616,7 +8481,7 @@
|
|
|
8616
8481
|
subprocessCompatibility: [ 'type', SubprocessCompatibility ]
|
|
8617
8482
|
};
|
|
8618
8483
|
|
|
8619
|
-
|
|
8484
|
+
const CLASS_PATTERN = /^class[ {]/;
|
|
8620
8485
|
|
|
8621
8486
|
|
|
8622
8487
|
/**
|
|
@@ -8633,8 +8498,8 @@
|
|
|
8633
8498
|
*
|
|
8634
8499
|
* @return {boolean}
|
|
8635
8500
|
*/
|
|
8636
|
-
function isArray(obj) {
|
|
8637
|
-
return
|
|
8501
|
+
function isArray$2(obj) {
|
|
8502
|
+
return Array.isArray(obj);
|
|
8638
8503
|
}
|
|
8639
8504
|
|
|
8640
8505
|
/**
|
|
@@ -8658,14 +8523,15 @@
|
|
|
8658
8523
|
*
|
|
8659
8524
|
* @return {T & InjectAnnotated}
|
|
8660
8525
|
*/
|
|
8661
|
-
function annotate() {
|
|
8662
|
-
var args = Array.prototype.slice.call(arguments);
|
|
8526
|
+
function annotate(...args) {
|
|
8663
8527
|
|
|
8664
|
-
if (args.length === 1 && isArray(args[0])) {
|
|
8528
|
+
if (args.length === 1 && isArray$2(args[0])) {
|
|
8665
8529
|
args = args[0];
|
|
8666
8530
|
}
|
|
8667
8531
|
|
|
8668
|
-
|
|
8532
|
+
args = [ ...args ];
|
|
8533
|
+
|
|
8534
|
+
const fn = args.pop();
|
|
8669
8535
|
|
|
8670
8536
|
fn.$inject = args;
|
|
8671
8537
|
|
|
@@ -8686,9 +8552,9 @@
|
|
|
8686
8552
|
// first constructor(...) pattern found which may be the one
|
|
8687
8553
|
// of a nested class, too.
|
|
8688
8554
|
|
|
8689
|
-
|
|
8690
|
-
|
|
8691
|
-
|
|
8555
|
+
const CONSTRUCTOR_ARGS = /constructor\s*[^(]*\(\s*([^)]*)\)/m;
|
|
8556
|
+
const FN_ARGS = /^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m;
|
|
8557
|
+
const FN_ARG = /\/\*([^*]*)\*\//m;
|
|
8692
8558
|
|
|
8693
8559
|
/**
|
|
8694
8560
|
* @param {unknown} fn
|
|
@@ -8698,20 +8564,20 @@
|
|
|
8698
8564
|
function parseAnnotations(fn) {
|
|
8699
8565
|
|
|
8700
8566
|
if (typeof fn !== 'function') {
|
|
8701
|
-
throw new Error(
|
|
8567
|
+
throw new Error(`Cannot annotate "${fn}". Expected a function!`);
|
|
8702
8568
|
}
|
|
8703
8569
|
|
|
8704
|
-
|
|
8570
|
+
const match = fn.toString().match(isClass(fn) ? CONSTRUCTOR_ARGS : FN_ARGS);
|
|
8705
8571
|
|
|
8706
8572
|
// may parse class without constructor
|
|
8707
8573
|
if (!match) {
|
|
8708
8574
|
return [];
|
|
8709
8575
|
}
|
|
8710
8576
|
|
|
8711
|
-
|
|
8577
|
+
const args = match[1] || match[2];
|
|
8712
8578
|
|
|
8713
|
-
return args && args.split(',').map(
|
|
8714
|
-
|
|
8579
|
+
return args && args.split(',').map(arg => {
|
|
8580
|
+
const argMatch = arg.match(FN_ARG);
|
|
8715
8581
|
return (argMatch && argMatch[1] || arg).trim();
|
|
8716
8582
|
}) || [];
|
|
8717
8583
|
}
|
|
@@ -8736,21 +8602,21 @@
|
|
|
8736
8602
|
if (strict === false) {
|
|
8737
8603
|
return null;
|
|
8738
8604
|
} else {
|
|
8739
|
-
throw error(
|
|
8605
|
+
throw error(`No provider for "${ name }"!`);
|
|
8740
8606
|
}
|
|
8741
8607
|
}
|
|
8742
8608
|
};
|
|
8743
8609
|
|
|
8744
|
-
|
|
8745
|
-
|
|
8746
|
-
|
|
8610
|
+
const currentlyResolving = [];
|
|
8611
|
+
const providers = this._providers = Object.create(parent._providers || null);
|
|
8612
|
+
const instances = this._instances = Object.create(null);
|
|
8747
8613
|
|
|
8748
|
-
|
|
8614
|
+
const self = instances.injector = this;
|
|
8749
8615
|
|
|
8750
|
-
|
|
8751
|
-
|
|
8616
|
+
const error = function(msg) {
|
|
8617
|
+
const stack = currentlyResolving.join(' -> ');
|
|
8752
8618
|
currentlyResolving.length = 0;
|
|
8753
|
-
return new Error(stack ? msg
|
|
8619
|
+
return new Error(stack ? `${ msg } (Resolving: ${ stack })` : msg);
|
|
8754
8620
|
};
|
|
8755
8621
|
|
|
8756
8622
|
/**
|
|
@@ -8763,8 +8629,8 @@
|
|
|
8763
8629
|
*/
|
|
8764
8630
|
function get(name, strict) {
|
|
8765
8631
|
if (!providers[name] && name.indexOf('.') !== -1) {
|
|
8766
|
-
|
|
8767
|
-
|
|
8632
|
+
const parts = name.split('.');
|
|
8633
|
+
let pivot = get(parts.shift());
|
|
8768
8634
|
|
|
8769
8635
|
while (parts.length) {
|
|
8770
8636
|
pivot = pivot[parts.shift()];
|
|
@@ -8800,15 +8666,15 @@
|
|
|
8800
8666
|
}
|
|
8801
8667
|
|
|
8802
8668
|
if (typeof fn !== 'function') {
|
|
8803
|
-
if (isArray(fn)) {
|
|
8669
|
+
if (isArray$2(fn)) {
|
|
8804
8670
|
fn = annotate(fn.slice());
|
|
8805
8671
|
} else {
|
|
8806
|
-
throw
|
|
8672
|
+
throw error(`Cannot invoke "${ fn }". Expected a function!`);
|
|
8807
8673
|
}
|
|
8808
8674
|
}
|
|
8809
8675
|
|
|
8810
|
-
|
|
8811
|
-
|
|
8676
|
+
const inject = fn.$inject || parseAnnotations(fn);
|
|
8677
|
+
const dependencies = inject.map(dep => {
|
|
8812
8678
|
if (hasOwnProp(locals, dep)) {
|
|
8813
8679
|
return locals[dep];
|
|
8814
8680
|
} else {
|
|
@@ -8823,22 +8689,22 @@
|
|
|
8823
8689
|
}
|
|
8824
8690
|
|
|
8825
8691
|
function instantiate(Type) {
|
|
8826
|
-
|
|
8827
|
-
|
|
8828
|
-
|
|
8829
|
-
|
|
8692
|
+
const {
|
|
8693
|
+
fn,
|
|
8694
|
+
dependencies
|
|
8695
|
+
} = fnDef(Type);
|
|
8830
8696
|
|
|
8831
8697
|
// instantiate var args constructor
|
|
8832
|
-
|
|
8698
|
+
const Constructor = Function.prototype.bind.apply(fn, [ null ].concat(dependencies));
|
|
8833
8699
|
|
|
8834
8700
|
return new Constructor();
|
|
8835
8701
|
}
|
|
8836
8702
|
|
|
8837
8703
|
function invoke(func, context, locals) {
|
|
8838
|
-
|
|
8839
|
-
|
|
8840
|
-
|
|
8841
|
-
|
|
8704
|
+
const {
|
|
8705
|
+
fn,
|
|
8706
|
+
dependencies
|
|
8707
|
+
} = fnDef(func, locals);
|
|
8842
8708
|
|
|
8843
8709
|
return fn.apply(context, dependencies);
|
|
8844
8710
|
}
|
|
@@ -8849,9 +8715,7 @@
|
|
|
8849
8715
|
* @return {Function}
|
|
8850
8716
|
*/
|
|
8851
8717
|
function createPrivateInjectorFactory(childInjector) {
|
|
8852
|
-
return annotate(
|
|
8853
|
-
return childInjector.get(key);
|
|
8854
|
-
});
|
|
8718
|
+
return annotate(key => childInjector.get(key));
|
|
8855
8719
|
}
|
|
8856
8720
|
|
|
8857
8721
|
/**
|
|
@@ -8862,18 +8726,19 @@
|
|
|
8862
8726
|
*/
|
|
8863
8727
|
function createChild(modules, forceNewInstances) {
|
|
8864
8728
|
if (forceNewInstances && forceNewInstances.length) {
|
|
8865
|
-
|
|
8866
|
-
|
|
8867
|
-
|
|
8868
|
-
|
|
8869
|
-
|
|
8870
|
-
|
|
8871
|
-
|
|
8872
|
-
|
|
8873
|
-
|
|
8874
|
-
|
|
8875
|
-
|
|
8876
|
-
|
|
8729
|
+
const fromParentModule = Object.create(null);
|
|
8730
|
+
const matchedScopes = Object.create(null);
|
|
8731
|
+
|
|
8732
|
+
const privateInjectorsCache = [];
|
|
8733
|
+
const privateChildInjectors = [];
|
|
8734
|
+
const privateChildFactories = [];
|
|
8735
|
+
|
|
8736
|
+
let provider;
|
|
8737
|
+
let cacheIdx;
|
|
8738
|
+
let privateChildInjector;
|
|
8739
|
+
let privateChildInjectorFactory;
|
|
8740
|
+
|
|
8741
|
+
for (let name in providers) {
|
|
8877
8742
|
provider = providers[name];
|
|
8878
8743
|
|
|
8879
8744
|
if (forceNewInstances.indexOf(name) !== -1) {
|
|
@@ -8897,7 +8762,7 @@
|
|
|
8897
8762
|
|
|
8898
8763
|
if ((provider[2] === 'factory' || provider[2] === 'type') && provider[1].$scope) {
|
|
8899
8764
|
/* jshint -W083 */
|
|
8900
|
-
forceNewInstances.forEach(
|
|
8765
|
+
forceNewInstances.forEach(scope => {
|
|
8901
8766
|
if (provider[1].$scope.indexOf(scope) !== -1) {
|
|
8902
8767
|
fromParentModule[name] = [ provider[2], provider[1] ];
|
|
8903
8768
|
matchedScopes[scope] = true;
|
|
@@ -8906,7 +8771,7 @@
|
|
|
8906
8771
|
}
|
|
8907
8772
|
}
|
|
8908
8773
|
|
|
8909
|
-
forceNewInstances.forEach(
|
|
8774
|
+
forceNewInstances.forEach(scope => {
|
|
8910
8775
|
if (!matchedScopes[scope]) {
|
|
8911
8776
|
throw new Error('No provider for "' + scope + '". Cannot use provider from the parent!');
|
|
8912
8777
|
}
|
|
@@ -8918,7 +8783,7 @@
|
|
|
8918
8783
|
return new Injector(modules, self);
|
|
8919
8784
|
}
|
|
8920
8785
|
|
|
8921
|
-
|
|
8786
|
+
const factoryMap = {
|
|
8922
8787
|
factory: invoke,
|
|
8923
8788
|
type: instantiate,
|
|
8924
8789
|
value: function(value) {
|
|
@@ -8932,10 +8797,10 @@
|
|
|
8932
8797
|
*/
|
|
8933
8798
|
function createInitializer(moduleDefinition, injector) {
|
|
8934
8799
|
|
|
8935
|
-
|
|
8800
|
+
const initializers = moduleDefinition.__init__ || [];
|
|
8936
8801
|
|
|
8937
8802
|
return function() {
|
|
8938
|
-
initializers.forEach(
|
|
8803
|
+
initializers.forEach(initializer => {
|
|
8939
8804
|
|
|
8940
8805
|
// eagerly resolve component (fn or string)
|
|
8941
8806
|
if (typeof initializer === 'string') {
|
|
@@ -8952,13 +8817,13 @@
|
|
|
8952
8817
|
*/
|
|
8953
8818
|
function loadModule(moduleDefinition) {
|
|
8954
8819
|
|
|
8955
|
-
|
|
8820
|
+
const moduleExports = moduleDefinition.__exports__;
|
|
8956
8821
|
|
|
8957
8822
|
// private module
|
|
8958
8823
|
if (moduleExports) {
|
|
8959
|
-
|
|
8824
|
+
const nestedModules = moduleDefinition.__modules__;
|
|
8960
8825
|
|
|
8961
|
-
|
|
8826
|
+
const clonedModule = Object.keys(moduleDefinition).reduce((clonedModule, key) => {
|
|
8962
8827
|
|
|
8963
8828
|
if (key !== '__exports__' && key !== '__modules__' && key !== '__init__' && key !== '__depends__') {
|
|
8964
8829
|
clonedModule[key] = moduleDefinition[key];
|
|
@@ -8967,10 +8832,10 @@
|
|
|
8967
8832
|
return clonedModule;
|
|
8968
8833
|
}, Object.create(null));
|
|
8969
8834
|
|
|
8970
|
-
|
|
8835
|
+
const childModules = (nestedModules || []).concat(clonedModule);
|
|
8971
8836
|
|
|
8972
|
-
|
|
8973
|
-
|
|
8837
|
+
const privateInjector = createChild(childModules);
|
|
8838
|
+
const getFromPrivateInjector = annotate(function(key) {
|
|
8974
8839
|
return privateInjector.get(key);
|
|
8975
8840
|
});
|
|
8976
8841
|
|
|
@@ -8979,7 +8844,7 @@
|
|
|
8979
8844
|
});
|
|
8980
8845
|
|
|
8981
8846
|
// ensure child injector initializes
|
|
8982
|
-
|
|
8847
|
+
const initializers = (moduleDefinition.__init__ || []).slice();
|
|
8983
8848
|
|
|
8984
8849
|
initializers.unshift(function() {
|
|
8985
8850
|
privateInjector.init();
|
|
@@ -9004,8 +8869,8 @@
|
|
|
9004
8869
|
return;
|
|
9005
8870
|
}
|
|
9006
8871
|
|
|
9007
|
-
|
|
9008
|
-
|
|
8872
|
+
const type = moduleDefinition[key][0];
|
|
8873
|
+
const value = moduleDefinition[key][1];
|
|
9009
8874
|
|
|
9010
8875
|
providers[key] = [ factoryMap[type], arrayUnwrap(type, value), type ];
|
|
9011
8876
|
});
|
|
@@ -9041,11 +8906,11 @@
|
|
|
9041
8906
|
*/
|
|
9042
8907
|
function bootstrap(moduleDefinitions) {
|
|
9043
8908
|
|
|
9044
|
-
|
|
8909
|
+
const initializers = moduleDefinitions
|
|
9045
8910
|
.reduce(resolveDependencies, [])
|
|
9046
8911
|
.map(loadModule);
|
|
9047
8912
|
|
|
9048
|
-
|
|
8913
|
+
let initialized = false;
|
|
9049
8914
|
|
|
9050
8915
|
return function() {
|
|
9051
8916
|
|
|
@@ -9055,9 +8920,7 @@
|
|
|
9055
8920
|
|
|
9056
8921
|
initialized = true;
|
|
9057
8922
|
|
|
9058
|
-
initializers.forEach(
|
|
9059
|
-
return initializer();
|
|
9060
|
-
});
|
|
8923
|
+
initializers.forEach(initializer => initializer());
|
|
9061
8924
|
};
|
|
9062
8925
|
}
|
|
9063
8926
|
|
|
@@ -9075,7 +8938,7 @@
|
|
|
9075
8938
|
// helpers ///////////////
|
|
9076
8939
|
|
|
9077
8940
|
function arrayUnwrap(type, value) {
|
|
9078
|
-
if (type !== 'value' && isArray(value)) {
|
|
8941
|
+
if (type !== 'value' && isArray$2(value)) {
|
|
9079
8942
|
value = annotate(value.slice());
|
|
9080
8943
|
}
|
|
9081
8944
|
|
|
@@ -9120,9 +8983,9 @@
|
|
|
9120
8983
|
});
|
|
9121
8984
|
|
|
9122
8985
|
if (isFrameElement(element)) {
|
|
9123
|
-
attr$1(rect, assign({}, this.FRAME_STYLE, attrs || {}));
|
|
8986
|
+
attr$1(rect, assign$4({}, this.FRAME_STYLE, attrs || {}));
|
|
9124
8987
|
} else {
|
|
9125
|
-
attr$1(rect, assign({}, this.SHAPE_STYLE, attrs || {}));
|
|
8988
|
+
attr$1(rect, assign$4({}, this.SHAPE_STYLE, attrs || {}));
|
|
9126
8989
|
}
|
|
9127
8990
|
|
|
9128
8991
|
append(visuals, rect);
|
|
@@ -9132,7 +8995,7 @@
|
|
|
9132
8995
|
|
|
9133
8996
|
DefaultRenderer.prototype.drawConnection = function drawConnection(visuals, connection, attrs) {
|
|
9134
8997
|
|
|
9135
|
-
var line = createLine(connection.waypoints, assign({}, this.CONNECTION_STYLE, attrs || {}));
|
|
8998
|
+
var line = createLine(connection.waypoints, assign$4({}, this.CONNECTION_STYLE, attrs || {}));
|
|
9136
8999
|
append(visuals, line);
|
|
9137
9000
|
|
|
9138
9001
|
return line;
|
|
@@ -9208,7 +9071,7 @@
|
|
|
9208
9071
|
this.cls = function(className, traits, additionalAttrs) {
|
|
9209
9072
|
var attrs = this.style(traits, additionalAttrs);
|
|
9210
9073
|
|
|
9211
|
-
return assign(attrs, { 'class': className });
|
|
9074
|
+
return assign$4(attrs, { 'class': className });
|
|
9212
9075
|
};
|
|
9213
9076
|
|
|
9214
9077
|
/**
|
|
@@ -9221,25 +9084,25 @@
|
|
|
9221
9084
|
*/
|
|
9222
9085
|
this.style = function(traits, additionalAttrs) {
|
|
9223
9086
|
|
|
9224
|
-
if (!isArray$
|
|
9087
|
+
if (!isArray$4(traits) && !additionalAttrs) {
|
|
9225
9088
|
additionalAttrs = traits;
|
|
9226
9089
|
traits = [];
|
|
9227
9090
|
}
|
|
9228
9091
|
|
|
9229
9092
|
var attrs = reduce(traits, function(attrs, t) {
|
|
9230
|
-
return assign(attrs, defaultTraits[t] || {});
|
|
9093
|
+
return assign$4(attrs, defaultTraits[t] || {});
|
|
9231
9094
|
}, {});
|
|
9232
9095
|
|
|
9233
|
-
return additionalAttrs ? assign(attrs, additionalAttrs) : attrs;
|
|
9096
|
+
return additionalAttrs ? assign$4(attrs, additionalAttrs) : attrs;
|
|
9234
9097
|
};
|
|
9235
9098
|
|
|
9236
9099
|
this.computeStyle = function(custom, traits, defaultStyles) {
|
|
9237
|
-
if (!isArray$
|
|
9100
|
+
if (!isArray$4(traits)) {
|
|
9238
9101
|
defaultStyles = traits;
|
|
9239
9102
|
traits = [];
|
|
9240
9103
|
}
|
|
9241
9104
|
|
|
9242
|
-
return self.style(traits || [], assign({}, defaultStyles, custom || {}));
|
|
9105
|
+
return self.style(traits || [], assign$4({}, defaultStyles, custom || {}));
|
|
9243
9106
|
};
|
|
9244
9107
|
}
|
|
9245
9108
|
|
|
@@ -9348,17 +9211,17 @@
|
|
|
9348
9211
|
*/
|
|
9349
9212
|
function createContainer(options) {
|
|
9350
9213
|
|
|
9351
|
-
options = assign({}, { width: '100%', height: '100%' }, options);
|
|
9214
|
+
options = assign$4({}, { width: '100%', height: '100%' }, options);
|
|
9352
9215
|
|
|
9353
|
-
|
|
9216
|
+
const container = options.container || document.body;
|
|
9354
9217
|
|
|
9355
9218
|
// create a <div> around the svg element with the respective size
|
|
9356
9219
|
// this way we can always get the correct container size
|
|
9357
9220
|
// (this is impossible for <svg> elements at the moment)
|
|
9358
|
-
|
|
9221
|
+
const parent = document.createElement('div');
|
|
9359
9222
|
parent.setAttribute('class', 'djs-container');
|
|
9360
9223
|
|
|
9361
|
-
assign$
|
|
9224
|
+
assign$3(parent, {
|
|
9362
9225
|
position: 'relative',
|
|
9363
9226
|
overflow: 'hidden',
|
|
9364
9227
|
width: ensurePx(options.width),
|
|
@@ -9371,10 +9234,10 @@
|
|
|
9371
9234
|
}
|
|
9372
9235
|
|
|
9373
9236
|
function createGroup(parent, cls, childIndex) {
|
|
9374
|
-
|
|
9237
|
+
const group = create$1('g');
|
|
9375
9238
|
classes$1(group).add(cls);
|
|
9376
9239
|
|
|
9377
|
-
|
|
9240
|
+
const index = childIndex !== undefined ? childIndex : parent.childNodes.length - 1;
|
|
9378
9241
|
|
|
9379
9242
|
// must ensure second argument is node or _null_
|
|
9380
9243
|
// cf. https://developer.mozilla.org/en-US/docs/Web/API/Node/insertBefore
|
|
@@ -9383,14 +9246,14 @@
|
|
|
9383
9246
|
return group;
|
|
9384
9247
|
}
|
|
9385
9248
|
|
|
9386
|
-
|
|
9249
|
+
const BASE_LAYER = 'base';
|
|
9387
9250
|
|
|
9388
9251
|
// render plane contents behind utility layers
|
|
9389
|
-
|
|
9390
|
-
|
|
9252
|
+
const PLANE_LAYER_INDEX = 0;
|
|
9253
|
+
const UTILITY_LAYER_INDEX = 1;
|
|
9391
9254
|
|
|
9392
9255
|
|
|
9393
|
-
|
|
9256
|
+
const REQUIRED_MODEL_ATTRS = {
|
|
9394
9257
|
shape: [ 'x', 'y', 'width', 'height' ],
|
|
9395
9258
|
connection: [ 'waypoints' ]
|
|
9396
9259
|
};
|
|
@@ -9445,22 +9308,22 @@
|
|
|
9445
9308
|
*/
|
|
9446
9309
|
Canvas.prototype._init = function(config) {
|
|
9447
9310
|
|
|
9448
|
-
|
|
9311
|
+
const eventBus = this._eventBus;
|
|
9449
9312
|
|
|
9450
9313
|
// html container
|
|
9451
|
-
|
|
9314
|
+
const container = this._container = createContainer(config);
|
|
9452
9315
|
|
|
9453
|
-
|
|
9316
|
+
const svg = this._svg = create$1('svg');
|
|
9454
9317
|
attr$1(svg, { width: '100%', height: '100%' });
|
|
9455
9318
|
|
|
9456
9319
|
append(container, svg);
|
|
9457
9320
|
|
|
9458
|
-
|
|
9321
|
+
const viewport = this._viewport = createGroup(svg, 'viewport');
|
|
9459
9322
|
|
|
9460
9323
|
// debounce canvas.viewbox.changed events
|
|
9461
9324
|
// for smoother diagram interaction
|
|
9462
9325
|
if (config.deferUpdate !== false) {
|
|
9463
|
-
this._viewboxChanged = debounce(bind(this._viewboxChanged, this), 300);
|
|
9326
|
+
this._viewboxChanged = debounce(bind$3(this._viewboxChanged, this), 300);
|
|
9464
9327
|
}
|
|
9465
9328
|
|
|
9466
9329
|
eventBus.on('diagram.init', function() {
|
|
@@ -9506,7 +9369,7 @@
|
|
|
9506
9369
|
viewport: this._viewport
|
|
9507
9370
|
});
|
|
9508
9371
|
|
|
9509
|
-
|
|
9372
|
+
const parent = this._container.parentNode;
|
|
9510
9373
|
|
|
9511
9374
|
if (parent) {
|
|
9512
9375
|
parent.removeChild(this._container);
|
|
@@ -9522,18 +9385,16 @@
|
|
|
9522
9385
|
|
|
9523
9386
|
Canvas.prototype._clear = function() {
|
|
9524
9387
|
|
|
9525
|
-
|
|
9526
|
-
|
|
9527
|
-
var allElements = this._elementRegistry.getAll();
|
|
9388
|
+
const allElements = this._elementRegistry.getAll();
|
|
9528
9389
|
|
|
9529
9390
|
// remove all elements
|
|
9530
|
-
allElements.forEach(
|
|
9531
|
-
|
|
9391
|
+
allElements.forEach(element => {
|
|
9392
|
+
const type = getType(element);
|
|
9532
9393
|
|
|
9533
9394
|
if (type === 'root') {
|
|
9534
|
-
|
|
9395
|
+
this.removeRootElement(element);
|
|
9535
9396
|
} else {
|
|
9536
|
-
|
|
9397
|
+
this._removeElement(element, type);
|
|
9537
9398
|
}
|
|
9538
9399
|
});
|
|
9539
9400
|
|
|
@@ -9576,7 +9437,7 @@
|
|
|
9576
9437
|
throw new Error('must specify a name');
|
|
9577
9438
|
}
|
|
9578
9439
|
|
|
9579
|
-
|
|
9440
|
+
let layer = this._layers[name];
|
|
9580
9441
|
|
|
9581
9442
|
if (!layer) {
|
|
9582
9443
|
layer = this._layers[name] = this._createLayer(name, index);
|
|
@@ -9624,7 +9485,7 @@
|
|
|
9624
9485
|
index = UTILITY_LAYER_INDEX;
|
|
9625
9486
|
}
|
|
9626
9487
|
|
|
9627
|
-
|
|
9488
|
+
const childIndex = this._getChildIndex(index);
|
|
9628
9489
|
|
|
9629
9490
|
return {
|
|
9630
9491
|
group: createGroup(this._viewport, 'layer-' + name, childIndex),
|
|
@@ -9646,21 +9507,21 @@
|
|
|
9646
9507
|
throw new Error('must specify a name');
|
|
9647
9508
|
}
|
|
9648
9509
|
|
|
9649
|
-
|
|
9510
|
+
const layer = this._layers[name];
|
|
9650
9511
|
|
|
9651
9512
|
if (!layer) {
|
|
9652
9513
|
throw new Error('layer <' + name + '> does not exist');
|
|
9653
9514
|
}
|
|
9654
9515
|
|
|
9655
|
-
|
|
9656
|
-
|
|
9657
|
-
|
|
9516
|
+
const viewport = this._viewport;
|
|
9517
|
+
const group = layer.group;
|
|
9518
|
+
const index = layer.index;
|
|
9658
9519
|
|
|
9659
9520
|
if (layer.visible) {
|
|
9660
9521
|
return group;
|
|
9661
9522
|
}
|
|
9662
9523
|
|
|
9663
|
-
|
|
9524
|
+
const childIndex = this._getChildIndex(index);
|
|
9664
9525
|
|
|
9665
9526
|
viewport.insertBefore(group, viewport.childNodes[childIndex] || null);
|
|
9666
9527
|
|
|
@@ -9681,13 +9542,13 @@
|
|
|
9681
9542
|
throw new Error('must specify a name');
|
|
9682
9543
|
}
|
|
9683
9544
|
|
|
9684
|
-
|
|
9545
|
+
const layer = this._layers[name];
|
|
9685
9546
|
|
|
9686
9547
|
if (!layer) {
|
|
9687
9548
|
throw new Error('layer <' + name + '> does not exist');
|
|
9688
9549
|
}
|
|
9689
9550
|
|
|
9690
|
-
|
|
9551
|
+
const group = layer.group;
|
|
9691
9552
|
|
|
9692
9553
|
if (!layer.visible) {
|
|
9693
9554
|
return group;
|
|
@@ -9703,7 +9564,7 @@
|
|
|
9703
9564
|
|
|
9704
9565
|
Canvas.prototype._removeLayer = function(name) {
|
|
9705
9566
|
|
|
9706
|
-
|
|
9567
|
+
const layer = this._layers[name];
|
|
9707
9568
|
|
|
9708
9569
|
if (layer) {
|
|
9709
9570
|
delete this._layers[name];
|
|
@@ -9718,7 +9579,7 @@
|
|
|
9718
9579
|
* @returns {SVGElement|null}
|
|
9719
9580
|
*/
|
|
9720
9581
|
Canvas.prototype.getActiveLayer = function() {
|
|
9721
|
-
|
|
9582
|
+
const plane = this._findPlaneForRoot(this.getRootElement());
|
|
9722
9583
|
|
|
9723
9584
|
if (!plane) {
|
|
9724
9585
|
return null;
|
|
@@ -9744,7 +9605,7 @@
|
|
|
9744
9605
|
return;
|
|
9745
9606
|
}
|
|
9746
9607
|
|
|
9747
|
-
|
|
9608
|
+
const plane = this._findPlaneForRoot(
|
|
9748
9609
|
findRoot(element)
|
|
9749
9610
|
) || {};
|
|
9750
9611
|
|
|
@@ -9763,7 +9624,7 @@
|
|
|
9763
9624
|
};
|
|
9764
9625
|
|
|
9765
9626
|
Canvas.prototype._findPlaneForRoot = function(rootElement) {
|
|
9766
|
-
return find(this._planes, function(plane) {
|
|
9627
|
+
return find$1(this._planes, function(plane) {
|
|
9767
9628
|
return plane.rootElement === rootElement;
|
|
9768
9629
|
});
|
|
9769
9630
|
};
|
|
@@ -9783,7 +9644,7 @@
|
|
|
9783
9644
|
// markers //////////////////////
|
|
9784
9645
|
|
|
9785
9646
|
Canvas.prototype._updateMarker = function(element, marker, add) {
|
|
9786
|
-
|
|
9647
|
+
let container;
|
|
9787
9648
|
|
|
9788
9649
|
if (!element.id) {
|
|
9789
9650
|
element = this._elementRegistry.get(element);
|
|
@@ -9796,7 +9657,7 @@
|
|
|
9796
9657
|
return;
|
|
9797
9658
|
}
|
|
9798
9659
|
|
|
9799
|
-
forEach$
|
|
9660
|
+
forEach$3([ container.gfx, container.secondaryGfx ], function(gfx) {
|
|
9800
9661
|
if (gfx) {
|
|
9801
9662
|
|
|
9802
9663
|
// invoke either addClass or removeClass based on mode
|
|
@@ -9831,7 +9692,7 @@
|
|
|
9831
9692
|
* @example
|
|
9832
9693
|
* canvas.addMarker('foo', 'some-marker');
|
|
9833
9694
|
*
|
|
9834
|
-
*
|
|
9695
|
+
* const fooGfx = canvas.getGraphics('foo');
|
|
9835
9696
|
*
|
|
9836
9697
|
* fooGfx; // <g class="... some-marker"> ... </g>
|
|
9837
9698
|
*
|
|
@@ -9867,7 +9728,7 @@
|
|
|
9867
9728
|
element = this._elementRegistry.get(element);
|
|
9868
9729
|
}
|
|
9869
9730
|
|
|
9870
|
-
|
|
9731
|
+
const gfx = this.getGraphics(element);
|
|
9871
9732
|
|
|
9872
9733
|
return classes$1(gfx).has(marker);
|
|
9873
9734
|
};
|
|
@@ -9905,7 +9766,7 @@
|
|
|
9905
9766
|
* @returns {Object|djs.model.Root|null} rootElement.
|
|
9906
9767
|
*/
|
|
9907
9768
|
Canvas.prototype.getRootElement = function() {
|
|
9908
|
-
|
|
9769
|
+
const rootElement = this._rootElement;
|
|
9909
9770
|
|
|
9910
9771
|
// can return null if root elements are present but none was set yet
|
|
9911
9772
|
if (rootElement || this._planes.length) {
|
|
@@ -9924,7 +9785,7 @@
|
|
|
9924
9785
|
*/
|
|
9925
9786
|
|
|
9926
9787
|
Canvas.prototype.addRootElement = function(rootElement) {
|
|
9927
|
-
|
|
9788
|
+
const idx = this._rootsIdx++;
|
|
9928
9789
|
|
|
9929
9790
|
if (!rootElement) {
|
|
9930
9791
|
rootElement = {
|
|
@@ -9934,11 +9795,11 @@
|
|
|
9934
9795
|
};
|
|
9935
9796
|
}
|
|
9936
9797
|
|
|
9937
|
-
|
|
9798
|
+
const layerName = rootElement.layer = 'root-' + idx;
|
|
9938
9799
|
|
|
9939
9800
|
this._ensureValid('root', rootElement);
|
|
9940
9801
|
|
|
9941
|
-
|
|
9802
|
+
const layer = this.getLayer(layerName, PLANE_LAYER_INDEX);
|
|
9942
9803
|
|
|
9943
9804
|
this.hideLayer(layerName);
|
|
9944
9805
|
|
|
@@ -9965,7 +9826,7 @@
|
|
|
9965
9826
|
rootElement = this._elementRegistry.get(rootElement);
|
|
9966
9827
|
}
|
|
9967
9828
|
|
|
9968
|
-
|
|
9829
|
+
const plane = this._findPlaneForRoot(rootElement);
|
|
9969
9830
|
|
|
9970
9831
|
if (!plane) {
|
|
9971
9832
|
return;
|
|
@@ -10011,7 +9872,7 @@
|
|
|
10011
9872
|
return;
|
|
10012
9873
|
}
|
|
10013
9874
|
|
|
10014
|
-
|
|
9875
|
+
let plane;
|
|
10015
9876
|
|
|
10016
9877
|
if (!rootElement) {
|
|
10017
9878
|
throw new Error('rootElement required');
|
|
@@ -10031,8 +9892,8 @@
|
|
|
10031
9892
|
|
|
10032
9893
|
|
|
10033
9894
|
Canvas.prototype._removeRoot = function(element) {
|
|
10034
|
-
|
|
10035
|
-
|
|
9895
|
+
const elementRegistry = this._elementRegistry,
|
|
9896
|
+
eventBus = this._eventBus;
|
|
10036
9897
|
|
|
10037
9898
|
// simulate element remove event sequence
|
|
10038
9899
|
eventBus.fire('root.remove', { element: element });
|
|
@@ -10043,8 +9904,8 @@
|
|
|
10043
9904
|
|
|
10044
9905
|
|
|
10045
9906
|
Canvas.prototype._addRoot = function(element, gfx) {
|
|
10046
|
-
|
|
10047
|
-
|
|
9907
|
+
const elementRegistry = this._elementRegistry,
|
|
9908
|
+
eventBus = this._eventBus;
|
|
10048
9909
|
|
|
10049
9910
|
// resemble element add event sequence
|
|
10050
9911
|
eventBus.fire('root.add', { element: element });
|
|
@@ -10057,7 +9918,7 @@
|
|
|
10057
9918
|
|
|
10058
9919
|
Canvas.prototype._setRoot = function(rootElement, layer) {
|
|
10059
9920
|
|
|
10060
|
-
|
|
9921
|
+
const currentRoot = this._rootElement;
|
|
10061
9922
|
|
|
10062
9923
|
if (currentRoot) {
|
|
10063
9924
|
|
|
@@ -10097,9 +9958,9 @@
|
|
|
10097
9958
|
throw new Error('element <' + element.id + '> already exists');
|
|
10098
9959
|
}
|
|
10099
9960
|
|
|
10100
|
-
|
|
9961
|
+
const requiredAttrs = REQUIRED_MODEL_ATTRS[type];
|
|
10101
9962
|
|
|
10102
|
-
|
|
9963
|
+
const valid = every(requiredAttrs, function(attr) {
|
|
10103
9964
|
return typeof element[attr] !== 'undefined';
|
|
10104
9965
|
});
|
|
10105
9966
|
|
|
@@ -10138,8 +9999,8 @@
|
|
|
10138
9999
|
|
|
10139
10000
|
parent = parent || this.getRootElement();
|
|
10140
10001
|
|
|
10141
|
-
|
|
10142
|
-
|
|
10002
|
+
const eventBus = this._eventBus,
|
|
10003
|
+
graphicsFactory = this._graphicsFactory;
|
|
10143
10004
|
|
|
10144
10005
|
this._ensureValid(type, element);
|
|
10145
10006
|
|
|
@@ -10148,7 +10009,7 @@
|
|
|
10148
10009
|
this._setParent(element, parent, parentIndex);
|
|
10149
10010
|
|
|
10150
10011
|
// create graphics
|
|
10151
|
-
|
|
10012
|
+
const gfx = graphicsFactory.create(type, element, parentIndex);
|
|
10152
10013
|
|
|
10153
10014
|
this._elementRegistry.add(element, gfx);
|
|
10154
10015
|
|
|
@@ -10192,9 +10053,9 @@
|
|
|
10192
10053
|
*/
|
|
10193
10054
|
Canvas.prototype._removeElement = function(element, type) {
|
|
10194
10055
|
|
|
10195
|
-
|
|
10196
|
-
|
|
10197
|
-
|
|
10056
|
+
const elementRegistry = this._elementRegistry,
|
|
10057
|
+
graphicsFactory = this._graphicsFactory,
|
|
10058
|
+
eventBus = this._eventBus;
|
|
10198
10059
|
|
|
10199
10060
|
element = elementRegistry.get(element.id || element);
|
|
10200
10061
|
|
|
@@ -10343,7 +10204,7 @@
|
|
|
10343
10204
|
* // sets the visible area of the diagram to (100|100) -> (600|100)
|
|
10344
10205
|
* // and and scales it according to the diagram width
|
|
10345
10206
|
*
|
|
10346
|
-
*
|
|
10207
|
+
* const viewbox = canvas.viewbox(); // pass `false` to force recomputing the box.
|
|
10347
10208
|
*
|
|
10348
10209
|
* console.log(viewbox);
|
|
10349
10210
|
* // {
|
|
@@ -10357,7 +10218,7 @@
|
|
|
10357
10218
|
* // if the current diagram is zoomed and scrolled, you may reset it to the
|
|
10358
10219
|
* // default zoom via this method, too:
|
|
10359
10220
|
*
|
|
10360
|
-
*
|
|
10221
|
+
* const zoomedAndScrolledViewbox = canvas.viewbox();
|
|
10361
10222
|
*
|
|
10362
10223
|
* canvas.viewbox({
|
|
10363
10224
|
* x: 0,
|
|
@@ -10380,9 +10241,9 @@
|
|
|
10380
10241
|
return this._cachedViewbox;
|
|
10381
10242
|
}
|
|
10382
10243
|
|
|
10383
|
-
|
|
10384
|
-
|
|
10385
|
-
|
|
10244
|
+
const viewport = this._viewport,
|
|
10245
|
+
outerBox = this.getSize();
|
|
10246
|
+
let innerBox,
|
|
10386
10247
|
matrix,
|
|
10387
10248
|
activeLayer,
|
|
10388
10249
|
transform,
|
|
@@ -10426,7 +10287,7 @@
|
|
|
10426
10287
|
this._changeViewbox(function() {
|
|
10427
10288
|
scale = Math.min(outerBox.width / box.width, outerBox.height / box.height);
|
|
10428
10289
|
|
|
10429
|
-
|
|
10290
|
+
const matrix = this._svg.createSVGMatrix()
|
|
10430
10291
|
.scale(scale)
|
|
10431
10292
|
.translate(-box.x, -box.y);
|
|
10432
10293
|
|
|
@@ -10448,12 +10309,12 @@
|
|
|
10448
10309
|
*/
|
|
10449
10310
|
Canvas.prototype.scroll = function(delta) {
|
|
10450
10311
|
|
|
10451
|
-
|
|
10452
|
-
|
|
10312
|
+
const node = this._viewport;
|
|
10313
|
+
let matrix = node.getCTM();
|
|
10453
10314
|
|
|
10454
10315
|
if (delta) {
|
|
10455
10316
|
this._changeViewbox(function() {
|
|
10456
|
-
delta = assign({ dx: 0, dy: 0 }, delta || {});
|
|
10317
|
+
delta = assign$4({ dx: 0, dy: 0 }, delta || {});
|
|
10457
10318
|
|
|
10458
10319
|
matrix = this._svg.createSVGMatrix().translate(delta.dx, delta.dy).multiply(matrix);
|
|
10459
10320
|
|
|
@@ -10473,14 +10334,14 @@
|
|
|
10473
10334
|
*
|
|
10474
10335
|
*/
|
|
10475
10336
|
Canvas.prototype.scrollToElement = function(element, padding) {
|
|
10476
|
-
|
|
10337
|
+
let defaultPadding = 100;
|
|
10477
10338
|
|
|
10478
10339
|
if (typeof element === 'string') {
|
|
10479
10340
|
element = this._elementRegistry.get(element);
|
|
10480
10341
|
}
|
|
10481
10342
|
|
|
10482
10343
|
// set to correct rootElement
|
|
10483
|
-
|
|
10344
|
+
const rootElement = this.findRoot(element);
|
|
10484
10345
|
|
|
10485
10346
|
if (rootElement !== this.getRootElement()) {
|
|
10486
10347
|
this.setRootElement(rootElement);
|
|
@@ -10500,11 +10361,11 @@
|
|
|
10500
10361
|
left: padding.left || defaultPadding
|
|
10501
10362
|
};
|
|
10502
10363
|
|
|
10503
|
-
|
|
10504
|
-
|
|
10505
|
-
|
|
10506
|
-
|
|
10507
|
-
|
|
10364
|
+
const elementBounds = getBBox(element),
|
|
10365
|
+
elementTrbl = asTRBL(elementBounds),
|
|
10366
|
+
viewboxBounds = this.viewbox(),
|
|
10367
|
+
zoom = this.zoom();
|
|
10368
|
+
let dx, dy;
|
|
10508
10369
|
|
|
10509
10370
|
// shrink viewboxBounds with padding
|
|
10510
10371
|
viewboxBounds.y += padding.top / zoom;
|
|
@@ -10512,9 +10373,9 @@
|
|
|
10512
10373
|
viewboxBounds.width -= (padding.right + padding.left) / zoom;
|
|
10513
10374
|
viewboxBounds.height -= (padding.bottom + padding.top) / zoom;
|
|
10514
10375
|
|
|
10515
|
-
|
|
10376
|
+
const viewboxTrbl = asTRBL(viewboxBounds);
|
|
10516
10377
|
|
|
10517
|
-
|
|
10378
|
+
const canFit = elementBounds.width < viewboxBounds.width && elementBounds.height < viewboxBounds.height;
|
|
10518
10379
|
|
|
10519
10380
|
if (!canFit) {
|
|
10520
10381
|
|
|
@@ -10524,10 +10385,10 @@
|
|
|
10524
10385
|
|
|
10525
10386
|
} else {
|
|
10526
10387
|
|
|
10527
|
-
|
|
10528
|
-
|
|
10529
|
-
|
|
10530
|
-
|
|
10388
|
+
const dRight = Math.max(0, elementTrbl.right - viewboxTrbl.right),
|
|
10389
|
+
dLeft = Math.min(0, elementTrbl.left - viewboxTrbl.left),
|
|
10390
|
+
dBottom = Math.max(0, elementTrbl.bottom - viewboxTrbl.bottom),
|
|
10391
|
+
dTop = Math.min(0, elementTrbl.top - viewboxTrbl.top);
|
|
10531
10392
|
|
|
10532
10393
|
dx = dRight || dLeft;
|
|
10533
10394
|
dy = dBottom || dTop;
|
|
@@ -10560,7 +10421,7 @@
|
|
|
10560
10421
|
return this._fitViewport(center);
|
|
10561
10422
|
}
|
|
10562
10423
|
|
|
10563
|
-
|
|
10424
|
+
let outer,
|
|
10564
10425
|
matrix;
|
|
10565
10426
|
|
|
10566
10427
|
this._changeViewbox(function() {
|
|
@@ -10581,16 +10442,16 @@
|
|
|
10581
10442
|
};
|
|
10582
10443
|
|
|
10583
10444
|
function setCTM(node, m) {
|
|
10584
|
-
|
|
10445
|
+
const mstr = 'matrix(' + m.a + ',' + m.b + ',' + m.c + ',' + m.d + ',' + m.e + ',' + m.f + ')';
|
|
10585
10446
|
node.setAttribute('transform', mstr);
|
|
10586
10447
|
}
|
|
10587
10448
|
|
|
10588
10449
|
Canvas.prototype._fitViewport = function(center) {
|
|
10589
10450
|
|
|
10590
|
-
|
|
10591
|
-
|
|
10592
|
-
|
|
10593
|
-
|
|
10451
|
+
const vbox = this.viewbox(),
|
|
10452
|
+
outer = vbox.outer,
|
|
10453
|
+
inner = vbox.inner;
|
|
10454
|
+
let newScale,
|
|
10594
10455
|
newViewbox;
|
|
10595
10456
|
|
|
10596
10457
|
// display the complete diagram without zooming in.
|
|
@@ -10631,13 +10492,13 @@
|
|
|
10631
10492
|
|
|
10632
10493
|
Canvas.prototype._setZoom = function(scale, center) {
|
|
10633
10494
|
|
|
10634
|
-
|
|
10635
|
-
|
|
10495
|
+
const svg = this._svg,
|
|
10496
|
+
viewport = this._viewport;
|
|
10636
10497
|
|
|
10637
|
-
|
|
10638
|
-
|
|
10498
|
+
const matrix = svg.createSVGMatrix();
|
|
10499
|
+
const point = svg.createSVGPoint();
|
|
10639
10500
|
|
|
10640
|
-
|
|
10501
|
+
let centerPoint,
|
|
10641
10502
|
originalPoint,
|
|
10642
10503
|
currentMatrix,
|
|
10643
10504
|
scaleMatrix,
|
|
@@ -10645,10 +10506,10 @@
|
|
|
10645
10506
|
|
|
10646
10507
|
currentMatrix = viewport.getCTM();
|
|
10647
10508
|
|
|
10648
|
-
|
|
10509
|
+
const currentScale = currentMatrix.a;
|
|
10649
10510
|
|
|
10650
10511
|
if (center) {
|
|
10651
|
-
centerPoint = assign(point, center);
|
|
10512
|
+
centerPoint = assign$4(point, center);
|
|
10652
10513
|
|
|
10653
10514
|
// revert applied viewport transformations
|
|
10654
10515
|
originalPoint = centerPoint.matrixTransform(currentMatrix.inverse());
|
|
@@ -10694,13 +10555,13 @@
|
|
|
10694
10555
|
* @return {Bounds} the absolute bounding box
|
|
10695
10556
|
*/
|
|
10696
10557
|
Canvas.prototype.getAbsoluteBBox = function(element) {
|
|
10697
|
-
|
|
10698
|
-
|
|
10558
|
+
const vbox = this.viewbox();
|
|
10559
|
+
let bbox;
|
|
10699
10560
|
|
|
10700
10561
|
// connection
|
|
10701
10562
|
// use svg bbox
|
|
10702
10563
|
if (element.waypoints) {
|
|
10703
|
-
|
|
10564
|
+
const gfx = this.getGraphics(element);
|
|
10704
10565
|
|
|
10705
10566
|
bbox = gfx.getBBox();
|
|
10706
10567
|
}
|
|
@@ -10711,11 +10572,11 @@
|
|
|
10711
10572
|
bbox = element;
|
|
10712
10573
|
}
|
|
10713
10574
|
|
|
10714
|
-
|
|
10715
|
-
|
|
10575
|
+
const x = bbox.x * vbox.scale - vbox.x * vbox.scale;
|
|
10576
|
+
const y = bbox.y * vbox.scale - vbox.y * vbox.scale;
|
|
10716
10577
|
|
|
10717
|
-
|
|
10718
|
-
|
|
10578
|
+
const width = bbox.width * vbox.scale;
|
|
10579
|
+
const height = bbox.height * vbox.scale;
|
|
10719
10580
|
|
|
10720
10581
|
return {
|
|
10721
10582
|
x: x,
|
|
@@ -11542,7 +11403,7 @@
|
|
|
11542
11403
|
if (!Type) {
|
|
11543
11404
|
throw new Error('unknown type: <' + type + '>');
|
|
11544
11405
|
}
|
|
11545
|
-
return assign(new Type(), attrs);
|
|
11406
|
+
return assign$4(new Type(), attrs);
|
|
11546
11407
|
}
|
|
11547
11408
|
|
|
11548
11409
|
/**
|
|
@@ -11579,7 +11440,7 @@
|
|
|
11579
11440
|
*/
|
|
11580
11441
|
ElementFactory.prototype.create = function(type, attrs) {
|
|
11581
11442
|
|
|
11582
|
-
attrs = assign({}, attrs || {});
|
|
11443
|
+
attrs = assign$4({}, attrs || {});
|
|
11583
11444
|
|
|
11584
11445
|
if (!attrs.id) {
|
|
11585
11446
|
attrs.id = type + '_' + (this._uid++);
|
|
@@ -11705,9 +11566,9 @@
|
|
|
11705
11566
|
*/
|
|
11706
11567
|
EventBus.prototype.on = function(events, priority, callback, that) {
|
|
11707
11568
|
|
|
11708
|
-
events = isArray$
|
|
11569
|
+
events = isArray$4(events) ? events : [ events ];
|
|
11709
11570
|
|
|
11710
|
-
if (isFunction(priority)) {
|
|
11571
|
+
if (isFunction$1(priority)) {
|
|
11711
11572
|
that = callback;
|
|
11712
11573
|
callback = priority;
|
|
11713
11574
|
priority = DEFAULT_PRIORITY$1;
|
|
@@ -11720,7 +11581,7 @@
|
|
|
11720
11581
|
var actualCallback = callback;
|
|
11721
11582
|
|
|
11722
11583
|
if (that) {
|
|
11723
|
-
actualCallback = bind(callback, that);
|
|
11584
|
+
actualCallback = bind$3(callback, that);
|
|
11724
11585
|
|
|
11725
11586
|
// make sure we remember and are able to remove
|
|
11726
11587
|
// bound callbacks via {@link #off} using the original
|
|
@@ -11751,7 +11612,7 @@
|
|
|
11751
11612
|
EventBus.prototype.once = function(event, priority, callback, that) {
|
|
11752
11613
|
var self = this;
|
|
11753
11614
|
|
|
11754
|
-
if (isFunction(priority)) {
|
|
11615
|
+
if (isFunction$1(priority)) {
|
|
11755
11616
|
that = callback;
|
|
11756
11617
|
callback = priority;
|
|
11757
11618
|
priority = DEFAULT_PRIORITY$1;
|
|
@@ -11790,7 +11651,7 @@
|
|
|
11790
11651
|
*/
|
|
11791
11652
|
EventBus.prototype.off = function(events, callback) {
|
|
11792
11653
|
|
|
11793
|
-
events = isArray$
|
|
11654
|
+
events = isArray$4(events) ? events : [ events ];
|
|
11794
11655
|
|
|
11795
11656
|
var self = this;
|
|
11796
11657
|
|
|
@@ -12085,7 +11946,7 @@
|
|
|
12085
11946
|
};
|
|
12086
11947
|
|
|
12087
11948
|
InternalEvent.prototype.init = function(data) {
|
|
12088
|
-
assign(this, data || {});
|
|
11949
|
+
assign$4(this, data || {});
|
|
12089
11950
|
};
|
|
12090
11951
|
|
|
12091
11952
|
|
|
@@ -12258,7 +12119,7 @@
|
|
|
12258
12119
|
|
|
12259
12120
|
// update all parents of changed and reorganized their children
|
|
12260
12121
|
// in the correct order (as indicated in our model)
|
|
12261
|
-
forEach$
|
|
12122
|
+
forEach$3(parents, function(parent) {
|
|
12262
12123
|
|
|
12263
12124
|
var children = parent.children;
|
|
12264
12125
|
|
|
@@ -12268,7 +12129,7 @@
|
|
|
12268
12129
|
|
|
12269
12130
|
var childrenGfx = self._getChildrenContainer(parent);
|
|
12270
12131
|
|
|
12271
|
-
forEach$
|
|
12132
|
+
forEach$3(children.slice().reverse(), function(child) {
|
|
12272
12133
|
var childGfx = elementRegistry.getGraphics(child);
|
|
12273
12134
|
|
|
12274
12135
|
prependTo(childGfx.parentNode, childrenGfx);
|
|
@@ -12518,6 +12379,193 @@
|
|
|
12518
12379
|
this.get('eventBus').fire('diagram.clear');
|
|
12519
12380
|
};
|
|
12520
12381
|
|
|
12382
|
+
/**
|
|
12383
|
+
* Flatten array, one level deep.
|
|
12384
|
+
*
|
|
12385
|
+
* @param {Array<?>} arr
|
|
12386
|
+
*
|
|
12387
|
+
* @return {Array<?>}
|
|
12388
|
+
*/
|
|
12389
|
+
|
|
12390
|
+
var nativeToString$2 = Object.prototype.toString;
|
|
12391
|
+
function isString$2(obj) {
|
|
12392
|
+
return nativeToString$2.call(obj) === '[object String]';
|
|
12393
|
+
}
|
|
12394
|
+
|
|
12395
|
+
function _extends$2() {
|
|
12396
|
+
_extends$2 = Object.assign || function (target) {
|
|
12397
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
12398
|
+
var source = arguments[i];
|
|
12399
|
+
|
|
12400
|
+
for (var key in source) {
|
|
12401
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
12402
|
+
target[key] = source[key];
|
|
12403
|
+
}
|
|
12404
|
+
}
|
|
12405
|
+
}
|
|
12406
|
+
|
|
12407
|
+
return target;
|
|
12408
|
+
};
|
|
12409
|
+
|
|
12410
|
+
return _extends$2.apply(this, arguments);
|
|
12411
|
+
}
|
|
12412
|
+
|
|
12413
|
+
/**
|
|
12414
|
+
* Convenience wrapper for `Object.assign`.
|
|
12415
|
+
*
|
|
12416
|
+
* @param {Object} target
|
|
12417
|
+
* @param {...Object} others
|
|
12418
|
+
*
|
|
12419
|
+
* @return {Object} the target
|
|
12420
|
+
*/
|
|
12421
|
+
|
|
12422
|
+
function assign$2(target) {
|
|
12423
|
+
for (var _len = arguments.length, others = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
12424
|
+
others[_key - 1] = arguments[_key];
|
|
12425
|
+
}
|
|
12426
|
+
|
|
12427
|
+
return _extends$2.apply(void 0, [target].concat(others));
|
|
12428
|
+
}
|
|
12429
|
+
|
|
12430
|
+
/**
|
|
12431
|
+
* Flatten array, one level deep.
|
|
12432
|
+
*
|
|
12433
|
+
* @param {Array<?>} arr
|
|
12434
|
+
*
|
|
12435
|
+
* @return {Array<?>}
|
|
12436
|
+
*/
|
|
12437
|
+
|
|
12438
|
+
var nativeToString$1 = Object.prototype.toString;
|
|
12439
|
+
var nativeHasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
12440
|
+
function isUndefined$2(obj) {
|
|
12441
|
+
return obj === undefined;
|
|
12442
|
+
}
|
|
12443
|
+
function isArray$1(obj) {
|
|
12444
|
+
return nativeToString$1.call(obj) === '[object Array]';
|
|
12445
|
+
}
|
|
12446
|
+
function isObject(obj) {
|
|
12447
|
+
return nativeToString$1.call(obj) === '[object Object]';
|
|
12448
|
+
}
|
|
12449
|
+
function isString$1(obj) {
|
|
12450
|
+
return nativeToString$1.call(obj) === '[object String]';
|
|
12451
|
+
}
|
|
12452
|
+
/**
|
|
12453
|
+
* Return true, if target owns a property with the given key.
|
|
12454
|
+
*
|
|
12455
|
+
* @param {Object} target
|
|
12456
|
+
* @param {String} key
|
|
12457
|
+
*
|
|
12458
|
+
* @return {Boolean}
|
|
12459
|
+
*/
|
|
12460
|
+
|
|
12461
|
+
function has$1(target, key) {
|
|
12462
|
+
return nativeHasOwnProperty$1.call(target, key);
|
|
12463
|
+
}
|
|
12464
|
+
/**
|
|
12465
|
+
* Iterate over collection; returning something
|
|
12466
|
+
* (non-undefined) will stop iteration.
|
|
12467
|
+
*
|
|
12468
|
+
* @param {Array|Object} collection
|
|
12469
|
+
* @param {Function} iterator
|
|
12470
|
+
*
|
|
12471
|
+
* @return {Object} return result that stopped the iteration
|
|
12472
|
+
*/
|
|
12473
|
+
|
|
12474
|
+
function forEach$1(collection, iterator) {
|
|
12475
|
+
var val, result;
|
|
12476
|
+
|
|
12477
|
+
if (isUndefined$2(collection)) {
|
|
12478
|
+
return;
|
|
12479
|
+
}
|
|
12480
|
+
|
|
12481
|
+
var convertKey = isArray$1(collection) ? toNum$1 : identity$1;
|
|
12482
|
+
|
|
12483
|
+
for (var key in collection) {
|
|
12484
|
+
if (has$1(collection, key)) {
|
|
12485
|
+
val = collection[key];
|
|
12486
|
+
result = iterator(val, convertKey(key));
|
|
12487
|
+
|
|
12488
|
+
if (result === false) {
|
|
12489
|
+
return val;
|
|
12490
|
+
}
|
|
12491
|
+
}
|
|
12492
|
+
}
|
|
12493
|
+
}
|
|
12494
|
+
|
|
12495
|
+
function identity$1(arg) {
|
|
12496
|
+
return arg;
|
|
12497
|
+
}
|
|
12498
|
+
|
|
12499
|
+
function toNum$1(arg) {
|
|
12500
|
+
return Number(arg);
|
|
12501
|
+
}
|
|
12502
|
+
/**
|
|
12503
|
+
* Bind function against target <this>.
|
|
12504
|
+
*
|
|
12505
|
+
* @param {Function} fn
|
|
12506
|
+
* @param {Object} target
|
|
12507
|
+
*
|
|
12508
|
+
* @return {Function} bound function
|
|
12509
|
+
*/
|
|
12510
|
+
|
|
12511
|
+
function bind(fn, target) {
|
|
12512
|
+
return fn.bind(target);
|
|
12513
|
+
}
|
|
12514
|
+
|
|
12515
|
+
function _extends$1() {
|
|
12516
|
+
_extends$1 = Object.assign || function (target) {
|
|
12517
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
12518
|
+
var source = arguments[i];
|
|
12519
|
+
|
|
12520
|
+
for (var key in source) {
|
|
12521
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
12522
|
+
target[key] = source[key];
|
|
12523
|
+
}
|
|
12524
|
+
}
|
|
12525
|
+
}
|
|
12526
|
+
|
|
12527
|
+
return target;
|
|
12528
|
+
};
|
|
12529
|
+
|
|
12530
|
+
return _extends$1.apply(this, arguments);
|
|
12531
|
+
}
|
|
12532
|
+
|
|
12533
|
+
/**
|
|
12534
|
+
* Convenience wrapper for `Object.assign`.
|
|
12535
|
+
*
|
|
12536
|
+
* @param {Object} target
|
|
12537
|
+
* @param {...Object} others
|
|
12538
|
+
*
|
|
12539
|
+
* @return {Object} the target
|
|
12540
|
+
*/
|
|
12541
|
+
|
|
12542
|
+
function assign$1(target) {
|
|
12543
|
+
for (var _len = arguments.length, others = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
12544
|
+
others[_key - 1] = arguments[_key];
|
|
12545
|
+
}
|
|
12546
|
+
|
|
12547
|
+
return _extends$1.apply(void 0, [target].concat(others));
|
|
12548
|
+
}
|
|
12549
|
+
/**
|
|
12550
|
+
* Pick given properties from the target object.
|
|
12551
|
+
*
|
|
12552
|
+
* @param {Object} target
|
|
12553
|
+
* @param {Array} properties
|
|
12554
|
+
*
|
|
12555
|
+
* @return {Object} target
|
|
12556
|
+
*/
|
|
12557
|
+
|
|
12558
|
+
function pick(target, properties) {
|
|
12559
|
+
var result = {};
|
|
12560
|
+
var obj = Object(target);
|
|
12561
|
+
forEach$1(properties, function (prop) {
|
|
12562
|
+
if (prop in obj) {
|
|
12563
|
+
result[prop] = target[prop];
|
|
12564
|
+
}
|
|
12565
|
+
});
|
|
12566
|
+
return result;
|
|
12567
|
+
}
|
|
12568
|
+
|
|
12521
12569
|
/**
|
|
12522
12570
|
* Moddle base element.
|
|
12523
12571
|
*/
|
|
@@ -12862,7 +12910,7 @@
|
|
|
12862
12910
|
forEach$1(t.properties, bind(function(p) {
|
|
12863
12911
|
|
|
12864
12912
|
// clone property to allow extensions
|
|
12865
|
-
p = assign({}, p, {
|
|
12913
|
+
p = assign$1({}, p, {
|
|
12866
12914
|
name: p.ns.localName,
|
|
12867
12915
|
inherited: inherited
|
|
12868
12916
|
});
|
|
@@ -12922,7 +12970,7 @@
|
|
|
12922
12970
|
Registry.prototype.registerPackage = function(pkg) {
|
|
12923
12971
|
|
|
12924
12972
|
// copy package
|
|
12925
|
-
pkg = assign({}, pkg);
|
|
12973
|
+
pkg = assign$1({}, pkg);
|
|
12926
12974
|
|
|
12927
12975
|
var pkgMap = this.packageMap;
|
|
12928
12976
|
|
|
@@ -12944,11 +12992,11 @@
|
|
|
12944
12992
|
*/
|
|
12945
12993
|
Registry.prototype.registerType = function(type, pkg) {
|
|
12946
12994
|
|
|
12947
|
-
type = assign({}, type, {
|
|
12995
|
+
type = assign$1({}, type, {
|
|
12948
12996
|
superClass: (type.superClass || []).slice(),
|
|
12949
12997
|
extends: (type.extends || []).slice(),
|
|
12950
12998
|
properties: (type.properties || []).slice(),
|
|
12951
|
-
meta: assign((type.meta || {}))
|
|
12999
|
+
meta: assign$1((type.meta || {}))
|
|
12952
13000
|
});
|
|
12953
13001
|
|
|
12954
13002
|
var ns = parseName(type.name, pkg.prefix),
|
|
@@ -12967,7 +13015,7 @@
|
|
|
12967
13015
|
p.type = parseName(p.type, propertyNs.prefix).name;
|
|
12968
13016
|
}
|
|
12969
13017
|
|
|
12970
|
-
assign(p, {
|
|
13018
|
+
assign$1(p, {
|
|
12971
13019
|
ns: propertyNs,
|
|
12972
13020
|
name: propertyName
|
|
12973
13021
|
});
|
|
@@ -12976,7 +13024,7 @@
|
|
|
12976
13024
|
}, this));
|
|
12977
13025
|
|
|
12978
13026
|
// update ns + name
|
|
12979
|
-
assign(type, {
|
|
13027
|
+
assign$1(type, {
|
|
12980
13028
|
ns: ns,
|
|
12981
13029
|
name: name,
|
|
12982
13030
|
propertiesByName: propertiesByName
|
|
@@ -13112,7 +13160,7 @@
|
|
|
13112
13160
|
|
|
13113
13161
|
var propertyName = property && property.name;
|
|
13114
13162
|
|
|
13115
|
-
if (isUndefined(value)) {
|
|
13163
|
+
if (isUndefined$1(value)) {
|
|
13116
13164
|
// unset the property, if the specified value is undefined;
|
|
13117
13165
|
// delete from $attrs (for extensions) or the target itself
|
|
13118
13166
|
if (property) {
|
|
@@ -13177,7 +13225,7 @@
|
|
|
13177
13225
|
|
|
13178
13226
|
// use getters for read-only variables to support ES6 proxies
|
|
13179
13227
|
// cf. https://github.com/bpmn-io/internal-docs/issues/386
|
|
13180
|
-
options = assign({}, options, {
|
|
13228
|
+
options = assign$1({}, options, {
|
|
13181
13229
|
get: function() { return value; }
|
|
13182
13230
|
});
|
|
13183
13231
|
|
|
@@ -13203,7 +13251,7 @@
|
|
|
13203
13251
|
};
|
|
13204
13252
|
|
|
13205
13253
|
|
|
13206
|
-
function isUndefined(val) {
|
|
13254
|
+
function isUndefined$1(val) {
|
|
13207
13255
|
return typeof val === 'undefined';
|
|
13208
13256
|
}
|
|
13209
13257
|
|
|
@@ -13292,7 +13340,7 @@
|
|
|
13292
13340
|
|
|
13293
13341
|
var cache = this.typeCache;
|
|
13294
13342
|
|
|
13295
|
-
var name = isString(descriptor) ? descriptor : descriptor.ns.name;
|
|
13343
|
+
var name = isString$1(descriptor) ? descriptor : descriptor.ns.name;
|
|
13296
13344
|
|
|
13297
13345
|
var type = cache[name];
|
|
13298
13346
|
|
|
@@ -13425,6 +13473,180 @@
|
|
|
13425
13473
|
return this.registry.typeMap[type];
|
|
13426
13474
|
};
|
|
13427
13475
|
|
|
13476
|
+
/**
|
|
13477
|
+
* Flatten array, one level deep.
|
|
13478
|
+
*
|
|
13479
|
+
* @param {Array<?>} arr
|
|
13480
|
+
*
|
|
13481
|
+
* @return {Array<?>}
|
|
13482
|
+
*/
|
|
13483
|
+
|
|
13484
|
+
var nativeToString = Object.prototype.toString;
|
|
13485
|
+
var nativeHasOwnProperty = Object.prototype.hasOwnProperty;
|
|
13486
|
+
function isUndefined(obj) {
|
|
13487
|
+
return obj === undefined;
|
|
13488
|
+
}
|
|
13489
|
+
function isArray(obj) {
|
|
13490
|
+
return nativeToString.call(obj) === '[object Array]';
|
|
13491
|
+
}
|
|
13492
|
+
function isFunction(obj) {
|
|
13493
|
+
var tag = nativeToString.call(obj);
|
|
13494
|
+
return tag === '[object Function]' || tag === '[object AsyncFunction]' || tag === '[object GeneratorFunction]' || tag === '[object AsyncGeneratorFunction]' || tag === '[object Proxy]';
|
|
13495
|
+
}
|
|
13496
|
+
function isString(obj) {
|
|
13497
|
+
return nativeToString.call(obj) === '[object String]';
|
|
13498
|
+
}
|
|
13499
|
+
/**
|
|
13500
|
+
* Return true, if target owns a property with the given key.
|
|
13501
|
+
*
|
|
13502
|
+
* @param {Object} target
|
|
13503
|
+
* @param {String} key
|
|
13504
|
+
*
|
|
13505
|
+
* @return {Boolean}
|
|
13506
|
+
*/
|
|
13507
|
+
|
|
13508
|
+
function has(target, key) {
|
|
13509
|
+
return nativeHasOwnProperty.call(target, key);
|
|
13510
|
+
}
|
|
13511
|
+
|
|
13512
|
+
/**
|
|
13513
|
+
* Find element in collection.
|
|
13514
|
+
*
|
|
13515
|
+
* @param {Array|Object} collection
|
|
13516
|
+
* @param {Function|Object} matcher
|
|
13517
|
+
*
|
|
13518
|
+
* @return {Object}
|
|
13519
|
+
*/
|
|
13520
|
+
|
|
13521
|
+
function find(collection, matcher) {
|
|
13522
|
+
matcher = toMatcher(matcher);
|
|
13523
|
+
var match;
|
|
13524
|
+
forEach(collection, function (val, key) {
|
|
13525
|
+
if (matcher(val, key)) {
|
|
13526
|
+
match = val;
|
|
13527
|
+
return false;
|
|
13528
|
+
}
|
|
13529
|
+
});
|
|
13530
|
+
return match;
|
|
13531
|
+
}
|
|
13532
|
+
/**
|
|
13533
|
+
* Find element index in collection.
|
|
13534
|
+
*
|
|
13535
|
+
* @param {Array|Object} collection
|
|
13536
|
+
* @param {Function} matcher
|
|
13537
|
+
*
|
|
13538
|
+
* @return {Object}
|
|
13539
|
+
*/
|
|
13540
|
+
|
|
13541
|
+
function findIndex(collection, matcher) {
|
|
13542
|
+
matcher = toMatcher(matcher);
|
|
13543
|
+
var idx = isArray(collection) ? -1 : undefined;
|
|
13544
|
+
forEach(collection, function (val, key) {
|
|
13545
|
+
if (matcher(val, key)) {
|
|
13546
|
+
idx = key;
|
|
13547
|
+
return false;
|
|
13548
|
+
}
|
|
13549
|
+
});
|
|
13550
|
+
return idx;
|
|
13551
|
+
}
|
|
13552
|
+
/**
|
|
13553
|
+
* Find element in collection.
|
|
13554
|
+
*
|
|
13555
|
+
* @param {Array|Object} collection
|
|
13556
|
+
* @param {Function} matcher
|
|
13557
|
+
*
|
|
13558
|
+
* @return {Array} result
|
|
13559
|
+
*/
|
|
13560
|
+
|
|
13561
|
+
function filter(collection, matcher) {
|
|
13562
|
+
var result = [];
|
|
13563
|
+
forEach(collection, function (val, key) {
|
|
13564
|
+
if (matcher(val, key)) {
|
|
13565
|
+
result.push(val);
|
|
13566
|
+
}
|
|
13567
|
+
});
|
|
13568
|
+
return result;
|
|
13569
|
+
}
|
|
13570
|
+
/**
|
|
13571
|
+
* Iterate over collection; returning something
|
|
13572
|
+
* (non-undefined) will stop iteration.
|
|
13573
|
+
*
|
|
13574
|
+
* @param {Array|Object} collection
|
|
13575
|
+
* @param {Function} iterator
|
|
13576
|
+
*
|
|
13577
|
+
* @return {Object} return result that stopped the iteration
|
|
13578
|
+
*/
|
|
13579
|
+
|
|
13580
|
+
function forEach(collection, iterator) {
|
|
13581
|
+
var val, result;
|
|
13582
|
+
|
|
13583
|
+
if (isUndefined(collection)) {
|
|
13584
|
+
return;
|
|
13585
|
+
}
|
|
13586
|
+
|
|
13587
|
+
var convertKey = isArray(collection) ? toNum : identity;
|
|
13588
|
+
|
|
13589
|
+
for (var key in collection) {
|
|
13590
|
+
if (has(collection, key)) {
|
|
13591
|
+
val = collection[key];
|
|
13592
|
+
result = iterator(val, convertKey(key));
|
|
13593
|
+
|
|
13594
|
+
if (result === false) {
|
|
13595
|
+
return val;
|
|
13596
|
+
}
|
|
13597
|
+
}
|
|
13598
|
+
}
|
|
13599
|
+
}
|
|
13600
|
+
|
|
13601
|
+
function toMatcher(matcher) {
|
|
13602
|
+
return isFunction(matcher) ? matcher : function (e) {
|
|
13603
|
+
return e === matcher;
|
|
13604
|
+
};
|
|
13605
|
+
}
|
|
13606
|
+
|
|
13607
|
+
function identity(arg) {
|
|
13608
|
+
return arg;
|
|
13609
|
+
}
|
|
13610
|
+
|
|
13611
|
+
function toNum(arg) {
|
|
13612
|
+
return Number(arg);
|
|
13613
|
+
}
|
|
13614
|
+
|
|
13615
|
+
function _extends() {
|
|
13616
|
+
_extends = Object.assign || function (target) {
|
|
13617
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
13618
|
+
var source = arguments[i];
|
|
13619
|
+
|
|
13620
|
+
for (var key in source) {
|
|
13621
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
13622
|
+
target[key] = source[key];
|
|
13623
|
+
}
|
|
13624
|
+
}
|
|
13625
|
+
}
|
|
13626
|
+
|
|
13627
|
+
return target;
|
|
13628
|
+
};
|
|
13629
|
+
|
|
13630
|
+
return _extends.apply(this, arguments);
|
|
13631
|
+
}
|
|
13632
|
+
|
|
13633
|
+
/**
|
|
13634
|
+
* Convenience wrapper for `Object.assign`.
|
|
13635
|
+
*
|
|
13636
|
+
* @param {Object} target
|
|
13637
|
+
* @param {...Object} others
|
|
13638
|
+
*
|
|
13639
|
+
* @return {Object} the target
|
|
13640
|
+
*/
|
|
13641
|
+
|
|
13642
|
+
function assign(target) {
|
|
13643
|
+
for (var _len = arguments.length, others = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
13644
|
+
others[_key - 1] = arguments[_key];
|
|
13645
|
+
}
|
|
13646
|
+
|
|
13647
|
+
return _extends.apply(void 0, [target].concat(others));
|
|
13648
|
+
}
|
|
13649
|
+
|
|
13428
13650
|
var fromCharCode = String.fromCharCode;
|
|
13429
13651
|
|
|
13430
13652
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
@@ -14820,7 +15042,7 @@
|
|
|
14820
15042
|
model = this.model,
|
|
14821
15043
|
propNameNs;
|
|
14822
15044
|
|
|
14823
|
-
forEach
|
|
15045
|
+
forEach(attributes, function(value, name) {
|
|
14824
15046
|
|
|
14825
15047
|
var prop = descriptor.propertiesByName[name],
|
|
14826
15048
|
values;
|
|
@@ -14838,7 +15060,7 @@
|
|
|
14838
15060
|
// IDREFS: parse references as whitespace-separated list
|
|
14839
15061
|
values = value.split(' ');
|
|
14840
15062
|
|
|
14841
|
-
forEach
|
|
15063
|
+
forEach(values, function(v) {
|
|
14842
15064
|
context.addReference({
|
|
14843
15065
|
element: instance,
|
|
14844
15066
|
property: prop.ns.name,
|
|
@@ -15582,7 +15804,7 @@
|
|
|
15582
15804
|
}
|
|
15583
15805
|
|
|
15584
15806
|
// do not serialize defaults
|
|
15585
|
-
if (!has
|
|
15807
|
+
if (!has(element, name)) {
|
|
15586
15808
|
return false;
|
|
15587
15809
|
}
|
|
15588
15810
|
|
|
@@ -15811,7 +16033,7 @@
|
|
|
15811
16033
|
|
|
15812
16034
|
var attributes = [];
|
|
15813
16035
|
|
|
15814
|
-
forEach
|
|
16036
|
+
forEach(element, function(val, key) {
|
|
15815
16037
|
|
|
15816
16038
|
var nonNsAttr;
|
|
15817
16039
|
|
|
@@ -15819,7 +16041,7 @@
|
|
|
15819
16041
|
body.push(new BodySerializer().build({ type: 'String' }, val));
|
|
15820
16042
|
} else
|
|
15821
16043
|
if (key === '$children') {
|
|
15822
|
-
forEach
|
|
16044
|
+
forEach(val, function(child) {
|
|
15823
16045
|
body.push(new ElementSerializer(self).build(child));
|
|
15824
16046
|
});
|
|
15825
16047
|
} else
|
|
@@ -15889,7 +16111,7 @@
|
|
|
15889
16111
|
// parse namespace attributes first
|
|
15890
16112
|
// and log them. push non namespace attributes to a list
|
|
15891
16113
|
// and process them later
|
|
15892
|
-
forEach
|
|
16114
|
+
forEach(genericAttrs, function(value, name) {
|
|
15893
16115
|
|
|
15894
16116
|
var nonNsAttr = self.parseNsAttribute(element, name, value);
|
|
15895
16117
|
|
|
@@ -15905,7 +16127,7 @@
|
|
|
15905
16127
|
|
|
15906
16128
|
var self = this;
|
|
15907
16129
|
|
|
15908
|
-
forEach
|
|
16130
|
+
forEach(attributes, function(attr) {
|
|
15909
16131
|
|
|
15910
16132
|
// do not serialize xsi:type attribute
|
|
15911
16133
|
// it is set manually based on the actual implementation type
|
|
@@ -15930,7 +16152,7 @@
|
|
|
15930
16152
|
body = this.body,
|
|
15931
16153
|
element = this.element;
|
|
15932
16154
|
|
|
15933
|
-
forEach
|
|
16155
|
+
forEach(properties, function(p) {
|
|
15934
16156
|
var value = element.get(p.name),
|
|
15935
16157
|
isReference = p.isReference,
|
|
15936
16158
|
isMany = p.isMany;
|
|
@@ -15943,12 +16165,12 @@
|
|
|
15943
16165
|
body.push(new BodySerializer().build(p, value[0]));
|
|
15944
16166
|
} else
|
|
15945
16167
|
if (isSimple(p.type)) {
|
|
15946
|
-
forEach
|
|
16168
|
+
forEach(value, function(v) {
|
|
15947
16169
|
body.push(new ValueSerializer(self.addTagName(self.nsPropertyTagName(p))).build(p, v));
|
|
15948
16170
|
});
|
|
15949
16171
|
} else
|
|
15950
16172
|
if (isReference) {
|
|
15951
|
-
forEach
|
|
16173
|
+
forEach(value, function(v) {
|
|
15952
16174
|
body.push(new ReferenceSerializer(self.addTagName(self.nsPropertyTagName(p))).build(v));
|
|
15953
16175
|
});
|
|
15954
16176
|
} else {
|
|
@@ -15958,7 +16180,7 @@
|
|
|
15958
16180
|
var asType = serializeAsType(p),
|
|
15959
16181
|
asProperty = serializeAsProperty(p);
|
|
15960
16182
|
|
|
15961
|
-
forEach
|
|
16183
|
+
forEach(value, function(v) {
|
|
15962
16184
|
var serializer;
|
|
15963
16185
|
|
|
15964
16186
|
if (asType) {
|
|
@@ -16066,7 +16288,7 @@
|
|
|
16066
16288
|
var self = this,
|
|
16067
16289
|
element = this.element;
|
|
16068
16290
|
|
|
16069
|
-
forEach
|
|
16291
|
+
forEach(properties, function(p) {
|
|
16070
16292
|
|
|
16071
16293
|
var value = element.get(p.name);
|
|
16072
16294
|
|
|
@@ -16077,7 +16299,7 @@
|
|
|
16077
16299
|
}
|
|
16078
16300
|
else {
|
|
16079
16301
|
var values = [];
|
|
16080
|
-
forEach
|
|
16302
|
+
forEach(value, function(v) {
|
|
16081
16303
|
values.push(v.id);
|
|
16082
16304
|
});
|
|
16083
16305
|
|
|
@@ -16133,7 +16355,7 @@
|
|
|
16133
16355
|
attrs = getNsAttrs(namespaces).concat(attrs);
|
|
16134
16356
|
}
|
|
16135
16357
|
|
|
16136
|
-
forEach
|
|
16358
|
+
forEach(attrs, function(a) {
|
|
16137
16359
|
writer
|
|
16138
16360
|
.append(' ')
|
|
16139
16361
|
.append(nsName(a.name)).append('="').append(a.value).append('"');
|
|
@@ -16160,7 +16382,7 @@
|
|
|
16160
16382
|
.indent();
|
|
16161
16383
|
}
|
|
16162
16384
|
|
|
16163
|
-
forEach
|
|
16385
|
+
forEach(this.body, function(b) {
|
|
16164
16386
|
b.serializeTo(writer);
|
|
16165
16387
|
});
|
|
16166
16388
|
|
|
@@ -16337,12 +16559,12 @@
|
|
|
16337
16559
|
*/
|
|
16338
16560
|
BpmnModdle.prototype.fromXML = function(xmlStr, typeName, options) {
|
|
16339
16561
|
|
|
16340
|
-
if (!isString(typeName)) {
|
|
16562
|
+
if (!isString$2(typeName)) {
|
|
16341
16563
|
options = typeName;
|
|
16342
16564
|
typeName = 'bpmn:Definitions';
|
|
16343
16565
|
}
|
|
16344
16566
|
|
|
16345
|
-
var reader = new Reader(assign({ model: this, lax: true }, options));
|
|
16567
|
+
var reader = new Reader(assign$2({ model: this, lax: true }, options));
|
|
16346
16568
|
var rootHandler = reader.handler(typeName);
|
|
16347
16569
|
|
|
16348
16570
|
return reader.fromXML(xmlStr, rootHandler);
|
|
@@ -20029,7 +20251,7 @@
|
|
|
20029
20251
|
};
|
|
20030
20252
|
|
|
20031
20253
|
function simple(additionalPackages, options) {
|
|
20032
|
-
var pks = assign({}, packages, additionalPackages);
|
|
20254
|
+
var pks = assign$2({}, packages, additionalPackages);
|
|
20033
20255
|
|
|
20034
20256
|
return new BpmnModdle(pks, options);
|
|
20035
20257
|
}
|
|
@@ -20053,7 +20275,7 @@
|
|
|
20053
20275
|
}
|
|
20054
20276
|
|
|
20055
20277
|
var argLen = arguments.length;
|
|
20056
|
-
if (argLen >= 1 && isFunction(arguments[argLen - 1])) {
|
|
20278
|
+
if (argLen >= 1 && isFunction$1(arguments[argLen - 1])) {
|
|
20057
20279
|
|
|
20058
20280
|
var callback = arguments[argLen - 1];
|
|
20059
20281
|
|
|
@@ -20094,7 +20316,7 @@
|
|
|
20094
20316
|
function ensureCompatDiRef(businessObject) {
|
|
20095
20317
|
|
|
20096
20318
|
// bpmnElement can have multiple independent DIs
|
|
20097
|
-
if (!has$
|
|
20319
|
+
if (!has$3(businessObject, 'di')) {
|
|
20098
20320
|
Object.defineProperty(businessObject, 'di', {
|
|
20099
20321
|
enumerable: false,
|
|
20100
20322
|
get: function() {
|
|
@@ -20122,7 +20344,7 @@
|
|
|
20122
20344
|
* correctly specify one.
|
|
20123
20345
|
*/
|
|
20124
20346
|
function findDisplayCandidate(definitions) {
|
|
20125
|
-
return find(definitions.rootElements, function(e) {
|
|
20347
|
+
return find$1(definitions.rootElements, function(e) {
|
|
20126
20348
|
return is(e, 'bpmn:Process') || is(e, 'bpmn:Collaboration');
|
|
20127
20349
|
});
|
|
20128
20350
|
}
|
|
@@ -20229,7 +20451,7 @@
|
|
|
20229
20451
|
function handlePlane(plane) {
|
|
20230
20452
|
registerDi(plane);
|
|
20231
20453
|
|
|
20232
|
-
forEach$
|
|
20454
|
+
forEach$3(plane.planeElement, handlePlaneElement);
|
|
20233
20455
|
}
|
|
20234
20456
|
|
|
20235
20457
|
function handlePlaneElement(planeElement) {
|
|
@@ -20354,7 +20576,7 @@
|
|
|
20354
20576
|
// walk through all processes that have not yet been drawn and draw them
|
|
20355
20577
|
// if they contain lanes with DI information.
|
|
20356
20578
|
// we do this to pass the free-floating lane test cases in the MIWG test suite
|
|
20357
|
-
var processes = filter(rootElements, function(e) {
|
|
20579
|
+
var processes = filter$1(rootElements, function(e) {
|
|
20358
20580
|
return !isHandled(e) && is(e, 'bpmn:Process') && e.laneSets;
|
|
20359
20581
|
});
|
|
20360
20582
|
|
|
@@ -20366,7 +20588,7 @@
|
|
|
20366
20588
|
}
|
|
20367
20589
|
|
|
20368
20590
|
function handleMessageFlows(messageFlows, context) {
|
|
20369
|
-
forEach$
|
|
20591
|
+
forEach$3(messageFlows, contextual(handleMessageFlow, context));
|
|
20370
20592
|
}
|
|
20371
20593
|
|
|
20372
20594
|
function handleDataAssociation(association, context) {
|
|
@@ -20392,7 +20614,7 @@
|
|
|
20392
20614
|
|
|
20393
20615
|
function handleArtifacts(artifacts, context) {
|
|
20394
20616
|
|
|
20395
|
-
forEach$
|
|
20617
|
+
forEach$3(artifacts, function(e) {
|
|
20396
20618
|
if (is(e, 'bpmn:Association')) {
|
|
20397
20619
|
deferred.push(function() {
|
|
20398
20620
|
handleArtifact(e, context);
|
|
@@ -20409,8 +20631,8 @@
|
|
|
20409
20631
|
return;
|
|
20410
20632
|
}
|
|
20411
20633
|
|
|
20412
|
-
forEach$
|
|
20413
|
-
forEach$
|
|
20634
|
+
forEach$3(ioSpecification.dataInputs, contextual(handleDataInput, context));
|
|
20635
|
+
forEach$3(ioSpecification.dataOutputs, contextual(handleDataOutput, context));
|
|
20414
20636
|
}
|
|
20415
20637
|
|
|
20416
20638
|
function handleSubProcess(subProcess, context) {
|
|
@@ -20437,8 +20659,8 @@
|
|
|
20437
20659
|
// * bpmn:CatchEvent
|
|
20438
20660
|
//
|
|
20439
20661
|
deferred.push(function() {
|
|
20440
|
-
forEach$
|
|
20441
|
-
forEach$
|
|
20662
|
+
forEach$3(flowNode.dataInputAssociations, contextual(handleDataAssociation, context));
|
|
20663
|
+
forEach$3(flowNode.dataOutputAssociations, contextual(handleDataAssociation, context));
|
|
20442
20664
|
});
|
|
20443
20665
|
}
|
|
20444
20666
|
|
|
@@ -20465,11 +20687,11 @@
|
|
|
20465
20687
|
}
|
|
20466
20688
|
|
|
20467
20689
|
function handleLaneSet(laneSet, context) {
|
|
20468
|
-
forEach$
|
|
20690
|
+
forEach$3(laneSet.lanes, contextual(handleLane, context));
|
|
20469
20691
|
}
|
|
20470
20692
|
|
|
20471
20693
|
function handleLaneSets(laneSets, context) {
|
|
20472
|
-
forEach$
|
|
20694
|
+
forEach$3(laneSets, contextual(handleLaneSet, context));
|
|
20473
20695
|
}
|
|
20474
20696
|
|
|
20475
20697
|
function handleFlowElementsContainer(container, context) {
|
|
@@ -20481,7 +20703,7 @@
|
|
|
20481
20703
|
}
|
|
20482
20704
|
|
|
20483
20705
|
function handleFlowElements(flowElements, context) {
|
|
20484
|
-
forEach$
|
|
20706
|
+
forEach$3(flowElements, function(e) {
|
|
20485
20707
|
if (is(e, 'bpmn:SequenceFlow')) {
|
|
20486
20708
|
deferred.push(function() {
|
|
20487
20709
|
handleSequenceFlow(e, context);
|
|
@@ -20519,7 +20741,7 @@
|
|
|
20519
20741
|
|
|
20520
20742
|
function handleCollaboration(collaboration, context) {
|
|
20521
20743
|
|
|
20522
|
-
forEach$
|
|
20744
|
+
forEach$3(collaboration.participants, contextual(handleParticipant, context));
|
|
20523
20745
|
|
|
20524
20746
|
handleArtifacts(collaboration.artifacts, context);
|
|
20525
20747
|
|
|
@@ -20533,7 +20755,7 @@
|
|
|
20533
20755
|
function wireFlowNodeRefs(lane) {
|
|
20534
20756
|
|
|
20535
20757
|
// wire the virtual flowNodeRefs <-> relationship
|
|
20536
|
-
forEach$
|
|
20758
|
+
forEach$3(lane.flowNodeRef, function(flowNode) {
|
|
20537
20759
|
var lanes = flowNode.get('lanes');
|
|
20538
20760
|
|
|
20539
20761
|
if (lanes) {
|
|
@@ -20627,7 +20849,7 @@
|
|
|
20627
20849
|
|
|
20628
20850
|
// traverse BPMN 2.0 document model,
|
|
20629
20851
|
// starting at definitions
|
|
20630
|
-
forEach$
|
|
20852
|
+
forEach$3(diagramsToImport, function(diagram) {
|
|
20631
20853
|
walker.handleDefinitions(definitions, diagram);
|
|
20632
20854
|
});
|
|
20633
20855
|
|
|
@@ -20694,12 +20916,12 @@
|
|
|
20694
20916
|
if (is$1(rootElement, 'bpmn:Collaboration')) {
|
|
20695
20917
|
collaboration = rootElement;
|
|
20696
20918
|
} else {
|
|
20697
|
-
collaboration = find(definitions.rootElements, function(element) {
|
|
20919
|
+
collaboration = find$1(definitions.rootElements, function(element) {
|
|
20698
20920
|
if (!is$1(element, 'bpmn:Collaboration')) {
|
|
20699
20921
|
return;
|
|
20700
20922
|
}
|
|
20701
20923
|
|
|
20702
|
-
return find(element.participants, function(participant) {
|
|
20924
|
+
return find$1(element.participants, function(participant) {
|
|
20703
20925
|
return participant.processRef === rootElement;
|
|
20704
20926
|
});
|
|
20705
20927
|
});
|
|
@@ -20709,7 +20931,7 @@
|
|
|
20709
20931
|
|
|
20710
20932
|
// all collaboration processes can contain sub-diagrams
|
|
20711
20933
|
if (collaboration) {
|
|
20712
|
-
rootElements = map(collaboration.participants, function(participant) {
|
|
20934
|
+
rootElements = map$1(collaboration.participants, function(participant) {
|
|
20713
20935
|
return participant.processRef;
|
|
20714
20936
|
});
|
|
20715
20937
|
|
|
@@ -20723,7 +20945,7 @@
|
|
|
20723
20945
|
var diagramsToImport = [ bpmnDiagram ];
|
|
20724
20946
|
var handledElements = [ bpmnElement ];
|
|
20725
20947
|
|
|
20726
|
-
forEach$
|
|
20948
|
+
forEach$3(definitions.diagrams, function(diagram) {
|
|
20727
20949
|
var businessObject = diagram.plane.bpmnElement;
|
|
20728
20950
|
|
|
20729
20951
|
if (
|
|
@@ -20742,7 +20964,7 @@
|
|
|
20742
20964
|
function selfAndAllFlowElements(elements) {
|
|
20743
20965
|
var result = [];
|
|
20744
20966
|
|
|
20745
|
-
forEach$
|
|
20967
|
+
forEach$3(elements, function(element) {
|
|
20746
20968
|
if (!element) {
|
|
20747
20969
|
return;
|
|
20748
20970
|
}
|
|
@@ -20835,13 +21057,13 @@
|
|
|
20835
21057
|
var lightbox;
|
|
20836
21058
|
|
|
20837
21059
|
function createLightbox() {
|
|
20838
|
-
lightbox = domify(LIGHTBOX_MARKUP);
|
|
21060
|
+
lightbox = domify$1(LIGHTBOX_MARKUP);
|
|
20839
21061
|
|
|
20840
|
-
assign$
|
|
20841
|
-
assign$
|
|
20842
|
-
assign$
|
|
20843
|
-
assign$
|
|
20844
|
-
assign$
|
|
21062
|
+
assign$3(lightbox, LIGHTBOX_STYLES);
|
|
21063
|
+
assign$3(query('svg', lightbox), LOGO_STYLES);
|
|
21064
|
+
assign$3(query('.backdrop', lightbox), BACKDROP_STYLES);
|
|
21065
|
+
assign$3(query('.notice', lightbox), NOTICE_STYLES);
|
|
21066
|
+
assign$3(query('.link', lightbox), LINK_STYLES, {
|
|
20845
21067
|
'margin': '15px 20px 15px 10px',
|
|
20846
21068
|
'alignSelf': 'center'
|
|
20847
21069
|
});
|
|
@@ -20883,7 +21105,7 @@
|
|
|
20883
21105
|
*/
|
|
20884
21106
|
function BaseViewer(options) {
|
|
20885
21107
|
|
|
20886
|
-
options = assign({}, DEFAULT_OPTIONS, options);
|
|
21108
|
+
options = assign$4({}, DEFAULT_OPTIONS, options);
|
|
20887
21109
|
|
|
20888
21110
|
this._moddle = this._createModdle(options);
|
|
20889
21111
|
|
|
@@ -21425,8 +21647,8 @@
|
|
|
21425
21647
|
|
|
21426
21648
|
const diagramModules = [].concat(staticModules, baseModules, additionalModules);
|
|
21427
21649
|
|
|
21428
|
-
const diagramOptions = assign(omit(options, [ 'additionalModules' ]), {
|
|
21429
|
-
canvas: assign({}, options.canvas, { container: container }),
|
|
21650
|
+
const diagramOptions = assign$4(omit(options, [ 'additionalModules' ]), {
|
|
21651
|
+
canvas: assign$4({}, options.canvas, { container: container }),
|
|
21430
21652
|
modules: diagramModules
|
|
21431
21653
|
});
|
|
21432
21654
|
|
|
@@ -21452,9 +21674,9 @@
|
|
|
21452
21674
|
|
|
21453
21675
|
BaseViewer.prototype._createContainer = function(options) {
|
|
21454
21676
|
|
|
21455
|
-
const container = domify('<div class="bjs-container"></div>');
|
|
21677
|
+
const container = domify$1('<div class="bjs-container"></div>');
|
|
21456
21678
|
|
|
21457
|
-
assign$
|
|
21679
|
+
assign$3(container, {
|
|
21458
21680
|
width: ensureUnit(options.width),
|
|
21459
21681
|
height: ensureUnit(options.height),
|
|
21460
21682
|
position: options.position
|
|
@@ -21464,7 +21686,7 @@
|
|
|
21464
21686
|
};
|
|
21465
21687
|
|
|
21466
21688
|
BaseViewer.prototype._createModdle = function(options) {
|
|
21467
|
-
const moddleOptions = assign({}, this._moddleExtensions, options.moddleExtensions);
|
|
21689
|
+
const moddleOptions = assign$4({}, this._moddleExtensions, options.moddleExtensions);
|
|
21468
21690
|
|
|
21469
21691
|
return new simple(moddleOptions);
|
|
21470
21692
|
};
|
|
@@ -21523,7 +21745,7 @@
|
|
|
21523
21745
|
return null;
|
|
21524
21746
|
}
|
|
21525
21747
|
|
|
21526
|
-
return find(definitions.diagrams, function(element) {
|
|
21748
|
+
return find$1(definitions.diagrams, function(element) {
|
|
21527
21749
|
return element.id === diagramId;
|
|
21528
21750
|
}) || null;
|
|
21529
21751
|
}
|
|
@@ -21548,10 +21770,10 @@
|
|
|
21548
21770
|
img +
|
|
21549
21771
|
'</a>';
|
|
21550
21772
|
|
|
21551
|
-
const linkElement = domify(linkMarkup);
|
|
21773
|
+
const linkElement = domify$1(linkMarkup);
|
|
21552
21774
|
|
|
21553
|
-
assign$
|
|
21554
|
-
assign$
|
|
21775
|
+
assign$3(query('svg', linkElement), LOGO_STYLES);
|
|
21776
|
+
assign$3(linkElement, LINK_STYLES, {
|
|
21555
21777
|
position: 'absolute',
|
|
21556
21778
|
bottom: '15px',
|
|
21557
21779
|
right: '15px',
|
|
@@ -21560,7 +21782,7 @@
|
|
|
21560
21782
|
|
|
21561
21783
|
container.appendChild(linkElement);
|
|
21562
21784
|
|
|
21563
|
-
|
|
21785
|
+
event.bind(linkElement, 'click', function(event) {
|
|
21564
21786
|
open();
|
|
21565
21787
|
|
|
21566
21788
|
event.preventDefault();
|
|
@@ -21673,7 +21895,7 @@
|
|
|
21673
21895
|
* @param {KeyboardEvent} event
|
|
21674
21896
|
*/
|
|
21675
21897
|
function isKey(keys, event) {
|
|
21676
|
-
keys = isArray$
|
|
21898
|
+
keys = isArray$4(keys) ? keys : [ keys ];
|
|
21677
21899
|
|
|
21678
21900
|
return keys.indexOf(event.key) !== -1 || keys.indexOf(event.keyCode) !== -1;
|
|
21679
21901
|
}
|
|
@@ -21829,8 +22051,8 @@
|
|
|
21829
22051
|
this._node = node;
|
|
21830
22052
|
|
|
21831
22053
|
// bind key events
|
|
21832
|
-
|
|
21833
|
-
|
|
22054
|
+
event.bind(node, 'keydown', this._keydownHandler, true);
|
|
22055
|
+
event.bind(node, 'keyup', this._keyupHandler, true);
|
|
21834
22056
|
|
|
21835
22057
|
this._fire('bind');
|
|
21836
22058
|
};
|
|
@@ -21846,8 +22068,8 @@
|
|
|
21846
22068
|
this._fire('unbind');
|
|
21847
22069
|
|
|
21848
22070
|
// unbind key events
|
|
21849
|
-
|
|
21850
|
-
|
|
22071
|
+
event.unbind(node, 'keydown', this._keydownHandler, true);
|
|
22072
|
+
event.unbind(node, 'keyup', this._keyupHandler, true);
|
|
21851
22073
|
}
|
|
21852
22074
|
|
|
21853
22075
|
this._node = null;
|
|
@@ -21867,7 +22089,7 @@
|
|
|
21867
22089
|
* @param {string} type
|
|
21868
22090
|
*/
|
|
21869
22091
|
Keyboard.prototype.addListener = function(priority, listener, type) {
|
|
21870
|
-
if (isFunction(priority)) {
|
|
22092
|
+
if (isFunction$1(priority)) {
|
|
21871
22093
|
type = listener;
|
|
21872
22094
|
listener = priority;
|
|
21873
22095
|
priority = DEFAULT_PRIORITY;
|
|
@@ -21890,7 +22112,7 @@
|
|
|
21890
22112
|
// helpers ///////
|
|
21891
22113
|
|
|
21892
22114
|
function isInput(target) {
|
|
21893
|
-
return target && (
|
|
22115
|
+
return target && (matches(target, 'input, textarea') || target.contentEditable === 'true');
|
|
21894
22116
|
}
|
|
21895
22117
|
|
|
21896
22118
|
var LOW_PRIORITY = 500;
|
|
@@ -22083,7 +22305,7 @@
|
|
|
22083
22305
|
|
|
22084
22306
|
var self = this;
|
|
22085
22307
|
|
|
22086
|
-
this._config = assign({}, DEFAULT_CONFIG, config || {});
|
|
22308
|
+
this._config = assign$4({}, DEFAULT_CONFIG, config || {});
|
|
22087
22309
|
|
|
22088
22310
|
keyboard.addListener(arrowsListener);
|
|
22089
22311
|
|
|
@@ -22290,36 +22512,36 @@
|
|
|
22290
22512
|
}
|
|
22291
22513
|
|
|
22292
22514
|
|
|
22293
|
-
function handleEnd(event) {
|
|
22294
|
-
|
|
22295
|
-
|
|
22515
|
+
function handleEnd(event$1) {
|
|
22516
|
+
event.unbind(document, 'mousemove', handleMove);
|
|
22517
|
+
event.unbind(document, 'mouseup', handleEnd);
|
|
22296
22518
|
|
|
22297
22519
|
context = null;
|
|
22298
22520
|
|
|
22299
22521
|
unset();
|
|
22300
22522
|
}
|
|
22301
22523
|
|
|
22302
|
-
function handleStart(event) {
|
|
22524
|
+
function handleStart(event$1) {
|
|
22303
22525
|
|
|
22304
22526
|
// event is already handled by '.djs-draggable'
|
|
22305
|
-
if (closest(event.target, '.djs-draggable')) {
|
|
22527
|
+
if (closest(event$1.target, '.djs-draggable')) {
|
|
22306
22528
|
return;
|
|
22307
22529
|
}
|
|
22308
22530
|
|
|
22309
|
-
var button = event.button;
|
|
22531
|
+
var button = event$1.button;
|
|
22310
22532
|
|
|
22311
22533
|
// reject right mouse button or modifier key
|
|
22312
|
-
if (button >= 2 || event.ctrlKey || event.shiftKey || event.altKey) {
|
|
22534
|
+
if (button >= 2 || event$1.ctrlKey || event$1.shiftKey || event$1.altKey) {
|
|
22313
22535
|
return;
|
|
22314
22536
|
}
|
|
22315
22537
|
|
|
22316
22538
|
context = {
|
|
22317
22539
|
button: button,
|
|
22318
|
-
start: toPoint(event)
|
|
22540
|
+
start: toPoint(event$1)
|
|
22319
22541
|
};
|
|
22320
22542
|
|
|
22321
|
-
|
|
22322
|
-
|
|
22543
|
+
event.bind(document, 'mousemove', handleMove);
|
|
22544
|
+
event.bind(document, 'mouseup', handleEnd);
|
|
22323
22545
|
|
|
22324
22546
|
// we've handled the event
|
|
22325
22547
|
return true;
|
|
@@ -22412,7 +22634,7 @@
|
|
|
22412
22634
|
this._canvas = canvas;
|
|
22413
22635
|
this._container = canvas._container;
|
|
22414
22636
|
|
|
22415
|
-
this._handleWheel = bind(this._handleWheel, this);
|
|
22637
|
+
this._handleWheel = bind$3(this._handleWheel, this);
|
|
22416
22638
|
|
|
22417
22639
|
this._totalDelta = 0;
|
|
22418
22640
|
this._scale = config.scale || DEFAULT_SCALE;
|
|
@@ -22587,7 +22809,7 @@
|
|
|
22587
22809
|
|
|
22588
22810
|
// add or remove wheel listener based on
|
|
22589
22811
|
// changed enabled state
|
|
22590
|
-
|
|
22812
|
+
event[newEnabled ? 'bind' : 'unbind'](element, 'wheel', handleWheel, false);
|
|
22591
22813
|
}
|
|
22592
22814
|
|
|
22593
22815
|
this._enabled = newEnabled;
|