impact-nova 1.7.2 → 1.7.4
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/components/ui/accordion.d.ts +5 -0
- package/dist/components/ui/accordion.js +51 -39
- package/dist/components/ui/ag-grid-react/headers/header-search-input.js +207 -209
- package/dist/components/ui/ag-grid-react/headers/utils/filter-utils.js +58 -47
- package/dist/components/ui/ag-grid-react/index.js +86 -84
- package/dist/components/ui/ag-grid-react/theme.js +3 -0
- package/dist/components/ui/data-table/data-table-column-list.js +84 -78
- package/dist/components/ui/expandable-sku/expandable-sku.d.ts +38 -0
- package/dist/components/ui/expandable-sku/expandable-sku.js +244 -0
- package/dist/components/ui/expandable-sku/expandable-sku.types.d.ts +35 -0
- package/dist/components/ui/expandable-sku/index.d.ts +2 -0
- package/dist/components/ui/expandable-sku/index.js +4 -0
- package/dist/components/ui/filter-strip/filter-tag-list.d.ts +8 -1
- package/dist/components/ui/filter-strip/filter-tag-list.js +1 -0
- package/dist/components/ui/select/select.js +221 -210
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +57 -0
- package/dist/index.js +318 -300
- package/dist/lib/virtualized/index.d.ts +9 -0
- package/dist/lib/virtualized/sectioned.d.ts +37 -0
- package/dist/lib/virtualized/sectioned.js +38 -0
- package/dist/lib/virtualized/selection-counts.d.ts +14 -0
- package/dist/lib/virtualized/selection-counts.js +12 -0
- package/dist/lib/virtualized/types.d.ts +131 -0
- package/dist/lib/virtualized/useDataGrid.d.ts +15 -0
- package/dist/lib/virtualized/useDataGrid.js +12 -0
- package/dist/lib/virtualized/useDataSource.d.ts +8 -0
- package/dist/lib/virtualized/useDataSource.js +34 -0
- package/dist/lib/virtualized/useDebouncedValue.d.ts +4 -0
- package/dist/lib/virtualized/useDebouncedValue.js +11 -0
- package/dist/lib/virtualized/useRowState.d.ts +15 -0
- package/dist/lib/virtualized/useRowState.js +127 -0
- package/dist/lib/virtualized/useVirtualizedList.d.ts +72 -0
- package/dist/lib/virtualized/useVirtualizedList.js +155 -0
- package/dist/lib/virtualized/useVirtualizedRows.d.ts +22 -0
- package/dist/lib/virtualized/useVirtualizedRows.js +27 -0
- package/package.json +23 -1
- package/tailwind.config.js +2 -0
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
import { jsxs as g, jsx as a, Fragment as pt } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
import * as
|
|
2
|
+
import { useState as K, useRef as z, useEffect as L } from "react";
|
|
3
|
+
import * as ne from "@radix-ui/react-popover";
|
|
4
4
|
import { useVirtualizer as mt } from "@tanstack/react-virtual";
|
|
5
5
|
import ht from "./components/LabelWithSequence.js";
|
|
6
6
|
import xt from "./components/Submenu.js";
|
|
7
7
|
import { LoadingSpinner as gt, Cross as bt, ChevronRight as $e, Search as vt, Info as xe } from "../../../icons/index.js";
|
|
8
8
|
import { Checkbox as Ge } from "../checkbox.js";
|
|
9
|
-
import { Button as
|
|
10
|
-
import { cn as
|
|
11
|
-
import { isInvertedSelection as T, isOptionArray as w, isSelected as
|
|
9
|
+
import { Button as yt } from "../button.js";
|
|
10
|
+
import { cn as A } from "../../../lib/utils.js";
|
|
11
|
+
import { isInvertedSelection as T, isOptionArray as w, isSelected as St, getSequence as wt, getLeafOptions as Vt } from "./utils/select.js";
|
|
12
12
|
import { useFlattenOptions as Nt } from "./hooks/useFlattenOptions.js";
|
|
13
13
|
import { useSelectionModel as kt } from "./hooks/useSelectionModel.js";
|
|
14
14
|
import { useVisibleStats as Dt } from "./hooks/useVisibleStats.js";
|
|
15
15
|
import { useImpactNovaI18n as Pt } from "../../../i18n/ImpactNovaI18nContext.js";
|
|
16
|
-
const
|
|
16
|
+
const At = (ge) => {
|
|
17
17
|
const {
|
|
18
|
-
options:
|
|
19
|
-
value:
|
|
18
|
+
options: F,
|
|
19
|
+
value: se,
|
|
20
20
|
defaultValue: Me,
|
|
21
21
|
onChange: u,
|
|
22
22
|
isMulti: f,
|
|
23
23
|
isDisabled: V,
|
|
24
|
-
isLoading:
|
|
24
|
+
isLoading: I,
|
|
25
25
|
isClearable: ze = !0,
|
|
26
|
-
isSearchable:
|
|
26
|
+
isSearchable: E = !0,
|
|
27
27
|
placeholder: Le,
|
|
28
28
|
// menuPortalTarget is kept for API compatibility but no longer used (Radix handles portalling)
|
|
29
|
-
menuPortalTarget:
|
|
30
|
-
autoFocus:
|
|
31
|
-
closeMenuOnSelect:
|
|
29
|
+
menuPortalTarget: Ot,
|
|
30
|
+
autoFocus: Fe,
|
|
31
|
+
closeMenuOnSelect: Re = !f,
|
|
32
32
|
defaultMenuIsOpen: He = !1,
|
|
33
33
|
scrollToSelectedOnOpen: be = !1,
|
|
34
34
|
maxSelectableOptions: x,
|
|
35
35
|
showSequence: ve,
|
|
36
36
|
selectionOrder: je,
|
|
37
|
-
label:
|
|
38
|
-
isRequired:
|
|
39
|
-
error:
|
|
40
|
-
helperText:
|
|
37
|
+
label: R,
|
|
38
|
+
isRequired: qe,
|
|
39
|
+
error: ye,
|
|
40
|
+
helperText: Se,
|
|
41
41
|
id: N,
|
|
42
|
-
className:
|
|
42
|
+
className: _e,
|
|
43
43
|
parentClassName: Be,
|
|
44
|
-
onMenuScrollToBottom:
|
|
44
|
+
onMenuScrollToBottom: ie,
|
|
45
45
|
name: Ke,
|
|
46
|
-
isSelectAllEnabled:
|
|
47
|
-
isReadOnly:
|
|
48
|
-
searchPosition:
|
|
46
|
+
isSelectAllEnabled: Y = !0,
|
|
47
|
+
isReadOnly: m = !1,
|
|
48
|
+
searchPosition: $ = "menu",
|
|
49
49
|
footerContent: we,
|
|
50
50
|
onInputChange: Ue,
|
|
51
51
|
getOptionLabel: Ve,
|
|
@@ -60,65 +60,72 @@ const Ot = (ge) => {
|
|
|
60
60
|
stringify: Qe,
|
|
61
61
|
trim: Ze,
|
|
62
62
|
filterOption: et,
|
|
63
|
-
enableSubMenus:
|
|
63
|
+
enableSubMenus: y = !1,
|
|
64
64
|
enableGroups: k = !1,
|
|
65
|
-
fetchError:
|
|
66
|
-
onRefetch:
|
|
65
|
+
fetchError: H,
|
|
66
|
+
onRefetch: Ae,
|
|
67
67
|
menuWidth: tt,
|
|
68
|
-
onClearAll:
|
|
68
|
+
onClearAll: Oe,
|
|
69
69
|
onFocus: lt,
|
|
70
70
|
onBlur: nt
|
|
71
|
-
} = ge, { t:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}, [
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
e && clearTimeout(e);
|
|
71
|
+
} = ge, { t: U } = Pt(), re = Le ?? U("select.placeholder"), [b, Ce] = K(He), [G, J] = K(""), [Ie, ae] = K(void 0), [d, v] = K(Me || (f ? [] : null)), [st, oe] = K(null), W = -2, [D, C] = K(-1), ce = z(!1), ue = z(null), de = z(null), it = z(null), X = z(null), j = z(null);
|
|
72
|
+
L(() => {
|
|
73
|
+
se !== void 0 && v(se);
|
|
74
|
+
}, [se]), L(() => {
|
|
75
|
+
if (!(b && E && $ === "menu")) return;
|
|
76
|
+
let e = !1;
|
|
77
|
+
const t = () => {
|
|
78
|
+
!e && j.current && j.current.focus();
|
|
80
79
|
};
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
requestAnimationFrame(t);
|
|
81
|
+
const l = setTimeout(t, 50);
|
|
82
|
+
return () => {
|
|
83
|
+
e = !0, clearTimeout(l);
|
|
84
|
+
};
|
|
85
|
+
}, [b, E, $]);
|
|
86
|
+
const { flatOptions: p, isProcessing: O, totalOptionsCount: Te, workerSelectAll: rt } = Nt(F, G, {
|
|
83
87
|
ignoreCase: Xe,
|
|
84
88
|
ignoreAccents: Ye,
|
|
85
89
|
matchFrom: Je,
|
|
86
90
|
stringify: Qe,
|
|
87
91
|
trim: Ze,
|
|
88
92
|
filterOption: et,
|
|
89
|
-
enableSubMenus:
|
|
93
|
+
enableSubMenus: y,
|
|
90
94
|
enableGroups: k
|
|
91
|
-
}),
|
|
95
|
+
}), S = kt(d, f ?? !1), { stats: q, getGroupStats: fe } = Dt(
|
|
92
96
|
p,
|
|
93
97
|
Te,
|
|
94
|
-
|
|
95
|
-
|
|
98
|
+
G,
|
|
99
|
+
S,
|
|
96
100
|
d,
|
|
97
101
|
f ?? !1
|
|
98
102
|
), P = mt({
|
|
99
103
|
count: p.length,
|
|
100
|
-
getScrollElement: () =>
|
|
104
|
+
getScrollElement: () => X.current,
|
|
101
105
|
estimateSize: () => 34,
|
|
102
106
|
overscan: 5
|
|
103
107
|
});
|
|
104
|
-
|
|
108
|
+
L(() => {
|
|
105
109
|
if (!b)
|
|
106
|
-
|
|
107
|
-
else if (
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
110
|
+
ae(void 0), C(-1);
|
|
111
|
+
else if (ce.current)
|
|
112
|
+
if (ce.current = !1, E && $ === "menu" && !m)
|
|
113
|
+
C(-1);
|
|
114
|
+
else {
|
|
115
|
+
const e = !I && !O && !H && f && Y && !m && p.length > 0;
|
|
116
|
+
C(e ? W : 0);
|
|
117
|
+
}
|
|
118
|
+
}, [b]), L(() => {
|
|
119
|
+
D !== -1 && C(0);
|
|
120
|
+
}, [G]), L(() => {
|
|
114
121
|
if (!b) return;
|
|
115
122
|
const e = requestAnimationFrame(() => {
|
|
116
123
|
P.measure();
|
|
117
124
|
});
|
|
118
125
|
return () => cancelAnimationFrame(e);
|
|
119
|
-
}, [b, P]),
|
|
120
|
-
if (b && be && !
|
|
121
|
-
const e = p.findIndex((t) => f ?
|
|
126
|
+
}, [b, P]), L(() => {
|
|
127
|
+
if (b && be && !O && p.length > 0) {
|
|
128
|
+
const e = p.findIndex((t) => f ? S.mode === "exclude" ? !S.set.has(t.value) : S.set.has(t.value) : d?.value === t.value);
|
|
122
129
|
if (e !== -1) {
|
|
123
130
|
const t = setTimeout(() => {
|
|
124
131
|
P.scrollToIndex(e, { align: "center" });
|
|
@@ -126,57 +133,57 @@ const Ot = (ge) => {
|
|
|
126
133
|
return () => clearTimeout(t);
|
|
127
134
|
}
|
|
128
135
|
}
|
|
129
|
-
}, [b, be,
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
if (!
|
|
136
|
+
}, [b, be, O, p.length, f, S.mode, S.set, d, P]);
|
|
137
|
+
const _ = z(null);
|
|
138
|
+
L(() => {
|
|
139
|
+
if (!X.current || !ie) return;
|
|
133
140
|
const e = () => {
|
|
134
|
-
if (
|
|
135
|
-
const { scrollTop: l, scrollHeight: s, clientHeight: n } =
|
|
141
|
+
if (I || O) return;
|
|
142
|
+
const { scrollTop: l, scrollHeight: s, clientHeight: n } = X.current;
|
|
136
143
|
if (s - l - n <= 10) {
|
|
137
|
-
if (
|
|
138
|
-
|
|
139
|
-
|
|
144
|
+
if (_.current) return;
|
|
145
|
+
ie(), _.current = setTimeout(() => {
|
|
146
|
+
_.current = null;
|
|
140
147
|
}, 500);
|
|
141
148
|
}
|
|
142
|
-
}, t =
|
|
143
|
-
return t.addEventListener("scroll", e), !
|
|
144
|
-
t.removeEventListener("scroll", e),
|
|
149
|
+
}, t = X.current;
|
|
150
|
+
return t.addEventListener("scroll", e), !I && !O && e(), () => {
|
|
151
|
+
t.removeEventListener("scroll", e), _.current && (clearTimeout(_.current), _.current = null);
|
|
145
152
|
};
|
|
146
153
|
}, [
|
|
147
|
-
|
|
154
|
+
ie,
|
|
148
155
|
p.length,
|
|
149
156
|
b,
|
|
150
|
-
|
|
151
|
-
|
|
157
|
+
I,
|
|
158
|
+
O
|
|
152
159
|
]);
|
|
153
|
-
const
|
|
160
|
+
const Q = (e) => {
|
|
154
161
|
if (!V)
|
|
155
162
|
if (Ce(e), e)
|
|
156
163
|
We?.();
|
|
157
164
|
else {
|
|
158
165
|
const t = d, l = f && w(d) ? d.map((s) => s.value) : void 0;
|
|
159
|
-
ke?.(t, l),
|
|
166
|
+
ke?.(t, l), J(""), oe(null);
|
|
160
167
|
}
|
|
161
|
-
},
|
|
162
|
-
if (!(V ||
|
|
168
|
+
}, Z = (e) => {
|
|
169
|
+
if (!(V || m || e.isDisabled || ("children" in e || "options" in e) && e.isParentSelectable === !1))
|
|
163
170
|
if (f) {
|
|
164
171
|
const l = d || [];
|
|
165
172
|
if ("children" in e || "options" in e) {
|
|
166
173
|
const n = Vt(
|
|
167
174
|
e,
|
|
168
|
-
|
|
175
|
+
y,
|
|
169
176
|
k
|
|
170
177
|
).filter((i) => !i.isDisabled);
|
|
171
178
|
if (T(l)) {
|
|
172
179
|
const i = l.excludedValues, r = n.every(
|
|
173
|
-
(
|
|
180
|
+
(h) => !i.includes(h.value)
|
|
174
181
|
);
|
|
175
182
|
let c = [...i];
|
|
176
|
-
r ? n.forEach((
|
|
177
|
-
c.includes(
|
|
183
|
+
r ? n.forEach((h) => {
|
|
184
|
+
c.includes(h.value) || c.push(h.value);
|
|
178
185
|
}) : c = c.filter(
|
|
179
|
-
(
|
|
186
|
+
(h) => !n.some((te) => te.value === h)
|
|
180
187
|
);
|
|
181
188
|
const o = {
|
|
182
189
|
isAllSelected: !0,
|
|
@@ -188,13 +195,13 @@ const Ot = (ge) => {
|
|
|
188
195
|
});
|
|
189
196
|
} else if (w(l)) {
|
|
190
197
|
const i = l, r = n.every(
|
|
191
|
-
(o) => i.some((
|
|
198
|
+
(o) => i.some((h) => h.value === o.value)
|
|
192
199
|
);
|
|
193
200
|
let c = [...i];
|
|
194
201
|
if (r ? c = c.filter(
|
|
195
|
-
(o) => !n.some((
|
|
202
|
+
(o) => !n.some((h) => h.value === o.value)
|
|
196
203
|
) : n.forEach((o) => {
|
|
197
|
-
c.some((
|
|
204
|
+
c.some((h) => h.value === o.value) || c.push(o);
|
|
198
205
|
}), x && c.length > x)
|
|
199
206
|
return;
|
|
200
207
|
v(c), u && u(c, {
|
|
@@ -215,7 +222,7 @@ const Ot = (ge) => {
|
|
|
215
222
|
option: e
|
|
216
223
|
});
|
|
217
224
|
} else if (w(l)) {
|
|
218
|
-
const s = l, n = f ?
|
|
225
|
+
const s = l, n = f ? S.mode === "exclude" ? !S.set.has(e.value) : S.set.has(e.value) : d?.value === e.value;
|
|
219
226
|
let i = [];
|
|
220
227
|
if (n)
|
|
221
228
|
i = s.filter((r) => r.value !== e.value);
|
|
@@ -233,10 +240,10 @@ const Ot = (ge) => {
|
|
|
233
240
|
v(e), u && u(e, {
|
|
234
241
|
action: "select-option",
|
|
235
242
|
option: e
|
|
236
|
-
}),
|
|
243
|
+
}), Re && (Ce(!1), ke?.(e, void 0), J(""));
|
|
237
244
|
}, pe = async () => {
|
|
238
|
-
if (!(!f || V ||
|
|
239
|
-
if (
|
|
245
|
+
if (!(!f || V || m)) {
|
|
246
|
+
if (F.length > 3e3) {
|
|
240
247
|
try {
|
|
241
248
|
const e = await rt(
|
|
242
249
|
d,
|
|
@@ -248,7 +255,7 @@ const Ot = (ge) => {
|
|
|
248
255
|
}
|
|
249
256
|
return;
|
|
250
257
|
}
|
|
251
|
-
if (
|
|
258
|
+
if (G) {
|
|
252
259
|
let e = !1;
|
|
253
260
|
for (const l of p)
|
|
254
261
|
if (!l.isGroup && !l.isSubmenuParent && !l.isDisabled) {
|
|
@@ -259,16 +266,16 @@ const Ot = (ge) => {
|
|
|
259
266
|
return;
|
|
260
267
|
const t = d || [];
|
|
261
268
|
if (T(t)) {
|
|
262
|
-
const l = t.excludedValues, { totalVisible: s, selectedVisible: n } =
|
|
269
|
+
const l = t.excludedValues, { totalVisible: s, selectedVisible: n } = q, i = s > 0 && s === n;
|
|
263
270
|
let r = [...l];
|
|
264
271
|
if (i)
|
|
265
272
|
for (const o of p)
|
|
266
273
|
!o.isGroup && !o.isSubmenuParent && !o.isDisabled && (r.includes(o.value) || r.push(o.value));
|
|
267
274
|
else {
|
|
268
275
|
const o = /* @__PURE__ */ new Set();
|
|
269
|
-
for (const
|
|
270
|
-
!
|
|
271
|
-
r = r.filter((
|
|
276
|
+
for (const h of p)
|
|
277
|
+
!h.isGroup && !h.isSubmenuParent && !h.isDisabled && o.add(h.value);
|
|
278
|
+
r = r.filter((h) => !o.has(h));
|
|
272
279
|
}
|
|
273
280
|
const c = {
|
|
274
281
|
isAllSelected: !0,
|
|
@@ -276,7 +283,7 @@ const Ot = (ge) => {
|
|
|
276
283
|
};
|
|
277
284
|
v(c), u && u(c, { action: "select-option" });
|
|
278
285
|
} else if (w(t)) {
|
|
279
|
-
const l = t, { totalVisible: s, selectedVisible: n } =
|
|
286
|
+
const l = t, { totalVisible: s, selectedVisible: n } = q, i = s > 0 && s === n;
|
|
280
287
|
let r = [...l];
|
|
281
288
|
if (i) {
|
|
282
289
|
const c = /* @__PURE__ */ new Set();
|
|
@@ -293,7 +300,7 @@ const Ot = (ge) => {
|
|
|
293
300
|
v(r), u && u(r, { action: "select-option" });
|
|
294
301
|
}
|
|
295
302
|
} else if (x) {
|
|
296
|
-
const e = d, { totalVisible: t } =
|
|
303
|
+
const e = d, { totalVisible: t } = q, l = w(e) ? e.length : 0, s = Math.min(t, x);
|
|
297
304
|
if (w(e) && l >= s && l > 0) {
|
|
298
305
|
const n = e.filter((i) => i.isDisabled);
|
|
299
306
|
v(n), u && u(n, {
|
|
@@ -329,7 +336,7 @@ const Ot = (ge) => {
|
|
|
329
336
|
v(s), u && u(s, { action: "select-option" });
|
|
330
337
|
}
|
|
331
338
|
else {
|
|
332
|
-
const { totalVisible: l, selectedVisible: s } =
|
|
339
|
+
const { totalVisible: l, selectedVisible: s } = q;
|
|
333
340
|
if (l > 0 && l === s) {
|
|
334
341
|
const n = w(e) ? e.filter((i) => i.isDisabled) : [];
|
|
335
342
|
v(n), u && u(n, {
|
|
@@ -347,7 +354,7 @@ const Ot = (ge) => {
|
|
|
347
354
|
}
|
|
348
355
|
}
|
|
349
356
|
}, at = (e) => {
|
|
350
|
-
if (e.stopPropagation(), !
|
|
357
|
+
if (e.stopPropagation(), !m)
|
|
351
358
|
if (f) {
|
|
352
359
|
const t = [], l = (n) => {
|
|
353
360
|
for (const i of n) {
|
|
@@ -357,17 +364,17 @@ const Ot = (ge) => {
|
|
|
357
364
|
);
|
|
358
365
|
continue;
|
|
359
366
|
}
|
|
360
|
-
if (
|
|
367
|
+
if (y && "children" in i && Array.isArray(i.children)) {
|
|
361
368
|
l(i.children);
|
|
362
369
|
continue;
|
|
363
370
|
}
|
|
364
371
|
const r = i;
|
|
365
|
-
r.isDisabled && (
|
|
372
|
+
r.isDisabled && (S.mode === "exclude" ? !S.set.has(r.value) : S.set.has(r.value)) && t.push(r);
|
|
366
373
|
}
|
|
367
374
|
};
|
|
368
|
-
l(
|
|
375
|
+
l(F);
|
|
369
376
|
const s = t;
|
|
370
|
-
v(s), u && u(s, { action: "clear" }),
|
|
377
|
+
v(s), u && u(s, { action: "clear" }), Oe?.();
|
|
371
378
|
} else {
|
|
372
379
|
const t = d;
|
|
373
380
|
if (t) {
|
|
@@ -381,7 +388,7 @@ const Ot = (ge) => {
|
|
|
381
388
|
), s) return;
|
|
382
389
|
continue;
|
|
383
390
|
}
|
|
384
|
-
if (
|
|
391
|
+
if (y && "children" in r && Array.isArray(r.children)) {
|
|
385
392
|
if (n(
|
|
386
393
|
r.children
|
|
387
394
|
), s) return;
|
|
@@ -394,11 +401,11 @@ const Ot = (ge) => {
|
|
|
394
401
|
}
|
|
395
402
|
}
|
|
396
403
|
};
|
|
397
|
-
if (n(
|
|
404
|
+
if (n(F), s?.isDisabled)
|
|
398
405
|
return;
|
|
399
406
|
}
|
|
400
407
|
const l = null;
|
|
401
|
-
v(l), u && u(l, { action: "clear" }),
|
|
408
|
+
v(l), u && u(l, { action: "clear" }), Oe?.();
|
|
402
409
|
}
|
|
403
410
|
}, ot = (e) => wt(
|
|
404
411
|
e,
|
|
@@ -406,15 +413,19 @@ const Ot = (ge) => {
|
|
|
406
413
|
f ?? !1,
|
|
407
414
|
je,
|
|
408
415
|
d
|
|
409
|
-
),
|
|
416
|
+
), ee = (e) => Ve ? Ve(e) : e.label, Ee = () => {
|
|
410
417
|
const e = [];
|
|
411
|
-
return !
|
|
412
|
-
!l.isGroup && !(
|
|
418
|
+
return !I && !O && !H && f && Y && !m && p.length > 0 && e.push(W), p.forEach((l, s) => {
|
|
419
|
+
!l.isGroup && !(y && l.isSubmenuParent) && !l.isDisabled && e.push(s);
|
|
413
420
|
}), e;
|
|
414
421
|
}, ct = (e) => {
|
|
415
|
-
if (V ||
|
|
422
|
+
if (V || m) return;
|
|
416
423
|
if (!b) {
|
|
417
|
-
(e.key === "Enter" || e.key === " " || e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(),
|
|
424
|
+
(e.key === "Enter" || e.key === " " || e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), ce.current = !0, Q(!0));
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
if (E && $ === "menu" && !m && j.current) {
|
|
428
|
+
document.activeElement !== j.current && j.current.focus();
|
|
418
429
|
return;
|
|
419
430
|
}
|
|
420
431
|
const t = Ee();
|
|
@@ -423,25 +434,25 @@ const Ot = (ge) => {
|
|
|
423
434
|
if (e.key === "ArrowDown") {
|
|
424
435
|
e.preventDefault();
|
|
425
436
|
const s = l < t.length - 1 ? l + 1 : 0, n = t[s];
|
|
426
|
-
|
|
437
|
+
C(n), n >= 0 && P.scrollToIndex(n, { align: "auto" });
|
|
427
438
|
} else if (e.key === "ArrowUp") {
|
|
428
439
|
e.preventDefault();
|
|
429
440
|
const s = l > 0 ? l - 1 : t.length - 1, n = t[s];
|
|
430
|
-
|
|
441
|
+
C(n), n >= 0 && P.scrollToIndex(n, { align: "auto" });
|
|
431
442
|
} else if (e.key === "Enter" || e.key === " ") {
|
|
432
|
-
if (e.preventDefault(), D ===
|
|
443
|
+
if (e.preventDefault(), D === W)
|
|
433
444
|
pe();
|
|
434
445
|
else if (D >= 0 && D < p.length) {
|
|
435
446
|
const s = p[D];
|
|
436
|
-
s.isDisabled ||
|
|
447
|
+
s.isDisabled || Z(s);
|
|
437
448
|
}
|
|
438
449
|
} else if (e.key === "Escape")
|
|
439
|
-
e.preventDefault(),
|
|
450
|
+
e.preventDefault(), Q(!1), ue.current?.focus();
|
|
440
451
|
else if (e.key === "Home")
|
|
441
|
-
e.preventDefault(), t.length > 0 && (
|
|
452
|
+
e.preventDefault(), t.length > 0 && (C(t[0]), t[0] >= 0 && P.scrollToIndex(t[0], { align: "auto" }));
|
|
442
453
|
else if (e.key === "End" && (e.preventDefault(), t.length > 0)) {
|
|
443
454
|
const s = t[t.length - 1];
|
|
444
|
-
|
|
455
|
+
C(s), s >= 0 && P.scrollToIndex(s, { align: "auto" });
|
|
445
456
|
}
|
|
446
457
|
}, ut = (e) => {
|
|
447
458
|
const t = Ee();
|
|
@@ -450,33 +461,33 @@ const Ot = (ge) => {
|
|
|
450
461
|
if (e.key === "ArrowDown") {
|
|
451
462
|
e.preventDefault();
|
|
452
463
|
const s = l < t.length - 1 ? l + 1 : 0, n = t[s];
|
|
453
|
-
|
|
464
|
+
C(n), n >= 0 && P.scrollToIndex(n, { align: "auto" });
|
|
454
465
|
} else if (e.key === "ArrowUp") {
|
|
455
466
|
e.preventDefault();
|
|
456
467
|
const s = l > 0 ? l - 1 : t.length - 1, n = t[s];
|
|
457
|
-
|
|
468
|
+
C(n), n >= 0 && P.scrollToIndex(n, { align: "auto" });
|
|
458
469
|
} else if (e.key === "Enter") {
|
|
459
|
-
if (e.preventDefault(), D ===
|
|
470
|
+
if (e.preventDefault(), D === W)
|
|
460
471
|
pe();
|
|
461
472
|
else if (D >= 0 && D < p.length) {
|
|
462
473
|
const s = p[D];
|
|
463
|
-
s.isDisabled ||
|
|
474
|
+
s.isDisabled || Z(s);
|
|
464
475
|
}
|
|
465
|
-
} else e.key === "Escape" && (e.preventDefault(),
|
|
476
|
+
} else e.key === "Escape" && (e.preventDefault(), Q(!1), ue.current?.focus());
|
|
466
477
|
}, dt = () => {
|
|
467
478
|
if (f) {
|
|
468
479
|
const e = d || [];
|
|
469
480
|
let t = 0;
|
|
470
|
-
return T(e) ? t = Te - e.excludedValues.length : w(e) && (t = e.length), t === 0 ? null : t === 1 && w(e) ? /* @__PURE__ */ a("span", { className:
|
|
481
|
+
return T(e) ? t = Te - e.excludedValues.length : w(e) && (t = e.length), t === 0 ? null : t === 1 && w(e) ? /* @__PURE__ */ a("span", { className: A("text-[14px] font-medium truncate min-w-0 block", V ? "text-disabled-foreground" : "text-[#1f2b4d]"), children: ee(e[0]) }) : /* @__PURE__ */ a("span", { className: A("text-[14px] font-medium truncate min-w-0 block", V ? "text-disabled-foreground" : "text-[#1f2b4d]"), children: U("select.selectedCount", { count: t }) });
|
|
471
482
|
} else {
|
|
472
483
|
const e = d;
|
|
473
|
-
return e ? /* @__PURE__ */ a("span", { className:
|
|
484
|
+
return e ? /* @__PURE__ */ a("span", { className: A("text-[14px] font-medium truncate min-w-0 block", V ? "text-disabled-foreground" : "text-[#1f2b4d]"), children: ee(e) }) : null;
|
|
474
485
|
}
|
|
475
486
|
};
|
|
476
487
|
return /* @__PURE__ */ g(
|
|
477
488
|
"div",
|
|
478
489
|
{
|
|
479
|
-
className:
|
|
490
|
+
className: A(
|
|
480
491
|
"flex gap-[6px]",
|
|
481
492
|
De === "left" ? "w-fit flex-row items-center" : "w-full flex-col",
|
|
482
493
|
Be
|
|
@@ -484,33 +495,33 @@ const Ot = (ge) => {
|
|
|
484
495
|
"data-testid": `select-${N || "default"}`,
|
|
485
496
|
"data-component": "select",
|
|
486
497
|
children: [
|
|
487
|
-
|
|
498
|
+
R && /* @__PURE__ */ g(
|
|
488
499
|
"label",
|
|
489
500
|
{
|
|
490
|
-
className:
|
|
501
|
+
className: A(
|
|
491
502
|
"text-[12px] font-medium text-[#60697d] leading-[18px]",
|
|
492
503
|
De === "left" ? "shrink-0" : ""
|
|
493
504
|
),
|
|
494
505
|
children: [
|
|
495
|
-
|
|
506
|
+
R,
|
|
496
507
|
" ",
|
|
497
|
-
|
|
508
|
+
qe && /* @__PURE__ */ a("span", { className: "text-[red]", children: "*" })
|
|
498
509
|
]
|
|
499
510
|
}
|
|
500
511
|
),
|
|
501
|
-
/* @__PURE__ */ g(
|
|
502
|
-
/* @__PURE__ */ a(
|
|
512
|
+
/* @__PURE__ */ g(ne.Root, { open: b, onOpenChange: Q, children: [
|
|
513
|
+
/* @__PURE__ */ a(ne.Trigger, { asChild: !0, children: /* @__PURE__ */ a(
|
|
503
514
|
"div",
|
|
504
515
|
{
|
|
505
|
-
ref:
|
|
506
|
-
className:
|
|
516
|
+
ref: ue,
|
|
517
|
+
className: A(
|
|
507
518
|
"relative h-[32px] w-full cursor-pointer rounded-[8px] border border-solid px-3 py-1 text-left shadow-sm sm:text-sm transition-all flex items-center overflow-hidden",
|
|
508
|
-
|
|
519
|
+
ye ? "border-[#e15554] focus-visible:ring-[#e15554]" : "border-[#c3c8d4] hover:border-gray-400 focus-visible:border-indigo-500 focus-visible:ring-1 focus-visible:ring-indigo-500",
|
|
509
520
|
V ? "bg-[#f2f4fb] cursor-not-allowed opacity-75" : "",
|
|
510
|
-
|
|
521
|
+
m ? "cursor-default bg-[#f2f4fb]" : "",
|
|
511
522
|
b ? "ring-1 ring-indigo-500 border-indigo-500" : "",
|
|
512
|
-
!V && !
|
|
513
|
-
|
|
523
|
+
!V && !m && "bg-white",
|
|
524
|
+
_e
|
|
514
525
|
),
|
|
515
526
|
id: N,
|
|
516
527
|
tabIndex: V ? -1 : 0,
|
|
@@ -519,7 +530,7 @@ const Ot = (ge) => {
|
|
|
519
530
|
role: "combobox",
|
|
520
531
|
"aria-expanded": b,
|
|
521
532
|
"aria-haspopup": "listbox",
|
|
522
|
-
"aria-label":
|
|
533
|
+
"aria-label": R ? String(R) : re,
|
|
523
534
|
"data-component": "select-trigger",
|
|
524
535
|
"data-disabled": V || void 0,
|
|
525
536
|
"data-state": b ? "open" : "closed",
|
|
@@ -538,27 +549,27 @@ const Ot = (ge) => {
|
|
|
538
549
|
className: "text-[#b4bac7] font-normal text-[14px] truncate min-w-0 block",
|
|
539
550
|
"data-testid": `select-placeholder-${N || "default"}`,
|
|
540
551
|
"data-has-value": !1,
|
|
541
|
-
children:
|
|
552
|
+
children: re
|
|
542
553
|
}
|
|
543
554
|
),
|
|
544
|
-
|
|
555
|
+
E && b && $ === "trigger" && !m && /* @__PURE__ */ a(
|
|
545
556
|
"input",
|
|
546
557
|
{
|
|
547
558
|
ref: it,
|
|
548
559
|
type: "text",
|
|
549
560
|
className: "flex-1 min-w-[50px] border-none p-0 focus:ring-0 text-sm outline-none h-full",
|
|
550
|
-
value:
|
|
551
|
-
onChange: (e) =>
|
|
561
|
+
value: G,
|
|
562
|
+
onChange: (e) => J(e.target.value),
|
|
552
563
|
onClick: (e) => e.stopPropagation(),
|
|
553
|
-
autoFocus:
|
|
564
|
+
autoFocus: Fe,
|
|
554
565
|
name: Ke || void 0
|
|
555
566
|
}
|
|
556
567
|
)
|
|
557
568
|
]
|
|
558
569
|
}
|
|
559
570
|
),
|
|
560
|
-
/* @__PURE__ */ a("div", { className: "flex items-center gap-1 text-gray-400 shrink-0", children: !b && (
|
|
561
|
-
ze && !
|
|
571
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-1 text-gray-400 shrink-0", children: !b && (I || O) ? /* @__PURE__ */ a(gt, { size: "14px" }) : /* @__PURE__ */ g(pt, { children: [
|
|
572
|
+
ze && !m && !V && (f && (T(
|
|
562
573
|
d
|
|
563
574
|
) && d.isAllSelected || w(d) && d.length > 0) || !f && d) && /* @__PURE__ */ a(
|
|
564
575
|
"div",
|
|
@@ -573,7 +584,7 @@ const Ot = (ge) => {
|
|
|
573
584
|
$e,
|
|
574
585
|
{
|
|
575
586
|
size: "16px",
|
|
576
|
-
className:
|
|
587
|
+
className: A(
|
|
577
588
|
"transition-transform duration-200",
|
|
578
589
|
b ? "-rotate-90" : "rotate-90"
|
|
579
590
|
)
|
|
@@ -583,10 +594,10 @@ const Ot = (ge) => {
|
|
|
583
594
|
] })
|
|
584
595
|
}
|
|
585
596
|
) }),
|
|
586
|
-
/* @__PURE__ */ a(
|
|
587
|
-
|
|
597
|
+
/* @__PURE__ */ a(ne.Portal, { children: /* @__PURE__ */ g(
|
|
598
|
+
ne.Content,
|
|
588
599
|
{
|
|
589
|
-
ref:
|
|
600
|
+
ref: de,
|
|
590
601
|
side: "bottom",
|
|
591
602
|
sideOffset: 4,
|
|
592
603
|
align: "start",
|
|
@@ -599,9 +610,9 @@ const Ot = (ge) => {
|
|
|
599
610
|
maxHeight: "var(--radix-popover-content-available-height)",
|
|
600
611
|
minHeight: Ie ? `${Ie}px` : void 0
|
|
601
612
|
},
|
|
602
|
-
className:
|
|
613
|
+
className: A(
|
|
603
614
|
"z-50 overflow-hidden rounded-[12px] text-base shadow-[0px_1px_6px_0px_rgba(26,39,124,0.14)] focus:outline-none sm:text-sm flex flex-col border-none pointer-events-auto",
|
|
604
|
-
|
|
615
|
+
m ? "bg-[#f5f5f5]" : "bg-white"
|
|
605
616
|
),
|
|
606
617
|
"data-testid": `select-menu-${N || "default"}`,
|
|
607
618
|
"data-component": "select-menu",
|
|
@@ -609,13 +620,13 @@ const Ot = (ge) => {
|
|
|
609
620
|
/* @__PURE__ */ g(
|
|
610
621
|
"div",
|
|
611
622
|
{
|
|
612
|
-
className:
|
|
623
|
+
className: A(
|
|
613
624
|
"flex flex-col z-10 sticky top-0 px-[6px] pt-[8px]",
|
|
614
|
-
|
|
615
|
-
!
|
|
625
|
+
m ? "bg-[#f5f5f5]" : "bg-white",
|
|
626
|
+
!H && (E && $ === "menu" && !m || f && Y && !m && p.length > 0) ? "border-b border-solid border-gray-100" : ""
|
|
616
627
|
),
|
|
617
628
|
children: [
|
|
618
|
-
|
|
629
|
+
E && $ === "menu" && !m && !H && /* @__PURE__ */ a(
|
|
619
630
|
"div",
|
|
620
631
|
{
|
|
621
632
|
className: "p-0",
|
|
@@ -625,15 +636,15 @@ const Ot = (ge) => {
|
|
|
625
636
|
/* @__PURE__ */ a(
|
|
626
637
|
"input",
|
|
627
638
|
{
|
|
628
|
-
ref:
|
|
639
|
+
ref: j,
|
|
629
640
|
type: "text",
|
|
630
|
-
className: "block w-full pl-[34px] pr-4 h-[35px] border-none border-b border-primary text-sm outline-none focus:ring-
|
|
631
|
-
placeholder:
|
|
632
|
-
value:
|
|
641
|
+
className: "block w-full pl-[34px] pr-4 h-[35px] border-none border-b border-primary text-sm outline-none focus-visible:ring-1 focus-visible:ring-indigo-500 focus-visible:rounded-md",
|
|
642
|
+
placeholder: U("select.searchHere"),
|
|
643
|
+
value: G,
|
|
633
644
|
onKeyDown: ut,
|
|
634
645
|
onChange: (e) => {
|
|
635
646
|
const t = e.target.value;
|
|
636
|
-
|
|
647
|
+
G === "" && t !== "" ? de.current && ae(de.current.offsetHeight) : t === "" && ae(void 0), J(t), Ue?.(t);
|
|
637
648
|
},
|
|
638
649
|
onClick: (e) => e.stopPropagation(),
|
|
639
650
|
"data-testid": `select-search-input-${N || "default"}`
|
|
@@ -642,7 +653,7 @@ const Ot = (ge) => {
|
|
|
642
653
|
] })
|
|
643
654
|
}
|
|
644
655
|
),
|
|
645
|
-
!
|
|
656
|
+
!I && !O && !H && f && Y && !m && p.length > 0 && /* @__PURE__ */ a(
|
|
646
657
|
"div",
|
|
647
658
|
{
|
|
648
659
|
className: "pb-1",
|
|
@@ -650,9 +661,9 @@ const Ot = (ge) => {
|
|
|
650
661
|
children: /* @__PURE__ */ a(
|
|
651
662
|
"div",
|
|
652
663
|
{
|
|
653
|
-
className:
|
|
664
|
+
className: A(
|
|
654
665
|
"flex items-center justify-between cursor-pointer rounded-md hover:bg-gray-100 transition-colors py-[6px] px-3 w-full",
|
|
655
|
-
D ===
|
|
666
|
+
D === W && "ring-2 ring-inset ring-primary bg-[#edf0ff]"
|
|
656
667
|
),
|
|
657
668
|
onClick: pe,
|
|
658
669
|
role: "option",
|
|
@@ -663,12 +674,12 @@ const Ot = (ge) => {
|
|
|
663
674
|
Ge,
|
|
664
675
|
{
|
|
665
676
|
checked: (() => {
|
|
666
|
-
const { totalVisible: e, selectedVisible: t } =
|
|
677
|
+
const { totalVisible: e, selectedVisible: t } = q;
|
|
667
678
|
if (e === 0) return !1;
|
|
668
679
|
const l = x ? Math.min(e, x) : e;
|
|
669
680
|
return t > 0 && t < l ? "indeterminate" : t >= l;
|
|
670
681
|
})(),
|
|
671
|
-
disabled: V ||
|
|
682
|
+
disabled: V || m,
|
|
672
683
|
onChange: () => {
|
|
673
684
|
},
|
|
674
685
|
"data-testid": `select-select-all-checkbox-${N || "default"}`
|
|
@@ -680,8 +691,8 @@ const Ot = (ge) => {
|
|
|
680
691
|
className: "text-sm font-medium text-gray-700",
|
|
681
692
|
"data-testid": `select-select-all-label-${N || "default"}`,
|
|
682
693
|
children: (() => {
|
|
683
|
-
const { totalVisible: e, selectedVisible: t } =
|
|
684
|
-
return
|
|
694
|
+
const { totalVisible: e, selectedVisible: t } = q, l = x ? Math.min(e, x) : e, s = e > 0 && t >= l;
|
|
695
|
+
return U(s ? "select.unselectAll" : "select.selectAll");
|
|
685
696
|
})()
|
|
686
697
|
}
|
|
687
698
|
)
|
|
@@ -696,27 +707,27 @@ const Ot = (ge) => {
|
|
|
696
707
|
/* @__PURE__ */ a(
|
|
697
708
|
"div",
|
|
698
709
|
{
|
|
699
|
-
ref:
|
|
710
|
+
ref: X,
|
|
700
711
|
role: "listbox",
|
|
701
|
-
"aria-label":
|
|
712
|
+
"aria-label": R ? String(R) : re,
|
|
702
713
|
className: "flex-1 overflow-auto py-1 px-[6px]",
|
|
703
714
|
style: {
|
|
704
715
|
maxHeight: "297px",
|
|
705
716
|
overscrollBehavior: "contain"
|
|
706
717
|
},
|
|
707
718
|
onWheel: (e) => e.stopPropagation(),
|
|
708
|
-
children:
|
|
719
|
+
children: H ? /* @__PURE__ */ g("div", { className: "flex flex-col items-center justify-center py-8 px-4 text-center", children: [
|
|
709
720
|
/* @__PURE__ */ a("p", { className: "text-sm text-gray-500 font-medium mb-3", children: "Something went wrong" }),
|
|
710
|
-
|
|
711
|
-
|
|
721
|
+
Ae && /* @__PURE__ */ a(
|
|
722
|
+
yt,
|
|
712
723
|
{
|
|
713
724
|
size: "sm",
|
|
714
725
|
variant: "outline",
|
|
715
|
-
onClick: () =>
|
|
726
|
+
onClick: () => Ae(),
|
|
716
727
|
children: "Refetch"
|
|
717
728
|
}
|
|
718
729
|
)
|
|
719
|
-
] }) : p.length === 0 && !
|
|
730
|
+
] }) : p.length === 0 && !I && !O ? /* @__PURE__ */ a("div", { className: "flex items-center justify-center py-8 text-sm text-gray-500", children: "No options found" }) : I || O ? /* @__PURE__ */ a("div", { className: "px-1 py-1 space-y-1", children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ g(
|
|
720
731
|
"div",
|
|
721
732
|
{
|
|
722
733
|
className: "flex items-center gap-2 px-3 py-2 animate-pulse",
|
|
@@ -735,9 +746,9 @@ const Ot = (ge) => {
|
|
|
735
746
|
position: "relative"
|
|
736
747
|
},
|
|
737
748
|
children: P.getVirtualItems().map((e) => {
|
|
738
|
-
const t = p[e.index], l = f ?
|
|
749
|
+
const t = p[e.index], l = f ? S.mode === "exclude" ? !S.set.has(t.value) : S.set.has(t.value) : d?.value === t.value, s = d || [], n = f && x ? T(s) ? !1 : w(s) && s.length >= x : !1, i = t.isDisabled || n && !l && !(k && t.isGroup) && !(y && t.isSubmenuParent), r = k && t.isGroup || y && t.isSubmenuParent ? fe(t.original) : void 0, c = r?.selected || 0, o = r?.total || 0, h = c > 0 && c < o, te = t.isParentSelectable !== !1, me = N || "default", le = String(t.value || ""), he = ee(
|
|
739
750
|
t
|
|
740
|
-
), ft = typeof he == "string" ? he :
|
|
751
|
+
), ft = typeof he == "string" ? he : le;
|
|
741
752
|
return /* @__PURE__ */ g(
|
|
742
753
|
"div",
|
|
743
754
|
{
|
|
@@ -748,32 +759,32 @@ const Ot = (ge) => {
|
|
|
748
759
|
transform: `translateY(${e.start}px)`,
|
|
749
760
|
width: "100%"
|
|
750
761
|
},
|
|
751
|
-
"data-testid": `select-option-wrapper-${me}-${
|
|
762
|
+
"data-testid": `select-option-wrapper-${me}-${le}`,
|
|
752
763
|
children: [
|
|
753
764
|
/* @__PURE__ */ a(
|
|
754
765
|
"div",
|
|
755
766
|
{
|
|
756
|
-
className:
|
|
767
|
+
className: A(
|
|
757
768
|
"cursor-default select-none py-[6px] px-3 flex items-center justify-between transition-colors rounded-md",
|
|
758
|
-
i ? "opacity-50 cursor-not-allowed bg-[#f5f5f5]" :
|
|
759
|
-
l && !i && !(k && t.isGroup) && !(
|
|
769
|
+
i ? "opacity-50 cursor-not-allowed bg-[#f5f5f5]" : m ? "cursor-default" : "hover:bg-gray-100 cursor-pointer",
|
|
770
|
+
l && !i && !(k && t.isGroup) && !(y && t.isSubmenuParent) ? "bg-[#edf0ff] text-[#1f2b4d]" : "text-[#1f2b4d]",
|
|
760
771
|
D === e.index && !i && "ring-2 ring-inset ring-primary bg-[#edf0ff]"
|
|
761
772
|
),
|
|
762
773
|
style: {
|
|
763
774
|
paddingLeft: `${t.depth * 16 + 12}px`
|
|
764
775
|
},
|
|
765
776
|
onClick: () => {
|
|
766
|
-
i || (k && t.isGroup ||
|
|
777
|
+
i || (k && t.isGroup || y && t.isSubmenuParent) && !te || Z(t);
|
|
767
778
|
},
|
|
768
|
-
onMouseEnter: (
|
|
769
|
-
if (
|
|
770
|
-
|
|
771
|
-
const
|
|
772
|
-
t.rect =
|
|
779
|
+
onMouseEnter: (M) => {
|
|
780
|
+
if (y && t.isSubmenuParent) {
|
|
781
|
+
oe(t.value);
|
|
782
|
+
const B = M.currentTarget.getBoundingClientRect();
|
|
783
|
+
t.rect = B;
|
|
773
784
|
} else
|
|
774
|
-
|
|
785
|
+
oe(null);
|
|
775
786
|
},
|
|
776
|
-
"data-testid": `select-option-${me}-${
|
|
787
|
+
"data-testid": `select-option-${me}-${le}`,
|
|
777
788
|
"data-state": l ? "checked" : "unchecked",
|
|
778
789
|
"data-disabled": i || void 0,
|
|
779
790
|
"data-component": "select-option",
|
|
@@ -790,19 +801,19 @@ const Ot = (ge) => {
|
|
|
790
801
|
},
|
|
791
802
|
t
|
|
792
803
|
) : /* @__PURE__ */ g("div", { className: "flex items-center flex-1 overflow-hidden", children: [
|
|
793
|
-
f && (k && t.isGroup ||
|
|
804
|
+
f && (k && t.isGroup || y && t.isSubmenuParent ? te : !0) && /* @__PURE__ */ a(
|
|
794
805
|
Ge,
|
|
795
806
|
{
|
|
796
|
-
checked:
|
|
797
|
-
disabled: i ||
|
|
807
|
+
checked: h ? "indeterminate" : l,
|
|
808
|
+
disabled: i || m,
|
|
798
809
|
onChange: () => {
|
|
799
810
|
}
|
|
800
811
|
}
|
|
801
812
|
),
|
|
802
|
-
ve && !(k && t.isGroup) && !(
|
|
813
|
+
ve && !(k && t.isGroup) && !(y && t.isSubmenuParent) ? /* @__PURE__ */ a(
|
|
803
814
|
ht,
|
|
804
815
|
{
|
|
805
|
-
label:
|
|
816
|
+
label: ee(
|
|
806
817
|
t
|
|
807
818
|
),
|
|
808
819
|
sequence: ot(t)
|
|
@@ -811,20 +822,20 @@ const Ot = (ge) => {
|
|
|
811
822
|
/* @__PURE__ */ a(
|
|
812
823
|
"span",
|
|
813
824
|
{
|
|
814
|
-
className:
|
|
825
|
+
className: A(
|
|
815
826
|
"block truncate",
|
|
816
|
-
k && t.isGroup ? "text-xs font-semibold text-gray-400 uppercase tracking-wider" : l && !(
|
|
827
|
+
k && t.isGroup ? "text-xs font-semibold text-gray-400 uppercase tracking-wider" : l && !(y && t.isSubmenuParent) ? "font-medium" : "font-normal",
|
|
817
828
|
!(k && t.isGroup) && "text-[14px]"
|
|
818
829
|
),
|
|
819
|
-
"data-testid": `select-option-label-${me}-${
|
|
830
|
+
"data-testid": `select-option-label-${me}-${le}`,
|
|
820
831
|
"data-state": l ? "checked" : "unchecked",
|
|
821
832
|
title: ft,
|
|
822
833
|
children: he
|
|
823
834
|
}
|
|
824
835
|
),
|
|
825
|
-
(k && t.isGroup ||
|
|
836
|
+
(k && t.isGroup || y && t.isSubmenuParent) && c > 0 && /* @__PURE__ */ a("span", { className: "inline-flex items-center justify-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-indigo-100 text-indigo-800", children: c })
|
|
826
837
|
] }),
|
|
827
|
-
|
|
838
|
+
y && t.isSubmenuParent && /* @__PURE__ */ a(
|
|
828
839
|
$e,
|
|
829
840
|
{
|
|
830
841
|
size: "12px",
|
|
@@ -834,19 +845,19 @@ const Ot = (ge) => {
|
|
|
834
845
|
] })
|
|
835
846
|
}
|
|
836
847
|
),
|
|
837
|
-
|
|
848
|
+
y && st === t.value && t.isSubmenuParent && t.rect && /* @__PURE__ */ a(
|
|
838
849
|
xt,
|
|
839
850
|
{
|
|
840
851
|
parentOption: t,
|
|
841
852
|
isMulti: !!f,
|
|
842
|
-
isReadOnly: !!
|
|
843
|
-
isSelected: (
|
|
844
|
-
getIndeterminateState: (
|
|
845
|
-
const
|
|
846
|
-
return
|
|
853
|
+
isReadOnly: !!m,
|
|
854
|
+
isSelected: (M) => St(M, d, !!f),
|
|
855
|
+
getIndeterminateState: (M) => {
|
|
856
|
+
const B = fe(M);
|
|
857
|
+
return B ? B.selected > 0 && B.selected < B.total : !1;
|
|
847
858
|
},
|
|
848
|
-
getSelectedCount: (
|
|
849
|
-
handleSelect:
|
|
859
|
+
getSelectedCount: (M) => fe(M)?.selected || 0,
|
|
860
|
+
handleSelect: Z,
|
|
850
861
|
id: N
|
|
851
862
|
}
|
|
852
863
|
)
|
|
@@ -859,14 +870,14 @@ const Ot = (ge) => {
|
|
|
859
870
|
)
|
|
860
871
|
}
|
|
861
872
|
),
|
|
862
|
-
(we || x ||
|
|
873
|
+
(we || x || F.length > 5e3) && /* @__PURE__ */ a("div", { className: "px-3 py-[10px] border-t border-solid border-gray-100 z-10 sticky bottom-0 bg-white", children: x ? /* @__PURE__ */ g("div", { className: "flex items-center gap-2 text-gray-500 px-2", children: [
|
|
863
874
|
/* @__PURE__ */ a(xe, { size: "12px", className: "text-gray-400" }),
|
|
864
875
|
/* @__PURE__ */ g("span", { className: "text-xs font-medium leading-4 text-[#60697d]", children: [
|
|
865
876
|
"Maximum ",
|
|
866
877
|
x,
|
|
867
878
|
" selections"
|
|
868
879
|
] })
|
|
869
|
-
] }) :
|
|
880
|
+
] }) : F.length > 5e3 ? /* @__PURE__ */ g("div", { className: "flex items-center gap-2 text-gray-500 px-2", children: [
|
|
870
881
|
/* @__PURE__ */ a(xe, { size: "12px", className: "text-gray-400" }),
|
|
871
882
|
/* @__PURE__ */ a("span", { className: "text-xs font-medium leading-4 text-[#60697d]", children: "Large dataset detected. Operations might be slower." })
|
|
872
883
|
] }) : we })
|
|
@@ -874,16 +885,16 @@ const Ot = (ge) => {
|
|
|
874
885
|
}
|
|
875
886
|
) })
|
|
876
887
|
] }),
|
|
877
|
-
|
|
888
|
+
Se && /* @__PURE__ */ g(
|
|
878
889
|
"p",
|
|
879
890
|
{
|
|
880
|
-
className:
|
|
891
|
+
className: A(
|
|
881
892
|
"text-[12px] mt-1 flex items-center gap-1",
|
|
882
|
-
|
|
893
|
+
ye ? "text-[#e15554]" : "text-gray-500"
|
|
883
894
|
),
|
|
884
895
|
children: [
|
|
885
896
|
/* @__PURE__ */ a(xe, { size: "12px" }),
|
|
886
|
-
|
|
897
|
+
Se
|
|
887
898
|
]
|
|
888
899
|
}
|
|
889
900
|
)
|
|
@@ -891,7 +902,7 @@ const Ot = (ge) => {
|
|
|
891
902
|
}
|
|
892
903
|
);
|
|
893
904
|
};
|
|
894
|
-
|
|
905
|
+
At.displayName = "Select";
|
|
895
906
|
export {
|
|
896
|
-
|
|
907
|
+
At as default
|
|
897
908
|
};
|