@baishuyun/ui-base 3.0.2 → 6.1.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/Amap/AmapCircle/index.js +1 -1
- package/dist/Amap/{AmapCircle-COjtl-XB.js → AmapCircle-mh92P2l6.js} +1 -1
- package/dist/Amap/AmapProvider/index.js +2 -2
- package/dist/Amap/{AmapProvider-CWbRK6QL.js → AmapProvider-H1GNfMdk.js} +1 -1
- package/dist/Amap/index.js +3 -3
- package/dist/Card/{Card-D__c94yx.js → Card-CRrtIjNT.js} +1 -1
- package/dist/Card/index.js +2 -2
- package/dist/CheckBox/{CheckBox-DF201Nxg.js → CheckBox-BsihF-AN.js} +1 -1
- package/dist/CheckBox/{CheckBox-B04hZKaC.js → CheckBox-D1aeCoQb.js} +1 -1
- package/dist/CheckBox/index.js +3 -3
- package/dist/ColorPicker/{ColorPicker-B-KaMDAn.js → ColorPicker-CFKvAzYa.js} +8 -8
- package/dist/ColorPicker/index.js +2 -2
- package/dist/ConfigProvider/index.js +1 -1
- package/dist/DropDown/{DropDown-CMKiQDrc.js → DropDown-DNEQ5nQz.js} +1 -1
- package/dist/DropDown/index.js +3 -3
- package/dist/Editor/{Buttons-CZOTyAPL.js → Buttons-0qZ4g7Ig.js} +30 -30
- package/dist/Editor/ToolbarPlugin/Buttons/index.js +8 -8
- package/dist/Editor/index.js +8 -8
- package/dist/Icon/{Icon-CTZCSuVg.js → Icon-BQ3Whub2.js} +1 -1
- package/dist/Icon/index.js +1 -1
- package/dist/InputTag/{InputTag-F2Dv-r56.js → InputTag-DcVn_bRl.js} +1 -1
- package/dist/InputTag/index.js +2 -2
- package/dist/Modal/{Modal-CuDbh_WD.js → Modal-B5AW5GKt.js} +39 -30
- package/dist/Modal/index.js +2 -2
- package/dist/Segmented/{Segmented-Byw8j1hQ.js → Segmented-DkhT5_Ty.js} +36 -25
- package/dist/Segmented/index.js +1 -1
- package/dist/Select/{Select-xuQGK6It.js → Select-BSPmsIMh.js} +16 -17
- package/dist/Select/{SelectInputSearch-Dm3CI_L4.js → SelectInputSearch-Cj9Uubc4.js} +2 -2
- package/dist/Select/index.js +6 -6
- package/dist/Tabs/{Tabs-Cxf7jwys.js → Tabs-BVSzo2qS.js} +1 -1
- package/dist/Tabs/index.js +2 -2
- package/dist/Tree/index.js +3 -3
- package/dist/components/Amap/Amap.d.ts +1 -1
- package/dist/components/Amap/{interface.d.ts → Amap.type.d.ts} +187 -2
- package/dist/components/Amap/AmapCircle/AmapCircle.d.ts +1 -1
- package/dist/components/Amap/AmapMarker/AmapMarker.d.ts +1 -1
- package/dist/components/Amap/AmapMarker/useMarkerInfoWindow.d.ts +1 -1
- package/dist/components/Amap/AmapMarker/useMarkerInfoWindowController.d.ts +1 -1
- package/dist/components/Amap/AmapMarkerCluster/AmapMarkerCluster.d.ts +1 -1
- package/dist/components/Amap/AmapMarkerCluster/AmapMarkerCluster.type.d.ts +1 -1
- package/dist/components/Amap/AmapMarkerCluster/utils.d.ts +1 -1
- package/dist/components/Amap/AmapProvider/AmapProvider.d.ts +1 -1
- package/dist/components/Amap/context/AmapContext.d.ts +1 -1
- package/dist/components/Amap/hooks/useAmap.d.ts +1 -1
- package/dist/components/Amap/hooks/useCurrentLocation.d.ts +1 -1
- package/dist/components/Amap/index.d.ts +1 -1
- package/dist/components/Amap/utils/currentLocation.d.ts +1 -1
- package/dist/components/ConfigProvider/ConfigProvider.type.d.ts +1 -0
- package/dist/components/Modal/Modal.type.d.ts +4 -0
- package/dist/components/Segmented/Segmented.type.d.ts +4 -0
- package/dist/components/index.d.ts +1 -1
- package/dist/components/theme.d.ts +6 -0
- package/dist/index.js +25 -51
- package/dist/style.css +1 -1
- package/dist/{ConfigProvider/ConfigProvider-Bx-uxnns.js → vendors/ConfigProvider-Bd6SRQtO.js} +93 -22
- package/dist/vendors/{Tree-Bg2UzLsC.js → Tree-D7ZZAwIg.js} +2 -2
- package/package.json +6 -10
- package/dist/locale/LocaleProvider.d.ts +0 -9
- /package/dist/locale/__tests__/{LocaleProvider.test.d.ts → locale.test.d.ts} +0 -0
|
@@ -13,50 +13,61 @@ var l = {
|
|
|
13
13
|
"bsy-segmented__item--active": "_bsy-segmented__item--active_ia83v_44",
|
|
14
14
|
"bsy-segmented__item--inactive": "_bsy-segmented__item--inactive_ia83v_48",
|
|
15
15
|
"bsy-segmented__slider": "_bsy-segmented__slider_ia83v_53"
|
|
16
|
-
}, u =
|
|
17
|
-
|
|
16
|
+
}, u = {
|
|
17
|
+
type: "spring",
|
|
18
|
+
stiffness: 350,
|
|
19
|
+
damping: 35
|
|
20
|
+
}, d = { duration: 0 }, f = (f) => {
|
|
21
|
+
let { options: p, block: m = !1, disabled: h = !1, enableAnimation: g = !1 } = f, [_, v] = s(f), [y, b] = a({
|
|
18
22
|
width: 0,
|
|
19
23
|
left: 0
|
|
20
|
-
}),
|
|
21
|
-
let e =
|
|
24
|
+
}), x = i(null), S = i(/* @__PURE__ */ new Map()), C = i(!1), w = n(() => {
|
|
25
|
+
let e = S.current.get(_), t = x.current;
|
|
22
26
|
if (e && t) {
|
|
23
27
|
let n = t.getBoundingClientRect(), r = e.getBoundingClientRect();
|
|
24
|
-
|
|
28
|
+
b({
|
|
25
29
|
width: r.width,
|
|
26
30
|
left: r.left - n.left
|
|
27
31
|
});
|
|
28
32
|
}
|
|
29
|
-
}, [
|
|
33
|
+
}, [_]);
|
|
30
34
|
return r(() => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
if (g && C.current) {
|
|
36
|
+
let e = requestAnimationFrame(() => {
|
|
37
|
+
w();
|
|
38
|
+
});
|
|
39
|
+
return () => cancelAnimationFrame(e);
|
|
40
|
+
}
|
|
41
|
+
w();
|
|
42
|
+
}, [
|
|
43
|
+
_,
|
|
44
|
+
g,
|
|
45
|
+
w
|
|
46
|
+
]), r(() => {
|
|
47
|
+
let e = new ResizeObserver(w);
|
|
48
|
+
return x.current && e.observe(x.current), () => {
|
|
34
49
|
e.disconnect();
|
|
35
50
|
};
|
|
36
|
-
}, [
|
|
37
|
-
ref:
|
|
38
|
-
className: o(l["bsy-segmented"],
|
|
39
|
-
style:
|
|
51
|
+
}, [w]), /* @__PURE__ */ t("div", {
|
|
52
|
+
ref: x,
|
|
53
|
+
className: o(l["bsy-segmented"], m && l["bsy-segmented--block"]),
|
|
54
|
+
style: m ? { gridTemplateColumns: `repeat(${p.length}, 1fr)` } : void 0,
|
|
40
55
|
children: [/* @__PURE__ */ e(c.div, {
|
|
41
56
|
className: l["bsy-segmented__slider"],
|
|
42
|
-
animate:
|
|
43
|
-
transition:
|
|
44
|
-
|
|
45
|
-
stiffness: 350,
|
|
46
|
-
damping: 35
|
|
47
|
-
} : { duration: 0 }
|
|
48
|
-
}), d.map((t) => /* @__PURE__ */ e("button", {
|
|
57
|
+
animate: y,
|
|
58
|
+
transition: g && C.current ? u : d
|
|
59
|
+
}), p.map((t) => /* @__PURE__ */ e("button", {
|
|
49
60
|
ref: (e) => {
|
|
50
|
-
e ?
|
|
61
|
+
e ? S.current.set(t.value, e) : S.current.delete(t.value);
|
|
51
62
|
},
|
|
52
63
|
onClick: () => {
|
|
53
|
-
|
|
64
|
+
h || (g && t.value !== _ && (C.current = !0), v(t.value));
|
|
54
65
|
},
|
|
55
|
-
className: o(l["bsy-segmented__item"],
|
|
66
|
+
className: o(l["bsy-segmented__item"], m && l["bsy-segmented__item--block"], _ === t.value ? l["bsy-segmented__item--active"] : l["bsy-segmented__item--inactive"], { [l["bsy-segmented__item--disabled"]]: h }),
|
|
56
67
|
children: t.label
|
|
57
68
|
}, t.value))]
|
|
58
69
|
});
|
|
59
70
|
};
|
|
60
|
-
|
|
71
|
+
f.displayName = "BsySegmented";
|
|
61
72
|
//#endregion
|
|
62
|
-
export {
|
|
73
|
+
export { f as t };
|
package/dist/Segmented/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "./Segmented-
|
|
1
|
+
import { t as e } from "./Segmented-DkhT5_Ty.js";
|
|
2
2
|
export { e as default };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { t as e } from "../Icon/Icon-
|
|
1
|
+
import { t as e } from "../Icon/Icon-BQ3Whub2.js";
|
|
2
2
|
import { t } from "../vendors/useLocale-Mk0d7wNt.js";
|
|
3
3
|
import { n, t as r } from "../vendors/animations-C2i5EijE.js";
|
|
4
|
-
import { t as i } from "./SelectInputSearch-
|
|
5
|
-
import { n as a, t as o } from "../vendors/Tree-
|
|
6
|
-
import { t as s } from "../CheckBox/CheckBox-
|
|
4
|
+
import { t as i } from "./SelectInputSearch-Cj9Uubc4.js";
|
|
5
|
+
import { n as a, t as o } from "../vendors/Tree-D7ZZAwIg.js";
|
|
6
|
+
import { t as s } from "../CheckBox/CheckBox-D1aeCoQb.js";
|
|
7
7
|
import { t as c } from "../NotFoundContent/NotFoundContent-DJUQ0_2D.js";
|
|
8
8
|
import { t as l } from "../vendors/useFloatingPortal-CDgiCnbb.js";
|
|
9
9
|
import { first as u, isArray as d, isEmpty as f, isNil as p, noop as m } from "lodash-es";
|
|
10
10
|
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
11
11
|
import { Suspense as v, createContext as y, forwardRef as b, memo as x, useCallback as S, useContext as C, useDeferredValue as w, useId as T, useImperativeHandle as E, useLayoutEffect as D, useMemo as O, useRef as k, useState as A } from "react";
|
|
12
|
+
import { Input as ee } from "antd";
|
|
12
13
|
import j from "clsx";
|
|
13
|
-
import { useControllableValue as
|
|
14
|
-
import { Input as M } from "antd";
|
|
14
|
+
import { useControllableValue as te, useHover as M, useToggle as ne } from "ahooks";
|
|
15
15
|
import { AnimatePresence as re, motion as N } from "motion/react";
|
|
16
16
|
import { FloatingPortal as ie } from "@floating-ui/react";
|
|
17
17
|
import P from "fuse.js";
|
|
@@ -89,10 +89,10 @@ H.displayName = "BsySelectSingleInput";
|
|
|
89
89
|
//#endregion
|
|
90
90
|
//#region src/components/Select/SelectInput/SelectMultipleInput/OptionTag/option-tag.module.scss
|
|
91
91
|
var U = {
|
|
92
|
-
"bsy-input-tag__container": "_bsy-input-
|
|
93
|
-
"bsy-input-tag__item": "_bsy-input-
|
|
94
|
-
"bsy-input-tag__item--disabled": "_bsy-input-tag__item--
|
|
95
|
-
"bsy-input-tag__item-icon": "_bsy-input-tag__item-
|
|
92
|
+
"bsy-input-tag__container": "_bsy-input-tag__container_znvs6_1",
|
|
93
|
+
"bsy-input-tag__item": "_bsy-input-tag__item_znvs6_7",
|
|
94
|
+
"bsy-input-tag__item--disabled": "_bsy-input-tag__item--disabled_znvs6_20",
|
|
95
|
+
"bsy-input-tag__item-icon": "_bsy-input-tag__item-icon_znvs6_24"
|
|
96
96
|
}, W = b(({ children: e, style: t, disabled: n }, r) => /* @__PURE__ */ g("div", {
|
|
97
97
|
"data-bsy-input-tag": "true",
|
|
98
98
|
className: j({
|
|
@@ -146,7 +146,7 @@ var G = "_select_multiple_input__container_8pd2n_1", K = "_select_multiple_input
|
|
|
146
146
|
children: /* @__PURE__ */ _(W.Container, { children: [n?.map((t, n) => {
|
|
147
147
|
let a = (t) => /* @__PURE__ */ g("div", {
|
|
148
148
|
style: t,
|
|
149
|
-
className: "bsy-input-tag__item-icon cursor-pointer",
|
|
149
|
+
className: j(U["bsy-input-tag__item-icon"], "cursor-pointer"),
|
|
150
150
|
children: /* @__PURE__ */ g(e, {
|
|
151
151
|
name: "close",
|
|
152
152
|
style: { fontSize: 12 },
|
|
@@ -178,7 +178,7 @@ var G = "_select_multiple_input__container_8pd2n_1", K = "_select_multiple_input
|
|
|
178
178
|
children: [v, /* @__PURE__ */ _(W.Container, { children: [n?.slice(0, u).map((t, n) => {
|
|
179
179
|
let a = (n) => /* @__PURE__ */ g("div", {
|
|
180
180
|
style: n,
|
|
181
|
-
className: j("bsy-input-tag__item-icon", {
|
|
181
|
+
className: j(U["bsy-input-tag__item-icon"], {
|
|
182
182
|
[Y.select_multiple_input__close_btn]: !s,
|
|
183
183
|
[Y.select_multiple_input__close_btn + "--disabled"]: s
|
|
184
184
|
}),
|
|
@@ -225,7 +225,7 @@ var Q = (e, t) => {
|
|
|
225
225
|
};
|
|
226
226
|
return r(e), n;
|
|
227
227
|
}, ue = ({ placeholder: t, mode: n, clearable: i, onClear: a, disabled: o = !1, labelRender: s, options: c = [], type: l, prefix: u, suffixIcon: f, ghost: m, inputValueStyle: v, tagStyle: y }) => {
|
|
228
|
-
let b = k(null), x =
|
|
228
|
+
let b = k(null), x = M(o ? null : b), { isOpen: S, value: C, getCachedOptionByValue: w } = R(), { fieldNames: T } = z(), E = O(() => {
|
|
229
229
|
if (p(C)) return [];
|
|
230
230
|
let e = d(C) ? C : [C];
|
|
231
231
|
if (l === L.TREE) {
|
|
@@ -331,7 +331,7 @@ var $ = x((e) => {
|
|
|
331
331
|
className: "ml-2 flex-1",
|
|
332
332
|
onClick: (e) => e.stopPropagation(),
|
|
333
333
|
style: { minWidth: "146px" },
|
|
334
|
-
children: /* @__PURE__ */ g(
|
|
334
|
+
children: /* @__PURE__ */ g(ee, {
|
|
335
335
|
ref: m,
|
|
336
336
|
value: u,
|
|
337
337
|
onChange: (e) => {
|
|
@@ -384,7 +384,6 @@ var de = (e) => {
|
|
|
384
384
|
return /* @__PURE__ */ g("li", {
|
|
385
385
|
className: j("flex items-center gap-[8px] min-h-[34px]", "cursor-pointer rounded-[4px]", "bsy-multiple-select-item", {
|
|
386
386
|
"hover:bg-[#f3f3f3]": !0,
|
|
387
|
-
"text-[#0265ff]": o,
|
|
388
387
|
"text-[#4d609f]": c && !o
|
|
389
388
|
}),
|
|
390
389
|
children: /* @__PURE__ */ g(s, {
|
|
@@ -526,7 +525,7 @@ ge.displayName = "BsySelectPanel";
|
|
|
526
525
|
//#endregion
|
|
527
526
|
//#region src/components/Select/Select.tsx
|
|
528
527
|
var _e = b((e, n) => {
|
|
529
|
-
let { options: r = [], type: i = L.SINGLE, fieldNames: a, clearable: o = !0, disabled: s = !1, placeholder: c, labelRender: u, onOtherInputChange: d, onOpenChange: f, onPopupScroll: p, prefix: m, suffixIcon: v, ghost: y, inputValueStyle: b, tagStyle: x, zIndex: C = 1101, zIndexMask: w = 1100, otherInputPosition: D = "bottom", popupMinWidth:
|
|
528
|
+
let { options: r = [], type: i = L.SINGLE, fieldNames: a, clearable: o = !0, disabled: s = !1, placeholder: c, labelRender: u, onOtherInputChange: d, onOpenChange: f, onPopupScroll: p, prefix: m, suffixIcon: v, ghost: y, inputValueStyle: b, tagStyle: x, zIndex: C = 1101, zIndexMask: w = 1100, otherInputPosition: D = "bottom", popupMinWidth: ee } = e, M = ae[i], { t: N } = t(), P = T(), { onChange: F } = e, R = a || oe, [z, B] = te(e, {
|
|
530
529
|
defaultValue: M === I.SINGLE ? void 0 : [],
|
|
531
530
|
defaultValuePropName: "defaultValue",
|
|
532
531
|
valuePropName: "value",
|
|
@@ -633,7 +632,7 @@ var _e = b((e, n) => {
|
|
|
633
632
|
showMask: e.showMask,
|
|
634
633
|
zIndex: C,
|
|
635
634
|
zIndexMask: w,
|
|
636
|
-
popupMinWidth:
|
|
635
|
+
popupMinWidth: ee,
|
|
637
636
|
offset: {
|
|
638
637
|
x: 0,
|
|
639
638
|
y: 4
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "../Icon/Icon-
|
|
1
|
+
import { t as e } from "../Icon/Icon-BQ3Whub2.js";
|
|
2
2
|
import { t } from "../vendors/useLocale-Mk0d7wNt.js";
|
|
3
3
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/Select/SelectInputSearch/SelectInputSearch.tsx
|
|
@@ -35,7 +35,7 @@ var i = (i) => {
|
|
|
35
35
|
onClick: () => c?.(""),
|
|
36
36
|
role: "button",
|
|
37
37
|
"aria-label": "clear search",
|
|
38
|
-
children: /* @__PURE__ */ n(e, { name: "
|
|
38
|
+
children: /* @__PURE__ */ n(e, { name: "empty" })
|
|
39
39
|
})
|
|
40
40
|
]
|
|
41
41
|
})
|
package/dist/Select/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import "../Icon/Icon-
|
|
1
|
+
import "../Icon/Icon-BQ3Whub2.js";
|
|
2
2
|
import "../vendors/LocaleContext-Jj_JGgi2.js";
|
|
3
3
|
import "../vendors/useLocale-Mk0d7wNt.js";
|
|
4
|
-
import { n as e, r as t, t as n } from "./Select-
|
|
5
|
-
import "./SelectInputSearch-
|
|
6
|
-
import "../vendors/Tree-
|
|
7
|
-
import "../CheckBox/CheckBox-
|
|
8
|
-
import "../CheckBox/CheckBox-
|
|
4
|
+
import { n as e, r as t, t as n } from "./Select-BSPmsIMh.js";
|
|
5
|
+
import "./SelectInputSearch-Cj9Uubc4.js";
|
|
6
|
+
import "../vendors/Tree-D7ZZAwIg.js";
|
|
7
|
+
import "../CheckBox/CheckBox-BsihF-AN.js";
|
|
8
|
+
import "../CheckBox/CheckBox-D1aeCoQb.js";
|
|
9
9
|
import "../Radio/Radio-WNw-VqIS.js";
|
|
10
10
|
import "../NotFoundContent/NotFoundContent-DJUQ0_2D.js";
|
|
11
11
|
import "../vendors/useFloatingPortal-CDgiCnbb.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "../Icon/Icon-
|
|
1
|
+
import { t as e } from "../Icon/Icon-BQ3Whub2.js";
|
|
2
2
|
import { n as t } from "../vendors/color-CxdZwdYM.js";
|
|
3
3
|
import { n } from "../vendors/animations-C2i5EijE.js";
|
|
4
4
|
import { t as r } from "../vendors/useFloatingPortal-CDgiCnbb.js";
|
package/dist/Tabs/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../Icon/Icon-
|
|
1
|
+
import "../Icon/Icon-BQ3Whub2.js";
|
|
2
2
|
import "../vendors/color-CxdZwdYM.js";
|
|
3
3
|
import "../vendors/useFloatingPortal-CDgiCnbb.js";
|
|
4
|
-
import { i as e, n as t, r as n, t as r } from "./Tabs-
|
|
4
|
+
import { i as e, n as t, r as n, t as r } from "./Tabs-BVSzo2qS.js";
|
|
5
5
|
export { e as TABS_TYPE, n as TabPanel, r as TabSelect, t as default };
|
package/dist/Tree/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../Icon/Icon-
|
|
2
|
-
import { t as e } from "../vendors/Tree-
|
|
3
|
-
import "../CheckBox/CheckBox-
|
|
1
|
+
import "../Icon/Icon-BQ3Whub2.js";
|
|
2
|
+
import { t as e } from "../vendors/Tree-D7ZZAwIg.js";
|
|
3
|
+
import "../CheckBox/CheckBox-BsihF-AN.js";
|
|
4
4
|
import "../Radio/Radio-WNw-VqIS.js";
|
|
5
5
|
export { e as Tree };
|
|
@@ -1,14 +1,45 @@
|
|
|
1
1
|
/// <reference path="amap-types.d.ts" />
|
|
2
|
-
import {
|
|
2
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
3
3
|
export type LngLat = [number, number];
|
|
4
4
|
export type AmapLoaderStatus = 'idle' | 'loading' | 'success' | 'error';
|
|
5
5
|
export type AmapProviderProps = {
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* 高德地图应用 Key,未传时读取全局 ConfigProvider 中的 amap.key
|
|
9
|
+
*/
|
|
6
10
|
amapKey?: string;
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* 高德地图安全密钥,未传时读取全局 ConfigProvider 中的 amap.securityJsCode
|
|
14
|
+
*/
|
|
7
15
|
securityJsCode?: string;
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* 高德地图 JSAPI 版本号,未传时读取全局 ConfigProvider 中的 amap.version
|
|
19
|
+
*/
|
|
8
20
|
version?: string;
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* 需要额外加载的高德地图插件列表
|
|
24
|
+
* @default []
|
|
25
|
+
*/
|
|
9
26
|
plugins?: string[];
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* 地图资源加载中的占位内容
|
|
30
|
+
* @default null
|
|
31
|
+
*/
|
|
10
32
|
fallback?: ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* 地图资源加载失败时的占位内容或自定义渲染函数
|
|
36
|
+
* @default null
|
|
37
|
+
*/
|
|
11
38
|
errorFallback?: ReactNode | ((error: Error) => ReactNode);
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
* Provider 包裹的地图内容
|
|
42
|
+
*/
|
|
12
43
|
children?: ReactNode;
|
|
13
44
|
};
|
|
14
45
|
export type AmapProviderContextValue = {
|
|
@@ -19,16 +50,49 @@ export type AmapProviderContextValue = {
|
|
|
19
50
|
plugins: string[];
|
|
20
51
|
};
|
|
21
52
|
export type AmapProps = {
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
* 地图中心点坐标
|
|
56
|
+
*/
|
|
22
57
|
center?: LngLat;
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* 地图缩放级别
|
|
61
|
+
*/
|
|
23
62
|
zoom?: number;
|
|
24
|
-
|
|
63
|
+
/**
|
|
64
|
+
*
|
|
65
|
+
* 透传给 AMap.Map 的初始化配置
|
|
66
|
+
* @default {}
|
|
67
|
+
*/
|
|
68
|
+
options?: AMap.Map;
|
|
69
|
+
/**
|
|
70
|
+
*
|
|
71
|
+
* 地图容器自定义类名
|
|
72
|
+
*/
|
|
25
73
|
className?: string;
|
|
74
|
+
/**
|
|
75
|
+
*
|
|
76
|
+
* 地图容器自定义样式
|
|
77
|
+
*/
|
|
26
78
|
style?: CSSProperties;
|
|
79
|
+
/**
|
|
80
|
+
*
|
|
81
|
+
* 地图子组件,例如标记、圆形覆盖物、聚合标记
|
|
82
|
+
*/
|
|
27
83
|
children?: ReactNode;
|
|
84
|
+
/**
|
|
85
|
+
*
|
|
86
|
+
* 地图实例创建完成后的回调
|
|
87
|
+
*/
|
|
28
88
|
onReady?: (ctx: {
|
|
29
89
|
AMap: typeof AMap;
|
|
30
90
|
map: AMap.Map;
|
|
31
91
|
}) => void;
|
|
92
|
+
/**
|
|
93
|
+
*
|
|
94
|
+
* 地图初始化或事件绑定异常时的回调
|
|
95
|
+
*/
|
|
32
96
|
onError?: (error: Error) => void;
|
|
33
97
|
};
|
|
34
98
|
export type AmapContextValue = {
|
|
@@ -64,11 +128,36 @@ export type AmapMarkerInfoWindowOptions = {
|
|
|
64
128
|
options?: AmapMarkerInfoWindowNativeOptions;
|
|
65
129
|
};
|
|
66
130
|
export type AmapMarkerProps = {
|
|
131
|
+
/**
|
|
132
|
+
*
|
|
133
|
+
* 标记自定义内容
|
|
134
|
+
*/
|
|
67
135
|
content?: ReactNode;
|
|
136
|
+
/**
|
|
137
|
+
*
|
|
138
|
+
* 鼠标悬停时展示的信息窗配置
|
|
139
|
+
*/
|
|
68
140
|
infoWindow?: AmapMarkerInfoWindowOptions;
|
|
141
|
+
/**
|
|
142
|
+
*
|
|
143
|
+
* 透传给 AMap.Marker 的配置
|
|
144
|
+
* @default {}
|
|
145
|
+
*/
|
|
69
146
|
options?: AMap.MarkerOptions;
|
|
147
|
+
/**
|
|
148
|
+
*
|
|
149
|
+
* 标记点击回调
|
|
150
|
+
*/
|
|
70
151
|
onClick?: (ctx: AmapMarkerEventContext) => void;
|
|
152
|
+
/**
|
|
153
|
+
*
|
|
154
|
+
* 鼠标移入标记回调
|
|
155
|
+
*/
|
|
71
156
|
onMouseEnter?: (ctx: AmapMarkerEventContext) => void;
|
|
157
|
+
/**
|
|
158
|
+
*
|
|
159
|
+
* 鼠标移出标记回调
|
|
160
|
+
*/
|
|
72
161
|
onMouseLeave?: (ctx: AmapMarkerEventContext) => void;
|
|
73
162
|
};
|
|
74
163
|
export type AmapMarkerClusterFitOptions = {
|
|
@@ -107,22 +196,92 @@ export type AmapMarkerClusterRuntime<T> = {
|
|
|
107
196
|
content?: AmapMarkerClusterContent;
|
|
108
197
|
};
|
|
109
198
|
export type AmapMarkerClusterProps<T> = {
|
|
199
|
+
/**
|
|
200
|
+
*
|
|
201
|
+
* 聚合数据源
|
|
202
|
+
*/
|
|
110
203
|
data: T[];
|
|
204
|
+
/**
|
|
205
|
+
*
|
|
206
|
+
* 获取数据项唯一标识
|
|
207
|
+
*/
|
|
111
208
|
getKey: (item: T) => string;
|
|
209
|
+
/**
|
|
210
|
+
*
|
|
211
|
+
* 获取数据项经纬度坐标,返回空值时跳过该数据项
|
|
212
|
+
*/
|
|
112
213
|
getPosition: (item: T) => LngLat | null | undefined;
|
|
214
|
+
/**
|
|
215
|
+
*
|
|
216
|
+
* 自定义渲染单个标记内容
|
|
217
|
+
*/
|
|
113
218
|
renderMarker?: (ctx: AmapMarkerClusterMarkerContext<T>) => AmapMarkerClusterContent;
|
|
219
|
+
/**
|
|
220
|
+
*
|
|
221
|
+
* 自定义渲染聚合点内容
|
|
222
|
+
*/
|
|
114
223
|
renderCluster?: (ctx: AmapMarkerClusterRenderClusterContext<T>) => AmapMarkerClusterContent;
|
|
224
|
+
/**
|
|
225
|
+
*
|
|
226
|
+
* 单个标记的信息窗配置
|
|
227
|
+
*/
|
|
115
228
|
markerInfoWindow?: (ctx: AmapMarkerClusterInfoWindowContext<T>) => AmapMarkerInfoWindowOptions | null | undefined;
|
|
229
|
+
/**
|
|
230
|
+
*
|
|
231
|
+
* 透传给 AMap.MarkerCluster 的配置
|
|
232
|
+
* @default {}
|
|
233
|
+
*/
|
|
116
234
|
clusterOptions?: Record<string, any>;
|
|
235
|
+
/**
|
|
236
|
+
*
|
|
237
|
+
* 单个标记内容偏移量
|
|
238
|
+
*/
|
|
117
239
|
markerOffset?: AmapMarkerClusterMarkerOffset;
|
|
240
|
+
/**
|
|
241
|
+
*
|
|
242
|
+
* 点击聚合点时是否自动调整地图视野
|
|
243
|
+
* @default true
|
|
244
|
+
*/
|
|
118
245
|
autoFitOnClusterClick?: boolean;
|
|
246
|
+
/**
|
|
247
|
+
*
|
|
248
|
+
* 点击聚合点自动调整视野时的配置
|
|
249
|
+
*/
|
|
119
250
|
fitOptions?: AmapMarkerClusterFitOptions;
|
|
251
|
+
/**
|
|
252
|
+
*
|
|
253
|
+
* 单个标记点击回调
|
|
254
|
+
*/
|
|
120
255
|
onMarkerClick?: (ctx: AmapMarkerClusterMarkerEventContext<T>) => void;
|
|
256
|
+
/**
|
|
257
|
+
*
|
|
258
|
+
* 聚合点点击回调
|
|
259
|
+
*/
|
|
121
260
|
onClusterClick?: (ctx: AmapMarkerClusterEventContext<T>) => void;
|
|
261
|
+
/**
|
|
262
|
+
*
|
|
263
|
+
* 鼠标移入单个标记回调
|
|
264
|
+
*/
|
|
122
265
|
onMarkerMouseEnter?: (ctx: AmapMarkerClusterMarkerEventContext<T>) => void;
|
|
266
|
+
/**
|
|
267
|
+
*
|
|
268
|
+
* 鼠标移出单个标记回调
|
|
269
|
+
*/
|
|
123
270
|
onMarkerMouseLeave?: (ctx: AmapMarkerClusterMarkerEventContext<T>) => void;
|
|
271
|
+
/**
|
|
272
|
+
*
|
|
273
|
+
* 当前地图视野内可见数据项变化回调
|
|
274
|
+
*/
|
|
124
275
|
onVisibleItemsChange?: (items: T[]) => void;
|
|
276
|
+
/**
|
|
277
|
+
*
|
|
278
|
+
* 标记运行时信息变化回调
|
|
279
|
+
*/
|
|
125
280
|
onMarkerRuntimeChange?: (runtimes: Array<AmapMarkerClusterRuntime<T>>) => void;
|
|
281
|
+
/**
|
|
282
|
+
*
|
|
283
|
+
* 聚合组件内部异常回调
|
|
284
|
+
*/
|
|
126
285
|
onError?: (error: Error) => void;
|
|
127
286
|
};
|
|
128
287
|
export type AmapCircleEventContext = {
|
|
@@ -131,10 +290,36 @@ export type AmapCircleEventContext = {
|
|
|
131
290
|
map: AMap.Map;
|
|
132
291
|
};
|
|
133
292
|
export type AmapCircleProps = {
|
|
293
|
+
/**
|
|
294
|
+
*
|
|
295
|
+
* 圆心坐标
|
|
296
|
+
*/
|
|
134
297
|
center: LngLat;
|
|
298
|
+
/**
|
|
299
|
+
*
|
|
300
|
+
* 圆形半径,单位米
|
|
301
|
+
*/
|
|
135
302
|
radius: number;
|
|
303
|
+
/**
|
|
304
|
+
*
|
|
305
|
+
* 透传给 AMap.Circle 的配置
|
|
306
|
+
* @default {}
|
|
307
|
+
*/
|
|
136
308
|
options?: Record<string, any>;
|
|
309
|
+
/**
|
|
310
|
+
*
|
|
311
|
+
* 是否显示圆形覆盖物
|
|
312
|
+
* @default true
|
|
313
|
+
*/
|
|
137
314
|
visible?: boolean;
|
|
315
|
+
/**
|
|
316
|
+
*
|
|
317
|
+
* 鼠标移入圆形覆盖物回调
|
|
318
|
+
*/
|
|
138
319
|
onMouseEnter?: (ctx: AmapCircleEventContext) => void;
|
|
320
|
+
/**
|
|
321
|
+
*
|
|
322
|
+
* 鼠标移出圆形覆盖物回调
|
|
323
|
+
*/
|
|
139
324
|
onMouseLeave?: (ctx: AmapCircleEventContext) => void;
|
|
140
325
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference path="../amap-types.d.ts" />
|
|
2
|
-
import { AmapMarkerClusterContent, AmapMarkerClusterMarkerOffset, AmapMarkerClusterRuntime, LngLat } from '../
|
|
2
|
+
import { AmapMarkerClusterContent, AmapMarkerClusterMarkerOffset, AmapMarkerClusterRuntime, LngLat } from '../Amap.type';
|
|
3
3
|
import { ClusterPoint, ManagedMarker } from './AmapMarkerCluster.type';
|
|
4
4
|
export declare const MARKER_CLUSTER_PLUGIN_ERROR = "[ui-base] AmapMarkerCluster requires AMap.MarkerCluster plugin. Please add \"AMap.MarkerCluster\" to AmapProvider plugins.";
|
|
5
5
|
export declare const EMPTY_CLUSTER_OPTIONS: Record<string, any>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { AmapContextValue, AmapProviderContextValue } from '../
|
|
1
|
+
import { AmapContextValue, AmapProviderContextValue } from '../Amap.type';
|
|
2
2
|
export declare const AmapProviderContext: import('react').Context<AmapProviderContextValue>;
|
|
3
3
|
export declare const AmapContext: import('react').Context<AmapContextValue | null>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { UseAmapResult } from '../
|
|
1
|
+
import { UseAmapResult } from '../Amap.type';
|
|
2
2
|
export declare const useAmap: () => UseAmapResult;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { UseCurrentLocationOptions, UseCurrentLocationResult } from '../
|
|
1
|
+
import { UseCurrentLocationOptions, UseCurrentLocationResult } from '../Amap.type';
|
|
2
2
|
export declare const useCurrentLocation: (options?: UseCurrentLocationOptions) => UseCurrentLocationResult;
|
|
@@ -4,4 +4,4 @@ export { AmapCircle } from './AmapCircle';
|
|
|
4
4
|
export { AmapMarker } from './AmapMarker';
|
|
5
5
|
export { AmapMarkerCluster } from './AmapMarkerCluster';
|
|
6
6
|
export { useAmap, useCurrentLocation } from './hooks';
|
|
7
|
-
export type { AmapCircleEventContext, AmapCircleProps, AmapMarkerClusterContent, AmapMarkerClusterEventContext, AmapMarkerClusterFitOptions, AmapMarkerClusterInfoWindowContext, AmapMarkerClusterMarkerContext, AmapMarkerClusterMarkerEventContext, AmapMarkerClusterMarkerOffset, AmapMarkerClusterProps, AmapMarkerClusterRenderClusterContext, AmapMarkerClusterRuntime, AmapMarkerEventContext, AmapMarkerInfoWindowNativeOptions, AmapMarkerInfoWindowOptions, AmapMarkerProps, AmapProps, AmapProviderProps, LngLat, UseAmapResult, UseCurrentLocationOptions, UseCurrentLocationResult, } from './
|
|
7
|
+
export type { AmapCircleEventContext, AmapCircleProps, AmapMarkerClusterContent, AmapMarkerClusterEventContext, AmapMarkerClusterFitOptions, AmapMarkerClusterInfoWindowContext, AmapMarkerClusterMarkerContext, AmapMarkerClusterMarkerEventContext, AmapMarkerClusterMarkerOffset, AmapMarkerClusterProps, AmapMarkerClusterRenderClusterContext, AmapMarkerClusterRuntime, AmapMarkerEventContext, AmapMarkerInfoWindowNativeOptions, AmapMarkerInfoWindowOptions, AmapMarkerProps, AmapProps, AmapProviderProps, LngLat, UseAmapResult, UseCurrentLocationOptions, UseCurrentLocationResult, } from './Amap.type';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference path="../amap-types.d.ts" />
|
|
2
|
-
import { LngLat } from '../
|
|
2
|
+
import { LngLat } from '../Amap.type';
|
|
3
3
|
export type AmapRuntime = typeof globalThis.AMap & {
|
|
4
4
|
convertFrom?: (location: LngLat, type: string, callback: (status: string, result: any) => void) => void;
|
|
5
5
|
Geolocation?: new () => {
|
|
@@ -3,7 +3,7 @@ export { Amap, AmapCircle, AmapMarker, AmapMarkerCluster, AmapProvider, useAmap,
|
|
|
3
3
|
export type { AmapCircleEventContext, AmapCircleProps, AmapMarkerClusterContent, AmapMarkerClusterEventContext, AmapMarkerClusterFitOptions, AmapMarkerClusterInfoWindowContext, AmapMarkerClusterMarkerContext, AmapMarkerClusterMarkerEventContext, AmapMarkerClusterMarkerOffset, AmapMarkerClusterProps, AmapMarkerClusterRenderClusterContext, AmapMarkerClusterRuntime, AmapMarkerEventContext, AmapMarkerInfoWindowNativeOptions, AmapMarkerInfoWindowOptions, AmapMarkerProps, AmapProps, AmapProviderProps, LngLat, UseAmapResult, UseCurrentLocationOptions, UseCurrentLocationResult, } from './Amap';
|
|
4
4
|
export { ConfigProvider } from './ConfigProvider';
|
|
5
5
|
export type { AmapConfig, ConfigProviderProps } from './ConfigProvider';
|
|
6
|
-
export {
|
|
6
|
+
export { LocalTheme } from './theme';
|
|
7
7
|
export { default as Card } from './Card';
|
|
8
8
|
export { default as Modal } from './Modal';
|
|
9
9
|
export { default as ColorPicker } from './ColorPicker';
|