@baishuyun/ui-base 2.2.0 → 2.2.3
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/Card/{Card-CXULQNHa.js → Card-DHOMkrEE.js} +2 -2
- package/dist/Card/index.js +1 -1
- package/dist/CheckBox/{CheckBox-Bu40TO29.js → CheckBox-VlP6u_-s.js} +2 -2
- package/dist/CheckBox/index.js +19 -17
- package/dist/ColorPicker/ColorPicker-049kyJn6.js +205 -0
- package/dist/ColorPicker/index.js +1 -1
- package/dist/DropDown/DropDown-BkTY-3y0.js +166 -0
- package/dist/DropDown/index.js +4 -0
- package/dist/Editor/ToolbarPlugin/Buttons/index.js +4 -0
- package/dist/Editor/constants/index.js +20 -0
- package/dist/Editor/index-C0MY9j94.js +832 -0
- package/dist/Editor/index.js +581 -0
- package/dist/Icon/Icon-CkHAU1fA.js +24 -0
- package/dist/Icon/index.js +1 -1
- package/dist/InputTag/InputTag-S9hHXsyQ.js +137 -0
- package/dist/InputTag/index.js +2 -135
- package/dist/Loading/Loading-CEB4PLUE.js +9 -0
- package/dist/Loading/index.js +4 -0
- package/dist/Modal/{Modal-BZTEGGa0.js → Modal-oRJ-Almn.js} +1 -1
- package/dist/Modal/index.js +1 -1
- package/dist/Radio/index.js +1 -1
- package/dist/Select/Select-BiARGTPz.js +820 -0
- package/dist/Select/SelectInputSearch-DigfTvpo.js +34 -0
- package/dist/Select/index.js +1 -1
- package/dist/Tabs/TabSelect-bKB0Qe9F.js +445 -0
- package/dist/Tabs/index.js +7 -0
- package/dist/Tree/index.js +1 -1
- package/dist/Tree/utils/index.js +1 -1
- package/dist/components/CheckBox/Group.d.ts +4 -0
- package/dist/components/DropDown/DropDown.d.ts +3 -0
- package/dist/components/DropDown/MenuItem/MenuItem.d.ts +8 -0
- package/dist/components/DropDown/MenuList/MenuList.d.ts +9 -0
- package/dist/components/DropDown/index.d.ts +1 -0
- package/dist/components/Editor/Editor.d.ts +4 -0
- package/dist/components/Editor/EditorCore.d.ts +4 -0
- package/dist/components/Editor/ToolbarPlugin/BaseButton/BaseButton.d.ts +29 -0
- package/dist/components/Editor/ToolbarPlugin/Buttons/AlignButton.d.ts +2 -0
- package/dist/components/Editor/ToolbarPlugin/Buttons/BoldButton.d.ts +2 -0
- package/dist/components/Editor/ToolbarPlugin/Buttons/FillButton.d.ts +2 -0
- package/dist/components/Editor/ToolbarPlugin/Buttons/FontColorButton.d.ts +2 -0
- package/dist/components/Editor/ToolbarPlugin/Buttons/FontSizeButton.d.ts +2 -0
- package/dist/components/Editor/ToolbarPlugin/Buttons/ItalicButton.d.ts +2 -0
- package/dist/components/Editor/ToolbarPlugin/Buttons/LinkButton.d.ts +2 -0
- package/dist/components/Editor/ToolbarPlugin/Buttons/PictureButton/LinkInput.d.ts +5 -0
- package/dist/components/Editor/ToolbarPlugin/Buttons/PictureButton/PictureButton.d.ts +2 -0
- package/dist/components/Editor/ToolbarPlugin/Buttons/PictureButton/UploadImage.d.ts +8 -0
- package/dist/components/Editor/ToolbarPlugin/Buttons/UnLinkButton.d.ts +2 -0
- package/dist/components/Editor/ToolbarPlugin/Buttons/UnderLineButton.d.ts +2 -0
- package/dist/components/Editor/ToolbarPlugin/Buttons/index.d.ts +14 -0
- package/dist/components/Editor/ToolbarPlugin/ToolbarPlugin.d.ts +3 -0
- package/dist/components/Editor/ToolbarPlugin/context/TextFormatProvider.d.ts +3 -0
- package/dist/components/Editor/ToolbarPlugin/context/TextFormatsContext.d.ts +17 -0
- package/dist/components/Editor/ToolbarPlugin/context/useTextFormatsContext.d.ts +1 -0
- package/dist/components/Editor/ToolbarPlugin/interface.d.ts +32 -0
- package/dist/components/Editor/commands/ImageCommands.d.ts +8 -0
- package/dist/components/Editor/constants/index.d.ts +41 -0
- package/dist/components/Editor/hooks/useTextFormatsState.d.ts +2 -0
- package/dist/components/Editor/index.d.ts +2 -0
- package/dist/components/Editor/interface.d.ts +62 -0
- package/dist/components/Editor/nodes/ExtendedTextNode.d.ts +11 -0
- package/dist/components/Editor/nodes/ImageComponent.d.ts +11 -0
- package/dist/components/Editor/nodes/ImageNode.d.ts +50 -0
- package/dist/components/Editor/plugins/EnterKeyPlugin.d.ts +1 -0
- package/dist/components/Editor/plugins/ImagePlugin.d.ts +1 -0
- package/dist/components/Loading/Loading.d.ts +5 -0
- package/dist/components/Loading/index.d.ts +1 -0
- package/dist/components/Select/HighlightText/HighlightText.d.ts +1 -0
- package/dist/components/Select/context/SelectContext.d.ts +12 -0
- package/dist/components/Tabs/Tab/Tab.d.ts +10 -0
- package/dist/components/Tabs/TabList/TabList.d.ts +4 -0
- package/dist/components/Tabs/TabList/useTabIndicator.d.ts +19 -0
- package/dist/components/Tabs/TabList/useTabScroll.d.ts +16 -0
- package/dist/components/Tabs/TabPanel/TabPanel.d.ts +9 -0
- package/dist/components/Tabs/TabSelect/TabSelect.d.ts +3 -0
- package/dist/components/Tabs/TabSelect/interface.d.ts +26 -0
- package/dist/components/Tabs/Tabs.d.ts +3 -0
- package/dist/components/Tabs/constants.d.ts +9 -0
- package/dist/components/Tabs/context/TabContext.d.ts +7 -0
- package/dist/components/Tabs/index.d.ts +4 -0
- package/dist/components/Tabs/interface.d.ts +61 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/index.js +41 -30
- package/dist/style.css +1 -1
- package/dist/vendors/Tree-CjrhMBFX.js +235 -0
- package/dist/vendors/color-VzwvCPhF.js +21 -0
- package/dist/vendors/index-MTmG1Ezy.js +15 -0
- package/dist/vendors/lexical-DdSmj_Kv.js +5891 -0
- package/dist/vendors/{lodash-es-CZfJRWhO.js → lodash-es-DFpaJB4Y.js} +2 -2
- package/dist/vendors/{simplebar-react-Bf9Zq-21.js → simplebar-react-D68KzE44.js} +1 -1
- package/dist/vendors/useFloatingPortal-9VUFOAOG.js +45 -0
- package/dist/vendors/{index-ByQkttKA.js → useLocale-DgqW9M3h.js} +35 -47
- package/package.json +3 -6
- package/dist/ColorPicker/ColorPicker-CwFsihkL.js +0 -207
- package/dist/Icon/Icon-BlkVlKDd.js +0 -24
- package/dist/Select/Select-C3abXG27.js +0 -855
- package/dist/vendors/Tree-CCY2gtpG.js +0 -225
- package/dist/vendors/lexical-Bz4mqKs6.js +0 -3
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
import { jsx as a, jsxs as N, Fragment as O } from "react/jsx-runtime";
|
|
2
|
-
import M, { useMemo as j, useCallback as I, createContext as R, useContext as V, useEffect as $ } from "react";
|
|
3
|
-
import { I as z } from "../Icon/Icon-BlkVlKDd.js";
|
|
4
|
-
import { c as E } from "./clsx-OuTLNxxd.js";
|
|
5
|
-
import { n as _ } from "./lodash-es-CZfJRWhO.js";
|
|
6
|
-
import { B as A } from "../CheckBox/CheckBox-Bu40TO29.js";
|
|
7
|
-
import F from "../Radio/index.js";
|
|
8
|
-
import { useControllableValue as B } from "ahooks";
|
|
9
|
-
import { getMatchingNodesPaths as W, getNodePath as q } from "../Tree/utils/index.js";
|
|
10
|
-
const L = ({ text: e, highlight: s }) => {
|
|
11
|
-
const [t, o] = j(
|
|
12
|
-
() => e && s ? [e.toLowerCase(), s.toLowerCase()] : [],
|
|
13
|
-
[e, s]
|
|
14
|
-
), g = I(() => {
|
|
15
|
-
if (!s.trim())
|
|
16
|
-
return [{ text: e, isMatch: !1 }];
|
|
17
|
-
const l = o ? t == null ? void 0 : t.indexOf(o) : -1;
|
|
18
|
-
return l === -1 || l === void 0 ? [{ text: e, isMatch: !1 }] : [
|
|
19
|
-
{ text: e.slice(0, l), isMatch: !1 },
|
|
20
|
-
{ text: e.slice(l, l + s.length), isMatch: !0 },
|
|
21
|
-
{ text: e.slice(l + s.length), isMatch: !1 }
|
|
22
|
-
].filter((c) => c.text);
|
|
23
|
-
}, [e, s, t, o])(), f = {
|
|
24
|
-
color: "#0265ff",
|
|
25
|
-
fontWeight: 500
|
|
26
|
-
};
|
|
27
|
-
return /* @__PURE__ */ a("div", { className: "select-none text-ellipsis overflow-hidden whitespace-nowrap truncate w-full", children: g.map(
|
|
28
|
-
(l, c) => l.isMatch ? /* @__PURE__ */ a("span", { style: f, children: l.text }, c) : /* @__PURE__ */ a("span", { children: l.text }, c)
|
|
29
|
-
) });
|
|
30
|
-
};
|
|
31
|
-
L.displayName = "HighlightText";
|
|
32
|
-
const G = M.memo(L), P = R({
|
|
33
|
-
searchValue: "",
|
|
34
|
-
selectedKeys: [],
|
|
35
|
-
expandedKeys: [],
|
|
36
|
-
parentCheckable: !1,
|
|
37
|
-
onSelect: _,
|
|
38
|
-
onExpand: _,
|
|
39
|
-
icon: void 0,
|
|
40
|
-
switcherIcon: void 0,
|
|
41
|
-
checkType: "default",
|
|
42
|
-
showSwitcher: !0
|
|
43
|
-
}), J = 22, H = ({ node: e, level: s = 0, fieldNames: t }) => {
|
|
44
|
-
var r;
|
|
45
|
-
const o = V(P), {
|
|
46
|
-
searchValue: v,
|
|
47
|
-
selectedKeys: g,
|
|
48
|
-
expandedKeys: f,
|
|
49
|
-
onSelect: l,
|
|
50
|
-
onExpand: c,
|
|
51
|
-
onDeSelect: x,
|
|
52
|
-
parentCheckable: w,
|
|
53
|
-
checkType: d,
|
|
54
|
-
showSwitcher: k
|
|
55
|
-
} = V(P), h = e[t.children] && e[t.children].length > 0, m = g.includes(e[t.value]), p = h ? f.includes(e[t.value]) : !1, y = () => {
|
|
56
|
-
if (e.checkable === !1) {
|
|
57
|
-
h && (c == null || c(e[t.value], !p));
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
if (h) {
|
|
61
|
-
w ? C() : c == null || c(e[t.value], !p);
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
C();
|
|
65
|
-
}, C = () => {
|
|
66
|
-
m ? x == null || x(e[t.value]) : l == null || l(e[t.value], e);
|
|
67
|
-
}, K = (n) => {
|
|
68
|
-
n.stopPropagation(), h && (c == null || c(e[t.value], !p));
|
|
69
|
-
}, S = (n = !1) => {
|
|
70
|
-
const i = e.icon || o.icon;
|
|
71
|
-
if (!i) return null;
|
|
72
|
-
const u = typeof i == "function" ? i(e) : i;
|
|
73
|
-
return M.isValidElement(u) ? /* @__PURE__ */ a(
|
|
74
|
-
"span",
|
|
75
|
-
{
|
|
76
|
-
className: E({
|
|
77
|
-
"text-[#0265ff]": n,
|
|
78
|
-
"text-[#73819c]": !n
|
|
79
|
-
}),
|
|
80
|
-
children: u
|
|
81
|
-
}
|
|
82
|
-
) : null;
|
|
83
|
-
}, T = (n) => h ? o.switcherIcon ? o.switcherIcon(n) : /* @__PURE__ */ a(
|
|
84
|
-
z,
|
|
85
|
-
{
|
|
86
|
-
name: "arrow-right",
|
|
87
|
-
className: E("transition-transform duration-300 ease-in-out text-[#666]", {
|
|
88
|
-
"rotate-90": n
|
|
89
|
-
})
|
|
90
|
-
}
|
|
91
|
-
) : null, b = () => h && !w || d === "default" || e.checkable === !1 ? null : /* @__PURE__ */ N("div", { className: "ml-auto shrink-0", children: [
|
|
92
|
-
d === "radio" && /* @__PURE__ */ a(F, { checked: m }),
|
|
93
|
-
d === "checkbox" && /* @__PURE__ */ a(A, { checked: m })
|
|
94
|
-
] });
|
|
95
|
-
return /* @__PURE__ */ N(O, { children: [
|
|
96
|
-
/* @__PURE__ */ a(
|
|
97
|
-
"div",
|
|
98
|
-
{
|
|
99
|
-
className: E("rounded-[4px] cursor-pointer", {
|
|
100
|
-
"text-[#0265ff] bg-[#f0f6ff]": m && d === "default",
|
|
101
|
-
"hover:bg-[#f3f3f3]": !m || d !== "default"
|
|
102
|
-
}),
|
|
103
|
-
onClick: y,
|
|
104
|
-
children: /* @__PURE__ */ N(
|
|
105
|
-
"div",
|
|
106
|
-
{
|
|
107
|
-
className: "flex items-center px-[10px] py-[7px] gap-x-[6px]",
|
|
108
|
-
style: { marginLeft: `${s * J}px` },
|
|
109
|
-
children: [
|
|
110
|
-
/* @__PURE__ */ a(
|
|
111
|
-
"div",
|
|
112
|
-
{
|
|
113
|
-
className: E("w-4 h-4 flex items-center justify-center flex-shrink-0", {
|
|
114
|
-
hidden: !k
|
|
115
|
-
}),
|
|
116
|
-
onClick: K,
|
|
117
|
-
children: T(p)
|
|
118
|
-
}
|
|
119
|
-
),
|
|
120
|
-
S(m),
|
|
121
|
-
M.isValidElement(e[t.title]) ? e[t.title] : /* @__PURE__ */ a(G, { text: e[t.title], highlight: v }),
|
|
122
|
-
b()
|
|
123
|
-
]
|
|
124
|
-
}
|
|
125
|
-
)
|
|
126
|
-
}
|
|
127
|
-
),
|
|
128
|
-
h && /* @__PURE__ */ a(
|
|
129
|
-
"div",
|
|
130
|
-
{
|
|
131
|
-
className: "grid transition-[grid-template-rows] duration-300 ease-in-out",
|
|
132
|
-
style: { gridTemplateRows: p ? "1fr" : "0fr" },
|
|
133
|
-
children: /* @__PURE__ */ a("div", { className: "overflow-hidden", children: (r = e[t.children]) == null ? void 0 : r.map((n) => /* @__PURE__ */ a(
|
|
134
|
-
H,
|
|
135
|
-
{
|
|
136
|
-
node: n,
|
|
137
|
-
level: s + 1,
|
|
138
|
-
fieldNames: t
|
|
139
|
-
},
|
|
140
|
-
n[t.value]
|
|
141
|
-
)) })
|
|
142
|
-
}
|
|
143
|
-
)
|
|
144
|
-
] });
|
|
145
|
-
}, Q = (e) => {
|
|
146
|
-
const {
|
|
147
|
-
data: s,
|
|
148
|
-
searchValue: t = "",
|
|
149
|
-
fieldNames: o = { title: "title", value: "value", children: "children" },
|
|
150
|
-
icon: v,
|
|
151
|
-
switcherIcon: g,
|
|
152
|
-
onSelect: f,
|
|
153
|
-
parentCheckable: l = !1,
|
|
154
|
-
checkType: c = "default",
|
|
155
|
-
defaultExpandedKeys: x,
|
|
156
|
-
showSwitcher: w = !0,
|
|
157
|
-
onDeSelect: d
|
|
158
|
-
} = e, [k, h] = B(e, {
|
|
159
|
-
defaultValuePropName: "defaultSelectedKeys",
|
|
160
|
-
valuePropName: "selectedKeys",
|
|
161
|
-
defaultValue: [],
|
|
162
|
-
trigger: "__DO_NOT_CALLED__"
|
|
163
|
-
}), m = () => {
|
|
164
|
-
var n;
|
|
165
|
-
const r = /* @__PURE__ */ new Set();
|
|
166
|
-
return (n = e.selectedKeys) != null && n.length ? (e.selectedKeys.forEach((i) => {
|
|
167
|
-
const u = q(s, i, o);
|
|
168
|
-
u && u.length > 1 && u.slice(0, -1).forEach((D) => r.add(D));
|
|
169
|
-
}), [...r]) : [];
|
|
170
|
-
}, [p, y] = B(e, {
|
|
171
|
-
valuePropName: "expandedKeys",
|
|
172
|
-
defaultValuePropName: "defaultExpandedKeys",
|
|
173
|
-
defaultValue: m(),
|
|
174
|
-
trigger: "onExpand"
|
|
175
|
-
});
|
|
176
|
-
$(() => {
|
|
177
|
-
if (!t) {
|
|
178
|
-
if (k.length || x != null && x.length) return;
|
|
179
|
-
y([]);
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
const r = /* @__PURE__ */ new Set(), n = W(s, t, o);
|
|
183
|
-
if (n.length === 0) {
|
|
184
|
-
y([]);
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
n.forEach((i) => i.slice(0, -1).forEach((u) => r.add(u))), r.size !== 0 && y([...r]);
|
|
188
|
-
}, [t]);
|
|
189
|
-
const C = I(
|
|
190
|
-
(r, n) => {
|
|
191
|
-
h((i) => c === "checkbox" ? [.../* @__PURE__ */ new Set([...i, r])] : [r]), f && (f == null || f(r, n));
|
|
192
|
-
},
|
|
193
|
-
[f, h, c]
|
|
194
|
-
), K = (r, n) => {
|
|
195
|
-
C(r, n);
|
|
196
|
-
}, S = I(
|
|
197
|
-
(r) => {
|
|
198
|
-
h((n) => n.filter((i) => i !== r)), d == null || d(r);
|
|
199
|
-
},
|
|
200
|
-
[h, d]
|
|
201
|
-
), T = (r, n) => {
|
|
202
|
-
const i = n ? [...p, r] : p.filter((u) => u !== r);
|
|
203
|
-
y(i);
|
|
204
|
-
};
|
|
205
|
-
if (!(s != null && s.length)) return null;
|
|
206
|
-
const b = {
|
|
207
|
-
searchValue: t,
|
|
208
|
-
selectedKeys: k,
|
|
209
|
-
expandedKeys: p,
|
|
210
|
-
onSelect: K,
|
|
211
|
-
onDeSelect: S,
|
|
212
|
-
onExpand: T,
|
|
213
|
-
icon: v,
|
|
214
|
-
switcherIcon: g,
|
|
215
|
-
checkType: c,
|
|
216
|
-
parentCheckable: l,
|
|
217
|
-
showSwitcher: w
|
|
218
|
-
};
|
|
219
|
-
return /* @__PURE__ */ a(P.Provider, { value: b, children: /* @__PURE__ */ a("div", { className: "bsy-tree text-sm", children: s.map((r) => /* @__PURE__ */ a(H, { node: r, fieldNames: o }, r[o.value])) }) });
|
|
220
|
-
};
|
|
221
|
-
Q.displayName = "BsyTree";
|
|
222
|
-
export {
|
|
223
|
-
G as H,
|
|
224
|
-
Q as T
|
|
225
|
-
};
|