@glodon-aiot/react-components 3.0.11-beta.0 → 3.0.11-beta.2
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/es/Button/index.mjs +48 -0
- package/dist/es/Button/style.less.mjs +4 -0
- package/dist/es/ConfirmableButton/index.mjs +59 -0
- package/dist/es/Drawable/Drawable.mjs +220 -0
- package/dist/es/Drawable/LineElement.mjs +27 -0
- package/dist/es/Drawable/MarkerElement.mjs +39 -0
- package/dist/es/Drawable/PolygonElement.mjs +88 -0
- package/dist/es/Drawable/index.mjs +23 -0
- package/dist/es/Drawable/state.mjs +134 -0
- package/dist/es/ExpandablePannel/index.mjs +94 -0
- package/dist/es/ExpandablePannel/style.less.mjs +4 -0
- package/dist/es/GOSImageMap/DrawableImageMap.mjs +50 -0
- package/dist/es/GOSImageMap/ImageMap.mjs +42 -0
- package/dist/es/IconButton/index.mjs +23 -0
- package/dist/es/IconButton/style.less.mjs +4 -0
- package/dist/es/Iconfont/index.mjs +8 -0
- package/dist/es/ImageMap/index.mjs +304 -0
- package/dist/es/ImageMap/style.less.mjs +4 -0
- package/dist/es/MouseTip/constant.mjs +9 -0
- package/dist/es/MouseTip/index.mjs +54 -0
- package/dist/es/MouseTip/style.less.mjs +4 -0
- package/dist/es/MouseTip/utils.mjs +70 -0
- package/dist/es/PanoramaRecordPlayer/index.mjs +84 -0
- package/dist/es/PassMap/index.mjs +43 -0
- package/dist/es/PassMap/style.less.mjs +4 -0
- package/dist/es/TrackMap/PointTooltip.mjs +86 -0
- package/dist/es/TrackMap/TrackPoint.mjs +57 -0
- package/dist/es/TrackMap/index.mjs +375 -0
- package/dist/es/TrackMap/style.less.mjs +4 -0
- package/dist/es/Zoom/index.mjs +48 -0
- package/dist/es/index.mjs +32 -0
- package/dist/es/style.css +1 -0
- package/dist/es/useBimface/index.mjs +148 -0
- package/dist/es/utils/JSAsyncLoader.mjs +7 -0
- package/dist/lib/index.js +1 -0
- package/dist/lib/style.css +1 -0
- package/dist/src/Button/index.d.ts +1 -2
- package/dist/src/ConfirmableButton/index.d.ts +1 -1
- package/dist/src/Drawable/LineElement.d.ts +0 -1
- package/dist/src/Drawable/MarkersMap.d.ts +0 -1
- package/dist/src/Drawable/PolygonElement.d.ts +0 -1
- package/dist/src/Drawable/index.d.ts +1 -2
- package/dist/src/Drawable/state.d.ts +1 -1
- package/dist/src/ExpandablePannel/index.d.ts +0 -1
- package/dist/src/GOSImageMap/DrawableImageMap.d.ts +0 -1
- package/dist/src/IconButton/index.d.ts +0 -1
- package/dist/src/Iconfont/CloudIconfont.d.ts +1 -1
- package/dist/src/Iconfont/EdgeIconfont.d.ts +1 -1
- package/dist/src/Iconfont/font_3929209_z3fhml098hr.d.ts +0 -0
- package/dist/src/Iconfont/font_edge.d.ts +0 -0
- package/dist/src/Iconfont/index.d.ts +1 -1
- package/dist/src/ImageMap/index.d.ts +1 -2
- package/dist/src/MouseTip/index.d.ts +0 -1
- package/dist/src/PassMap/index.d.ts +1 -2
- package/dist/src/TrackMap/index.d.ts +1 -2
- package/dist/src/useBimface/index.d.ts +1 -1
- package/package.json +8 -6
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
var Tt = Object.defineProperty, $t = Object.defineProperties;
|
|
2
|
+
var Ft = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var ht = Object.getOwnPropertySymbols;
|
|
4
|
+
var zt = Object.prototype.hasOwnProperty, Dt = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var yt = (x, l, y) => l in x ? Tt(x, l, { enumerable: !0, configurable: !0, writable: !0, value: y }) : x[l] = y, b = (x, l) => {
|
|
6
|
+
for (var y in l || (l = {}))
|
|
7
|
+
zt.call(l, y) && yt(x, y, l[y]);
|
|
8
|
+
if (ht)
|
|
9
|
+
for (var y of ht(l))
|
|
10
|
+
Dt.call(l, y) && yt(x, y, l[y]);
|
|
11
|
+
return x;
|
|
12
|
+
}, X = (x, l) => $t(x, Ft(l));
|
|
13
|
+
import { jsx as d, jsxs as Y } from "react/jsx-runtime";
|
|
14
|
+
import { useRef as D, useState as u, useEffect as h } from "react";
|
|
15
|
+
import Mt from "antd/es/tooltip";
|
|
16
|
+
import Ot from "react-moveable";
|
|
17
|
+
import "./style.less.mjs";
|
|
18
|
+
import mt from "./TrackPoint.mjs";
|
|
19
|
+
import { ConfigProvider as Ct } from "antd";
|
|
20
|
+
const Ut = (x) => {
|
|
21
|
+
var ft;
|
|
22
|
+
const {
|
|
23
|
+
width: l,
|
|
24
|
+
height: y,
|
|
25
|
+
points: T,
|
|
26
|
+
scale: a,
|
|
27
|
+
pointSize: $ = 6,
|
|
28
|
+
direction: q,
|
|
29
|
+
activePointId: M,
|
|
30
|
+
style: g,
|
|
31
|
+
lineStyle: O,
|
|
32
|
+
pointStyle: k,
|
|
33
|
+
directionStyle: xt,
|
|
34
|
+
marks: ot,
|
|
35
|
+
resizable: H,
|
|
36
|
+
transform: r,
|
|
37
|
+
keepRatio: it = !1,
|
|
38
|
+
onPointClick: J,
|
|
39
|
+
onTransform: N,
|
|
40
|
+
onPointsChange: C,
|
|
41
|
+
onCancelResize: Wt,
|
|
42
|
+
actions: B = !0,
|
|
43
|
+
setIsSaved: st,
|
|
44
|
+
isSaved: ct = !1
|
|
45
|
+
} = x, S = D(null), w = D(null), s = D(null), E = D(null), K = D(null), [F, pt] = u(null), [Q, U] = u((r == null ? void 0 : r.scale) || [1, 1]), [V, Z] = u((r == null ? void 0 : r.rotate) || 0), [W, _] = u((r == null ? void 0 : r.translate) || [0, 0, 0, 0]), [bt, vt] = u([]), [f, Rt] = u(), [kt, at] = u(), [P, G] = u(H), [lt, tt] = u([]), [v, dt] = u(T), [I, Pt] = u(!0), [R, j] = u(), [m, z] = u(), [It, Nt] = u(typeof B != "boolean" ? B : B === !0 ? {} : null), A = ($ - $ / 4 * 0.9) * 2 / a;
|
|
46
|
+
h(() => {
|
|
47
|
+
Nt(typeof B != "boolean" ? B : B === !0 ? {} : null);
|
|
48
|
+
}, [B]);
|
|
49
|
+
const Bt = (t, e) => {
|
|
50
|
+
if (!t.length)
|
|
51
|
+
return;
|
|
52
|
+
let i;
|
|
53
|
+
return t.map((o) => {
|
|
54
|
+
var p;
|
|
55
|
+
if (!i) {
|
|
56
|
+
i = o;
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const c = /* @__PURE__ */ d("line", {
|
|
60
|
+
x1: Number.isFinite(i.x) ? i.x : 0,
|
|
61
|
+
y1: Number.isFinite(i.y) ? i.y : 0,
|
|
62
|
+
x2: Number.isFinite(o.x) ? o.x : 0,
|
|
63
|
+
y2: Number.isFinite(o.y) ? o.y : 0,
|
|
64
|
+
style: X(b(b({
|
|
65
|
+
stroke: "#1F66E1BF"
|
|
66
|
+
}, O), i.lineStyle), {
|
|
67
|
+
strokeWidth: Number((O == null ? void 0 : O.strokeWidth) || ((p = i.lineStyle) == null ? void 0 : p.strokeWidth) || 2) / e
|
|
68
|
+
})
|
|
69
|
+
}, o.id);
|
|
70
|
+
return i = o, c;
|
|
71
|
+
});
|
|
72
|
+
}, ut = new ResizeObserver(() => {
|
|
73
|
+
S.current && (w.current && (w.current.style.transform = "none", w.current.style.width = "auto", w.current.style.height = "100%"), w.current && (w.current.style.width = "100%", w.current.style.height = "100%"));
|
|
74
|
+
});
|
|
75
|
+
h(() => {
|
|
76
|
+
var t;
|
|
77
|
+
z((t = s.current) == null ? void 0 : t.getBoundingClientRect());
|
|
78
|
+
}, [g == null ? void 0 : g.left, g == null ? void 0 : g.top, g == null ? void 0 : g.width, g == null ? void 0 : g.height, a]), h(() => {
|
|
79
|
+
G(H);
|
|
80
|
+
}, [H]), h(() => {
|
|
81
|
+
dt(T || []);
|
|
82
|
+
}, [T, lt]), h(() => {
|
|
83
|
+
var t;
|
|
84
|
+
(!((t = s.current) != null && t.style.transform) || s.current.style.transform === "none") && (U((r == null ? void 0 : r.scale) || [1, 1]), Z((r == null ? void 0 : r.rotate) || 0), _((r == null ? void 0 : r.translate) || [0, 0, 0, 0]));
|
|
85
|
+
}, [(ft = s.current) == null ? void 0 : ft.style.transform]), h(() => {
|
|
86
|
+
!s.current || P || (s.current.style.transform = "none", U((r == null ? void 0 : r.scale) || [1, 1]), Z((r == null ? void 0 : r.rotate) || 0), _((r == null ? void 0 : r.translate) || [0, 0, 0, 0]));
|
|
87
|
+
}, [P]), h(() => {
|
|
88
|
+
if (S.current)
|
|
89
|
+
return ut.observe(S.current), () => {
|
|
90
|
+
S.current && ut.unobserve(S.current);
|
|
91
|
+
};
|
|
92
|
+
}, [S.current]), h(() => {
|
|
93
|
+
!F || !r || (F.throttleDragRotate = r.rotate, F.throttleScale = r.scale, F.throttleDrag = r.translate);
|
|
94
|
+
}, [F, r]), h(() => {
|
|
95
|
+
Rt(v == null ? void 0 : v.find((e) => e.id === M));
|
|
96
|
+
let t = v.map((e) => {
|
|
97
|
+
var p, nt, L;
|
|
98
|
+
const i = e.x, n = e.y, o = e.id === M, c = $ * (o ? 1.2 : 1) / a;
|
|
99
|
+
return /* @__PURE__ */ d(mt, {
|
|
100
|
+
open: I,
|
|
101
|
+
id: e.id,
|
|
102
|
+
point: e,
|
|
103
|
+
getTooltipContainer: () => K.current || document.body,
|
|
104
|
+
x: i,
|
|
105
|
+
y: n,
|
|
106
|
+
r: k != null && k.r || (p = e.pointStyle) != null && p.r ? Number((k == null ? void 0 : k.r) || ((nt = e.pointStyle) == null ? void 0 : nt.r)) / a : c / 2,
|
|
107
|
+
hidden: o,
|
|
108
|
+
style: X(b(b({
|
|
109
|
+
stroke: "#1F66E1BF",
|
|
110
|
+
fill: "#fff",
|
|
111
|
+
cursor: J ? "pointer" : "unset"
|
|
112
|
+
}, k), e.pointStyle), {
|
|
113
|
+
strokeWidth: Number(((L = e.pointStyle) == null ? void 0 : L.strokeWidth) || 2) / a,
|
|
114
|
+
r: void 0
|
|
115
|
+
}),
|
|
116
|
+
onPointClick: J
|
|
117
|
+
}, e.id);
|
|
118
|
+
}) || [];
|
|
119
|
+
vt(t);
|
|
120
|
+
}, [v, M, a, I]), h(() => {
|
|
121
|
+
var o, c, p;
|
|
122
|
+
if (!f) {
|
|
123
|
+
at(void 0);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
const t = f.x, e = f.y, i = f.id === M, n = $ * (i ? 1.2 : 1) / a;
|
|
127
|
+
at(/* @__PURE__ */ Y("g", {
|
|
128
|
+
children: [q !== void 0 && /* @__PURE__ */ d("circle", {
|
|
129
|
+
id: `mark-${f.id}`,
|
|
130
|
+
cx: t,
|
|
131
|
+
cy: e,
|
|
132
|
+
r: `${A}`,
|
|
133
|
+
strokeDasharray: A * 2 * Math.PI,
|
|
134
|
+
strokeDashoffset: A * 2 * Math.PI / 360 * (360 - 60),
|
|
135
|
+
style: b({
|
|
136
|
+
transform: `rotate(${q + 240}deg)`,
|
|
137
|
+
transformOrigin: `${t}px ${e}px`,
|
|
138
|
+
strokeWidth: A * 2,
|
|
139
|
+
stroke: "#1F66E1BF",
|
|
140
|
+
fill: "transparent",
|
|
141
|
+
pointerEvents: "none"
|
|
142
|
+
}, xt)
|
|
143
|
+
}), /* @__PURE__ */ d(mt, {
|
|
144
|
+
open: I,
|
|
145
|
+
point: f,
|
|
146
|
+
getTooltipContainer: () => K.current || document.body,
|
|
147
|
+
x: t,
|
|
148
|
+
y: e,
|
|
149
|
+
r: (o = f.pointStyle) != null && o.r ? Number((c = f.pointStyle) == null ? void 0 : c.r) / a : n / 2,
|
|
150
|
+
style: X(b(b({
|
|
151
|
+
stroke: "#1F66E1BF",
|
|
152
|
+
fill: "#fff"
|
|
153
|
+
}, k), f.pointStyle), {
|
|
154
|
+
strokeWidth: Number(((p = f.pointStyle) == null ? void 0 : p.strokeWidth) || 2) / a,
|
|
155
|
+
r: void 0
|
|
156
|
+
}),
|
|
157
|
+
onPointClick: J
|
|
158
|
+
}, f.id)]
|
|
159
|
+
}, f.id));
|
|
160
|
+
}, [f, q, a, I]), h(() => {
|
|
161
|
+
s.current && setTimeout(() => {
|
|
162
|
+
var t, e;
|
|
163
|
+
j((t = s.current) == null ? void 0 : t.getBBox()), z((e = s.current) == null ? void 0 : e.getBoundingClientRect());
|
|
164
|
+
}, 100);
|
|
165
|
+
}, [r]), h(() => {
|
|
166
|
+
var e, i;
|
|
167
|
+
if (!s.current)
|
|
168
|
+
return;
|
|
169
|
+
j((e = s.current) == null ? void 0 : e.getBBox()), z((i = s.current) == null ? void 0 : i.getBoundingClientRect()), new ResizeObserver(() => {
|
|
170
|
+
var n, o;
|
|
171
|
+
j((n = s.current) == null ? void 0 : n.getBBox()), z((o = s.current) == null ? void 0 : o.getBoundingClientRect());
|
|
172
|
+
}).observe(s.current);
|
|
173
|
+
}, [s.current]), h(() => {
|
|
174
|
+
ct && (St(), st && st(!1));
|
|
175
|
+
}, [ct]);
|
|
176
|
+
const St = () => {
|
|
177
|
+
var n;
|
|
178
|
+
const t = (n = E.current) == null ? void 0 : n.getBoundingClientRect();
|
|
179
|
+
if (!t) {
|
|
180
|
+
C && C(T), G(!1);
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
const e = lt.map((o) => {
|
|
184
|
+
const c = o.getBoundingClientRect();
|
|
185
|
+
return {
|
|
186
|
+
id: o.id.split("-")[1],
|
|
187
|
+
x: (c.x + c.width / 2 - t.x) / a,
|
|
188
|
+
y: (c.y + c.height / 2 - t.y) / a
|
|
189
|
+
};
|
|
190
|
+
}), i = T.map((o) => {
|
|
191
|
+
const c = e == null ? void 0 : e.find((p) => p.id.toString() === o.id.toString());
|
|
192
|
+
return c ? b(b({}, o), c) : o;
|
|
193
|
+
});
|
|
194
|
+
dt(i), C && C(i.length ? i.map((o, c) => ({
|
|
195
|
+
id: o.id,
|
|
196
|
+
x: o.x,
|
|
197
|
+
y: o.y,
|
|
198
|
+
order: c
|
|
199
|
+
})) : T), G(!1);
|
|
200
|
+
}, wt = (t) => t.map((e) => {
|
|
201
|
+
const {
|
|
202
|
+
render: i,
|
|
203
|
+
renderData: n
|
|
204
|
+
} = e, o = e.x * a, c = e.y * a;
|
|
205
|
+
return /* @__PURE__ */ d(Mt, {
|
|
206
|
+
className: "track-map-marker-tooltip",
|
|
207
|
+
placement: "top",
|
|
208
|
+
title: i(n, b({}, e)),
|
|
209
|
+
open: !!n,
|
|
210
|
+
style: {
|
|
211
|
+
zIndex: 9999
|
|
212
|
+
},
|
|
213
|
+
children: /* @__PURE__ */ d("circle", {
|
|
214
|
+
id: `mark-${e.id}`,
|
|
215
|
+
cx: o,
|
|
216
|
+
cy: c,
|
|
217
|
+
r: $ / 2,
|
|
218
|
+
style: {
|
|
219
|
+
stroke: "#1F66E100",
|
|
220
|
+
strokeWidth: 2,
|
|
221
|
+
fill: "#fff0"
|
|
222
|
+
},
|
|
223
|
+
children: /* @__PURE__ */ d("span", {
|
|
224
|
+
children: n.label
|
|
225
|
+
})
|
|
226
|
+
})
|
|
227
|
+
}, e.id);
|
|
228
|
+
}), gt = R ? {
|
|
229
|
+
x: R.x + R.width / 2,
|
|
230
|
+
y: R.y + R.height / 2
|
|
231
|
+
} : {
|
|
232
|
+
x: 0,
|
|
233
|
+
y: 0
|
|
234
|
+
}, et = v.reduce((t, e) => [Math.min(t[0], e.x), Math.max(t[1], e.x)], [0, 0]), rt = v.reduce((t, e) => [Math.min(t[0], e.y), Math.max(t[1], e.y)], [0, 0]);
|
|
235
|
+
return /* @__PURE__ */ d(Ct, {
|
|
236
|
+
prefixCls: "g-rc",
|
|
237
|
+
children: /* @__PURE__ */ Y("div", {
|
|
238
|
+
className: "track-map",
|
|
239
|
+
style: {
|
|
240
|
+
width: "100%",
|
|
241
|
+
height: "100%"
|
|
242
|
+
},
|
|
243
|
+
ref: S,
|
|
244
|
+
children: [/* @__PURE__ */ d("svg", {
|
|
245
|
+
style: g,
|
|
246
|
+
ref: E,
|
|
247
|
+
viewBox: `0 0 ${l} ${y}`,
|
|
248
|
+
children: /* @__PURE__ */ Y("g", {
|
|
249
|
+
ref: s,
|
|
250
|
+
x: et[0],
|
|
251
|
+
y: rt[0],
|
|
252
|
+
width: et[1] - et[0],
|
|
253
|
+
height: rt[1] - rt[0],
|
|
254
|
+
style: {
|
|
255
|
+
transformOrigin: `${gt.x}px ${gt.y}px`,
|
|
256
|
+
cursor: P ? "url('./images/icon-move.svg') 16 16, move" : "unset",
|
|
257
|
+
transform: r && r.scale ? `${r.translate ? ` translate(${r.translate[0]}px, ${r.translate[1]}px)` : ""} rotate(${r.rotate}rad)${r.scale ? ` scale(${r.scale[0]}, ${r.scale[1]})` : ""}` : "none"
|
|
258
|
+
},
|
|
259
|
+
children: [R && /* @__PURE__ */ d("rect", {
|
|
260
|
+
x: R.x,
|
|
261
|
+
y: R.y,
|
|
262
|
+
width: R.width,
|
|
263
|
+
height: R.height,
|
|
264
|
+
fill: "#ff000004"
|
|
265
|
+
}), /* @__PURE__ */ d("g", {
|
|
266
|
+
className: "track-lines",
|
|
267
|
+
children: Bt((v == null ? void 0 : v.filter((t) => t.order > -1)) || [], a)
|
|
268
|
+
}), /* @__PURE__ */ Y("g", {
|
|
269
|
+
className: "track-points",
|
|
270
|
+
children: [bt, kt]
|
|
271
|
+
}), ot && /* @__PURE__ */ d("g", {
|
|
272
|
+
children: wt(ot)
|
|
273
|
+
})]
|
|
274
|
+
})
|
|
275
|
+
}), /* @__PURE__ */ d("div", {
|
|
276
|
+
className: "tooltip-container",
|
|
277
|
+
ref: K,
|
|
278
|
+
style: {
|
|
279
|
+
position: "fixed",
|
|
280
|
+
top: (m == null ? void 0 : m.y) || 0,
|
|
281
|
+
left: (m == null ? void 0 : m.x) || 0,
|
|
282
|
+
width: (m == null ? void 0 : m.width) || 0,
|
|
283
|
+
height: (m == null ? void 0 : m.height) || 0
|
|
284
|
+
}
|
|
285
|
+
}), P && s.current && E.current && /* @__PURE__ */ d(Ot, {
|
|
286
|
+
className: "path-moveable-control-box",
|
|
287
|
+
ref: (t) => {
|
|
288
|
+
pt(t);
|
|
289
|
+
},
|
|
290
|
+
keepRatio: it,
|
|
291
|
+
target: [s.current],
|
|
292
|
+
draggable: !0,
|
|
293
|
+
scalable: !0,
|
|
294
|
+
rotatable: !0,
|
|
295
|
+
padding: {
|
|
296
|
+
left: 10,
|
|
297
|
+
right: 10,
|
|
298
|
+
top: 10,
|
|
299
|
+
bottom: 10
|
|
300
|
+
},
|
|
301
|
+
onDrag: ({
|
|
302
|
+
target: t,
|
|
303
|
+
beforeDelta: e,
|
|
304
|
+
beforeDist: i,
|
|
305
|
+
left: n,
|
|
306
|
+
top: o,
|
|
307
|
+
right: c,
|
|
308
|
+
bottom: p,
|
|
309
|
+
delta: nt,
|
|
310
|
+
dist: L,
|
|
311
|
+
transform: Et,
|
|
312
|
+
clientX: jt,
|
|
313
|
+
clientY: At
|
|
314
|
+
}) => {
|
|
315
|
+
_(L), t.style.transform = Et;
|
|
316
|
+
},
|
|
317
|
+
onDragStart: ({
|
|
318
|
+
inputEvent: t
|
|
319
|
+
}) => {
|
|
320
|
+
t.stopPropagation();
|
|
321
|
+
},
|
|
322
|
+
onDragEnd: () => {
|
|
323
|
+
var e;
|
|
324
|
+
const t = (e = s.current) == null ? void 0 : e.getElementsByTagName("circle");
|
|
325
|
+
tt(t != null && t.length ? [...t] : []), N && N({
|
|
326
|
+
rotate: V,
|
|
327
|
+
translate: W,
|
|
328
|
+
scale: Q
|
|
329
|
+
}, t != null && t.length ? [...t] : [], E.current || void 0);
|
|
330
|
+
},
|
|
331
|
+
renderDirections: it ? ["nw", "ne", "sw", "se"] : ["n", "w", "e", "s", "nw", "ne", "sw", "se"],
|
|
332
|
+
onScale: ({
|
|
333
|
+
target: t,
|
|
334
|
+
scale: e,
|
|
335
|
+
transform: i
|
|
336
|
+
}) => {
|
|
337
|
+
var o;
|
|
338
|
+
U(e), t.style.transform = i;
|
|
339
|
+
const n = (o = s.current) == null ? void 0 : o.getElementsByTagName("circle");
|
|
340
|
+
tt(n != null && n.length ? [...n] : []), N && N({
|
|
341
|
+
rotate: V,
|
|
342
|
+
translate: W,
|
|
343
|
+
scale: e
|
|
344
|
+
}, n != null && n.length ? [...n] : [], E.current || void 0);
|
|
345
|
+
},
|
|
346
|
+
onRotate: ({
|
|
347
|
+
target: t,
|
|
348
|
+
dist: e,
|
|
349
|
+
transform: i
|
|
350
|
+
}) => {
|
|
351
|
+
var o;
|
|
352
|
+
Z(e), t.style.transform = i;
|
|
353
|
+
const n = (o = s.current) == null ? void 0 : o.getElementsByTagName("circle");
|
|
354
|
+
tt(n != null && n.length ? [...n] : []), N && N({
|
|
355
|
+
rotate: e,
|
|
356
|
+
translate: W,
|
|
357
|
+
scale: Q
|
|
358
|
+
}, n != null && n.length ? [...n] : [], E.current || void 0);
|
|
359
|
+
},
|
|
360
|
+
onRenderEnd: () => {
|
|
361
|
+
var e, i, n;
|
|
362
|
+
const t = (e = s.current) == null ? void 0 : e.getElementsByTagName("circle");
|
|
363
|
+
N && N({
|
|
364
|
+
rotate: V,
|
|
365
|
+
translate: W,
|
|
366
|
+
scale: Q
|
|
367
|
+
}, t != null && t.length ? [...t] : [], E.current || void 0), j((i = s.current) == null ? void 0 : i.getBBox()), z((n = s.current) == null ? void 0 : n.getBoundingClientRect());
|
|
368
|
+
}
|
|
369
|
+
})]
|
|
370
|
+
})
|
|
371
|
+
});
|
|
372
|
+
};
|
|
373
|
+
export {
|
|
374
|
+
Ut as default
|
|
375
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import m from "../IconButton/index.mjs";
|
|
3
|
+
import a from "../Iconfont/index.mjs";
|
|
4
|
+
import { useState as x, useEffect as u } from "react";
|
|
5
|
+
const y = (l) => {
|
|
6
|
+
const {
|
|
7
|
+
className: f,
|
|
8
|
+
style: h,
|
|
9
|
+
value: o,
|
|
10
|
+
min: i,
|
|
11
|
+
max: c,
|
|
12
|
+
step: n = 1,
|
|
13
|
+
onChange: r,
|
|
14
|
+
showText: p = !1
|
|
15
|
+
} = l, [t, s] = x(o != null ? o : 0);
|
|
16
|
+
return u(() => {
|
|
17
|
+
s(o != null ? o : 0);
|
|
18
|
+
}, [o]), /* @__PURE__ */ d("div", {
|
|
19
|
+
className: f,
|
|
20
|
+
style: h,
|
|
21
|
+
children: [/* @__PURE__ */ e(m, {
|
|
22
|
+
disabled: !!(c && c <= t),
|
|
23
|
+
onClick: () => {
|
|
24
|
+
r(t + n), s(t + n);
|
|
25
|
+
},
|
|
26
|
+
children: /* @__PURE__ */ e(a, {
|
|
27
|
+
type: "icon-fangda"
|
|
28
|
+
})
|
|
29
|
+
}), p && /* @__PURE__ */ d("div", {
|
|
30
|
+
style: {
|
|
31
|
+
width: 40,
|
|
32
|
+
textAlign: "center"
|
|
33
|
+
},
|
|
34
|
+
children: [Math.round(t * 100), "%"]
|
|
35
|
+
}), /* @__PURE__ */ e(m, {
|
|
36
|
+
disabled: !!(i && i >= t),
|
|
37
|
+
onClick: () => {
|
|
38
|
+
r(t - n), s(t - n);
|
|
39
|
+
},
|
|
40
|
+
children: /* @__PURE__ */ e(a, {
|
|
41
|
+
type: "icon-suoxiao"
|
|
42
|
+
})
|
|
43
|
+
})]
|
|
44
|
+
});
|
|
45
|
+
}, k = y;
|
|
46
|
+
export {
|
|
47
|
+
k as default
|
|
48
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { default as f } from "./Button/index.mjs";
|
|
2
|
+
import { default as m } from "./ExpandablePannel/index.mjs";
|
|
3
|
+
import { default as s } from "./IconButton/index.mjs";
|
|
4
|
+
import { default as x } from "./Iconfont/index.mjs";
|
|
5
|
+
import { default as n } from "./ImageMap/index.mjs";
|
|
6
|
+
import { default as i } from "./PanoramaRecordPlayer/index.mjs";
|
|
7
|
+
import { default as I } from "./TrackMap/index.mjs";
|
|
8
|
+
import { default as b } from "./MouseTip/index.mjs";
|
|
9
|
+
import { default as B } from "./PassMap/index.mjs";
|
|
10
|
+
import { default as D } from "./Zoom/index.mjs";
|
|
11
|
+
import { useBimface as k } from "./useBimface/index.mjs";
|
|
12
|
+
import "react/jsx-runtime";
|
|
13
|
+
import "@umijs/hooks";
|
|
14
|
+
import "react";
|
|
15
|
+
import { default as A } from "./GOSImageMap/DrawableImageMap.mjs";
|
|
16
|
+
import { DrawableContext as E, calAngle as R } from "./Drawable/index.mjs";
|
|
17
|
+
export {
|
|
18
|
+
f as Button,
|
|
19
|
+
E as DrawableContext,
|
|
20
|
+
A as DrawableImageMap,
|
|
21
|
+
m as ExpandablePannel,
|
|
22
|
+
s as IconButton,
|
|
23
|
+
x as Iconfont,
|
|
24
|
+
n as ImageMap,
|
|
25
|
+
b as MouseTip,
|
|
26
|
+
i as PanoramaRecordPlayer,
|
|
27
|
+
B as PassMap,
|
|
28
|
+
I as TrackMap,
|
|
29
|
+
D as Zoom,
|
|
30
|
+
R as calAngle,
|
|
31
|
+
k as useBimface
|
|
32
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.storybook-button{font-family:Nunito Sans,Helvetica Neue,Helvetica,Arial,sans-serif;font-weight:700;border:0;border-radius:3em;cursor:pointer;display:inline-block;line-height:1}.storybook-button--primary{color:#fff;background-color:#027bf4}.storybook-button--secondary{color:#333;background-color:transparent;box-shadow:#00000026 0 0 0 1px inset}.storybook-button--small{font-size:12px;padding:10px 16px}.storybook-button--medium{font-size:14px;padding:11px 20px}.storybook-button--large{font-size:16px;padding:12px 24px}.g-icon-btn{height:28px;width:28px;line-height:28px;background-color:#222836;color:#b8c1d0;cursor:pointer;text-align:center;padding:0;border:none;font-size:16px;display:block}.g-icon-btn:hover{color:#fff;background:linear-gradient(180deg,#4e5b73 0%,#222836 100%);border-image:linear-gradient(180deg,#4e5b73 0%,#222836 100%),linear-gradient(180deg,#ffffff 16.67%,#d2d2d2 49.48%,#000000 73.44%,#e4e4e4 92.71%)}.g-icon-btn:disabled{color:#68707e;cursor:not-allowed;background:linear-gradient(180deg,#0a111d 0%,#222836 100%)}.g-expandable-pannel-wrap{inset:0;z-index:999}.g-expandable-pannel-wrap .g-expandable-pannel-expand-bar{position:absolute;right:0;top:0;background-color:#222836;z-index:9999}.g-expandable-pannel-wrap .g-expandable-pannel-expand-bar.collapsed{position:absolute;top:0;right:0;z-index:9;width:40px;height:40px;display:flex;align-items:center;justify-content:center}.g-expandable-pannel-wrap .g-expandable-pannel-expand-bar.expaned{padding:0}.g-expandable-pannel-wrap .g-expandable-pannel-expand-bar.expaned .g-icon-btn{background-color:#0000}.g-expandable-pannel-wrap .g-expandable-pannel{width:100%;height:100%;border:.5px solid #313A4D}.g-expandable-pannel-wrap .g-expandable-pannel-header{position:absolute;right:0;top:0;z-index:9;padding-right:28px;height:28px;display:flex;flex-direction:row-reverse}.g-expandable-pannel-wrap .g-expandable-pannel-body{opacity:.85;width:100%;height:100%}.g-expandable-pannel-wrap .g-expandable-pannel-body .icon{width:16px;height:16px}.g-expandable-pannel-wrap .g-expandable-pannel.full{width:100%!important;height:100%!important;inset:0 55px;z-index:9}.g-expandable-pannel-wrap .g-expandable-pannel.hidden{inset:0 -20000px}.g-expandable-pannel-wrap .g-expandable-pannel.hidden+.bar-btn{position:absolute;right:0!important;background:rgba(58,63,76,.5);border-radius:20px 0 0 20px}.g-expandable-pannel-wrap .g-expandable-pannel.normal{height:250px;overflow:hidden;padding:0}.g-expandable-pannel-wrap .g-expandable-pannel.full+.bar-btn{top:0;right:55px;z-index:99}.g-expandable-pannel-wrap .g-expandable-pannel.full~.cover{display:block;position:absolute;width:100vw;height:100vh;top:0;left:0;background:#00000066}.g-expandable-pannel-wrap .g-expandable-pannel.hiddern~.cover{display:none}.g-expandable-pannel-wrap .g-expandable-pannel .minimap-menu-pannel{width:134px;background:#ffffff;border:1px solid #ececec;box-shadow:2px 2px 6px #c0c0c040;border-radius:4px;padding:6px 12px}.g-expandable-pannel-wrap .g-expandable-pannel .minimap-menu-pannel .item-row{width:100%;display:flex;height:32px;align-items:center}.g-expandable-pannel-wrap .g-expandable-pannel .minimap-menu-pannel .item-row img{width:16px;height:16px;margin:0 8px}.g-expandable-pannel-wrap .g-expandable-pannel .status{display:block}.g-expandable-pannel-wrap .g-expandable-pannel .status.success:before{display:inline-block;content:"";width:12px;height:12px;background-color:#52c41a}.g-expandable-pannel-wrap .g-expandable-pannel .status.error:before{display:inline-block;content:"";width:12px;height:12px;background-color:#ff4d4f}.g-expandable-pannel-wrap .g-expandable-pannel .pass-confirm-wrap{position:absolute}.g-mouse-tip{display:inline-flex;justify-content:center;align-items:center;gap:4px;box-shadow:0 1px 10px #0000000d,0 4px 5px #00000014,0 2px 4px -1px #0000001f;border-radius:4px;background:#000;position:fixed;z-index:2000;padding:8px 12px}.g-mouse-tip-content{font-size:12px;font-style:normal;font-weight:400;color:#fff}.pass-map{background:transparent}.pass-map .pass-area{position:absolute;background:rgba(255,77,79,.21);border:1px solid #00000000;z-index:1}.pass-map .pass-area-circle{border-radius:50%}.pass-map .pass-area__active{background:rgba(255,77,79,.25);border:1px solid #ff4d4f}*{box-sizing:border-box}.image-map{position:relative;width:100%;height:100%;overflow:hidden;user-select:none;display:flex;justify-content:center}.image-map .image-map-pannel{width:100%;height:100%;user-select:none;display:flex;justify-content:center;align-items:center}.image-map .image-map-toolbar{position:absolute;width:auto;height:auto;bottom:12px;z-index:99;display:flex;align-items:center;gap:12px;background-color:#393939;padding:10px;border-radius:6px}.image-map .image-map-toolbar .zoom-controller{display:flex;height:100%;align-items:center;gap:12px;color:#fff}.image-map .image-map-toolbar .zoom-controller .g-icon-btn,.image-map .image-map-toolbar .zoom-controller .g-icon-btn button{background-color:unset;font-size:16px;border:.5px solid #6f6f6f;border-radius:2px;font-size:14px}.image-map .image-map-toolbar .zoom-controller .g-icon-btn .anticon,.image-map .image-map-toolbar .zoom-controller .g-icon-btn button .anticon{font-size:14px}.image-map .image-map-toolbar .zoom-controller.vertical{flex-direction:column}.image-map .image-map-toolbar .zoom-controller.vertical .g-icon-btn{background-color:red;margin-top:6px;border:none}.image-map .image-map-toolbar .zoom-controller.vertical .g-icon-btn .anticon{font-size:16px}.image-map .image-map-toolbar .zoom-controller.horizontal{flex-direction:row}.image-map .image-map-toolbar .line{width:1px;height:12px;border:.5px solid #e0e0e0}.image-map .image-map-toolbar .moveable-controller{background-color:unset;height:100%;border:.5px solid #6f6f6f;border-radius:2px}.image-map .image-map-toolbar .moveable-controller .moveable-controller-btn{position:relative;border:none;border-radius:2px;background-color:unset;padding:0;display:flex;height:100%}.image-map .image-map-toolbar .moveable-controller .moveable-controller-btn .btn-change{display:flex;align-items:center;color:#fff;gap:10px;height:100%;margin-inline-end:unset;padding:4px 8px}.image-map .image-map-toolbar .moveable-controller .moveable-controller-btn .btn-change svg{font-size:16px}.image-map .image-map-toolbar .moveable-controller .moveable-controller-btn .anticon{font-size:24px}.image-map .image-map-toolbar .moveable-controller .moveable-controller-btn.active{color:#fff}.image-map .image-map-toolbar .moveable-controller .moveable-controller-btn:hover{background:linear-gradient(180deg,#4e5b73 0%,#222836 100%)}.image-map .image-map-toolbar .editing-controller{display:flex;gap:12px;align-items:center;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:left}.image-map .image-map-toolbar .editing-controller .ant-btn-default{border:.5px solid #6f6f6f;border-radius:2px;background-color:unset;color:#fff;padding:4px 8px}.image-map .image-map-toolbar .editing-controller .ant-btn-default:hover{background:linear-gradient(180deg,#4e5b73 0%,#222836 100%)}.image-map .image-map-toolbar .editing-controller .ant-btn-primary{border-radius:2px;background-color:#0532a6;border:.5px solid #6f6f6f;color:#fff;padding:4px 8px}.image-map .image-map-toolbar .editing-controller .ant-btn-primary:hover{background:#0949d2}.image-map .image-map-toolbar .editing-controller .ant-btn-primary .save-detail{display:flex;align-items:center;color:#fff;gap:10px;height:100%}.image-map .image-map-toolbar .editing-controller .ant-btn-primary .save-detail svg{font-size:16px}.track-map{z-index:10;position:relative}.track-map .point{cursor:pointer}.track-map .bottom-action{position:fixed;left:50%;bottom:10px;transform:translate(-50%);z-index:1000;display:flex;justify-content:center;align-items:flex-end;padding-bottom:12px}.track-map .bottom-action .bottom-pannel{background:white;height:48px;background:rgba(255,255,255,.9);border:1px solid #f8f8f8;box-shadow:2px 2px 4px #c0c0c040;border-radius:4px;padding:0 12px}:where(.css-ed5zg0)[class^=ant-popconfirm],:where(.css-ed5zg0)[class*=" ant-popconfirm"]{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-size:14px;box-sizing:border-box}:where(.css-ed5zg0)[class^=ant-popconfirm]:before,:where(.css-ed5zg0)[class*=" ant-popconfirm"]:before,:where(.css-ed5zg0)[class^=ant-popconfirm]:after,:where(.css-ed5zg0)[class*=" ant-popconfirm"]:after{box-sizing:border-box}:where(.css-ed5zg0)[class^=ant-popconfirm] [class^=ant-popconfirm],:where(.css-ed5zg0)[class*=" ant-popconfirm"] [class^=ant-popconfirm],:where(.css-ed5zg0)[class^=ant-popconfirm] [class*=" ant-popconfirm"],:where(.css-ed5zg0)[class*=" ant-popconfirm"] [class*=" ant-popconfirm"]{box-sizing:border-box}:where(.css-ed5zg0)[class^=ant-popconfirm] [class^=ant-popconfirm]:before,:where(.css-ed5zg0)[class*=" ant-popconfirm"] [class^=ant-popconfirm]:before,:where(.css-ed5zg0)[class^=ant-popconfirm] [class*=" ant-popconfirm"]:before,:where(.css-ed5zg0)[class*=" ant-popconfirm"] [class*=" ant-popconfirm"]:before,:where(.css-ed5zg0)[class^=ant-popconfirm] [class^=ant-popconfirm]:after,:where(.css-ed5zg0)[class*=" ant-popconfirm"] [class^=ant-popconfirm]:after,:where(.css-ed5zg0)[class^=ant-popconfirm] [class*=" ant-popconfirm"]:after,:where(.css-ed5zg0)[class*=" ant-popconfirm"] [class*=" ant-popconfirm"]:after{box-sizing:border-box}:where(.css-ed5zg0).ant-popconfirm{z-index:1060}:where(.css-ed5zg0).ant-popconfirm .ant-popconfirm-inner-content{color:#000000e0}:where(.css-ed5zg0).ant-popconfirm .ant-popconfirm-message{position:relative;margin-bottom:8px;color:#000000e0;font-size:14px;display:flex;flex-wrap:nowrap;align-items:start}:where(.css-ed5zg0).ant-popconfirm .ant-popconfirm-message>.ant-popconfirm-message-icon .anticon{color:#faad14;font-size:14px;flex:none;line-height:1;padding-top:4px}:where(.css-ed5zg0).ant-popconfirm .ant-popconfirm-message-title{flex:auto;margin-inline-start:8px}:where(.css-ed5zg0).ant-popconfirm .ant-popconfirm-message-title-only{font-weight:600}:where(.css-ed5zg0).ant-popconfirm .ant-popconfirm-description{position:relative;margin-inline-start:22px;margin-bottom:8px;color:#000000e0;font-size:14px}:where(.css-ed5zg0).ant-popconfirm .ant-popconfirm-buttons{text-align:end}:where(.css-ed5zg0).ant-popconfirm .ant-popconfirm-buttons button{margin-inline-start:8px}:where(.css-ed5zg0)[class^=ant-popover],:where(.css-ed5zg0)[class*=" ant-popover"]{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-size:14px;box-sizing:border-box}:where(.css-ed5zg0)[class^=ant-popover]:before,:where(.css-ed5zg0)[class*=" ant-popover"]:before,:where(.css-ed5zg0)[class^=ant-popover]:after,:where(.css-ed5zg0)[class*=" ant-popover"]:after{box-sizing:border-box}:where(.css-ed5zg0)[class^=ant-popover] [class^=ant-popover],:where(.css-ed5zg0)[class*=" ant-popover"] [class^=ant-popover],:where(.css-ed5zg0)[class^=ant-popover] [class*=" ant-popover"],:where(.css-ed5zg0)[class*=" ant-popover"] [class*=" ant-popover"]{box-sizing:border-box}:where(.css-ed5zg0)[class^=ant-popover] [class^=ant-popover]:before,:where(.css-ed5zg0)[class*=" ant-popover"] [class^=ant-popover]:before,:where(.css-ed5zg0)[class^=ant-popover] [class*=" ant-popover"]:before,:where(.css-ed5zg0)[class*=" ant-popover"] [class*=" ant-popover"]:before,:where(.css-ed5zg0)[class^=ant-popover] [class^=ant-popover]:after,:where(.css-ed5zg0)[class*=" ant-popover"] [class^=ant-popover]:after,:where(.css-ed5zg0)[class^=ant-popover] [class*=" ant-popover"]:after,:where(.css-ed5zg0)[class*=" ant-popover"] [class*=" ant-popover"]:after{box-sizing:border-box}:where(.css-ed5zg0).ant-popover{box-sizing:border-box;margin:0;padding:0;color:#000000e0;font-size:14px;line-height:1.57142857;list-style:none;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";position:absolute;top:0;left:0;z-index:1030;font-weight:400;white-space:normal;text-align:start;cursor:auto;user-select:text;--antd-arrow-background-color: #ffffff}:where(.css-ed5zg0).ant-popover-rtl{direction:rtl}:where(.css-ed5zg0).ant-popover-hidden{display:none}:where(.css-ed5zg0).ant-popover .ant-popover-content{position:relative}:where(.css-ed5zg0).ant-popover .ant-popover-inner{background-color:#fff;background-clip:padding-box;border-radius:8px;box-shadow:0 6px 16px #00000014,0 3px 6px -4px #0000001f,0 9px 28px 8px #0000000d;padding:12px}:where(.css-ed5zg0).ant-popover .ant-popover-title{min-width:177px;margin-bottom:8px;color:#000000e0;font-weight:600}:where(.css-ed5zg0).ant-popover .ant-popover-inner-content{color:#000000e0;padding:0}:where(.css-ed5zg0).ant-popover .ant-popover-arrow{position:absolute;z-index:1;display:block;pointer-events:none;width:16px;height:16px;overflow:hidden;border:0}:where(.css-ed5zg0).ant-popover .ant-popover-arrow:before{position:absolute;bottom:0;inset-inline-start:0;width:16px;height:8px;background:var(--antd-arrow-background-color);clip-path:polygon(1.65685425px 100%,50% 1.65685425px,14.34314575px 100%,1.65685425px 100%);clip-path:path("M 0 8 A 4 4 0 0 0 2.82842712474619 6.82842712474619 L 6.585786437626905 3.0710678118654755 A 2 2 0 0 1 9.414213562373096 3.0710678118654755 L 13.17157287525381 6.82842712474619 A 4 4 0 0 0 16 8 Z");content:""}:where(.css-ed5zg0).ant-popover .ant-popover-arrow:after{content:"";position:absolute;width:8.97056275px;height:8.97056275px;bottom:0;inset-inline:0;margin:auto;border-radius:0 0 2px;transform:translateY(50%) rotate(-135deg);box-shadow:2px 2px 5px #0000000d;z-index:0;background:transparent}:where(.css-ed5zg0).ant-popover .ant-popover-arrow:before{background:var(--antd-arrow-background-color)}:where(.css-ed5zg0).ant-popover-placement-top .ant-popover-arrow,:where(.css-ed5zg0).ant-popover-placement-topLeft .ant-popover-arrow,:where(.css-ed5zg0).ant-popover-placement-topRight .ant-popover-arrow{bottom:0;transform:translateY(100%) rotate(180deg)}:where(.css-ed5zg0).ant-popover-placement-top .ant-popover-arrow{left:50%;transform:translate(-50%) translateY(100%) rotate(180deg)}:where(.css-ed5zg0).ant-popover-placement-topLeft .ant-popover-arrow{left:12px}:where(.css-ed5zg0).ant-popover-placement-topRight .ant-popover-arrow{right:12px}:where(.css-ed5zg0).ant-popover-placement-bottom .ant-popover-arrow,:where(.css-ed5zg0).ant-popover-placement-bottomLeft .ant-popover-arrow,:where(.css-ed5zg0).ant-popover-placement-bottomRight .ant-popover-arrow{top:0;transform:translateY(-100%)}:where(.css-ed5zg0).ant-popover-placement-bottom .ant-popover-arrow{left:50%;transform:translate(-50%) translateY(-100%)}:where(.css-ed5zg0).ant-popover-placement-bottomLeft .ant-popover-arrow{left:12px}:where(.css-ed5zg0).ant-popover-placement-bottomRight .ant-popover-arrow{right:12px}:where(.css-ed5zg0).ant-popover-placement-left .ant-popover-arrow,:where(.css-ed5zg0).ant-popover-placement-leftTop .ant-popover-arrow,:where(.css-ed5zg0).ant-popover-placement-leftBottom .ant-popover-arrow{right:0;transform:translate(100%) rotate(90deg)}:where(.css-ed5zg0).ant-popover-placement-left .ant-popover-arrow{top:50%;transform:translateY(-50%) translate(100%) rotate(90deg)}:where(.css-ed5zg0).ant-popover-placement-leftTop .ant-popover-arrow{top:12px}:where(.css-ed5zg0).ant-popover-placement-leftBottom .ant-popover-arrow{bottom:12px}:where(.css-ed5zg0).ant-popover-placement-right .ant-popover-arrow,:where(.css-ed5zg0).ant-popover-placement-rightTop .ant-popover-arrow,:where(.css-ed5zg0).ant-popover-placement-rightBottom .ant-popover-arrow{left:0;transform:translate(-100%) rotate(-90deg)}:where(.css-ed5zg0).ant-popover-placement-right .ant-popover-arrow{top:50%;transform:translateY(-50%) translate(-100%) rotate(-90deg)}:where(.css-ed5zg0).ant-popover-placement-rightTop .ant-popover-arrow{top:12px}:where(.css-ed5zg0).ant-popover-placement-rightBottom .ant-popover-arrow{bottom:12px}:where(.css-ed5zg0).ant-popover-pure{position:relative;max-width:none;margin:16px;display:inline-block}:where(.css-ed5zg0).ant-popover-pure .ant-popover-content{display:inline-block}:where(.css-ed5zg0).ant-popover.ant-popover-blue{--antd-arrow-background-color: #1677ff}:where(.css-ed5zg0).ant-popover.ant-popover-blue .ant-popover-inner{background-color:#1677ff}:where(.css-ed5zg0).ant-popover.ant-popover-blue .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-purple{--antd-arrow-background-color: #722ed1}:where(.css-ed5zg0).ant-popover.ant-popover-purple .ant-popover-inner{background-color:#722ed1}:where(.css-ed5zg0).ant-popover.ant-popover-purple .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-cyan{--antd-arrow-background-color: #13c2c2}:where(.css-ed5zg0).ant-popover.ant-popover-cyan .ant-popover-inner{background-color:#13c2c2}:where(.css-ed5zg0).ant-popover.ant-popover-cyan .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-green{--antd-arrow-background-color: #52c41a}:where(.css-ed5zg0).ant-popover.ant-popover-green .ant-popover-inner{background-color:#52c41a}:where(.css-ed5zg0).ant-popover.ant-popover-green .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-magenta{--antd-arrow-background-color: #eb2f96}:where(.css-ed5zg0).ant-popover.ant-popover-magenta .ant-popover-inner{background-color:#eb2f96}:where(.css-ed5zg0).ant-popover.ant-popover-magenta .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-pink{--antd-arrow-background-color: #eb2f96}:where(.css-ed5zg0).ant-popover.ant-popover-pink .ant-popover-inner{background-color:#eb2f96}:where(.css-ed5zg0).ant-popover.ant-popover-pink .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-red{--antd-arrow-background-color: #f5222d}:where(.css-ed5zg0).ant-popover.ant-popover-red .ant-popover-inner{background-color:#f5222d}:where(.css-ed5zg0).ant-popover.ant-popover-red .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-orange{--antd-arrow-background-color: #fa8c16}:where(.css-ed5zg0).ant-popover.ant-popover-orange .ant-popover-inner{background-color:#fa8c16}:where(.css-ed5zg0).ant-popover.ant-popover-orange .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-yellow{--antd-arrow-background-color: #fadb14}:where(.css-ed5zg0).ant-popover.ant-popover-yellow .ant-popover-inner{background-color:#fadb14}:where(.css-ed5zg0).ant-popover.ant-popover-yellow .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-volcano{--antd-arrow-background-color: #fa541c}:where(.css-ed5zg0).ant-popover.ant-popover-volcano .ant-popover-inner{background-color:#fa541c}:where(.css-ed5zg0).ant-popover.ant-popover-volcano .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-geekblue{--antd-arrow-background-color: #2f54eb}:where(.css-ed5zg0).ant-popover.ant-popover-geekblue .ant-popover-inner{background-color:#2f54eb}:where(.css-ed5zg0).ant-popover.ant-popover-geekblue .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-lime{--antd-arrow-background-color: #a0d911}:where(.css-ed5zg0).ant-popover.ant-popover-lime .ant-popover-inner{background-color:#a0d911}:where(.css-ed5zg0).ant-popover.ant-popover-lime .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-gold{--antd-arrow-background-color: #faad14}:where(.css-ed5zg0).ant-popover.ant-popover-gold .ant-popover-inner{background-color:#faad14}:where(.css-ed5zg0).ant-popover.ant-popover-gold .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-zoom-big-enter,:where(.css-ed5zg0).ant-zoom-big-appear{animation-duration:.2s;animation-fill-mode:both;animation-play-state:paused}:where(.css-ed5zg0).ant-zoom-big-leave{animation-duration:.2s;animation-fill-mode:both;animation-play-state:paused}:where(.css-ed5zg0).ant-zoom-big-enter.ant-zoom-big-enter-active,:where(.css-ed5zg0).ant-zoom-big-appear.ant-zoom-big-appear-active{animation-name:css-ed5zg0-antZoomBigIn;animation-play-state:running}:where(.css-ed5zg0).ant-zoom-big-leave.ant-zoom-big-leave-active{animation-name:css-ed5zg0-antZoomBigOut;animation-play-state:running;pointer-events:none}:where(.css-ed5zg0).ant-zoom-big-enter,:where(.css-ed5zg0).ant-zoom-big-appear{transform:scale(0);opacity:0;animation-timing-function:cubic-bezier(.08,.82,.17,1)}:where(.css-ed5zg0).ant-zoom-big-enter-prepare,:where(.css-ed5zg0).ant-zoom-big-appear-prepare{transform:none}:where(.css-ed5zg0).ant-zoom-big-leave{animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.track-map .tooltip-container{pointer-events:none!important}.track-map .tooltip-container>*{pointer-events:initial}.g-expandable-pannel-wrap.collapsed .tooltip-container{display:none}.g-rc-tooltip{position:absolute!important}.g-rc-tooltip .g-rc-tooltip-arrow{height:10px}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import H from "../utils/JSAsyncLoader.mjs";
|
|
2
|
+
import { useState as d, useEffect as v } from "react";
|
|
3
|
+
function $(F) {
|
|
4
|
+
const [m, y] = d(!1), [D, b] = d(), [i, G] = d(), [g, L] = d(!1), [l, S] = d(), [r, M] = d([]), [c, V] = d(0);
|
|
5
|
+
function W(o) {
|
|
6
|
+
if (o.viewType != "3DView") {
|
|
7
|
+
console.error("bimface view type is not 3DView");
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
y(!0), l && N(o.viewToken);
|
|
11
|
+
}
|
|
12
|
+
const N = (o) => {
|
|
13
|
+
if (!D) {
|
|
14
|
+
let a = l, t = new window.Glodon.Bimface.Application.WebApplication3DConfig();
|
|
15
|
+
t.domElement = a, t.Toolbars = [];
|
|
16
|
+
const e = new window.Glodon.Bimface.Application.WebApplication3D(t);
|
|
17
|
+
e.addView(o), b(e);
|
|
18
|
+
const n = e.getViewer();
|
|
19
|
+
n.addEventListener(window.Glodon.Bimface.Viewer.Viewer3DEvent.ViewAdded, function() {
|
|
20
|
+
window.onresize = function() {
|
|
21
|
+
n.resize(document.documentElement.clientWidth, document.documentElement.clientHeight - 40);
|
|
22
|
+
}, n.setCameraAnimation(!1), n.render(), n.setNavigationMode(window.Glodon.Bimface.Viewer.NavigationMode3D.Walk), n.render(), L(!0);
|
|
23
|
+
}), n.addEventListener(window.Glodon.Bimface.Viewer.Viewer3DEvent.ModelAdded, () => {
|
|
24
|
+
V((f) => f + 1);
|
|
25
|
+
}), G(n);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
v(() => {
|
|
29
|
+
g && r.forEach((o) => {
|
|
30
|
+
i.loadModel({
|
|
31
|
+
viewToken: o
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
}, [g, r]), v(() => {
|
|
35
|
+
}, [c]), v(() => {
|
|
36
|
+
if (!l || !r.length)
|
|
37
|
+
return;
|
|
38
|
+
const o = r.pop();
|
|
39
|
+
o && A(o), M([...r]);
|
|
40
|
+
}, [l]);
|
|
41
|
+
function I(o) {
|
|
42
|
+
console.log(o);
|
|
43
|
+
}
|
|
44
|
+
function A(o) {
|
|
45
|
+
V(0);
|
|
46
|
+
const a = () => {
|
|
47
|
+
let t = new window.BimfaceSDKLoaderConfig();
|
|
48
|
+
t.viewToken = o, window.BimfaceSDKLoader.load(t, W, I);
|
|
49
|
+
};
|
|
50
|
+
if (!window.BimfaceSDKLoaderConfig) {
|
|
51
|
+
H("https://static.bimface.com/api/BimfaceSDKLoader/BimfaceSDKLoader@latest-release.js", a);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
a();
|
|
55
|
+
}
|
|
56
|
+
const K = (o, a) => {
|
|
57
|
+
if (!i || !g || !l) {
|
|
58
|
+
console.error("BIMFace viewer is not ready.");
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const t = l.getElementsByTagName("canvas")[0], e = document.createElement("canvas");
|
|
62
|
+
e.width = t.width, e.height = t.height;
|
|
63
|
+
const n = e.getContext("2d");
|
|
64
|
+
return n && (n.fillStyle = "#fff", n.fillRect(0, 0, e.width, e.height), n.drawImage(t, 0, 0, t.width, t.height)), e.toDataURL(o, a);
|
|
65
|
+
}, k = (o) => {
|
|
66
|
+
if (!i) {
|
|
67
|
+
console.error("viewer is not ready");
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (c && r.length + 1 === c || !r.length)
|
|
71
|
+
i.getAllModels().map((e) => i._models[e.modelId]).forEach((e) => {
|
|
72
|
+
let n = new window.Glodon.Web.Graphics.Color(o);
|
|
73
|
+
e.overrideAllComponentsColor && e.overrideAllComponentsColor(n);
|
|
74
|
+
}), i.enableWireframe(!0), i.getLightManager().getAllFillLights().forEach((e) => e.enableLight(!0)), i.render();
|
|
75
|
+
else {
|
|
76
|
+
console.error("viewer is not render complete");
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
}, x = (o) => {
|
|
80
|
+
if (i)
|
|
81
|
+
if (c && r.length + 1 === c || !r.length)
|
|
82
|
+
i.getAllModels().map((e) => i._models[e.modelId]).forEach((e) => {
|
|
83
|
+
Object.keys(o).forEach((n) => {
|
|
84
|
+
let f = [{
|
|
85
|
+
categoryId: n
|
|
86
|
+
}];
|
|
87
|
+
e.getComponentsByConditions(f, function(B) {
|
|
88
|
+
let w = new window.Glodon.Web.Graphics.Color(o[n]);
|
|
89
|
+
e.overrideComponentsColorById && e.overrideComponentsColorById(B, w);
|
|
90
|
+
}, function() {
|
|
91
|
+
window.alert("error");
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
}), i.enableWireframe(!1), i.getLightManager().getAllFillLights().forEach((e) => e.enableLight(!1)), i.render();
|
|
95
|
+
else {
|
|
96
|
+
console.error("viewer is not render complete");
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
function P(o, a, t) {
|
|
101
|
+
const e = i.getModel();
|
|
102
|
+
e == null || e.getBoundingBox(({
|
|
103
|
+
currentBoundingBox: n
|
|
104
|
+
}) => {
|
|
105
|
+
const f = n.max.x - n.min.x, B = n.max.y - n.min.y, w = f / B;
|
|
106
|
+
let p, u;
|
|
107
|
+
w > 1 ? (p = a.width, u = p / w) : (u = a.height, p = u * w);
|
|
108
|
+
const h = document.createElement("div");
|
|
109
|
+
h.setAttribute("style", `width: ${p}px;height: ${u}px`), document.body.appendChild(h);
|
|
110
|
+
const E = new window.Glodon.Bimface.Plugins.NavigationMap.MapViewerConfig();
|
|
111
|
+
E.domElement = h;
|
|
112
|
+
const T = new window.Glodon.Bimface.Plugins.NavigationMap.MapViewer(E), s = new window.Glodon.Bimface.Plugins.NavigationMap.NavigationMapConfig();
|
|
113
|
+
s.viewer = i, s.mapViewer = T, s.type = "SetProfile", s.height = o, s.successCallback = (R) => {
|
|
114
|
+
setTimeout(() => {
|
|
115
|
+
const C = new Image();
|
|
116
|
+
C.src = h.getElementsByTagName("image")[0].getAttribute("href") || "", C.onload = () => {
|
|
117
|
+
t(C);
|
|
118
|
+
};
|
|
119
|
+
}, 200);
|
|
120
|
+
}, new window.Glodon.Bimface.Plugins.NavigationMap.NavigationMap(s);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
BimfaceViewer: m && window.Glodon.Bimface.Viewer,
|
|
125
|
+
BimfaceSection: m && window.Glodon.Bimface.Plugins.Section,
|
|
126
|
+
BimfaceMark: m && window.Glodon.Bimface.Plugins.Marker3D,
|
|
127
|
+
BimfaceViewerEvents: m && window.Glodon.Bimface.Viewer.Viewer3DEvent,
|
|
128
|
+
viewer: i,
|
|
129
|
+
viewerAdded: g,
|
|
130
|
+
sDKLoaded: m,
|
|
131
|
+
loadedModelCount: c,
|
|
132
|
+
loadModels: (o) => {
|
|
133
|
+
if (o != null && o.length || console.error("viewTokens is Empty"), !i && l) {
|
|
134
|
+
const a = o[0];
|
|
135
|
+
A(a);
|
|
136
|
+
}
|
|
137
|
+
M(o);
|
|
138
|
+
},
|
|
139
|
+
setContainerDom: S,
|
|
140
|
+
getSnapshot: K,
|
|
141
|
+
setComponentsColorByCatgryId: x,
|
|
142
|
+
setAllComponentsColor: k,
|
|
143
|
+
navigationMapByHeight: P
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
export {
|
|
147
|
+
$ as useBimface
|
|
148
|
+
};
|