@baishuyun/ui-base 2.1.0 → 2.2.2

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 (95) hide show
  1. package/dist/Card/{Card-CXULQNHa.js → Card-DHOMkrEE.js} +2 -2
  2. package/dist/Card/index.js +1 -1
  3. package/dist/CheckBox/{CheckBox-Bu40TO29.js → CheckBox-VlP6u_-s.js} +2 -2
  4. package/dist/CheckBox/index.js +19 -17
  5. package/dist/ColorPicker/ColorPicker-049kyJn6.js +205 -0
  6. package/dist/ColorPicker/index.js +1 -1
  7. package/dist/DropDown/DropDown-BkTY-3y0.js +166 -0
  8. package/dist/DropDown/index.js +4 -0
  9. package/dist/Editor/ToolbarPlugin/Buttons/index.js +4 -0
  10. package/dist/Editor/constants/index.js +20 -0
  11. package/dist/Editor/index-C0MY9j94.js +832 -0
  12. package/dist/Editor/index.js +581 -0
  13. package/dist/Icon/Icon-CkHAU1fA.js +24 -0
  14. package/dist/Icon/index.js +1 -1
  15. package/dist/InputTag/InputTag-S9hHXsyQ.js +137 -0
  16. package/dist/InputTag/index.js +2 -135
  17. package/dist/Loading/Loading-CEB4PLUE.js +9 -0
  18. package/dist/Loading/index.js +4 -0
  19. package/dist/Modal/{Modal-BZTEGGa0.js → Modal-oRJ-Almn.js} +1 -1
  20. package/dist/Modal/index.js +1 -1
  21. package/dist/Radio/index.js +1 -1
  22. package/dist/Select/Select-7KGHOKs6.js +820 -0
  23. package/dist/Select/SelectInputSearch-DigfTvpo.js +34 -0
  24. package/dist/Select/index.js +1 -1
  25. package/dist/Tabs/TabSelect-bKB0Qe9F.js +445 -0
  26. package/dist/Tabs/index.js +7 -0
  27. package/dist/Tree/index.js +1 -1
  28. package/dist/Tree/utils/index.js +1 -1
  29. package/dist/components/CheckBox/Group.d.ts +4 -0
  30. package/dist/components/DropDown/DropDown.d.ts +3 -0
  31. package/dist/components/DropDown/MenuItem/MenuItem.d.ts +8 -0
  32. package/dist/components/DropDown/MenuList/MenuList.d.ts +9 -0
  33. package/dist/components/DropDown/index.d.ts +1 -0
  34. package/dist/components/Editor/Editor.d.ts +4 -0
  35. package/dist/components/Editor/EditorCore.d.ts +4 -0
  36. package/dist/components/Editor/ToolbarPlugin/BaseButton/BaseButton.d.ts +29 -0
  37. package/dist/components/Editor/ToolbarPlugin/Buttons/AlignButton.d.ts +2 -0
  38. package/dist/components/Editor/ToolbarPlugin/Buttons/BoldButton.d.ts +2 -0
  39. package/dist/components/Editor/ToolbarPlugin/Buttons/FillButton.d.ts +2 -0
  40. package/dist/components/Editor/ToolbarPlugin/Buttons/FontColorButton.d.ts +2 -0
  41. package/dist/components/Editor/ToolbarPlugin/Buttons/FontSizeButton.d.ts +2 -0
  42. package/dist/components/Editor/ToolbarPlugin/Buttons/ItalicButton.d.ts +2 -0
  43. package/dist/components/Editor/ToolbarPlugin/Buttons/LinkButton.d.ts +2 -0
  44. package/dist/components/Editor/ToolbarPlugin/Buttons/PictureButton/LinkInput.d.ts +5 -0
  45. package/dist/components/Editor/ToolbarPlugin/Buttons/PictureButton/PictureButton.d.ts +2 -0
  46. package/dist/components/Editor/ToolbarPlugin/Buttons/PictureButton/UploadImage.d.ts +8 -0
  47. package/dist/components/Editor/ToolbarPlugin/Buttons/UnLinkButton.d.ts +2 -0
  48. package/dist/components/Editor/ToolbarPlugin/Buttons/UnderLineButton.d.ts +2 -0
  49. package/dist/components/Editor/ToolbarPlugin/Buttons/index.d.ts +14 -0
  50. package/dist/components/Editor/ToolbarPlugin/ToolbarPlugin.d.ts +3 -0
  51. package/dist/components/Editor/ToolbarPlugin/context/TextFormatProvider.d.ts +3 -0
  52. package/dist/components/Editor/ToolbarPlugin/context/TextFormatsContext.d.ts +17 -0
  53. package/dist/components/Editor/ToolbarPlugin/context/useTextFormatsContext.d.ts +1 -0
  54. package/dist/components/Editor/ToolbarPlugin/interface.d.ts +32 -0
  55. package/dist/components/Editor/commands/ImageCommands.d.ts +8 -0
  56. package/dist/components/Editor/constants/index.d.ts +41 -0
  57. package/dist/components/Editor/hooks/useTextFormatsState.d.ts +2 -0
  58. package/dist/components/Editor/index.d.ts +2 -0
  59. package/dist/components/Editor/interface.d.ts +62 -0
  60. package/dist/components/Editor/nodes/ExtendedTextNode.d.ts +11 -0
  61. package/dist/components/Editor/nodes/ImageComponent.d.ts +11 -0
  62. package/dist/components/Editor/nodes/ImageNode.d.ts +50 -0
  63. package/dist/components/Editor/plugins/EnterKeyPlugin.d.ts +1 -0
  64. package/dist/components/Editor/plugins/ImagePlugin.d.ts +1 -0
  65. package/dist/components/Loading/Loading.d.ts +5 -0
  66. package/dist/components/Loading/index.d.ts +1 -0
  67. package/dist/components/Select/context/SelectContext.d.ts +12 -0
  68. package/dist/components/Tabs/Tab/Tab.d.ts +10 -0
  69. package/dist/components/Tabs/TabList/TabList.d.ts +4 -0
  70. package/dist/components/Tabs/TabList/useTabIndicator.d.ts +19 -0
  71. package/dist/components/Tabs/TabList/useTabScroll.d.ts +16 -0
  72. package/dist/components/Tabs/TabPanel/TabPanel.d.ts +9 -0
  73. package/dist/components/Tabs/TabSelect/TabSelect.d.ts +3 -0
  74. package/dist/components/Tabs/TabSelect/interface.d.ts +26 -0
  75. package/dist/components/Tabs/Tabs.d.ts +3 -0
  76. package/dist/components/Tabs/constants.d.ts +9 -0
  77. package/dist/components/Tabs/context/TabContext.d.ts +7 -0
  78. package/dist/components/Tabs/index.d.ts +4 -0
  79. package/dist/components/Tabs/interface.d.ts +61 -0
  80. package/dist/components/index.d.ts +6 -0
  81. package/dist/index.js +41 -30
  82. package/dist/style.css +1 -1
  83. package/dist/vendors/{Tree-CCY2gtpG.js → Tree-C-8x1jXV.js} +4 -4
  84. package/dist/vendors/color-VzwvCPhF.js +21 -0
  85. package/dist/vendors/index-MTmG1Ezy.js +15 -0
  86. package/dist/vendors/lexical-DdSmj_Kv.js +5891 -0
  87. package/dist/vendors/{lodash-es-CZfJRWhO.js → lodash-es-DFpaJB4Y.js} +2 -2
  88. package/dist/vendors/{simplebar-react-Bf9Zq-21.js → simplebar-react-D68KzE44.js} +1 -1
  89. package/dist/vendors/useFloatingPortal-9VUFOAOG.js +45 -0
  90. package/dist/vendors/{index-ByQkttKA.js → useLocale-DgqW9M3h.js} +35 -47
  91. package/package.json +9 -7
  92. package/dist/ColorPicker/ColorPicker-CwFsihkL.js +0 -207
  93. package/dist/Icon/Icon-BlkVlKDd.js +0 -24
  94. package/dist/Select/Select-C3abXG27.js +0 -855
  95. package/dist/vendors/lexical-Bz4mqKs6.js +0 -3
