@baishuyun/ui-base 2.3.4 → 3.0.1

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.
Files changed (96) hide show
  1. package/dist/Amap/Amap-DL5dLiUm.js +77 -0
  2. package/dist/Amap/AmapCircle/index.js +4 -0
  3. package/dist/Amap/AmapCircle-BP187l-8.js +62 -0
  4. package/dist/Amap/AmapContext-JaYk1a3H.js +11 -0
  5. package/dist/Amap/AmapMarker/index.js +5 -0
  6. package/dist/Amap/AmapMarker-DYW0-8Hd.js +152 -0
  7. package/dist/Amap/AmapMarkerCluster/index.js +5 -0
  8. package/dist/Amap/AmapMarkerCluster-BRVHHMbi.js +241 -0
  9. package/dist/Amap/AmapProvider/index.js +5 -0
  10. package/dist/Amap/AmapProvider-CWbRK6QL.js +107 -0
  11. package/dist/Amap/hooks/index.js +3 -0
  12. package/dist/Amap/hooks-D1m8KgVM.js +121 -0
  13. package/dist/Amap/index.js +11 -0
  14. package/dist/Amap/useMarkerInfoWindowController-CRgf2I0Q.js +94 -0
  15. package/dist/Card/index.js +1 -1
  16. package/dist/CheckBox/{CheckBox-Cz6KW9Lw.js → CheckBox-B04hZKaC.js} +1 -1
  17. package/dist/CheckBox/index.js +2 -2
  18. package/dist/ColorPicker/{ColorPicker-C1kG_eI-.js → ColorPicker-B-KaMDAn.js} +3 -3
  19. package/dist/ColorPicker/index.js +4 -3
  20. package/dist/ConfigProvider/ConfigProvider-Bx-uxnns.js +159 -0
  21. package/dist/ConfigProvider/index.js +3 -0
  22. package/dist/DropDown/{DropDown-BAPBTglm.js → DropDown-CMKiQDrc.js} +5 -5
  23. package/dist/DropDown/index.js +6 -5
  24. package/dist/Editor/{Buttons-CsKKYGbV.js → Buttons-CZOTyAPL.js} +49 -49
  25. package/dist/Editor/ToolbarPlugin/Buttons/index.js +12 -11
  26. package/dist/Editor/index.js +12 -11
  27. package/dist/InputTag/index.js +1 -1
  28. package/dist/Loading/index.js +1 -1
  29. package/dist/Modal/index.js +1 -1
  30. package/dist/NotFoundContent/index.js +1 -1
  31. package/dist/Radio/index.js +1 -1
  32. package/dist/Segmented/index.js +1 -1
  33. package/dist/Select/{Select-BoNqxIRo.js → Select-xuQGK6It.js} +7 -7
  34. package/dist/Select/{SelectInputSearch-DMY6Y9B6.js → SelectInputSearch-Dm3CI_L4.js} +1 -1
  35. package/dist/Select/index.js +10 -9
  36. package/dist/Tabs/{Tabs-BqT-_eVo.js → Tabs-Cxf7jwys.js} +3 -3
  37. package/dist/Tabs/index.js +3 -3
  38. package/dist/Tree/index.js +3 -3
  39. package/dist/components/Amap/Amap.d.ts +3 -0
  40. package/dist/components/Amap/AmapCircle/AmapCircle.d.ts +3 -0
  41. package/dist/components/Amap/AmapCircle/__tests__/AmapCircle.test.d.ts +1 -0
  42. package/dist/components/Amap/AmapCircle/index.d.ts +1 -0
  43. package/dist/components/Amap/AmapMarker/AmapMarker.d.ts +3 -0
  44. package/dist/components/Amap/AmapMarker/__tests__/AmapMarker.test.d.ts +1 -0
  45. package/dist/components/Amap/AmapMarker/index.d.ts +1 -0
  46. package/dist/components/Amap/AmapMarker/useMarkerInfoWindow.d.ts +15 -0
  47. package/dist/components/Amap/AmapMarker/useMarkerInfoWindowController.d.ts +13 -0
  48. package/dist/components/Amap/AmapMarkerCluster/AmapMarkerCluster.d.ts +3 -0
  49. package/dist/components/Amap/AmapMarkerCluster/AmapMarkerCluster.type.d.ts +25 -0
  50. package/dist/components/Amap/AmapMarkerCluster/__tests__/AmapMarkerCluster.test.d.ts +1 -0
  51. package/dist/components/Amap/AmapMarkerCluster/index.d.ts +1 -0
  52. package/dist/components/Amap/AmapMarkerCluster/utils.d.ts +26 -0
  53. package/dist/components/Amap/AmapProvider/AmapProvider.d.ts +3 -0
  54. package/dist/components/Amap/AmapProvider/__tests__/AmapProvider.test.d.ts +1 -0
  55. package/dist/components/Amap/AmapProvider/index.d.ts +1 -0
  56. package/dist/components/Amap/__tests__/Amap.test.d.ts +1 -0
  57. package/dist/components/Amap/amap-types.d.ts +44 -0
  58. package/dist/components/Amap/context/AmapContext.d.ts +3 -0
  59. package/dist/components/Amap/hooks/__tests__/useCurrentLocation.test.d.ts +1 -0
  60. package/dist/components/Amap/hooks/index.d.ts +2 -0
  61. package/dist/components/Amap/hooks/useAmap.d.ts +2 -0
  62. package/dist/components/Amap/hooks/useCurrentLocation.d.ts +2 -0
  63. package/dist/components/Amap/index.d.ts +7 -0
  64. package/dist/components/Amap/interface.d.ts +142 -0
  65. package/dist/components/Amap/loader.d.ts +9 -0
  66. package/dist/components/Amap/utils/currentLocation.d.ts +18 -0
  67. package/dist/components/ConfigProvider/ConfigProvider.d.ts +3 -0
  68. package/dist/components/ConfigProvider/ConfigProvider.type.d.ts +16 -0
  69. package/dist/components/ConfigProvider/__tests__/ConfigProvider.test.d.ts +1 -0
  70. package/dist/components/ConfigProvider/context.d.ts +3 -0
  71. package/dist/components/ConfigProvider/index.d.ts +3 -0
  72. package/dist/components/Tree/Tree.test.d.ts +1 -0
  73. package/dist/components/Tree/context/TreeContext.d.ts +1 -1
  74. package/dist/components/Tree/types/tree.d.ts +1 -1
  75. package/dist/components/index.d.ts +4 -0
  76. package/dist/index.js +49 -94
  77. package/dist/locale/LocaleProvider.d.ts +3 -0
  78. package/dist/locale/__tests__/LocaleProvider.test.d.ts +1 -0
  79. package/dist/locale/index.d.ts +1 -1
  80. package/dist/locale/lang/zh-TW.json.d.ts +64 -0
  81. package/dist/vendors/{useLocale-BXnqO-Ju.js → LocaleContext-Jj_JGgi2.js} +7 -7
  82. package/dist/vendors/{Tree-nIRgDY2s.js → Tree-Bg2UzLsC.js} +3 -3
  83. package/dist/vendors/useLocale-Mk0d7wNt.js +6 -0
  84. package/dist/vite-env.d.ts +7 -0
  85. package/package.json +4 -3
  86. /package/dist/Card/{Card-CaKTq_1y.js → Card-D__c94yx.js} +0 -0
  87. /package/dist/CheckBox/{CheckBox-l__wOnmH.js → CheckBox-DF201Nxg.js} +0 -0
  88. /package/dist/InputTag/{InputTag-V4UnUnGJ.js → InputTag-F2Dv-r56.js} +0 -0
  89. /package/dist/Loading/{Loading-Dy5A--HK.js → Loading-dsLWSWsE.js} +0 -0
  90. /package/dist/Modal/{Modal-DQ5bptu_.js → Modal-CuDbh_WD.js} +0 -0
  91. /package/dist/NotFoundContent/{NotFoundContent-1-41e1rN.js → NotFoundContent-DJUQ0_2D.js} +0 -0
  92. /package/dist/Radio/{Radio-CZOrtNyn.js → Radio-WNw-VqIS.js} +0 -0
  93. /package/dist/Segmented/{Segmented-DEGgLO-b.js → Segmented-Byw8j1hQ.js} +0 -0
  94. /package/dist/vendors/{animations-DvjIfVz9.js → animations-C2i5EijE.js} +0 -0
  95. /package/dist/vendors/{color-CyuNdAfc.js → color-CxdZwdYM.js} +0 -0
  96. /package/dist/vendors/{useFloatingPortal-W4pliYWU.js → useFloatingPortal-CDgiCnbb.js} +0 -0
