@baishuyun/ui-base 3.0.1 → 6.0.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.
Files changed (40) hide show
  1. package/dist/Amap/AmapCircle/index.js +1 -1
  2. package/dist/Amap/AmapCircle-mh92P2l6.js +55 -0
  3. package/dist/Amap/AmapProvider/index.js +2 -2
  4. package/dist/Amap/{AmapProvider-CWbRK6QL.js → AmapProvider-BkJp-sWi.js} +1 -1
  5. package/dist/Amap/index.js +3 -3
  6. package/dist/ColorPicker/{ColorPicker-B-KaMDAn.js → ColorPicker-nnQIw0_e.js} +7 -7
  7. package/dist/ColorPicker/index.js +1 -1
  8. package/dist/ConfigProvider/index.js +1 -1
  9. package/dist/Editor/{Buttons-CZOTyAPL.js → Buttons-D17RQIEb.js} +27 -27
  10. package/dist/Editor/ToolbarPlugin/Buttons/index.js +3 -3
  11. package/dist/Editor/index.js +3 -3
  12. package/dist/Modal/{Modal-CuDbh_WD.js → Modal-CweuD-VO.js} +37 -29
  13. package/dist/Modal/index.js +1 -1
  14. package/dist/Select/{Select-xuQGK6It.js → Select-D8T0S1_m.js} +6 -6
  15. package/dist/Select/index.js +1 -1
  16. package/dist/components/Amap/Amap.d.ts +1 -1
  17. package/dist/components/Amap/{interface.d.ts → Amap.type.d.ts} +187 -4
  18. package/dist/components/Amap/AmapCircle/AmapCircle.d.ts +1 -1
  19. package/dist/components/Amap/AmapMarker/AmapMarker.d.ts +1 -1
  20. package/dist/components/Amap/AmapMarker/useMarkerInfoWindow.d.ts +1 -1
  21. package/dist/components/Amap/AmapMarker/useMarkerInfoWindowController.d.ts +1 -1
  22. package/dist/components/Amap/AmapMarkerCluster/AmapMarkerCluster.d.ts +1 -1
  23. package/dist/components/Amap/AmapMarkerCluster/AmapMarkerCluster.type.d.ts +1 -1
  24. package/dist/components/Amap/AmapMarkerCluster/utils.d.ts +1 -1
  25. package/dist/components/Amap/AmapProvider/AmapProvider.d.ts +1 -1
  26. package/dist/components/Amap/context/AmapContext.d.ts +1 -1
  27. package/dist/components/Amap/hooks/useAmap.d.ts +1 -1
  28. package/dist/components/Amap/hooks/useCurrentLocation.d.ts +1 -1
  29. package/dist/components/Amap/index.d.ts +1 -1
  30. package/dist/components/Amap/utils/currentLocation.d.ts +1 -1
  31. package/dist/components/Modal/Modal.type.d.ts +4 -0
  32. package/dist/components/index.d.ts +1 -1
  33. package/dist/components/theme.d.ts +6 -0
  34. package/dist/index.js +22 -48
  35. package/dist/style.css +1 -1
  36. package/dist/{ConfigProvider/ConfigProvider-Bx-uxnns.js → vendors/ConfigProvider-BekyDD3V.js} +86 -22
  37. package/package.json +5 -9
  38. package/dist/Amap/AmapCircle-BP187l-8.js +0 -62
  39. package/dist/locale/LocaleProvider.d.ts +0 -9
  40. /package/dist/locale/__tests__/{LocaleProvider.test.d.ts → locale.test.d.ts} +0 -0
@@ -1,7 +1,8 @@
1
- import { n as e, t } from "../vendors/LocaleContext-Jj_JGgi2.js";
1
+ import { n as e, t } from "./LocaleContext-Jj_JGgi2.js";
2
2
  import { jsx as n } from "react/jsx-runtime";
3
3
  import { createContext as r, useCallback as i, useContext as a, useMemo as o } from "react";