@@ -0,0 +1,137 @@
1
+ import { jsxs as C, jsx as l } from "react/jsx-runtime";
2
+ import { useControllableValue as A } from "ahooks";
3
+ import { useState as S, useLayoutEffect as k, useRef as p, useEffect as D } from "react";
4
+ import { c as h } from "../vendors/clsx-OuTLNxxd.js";
5
+ import { I as M } from "../Icon/Icon-CkHAU1fA.js";
6
+ import { motion as O } from "motion/react";
7
+ import { S as V } from "../vendors/simplebar-react-D68KzE44.js";
8
+ const g = {
9
+ "bsy-inputTag": "_bsy-inputTag_46spj_11",
10
+ "bsy-inputTag__container": "_bsy-inputTag__container_46spj_22",
11
+ "bsy-inputTag__inputContainer": "_bsy-inputTag__inputContainer_46spj_27",
12
+ "bsy-inputTag__inputContainer--zeroMargin": "_bsy-inputTag__inputContainer--zeroMargin_46spj_37",
13
+ "bsy-inputTag__input": "_bsy-inputTag__input_46spj_27"
14
+ }, d = {
15
+ GAP: 4,
16
+ OFFSET: 3,
17
+ CONTAINER_PADDING: 10,
18
+ INPUT_MARGIN: 4
19
+ }, z = (s, _) => {
20
+ const [a, f] = S(0);
21
+ return k(() => {
22
+ if (s.current) {
23
+ const i = s.current.children;
24
+ let e = 0;
25
+ for (let r = 0; r < i.length; r++)
26
+ e += i[r].clientWidth;
27
+ const u = (i.length - 1) * d.GAP;
28
+ f(e + u + d.OFFSET);
29
+ }
30
+ }, [_, s]), a;
31
+ }, B = (s) => {
32
+ const { defaultValue: _, enableActive: a = !1, defaultActiveIndex: f, onActiveIndexChange: i } = s, [e, u] = A(s, {
33
+ defaultValue: _ || []
34
+ }), [r, w] = A(
35
+ s,
36
+ {
37
+ valuePropName: "activeIndex",
38
+ trigger: "onActiveIndexChange",
39
+ defaultValue: f
40
+ }
41
+ ), [T, x] = S(""), m = p(null), c = p(null), y = p(null), b = p(!1), E = () => {
42
+ if (c.current && c.current.children.length > 0) {
43
+ const t = c.current.children.length - 1;
44
+ c.current.children[t].scrollIntoView({
45
+ behavior: "smooth",
46
+ block: "nearest",
47
+ inline: "end"
48
+ });
49
+ }
50
+ };
51
+ D(() => {
52
+ b.current && e.length > 0 && (E(), b.current = !1);
53
+ }, [e.length]);
54
+ const W = (t) => {
55
+ x(t.currentTarget.value);
56
+ }, N = () => {
57
+ const t = T.trim();
58
+ if (t !== "") {
59
+ const n = t;
60
+ b.current = !0, u([...e, n]), x("");
61
+ }
62
+ }, G = (t, n) => {
63
+ if (!a) return;
64
+ const o = r === t ? void 0 : t;
65
+ w(o), i == null || i(o ?? -1, n);
66
+ }, P = (t) => {
67
+ t.key === "Enter" || t.key === "NumpadEnter" ? N() : t.key === "Backspace" && T === "" && e.length > 0 && u(e.slice(0, -1));
68
+ }, j = (t) => {
69
+ u(e.filter((n, o) => o !== t));
70
+ }, I = p(0), v = z(c, e.length);
71
+ k(() => {
72
+ m.current && y.current && (I.current = m.current.clientWidth - y.current.clientWidth - d.INPUT_MARGIN - d.CONTAINER_PADDING);
73
+ }, []);
74
+ const R = v > I.current ? I.current : v;
75
+ return /* @__PURE__ */ C("div", { className: g["bsy-inputTag"], ref: m, children: [
76
+ /* @__PURE__ */ l("div", { className: g["bsy-inputTag__container"], children: e.length ? /* @__PURE__ */ l(V, { style: { width: R + "px" }, children: /* @__PURE__ */ l("div", { className: "flex gap-1 py-[3px]", ref: c, children: e.map((t, n) => /* @__PURE__ */ C(
77
+ O.div,
78
+ {
79
+ className: h(
80
+ "rounded-[2px] gap-1 px-[6px] h-[26px] flex items-center flex-shrink-0",
81
+ {
82
+ "cursor-pointer": a,
83
+ "hover:bg-[#e0e0e0]": a && r !== n,
84
+ "bg-[#0265ff] text-white": a && r === n,
85
+ "bg-[#eee] text-black": !a || r !== n
86
+ }
87
+ ),
88
+ onClick: () => G(n, t),
89
+ children: [
90
+ /* @__PURE__ */ l("span", { children: t }),
91
+ /* @__PURE__ */ l(
92
+ "div",
93
+ {
94
+ className: h(
95
+ "cursor-pointer",
96
+ a && r === n ? "text-white hover:text-gray-200" : "text-[#666] hover:text-[#0265ff]"
97
+ ),
98
+ onClick: (o) => {
99
+ o.stopPropagation(), j(n);
100
+ },
101
+ children: /* @__PURE__ */ l(M, { name: "close", size: 12 })
102
+ }
103
+ )
104
+ ]
105
+ },
106
+ n
107
+ )) }) }) : null }),
108
+ /* @__PURE__ */ l(
109
+ "div",
110
+ {
111
+ ref: y,
112
+ className: h(
113
+ g["bsy-inputTag__inputContainer"],
114
+ {
115
+ [g["bsy-inputTag__inputContainer--zeroMargin"]]: e.length === 0
116
+ },
117
+ "py-[3px]"
118
+ ),
119
+ children: /* @__PURE__ */ l(
120
+ "input",
121
+ {
122
+ value: T,
123
+ onChange: W,
124
+ onKeyDown: P,
125
+ onBlur: N,
126
+ className: h(g["bsy-inputTag__input"], "placeholder:text-[#999]"),
127
+ placeholder: "输入标签"
128
+ }
129
+ )
130
+ }
131
+ )
132
+ ] });
133
+ };
134
+ B.displayName = "BsyInputTag";
135
+ export {
136
+ B as I
137
+ };
@@ -1,137 +1,4 @@
1
- import { jsxs as C, jsx as l } from "react/jsx-runtime";
2
- import { useControllableValue as A } from "ahooks";
3
- import { useState as S, useLayoutEffect as k, useRef as p, useEffect as D } from "react";
4
- import { c as h } from "../vendors/clsx-OuTLNxxd.js";
5
- import { I as M } from "../Icon/Icon-BlkVlKDd.js";
6
- import { motion as O } from "motion/react";
7
- import { S as V } from "../vendors/simplebar-react-Bf9Zq-21.js";
8
- const g = {
9
- "bsy-inputTag": "_bsy-inputTag_46spj_11",
10
- "bsy-inputTag__container": "_bsy-inputTag__container_46spj_22",
11
- "bsy-inputTag__inputContainer": "_bsy-inputTag__inputContainer_46spj_27",
12
- "bsy-inputTag__inputContainer--zeroMargin": "_bsy-inputTag__inputContainer--zeroMargin_46spj_37",
13
- "bsy-inputTag__input": "_bsy-inputTag__input_46spj_27"
14
- }, d = {
15
- GAP: 4,
16
- OFFSET: 3,
17
- CONTAINER_PADDING: 10,
18
- INPUT_MARGIN: 4
19
- }, z = (s, _) => {
20
- const [a, f] = S(0);
21
- return k(() => {
22
- if (s.current) {
23
- const i = s.current.children;
24
- let e = 0;
25
- for (let r = 0; r < i.length; r++)
26
- e += i[r].clientWidth;
27
- const u = (i.length - 1) * d.GAP;
28
- f(e + u + d.OFFSET);
29
- }
30
- }, [_, s]), a;
31
- }, B = (s) => {
32
- const { defaultValue: _, enableActive: a = !1, defaultActiveIndex: f, onActiveIndexChange: i } = s, [e, u] = A(s, {
33
- defaultValue: _ || []
34
- }), [r, w] = A(
35
- s,
36
- {
37
- valuePropName: "activeIndex",
38
- trigger: "onActiveIndexChange",
39
- defaultValue: f
40
- }
41
- ), [T, x] = S(""), m = p(null), c = p(null), y = p(null), b = p(!1), E = () => {
42
- if (c.current && c.current.children.length > 0) {
43
- const t = c.current.children.length - 1;
44
- c.current.children[t].scrollIntoView({
45
- behavior: "smooth",
46
- block: "nearest",
47
- inline: "end"
48
- });
49
- }
50
- };
51
- D(() => {
52
- b.current && e.length > 0 && (E(), b.current = !1);
53
- }, [e.length]);
54
- const W = (t) => {
55
- x(t.currentTarget.value);
56
- }, N = () => {
57
- const t = T.trim();
58
- if (t !== "") {
59
- const n = t;
60
- b.current = !0, u([...e, n]), x("");
61
- }
62
- }, G = (t, n) => {
63
- if (!a) return;
64
- const o = r === t ? void 0 : t;
65
- w(o), i == null || i(o ?? -1, n);
66
- }, P = (t) => {
67
- t.key === "Enter" || t.key === "NumpadEnter" ? N() : t.key === "Backspace" && T === "" && e.length > 0 && u(e.slice(0, -1));
68
- }, j = (t) => {
69
- u(e.filter((n, o) => o !== t));
70
- }, I = p(0), v = z(c, e.length);
71
- k(() => {
72
- m.current && y.current && (I.current = m.current.clientWidth - y.current.clientWidth - d.INPUT_MARGIN - d.CONTAINER_PADDING);
73
- }, []);
74
- const R = v > I.current ? I.current : v;
75
- return /* @__PURE__ */ C("div", { className: g["bsy-inputTag"], ref: m, children: [
76
- /* @__PURE__ */ l("div", { className: g["bsy-inputTag__container"], children: e.length ? /* @__PURE__ */ l(V, { style: { width: R + "px" }, children: /* @__PURE__ */ l("div", { className: "flex gap-1 py-[3px]", ref: c, children: e.map((t, n) => /* @__PURE__ */ C(
77
- O.div,
78
- {
79
- className: h(
80
- "rounded-[2px] gap-1 px-[6px] h-[26px] flex items-center flex-shrink-0",
81
- {
82
- "cursor-pointer": a,
83
- "hover:bg-[#e0e0e0]": a && r !== n,
84
- "bg-[#0265ff] text-white": a && r === n,
85
- "bg-[#eee] text-black": !a || r !== n
86
- }
87
- ),
88
- onClick: () => G(n, t),
89
- children: [
90
- /* @__PURE__ */ l("span", { children: t }),
91
- /* @__PURE__ */ l(
92
- "div",
93
- {
94
- className: h(
95
- "cursor-pointer",
96
- a && r === n ? "text-white hover:text-gray-200" : "text-[#666] hover:text-[#0265ff]"
97
- ),
98
- onClick: (o) => {
99
- o.stopPropagation(), j(n);
100
- },
101
- children: /* @__PURE__ */ l(M, { name: "close", size: 12 })
102
- }
103
- )
104
- ]
105
- },
106
- n
107
- )) }) }) : null }),
108
- /* @__PURE__ */ l(
109
- "div",
110
- {
111
- ref: y,
112
- className: h(
113
- g["bsy-inputTag__inputContainer"],
114
- {
115
- [g["bsy-inputTag__inputContainer--zeroMargin"]]: e.length === 0
116
- },
117
- "py-[3px]"
118
- ),
119
- children: /* @__PURE__ */ l(
120
- "input",
121
- {
122
- value: T,
123
- onChange: W,
124
- onKeyDown: P,
125
- onBlur: N,
126
- className: h(g["bsy-inputTag__input"], "placeholder:text-[#999]"),
127
- placeholder: "输入标签"
128
- }
129
- )
130
- }
131
- )
132
- ] });
133
- };
134
- B.displayName = "BsyInputTag";
1
+ import { I as t } from "./InputTag-S9hHXsyQ.js";
135
2
  export {
136
- B as default
3
+ t as default
137
4
  };
