@das-fed/upf-utils 6.4.0-dev.243 → 6.4.0-dev.245
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/api-services/es5.js +952 -938
- package/api-services/index.js +732 -723
- package/api-services/index.js.gz +0 -0
- package/api-services/modules/app-manage/es5.js +690 -676
- package/api-services/modules/app-manage/index.js +540 -531
- package/api-services/modules/app-manage/index.js.gz +0 -0
- package/api-services/modules/authentication/es5.js +690 -676
- package/api-services/modules/authentication/index.js +540 -531
- package/api-services/modules/authentication/index.js.gz +0 -0
- package/api-services/modules/bems/es5.js +705 -691
- package/api-services/modules/bems/index.js +555 -546
- package/api-services/modules/bems/index.js.gz +0 -0
- package/api-services/modules/contract/es5.js +926 -909
- package/api-services/modules/contract/index.js +732 -719
- package/api-services/modules/contract/index.js.gz +0 -0
- package/api-services/modules/duty-manage/es5.js +708 -694
- package/api-services/modules/duty-manage/index.js +559 -550
- package/api-services/modules/duty-manage/index.js.gz +0 -0
- package/api-services/modules/enterpriseright/es5.js +1160 -1137
- package/api-services/modules/enterpriseright/index.js +969 -946
- package/api-services/modules/enterpriseright/index.js.gz +0 -0
- package/api-services/modules/es5.js +1453 -1451
- package/api-services/modules/file/es5.js +1349 -1347
- package/api-services/modules/file/index.js +1101 -1110
- package/api-services/modules/file/index.js.gz +0 -0
- package/api-services/modules/gateway-edge/es5.js +690 -676
- package/api-services/modules/gateway-edge/index.js +540 -531
- package/api-services/modules/gateway-edge/index.js.gz +0 -0
- package/api-services/modules/index.js +1137 -1146
- package/api-services/modules/index.js.gz +0 -0
- package/api-services/modules/iot/es5.js +1155 -1153
- package/api-services/modules/iot/index.js +947 -956
- package/api-services/modules/iot/index.js.gz +0 -0
- package/api-services/modules/justauth/es5.js +1115 -1110
- package/api-services/modules/justauth/index.js +917 -922
- package/api-services/modules/justauth/index.js.gz +0 -0
- package/api-services/modules/knowledge/es5.js +1091 -1065
- package/api-services/modules/knowledge/index.js +919 -892
- package/api-services/modules/knowledge/index.js.gz +0 -0
- package/api-services/modules/link/es5.js +690 -676
- package/api-services/modules/link/index.js +540 -531
- package/api-services/modules/link/index.js.gz +0 -0
- package/api-services/modules/permission/es5.js +737 -723
- package/api-services/modules/permission/index.js +581 -572
- package/api-services/modules/permission/index.js.gz +0 -0
- package/api-services/modules/platformManage/es5.js +755 -741
- package/api-services/modules/platformManage/index.js +590 -581
- package/api-services/modules/platformManage/index.js.gz +0 -0
- package/api-services/modules/portal/es5.js +737 -723
- package/api-services/modules/portal/index.js +581 -572
- package/api-services/modules/portal/index.js.gz +0 -0
- package/api-services/modules/space-manage/es5.js +1091 -1065
- package/api-services/modules/space-manage/index.js +919 -892
- package/api-services/modules/space-manage/index.js.gz +0 -0
- package/api-services/modules/super-admin/es5.js +614 -603
- package/api-services/modules/super-admin/index.js +490 -485
- package/api-services/modules/super-admin/index.js.gz +0 -0
- package/api-services/modules/supplier/es5.js +1058 -1032
- package/api-services/modules/supplier/index.js +898 -871
- package/api-services/modules/supplier/index.js.gz +0 -0
- package/api-services/modules/supplychain-manage/es5.js +737 -723
- package/api-services/modules/supplychain-manage/index.js +581 -572
- package/api-services/modules/supplychain-manage/index.js.gz +0 -0
- package/api-services/modules/systemConfiguration/es5.js +1116 -1111
- package/api-services/modules/systemConfiguration/index.js +917 -922
- package/api-services/modules/systemConfiguration/index.js.gz +0 -0
- package/api-services/modules/tool/es5.js +579 -568
- package/api-services/modules/tool/index.js +475 -470
- package/api-services/modules/tool/index.js.gz +0 -0
- package/api-services/src/create-service/es5.js +1160 -1137
- package/api-services/src/create-service/index.js +969 -946
- package/api-services/src/create-service/index.js.gz +0 -0
- package/common-info/es5.js +734 -720
- package/common-info/getPermissionMethod/es5.js +705 -691
- package/common-info/getPermissionMethod/index.js +544 -535
- package/common-info/getPermissionMethod/index.js.gz +0 -0
- package/common-info/index.js +569 -560
- package/common-info/index.js.gz +0 -0
- package/common-tools/timezone-format/es5.d.ts +107 -3
- package/common-tools/timezone-format/es5.js +751 -101
- package/common-tools/timezone-format/get-iana-data/dayjs-timezone-iana-plugin.d.ts +72 -0
- package/common-tools/timezone-format/get-iana-data/iana-api-fetch.d.ts +21 -0
- package/common-tools/timezone-format/get-iana-data/moment-iana-loader.d.ts +29 -0
- package/common-tools/timezone-format/index.d.ts +107 -3
- package/common-tools/timezone-format/index.js +392 -62
- package/common-tools/timezone-format/index.js.gz +0 -0
- package/create-api-service/es5.js +736 -722
- package/create-api-service/index.js +581 -572
- package/create-api-service/index.js.gz +0 -0
- package/dimple-canvas/use-dimple-canvas/core/antv-x6/index.d.ts +29 -0
- package/dimple-canvas/use-dimple-canvas/core/antv-x6/index.js +19868 -0
- package/dimple-canvas/use-dimple-canvas/core/antv-x6/index.js.gz +0 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/index.d.ts +55 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/index.js +116 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/index.js.gz +0 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-event-listener.d.ts +104 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-event-listener.js +17 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-object/index.d.ts +8 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-object/index.js +51 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/add-object/index.js.gz +0 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/create-canvas.d.ts +5 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/create-canvas.js +14 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/find.d.ts +7 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/find.js +5 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/guideline.d.ts +5 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/guideline.js +180 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/guideline.js.gz +0 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/lib.d.ts +4 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/lib.js +7535 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/lib.js.gz +0 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/load-json.d.ts +6 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/load-json.js +13 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/remove-object.d.ts +6 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/remove-object.js +7 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/rule.d.ts +8 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/rule.js +193 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/rule.js.gz +0 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/transform-axis.d.ts +11 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/transform-axis.js +20 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/transformer.d.ts +5 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/transformer.js +52 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/transformer.js.gz +0 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/wheel-zoom.d.ts +4 -0
- package/dimple-canvas/use-dimple-canvas/core/konva/utils/wheel-zoom.js +14 -0
- package/dimple-canvas/use-dimple-canvas/es5.d.ts +9 -0
- package/dimple-canvas/use-dimple-canvas/es5.js +20 -0
- package/dimple-canvas/use-dimple-canvas/index.d.ts +9 -0
- package/dimple-canvas/use-dimple-canvas/index.js +10 -0
- package/esm-map.json +33 -1
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +3 -3
- package/theme/es5.d.ts +20 -1
- package/theme/es5.js +614 -303
- package/theme/index.d.ts +20 -1
- package/theme/index.js +523 -276
- package/theme/index.js.gz +0 -0
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Konva as c } from "@das-fed/upf-utils/dimple-canvas/use-dimple-canvas/core/konva/utils/lib";
|
|
2
|
+
const m = (t, n) => {
|
|
3
|
+
const a = c.Node.create(n, t), o = a.getLayers().find((e) => e.getAttr("name") === "base"), s = a.getLayers().find((e) => e.getAttr("name") === "ruleLayer");
|
|
4
|
+
return a.find("Image").forEach((e) => {
|
|
5
|
+
const r = new Image();
|
|
6
|
+
r.src = e.attrs.src, r.onload = () => {
|
|
7
|
+
e.image(r);
|
|
8
|
+
};
|
|
9
|
+
}), { canvas: a, layer: o, ruleLayer: s };
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
m as loadJSON
|
|
13
|
+
};
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { Konva as i } from "@das-fed/upf-utils/dimple-canvas/use-dimple-canvas/core/konva/utils/lib";
|
|
2
|
+
function C(h, c) {
|
|
3
|
+
const {
|
|
4
|
+
precision: n = 50,
|
|
5
|
+
textColor: f = "#F56C6C",
|
|
6
|
+
lineColor: l = "#ccc",
|
|
7
|
+
originalPoint: e = { x: 0, y: 0 },
|
|
8
|
+
backgroundColor: w = "#EAEAEA",
|
|
9
|
+
scaleWidth: r = 30,
|
|
10
|
+
scalePoint: g = { x: 0, y: 0 }
|
|
11
|
+
} = c || {}, d = h.height() - r, a = h.width() - r;
|
|
12
|
+
h.offsetX(), h.offsetY();
|
|
13
|
+
const x = n / 10;
|
|
14
|
+
var p = new i.Line({
|
|
15
|
+
points: [
|
|
16
|
+
e.x - r,
|
|
17
|
+
e.y - r,
|
|
18
|
+
e.x - r,
|
|
19
|
+
d,
|
|
20
|
+
g.x,
|
|
21
|
+
d,
|
|
22
|
+
g.x,
|
|
23
|
+
g.y,
|
|
24
|
+
a,
|
|
25
|
+
g.y,
|
|
26
|
+
a,
|
|
27
|
+
e.y - r
|
|
28
|
+
],
|
|
29
|
+
fill: w,
|
|
30
|
+
stroke: l,
|
|
31
|
+
strokeWidth: 1,
|
|
32
|
+
closed: !0,
|
|
33
|
+
name: "disabled"
|
|
34
|
+
});
|
|
35
|
+
let o = new i.Layer();
|
|
36
|
+
o.name("ruleLayer"), o.add(p), o.setDraggable(!1);
|
|
37
|
+
const L = new i.Line({
|
|
38
|
+
points: [e.x, e.y, a, e.y],
|
|
39
|
+
stroke: l,
|
|
40
|
+
strokeWidth: 1,
|
|
41
|
+
lineCap: "round",
|
|
42
|
+
lineJoin: "round",
|
|
43
|
+
fill: l,
|
|
44
|
+
listening: !1
|
|
45
|
+
});
|
|
46
|
+
for (let t = 1; t < 10; t++)
|
|
47
|
+
o.add(
|
|
48
|
+
new i.Line({
|
|
49
|
+
points: [
|
|
50
|
+
e.x + t * x,
|
|
51
|
+
e.y,
|
|
52
|
+
e.x + t * x,
|
|
53
|
+
t === 5 ? e.x - 15 : e.x - 10
|
|
54
|
+
],
|
|
55
|
+
stroke: l,
|
|
56
|
+
strokeWidth: 1,
|
|
57
|
+
listening: !1
|
|
58
|
+
})
|
|
59
|
+
);
|
|
60
|
+
const u = new i.Text({
|
|
61
|
+
x: a - 20,
|
|
62
|
+
y: 0,
|
|
63
|
+
text: "",
|
|
64
|
+
fontSize: 20,
|
|
65
|
+
fill: f,
|
|
66
|
+
listening: !1
|
|
67
|
+
}), W = new i.Line({
|
|
68
|
+
points: [e.x, e.y, e.x, d],
|
|
69
|
+
stroke: l,
|
|
70
|
+
fill: l,
|
|
71
|
+
strokeWidth: 1,
|
|
72
|
+
lineCap: "round",
|
|
73
|
+
lineJoin: "round",
|
|
74
|
+
listening: !1
|
|
75
|
+
});
|
|
76
|
+
for (let t = 1; t < 10; t++)
|
|
77
|
+
o.add(
|
|
78
|
+
new i.Line({
|
|
79
|
+
points: [
|
|
80
|
+
e.x,
|
|
81
|
+
e.y + t * x,
|
|
82
|
+
t === 5 ? e.y - 15 : e.y - 10,
|
|
83
|
+
e.y + t * x
|
|
84
|
+
],
|
|
85
|
+
stroke: l,
|
|
86
|
+
strokeWidth: 1,
|
|
87
|
+
listening: !1
|
|
88
|
+
})
|
|
89
|
+
);
|
|
90
|
+
const b = new i.Text({
|
|
91
|
+
x: 10,
|
|
92
|
+
y: d - 20,
|
|
93
|
+
text: "",
|
|
94
|
+
fontSize: 20,
|
|
95
|
+
width: 100,
|
|
96
|
+
fill: f,
|
|
97
|
+
listening: !1
|
|
98
|
+
});
|
|
99
|
+
o.add(L, W, u, b), o.add(
|
|
100
|
+
new i.Text({
|
|
101
|
+
x: e.x - 10,
|
|
102
|
+
y: e.y - 10,
|
|
103
|
+
text: "0",
|
|
104
|
+
fontSize: 10,
|
|
105
|
+
fill: f,
|
|
106
|
+
listening: !1
|
|
107
|
+
})
|
|
108
|
+
);
|
|
109
|
+
for (let t = 1; t <= Math.floor(d / n); t++) {
|
|
110
|
+
o.add(
|
|
111
|
+
new i.Line({
|
|
112
|
+
points: [
|
|
113
|
+
e.x,
|
|
114
|
+
t * n + e.y,
|
|
115
|
+
e.x - r,
|
|
116
|
+
t * n + e.y
|
|
117
|
+
],
|
|
118
|
+
stroke: l,
|
|
119
|
+
strokeWidth: 1,
|
|
120
|
+
listening: !1
|
|
121
|
+
})
|
|
122
|
+
);
|
|
123
|
+
let y = d - t * n - e.y, k = y < n ? y / x : 10;
|
|
124
|
+
for (let s = 1; s < k; s++)
|
|
125
|
+
o.add(
|
|
126
|
+
new i.Line({
|
|
127
|
+
points: [
|
|
128
|
+
e.x,
|
|
129
|
+
t * n + e.y + s * x,
|
|
130
|
+
s === 5 ? e.y - 15 : e.y - 10,
|
|
131
|
+
t * n + e.y + s * x
|
|
132
|
+
],
|
|
133
|
+
stroke: l,
|
|
134
|
+
strokeWidth: 1,
|
|
135
|
+
listening: !1
|
|
136
|
+
})
|
|
137
|
+
);
|
|
138
|
+
o.add(
|
|
139
|
+
new i.Text({
|
|
140
|
+
x: e.x - r + 2,
|
|
141
|
+
y: t * n + e.y - 10,
|
|
142
|
+
text: "" + t * n,
|
|
143
|
+
fontSize: 10,
|
|
144
|
+
fill: f,
|
|
145
|
+
listening: !1
|
|
146
|
+
})
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
for (let t = 1; t <= Math.floor(a / n); t++) {
|
|
150
|
+
o.add(
|
|
151
|
+
new i.Line({
|
|
152
|
+
points: [
|
|
153
|
+
t * n + e.x,
|
|
154
|
+
e.y,
|
|
155
|
+
t * n + e.x,
|
|
156
|
+
e.y - r
|
|
157
|
+
],
|
|
158
|
+
stroke: l,
|
|
159
|
+
strokeWidth: 1,
|
|
160
|
+
listening: !1
|
|
161
|
+
})
|
|
162
|
+
);
|
|
163
|
+
let y = a - t * n - e.x, k = y < n ? y / x : 10;
|
|
164
|
+
for (let s = 1; s < k; s++)
|
|
165
|
+
o.add(
|
|
166
|
+
new i.Line({
|
|
167
|
+
points: [
|
|
168
|
+
e.x + t * n + s * x,
|
|
169
|
+
e.y,
|
|
170
|
+
e.x + t * n + s * x,
|
|
171
|
+
s === 5 ? e.x - 15 : e.x - 10
|
|
172
|
+
],
|
|
173
|
+
stroke: l,
|
|
174
|
+
strokeWidth: 1,
|
|
175
|
+
listening: !1
|
|
176
|
+
})
|
|
177
|
+
);
|
|
178
|
+
o.add(
|
|
179
|
+
new i.Text({
|
|
180
|
+
x: t * n + e.x,
|
|
181
|
+
y: e.y - r + 2,
|
|
182
|
+
text: "" + t * n,
|
|
183
|
+
fontSize: 10,
|
|
184
|
+
fill: f,
|
|
185
|
+
listening: !1
|
|
186
|
+
})
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
return o;
|
|
190
|
+
}
|
|
191
|
+
export {
|
|
192
|
+
C as initRule
|
|
193
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Canvas } from '@das-fed/upf-utils/dimple-canvas/use-dimple-canvas/core/type';
|
|
2
|
+
|
|
3
|
+
declare const transformAxis: (containerEl: HTMLDivElement, canvas: Canvas | null | undefined, coordinate: {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}) => {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
};
|
|
11
|
+
export { transformAxis };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
function Y(l, t) {
|
|
2
|
+
const { x: i, y: r } = l;
|
|
3
|
+
var x = i * Math.cos(t * Math.PI / 180) - r * Math.sin(t * Math.PI / 180), h = i * Math.sin(t * Math.PI / 180) + r * Math.cos(t * Math.PI / 180);
|
|
4
|
+
return { x, y: h };
|
|
5
|
+
}
|
|
6
|
+
const w = (l, t, i) => {
|
|
7
|
+
var y, P;
|
|
8
|
+
const { left: r, top: x, width: h, height: M } = l.getBoundingClientRect();
|
|
9
|
+
let { x: o = 0, y: e = 0 } = i;
|
|
10
|
+
o = o - r, e = e - x, o < 0 && (o = 0), o > h && (o = h), e < 0 && (e = 0), e > M && (e = M);
|
|
11
|
+
let d = (t == null ? void 0 : t.x()) || 0, u = (t == null ? void 0 : t.y()) || 0;
|
|
12
|
+
o = o - d, e = e - u;
|
|
13
|
+
const I = ((y = t == null ? void 0 : t.scale()) == null ? void 0 : y.x) || 1, X = ((P = t == null ? void 0 : t.scale()) == null ? void 0 : P.y) || 1;
|
|
14
|
+
o = o / I, e = e / X;
|
|
15
|
+
const f = Y({ x: o, y: e }, 360 - ((t == null ? void 0 : t.rotation()) || 0));
|
|
16
|
+
return o = f.x, e = f.y, { x: o, y: e };
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
w as transformAxis
|
|
20
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Canvas, Layer } from '@das-fed/upf-utils/dimple-canvas/use-dimple-canvas/core/type';
|
|
2
|
+
|
|
3
|
+
declare const initTransformer: (canvas?: Canvas | null, layer?: Layer | null) => any;
|
|
4
|
+
declare const removeTransformer: () => void;
|
|
5
|
+
export { initTransformer, removeTransformer };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Konva as m } from "@das-fed/upf-utils/dimple-canvas/use-dimple-canvas/core/konva/utils/lib";
|
|
2
|
+
let r, i;
|
|
3
|
+
const h = (t, f) => {
|
|
4
|
+
if (t && f) {
|
|
5
|
+
i = new m.Transformer(), f.add(i), r = new m.Rect({
|
|
6
|
+
fill: "rgba(0,0,255,0.5)",
|
|
7
|
+
visible: !1
|
|
8
|
+
}), f.add(r);
|
|
9
|
+
var g, u, l, d;
|
|
10
|
+
return t.on("mousedown", (e) => {
|
|
11
|
+
e.target === t && (e.evt.preventDefault(), g = t.getPointerPosition().x, u = t.getPointerPosition().y, l = t.getPointerPosition().x, d = t.getPointerPosition().y, r.visible(!0), r.width(0), r.height(0));
|
|
12
|
+
}), t.on("mousemove", (e) => {
|
|
13
|
+
r.visible() && (e.evt.preventDefault(), l = t.getPointerPosition().x, d = t.getPointerPosition().y, r.setAttrs({
|
|
14
|
+
x: Math.min(g, l),
|
|
15
|
+
y: Math.min(u, d),
|
|
16
|
+
width: Math.abs(l - g),
|
|
17
|
+
height: Math.abs(d - u)
|
|
18
|
+
}));
|
|
19
|
+
}), t.on("mouseup", (e) => {
|
|
20
|
+
if (r.visible()) {
|
|
21
|
+
e.evt.preventDefault(), setTimeout(() => {
|
|
22
|
+
r.visible(!1);
|
|
23
|
+
});
|
|
24
|
+
var n = t.find(".rect"), s = r.getClientRect(), o = n.filter((a) => m.Util.haveIntersection(s, a.getClientRect()));
|
|
25
|
+
i.nodes(o);
|
|
26
|
+
}
|
|
27
|
+
}), t.on("click", function(e) {
|
|
28
|
+
if (e.target.name() === "disabled" || r.visible())
|
|
29
|
+
return;
|
|
30
|
+
if (e.target === t) {
|
|
31
|
+
i.nodes([]);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const n = e.evt.shiftKey || e.evt.ctrlKey || e.evt.metaKey, s = i.nodes().indexOf(e.target) >= 0;
|
|
35
|
+
if (!n && !s)
|
|
36
|
+
i.nodes([e.target]), i.rotateEnabled(e.target.name() !== "backgroundImage");
|
|
37
|
+
else if (n && s) {
|
|
38
|
+
const o = i.nodes().slice();
|
|
39
|
+
o.splice(o.indexOf(e.target), 1), i.nodes(o);
|
|
40
|
+
} else if (n && !s) {
|
|
41
|
+
const o = i.nodes().concat([e.target]);
|
|
42
|
+
i.nodes(o);
|
|
43
|
+
}
|
|
44
|
+
}), i;
|
|
45
|
+
}
|
|
46
|
+
}, P = () => {
|
|
47
|
+
i.nodes([]);
|
|
48
|
+
};
|
|
49
|
+
export {
|
|
50
|
+
h as initTransformer,
|
|
51
|
+
P as removeTransformer
|
|
52
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const r = (e) => {
|
|
2
|
+
e.on("wheel", (l) => {
|
|
3
|
+
l.evt.preventDefault();
|
|
4
|
+
let t = e.scaleX(), i = e.getPointerPosition();
|
|
5
|
+
(i.x - e.x()) / t, (i.y - e.y()) / t;
|
|
6
|
+
let o = l.evt.deltaY > 0 ? 1 : -1;
|
|
7
|
+
l.evt.ctrlKey && (o = -o);
|
|
8
|
+
let y = o > 0 ? t * 1.01 : t / 1.01;
|
|
9
|
+
e.scale({ x: y, y });
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
r as initWheelZoom
|
|
14
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useKonva, Konva } from '@das-fed/upf-utils/dimple-canvas/use-dimple-canvas/core/konva';
|
|
2
|
+
import { useAntvX6, Graph } from '@das-fed/upf-utils/dimple-canvas/use-dimple-canvas/core/antv-x6';
|
|
3
|
+
|
|
4
|
+
type HookTypeMap = {
|
|
5
|
+
konva: ReturnType<typeof useKonva>;
|
|
6
|
+
'antv-x6': ReturnType<typeof useAntvX6>;
|
|
7
|
+
};
|
|
8
|
+
declare const useDimpleCanvas: <T extends "konva" | "antv-x6" = "konva">(core?: T, initOptions?: Graph.Options) => T extends "antv-x6" ? HookTypeMap["antv-x6"] : HookTypeMap["konva"];
|
|
9
|
+
export { useDimpleCanvas, Konva, Graph };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var konva = require('@das-fed/upf-utils/dimple-canvas/use-dimple-canvas/core/konva/es5');
|
|
4
|
+
var antvX6 = require('@das-fed/upf-utils/dimple-canvas/use-dimple-canvas/core/antv-x6/es5');
|
|
5
|
+
var p = function p(r, t) {
|
|
6
|
+
return r || konva.useKonva(), r === "antv-x6" ? antvX6.useAntvX6(t || {}) : konva.useKonva();
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "Konva", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return konva.Konva;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
Object.defineProperty(exports, "Graph", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function get() {
|
|
17
|
+
return antvX6.Graph;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
exports.useDimpleCanvas = p;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useKonva, Konva } from '@das-fed/upf-utils/dimple-canvas/use-dimple-canvas/core/konva';
|
|
2
|
+
import { useAntvX6, Graph } from '@das-fed/upf-utils/dimple-canvas/use-dimple-canvas/core/antv-x6';
|
|
3
|
+
|
|
4
|
+
type HookTypeMap = {
|
|
5
|
+
konva: ReturnType<typeof useKonva>;
|
|
6
|
+
'antv-x6': ReturnType<typeof useAntvX6>;
|
|
7
|
+
};
|
|
8
|
+
declare const useDimpleCanvas: <T extends "konva" | "antv-x6" = "konva">(core?: T, initOptions?: Graph.Options) => T extends "antv-x6" ? HookTypeMap["antv-x6"] : HookTypeMap["konva"];
|
|
9
|
+
export { useDimpleCanvas, Konva, Graph };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useKonva as o } from "@das-fed/upf-utils/dimple-canvas/use-dimple-canvas/core/konva";
|
|
2
|
+
import { Konva as i } from "@das-fed/upf-utils/dimple-canvas/use-dimple-canvas/core/konva";
|
|
3
|
+
import { useAntvX6 as e } from "@das-fed/upf-utils/dimple-canvas/use-dimple-canvas/core/antv-x6";
|
|
4
|
+
import { Graph as u } from "@das-fed/upf-utils/dimple-canvas/use-dimple-canvas/core/antv-x6";
|
|
5
|
+
const p = (r, t) => (r || o(), r === "antv-x6" ? e(t || {}) : o());
|
|
6
|
+
export {
|
|
7
|
+
u as Graph,
|
|
8
|
+
i as Konva,
|
|
9
|
+
p as useDimpleCanvas
|
|
10
|
+
};
|
package/esm-map.json
CHANGED
|
@@ -59,6 +59,28 @@
|
|
|
59
59
|
"normalizeLocaleCode": "/common-tools/timezone-format/index",
|
|
60
60
|
"isDaylightSavingTime": "/common-tools/timezone-format/index",
|
|
61
61
|
"getTimeZoneDisplayInfo": "/common-tools/timezone-format/index",
|
|
62
|
+
"dayjsTimezoneIanaPlugin": "/common-tools/timezone-format/index",
|
|
63
|
+
"loadDayjsIanaTimeZoneData": "/common-tools/timezone-format/index",
|
|
64
|
+
"applyDayjsIanaTimeZoneData": "/common-tools/timezone-format/index",
|
|
65
|
+
"loadMomentIanaTimeZoneData": "/common-tools/timezone-format/index",
|
|
66
|
+
"applyMomentIanaTimeZoneData": "/common-tools/timezone-format/index",
|
|
67
|
+
"loadMomentIanaData": "/common-tools/timezone-format/index",
|
|
68
|
+
"loadMomentIanaFromApi": "/common-tools/timezone-format/index",
|
|
69
|
+
"setDefaultTimeZone": "/common-tools/timezone-format/index",
|
|
70
|
+
"resolveTimeZone": "/common-tools/timezone-format/index",
|
|
71
|
+
"formatInTimeZone": "/common-tools/timezone-format/index",
|
|
72
|
+
"formatLocalDateTime": "/common-tools/timezone-format/index",
|
|
73
|
+
"toLocalDate": "/common-tools/timezone-format/index",
|
|
74
|
+
"getZoneUtcOffset": "/common-tools/timezone-format/index",
|
|
75
|
+
"formatTimeZoneOffsetLabel": "/common-tools/timezone-format/index",
|
|
76
|
+
"resolveUtcOffsetFallback": "/common-tools/timezone-format/index",
|
|
77
|
+
"buildTimeZoneDisplayOptions": "/common-tools/timezone-format/index",
|
|
78
|
+
"formatClientLocalDateTimeLine": "/common-tools/timezone-format/index",
|
|
79
|
+
"timeZoneHasDST": "/common-tools/timezone-format/index",
|
|
80
|
+
"timeZoneIsDST": "/common-tools/timezone-format/index",
|
|
81
|
+
"isKnownTimeZone": "/common-tools/timezone-format/index",
|
|
82
|
+
"rebuildKnownTimeZoneIds": "/common-tools/timezone-format/index",
|
|
83
|
+
"getKnownTimeZoneIds": "/common-tools/timezone-format/index",
|
|
62
84
|
"mixHexColor": "/theme/index",
|
|
63
85
|
"toRgbaColor": "/theme/index",
|
|
64
86
|
"resolveThemeBridgeVariables": "/theme/index",
|
|
@@ -67,6 +89,15 @@
|
|
|
67
89
|
"toDasUiColorOverrides": "/theme/index",
|
|
68
90
|
"toUpfComponentThemeVariables": "/theme/index",
|
|
69
91
|
"buildRuntimeThemeVariables": "/theme/index",
|
|
92
|
+
"BUILTIN_PRESET_THEME_NAMES": "/theme/index",
|
|
93
|
+
"PRESET_THEMES": "/theme/index",
|
|
94
|
+
"getPresetTheme": "/theme/index",
|
|
95
|
+
"getAllPresetThemes": "/theme/index",
|
|
96
|
+
"getDefaultPresetTheme": "/theme/index",
|
|
97
|
+
"getDefaultThemeVariables": "/theme/index",
|
|
98
|
+
"buildPresetThemeCssText": "/theme/index",
|
|
99
|
+
"buildDefaultThemeCssText": "/theme/index",
|
|
100
|
+
"ensureDefaultThemeStyle": "/theme/index",
|
|
70
101
|
"applyThemeVariablesToDocument": "/theme/index",
|
|
71
102
|
"applyThemeEventToDocument": "/theme/index",
|
|
72
103
|
"getThemeAPI": "/theme/index",
|
|
@@ -207,5 +238,6 @@
|
|
|
207
238
|
"ELEMENT_THEME_BRIDGE_ITEMS": "/theme/index",
|
|
208
239
|
"DAS_UI_THEME_BRIDGE_ITEMS": "/theme/index",
|
|
209
240
|
"UPF_COMPONENT_THEME_BRIDGE_ITEMS": "/theme/index",
|
|
210
|
-
"getHostThemeSnapshotFromWindowName": "/theme/index"
|
|
241
|
+
"getHostThemeSnapshotFromWindowName": "/theme/index",
|
|
242
|
+
"clonePresetTheme": "/theme/presets/index"
|
|
211
243
|
}
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@das-fed/upf-utils",
|
|
3
|
-
"version": "6.4.0-dev.
|
|
3
|
+
"version": "6.4.0-dev.245",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@babel/preset-env": "7.26.0",
|
|
25
|
-
"@das-fed/upf-cli": "6.4.0-dev.
|
|
26
|
-
"@das-fed/upf-web": "6.4.0-dev.
|
|
25
|
+
"@das-fed/upf-cli": "6.4.0-dev.245",
|
|
26
|
+
"@das-fed/upf-web": "6.4.0-dev.245",
|
|
27
27
|
"@rollup/plugin-babel": "6.0.4",
|
|
28
28
|
"@types/js-cookie": "^3.0.6",
|
|
29
29
|
"@types/lodash-es": "^4.17.12",
|
package/theme/es5.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { BUILTIN_PRESET_THEME_NAMES, PRESET_THEMES, BuiltinPresetThemeConfig, BuiltinPresetThemeName } from './presets';
|
|
2
|
+
|
|
1
3
|
export type ThemeVariables = Record<string, string>;
|
|
2
4
|
type ThemeVariableSource = Record<string, string | undefined>;
|
|
3
5
|
export interface ThemeConfig {
|
|
@@ -19,6 +21,16 @@ export interface ThemeBridgeAPI<TThemeName extends string = string, TVariables e
|
|
|
19
21
|
changeTheme?: (themeName: TThemeName) => void;
|
|
20
22
|
onThemeChange?: (callback: (event: ThemeChangeEvent<TThemeName, TVariables>) => void) => () => void;
|
|
21
23
|
}
|
|
24
|
+
export interface DefaultThemeStyleOptions extends ApplyThemeVariablesOptions {
|
|
25
|
+
/** 默认注入的预设主题名称。 */
|
|
26
|
+
presetName?: BuiltinPresetThemeName | string;
|
|
27
|
+
/** 默认主题 style 标签 id;用于手动注入时避免重复插入。 */
|
|
28
|
+
styleId?: string;
|
|
29
|
+
/** 已存在运行时主题变量时是否强制覆盖;默认 false。 */
|
|
30
|
+
force?: boolean;
|
|
31
|
+
/** 是否写入 data-theme/data-skin;默认 true,mframe 自动兜底可关闭避免误标记。 */
|
|
32
|
+
setThemeAttributes?: boolean;
|
|
33
|
+
}
|
|
22
34
|
export interface ThemeBridgeResolveContext<TVariables extends object = ThemeVariables> {
|
|
23
35
|
variables: TVariables;
|
|
24
36
|
result: Record<string, string>;
|
|
@@ -73,6 +85,14 @@ export declare const toElementThemeVariables: (variables: object) => any;
|
|
|
73
85
|
export declare const toDasUiColorOverrides: (variables: object) => any;
|
|
74
86
|
export declare const toUpfComponentThemeVariables: (variables: object) => any;
|
|
75
87
|
export declare const buildRuntimeThemeVariables: (variables: object, options?: RuntimeThemeVariableBuildOptions) => Record<string, string>;
|
|
88
|
+
export { BUILTIN_PRESET_THEME_NAMES, PRESET_THEMES };
|
|
89
|
+
export declare const getPresetTheme: (themeName: string) => any;
|
|
90
|
+
export declare const getAllPresetThemes: () => any;
|
|
91
|
+
export declare const getDefaultPresetTheme: () => BuiltinPresetThemeConfig;
|
|
92
|
+
export declare const getDefaultThemeVariables: () => any;
|
|
93
|
+
export declare const buildPresetThemeCssText: (presetName?: string, options?: RuntimeThemeVariableBuildOptions) => string;
|
|
94
|
+
export declare const buildDefaultThemeCssText: (options?: RuntimeThemeVariableBuildOptions) => string;
|
|
95
|
+
export declare const ensureDefaultThemeStyle: (options?: DefaultThemeStyleOptions) => any;
|
|
76
96
|
export declare const getHostThemeSnapshotFromWindowName: (debug?: boolean) => ThemeChangeEvent | null;
|
|
77
97
|
export declare const applyThemeVariablesToDocument: (variables: object, options?: ApplyThemeVariablesOptions) => any;
|
|
78
98
|
export declare const applyThemeEventToDocument: (event: ThemeChangeEvent, options?: ApplyThemeVariablesOptions) => any;
|
|
@@ -89,4 +109,3 @@ export declare const getVar: (key?: string) => string;
|
|
|
89
109
|
export declare const getVarValue: (key?: string, root?: HTMLElement | null) => {
|
|
90
110
|
value: any;
|
|
91
111
|
};
|
|
92
|
-
export {};
|