4
- var s = {
4
+ import { ConfigProvider as s } from "antd";
5
+ var c = {
5
6
  select: "請選擇",
6
7
  search: "搜尋",
7
8
  noFindData: "未搜尋到任何資料",
@@ -61,7 +62,7 @@ var s = {
61
62
  picture: "圖片",
62
63
  addPicture: "新增圖片",
63
64
  customColor: "自訂顏色"
64
- }, c = {
65
+ }, l = {
65
66
  select: "Please select",
66
67
  search: "search",
67
68
  noFindData: "No search data",
@@ -121,12 +122,72 @@ var s = {
121
122
  picture: "Picture",
122
123
  customColor: "Custom Color",
123
124
  addPicture: "Add Picture"
124
- }, l = r({}), u = () => a(l), d = (...e) => e.reduce((e, t) => (t && Object.entries(t).forEach(([t, n]) => {
125
+ }, u = {
126
+ token: {
127
+ fontFamily: "-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, PingFang SC, Noto Sans, Noto Sans CJK SC, Microsoft YaHei, 微软雅黑, sans-serif",
128
+ colorPrimary: "#0265ff",
129
+ borderRadius: 4
130
+ },
131
+ components: {
132
+ Input: {
133
+ controlHeight: 34,
134
+ paddingInline: 10,
135
+ activeShadow: "none",
136
+ activeBorderColor: "#0265ff",
137
+ colorTextPlaceholder: "#999"
138
+ },
139
+ InputNumber: {
140
+ controlHeight: 34,
141
+ paddingInline: 10,
142
+ colorTextPlaceholder: "#999",
143
+ activeShadow: "none"
144
+ },
145
+ DatePicker: {
146
+ paddingInline: 10,
147
+ controlHeight: 34,
148
+ colorTextPlaceholder: "#999",
149
+ cellWidth: 36,
150
+ cellHeight: 36
151
+ },
152
+ Button: {
153
+ borderRadius: 4,
154
+ dangerShadow: "none",
155
+ defaultShadow: "none",
156
+ primaryShadow: "none",
157
+ colorError: "#ff5631",
158
+ colorLink: "#0265ff",
159
+ colorLinkHover: "rgba(2,99,255,0.8)",
160
+ colorErrorHover: "rgba(255,87,49,0.8)",
161
+ defaultHoverBg: "#e5e5e5",
162
+ defaultHoverColor: "#121211",
163
+ defaultActiveBg: "#e5e5e5",
164
+ defaultColor: "#121211",
165
+ defaultActiveColor: "#121211",
166
+ defaultHoverBorderColor: "#e5e5e5",
167
+ defaultActiveBorderColor: "#e5e5e5"
168
+ },
169
+ Popover: {
170
+ sizePopupArrow: 0,
171
+ borderRadius: 4,
172
+ padding: 10,
173
+ colorText: "#121211",
174
+ boxShadowSecondary: "0px 0px 10px 0px rgba(0, 0, 0, 0.08);"
175
+ },
176
+ Segmented: {
177
+ itemColor: "#121211",
178
+ itemSelectedColor: "#0265ff",
179
+ trackBg: "#f3f3f3",
180
+ colorPrimaryBorder: "#e0e0e0",
181
+ controlHeight: 34,
182
+ borderRadius: 4
183
+ }
184
+ }
185
+ }, d = r({}), f = () => a(d), p = (...e) => e.reduce((e, t) => (t && Object.entries(t).forEach(([t, n]) => {
125
186
  e[t] = {
126
187
  ...e[t] || {},
127
188
  ...n || {}
128
189
  };
129
- }), e), {}), f = (e, t) => {
190
+ }), e), {}), m = (e, t) => {
130
191
  if (!e && !t) return;
131
192
  let n = Array.from(new Set([...e?.plugins || [], ...t?.plugins || []]));
132
193
  return {
@@ -134,26 +195,29 @@ var s = {
134
195
  ...t,
135
196
  plugins: n.length ? n : void 0
136
197
  };
137
- }, p = (r) => {
138
- let u = a(l), p = a(t), { children: m, locale: h = p.locale, messages: g = {}, amap: _ } = r, v = o(() => d({
198
+ }, h = (r) => {
199
+ let f = a(d), h = a(t), { children: g, locale: _ = h.locale, messages: v = {}, amap: y } = r, b = o(() => p({
139
200
  "zh-CN": e,
140
- "zh-TW": s,
141
- "en-US": c
142
- }, g), [g]), y = o(() => v[h] || e, [v, h]), b = i((e) => {
143
- let t = e.split("."), n = y;
144
- for (let r of t) if (n = n[r], !n) return console.warn(`[LocaleProvider] Cannot find translation for key: ${e}`), e;
201
+ "zh-TW": c,
202
+ "en-US": l
203
+ }, v), [v]), x = o(() => b[_] || e, [b, _]), S = i((e) => {
204
+ let t = e.split("."), n = x;
205
+ for (let r of t) if (n = n[r], !n) return console.warn(`[ConfigProvider] Cannot find translation for key: ${e}`), e;
145
206
  return typeof n == "string" ? n : e;
146
- }, [y]), x = o(() => ({
147
- locale: h,
148
- t: b
149
- }), [h, b]), S = o(() => ({ amap: f(u.amap, _) }), [_, u.amap]);
150
- return /* @__PURE__ */ n(l.Provider, {
151
- value: S,
152
- children: /* @__PURE__ */ n(t.Provider, {
153
- value: x,
154
- children: m
207
+ }, [x]), C = o(() => ({
208
+ locale: _,
209
+ t: S
210
+ }), [_, S]), w = o(() => ({ amap: m(f.amap, y) }), [y, f.amap]);
211
+ return /* @__PURE__ */ n(s, {
212
+ theme: u,
213
+ children: /* @__PURE__ */ n(d.Provider, {
214
+ value: w,
215
+ children: /* @__PURE__ */ n(t.Provider, {
216
+ value: C,
217
+ children: g
218
+ })
155
219
  })
156
220
  });
157
221
  };
158
222
  //#endregion
159
- export { s as i, u as n, c as r, p as t };
223
+ export { f as n, u as r, h as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baishuyun/ui-base",
3
- "version": "3.0.1",
3
+ "version": "6.0.0",
4
4
  "type": "module",
5
5
  "description": "百数云低代码平台通用组件库",
6
6
  "author": "bsy-fe team",
@@ -23,10 +23,6 @@
23
23
  "types": "./dist/components/index.d.ts"
24
24
  },
25
25
  "./style.css": "./dist/style.css",
26
- "./locale": {
27
- "import": "./dist/locale/index.js",
28
- "types": "./dist/locale/index.d.ts"
29
- },
30
26
  "./*": {
31
27
  "import": "./dist/*/index.js",
32
28
  "types": "./dist/components/*/index.d.ts"
@@ -38,9 +34,9 @@
38
34
  ],
39
35
  "keywords": [],
40
36
  "peerDependencies": {
41
- "@ant-design/icons": ">=6.0.0",
37
+ "@ant-design/icons": ">=6.0.0 <7.0.0",
42
38
  "@floating-ui/react": ">=0.27.0",
43
- "antd": ">=5.1.2",
39
+ "antd": ">=6.0.0 <7.0.0",
44
40
  "motion": "^11.18.2",
45
41
  "react": ">=18.3.0",
46
42
  "react-dom": ">=18.3.0"
@@ -63,7 +59,7 @@
63
59
  "tinycolor2": "^1.6.0"
64
60
  },
65
61
  "devDependencies": {
66
- "@ant-design/icons": "^6.0.0",
62
+ "@ant-design/icons": "^6.2.3",
67
63
  "@floating-ui/react": "^0.27.16",
68
64
  "@tailwindcss/typography": "^0.5.16",
69
65
  "@types/lodash-es": "^4.17.12",
@@ -72,7 +68,7 @@
72
68
  "@types/react-dom": "^18.3.0",
73
69
  "@types/tinycolor2": "^1.4.6",
74
70
  "@vitejs/plugin-react": "^6.0.0",
75
- "antd": "^5.26.2",
71
+ "antd": "^6.4.2",
76
72
  "glob": "^11.0.3",
77
73
  "motion": "^11.18.2",
78
74
  "postcss": "^8.5.3",
@@ -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 };
@@ -1,9 +0,0 @@
1
- import { PropsWithChildren } from 'react';
2
- import { Locale } from './index';
3
- /**
4
- * @deprecated LocaleProvider will be removed in the next major version. Please use ConfigProvider.
5
- */
6
- export declare const LocaleProvider: React.FC<{
7
- locale?: Locale;
8
- messages?: Record<string, any>;
9
- } & PropsWithChildren>;