@baishuyun/ui-base 2.3.2 → 2.3.4
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-BE6v4I-A.js → Card-CaKTq_1y.js} +17 -17
- package/dist/Card/index.js +2 -2
- package/dist/CheckBox/CheckBox-Cz6KW9Lw.js +33 -0
- package/dist/CheckBox/{CheckBox--rXaUgMO.js → CheckBox-l__wOnmH.js} +25 -25
- package/dist/CheckBox/index.js +3 -3
- package/dist/ColorPicker/ColorPicker-C1kG_eI-.js +168 -0
- package/dist/ColorPicker/index.js +4 -5
- package/dist/DropDown/DropDown-BAPBTglm.js +162 -0
- package/dist/DropDown/index.js +6 -6
- package/dist/Editor/{Buttons--dMLPuk2.js → Buttons-CsKKYGbV.js} +207 -204
- package/dist/Editor/ToolbarPlugin/Buttons/index.js +12 -13
- package/dist/Editor/index.js +207 -196
- package/dist/Icon/Icon-CTZCSuVg.js +19 -0
- package/dist/Icon/index.js +1 -1
- package/dist/InputTag/{InputTag-B6N5MZA2.js → InputTag-V4UnUnGJ.js} +33 -33
- package/dist/InputTag/index.js +2 -2
- package/dist/Loading/index.js +1 -1
- package/dist/Modal/{Modal-FVJpbEgw.js → Modal-DQ5bptu_.js} +1 -1
- package/dist/Modal/index.js +2 -2
- package/dist/NotFoundContent/index.js +1 -1
- package/dist/Radio/{Radio-dyoBNiKF.js → Radio-CZOrtNyn.js} +25 -25
- package/dist/Radio/index.js +1 -1
- package/dist/Segmented/{Segmented-Dd8glDXI.js → Segmented-DEGgLO-b.js} +15 -15
- package/dist/Segmented/index.js +1 -1
- package/dist/Select/Select-BoNqxIRo.js +729 -0
- package/dist/Select/{SelectInputSearch-CIXBNLFi.js → SelectInputSearch-DMY6Y9B6.js} +2 -2
- package/dist/Select/index.js +10 -10
- package/dist/Tabs/{Tabs-C79GTyGd.js → Tabs-BqT-_eVo.js} +138 -138
- package/dist/Tabs/index.js +4 -5
- package/dist/Tree/index.js +4 -4
- package/dist/Tree/utils/index.js +1 -1
- package/dist/index.js +19 -20
- package/dist/vendors/Tree-nIRgDY2s.js +231 -0
- package/dist/vendors/{color-BPWy9DvT.js → color-CyuNdAfc.js} +2 -2
- package/package.json +4 -2
- package/dist/CheckBox/CheckBox-Db8X-pw9.js +0 -33
- package/dist/ColorPicker/ColorPicker-BBP-4-so.js +0 -168
- package/dist/DropDown/DropDown-CKXi9mXN.js +0 -162
- package/dist/Icon/Icon-DppVOyPK.js +0 -19
- package/dist/Select/Select-Bd2ECrB0.js +0 -729
- package/dist/vendors/Tree-CQR9fvpA.js +0 -231
- package/dist/vendors/clsx-DNOE4Gl8.js +0 -16
- package/dist/vendors/fuse.js-BKtvbTjL.js +0 -877
- package/dist/vendors/lexical-hZliMgDv.js +0 -6439
- package/dist/vendors/lodash-es-Bu9xU1fK.js +0 -334
- package/dist/vendors/simplebar-react-CFlS-Nm9.js +0 -370
- package/dist/vendors/tinycolor2-DToeAEPD.js +0 -726
- /package/dist/Loading/{Loading-Bi5NO-Ky.js → Loading-Dy5A--HK.js} +0 -0
- /package/dist/NotFoundContent/{NotFoundContent-CTPpcZOt.js → NotFoundContent-1-41e1rN.js} +0 -0
- /package/dist/vendors/{animations-C5JKFkz4.js → animations-DvjIfVz9.js} +0 -0
- /package/dist/vendors/{useFloatingPortal-BA6P5GxV.js → useFloatingPortal-W4pliYWU.js} +0 -0
- /package/dist/vendors/{useLocale-BfT0V1j4.js → useLocale-BXnqO-Ju.js} +0 -0
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import { l as e } from "./lodash-es-Bu9xU1fK.js";
|
|
2
|
-
import { t } from "../Icon/Icon-DppVOyPK.js";
|
|
3
|
-
import { t as n } from "./clsx-DNOE4Gl8.js";
|
|
4
|
-
import { t as r } from "../CheckBox/CheckBox--rXaUgMO.js";
|
|
5
|
-
import { t as i } from "../Radio/Radio-dyoBNiKF.js";
|
|
6
|
-
import { getMatchingNodesPaths as a, getNodePath as o } from "../Tree/utils/index.js";
|
|
7
|
-
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
|
-
import u, { createContext as d, useCallback as f, useContext as p, useEffect as m, useMemo as h } from "react";
|
|
9
|
-
import { useControllableValue as g } from "ahooks";
|
|
10
|
-
import { AnimatePresence as _, motion as v } from "motion/react";
|
|
11
|
-
//#region src/components/Select/HighlightText/HighlightText.tsx
|
|
12
|
-
var y = ({ text: e, highlight: t, truncate: n = !0 }) => {
|
|
13
|
-
let [r, i] = h(() => e && t ? [e.toLowerCase(), t.toLowerCase()] : [], [e, t]), a = f(() => {
|
|
14
|
-
if (!t.trim()) return [{
|
|
15
|
-
text: e,
|
|
16
|
-
isMatch: !1
|
|
17
|
-
}];
|
|
18
|
-
let n = i ? r?.indexOf(i) : -1;
|
|
19
|
-
return n === -1 || n === void 0 ? [{
|
|
20
|
-
text: e,
|
|
21
|
-
isMatch: !1
|
|
22
|
-
}] : [
|
|
23
|
-
{
|
|
24
|
-
text: e.slice(0, n),
|
|
25
|
-
isMatch: !1
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
text: e.slice(n, n + t.length),
|
|
29
|
-
isMatch: !0
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
text: e.slice(n + t.length),
|
|
33
|
-
isMatch: !1
|
|
34
|
-
}
|
|
35
|
-
].filter((e) => e.text);
|
|
36
|
-
}, [
|
|
37
|
-
e,
|
|
38
|
-
t,
|
|
39
|
-
r,
|
|
40
|
-
i
|
|
41
|
-
])(), o = {
|
|
42
|
-
color: "#0265ff",
|
|
43
|
-
fontWeight: 500
|
|
44
|
-
};
|
|
45
|
-
return /* @__PURE__ */ c("div", {
|
|
46
|
-
className: n ? "select-none text-ellipsis overflow-hidden whitespace-nowrap truncate w-full" : "select-none whitespace-nowrap w-full",
|
|
47
|
-
children: a.map((e, t) => e.isMatch ? /* @__PURE__ */ c("span", {
|
|
48
|
-
style: o,
|
|
49
|
-
children: e.text
|
|
50
|
-
}, t) : /* @__PURE__ */ c("span", { children: e.text }, t))
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
y.displayName = "HighlightText";
|
|
54
|
-
var b = u.memo(y), x = d({
|
|
55
|
-
searchValue: "",
|
|
56
|
-
selectedKeys: [],
|
|
57
|
-
expandedKeys: [],
|
|
58
|
-
parentCheckable: !1,
|
|
59
|
-
onSelect: e,
|
|
60
|
-
onExpand: e,
|
|
61
|
-
icon: void 0,
|
|
62
|
-
switcherIcon: void 0,
|
|
63
|
-
checkType: "default",
|
|
64
|
-
showSwitcher: !0
|
|
65
|
-
}), S = 22, C = ({ node: e, level: a = 0, fieldNames: o }) => {
|
|
66
|
-
let d = p(x), { searchValue: f, selectedKeys: m, expandedKeys: h, onSelect: g, onExpand: y, onDeSelect: w, parentCheckable: T, checkType: E, showSwitcher: D } = p(x), O = e[o.children] && e[o.children].length > 0, k = m.includes(e[o.value]), A = O ? h.includes(e[o.value]) : !1, j = () => {
|
|
67
|
-
if (e.checkable === !1) {
|
|
68
|
-
O && y?.(e[o.value], !A);
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
if (O) {
|
|
72
|
-
T ? M() : y?.(e[o.value], !A);
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
M();
|
|
76
|
-
}, M = () => {
|
|
77
|
-
k ? w?.(e[o.value]) : g?.(e[o.value], e);
|
|
78
|
-
}, N = (t) => {
|
|
79
|
-
t.stopPropagation(), O && y?.(e[o.value], !A);
|
|
80
|
-
}, P = (t = !1) => {
|
|
81
|
-
let r = e.icon || d.icon;
|
|
82
|
-
if (!r) return null;
|
|
83
|
-
let i = typeof r == "function" ? r(e) : r;
|
|
84
|
-
return u.isValidElement(i) ? /* @__PURE__ */ c("span", {
|
|
85
|
-
className: n({
|
|
86
|
-
"text-[#0265ff]": t,
|
|
87
|
-
"text-[#73819c]": !t
|
|
88
|
-
}),
|
|
89
|
-
children: i
|
|
90
|
-
}) : null;
|
|
91
|
-
}, F = (e) => O ? d.switcherIcon ? d.switcherIcon(e) : /* @__PURE__ */ c(t, {
|
|
92
|
-
name: "arrow-right",
|
|
93
|
-
className: n("transition-transform duration-300 ease-in-out text-[#666]", { "rotate-90": e })
|
|
94
|
-
}) : null, I = () => O && !T || E === "default" || e.checkable === !1 ? null : /* @__PURE__ */ l("div", {
|
|
95
|
-
className: "ml-auto shrink-0",
|
|
96
|
-
children: [E === "radio" && /* @__PURE__ */ c(i, { checked: k }), E === "checkbox" && /* @__PURE__ */ c(r, { checked: k })]
|
|
97
|
-
});
|
|
98
|
-
return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", {
|
|
99
|
-
className: n("rounded-[4px] cursor-pointer", {
|
|
100
|
-
"text-[#0265ff] bg-[#f0f6ff]": k && E === "default",
|
|
101
|
-
"hover:bg-[#f3f3f3]": !k || E !== "default"
|
|
102
|
-
}),
|
|
103
|
-
onClick: j,
|
|
104
|
-
children: /* @__PURE__ */ l("div", {
|
|
105
|
-
className: "flex items-center px-[10px] py-[7px] gap-x-[6px]",
|
|
106
|
-
style: { marginLeft: `${a * S}px` },
|
|
107
|
-
children: [
|
|
108
|
-
/* @__PURE__ */ c("div", {
|
|
109
|
-
className: n("w-4 h-4 flex items-center justify-center flex-shrink-0", { hidden: !D }),
|
|
110
|
-
onClick: N,
|
|
111
|
-
children: F(A)
|
|
112
|
-
}),
|
|
113
|
-
P(k),
|
|
114
|
-
u.isValidElement(e[o.title]) ? e[o.title] : /* @__PURE__ */ c(b, {
|
|
115
|
-
text: e[o.title],
|
|
116
|
-
highlight: f,
|
|
117
|
-
truncate: !1
|
|
118
|
-
}),
|
|
119
|
-
I()
|
|
120
|
-
]
|
|
121
|
-
})
|
|
122
|
-
}), O && /* @__PURE__ */ c(_, {
|
|
123
|
-
initial: !1,
|
|
124
|
-
children: A ? /* @__PURE__ */ c(v.div, {
|
|
125
|
-
initial: {
|
|
126
|
-
height: 0,
|
|
127
|
-
opacity: 0
|
|
128
|
-
},
|
|
129
|
-
animate: {
|
|
130
|
-
height: "auto",
|
|
131
|
-
opacity: 1
|
|
132
|
-
},
|
|
133
|
-
exit: {
|
|
134
|
-
height: 0,
|
|
135
|
-
opacity: 0
|
|
136
|
-
},
|
|
137
|
-
transition: {
|
|
138
|
-
duration: .2,
|
|
139
|
-
ease: [
|
|
140
|
-
.4,
|
|
141
|
-
0,
|
|
142
|
-
.2,
|
|
143
|
-
1
|
|
144
|
-
]
|
|
145
|
-
},
|
|
146
|
-
children: /* @__PURE__ */ c("div", {
|
|
147
|
-
className: "min-w-max",
|
|
148
|
-
children: e[o.children]?.map((e) => /* @__PURE__ */ c(C, {
|
|
149
|
-
node: e,
|
|
150
|
-
level: a + 1,
|
|
151
|
-
fieldNames: o
|
|
152
|
-
}, e[o.value]))
|
|
153
|
-
})
|
|
154
|
-
}, "children") : null
|
|
155
|
-
})] });
|
|
156
|
-
}, w = (e) => {
|
|
157
|
-
let { data: t, searchValue: n = "", fieldNames: r = {
|
|
158
|
-
title: "title",
|
|
159
|
-
value: "value",
|
|
160
|
-
children: "children"
|
|
161
|
-
}, icon: i, switcherIcon: s, onSelect: l, parentCheckable: u = !1, checkType: d = "default", defaultExpandedKeys: p, showSwitcher: h = !0, onDeSelect: _ } = e, [v, y] = g(e, {
|
|
162
|
-
defaultValuePropName: "defaultSelectedKeys",
|
|
163
|
-
valuePropName: "selectedKeys",
|
|
164
|
-
defaultValue: [],
|
|
165
|
-
trigger: "__DO_NOT_CALLED__"
|
|
166
|
-
}), [b, S] = g(e, {
|
|
167
|
-
valuePropName: "expandedKeys",
|
|
168
|
-
defaultValuePropName: "defaultExpandedKeys",
|
|
169
|
-
defaultValue: (() => {
|
|
170
|
-
let n = /* @__PURE__ */ new Set();
|
|
171
|
-
return e.selectedKeys?.length ? (e.selectedKeys.forEach((e) => {
|
|
172
|
-
let i = o(t, e, r);
|
|
173
|
-
i && i.length > 1 && i.slice(0, -1).forEach((e) => n.add(e));
|
|
174
|
-
}), [...n]) : [];
|
|
175
|
-
})(),
|
|
176
|
-
trigger: "onExpand"
|
|
177
|
-
});
|
|
178
|
-
m(() => {
|
|
179
|
-
if (!n) {
|
|
180
|
-
if (v.length || p?.length) return;
|
|
181
|
-
S([]);
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
let e = /* @__PURE__ */ new Set(), i = a(t, n, r);
|
|
185
|
-
if (i.length === 0) {
|
|
186
|
-
S([]);
|
|
187
|
-
return;
|
|
188
|
-
}
|
|
189
|
-
i.forEach((t) => t.slice(0, -1).forEach((t) => e.add(t))), e.size !== 0 && S([...e]);
|
|
190
|
-
}, [n]);
|
|
191
|
-
let w = f((e, t) => {
|
|
192
|
-
y((t) => d === "checkbox" ? [...new Set([...t, e])] : [e]), l && l?.(e, t);
|
|
193
|
-
}, [
|
|
194
|
-
l,
|
|
195
|
-
y,
|
|
196
|
-
d
|
|
197
|
-
]), T = (e, t) => {
|
|
198
|
-
w(e, t);
|
|
199
|
-
}, E = f((e) => {
|
|
200
|
-
y((t) => t.filter((t) => t !== e)), _?.(e);
|
|
201
|
-
}, [y, _]), D = (e, t) => {
|
|
202
|
-
S(t ? [...b, e] : b.filter((t) => t !== e));
|
|
203
|
-
};
|
|
204
|
-
if (!t?.length) return null;
|
|
205
|
-
let O = {
|
|
206
|
-
searchValue: n,
|
|
207
|
-
selectedKeys: v,
|
|
208
|
-
expandedKeys: b,
|
|
209
|
-
onSelect: T,
|
|
210
|
-
onDeSelect: E,
|
|
211
|
-
onExpand: D,
|
|
212
|
-
icon: i,
|
|
213
|
-
switcherIcon: s,
|
|
214
|
-
checkType: d,
|
|
215
|
-
parentCheckable: u,
|
|
216
|
-
showSwitcher: h
|
|
217
|
-
};
|
|
218
|
-
return /* @__PURE__ */ c(x.Provider, {
|
|
219
|
-
value: O,
|
|
220
|
-
children: /* @__PURE__ */ c("div", {
|
|
221
|
-
className: "bsy-tree text-sm",
|
|
222
|
-
children: t.map((e) => /* @__PURE__ */ c(C, {
|
|
223
|
-
node: e,
|
|
224
|
-
fieldNames: r
|
|
225
|
-
}, e[r.value]))
|
|
226
|
-
})
|
|
227
|
-
});
|
|
228
|
-
};
|
|
229
|
-
w.displayName = "BsyTree";
|
|
230
|
-
//#endregion
|
|
231
|
-
export { b as n, w as t };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
2
|
-
function e(t) {
|
|
3
|
-
var n, r, i = "";
|
|
4
|
-
if (typeof t == "string" || typeof t == "number") i += t;
|
|
5
|
-
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
6
|
-
var a = t.length;
|
|
7
|
-
for (n = 0; n < a; n++) t[n] && (r = e(t[n])) && (i && (i += " "), i += r);
|
|
8
|
-
} else for (r in t) t[r] && (i && (i += " "), i += r);
|
|
9
|
-
return i;
|
|
10
|
-
}
|
|
11
|
-
function t() {
|
|
12
|
-
for (var t, n, r = 0, i = "", a = arguments.length; r < a; r++) (t = arguments[r]) && (n = e(t)) && (i && (i += " "), i += n);
|
|
13
|
-
return i;
|
|
14
|
-
}
|
|
15
|
-
//#endregion
|
|
16
|
-
export { t };
|