@baishuyun/ui-base 6.14.1 → 6.15.0
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/Amap/AmapCircle/index.js +1 -1
- package/dist/Amap/AmapMarker/index.js +1 -1
- package/dist/Amap/AmapMarkerCluster/index.js +1 -1
- package/dist/Amap/AmapProvider/index.js +4 -4
- package/dist/Amap/{AmapProvider-BwyzXpEj.js → AmapProvider-B-R2DrkJ.js} +1 -1
- package/dist/Amap/hooks/index.js +1 -1
- package/dist/Amap/index.js +4 -4
- package/dist/Calendar/{AllDaySection-D9YHhwIa.js → AllDaySection-b3li9ovR.js} +1 -1
- package/dist/Calendar/{Calendar-iYCmCK5P.js → Calendar-DbQvgTzh.js} +7 -7
- package/dist/Calendar/{CurrentTimeIndicator-dRYot1Rk.js → CurrentTimeIndicator-BZLQps2m.js} +1 -1
- package/dist/Calendar/{EventCard-Di5UX4pB.js → EventCard-DkJoyxI3.js} +1 -1
- package/dist/Calendar/{TimeGrid-5zMy9Hks.js → TimeGrid-Qjvt-eum.js} +1 -1
- package/dist/Calendar/context/index.js +1 -1
- package/dist/Calendar/index.js +10 -10
- package/dist/Calendar/subcomponents/AllDaySection/index.js +5 -4
- package/dist/Calendar/subcomponents/CurrentTimeIndicator/index.js +4 -3
- package/dist/Calendar/subcomponents/EventCard/index.js +4 -3
- package/dist/Calendar/subcomponents/TimeAxis/index.js +1 -1
- package/dist/Calendar/subcomponents/TimeGrid/index.js +4 -3
- package/dist/Calendar/utils/index.js +1 -1
- package/dist/Calendar/utils/layout/index.js +1 -1
- package/dist/Calendar/utils/theme/index.js +1 -1
- package/dist/Card/index.js +1 -1
- package/dist/CheckBox/index.js +1 -1
- package/dist/ColorPicker/{ColorPicker-Cm_-e0Hz.js → ColorPicker-BGduOQbR.js} +2 -2
- package/dist/ColorPicker/index.js +4 -4
- package/dist/ConfigProvider/index.js +3 -3
- package/dist/DatePicker/{DatePicker-Dt9bMTSh.js → DatePicker-CvOPih1m.js} +3 -3
- package/dist/DatePicker/{DatePickerPanel-DB6eQZ7k.js → DatePickerPanel-CrpZidbJ.js} +3 -3
- package/dist/DatePicker/index.js +4 -4
- package/dist/DatePicker/style/index.js +1 -1
- package/dist/DropDown/{DropDown-DV1IuuQD.js → DropDown-CtiUrlqk.js} +4 -4
- package/dist/DropDown/index.js +6 -6
- package/dist/DropDown/style/index.js +1 -1
- package/dist/Editor/{Buttons-C6whbXgn.js → Buttons-BhGuyTzy.js} +595 -558
- package/dist/Editor/ToolbarPlugin/Buttons/index.js +9 -8
- package/dist/Editor/constants/index.js +1 -1
- package/dist/Editor/index.js +84 -73
- package/dist/Gantt/GanttChart/index.js +9 -9
- package/dist/Gantt/{GanttChart-DEGOIgRD.js → GanttChart-C_bxX0_A.js} +3 -3
- package/dist/Gantt/GanttTable/index.js +5 -5
- package/dist/Gantt/{GanttTable-Dwb00N8Z.js → GanttTable-T7ZHce4a.js} +1 -1
- package/dist/Gantt/GanttToolBar/index.js +7 -7
- package/dist/Gantt/{GanttToolBar-BcJB6sKY.js → GanttToolBar-jhhCjBn-.js} +2 -2
- package/dist/Gantt/index.js +11 -11
- package/dist/Gantt/utils/index.js +1 -1
- package/dist/Gantt/utils/theme/index.js +1 -1
- package/dist/Icon/index.js +1 -1
- package/dist/InputTag/{InputTag-CBnG1R7g.js → InputTag-BcywA_86.js} +1 -1
- package/dist/InputTag/index.js +4 -4
- package/dist/Loading/{Loading-DYayeRbT.js → Loading-D1QxBrOq.js} +1 -1
- package/dist/Loading/index.js +4 -4
- package/dist/Modal/index.js +1 -1
- package/dist/NotFoundContent/index.js +1 -1
- package/dist/Overlay/index.js +1 -1
- package/dist/Radio/index.js +1 -1
- package/dist/ScrollBar/index.js +1 -1
- package/dist/Segmented/index.js +1 -1
- package/dist/Select/{Select-CG5wFTL4.js → Select-DWXMgoud.js} +145 -145
- package/dist/Select/{SelectInputSearch-DiuwwOWz.js → SelectInputSearch-BUWOQCgT.js} +1 -1
- package/dist/Select/index.js +6 -6
- package/dist/Table/{Table-B7J-IK2_.js → Table-BjLvTorz.js} +1 -1
- package/dist/Table/hooks/index.js +1 -1
- package/dist/Table/index.js +4 -4
- package/dist/Table/style/index.js +1 -1
- package/dist/Table/utils/index.js +1 -1
- package/dist/Tabs/{Tabs-CObQtF37.js → Tabs-DezpnxP1.js} +3 -3
- package/dist/Tabs/index.js +5 -5
- package/dist/Tooltip/Tooltip-nJU13gX4.js +175 -0
- package/dist/Tooltip/index.js +3 -2
- package/dist/Tree/index.js +1 -1
- package/dist/Tree/utils/index.js +1 -1
- package/dist/animations/index.d.ts +1 -0
- package/dist/components/Editor/ToolbarPlugin/BaseButton/BaseButton.d.ts +4 -18
- package/dist/components/Editor/ToolbarPlugin/Buttons/PictureButton/UploadImage.d.ts +3 -1
- package/dist/components/Editor/ToolbarPlugin/Buttons/index.d.ts +2 -0
- package/dist/components/Editor/ToolbarPlugin/Buttons/registry.d.ts +2 -0
- package/dist/components/Editor/ToolbarPlugin/interface.d.ts +9 -11
- package/dist/components/Editor/commands/ImageCommands.d.ts +1 -0
- package/dist/components/Editor/index.d.ts +2 -1
- package/dist/components/Editor/interface.d.ts +1 -1
- package/dist/components/Editor/nodes/ImageComponent.d.ts +1 -0
- package/dist/components/Editor/nodes/ImageNode.d.ts +6 -2
- package/dist/components/Select/interface.d.ts +7 -0
- package/dist/components/Tooltip/Tooltip.type.d.ts +1 -2
- package/dist/hooks/resolvePopupMatchSelectWidth.d.ts +4 -0
- package/dist/hooks/useFloatingPortal.d.ts +1 -0
- package/dist/hooks/useLatchedPopupPortalRoot.d.ts +1 -1
- package/dist/index.js +21 -21
- package/dist/locale/lang/en-US.json.d.ts +2 -1
- package/dist/locale/lang/zh-CN.json.d.ts +2 -1
- package/dist/locale/lang/zh-TW.json.d.ts +2 -1
- package/dist/style.css +1 -1
- package/dist/vendors/{ConfigProvider-BDyxjj6K.js → ConfigProvider-gZYvcwIQ.js} +5 -3
- package/dist/vendors/{LocaleContext-w5ODGcJX.js → LocaleContext-DXQoOKM2.js} +2 -1
- package/dist/vendors/{animations-rwUbyoT0.js → animations-Dn_5xJ7B.js} +9 -1
- package/dist/vendors/useFloatingPortal-VpzL-EPh.js +75 -0
- package/dist/vendors/{useLocale-CEDl6cUK.js → useLocale-D31qCCff.js} +1 -1
- package/dist/vendors/{version-CeLXqcsl.js → version-DuQW7jtS.js} +1 -1
- package/package.json +1 -1
- package/dist/Tooltip/Tooltip-Bb3Jx-If.js +0 -172
- package/dist/vendors/useFloatingPortal-B3N1viK2.js +0 -47
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { t as e } from "../Icon/Icon-DDHx0R18.js";
|
|
2
2
|
import { a as t, i as n } from "../Overlay/OverlayContext-CVSFoyqN.js";
|
|
3
|
-
import { t as r } from "../vendors/useLocale-
|
|
4
|
-
import { n as i,
|
|
3
|
+
import { t as r } from "../vendors/useLocale-D31qCCff.js";
|
|
4
|
+
import { n as i, r as a } from "../vendors/animations-Dn_5xJ7B.js";
|
|
5
5
|
import { t as o } from "../vendors/useLatchedPopupPortalRoot-4fVhqVT4.js";
|
|
6
|
-
import { t as s } from "./SelectInputSearch-
|
|
6
|
+
import { t as s } from "./SelectInputSearch-BUWOQCgT.js";
|
|
7
7
|
import { n as c, t as l } from "../vendors/Tree-B7XeC9Mi.js";
|
|
8
8
|
import { t as u } from "../CheckBox/CheckBox-CwfrMEFb.js";
|
|
9
9
|
import { t as d } from "../NotFoundContent/NotFoundContent-BLmzWNBi.js";
|
|
10
10
|
import { t as f } from "../ScrollBar/ScrollBar-N2pOLv-8.js";
|
|
11
|
-
import { t as p } from "../vendors/useFloatingPortal-
|
|
11
|
+
import { t as p } from "../vendors/useFloatingPortal-VpzL-EPh.js";
|
|
12
12
|
import { first as m, isArray as h, isEmpty as g, isNil as _, noop as v } from "lodash-es";
|
|
13
13
|
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
14
|
-
import { Suspense as S, createContext as C, forwardRef as w, memo as T, useCallback as E, useContext as D, useDeferredValue as O, useId as ee, useImperativeHandle as te, useLayoutEffect as ne, useMemo as k, useRef as A, useState as
|
|
15
|
-
import { Input as
|
|
16
|
-
import
|
|
17
|
-
import { useControllableValue as
|
|
18
|
-
import { AnimatePresence as
|
|
14
|
+
import { Suspense as S, createContext as C, forwardRef as w, memo as T, useCallback as E, useContext as D, useDeferredValue as O, useId as ee, useImperativeHandle as te, useLayoutEffect as ne, useMemo as k, useRef as A, useState as j } from "react";
|
|
15
|
+
import { Input as M } from "antd";
|
|
16
|
+
import N from "clsx";
|
|
17
|
+
import { useControllableValue as re, useHover as ie, useToggle as ae } from "ahooks";
|
|
18
|
+
import { AnimatePresence as oe, motion as se } from "motion/react";
|
|
19
19
|
import { FloatingPortal as ce } from "@floating-ui/react";
|
|
20
20
|
import P from "fuse.js";
|
|
21
21
|
//#region src/components/Select/constants.ts
|
|
@@ -79,7 +79,7 @@ function B(e) {
|
|
|
79
79
|
var V = T((e) => {
|
|
80
80
|
let { value: t, inputValueStyle: n } = e, { fieldNames: r, otherInputPosition: i } = R(), { isSelectedOtherOption: a, otherOptionValue: o } = z(), s = B(r), c = m(t), l;
|
|
81
81
|
return l = a && o && i === "inline" ? o : e.labelRender && c ? e.labelRender(c) : c ? s.getLabel(c) : "", /* @__PURE__ */ b("div", {
|
|
82
|
-
className:
|
|
82
|
+
className: N("bsy-select-input-container__input-value overflow-hidden"),
|
|
83
83
|
style: n,
|
|
84
84
|
children: /* @__PURE__ */ b("div", {
|
|
85
85
|
className: "bsy-select-input-container__input-value-text",
|
|
@@ -97,7 +97,7 @@ var H = {
|
|
|
97
97
|
"bsy-input-tag__item-icon": "_bsy-input-tag__item-icon_znvs6_24"
|
|
98
98
|
}, U = w(({ children: e, style: t, disabled: n }, r) => /* @__PURE__ */ b("div", {
|
|
99
99
|
"data-bsy-input-tag": "true",
|
|
100
|
-
className:
|
|
100
|
+
className: N({
|
|
101
101
|
[H["bsy-input-tag__item"]]: !0,
|
|
102
102
|
[H["bsy-input-tag__item--disabled"]]: n
|
|
103
103
|
}),
|
|
@@ -106,19 +106,19 @@ var H = {
|
|
|
106
106
|
children: e
|
|
107
107
|
}));
|
|
108
108
|
U.Container = (e) => /* @__PURE__ */ b("div", {
|
|
109
|
-
className:
|
|
109
|
+
className: N(H["bsy-input-tag__container"]),
|
|
110
110
|
children: e.children
|
|
111
111
|
}), U.displayName = "BsyOptionTag";
|
|
112
112
|
//#endregion
|
|
113
113
|
//#region src/components/Select/SelectInput/SelectMultipleInput/select-multiple-input.module.scss
|
|
114
|
-
var W = "_select_multiple_input__container_8pd2n_1", me = "_select_multiple_input__measurement_layer_8pd2n_6",
|
|
114
|
+
var W = "_select_multiple_input__container_8pd2n_1", me = "_select_multiple_input__measurement_layer_8pd2n_6", he = "_select_multiple_input__close_btn_8pd2n_14", G = "_select_multiple_input__tag_content_8pd2n_24", K = {
|
|
115
115
|
select_multiple_input__container: W,
|
|
116
116
|
select_multiple_input__measurement_layer: me,
|
|
117
|
-
select_multiple_input__close_btn:
|
|
117
|
+
select_multiple_input__close_btn: he,
|
|
118
118
|
"select_multiple_input__close_btn--disabled": "_select_multiple_input__close_btn--disabled_8pd2n_21",
|
|
119
|
-
select_multiple_input__tag_content:
|
|
120
|
-
},
|
|
121
|
-
let { value: n, labelRender: r, tagStyle: i } = t, { setValue: a } = L(), { fieldNames: o, disabled: s } = R(), c = B(o), l = n?.length ?? 0, [u, d] =
|
|
119
|
+
select_multiple_input__tag_content: G
|
|
120
|
+
}, q = 4, J = T((t) => {
|
|
121
|
+
let { value: n, labelRender: r, tagStyle: i } = t, { setValue: a } = L(), { fieldNames: o, disabled: s } = R(), c = B(o), l = n?.length ?? 0, [u, d] = j(0), f = A(null), p = A(null);
|
|
122
122
|
ne(() => {
|
|
123
123
|
if (!f.current) return;
|
|
124
124
|
let e = new ResizeObserver((e) => {
|
|
@@ -131,7 +131,7 @@ var W = "_select_multiple_input__container_8pd2n_1", me = "_select_multiple_inpu
|
|
|
131
131
|
}
|
|
132
132
|
let a = p.current?.offsetWidth || 65, o = 0, s = 0;
|
|
133
133
|
for (let e = 0; e < i.length; e++) {
|
|
134
|
-
let t = i[e].clientWidth +
|
|
134
|
+
let t = i[e].clientWidth + q, n = e < l - 1 ? a : 0;
|
|
135
135
|
if (o + t + n <= r) o += t, s = e + 1;
|
|
136
136
|
else break;
|
|
137
137
|
}
|
|
@@ -144,21 +144,21 @@ var W = "_select_multiple_input__container_8pd2n_1", me = "_select_multiple_inpu
|
|
|
144
144
|
n.length
|
|
145
145
|
]);
|
|
146
146
|
let m = l - u, h = O(m), g = /* @__PURE__ */ b("div", {
|
|
147
|
-
className: `${
|
|
147
|
+
className: `${K.select_multiple_input__measurement_layer} measure-list`,
|
|
148
148
|
children: /* @__PURE__ */ x(U.Container, { children: [n?.map((t, n) => {
|
|
149
149
|
let a = (t) => /* @__PURE__ */ b("div", {
|
|
150
150
|
style: t,
|
|
151
|
-
className:
|
|
151
|
+
className: N(H["bsy-input-tag__item-icon"], "cursor-pointer"),
|
|
152
152
|
children: /* @__PURE__ */ b(e, {
|
|
153
153
|
name: "close",
|
|
154
154
|
style: { fontSize: 12 },
|
|
155
|
-
className:
|
|
155
|
+
className: K.select_multiple_input__close_btn
|
|
156
156
|
})
|
|
157
157
|
});
|
|
158
158
|
return /* @__PURE__ */ x(U, {
|
|
159
159
|
style: i,
|
|
160
160
|
children: [r && r(t, a), !r && /* @__PURE__ */ x("div", {
|
|
161
|
-
className:
|
|
161
|
+
className: K.select_multiple_input__tag_content,
|
|
162
162
|
children: [/* @__PURE__ */ b("span", { children: c.getLabel(t) }), /* @__PURE__ */ b(a, {})]
|
|
163
163
|
})]
|
|
164
164
|
}, n);
|
|
@@ -176,13 +176,13 @@ var W = "_select_multiple_input__container_8pd2n_1", me = "_select_multiple_inpu
|
|
|
176
176
|
};
|
|
177
177
|
return /* @__PURE__ */ x("div", {
|
|
178
178
|
ref: f,
|
|
179
|
-
className:
|
|
179
|
+
className: N("bsy-select-input-container__input-value", K.select_multiple_input__container, "multiple"),
|
|
180
180
|
children: [g, /* @__PURE__ */ x(U.Container, { children: [n?.slice(0, u).map((t, n) => {
|
|
181
181
|
let a = (n) => /* @__PURE__ */ b("div", {
|
|
182
182
|
style: n,
|
|
183
|
-
className:
|
|
184
|
-
[
|
|
185
|
-
[
|
|
183
|
+
className: N(H["bsy-input-tag__item-icon"], {
|
|
184
|
+
[K.select_multiple_input__close_btn]: !s,
|
|
185
|
+
[K.select_multiple_input__close_btn + "--disabled"]: s
|
|
186
186
|
}),
|
|
187
187
|
onClick: (e) => {
|
|
188
188
|
e.stopPropagation(), _(t);
|
|
@@ -199,7 +199,7 @@ var W = "_select_multiple_input__container_8pd2n_1", me = "_select_multiple_inpu
|
|
|
199
199
|
},
|
|
200
200
|
disabled: s,
|
|
201
201
|
children: [r && r(t, a), !r && /* @__PURE__ */ x("div", {
|
|
202
|
-
className:
|
|
202
|
+
className: K.select_multiple_input__tag_content,
|
|
203
203
|
children: [/* @__PURE__ */ b("span", {
|
|
204
204
|
className: "truncate",
|
|
205
205
|
children: c.getLabel(t)
|
|
@@ -215,10 +215,10 @@ var W = "_select_multiple_input__container_8pd2n_1", me = "_select_multiple_inpu
|
|
|
215
215
|
})] })]
|
|
216
216
|
});
|
|
217
217
|
});
|
|
218
|
-
|
|
218
|
+
J.displayName = "BsySelectMultipleInput";
|
|
219
219
|
//#endregion
|
|
220
220
|
//#region src/components/Select/utils/tree.ts
|
|
221
|
-
var
|
|
221
|
+
var Y = (e, t) => {
|
|
222
222
|
let n = [], r = (e) => {
|
|
223
223
|
e.forEach((e) => {
|
|
224
224
|
let { [t.children]: i, ...a } = e;
|
|
@@ -226,12 +226,12 @@ var he = (e, t) => {
|
|
|
226
226
|
});
|
|
227
227
|
};
|
|
228
228
|
return r(e), n;
|
|
229
|
-
}, ge = ({ placeholder: t, mode: n, clearable: r, onClear:
|
|
230
|
-
let g = A(null), v =
|
|
229
|
+
}, ge = ({ placeholder: t, mode: n, clearable: r, onClear: a, disabled: o = !1, labelRender: s, options: c = [], type: l, prefix: u, suffixIcon: d, ghost: f, inputValueStyle: p, tagStyle: m }) => {
|
|
230
|
+
let g = A(null), v = ie(o ? null : g), { isOpen: S, value: C, getCachedOptionByValue: w } = L(), { fieldNames: T } = R(), E = k(() => {
|
|
231
231
|
if (_(C)) return [];
|
|
232
232
|
let e = h(C) ? C : [C];
|
|
233
233
|
if (l === I.TREE) {
|
|
234
|
-
let t = B(T), n =
|
|
234
|
+
let t = B(T), n = Y(c, T);
|
|
235
235
|
return e.map((e) => n.find((n) => t.getValue(n) === e) || w?.(e)).filter((e) => !!e);
|
|
236
236
|
}
|
|
237
237
|
return e.map((e) => c.find((t) => t[T.value] === e) || w?.(e)).filter((e) => !!e);
|
|
@@ -243,7 +243,7 @@ var he = (e, t) => {
|
|
|
243
243
|
w
|
|
244
244
|
]);
|
|
245
245
|
return /* @__PURE__ */ b("div", {
|
|
246
|
-
className:
|
|
246
|
+
className: N("bsy-select-input-container", {
|
|
247
247
|
disabled: o,
|
|
248
248
|
multiple: n === F.MULTIPLE,
|
|
249
249
|
active: S,
|
|
@@ -251,7 +251,7 @@ var he = (e, t) => {
|
|
|
251
251
|
}),
|
|
252
252
|
ref: g,
|
|
253
253
|
children: /* @__PURE__ */ x("div", {
|
|
254
|
-
className:
|
|
254
|
+
className: N("bsy-select-input-container-input"),
|
|
255
255
|
children: [
|
|
256
256
|
u && /* @__PURE__ */ b("div", {
|
|
257
257
|
className: "bsy-select-input-container-input-prefix",
|
|
@@ -261,7 +261,7 @@ var he = (e, t) => {
|
|
|
261
261
|
value: E,
|
|
262
262
|
labelRender: s,
|
|
263
263
|
inputValueStyle: p
|
|
264
|
-
}), n === F.MULTIPLE && /* @__PURE__ */ b(
|
|
264
|
+
}), n === F.MULTIPLE && /* @__PURE__ */ b(J, {
|
|
265
265
|
value: E,
|
|
266
266
|
labelRender: s,
|
|
267
267
|
tagStyle: m
|
|
@@ -270,27 +270,27 @@ var he = (e, t) => {
|
|
|
270
270
|
children: t
|
|
271
271
|
}),
|
|
272
272
|
/* @__PURE__ */ b("div", {
|
|
273
|
-
className:
|
|
274
|
-
children: /* @__PURE__ */ b(
|
|
273
|
+
className: N("bsy-select-input-container__icon"),
|
|
274
|
+
children: /* @__PURE__ */ b(oe, {
|
|
275
275
|
mode: "wait",
|
|
276
|
-
children: E?.length && r && v ? /* @__PURE__ */ b(
|
|
276
|
+
children: E?.length && r && v ? /* @__PURE__ */ b(se.div, {
|
|
277
277
|
className: "bsy-select-input-container__icon-motion",
|
|
278
|
-
...
|
|
278
|
+
...i,
|
|
279
279
|
children: /* @__PURE__ */ b(e, {
|
|
280
280
|
name: "cancel",
|
|
281
281
|
className: "icon hover:text-[#0265ff] text-[#666]",
|
|
282
282
|
role: "button",
|
|
283
283
|
"aria-label": "clear",
|
|
284
284
|
onClick: (e) => {
|
|
285
|
-
e.stopPropagation(),
|
|
285
|
+
e.stopPropagation(), a?.();
|
|
286
286
|
}
|
|
287
287
|
})
|
|
288
|
-
}, "cancel") : /* @__PURE__ */ b(
|
|
288
|
+
}, "cancel") : /* @__PURE__ */ b(se.div, {
|
|
289
289
|
className: "bsy-select-input-container__icon-motion",
|
|
290
|
-
...
|
|
290
|
+
...i,
|
|
291
291
|
children: d ? d(S, o) : /* @__PURE__ */ b(e, {
|
|
292
292
|
name: "arrow-down",
|
|
293
|
-
className:
|
|
293
|
+
className: N("icon", {
|
|
294
294
|
active: S,
|
|
295
295
|
"text-[#c2c2c2]": o,
|
|
296
296
|
"text-[#666]": !o
|
|
@@ -316,7 +316,7 @@ var X = T((e) => {
|
|
|
316
316
|
role: "option",
|
|
317
317
|
"aria-selected": w,
|
|
318
318
|
"aria-disabled": S,
|
|
319
|
-
className:
|
|
319
|
+
className: N("rounded-[4px] py-[7px] px-[10px] min-h-[34px]", {
|
|
320
320
|
"cursor-pointer": !S,
|
|
321
321
|
"cursor-not-allowed text-[#999] bg-transparent": S,
|
|
322
322
|
"hover:bg-[#eff0f6]": !S && !w,
|
|
@@ -338,7 +338,7 @@ var X = T((e) => {
|
|
|
338
338
|
className: "ml-2 flex-1",
|
|
339
339
|
onClick: (e) => e.stopPropagation(),
|
|
340
340
|
style: { minWidth: "146px" },
|
|
341
|
-
children: /* @__PURE__ */ b(
|
|
341
|
+
children: /* @__PURE__ */ b(M, {
|
|
342
342
|
ref: g,
|
|
343
343
|
value: f,
|
|
344
344
|
disabled: S,
|
|
@@ -370,7 +370,7 @@ var Z = (e) => {
|
|
|
370
370
|
children: /* @__PURE__ */ x("ul", {
|
|
371
371
|
className: "bsy-multiple-select-list",
|
|
372
372
|
children: [/* @__PURE__ */ b("li", {
|
|
373
|
-
className:
|
|
373
|
+
className: N("flex items-center gap-[8px]", "cursor-pointer hover:bg-[#eff0f6] rounded-[4px] min-h-[34px]", "bsy-multiple-select-item"),
|
|
374
374
|
children: /* @__PURE__ */ b(u, {
|
|
375
375
|
checked: g,
|
|
376
376
|
disabled: m.length === 0,
|
|
@@ -394,7 +394,7 @@ var Z = (e) => {
|
|
|
394
394
|
let n = d.getValue(e), r = d.getLabel(e), a = f.includes(n), o = e.systemField || !1, s = e.disabled === !0;
|
|
395
395
|
return /* @__PURE__ */ b("li", {
|
|
396
396
|
"aria-disabled": s,
|
|
397
|
-
className:
|
|
397
|
+
className: N("flex items-center gap-[8px] min-h-[34px]", "rounded-[4px]", "bsy-multiple-select-item", {
|
|
398
398
|
"cursor-pointer": !s,
|
|
399
399
|
"cursor-not-allowed text-[#999] bg-transparent": s,
|
|
400
400
|
"hover:bg-[#eff0f6]": !s,
|
|
@@ -418,7 +418,7 @@ var Z = (e) => {
|
|
|
418
418
|
Z.displayName = "BsyMultipleSelect";
|
|
419
419
|
//#endregion
|
|
420
420
|
//#region src/components/Select/OptionList/TreeOptionList/TreeOptionList.tsx
|
|
421
|
-
var
|
|
421
|
+
var Q = (e) => {
|
|
422
422
|
let { options: t, searchValue: n, value: r, onSelect: i, fieldNames: a } = e;
|
|
423
423
|
return /* @__PURE__ */ b("div", {
|
|
424
424
|
className: "bsy-tree-select",
|
|
@@ -437,13 +437,13 @@ var _e = (e) => {
|
|
|
437
437
|
})
|
|
438
438
|
})
|
|
439
439
|
});
|
|
440
|
-
},
|
|
440
|
+
}, _e = (e, t) => {
|
|
441
441
|
let n = [], r = (e) => {
|
|
442
442
|
if (e) for (let i of e) n.push(i), r(i[t.children]);
|
|
443
443
|
};
|
|
444
444
|
return r(e), n;
|
|
445
|
-
},
|
|
446
|
-
let i = r[n.children] ?
|
|
445
|
+
}, $ = (e, t, n) => e.reduce((e, r) => {
|
|
446
|
+
let i = r[n.children] ? $(r[n.children], t, n) : void 0;
|
|
447
447
|
if (t.has(r[n.value]) || i && i.length > 0) {
|
|
448
448
|
let a = t.has(r[n.value]) ? r[n.children] : i;
|
|
449
449
|
e.push({
|
|
@@ -452,8 +452,8 @@ var _e = (e) => {
|
|
|
452
452
|
});
|
|
453
453
|
}
|
|
454
454
|
return e;
|
|
455
|
-
}, []),
|
|
456
|
-
let { options: t = [], searchValue: n = "", type: i, filterOption: a, optionRender: o, optionStyle: s, notFoundContent: c } = e, { t: l } = r(), { value: u, setIsOpen: f, setValue: p } = L(), { fieldNames: m } = R(), h = k(() => i === I.TREE ?
|
|
455
|
+
}, []), ve = (e) => {
|
|
456
|
+
let { options: t = [], searchValue: n = "", type: i, filterOption: a, optionRender: o, optionStyle: s, notFoundContent: c } = e, { t: l } = r(), { value: u, setIsOpen: f, setValue: p } = L(), { fieldNames: m } = R(), h = k(() => i === I.TREE ? _e(t, m) : t, [
|
|
457
457
|
t,
|
|
458
458
|
m,
|
|
459
459
|
i
|
|
@@ -470,7 +470,7 @@ var _e = (e) => {
|
|
|
470
470
|
}, [f, p]), C = () => {
|
|
471
471
|
if (!a || g(n)) return t;
|
|
472
472
|
let e = _.search(n), r = new Set(e.map((e) => e.item[m.value]));
|
|
473
|
-
return i === I.TREE ?
|
|
473
|
+
return i === I.TREE ? $(t, r, m) : t.filter((e) => r.has(e[m.value]));
|
|
474
474
|
};
|
|
475
475
|
return /* @__PURE__ */ b(y, { children: (() => {
|
|
476
476
|
let e = {
|
|
@@ -494,7 +494,7 @@ var _e = (e) => {
|
|
|
494
494
|
onSelect: x,
|
|
495
495
|
optionRender: o
|
|
496
496
|
});
|
|
497
|
-
case I.TREE: return /* @__PURE__ */ b(
|
|
497
|
+
case I.TREE: return /* @__PURE__ */ b(Q, {
|
|
498
498
|
...e,
|
|
499
499
|
value: u,
|
|
500
500
|
fieldNames: m,
|
|
@@ -503,10 +503,10 @@ var _e = (e) => {
|
|
|
503
503
|
default: return null;
|
|
504
504
|
}
|
|
505
505
|
})() });
|
|
506
|
-
},
|
|
506
|
+
}, ye = (e) => {
|
|
507
507
|
let { options: t = [], type: n = I.SINGLE, filterOption: i = !0, onSearch: a, showSearch: o, searchPlaceholder: c, onPopupScroll: l, notFoundContent: u } = e, { t: p } = r(), { searchValue: m = "", setSearchValue: h } = L(), g = O(m), _ = (e) => {
|
|
508
508
|
h?.(e), a?.(e);
|
|
509
|
-
}, v = () => e.fetching ? /* @__PURE__ */ b(d, { text: p("dataSearching") }) : t.length === 0 && !m ? u === void 0 ? /* @__PURE__ */ b(d, { text: p("noData") }) : u : /* @__PURE__ */ b(
|
|
509
|
+
}, v = () => e.fetching ? /* @__PURE__ */ b(d, { text: p("dataSearching") }) : t.length === 0 && !m ? u === void 0 ? /* @__PURE__ */ b(d, { text: p("noData") }) : u : /* @__PURE__ */ b(ve, {
|
|
510
510
|
searchValue: g,
|
|
511
511
|
options: t,
|
|
512
512
|
type: n,
|
|
@@ -524,7 +524,7 @@ var _e = (e) => {
|
|
|
524
524
|
onChange: _,
|
|
525
525
|
searchPlaceholder: c
|
|
526
526
|
}), /* @__PURE__ */ b("div", {
|
|
527
|
-
className:
|
|
527
|
+
className: N({ "pt-[4px]": o }),
|
|
528
528
|
children: /* @__PURE__ */ b(f, {
|
|
529
529
|
style: { maxHeight: 300 },
|
|
530
530
|
onScroll: y,
|
|
@@ -533,53 +533,53 @@ var _e = (e) => {
|
|
|
533
533
|
})] })
|
|
534
534
|
});
|
|
535
535
|
};
|
|
536
|
-
|
|
536
|
+
ye.displayName = "BsySelectPanel";
|
|
537
537
|
//#endregion
|
|
538
538
|
//#region src/components/Select/Select.tsx
|
|
539
|
-
var
|
|
540
|
-
let { options: s = [], type: c = I.SINGLE, fieldNames: l, clearable: u = !0, disabled: d = !1, placeholder: f, labelRender: m, onOtherInputChange: h, onOpenChange: g, onPopupScroll: _, prefix: v, suffixIcon: y, ghost: S, inputValueStyle: C, tagStyle: w, zIndex: T, zIndexMask: D, otherInputPosition: O = "bottom",
|
|
541
|
-
defaultValue:
|
|
539
|
+
var be = w((e, i) => {
|
|
540
|
+
let { options: s = [], type: c = I.SINGLE, fieldNames: l, clearable: u = !0, disabled: d = !1, placeholder: f, labelRender: m, onOtherInputChange: h, onOpenChange: g, onPopupScroll: _, prefix: v, suffixIcon: y, ghost: S, inputValueStyle: C, tagStyle: w, zIndex: T, zIndexMask: D, otherInputPosition: O = "bottom", getPopupContainer: ne } = e, M = Number.parseFloat(e.popupMinWidth ?? ""), ie = e.popupMatchSelectWidth ?? (Number.isFinite(M) ? M : !0), P = le[c], L = t(T), R = D ?? L - 1, { t: z } = r(), B = ee(), { onChange: V } = e, H = l || ue, [U, W] = re(e, {
|
|
541
|
+
defaultValue: P === F.SINGLE ? void 0 : [],
|
|
542
542
|
defaultValuePropName: "defaultValue",
|
|
543
543
|
valuePropName: "value",
|
|
544
544
|
trigger: "__NO_CUSTOM_CHANGE__"
|
|
545
|
-
}), [
|
|
546
|
-
if (
|
|
547
|
-
let e = s.every((e) => e[
|
|
548
|
-
return e && t ?
|
|
545
|
+
}), [me, he] = j(""), G = A(/* @__PURE__ */ new Map()), [K, q] = j(() => {
|
|
546
|
+
if (P === F.SINGLE) {
|
|
547
|
+
let e = s.every((e) => e[H.value] !== U), t = s.find((e) => e.isOther === !0);
|
|
548
|
+
return e && t ? U : void 0;
|
|
549
549
|
}
|
|
550
550
|
}), J = E((e, t) => {
|
|
551
|
-
if (
|
|
551
|
+
if (W(e), t) {
|
|
552
552
|
let n = /* @__PURE__ */ new Map();
|
|
553
553
|
if (Array.isArray(e)) {
|
|
554
554
|
let r = Array.isArray(t) ? t : [];
|
|
555
555
|
e.forEach((e) => {
|
|
556
|
-
let t = r.find((t) => t?.[
|
|
556
|
+
let t = r.find((t) => t?.[H.value] === e);
|
|
557
557
|
e !== null && t && n.set(e, t);
|
|
558
558
|
});
|
|
559
559
|
} else e !== null && !Array.isArray(t) && n.set(e, t);
|
|
560
560
|
G.current = n;
|
|
561
561
|
}
|
|
562
|
-
|
|
562
|
+
V && V(e, t);
|
|
563
563
|
}, [
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
]), [Y, { set:
|
|
568
|
-
e !== Y && (
|
|
564
|
+
V,
|
|
565
|
+
W,
|
|
566
|
+
H
|
|
567
|
+
]), [Y, { set: X }] = ae(!1), Z = E((e) => {
|
|
568
|
+
e !== Y && (X(e), g?.(e));
|
|
569
569
|
}, [
|
|
570
|
-
|
|
570
|
+
X,
|
|
571
571
|
g,
|
|
572
572
|
Y
|
|
573
|
-
]), { isSelectedOtherOption:
|
|
574
|
-
if (
|
|
573
|
+
]), { isSelectedOtherOption: Q, shouldShowOtherInput: _e } = k(() => {
|
|
574
|
+
if (P === F.MULTIPLE) return {
|
|
575
575
|
isSelectedOtherOption: !1,
|
|
576
576
|
shouldShowOtherInput: !1
|
|
577
577
|
};
|
|
578
|
-
let e = s.find((e) => e[
|
|
578
|
+
let e = s.find((e) => e[H.value] === U);
|
|
579
579
|
return e ? {
|
|
580
580
|
isSelectedOtherOption: e.isOther === !0,
|
|
581
581
|
shouldShowOtherInput: e.isOther === !0
|
|
582
|
-
} : s.find((e) => e.isOther === !0) &&
|
|
582
|
+
} : s.find((e) => e.isOther === !0) && U ? {
|
|
583
583
|
isSelectedOtherOption: !0,
|
|
584
584
|
shouldShowOtherInput: !0
|
|
585
585
|
} : {
|
|
@@ -587,38 +587,38 @@ var $ = w((e, a) => {
|
|
|
587
587
|
shouldShowOtherInput: !1
|
|
588
588
|
};
|
|
589
589
|
}, [
|
|
590
|
-
|
|
590
|
+
U,
|
|
591
591
|
s,
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
]),
|
|
595
|
-
if (
|
|
596
|
-
if (
|
|
597
|
-
let e = s.every((e) => e[
|
|
598
|
-
if (e && t) return t[
|
|
592
|
+
H,
|
|
593
|
+
P
|
|
594
|
+
]), $ = E(() => {
|
|
595
|
+
if (U) {
|
|
596
|
+
if (P === F.SINGLE) {
|
|
597
|
+
let e = s.every((e) => e[H.value] !== U), t = s.find((e) => e.isOther === !0);
|
|
598
|
+
if (e && t) return t[H.value];
|
|
599
599
|
}
|
|
600
|
-
return
|
|
601
|
-
} else return
|
|
600
|
+
return U;
|
|
601
|
+
} else return U;
|
|
602
602
|
}, [
|
|
603
|
-
|
|
603
|
+
U,
|
|
604
604
|
s,
|
|
605
|
-
|
|
606
|
-
|
|
605
|
+
H,
|
|
606
|
+
P
|
|
607
607
|
]), ve = k(() => ({
|
|
608
|
-
value:
|
|
608
|
+
value: $(),
|
|
609
609
|
setValue: J,
|
|
610
610
|
isOpen: Y,
|
|
611
|
-
setIsOpen:
|
|
611
|
+
setIsOpen: Z,
|
|
612
612
|
getCachedOptionByValue: (e) => G.current.get(e),
|
|
613
|
-
searchValue:
|
|
614
|
-
setSearchValue:
|
|
613
|
+
searchValue: me,
|
|
614
|
+
setSearchValue: he
|
|
615
615
|
}), [
|
|
616
|
-
|
|
616
|
+
$,
|
|
617
617
|
J,
|
|
618
618
|
Y,
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
]),
|
|
619
|
+
Z,
|
|
620
|
+
me
|
|
621
|
+
]), be = k(() => ({
|
|
622
622
|
fieldNames: l || ue,
|
|
623
623
|
disabled: d,
|
|
624
624
|
otherInputPosition: O
|
|
@@ -626,39 +626,39 @@ var $ = w((e, a) => {
|
|
|
626
626
|
l,
|
|
627
627
|
d,
|
|
628
628
|
O
|
|
629
|
-
]),
|
|
630
|
-
isSelectedOtherOption:
|
|
629
|
+
]), xe = k(() => ({
|
|
630
|
+
isSelectedOtherOption: Q,
|
|
631
631
|
otherOptionValue: K,
|
|
632
632
|
setOtherOptionValue: q,
|
|
633
633
|
onOtherInputChange: h
|
|
634
634
|
}), [
|
|
635
|
-
|
|
635
|
+
Q,
|
|
636
636
|
K,
|
|
637
637
|
q,
|
|
638
638
|
h
|
|
639
|
-
]), { refs:
|
|
639
|
+
]), { refs: Se, floatingStyles: Ce, getReferenceProps: we, getFloatingProps: Te, referenceStyle: Ee } = p({
|
|
640
640
|
isOpen: Y,
|
|
641
641
|
close: () => {
|
|
642
|
-
|
|
642
|
+
Z(!1);
|
|
643
643
|
},
|
|
644
644
|
showMask: e.showMask,
|
|
645
|
-
zIndex:
|
|
646
|
-
zIndexMask:
|
|
647
|
-
|
|
645
|
+
zIndex: L,
|
|
646
|
+
zIndexMask: R,
|
|
647
|
+
popupMatchSelectWidth: ie,
|
|
648
648
|
offset: {
|
|
649
649
|
x: 0,
|
|
650
650
|
y: 4
|
|
651
651
|
}
|
|
652
|
-
}), { portalRoot:
|
|
653
|
-
|
|
652
|
+
}), { portalRoot: De, portalMountKey: Oe, handleExitComplete: ke } = o(Y, ne), Ae = E(() => {
|
|
653
|
+
Q && (q(""), h?.("")), Z(!1), G.current.clear(), J(P === F.SINGLE ? void 0 : []);
|
|
654
654
|
}, [
|
|
655
|
-
|
|
655
|
+
Q,
|
|
656
656
|
h,
|
|
657
657
|
J,
|
|
658
|
-
|
|
659
|
-
|
|
658
|
+
P,
|
|
659
|
+
Z
|
|
660
660
|
]);
|
|
661
|
-
return te(
|
|
661
|
+
return te(i, () => ({
|
|
662
662
|
getOtherOptionValue: () => K,
|
|
663
663
|
setOtherOptionValue: (e) => {
|
|
664
664
|
q(e), h?.(e);
|
|
@@ -666,31 +666,31 @@ var $ = w((e, a) => {
|
|
|
666
666
|
}), [K, h]), /* @__PURE__ */ b(de.Provider, {
|
|
667
667
|
value: ve,
|
|
668
668
|
children: /* @__PURE__ */ b(fe.Provider, {
|
|
669
|
-
value:
|
|
669
|
+
value: be,
|
|
670
670
|
children: /* @__PURE__ */ b(pe.Provider, {
|
|
671
|
-
value:
|
|
671
|
+
value: xe,
|
|
672
672
|
children: /* @__PURE__ */ x("div", {
|
|
673
|
-
className:
|
|
673
|
+
className: N("bsy-select-container text-sm", e.className),
|
|
674
674
|
style: e.style,
|
|
675
675
|
children: [
|
|
676
676
|
/* @__PURE__ */ b("div", {
|
|
677
|
-
ref:
|
|
678
|
-
className:
|
|
679
|
-
...
|
|
680
|
-
style:
|
|
677
|
+
ref: Se.setReference,
|
|
678
|
+
className: N("bsy-select-input-event", e.inputClassName),
|
|
679
|
+
...we(),
|
|
680
|
+
style: Ee,
|
|
681
681
|
onClick: () => {
|
|
682
|
-
e.disabled ||
|
|
682
|
+
e.disabled || Z(!Y);
|
|
683
683
|
},
|
|
684
684
|
role: "combobox",
|
|
685
685
|
"aria-expanded": Y,
|
|
686
686
|
"aria-haspopup": "listbox",
|
|
687
|
-
"aria-controls":
|
|
687
|
+
"aria-controls": B,
|
|
688
688
|
"aria-disabled": d,
|
|
689
689
|
children: /* @__PURE__ */ b(ge, {
|
|
690
|
-
mode:
|
|
690
|
+
mode: P,
|
|
691
691
|
clearable: u,
|
|
692
692
|
disabled: d,
|
|
693
|
-
placeholder: f ||
|
|
693
|
+
placeholder: f || z("select"),
|
|
694
694
|
labelRender: m,
|
|
695
695
|
options: s,
|
|
696
696
|
type: c,
|
|
@@ -699,28 +699,28 @@ var $ = w((e, a) => {
|
|
|
699
699
|
ghost: S,
|
|
700
700
|
inputValueStyle: C,
|
|
701
701
|
tagStyle: w,
|
|
702
|
-
onClear:
|
|
702
|
+
onClear: Ae
|
|
703
703
|
})
|
|
704
704
|
}),
|
|
705
705
|
/* @__PURE__ */ x(ce, {
|
|
706
|
-
root:
|
|
706
|
+
root: De,
|
|
707
707
|
children: [Y && e.showMask ? /* @__PURE__ */ b("div", {
|
|
708
708
|
className: "bsy-select-mask",
|
|
709
|
-
style: { zIndex:
|
|
709
|
+
style: { zIndex: R }
|
|
710
710
|
}) : null, /* @__PURE__ */ b(n, {
|
|
711
|
-
zIndex:
|
|
712
|
-
children: /* @__PURE__ */ b(
|
|
713
|
-
onExitComplete:
|
|
714
|
-
children: Y ? /* @__PURE__ */ b(
|
|
715
|
-
ref:
|
|
711
|
+
zIndex: L,
|
|
712
|
+
children: /* @__PURE__ */ b(oe, {
|
|
713
|
+
onExitComplete: ke,
|
|
714
|
+
children: Y ? /* @__PURE__ */ b(se.div, {
|
|
715
|
+
ref: Se.setFloating,
|
|
716
716
|
style: {
|
|
717
|
-
...
|
|
718
|
-
zIndex:
|
|
717
|
+
...Ce,
|
|
718
|
+
zIndex: L
|
|
719
719
|
},
|
|
720
|
-
...
|
|
721
|
-
id:
|
|
722
|
-
...
|
|
723
|
-
children: /* @__PURE__ */ b(
|
|
720
|
+
...Te(),
|
|
721
|
+
id: B,
|
|
722
|
+
...a,
|
|
723
|
+
children: /* @__PURE__ */ b(ye, {
|
|
724
724
|
...e,
|
|
725
725
|
options: s,
|
|
726
726
|
onPopupScroll: _
|
|
@@ -728,17 +728,17 @@ var $ = w((e, a) => {
|
|
|
728
728
|
}, "bsy-select-panel") : null
|
|
729
729
|
})
|
|
730
730
|
})]
|
|
731
|
-
},
|
|
731
|
+
}, Oe),
|
|
732
732
|
_e && O === "bottom" ? e.otherOptionRender ? e.otherOptionRender(K, s) : /* @__PURE__ */ b("div", {
|
|
733
|
-
className:
|
|
733
|
+
className: N("mt-[6px] w-full px-[10px] py-[7px] bg-white rounded-[4px]", "border border-[#e0e0e0]"),
|
|
734
734
|
children: /* @__PURE__ */ b("input", {
|
|
735
735
|
value: K || "",
|
|
736
736
|
onChange: (e) => {
|
|
737
737
|
q(e.target.value), h?.(e.target.value);
|
|
738
738
|
},
|
|
739
739
|
className: "w-full outline-none border-none placeholder:text-[#999]",
|
|
740
|
-
placeholder:
|
|
741
|
-
"aria-label":
|
|
740
|
+
placeholder: z("context"),
|
|
741
|
+
"aria-label": z("otherOptionInput"),
|
|
742
742
|
role: "textbox"
|
|
743
743
|
})
|
|
744
744
|
}) : null
|
|
@@ -748,6 +748,6 @@ var $ = w((e, a) => {
|
|
|
748
748
|
})
|
|
749
749
|
});
|
|
750
750
|
});
|
|
751
|
-
|
|
751
|
+
be.displayName = "BsySelect";
|
|
752
752
|
//#endregion
|
|
753
|
-
export { F as n, I as r,
|
|
753
|
+
export { F as n, I as r, be as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "../Icon/Icon-DDHx0R18.js";
|
|
2
|
-
import { t } from "../vendors/useLocale-
|
|
2
|
+
import { t } from "../vendors/useLocale-D31qCCff.js";
|
|
3
3
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/Select/SelectInputSearch/SelectInputSearch.tsx
|
|
5
5
|
var i = (i) => {
|