impact-nova 0.1.13 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/layout/dashboard-layout.d.ts +21 -6
- package/dist/components/ui/accordion-nested-list/accordion-nested-list.js +32 -33
- package/dist/components/ui/accordion.js +25 -23
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.d.ts +5 -0
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.js +50 -52
- package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.d.ts +1 -1
- package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +34 -34
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +8 -11
- package/dist/components/ui/ag-grid-react/headers/column-menu/column-settings-menu.js +17 -17
- package/dist/components/ui/ag-grid-react/headers/header-search-input.js +3 -3
- package/dist/components/ui/alert-dialog.js +45 -40
- package/dist/components/ui/alert.d.ts +21 -4
- package/dist/components/ui/alert.js +45 -25
- package/dist/components/ui/avatar.js +19 -16
- package/dist/components/ui/badge.js +8 -1
- package/dist/components/ui/breadcrumb.js +1 -0
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button-group.js +27 -32
- package/dist/components/ui/button-variants.d.ts +1 -1
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/button.js +11 -9
- package/dist/components/ui/calendar.d.ts +14 -2
- package/dist/components/ui/calendar.js +443 -376
- package/dist/components/ui/card.js +7 -6
- package/dist/components/ui/checkbox.js +64 -48
- package/dist/components/ui/chips.d.ts +1 -0
- package/dist/components/ui/chips.js +27 -19
- package/dist/components/ui/data-table/data-table-column-list.d.ts +4 -1
- package/dist/components/ui/data-table/data-table-column-list.js +58 -54
- package/dist/components/ui/data-table/data-table-sheet.d.ts +1 -1
- package/dist/components/ui/data-table/data-table-sheet.js +43 -40
- package/dist/components/ui/data-table/data-table-view-options.js +17 -17
- package/dist/components/ui/data-table/data-table.js +21 -20
- package/dist/components/ui/date-picker/date-picker.js +83 -87
- package/dist/components/ui/date-picker/date-range-picker.js +129 -125
- package/dist/components/ui/date-picker/month-picker.js +90 -93
- package/dist/components/ui/date-picker/month-range-picker.js +132 -129
- package/dist/components/ui/date-picker/multi-date-picker.js +37 -38
- package/dist/components/ui/date-picker/multi-month-picker.js +29 -30
- package/dist/components/ui/date-picker/multi-week-picker.js +49 -38
- package/dist/components/ui/date-picker/week-picker.js +116 -112
- package/dist/components/ui/date-picker/week-range-picker.js +153 -142
- package/dist/components/ui/dialog.js +15 -6
- package/dist/components/ui/drawer.js +16 -13
- package/dist/components/ui/dropdown-menu.js +4 -2
- package/dist/components/ui/dynamic-layout.d.ts +2 -2
- package/dist/components/ui/dynamic-layout.js +18 -15
- package/dist/components/ui/empty-container.js +69 -64
- package/dist/components/ui/file-upload.js +113 -106
- package/dist/components/ui/filter-panel/filter-panel.js +49 -46
- package/dist/components/ui/filter-strip/filter-strip.js +41 -37
- package/dist/components/ui/header.js +26 -25
- package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +43 -40
- package/dist/components/ui/hover-card.js +6 -5
- package/dist/components/ui/input.d.ts +1 -1
- package/dist/components/ui/input.js +79 -68
- package/dist/components/ui/loader.d.ts +1 -0
- package/dist/components/ui/loader.js +23 -13
- package/dist/components/ui/nested-list/components/NestedListContent.d.ts +1 -3
- package/dist/components/ui/nested-list/components/NestedListContent.js +16 -15
- package/dist/components/ui/nested-list/components/SortableItem.js +116 -80
- package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.d.ts +13 -1
- package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.js +162 -112
- package/dist/components/ui/nested-list/nested-list.js +182 -189
- package/dist/components/ui/notification-panel/notification-item.js +19 -17
- package/dist/components/ui/notification-panel/notification-list.js +21 -21
- package/dist/components/ui/notification-panel/notification-panel.js +25 -25
- package/dist/components/ui/popover.js +37 -34
- package/dist/components/ui/progress.js +12 -10
- package/dist/components/ui/prompt.js +29 -27
- package/dist/components/ui/radio-group.js +55 -46
- package/dist/components/ui/select/components/Submenu.d.ts +1 -2
- package/dist/components/ui/select/components/Submenu.js +52 -48
- package/dist/components/ui/select/select.js +321 -324
- package/dist/components/ui/sheet.js +18 -15
- package/dist/components/ui/sidebar.d.ts +2 -2
- package/dist/components/ui/sidebar.js +3 -3
- package/dist/components/ui/skeleton.d.ts +2 -1
- package/dist/components/ui/skeleton.js +12 -11
- package/dist/components/ui/slider.js +39 -12
- package/dist/components/ui/smart-input.js +44 -39
- package/dist/components/ui/stepper.js +33 -29
- package/dist/components/ui/switch.js +6 -4
- package/dist/components/ui/tabs.js +50 -45
- package/dist/components/ui/tag-group.d.ts +2 -1
- package/dist/components/ui/tag-group.js +29 -25
- package/dist/components/ui/tag.d.ts +1 -0
- package/dist/components/ui/tag.js +26 -20
- package/dist/components/ui/textarea.js +18 -17
- package/dist/components/ui/toast.d.ts +1 -1
- package/dist/components/ui/toast.js +47 -41
- package/dist/components/ui/toaster.js +42 -42
- package/dist/components/ui/tooltip.js +18 -16
- package/dist/components/ui/types/date-picker.types.d.ts +33 -0
- package/dist/components/ui/types/empty-container.types.d.ts +5 -0
- package/dist/components/ui/types/nested-list.types.d.ts +1 -0
- package/dist/components/ui/types/select.types.d.ts +0 -1
- package/dist/icons/assets/bookmark.svg.js +4 -0
- package/dist/icons/assets/bookmark.svg2.js +5 -0
- package/dist/icons/assets/bookmarkFilled.svg.js +4 -0
- package/dist/icons/assets/bookmarkFilled.svg2.js +5 -0
- package/dist/icons/assets/download.svg.js +4 -0
- package/dist/icons/assets/download.svg2.js +5 -0
- package/dist/icons/index.d.ts +20 -6
- package/dist/icons/index.js +398 -370
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +318 -314
- package/dist/lib/fiscal-calendar.d.ts +62 -0
- package/dist/lib/fiscal-calendar.js +99 -0
- package/package.json +5 -5
- package/dist/components/ui/select/hooks/useClickOutside.d.ts +0 -15
- package/dist/components/ui/select/hooks/useClickOutside.js +0 -43
- package/dist/components/ui/select/hooks/useMenuPosition.d.ts +0 -2
- package/dist/components/ui/select/hooks/useMenuPosition.js +0 -89
|
@@ -1,169 +1,164 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import { useVirtualizer as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { LoadingSpinner as
|
|
8
|
-
import { Checkbox as
|
|
9
|
-
import { Button as
|
|
1
|
+
import { jsxs as p, jsx as a, Fragment as lt } from "react/jsx-runtime";
|
|
2
|
+
import { useState as W, useRef as M, useEffect as j } from "react";
|
|
3
|
+
import * as Y from "@radix-ui/react-popover";
|
|
4
|
+
import { useVirtualizer as nt } from "@tanstack/react-virtual";
|
|
5
|
+
import st from "./components/LabelWithSequence.js";
|
|
6
|
+
import it from "./components/Submenu.js";
|
|
7
|
+
import { LoadingSpinner as at, Cross as rt, ChevronRight as ye, Search as ot, Info as ne } from "../../../icons/index.js";
|
|
8
|
+
import { Checkbox as we } from "../checkbox.js";
|
|
9
|
+
import { Button as ct } from "../button.js";
|
|
10
10
|
import { cn as C } from "../../../lib/utils.js";
|
|
11
|
-
import { isInvertedSelection as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
import { useMenuPosition as St } from "./hooks/useMenuPosition.js";
|
|
17
|
-
const yt = (re) => {
|
|
11
|
+
import { isInvertedSelection as k, isOptionArray as y, isSelected as ut, getSequence as dt, getLeafOptions as ft } from "./utils/select.js";
|
|
12
|
+
import { useFlattenOptions as mt } from "./hooks/useFlattenOptions.js";
|
|
13
|
+
import { useSelectionModel as pt } from "./hooks/useSelectionModel.js";
|
|
14
|
+
import { useVisibleStats as ht } from "./hooks/useVisibleStats.js";
|
|
15
|
+
const xt = (se) => {
|
|
18
16
|
const {
|
|
19
|
-
options:
|
|
20
|
-
value:
|
|
21
|
-
defaultValue:
|
|
17
|
+
options: $,
|
|
18
|
+
value: J,
|
|
19
|
+
defaultValue: Ve,
|
|
22
20
|
onChange: u,
|
|
23
21
|
isMulti: f,
|
|
24
|
-
isDisabled:
|
|
22
|
+
isDisabled: P,
|
|
25
23
|
isLoading: A,
|
|
26
|
-
isClearable:
|
|
27
|
-
isSearchable:
|
|
28
|
-
placeholder:
|
|
29
|
-
menuPortalTarget
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
24
|
+
isClearable: Ne = !0,
|
|
25
|
+
isSearchable: E = !0,
|
|
26
|
+
placeholder: Oe = "Select...",
|
|
27
|
+
// menuPortalTarget is kept for API compatibility but no longer used (Radix handles portalling)
|
|
28
|
+
menuPortalTarget: bt,
|
|
29
|
+
autoFocus: Ce,
|
|
30
|
+
closeMenuOnSelect: Pe = !f,
|
|
31
|
+
defaultMenuIsOpen: ke = !1,
|
|
32
|
+
scrollToSelectedOnOpen: ie = !1,
|
|
33
|
+
maxSelectableOptions: h,
|
|
34
|
+
showSequence: ae,
|
|
35
|
+
selectionOrder: Ae,
|
|
36
|
+
label: re,
|
|
37
|
+
isRequired: De,
|
|
38
|
+
error: K,
|
|
39
|
+
helperText: oe,
|
|
41
40
|
id: w,
|
|
42
|
-
className:
|
|
43
|
-
parentClassName:
|
|
44
|
-
onMenuScrollToBottom:
|
|
45
|
-
name:
|
|
46
|
-
isSelectAllEnabled:
|
|
41
|
+
className: Te,
|
|
42
|
+
parentClassName: $e,
|
|
43
|
+
onMenuScrollToBottom: Q,
|
|
44
|
+
name: Ge,
|
|
45
|
+
isSelectAllEnabled: ce = !0,
|
|
47
46
|
isReadOnly: b = !1,
|
|
48
47
|
searchPosition: R = "menu",
|
|
49
|
-
footerContent:
|
|
50
|
-
onInputChange:
|
|
51
|
-
getOptionLabel:
|
|
52
|
-
renderOption:
|
|
53
|
-
onMenuOpen:
|
|
54
|
-
onMenuClose:
|
|
55
|
-
labelOrientation:
|
|
56
|
-
leftContent:
|
|
57
|
-
ignoreCase:
|
|
58
|
-
ignoreAccents:
|
|
59
|
-
matchFrom:
|
|
60
|
-
stringify:
|
|
61
|
-
trim:
|
|
62
|
-
filterOption:
|
|
48
|
+
footerContent: ue,
|
|
49
|
+
onInputChange: ze,
|
|
50
|
+
getOptionLabel: de,
|
|
51
|
+
renderOption: fe,
|
|
52
|
+
onMenuOpen: Ie,
|
|
53
|
+
onMenuClose: me,
|
|
54
|
+
labelOrientation: pe = "top",
|
|
55
|
+
leftContent: he,
|
|
56
|
+
ignoreCase: Me,
|
|
57
|
+
ignoreAccents: Ee,
|
|
58
|
+
matchFrom: Re,
|
|
59
|
+
stringify: Fe,
|
|
60
|
+
trim: Le,
|
|
61
|
+
filterOption: je,
|
|
63
62
|
enableSubMenus: v = !1,
|
|
64
63
|
enableGroups: V = !1,
|
|
65
|
-
fetchError:
|
|
66
|
-
onRefetch:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}, [Y]), W(() => {
|
|
64
|
+
fetchError: q,
|
|
65
|
+
onRefetch: xe,
|
|
66
|
+
menuWidth: qe,
|
|
67
|
+
onClearAll: be,
|
|
68
|
+
onFocus: _e,
|
|
69
|
+
onBlur: Be
|
|
70
|
+
} = se, [N, ge] = W(ke), [F, _] = W(""), [d, g] = W(Ve || (f ? [] : null)), [He, X] = W(null), Ue = M(null), We = M(null), Ye = M(null), L = M(null), Z = M(null);
|
|
71
|
+
j(() => {
|
|
72
|
+
J !== void 0 && g(J);
|
|
73
|
+
}, [J]), j(() => {
|
|
76
74
|
let e;
|
|
77
|
-
return N &&
|
|
78
|
-
|
|
75
|
+
return N && E && R === "menu" && Z.current && (e = setTimeout(() => {
|
|
76
|
+
Z.current?.focus();
|
|
79
77
|
}, 50)), () => {
|
|
80
78
|
e && clearTimeout(e);
|
|
81
79
|
};
|
|
82
|
-
}, [N,
|
|
83
|
-
const { flatOptions: x, isProcessing: O, totalOptionsCount:
|
|
84
|
-
ignoreCase:
|
|
85
|
-
ignoreAccents:
|
|
86
|
-
matchFrom:
|
|
87
|
-
stringify:
|
|
88
|
-
trim:
|
|
89
|
-
filterOption:
|
|
80
|
+
}, [N, E, R]);
|
|
81
|
+
const { flatOptions: x, isProcessing: O, totalOptionsCount: ve, workerSelectAll: Je } = mt($, F, {
|
|
82
|
+
ignoreCase: Me,
|
|
83
|
+
ignoreAccents: Ee,
|
|
84
|
+
matchFrom: Re,
|
|
85
|
+
stringify: Fe,
|
|
86
|
+
trim: Le,
|
|
87
|
+
filterOption: je,
|
|
90
88
|
enableSubMenus: v,
|
|
91
89
|
enableGroups: V
|
|
92
|
-
}), S =
|
|
90
|
+
}), S = pt(d, f ?? !1), { stats: G, getGroupStats: ee } = ht(
|
|
93
91
|
x,
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
ve,
|
|
93
|
+
F,
|
|
96
94
|
S,
|
|
97
95
|
d,
|
|
98
96
|
f ?? !1
|
|
99
|
-
),
|
|
97
|
+
), D = nt({
|
|
100
98
|
count: x.length,
|
|
101
99
|
getScrollElement: () => L.current,
|
|
102
100
|
estimateSize: () => 40,
|
|
103
101
|
overscan: 5
|
|
104
102
|
});
|
|
105
|
-
|
|
106
|
-
if (N
|
|
103
|
+
j(() => {
|
|
104
|
+
if (!N) return;
|
|
105
|
+
const e = requestAnimationFrame(() => {
|
|
106
|
+
D.measure();
|
|
107
|
+
});
|
|
108
|
+
return () => cancelAnimationFrame(e);
|
|
109
|
+
}, [N, D]), j(() => {
|
|
110
|
+
if (N && ie && !O && x.length > 0) {
|
|
107
111
|
const e = x.findIndex((t) => f ? S.mode === "exclude" ? !S.set.has(t.value) : S.set.has(t.value) : d?.value === t.value);
|
|
108
112
|
if (e !== -1) {
|
|
109
113
|
const t = setTimeout(() => {
|
|
110
|
-
|
|
114
|
+
D.scrollToIndex(e, { align: "center" });
|
|
111
115
|
}, 50);
|
|
112
116
|
return () => clearTimeout(t);
|
|
113
117
|
}
|
|
114
118
|
}
|
|
115
|
-
}, [N,
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
if (!L.current || !
|
|
119
|
+
}, [N, ie, O, x.length, f, S.mode, S.set, d, D]);
|
|
120
|
+
const z = M(null);
|
|
121
|
+
j(() => {
|
|
122
|
+
if (!L.current || !Q) return;
|
|
119
123
|
const e = () => {
|
|
120
124
|
if (A || O) return;
|
|
121
125
|
const { scrollTop: n, scrollHeight: r, clientHeight: s } = L.current;
|
|
122
126
|
if (r - n - s <= 10) {
|
|
123
|
-
if (
|
|
124
|
-
|
|
125
|
-
|
|
127
|
+
if (z.current) return;
|
|
128
|
+
Q(), z.current = setTimeout(() => {
|
|
129
|
+
z.current = null;
|
|
126
130
|
}, 500);
|
|
127
131
|
}
|
|
128
132
|
}, t = L.current;
|
|
129
133
|
return t.addEventListener("scroll", e), !A && !O && e(), () => {
|
|
130
|
-
t.removeEventListener("scroll", e),
|
|
134
|
+
t.removeEventListener("scroll", e), z.current && (clearTimeout(z.current), z.current = null);
|
|
131
135
|
};
|
|
132
136
|
}, [
|
|
133
|
-
|
|
137
|
+
Q,
|
|
134
138
|
x.length,
|
|
135
139
|
N,
|
|
136
140
|
A,
|
|
137
141
|
O
|
|
138
|
-
])
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
const we = St(
|
|
150
|
-
N,
|
|
151
|
-
ee,
|
|
152
|
-
te,
|
|
153
|
-
x.length,
|
|
154
|
-
O,
|
|
155
|
-
He
|
|
156
|
-
), Ve = (e) => {
|
|
157
|
-
if (!(k || b || e.isDisabled || ("children" in e || "options" in e) && e.isParentSelectable === !1))
|
|
142
|
+
]);
|
|
143
|
+
const Ke = (e) => {
|
|
144
|
+
if (!P)
|
|
145
|
+
if (ge(e), e)
|
|
146
|
+
Ie?.();
|
|
147
|
+
else {
|
|
148
|
+
const t = d, n = f && y(d) ? d.map((r) => r.value) : void 0;
|
|
149
|
+
me?.(t, n), _(""), X(null);
|
|
150
|
+
}
|
|
151
|
+
}, Se = (e) => {
|
|
152
|
+
if (!(P || b || e.isDisabled || ("children" in e || "options" in e) && e.isParentSelectable === !1))
|
|
158
153
|
if (f) {
|
|
159
154
|
const n = d || [];
|
|
160
155
|
if ("children" in e || "options" in e) {
|
|
161
|
-
const s =
|
|
156
|
+
const s = ft(
|
|
162
157
|
e,
|
|
163
158
|
v,
|
|
164
159
|
V
|
|
165
160
|
).filter((l) => !l.isDisabled);
|
|
166
|
-
if (
|
|
161
|
+
if (k(n)) {
|
|
167
162
|
const l = n.excludedValues, i = s.every(
|
|
168
163
|
(m) => !l.includes(m.value)
|
|
169
164
|
);
|
|
@@ -171,7 +166,7 @@ const yt = (re) => {
|
|
|
171
166
|
i ? s.forEach((m) => {
|
|
172
167
|
c.includes(m.value) || c.push(m.value);
|
|
173
168
|
}) : c = c.filter(
|
|
174
|
-
(m) => !s.some((
|
|
169
|
+
(m) => !s.some((H) => H.value === m)
|
|
175
170
|
);
|
|
176
171
|
const o = {
|
|
177
172
|
isAllSelected: !0,
|
|
@@ -190,14 +185,14 @@ const yt = (re) => {
|
|
|
190
185
|
(o) => !s.some((m) => m.value === o.value)
|
|
191
186
|
) : s.forEach((o) => {
|
|
192
187
|
c.some((m) => m.value === o.value) || c.push(o);
|
|
193
|
-
}),
|
|
188
|
+
}), h && c.length > h)
|
|
194
189
|
return;
|
|
195
190
|
g(c), u && u(c, {
|
|
196
191
|
action: "select-option",
|
|
197
192
|
option: e
|
|
198
193
|
});
|
|
199
194
|
}
|
|
200
|
-
} else if (
|
|
195
|
+
} else if (k(n)) {
|
|
201
196
|
const r = n.excludedValues, s = r.includes(e.value);
|
|
202
197
|
let l = [...r];
|
|
203
198
|
s ? l = l.filter((c) => c !== e.value) : l.push(e.value);
|
|
@@ -215,7 +210,7 @@ const yt = (re) => {
|
|
|
215
210
|
if (s)
|
|
216
211
|
l = r.filter((i) => i.value !== e.value);
|
|
217
212
|
else {
|
|
218
|
-
if (
|
|
213
|
+
if (h && n.length >= h)
|
|
219
214
|
return;
|
|
220
215
|
l = [...r, e];
|
|
221
216
|
}
|
|
@@ -228,22 +223,22 @@ const yt = (re) => {
|
|
|
228
223
|
g(e), u && u(e, {
|
|
229
224
|
action: "select-option",
|
|
230
225
|
option: e
|
|
231
|
-
}),
|
|
232
|
-
},
|
|
233
|
-
if (!(!f ||
|
|
234
|
-
if (
|
|
226
|
+
}), Pe && (ge(!1), me?.(e, void 0), _(""));
|
|
227
|
+
}, Qe = async () => {
|
|
228
|
+
if (!(!f || P || b)) {
|
|
229
|
+
if ($.length > 3e3) {
|
|
235
230
|
try {
|
|
236
|
-
const e = await
|
|
231
|
+
const e = await Je(
|
|
237
232
|
d,
|
|
238
|
-
|
|
239
|
-
|
|
233
|
+
k(d),
|
|
234
|
+
h
|
|
240
235
|
);
|
|
241
236
|
g(e), u && u(e, { action: "select-option" });
|
|
242
237
|
} catch {
|
|
243
238
|
}
|
|
244
239
|
return;
|
|
245
240
|
}
|
|
246
|
-
if (
|
|
241
|
+
if (F) {
|
|
247
242
|
let e = !1;
|
|
248
243
|
for (const n of x)
|
|
249
244
|
if (!n.isGroup && !n.isSubmenuParent && !n.isDisabled) {
|
|
@@ -253,8 +248,8 @@ const yt = (re) => {
|
|
|
253
248
|
if (!e)
|
|
254
249
|
return;
|
|
255
250
|
const t = d || [];
|
|
256
|
-
if (
|
|
257
|
-
const n = t.excludedValues, { totalVisible: r, selectedVisible: s } =
|
|
251
|
+
if (k(t)) {
|
|
252
|
+
const n = t.excludedValues, { totalVisible: r, selectedVisible: s } = G, l = r > 0 && r === s;
|
|
258
253
|
let i = [...n];
|
|
259
254
|
if (l)
|
|
260
255
|
for (const o of x)
|
|
@@ -271,7 +266,7 @@ const yt = (re) => {
|
|
|
271
266
|
};
|
|
272
267
|
g(c), u && u(c, { action: "select-option" });
|
|
273
268
|
} else if (y(t)) {
|
|
274
|
-
const n = t, { totalVisible: r, selectedVisible: s } =
|
|
269
|
+
const n = t, { totalVisible: r, selectedVisible: s } = G, l = r > 0 && r === s;
|
|
275
270
|
let i = [...n];
|
|
276
271
|
if (l) {
|
|
277
272
|
const c = /* @__PURE__ */ new Set();
|
|
@@ -283,12 +278,12 @@ const yt = (re) => {
|
|
|
283
278
|
for (const o of x)
|
|
284
279
|
!o.isGroup && !o.isSubmenuParent && !o.isDisabled && (c.has(o.value) || (i.push(o), c.add(o.value)));
|
|
285
280
|
}
|
|
286
|
-
if (
|
|
281
|
+
if (h && i.length > h)
|
|
287
282
|
return;
|
|
288
283
|
g(i), u && u(i, { action: "select-option" });
|
|
289
284
|
}
|
|
290
|
-
} else if (
|
|
291
|
-
const e = d, { totalVisible: t } =
|
|
285
|
+
} else if (h) {
|
|
286
|
+
const e = d, { totalVisible: t } = G, n = y(e) ? e.length : 0, r = Math.min(t, h);
|
|
292
287
|
if (y(e) && n >= r && n > 0) {
|
|
293
288
|
const s = e.filter((l) => l.isDisabled);
|
|
294
289
|
g(s), u && u(s, {
|
|
@@ -300,15 +295,15 @@ const yt = (re) => {
|
|
|
300
295
|
);
|
|
301
296
|
let l = s.length;
|
|
302
297
|
for (const i of x)
|
|
303
|
-
if (!i.isGroup && !i.isSubmenuParent && !i.isDisabled && (s.push(i), l++, l >=
|
|
298
|
+
if (!i.isGroup && !i.isSubmenuParent && !i.isDisabled && (s.push(i), l++, l >= h))
|
|
304
299
|
break;
|
|
305
300
|
g(s), u && u(s, {
|
|
306
301
|
action: "select-option"
|
|
307
302
|
});
|
|
308
303
|
}
|
|
309
304
|
} else {
|
|
310
|
-
const e = d, t =
|
|
311
|
-
if (
|
|
305
|
+
const e = d, t = k(e) && e.excludedValues.length === 0;
|
|
306
|
+
if (se.enableInvertedSelection)
|
|
312
307
|
if (t) {
|
|
313
308
|
const n = y(e) ? e.filter((r) => r.isDisabled) : [];
|
|
314
309
|
g(n), u && u(n, {
|
|
@@ -324,7 +319,7 @@ const yt = (re) => {
|
|
|
324
319
|
g(r), u && u(r, { action: "select-option" });
|
|
325
320
|
}
|
|
326
321
|
else {
|
|
327
|
-
const { totalVisible: n, selectedVisible: r } =
|
|
322
|
+
const { totalVisible: n, selectedVisible: r } = G;
|
|
328
323
|
if (n > 0 && n === r) {
|
|
329
324
|
const s = y(e) ? e.filter((l) => l.isDisabled) : [];
|
|
330
325
|
g(s), u && u(s, {
|
|
@@ -341,7 +336,7 @@ const yt = (re) => {
|
|
|
341
336
|
}
|
|
342
337
|
}
|
|
343
338
|
}
|
|
344
|
-
},
|
|
339
|
+
}, Xe = (e) => {
|
|
345
340
|
if (e.stopPropagation(), !b)
|
|
346
341
|
if (f) {
|
|
347
342
|
const t = [], n = (s) => {
|
|
@@ -360,9 +355,9 @@ const yt = (re) => {
|
|
|
360
355
|
i.isDisabled && (S.mode === "exclude" ? !S.set.has(i.value) : S.set.has(i.value)) && t.push(i);
|
|
361
356
|
}
|
|
362
357
|
};
|
|
363
|
-
n(
|
|
358
|
+
n($);
|
|
364
359
|
const r = t;
|
|
365
|
-
g(r), u && u(r, { action: "clear" }),
|
|
360
|
+
g(r), u && u(r, { action: "clear" }), be?.();
|
|
366
361
|
} else {
|
|
367
362
|
const t = d;
|
|
368
363
|
if (t) {
|
|
@@ -389,195 +384,185 @@ const yt = (re) => {
|
|
|
389
384
|
}
|
|
390
385
|
}
|
|
391
386
|
};
|
|
392
|
-
if (s(
|
|
387
|
+
if (s($), r?.isDisabled)
|
|
393
388
|
return;
|
|
394
389
|
}
|
|
395
390
|
const n = null;
|
|
396
|
-
g(n), u && u(n, { action: "clear" }),
|
|
391
|
+
g(n), u && u(n, { action: "clear" }), be?.();
|
|
397
392
|
}
|
|
398
|
-
},
|
|
393
|
+
}, Ze = (e) => dt(
|
|
399
394
|
e,
|
|
400
|
-
|
|
395
|
+
ae ?? !1,
|
|
401
396
|
f ?? !1,
|
|
402
|
-
|
|
397
|
+
Ae,
|
|
403
398
|
d
|
|
404
|
-
),
|
|
399
|
+
), B = (e) => de ? de(e) : e.label, et = () => {
|
|
405
400
|
if (f) {
|
|
406
401
|
const e = d || [];
|
|
407
402
|
let t = 0;
|
|
408
|
-
return
|
|
403
|
+
return k(e) ? t = ve - e.excludedValues.length : y(e) && (t = e.length), t === 0 ? null : t === 1 && y(e) ? /* @__PURE__ */ a("span", { className: "text-[#1f2b4d] text-[14px] font-medium truncate min-w-0 block", children: B(e[0]) }) : /* @__PURE__ */ p("span", { className: "text-[#1f2b4d] text-[14px] font-medium truncate min-w-0 block", children: [
|
|
409
404
|
"Selected (",
|
|
410
405
|
t,
|
|
411
406
|
")"
|
|
412
407
|
] });
|
|
413
408
|
} else {
|
|
414
409
|
const e = d;
|
|
415
|
-
return e ? /* @__PURE__ */ a("span", { className: "text-[#1f2b4d] text-[14px] font-medium truncate min-w-0 block", children:
|
|
410
|
+
return e ? /* @__PURE__ */ a("span", { className: "text-[#1f2b4d] text-[14px] font-medium truncate min-w-0 block", children: B(e) }) : null;
|
|
416
411
|
}
|
|
417
412
|
};
|
|
418
|
-
return /* @__PURE__ */
|
|
413
|
+
return /* @__PURE__ */ p(
|
|
419
414
|
"div",
|
|
420
415
|
{
|
|
421
416
|
className: C(
|
|
422
417
|
"flex gap-[6px]",
|
|
423
|
-
|
|
424
|
-
|
|
418
|
+
pe === "left" ? "w-fit flex-row items-center" : "w-full flex-col",
|
|
419
|
+
$e
|
|
425
420
|
),
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
tabIndex: k ? -1 : 0,
|
|
421
|
+
onFocus: _e,
|
|
422
|
+
onBlur: Be,
|
|
423
|
+
tabIndex: P ? -1 : 0,
|
|
430
424
|
"data-testid": `select-${w || "default"}`,
|
|
425
|
+
"data-component": "select",
|
|
431
426
|
children: [
|
|
432
|
-
|
|
427
|
+
re && /* @__PURE__ */ p(
|
|
433
428
|
"label",
|
|
434
429
|
{
|
|
435
430
|
className: C(
|
|
436
431
|
"text-[12px] font-medium text-[#60697d] leading-[18px]",
|
|
437
|
-
|
|
432
|
+
pe === "left" ? "shrink-0" : ""
|
|
438
433
|
),
|
|
439
434
|
children: [
|
|
440
|
-
|
|
435
|
+
re,
|
|
441
436
|
" ",
|
|
442
|
-
|
|
437
|
+
De && /* @__PURE__ */ a("span", { className: "text-[red]", children: "*" })
|
|
443
438
|
]
|
|
444
439
|
}
|
|
445
440
|
),
|
|
446
|
-
/* @__PURE__ */
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
onClick: () => {
|
|
460
|
-
if (!k) {
|
|
461
|
-
const e = !N;
|
|
462
|
-
if (Q(e), e)
|
|
463
|
-
Ee?.();
|
|
464
|
-
else {
|
|
465
|
-
const t = d, n = f && y(d) ? d.map((r) => r.value) : void 0;
|
|
466
|
-
K?.(t, n);
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
},
|
|
470
|
-
id: w,
|
|
471
|
-
children: /* @__PURE__ */ h("div", { className: "flex items-center justify-between w-full min-w-0 max-w-full", children: [
|
|
472
|
-
ge && /* @__PURE__ */ a("div", { className: "flex items-center text-gray-500 shrink-0", children: ge }),
|
|
473
|
-
/* @__PURE__ */ h(
|
|
474
|
-
"div",
|
|
475
|
-
{
|
|
476
|
-
className: "flex-1 flex items-center overflow-hidden min-w-0 max-w-full",
|
|
477
|
-
"data-testid": `select-value-${w || "default"}`,
|
|
478
|
-
children: [
|
|
479
|
-
lt() || /* @__PURE__ */ a(
|
|
480
|
-
"span",
|
|
481
|
-
{
|
|
482
|
-
className: "text-[#b4bac7] font-normal text-[14px] truncate min-w-0 block",
|
|
483
|
-
"data-testid": `select-placeholder-${w || "default"}`,
|
|
484
|
-
"data-has-value": !1,
|
|
485
|
-
children: ke
|
|
486
|
-
}
|
|
487
|
-
),
|
|
488
|
-
T && N && R === "trigger" && !b && /* @__PURE__ */ a(
|
|
489
|
-
"input",
|
|
490
|
-
{
|
|
491
|
-
ref: Ke,
|
|
492
|
-
type: "text",
|
|
493
|
-
className: "flex-1 min-w-[50px] border-none p-0 focus:ring-0 text-sm outline-none h-full",
|
|
494
|
-
value: E,
|
|
495
|
-
onChange: (e) => q(e.target.value),
|
|
496
|
-
onClick: (e) => e.stopPropagation(),
|
|
497
|
-
autoFocus: Ae,
|
|
498
|
-
name: Te || void 0
|
|
499
|
-
}
|
|
500
|
-
)
|
|
501
|
-
]
|
|
502
|
-
}
|
|
441
|
+
/* @__PURE__ */ p(Y.Root, { open: N, onOpenChange: Ke, children: [
|
|
442
|
+
/* @__PURE__ */ a(Y.Trigger, { asChild: !0, children: /* @__PURE__ */ a(
|
|
443
|
+
"div",
|
|
444
|
+
{
|
|
445
|
+
ref: Ue,
|
|
446
|
+
className: C(
|
|
447
|
+
"relative h-[32px] w-full cursor-pointer rounded-[8px] border border-solid px-3 py-1 text-left shadow-sm focus:outline-none sm:text-sm transition-all flex items-center overflow-hidden",
|
|
448
|
+
K ? "border-[#e15554] focus:ring-[#e15554]" : "border-[#c3c8d4] hover:border-gray-400 focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500",
|
|
449
|
+
P ? "bg-[#f2f4fb] cursor-not-allowed opacity-75" : "",
|
|
450
|
+
b ? "cursor-default bg-[#f2f4fb]" : "",
|
|
451
|
+
N ? "ring-1 ring-indigo-500 border-indigo-500" : "",
|
|
452
|
+
!P && !b && "bg-white",
|
|
453
|
+
Te
|
|
503
454
|
),
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
455
|
+
id: w,
|
|
456
|
+
"data-component": "select-trigger",
|
|
457
|
+
"data-disabled": P || void 0,
|
|
458
|
+
"data-state": N ? "open" : "closed",
|
|
459
|
+
children: /* @__PURE__ */ p("div", { className: "flex items-center justify-between w-full min-w-0 max-w-full", children: [
|
|
460
|
+
he && /* @__PURE__ */ a("div", { className: "flex items-center text-gray-500 shrink-0", children: he }),
|
|
461
|
+
/* @__PURE__ */ p(
|
|
508
462
|
"div",
|
|
509
463
|
{
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
464
|
+
className: "flex-1 flex items-center overflow-hidden min-w-0 max-w-full",
|
|
465
|
+
"data-testid": `select-value-${w || "default"}`,
|
|
466
|
+
children: [
|
|
467
|
+
et() || /* @__PURE__ */ a(
|
|
468
|
+
"span",
|
|
469
|
+
{
|
|
470
|
+
className: "text-[#b4bac7] font-normal text-[14px] truncate min-w-0 block",
|
|
471
|
+
"data-testid": `select-placeholder-${w || "default"}`,
|
|
472
|
+
"data-has-value": !1,
|
|
473
|
+
children: Oe
|
|
474
|
+
}
|
|
475
|
+
),
|
|
476
|
+
E && N && R === "trigger" && !b && /* @__PURE__ */ a(
|
|
477
|
+
"input",
|
|
478
|
+
{
|
|
479
|
+
ref: Ye,
|
|
480
|
+
type: "text",
|
|
481
|
+
className: "flex-1 min-w-[50px] border-none p-0 focus:ring-0 text-sm outline-none h-full",
|
|
482
|
+
value: F,
|
|
483
|
+
onChange: (e) => _(e.target.value),
|
|
484
|
+
onClick: (e) => e.stopPropagation(),
|
|
485
|
+
autoFocus: Ce,
|
|
486
|
+
name: Ge || void 0
|
|
487
|
+
}
|
|
488
|
+
)
|
|
489
|
+
]
|
|
514
490
|
}
|
|
515
491
|
),
|
|
516
|
-
/* @__PURE__ */ a(
|
|
517
|
-
Ne
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
/* @__PURE__ */ h(
|
|
545
|
-
"div",
|
|
492
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-1 text-gray-400 shrink-0", children: !N && (A || O) ? /* @__PURE__ */ a(at, { size: "14px" }) : /* @__PURE__ */ p(lt, { children: [
|
|
493
|
+
Ne && !b && (f && (k(
|
|
494
|
+
d
|
|
495
|
+
) && d.isAllSelected || y(d) && d.length > 0) || !f && d) && /* @__PURE__ */ a(
|
|
496
|
+
"div",
|
|
497
|
+
{
|
|
498
|
+
role: "button",
|
|
499
|
+
onClick: Xe,
|
|
500
|
+
className: "hover:text-gray-600 p-0.5",
|
|
501
|
+
children: /* @__PURE__ */ a(rt, { size: "11px", color: "#758490" })
|
|
502
|
+
}
|
|
503
|
+
),
|
|
504
|
+
/* @__PURE__ */ a(
|
|
505
|
+
ye,
|
|
506
|
+
{
|
|
507
|
+
size: "16px",
|
|
508
|
+
className: C(
|
|
509
|
+
"transition-transform duration-200",
|
|
510
|
+
N ? "-rotate-90" : "rotate-90"
|
|
511
|
+
)
|
|
512
|
+
}
|
|
513
|
+
)
|
|
514
|
+
] }) })
|
|
515
|
+
] })
|
|
516
|
+
}
|
|
517
|
+
) }),
|
|
518
|
+
/* @__PURE__ */ a(Y.Portal, { children: /* @__PURE__ */ p(
|
|
519
|
+
Y.Content,
|
|
546
520
|
{
|
|
547
|
-
ref:
|
|
548
|
-
|
|
521
|
+
ref: We,
|
|
522
|
+
side: "bottom",
|
|
523
|
+
sideOffset: 4,
|
|
524
|
+
align: "start",
|
|
525
|
+
avoidCollisions: !0,
|
|
526
|
+
collisionPadding: 8,
|
|
527
|
+
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
528
|
+
onInteractOutside: () => {
|
|
529
|
+
},
|
|
530
|
+
style: {
|
|
531
|
+
width: qe || "var(--radix-popover-trigger-width)"
|
|
532
|
+
},
|
|
549
533
|
className: C(
|
|
550
|
-
"
|
|
534
|
+
"z-50 max-h-80 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",
|
|
551
535
|
b ? "bg-[#f5f5f5]" : "bg-white"
|
|
552
536
|
),
|
|
553
537
|
"data-testid": `select-menu-${w || "default"}`,
|
|
538
|
+
"data-component": "select-menu",
|
|
554
539
|
children: [
|
|
555
|
-
/* @__PURE__ */
|
|
540
|
+
/* @__PURE__ */ p(
|
|
556
541
|
"div",
|
|
557
542
|
{
|
|
558
543
|
className: C(
|
|
559
544
|
"flex flex-col z-10 sticky top-0 px-[6px] pt-[8px]",
|
|
560
545
|
b ? "bg-[#f5f5f5]" : "bg-white",
|
|
561
|
-
!
|
|
546
|
+
!q && (E && R === "menu" && !b || f && ce && !b && x.length > 0) ? "border-b border-solid border-gray-100" : ""
|
|
562
547
|
),
|
|
563
548
|
children: [
|
|
564
|
-
|
|
549
|
+
E && R === "menu" && !b && !q && /* @__PURE__ */ a(
|
|
565
550
|
"div",
|
|
566
551
|
{
|
|
567
552
|
className: "p-0",
|
|
568
553
|
"data-testid": `select-search-container-${w || "default"}`,
|
|
569
|
-
children: /* @__PURE__ */
|
|
570
|
-
/* @__PURE__ */ a("div", { className: "absolute inset-y-0 left-[12px] flex items-center pointer-events-none", children: /* @__PURE__ */ a(
|
|
554
|
+
children: /* @__PURE__ */ p("div", { className: "relative", children: [
|
|
555
|
+
/* @__PURE__ */ a("div", { className: "absolute inset-y-0 left-[12px] flex items-center pointer-events-none", children: /* @__PURE__ */ a(ot, { size: "14px", color: "#AFAFAF" }) }),
|
|
571
556
|
/* @__PURE__ */ a(
|
|
572
557
|
"input",
|
|
573
558
|
{
|
|
574
|
-
ref:
|
|
559
|
+
ref: Z,
|
|
575
560
|
type: "text",
|
|
576
561
|
className: "block w-full pl-[34px] pr-4 h-[35px] border-none border-b border-primary text-sm outline-none focus:ring-0",
|
|
577
562
|
placeholder: "Search here...",
|
|
578
|
-
value:
|
|
563
|
+
value: F,
|
|
579
564
|
onChange: (e) => {
|
|
580
|
-
|
|
565
|
+
_(e.target.value), ze?.(e.target.value);
|
|
581
566
|
},
|
|
582
567
|
onClick: (e) => e.stopPropagation(),
|
|
583
568
|
"data-testid": `select-search-input-${w || "default"}`
|
|
@@ -586,7 +571,7 @@ const yt = (re) => {
|
|
|
586
571
|
] })
|
|
587
572
|
}
|
|
588
573
|
),
|
|
589
|
-
!A && !O && !
|
|
574
|
+
!A && !O && !q && f && ce && !b && x.length > 0 && /* @__PURE__ */ a(
|
|
590
575
|
"div",
|
|
591
576
|
{
|
|
592
577
|
className: "pb-1",
|
|
@@ -595,19 +580,19 @@ const yt = (re) => {
|
|
|
595
580
|
"div",
|
|
596
581
|
{
|
|
597
582
|
className: "flex items-center justify-between cursor-pointer rounded-md hover:bg-gray-100 transition-colors py-[6px] px-3 w-full",
|
|
598
|
-
onClick:
|
|
583
|
+
onClick: Qe,
|
|
599
584
|
"data-testid": `select-select-all-button-${w || "default"}`,
|
|
600
|
-
children: /* @__PURE__ */
|
|
585
|
+
children: /* @__PURE__ */ p("div", { className: "flex items-center flex-1", children: [
|
|
601
586
|
/* @__PURE__ */ a("div", { className: "pointer-events-none flex", children: /* @__PURE__ */ a(
|
|
602
|
-
|
|
587
|
+
we,
|
|
603
588
|
{
|
|
604
589
|
checked: (() => {
|
|
605
|
-
const { totalVisible: e, selectedVisible: t } =
|
|
590
|
+
const { totalVisible: e, selectedVisible: t } = G;
|
|
606
591
|
if (e === 0) return !1;
|
|
607
|
-
const n =
|
|
592
|
+
const n = h ? Math.min(e, h) : e;
|
|
608
593
|
return t > 0 && t < n ? "indeterminate" : t >= n;
|
|
609
594
|
})(),
|
|
610
|
-
disabled:
|
|
595
|
+
disabled: P || b,
|
|
611
596
|
onChange: () => {
|
|
612
597
|
},
|
|
613
598
|
"data-testid": `select-select-all-checkbox-${w || "default"}`
|
|
@@ -619,7 +604,7 @@ const yt = (re) => {
|
|
|
619
604
|
className: "text-sm font-medium text-gray-700",
|
|
620
605
|
"data-testid": `select-select-all-label-${w || "default"}`,
|
|
621
606
|
children: (() => {
|
|
622
|
-
const { totalVisible: e, selectedVisible: t } =
|
|
607
|
+
const { totalVisible: e, selectedVisible: t } = G, n = h ? Math.min(e, h) : e;
|
|
623
608
|
return e > 0 && t >= n ? "Unselect All" : "Select All";
|
|
624
609
|
})()
|
|
625
610
|
}
|
|
@@ -638,18 +623,18 @@ const yt = (re) => {
|
|
|
638
623
|
ref: L,
|
|
639
624
|
className: "flex-1 overflow-auto py-1 px-[6px]",
|
|
640
625
|
style: { maxHeight: "300px" },
|
|
641
|
-
children:
|
|
626
|
+
children: q ? /* @__PURE__ */ p("div", { className: "flex flex-col items-center justify-center py-8 px-4 text-center", children: [
|
|
642
627
|
/* @__PURE__ */ a("p", { className: "text-sm text-gray-500 font-medium mb-3", children: "Something went wrong" }),
|
|
643
|
-
|
|
644
|
-
|
|
628
|
+
xe && /* @__PURE__ */ a(
|
|
629
|
+
ct,
|
|
645
630
|
{
|
|
646
631
|
size: "sm",
|
|
647
632
|
variant: "outline",
|
|
648
|
-
onClick: () =>
|
|
633
|
+
onClick: () => xe(),
|
|
649
634
|
children: "Refetch"
|
|
650
635
|
}
|
|
651
636
|
)
|
|
652
|
-
] }) : x.length === 0 && !A && !O ? /* @__PURE__ */ a("div", { className: "flex items-center justify-center py-8 text-sm text-gray-500", children: "No options found" }) : A || O ? /* @__PURE__ */ a("div", { className: "px-1 py-1 space-y-1", children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */
|
|
637
|
+
] }) : x.length === 0 && !A && !O ? /* @__PURE__ */ a("div", { className: "flex items-center justify-center py-8 text-sm text-gray-500", children: "No options found" }) : A || O ? /* @__PURE__ */ a("div", { className: "px-1 py-1 space-y-1", children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ p(
|
|
653
638
|
"div",
|
|
654
639
|
{
|
|
655
640
|
className: "flex items-center gap-2 px-3 py-2 animate-pulse",
|
|
@@ -663,25 +648,25 @@ const yt = (re) => {
|
|
|
663
648
|
"div",
|
|
664
649
|
{
|
|
665
650
|
style: {
|
|
666
|
-
height: `${
|
|
651
|
+
height: `${D.getTotalSize()}px`,
|
|
667
652
|
width: "100%",
|
|
668
653
|
position: "relative"
|
|
669
654
|
},
|
|
670
|
-
children:
|
|
671
|
-
const t = x[e.index], n = f ? S.mode === "exclude" ? !S.set.has(t.value) : S.set.has(t.value) : d?.value === t.value, r = d || [], s = f &&
|
|
655
|
+
children: D.getVirtualItems().map((e) => {
|
|
656
|
+
const t = x[e.index], n = f ? S.mode === "exclude" ? !S.set.has(t.value) : S.set.has(t.value) : d?.value === t.value, r = d || [], s = f && h ? k(r) ? !1 : y(r) && r.length >= h : !1, l = t.isDisabled || s && !n && !(V && t.isGroup) && !(v && t.isSubmenuParent), i = V && t.isGroup || v && t.isSubmenuParent ? ee(t.original) : void 0, c = i?.selected || 0, o = i?.total || 0, m = c > 0 && c < o, H = t.isParentSelectable !== !1, te = w || "default", U = String(t.value || ""), le = B(
|
|
672
657
|
t
|
|
673
|
-
),
|
|
674
|
-
return /* @__PURE__ */
|
|
658
|
+
), tt = typeof le == "string" ? le : U;
|
|
659
|
+
return /* @__PURE__ */ p(
|
|
675
660
|
"div",
|
|
676
661
|
{
|
|
677
662
|
"data-index": e.index,
|
|
678
|
-
ref:
|
|
663
|
+
ref: D.measureElement,
|
|
679
664
|
className: "absolute left-0 w-full pb-[2px]",
|
|
680
665
|
style: {
|
|
681
666
|
transform: `translateY(${e.start}px)`,
|
|
682
667
|
width: "100%"
|
|
683
668
|
},
|
|
684
|
-
"data-testid": `select-option-wrapper-${
|
|
669
|
+
"data-testid": `select-option-wrapper-${te}-${U}`,
|
|
685
670
|
children: [
|
|
686
671
|
/* @__PURE__ */ a(
|
|
687
672
|
"div",
|
|
@@ -695,20 +680,21 @@ const yt = (re) => {
|
|
|
695
680
|
paddingLeft: `${t.depth * 16 + 12}px`
|
|
696
681
|
},
|
|
697
682
|
onClick: () => {
|
|
698
|
-
l || (V && t.isGroup || v && t.isSubmenuParent) && !
|
|
683
|
+
l || (V && t.isGroup || v && t.isSubmenuParent) && !H || Se(t);
|
|
699
684
|
},
|
|
700
|
-
onMouseEnter: (
|
|
685
|
+
onMouseEnter: (T) => {
|
|
701
686
|
if (v && t.isSubmenuParent) {
|
|
702
687
|
X(t.value);
|
|
703
|
-
const
|
|
704
|
-
t.rect =
|
|
688
|
+
const I = T.currentTarget.getBoundingClientRect();
|
|
689
|
+
t.rect = I;
|
|
705
690
|
} else
|
|
706
691
|
X(null);
|
|
707
692
|
},
|
|
708
|
-
"data-testid": `select-option-${
|
|
709
|
-
"data-
|
|
710
|
-
"data-disabled": l,
|
|
711
|
-
|
|
693
|
+
"data-testid": `select-option-${te}-${U}`,
|
|
694
|
+
"data-state": n ? "checked" : "unchecked",
|
|
695
|
+
"data-disabled": l || void 0,
|
|
696
|
+
"data-component": "select-option",
|
|
697
|
+
children: fe ? fe(
|
|
712
698
|
{
|
|
713
699
|
onClick: () => {
|
|
714
700
|
},
|
|
@@ -717,9 +703,9 @@ const yt = (re) => {
|
|
|
717
703
|
disabled: l
|
|
718
704
|
},
|
|
719
705
|
t
|
|
720
|
-
) : /* @__PURE__ */
|
|
721
|
-
f && (V && t.isGroup || v && t.isSubmenuParent ?
|
|
722
|
-
|
|
706
|
+
) : /* @__PURE__ */ p("div", { className: "flex items-center flex-1 overflow-hidden", children: [
|
|
707
|
+
f && (V && t.isGroup || v && t.isSubmenuParent ? H : !0) && /* @__PURE__ */ a(
|
|
708
|
+
we,
|
|
723
709
|
{
|
|
724
710
|
checked: m ? "indeterminate" : n,
|
|
725
711
|
disabled: l || b,
|
|
@@ -727,15 +713,15 @@ const yt = (re) => {
|
|
|
727
713
|
}
|
|
728
714
|
}
|
|
729
715
|
),
|
|
730
|
-
|
|
731
|
-
|
|
716
|
+
ae && !(V && t.isGroup) && !(v && t.isSubmenuParent) ? /* @__PURE__ */ a(
|
|
717
|
+
st,
|
|
732
718
|
{
|
|
733
|
-
label:
|
|
719
|
+
label: B(
|
|
734
720
|
t
|
|
735
721
|
),
|
|
736
|
-
sequence:
|
|
722
|
+
sequence: Ze(t)
|
|
737
723
|
}
|
|
738
|
-
) : /* @__PURE__ */
|
|
724
|
+
) : /* @__PURE__ */ p("div", { className: "flex items-center gap-2 overflow-hidden w-full", children: [
|
|
739
725
|
/* @__PURE__ */ a(
|
|
740
726
|
"span",
|
|
741
727
|
{
|
|
@@ -744,16 +730,16 @@ const yt = (re) => {
|
|
|
744
730
|
V && t.isGroup ? "text-xs font-semibold text-gray-400 uppercase tracking-wider" : n && !(v && t.isSubmenuParent) ? "font-medium" : "font-normal",
|
|
745
731
|
!(V && t.isGroup) && "text-[14px]"
|
|
746
732
|
),
|
|
747
|
-
"data-testid": `select-option-label-${
|
|
748
|
-
"data-
|
|
749
|
-
title:
|
|
750
|
-
children:
|
|
733
|
+
"data-testid": `select-option-label-${te}-${U}`,
|
|
734
|
+
"data-state": n ? "checked" : "unchecked",
|
|
735
|
+
title: tt,
|
|
736
|
+
children: le
|
|
751
737
|
}
|
|
752
738
|
),
|
|
753
739
|
(V && t.isGroup || v && 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 })
|
|
754
740
|
] }),
|
|
755
741
|
v && t.isSubmenuParent && /* @__PURE__ */ a(
|
|
756
|
-
|
|
742
|
+
ye,
|
|
757
743
|
{
|
|
758
744
|
size: "12px",
|
|
759
745
|
className: "text-gray-400"
|
|
@@ -762,20 +748,19 @@ const yt = (re) => {
|
|
|
762
748
|
] })
|
|
763
749
|
}
|
|
764
750
|
),
|
|
765
|
-
v &&
|
|
766
|
-
|
|
751
|
+
v && He === t.value && t.isSubmenuParent && t.rect && /* @__PURE__ */ a(
|
|
752
|
+
it,
|
|
767
753
|
{
|
|
768
754
|
parentOption: t,
|
|
769
|
-
parentRect: t.rect,
|
|
770
755
|
isMulti: !!f,
|
|
771
756
|
isReadOnly: !!b,
|
|
772
|
-
isSelected: (
|
|
773
|
-
getIndeterminateState: (
|
|
774
|
-
const
|
|
775
|
-
return
|
|
757
|
+
isSelected: (T) => ut(T, d, !!f),
|
|
758
|
+
getIndeterminateState: (T) => {
|
|
759
|
+
const I = ee(T);
|
|
760
|
+
return I ? I.selected > 0 && I.selected < I.total : !1;
|
|
776
761
|
},
|
|
777
|
-
getSelectedCount: (
|
|
778
|
-
handleSelect:
|
|
762
|
+
getSelectedCount: (T) => ee(T)?.selected || 0,
|
|
763
|
+
handleSelect: Se,
|
|
779
764
|
id: w
|
|
780
765
|
}
|
|
781
766
|
)
|
|
@@ -788,27 +773,39 @@ const yt = (re) => {
|
|
|
788
773
|
)
|
|
789
774
|
}
|
|
790
775
|
),
|
|
791
|
-
(
|
|
792
|
-
/* @__PURE__ */ a(
|
|
793
|
-
/* @__PURE__ */
|
|
776
|
+
(ue || h || $.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: h ? /* @__PURE__ */ p("div", { className: "flex items-center gap-2 text-gray-500 px-2", children: [
|
|
777
|
+
/* @__PURE__ */ a(ne, { size: "12px", className: "text-gray-400" }),
|
|
778
|
+
/* @__PURE__ */ p("span", { className: "text-xs font-medium leading-4 text-[#60697d]", children: [
|
|
794
779
|
"Maximum ",
|
|
795
|
-
|
|
780
|
+
h,
|
|
796
781
|
" selections"
|
|
797
782
|
] })
|
|
798
|
-
] }) :
|
|
799
|
-
/* @__PURE__ */ a(
|
|
783
|
+
] }) : $.length > 5e3 ? /* @__PURE__ */ p("div", { className: "flex items-center gap-2 text-gray-500 px-2", children: [
|
|
784
|
+
/* @__PURE__ */ a(ne, { size: "12px", className: "text-gray-400" }),
|
|
800
785
|
/* @__PURE__ */ a("span", { className: "text-xs font-medium leading-4 text-[#60697d]", children: "Large dataset detected. Operations might be slower." })
|
|
801
|
-
] }) :
|
|
786
|
+
] }) : ue })
|
|
802
787
|
]
|
|
803
788
|
}
|
|
804
|
-
)
|
|
805
|
-
|
|
789
|
+
) })
|
|
790
|
+
] }),
|
|
791
|
+
oe && /* @__PURE__ */ p(
|
|
792
|
+
"p",
|
|
793
|
+
{
|
|
794
|
+
className: C(
|
|
795
|
+
"text-[12px] mt-1 flex items-center gap-1",
|
|
796
|
+
K ? "text-[#e15554]" : "text-gray-500"
|
|
797
|
+
),
|
|
798
|
+
children: [
|
|
799
|
+
K && /* @__PURE__ */ a(ne, { size: "12px" }),
|
|
800
|
+
oe
|
|
801
|
+
]
|
|
802
|
+
}
|
|
806
803
|
)
|
|
807
804
|
]
|
|
808
805
|
}
|
|
809
806
|
);
|
|
810
807
|
};
|
|
811
|
-
|
|
808
|
+
xt.displayName = "Select";
|
|
812
809
|
export {
|
|
813
|
-
|
|
810
|
+
xt as default
|
|
814
811
|
};
|