@glodon-aiot/react-components 3.1.0-beta.16 → 3.2.2-beta.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/aiot-react-components.js +8186 -7514
- package/dist/aiot-react-components.umd.cjs +43 -40
- package/dist/src/Button/index.d.ts +2 -1
- package/dist/src/ConfirmableButton/index.d.ts +1 -1
- package/dist/src/Drawable/LineElement.d.ts +1 -0
- package/dist/src/Drawable/MarkersMap.d.ts +1 -0
- package/dist/src/Drawable/PolygonElement.d.ts +1 -0
- package/dist/src/Drawable/index.d.ts +2 -1
- package/dist/src/Drawable/state.d.ts +1 -1
- package/dist/src/ExpandablePannel/index.d.ts +1 -0
- package/dist/src/GOSImageMap/DrawableImageMap.d.ts +1 -0
- package/dist/src/IconButton/index.d.ts +1 -0
- package/dist/src/Iconfont/CloudIconfont.d.ts +1 -1
- package/dist/src/Iconfont/EdgeIconfont.d.ts +1 -1
- package/dist/src/Iconfont/index.d.ts +1 -1
- package/dist/src/ImageMap/index.d.ts +2 -1
- package/dist/src/MouseTip/index.d.ts +1 -0
- package/dist/src/PassMap/index.d.ts +2 -1
- package/dist/src/TrackMap/index.d.ts +2 -1
- package/dist/src/useBimface/index.d.ts +1 -1
- package/package.json +7 -9
- package/dist/es/Button/index.mjs +0 -47
- package/dist/es/ConfirmableButton/index.mjs +0 -59
- package/dist/es/Drawable/Drawable.mjs +0 -220
- package/dist/es/Drawable/LineElement.mjs +0 -27
- package/dist/es/Drawable/MarkerElement.mjs +0 -39
- package/dist/es/Drawable/PolygonElement.mjs +0 -88
- package/dist/es/Drawable/index.mjs +0 -23
- package/dist/es/Drawable/state.mjs +0 -134
- package/dist/es/ExpandablePannel/index.mjs +0 -93
- package/dist/es/GOSImageMap/DrawableImageMap.mjs +0 -50
- package/dist/es/GOSImageMap/ImageMap.mjs +0 -43
- package/dist/es/IconButton/index.mjs +0 -22
- package/dist/es/Iconfont/index.mjs +0 -8
- package/dist/es/ImageMap/index.mjs +0 -299
- package/dist/es/MouseTip/constant.mjs +0 -9
- package/dist/es/MouseTip/index.mjs +0 -53
- package/dist/es/MouseTip/utils.mjs +0 -70
- package/dist/es/PanoramaRecordPlayer/index.mjs +0 -84
- package/dist/es/PassMap/index.mjs +0 -42
- package/dist/es/TrackMap/PointTooltip.mjs +0 -86
- package/dist/es/TrackMap/TrackPoint.mjs +0 -57
- package/dist/es/TrackMap/index.mjs +0 -374
- package/dist/es/Zoom/index.mjs +0 -48
- package/dist/es/index.mjs +0 -39
- package/dist/es/useBimface/index.mjs +0 -148
- package/dist/es/utils/JSAsyncLoader.mjs +0 -7
- package/dist/lib/index.js +0 -2
- package/dist/src/Iconfont/font_3929209_z3fhml098hr.d.ts +0 -0
- package/dist/src/Iconfont/font_edge.d.ts +0 -0
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
import { jsxs as b, jsx as i, Fragment as ke } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as dt, useRef as we, useState as a, useEffect as X, useImperativeHandle as gt } from "react";
|
|
3
|
-
/* empty css *//* empty css *//* empty css */import pt from "../Iconfont/index.mjs";
|
|
4
|
-
/* empty css */import ht from "../TrackMap/index.mjs";
|
|
5
|
-
/* empty css */import vt from "../PassMap/index.mjs";
|
|
6
|
-
import yt from "../Zoom/index.mjs";
|
|
7
|
-
import "ahooks";
|
|
8
|
-
import "use-immer";
|
|
9
|
-
import "../Drawable/index.mjs";
|
|
10
|
-
import Bt from "antd/es/button";
|
|
11
|
-
import Ee from "../ConfirmableButton/index.mjs";
|
|
12
|
-
import { SaveOutlined as bt } from "@ant-design/icons";
|
|
13
|
-
let Pe;
|
|
14
|
-
const Lt = dt((Se, Te) => {
|
|
15
|
-
var ie, ae, re, ce, le, me, ue, fe, de, ge, pe, he, ve, ye, Be, be, xe, Me, Ie, Ce, Ne;
|
|
16
|
-
const {
|
|
17
|
-
url: ze,
|
|
18
|
-
points: w,
|
|
19
|
-
pointSize: We,
|
|
20
|
-
direction: He,
|
|
21
|
-
activePointId: Ye,
|
|
22
|
-
lineStyle: Xe,
|
|
23
|
-
pointStyle: Re,
|
|
24
|
-
directionStyle: Le,
|
|
25
|
-
onPointClick: $e,
|
|
26
|
-
passes: E,
|
|
27
|
-
activePassId: Oe,
|
|
28
|
-
passStyle: De,
|
|
29
|
-
activePassStyle: je,
|
|
30
|
-
marks: Ue,
|
|
31
|
-
draggable: h = !1,
|
|
32
|
-
offsetEdge: Ve = [50, 50, 50, 50],
|
|
33
|
-
zoomable: D = !1,
|
|
34
|
-
zoomStep: M = 0.02,
|
|
35
|
-
zoomMax: I = 2,
|
|
36
|
-
zoomMin: C = 0,
|
|
37
|
-
onImageLoad: j,
|
|
38
|
-
trackEditable: U,
|
|
39
|
-
trackEditing: R,
|
|
40
|
-
keepRatio: Ze,
|
|
41
|
-
transform: qe,
|
|
42
|
-
onTrackEditingChange: g,
|
|
43
|
-
onTransform: Fe,
|
|
44
|
-
onPointsChange: V,
|
|
45
|
-
actions: e = !0
|
|
46
|
-
} = Se, x = we({}), v = we({}), [Z, Ae] = a(0), [q, Ge] = a(0), [m, L] = a(1), [u, y] = a(0), [f, B] = a(0), [c, $] = a(0), [l, O] = a(0), [F, Je] = a(!1), [A, P] = a(!1), [G, Ke] = a(), [S, T] = a({
|
|
47
|
-
x: 0,
|
|
48
|
-
y: 0
|
|
49
|
-
}), [J, K, Q, _] = Ve, [d, N] = a(R), [ee, Qe] = a(1), [_e, te] = a(!1), [r, et] = a(typeof e != "boolean" ? e : e === !0 ? {} : null);
|
|
50
|
-
X(() => {
|
|
51
|
-
Qe(Math.round(m * 100) / 100);
|
|
52
|
-
}, [m]), X(() => {
|
|
53
|
-
N(R);
|
|
54
|
-
}, [R]), X(() => {
|
|
55
|
-
Pe = new ResizeObserver(oe), Pe.observe(v.current);
|
|
56
|
-
const t = (o) => (o.preventDefault(), !1);
|
|
57
|
-
return v.current.addEventListener("wheel", t), () => {
|
|
58
|
-
v.current.removeEventListener("wheel", t);
|
|
59
|
-
};
|
|
60
|
-
}, []);
|
|
61
|
-
const oe = () => {
|
|
62
|
-
if (!v.current)
|
|
63
|
-
return;
|
|
64
|
-
const t = v.current.clientWidth, o = v.current.clientHeight, n = x.current.naturalWidth, s = x.current.naturalHeight, p = t / n, Y = o / s, k = p < Y ? p : Y, lt = (t - n * k) / 2, mt = (o - s * k) / 2, ut = n * k, ft = s * k;
|
|
65
|
-
Ae(t), Ge(o), L(k), y(lt), B(mt), $(ut), O(ft), Je(!0), j && j(x.current);
|
|
66
|
-
}, z = () => {
|
|
67
|
-
if (!D || m >= I)
|
|
68
|
-
return;
|
|
69
|
-
let t = m * (1 + M), o = M;
|
|
70
|
-
t >= I && (t = I, o = I / m - 1), y(u - c * (o / 2)), B(f - l * (o / 2)), $(c + c * o), O(l + l * o), L(t), H();
|
|
71
|
-
}, W = () => {
|
|
72
|
-
if (!D || m <= C)
|
|
73
|
-
return;
|
|
74
|
-
let t = m * (1 - M), o = M;
|
|
75
|
-
t <= C && (t = C, o = 1 - C / m), y(u - c * (-o / 2)), B(f - l * (-o / 2)), $(c + c * -o), O(l + l * -o), L(t), H();
|
|
76
|
-
};
|
|
77
|
-
gt(Te, () => ({
|
|
78
|
-
zoomIn: z,
|
|
79
|
-
zoomOut: W
|
|
80
|
-
}));
|
|
81
|
-
const tt = (t) => (t.nativeEvent.deltaY < 0 ? z() : W(), !1), ot = (t) => {
|
|
82
|
-
P(!0);
|
|
83
|
-
const {
|
|
84
|
-
pageX: o,
|
|
85
|
-
pageY: n
|
|
86
|
-
} = t;
|
|
87
|
-
T({
|
|
88
|
-
x: o,
|
|
89
|
-
y: n
|
|
90
|
-
});
|
|
91
|
-
}, nt = (t) => {
|
|
92
|
-
if (!A)
|
|
93
|
-
return !1;
|
|
94
|
-
const {
|
|
95
|
-
pageX: o,
|
|
96
|
-
pageY: n
|
|
97
|
-
} = t, s = o - S.x, p = n - S.y;
|
|
98
|
-
T({
|
|
99
|
-
x: o,
|
|
100
|
-
y: n
|
|
101
|
-
}), y(u + s), B(f + p), H();
|
|
102
|
-
}, ne = () => {
|
|
103
|
-
P(!1);
|
|
104
|
-
};
|
|
105
|
-
window.onmouseup = () => {
|
|
106
|
-
P(!1);
|
|
107
|
-
};
|
|
108
|
-
const H = () => {
|
|
109
|
-
u < -c + _ && y(-c + _), f < -l + J && B(-l + J), u > Z - K && y(Z - K), f > q - Q && B(q - Q);
|
|
110
|
-
}, st = () => {
|
|
111
|
-
N(!d), g && g(!d);
|
|
112
|
-
}, it = (t) => {
|
|
113
|
-
const {
|
|
114
|
-
touches: o
|
|
115
|
-
} = t;
|
|
116
|
-
if (console.log("onTouchStart"), console.log(o), P(!0), o.length < 2) {
|
|
117
|
-
const {
|
|
118
|
-
clientX: n,
|
|
119
|
-
clientY: s
|
|
120
|
-
} = o[0];
|
|
121
|
-
T({
|
|
122
|
-
x: n,
|
|
123
|
-
y: s
|
|
124
|
-
});
|
|
125
|
-
} else
|
|
126
|
-
Ke(o);
|
|
127
|
-
}, at = (t) => {
|
|
128
|
-
if (!A || !t.touches)
|
|
129
|
-
return !1;
|
|
130
|
-
const {
|
|
131
|
-
clientX: o,
|
|
132
|
-
clientY: n
|
|
133
|
-
} = t.touches[0];
|
|
134
|
-
if (t.touches.length < 2) {
|
|
135
|
-
const s = o - S.x, p = n - S.y;
|
|
136
|
-
T({
|
|
137
|
-
x: o,
|
|
138
|
-
y: n
|
|
139
|
-
}), y(u + s), B(f + p), H();
|
|
140
|
-
} else {
|
|
141
|
-
console.log("onTouchMove"), console.log(t.touches);
|
|
142
|
-
const s = t.touches, p = se(s[0], s[1]), Y = se(G[0], G[1]);
|
|
143
|
-
p > Y ? z() : W();
|
|
144
|
-
}
|
|
145
|
-
}, se = (t, o) => {
|
|
146
|
-
const n = o.pageX - t.pageX, s = o.pageY - t.pageY;
|
|
147
|
-
return Math.sqrt(n * n + s * s);
|
|
148
|
-
};
|
|
149
|
-
X(() => {
|
|
150
|
-
et(typeof e != "boolean" ? e : e === !0 ? {} : null);
|
|
151
|
-
}, [e]);
|
|
152
|
-
const rt = () => {
|
|
153
|
-
N(!1), g && g(!1);
|
|
154
|
-
}, ct = () => {
|
|
155
|
-
te(!0);
|
|
156
|
-
};
|
|
157
|
-
return /* @__PURE__ */ b("div", {
|
|
158
|
-
className: "image-map",
|
|
159
|
-
ref: v,
|
|
160
|
-
onMouseDown: h ? ot : void 0,
|
|
161
|
-
onMouseMove: h ? nt : void 0,
|
|
162
|
-
onMouseUp: h ? ne : void 0,
|
|
163
|
-
onWheel: h ? tt : void 0,
|
|
164
|
-
onTouchStart: h ? it : void 0,
|
|
165
|
-
onTouchMove: h ? at : void 0,
|
|
166
|
-
onTouchEnd: h ? ne : void 0,
|
|
167
|
-
children: [/* @__PURE__ */ i("img", {
|
|
168
|
-
className: "img",
|
|
169
|
-
style: {
|
|
170
|
-
position: "absolute",
|
|
171
|
-
left: u,
|
|
172
|
-
top: f,
|
|
173
|
-
width: c,
|
|
174
|
-
height: l
|
|
175
|
-
},
|
|
176
|
-
ref: x,
|
|
177
|
-
onLoad: oe,
|
|
178
|
-
src: ze,
|
|
179
|
-
alt: ""
|
|
180
|
-
}), F && (E == null ? void 0 : E.length) && /* @__PURE__ */ i(vt, {
|
|
181
|
-
style: {
|
|
182
|
-
position: "absolute",
|
|
183
|
-
left: u,
|
|
184
|
-
top: f,
|
|
185
|
-
width: c,
|
|
186
|
-
height: l
|
|
187
|
-
},
|
|
188
|
-
passes: E,
|
|
189
|
-
scale: m,
|
|
190
|
-
activePassId: Oe,
|
|
191
|
-
passStyle: De,
|
|
192
|
-
activePassStyle: je
|
|
193
|
-
}), F && !!(w != null && w.length) && /* @__PURE__ */ i(ht, {
|
|
194
|
-
style: {
|
|
195
|
-
position: "absolute",
|
|
196
|
-
left: u,
|
|
197
|
-
top: f,
|
|
198
|
-
width: c,
|
|
199
|
-
height: l,
|
|
200
|
-
overflow: "visible"
|
|
201
|
-
},
|
|
202
|
-
width: x.current.naturalWidth,
|
|
203
|
-
height: x.current.naturalHeight,
|
|
204
|
-
transform: qe,
|
|
205
|
-
movable: d,
|
|
206
|
-
resizable: d,
|
|
207
|
-
points: w,
|
|
208
|
-
scale: m,
|
|
209
|
-
pointSize: We,
|
|
210
|
-
direction: He,
|
|
211
|
-
activePointId: Ye,
|
|
212
|
-
lineStyle: Xe,
|
|
213
|
-
pointStyle: Re,
|
|
214
|
-
directionStyle: Le,
|
|
215
|
-
keepRatio: Ze,
|
|
216
|
-
marks: Ue,
|
|
217
|
-
onPointClick: $e,
|
|
218
|
-
onTransform: Fe,
|
|
219
|
-
onPointsChange: (t) => {
|
|
220
|
-
V && V(t), N(!1), g && g(!1);
|
|
221
|
-
},
|
|
222
|
-
onCancelResize: () => {
|
|
223
|
-
N(!1), g && g(!1);
|
|
224
|
-
},
|
|
225
|
-
actions: e,
|
|
226
|
-
setIsSaved: te,
|
|
227
|
-
isSaved: _e
|
|
228
|
-
}), U && /* @__PURE__ */ b("div", {
|
|
229
|
-
className: "image-map-toolbar",
|
|
230
|
-
children: [/* @__PURE__ */ i(yt, {
|
|
231
|
-
className: "zoom-controller",
|
|
232
|
-
value: ee,
|
|
233
|
-
min: C,
|
|
234
|
-
max: I,
|
|
235
|
-
step: M,
|
|
236
|
-
showText: !0,
|
|
237
|
-
onChange: (t) => {
|
|
238
|
-
ee > t ? W() : z();
|
|
239
|
-
}
|
|
240
|
-
}), U && (d && e ? /* @__PURE__ */ b(ke, {
|
|
241
|
-
children: [/* @__PURE__ */ i("div", {
|
|
242
|
-
className: "line"
|
|
243
|
-
}), /* @__PURE__ */ b("div", {
|
|
244
|
-
className: "editing-controller",
|
|
245
|
-
children: [/* @__PURE__ */ i(Ee, {
|
|
246
|
-
children: typeof e != "boolean" && ((ie = e.cancelButton) == null ? void 0 : ie.children) || void 0,
|
|
247
|
-
name: typeof e != "boolean" && ((ae = e.cancelButton) == null ? void 0 : ae.text) || "退出编辑",
|
|
248
|
-
className: `editing-controller${d ? " active" : ""} ${typeof e != "boolean" && ((re = e.cancelButton) == null ? void 0 : re.className) || ""}`,
|
|
249
|
-
confirm: ((ce = r == null ? void 0 : r.cancelButton) == null ? void 0 : ce.confirm) === !0 ? {
|
|
250
|
-
text: "调整记录将不被保存"
|
|
251
|
-
} : (le = r == null ? void 0 : r.cancelButton) != null && le.confirm ? r.cancelButton.confirm : !1,
|
|
252
|
-
style: typeof e != "boolean" && ((me = e.cancelButton) == null ? void 0 : me.style) || void 0,
|
|
253
|
-
onConfirm: rt
|
|
254
|
-
}), /* @__PURE__ */ i(Ee, {
|
|
255
|
-
type: "primary",
|
|
256
|
-
children: typeof e != "boolean" && ((ue = e.okButton) == null ? void 0 : ue.children) || /* @__PURE__ */ b("div", {
|
|
257
|
-
className: "save-detail",
|
|
258
|
-
children: [/* @__PURE__ */ i(bt, {}), /* @__PURE__ */ i("span", {
|
|
259
|
-
children: "保存"
|
|
260
|
-
})]
|
|
261
|
-
}),
|
|
262
|
-
name: typeof e != "boolean" && ((fe = e.okButton) != null && fe.confirm) ? ((de = e.okButton) == null ? void 0 : de.text) || "保存" : "确定",
|
|
263
|
-
className: `editing-controller${d ? " active" : ""} ${typeof e != "boolean" && ((ge = e.okButton) == null ? void 0 : ge.className) || ""}`,
|
|
264
|
-
confirm: ((pe = r == null ? void 0 : r.okButton) == null ? void 0 : pe.confirm) === !0 ? {
|
|
265
|
-
text: "调整记录保存后,将改变当前巡检数据状态"
|
|
266
|
-
} : (he = r == null ? void 0 : r.okButton) != null && he.confirm ? r.okButton.confirm : !1,
|
|
267
|
-
style: typeof e != "boolean" && ((ve = e.okButton) == null ? void 0 : ve.style) || void 0,
|
|
268
|
-
onConfirm: ct
|
|
269
|
-
})]
|
|
270
|
-
})]
|
|
271
|
-
}) : /* @__PURE__ */ b(ke, {
|
|
272
|
-
children: [/* @__PURE__ */ i("div", {
|
|
273
|
-
className: "line"
|
|
274
|
-
}), /* @__PURE__ */ i("div", {
|
|
275
|
-
className: "moveable-controller",
|
|
276
|
-
children: /* @__PURE__ */ i(Bt, {
|
|
277
|
-
title: d ? typeof e != "boolean" && ((ye = e.editButton) == null ? void 0 : ye.exitTitleText) || "退出编辑" : typeof e != "boolean" && ((Be = e.editButton) == null ? void 0 : Be.titleText) || "调整轨迹",
|
|
278
|
-
className: `moveable-controller-btn${d ? " active" : ""} ${typeof e != "boolean" && ((be = e.editButton) == null ? void 0 : be.className) || ""}`,
|
|
279
|
-
style: typeof e != "boolean" && ((xe = e.editButton) == null ? void 0 : xe.style) || void 0,
|
|
280
|
-
onClick: st,
|
|
281
|
-
children: typeof e != "boolean" ? (Me = e.editButton) != null && Me.children ? (Ie = e.editButton) == null ? void 0 : Ie.children : (Ce = e.editButton) != null && Ce.text ? /* @__PURE__ */ i("span", {
|
|
282
|
-
children: (Ne = e.editButton) == null ? void 0 : Ne.text
|
|
283
|
-
}) : /* @__PURE__ */ b("div", {
|
|
284
|
-
className: "btn-change",
|
|
285
|
-
children: [/* @__PURE__ */ i(pt, {
|
|
286
|
-
type: "icon-tiaozheng"
|
|
287
|
-
}), /* @__PURE__ */ i("span", {
|
|
288
|
-
children: "修改"
|
|
289
|
-
})]
|
|
290
|
-
}) : void 0
|
|
291
|
-
})
|
|
292
|
-
})]
|
|
293
|
-
}))]
|
|
294
|
-
})]
|
|
295
|
-
});
|
|
296
|
-
});
|
|
297
|
-
export {
|
|
298
|
-
Lt as default
|
|
299
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as d, useState as f, useEffect as p } from "react";
|
|
3
|
-
/* empty css */import { placementStringToArr as O, getPlacementPosition as S, getOffsetX as T, getOffsetY as w } from "./utils.mjs";
|
|
4
|
-
const V = (t) => {
|
|
5
|
-
var u;
|
|
6
|
-
const {
|
|
7
|
-
children: b,
|
|
8
|
-
defaultPosition: g,
|
|
9
|
-
forElement: E,
|
|
10
|
-
placement: x = "right-bottom",
|
|
11
|
-
curserPosition: y,
|
|
12
|
-
className: h,
|
|
13
|
-
style: L
|
|
14
|
-
} = t, P = d(null), n = d(null), e = E || document.body, o = O(x), i = S(o, (u = n.current) == null ? void 0 : u.getBoundingClientRect(), y), [$, s] = f(t.visible || !0), [r, N] = f(g || {
|
|
15
|
-
x: -2e3,
|
|
16
|
-
y: -2e3
|
|
17
|
-
});
|
|
18
|
-
p(() => (e.addEventListener("mouseenter", l), e.addEventListener("mousemove", c), e.addEventListener("mouseleave", m), () => {
|
|
19
|
-
e.removeEventListener("mouseenter", l), e.removeEventListener("mousemove", c), e.removeEventListener("mouseleave", m);
|
|
20
|
-
}), [e]), p(() => {
|
|
21
|
-
s(t.visible || !0);
|
|
22
|
-
}, [t.visible]);
|
|
23
|
-
const l = () => {
|
|
24
|
-
s(!0);
|
|
25
|
-
}, m = () => {
|
|
26
|
-
s(!1);
|
|
27
|
-
}, c = (v) => {
|
|
28
|
-
let R = T(v) + i.x;
|
|
29
|
-
const j = w(v) + i.y;
|
|
30
|
-
N({
|
|
31
|
-
x: R,
|
|
32
|
-
y: j
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
return /* @__PURE__ */ a("div", {
|
|
36
|
-
className: `g-mouse-tip ${o.join(" ")}`,
|
|
37
|
-
ref: P,
|
|
38
|
-
style: {
|
|
39
|
-
left: `${r.x}px`,
|
|
40
|
-
top: `${r.y}px`,
|
|
41
|
-
visibility: `${$ ? "visible" : "hidden"}`
|
|
42
|
-
},
|
|
43
|
-
children: /* @__PURE__ */ a("div", {
|
|
44
|
-
className: `g-mouse-tip-content ${h}`,
|
|
45
|
-
style: L,
|
|
46
|
-
ref: n,
|
|
47
|
-
children: b
|
|
48
|
-
})
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
export {
|
|
52
|
-
V as default
|
|
53
|
-
};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { GAP_SIZE_H as n, GAP_SIZE_V as u, ON_RIGHT as f, ON_LEFT as a, ON_BOTTOM as h, ON_TOP as g } from "./constant.mjs";
|
|
2
|
-
const c = (t) => {
|
|
3
|
-
const r = t || window.event, e = t.target || t.srcElement;
|
|
4
|
-
if (r.offsetX)
|
|
5
|
-
return r.offsetX;
|
|
6
|
-
{
|
|
7
|
-
const s = e.getBoundingClientRect();
|
|
8
|
-
return r.clientX - s.left;
|
|
9
|
-
}
|
|
10
|
-
}, O = (t) => {
|
|
11
|
-
const r = t || window.event, e = t.target || t.srcElement;
|
|
12
|
-
if (r.offsetY)
|
|
13
|
-
return r.offsetY;
|
|
14
|
-
{
|
|
15
|
-
const s = e.getBoundingClientRect();
|
|
16
|
-
return r.clientY - s.top;
|
|
17
|
-
}
|
|
18
|
-
}, w = (t) => {
|
|
19
|
-
const r = t.split("-");
|
|
20
|
-
let e = r.length > 1 || r[0] === "left" || r[0] === "right" ? r[0] : "center", s = r.length > 1 ? r[1] : r[0] === "top" || r[0] === "bottom" ? r[0] : "middle";
|
|
21
|
-
return [e, s];
|
|
22
|
-
}, m = (t, r, e = [n, u]) => {
|
|
23
|
-
const s = () => {
|
|
24
|
-
switch (t[0]) {
|
|
25
|
-
case "left":
|
|
26
|
-
return a;
|
|
27
|
-
case "right":
|
|
28
|
-
return f;
|
|
29
|
-
default:
|
|
30
|
-
return 0;
|
|
31
|
-
}
|
|
32
|
-
}, i = () => {
|
|
33
|
-
switch (t[1]) {
|
|
34
|
-
case "top":
|
|
35
|
-
return g;
|
|
36
|
-
case "bottom":
|
|
37
|
-
return h;
|
|
38
|
-
default:
|
|
39
|
-
return 0;
|
|
40
|
-
}
|
|
41
|
-
}, l = () => {
|
|
42
|
-
switch (t[0]) {
|
|
43
|
-
case "left":
|
|
44
|
-
return -((r == null ? void 0 : r.width) || 0) - e[0] - 2;
|
|
45
|
-
case "right":
|
|
46
|
-
return 0;
|
|
47
|
-
default:
|
|
48
|
-
return -((r == null ? void 0 : r.width) || 0) / 2;
|
|
49
|
-
}
|
|
50
|
-
}, o = () => {
|
|
51
|
-
switch (t[1]) {
|
|
52
|
-
case "top":
|
|
53
|
-
return -e[1] - 2;
|
|
54
|
-
case "bottom":
|
|
55
|
-
return (r == null ? void 0 : r.height) || 0;
|
|
56
|
-
default:
|
|
57
|
-
return ((r == null ? void 0 : r.height) || 0) / 2;
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
return {
|
|
61
|
-
x: e[0] * s() + l(),
|
|
62
|
-
y: e[1] * i() + o()
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
export {
|
|
66
|
-
c as getOffsetX,
|
|
67
|
-
O as getOffsetY,
|
|
68
|
-
m as getPlacementPosition,
|
|
69
|
-
w as placementStringToArr
|
|
70
|
-
};
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { jsxs as j, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import c from "../IconButton/index.mjs";
|
|
3
|
-
import s from "../Iconfont/index.mjs";
|
|
4
|
-
import { useState as p, useEffect as f } from "react";
|
|
5
|
-
const N = (b) => {
|
|
6
|
-
const {
|
|
7
|
-
className: k,
|
|
8
|
-
style: x,
|
|
9
|
-
length: i = 0,
|
|
10
|
-
current: u = 0,
|
|
11
|
-
speed: P = 2e3,
|
|
12
|
-
play: y = !1,
|
|
13
|
-
loop: I = !1,
|
|
14
|
-
loading: o = !1,
|
|
15
|
-
onChange: t
|
|
16
|
-
} = b, [r, m] = p(y), [n, l] = p(u), [a, h] = p(null);
|
|
17
|
-
f(() => {
|
|
18
|
-
l(u);
|
|
19
|
-
}, [u]), f(() => {
|
|
20
|
-
m(y);
|
|
21
|
-
}, [y]), f(() => {
|
|
22
|
-
r ? g() : n >= i - 1 && (l(0), t(0));
|
|
23
|
-
}, [r]), f(() => {
|
|
24
|
-
r && (o ? a && (clearTimeout(a), h(null)) : h(setTimeout(g, P)));
|
|
25
|
-
}, [o]);
|
|
26
|
-
const g = () => {
|
|
27
|
-
l((d) => d < i - 1 ? (t(d + 1), d + 1) : I ? (t(0), 0) : (C(), d));
|
|
28
|
-
}, T = () => {
|
|
29
|
-
n >= i - 1 && l(0), m(!0);
|
|
30
|
-
}, C = () => {
|
|
31
|
-
m(!1), a && (clearTimeout(a), h(null));
|
|
32
|
-
};
|
|
33
|
-
return /* @__PURE__ */ j("div", {
|
|
34
|
-
className: k,
|
|
35
|
-
style: x,
|
|
36
|
-
children: [/* @__PURE__ */ e(c, {
|
|
37
|
-
disabled: n <= 0 || o,
|
|
38
|
-
onClick: () => {
|
|
39
|
-
t(0), l(0);
|
|
40
|
-
},
|
|
41
|
-
children: /* @__PURE__ */ e(s, {
|
|
42
|
-
type: "icon-diyige"
|
|
43
|
-
})
|
|
44
|
-
}), /* @__PURE__ */ e(c, {
|
|
45
|
-
disabled: n <= 0 || o,
|
|
46
|
-
onClick: () => {
|
|
47
|
-
t(n - 1), l(n - 1);
|
|
48
|
-
},
|
|
49
|
-
children: /* @__PURE__ */ e(s, {
|
|
50
|
-
type: "icon-qianyige"
|
|
51
|
-
})
|
|
52
|
-
}), r ? /* @__PURE__ */ e(c, {
|
|
53
|
-
onClick: C,
|
|
54
|
-
children: /* @__PURE__ */ e(s, {
|
|
55
|
-
type: "icon-zanting"
|
|
56
|
-
})
|
|
57
|
-
}) : /* @__PURE__ */ e(c, {
|
|
58
|
-
disabled: n >= i - 1 || o,
|
|
59
|
-
onClick: T,
|
|
60
|
-
children: /* @__PURE__ */ e(s, {
|
|
61
|
-
type: "icon-bofang"
|
|
62
|
-
})
|
|
63
|
-
}), /* @__PURE__ */ e(c, {
|
|
64
|
-
disabled: n >= i - 1 || o,
|
|
65
|
-
onClick: () => {
|
|
66
|
-
t(n + 1), l(n + 1);
|
|
67
|
-
},
|
|
68
|
-
children: /* @__PURE__ */ e(s, {
|
|
69
|
-
type: "icon-xiayige"
|
|
70
|
-
})
|
|
71
|
-
}), /* @__PURE__ */ e(c, {
|
|
72
|
-
disabled: n >= i - 1 || o,
|
|
73
|
-
onClick: () => {
|
|
74
|
-
t(i - 1), l(i - 1);
|
|
75
|
-
},
|
|
76
|
-
children: /* @__PURE__ */ e(s, {
|
|
77
|
-
type: "icon-zuihouyige"
|
|
78
|
-
})
|
|
79
|
-
})]
|
|
80
|
-
});
|
|
81
|
-
};
|
|
82
|
-
export {
|
|
83
|
-
N as default
|
|
84
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
var S = Object.defineProperty;
|
|
2
|
-
var n = Object.getOwnPropertySymbols;
|
|
3
|
-
var g = Object.prototype.hasOwnProperty, P = Object.prototype.propertyIsEnumerable;
|
|
4
|
-
var p = (e, s, t) => s in e ? S(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t, a = (e, s) => {
|
|
5
|
-
for (var t in s || (s = {}))
|
|
6
|
-
g.call(s, t) && p(e, t, s[t]);
|
|
7
|
-
if (n)
|
|
8
|
-
for (var t of n(s))
|
|
9
|
-
P.call(s, t) && p(e, t, s[t]);
|
|
10
|
-
return e;
|
|
11
|
-
};
|
|
12
|
-
import { jsx as l } from "react/jsx-runtime";
|
|
13
|
-
/* empty css */const f = {
|
|
14
|
-
stroke: "rgba(255, 77, 79, 0.25)",
|
|
15
|
-
strokeWidth: 1
|
|
16
|
-
}, k = (e) => {
|
|
17
|
-
const {
|
|
18
|
-
style: s,
|
|
19
|
-
passes: t,
|
|
20
|
-
scale: o,
|
|
21
|
-
activePassId: y,
|
|
22
|
-
passStyle: d,
|
|
23
|
-
activePassStyle: m
|
|
24
|
-
} = e;
|
|
25
|
-
return /* @__PURE__ */ l("svg", {
|
|
26
|
-
className: "pass-map",
|
|
27
|
-
style: s,
|
|
28
|
-
children: t.map((r, u) => {
|
|
29
|
-
var c;
|
|
30
|
-
const v = r.id === y ? m : f;
|
|
31
|
-
return /* @__PURE__ */ l("g", {
|
|
32
|
-
children: /* @__PURE__ */ l("polygon", {
|
|
33
|
-
points: (c = r.points) == null ? void 0 : c.map((i) => `${i.x * o} ${i.y * o}`).join(","),
|
|
34
|
-
style: a(a(a({}, d), r.passStyle), v)
|
|
35
|
-
})
|
|
36
|
-
}, u);
|
|
37
|
-
})
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
export {
|
|
41
|
-
k as default
|
|
42
|
-
};
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
var I = Object.defineProperty, P = Object.defineProperties;
|
|
2
|
-
var j = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var s = Object.getOwnPropertySymbols;
|
|
4
|
-
var m = Object.prototype.hasOwnProperty, C = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var h = (o, n, e) => n in o ? I(o, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[n] = e, c = (o, n) => {
|
|
6
|
-
for (var e in n || (n = {}))
|
|
7
|
-
m.call(n, e) && h(o, e, n[e]);
|
|
8
|
-
if (s)
|
|
9
|
-
for (var e of s(n))
|
|
10
|
-
C.call(n, e) && h(o, e, n[e]);
|
|
11
|
-
return o;
|
|
12
|
-
}, S = (o, n) => P(o, j(n));
|
|
13
|
-
var x = (o, n) => {
|
|
14
|
-
var e = {};
|
|
15
|
-
for (var t in o)
|
|
16
|
-
m.call(o, t) && n.indexOf(t) < 0 && (e[t] = o[t]);
|
|
17
|
-
if (o != null && s)
|
|
18
|
-
for (var t of s(o))
|
|
19
|
-
n.indexOf(t) < 0 && C.call(o, t) && (e[t] = o[t]);
|
|
20
|
-
return e;
|
|
21
|
-
};
|
|
22
|
-
import { jsx as R } from "react/jsx-runtime";
|
|
23
|
-
import { useState as W, useRef as z, useEffect as T } from "react";
|
|
24
|
-
import A from "antd/es/tooltip";
|
|
25
|
-
const F = (o) => {
|
|
26
|
-
var a, g, O, v;
|
|
27
|
-
const f = o, {
|
|
28
|
-
children: n,
|
|
29
|
-
open: e,
|
|
30
|
-
point: t,
|
|
31
|
-
key: b,
|
|
32
|
-
style: k
|
|
33
|
-
} = f, w = x(f, [
|
|
34
|
-
"children",
|
|
35
|
-
"open",
|
|
36
|
-
"point",
|
|
37
|
-
"key",
|
|
38
|
-
"style"
|
|
39
|
-
]), [D, u] = W(e && t.tooltipOpen !== void 0 ? t.tooltipOpen : void 0), i = z(null);
|
|
40
|
-
return T(() => {
|
|
41
|
-
var p, d;
|
|
42
|
-
if (!t.tooltipRender || !i.current)
|
|
43
|
-
return;
|
|
44
|
-
const l = t.tooltipRender(t);
|
|
45
|
-
if (typeof l == "string" || typeof l == "number") {
|
|
46
|
-
i.current.innerText = l.toString();
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
const r = (p = i.current) == null ? void 0 : p.firstChild;
|
|
50
|
-
r ? r.replaceWith(l) : (d = i.current) == null || d.appendChild(l), console.log("tooltip inner text", t.id), console.log((/* @__PURE__ */ new Date()).valueOf());
|
|
51
|
-
}, [t.tooltipRender, D]), T(() => {
|
|
52
|
-
u(t.tooltipOpen !== void 0 ? t.tooltipOpen && e : void 0);
|
|
53
|
-
}, [t.tooltipOpen !== void 0 ? t.tooltipOpen && e : void 0]), console.log("render PointTooltip", t.id), console.log((/* @__PURE__ */ new Date()).valueOf()), /* @__PURE__ */ R(A, S(c({}, w), {
|
|
54
|
-
autoAdjustOverflow: !1,
|
|
55
|
-
placement: "top",
|
|
56
|
-
open: t.tooltipOpen !== void 0 ? t.tooltipOpen && e : void 0,
|
|
57
|
-
onOpenChange: (l) => {
|
|
58
|
-
var d, y;
|
|
59
|
-
if (t.tooltipOpen || u(l), console.log("tooltip inner text", t.id), console.log((/* @__PURE__ */ new Date()).valueOf()), !t.tooltipRender || !i.current)
|
|
60
|
-
return;
|
|
61
|
-
const r = t.tooltipRender(t);
|
|
62
|
-
if (typeof r == "string" || typeof r == "number") {
|
|
63
|
-
i.current.innerText = r.toString();
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
const p = (d = i.current) == null ? void 0 : d.firstChild;
|
|
67
|
-
p ? p.replaceWith(r) : (y = i.current) == null || y.appendChild(r);
|
|
68
|
-
},
|
|
69
|
-
color: ((a = t.tooltipStyle) == null ? void 0 : a.backgroundColor) || ((g = t.tooltipStyle) == null ? void 0 : g.backgroundImage) || ((v = (O = t.tooltipStyle) == null ? void 0 : O.background) == null ? void 0 : v.toString()),
|
|
70
|
-
title: /* @__PURE__ */ R("div", {
|
|
71
|
-
ref: i
|
|
72
|
-
}, b),
|
|
73
|
-
overlayInnerStyle: t.tooltipStyle,
|
|
74
|
-
destroyTooltipOnHide: !0,
|
|
75
|
-
style: c({
|
|
76
|
-
zIndex: 9
|
|
77
|
-
}, k),
|
|
78
|
-
motion: {
|
|
79
|
-
forceRender: !0
|
|
80
|
-
},
|
|
81
|
-
children: n
|
|
82
|
-
}));
|
|
83
|
-
};
|
|
84
|
-
export {
|
|
85
|
-
F as default
|
|
86
|
-
};
|