@@ -0,0 +1,9 @@
1
+ import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
+ import { LoadingOutlined as n } from "@ant-design/icons";
3
+ const o = ({ tip: t = "加载中..." }) => /* @__PURE__ */ i("div", { className: "flex flex-col justify-center items-center h-full min-h-[100px] text-slate-500", children: [
4
+ /* @__PURE__ */ e(n, { style: { fontSize: 24, marginBottom: 8 }, spin: !0 }),
5
+ /* @__PURE__ */ e("span", { children: t })
6
+ ] });
7
+ export {
8
+ o as L
9
+ };
@@ -0,0 +1,4 @@
1
+ import { L as f } from "./Loading-CEB4PLUE.js";
2
+ export {
3
+ f as default
4
+ };
@@ -2,7 +2,7 @@ import { jsxs as s, jsx as o } from "react/jsx-runtime";
2
2
  import { useControllableValue as c } from "ahooks";
3
3
  import { Modal as r } from "antd";
4
4
  import { useState as u } from "react";
5
- import { I as n } from "../Icon/Icon-BlkVlKDd.js";
5
+ import { I as n } from "../Icon/Icon-CkHAU1fA.js";
6
6
  const f = "_modal__title_klsxr_1", b = "_modal__button_groups_klsxr_18", h = "_modal__button_klsxr_18", g = "_modal__icon_klsxr_38", l = {
7
7
  modal__title: f,
8
8
  modal__button_groups: b,
@@ -1,4 +1,4 @@
1
- import { M as f } from "./Modal-BZTEGGa0.js";
1
+ import { M as f } from "./Modal-oRJ-Almn.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,7 +1,7 @@
1
1
  import { jsxs as E, jsx as t } from "react/jsx-runtime";
2
2
  import { createContext as I, forwardRef as O, useContext as P } from "react";
3
3
  import { c as n } from "../vendors/clsx-OuTLNxxd.js";
4
- import { u as w } from "../vendors/lodash-es-CZfJRWhO.js";
4
+ import { u as w } from "../vendors/lodash-es-DFpaJB4Y.js";
5
5
  import { useControllableValue as z } from "ahooks";
6
6
  const N = I(null);
7
7
  var o = /* @__PURE__ */ ((i) => (i.NONE = "none", i.HORIZONTAL = "horizontal", i.VERTICAL = "vertical", i))(o || {});