@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,70 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
import "./style.less.mjs";
|
|
14
|
+
const f = {
|
|
15
|
+
stroke: "rgba(255, 77, 79, 0.25)",
|
|
16
|
+
strokeWidth: 1
|
|
17
|
+
}, k = (e) => {
|
|
18
|
+
const {
|
|
19
|
+
style: s,
|
|
20
|
+
passes: t,
|
|
21
|
+
scale: o,
|
|
22
|
+
activePassId: y,
|
|
23
|
+
passStyle: d,
|
|
24
|
+
activePassStyle: m
|
|
25
|
+
} = e;
|
|
26
|
+
return /* @__PURE__ */ l("svg", {
|
|
27
|
+
className: "pass-map",
|
|
28
|
+
style: s,
|
|
29
|
+
children: t.map((r, u) => {
|
|
30
|
+
var c;
|
|
31
|
+
const v = r.id === y ? m : f;
|
|
32
|
+
return /* @__PURE__ */ l("g", {
|
|
33
|
+
children: /* @__PURE__ */ l("polygon", {
|
|
34
|
+
points: (c = r.points) == null ? void 0 : c.map((i) => `${i.x * o} ${i.y * o}`).join(","),
|
|
35
|
+
style: a(a(a({}, d), r.passStyle), v)
|
|
36
|
+
})
|
|
37
|
+
}, u);
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
k as default
|
|
43
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as s, Fragment as O } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as R, useState as m, useEffect as p, useMemo as g } from "react";
|
|
3
|
+
import { diff as x } from "deep-object-diff";
|
|
4
|
+
import C from "./PointTooltip.mjs";
|
|
5
|
+
import P from "lodash/debounce";
|
|
6
|
+
const D = {
|
|
7
|
+
attributes: !0,
|
|
8
|
+
characterData: !0
|
|
9
|
+
}, F = (t) => {
|
|
10
|
+
const o = R(null), {
|
|
11
|
+
point: e,
|
|
12
|
+
open: h,
|
|
13
|
+
id: y,
|
|
14
|
+
x: n,
|
|
15
|
+
y: r,
|
|
16
|
+
r: i,
|
|
17
|
+
active: v = !1,
|
|
18
|
+
hidden: b = !1,
|
|
19
|
+
onPointClick: a,
|
|
20
|
+
getTooltipContainer: T
|
|
21
|
+
} = t, [c, k] = m(t.style), [w, u] = m(!0);
|
|
22
|
+
p(() => {
|
|
23
|
+
const l = x(c, t.style);
|
|
24
|
+
Object.keys(l).length && k(t.style);
|
|
25
|
+
}, [t.style]);
|
|
26
|
+
const f = g(() => /* @__PURE__ */ s("circle", {
|
|
27
|
+
id: `mark-${y}`,
|
|
28
|
+
className: "point point-active",
|
|
29
|
+
cx: n,
|
|
30
|
+
cy: r,
|
|
31
|
+
r: i,
|
|
32
|
+
ref: o,
|
|
33
|
+
style: c,
|
|
34
|
+
onClick: () => a && a(e)
|
|
35
|
+
}), [n, r, i, c, v]), d = g(() => {
|
|
36
|
+
const l = P(() => {
|
|
37
|
+
u(!0), console.log("show tooltip", e.id), console.log((/* @__PURE__ */ new Date()).valueOf());
|
|
38
|
+
}, 200);
|
|
39
|
+
return new MutationObserver(() => {
|
|
40
|
+
console.log("circle is changed"), console.log("hide tooltip", e.id), console.log((/* @__PURE__ */ new Date()).valueOf()), u(!1), l();
|
|
41
|
+
});
|
|
42
|
+
}, []);
|
|
43
|
+
return p(() => {
|
|
44
|
+
if (!(!o.current || !e.tooltipRender))
|
|
45
|
+
return d.observe(o.current, D), () => {
|
|
46
|
+
o.current && d.disconnect();
|
|
47
|
+
};
|
|
48
|
+
}, [n, r, i]), b ? /* @__PURE__ */ s(O, {}) : e.tooltipRender && w ? /* @__PURE__ */ s(C, {
|
|
49
|
+
open: h,
|
|
50
|
+
point: e,
|
|
51
|
+
getPopupContainer: T,
|
|
52
|
+
children: f
|
|
53
|
+
}) : f;
|
|
54
|
+
};
|
|
55
|
+
export {
|
|
56
|
+
F as default
|
|
57
|
+
};
|