@@ -0,0 +1,3 @@
1
+ import { AmapContextValue, AmapProviderContextValue } from '../interface';
2
+ export declare const AmapProviderContext: import('react').Context<AmapProviderContextValue>;
3
+ export declare const AmapContext: import('react').Context<AmapContextValue | null>;
@@ -0,0 +1,2 @@
1
+ export { useAmap } from './useAmap';
2
+ export { useCurrentLocation } from './useCurrentLocation';
@@ -0,0 +1,2 @@
1
+ import { UseAmapResult } from '../interface';
2
+ export declare const useAmap: () => UseAmapResult;
@@ -0,0 +1,2 @@
1
+ import { UseCurrentLocationOptions, UseCurrentLocationResult } from '../interface';
2
+ export declare const useCurrentLocation: (options?: UseCurrentLocationOptions) => UseCurrentLocationResult;
@@ -0,0 +1,7 @@
1
+ export { AmapProvider } from './AmapProvider';
2
+ export { Amap } from './Amap';
3
+ export { AmapCircle } from './AmapCircle';
4
+ export { AmapMarker } from './AmapMarker';
5
+ export { AmapMarkerCluster } from './AmapMarkerCluster';
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 './interface';
@@ -0,0 +1,142 @@
1
+ /// <reference path="amap-types.d.ts" />
2
+ import { ReactNode, CSSProperties } from 'react';
3
+ export type LngLat = [number, number];
4
+ export type AmapLoaderStatus = 'idle' | 'loading' | 'success' | 'error';
5
+ export type AmapProviderProps = {
6
+ amapKey?: string;
7
+ securityJsCode?: string;
8
+ version?: string;
9
+ plugins?: string[];
10
+ fallback?: ReactNode;
11
+ errorFallback?: ReactNode | ((error: Error) => ReactNode);
12
+ children?: ReactNode;
13
+ };
14
+ export type AmapProviderContextValue = {
15
+ AMap: typeof AMap | null;
16
+ status: AmapLoaderStatus;
17
+ loading: boolean;
18
+ error: Error | null;
19
+ plugins: string[];
20
+ };
21
+ export type AmapProps = {
22
+ center?: LngLat;
23
+ zoom?: number;
24
+ options?: Record<string, any>;
25
+ className?: string;
26
+ style?: CSSProperties;
27
+ children?: ReactNode;
28
+ onReady?: (ctx: {
29
+ AMap: typeof AMap;
30
+ map: AMap.Map;
31
+ }) => void;
32
+ onError?: (error: Error) => void;
33
+ };
34
+ export type AmapContextValue = {
35
+ AMap: typeof AMap;
36
+ map: AMap.Map;
37
+ jsApiReady: boolean;
38
+ mapReady: boolean;
39
+ loading: boolean;
40
+ error: Error | null;
41
+ };
42
+ export type UseAmapResult = AmapContextValue;
43
+ export type UseCurrentLocationOptions = {
44
+ defaultLocation?: LngLat;
45
+ fallbackToCity?: boolean;
46
+ timeout?: number;
47
+ };
48
+ export type UseCurrentLocationResult = {
49
+ location: LngLat;
50
+ loading: boolean;
51
+ error: Error | null;
52
+ refresh: () => Promise<LngLat>;
53
+ };
54
+ export type AmapMarkerEventContext = {
55
+ marker: AMap.Marker;
56
+ AMap: typeof AMap;
57
+ map: AMap.Map;
58
+ };
59
+ export type AmapMarkerInfoWindowNativeOptions = Omit<AMap.InfoOptions, 'anchor' | 'offset'> & {
60
+ offset?: AMap.InfoOptions['offset'] | [number, number];
61
+ };
62
+ export type AmapMarkerInfoWindowOptions = {
63
+ content: ReactNode;
64
+ options?: AmapMarkerInfoWindowNativeOptions;
65
+ };
66
+ export type AmapMarkerProps = {
67
+ content?: ReactNode;
68
+ infoWindow?: AmapMarkerInfoWindowOptions;
69
+ options?: AMap.MarkerOptions;
70
+ onClick?: (ctx: AmapMarkerEventContext) => void;
71
+ onMouseEnter?: (ctx: AmapMarkerEventContext) => void;
72
+ onMouseLeave?: (ctx: AmapMarkerEventContext) => void;
73
+ };
74
+ export type AmapMarkerClusterFitOptions = {
75
+ padding?: [number, number, number, number];
76
+ maxZoom?: number;
77
+ singlePointZoom?: number;
78
+ };
79
+ export type AmapMarkerClusterContent = string | HTMLElement;
80
+ export type AmapMarkerClusterMarkerOffset = [number, number] | AMap.Pixel | null;
81
+ export type AmapMarkerClusterMarkerContext<T> = {
82
+ item: T;
83
+ index: number;
84
+ };
85
+ export type AmapMarkerClusterInfoWindowContext<T> = AmapMarkerClusterMarkerContext<T>;
86
+ export type AmapMarkerClusterRenderClusterContext<T> = {
87
+ count: number;
88
+ items: T[];
89
+ };
90
+ export type AmapMarkerClusterMarkerEventContext<T> = {
91
+ item: T;
92
+ marker: AMap.Marker;
93
+ AMap: typeof AMap;
94
+ map: AMap.Map;
95
+ };
96
+ export type AmapMarkerClusterEventContext<T> = {
97
+ items: T[];
98
+ marker: AMap.Marker;
99
+ AMap: typeof AMap;
100
+ map: AMap.Map;
101
+ };
102
+ export type AmapMarkerClusterRuntime<T> = {
103
+ item: T;
104
+ index: number;
105
+ key: string;
106
+ marker: AMap.Marker;
107
+ content?: AmapMarkerClusterContent;
108
+ };
109
+ export type AmapMarkerClusterProps<T> = {
110
+ data: T[];
111
+ getKey: (item: T) => string;
112
+ getPosition: (item: T) => LngLat | null | undefined;
113
+ renderMarker?: (ctx: AmapMarkerClusterMarkerContext<T>) => AmapMarkerClusterContent;
114
+ renderCluster?: (ctx: AmapMarkerClusterRenderClusterContext<T>) => AmapMarkerClusterContent;
115
+ markerInfoWindow?: (ctx: AmapMarkerClusterInfoWindowContext<T>) => AmapMarkerInfoWindowOptions | null | undefined;
116
+ clusterOptions?: Record<string, any>;
117
+ markerOffset?: AmapMarkerClusterMarkerOffset;
118
+ autoFitOnClusterClick?: boolean;
119
+ fitOptions?: AmapMarkerClusterFitOptions;
120
+ onMarkerClick?: (ctx: AmapMarkerClusterMarkerEventContext<T>) => void;
121
+ onClusterClick?: (ctx: AmapMarkerClusterEventContext<T>) => void;
122
+ onMarkerMouseEnter?: (ctx: AmapMarkerClusterMarkerEventContext<T>) => void;
123
+ onMarkerMouseLeave?: (ctx: AmapMarkerClusterMarkerEventContext<T>) => void;
124
+ onVisibleItemsChange?: (items: T[]) => void;
125
+ onMarkerRuntimeChange?: (runtimes: Array<AmapMarkerClusterRuntime<T>>) => void;
126
+ onError?: (error: Error) => void;
127
+ };
128
+ export type AmapCircleEventContext = {
129
+ circle: AMap.Circle;
130
+ AMap: typeof AMap;
131
+ map: AMap.Map;
132
+ };
133
+ export type AmapCircleProps = {
134
+ center: LngLat;
135
+ radius: number;
136
+ options?: Record<string, any>;
137
+ visible?: boolean;
138
+ onReady?: (ctx: AmapCircleEventContext) => void;
139
+ onClick?: (ctx: AmapCircleEventContext) => void;
140
+ onMouseEnter?: (ctx: AmapCircleEventContext) => void;
141
+ onMouseLeave?: (ctx: AmapCircleEventContext) => void;
142
+ };
@@ -0,0 +1,9 @@
1
+ /// <reference path="amap-types.d.ts" />
2
+ type LoadAmapOptions = {
3
+ key: string;
4
+ securityJsCode?: string;
5
+ version?: string;
6
+ plugins?: string[];
7
+ };
8
+ export declare const loadAmap: (options: LoadAmapOptions) => Promise<typeof AMap>;
9
+ export {};
@@ -0,0 +1,18 @@
1
+ /// <reference path="../amap-types.d.ts" />
2
+ import { LngLat } from '../interface';
3
+ export type AmapRuntime = typeof globalThis.AMap & {
4
+ convertFrom?: (location: LngLat, type: string, callback: (status: string, result: any) => void) => void;
5
+ Geolocation?: new () => {
6
+ getCityInfo: (callback: (status: string, result: any) => void) => void;
7
+ };
8
+ DistrictSearch?: new (options: Record<string, any>) => {
9
+ search: (keyword: string, callback: (status: string, result: any) => void) => void;
10
+ };
11
+ };
12
+ export declare const isValidLngLat: (location: unknown) => location is LngLat;
13
+ export declare const toLngLat: (lng: unknown, lat: unknown) => LngLat | null;
14
+ export declare const isAmapCallbackSuccess: (status: string, result: any) => boolean;
15
+ export declare const withTimeout: <T>(promise: Promise<T>, timeout: number, message: string) => Promise<T>;
16
+ export declare const resolveBrowserLocation: (timeout: number) => Promise<GeolocationPosition>;
17
+ export declare const convertWgs84ToAmap: (AMap: AmapRuntime, location: LngLat, timeout: number) => Promise<LngLat>;
18
+ export declare const resolveCityLocation: (AMap: AmapRuntime, timeout: number) => Promise<LngLat>;
@@ -0,0 +1,3 @@
1
+ import { ConfigProviderProps } from './ConfigProvider.type';
2
+ export declare const ConfigProvider: React.FC<ConfigProviderProps>;
3
+ export default ConfigProvider;
@@ -0,0 +1,16 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { Locale } from '../../locale';
3
+ export type AmapConfig = {
4
+ key?: string;
5
+ securityJsCode?: string;
6
+ version?: string;
7
+ plugins?: string[];
8
+ };
9
+ export type ConfigProviderProps = PropsWithChildren<{
10
+ locale?: Locale;
11
+ messages?: Record<string, any>;
12
+ amap?: AmapConfig;
13
+ }>;
14
+ export type ConfigContextValue = {
15
+ amap?: AmapConfig;
16
+ };
@@ -0,0 +1,3 @@
1
+ import { ConfigContextValue } from './ConfigProvider.type';
2
+ export declare const ConfigContext: import('react').Context<ConfigContextValue>;
3
+ export declare const useConfig: () => ConfigContextValue;
@@ -0,0 +1,3 @@
1
+ export { ConfigProvider, default } from './ConfigProvider';
2
+ export { useConfig } from './context';
3
+ export type { AmapConfig, ConfigProviderProps } from './ConfigProvider.type';
@@ -0,0 +1 @@
1
+ export {};
@@ -9,7 +9,7 @@ export declare const BsyTreeContext: import('react').Context<{
9
9
  onDeSelect?: (value: string | number) => void;
10
10
  onExpand?: (key: string | number, expanded: boolean) => void;
11
11
  icon?: (node: TreeNodeDefine) => React.ReactNode;
12
- switcherIcon?: (expanded: boolean) => React.ReactNode;
12
+ switcherIcon?: (expanded: boolean, node: TreeNodeDefine) => React.ReactNode;
13
13
  checkType: CheckType;
14
14
  showSwitcher: boolean;
15
15
  }>;
