@baishuyun/ui-base 6.6.0 → 6.6.1

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.
Files changed (94) hide show
  1. package/dist/Calendar/{AllDaySection-M-b9tRHh.js → AllDaySection-DOMayJvh.js} +3 -3
  2. package/dist/Calendar/{Calendar-C9PhASp0.js → Calendar-DSqL58yh.js} +11 -11
  3. package/dist/Calendar/{CurrentTimeIndicator-Dpi36eVJ.js → CurrentTimeIndicator-CgDrVXin.js} +1 -1
  4. package/dist/Calendar/{EventCard-BIfRqCk5.js → EventCard-BGDwQ-c7.js} +3 -3
  5. package/dist/Calendar/{TimeGrid-Dk3soSo4.js → TimeGrid-KeZ4RsDq.js} +1 -1
  6. package/dist/Calendar/context/index.js +1 -1
  7. package/dist/Calendar/index.js +16 -15
  8. package/dist/Calendar/subcomponents/AllDaySection/index.js +6 -6
  9. package/dist/Calendar/subcomponents/CurrentTimeIndicator/index.js +4 -4
  10. package/dist/Calendar/subcomponents/EventCard/index.js +5 -5
  11. package/dist/Calendar/subcomponents/TimeAxis/index.js +3 -3
  12. package/dist/Calendar/subcomponents/TimeGrid/index.js +2 -2
  13. package/dist/Calendar/{theme-Cgn0zQoC.js → theme-qcYESlpU.js} +2 -2
  14. package/dist/Calendar/utils/index.js +3 -3
  15. package/dist/Calendar/utils/layout/index.js +2 -2
  16. package/dist/Calendar/utils/theme/index.js +1 -1
  17. package/dist/CheckBox/{CheckBox-81R8QKHb.js → CheckBox-GtT43IQ8.js} +1 -1
  18. package/dist/CheckBox/index.js +2 -2
  19. package/dist/ColorPicker/{ColorPicker-aj57lMA5.js → ColorPicker-Hjs4Vp5a.js} +37 -35
  20. package/dist/ColorPicker/index.js +2 -1
  21. package/dist/DatePicker/DatePicker-DnH3zblC.js +96 -0
  22. package/dist/DatePicker/{DatePickerPanel-BjnLfncu.js → DatePickerPanel-CQGrY4wT.js} +2 -2
  23. package/dist/DatePicker/index.js +5 -4
  24. package/dist/DatePicker/style/index.js +1 -1
  25. package/dist/DatePicker/{style-BxWyBhZ3.js → style-BlAisgTN.js} +1 -1
  26. package/dist/DropDown/DropDown-D_Zh6fGX.js +171 -0
  27. package/dist/DropDown/index.js +6 -5
  28. package/dist/DropDown/style/index.js +1 -1
  29. package/dist/DropDown/{style-4LK6rNHe.js → style-WiojFVQn.js} +1 -1
  30. package/dist/Editor/{Buttons-Ds6bLmnl.js → Buttons-De6NyZQs.js} +3 -3
  31. package/dist/Editor/ToolbarPlugin/Buttons/index.js +10 -9
  32. package/dist/Editor/index.js +10 -9
  33. package/dist/Gantt/GanttChart/index.js +13 -12
  34. package/dist/Gantt/{GanttChart-DbI1fvxe.js → GanttChart-MwVs4NFd.js} +7 -7
  35. package/dist/Gantt/GanttTable/index.js +7 -7
  36. package/dist/Gantt/{GanttTable-C3PLGmKr.js → GanttTable-DoDMELyN.js} +5 -5
  37. package/dist/Gantt/GanttToolBar/index.js +9 -8
  38. package/dist/Gantt/{GanttToolBar-8jPQ9BAG.js → GanttToolBar-BAAQMT0x.js} +2 -2
  39. package/dist/Gantt/{collapseKeys-1N9ci2oJ.js → collapseKeys-VeqoqKwC.js} +2 -2
  40. package/dist/Gantt/index.js +20 -19
  41. package/dist/Gantt/{theme-C197Dtjy.js → theme-DLS8mdri.js} +1 -1
  42. package/dist/Gantt/{timelineViewConfig-Dl3AXO45.js → timelineViewConfig-C1T1exJd.js} +1 -1
  43. package/dist/Gantt/utils/index.js +5 -5
  44. package/dist/Gantt/utils/theme/index.js +1 -1
  45. package/dist/InputTag/{InputTag-CGQ5dXyf.js → InputTag-C4iRY5Mw.js} +1 -1
  46. package/dist/InputTag/index.js +2 -2
  47. package/dist/Loading/index.js +1 -1
  48. package/dist/NotFoundContent/index.js +1 -1
  49. package/dist/Radio/index.js +1 -1
  50. package/dist/ScrollBar/{ScrollBar-CSGBOE3e.js → ScrollBar-C4-PtPBc.js} +1 -1
  51. package/dist/ScrollBar/index.js +1 -1
  52. package/dist/Segmented/{Segmented-CzVKrL6o.js → Segmented-Ck2ZmfF7.js} +13 -12
  53. package/dist/Segmented/index.js +1 -1
  54. package/dist/Select/Select-CuAdbvvQ.js +733 -0
  55. package/dist/Select/index.js +10 -9
  56. package/dist/Table/{Table-BtH9Oa14.js → Table-BZspRsYV.js} +4 -4
  57. package/dist/Table/hooks/index.js +1 -1
  58. package/dist/Table/{hooks-DK8Pf7iH.js → hooks-5ETrGbzY.js} +1 -1
  59. package/dist/Table/index.js +5 -5
  60. package/dist/Table/{processRowspan-D4uv6zLk.js → processRowspan-CSW5J9Rs.js} +1 -1
  61. package/dist/Table/style/index.js +1 -1
  62. package/dist/Table/{style-BwcnT2ee.js → style-qi0sTT0x.js} +1 -1
  63. package/dist/Table/utils/index.js +1 -1
  64. package/dist/Tabs/{Tabs-7wEcxUv6.js → Tabs-sag2ofoG.js} +1 -1
  65. package/dist/Tabs/index.js +2 -2
  66. package/dist/Tooltip/{Tooltip-B_SZOy6k.js → Tooltip-DWWWYn1a.js} +1 -1
  67. package/dist/Tooltip/index.js +1 -1
  68. package/dist/Tree/index.js +3 -3
  69. package/dist/index.js +33 -32
  70. package/dist/vendors/{Tree-DqnOGJtB.js → Tree-DMC_MSw1.js} +2 -2
  71. package/dist/vendors/{useFloatingPortal-B2SDNV5C.js → useFloatingPortal-CsNiNirJ.js} +1 -0
  72. package/dist/vendors/useLatchedPopupPortalRoot-hwf14FJ5.js +24 -0
  73. package/package.json +1 -1
  74. package/dist/DatePicker/DatePicker-EIFyC9zF.js +0 -115
  75. package/dist/DropDown/DropDown-B34vfoOs.js +0 -172
  76. package/dist/Select/Select-DTximYG6.js +0 -734
  77. /package/dist/Calendar/{TimeAxis-Chwxo6Yj.js → TimeAxis-f40447Et.js} +0 -0
  78. /package/dist/Calendar/{colorUtils-FNbm3zBQ.js → colorUtils-Be9RqvDV.js} +0 -0
  79. /package/dist/Calendar/{context-CzS6P3nk.js → context-BrzVkPeC.js} +0 -0
  80. /package/dist/Calendar/{layout-Cb39seCc.js → layout-rnPhDP7c.js} +0 -0
  81. /package/dist/CheckBox/{CheckBox-ejvbDr-a.js → CheckBox-D7bCjlkU.js} +0 -0
  82. /package/dist/DatePicker/{ensureDayjsPlugins-DxqbKqon.js → ensureDayjsPlugins-Bz70Nzmi.js} +0 -0
  83. /package/dist/DatePicker/{pickerLocale-CtDOOxxD.js → pickerLocale-g90uglxB.js} +0 -0
  84. /package/dist/Gantt/{GanttHighlightContext-CtT98ZnK.js → GanttHighlightContext-CMXYFPyz.js} +0 -0
  85. /package/dist/Gantt/{columnResize-DFe7F98O.js → columnResize-1nSds2g5.js} +0 -0
  86. /package/dist/Gantt/{constants-CrBb5i5p.js → constants-BSCH_s3S.js} +0 -0
  87. /package/dist/Gantt/{highlightTarget-DtCe7zto.js → highlightTarget-EEsL61Qd.js} +0 -0
  88. /package/dist/Loading/{Loading-ho-6d72M.js → Loading-CV5GuhWQ.js} +0 -0
  89. /package/dist/NotFoundContent/{NotFoundContent-CV9fTylQ.js → NotFoundContent-J-TEnljc.js} +0 -0
  90. /package/dist/Radio/{Radio-C2zJzZc3.js → Radio-CMAwZdP7.js} +0 -0
  91. /package/dist/Select/{SelectInputSearch-BDwg-Noi.js → SelectInputSearch-dfBUnTCY.js} +0 -0
  92. /package/dist/Table/{constants-CuBlYZLO.js → constants-BZfNf-UU.js} +0 -0
  93. /package/dist/vendors/{cssVars-DoQgQ2CM.js → cssVars-B8o94Yao.js} +0 -0
  94. /package/dist/vendors/{mergeRefs-TiJ0xjUN.js → mergeRefs-Bai1cIzv.js} +0 -0
