@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.
- 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-7KGHOKs6.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/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-CCY2gtpG.js → Tree-C-8x1jXV.js} +4 -4
- 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 +9 -7
- 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/lexical-Bz4mqKs6.js +0 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as e, jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import { useState as l } from "react";
|
|
3
3
|
import { c as n } from "../vendors/clsx-OuTLNxxd.js";
|
|
4
|
-
import { I as p } from "../Icon/Icon-
|
|
4
|
+
import { I as p } from "../Icon/Icon-CkHAU1fA.js";
|
|
5
5
|
const _ = {
|
|
6
6
|
"bsy-card": "_bsy-card_myftj_1",
|
|
7
7
|
"bsy-card__header": "_bsy-card__header_myftj_6",
|
|
@@ -40,7 +40,7 @@ const _ = {
|
|
|
40
40
|
onClick: m,
|
|
41
41
|
style: a == null ? void 0 : a.header,
|
|
42
42
|
children: [
|
|
43
|
-
/* @__PURE__ */ c("
|
|
43
|
+
/* @__PURE__ */ c("div", { className: _["bsy-card__title"], role: "heading", children: r }),
|
|
44
44
|
/* @__PURE__ */ c("div", { className: _["bsy-card__icon-container"], children: /* @__PURE__ */ c(
|
|
45
45
|
p,
|
|
46
46
|
{
|
package/dist/Card/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as m, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { createContext as B, forwardRef as E, useContext as R } from "react";
|
|
3
|
-
import { I as j } from "../Icon/Icon-
|
|
3
|
+
import { I as j } from "../Icon/Icon-CkHAU1fA.js";
|
|
4
4
|
import { c as i } from "../vendors/clsx-OuTLNxxd.js";
|
|
5
|
-
import { u as O } from "../vendors/lodash-es-
|
|
5
|
+
import { u as O } from "../vendors/lodash-es-DFpaJB4Y.js";
|
|
6
6
|
const P = B(null), V = "_checkbox_vheru_1", q = "_checkbox__inner_vheru_32", o = {
|
|
7
7
|
checkbox: V,
|
|
8
8
|
"checkbox--checked": "_checkbox--checked_vheru_12",
|
package/dist/CheckBox/index.js
CHANGED
|
@@ -1,37 +1,39 @@
|
|
|
1
|
-
import { L as o, C as c, B as
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useControllableValue as
|
|
4
|
-
import { c as
|
|
1
|
+
import { L as o, C as c, B as n } from "./CheckBox-VlP6u_-s.js";
|
|
2
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { useControllableValue as f } from "ahooks";
|
|
4
|
+
import { c as C } from "../vendors/clsx-OuTLNxxd.js";
|
|
5
5
|
const m = ({
|
|
6
|
-
disabled:
|
|
6
|
+
disabled: l,
|
|
7
7
|
layout: e = o.NONE,
|
|
8
|
-
children:
|
|
8
|
+
children: p,
|
|
9
|
+
className: a,
|
|
9
10
|
...s
|
|
10
11
|
}) => {
|
|
11
|
-
const [
|
|
12
|
+
const [t, x] = f(s, {
|
|
12
13
|
defaultValue: [],
|
|
13
14
|
valuePropName: "value",
|
|
14
15
|
defaultValuePropName: "defaultValue",
|
|
15
16
|
trigger: "onChange"
|
|
16
|
-
}),
|
|
17
|
+
}), u = C("flex", {
|
|
17
18
|
"flex-col": e === o.NONE,
|
|
18
19
|
"flex-col gap-[10px]": e === o.VERTICAL,
|
|
19
|
-
"flex-row gap-y-[10px] gap-x-[20px] flex-wrap": e === o.HORIZONTAL
|
|
20
|
+
"flex-row gap-y-[10px] gap-x-[20px] flex-wrap": e === o.HORIZONTAL,
|
|
21
|
+
[a || ""]: !!a
|
|
20
22
|
});
|
|
21
|
-
return /* @__PURE__ */
|
|
23
|
+
return /* @__PURE__ */ r(
|
|
22
24
|
c.Provider,
|
|
23
25
|
{
|
|
24
26
|
value: {
|
|
25
|
-
value:
|
|
26
|
-
onChange:
|
|
27
|
-
disabled:
|
|
27
|
+
value: t,
|
|
28
|
+
onChange: x,
|
|
29
|
+
disabled: l,
|
|
28
30
|
layout: e
|
|
29
31
|
},
|
|
30
|
-
children: /* @__PURE__ */
|
|
32
|
+
children: /* @__PURE__ */ r("div", { className: u, children: p })
|
|
31
33
|
}
|
|
32
34
|
);
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
+
}, i = n;
|
|
36
|
+
i.Group = m;
|
|
35
37
|
export {
|
|
36
|
-
|
|
38
|
+
i as default
|
|
37
39
|
};
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { jsx as r, jsxs as _, Fragment as O } from "react/jsx-runtime";
|
|
2
|
+
import { ColorPicker as w } from "antd";
|
|
3
|
+
import { AnimatePresence as R, motion as A } from "motion/react";
|
|
4
|
+
import { useFloating as F, offset as I, flip as x, shift as L, useClick as E, useDismiss as T, useInteractions as V, FloatingPortal as j } from "@floating-ui/react";
|
|
5
|
+
import { useState as k, isValidElement as B, cloneElement as D, useRef as G } from "react";
|
|
6
|
+
import { useControllableValue as M } from "ahooks";
|
|
7
|
+
import { I as d } from "../Icon/Icon-CkHAU1fA.js";
|
|
8
|
+
import { u as g } from "../vendors/useLocale-DgqW9M3h.js";
|
|
9
|
+
import { c as $ } from "../vendors/clsx-OuTLNxxd.js";
|
|
10
|
+
import { a as u } from "../vendors/color-VzwvCPhF.js";
|
|
11
|
+
import { t as q } from "../vendors/tinycolor2-Begv3Jc8.js";
|
|
12
|
+
import { P as z } from "../vendors/index-MTmG1Ezy.js";
|
|
13
|
+
import { c as H } from "../vendors/lodash-es-DFpaJB4Y.js";
|
|
14
|
+
const J = [
|
|
15
|
+
"rgba(240, 102, 72, 1)",
|
|
16
|
+
// #F06648
|
|
17
|
+
"rgba(255, 197, 2, 1)",
|
|
18
|
+
// #FFC502
|
|
19
|
+
"rgba(74, 204, 140, 1)",
|
|
20
|
+
// #4ACC8C
|
|
21
|
+
"rgba(74, 192, 236, 1)",
|
|
22
|
+
// #4AC0EC
|
|
23
|
+
"rgba(255, 153, 33, 1)",
|
|
24
|
+
// #ff9921
|
|
25
|
+
"rgba(101, 101, 101, 1)",
|
|
26
|
+
// #656565
|
|
27
|
+
"rgba(255, 156, 136, 1)",
|
|
28
|
+
// #ff9c88
|
|
29
|
+
"rgba(98, 98, 206, 1)",
|
|
30
|
+
// #6262ce
|
|
31
|
+
"rgba(241, 104, 182, 1)",
|
|
32
|
+
// #f168b6
|
|
33
|
+
"rgba(55, 103, 241, 1)",
|
|
34
|
+
// #3767f1
|
|
35
|
+
"rgba(162, 206, 30, 1)",
|
|
36
|
+
// #a2ce1e
|
|
37
|
+
"rgba(179, 179, 179, 1)",
|
|
38
|
+
// #b3b3b3
|
|
39
|
+
"rgba(0, 0, 0, 1)",
|
|
40
|
+
// #000000
|
|
41
|
+
"rgba(102, 102, 102, 1)",
|
|
42
|
+
// #666
|
|
43
|
+
"rgba(153, 153, 153, 1)",
|
|
44
|
+
// #999
|
|
45
|
+
"rgba(194, 194, 194, 1)",
|
|
46
|
+
// #c2c2c2
|
|
47
|
+
"rgba(224, 224, 224, 1)",
|
|
48
|
+
// #e0e0e0
|
|
49
|
+
"rgba(77, 96, 159, 1)"
|
|
50
|
+
// #4d609f
|
|
51
|
+
], K = (s = "bottom-start") => {
|
|
52
|
+
const [t, o] = k(!1), { refs: i, floatingStyles: e, context: a } = F({
|
|
53
|
+
open: t,
|
|
54
|
+
onOpenChange: o,
|
|
55
|
+
placement: s,
|
|
56
|
+
middleware: [
|
|
57
|
+
I(4),
|
|
58
|
+
// 浮层与触发器间距
|
|
59
|
+
x(),
|
|
60
|
+
// 超出边界时自动翻转
|
|
61
|
+
L({ padding: 8 })
|
|
62
|
+
// 自动避开边界
|
|
63
|
+
]
|
|
64
|
+
}), n = E(a), l = T(a), { getReferenceProps: p, getFloatingProps: m } = V([n, l]);
|
|
65
|
+
return {
|
|
66
|
+
isOpen: t,
|
|
67
|
+
refs: i,
|
|
68
|
+
floatingStyles: e,
|
|
69
|
+
getReferenceProps: p,
|
|
70
|
+
getFloatingProps: m,
|
|
71
|
+
setIsOpen: o
|
|
72
|
+
};
|
|
73
|
+
}, c = {
|
|
74
|
+
"bsy-color-picker__floating": "_bsy-color-picker__floating_1kfi6_1",
|
|
75
|
+
"bsy-color-picker__content": "_bsy-color-picker__content_1kfi6_4",
|
|
76
|
+
"bsy-color-picker__grid": "_bsy-color-picker__grid_1kfi6_11",
|
|
77
|
+
"bsy-color-picker__preset-colors-title": "_bsy-color-picker__preset-colors-title_1kfi6_15",
|
|
78
|
+
"bsy-color-picker__preset-colors-grid": "_bsy-color-picker__preset-colors-grid_1kfi6_19",
|
|
79
|
+
"bsy-color-picker__preset-colors-item": "_bsy-color-picker__preset-colors-item_1kfi6_24",
|
|
80
|
+
"bsy-color-picker__custom-color-title": "_bsy-color-picker__custom-color-title_1kfi6_47",
|
|
81
|
+
"bsy-color-picker__custom-color-btn": "_bsy-color-picker__custom-color-btn_1kfi6_51",
|
|
82
|
+
"bsy-color-picker__custom-color-btn--active": "_bsy-color-picker__custom-color-btn--active_1kfi6_61",
|
|
83
|
+
"bsy-color-picker__custom-color-btn--preview": "_bsy-color-picker__custom-color-btn--preview_1kfi6_65",
|
|
84
|
+
"bsy-color-picker__custom-color-content": "_bsy-color-picker__custom-color-content_1kfi6_68",
|
|
85
|
+
"bsy-color-picker__check-icon": "_bsy-color-picker__check-icon_1kfi6_72"
|
|
86
|
+
}, y = ({
|
|
87
|
+
currentColor: s,
|
|
88
|
+
onColorSelect: t,
|
|
89
|
+
options: o,
|
|
90
|
+
style: i
|
|
91
|
+
}) => /* @__PURE__ */ r("div", { className: c["bsy-color-picker__preset-colors-grid"], style: i, children: o.map((e) => /* @__PURE__ */ r(
|
|
92
|
+
"div",
|
|
93
|
+
{
|
|
94
|
+
className: c["bsy-color-picker__preset-colors-item"],
|
|
95
|
+
style: {
|
|
96
|
+
backgroundColor: e,
|
|
97
|
+
"--hover-color": q(e).setAlpha(0.5).toRgbString()
|
|
98
|
+
},
|
|
99
|
+
onClick: () => t(e),
|
|
100
|
+
children: u(s, e) && /* @__PURE__ */ r(d, { name: "checkthebox", className: c["bsy-color-picker__check-icon"] })
|
|
101
|
+
},
|
|
102
|
+
e
|
|
103
|
+
)) }), Q = (s) => {
|
|
104
|
+
const { children: t, placement: o = "bottom-start", disabled: i = !1, presetColors: e } = s, { t: a } = g(), [n, l] = M(s, {
|
|
105
|
+
defaultValue: s.value
|
|
106
|
+
}), { isOpen: p, refs: m, floatingStyles: f, getReferenceProps: C, getFloatingProps: h } = K(o), v = B(t) ? D(t, {
|
|
107
|
+
...C(),
|
|
108
|
+
// @ts-ignore
|
|
109
|
+
ref: m.setReference,
|
|
110
|
+
disabled: i
|
|
111
|
+
}) : t, b = H(e) && e.length ? e : J, P = b.some((S) => u(S, n)), N = G(P ? [] : [n]);
|
|
112
|
+
return /* @__PURE__ */ _(O, { children: [
|
|
113
|
+
v,
|
|
114
|
+
/* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(R, { children: p && /* @__PURE__ */ r(
|
|
115
|
+
"div",
|
|
116
|
+
{
|
|
117
|
+
ref: m.setFloating,
|
|
118
|
+
style: f,
|
|
119
|
+
...h(),
|
|
120
|
+
className: c["bsy-color-picker__floating"],
|
|
121
|
+
children: /* @__PURE__ */ r(A.div, { ...z, children: /* @__PURE__ */ r("div", { className: c["bsy-color-picker__content"], children: /* @__PURE__ */ _("div", { className: c["bsy-color-picker__grid"], children: [
|
|
122
|
+
/* @__PURE__ */ _("div", { className: c["bsy-color-picker__preset-colors"], children: [
|
|
123
|
+
/* @__PURE__ */ r("div", { className: c["bsy-color-picker__preset-colors-title"], children: a("presetColors") }),
|
|
124
|
+
/* @__PURE__ */ r(
|
|
125
|
+
y,
|
|
126
|
+
{
|
|
127
|
+
currentColor: n,
|
|
128
|
+
onColorSelect: l,
|
|
129
|
+
options: b
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
] }),
|
|
133
|
+
/* @__PURE__ */ r(
|
|
134
|
+
U,
|
|
135
|
+
{
|
|
136
|
+
value: n,
|
|
137
|
+
onChange: l,
|
|
138
|
+
options: b,
|
|
139
|
+
list: N.current
|
|
140
|
+
}
|
|
141
|
+
)
|
|
142
|
+
] }) }) })
|
|
143
|
+
}
|
|
144
|
+
) }) })
|
|
145
|
+
] });
|
|
146
|
+
}, U = (s) => {
|
|
147
|
+
const { list: t } = s, [o, i] = k(), [e, a] = k(!1), { t: n } = g();
|
|
148
|
+
return /* @__PURE__ */ _("div", { className: c["bsy-color-picker__custom-color"], children: [
|
|
149
|
+
/* @__PURE__ */ r("div", { className: c["bsy-color-picker__custom-color-title"], children: n("customColor") }),
|
|
150
|
+
/* @__PURE__ */ _("div", { className: c["bsy-color-picker__custom-color-content"], children: [
|
|
151
|
+
/* @__PURE__ */ r(
|
|
152
|
+
w,
|
|
153
|
+
{
|
|
154
|
+
value: o,
|
|
155
|
+
onChange: (l) => i(l.toRgbString()),
|
|
156
|
+
open: e,
|
|
157
|
+
onOpenChange: (l) => {
|
|
158
|
+
a(l), !l && o && (t.includes(o) || t.unshift(o), s.onChange(o), i(void 0));
|
|
159
|
+
},
|
|
160
|
+
children: /* @__PURE__ */ r(
|
|
161
|
+
"div",
|
|
162
|
+
{
|
|
163
|
+
className: $(c["bsy-color-picker__custom-color-btn"], {
|
|
164
|
+
[c["bsy-color-picker__custom-color-btn--active"]]: e && !o,
|
|
165
|
+
[c["bsy-color-picker__custom-color-btn--preview"]]: !!o
|
|
166
|
+
}),
|
|
167
|
+
role: "button",
|
|
168
|
+
style: {
|
|
169
|
+
backgroundColor: o || void 0
|
|
170
|
+
},
|
|
171
|
+
onClick: () => {
|
|
172
|
+
a(!0);
|
|
173
|
+
},
|
|
174
|
+
children: /* @__PURE__ */ r(
|
|
175
|
+
d,
|
|
176
|
+
{
|
|
177
|
+
name: "add",
|
|
178
|
+
style: {
|
|
179
|
+
visibility: o ? "hidden" : "visible"
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
)
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
}
|
|
186
|
+
),
|
|
187
|
+
/* @__PURE__ */ r(
|
|
188
|
+
y,
|
|
189
|
+
{
|
|
190
|
+
currentColor: s.value,
|
|
191
|
+
onColorSelect: s.onChange,
|
|
192
|
+
options: t.slice(0, 5),
|
|
193
|
+
style: {
|
|
194
|
+
gridTemplateColumns: "repeat(5, 1fr)"
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
)
|
|
198
|
+
] })
|
|
199
|
+
] });
|
|
200
|
+
};
|
|
201
|
+
Q.displayName = "BsyColorPicker";
|
|
202
|
+
export {
|
|
203
|
+
Q as C,
|
|
204
|
+
J as a
|
|
205
|
+
};
|
|
@@ -0,0 +1,166 @@
|
|
|
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-DigfTvpo.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
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const l = [
|
|
2
|
+
{ label: "12", value: "12px" },
|
|
3
|
+
{ label: "14", value: "14px" },
|
|
4
|
+
{ label: "16", value: "16px" },
|
|
5
|
+
{ label: "18", value: "18px" },
|
|
6
|
+
{ label: "20", value: "20px" },
|
|
7
|
+
{ label: "22", value: "22px" },
|
|
8
|
+
{ label: "24", value: "24px" },
|
|
9
|
+
{ label: "28", value: "28px" },
|
|
10
|
+
{ label: "32", value: "32px" },
|
|
11
|
+
{ label: "36", value: "36px" },
|
|
12
|
+
{ label: "64", value: "64px" },
|
|
13
|
+
{ label: "128", value: "128px" }
|
|
14
|
+
], a = "16px", e = "#000", p = "transparent";
|
|
15
|
+
export {
|
|
16
|
+
p as DEFAULT_BACKGROUND_COLOR,
|
|
17
|
+
e as DEFAULT_FONT_COLOR,
|
|
18
|
+
a as DEFAULT_FONT_SIZE,
|
|
19
|
+
l as FONT_SIZES
|
|
20
|
+
};
|