@baishuyun/ui-base 2.3.3 → 2.4.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 (58) hide show
  1. package/dist/Card/{Card-F2t4Rv_v.js → Card-CaKTq_1y.js} +17 -17
  2. package/dist/Card/index.js +2 -2
  3. package/dist/CheckBox/CheckBox-Cz6KW9Lw.js +33 -0
  4. package/dist/CheckBox/{CheckBox-DFoMXJZz.js → CheckBox-l__wOnmH.js} +25 -25
  5. package/dist/CheckBox/index.js +3 -3
  6. package/dist/ColorPicker/ColorPicker-C1kG_eI-.js +168 -0
  7. package/dist/ColorPicker/index.js +4 -5
  8. package/dist/DropDown/DropDown-BAPBTglm.js +162 -0
  9. package/dist/DropDown/index.js +6 -6
  10. package/dist/Editor/{Buttons-ClWtl3G-.js → Buttons-CsKKYGbV.js} +207 -204
  11. package/dist/Editor/ToolbarPlugin/Buttons/index.js +12 -13
  12. package/dist/Editor/index.js +207 -196
  13. package/dist/Icon/Icon-CTZCSuVg.js +19 -0
  14. package/dist/Icon/index.js +1 -1
  15. package/dist/InputTag/{InputTag-DbiyuWo9.js → InputTag-V4UnUnGJ.js} +33 -33
  16. package/dist/InputTag/index.js +2 -2
  17. package/dist/Loading/index.js +1 -1
  18. package/dist/Modal/{Modal-BO1s8pJe.js → Modal-DQ5bptu_.js} +1 -1
  19. package/dist/Modal/index.js +2 -2
  20. package/dist/NotFoundContent/index.js +1 -1
  21. package/dist/Radio/{Radio-dyoBNiKF.js → Radio-CZOrtNyn.js} +25 -25
  22. package/dist/Radio/index.js +1 -1
  23. package/dist/Segmented/{Segmented-Dd8glDXI.js → Segmented-DEGgLO-b.js} +15 -15
  24. package/dist/Segmented/index.js +1 -1
  25. package/dist/Select/Select-DyV_1e23.js +729 -0
  26. package/dist/Select/{SelectInputSearch-gp6gcY3x.js → SelectInputSearch-DMY6Y9B6.js} +2 -2
  27. package/dist/Select/index.js +10 -10
  28. package/dist/Tabs/{Tabs-Dsxn_7gF.js → Tabs-BqT-_eVo.js} +138 -138
  29. package/dist/Tabs/index.js +4 -5
  30. package/dist/Tree/index.js +4 -4
  31. package/dist/Tree/utils/index.js +1 -1
  32. package/dist/components/Tree/Tree.test.d.ts +1 -0
  33. package/dist/components/Tree/context/TreeContext.d.ts +1 -1
  34. package/dist/components/Tree/types/tree.d.ts +1 -1
  35. package/dist/index.js +83 -23
  36. package/dist/locale/LocaleProvider.test.d.ts +1 -0
  37. package/dist/locale/index.d.ts +1 -1
  38. package/dist/locale/lang/zh-TW.json.d.ts +64 -0
  39. package/dist/vendors/Tree-P9E06Unm.js +231 -0
  40. package/dist/vendors/{color-BPWy9DvT.js → color-CyuNdAfc.js} +2 -2
  41. package/package.json +3 -1
  42. package/dist/CheckBox/CheckBox-q2vu7qf7.js +0 -33
  43. package/dist/ColorPicker/ColorPicker-Bh4KTHxh.js +0 -168
  44. package/dist/DropDown/DropDown-BEzloRRM.js +0 -162
  45. package/dist/Icon/Icon-DXmPqVzg.js +0 -19
  46. package/dist/Select/Select-DoQO-Xi5.js +0 -729
  47. package/dist/vendors/Tree-DgwG7Unx.js +0 -231
  48. package/dist/vendors/clsx-DNOE4Gl8.js +0 -16
  49. package/dist/vendors/fuse.js-BKtvbTjL.js +0 -877
  50. package/dist/vendors/lexical-hZliMgDv.js +0 -6439
  51. package/dist/vendors/lodash-es-Bu9xU1fK.js +0 -334
  52. package/dist/vendors/simplebar-react-CFlS-Nm9.js +0 -370
  53. package/dist/vendors/tinycolor2-DToeAEPD.js +0 -726
  54. /package/dist/Loading/{Loading-Bi5NO-Ky.js → Loading-Dy5A--HK.js} +0 -0
  55. /package/dist/NotFoundContent/{NotFoundContent-CTPpcZOt.js → NotFoundContent-1-41e1rN.js} +0 -0
  56. /package/dist/vendors/{animations-C5JKFkz4.js → animations-DvjIfVz9.js} +0 -0
  57. /package/dist/vendors/{useFloatingPortal-BA6P5GxV.js → useFloatingPortal-W4pliYWU.js} +0 -0
  58. /package/dist/vendors/{useLocale-BfT0V1j4.js → useLocale-BXnqO-Ju.js} +0 -0