@@ -0,0 +1,733 @@
1
+ import { t as e } from "../ScrollBar/ScrollBar-C4-PtPBc.js";
2
+ import { t } from "../Icon/Icon-SQ5tu-yG.js";
3
+ import { t as n } from "../vendors/useLocale-DZ8XW2VL.js";
4
+ import { n as r, t as i } from "../vendors/animations-Mlw78WYo.js";
5
+ import { t as a } from "../vendors/useLatchedPopupPortalRoot-hwf14FJ5.js";
6
+ import { t as o } from "./SelectInputSearch-dfBUnTCY.js";
7
+ import { n as s, t as c } from "../vendors/Tree-DMC_MSw1.js";
8
+ import { t as l } from "../CheckBox/CheckBox-GtT43IQ8.js";
9
+ import { t as u } from "../NotFoundContent/NotFoundContent-J-TEnljc.js";
10
+ import { t as d } from "../vendors/useFloatingPortal-CsNiNirJ.js";
11
+ import { first as f, isArray as p, isEmpty as m, isNil as h, noop as g } from "lodash-es";
12
+ import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
13
+ import { Suspense as b, createContext as x, forwardRef as S, memo as C, useCallback as w, useContext as T, useDeferredValue as E, useId as ee, useImperativeHandle as te, useLayoutEffect as ne, useMemo as D, useRef as O, useState as k } from "react";
14
+ import { Input as re } from "antd";
15
+ import A from "clsx";
16
+ import { useControllableValue as ie, useHover as j, useToggle as ae } from "ahooks";
17
+ import { AnimatePresence as oe, motion as M } from "motion/react";
18
+ import { FloatingPortal as se } from "@floating-ui/react";
19
+ import N from "fuse.js";
20
+ //#region src/components/Select/constants.ts
21
+ var P = /* @__PURE__ */ function(e) {
22
+ return e.SINGLE = "single", e.MULTIPLE = "multiple", e;
23
+ }({}), F = /* @__PURE__ */ function(e) {
24
+ return e[e.SINGLE = 0] = "SINGLE", e[e.MULTIPLE = 1] = "MULTIPLE", e[e.TREE = 2] = "TREE", e[e.TREE_TAGS = 3] = "TREE_TAGS", e[e.MEMBER = 4] = "MEMBER", e[e.DEPARTEMENT = 5] = "DEPARTEMENT", e;
25
+ }({}), ce = {
26
+ [F.SINGLE]: P.SINGLE,
27
+ [F.TREE]: P.SINGLE,
28
+ [F.MULTIPLE]: P.MULTIPLE,
29
+ [F.TREE_TAGS]: P.MULTIPLE,
30
+ [F.MEMBER]: P.MULTIPLE,
31
+ [F.DEPARTEMENT]: P.MULTIPLE
32
+ }, le = {
33
+ label: "label",
34
+ value: "value",
35
+ children: "children"
36
+ }, ue = x({
37
+ value: void 0,
38
+ setValue: g,
39
+ isOpen: !1,
40
+ setIsOpen: g
41
+ }), de = x({
42
+ fieldNames: {
43
+ label: "label",
44
+ value: "value",
45
+ children: "children"
46
+ },
47
+ disabled: !1
48
+ }), fe = x({}), I = () => {
49
+ let e = T(ue);
50
+ if (!e) throw Error("Select.* components must be used within a SelectStateContext provider");
51
+ return e;
52
+ }, L = () => {
53
+ let e = T(de);
54
+ if (!e) throw Error("Select.* components must be used within a SelectConfigContext provider");
55
+ return e;
56
+ }, R = () => T(fe);
57
+ //#endregion
58
+ //#region src/components/Select/utils/fieldAccessor.ts
59
+ function z(e) {
60
+ let t = e;
61
+ return {
62
+ getLabel: (e) => e[t.label],
63
+ getValue: (e) => e[t.value],
64
+ getChildren: (e) => {
65
+ if (t.children) return e[t.children];
66
+ },
67
+ normalizeOption: (e) => ({
68
+ ...e,
69
+ label: e[t.label],
70
+ value: e[t.value],
71
+ children: t.children ? e[t.children] : void 0
72
+ }),
73
+ getFieldNames: () => t
74
+ };
75
+ }
76
+ //#endregion
77
+ //#region src/components/Select/SelectInput/SelectSingleInput/SelectSingleInput.tsx
78
+ var B = C((e) => {
79
+ let { value: t, inputValueStyle: n } = e, { fieldNames: r, otherInputPosition: i } = L(), { isSelectedOtherOption: a, otherOptionValue: o } = R(), s = z(r), c = f(t), l;
80
+ return l = a && o && i === "inline" ? o : e.labelRender && c ? e.labelRender(c) : c ? s.getLabel(c) : "", /* @__PURE__ */ v("div", {
81
+ className: A("bsy-select-input-container__input-value overflow-hidden"),
82
+ style: n,
83
+ children: /* @__PURE__ */ v("div", {
84
+ className: "bsy-select-input-container__input-value-text",
85
+ children: l
86
+ })
87
+ });
88
+ });
89
+ B.displayName = "BsySelectSingleInput";
90
+ //#endregion
91
+ //#region src/components/Select/SelectInput/SelectMultipleInput/OptionTag/option-tag.module.scss
92
+ var V = {
93
+ "bsy-input-tag__container": "_bsy-input-tag__container_znvs6_1",
94
+ "bsy-input-tag__item": "_bsy-input-tag__item_znvs6_7",
95
+ "bsy-input-tag__item--disabled": "_bsy-input-tag__item--disabled_znvs6_20",
96
+ "bsy-input-tag__item-icon": "_bsy-input-tag__item-icon_znvs6_24"
97
+ }, H = S(({ children: e, style: t, disabled: n }, r) => /* @__PURE__ */ v("div", {
98
+ "data-bsy-input-tag": "true",
99
+ className: A({
100
+ [V["bsy-input-tag__item"]]: !0,
101
+ [V["bsy-input-tag__item--disabled"]]: n
102
+ }),
103
+ ref: r,
104
+ style: t,
105
+ children: e
106
+ }));
107
+ H.Container = (e) => /* @__PURE__ */ v("div", {
108
+ className: A(V["bsy-input-tag__container"]),
109
+ children: e.children
110
+ }), H.displayName = "BsyOptionTag";
111
+ //#endregion
112
+ //#region src/components/Select/SelectInput/SelectMultipleInput/select-multiple-input.module.scss
113
+ var U = "_select_multiple_input__container_8pd2n_1", W = "_select_multiple_input__measurement_layer_8pd2n_6", G = "_select_multiple_input__close_btn_8pd2n_14", K = "_select_multiple_input__tag_content_8pd2n_24", q = {
114
+ select_multiple_input__container: U,
115
+ select_multiple_input__measurement_layer: W,
116
+ select_multiple_input__close_btn: G,
117
+ "select_multiple_input__close_btn--disabled": "_select_multiple_input__close_btn--disabled_8pd2n_21",
118
+ select_multiple_input__tag_content: K
119
+ }, J = 4, Y = C((e) => {
120
+ let { value: n, labelRender: r, tagStyle: i } = e, { setValue: a } = I(), { fieldNames: o, disabled: s } = L(), c = z(o), l = n?.length ?? 0, [u, d] = k(0), f = O(null), p = O(null);
121
+ ne(() => {
122
+ if (!f.current) return;
123
+ let e = new ResizeObserver((e) => {
124
+ let t = e[0];
125
+ if (!t) return;
126
+ let r = t.contentRect.width, i = t.target.querySelectorAll(".measure-list [data-bsy-input-tag=\"true\"]");
127
+ if (i.length === 0) {
128
+ d(n?.length ?? 0);
129
+ return;
130
+ }
131
+ let a = p.current?.offsetWidth || 65, o = 0, s = 0;
132
+ for (let e = 0; e < i.length; e++) {
133
+ let t = i[e].clientWidth + J, n = e < l - 1 ? a : 0;
134
+ if (o + t + n <= r) o += t, s = e + 1;
135
+ else break;
136
+ }
137
+ s === 0 && l === 1 && (s = 1), u !== s && d(s);
138
+ });
139
+ return e.observe(f.current), () => e.disconnect();
140
+ }, [
141
+ l,
142
+ u,
143
+ n.length
144
+ ]);
145
+ let m = l - u, h = E(m), g = /* @__PURE__ */ v("div", {
146
+ className: `${q.select_multiple_input__measurement_layer} measure-list`,
147
+ children: /* @__PURE__ */ y(H.Container, { children: [n?.map((e, n) => {
148
+ let a = (e) => /* @__PURE__ */ v("div", {
149
+ style: e,
150
+ className: A(V["bsy-input-tag__item-icon"], "cursor-pointer"),
151
+ children: /* @__PURE__ */ v(t, {
152
+ name: "close",
153
+ style: { fontSize: 12 },
154
+ className: q.select_multiple_input__close_btn
155
+ })
156
+ });
157
+ return /* @__PURE__ */ y(H, {
158
+ style: i,
159
+ children: [r && r(e, a), !r && /* @__PURE__ */ y("div", {
160
+ className: q.select_multiple_input__tag_content,
161
+ children: [/* @__PURE__ */ v("span", { children: c.getLabel(e) }), /* @__PURE__ */ v(a, {})]
162
+ })]
163
+ }, n);
164
+ }), u < l && h > 0 && /* @__PURE__ */ y(H, {
165
+ ref: p,
166
+ children: [`+ ${m}`, /* @__PURE__ */ v("span", {
167
+ className: "text-[#666]",
168
+ children: "..."
169
+ })]
170
+ })] })
171
+ }), _ = (e) => {
172
+ if (s) return;
173
+ let t = n.filter((t) => c.getValue(t) !== c.getValue(e));
174
+ a(t.map((e) => c.getValue(e)), t);
175
+ };
176
+ return /* @__PURE__ */ y("div", {
177
+ ref: f,
178
+ className: A("bsy-select-input-container__input-value", q.select_multiple_input__container, "multiple"),
179
+ children: [g, /* @__PURE__ */ y(H.Container, { children: [n?.slice(0, u).map((e, n) => {
180
+ let a = (n) => /* @__PURE__ */ v("div", {
181
+ style: n,
182
+ className: A(V["bsy-input-tag__item-icon"], {
183
+ [q.select_multiple_input__close_btn]: !s,
184
+ [q.select_multiple_input__close_btn + "--disabled"]: s
185
+ }),
186
+ onClick: (t) => {
187
+ t.stopPropagation(), _(e);
188
+ },
189
+ children: /* @__PURE__ */ v(t, {
190
+ name: "close",
191
+ style: { fontSize: 12 }
192
+ })
193
+ });
194
+ return /* @__PURE__ */ y(H, {
195
+ style: {
196
+ ...i,
197
+ flexShrink: u === 1 ? 1 : 0
198
+ },
199
+ disabled: s,
200
+ children: [r && r(e, a), !r && /* @__PURE__ */ y("div", {
201
+ className: q.select_multiple_input__tag_content,
202
+ children: [/* @__PURE__ */ v("span", {
203
+ className: "truncate",
204
+ children: c.getLabel(e)
205
+ }), /* @__PURE__ */ v(a, {})]
206
+ })]
207
+ }, n);
208
+ }), u < l && h > 0 && /* @__PURE__ */ y(H, {
209
+ ref: p,
210
+ children: [`+ ${m} `, /* @__PURE__ */ v("span", {
211
+ className: "text-[#666]",
212
+ children: "..."
213
+ })]
214
+ })] })]
215
+ });
216
+ });
217
+ Y.displayName = "BsySelectMultipleInput";
218
+ //#endregion
219
+ //#region src/components/Select/utils/tree.ts
220
+ var X = (e, t) => {
221
+ let n = [], r = (e) => {
222
+ e.forEach((e) => {
223
+ let { [t.children]: i, ...a } = e;
224
+ n.push(a), i && r(i);
225
+ });
226
+ };
227
+ return r(e), n;
228
+ }, pe = ({ placeholder: e, mode: n, clearable: r, onClear: a, disabled: o = !1, labelRender: s, options: c = [], type: l, prefix: u, suffixIcon: d, ghost: f, inputValueStyle: m, tagStyle: g }) => {
229
+ let b = O(null), x = j(o ? null : b), { isOpen: S, value: C, getCachedOptionByValue: w } = I(), { fieldNames: T } = L(), E = D(() => {
230
+ if (h(C)) return [];
231
+ let e = p(C) ? C : [C];
232
+ if (l === F.TREE) {
233
+ let t = z(T), n = X(c, T);
234
+ return e.map((e) => n.find((n) => t.getValue(n) === e) || w?.(e)).filter((e) => !!e);
235
+ }
236
+ return e.map((e) => c.find((t) => t[T.value] === e) || w?.(e)).filter((e) => !!e);
237
+ }, [
238
+ C,
239
+ c,
240
+ l,
241
+ T,
242
+ w
243
+ ]);
244
+ return /* @__PURE__ */ v("div", {
245
+ className: A("bsy-select-input-container", {
246
+ disabled: o,
247
+ multiple: n === P.MULTIPLE,
248
+ active: S,
249
+ "ghost-style": f
250
+ }),
251
+ ref: b,
252
+ children: /* @__PURE__ */ y("div", {
253
+ className: A("bsy-select-input-container-input"),
254
+ children: [
255
+ u && /* @__PURE__ */ v("div", {
256
+ className: "bsy-select-input-container-input-prefix",
257
+ children: u
258
+ }),
259
+ E?.length ? /* @__PURE__ */ y(_, { children: [n === P.SINGLE && /* @__PURE__ */ v(B, {
260
+ value: E,
261
+ labelRender: s,
262
+ inputValueStyle: m
263
+ }), n === P.MULTIPLE && /* @__PURE__ */ v(Y, {
264
+ value: E,
265
+ labelRender: s,
266
+ tagStyle: g
267
+ })] }) : /* @__PURE__ */ v("div", {
268
+ className: "bsy-select-input-container__input-value-placeholder truncate",
269
+ children: e
270
+ }),
271
+ /* @__PURE__ */ v("div", {
272
+ className: A("bsy-select-input-container__icon"),
273
+ children: /* @__PURE__ */ v(oe, {
274
+ mode: "wait",
275
+ children: E?.length && r && x ? /* @__PURE__ */ v(M.div, {
276
+ ...i,
277
+ children: /* @__PURE__ */ v(t, {
278
+ name: "cancel",
279
+ className: "icon hover:text-[#0265ff] text-[#666]",
280
+ role: "button",
281
+ "aria-label": "clear",
282
+ onClick: (e) => {
283
+ e.stopPropagation(), a?.();
284
+ }
285
+ })
286
+ }, "cancel") : /* @__PURE__ */ v(M.div, {
287
+ ...i,
288
+ children: d ? d(S, o) : /* @__PURE__ */ v(t, {
289
+ name: "arrow-down",
290
+ className: A("icon", {
291
+ active: S,
292
+ "text-[#c2c2c2]": o,
293
+ "text-[#666]": !o
294
+ })
295
+ })
296
+ }, "arrow")
297
+ })
298
+ })
299
+ ]
300
+ })
301
+ });
302
+ };
303
+ pe.displayName = "BsySelectInput";
304
+ //#endregion
305
+ //#region src/components/Select/OptionList/SingleOptionList/SingleOptionList.tsx
306
+ var Z = C((e) => {
307
+ let { options: t, value: n, onSelect: r, searchValue: i = "", fieldNames: a, optionRender: o, optionStyle: c } = e, { otherInputPosition: l } = L(), { otherOptionValue: u, setOtherOptionValue: d, onOtherInputChange: f, isSelectedOtherOption: p = !1 } = R(), m = O(null), h = z(a);
308
+ return /* @__PURE__ */ v("ul", {
309
+ role: "listbox",
310
+ children: t.map((e, t) => {
311
+ let a = h.getValue(e), g = h.getLabel(e), _ = e.systemField || !1, b = e.isOther === !0, x = b && l === "inline" && g.length > 6 ? g.slice(0, 6) + "..." : g, S = b ? p : a === n;
312
+ return /* @__PURE__ */ y("li", {
313
+ role: "option",
314
+ "aria-selected": S,
315
+ className: A("cursor-pointer rounded-[4px] py-[7px] px-[10px] min-h-[34px]", {
316
+ "hover:bg-[#eff0f6]": !S,
317
+ "text-[#4d609f]": _ && !S,
318
+ "text-[#0265ff] bg-[#f0f6ff]": S,
319
+ "flex items-center": b && l === "inline"
320
+ }),
321
+ style: c,
322
+ onClick: () => {
323
+ r(a, e);
324
+ },
325
+ children: [/* @__PURE__ */ v("div", {
326
+ title: g,
327
+ children: o ? o(e, { index: t }, S) : /* @__PURE__ */ v(s, {
328
+ text: x,
329
+ highlight: i
330
+ })
331
+ }), b && l === "inline" && /* @__PURE__ */ v("div", {
332
+ className: "ml-2 flex-1",
333
+ onClick: (e) => e.stopPropagation(),
334
+ style: { minWidth: "146px" },
335
+ children: /* @__PURE__ */ v(re, {
336
+ ref: m,
337
+ value: u,
338
+ onChange: (e) => {
339
+ let t = e.target.value;
340
+ d?.(t), f?.(t);
341
+ },
342
+ onPressEnter: () => {
343
+ u && r(a, e);
344
+ },
345
+ onBlur: () => {
346
+ u && r(a, e);
347
+ },
348
+ placeholder: "请输入内容"
349
+ })
350
+ })]
351
+ }, `${a}-${t}`);
352
+ })
353
+ });
354
+ });
355
+ Z.displayName = "BsySingleSelect";
356
+ //#endregion
357
+ //#region src/components/Select/OptionList/MultOptionList/MultOptionList.tsx
358
+ var Q = (e) => {
359
+ let { t } = n(), { options: r, searchValue: i = "", value: a, onSelect: o, fieldNames: c, optionRender: u } = e, d = z(c), f = a || [], p = r.filter((e) => !e.isOther), m = p.length > 0 && p.every((e) => f.includes(d.getValue(e)));
360
+ return /* @__PURE__ */ v("div", {
361
+ className: "bsy-multiple-select",
362
+ children: /* @__PURE__ */ y("ul", {
363
+ className: "bsy-multiple-select-list",
364
+ children: [/* @__PURE__ */ v("li", {
365
+ className: A("flex items-center gap-[8px]", "cursor-pointer hover:bg-[#eff0f6] rounded-[4px] min-h-[34px]", "bsy-multiple-select-item"),
366
+ children: /* @__PURE__ */ v(l, {
367
+ checked: m,
368
+ onChange: () => {
369
+ o(m ? [] : p.map((e) => d.getValue(e)), m ? [] : p.filter((e) => f.includes(d.getValue(e))));
370
+ },
371
+ indeterminate: f.length > 0 && f.length < p.length,
372
+ style: { padding: "7px 10px" },
373
+ children: /* @__PURE__ */ v("span", {
374
+ className: "font-bold text-[#0265ff]",
375
+ children: t(i ? "allSelectedBySearch" : "allSelect")
376
+ })
377
+ })
378
+ }), /* @__PURE__ */ v(l.Group, {
379
+ value: f,
380
+ onChange: (e) => {
381
+ o(e, p.filter((t) => e.includes(d.getValue(t))));
382
+ },
383
+ children: p.map((e, t) => {
384
+ let n = d.getValue(e), r = d.getLabel(e), a = f.includes(n), o = e.systemField || !1;
385
+ return /* @__PURE__ */ v("li", {
386
+ className: A("flex items-center gap-[8px] min-h-[34px]", "cursor-pointer rounded-[4px]", "bsy-multiple-select-item", {
387
+ "hover:bg-[#eff0f6]": !0,
388
+ "text-[#4d609f]": o && !a
389
+ }),
390
+ children: /* @__PURE__ */ v(l, {
391
+ value: n,
392
+ style: { padding: "7px 10px" },
393
+ children: u ? u(e, { index: t }, a) : /* @__PURE__ */ v(s, {
394
+ text: r,
395
+ highlight: i
396
+ })
397
+ })
398
+ }, `${n}-${t}`);
399
+ })
400
+ })]
401
+ })
402
+ });
403
+ };
404
+ Q.displayName = "BsyMultipleSelect";
405
+ //#endregion
406
+ //#region src/components/Select/OptionList/TreeOptionList/TreeOptionList.tsx
407
+ var me = (e) => {
408
+ let { options: t, searchValue: n, value: r, onSelect: i, fieldNames: a } = e;
409
+ return /* @__PURE__ */ v("div", {
410
+ className: "bsy-tree-select",
411
+ children: /* @__PURE__ */ v("div", {
412
+ className: "bsy-tree-select-nodes",
413
+ children: /* @__PURE__ */ v(c, {
414
+ data: t,
415
+ searchValue: n,
416
+ fieldNames: a ? {
417
+ title: a.label,
418
+ value: a.value,
419
+ children: a.children
420
+ } : void 0,
421
+ selectedKeys: r ? [r] : [],
422
+ onSelect: i
423
+ })
424
+ })
425
+ });
426
+ }, he = (e, t) => {
427
+ let n = [], r = (e) => {
428
+ if (e) for (let i of e) n.push(i), r(i[t.children]);
429
+ };
430
+ return r(e), n;
431
+ }, $ = (e, t, n) => e.reduce((e, r) => {
432
+ let i = r[n.children] ? $(r[n.children], t, n) : void 0;
433
+ if (t.has(r[n.value]) || i && i.length > 0) {
434
+ let a = t.has(r[n.value]) ? r[n.children] : i;
435
+ e.push({
436
+ ...r,
437
+ children: a
438
+ });
439
+ }
440
+ return e;
441
+ }, []), ge = (e) => {
442
+ let { options: t = [], searchValue: r = "", type: i, filterOption: a, optionRender: o, optionStyle: s, notFoundContent: c } = e, { t: l } = n(), { value: d, setIsOpen: f, setValue: p } = I(), { fieldNames: h } = L(), g = D(() => i === F.TREE ? he(t, h) : t, [
443
+ t,
444
+ h,
445
+ i
446
+ ]), y = D(() => new N(g, {
447
+ keys: [h.label],
448
+ ignoreLocation: !0,
449
+ threshold: .3
450
+ }), [g, h]), b = w((e, t) => {
451
+ f?.(!1), p(e, t);
452
+ }, [f, p]), x = w((e, t) => {
453
+ p(e, t);
454
+ }, [p]), S = w((e, t) => {
455
+ f?.(!1), p(e, t);
456
+ }, [f, p]), C = () => {
457
+ if (!a || m(r)) return t;
458
+ let e = y.search(r), n = new Set(e.map((e) => e.item[h.value]));
459
+ return i === F.TREE ? $(t, n, h) : t.filter((e) => n.has(e[h.value]));
460
+ };
461
+ return /* @__PURE__ */ v(_, { children: (() => {
462
+ let e = {
463
+ options: C(),
464
+ searchValue: r,
465
+ optionStyle: s
466
+ };
467
+ if (!m(r) && e.options.length === 0) return c === void 0 ? /* @__PURE__ */ v(u, { text: l("noDataFound") }) : c;
468
+ switch (i) {
469
+ case F.SINGLE: return /* @__PURE__ */ v(Z, {
470
+ ...e,
471
+ value: d,
472
+ fieldNames: h,
473
+ onSelect: b,
474
+ optionRender: o
475
+ });
476
+ case F.MULTIPLE: return /* @__PURE__ */ v(Q, {
477
+ ...e,
478
+ value: d,
479
+ fieldNames: h,
480
+ onSelect: x,
481
+ optionRender: o
482
+ });
483
+ case F.TREE: return /* @__PURE__ */ v(me, {
484
+ ...e,
485
+ value: d,
486
+ fieldNames: h,
487
+ onSelect: S
488
+ });
489
+ default: return null;
490
+ }
491
+ })() });
492
+ }, _e = (t) => {
493
+ let { options: r = [], type: i = F.SINGLE, filterOption: a = !0, onSearch: s, showSearch: c, searchPlaceholder: l, onPopupScroll: d, notFoundContent: f } = t, { t: p } = n(), { searchValue: m = "", setSearchValue: h } = I(), g = E(m), _ = (e) => {
494
+ h?.(e), s?.(e);
495
+ }, x = () => t.fetching ? /* @__PURE__ */ v(u, { text: p("dataSearching") }) : r.length === 0 && !m ? f === void 0 ? /* @__PURE__ */ v(u, { text: p("noData") }) : f : /* @__PURE__ */ v(ge, {
496
+ searchValue: g,
497
+ options: r,
498
+ type: i,
499
+ filterOption: a,
500
+ optionRender: t.optionRender,
501
+ optionStyle: t.optionStyle,
502
+ notFoundContent: f
503
+ }), S = w((e) => {
504
+ d?.(e);
505
+ }, [d]);
506
+ return /* @__PURE__ */ v("div", {
507
+ className: "bsy-select-panel",
508
+ children: /* @__PURE__ */ y(b, { children: [c && /* @__PURE__ */ v(o, {
509
+ value: m,
510
+ onChange: _,
511
+ searchPlaceholder: l
512
+ }), /* @__PURE__ */ v("div", {
513
+ className: A({ "pt-[4px]": c }),
514
+ children: /* @__PURE__ */ v(e, {
515
+ style: { maxHeight: 300 },
516
+ onScroll: S,
517
+ children: x()
518
+ })
519
+ })] })
520
+ });
521
+ };
522
+ _e.displayName = "BsySelectPanel";
523
+ //#endregion
524
+ //#region src/components/Select/Select.tsx
525
+ var ve = S((e, t) => {
526
+ let { options: i = [], type: o = F.SINGLE, fieldNames: s, clearable: c = !0, disabled: l = !1, placeholder: u, labelRender: f, onOtherInputChange: p, onOpenChange: m, onPopupScroll: h, prefix: g, suffixIcon: _, ghost: b, inputValueStyle: x, tagStyle: S, zIndex: C = 1101, zIndexMask: T = 1100, otherInputPosition: E = "bottom", popupMinWidth: ne, getPopupContainer: re } = e, j = ce[o], { t: N } = n(), I = ee(), { onChange: L } = e, R = s || le, [z, B] = ie(e, {
527
+ defaultValue: j === P.SINGLE ? void 0 : [],
528
+ defaultValuePropName: "defaultValue",
529
+ valuePropName: "value",
530
+ trigger: "__NO_CUSTOM_CHANGE__"
531
+ }), [V, H] = k(""), U = O(/* @__PURE__ */ new Map()), [W, G] = k(() => {
532
+ if (j === P.SINGLE) {
533
+ let e = i.every((e) => e[R.value] !== z), t = i.find((e) => e.isOther === !0);
534
+ return e && t ? z : void 0;
535
+ }
536
+ }), K = w((e, t) => {
537
+ if (B(e), t) {
538
+ let n = /* @__PURE__ */ new Map();
539
+ if (Array.isArray(e)) {
540
+ let r = Array.isArray(t) ? t : [];
541
+ e.forEach((e) => {
542
+ let t = r.find((t) => t?.[R.value] === e);
543
+ e !== null && t && n.set(e, t);
544
+ });
545
+ } else e !== null && !Array.isArray(t) && n.set(e, t);
546
+ U.current = n;
547
+ }
548
+ L && L(e, t);
549
+ }, [
550
+ L,
551
+ B,
552
+ R
553
+ ]), [q, { set: J }] = ae(!1), Y = w((e) => {
554
+ e !== q && (J(e), m?.(e));
555
+ }, [
556
+ J,
557
+ m,
558
+ q
559
+ ]), { isSelectedOtherOption: X, shouldShowOtherInput: Z } = D(() => {
560
+ if (j === P.MULTIPLE) return {
561
+ isSelectedOtherOption: !1,
562
+ shouldShowOtherInput: !1
563
+ };
564
+ let e = i.find((e) => e[R.value] === z);
565
+ return e ? {
566
+ isSelectedOtherOption: e.isOther === !0,
567
+ shouldShowOtherInput: e.isOther === !0
568
+ } : i.find((e) => e.isOther === !0) && z ? {
569
+ isSelectedOtherOption: !0,
570
+ shouldShowOtherInput: !0
571
+ } : {
572
+ isSelectedOtherOption: !1,
573
+ shouldShowOtherInput: !1
574
+ };
575
+ }, [
576
+ z,
577
+ i,
578
+ R,
579
+ j
580
+ ]), Q = w(() => {
581
+ if (z) {
582
+ if (j === P.SINGLE) {
583
+ let e = i.every((e) => e[R.value] !== z), t = i.find((e) => e.isOther === !0);
584
+ if (e && t) return t[R.value];
585
+ }
586
+ return z;
587
+ } else return z;
588
+ }, [
589
+ z,
590
+ i,
591
+ R,
592
+ j
593
+ ]), me = D(() => ({
594
+ value: Q(),
595
+ setValue: K,
596
+ isOpen: q,
597
+ setIsOpen: Y,
598
+ getCachedOptionByValue: (e) => U.current.get(e),
599
+ searchValue: V,
600
+ setSearchValue: H
601
+ }), [
602
+ Q,
603
+ K,
604
+ q,
605
+ Y,
606
+ V
607
+ ]), he = D(() => ({
608
+ fieldNames: s || le,
609
+ disabled: l,
610
+ otherInputPosition: E
611
+ }), [
612
+ s,
613
+ l,
614
+ E
615
+ ]), $ = D(() => ({
616
+ isSelectedOtherOption: X,
617
+ otherOptionValue: W,
618
+ setOtherOptionValue: G,
619
+ onOtherInputChange: p
620
+ }), [
621
+ X,
622
+ W,
623
+ G,
624
+ p
625
+ ]), { refs: ge, floatingStyles: ve, getReferenceProps: ye, getFloatingProps: be, referenceStyle: xe } = d({
626
+ isOpen: q,
627
+ close: () => {
628
+ Y(!1);
629
+ },
630
+ showMask: e.showMask,
631
+ zIndex: C,
632
+ zIndexMask: T,
633
+ popupMinWidth: ne,
634
+ offset: {
635
+ x: 0,
636
+ y: 4
637
+ }
638
+ }), { portalRoot: Se, portalMountKey: Ce, handleExitComplete: we } = a(q, re), Te = w(() => {
639
+ X && (G(""), p?.("")), Y(!1), U.current.clear(), K(j === P.SINGLE ? void 0 : []);
640
+ }, [
641
+ X,
642
+ p,
643
+ K,
644
+ j,
645
+ Y
646
+ ]);
647
+ return te(t, () => ({
648
+ getOtherOptionValue: () => W,
649
+ setOtherOptionValue: (e) => {
650
+ G(e), p?.(e);
651
+ }
652
+ }), [W, p]), /* @__PURE__ */ v(ue.Provider, {
653
+ value: me,
654
+ children: /* @__PURE__ */ v(de.Provider, {
655
+ value: he,
656
+ children: /* @__PURE__ */ v(fe.Provider, {
657
+ value: $,
658
+ children: /* @__PURE__ */ y("div", {
659
+ className: A("bsy-select-container text-sm", e.className),
660
+ style: e.style,
661
+ children: [
662
+ /* @__PURE__ */ v("div", {
663
+ ref: ge.setReference,
664
+ className: A("bsy-select-input-event", e.inputClassName),
665
+ ...ye(),
666
+ style: xe,
667
+ onClick: () => {
668
+ e.disabled || Y(!0);
669
+ },
670
+ role: "combobox",
671
+ "aria-expanded": q,
672
+ "aria-haspopup": "listbox",
673
+ "aria-controls": I,
674
+ "aria-disabled": l,
675
+ children: /* @__PURE__ */ v(pe, {
676
+ mode: j,
677
+ clearable: c,
678
+ disabled: l,
679
+ placeholder: u || N("select"),
680
+ labelRender: f,
681
+ options: i,
682
+ type: o,
683
+ prefix: g,
684
+ suffixIcon: _,
685
+ ghost: b,
686
+ inputValueStyle: x,
687
+ tagStyle: S,
688
+ onClear: Te
689
+ })
690
+ }),
691
+ /* @__PURE__ */ y(se, {
692
+ root: Se,
693
+ children: [q && e.showMask ? /* @__PURE__ */ v("div", {
694
+ className: "bsy-select-mask",
695
+ style: { zIndex: T }
696
+ }) : null, /* @__PURE__ */ v(oe, {
697
+ onExitComplete: we,
698
+ children: q ? /* @__PURE__ */ v(M.div, {
699
+ ref: ge.setFloating,
700
+ style: ve,
701
+ ...be(),
702
+ id: I,
703
+ ...r,
704
+ children: /* @__PURE__ */ v(_e, {
705
+ ...e,
706
+ options: i,
707
+ onPopupScroll: h
708
+ })
709
+ }, "bsy-select-panel") : null
710
+ })]
711
+ }, Ce),
712
+ Z && E === "bottom" ? e.otherOptionRender ? e.otherOptionRender(W, i) : /* @__PURE__ */ v("div", {
713
+ className: A("mt-[6px] w-full px-[10px] py-[7px] bg-white rounded-[4px]", "border border-[#e0e0e0]"),
714
+ children: /* @__PURE__ */ v("input", {
715
+ value: W || "",
716
+ onChange: (e) => {
717
+ G(e.target.value), p?.(e.target.value);
718
+ },
719
+ className: "w-full outline-none border-none placeholder:text-[#999]",
720
+ placeholder: N("context"),
721
+ "aria-label": "其他选项输入框",
722
+ role: "textbox"
723
+ })
724
+ }) : null
725
+ ]
726
+ })
727
+ })
728
+ })
729
+ });
730
+ });
731
+ ve.displayName = "BsySelect";
732
+ //#endregion
733
+ export { P as n, F as r, ve as t };