@baishuyun/ui-base 6.15.0 → 6.16.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.
Files changed (113) hide show
  1. package/dist/Amap/AmapCircle/index.js +1 -1
  2. package/dist/Amap/AmapMarker/index.js +1 -1
  3. package/dist/Amap/AmapMarkerCluster/index.js +1 -1
  4. package/dist/Amap/AmapProvider/index.js +1 -1
  5. package/dist/Amap/hooks/index.js +1 -1
  6. package/dist/Amap/index.js +1 -1
  7. package/dist/Calendar/{AllDaySection-b3li9ovR.js → AllDaySection-pO7suGJM.js} +4 -4
  8. package/dist/Calendar/{Calendar-DbQvgTzh.js → Calendar-DUD4iffO.js} +10 -10
  9. package/dist/Calendar/{EventCard-DkJoyxI3.js → EventCard-DKEZQRTp.js} +2 -2
  10. package/dist/Calendar/{TimeGrid-Qjvt-eum.js → TimeGrid-BV8x9VnF.js} +1 -1
  11. package/dist/Calendar/context/index.js +2 -2
  12. package/dist/Calendar/index.js +15 -15
  13. package/dist/Calendar/subcomponents/AllDaySection/index.js +7 -7
  14. package/dist/Calendar/subcomponents/CurrentTimeIndicator/index.js +4 -4
  15. package/dist/Calendar/subcomponents/EventCard/index.js +5 -5
  16. package/dist/Calendar/subcomponents/TimeAxis/index.js +4 -4
  17. package/dist/Calendar/subcomponents/TimeGrid/index.js +3 -3
  18. package/dist/Calendar/{theme-i60ueO92.js → theme-Dc8hjcdo.js} +1 -1
  19. package/dist/Calendar/utils/index.js +4 -4
  20. package/dist/Calendar/utils/layout/index.js +3 -3
  21. package/dist/Calendar/utils/theme/index.js +2 -2
  22. package/dist/Card/{Card-DDbQQsCc.js → Card-rJeWgxu5.js} +1 -1
  23. package/dist/Card/index.js +3 -3
  24. package/dist/CheckBox/{CheckBox-CwfrMEFb.js → CheckBox-B92dxWNo.js} +1 -1
  25. package/dist/CheckBox/{CheckBox-DFfNiPGM.js → CheckBox-DOK5N7z6.js} +1 -1
  26. package/dist/CheckBox/index.js +4 -4
  27. package/dist/ColorPicker/{ColorPicker-BGduOQbR.js → ColorPicker-CPr5j6ZN.js} +1 -1
  28. package/dist/ColorPicker/index.js +3 -3
  29. package/dist/ConfigProvider/index.js +1 -1
  30. package/dist/DatePicker/{DatePicker-CvOPih1m.js → DatePicker-BWMmI6rl.js} +3 -3
  31. package/dist/DatePicker/{DatePickerPanel-CrpZidbJ.js → DatePickerPanel-CRnLvIwc.js} +4 -4
  32. package/dist/DatePicker/index.js +5 -5
  33. package/dist/DatePicker/style/index.js +2 -2
  34. package/dist/DropDown/{DropDown-CtiUrlqk.js → DropDown-CvG9IFVk.js} +3 -3
  35. package/dist/DropDown/index.js +5 -5
  36. package/dist/DropDown/style/index.js +2 -2
  37. package/dist/Editor/{Buttons-BhGuyTzy.js → Buttons-vt3gwedu.js} +533 -469
  38. package/dist/Editor/ToolbarPlugin/Buttons/index.js +10 -10
  39. package/dist/Editor/constants/index.js +1 -1
  40. package/dist/Editor/index.js +57 -52
  41. package/dist/Gantt/GanttChart/index.js +11 -11
  42. package/dist/Gantt/{GanttChart-C_bxX0_A.js → GanttChart-DRzJdEm-.js} +7 -7
  43. package/dist/Gantt/GanttTable/index.js +9 -9
  44. package/dist/Gantt/{GanttTable-T7ZHce4a.js → GanttTable-fOv1Zn2-.js} +5 -5
  45. package/dist/Gantt/GanttToolBar/index.js +8 -8
  46. package/dist/Gantt/{GanttToolBar-jhhCjBn-.js → GanttToolBar-4kxZP6oS.js} +3 -3
  47. package/dist/Gantt/{collapseKeys-B4SOVHjd.js → collapseKeys-BV_8sIA-.js} +2 -2
  48. package/dist/Gantt/index.js +19 -19
  49. package/dist/Gantt/{timelineViewConfig-9HArvbmb.js → timelineViewConfig-DNt7yi83.js} +1 -1
  50. package/dist/Gantt/utils/index.js +6 -6
  51. package/dist/Gantt/utils/theme/index.js +2 -2
  52. package/dist/Icon/{Icon-DDHx0R18.js → Icon-DrdQOEJE.js} +1 -1
  53. package/dist/Icon/index.js +2 -2
  54. package/dist/InputTag/{InputTag-BcywA_86.js → InputTag-BfZycXw4.js} +1 -1
  55. package/dist/InputTag/index.js +3 -3
  56. package/dist/Loading/index.js +2 -2
  57. package/dist/Modal/{Modal-BnF6CUrn.js → Modal-CRKitOOj.js} +1 -1
  58. package/dist/Modal/index.js +3 -3
  59. package/dist/NotFoundContent/index.js +1 -1
  60. package/dist/Overlay/index.js +1 -1
  61. package/dist/Radio/index.js +1 -1
  62. package/dist/ScrollBar/index.js +1 -1
  63. package/dist/Segmented/index.js +1 -1
  64. package/dist/Select/Select-Bla1mQ8v.js +767 -0
  65. package/dist/Select/{SelectInputSearch-BUWOQCgT.js → SelectInputSearch-CRgBcsq2.js} +2 -5
  66. package/dist/Select/index.js +8 -7
  67. package/dist/Select/style/index.js +3 -0
  68. package/dist/Select/style-C4A8kUd1.js +9 -0
  69. package/dist/Table/{Table-BjLvTorz.js → Table-3LSO0xSH.js} +4 -4
  70. package/dist/Table/hooks/index.js +2 -2
  71. package/dist/Table/{hooks-BceUZQQm.js → hooks-DSBl2e4O.js} +1 -1
  72. package/dist/Table/index.js +6 -6
  73. package/dist/Table/{processRowspan-B0WELhG2.js → processRowspan-B6HMqw0Q.js} +1 -1
  74. package/dist/Table/style/index.js +2 -2
  75. package/dist/Table/utils/index.js +2 -2
  76. package/dist/Tabs/{Tabs-DezpnxP1.js → Tabs-B9uCGlxM.js} +1 -1
  77. package/dist/Tabs/index.js +3 -3
  78. package/dist/Tooltip/index.js +1 -1
  79. package/dist/Tree/index.js +4 -4
  80. package/dist/Tree/utils/index.js +1 -1
  81. package/dist/components/Editor/ToolbarPlugin/Buttons/ToolbarColorGlyph.d.ts +8 -0
  82. package/dist/components/Editor/interface.d.ts +8 -3
  83. package/dist/components/Editor/utils/fillRootFromHtml.d.ts +1 -1
  84. package/dist/components/Select/SelectPanel/SelectPanel.d.ts +4 -1
  85. package/dist/components/Select/index.d.ts +1 -1
  86. package/dist/components/Select/interface.d.ts +54 -0
  87. package/dist/components/Select/style/index.d.ts +1 -0
  88. package/dist/components/Select/style/resolveSelectThemeVars.d.ts +2 -0
  89. package/dist/components/Table/interface.d.ts +2 -2
  90. package/dist/components/index.d.ts +1 -0
  91. package/dist/index.js +33 -32
  92. package/dist/style.css +1 -1
  93. package/dist/vendors/{Tree-B7XeC9Mi.js → Tree-DSl4lDjx.js} +3 -3
  94. package/dist/vendors/{version-DuQW7jtS.js → version-CFii9VTt.js} +1 -1
  95. package/package.json +2 -2
  96. package/dist/Select/Select-DWXMgoud.js +0 -753
  97. /package/dist/Calendar/{CurrentTimeIndicator-BZLQps2m.js → CurrentTimeIndicator-BF3_INSL.js} +0 -0
  98. /package/dist/Calendar/{TimeAxis-C9e2BdYs.js → TimeAxis-DUc6EL-j.js} +0 -0
  99. /package/dist/Calendar/{colorUtils-CBLTsDX0.js → colorUtils-BbeSMnOs.js} +0 -0
  100. /package/dist/Calendar/{context-4tCN5X33.js → context-CamSpkj3.js} +0 -0
  101. /package/dist/Calendar/{layout-Dz-grtu9.js → layout-CpOabFQ2.js} +0 -0
  102. /package/dist/DatePicker/{ensureDayjsPlugins-Cn9Bkjkj.js → ensureDayjsPlugins-CSqhjLS7.js} +0 -0
  103. /package/dist/DatePicker/{pickerLocale-BRnNjLcv.js → pickerLocale-CcPLUbZO.js} +0 -0
  104. /package/dist/DatePicker/{style-UKXn1N_p.js → style-W7f5wyUb.js} +0 -0
  105. /package/dist/DropDown/{style-LLDVPpPa.js → style-DZpkarne.js} +0 -0
  106. /package/dist/Gantt/{GanttHighlightContext-ChThr8ia.js → GanttHighlightContext-dtyoq-oj.js} +0 -0
  107. /package/dist/Gantt/{columnResize-jG0Wy2PC.js → columnResize-Bkenlbab.js} +0 -0
  108. /package/dist/Gantt/{constants-LIz5jwed.js → constants-mEGQ1U1Q.js} +0 -0
  109. /package/dist/Gantt/{highlightTarget-BpkYTonb.js → highlightTarget-D3Nf9_7S.js} +0 -0
  110. /package/dist/Gantt/{theme-2LyXJRDe.js → theme-B7Iap-tZ.js} +0 -0
  111. /package/dist/Loading/{Loading-D1QxBrOq.js → Loading-DpbJSRYf.js} +0 -0
  112. /package/dist/Table/{constants-kRpjsoet.js → constants-D7wLH8Qy.js} +0 -0
  113. /package/dist/Table/{style-C4wp0IOM.js → style-B8Cw8HJe.js} +0 -0
