@baishuyun/ui-base 2.3.0 → 2.3.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.
- package/dist/Card/Card-BE6v4I-A.js +69 -0
- package/dist/Card/index.js +3 -4
- package/dist/CheckBox/CheckBox--rXaUgMO.js +67 -0
- package/dist/CheckBox/CheckBox-Db8X-pw9.js +33 -0
- package/dist/CheckBox/index.js +4 -39
- package/dist/ColorPicker/ColorPicker-BBP-4-so.js +168 -0
- package/dist/ColorPicker/index.js +6 -5
- package/dist/DropDown/DropDown-CKXi9mXN.js +162 -0
- package/dist/DropDown/index.js +7 -4
- package/dist/Editor/Buttons--dMLPuk2.js +595 -0
- package/dist/Editor/ToolbarPlugin/Buttons/index.js +14 -8
- package/dist/Editor/constants/index.js +53 -20
- package/dist/Editor/index.js +518 -576
- package/dist/Icon/Icon-DppVOyPK.js +19 -0
- package/dist/Icon/index.js +2 -4
- package/dist/InputTag/InputTag-B6N5MZA2.js +139 -0
- package/dist/InputTag/index.js +3 -4
- package/dist/Loading/Loading-Bi5NO-Ky.js +15 -0
- package/dist/Loading/index.js +2 -4
- package/dist/Modal/Modal-FVJpbEgw.js +81 -0
- package/dist/Modal/index.js +3 -4
- package/dist/NotFoundContent/NotFoundContent-CTPpcZOt.js +9 -0
- package/dist/NotFoundContent/index.js +2 -4
- package/dist/Radio/Radio-dyoBNiKF.js +85 -0
- package/dist/Radio/index.js +2 -105
- package/dist/Segmented/Segmented-Dd8glDXI.js +62 -0
- package/dist/Segmented/index.js +2 -4
- package/dist/Select/Select-Bd2ECrB0.js +729 -0
- package/dist/Select/SelectInputSearch-CIXBNLFi.js +46 -0
- package/dist/Select/index.js +11 -6
- package/dist/Tabs/Tabs-C79GTyGd.js +410 -0
- package/dist/Tabs/index.js +6 -7
- package/dist/Tree/index.js +5 -4
- package/dist/Tree/utils/index.js +24 -39
- package/dist/components/Editor/context/EditorContainerContext.d.ts +8 -0
- package/dist/index.js +103 -81
- package/dist/style.css +2 -1
- package/dist/vendors/Tree-CQR9fvpA.js +231 -0
- package/dist/vendors/animations-C5JKFkz4.js +38 -0
- package/dist/vendors/clsx-DNOE4Gl8.js +16 -0
- package/dist/vendors/color-BPWy9DvT.js +12 -0
- package/dist/vendors/fuse.js-BKtvbTjL.js +877 -0
- package/dist/vendors/lexical-hZliMgDv.js +6439 -0
- package/dist/vendors/lodash-es-Bu9xU1fK.js +334 -0
- package/dist/vendors/simplebar-react-CFlS-Nm9.js +370 -0
- package/dist/vendors/tinycolor2-DToeAEPD.js +726 -0
- package/dist/vendors/useFloatingPortal-BA6P5GxV.js +45 -0
- package/dist/vendors/useLocale-BfT0V1j4.js +75 -0
- package/package.json +3 -3
- package/dist/Card/Card-Y1ISqAp9.js +0 -86
- package/dist/CheckBox/CheckBox-C9sXWSA5.js +0 -84
- package/dist/ColorPicker/ColorPicker-D0D5azon.js +0 -216
- package/dist/DropDown/DropDown-DGkSeXQT.js +0 -166
- package/dist/Editor/index-C0Rjz8DK.js +0 -846
- package/dist/Icon/Icon-CBlIwtp2.js +0 -24
- package/dist/InputTag/InputTag-C-rQUJnF.js +0 -155
- package/dist/Loading/Loading-CEB4PLUE.js +0 -9
- package/dist/Modal/Modal-z3TvEXwN.js +0 -80
- package/dist/NotFoundContent/NotFoundContent-h0-oIXlk.js +0 -6
- package/dist/Segmented/Segmented-UgzW78Ey.js +0 -75
- package/dist/Select/Select-hwXXDuLU.js +0 -820
- package/dist/Select/SelectInputSearch-ChUpUgxa.js +0 -34
- package/dist/Tabs/TabSelect-DL8Bhehc.js +0 -445
- package/dist/vendors/Tree-CLEy-xqz.js +0 -235
- package/dist/vendors/clsx-OuTLNxxd.js +0 -16
- package/dist/vendors/color-VzwvCPhF.js +0 -21
- package/dist/vendors/fuse.js-D1DCbUBb.js +0 -1022
- package/dist/vendors/index-MTmG1Ezy.js +0 -15
- package/dist/vendors/lexical-DO7eMeC2.js +0 -5891
- package/dist/vendors/lodash-es-DFpaJB4Y.js +0 -305
- package/dist/vendors/simplebar-react-D68KzE44.js +0 -408
- package/dist/vendors/tinycolor2-Begv3Jc8.js +0 -711
- package/dist/vendors/useFloatingPortal-9VUFOAOG.js +0 -45
- package/dist/vendors/useLocale-DgqW9M3h.js +0 -47
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { jsxs as w, jsx as o, Fragment as V } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as f, memo as q, useState as G, isValidElement as J, cloneElement as Q } from "react";
|
|
3
|
-
import { FloatingPortal as U } from "@floating-ui/react";
|
|
4
|
-
import { AnimatePresence as W, motion as X } from "motion/react";
|
|
5
|
-
import { useControllableValue as Y } from "ahooks";
|
|
6
|
-
import { u as Z } from "../vendors/useFloatingPortal-9VUFOAOG.js";
|
|
7
|
-
import { F as $ } from "../vendors/fuse.js-D1DCbUBb.js";
|
|
8
|
-
import { a as S, b as D } from "../vendors/lodash-es-DFpaJB4Y.js";
|
|
9
|
-
import { P as ee } from "../vendors/index-MTmG1Ezy.js";
|
|
10
|
-
import { S as ne } from "../Select/SelectInputSearch-ChUpUgxa.js";
|
|
11
|
-
import { c as h } from "../vendors/clsx-OuTLNxxd.js";
|
|
12
|
-
import { N as C } from "../NotFoundContent/NotFoundContent-h0-oIXlk.js";
|
|
13
|
-
import { u as z } from "../vendors/useLocale-DgqW9M3h.js";
|
|
14
|
-
import { S as oe } from "../vendors/simplebar-react-D68KzE44.js";
|
|
15
|
-
const se = ({
|
|
16
|
-
menus: e,
|
|
17
|
-
searchValue: r,
|
|
18
|
-
enableInternalFilter: n,
|
|
19
|
-
searchKey: i
|
|
20
|
-
// 默认搜索 label 字段
|
|
21
|
-
}) => {
|
|
22
|
-
const s = f(
|
|
23
|
-
() => new $(e, {
|
|
24
|
-
keys: [i],
|
|
25
|
-
ignoreLocation: !0,
|
|
26
|
-
threshold: 0.3,
|
|
27
|
-
// 自定义字段值获取函数
|
|
28
|
-
getFn: (c, a) => {
|
|
29
|
-
const _ = c[a];
|
|
30
|
-
return a === "label" && typeof _ != "string" ? "" : String(_ || "");
|
|
31
|
-
}
|
|
32
|
-
}),
|
|
33
|
-
[e, i]
|
|
34
|
-
), t = f(() => !n || S(r) ? e : s.search(r).map((a) => a.item), [e, r, n, s]), p = f(() => n && !S(r) && t.length === 0, [n, r, t.length]);
|
|
35
|
-
return {
|
|
36
|
-
filteredMenus: t,
|
|
37
|
-
hasNoResults: p
|
|
38
|
-
};
|
|
39
|
-
}, te = "_dropdown__panel_11n5z_7", re = "_dropdown__search_11n5z_15", de = "_dropdown__menu_11n5z_19", d = {
|
|
40
|
-
dropdown__panel: te,
|
|
41
|
-
dropdown__search: re,
|
|
42
|
-
dropdown__menu: de,
|
|
43
|
-
"dropdown__menu-item": "_dropdown__menu-item_11n5z_22",
|
|
44
|
-
"dropdown__menu-item--disabled": "_dropdown__menu-item--disabled_11n5z_34",
|
|
45
|
-
"dropdown__menu-item--active": "_dropdown__menu-item--active_11n5z_34",
|
|
46
|
-
"dropdown__menu-item-icon": "_dropdown__menu-item-icon_11n5z_41",
|
|
47
|
-
"system-field": "_system-field_11n5z_52",
|
|
48
|
-
"dropdown__menu-item-label": "_dropdown__menu-item-label_11n5z_63"
|
|
49
|
-
}, F = q(({ item: e, onClick: r, isActive: n = !1 }) => {
|
|
50
|
-
const i = () => {
|
|
51
|
-
e.disabled || r(e);
|
|
52
|
-
}, s = e.systemField || !1;
|
|
53
|
-
return /* @__PURE__ */ w(
|
|
54
|
-
"div",
|
|
55
|
-
{
|
|
56
|
-
className: h(d["dropdown__menu-item"], {
|
|
57
|
-
[d["dropdown__menu-item--disabled"]]: e.disabled,
|
|
58
|
-
[d["dropdown__menu-item--active"]]: n && !e.disabled,
|
|
59
|
-
"text-[#4d609f]": s && !e.disabled && !n
|
|
60
|
-
}),
|
|
61
|
-
onClick: i,
|
|
62
|
-
children: [
|
|
63
|
-
e.icon && /* @__PURE__ */ o(
|
|
64
|
-
"div",
|
|
65
|
-
{
|
|
66
|
-
className: h(d["dropdown__menu-item-icon"], {
|
|
67
|
-
[d["system-field"]]: s
|
|
68
|
-
}),
|
|
69
|
-
children: e.icon
|
|
70
|
-
}
|
|
71
|
-
),
|
|
72
|
-
/* @__PURE__ */ o("div", { className: h(d["dropdown__menu-item-label"], "truncate"), children: e.label })
|
|
73
|
-
]
|
|
74
|
-
}
|
|
75
|
-
);
|
|
76
|
-
});
|
|
77
|
-
F.displayName = "BsyDropDownMenuItem";
|
|
78
|
-
const M = ({ menus: e, onClick: r, hasNoResults: n, activeKey: i = [] }) => {
|
|
79
|
-
const { t: s } = z();
|
|
80
|
-
return e.length === 0 ? /* @__PURE__ */ o(C, { text: s("noData"), className: "px-3 py-6" }) : n ? /* @__PURE__ */ o(C, { text: s("noDataFound"), className: "px-3 py-6" }) : /* @__PURE__ */ o("div", { className: d.dropdown__menu, children: e.map((t) => /* @__PURE__ */ o(
|
|
81
|
-
F,
|
|
82
|
-
{
|
|
83
|
-
item: t,
|
|
84
|
-
onClick: r,
|
|
85
|
-
isActive: i.includes(t.key)
|
|
86
|
-
},
|
|
87
|
-
t.key
|
|
88
|
-
)) });
|
|
89
|
-
};
|
|
90
|
-
M.displayName = "BsyDropDownMenuList";
|
|
91
|
-
const ie = (e) => {
|
|
92
|
-
const { t: r } = z(), {
|
|
93
|
-
children: n,
|
|
94
|
-
menus: i,
|
|
95
|
-
onClick: s,
|
|
96
|
-
onSearch: t,
|
|
97
|
-
searchKey: p = "label",
|
|
98
|
-
showSearch: c = !0,
|
|
99
|
-
closeOnSelect: a = !0,
|
|
100
|
-
searchPlaceholder: _ = r("search"),
|
|
101
|
-
offset: m = { x: 0, y: 0 },
|
|
102
|
-
zIndex: k = 1101,
|
|
103
|
-
style: P,
|
|
104
|
-
activeKey: R = []
|
|
105
|
-
} = e, [u, y] = Y(e, {
|
|
106
|
-
valuePropName: "visible",
|
|
107
|
-
defaultValue: !1,
|
|
108
|
-
trigger: "onOpenChange"
|
|
109
|
-
}), [g, L] = G(""), O = () => {
|
|
110
|
-
y(!u);
|
|
111
|
-
}, N = () => {
|
|
112
|
-
y(!1);
|
|
113
|
-
}, A = (l) => {
|
|
114
|
-
l.disabled || (s == null || s(l), a && N());
|
|
115
|
-
}, B = (l) => {
|
|
116
|
-
L(l), t == null || t(l);
|
|
117
|
-
}, { filteredMenus: E, hasNoResults: I } = se({
|
|
118
|
-
menus: i,
|
|
119
|
-
searchValue: g,
|
|
120
|
-
enableInternalFilter: !t,
|
|
121
|
-
searchKey: p
|
|
122
|
-
}), { refs: b, floatingStyles: j, getReferenceProps: T, getFloatingProps: H } = Z({
|
|
123
|
-
isOpen: u,
|
|
124
|
-
close: N,
|
|
125
|
-
showMask: !1,
|
|
126
|
-
zIndex: k,
|
|
127
|
-
offset: {
|
|
128
|
-
x: D(m.x) ? m.x : 0,
|
|
129
|
-
y: D(m.y) ? m.y : 0
|
|
130
|
-
}
|
|
131
|
-
}), K = J(n) ? Q(n, {
|
|
132
|
-
...T(),
|
|
133
|
-
// @ts-ignore
|
|
134
|
-
ref: b.setReference,
|
|
135
|
-
onClick: (l) => {
|
|
136
|
-
var v, x;
|
|
137
|
-
O(), (x = (v = n.props).onClick) == null || x.call(v, l);
|
|
138
|
-
}
|
|
139
|
-
}) : n;
|
|
140
|
-
return /* @__PURE__ */ w(V, { children: [
|
|
141
|
-
K,
|
|
142
|
-
/* @__PURE__ */ o(U, { children: /* @__PURE__ */ o(W, { children: u && /* @__PURE__ */ o("div", { ref: b.setFloating, ...H(), style: j, children: /* @__PURE__ */ o(X.div, { ...ee, children: /* @__PURE__ */ w("div", { className: d.dropdown__panel, style: P, children: [
|
|
143
|
-
c && /* @__PURE__ */ o("div", { className: d.dropdown__search, children: /* @__PURE__ */ o(
|
|
144
|
-
ne,
|
|
145
|
-
{
|
|
146
|
-
value: g,
|
|
147
|
-
onChange: B,
|
|
148
|
-
searchPlaceholder: _
|
|
149
|
-
}
|
|
150
|
-
) }),
|
|
151
|
-
/* @__PURE__ */ o(oe, { style: { maxHeight: 300 }, children: /* @__PURE__ */ o(
|
|
152
|
-
M,
|
|
153
|
-
{
|
|
154
|
-
menus: E,
|
|
155
|
-
onClick: A,
|
|
156
|
-
hasNoResults: I,
|
|
157
|
-
activeKey: R
|
|
158
|
-
}
|
|
159
|
-
) })
|
|
160
|
-
] }) }) }) }) })
|
|
161
|
-
] });
|
|
162
|
-
};
|
|
163
|
-
ie.displayName = "BsyDropDown";
|
|
164
|
-
export {
|
|
165
|
-
ie as D
|
|
166
|
-
};
|