@baishuyun/ui-base 3.0.1 → 3.0.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.
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { n as e } from "./hooks-D1m8KgVM.js";
|
|
2
|
+
import { useEffect as t, useRef as n } from "react";
|
|
3
|
+
//#region src/components/Amap/AmapCircle/AmapCircle.tsx
|
|
4
|
+
function r(r) {
|
|
5
|
+
let { AMap: i, map: a, mapReady: o } = e(), { center: s, radius: c, options: l = {}, visible: u = !0, onMouseEnter: d, onMouseLeave: f } = r, p = n(null), m = c > 0, h = n({
|
|
6
|
+
center: s,
|
|
7
|
+
radius: c,
|
|
8
|
+
options: l
|
|
9
|
+
});
|
|
10
|
+
return h.current = {
|
|
11
|
+
center: s,
|
|
12
|
+
radius: c,
|
|
13
|
+
options: l
|
|
14
|
+
}, t(() => {
|
|
15
|
+
if (!i || !a || !o || p.current || !m) return;
|
|
16
|
+
let e = h.current, t = new i.Circle({
|
|
17
|
+
...e.options,
|
|
18
|
+
center: e.center,
|
|
19
|
+
radius: e.radius
|
|
20
|
+
});
|
|
21
|
+
return a.add(t), p.current = t, () => {
|
|
22
|
+
a.remove(t), p.current = null;
|
|
23
|
+
};
|
|
24
|
+
}, [
|
|
25
|
+
i,
|
|
26
|
+
m,
|
|
27
|
+
a,
|
|
28
|
+
o
|
|
29
|
+
]), t(() => {
|
|
30
|
+
p.current?.setCenter(s);
|
|
31
|
+
}, [s]), t(() => {
|
|
32
|
+
c > 0 && p.current?.setRadius(c);
|
|
33
|
+
}, [c]), t(() => {
|
|
34
|
+
let e = p.current;
|
|
35
|
+
e && (u ? e.show?.() : e.hide?.());
|
|
36
|
+
}, [u]), t(() => {
|
|
37
|
+
let e = p.current;
|
|
38
|
+
if (!e) return;
|
|
39
|
+
let t = () => ({
|
|
40
|
+
circle: e,
|
|
41
|
+
AMap: i,
|
|
42
|
+
map: a
|
|
43
|
+
}), n = () => d?.(t()), r = () => f?.(t());
|
|
44
|
+
return e.on("mouseover", n), e.on("mouseout", r), () => {
|
|
45
|
+
e.off("mouseover", n), e.off("mouseout", r);
|
|
46
|
+
};
|
|
47
|
+
}, [
|
|
48
|
+
i,
|
|
49
|
+
a,
|
|
50
|
+
d,
|
|
51
|
+
f
|
|
52
|
+
]), null;
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
export { r as t };
|
package/dist/Amap/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import "./AmapContext-JaYk1a3H.js";
|
|
|
4
4
|
import { t as e } from "./AmapProvider-CWbRK6QL.js";
|
|
5
5
|
import { t } from "./Amap-DL5dLiUm.js";
|
|
6
6
|
import { n, t as r } from "./hooks-D1m8KgVM.js";
|
|
7
|
-
import { t as i } from "./AmapCircle-
|
|
7
|
+
import { t as i } from "./AmapCircle-COjtl-XB.js";
|
|
8
8
|
import "./useMarkerInfoWindowController-CRgf2I0Q.js";
|
|
9
9
|
import { t as a } from "./AmapMarker-DYW0-8Hd.js";
|
|
10
10
|
import { t as o } from "./AmapMarkerCluster-BRVHHMbi.js";
|
|
@@ -135,8 +135,6 @@ export type AmapCircleProps = {
|
|
|
135
135
|
radius: number;
|
|
136
136
|
options?: Record<string, any>;
|
|
137
137
|
visible?: boolean;
|
|
138
|
-
onReady?: (ctx: AmapCircleEventContext) => void;
|
|
139
|
-
onClick?: (ctx: AmapCircleEventContext) => void;
|
|
140
138
|
onMouseEnter?: (ctx: AmapCircleEventContext) => void;
|
|
141
139
|
onMouseLeave?: (ctx: AmapCircleEventContext) => void;
|
|
142
140
|
};
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import "./Amap/AmapContext-JaYk1a3H.js";
|
|
|
5
5
|
import { t as o } from "./Amap/AmapProvider-CWbRK6QL.js";
|
|
6
6
|
import { t as s } from "./Amap/Amap-DL5dLiUm.js";
|
|
7
7
|
import { n as c, t as l } from "./Amap/hooks-D1m8KgVM.js";
|
|
8
|
-
import { t as u } from "./Amap/AmapCircle-
|
|
8
|
+
import { t as u } from "./Amap/AmapCircle-COjtl-XB.js";
|
|
9
9
|
import "./Amap/useMarkerInfoWindowController-CRgf2I0Q.js";
|
|
10
10
|
import { t as d } from "./Amap/AmapMarker-DYW0-8Hd.js";
|
|
11
11
|
import { t as f } from "./Amap/AmapMarkerCluster-BRVHHMbi.js";
|
package/package.json
CHANGED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { n as e } from "./hooks-D1m8KgVM.js";
|
|
2
|
-
import { useEffect as t, useRef as n } from "react";
|
|
3
|
-
//#region src/components/Amap/AmapCircle/AmapCircle.tsx
|
|
4
|
-
function r(r) {
|
|
5
|
-
let { AMap: i, map: a, mapReady: o } = e(), { center: s, radius: c, options: l = {}, visible: u = !0, onReady: d, onClick: f, onMouseEnter: p, onMouseLeave: m } = r, h = n(null), g = c > 0, _ = n({
|
|
6
|
-
center: s,
|
|
7
|
-
radius: c,
|
|
8
|
-
options: l,
|
|
9
|
-
onReady: d
|
|
10
|
-
});
|
|
11
|
-
return _.current = {
|
|
12
|
-
center: s,
|
|
13
|
-
radius: c,
|
|
14
|
-
options: l,
|
|
15
|
-
onReady: d
|
|
16
|
-
}, t(() => {
|
|
17
|
-
if (!i || !a || !o || h.current || !g) return;
|
|
18
|
-
let e = _.current, t = new i.Circle({
|
|
19
|
-
...e.options,
|
|
20
|
-
center: e.center,
|
|
21
|
-
radius: e.radius
|
|
22
|
-
});
|
|
23
|
-
return a.add(t), h.current = t, e.onReady?.({
|
|
24
|
-
circle: t,
|
|
25
|
-
AMap: i,
|
|
26
|
-
map: a
|
|
27
|
-
}), () => {
|
|
28
|
-
a.remove(t), h.current = null;
|
|
29
|
-
};
|
|
30
|
-
}, [
|
|
31
|
-
i,
|
|
32
|
-
g,
|
|
33
|
-
a,
|
|
34
|
-
o
|
|
35
|
-
]), t(() => {
|
|
36
|
-
h.current?.setCenter(s);
|
|
37
|
-
}, [s]), t(() => {
|
|
38
|
-
c > 0 && h.current?.setRadius(c);
|
|
39
|
-
}, [c]), t(() => {
|
|
40
|
-
let e = h.current;
|
|
41
|
-
e && (u ? e.show?.() : e.hide?.());
|
|
42
|
-
}, [u]), t(() => {
|
|
43
|
-
let e = h.current;
|
|
44
|
-
if (!e) return;
|
|
45
|
-
let t = () => ({
|
|
46
|
-
circle: e,
|
|
47
|
-
AMap: i,
|
|
48
|
-
map: a
|
|
49
|
-
}), n = () => f?.(t()), r = () => p?.(t()), o = () => m?.(t());
|
|
50
|
-
return e.on("click", n), e.on("mouseover", r), e.on("mouseout", o), () => {
|
|
51
|
-
e.off("click", n), e.off("mouseover", r), e.off("mouseout", o);
|
|
52
|
-
};
|
|
53
|
-
}, [
|
|
54
|
-
i,
|
|
55
|
-
a,
|
|
56
|
-
f,
|
|
57
|
-
p,
|
|
58
|
-
m
|
|
59
|
-
]), null;
|
|
60
|
-
}
|
|
61
|
-
//#endregion
|
|
62
|
-
export { r as t };
|