@@ -62,7 +62,7 @@ export type TreeProps = {
62
62
  /**
63
63
  * @description 全局下拉箭头图标渲染函数
64
64
  */
65
- switcherIcon?: (expanded: boolean) => React.ReactNode;
65
+ switcherIcon?: (expanded: boolean, node: TreeNodeDefine) => React.ReactNode;
66
66
 
67
67
  /**
68
68
  * @description 父节点是否可以被选中(如果设置为 true, 则所有节点的展开/折叠必须点击箭头按钮才能正常操作)
@@ -1,4 +1,8 @@
1
1
  export { default as Icon } from './Icon';
2
+ export { Amap, AmapCircle, AmapMarker, AmapMarkerCluster, AmapProvider, useAmap, useCurrentLocation, } from './Amap';
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
+ export { ConfigProvider } from './ConfigProvider';
5
+ export type { AmapConfig, ConfigProviderProps } from './ConfigProvider';
2
6
  export { LocaleProvider } from '../locale/LocaleProvider';
3
7
  export { default as Card } from './Card';
4
8
  export { default as Modal } from './Modal';
package/dist/index.js CHANGED
@@ -1,103 +1,58 @@
1
1
  import { t as e } from "./Icon/Icon-CTZCSuVg.js";
2
- import { n as t, r as n } from "./vendors/useLocale-BXnqO-Ju.js";
3
- import { t as r } from "./Card/Card-CaKTq_1y.js";
4
- import { t as i } from "./Modal/Modal-DQ5bptu_.js";
5
- import { t as a } from "./ColorPicker/ColorPicker-C1kG_eI-.js";
6
- import "./vendors/color-CyuNdAfc.js";
7
- import { t as o } from "./Segmented/Segmented-DEGgLO-b.js";
8
- import { t as s } from "./Select/Select-BoNqxIRo.js";
9
- import "./Select/SelectInputSearch-DMY6Y9B6.js";
10
- import { t as c } from "./vendors/Tree-nIRgDY2s.js";
11
- import "./CheckBox/CheckBox-l__wOnmH.js";
12
- import { t as l } from "./CheckBox/CheckBox-Cz6KW9Lw.js";
13
- import { t as u } from "./Radio/Radio-CZOrtNyn.js";
14
- import { t as d } from "./NotFoundContent/NotFoundContent-1-41e1rN.js";
15
- import "./vendors/useFloatingPortal-W4pliYWU.js";
2
+ import { n as t, t as n } from "./vendors/LocaleContext-Jj_JGgi2.js";
3
+ import { i as r, r as i, t as a } from "./ConfigProvider/ConfigProvider-Bx-uxnns.js";
4
+ import "./Amap/AmapContext-JaYk1a3H.js";
5
+ import { t as o } from "./Amap/AmapProvider-CWbRK6QL.js";
6
+ import { t as s } from "./Amap/Amap-DL5dLiUm.js";
7
+ import { n as c, t as l } from "./Amap/hooks-D1m8KgVM.js";
8
+ import { t as u } from "./Amap/AmapCircle-BP187l-8.js";
9
+ import "./Amap/useMarkerInfoWindowController-CRgf2I0Q.js";
10
+ import { t as d } from "./Amap/AmapMarker-DYW0-8Hd.js";
11
+ import { t as f } from "./Amap/AmapMarkerCluster-BRVHHMbi.js";
12
+ import { t as p } from "./Card/Card-D__c94yx.js";
13
+ import { t as m } from "./Modal/Modal-CuDbh_WD.js";
14
+ import { t as h } from "./ColorPicker/ColorPicker-B-KaMDAn.js";
15
+ import "./vendors/useLocale-Mk0d7wNt.js";
16
+ import "./vendors/color-CxdZwdYM.js";
17
+ import { t as g } from "./Segmented/Segmented-Byw8j1hQ.js";
18
+ import { t as _ } from "./Select/Select-xuQGK6It.js";
19
+ import "./Select/SelectInputSearch-Dm3CI_L4.js";
20
+ import { t as v } from "./vendors/Tree-Bg2UzLsC.js";
21
+ import "./CheckBox/CheckBox-DF201Nxg.js";
22
+ import { t as y } from "./CheckBox/CheckBox-B04hZKaC.js";
23
+ import { t as b } from "./Radio/Radio-WNw-VqIS.js";
24
+ import { t as x } from "./NotFoundContent/NotFoundContent-DJUQ0_2D.js";
25
+ import "./vendors/useFloatingPortal-CDgiCnbb.js";
16
26
  import "./Tree/index.js";
17
- import { n as f, t as p } from "./Tabs/Tabs-BqT-_eVo.js";
18
- import { t as m } from "./DropDown/DropDown-BAPBTglm.js";
19
- import { t as h } from "./Loading/Loading-Dy5A--HK.js";
27
+ import { n as S, t as C } from "./Tabs/Tabs-Cxf7jwys.js";
28
+ import { t as w } from "./DropDown/DropDown-CMKiQDrc.js";
29
+ import { t as T } from "./Loading/Loading-dsLWSWsE.js";
20
30
  import "./NotFoundContent/index.js";
21
- import { t as g } from "./InputTag/InputTag-V4UnUnGJ.js";
22
- import { jsx as _ } from "react/jsx-runtime";
23
- import { useCallback as v, useMemo as y } from "react";
24
- var b = {
25
- select: "Please select",
26
- search: "search",
27
- noFindData: "No search data",
28
- allSelect: "Select All",
29
- context: "Please enter the content",
30
- noData: "No Data",
31
- noDataFound: "No Data Found",
32
- dataSearching: "Data Searching...",
33
- allSelectedBySearch: "Select All by Search",
34
- leftAlign: "Left Align",
35
- centerAlign: "Center Align",
36
- rightAlign: "Right Align",
37
- underline: "Underline",
38
- link: "Link",
39
- hyperLink: "Hyper Link",
40
- showContent: "Show Content",
41
- linkAddress: "Link Address",
42
- openInNewTab: "Open in New Tab",
43
- confirm: "Confirm",
44
- cancel: "Cancel",
45
- cancelLink: "Cancel Link",
46
- presetColors: "preset color",
47
- editor: {
48
- linkTip: "Support https://link or @form alias",
49
- bold: "Bold",
50
- italic: "Italic",
51
- fontSize: "Font Size",
52
- fontColor: "Font Color",
53
- fill: "fill",
54
- alignment: "Alignment",
55
- centerAlign: "Center Align",
56
- rightAlign: "Right Align",
57
- uploadImage: "Upload Image",
58
- imageUrl: "Image URL",
59
- imageUrlPlaceholder: "Please enter image URL",
60
- imageUrlRequired: "Please enter image URL",
61
- imageUrlInvalid: "Please enter a valid image URL",
62
- imageUrlNote: "Note: Enter image URL to insert image",
63
- inputImageUrl: "Enter Image URL",
64
- uploadImageNote: "Note: Single image size cannot exceed 1MB",
65
- uploadImageText: "Click or drag to upload image",
66
- previewImage: "Preview Image",
67
- underline: "Underline",
68
- imageFormatOnly: "Only image formats are supported",
69
- uploadImageFirst: "Please upload image first",
70
- imageAddSuccess: "Image added successfully",
71
- operationFailed: "Operation failed",
72
- onlyImageFormatsSupported: "Only image formats are supported",
73
- pleaseUploadImageFirst: "Please upload image first",
74
- imageSizeNote: "Image size cannot exceed 1MB",
75
- clickOrDragToUpload: "Click or drag to upload image",
76
- enterImageUrl: "Enter image URL",
77
- pleaseEnterImageUrl: "Please enter image URL",
78
- pleaseEnterValidImageUrl: "Please enter a valid image URL",
79
- linkAddressEmpty: "Link address cannot be empty"
80
- },
81
- picture: "Picture",
82
- customColor: "Custom Color",
83
- addPicture: "Add Picture"
84
- }, x = ({ children: e, locale: r = "zh-CN", messages: i = {} }) => {
85
- let a = y(() => ({
86
- "zh-CN": n,
87
- "en-US": b,
88
- ...i
89
- }), [i]), o = y(() => a[r] || n, [r, a]), s = v((e) => {
90
- let t = e.split("."), n = o;
31
+ import { t as E } from "./InputTag/InputTag-F2Dv-r56.js";
32
+ import { jsx as D } from "react/jsx-runtime";
33
+ import { useCallback as O, useMemo as k } from "react";
34
+ //#region src/locale/LocaleProvider.tsx
35
+ var A = "[ui-base] LocaleProvider is deprecated and will be removed in the next major version. Please migrate to ConfigProvider.", j = !1, M = () => {
36
+ typeof process < "u" && process.env.NODE_ENV === "production" || j || (j = !0, console.warn(A));
37
+ }, N = ({ children: e, locale: a = "zh-CN", messages: o = {} }) => {
38
+ M();
39
+ let s = k(() => ({
40
+ "zh-CN": t,
41
+ "zh-TW": r,
42
+ "en-US": i,
43
+ ...o
44
+ }), [o]), c = k(() => s[a] || t, [a, s]), l = O((e) => {
45
+ let t = e.split("."), n = c;
91
46
  for (let r of t) if (n = n[r], !n) return console.warn(`[LocaleProvider] Cannot find translation for key: ${e}`), e;
92
47
  return typeof n == "string" ? n : e;
93
- }, [o]), c = y(() => ({
94
- locale: r,
95
- t: s
96
- }), [r, s]);
97
- return /* @__PURE__ */ _(t.Provider, {
98
- value: c,
48
+ }, [c]), u = k(() => ({
49
+ locale: a,
50
+ t: l
51
+ }), [a, l]);
52
+ return /* @__PURE__ */ D(n.Provider, {
53
+ value: u,
99
54
  children: e
100
55
  });
101
56
  };
