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