@baishuyun/ui-base 2.4.1 → 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.
- package/dist/Amap/Amap-DL5dLiUm.js +77 -0
- package/dist/Amap/AmapCircle/index.js +4 -0
- package/dist/Amap/AmapCircle-BP187l-8.js +62 -0
- package/dist/Amap/AmapContext-JaYk1a3H.js +11 -0
- package/dist/Amap/AmapMarker/index.js +5 -0
- package/dist/Amap/AmapMarker-DYW0-8Hd.js +152 -0
- package/dist/Amap/AmapMarkerCluster/index.js +5 -0
- package/dist/Amap/AmapMarkerCluster-BRVHHMbi.js +241 -0
- package/dist/Amap/AmapProvider/index.js +5 -0
- package/dist/Amap/AmapProvider-CWbRK6QL.js +107 -0
- package/dist/Amap/hooks/index.js +3 -0
- package/dist/Amap/hooks-D1m8KgVM.js +121 -0
- package/dist/Amap/index.js +11 -0
- package/dist/Amap/useMarkerInfoWindowController-CRgf2I0Q.js +94 -0
- package/dist/Card/index.js +1 -1
- package/dist/CheckBox/{CheckBox-Cz6KW9Lw.js → CheckBox-B04hZKaC.js} +1 -1
- package/dist/CheckBox/index.js +2 -2
- package/dist/ColorPicker/{ColorPicker-C1kG_eI-.js → ColorPicker-B-KaMDAn.js} +3 -3
- package/dist/ColorPicker/index.js +4 -3
- package/dist/ConfigProvider/ConfigProvider-Bx-uxnns.js +159 -0
- package/dist/ConfigProvider/index.js +3 -0
- package/dist/DropDown/{DropDown-BAPBTglm.js → DropDown-CMKiQDrc.js} +5 -5
- package/dist/DropDown/index.js +6 -5
- package/dist/Editor/{Buttons-CsKKYGbV.js → Buttons-CZOTyAPL.js} +49 -49
- package/dist/Editor/ToolbarPlugin/Buttons/index.js +12 -11
- package/dist/Editor/index.js +12 -11
- package/dist/InputTag/index.js +1 -1
- package/dist/Loading/index.js +1 -1
- package/dist/Modal/index.js +1 -1
- package/dist/NotFoundContent/index.js +1 -1
- package/dist/Radio/index.js +1 -1
- package/dist/Segmented/index.js +1 -1
- package/dist/Select/{Select-DyV_1e23.js → Select-xuQGK6It.js} +7 -7
- package/dist/Select/{SelectInputSearch-DMY6Y9B6.js → SelectInputSearch-Dm3CI_L4.js} +1 -1
- package/dist/Select/index.js +10 -9
- package/dist/Tabs/{Tabs-BqT-_eVo.js → Tabs-Cxf7jwys.js} +3 -3
- package/dist/Tabs/index.js +3 -3
- package/dist/Tree/index.js +3 -3
- package/dist/components/Amap/Amap.d.ts +3 -0
- package/dist/components/Amap/AmapCircle/AmapCircle.d.ts +3 -0
- package/dist/components/Amap/AmapCircle/index.d.ts +1 -0
- package/dist/components/Amap/AmapMarker/AmapMarker.d.ts +3 -0
- package/dist/components/Amap/AmapMarker/__tests__/AmapMarker.test.d.ts +1 -0
- package/dist/components/Amap/AmapMarker/index.d.ts +1 -0
- package/dist/components/Amap/AmapMarker/useMarkerInfoWindow.d.ts +15 -0
- package/dist/components/Amap/AmapMarker/useMarkerInfoWindowController.d.ts +13 -0
- package/dist/components/Amap/AmapMarkerCluster/AmapMarkerCluster.d.ts +3 -0
- package/dist/components/Amap/AmapMarkerCluster/AmapMarkerCluster.type.d.ts +25 -0
- package/dist/components/Amap/AmapMarkerCluster/__tests__/AmapMarkerCluster.test.d.ts +1 -0
- package/dist/components/Amap/AmapMarkerCluster/index.d.ts +1 -0
- package/dist/components/Amap/AmapMarkerCluster/utils.d.ts +26 -0
- package/dist/components/Amap/AmapProvider/AmapProvider.d.ts +3 -0
- package/dist/components/Amap/AmapProvider/__tests__/AmapProvider.test.d.ts +1 -0
- package/dist/components/Amap/AmapProvider/index.d.ts +1 -0
- package/dist/components/Amap/__tests__/Amap.test.d.ts +1 -0
- package/dist/components/Amap/amap-types.d.ts +44 -0
- package/dist/components/Amap/context/AmapContext.d.ts +3 -0
- package/dist/components/Amap/hooks/__tests__/useCurrentLocation.test.d.ts +1 -0
- package/dist/components/Amap/hooks/index.d.ts +2 -0
- package/dist/components/Amap/hooks/useAmap.d.ts +2 -0
- package/dist/components/Amap/hooks/useCurrentLocation.d.ts +2 -0
- package/dist/components/Amap/index.d.ts +7 -0
- package/dist/components/Amap/interface.d.ts +142 -0
- package/dist/components/Amap/loader.d.ts +9 -0
- package/dist/components/Amap/utils/currentLocation.d.ts +18 -0
- package/dist/components/ConfigProvider/ConfigProvider.d.ts +3 -0
- package/dist/components/ConfigProvider/ConfigProvider.type.d.ts +16 -0
- package/dist/components/ConfigProvider/__tests__/ConfigProvider.test.d.ts +1 -0
- package/dist/components/ConfigProvider/context.d.ts +3 -0
- package/dist/components/ConfigProvider/index.d.ts +3 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/index.js +49 -155
- package/dist/locale/LocaleProvider.d.ts +3 -0
- package/dist/locale/__tests__/LocaleProvider.test.d.ts +1 -0
- package/dist/vendors/{useLocale-BXnqO-Ju.js → LocaleContext-Jj_JGgi2.js} +7 -7
- package/dist/vendors/{Tree-P9E06Unm.js → Tree-Bg2UzLsC.js} +2 -2
- package/dist/vendors/useLocale-Mk0d7wNt.js +6 -0
- package/dist/vite-env.d.ts +7 -0
- package/package.json +4 -3
- /package/dist/Card/{Card-CaKTq_1y.js → Card-D__c94yx.js} +0 -0
- /package/dist/CheckBox/{CheckBox-l__wOnmH.js → CheckBox-DF201Nxg.js} +0 -0
- /package/dist/InputTag/{InputTag-V4UnUnGJ.js → InputTag-F2Dv-r56.js} +0 -0
- /package/dist/Loading/{Loading-Dy5A--HK.js → Loading-dsLWSWsE.js} +0 -0
- /package/dist/Modal/{Modal-DQ5bptu_.js → Modal-CuDbh_WD.js} +0 -0
- /package/dist/NotFoundContent/{NotFoundContent-1-41e1rN.js → NotFoundContent-DJUQ0_2D.js} +0 -0
- /package/dist/Radio/{Radio-CZOrtNyn.js → Radio-WNw-VqIS.js} +0 -0
- /package/dist/Segmented/{Segmented-DEGgLO-b.js → Segmented-Byw8j1hQ.js} +0 -0
- /package/dist/{locale/LocaleProvider.test.d.ts → components/Amap/AmapCircle/__tests__/AmapCircle.test.d.ts} +0 -0
- /package/dist/vendors/{animations-DvjIfVz9.js → animations-C2i5EijE.js} +0 -0
- /package/dist/vendors/{color-CyuNdAfc.js → color-CxdZwdYM.js} +0 -0
- /package/dist/vendors/{useFloatingPortal-W4pliYWU.js → useFloatingPortal-CDgiCnbb.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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,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,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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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,164 +1,58 @@
|
|
|
1
1
|
import { t as e } from "./Icon/Icon-CTZCSuVg.js";
|
|
2
|
-
import { n as t,
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { t as
|
|
6
|
-
import "./
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
import "./
|
|
10
|
-
import { t as
|
|
11
|
-
import "./
|
|
12
|
-
import { t as
|
|
13
|
-
import { t as
|
|
14
|
-
import { t as
|
|
15
|
-
import "./vendors/
|
|
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
|
|
18
|
-
import { t as
|
|
19
|
-
import { t as
|
|
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
|
|
22
|
-
import { jsx as
|
|
23
|
-
import { useCallback as
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
rightAlign: "右對齊",
|
|
37
|
-
underline: "底線",
|
|
38
|
-
link: "連結",
|
|
39
|
-
hyperLink: "超連結",
|
|
40
|
-
showContent: "顯示文字",
|
|
41
|
-
linkAddress: "連結地址",
|
|
42
|
-
openInNewTab: "在新頁面開啟",
|
|
43
|
-
confirm: "確認",
|
|
44
|
-
cancel: "取消",
|
|
45
|
-
cancelLink: "取消連結",
|
|
46
|
-
presetColors: "預設顏色",
|
|
47
|
-
editor: {
|
|
48
|
-
linkTip: "支援 https:// 連結或 @表單別名",
|
|
49
|
-
bold: "粗體",
|
|
50
|
-
italic: "斜體",
|
|
51
|
-
fontSize: "字號",
|
|
52
|
-
fontColor: "顏色",
|
|
53
|
-
fill: "填滿",
|
|
54
|
-
alignment: "對齊方式",
|
|
55
|
-
centerAlign: "置中對齊",
|
|
56
|
-
rightAlign: "右對齊",
|
|
57
|
-
uploadImage: "上傳圖片",
|
|
58
|
-
imageUrl: "圖片 URL",
|
|
59
|
-
imageUrlPlaceholder: "請輸入圖片 URL",
|
|
60
|
-
imageUrlRequired: "請輸入圖片 URL",
|
|
61
|
-
imageUrlInvalid: "請輸入有效的圖片 URL",
|
|
62
|
-
imageUrlNote: "註:輸入圖片 URL 即可插入圖片",
|
|
63
|
-
inputImageUrl: "輸入圖片 URL",
|
|
64
|
-
uploadImageNote: "註:單張圖片大小不能超過 1MB",
|
|
65
|
-
uploadImageText: "點擊或拖曳上傳圖片",
|
|
66
|
-
previewImage: "預覽圖片",
|
|
67
|
-
underline: "底線",
|
|
68
|
-
imageFormatOnly: "僅支援圖片格式",
|
|
69
|
-
imageSizeNote: "註:圖片大小不能超過 1MB",
|
|
70
|
-
uploadImageFirst: "請先上傳圖片",
|
|
71
|
-
imageAddSuccess: "圖片新增成功",
|
|
72
|
-
operationFailed: "操作失敗",
|
|
73
|
-
onlyImageFormatsSupported: "僅支援圖片格式",
|
|
74
|
-
pleaseUploadImageFirst: "請先上傳圖片",
|
|
75
|
-
clickOrDragToUpload: "點擊或拖曳上傳圖片",
|
|
76
|
-
enterImageUrl: "輸入圖片 URL",
|
|
77
|
-
pleaseEnterImageUrl: "請輸入圖片 URL",
|
|
78
|
-
pleaseEnterValidImageUrl: "請輸入有效的圖片 URL",
|
|
79
|
-
linkAddressEmpty: "連結地址不能為空"
|
|
80
|
-
},
|
|
81
|
-
picture: "圖片",
|
|
82
|
-
addPicture: "新增圖片",
|
|
83
|
-
customColor: "自訂顏色"
|
|
84
|
-
}, x = {
|
|
85
|
-
select: "Please select",
|
|
86
|
-
search: "search",
|
|
87
|
-
noFindData: "No search data",
|
|
88
|
-
allSelect: "Select All",
|
|
89
|
-
context: "Please enter the content",
|
|
90
|
-
noData: "No Data",
|
|
91
|
-
noDataFound: "No Data Found",
|
|
92
|
-
dataSearching: "Data Searching...",
|
|
93
|
-
allSelectedBySearch: "Select All by Search",
|
|
94
|
-
leftAlign: "Left Align",
|
|
95
|
-
centerAlign: "Center Align",
|
|
96
|
-
rightAlign: "Right Align",
|
|
97
|
-
underline: "Underline",
|
|
98
|
-
link: "Link",
|
|
99
|
-
hyperLink: "Hyper Link",
|
|
100
|
-
showContent: "Show Content",
|
|
101
|
-
linkAddress: "Link Address",
|
|
102
|
-
openInNewTab: "Open in New Tab",
|
|
103
|
-
confirm: "Confirm",
|
|
104
|
-
cancel: "Cancel",
|
|
105
|
-
cancelLink: "Cancel Link",
|
|
106
|
-
presetColors: "preset color",
|
|
107
|
-
editor: {
|
|
108
|
-
linkTip: "Support https://link or @form alias",
|
|
109
|
-
bold: "Bold",
|
|
110
|
-
italic: "Italic",
|
|
111
|
-
fontSize: "Font Size",
|
|
112
|
-
fontColor: "Font Color",
|
|
113
|
-
fill: "fill",
|
|
114
|
-
alignment: "Alignment",
|
|
115
|
-
centerAlign: "Center Align",
|
|
116
|
-
rightAlign: "Right Align",
|
|
117
|
-
uploadImage: "Upload Image",
|
|
118
|
-
imageUrl: "Image URL",
|
|
119
|
-
imageUrlPlaceholder: "Please enter image URL",
|
|
120
|
-
imageUrlRequired: "Please enter image URL",
|
|
121
|
-
imageUrlInvalid: "Please enter a valid image URL",
|
|
122
|
-
imageUrlNote: "Note: Enter image URL to insert image",
|
|
123
|
-
inputImageUrl: "Enter Image URL",
|
|
124
|
-
uploadImageNote: "Note: Single image size cannot exceed 1MB",
|
|
125
|
-
uploadImageText: "Click or drag to upload image",
|
|
126
|
-
previewImage: "Preview Image",
|
|
127
|
-
underline: "Underline",
|
|
128
|
-
imageFormatOnly: "Only image formats are supported",
|
|
129
|
-
uploadImageFirst: "Please upload image first",
|
|
130
|
-
imageAddSuccess: "Image added successfully",
|
|
131
|
-
operationFailed: "Operation failed",
|
|
132
|
-
onlyImageFormatsSupported: "Only image formats are supported",
|
|
133
|
-
pleaseUploadImageFirst: "Please upload image first",
|
|
134
|
-
imageSizeNote: "Image size cannot exceed 1MB",
|
|
135
|
-
clickOrDragToUpload: "Click or drag to upload image",
|
|
136
|
-
enterImageUrl: "Enter image URL",
|
|
137
|
-
pleaseEnterImageUrl: "Please enter image URL",
|
|
138
|
-
pleaseEnterValidImageUrl: "Please enter a valid image URL",
|
|
139
|
-
linkAddressEmpty: "Link address cannot be empty"
|
|
140
|
-
},
|
|
141
|
-
picture: "Picture",
|
|
142
|
-
customColor: "Custom Color",
|
|
143
|
-
addPicture: "Add Picture"
|
|
144
|
-
}, S = ({ children: e, locale: r = "zh-CN", messages: i = {} }) => {
|
|
145
|
-
let a = y(() => ({
|
|
146
|
-
"zh-CN": n,
|
|
147
|
-
"zh-TW": b,
|
|
148
|
-
"en-US": x,
|
|
149
|
-
...i
|
|
150
|
-
}), [i]), o = y(() => a[r] || n, [r, a]), s = v((e) => {
|
|
151
|
-
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;
|
|
152
46
|
for (let r of t) if (n = n[r], !n) return console.warn(`[LocaleProvider] Cannot find translation for key: ${e}`), e;
|
|
153
47
|
return typeof n == "string" ? n : e;
|
|
154
|
-
}, [
|
|
155
|
-
locale:
|
|
156
|
-
t:
|
|
157
|
-
}), [
|
|
158
|
-
return /* @__PURE__ */
|
|
159
|
-
value:
|
|
48
|
+
}, [c]), u = k(() => ({
|
|
49
|
+
locale: a,
|
|
50
|
+
t: l
|
|
51
|
+
}), [a, l]);
|
|
52
|
+
return /* @__PURE__ */ D(n.Provider, {
|
|
53
|
+
value: u,
|
|
160
54
|
children: e
|
|
161
55
|
});
|
|
162
56
|
};
|
|
163
57
|
//#endregion
|
|
164
|
-
export {
|
|
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,5 +1,5 @@
|
|
|
1
|
-
import { createContext as e
|
|
2
|
-
var
|
|
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
|
-
},
|
|
62
|
+
}, n = e({
|
|
63
63
|
locale: "zh-CN",
|
|
64
64
|
t: (e) => {
|
|
65
|
-
let
|
|
65
|
+
let n = e.split("."), r = t;
|
|
66
66
|
try {
|
|
67
|
-
for (let e of
|
|
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
|
-
})
|
|
73
|
+
});
|
|
74
74
|
//#endregion
|
|
75
|
-
export {
|
|
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-
|
|
3
|
-
import { t as n } from "../Radio/Radio-
|
|
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";
|
package/dist/vite-env.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baishuyun/ui-base",
|
|
3
|
-
"version": "
|
|
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",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|