@@ -1,10 +1,10 @@
1
- import { t as e } from "../Icon/Icon-DXmPqVzg.js";
2
- import { t } from "../vendors/clsx-DNOE4Gl8.js";
3
- import { t as n } from "../vendors/simplebar-react-CFlS-Nm9.js";
4
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
- import { useCallback as a, useEffect as o, useLayoutEffect as s, useRef as c, useState as l } from "react";
6
- import { useControllableValue as u } from "ahooks";
7
- import { motion as d } from "motion/react";
1
+ import { t as e } from "../Icon/Icon-CTZCSuVg.js";
2
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ import { useCallback as r, useEffect as i, useLayoutEffect as a, useRef as o, useState as s } from "react";
4
+ import c from "clsx";
5
+ import { useControllableValue as l } from "ahooks";
6
+ import { motion as u } from "motion/react";
7
+ import d from "simplebar-react";
8
8
  //#region src/components/InputTag/input-tag.module.scss
9
9
  var f = {
10
10
  "bsy-inputTag": "_bsy-inputTag_46spj_11",
@@ -20,8 +20,8 @@ var f = {
20
20
  CONTAINER_PADDING: 10,
21
21
  INPUT_MARGIN: 4
22
22
  }, m = (e, t) => {
23
- let [n, r] = l(0);
24
- return s(() => {
23
+ let [n, r] = s(0);
24
+ return a(() => {
25
25
  let t = e.current;
26
26
  if (!t) return;
27
27
  let n = () => {
@@ -37,11 +37,11 @@ var f = {
37
37
  };
38
38
  }, [t, e]), n;
39
39
  }, h = (h) => {
40
- let { defaultValue: g, enableActive: _ = !1, defaultActiveIndex: v, onActiveIndexChange: y } = h, [b, x] = u(h, { defaultValue: g || [] }), [S, C] = u(h, {
40
+ let { defaultValue: g, enableActive: _ = !1, defaultActiveIndex: v, onActiveIndexChange: y } = h, [b, x] = l(h, { defaultValue: g || [] }), [S, C] = l(h, {
41
41
  valuePropName: "activeIndex",
42
42
  trigger: "onActiveIndexChange",
43
43
  defaultValue: v
44
- }), [w, T] = l(""), E = c(null), D = c(null), O = c(null), k = c(!1), A = () => {
44
+ }), [w, T] = s(""), E = o(null), D = o(null), O = o(null), k = o(!1), A = () => {
45
45
  if (D.current && D.current.children.length > 0) {
46
46
  let e = D.current.children.length - 1;
47
47
  D.current.children[e].scrollIntoView({
@@ -51,7 +51,7 @@ var f = {
51
51
  });
52
52
  }
53
53
  };
54
- o(() => {
54
+ i(() => {
55
55
  k.current && b.length > 0 && (A(), k.current = !1);
56
56
  }, [b.length]);
57
57
  let j = (e) => {
@@ -70,12 +70,12 @@ var f = {
70
70
  e.key === "Enter" || e.key === "NumpadEnter" ? M() : e.key === "Backspace" && w === "" && b.length > 0 && x(b.slice(0, -1));
71
71
  }, F = (e) => {
72
72
  x(b.filter((t, n) => n !== e));
73
- }, [I, L] = l(0), R = m(D, b.length), z = a(() => {
73
+ }, [I, L] = s(0), R = m(D, b.length), z = r(() => {
74
74
  if (!E.current || !O.current) return;
75
75
  let e = E.current.clientWidth - O.current.clientWidth - p.INPUT_MARGIN - p.CONTAINER_PADDING, t = Math.max(0, e);
76
76
  L((e) => e === t ? e : t);
77
77
  }, []);
78
- s(() => {
78
+ a(() => {
79
79
  if (!E.current || !O.current) return;
80
80
  z();
81
81
  let e = new ResizeObserver(() => {
@@ -86,46 +86,46 @@ var f = {
86
86
  };
87
87
  }, [z]);
88
88
  let B = Math.min(R, I);
89
- return /* @__PURE__ */ i("div", {
89
+ return /* @__PURE__ */ n("div", {
90
90
  className: f["bsy-inputTag"],
91
91
  ref: E,
92
- children: [/* @__PURE__ */ r("div", {
92
+ children: [/* @__PURE__ */ t("div", {
93
93
  className: f["bsy-inputTag__container"],
94
- children: b.length ? /* @__PURE__ */ r(n, {
94
+ children: b.length ? /* @__PURE__ */ t(d, {
95
95
  style: { width: B + "px" },
96
- children: /* @__PURE__ */ r("div", {
96
+ children: /* @__PURE__ */ t("div", {
97
97
  className: "flex gap-1 py-[3px]",
98
98
  ref: D,
99
- children: b.map((n, a) => /* @__PURE__ */ i(d.div, {
100
- className: t("rounded-[2px] gap-1 px-[6px] h-[26px] flex items-center flex-shrink-0", {
99
+ children: b.map((r, i) => /* @__PURE__ */ n(u.div, {
100
+ className: c("rounded-[2px] gap-1 px-[6px] h-[26px] flex items-center flex-shrink-0", {
101
101
  "cursor-pointer": _,
102
- "hover:bg-[#e0e0e0]": _ && S !== a,
103
- "bg-[#0265ff] text-white": _ && S === a,
104
- "bg-[#eee] text-black": !_ || S !== a
102
+ "hover:bg-[#e0e0e0]": _ && S !== i,
103
+ "bg-[#0265ff] text-white": _ && S === i,
104
+ "bg-[#eee] text-black": !_ || S !== i
105
105
  }),
106
- onClick: () => N(a, n),
107
- children: [/* @__PURE__ */ r("span", { children: n }), /* @__PURE__ */ r("div", {
108
- className: t("cursor-pointer", _ && S === a ? "text-white hover:text-gray-200" : "text-[#666] hover:text-[#0265ff]"),
106
+ onClick: () => N(i, r),
107
+ children: [/* @__PURE__ */ t("span", { children: r }), /* @__PURE__ */ t("div", {
108
+ className: c("cursor-pointer", _ && S === i ? "text-white hover:text-gray-200" : "text-[#666] hover:text-[#0265ff]"),
109
109
  onClick: (e) => {
110
- e.stopPropagation(), F(a);
110
+ e.stopPropagation(), F(i);
111
111
  },
112
- children: /* @__PURE__ */ r(e, {
112
+ children: /* @__PURE__ */ t(e, {
113
113
  name: "close",
114
114
  size: 12
115
115
  })
116
116
  })]
117
- }, a))
117
+ }, i))
118
118
  })
119
119
  }) : null
120
- }), /* @__PURE__ */ r("div", {
120
+ }), /* @__PURE__ */ t("div", {
121
121
  ref: O,
122
- className: t(f["bsy-inputTag__inputContainer"], { [f["bsy-inputTag__inputContainer--zeroMargin"]]: b.length === 0 }, "py-[3px]"),
123
- children: /* @__PURE__ */ r("input", {
122
+ className: c(f["bsy-inputTag__inputContainer"], { [f["bsy-inputTag__inputContainer--zeroMargin"]]: b.length === 0 }, "py-[3px]"),
123
+ children: /* @__PURE__ */ t("input", {
124
124
  value: w,
125
125
  onChange: j,
126
126
  onKeyDown: P,
127
127
  onBlur: M,
128
- className: t(f["bsy-inputTag__input"], "placeholder:text-[#999]"),
128
+ className: c(f["bsy-inputTag__input"], "placeholder:text-[#999]"),
129
129
  placeholder: "输入标签"
130
130
  })
131
131
  })]
@@ -1,3 +1,3 @@
1
- import "../Icon/Icon-DXmPqVzg.js";
2
- import { t as e } from "./InputTag-DbiyuWo9.js";
1
+ import "../Icon/Icon-CTZCSuVg.js";
2
+ import { t as e } from "./InputTag-V4UnUnGJ.js";
3
3
  export { e as default };
@@ -1,2 +1,2 @@
1
- import { t as e } from "./Loading-Bi5NO-Ky.js";
1
+ import { t as e } from "./Loading-Dy5A--HK.js";
2
2
  export { e as default };
@@ -1,4 +1,4 @@
1
- import { t as e } from "../Icon/Icon-DXmPqVzg.js";
1
+ import { t as e } from "../Icon/Icon-CTZCSuVg.js";
2
2
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
3
  import { useState as r } from "react";
4
4
  import { useControllableValue as i } from "ahooks";
@@ -1,3 +1,3 @@
1
- import "../Icon/Icon-DXmPqVzg.js";
2
- import { t as e } from "./Modal-BO1s8pJe.js";
1
+ import "../Icon/Icon-CTZCSuVg.js";
2
+ import { t as e } from "./Modal-DQ5bptu_.js";
3
3
  export { e as default };
@@ -1,2 +1,2 @@
1
- import { t as e } from "./NotFoundContent-CTPpcZOt.js";
1
+ import { t as e } from "./NotFoundContent-1-41e1rN.js";
2
2
  export { e as NotFoundContent };
@@ -1,10 +1,10 @@
1
- import { t as e } from "../vendors/lodash-es-Bu9xU1fK.js";
2
- import { t } from "../vendors/clsx-DNOE4Gl8.js";
3
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
- import { createContext as i, forwardRef as a, useContext as o } from "react";
1
+ import { uniqueId as e } from "lodash-es";
2
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ import { createContext as r, forwardRef as i, useContext as a } from "react";
4
+ import o from "clsx";
5
5
  import { useControllableValue as s } from "ahooks";
6
6
  //#region src/components/Radio/context/context.ts
7
- var c = i(null), l = /* @__PURE__ */ function(e) {
7
+ var c = r(null), l = /* @__PURE__ */ function(e) {
8
8
  return e.NONE = "none", e.HORIZONTAL = "horizontal", e.VERTICAL = "vertical", e;
9
9
  }({}), u = {
10
10
  "bsy-radio": "_bsy-radio_q02xg_1",
@@ -19,29 +19,29 @@ var c = i(null), l = /* @__PURE__ */ function(e) {
19
19
  "bsy-radio-group--none": "_bsy-radio-group--none_q02xg_78",
20
20
  "bsy-radio-group--vertical": "_bsy-radio-group--vertical_q02xg_81",
21
21
  "bsy-radio-group--horizontal": "_bsy-radio-group--horizontal_q02xg_85"
22
- }, d = a((i, a) => {
23
- let { checked: s, onChange: d, value: f = e("radio"), disabled: p = !1, children: m, style: h, labelPosition: g = "right", className: _ } = i, v = o(c), y = v ? v.value === f : s, b = () => {
22
+ }, d = i((r, i) => {
23
+ let { checked: s, onChange: d, value: f = e("radio"), disabled: p = !1, children: m, style: h, labelPosition: g = "right", className: _ } = r, v = a(c), y = v ? v.value === f : s, b = () => {
24
24
  p || v?.disabled || (v ? y ? v.onDeselect?.(f) : v.onChange?.(f) : d?.(!y));
25
- }, x = p || v?.disabled, S = v?.layout === l.NONE || !v?.layout, C = t(u["bsy-radio"], {
25
+ }, x = p || v?.disabled, S = v?.layout === l.NONE || !v?.layout, C = o(u["bsy-radio"], {
26
26
  [u["bsy-radio--disabled"]]: x,
27
27
  [u["bsy-radio--full-width"]]: S
28
- }, _), w = t(u["bsy-radio__input"], {
28
+ }, _), w = o(u["bsy-radio__input"], {
29
29
  [u["bsy-radio__input--checked"]]: y,
30
30
  [u["bsy-radio__input--disabled"]]: x
31
- }), T = t(u["bsy-radio__label"], { [u["bsy-radio__label--left"]]: g === "left" });
32
- return /* @__PURE__ */ r("div", {
31
+ }), T = o(u["bsy-radio__label"], { [u["bsy-radio__label--left"]]: g === "left" });
32
+ return /* @__PURE__ */ n("div", {
33
33
  role: "radio",
34
34
  className: C,
35
35
  onClick: b,
36
36
  style: h,
37
- children: [/* @__PURE__ */ n("div", {
38
- ref: a,
37
+ children: [/* @__PURE__ */ t("div", {
38
+ ref: i,
39
39
  role: "radio",
40
40
  "aria-checked": y,
41
41
  tabIndex: x ? -1 : 0,
42
42
  className: w,
43
43
  "data-layout": v?.layout
44
- }), m && /* @__PURE__ */ n("span", {
44
+ }), m && /* @__PURE__ */ t("span", {
45
45
  className: T,
46
46
  children: m
47
47
  })]
@@ -50,29 +50,29 @@ var c = i(null), l = /* @__PURE__ */ function(e) {
50
50
  d.displayName = "BsyRadio";
51
51
  //#endregion
52
52
  //#region src/components/Radio/Group.tsx
53
- var f = ({ disabled: e, layout: r = l.NONE, children: i, className: a, style: o, onDeselect: d, ...f }) => {
53
+ var f = ({ disabled: e, layout: n = l.NONE, children: r, className: i, style: a, onDeselect: d, ...f }) => {
54
54
  let [p, m] = s(f, {
55
55
  defaultValue: "",
56
56
  valuePropName: "value",
57
57
  defaultValuePropName: "defaultValue",
58
58
  trigger: "onChange"
59
- }), h = t(u["bsy-radio-group"], {
60
- [u["bsy-radio-group--none"]]: r === l.NONE,
61
- [u["bsy-radio-group--vertical"]]: r === l.VERTICAL,
62
- [u["bsy-radio-group--horizontal"]]: r === l.HORIZONTAL
63
- }, a);
64
- return /* @__PURE__ */ n(c.Provider, {
59
+ }), h = o(u["bsy-radio-group"], {
60
+ [u["bsy-radio-group--none"]]: n === l.NONE,
61
+ [u["bsy-radio-group--vertical"]]: n === l.VERTICAL,
62
+ [u["bsy-radio-group--horizontal"]]: n === l.HORIZONTAL
63
+ }, i);
64
+ return /* @__PURE__ */ t(c.Provider, {
65
65
  value: {
66
66
  value: p,
67
67
  onChange: m,
68
68
  disabled: e,
69
- layout: r,
69
+ layout: n,
70
70
  onDeselect: d
71
71
  },
72
- children: /* @__PURE__ */ n("div", {
72
+ children: /* @__PURE__ */ t("div", {
73
73
  className: h,
74
- style: o,
75
- children: i
74
+ style: a,
75
+ children: r
76
76
  })
77
77
  });
78
78
  };
@@ -1,2 +1,2 @@
1
- import { t as e } from "./Radio-dyoBNiKF.js";
1
+ import { t as e } from "./Radio-CZOrtNyn.js";
2
2
  export { e as default };
@@ -1,6 +1,6 @@
1
- import { t as e } from "../vendors/clsx-DNOE4Gl8.js";
2
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
- import { useCallback as r, useLayoutEffect as i, useRef as a, useState as o } from "react";
1
+ import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
+ import { useCallback as n, useLayoutEffect as r, useRef as i, useState as a } from "react";
3
+ import o from "clsx";
4
4
  import { useControllableValue as s } from "ahooks";
5
5
  import { motion as c } from "motion/react";
6
6
  //#region src/components/Segmented/Segmented.module.scss
@@ -14,10 +14,10 @@ var l = {
14
14
  "bsy-segmented__item--inactive": "_bsy-segmented__item--inactive_ia83v_48",
15
15
  "bsy-segmented__slider": "_bsy-segmented__slider_ia83v_53"
16
16
  }, u = (u) => {
17
- let { options: d, block: f = !1, disabled: p = !1 } = u, [m, h] = s(u), [g, _] = o({
17
+ let { options: d, block: f = !1, disabled: p = !1 } = u, [m, h] = s(u), [g, _] = a({
18
18
  width: 0,
19
19
  left: 0
20
- }), [v, y] = o(!1), b = a(null), x = a(/* @__PURE__ */ new Map()), S = r(() => {
20
+ }), [v, y] = a(!1), b = i(null), x = i(/* @__PURE__ */ new Map()), S = n(() => {
21
21
  let e = x.current.get(m), t = b.current;
22
22
  if (e && t) {
23
23
  let n = t.getBoundingClientRect(), r = e.getBoundingClientRect();
@@ -27,17 +27,17 @@ var l = {
27
27
  });
28
28
  }
29
29
  }, [m]);
30
- return i(() => {
30
+ return r(() => {
31
31
  S();
32
32
  let e = new ResizeObserver(S);
33
33
  return b.current && e.observe(b.current), () => {
34
34
  e.disconnect();
35
35
  };
36
- }, [S]), /* @__PURE__ */ n("div", {
36
+ }, [S]), /* @__PURE__ */ t("div", {
37
37
  ref: b,
38
- className: e(l["bsy-segmented"], f && l["bsy-segmented--block"]),
38
+ className: o(l["bsy-segmented"], f && l["bsy-segmented--block"]),
39
39
  style: f ? { gridTemplateColumns: `repeat(${d.length}, 1fr)` } : void 0,
40
- children: [/* @__PURE__ */ t(c.div, {
40
+ children: [/* @__PURE__ */ e(c.div, {
41
41
  className: l["bsy-segmented__slider"],
42
42
  animate: g,
43
43
  transition: v ? {
@@ -45,16 +45,16 @@ var l = {
45
45
  stiffness: 350,
46
46
  damping: 35
47
47
  } : { duration: 0 }
48
- }), d.map((n) => /* @__PURE__ */ t("button", {
48
+ }), d.map((t) => /* @__PURE__ */ e("button", {
49
49
  ref: (e) => {
50
- e ? x.current.set(n.value, e) : x.current.delete(n.value);
50
+ e ? x.current.set(t.value, e) : x.current.delete(t.value);
51
51
  },
52
52
  onClick: () => {
53
- p || (h(n.value), y(!0));
53
+ p || (h(t.value), y(!0));
54
54
  },
55
- className: e(l["bsy-segmented__item"], f && l["bsy-segmented__item--block"], m === n.value ? l["bsy-segmented__item--active"] : l["bsy-segmented__item--inactive"], { [l["bsy-segmented__item--disabled"]]: p }),
56
- children: n.label
57
- }, n.value))]
55
+ className: o(l["bsy-segmented__item"], f && l["bsy-segmented__item--block"], m === t.value ? l["bsy-segmented__item--active"] : l["bsy-segmented__item--inactive"], { [l["bsy-segmented__item--disabled"]]: p }),
56
+ children: t.label
57
+ }, t.value))]
58
58
  });
59
59
  };
60
60
  u.displayName = "BsySegmented";
@@ -1,2 +1,2 @@
1
- import { t as e } from "./Segmented-Dd8glDXI.js";
1
+ import { t as e } from "./Segmented-DEGgLO-b.js";
2
2
  export { e as default };