@a2simcode/ui 0.0.41 → 0.0.43
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/components/index.d.ts +1 -0
- package/dist/simcode-ui.es.js +218 -19262
- package/dist/simcode-ui.es10.js +6 -0
- package/dist/simcode-ui.es100.js +121 -0
- package/dist/simcode-ui.es101.js +157 -0
- package/dist/simcode-ui.es102.js +561 -0
- package/dist/simcode-ui.es103.js +78 -0
- package/dist/simcode-ui.es104.js +403 -0
- package/dist/simcode-ui.es105.js +219 -0
- package/dist/simcode-ui.es106.js +371 -0
- package/dist/simcode-ui.es107.js +114 -0
- package/dist/simcode-ui.es108.js +82 -0
- package/dist/simcode-ui.es109.js +32 -0
- package/dist/simcode-ui.es11.js +6 -0
- package/dist/simcode-ui.es110.js +215 -0
- package/dist/simcode-ui.es111.js +150 -0
- package/dist/simcode-ui.es112.js +131 -0
- package/dist/simcode-ui.es113.js +107 -0
- package/dist/simcode-ui.es114.js +58 -0
- package/dist/simcode-ui.es115.js +34 -0
- package/dist/simcode-ui.es116.js +7 -0
- package/dist/simcode-ui.es117.js +134 -0
- package/dist/simcode-ui.es118.js +151 -0
- package/dist/simcode-ui.es119.js +4 -0
- package/dist/simcode-ui.es12.js +6 -0
- package/dist/simcode-ui.es120.js +4 -0
- package/dist/simcode-ui.es121.js +4 -0
- package/dist/simcode-ui.es122.js +4 -0
- package/dist/simcode-ui.es123.js +4 -0
- package/dist/simcode-ui.es124.js +4 -0
- package/dist/simcode-ui.es125.js +4 -0
- package/dist/simcode-ui.es126.js +4 -0
- package/dist/simcode-ui.es127.js +4 -0
- package/dist/simcode-ui.es128.js +85 -0
- package/dist/simcode-ui.es13.js +6 -0
- package/dist/simcode-ui.es130.js +9 -0
- package/dist/simcode-ui.es131.js +4 -0
- package/dist/simcode-ui.es132.js +4 -0
- package/dist/simcode-ui.es133.js +4 -0
- package/dist/simcode-ui.es134.js +4 -0
- package/dist/simcode-ui.es135.js +4 -0
- package/dist/simcode-ui.es136.js +4 -0
- package/dist/simcode-ui.es137.js +4 -0
- package/dist/simcode-ui.es138.js +4 -0
- package/dist/simcode-ui.es139.js +4 -0
- package/dist/simcode-ui.es14.js +7 -0
- package/dist/simcode-ui.es140.js +4 -0
- package/dist/simcode-ui.es141.js +4 -0
- package/dist/simcode-ui.es142.js +4 -0
- package/dist/simcode-ui.es143.js +4 -0
- package/dist/simcode-ui.es144.js +4 -0
- package/dist/simcode-ui.es145.js +4 -0
- package/dist/simcode-ui.es146.js +4 -0
- package/dist/simcode-ui.es147.js +4 -0
- package/dist/simcode-ui.es148.js +4 -0
- package/dist/simcode-ui.es149.js +4 -0
- package/dist/simcode-ui.es15.js +7 -0
- package/dist/simcode-ui.es150.js +4 -0
- package/dist/simcode-ui.es151.js +4 -0
- package/dist/simcode-ui.es152.js +4 -0
- package/dist/simcode-ui.es153.js +4 -0
- package/dist/simcode-ui.es154.js +4 -0
- package/dist/simcode-ui.es155.js +4 -0
- package/dist/simcode-ui.es156.js +4 -0
- package/dist/simcode-ui.es157.js +4 -0
- package/dist/simcode-ui.es158.js +4 -0
- package/dist/simcode-ui.es159.js +4 -0
- package/dist/simcode-ui.es16.js +7 -0
- package/dist/simcode-ui.es160.js +4 -0
- package/dist/simcode-ui.es161.js +4 -0
- package/dist/simcode-ui.es162.js +4 -0
- package/dist/simcode-ui.es163.js +4 -0
- package/dist/simcode-ui.es164.js +4 -0
- package/dist/simcode-ui.es165.js +121 -0
- package/dist/simcode-ui.es167.js +4 -0
- package/dist/simcode-ui.es168.js +4 -0
- package/dist/simcode-ui.es169.js +4 -0
- package/dist/simcode-ui.es17.js +7 -0
- package/dist/simcode-ui.es170.js +4 -0
- package/dist/simcode-ui.es171.js +4 -0
- package/dist/simcode-ui.es172.js +4 -0
- package/dist/simcode-ui.es173.js +4 -0
- package/dist/simcode-ui.es174.js +110 -0
- package/dist/simcode-ui.es175.js +88 -0
- package/dist/simcode-ui.es177.js +262 -0
- package/dist/simcode-ui.es179.js +92 -0
- package/dist/simcode-ui.es18.js +7 -0
- package/dist/simcode-ui.es181.js +158 -0
- package/dist/simcode-ui.es183.js +37 -0
- package/dist/simcode-ui.es184.js +52 -0
- package/dist/simcode-ui.es185.js +34 -0
- package/dist/simcode-ui.es186.js +53 -0
- package/dist/simcode-ui.es187.js +9 -0
- package/dist/simcode-ui.es188.js +216 -0
- package/dist/simcode-ui.es189.js +33 -0
- package/dist/simcode-ui.es19.js +7 -0
- package/dist/simcode-ui.es190.js +28 -0
- package/dist/simcode-ui.es191.js +49 -0
- package/dist/simcode-ui.es192.js +74 -0
- package/dist/simcode-ui.es193.js +47 -0
- package/dist/simcode-ui.es196.js +23 -0
- package/dist/simcode-ui.es197.js +20 -0
- package/dist/simcode-ui.es198.js +8 -0
- package/dist/simcode-ui.es199.js +8 -0
- package/dist/simcode-ui.es2.js +6 -0
- package/dist/simcode-ui.es20.js +7 -0
- package/dist/simcode-ui.es200.js +20 -0
- package/dist/simcode-ui.es201.js +12 -0
- package/dist/simcode-ui.es202.js +7 -0
- package/dist/simcode-ui.es203.js +32 -0
- package/dist/simcode-ui.es204.js +5 -0
- package/dist/simcode-ui.es205.js +5 -0
- package/dist/simcode-ui.es206.js +5 -0
- package/dist/simcode-ui.es207.js +5 -0
- package/dist/simcode-ui.es208.js +4 -0
- package/dist/simcode-ui.es209.js +4 -0
- package/dist/simcode-ui.es21.js +7 -0
- package/dist/simcode-ui.es210.js +4 -0
- package/dist/simcode-ui.es211.js +32 -0
- package/dist/simcode-ui.es212.js +4 -0
- package/dist/simcode-ui.es213.js +4 -0
- package/dist/simcode-ui.es214.js +4 -0
- package/dist/simcode-ui.es215.js +4 -0
- package/dist/simcode-ui.es216.js +126 -0
- package/dist/simcode-ui.es217.js +13 -0
- package/dist/simcode-ui.es218.js +8 -0
- package/dist/simcode-ui.es219.js +8 -0
- package/dist/simcode-ui.es22.js +6 -0
- package/dist/simcode-ui.es220.js +16 -0
- package/dist/simcode-ui.es221.js +150 -0
- package/dist/simcode-ui.es222.js +34 -0
- package/dist/simcode-ui.es223.js +63 -0
- package/dist/simcode-ui.es224.js +36 -0
- package/dist/simcode-ui.es225.js +52 -0
- package/dist/simcode-ui.es226.js +73 -0
- package/dist/simcode-ui.es227.js +7 -0
- package/dist/simcode-ui.es228.js +8 -0
- package/dist/simcode-ui.es229.js +56 -0
- package/dist/simcode-ui.es23.js +6 -0
- package/dist/simcode-ui.es230.js +23 -0
- package/dist/simcode-ui.es231.js +16 -0
- package/dist/simcode-ui.es232.js +35 -0
- package/dist/simcode-ui.es233.js +38 -0
- package/dist/simcode-ui.es234.js +435 -0
- package/dist/simcode-ui.es235.js +63 -0
- package/dist/simcode-ui.es236.js +81 -0
- package/dist/simcode-ui.es237.js +101 -0
- package/dist/simcode-ui.es238.js +221 -0
- package/dist/simcode-ui.es239.js +159 -0
- package/dist/simcode-ui.es24.js +6 -0
- package/dist/simcode-ui.es240.js +10 -0
- package/dist/simcode-ui.es241.js +19 -0
- package/dist/simcode-ui.es242.js +25 -0
- package/dist/simcode-ui.es243.js +8 -0
- package/dist/simcode-ui.es244.js +62 -0
- package/dist/simcode-ui.es245.js +62 -0
- package/dist/simcode-ui.es246.js +59 -0
- package/dist/simcode-ui.es247.js +141 -0
- package/dist/simcode-ui.es248.js +13 -0
- package/dist/simcode-ui.es249.js +13 -0
- package/dist/simcode-ui.es25.js +6 -0
- package/dist/simcode-ui.es250.js +16 -0
- package/dist/simcode-ui.es251.js +20 -0
- package/dist/simcode-ui.es252.js +8 -0
- package/dist/simcode-ui.es253.js +39 -0
- package/dist/simcode-ui.es254.js +36 -0
- package/dist/simcode-ui.es255.js +41 -0
- package/dist/simcode-ui.es256.js +11 -0
- package/dist/simcode-ui.es257.js +10 -0
- package/dist/simcode-ui.es258.js +130 -0
- package/dist/simcode-ui.es259.js +79 -0
- package/dist/simcode-ui.es26.js +6 -0
- package/dist/simcode-ui.es260.js +89 -0
- package/dist/simcode-ui.es261.js +71 -0
- package/dist/simcode-ui.es262.js +11 -0
- package/dist/simcode-ui.es263.js +6 -0
- package/dist/simcode-ui.es264.js +141 -0
- package/dist/simcode-ui.es265.js +58 -0
- package/dist/simcode-ui.es266.js +23 -0
- package/dist/simcode-ui.es267.js +7 -0
- package/dist/simcode-ui.es268.js +276 -0
- package/dist/simcode-ui.es269.js +50 -0
- package/dist/simcode-ui.es27.js +6 -0
- package/dist/simcode-ui.es270.js +40 -0
- package/dist/simcode-ui.es271.js +12 -0
- package/dist/simcode-ui.es272.js +259 -0
- package/dist/simcode-ui.es273.js +12 -0
- package/dist/simcode-ui.es274.js +6 -0
- package/dist/simcode-ui.es275.js +6 -0
- package/dist/simcode-ui.es276.js +152 -0
- package/dist/simcode-ui.es277.js +20 -0
- package/dist/simcode-ui.es278.js +44 -0
- package/dist/simcode-ui.es279.js +7 -0
- package/dist/simcode-ui.es28.js +6 -0
- package/dist/simcode-ui.es280.js +40 -0
- package/dist/simcode-ui.es281.js +338 -0
- package/dist/simcode-ui.es282.js +9 -0
- package/dist/simcode-ui.es283.js +6 -0
- package/dist/simcode-ui.es284.js +29 -0
- package/dist/simcode-ui.es285.js +12 -0
- package/dist/simcode-ui.es286.js +52 -0
- package/dist/simcode-ui.es287.js +20 -0
- package/dist/simcode-ui.es288.js +29 -0
- package/dist/simcode-ui.es289.js +19 -0
- package/dist/simcode-ui.es29.js +6 -0
- package/dist/simcode-ui.es290.js +66 -0
- package/dist/simcode-ui.es291.js +24 -0
- package/dist/simcode-ui.es292.js +24 -0
- package/dist/simcode-ui.es293.js +28 -0
- package/dist/simcode-ui.es294.js +17 -0
- package/dist/simcode-ui.es295.js +28 -0
- package/dist/simcode-ui.es296.js +56 -0
- package/dist/simcode-ui.es297.js +18 -0
- package/dist/simcode-ui.es298.js +19 -0
- package/dist/simcode-ui.es299.js +21 -0
- package/dist/simcode-ui.es3.js +6 -0
- package/dist/simcode-ui.es30.js +6 -0
- package/dist/simcode-ui.es300.js +46 -0
- package/dist/simcode-ui.es301.js +25 -0
- package/dist/simcode-ui.es302.js +66 -0
- package/dist/simcode-ui.es303.js +50 -0
- package/dist/simcode-ui.es304.js +106 -0
- package/dist/simcode-ui.es305.js +36 -0
- package/dist/simcode-ui.es306.js +25 -0
- package/dist/simcode-ui.es307.js +13 -0
- package/dist/simcode-ui.es308.js +85 -0
- package/dist/simcode-ui.es309.js +30 -0
- package/dist/simcode-ui.es31.js +6 -0
- package/dist/simcode-ui.es310.js +51 -0
- package/dist/simcode-ui.es311.js +53 -0
- package/dist/simcode-ui.es312.js +22 -0
- package/dist/simcode-ui.es313.js +4 -0
- package/dist/simcode-ui.es314.js +15 -0
- package/dist/simcode-ui.es315.js +15 -0
- package/dist/simcode-ui.es316.js +44 -0
- package/dist/simcode-ui.es317.js +4 -0
- package/dist/simcode-ui.es32.js +6 -0
- package/dist/simcode-ui.es33.js +6 -0
- package/dist/simcode-ui.es34.js +6 -0
- package/dist/simcode-ui.es35.js +7 -0
- package/dist/simcode-ui.es36.js +6 -0
- package/dist/simcode-ui.es37.js +6 -0
- package/dist/simcode-ui.es38.js +6 -0
- package/dist/simcode-ui.es39.js +7 -0
- package/dist/simcode-ui.es4.js +6 -0
- package/dist/simcode-ui.es40.js +6 -0
- package/dist/simcode-ui.es41.js +7 -0
- package/dist/simcode-ui.es42.js +7 -0
- package/dist/simcode-ui.es43.js +7 -0
- package/dist/simcode-ui.es44.js +6 -0
- package/dist/simcode-ui.es45.js +7 -0
- package/dist/simcode-ui.es46.js +7 -0
- package/dist/simcode-ui.es47.js +7 -0
- package/dist/simcode-ui.es48.js +6 -0
- package/dist/simcode-ui.es49.js +6 -0
- package/dist/simcode-ui.es5.js +7 -0
- package/dist/simcode-ui.es50.js +7 -0
- package/dist/simcode-ui.es51.js +7 -0
- package/dist/simcode-ui.es52.js +6 -0
- package/dist/simcode-ui.es53.js +6 -0
- package/dist/simcode-ui.es55.js +115 -0
- package/dist/simcode-ui.es56.js +58 -0
- package/dist/simcode-ui.es57.js +185 -0
- package/dist/simcode-ui.es58.js +12 -0
- package/dist/simcode-ui.es59.js +32 -0
- package/dist/simcode-ui.es6.js +6 -0
- package/dist/simcode-ui.es60.js +67 -0
- package/dist/simcode-ui.es61.js +16 -0
- package/dist/simcode-ui.es62.js +14 -0
- package/dist/simcode-ui.es63.js +102 -0
- package/dist/simcode-ui.es64.js +21 -0
- package/dist/simcode-ui.es65.js +18 -0
- package/dist/simcode-ui.es66.js +6 -0
- package/dist/simcode-ui.es67.js +186 -0
- package/dist/simcode-ui.es68.js +99 -0
- package/dist/simcode-ui.es69.js +129 -0
- package/dist/simcode-ui.es7.js +6 -0
- package/dist/simcode-ui.es70.js +48 -0
- package/dist/simcode-ui.es71.js +118 -0
- package/dist/simcode-ui.es72.js +186 -0
- package/dist/simcode-ui.es73.js +100 -0
- package/dist/simcode-ui.es74.js +72 -0
- package/dist/simcode-ui.es75.js +116 -0
- package/dist/simcode-ui.es76.js +157 -0
- package/dist/simcode-ui.es77.js +303 -0
- package/dist/simcode-ui.es78.js +824 -0
- package/dist/simcode-ui.es79.js +426 -0
- package/dist/simcode-ui.es8.js +6 -0
- package/dist/simcode-ui.es80.js +294 -0
- package/dist/simcode-ui.es81.js +336 -0
- package/dist/simcode-ui.es82.js +210 -0
- package/dist/simcode-ui.es83.js +100 -0
- package/dist/simcode-ui.es84.js +77 -0
- package/dist/simcode-ui.es85.js +48 -0
- package/dist/simcode-ui.es86.js +74 -0
- package/dist/simcode-ui.es87.js +449 -0
- package/dist/simcode-ui.es88.js +7 -0
- package/dist/simcode-ui.es89.js +305 -0
- package/dist/simcode-ui.es9.js +6 -0
- package/dist/simcode-ui.es90.js +196 -0
- package/dist/simcode-ui.es91.js +70 -0
- package/dist/simcode-ui.es92.js +27 -0
- package/dist/simcode-ui.es93.js +41 -0
- package/dist/simcode-ui.es94.js +17 -0
- package/dist/simcode-ui.es95.js +68 -0
- package/dist/simcode-ui.es96.js +83 -0
- package/dist/simcode-ui.es97.js +125 -0
- package/dist/simcode-ui.es98.js +28 -0
- package/dist/simcode-ui.es99.js +204 -0
- package/dist/stats.html +1 -1
- package/package.json +9 -5
- package/dist/simcode-ui.umd.js +0 -23
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { forEach as s } from "min-dash";
|
|
2
|
+
function n(i, e) {
|
|
3
|
+
this._modeling = i, this._elementRegistry = e;
|
|
4
|
+
}
|
|
5
|
+
n.$inject = [
|
|
6
|
+
"modeling",
|
|
7
|
+
"elementRegistry"
|
|
8
|
+
];
|
|
9
|
+
n.prototype.postExecute = function(i) {
|
|
10
|
+
var e = this._modeling, o = this._elementRegistry, r = i.elements;
|
|
11
|
+
s(r, function(t) {
|
|
12
|
+
o.get(t.id) && (t.waypoints ? e.removeConnection(t) : e.removeShape(t));
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
n as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { indexOf as d, add as s } from "./simcode-ui.es284.js";
|
|
2
|
+
import { saveClear as t } from "./simcode-ui.es285.js";
|
|
3
|
+
import { isConnection as p } from "./simcode-ui.es262.js";
|
|
4
|
+
function o(r, a) {
|
|
5
|
+
this._canvas = r, this._modeling = a;
|
|
6
|
+
}
|
|
7
|
+
o.$inject = ["canvas", "modeling"];
|
|
8
|
+
o.prototype.preExecute = function(r) {
|
|
9
|
+
var a = this._modeling, n = r.shape;
|
|
10
|
+
t(n.incoming, function(e) {
|
|
11
|
+
a.removeConnection(e, { nested: !0 });
|
|
12
|
+
}), t(n.outgoing, function(e) {
|
|
13
|
+
a.removeConnection(e, { nested: !0 });
|
|
14
|
+
}), t(n.children, function(e) {
|
|
15
|
+
p(e) ? a.removeConnection(e, { nested: !0 }) : a.removeShape(e, { nested: !0 });
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
o.prototype.execute = function(r) {
|
|
19
|
+
var a = this._canvas, n = r.shape, e = n.parent;
|
|
20
|
+
return r.oldParent = e, r.oldParentIndex = d(e.children, n), a.removeShape(n), n;
|
|
21
|
+
};
|
|
22
|
+
o.prototype.revert = function(r) {
|
|
23
|
+
var a = this._canvas, n = r.shape, e = r.oldParent, i = r.oldParentIndex;
|
|
24
|
+
return s(e.children, n, i), a.addShape(n, e), n;
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
o as default
|
|
28
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { forEach as c, sortBy as B } from "min-dash";
|
|
2
|
+
function x(s) {
|
|
3
|
+
this._modeling = s;
|
|
4
|
+
}
|
|
5
|
+
x.$inject = ["modeling"];
|
|
6
|
+
var _ = {
|
|
7
|
+
x: "y",
|
|
8
|
+
y: "x"
|
|
9
|
+
};
|
|
10
|
+
x.prototype.preExecute = function(s) {
|
|
11
|
+
var h = this._modeling, e = s.groups, a = s.axis, o = s.dimension;
|
|
12
|
+
function g(n, r) {
|
|
13
|
+
n.range.min = Math.min(r[a], n.range.min), n.range.max = Math.max(r[a] + r[o], n.range.max);
|
|
14
|
+
}
|
|
15
|
+
function v(n) {
|
|
16
|
+
return n[a] + n[o] / 2;
|
|
17
|
+
}
|
|
18
|
+
function d(n) {
|
|
19
|
+
return n.length - 1;
|
|
20
|
+
}
|
|
21
|
+
function E(n) {
|
|
22
|
+
return n.max - n.min;
|
|
23
|
+
}
|
|
24
|
+
function b(n, r) {
|
|
25
|
+
var t = { y: 0 };
|
|
26
|
+
t[a] = n - v(r), t[a] && (t[_[a]] = 0, h.moveElements([r], t, r.parent));
|
|
27
|
+
}
|
|
28
|
+
var y = e[0], M = d(e), G = e[M], l, I, u = 0;
|
|
29
|
+
c(e, function(n, r) {
|
|
30
|
+
var t, m, i;
|
|
31
|
+
if (n.elements.length < 2) {
|
|
32
|
+
r && r !== e.length - 1 && (g(n, n.elements[0]), u += E(n.range));
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
t = B(n.elements, a), m = t[0], r === M && (m = t[d(t)]), i = v(m), n.range = null, c(t, function(f) {
|
|
36
|
+
if (b(i, f), n.range === null) {
|
|
37
|
+
n.range = {
|
|
38
|
+
min: f[a],
|
|
39
|
+
max: f[a] + f[o]
|
|
40
|
+
};
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
g(n, f);
|
|
44
|
+
}), r && r !== e.length - 1 && (u += E(n.range));
|
|
45
|
+
}), I = Math.abs(G.range.min - y.range.max), l = Math.round((I - u) / (e.length - 1)), !(l < e.length - 1) && c(e, function(n, r) {
|
|
46
|
+
var t = {}, m;
|
|
47
|
+
n === y || n === G || (m = e[r - 1], n.range.max = 0, c(n.elements, function(i, f) {
|
|
48
|
+
t[_[a]] = 0, t[a] = m.range.max - i[a] + l, n.range.min !== i[a] && (t[a] += i[a] - n.range.min), t[a] && h.moveElements([i], t, i.parent), n.range.max = Math.max(i[a] + i[o], f ? n.range.max : 0);
|
|
49
|
+
}));
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
x.prototype.postExecute = function(s) {
|
|
53
|
+
};
|
|
54
|
+
export {
|
|
55
|
+
x as default
|
|
56
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { assign as i } from "min-dash";
|
|
2
|
+
function t(o, n) {
|
|
3
|
+
this._layouter = o, this._canvas = n;
|
|
4
|
+
}
|
|
5
|
+
t.$inject = ["layouter", "canvas"];
|
|
6
|
+
t.prototype.execute = function(o) {
|
|
7
|
+
var n = o.connection, a = n.waypoints;
|
|
8
|
+
return i(o, {
|
|
9
|
+
oldWaypoints: a
|
|
10
|
+
}), n.waypoints = this._layouter.layoutConnection(n, o.hints), n;
|
|
11
|
+
};
|
|
12
|
+
t.prototype.revert = function(o) {
|
|
13
|
+
var n = o.connection;
|
|
14
|
+
return n.waypoints = o.oldWaypoints, n;
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
t as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { forEach as d } from "min-dash";
|
|
2
|
+
import { remove as l, add as c } from "./simcode-ui.es284.js";
|
|
3
|
+
function y() {
|
|
4
|
+
}
|
|
5
|
+
y.prototype.execute = function(e) {
|
|
6
|
+
var n = e.connection, o = e.delta, i = e.newParent || n.parent, t = e.newParentIndex, a = n.parent;
|
|
7
|
+
return e.oldParent = a, e.oldParentIndex = l(a.children, n), c(i.children, n, t), n.parent = i, d(n.waypoints, function(r) {
|
|
8
|
+
r.x += o.x, r.y += o.y, r.original && (r.original.x += o.x, r.original.y += o.y);
|
|
9
|
+
}), n;
|
|
10
|
+
};
|
|
11
|
+
y.prototype.revert = function(e) {
|
|
12
|
+
var n = e.connection, o = n.parent, i = e.oldParent, t = e.oldParentIndex, a = e.delta;
|
|
13
|
+
return l(o.children, n), c(i.children, n, t), n.parent = i, d(n.waypoints, function(r) {
|
|
14
|
+
r.x -= a.x, r.y -= a.y, r.original && (r.original.x -= a.x, r.original.y -= a.y);
|
|
15
|
+
}), n;
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
y as default
|
|
19
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import t from "./simcode-ui.es309.js";
|
|
2
|
+
function o(e) {
|
|
3
|
+
this._helper = new t(e);
|
|
4
|
+
}
|
|
5
|
+
o.$inject = ["modeling"];
|
|
6
|
+
o.prototype.preExecute = function(e) {
|
|
7
|
+
e.closure = this._helper.getClosure(e.shapes);
|
|
8
|
+
};
|
|
9
|
+
o.prototype.postExecute = function(e) {
|
|
10
|
+
var r = e.hints, p;
|
|
11
|
+
r && r.primaryShape && (p = r.primaryShape, r.oldParent = p.parent), this._helper.moveClosure(
|
|
12
|
+
e.closure,
|
|
13
|
+
e.delta,
|
|
14
|
+
e.newParent,
|
|
15
|
+
e.newHost,
|
|
16
|
+
p
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
o as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { pick as h, assign as l, forEach as d } from "min-dash";
|
|
2
|
+
import s from "./simcode-ui.es309.js";
|
|
3
|
+
import { remove as u, add as p } from "./simcode-ui.es284.js";
|
|
4
|
+
import { getMovedTargetAnchor as f, getMovedSourceAnchor as m } from "./simcode-ui.es310.js";
|
|
5
|
+
function i(e) {
|
|
6
|
+
this._modeling = e, this._helper = new s(e);
|
|
7
|
+
}
|
|
8
|
+
i.$inject = ["modeling"];
|
|
9
|
+
i.prototype.execute = function(e) {
|
|
10
|
+
var n = e.shape, r = e.delta, t = e.newParent || n.parent, o = e.newParentIndex, a = n.parent;
|
|
11
|
+
return e.oldBounds = h(n, ["x", "y", "width", "height"]), e.oldParent = a, e.oldParentIndex = u(a.children, n), p(t.children, n, o), l(n, {
|
|
12
|
+
parent: t,
|
|
13
|
+
x: n.x + r.x,
|
|
14
|
+
y: n.y + r.y
|
|
15
|
+
}), n;
|
|
16
|
+
};
|
|
17
|
+
i.prototype.postExecute = function(e) {
|
|
18
|
+
var n = e.shape, r = e.delta, t = e.hints, o = this._modeling;
|
|
19
|
+
t.layout !== !1 && (d(n.incoming, function(a) {
|
|
20
|
+
o.layoutConnection(a, {
|
|
21
|
+
connectionEnd: f(a, n, r)
|
|
22
|
+
});
|
|
23
|
+
}), d(n.outgoing, function(a) {
|
|
24
|
+
o.layoutConnection(a, {
|
|
25
|
+
connectionStart: m(a, n, r)
|
|
26
|
+
});
|
|
27
|
+
})), t.recurse !== !1 && this.moveChildren(e);
|
|
28
|
+
};
|
|
29
|
+
i.prototype.revert = function(e) {
|
|
30
|
+
var n = e.shape, r = e.oldParent, t = e.oldParentIndex, o = e.delta;
|
|
31
|
+
return p(r.children, n, t), l(n, {
|
|
32
|
+
parent: r,
|
|
33
|
+
x: n.x - o.x,
|
|
34
|
+
y: n.y - o.y
|
|
35
|
+
}), n;
|
|
36
|
+
};
|
|
37
|
+
i.prototype.moveChildren = function(e) {
|
|
38
|
+
var n = e.delta, r = e.shape;
|
|
39
|
+
this._helper.moveRecursive(r.children, n, null);
|
|
40
|
+
};
|
|
41
|
+
i.prototype.getNewParent = function(e) {
|
|
42
|
+
return e.newParent || e.shape.parent;
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
i as default
|
|
46
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { isArray as u } from "min-dash";
|
|
2
|
+
function a(n) {
|
|
3
|
+
this._modeling = n;
|
|
4
|
+
}
|
|
5
|
+
a.$inject = ["modeling"];
|
|
6
|
+
a.prototype.execute = function(n) {
|
|
7
|
+
var r = n.newSource, i = n.newTarget, e = n.connection, o = n.dockingOrPoints;
|
|
8
|
+
if (!r && !i)
|
|
9
|
+
throw new Error("newSource or newTarget required");
|
|
10
|
+
return u(o) && (n.oldWaypoints = e.waypoints, e.waypoints = o), r && (n.oldSource = e.source, e.source = r), i && (n.oldTarget = e.target, e.target = i), e;
|
|
11
|
+
};
|
|
12
|
+
a.prototype.postExecute = function(n) {
|
|
13
|
+
var r = n.connection, i = n.newSource, e = n.newTarget, o = n.dockingOrPoints, t = n.hints || {}, c = {};
|
|
14
|
+
t.connectionStart && (c.connectionStart = t.connectionStart), t.connectionEnd && (c.connectionEnd = t.connectionEnd), t.layoutConnection !== !1 && (i && (!e || t.docking === "source") && (c.connectionStart = c.connectionStart || d(u(o) ? o[0] : o)), e && (!i || t.docking === "target") && (c.connectionEnd = c.connectionEnd || d(u(o) ? o[o.length - 1] : o)), t.newWaypoints && (c.waypoints = t.newWaypoints), this._modeling.layoutConnection(r, c));
|
|
15
|
+
};
|
|
16
|
+
a.prototype.revert = function(n) {
|
|
17
|
+
var r = n.oldSource, i = n.oldTarget, e = n.oldWaypoints, o = n.connection;
|
|
18
|
+
return r && (o.source = r), i && (o.target = i), e && (o.waypoints = e), o;
|
|
19
|
+
};
|
|
20
|
+
function d(n) {
|
|
21
|
+
return n.original || n;
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
a as default
|
|
25
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { forEach as f } from "min-dash";
|
|
2
|
+
import { getResizedTargetAnchor as y, getResizedSourceAnchor as w } from "./simcode-ui.es310.js";
|
|
3
|
+
function a(e, t) {
|
|
4
|
+
this._modeling = e, this._rules = t;
|
|
5
|
+
}
|
|
6
|
+
a.$inject = ["modeling", "rules"];
|
|
7
|
+
a.prototype.preExecute = function(e) {
|
|
8
|
+
var t = this, i = this._modeling, c = this._rules, n = e.oldShape, s = e.newData, h = e.hints || {}, r;
|
|
9
|
+
function d(o, l, p) {
|
|
10
|
+
return c.allowed("connection.reconnect", {
|
|
11
|
+
connection: p,
|
|
12
|
+
source: o,
|
|
13
|
+
target: l
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
var m = {
|
|
17
|
+
x: s.x,
|
|
18
|
+
y: s.y
|
|
19
|
+
}, u = {
|
|
20
|
+
x: n.x,
|
|
21
|
+
y: n.y,
|
|
22
|
+
width: n.width,
|
|
23
|
+
height: n.height
|
|
24
|
+
};
|
|
25
|
+
r = e.newShape = e.newShape || t.createShape(s, m, n.parent, h), n.host && i.updateAttachment(r, n.host);
|
|
26
|
+
var g;
|
|
27
|
+
h.moveChildren !== !1 && (g = n.children.slice(), i.moveElements(g, { x: 0, y: 0 }, r, h));
|
|
28
|
+
var S = n.incoming.slice(), v = n.outgoing.slice();
|
|
29
|
+
f(S, function(o) {
|
|
30
|
+
var l = o.source, p = d(l, r, o);
|
|
31
|
+
p && t.reconnectEnd(
|
|
32
|
+
o,
|
|
33
|
+
r,
|
|
34
|
+
y(o, r, u),
|
|
35
|
+
h
|
|
36
|
+
);
|
|
37
|
+
}), f(v, function(o) {
|
|
38
|
+
var l = o.target, p = d(r, l, o);
|
|
39
|
+
p && t.reconnectStart(
|
|
40
|
+
o,
|
|
41
|
+
r,
|
|
42
|
+
w(o, r, u),
|
|
43
|
+
h
|
|
44
|
+
);
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
a.prototype.postExecute = function(e) {
|
|
48
|
+
var t = e.oldShape;
|
|
49
|
+
this._modeling.removeShape(t);
|
|
50
|
+
};
|
|
51
|
+
a.prototype.execute = function(e) {
|
|
52
|
+
};
|
|
53
|
+
a.prototype.revert = function(e) {
|
|
54
|
+
};
|
|
55
|
+
a.prototype.createShape = function(e, t, i, c) {
|
|
56
|
+
return this._modeling.createShape(e, t, i, c);
|
|
57
|
+
};
|
|
58
|
+
a.prototype.reconnectStart = function(e, t, i, c) {
|
|
59
|
+
this._modeling.reconnectStart(e, t, i, c);
|
|
60
|
+
};
|
|
61
|
+
a.prototype.reconnectEnd = function(e, t, i, c) {
|
|
62
|
+
this._modeling.reconnectEnd(e, t, i, c);
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
a as default
|
|
66
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { assign as r, forEach as d } from "min-dash";
|
|
2
|
+
import { getResizedTargetAnchor as u, getResizedSourceAnchor as a } from "./simcode-ui.es310.js";
|
|
3
|
+
function o(n) {
|
|
4
|
+
this._modeling = n;
|
|
5
|
+
}
|
|
6
|
+
o.$inject = ["modeling"];
|
|
7
|
+
o.prototype.execute = function(n) {
|
|
8
|
+
var i = n.shape, e = n.newBounds, t = n.minBounds;
|
|
9
|
+
if (e.x === void 0 || e.y === void 0 || e.width === void 0 || e.height === void 0)
|
|
10
|
+
throw new Error("newBounds must have {x, y, width, height} properties");
|
|
11
|
+
if (t && (e.width < t.width || e.height < t.height))
|
|
12
|
+
throw new Error("width and height cannot be less than minimum height and width");
|
|
13
|
+
if (!t && e.width < 10 || e.height < 10)
|
|
14
|
+
throw new Error("width and height cannot be less than 10px");
|
|
15
|
+
return n.oldBounds = {
|
|
16
|
+
width: i.width,
|
|
17
|
+
height: i.height,
|
|
18
|
+
x: i.x,
|
|
19
|
+
y: i.y
|
|
20
|
+
}, r(i, {
|
|
21
|
+
width: e.width,
|
|
22
|
+
height: e.height,
|
|
23
|
+
x: e.x,
|
|
24
|
+
y: e.y
|
|
25
|
+
}), i;
|
|
26
|
+
};
|
|
27
|
+
o.prototype.postExecute = function(n) {
|
|
28
|
+
var i = this._modeling, e = n.shape, t = n.oldBounds, s = n.hints || {};
|
|
29
|
+
s.layout !== !1 && (d(e.incoming, function(h) {
|
|
30
|
+
i.layoutConnection(h, {
|
|
31
|
+
connectionEnd: u(h, e, t)
|
|
32
|
+
});
|
|
33
|
+
}), d(e.outgoing, function(h) {
|
|
34
|
+
i.layoutConnection(h, {
|
|
35
|
+
connectionStart: a(h, e, t)
|
|
36
|
+
});
|
|
37
|
+
}));
|
|
38
|
+
};
|
|
39
|
+
o.prototype.revert = function(n) {
|
|
40
|
+
var i = n.shape, e = n.oldBounds;
|
|
41
|
+
return r(i, {
|
|
42
|
+
width: e.width,
|
|
43
|
+
height: e.height,
|
|
44
|
+
x: e.x,
|
|
45
|
+
y: e.y
|
|
46
|
+
}), i;
|
|
47
|
+
};
|
|
48
|
+
export {
|
|
49
|
+
o as default
|
|
50
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { forEach as v, map as x, assign as A } from "min-dash";
|
|
2
|
+
import { getWaypointsUpdatingConnections as _, resizeBounds as B } from "./simcode-ui.es311.js";
|
|
3
|
+
import { getMovedSourceAnchor as C, getMovedTargetAnchor as E, getResizedSourceAnchor as R, getResizedTargetAnchor as M } from "./simcode-ui.es310.js";
|
|
4
|
+
function c(e) {
|
|
5
|
+
this._modeling = e;
|
|
6
|
+
}
|
|
7
|
+
c.$inject = ["modeling"];
|
|
8
|
+
c.prototype.preExecute = function(e) {
|
|
9
|
+
var t = e.delta, i = e.direction, r = e.movingShapes, n = e.resizingShapes, a = e.start, d = {};
|
|
10
|
+
this.moveShapes(r, t), v(n, function(p) {
|
|
11
|
+
d[p.id] = H(p);
|
|
12
|
+
}), this.resizeShapes(n, t, i), this.updateConnectionWaypoints(
|
|
13
|
+
_(r, n),
|
|
14
|
+
t,
|
|
15
|
+
i,
|
|
16
|
+
a,
|
|
17
|
+
r,
|
|
18
|
+
n,
|
|
19
|
+
d
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
c.prototype.execute = function() {
|
|
23
|
+
};
|
|
24
|
+
c.prototype.revert = function() {
|
|
25
|
+
};
|
|
26
|
+
c.prototype.moveShapes = function(e, t) {
|
|
27
|
+
var i = this;
|
|
28
|
+
v(e, function(r) {
|
|
29
|
+
i._modeling.moveShape(r, t, null, {
|
|
30
|
+
autoResize: !1,
|
|
31
|
+
layout: !1,
|
|
32
|
+
recurse: !1
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
c.prototype.resizeShapes = function(e, t, i) {
|
|
37
|
+
var r = this;
|
|
38
|
+
v(e, function(n) {
|
|
39
|
+
var a = B(n, i, t);
|
|
40
|
+
r._modeling.resizeShape(n, a, null, {
|
|
41
|
+
attachSupport: !1,
|
|
42
|
+
autoResize: !1,
|
|
43
|
+
layout: !1
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
c.prototype.updateConnectionWaypoints = function(e, t, i, r, n, a, d) {
|
|
48
|
+
var p = this, m = n.concat(a);
|
|
49
|
+
v(e, function(o) {
|
|
50
|
+
var f = o.source, l = o.target, S = T(o), g = W(i), h = {};
|
|
51
|
+
u(m, f) && u(m, l) ? (S = x(S, function(s) {
|
|
52
|
+
return z(s, r, i) && (s[g] = s[g] + t[g]), s.original && z(s.original, r, i) && (s.original[g] = s.original[g] + t[g]), s;
|
|
53
|
+
}), p._modeling.updateWaypoints(o, S, {
|
|
54
|
+
labelBehavior: !1
|
|
55
|
+
})) : (u(m, f) || u(m, l)) && (u(n, f) ? h.connectionStart = C(o, f, t) : u(n, l) ? h.connectionEnd = E(o, l, t) : u(a, f) ? h.connectionStart = R(
|
|
56
|
+
o,
|
|
57
|
+
f,
|
|
58
|
+
d[f.id]
|
|
59
|
+
) : u(a, l) && (h.connectionEnd = M(
|
|
60
|
+
o,
|
|
61
|
+
l,
|
|
62
|
+
d[l.id]
|
|
63
|
+
)), p._modeling.layoutConnection(o, h));
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
function y(e) {
|
|
67
|
+
return A({}, e);
|
|
68
|
+
}
|
|
69
|
+
function T(e) {
|
|
70
|
+
return x(e.waypoints, function(t) {
|
|
71
|
+
return t = y(t), t.original && (t.original = y(t.original)), t;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function W(e) {
|
|
75
|
+
switch (e) {
|
|
76
|
+
case "n":
|
|
77
|
+
return "y";
|
|
78
|
+
case "w":
|
|
79
|
+
return "x";
|
|
80
|
+
case "s":
|
|
81
|
+
return "y";
|
|
82
|
+
case "e":
|
|
83
|
+
return "x";
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function z(e, t, i) {
|
|
87
|
+
var r = W(i);
|
|
88
|
+
if (/e|s/.test(i))
|
|
89
|
+
return e[r] > t;
|
|
90
|
+
if (/n|w/.test(i))
|
|
91
|
+
return e[r] < t;
|
|
92
|
+
}
|
|
93
|
+
function u(e, t) {
|
|
94
|
+
return e.indexOf(t) !== -1;
|
|
95
|
+
}
|
|
96
|
+
function H(e) {
|
|
97
|
+
return {
|
|
98
|
+
x: e.x,
|
|
99
|
+
y: e.y,
|
|
100
|
+
height: e.height,
|
|
101
|
+
width: e.width
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
export {
|
|
105
|
+
c as default
|
|
106
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { forEach as o, assign as t } from "min-dash";
|
|
2
|
+
function d(n) {
|
|
3
|
+
this._modeling = n;
|
|
4
|
+
}
|
|
5
|
+
d.$inject = ["modeling"];
|
|
6
|
+
d.prototype.execute = function(n) {
|
|
7
|
+
var i = n.shape, r = i.children;
|
|
8
|
+
n.oldChildrenVisibility = l(r), i.collapsed = !i.collapsed;
|
|
9
|
+
var c = s(r, i.collapsed);
|
|
10
|
+
return [i].concat(c);
|
|
11
|
+
};
|
|
12
|
+
d.prototype.revert = function(n) {
|
|
13
|
+
var i = n.shape, r = n.oldChildrenVisibility, c = i.children, e = a(c, r);
|
|
14
|
+
return i.collapsed = !i.collapsed, [i].concat(e);
|
|
15
|
+
};
|
|
16
|
+
function l(n) {
|
|
17
|
+
var i = {};
|
|
18
|
+
return o(n, function(r) {
|
|
19
|
+
i[r.id] = r.hidden, r.children && (i = t({}, i, l(r.children)));
|
|
20
|
+
}), i;
|
|
21
|
+
}
|
|
22
|
+
function s(n, i) {
|
|
23
|
+
var r = [];
|
|
24
|
+
return o(n, function(c) {
|
|
25
|
+
c.hidden = i, r = r.concat(c), c.children && (r = r.concat(s(c.children, c.collapsed || i)));
|
|
26
|
+
}), r;
|
|
27
|
+
}
|
|
28
|
+
function a(n, i) {
|
|
29
|
+
var r = [];
|
|
30
|
+
return o(n, function(c) {
|
|
31
|
+
c.hidden = i[c.id], r = r.concat(c), c.children && (r = r.concat(a(c.children, i)));
|
|
32
|
+
}), r;
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
d as default
|
|
36
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { remove as h, add as i } from "./simcode-ui.es284.js";
|
|
2
|
+
function o(t) {
|
|
3
|
+
this._modeling = t;
|
|
4
|
+
}
|
|
5
|
+
o.$inject = ["modeling"];
|
|
6
|
+
o.prototype.execute = function(t) {
|
|
7
|
+
var e = t.shape, r = t.newHost, a = e.host;
|
|
8
|
+
return t.oldHost = a, t.attacherIdx = s(a, e), n(r, e), e.host = r, e;
|
|
9
|
+
};
|
|
10
|
+
o.prototype.revert = function(t) {
|
|
11
|
+
var e = t.shape, r = t.newHost, a = t.oldHost, d = t.attacherIdx;
|
|
12
|
+
return e.host = a, s(r, e), n(a, e, d), e;
|
|
13
|
+
};
|
|
14
|
+
function s(t, e) {
|
|
15
|
+
return h(t && t.attachers, e);
|
|
16
|
+
}
|
|
17
|
+
function n(t, e, r) {
|
|
18
|
+
if (t) {
|
|
19
|
+
var a = t.attachers;
|
|
20
|
+
a || (t.attachers = a = []), i(a, e, r);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
o as default
|
|
25
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function e() {
|
|
2
|
+
}
|
|
3
|
+
e.prototype.execute = function(n) {
|
|
4
|
+
var o = n.connection, t = n.newWaypoints;
|
|
5
|
+
return n.oldWaypoints = o.waypoints, o.waypoints = t, o;
|
|
6
|
+
};
|
|
7
|
+
e.prototype.revert = function(n) {
|
|
8
|
+
var o = n.connection, t = n.oldWaypoints;
|
|
9
|
+
return o.waypoints = t, o;
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
e as default
|
|
13
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
function r(e, n, i, u) {
|
|
2
|
+
var f = i.inverse;
|
|
3
|
+
return Object.defineProperty(e, "remove", {
|
|
4
|
+
value: function(s) {
|
|
5
|
+
var o = this.indexOf(s);
|
|
6
|
+
return o !== -1 && (this.splice(o, 1), n.unset(s, f, u)), s;
|
|
7
|
+
}
|
|
8
|
+
}), Object.defineProperty(e, "contains", {
|
|
9
|
+
value: function(s) {
|
|
10
|
+
return this.indexOf(s) !== -1;
|
|
11
|
+
}
|
|
12
|
+
}), Object.defineProperty(e, "add", {
|
|
13
|
+
value: function(s, o) {
|
|
14
|
+
var c = this.indexOf(s);
|
|
15
|
+
if (typeof o > "u") {
|
|
16
|
+
if (c !== -1)
|
|
17
|
+
return;
|
|
18
|
+
o = this.length;
|
|
19
|
+
}
|
|
20
|
+
c !== -1 && this.splice(c, 1), this.splice(o, 0, s), c === -1 && n.set(s, f, u);
|
|
21
|
+
}
|
|
22
|
+
}), Object.defineProperty(e, "__refs_collection", {
|
|
23
|
+
value: !0
|
|
24
|
+
}), e;
|
|
25
|
+
}
|
|
26
|
+
function d(e) {
|
|
27
|
+
return e.__refs_collection === !0;
|
|
28
|
+
}
|
|
29
|
+
function h(e, n) {
|
|
30
|
+
return Object.prototype.hasOwnProperty.call(e, n.name || n);
|
|
31
|
+
}
|
|
32
|
+
function l(e, n, i) {
|
|
33
|
+
var u = r(i[n.name] || [], e, n, i);
|
|
34
|
+
Object.defineProperty(i, n.name, {
|
|
35
|
+
enumerable: n.enumerable,
|
|
36
|
+
value: u
|
|
37
|
+
}), u.length && u.forEach(function(f) {
|
|
38
|
+
e.set(f, n.inverse, i);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function v(e, n, i) {
|
|
42
|
+
var u = n.inverse, f = i[n.name];
|
|
43
|
+
Object.defineProperty(i, n.name, {
|
|
44
|
+
configurable: n.configurable,
|
|
45
|
+
enumerable: n.enumerable,
|
|
46
|
+
get: function() {
|
|
47
|
+
return f;
|
|
48
|
+
},
|
|
49
|
+
set: function(s) {
|
|
50
|
+
if (s !== f) {
|
|
51
|
+
var o = f;
|
|
52
|
+
f = null, o && e.unset(o, u, i), f = s, e.set(f, u, i);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function t(e, n) {
|
|
58
|
+
if (!(this instanceof t))
|
|
59
|
+
return new t(e, n);
|
|
60
|
+
e.inverse = n, n.inverse = e, this.props = {}, this.props[e.name] = e, this.props[n.name] = n;
|
|
61
|
+
}
|
|
62
|
+
t.prototype.bind = function(e, n) {
|
|
63
|
+
if (typeof n == "string") {
|
|
64
|
+
if (!this.props[n])
|
|
65
|
+
throw new Error("no property <" + n + "> in ref");
|
|
66
|
+
n = this.props[n];
|
|
67
|
+
}
|
|
68
|
+
n.collection ? l(this, n, e) : v(this, n, e);
|
|
69
|
+
};
|
|
70
|
+
t.prototype.ensureRefsCollection = function(e, n) {
|
|
71
|
+
var i = e[n.name];
|
|
72
|
+
return d(i) || l(this, n, e), i;
|
|
73
|
+
};
|
|
74
|
+
t.prototype.ensureBound = function(e, n) {
|
|
75
|
+
h(e, n) || this.bind(e, n);
|
|
76
|
+
};
|
|
77
|
+
t.prototype.unset = function(e, n, i) {
|
|
78
|
+
e && (this.ensureBound(e, n), n.collection ? this.ensureRefsCollection(e, n).remove(i) : e[n.name] = void 0);
|
|
79
|
+
};
|
|
80
|
+
t.prototype.set = function(e, n, i) {
|
|
81
|
+
e && (this.ensureBound(e, n), n.collection ? this.ensureRefsCollection(e, n).add(i) : e[n.name] = i);
|
|
82
|
+
};
|
|
83
|
+
export {
|
|
84
|
+
t as Refs
|
|
85
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { forEach as c } from "min-dash";
|
|
2
|
+
import { getMovedTargetAnchor as m, getMovedSourceAnchor as g } from "./simcode-ui.es310.js";
|
|
3
|
+
import C from "./simcode-ui.es314.js";
|
|
4
|
+
function s(e) {
|
|
5
|
+
this._modeling = e;
|
|
6
|
+
}
|
|
7
|
+
s.prototype.moveRecursive = function(e, t, n) {
|
|
8
|
+
return e ? this.moveClosure(this.getClosure(e), t, n) : [];
|
|
9
|
+
};
|
|
10
|
+
s.prototype.moveClosure = function(e, t, n, h, u) {
|
|
11
|
+
var r = this._modeling, i = e.allShapes, d = e.allConnections, p = e.enclosedConnections, a = e.topLevel, l = !1;
|
|
12
|
+
u && u.parent === n && (l = !0), c(i, function(o) {
|
|
13
|
+
r.moveShape(o, t, a[o.id] && !l && n, {
|
|
14
|
+
recurse: !1,
|
|
15
|
+
layout: !1
|
|
16
|
+
});
|
|
17
|
+
}), c(d, function(o) {
|
|
18
|
+
var f = !!i[o.source.id], v = !!i[o.target.id];
|
|
19
|
+
p[o.id] && f && v ? r.moveConnection(o, t, a[o.id] && !l && n) : r.layoutConnection(o, {
|
|
20
|
+
connectionStart: f && g(o, o.source, t),
|
|
21
|
+
connectionEnd: v && m(o, o.target, t)
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
s.prototype.getClosure = function(e) {
|
|
26
|
+
return new C().addAll(e, !0);
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
s as default
|
|
30
|
+
};
|