102
57
  //#endregion
103
- export { r as Card, l as Checkbox, a as ColorPicker, m as DropDown, e as Icon, g as InputTag, h as Loading, x as LocaleProvider, i as Modal, d as NotFoundContent, u as Ratio, o as Segmented, s as Select, p as TabSelect, f as Tabs, c as Tree };
58
+ export { s as Amap, u as AmapCircle, d as AmapMarker, f as AmapMarkerCluster, o as AmapProvider, p as Card, y as Checkbox, h as ColorPicker, a as ConfigProvider, w as DropDown, e as Icon, E as InputTag, T as Loading, N as LocaleProvider, m as Modal, x as NotFoundContent, b as Ratio, g as Segmented, _ as Select, C as TabSelect, S as Tabs, v as Tree, c as useAmap, l as useCurrentLocation };
@@ -1,5 +1,8 @@
1
1
  import { PropsWithChildren } from 'react';
2
2
  import { Locale } from './index';
3
+ /**
4
+ * @deprecated LocaleProvider will be removed in the next major version. Please use ConfigProvider.
5
+ */
3
6
  export declare const LocaleProvider: React.FC<{
4
7
  locale?: Locale;
5
8
  messages?: Record<string, any>;
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1 @@
1
- export type Locale = 'zh-CN' | 'en-US';
1
+ export type Locale = 'zh-CN' | 'zh-TW' | 'en-US';
@@ -0,0 +1,64 @@
1
+ declare const _default: {
2
+ "select": "請選擇",
3
+ "search": "搜尋",
4
+ "noFindData": "未搜尋到任何資料",
5
+ "allSelect": "全選",
6
+ "context": "請輸入內容",
7
+ "noData": "沒有可選擇的資料",
8
+ "noDataFound": "未搜尋到任何資料",
9
+ "dataSearching": "資料搜尋中...",
10
+ "allSelectedBySearch": "搜尋結果全選",
11
+ "leftAlign": "左對齊",
12
+ "centerAlign": "置中對齊",
13
+ "rightAlign": "右對齊",
14
+ "underline": "底線",
15
+ "link": "連結",
16
+ "hyperLink": "超連結",
17
+ "showContent": "顯示文字",
18
+ "linkAddress": "連結地址",
19
+ "openInNewTab": "在新頁面開啟",
20
+ "confirm": "確認",
21
+ "cancel": "取消",
22
+ "cancelLink": "取消連結",
23
+ "presetColors": "預設顏色",
24
+ "editor": {
25
+ "linkTip": "支援 https:// 連結或 @表單別名",
26
+ "bold": "粗體",
27
+ "italic": "斜體",
28
+ "fontSize": "字號",
29
+ "fontColor": "顏色",
30
+ "fill": "填滿",
31
+ "alignment": "對齊方式",
32
+ "centerAlign": "置中對齊",
33
+ "rightAlign": "右對齊",
34
+ "uploadImage": "上傳圖片",
35
+ "imageUrl": "圖片 URL",
36
+ "imageUrlPlaceholder": "請輸入圖片 URL",
37
+ "imageUrlRequired": "請輸入圖片 URL",
38
+ "imageUrlInvalid": "請輸入有效的圖片 URL",
39
+ "imageUrlNote": "註:輸入圖片 URL 即可插入圖片",
40
+ "inputImageUrl": "輸入圖片 URL",
41
+ "uploadImageNote": "註:單張圖片大小不能超過 1MB",
42
+ "uploadImageText": "點擊或拖曳上傳圖片",
43
+ "previewImage": "預覽圖片",
44
+ "underline": "底線",
45
+ "imageFormatOnly": "僅支援圖片格式",
46
+ "imageSizeNote": "註:圖片大小不能超過 1MB",
47
+ "uploadImageFirst": "請先上傳圖片",
48
+ "imageAddSuccess": "圖片新增成功",
49
+ "operationFailed": "操作失敗",
50
+ "onlyImageFormatsSupported": "僅支援圖片格式",
51
+ "pleaseUploadImageFirst": "請先上傳圖片",
52
+ "clickOrDragToUpload": "點擊或拖曳上傳圖片",
53
+ "enterImageUrl": "輸入圖片 URL",
54
+ "pleaseEnterImageUrl": "請輸入圖片 URL",
55
+ "pleaseEnterValidImageUrl": "請輸入有效的圖片 URL",
56
+ "linkAddressEmpty": "連結地址不能為空"
57
+ },
58
+ "picture": "圖片",
59
+ "addPicture": "新增圖片",
60
+ "customColor": "自訂顏色"
61
+ }
62
+ ;
63
+
64
+ export default _default;
@@ -1,5 +1,5 @@
1
- import { createContext as e, useContext as t } from "react";
2
- var n = {
1
+ import { createContext as e } from "react";
2
+ var t = {
3
3
  select: "请选择",
4
4
  search: "搜索",
5
5
  noFindData: "未搜索到任何数据",
@@ -59,17 +59,17 @@ var n = {
59
59
  picture: "图片",
60
60
  addPicture: "添加图片",
61
61
  customColor: "自定义颜色"
62
- }, r = e({
62
+ }, n = e({
63
63
  locale: "zh-CN",
64
64
  t: (e) => {
65
- let t = e.split("."), r = n;
65
+ let n = e.split("."), r = t;
66
66
  try {
67
- for (let e of t) r = r[e];
67
+ for (let e of n) r = r[e];
68
68
  return typeof r == "string" ? r : e;
69
69
  } catch {
70
70
  return e;
71
71
  }
72
72
  }
73
- }), i = () => t(r);
73
+ });
74
74
  //#endregion
75
- export { r as n, n as r, i as t };
75
+ export { t as n, n as t };
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "../Icon/Icon-CTZCSuVg.js";
2
- import { t } from "../CheckBox/CheckBox-l__wOnmH.js";
3
- import { t as n } from "../Radio/Radio-CZOrtNyn.js";
2
+ import { t } from "../CheckBox/CheckBox-DF201Nxg.js";
3
+ import { t as n } from "../Radio/Radio-WNw-VqIS.js";
4
4
  import { getMatchingNodesPaths as r, getNodePath as i } from "../Tree/utils/index.js";
5
5
  import { noop as a } from "lodash-es";
6
6
  import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
@@ -88,7 +88,7 @@ var b = l.memo(y), x = u({
88
88
  }),
89
89
  children: n
90
90
  }) : null;