@@ -0,0 +1,767 @@
1
+ import { t as e } from "../Icon/Icon-DrdQOEJE.js";
2
+ import { a as t, i as n } from "../Overlay/OverlayContext-CVSFoyqN.js";
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
+ import { t as o } from "../vendors/useLatchedPopupPortalRoot-4fVhqVT4.js";
6
+ import { t as s } from "./SelectInputSearch-CRgBcsq2.js";
7
+ import { n as c, t as l } from "../vendors/Tree-DSl4lDjx.js";
8
+ import { t as u } from "../CheckBox/CheckBox-B92dxWNo.js";
9
+ import { t as d } from "../NotFoundContent/NotFoundContent-BLmzWNBi.js";
10
+ import { t as f } from "../ScrollBar/ScrollBar-N2pOLv-8.js";
11
+ import { t as p } from "../vendors/useFloatingPortal-VpzL-EPh.js";
12
+ import { t as m } from "./style-C4A8kUd1.js";
13
+ import { first as h, isArray as g, isEmpty as _, isNil as v, noop as y } from "lodash-es";
14
+ import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
15
+ import { Suspense as C, createContext as w, forwardRef as T, memo as E, useCallback as D, useContext as O, useDeferredValue as k, useId as ee, useImperativeHandle as te, useLayoutEffect as ne, useMemo as A, useRef as j, useState as re } from "react";
16
+ import { Input as ie } from "antd";
17
+ import M from "clsx";
18
+ import { useControllableValue as ae, useHover as oe, useToggle as se } from "ahooks";
19
+ import { AnimatePresence as ce, motion as N } from "motion/react";
20
+ import { FloatingPortal as le } from "@floating-ui/react";
21
+ import ue from "fuse.js";
22
+ //#region src/components/Select/constants.ts
23
+ var P = /* @__PURE__ */ function(e) {
24
+ return e.SINGLE = "single", e.MULTIPLE = "multiple", e;
25
+ }({}), F = /* @__PURE__ */ function(e) {
26
+ 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;
27
+ }({}), de = {
28
+ [F.SINGLE]: P.SINGLE,
29
+ [F.TREE]: P.SINGLE,
30
+ [F.MULTIPLE]: P.MULTIPLE,
31
+ [F.TREE_TAGS]: P.MULTIPLE,
32
+ [F.MEMBER]: P.MULTIPLE,
33
+ [F.DEPARTEMENT]: P.MULTIPLE
34
+ }, fe = {
35
+ label: "label",
36
+ value: "value",
37
+ children: "children"
38
+ }, pe = w({
39
+ value: void 0,
40
+ setValue: y,
41
+ isOpen: !1,
42
+ setIsOpen: y
43
+ }), me = w({
44
+ fieldNames: {
45
+ label: "label",
46
+ value: "value",
47
+ children: "children"
48
+ },
49
+ disabled: !1
50
+ }), he = w({}), I = () => {
51
+ let e = O(pe);
52
+ if (!e) throw Error("Select.* components must be used within a SelectStateContext provider");
53
+ return e;
54
+ }, L = () => {
55
+ let e = O(me);
56
+ if (!e) throw Error("Select.* components must be used within a SelectConfigContext provider");
57
+ return e;
58
+ }, R = () => O(he);
59
+ //#endregion
60
+ //#region src/components/Select/utils/fieldAccessor.ts
61
+ function z(e) {
62
+ let t = e;
63
+ return {
64
+ getLabel: (e) => e[t.label],
65
+ getValue: (e) => e[t.value],
66
+ getChildren: (e) => {
67
+ if (t.children) return e[t.children];
68
+ },
69
+ normalizeOption: (e) => ({
70
+ ...e,
71
+ label: e[t.label],
72
+ value: e[t.value],
73
+ children: t.children ? e[t.children] : void 0
74
+ }),
75
+ getFieldNames: () => t
76
+ };
77
+ }
78
+ //#endregion
79
+ //#region src/components/Select/SelectInput/SelectSingleInput/SelectSingleInput.tsx
80
+ var B = E((e) => {
81
+ let { value: t, inputValueStyle: n } = e, { fieldNames: r, otherInputPosition: i } = L(), { isSelectedOtherOption: a, otherOptionValue: o } = R(), s = z(r), c = h(t), l;
82
+ return l = a && o && i === "inline" ? o : e.labelRender && c ? e.labelRender(c) : c ? s.getLabel(c) : "", /* @__PURE__ */ x("div", {
83
+ className: M("bsy-select-input-container__input-value overflow-hidden"),
84
+ style: n,
85
+ children: /* @__PURE__ */ x("div", {
86
+ className: "bsy-select-input-container__input-value-text",
87
+ children: l
88
+ })
89
+ });
90
+ });
91
+ B.displayName = "BsySelectSingleInput";
92
+ //#endregion
93
+ //#region src/components/Select/SelectInput/SelectMultipleInput/OptionTag/option-tag.module.scss
94
+ var V = {
95
+ "bsy-input-tag__container": "_bsy-input-tag__container_1bb6m_1",
96
+ "bsy-input-tag__item": "_bsy-input-tag__item_1bb6m_7",
97
+ "bsy-input-tag__item--disabled": "_bsy-input-tag__item--disabled_1bb6m_20",
98
+ "bsy-input-tag__item-icon": "_bsy-input-tag__item-icon_1bb6m_24"
99
+ }, H = T(({ children: e, style: t, disabled: n }, r) => /* @__PURE__ */ x("div", {
100
+ "data-bsy-input-tag": "true",
101
+ className: M({
102
+ [V["bsy-input-tag__item"]]: !0,
103
+ [V["bsy-input-tag__item--disabled"]]: n
104
+ }),
105
+ ref: r,
106
+ style: t,
107
+ children: e
108
+ }));
109
+ H.Container = (e) => /* @__PURE__ */ x("div", {
110
+ className: M(V["bsy-input-tag__container"]),
111
+ children: e.children
112
+ }), H.displayName = "BsyOptionTag";
113
+ //#endregion
114
+ //#region src/components/Select/SelectInput/SelectMultipleInput/select-multiple-input.module.scss
115
+ var U = "_select_multiple_input__container_15izh_1", ge = "_select_multiple_input__measurement_layer_15izh_6", _e = "_select_multiple_input__close_btn_15izh_14", ve = "_select_multiple_input__ellipsis_15izh_24", W = "_select_multiple_input__tag_content_15izh_27", G = {
116
+ select_multiple_input__container: U,
117
+ select_multiple_input__measurement_layer: ge,
118
+ select_multiple_input__close_btn: _e,
119
+ "select_multiple_input__close_btn--disabled": "_select_multiple_input__close_btn--disabled_15izh_21",
120
+ select_multiple_input__ellipsis: ve,
121
+ select_multiple_input__tag_content: W
122
+ }, K = 4, q = E((t) => {
123
+ let { value: n, labelRender: r, tagStyle: i } = t, { setValue: a } = I(), { fieldNames: o, disabled: s } = L(), c = z(o), l = n?.length ?? 0, [u, d] = re(0), f = j(null), p = j(null);
124
+ ne(() => {
125
+ if (!f.current) return;
126
+ let e = new ResizeObserver((e) => {
127
+ let t = e[0];
128
+ if (!t) return;
129
+ let r = t.contentRect.width, i = t.target.querySelectorAll(".measure-list [data-bsy-input-tag=\"true\"]");
130
+ if (i.length === 0) {
131
+ d(n?.length ?? 0);
132
+ return;
133
+ }
134
+ let a = p.current?.offsetWidth || 65, o = 0, s = 0;
135
+ for (let e = 0; e < i.length; e++) {
136
+ let t = i[e].clientWidth + K, n = e < l - 1 ? a : 0;
137
+ if (o + t + n <= r) o += t, s = e + 1;
138
+ else break;
139
+ }
140
+ s === 0 && l === 1 && (s = 1), u !== s && d(s);
141
+ });
142
+ return e.observe(f.current), () => e.disconnect();
143
+ }, [
144
+ l,
145
+ u,
146
+ n.length
147
+ ]);
148
+ let m = l - u, h = k(m), g = /* @__PURE__ */ x("div", {
149
+ className: `${G.select_multiple_input__measurement_layer} measure-list`,
150
+ children: /* @__PURE__ */ S(H.Container, { children: [n?.map((t, n) => {
151
+ let a = (t) => /* @__PURE__ */ x("div", {
152
+ style: t,
153
+ className: M(V["bsy-input-tag__item-icon"], "cursor-pointer"),
154
+ children: /* @__PURE__ */ x(e, {
155
+ name: "close",
156
+ style: { fontSize: 12 },
157
+ className: G.select_multiple_input__close_btn
158
+ })
159
+ });
160
+ return /* @__PURE__ */ S(H, {
161
+ style: i,
162
+ children: [r && r(t, a), !r && /* @__PURE__ */ S("div", {
163
+ className: G.select_multiple_input__tag_content,
164
+ children: [/* @__PURE__ */ x("span", { children: c.getLabel(t) }), /* @__PURE__ */ x(a, {})]
165
+ })]
166
+ }, n);
167
+ }), u < l && h > 0 && /* @__PURE__ */ S(H, {
168
+ ref: p,
169
+ children: [`+ ${m}`, /* @__PURE__ */ x("span", {
170
+ className: G.select_multiple_input__ellipsis,
171
+ children: "..."
172
+ })]
173
+ })] })
174
+ }), _ = (e) => {
175
+ if (s) return;
176
+ let t = n.filter((t) => c.getValue(t) !== c.getValue(e));
177
+ a(t.map((e) => c.getValue(e)), t);
178
+ };
179
+ return /* @__PURE__ */ S("div", {
180
+ ref: f,
181
+ className: M("bsy-select-input-container__input-value", G.select_multiple_input__container, "multiple"),
182
+ children: [g, /* @__PURE__ */ S(H.Container, { children: [n?.slice(0, u).map((t, n) => {
183
+ let a = (n) => /* @__PURE__ */ x("div", {
184
+ style: n,
185
+ className: M(V["bsy-input-tag__item-icon"], {
186
+ [G.select_multiple_input__close_btn]: !s,
187
+ [G.select_multiple_input__close_btn + "--disabled"]: s
188
+ }),
189
+ onClick: (e) => {
190
+ e.stopPropagation(), _(t);
191
+ },
192
+ children: /* @__PURE__ */ x(e, {
193
+ name: "close",
194
+ style: { fontSize: 12 }
195
+ })
196
+ });
197
+ return /* @__PURE__ */ S(H, {
198
+ style: {
199
+ ...i,
200
+ flexShrink: u === 1 ? 1 : 0
201
+ },
202
+ disabled: s,
203
+ children: [r && r(t, a), !r && /* @__PURE__ */ S("div", {
204
+ className: G.select_multiple_input__tag_content,
205
+ children: [/* @__PURE__ */ x("span", {
206
+ className: "truncate",
207
+ children: c.getLabel(t)
208
+ }), /* @__PURE__ */ x(a, {})]
209
+ })]
210
+ }, n);
211
+ }), u < l && h > 0 && /* @__PURE__ */ S(H, {
212
+ ref: p,
213
+ children: [`+ ${m} `, /* @__PURE__ */ x("span", {
214
+ className: G.select_multiple_input__ellipsis,
215
+ children: "..."
216
+ })]
217
+ })] })]
218
+ });
219
+ });
220
+ q.displayName = "BsySelectMultipleInput";
221
+ //#endregion
222
+ //#region src/components/Select/utils/tree.ts
223
+ var J = (e, t) => {
224
+ let n = [], r = (e) => {
225
+ e.forEach((e) => {
226
+ let { [t.children]: i, ...a } = e;
227
+ n.push(a), i && r(i);
228
+ });
229
+ };
230
+ return r(e), n;
231
+ }, ye = ({ 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 }) => {
232
+ let h = j(null), _ = oe(o ? null : h), { isOpen: y, value: C, getCachedOptionByValue: w } = I(), { fieldNames: T } = L(), E = A(() => {
233
+ if (v(C)) return [];
234
+ let e = g(C) ? C : [C];
235
+ if (l === F.TREE) {
236
+ let t = z(T), n = J(c, T);
237
+ return e.map((e) => n.find((n) => t.getValue(n) === e) || w?.(e)).filter((e) => !!e);
238
+ }
239
+ return e.map((e) => c.find((t) => t[T.value] === e) || w?.(e)).filter((e) => !!e);
240
+ }, [
241
+ C,
242
+ c,
243
+ l,
244
+ T,
245
+ w
246
+ ]);
247
+ return /* @__PURE__ */ x("div", {
248
+ className: M("bsy-select-input-container", {
249
+ disabled: o,
250
+ multiple: n === P.MULTIPLE,
251
+ active: y,
252
+ "ghost-style": f
253
+ }),
254
+ ref: h,
255
+ children: /* @__PURE__ */ S("div", {
256
+ className: M("bsy-select-input-container-input"),
257
+ children: [
258
+ u && /* @__PURE__ */ x("div", {
259
+ className: "bsy-select-input-container-input-prefix",
260
+ children: u
261
+ }),
262
+ E?.length ? /* @__PURE__ */ S(b, { children: [n === P.SINGLE && /* @__PURE__ */ x(B, {
263
+ value: E,
264
+ labelRender: s,
265
+ inputValueStyle: p
266
+ }), n === P.MULTIPLE && /* @__PURE__ */ x(q, {
267
+ value: E,
268
+ labelRender: s,
269
+ tagStyle: m
270
+ })] }) : /* @__PURE__ */ x("div", {
271
+ className: "bsy-select-input-container__input-value-placeholder truncate",
272
+ children: t
273
+ }),
274
+ /* @__PURE__ */ x("div", {
275
+ className: M("bsy-select-input-container__icon"),
276
+ children: /* @__PURE__ */ x(ce, {
277
+ mode: "wait",
278
+ children: E?.length && r && _ ? /* @__PURE__ */ x(N.div, {
279
+ className: "bsy-select-input-container__icon-motion",
280
+ ...i,
281
+ children: /* @__PURE__ */ x(e, {
282
+ name: "cancel",
283
+ className: "icon bsy-select-input-clear",
284
+ role: "button",
285
+ "aria-label": "clear",
286
+ onClick: (e) => {
287
+ e.stopPropagation(), a?.();
288
+ }
289
+ })
290
+ }, "cancel") : /* @__PURE__ */ x(N.div, {
291
+ className: "bsy-select-input-container__icon-motion",
292
+ ...i,
293
+ children: d ? d(y, o) : /* @__PURE__ */ x(e, {
294
+ name: "arrow-down",
295
+ className: M("icon", { active: y })
296
+ })
297
+ }, "arrow")
298
+ })
299
+ })
300
+ ]
301
+ })
302
+ });
303
+ };
304
+ ye.displayName = "BsySelectInput";
305
+ //#endregion
306
+ //#region src/components/Select/OptionList/SingleOptionList/SingleOptionList.tsx
307
+ var Y = E((e) => {
308
+ let { options: t, value: n, onSelect: i, searchValue: a = "", fieldNames: o, optionRender: s, optionStyle: l } = e, { t: u } = r(), { otherInputPosition: d } = L(), { otherOptionValue: f, setOtherOptionValue: p, onOtherInputChange: m, isSelectedOtherOption: h = !1 } = R(), g = j(null), _ = z(o);
309
+ return /* @__PURE__ */ x("ul", {
310
+ role: "listbox",
311
+ children: t.map((e, t) => {
312
+ let r = _.getValue(e), o = _.getLabel(e), v = e.systemField || !1, y = e.isOther === !0, b = e.disabled === !0, C = y && d === "inline" && o.length > 6 ? o.slice(0, 6) + "..." : o, w = y ? h : r === n;
313
+ return /* @__PURE__ */ S("li", {
314
+ role: "option",
315
+ "aria-selected": w,
316
+ "aria-disabled": b,
317
+ className: M("rounded-[4px] py-[7px] px-[10px] min-h-[34px]", {
318
+ "cursor-pointer": !b,
319
+ "cursor-not-allowed bg-transparent": b,
320
+ "bsy-select-option--disabled": b,
321
+ "bsy-select-option--hoverable": !b && !w,
322
+ "bsy-select-option--system": !b && v && !w,
323
+ "bsy-select-option--selected": !b && w,
324
+ "flex items-center": y && d === "inline"
325
+ }),
326
+ style: l,
327
+ onClick: () => {
328
+ b || i(r, e);
329
+ },
330
+ children: [/* @__PURE__ */ x("div", {
331
+ title: o,
332
+ children: s ? s(e, { index: t }, w) : /* @__PURE__ */ x(c, {
333
+ text: C,
334
+ highlight: a
335
+ })
336
+ }), y && d === "inline" && /* @__PURE__ */ x("div", {
337
+ className: "ml-2 flex-1",
338
+ onClick: (e) => e.stopPropagation(),
339
+ style: { minWidth: "146px" },
340
+ children: /* @__PURE__ */ x(ie, {
341
+ ref: g,
342
+ value: f,
343
+ disabled: b,
344
+ onChange: (e) => {
345
+ let t = e.target.value;
346
+ p?.(t), m?.(t);
347
+ },
348
+ onPressEnter: () => {
349
+ !b && f && i(r, e);
350
+ },
351
+ onBlur: () => {
352
+ !b && f && i(r, e);
353
+ },
354
+ placeholder: u("context"),
355
+ "aria-label": u("otherOptionInput")
356
+ })
357
+ })]
358
+ }, `${r}-${t}`);
359
+ })
360
+ });
361
+ });
362
+ Y.displayName = "BsySingleSelect";
363
+ //#endregion
364
+ //#region src/components/Select/OptionList/MultOptionList/MultOptionList.tsx
365
+ var X = (e) => {
366
+ let { t } = r(), { options: n, searchValue: i = "", value: a, onSelect: o, fieldNames: s, optionRender: l } = e, d = z(s), f = a || [], p = n.filter((e) => !e.isOther), m = p.filter((e) => !e.disabled), h = m.map((e) => d.getValue(e)), g = m.length > 0 && m.every((e) => f.includes(d.getValue(e)));
367
+ return /* @__PURE__ */ x("div", {
368
+ className: "bsy-multiple-select",
369
+ children: /* @__PURE__ */ S("ul", {
370
+ className: "bsy-multiple-select-list",
371
+ children: [/* @__PURE__ */ x("li", {
372
+ className: M("flex items-center gap-[8px]", "cursor-pointer rounded-[4px] min-h-[34px]", "bsy-select-option--hoverable", "bsy-multiple-select-item"),
373
+ children: /* @__PURE__ */ x(u, {
374
+ checked: g,
375
+ disabled: m.length === 0,
376
+ onChange: () => {
377
+ let e = g ? f.filter((e) => !h.includes(e)) : [...f, ...h.filter((e) => !f.includes(e))];
378
+ o(e, p.filter((t) => e.includes(d.getValue(t))));
379
+ },
380
+ indeterminate: m.some((e) => f.includes(d.getValue(e))) && !g,
381
+ style: { padding: "7px 10px" },
382
+ children: /* @__PURE__ */ x("span", {
383
+ className: "font-bold bsy-select-option--all",
384
+ children: t(i ? "allSelectedBySearch" : "allSelect")
385
+ })
386
+ })
387
+ }), /* @__PURE__ */ x(u.Group, {
388
+ value: f,
389
+ onChange: (e) => {
390
+ o(e, p.filter((t) => e.includes(d.getValue(t))));
391
+ },
392
+ children: p.map((e, t) => {
393
+ let n = d.getValue(e), r = d.getLabel(e), a = f.includes(n), o = e.systemField || !1, s = e.disabled === !0;
394
+ return /* @__PURE__ */ x("li", {
395
+ "aria-disabled": s,
396
+ className: M("flex items-center gap-[8px] min-h-[34px]", "rounded-[4px]", "bsy-multiple-select-item", {
397
+ "cursor-pointer": !s,
398
+ "cursor-not-allowed bg-transparent": s,
399
+ "bsy-select-option--disabled": s,
400
+ "bsy-select-option--hoverable": !s,
401
+ "bsy-select-option--system": !s && o && !a
402
+ }),
403
+ children: /* @__PURE__ */ x(u, {
404
+ value: n,
405
+ disabled: s,
406
+ style: { padding: "7px 10px" },
407
+ children: l ? l(e, { index: t }, a) : /* @__PURE__ */ x(c, {
408
+ text: r,
409
+ highlight: i
410
+ })
411
+ })
412
+ }, `${n}-${t}`);
413
+ })
414
+ })]
415
+ })
416
+ });
417
+ };
418
+ X.displayName = "BsyMultipleSelect";
419
+ //#endregion
420
+ //#region src/components/Select/OptionList/TreeOptionList/TreeOptionList.tsx
421
+ var Z = (e) => {
422
+ let { options: t, searchValue: n, value: r, onSelect: i, fieldNames: a } = e;
423
+ return /* @__PURE__ */ x("div", {
424
+ className: "bsy-tree-select",
425
+ children: /* @__PURE__ */ x("div", {
426
+ className: "bsy-tree-select-nodes",
427
+ children: /* @__PURE__ */ x(l, {
428
+ data: t,
429
+ searchValue: n,
430
+ fieldNames: a ? {
431
+ title: a.label,
432
+ value: a.value,
433
+ children: a.children
434
+ } : void 0,
435
+ selectedKeys: r ? [r] : [],
436
+ onSelect: i
437
+ })
438
+ })
439
+ });
440
+ }, be = (e, t) => {
441
+ let n = [], r = (e) => {
442
+ if (e) for (let i of e) n.push(i), r(i[t.children]);
443
+ };
444
+ return r(e), n;
445
+ }, Q = (e, t, n) => e.reduce((e, r) => {
446
+ let i = r[n.children] ? Q(r[n.children], t, n) : void 0;
447
+ if (t.has(r[n.value]) || i && i.length > 0) {
448
+ let a = t.has(r[n.value]) ? r[n.children] : i;
449
+ e.push({
450
+ ...r,
451
+ children: a
452
+ });
453
+ }
454
+ return e;
455
+ }, []), xe = (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 } = I(), { fieldNames: m } = L(), h = A(() => i === F.TREE ? be(t, m) : t, [
457
+ t,
458
+ m,
459
+ i
460
+ ]), g = A(() => new ue(h, {
461
+ keys: [m.label],
462
+ ignoreLocation: !0,
463
+ threshold: .3
464
+ }), [h, m]), v = D((e, t) => {
465
+ f?.(!1), p(e, t);
466
+ }, [f, p]), y = D((e, t) => {
467
+ p(e, t);
468
+ }, [p]), S = D((e, t) => {
469
+ f?.(!1), p(e, t);
470
+ }, [f, p]), C = () => {
471
+ if (!a || _(n)) return t;
472
+ let e = g.search(n), r = new Set(e.map((e) => e.item[m.value]));
473
+ return i === F.TREE ? Q(t, r, m) : t.filter((e) => r.has(e[m.value]));
474
+ };
475
+ return /* @__PURE__ */ x(b, { children: (() => {
476
+ let e = {
477
+ options: C(),
478
+ searchValue: n,
479
+ optionStyle: s
480
+ };
481
+ if (!_(n) && e.options.length === 0) return c === void 0 ? /* @__PURE__ */ x(d, {
482
+ className: "bsy-select-empty",
483
+ text: l("noDataFound")
484
+ }) : c;
485
+ switch (i) {
486
+ case F.SINGLE: return /* @__PURE__ */ x(Y, {
487
+ ...e,
488
+ value: u,
489
+ fieldNames: m,
490
+ onSelect: v,
491
+ optionRender: o
492
+ });
493
+ case F.MULTIPLE: return /* @__PURE__ */ x(X, {
494
+ ...e,
495
+ value: u,
496
+ fieldNames: m,
497
+ onSelect: y,
498
+ optionRender: o
499
+ });
500
+ case F.TREE: return /* @__PURE__ */ x(Z, {
501
+ ...e,
502
+ value: u,
503
+ fieldNames: m,
504
+ onSelect: S
505
+ });
506
+ default: return null;
507
+ }
508
+ })() });
509
+ }, Se = (e) => {
510
+ let { options: t = [], type: n = F.SINGLE, filterOption: i = !0, onSearch: a, showSearch: o, searchPlaceholder: c, onPopupScroll: l, notFoundContent: u, themeStyle: p } = e, { t: m } = r(), { searchValue: h = "", setSearchValue: g } = I(), _ = k(h), v = (e) => {
511
+ g?.(e), a?.(e);
512
+ }, y = () => e.fetching ? /* @__PURE__ */ x(d, {
513
+ className: "bsy-select-empty",
514
+ text: m("dataSearching")
515
+ }) : t.length === 0 && !h ? u === void 0 ? /* @__PURE__ */ x(d, {
516
+ className: "bsy-select-empty",
517
+ text: m("noData")
518
+ }) : u : /* @__PURE__ */ x(xe, {
519
+ searchValue: _,
520
+ options: t,
521
+ type: n,
522
+ filterOption: i,
523
+ optionRender: e.optionRender,
524
+ optionStyle: e.optionStyle,
525
+ notFoundContent: u
526
+ }), b = D((e) => {
527
+ l?.(e);
528
+ }, [l]);
529
+ return /* @__PURE__ */ x("div", {
530
+ className: "bsy-select-panel",
531
+ style: p,
532
+ children: /* @__PURE__ */ S(C, { children: [o && /* @__PURE__ */ x(s, {
533
+ value: h,
534
+ onChange: v,
535
+ searchPlaceholder: c
536
+ }), /* @__PURE__ */ x("div", {
537
+ className: M({ "pt-[4px]": o }),
538
+ children: /* @__PURE__ */ x(f, {
539
+ style: { maxHeight: 300 },
540
+ onScroll: b,
541
+ children: y()
542
+ })
543
+ })] })
544
+ });
545
+ };
546
+ Se.displayName = "BsySelectPanel";
547
+ //#endregion
548
+ //#region src/components/Select/Select.tsx
549
+ var $ = T((e, i) => {
550
+ let { options: s = [], type: c = F.SINGLE, fieldNames: l, clearable: u = !0, disabled: d = !1, placeholder: f, labelRender: h, onOtherInputChange: g, onOpenChange: _, onPopupScroll: v, prefix: y, suffixIcon: b, ghost: C, inputValueStyle: w, tagStyle: T, zIndex: E, zIndexMask: O, otherInputPosition: k = "bottom", getPopupContainer: ne, theme: ie } = e, oe = Number.parseFloat(e.popupMinWidth ?? ""), ue = e.popupMatchSelectWidth ?? (Number.isFinite(oe) ? oe : !0), I = de[c], L = t(E), R = O ?? L - 1, { t: z } = r(), B = ee(), { onChange: V } = e, H = l || fe, [U, ge] = ae(e, {
551
+ defaultValue: I === P.SINGLE ? void 0 : [],
552
+ defaultValuePropName: "defaultValue",
553
+ valuePropName: "value",
554
+ trigger: "__NO_CUSTOM_CHANGE__"
555
+ }), [_e, ve] = re(""), W = j(/* @__PURE__ */ new Map()), [G, K] = re(() => {
556
+ if (I === P.SINGLE) {
557
+ let e = s.every((e) => e[H.value] !== U), t = s.find((e) => e.isOther === !0);
558
+ return e && t ? U : void 0;
559
+ }
560
+ }), q = D((e, t) => {
561
+ if (ge(e), t) {
562
+ let n = /* @__PURE__ */ new Map();
563
+ if (Array.isArray(e)) {
564
+ let r = Array.isArray(t) ? t : [];
565
+ e.forEach((e) => {
566
+ let t = r.find((t) => t?.[H.value] === e);
567
+ e !== null && t && n.set(e, t);
568
+ });
569
+ } else e !== null && !Array.isArray(t) && n.set(e, t);
570
+ W.current = n;
571
+ }
572
+ V && V(e, t);
573
+ }, [
574
+ V,
575
+ ge,
576
+ H
577
+ ]), [J, { set: Y }] = se(!1), X = D((e) => {
578
+ e !== J && (Y(e), _?.(e));
579
+ }, [
580
+ Y,
581
+ _,
582
+ J
583
+ ]), { isSelectedOtherOption: Z, shouldShowOtherInput: be } = A(() => {
584
+ if (I === P.MULTIPLE) return {
585
+ isSelectedOtherOption: !1,
586
+ shouldShowOtherInput: !1
587
+ };
588
+ let e = s.find((e) => e[H.value] === U);
589
+ return e ? {
590
+ isSelectedOtherOption: e.isOther === !0,
591
+ shouldShowOtherInput: e.isOther === !0
592
+ } : s.find((e) => e.isOther === !0) && U ? {
593
+ isSelectedOtherOption: !0,
594
+ shouldShowOtherInput: !0
595
+ } : {
596
+ isSelectedOtherOption: !1,
597
+ shouldShowOtherInput: !1
598
+ };
599
+ }, [
600
+ U,
601
+ s,
602
+ H,
603
+ I
604
+ ]), Q = D(() => {
605
+ if (U) {
606
+ if (I === P.SINGLE) {
607
+ let e = s.every((e) => e[H.value] !== U), t = s.find((e) => e.isOther === !0);
608
+ if (e && t) return t[H.value];
609
+ }
610
+ return U;
611
+ } else return U;
612
+ }, [
613
+ U,
614
+ s,
615
+ H,
616
+ I
617
+ ]), xe = A(() => ({
618
+ value: Q(),
619
+ setValue: q,
620
+ isOpen: J,
621
+ setIsOpen: X,
622
+ getCachedOptionByValue: (e) => W.current.get(e),
623
+ searchValue: _e,
624
+ setSearchValue: ve
625
+ }), [
626
+ Q,
627
+ q,
628
+ J,
629
+ X,
630
+ _e
631
+ ]), $ = A(() => m(ie), [ie]), Ce = A(() => ({
632
+ fieldNames: l || fe,
633
+ disabled: d,
634
+ otherInputPosition: k
635
+ }), [
636
+ l,
637
+ d,
638
+ k
639
+ ]), we = A(() => ({
640
+ isSelectedOtherOption: Z,
641
+ otherOptionValue: G,
642
+ setOtherOptionValue: K,
643
+ onOtherInputChange: g
644
+ }), [
645
+ Z,
646
+ G,
647
+ K,
648
+ g
649
+ ]), { refs: Te, floatingStyles: Ee, getReferenceProps: De, getFloatingProps: Oe, referenceStyle: ke } = p({
650
+ isOpen: J,
651
+ close: () => {
652
+ X(!1);
653
+ },
654
+ showMask: e.showMask,
655
+ zIndex: L,
656
+ zIndexMask: R,
657
+ popupMatchSelectWidth: ue,
658
+ offset: {
659
+ x: 0,
660
+ y: 4
661
+ }
662
+ }), { portalRoot: Ae, portalMountKey: je, handleExitComplete: Me } = o(J, ne), Ne = D(() => {
663
+ Z && (K(""), g?.("")), X(!1), W.current.clear(), q(I === P.SINGLE ? void 0 : []);
664
+ }, [
665
+ Z,
666
+ g,
667
+ q,
668
+ I,
669
+ X
670
+ ]);
671
+ return te(i, () => ({
672
+ getOtherOptionValue: () => G,
673
+ setOtherOptionValue: (e) => {
674
+ K(e), g?.(e);
675
+ }
676
+ }), [G, g]), /* @__PURE__ */ x(pe.Provider, {
677
+ value: xe,
678
+ children: /* @__PURE__ */ x(me.Provider, {
679
+ value: Ce,
680
+ children: /* @__PURE__ */ x(he.Provider, {
681
+ value: we,
682
+ children: /* @__PURE__ */ S("div", {
683
+ className: M("bsy-select-container text-sm", e.className),
684
+ style: {
685
+ ...$,
686
+ ...e.style
687
+ },
688
+ children: [
689
+ /* @__PURE__ */ x("div", {
690
+ ref: Te.setReference,
691
+ className: M("bsy-select-input-event", e.inputClassName),
692
+ ...De(),
693
+ style: ke,
694
+ onClick: () => {
695
+ e.disabled || X(!J);
696
+ },
697
+ role: "combobox",
698
+ "aria-expanded": J,
699
+ "aria-haspopup": "listbox",
700
+ "aria-controls": B,
701
+ "aria-disabled": d,
702
+ children: /* @__PURE__ */ x(ye, {
703
+ mode: I,
704
+ clearable: u,
705
+ disabled: d,
706
+ placeholder: f || z("select"),
707
+ labelRender: h,
708
+ options: s,
709
+ type: c,
710
+ prefix: y,
711
+ suffixIcon: b,
712
+ ghost: C,
713
+ inputValueStyle: w,
714
+ tagStyle: T,
715
+ onClear: Ne
716
+ })
717
+ }),
718
+ /* @__PURE__ */ S(le, {
719
+ root: Ae,
720
+ children: [J && e.showMask ? /* @__PURE__ */ x("div", {
721
+ className: "bsy-select-mask",
722
+ style: { zIndex: R }
723
+ }) : null, /* @__PURE__ */ x(n, {
724
+ zIndex: L,
725
+ children: /* @__PURE__ */ x(ce, {
726
+ onExitComplete: Me,
727
+ children: J ? /* @__PURE__ */ x(N.div, {
728
+ ref: Te.setFloating,
729
+ style: {
730
+ ...Ee,
731
+ zIndex: L
732
+ },
733
+ ...Oe(),
734
+ id: B,
735
+ ...a,
736
+ children: /* @__PURE__ */ x(Se, {
737
+ ...e,
738
+ options: s,
739
+ onPopupScroll: v,
740
+ themeStyle: $
741
+ })
742
+ }, "bsy-select-panel") : null
743
+ })
744
+ })]
745
+ }, je),
746
+ be && k === "bottom" ? e.otherOptionRender ? e.otherOptionRender(G, s) : /* @__PURE__ */ x("div", {
747
+ className: "bsy-select-other-input",
748
+ children: /* @__PURE__ */ x("input", {
749
+ value: G || "",
750
+ onChange: (e) => {
751
+ K(e.target.value), g?.(e.target.value);
752
+ },
753
+ className: "w-full outline-none border-none",
754
+ placeholder: z("context"),
755
+ "aria-label": z("otherOptionInput"),
756
+ role: "textbox"
757
+ })
758
+ }) : null
759
+ ]
760
+ })
761
+ })
762
+ })
763
+ });
764
+ });
765
+ $.displayName = "BsySelect";
766
+ //#endregion
767
+ export { P as n, F as r, $ as t };