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