91
- }, F = (t) => O ? u.switcherIcon ? u.switcherIcon(t) : /* @__PURE__ */ s(e, {
91
+ }, F = (t) => O ? u.switcherIcon ? u.switcherIcon(t, r) : /* @__PURE__ */ s(e, {
92
92
  name: "arrow-right",
93
93
  className: h("transition-transform duration-300 ease-in-out text-[#666]", { "rotate-90": t })
94
94
  }) : null, I = () => O && !T || E === "default" || r.checkable === !1 ? null : /* @__PURE__ */ c("div", {
@@ -0,0 +1,6 @@
1
+ import { t as e } from "./LocaleContext-Jj_JGgi2.js";
2
+ import { useContext as t } from "react";
3
+ //#region src/hooks/useLocale.ts
4
+ var n = () => t(e);
5
+ //#endregion
6
+ export { n as t };
@@ -1,3 +1,10 @@
1
1
  /// <reference types="vite/client" />
2
+ /// <reference types="@amap/amap-jsapi-types" />
2
3
 
3
4
  declare const __ICONFONT_SCRIPT_URL__: string;
5
+
6
+ interface Window {
7
+ _AMapSecurityConfig?: {
8
+ securityJsCode?: string;
9
+ };
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baishuyun/ui-base",
3
- "version": "2.3.4",
3
+ "version": "3.0.1",
4
4
  "type": "module",
5
5
  "description": "百数云低代码平台通用组件库",
6
6
  "author": "bsy-fe team",
@@ -40,13 +40,14 @@
40
40
  "peerDependencies": {
41
41
  "@ant-design/icons": ">=6.0.0",
42
42
  "@floating-ui/react": ">=0.27.0",
43
- "ahooks": ">=3.0.0",
44
43
  "antd": ">=5.1.2",
45
44
  "motion": "^11.18.2",
46
45
  "react": ">=18.3.0",
47
46
  "react-dom": ">=18.3.0"
48
47
  },
49
48
  "dependencies": {
49
+ "@amap/amap-jsapi-loader": "^1.0.1",
50
+ "@amap/amap-jsapi-types": "^0.0.15",
50
51
  "@lexical/html": "^0.33.1",
51
52
  "@lexical/link": "^0.33.1",
52
53
  "@lexical/react": "^0.33.1",
@@ -55,6 +56,7 @@
55
56
  "@lexical/utils": "^0.33.1",
56
57
  "clsx": "^2.1.1",
57
58
  "fuse.js": "^7.1.0",
59
+ "ahooks": "^3.8.5",
58
60
  "lexical": "^0.33.1",
59
61
  "lodash-es": "^4.17.21",
60
62
  "simplebar-react": "^3.3.2",
@@ -70,7 +72,6 @@
70
72
  "@types/react-dom": "^18.3.0",
71
73
  "@types/tinycolor2": "^1.4.6",
72
74
  "@vitejs/plugin-react": "^6.0.0",
73
- "ahooks": "^3.8.5",
74
75
  "antd": "^5.26.2",
75
76
  "glob": "^11.0.3",
76
77
  "motion": "^11.18.2",