impact-nova 1.2.4 → 1.5.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/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.js +1 -1
- 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.d.ts +1 -1
- package/dist/components/ui/alert.js +76 -60
- package/dist/components/ui/breadcrumb.js +81 -74
- package/dist/components/ui/calendar.js +355 -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 -85
- package/dist/components/ui/select/select.js +225 -229
- 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/tabs.d.ts +11 -1
- package/dist/components/ui/tabs.js +79 -54
- 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/assets/webp/delete-3d.webp.js +4 -0
- package/dist/icons/assets/webp/info-3d.webp.js +4 -0
- package/dist/icons/assets/webp/success-3d.webp.js +4 -0
- package/dist/icons/assets/webp/warning-3d.webp.js +4 -0
- package/dist/icons/index.d.ts +8 -0
- package/dist/icons/index.js +197 -181
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +260 -199
- package/package.json +36 -4
- package/dist/components/ui/ag-grid-react/cell-renderers/types.js +0 -74
|
@@ -1,121 +1,116 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as q, useRef 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
|
-
isSearchable:
|
|
26
|
-
placeholder:
|
|
25
|
+
isClearable: ke = !0,
|
|
26
|
+
isSearchable: F = !0,
|
|
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
|
-
isRequired:
|
|
38
|
-
error:
|
|
39
|
-
helperText:
|
|
37
|
+
label: ue,
|
|
38
|
+
isRequired: Ge,
|
|
39
|
+
error: Q,
|
|
40
|
+
helperText: de,
|
|
40
41
|
id: V,
|
|
41
|
-
className:
|
|
42
|
-
parentClassName:
|
|
43
|
-
onMenuScrollToBottom:
|
|
44
|
-
name:
|
|
45
|
-
isSelectAllEnabled:
|
|
42
|
+
className: Me,
|
|
43
|
+
parentClassName: ze,
|
|
44
|
+
onMenuScrollToBottom: X,
|
|
45
|
+
name: Ee,
|
|
46
|
+
isSelectAllEnabled: fe = !0,
|
|
46
47
|
isReadOnly: b = !1,
|
|
47
|
-
searchPosition:
|
|
48
|
-
footerContent:
|
|
49
|
-
onInputChange:
|
|
50
|
-
getOptionLabel:
|
|
51
|
-
renderOption:
|
|
48
|
+
searchPosition: L = "menu",
|
|
49
|
+
footerContent: me,
|
|
50
|
+
onInputChange: Re,
|
|
51
|
+
getOptionLabel: pe,
|
|
52
|
+
renderOption: he,
|
|
52
53
|
onMenuOpen: Fe,
|
|
53
|
-
onMenuClose:
|
|
54
|
-
labelOrientation:
|
|
55
|
-
leftContent:
|
|
56
|
-
ignoreCase:
|
|
57
|
-
ignoreAccents:
|
|
58
|
-
matchFrom:
|
|
59
|
-
stringify:
|
|
60
|
-
trim:
|
|
61
|
-
filterOption:
|
|
54
|
+
onMenuClose: xe,
|
|
55
|
+
labelOrientation: be = "top",
|
|
56
|
+
leftContent: ge,
|
|
57
|
+
ignoreCase: Le,
|
|
58
|
+
ignoreAccents: He,
|
|
59
|
+
matchFrom: je,
|
|
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
|
-
} =
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}, [
|
|
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);
|
|
72
|
+
R(() => {
|
|
73
|
+
K !== void 0 && g(K);
|
|
74
|
+
}, [K]), R(() => {
|
|
74
75
|
let e;
|
|
75
|
-
return S &&
|
|
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
|
-
}, [S,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}, [S]);
|
|
89
|
-
const { flatOptions: x, isProcessing: P, totalOptionsCount: we, workerSelectAll: Qe } = ht($, L, {
|
|
90
|
-
ignoreCase: Ee,
|
|
91
|
-
ignoreAccents: Re,
|
|
92
|
-
matchFrom: Le,
|
|
93
|
-
stringify: je,
|
|
94
|
-
trim: qe,
|
|
95
|
-
filterOption: He,
|
|
81
|
+
}, [S, F, L]);
|
|
82
|
+
const { flatOptions: x, isProcessing: P, totalOptionsCount: Ve, workerSelectAll: Ze } = bt(I, T, {
|
|
83
|
+
ignoreCase: Le,
|
|
84
|
+
ignoreAccents: He,
|
|
85
|
+
matchFrom: je,
|
|
86
|
+
stringify: qe,
|
|
87
|
+
trim: _e,
|
|
88
|
+
filterOption: Be,
|
|
96
89
|
enableSubMenus: v,
|
|
97
90
|
enableGroups: N
|
|
98
|
-
}), w =
|
|
91
|
+
}), w = gt(d, f ?? !1), { stats: G, getGroupStats: ne } = vt(
|
|
99
92
|
x,
|
|
100
|
-
|
|
101
|
-
|
|
93
|
+
Ve,
|
|
94
|
+
T,
|
|
102
95
|
w,
|
|
103
96
|
d,
|
|
104
97
|
f ?? !1
|
|
105
|
-
), D =
|
|
98
|
+
), D = rt({
|
|
106
99
|
count: x.length,
|
|
107
100
|
getScrollElement: () => j.current,
|
|
108
|
-
estimateSize: () =>
|
|
101
|
+
estimateSize: () => 34,
|
|
109
102
|
overscan: 5
|
|
110
103
|
});
|
|
111
|
-
|
|
104
|
+
R(() => {
|
|
105
|
+
S || Z(void 0);
|
|
106
|
+
}, [S]), R(() => {
|
|
112
107
|
if (!S) return;
|
|
113
108
|
const e = requestAnimationFrame(() => {
|
|
114
109
|
D.measure();
|
|
115
110
|
});
|
|
116
111
|
return () => cancelAnimationFrame(e);
|
|
117
|
-
}, [S, D]),
|
|
118
|
-
if (S &&
|
|
112
|
+
}, [S, D]), R(() => {
|
|
113
|
+
if (S && oe && !P && x.length > 0) {
|
|
119
114
|
const e = x.findIndex((t) => f ? w.mode === "exclude" ? !w.set.has(t.value) : w.set.has(t.value) : d?.value === t.value);
|
|
120
115
|
if (e !== -1) {
|
|
121
116
|
const t = setTimeout(() => {
|
|
@@ -124,44 +119,44 @@ const gt = (ie) => {
|
|
|
124
119
|
return () => clearTimeout(t);
|
|
125
120
|
}
|
|
126
121
|
}
|
|
127
|
-
}, [S,
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
if (!j.current || !
|
|
122
|
+
}, [S, oe, P, x.length, f, w.mode, w.set, d, D]);
|
|
123
|
+
const M = E(null);
|
|
124
|
+
R(() => {
|
|
125
|
+
if (!j.current || !X) return;
|
|
131
126
|
const e = () => {
|
|
132
127
|
if (A || P) return;
|
|
133
128
|
const { scrollTop: n, scrollHeight: r, clientHeight: s } = j.current;
|
|
134
129
|
if (r - n - s <= 10) {
|
|
135
|
-
if (
|
|
136
|
-
|
|
137
|
-
|
|
130
|
+
if (M.current) return;
|
|
131
|
+
X(), M.current = setTimeout(() => {
|
|
132
|
+
M.current = null;
|
|
138
133
|
}, 500);
|
|
139
134
|
}
|
|
140
135
|
}, t = j.current;
|
|
141
136
|
return t.addEventListener("scroll", e), !A && !P && e(), () => {
|
|
142
|
-
t.removeEventListener("scroll", e),
|
|
137
|
+
t.removeEventListener("scroll", e), M.current && (clearTimeout(M.current), M.current = null);
|
|
143
138
|
};
|
|
144
139
|
}, [
|
|
145
|
-
|
|
140
|
+
X,
|
|
146
141
|
x.length,
|
|
147
142
|
S,
|
|
148
143
|
A,
|
|
149
144
|
P
|
|
150
145
|
]);
|
|
151
|
-
const
|
|
146
|
+
const et = (e) => {
|
|
152
147
|
if (!C)
|
|
153
|
-
if (
|
|
148
|
+
if (we(e), e)
|
|
154
149
|
Fe?.();
|
|
155
150
|
else {
|
|
156
151
|
const t = d, n = f && y(d) ? d.map((r) => r.value) : void 0;
|
|
157
|
-
|
|
152
|
+
xe?.(t, n), B(""), ee(null);
|
|
158
153
|
}
|
|
159
|
-
},
|
|
154
|
+
}, Ne = (e) => {
|
|
160
155
|
if (!(C || b || e.isDisabled || ("children" in e || "options" in e) && e.isParentSelectable === !1))
|
|
161
156
|
if (f) {
|
|
162
157
|
const n = d || [];
|
|
163
158
|
if ("children" in e || "options" in e) {
|
|
164
|
-
const s =
|
|
159
|
+
const s = xt(
|
|
165
160
|
e,
|
|
166
161
|
v,
|
|
167
162
|
N
|
|
@@ -174,7 +169,7 @@ const gt = (ie) => {
|
|
|
174
169
|
i ? s.forEach((m) => {
|
|
175
170
|
c.includes(m.value) || c.push(m.value);
|
|
176
171
|
}) : c = c.filter(
|
|
177
|
-
(m) => !s.some((
|
|
172
|
+
(m) => !s.some((U) => U.value === m)
|
|
178
173
|
);
|
|
179
174
|
const o = {
|
|
180
175
|
isAllSelected: !0,
|
|
@@ -193,7 +188,7 @@ const gt = (ie) => {
|
|
|
193
188
|
(o) => !s.some((m) => m.value === o.value)
|
|
194
189
|
) : s.forEach((o) => {
|
|
195
190
|
c.some((m) => m.value === o.value) || c.push(o);
|
|
196
|
-
}),
|
|
191
|
+
}), p && c.length > p)
|
|
197
192
|
return;
|
|
198
193
|
g(c), u && u(c, {
|
|
199
194
|
action: "select-option",
|
|
@@ -218,7 +213,7 @@ const gt = (ie) => {
|
|
|
218
213
|
if (s)
|
|
219
214
|
l = r.filter((i) => i.value !== e.value);
|
|
220
215
|
else {
|
|
221
|
-
if (
|
|
216
|
+
if (p && n.length >= p)
|
|
222
217
|
return;
|
|
223
218
|
l = [...r, e];
|
|
224
219
|
}
|
|
@@ -231,22 +226,22 @@ const gt = (ie) => {
|
|
|
231
226
|
g(e), u && u(e, {
|
|
232
227
|
action: "select-option",
|
|
233
228
|
option: e
|
|
234
|
-
}),
|
|
235
|
-
},
|
|
229
|
+
}), $e && (we(!1), xe?.(e, void 0), B(""));
|
|
230
|
+
}, tt = async () => {
|
|
236
231
|
if (!(!f || C || b)) {
|
|
237
|
-
if (
|
|
232
|
+
if (I.length > 3e3) {
|
|
238
233
|
try {
|
|
239
|
-
const e = await
|
|
234
|
+
const e = await Ze(
|
|
240
235
|
d,
|
|
241
236
|
k(d),
|
|
242
|
-
|
|
237
|
+
p
|
|
243
238
|
);
|
|
244
239
|
g(e), u && u(e, { action: "select-option" });
|
|
245
240
|
} catch {
|
|
246
241
|
}
|
|
247
242
|
return;
|
|
248
243
|
}
|
|
249
|
-
if (
|
|
244
|
+
if (T) {
|
|
250
245
|
let e = !1;
|
|
251
246
|
for (const n of x)
|
|
252
247
|
if (!n.isGroup && !n.isSubmenuParent && !n.isDisabled) {
|
|
@@ -286,12 +281,12 @@ const gt = (ie) => {
|
|
|
286
281
|
for (const o of x)
|
|
287
282
|
!o.isGroup && !o.isSubmenuParent && !o.isDisabled && (c.has(o.value) || (i.push(o), c.add(o.value)));
|
|
288
283
|
}
|
|
289
|
-
if (
|
|
284
|
+
if (p && i.length > p)
|
|
290
285
|
return;
|
|
291
286
|
g(i), u && u(i, { action: "select-option" });
|
|
292
287
|
}
|
|
293
|
-
} else if (
|
|
294
|
-
const e = d, { totalVisible: t } = G, n = y(e) ? e.length : 0, r = Math.min(t,
|
|
288
|
+
} else if (p) {
|
|
289
|
+
const e = d, { totalVisible: t } = G, n = y(e) ? e.length : 0, r = Math.min(t, p);
|
|
295
290
|
if (y(e) && n >= r && n > 0) {
|
|
296
291
|
const s = e.filter((l) => l.isDisabled);
|
|
297
292
|
g(s), u && u(s, {
|
|
@@ -303,7 +298,7 @@ const gt = (ie) => {
|
|
|
303
298
|
);
|
|
304
299
|
let l = s.length;
|
|
305
300
|
for (const i of x)
|
|
306
|
-
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))
|
|
307
302
|
break;
|
|
308
303
|
g(s), u && u(s, {
|
|
309
304
|
action: "select-option"
|
|
@@ -311,7 +306,7 @@ const gt = (ie) => {
|
|
|
311
306
|
}
|
|
312
307
|
} else {
|
|
313
308
|
const e = d, t = k(e) && e.excludedValues.length === 0;
|
|
314
|
-
if (
|
|
309
|
+
if (re.enableInvertedSelection)
|
|
315
310
|
if (t) {
|
|
316
311
|
const n = y(e) ? e.filter((r) => r.isDisabled) : [];
|
|
317
312
|
g(n), u && u(n, {
|
|
@@ -344,7 +339,7 @@ const gt = (ie) => {
|
|
|
344
339
|
}
|
|
345
340
|
}
|
|
346
341
|
}
|
|
347
|
-
},
|
|
342
|
+
}, lt = (e) => {
|
|
348
343
|
if (e.stopPropagation(), !b)
|
|
349
344
|
if (f) {
|
|
350
345
|
const t = [], n = (s) => {
|
|
@@ -363,9 +358,9 @@ const gt = (ie) => {
|
|
|
363
358
|
i.isDisabled && (w.mode === "exclude" ? !w.set.has(i.value) : w.set.has(i.value)) && t.push(i);
|
|
364
359
|
}
|
|
365
360
|
};
|
|
366
|
-
n(
|
|
361
|
+
n(I);
|
|
367
362
|
const r = t;
|
|
368
|
-
g(r), u && u(r, { action: "clear" }),
|
|
363
|
+
g(r), u && u(r, { action: "clear" }), Se?.();
|
|
369
364
|
} else {
|
|
370
365
|
const t = d;
|
|
371
366
|
if (t) {
|
|
@@ -392,125 +387,121 @@ const gt = (ie) => {
|
|
|
392
387
|
}
|
|
393
388
|
}
|
|
394
389
|
};
|
|
395
|
-
if (s(
|
|
390
|
+
if (s(I), r?.isDisabled)
|
|
396
391
|
return;
|
|
397
392
|
}
|
|
398
393
|
const n = null;
|
|
399
|
-
g(n), u && u(n, { action: "clear" }),
|
|
394
|
+
g(n), u && u(n, { action: "clear" }), Se?.();
|
|
400
395
|
}
|
|
401
|
-
},
|
|
396
|
+
}, nt = (e) => ht(
|
|
402
397
|
e,
|
|
403
|
-
|
|
398
|
+
ce ?? !1,
|
|
404
399
|
f ?? !1,
|
|
405
400
|
Te,
|
|
406
401
|
d
|
|
407
|
-
),
|
|
402
|
+
), W = (e) => pe ? pe(e) : e.label, st = () => {
|
|
408
403
|
if (f) {
|
|
409
404
|
const e = d || [];
|
|
410
405
|
let t = 0;
|
|
411
|
-
return k(e) ? t =
|
|
412
|
-
"Selected (",
|
|
413
|
-
t,
|
|
414
|
-
")"
|
|
415
|
-
] });
|
|
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 }) });
|
|
416
407
|
} else {
|
|
417
408
|
const e = d;
|
|
418
|
-
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;
|
|
419
410
|
}
|
|
420
411
|
};
|
|
421
|
-
return /* @__PURE__ */
|
|
412
|
+
return /* @__PURE__ */ h(
|
|
422
413
|
"div",
|
|
423
414
|
{
|
|
424
415
|
className: O(
|
|
425
416
|
"flex gap-[6px]",
|
|
426
|
-
|
|
427
|
-
|
|
417
|
+
be === "left" ? "w-fit flex-row items-center" : "w-full flex-col",
|
|
418
|
+
ze
|
|
428
419
|
),
|
|
429
|
-
onFocus:
|
|
430
|
-
onBlur:
|
|
420
|
+
onFocus: Ue,
|
|
421
|
+
onBlur: Ye,
|
|
431
422
|
tabIndex: C ? -1 : 0,
|
|
432
423
|
"data-testid": `select-${V || "default"}`,
|
|
433
424
|
"data-component": "select",
|
|
434
425
|
children: [
|
|
435
|
-
|
|
426
|
+
ue && /* @__PURE__ */ h(
|
|
436
427
|
"label",
|
|
437
428
|
{
|
|
438
429
|
className: O(
|
|
439
430
|
"text-[12px] font-medium text-[#60697d] leading-[18px]",
|
|
440
|
-
|
|
431
|
+
be === "left" ? "shrink-0" : ""
|
|
441
432
|
),
|
|
442
433
|
children: [
|
|
443
|
-
|
|
434
|
+
ue,
|
|
444
435
|
" ",
|
|
445
|
-
|
|
436
|
+
Ge && /* @__PURE__ */ a("span", { className: "text-[red]", children: "*" })
|
|
446
437
|
]
|
|
447
438
|
}
|
|
448
439
|
),
|
|
449
|
-
/* @__PURE__ */
|
|
450
|
-
/* @__PURE__ */ a(
|
|
440
|
+
/* @__PURE__ */ h(J.Root, { open: S, onOpenChange: et, children: [
|
|
441
|
+
/* @__PURE__ */ a(J.Trigger, { asChild: !0, children: /* @__PURE__ */ a(
|
|
451
442
|
"div",
|
|
452
443
|
{
|
|
453
|
-
ref:
|
|
444
|
+
ref: Qe,
|
|
454
445
|
className: O(
|
|
455
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",
|
|
456
|
-
|
|
447
|
+
Q ? "border-[#e15554] focus:ring-[#e15554]" : "border-[#c3c8d4] hover:border-gray-400 focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500",
|
|
457
448
|
C ? "bg-[#f2f4fb] cursor-not-allowed opacity-75" : "",
|
|
458
449
|
b ? "cursor-default bg-[#f2f4fb]" : "",
|
|
459
450
|
S ? "ring-1 ring-indigo-500 border-indigo-500" : "",
|
|
460
451
|
!C && !b && "bg-white",
|
|
461
|
-
|
|
452
|
+
Me
|
|
462
453
|
),
|
|
463
454
|
id: V,
|
|
464
455
|
"data-component": "select-trigger",
|
|
465
456
|
"data-disabled": C || void 0,
|
|
466
457
|
"data-state": S ? "open" : "closed",
|
|
467
|
-
children: /* @__PURE__ */
|
|
468
|
-
|
|
469
|
-
/* @__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(
|
|
470
461
|
"div",
|
|
471
462
|
{
|
|
472
463
|
className: "flex-1 flex items-center overflow-hidden min-w-0 max-w-full",
|
|
473
464
|
"data-testid": `select-value-${V || "default"}`,
|
|
474
465
|
children: [
|
|
475
|
-
|
|
466
|
+
st() || /* @__PURE__ */ a(
|
|
476
467
|
"span",
|
|
477
468
|
{
|
|
478
469
|
className: "text-[#b4bac7] font-normal text-[14px] truncate min-w-0 block",
|
|
479
470
|
"data-testid": `select-placeholder-${V || "default"}`,
|
|
480
471
|
"data-has-value": !1,
|
|
481
|
-
children:
|
|
472
|
+
children: Je
|
|
482
473
|
}
|
|
483
474
|
),
|
|
484
|
-
|
|
475
|
+
F && S && L === "trigger" && !b && /* @__PURE__ */ a(
|
|
485
476
|
"input",
|
|
486
477
|
{
|
|
487
|
-
ref:
|
|
478
|
+
ref: Xe,
|
|
488
479
|
type: "text",
|
|
489
480
|
className: "flex-1 min-w-[50px] border-none p-0 focus:ring-0 text-sm outline-none h-full",
|
|
490
|
-
value:
|
|
491
|
-
onChange: (e) =>
|
|
481
|
+
value: T,
|
|
482
|
+
onChange: (e) => B(e.target.value),
|
|
492
483
|
onClick: (e) => e.stopPropagation(),
|
|
493
|
-
autoFocus:
|
|
494
|
-
name:
|
|
484
|
+
autoFocus: De,
|
|
485
|
+
name: Ee || void 0
|
|
495
486
|
}
|
|
496
487
|
)
|
|
497
488
|
]
|
|
498
489
|
}
|
|
499
490
|
),
|
|
500
|
-
/* @__PURE__ */ a("div", { className: "flex items-center gap-1 text-gray-400 shrink-0", children: !S && (A || P) ? /* @__PURE__ */ a(
|
|
501
|
-
|
|
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(
|
|
502
493
|
d
|
|
503
494
|
) && d.isAllSelected || y(d) && d.length > 0) || !f && d) && /* @__PURE__ */ a(
|
|
504
495
|
"div",
|
|
505
496
|
{
|
|
506
497
|
role: "button",
|
|
507
|
-
onClick:
|
|
498
|
+
onClick: lt,
|
|
508
499
|
className: "hover:text-gray-600 p-0.5",
|
|
509
|
-
children: /* @__PURE__ */ a(
|
|
500
|
+
children: /* @__PURE__ */ a(dt, { size: "11px", color: "#758490" })
|
|
510
501
|
}
|
|
511
502
|
),
|
|
512
503
|
/* @__PURE__ */ a(
|
|
513
|
-
|
|
504
|
+
Pe,
|
|
514
505
|
{
|
|
515
506
|
size: "16px",
|
|
516
507
|
className: O(
|
|
@@ -523,10 +514,10 @@ const gt = (ie) => {
|
|
|
523
514
|
] })
|
|
524
515
|
}
|
|
525
516
|
) }),
|
|
526
|
-
/* @__PURE__ */ a(
|
|
527
|
-
|
|
517
|
+
/* @__PURE__ */ a(J.Portal, { children: /* @__PURE__ */ h(
|
|
518
|
+
J.Content,
|
|
528
519
|
{
|
|
529
|
-
ref:
|
|
520
|
+
ref: te,
|
|
530
521
|
side: "bottom",
|
|
531
522
|
sideOffset: 4,
|
|
532
523
|
align: "start",
|
|
@@ -538,42 +529,44 @@ const gt = (ie) => {
|
|
|
538
529
|
onWheel: (e) => e.stopPropagation(),
|
|
539
530
|
onPointerDown: (e) => e.stopPropagation(),
|
|
540
531
|
style: {
|
|
541
|
-
width:
|
|
542
|
-
|
|
532
|
+
width: We || "var(--radix-popover-trigger-width)",
|
|
533
|
+
maxHeight: "var(--radix-popover-content-available-height)",
|
|
534
|
+
minHeight: ye ? `${ye}px` : void 0
|
|
543
535
|
},
|
|
544
536
|
className: O(
|
|
545
|
-
"z-50
|
|
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",
|
|
546
538
|
b ? "bg-[#f5f5f5]" : "bg-white"
|
|
547
539
|
),
|
|
548
540
|
"data-testid": `select-menu-${V || "default"}`,
|
|
549
541
|
"data-component": "select-menu",
|
|
550
542
|
children: [
|
|
551
|
-
/* @__PURE__ */
|
|
543
|
+
/* @__PURE__ */ h(
|
|
552
544
|
"div",
|
|
553
545
|
{
|
|
554
546
|
className: O(
|
|
555
547
|
"flex flex-col z-10 sticky top-0 px-[6px] pt-[8px]",
|
|
556
548
|
b ? "bg-[#f5f5f5]" : "bg-white",
|
|
557
|
-
!
|
|
549
|
+
!_ && (F && L === "menu" && !b || f && fe && !b && x.length > 0) ? "border-b border-solid border-gray-100" : ""
|
|
558
550
|
),
|
|
559
551
|
children: [
|
|
560
|
-
|
|
552
|
+
F && L === "menu" && !b && !_ && /* @__PURE__ */ a(
|
|
561
553
|
"div",
|
|
562
554
|
{
|
|
563
555
|
className: "p-0",
|
|
564
556
|
"data-testid": `select-search-container-${V || "default"}`,
|
|
565
|
-
children: /* @__PURE__ */
|
|
566
|
-
/* @__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" }) }),
|
|
567
559
|
/* @__PURE__ */ a(
|
|
568
560
|
"input",
|
|
569
561
|
{
|
|
570
|
-
ref:
|
|
562
|
+
ref: le,
|
|
571
563
|
type: "text",
|
|
572
564
|
className: "block w-full pl-[34px] pr-4 h-[35px] border-none border-b border-primary text-sm outline-none focus:ring-0",
|
|
573
|
-
placeholder: "
|
|
574
|
-
value:
|
|
565
|
+
placeholder: H("select.searchHere"),
|
|
566
|
+
value: T,
|
|
575
567
|
onChange: (e) => {
|
|
576
|
-
|
|
568
|
+
const t = e.target.value;
|
|
569
|
+
T === "" && t !== "" ? te.current && Z(te.current.offsetHeight) : t === "" && Z(void 0), B(t), Re?.(t);
|
|
577
570
|
},
|
|
578
571
|
onClick: (e) => e.stopPropagation(),
|
|
579
572
|
"data-testid": `select-search-input-${V || "default"}`
|
|
@@ -582,7 +575,7 @@ const gt = (ie) => {
|
|
|
582
575
|
] })
|
|
583
576
|
}
|
|
584
577
|
),
|
|
585
|
-
!A && !P && !
|
|
578
|
+
!A && !P && !_ && f && fe && !b && x.length > 0 && /* @__PURE__ */ a(
|
|
586
579
|
"div",
|
|
587
580
|
{
|
|
588
581
|
className: "pb-1",
|
|
@@ -591,16 +584,16 @@ const gt = (ie) => {
|
|
|
591
584
|
"div",
|
|
592
585
|
{
|
|
593
586
|
className: "flex items-center justify-between cursor-pointer rounded-md hover:bg-gray-100 transition-colors py-[6px] px-3 w-full",
|
|
594
|
-
onClick:
|
|
587
|
+
onClick: tt,
|
|
595
588
|
"data-testid": `select-select-all-button-${V || "default"}`,
|
|
596
|
-
children: /* @__PURE__ */
|
|
589
|
+
children: /* @__PURE__ */ h("div", { className: "flex items-center flex-1", children: [
|
|
597
590
|
/* @__PURE__ */ a("div", { className: "pointer-events-none flex", children: /* @__PURE__ */ a(
|
|
598
|
-
|
|
591
|
+
Oe,
|
|
599
592
|
{
|
|
600
593
|
checked: (() => {
|
|
601
594
|
const { totalVisible: e, selectedVisible: t } = G;
|
|
602
595
|
if (e === 0) return !1;
|
|
603
|
-
const n =
|
|
596
|
+
const n = p ? Math.min(e, p) : e;
|
|
604
597
|
return t > 0 && t < n ? "indeterminate" : t >= n;
|
|
605
598
|
})(),
|
|
606
599
|
disabled: C || b,
|
|
@@ -615,8 +608,8 @@ const gt = (ie) => {
|
|
|
615
608
|
className: "text-sm font-medium text-gray-700",
|
|
616
609
|
"data-testid": `select-select-all-label-${V || "default"}`,
|
|
617
610
|
children: (() => {
|
|
618
|
-
const { totalVisible: e, selectedVisible: t } = G, n =
|
|
619
|
-
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");
|
|
620
613
|
})()
|
|
621
614
|
}
|
|
622
615
|
)
|
|
@@ -633,21 +626,24 @@ const gt = (ie) => {
|
|
|
633
626
|
{
|
|
634
627
|
ref: j,
|
|
635
628
|
className: "flex-1 overflow-auto py-1 px-[6px]",
|
|
636
|
-
style: {
|
|
629
|
+
style: {
|
|
630
|
+
maxHeight: "297px",
|
|
631
|
+
overscrollBehavior: "contain"
|
|
632
|
+
},
|
|
637
633
|
onWheel: (e) => e.stopPropagation(),
|
|
638
634
|
onPointerDown: (e) => e.stopPropagation(),
|
|
639
|
-
children:
|
|
635
|
+
children: _ ? /* @__PURE__ */ h("div", { className: "flex flex-col items-center justify-center py-8 px-4 text-center", children: [
|
|
640
636
|
/* @__PURE__ */ a("p", { className: "text-sm text-gray-500 font-medium mb-3", children: "Something went wrong" }),
|
|
641
|
-
|
|
642
|
-
|
|
637
|
+
ve && /* @__PURE__ */ a(
|
|
638
|
+
mt,
|
|
643
639
|
{
|
|
644
640
|
size: "sm",
|
|
645
641
|
variant: "outline",
|
|
646
|
-
onClick: () =>
|
|
642
|
+
onClick: () => ve(),
|
|
647
643
|
children: "Refetch"
|
|
648
644
|
}
|
|
649
645
|
)
|
|
650
|
-
] }) : 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(
|
|
651
647
|
"div",
|
|
652
648
|
{
|
|
653
649
|
className: "flex items-center gap-2 px-3 py-2 animate-pulse",
|
|
@@ -666,10 +662,10 @@ const gt = (ie) => {
|
|
|
666
662
|
position: "relative"
|
|
667
663
|
},
|
|
668
664
|
children: D.getVirtualItems().map((e) => {
|
|
669
|
-
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(
|
|
670
666
|
t
|
|
671
|
-
),
|
|
672
|
-
return /* @__PURE__ */
|
|
667
|
+
), it = typeof ie == "string" ? ie : Y;
|
|
668
|
+
return /* @__PURE__ */ h(
|
|
673
669
|
"div",
|
|
674
670
|
{
|
|
675
671
|
"data-index": e.index,
|
|
@@ -679,7 +675,7 @@ const gt = (ie) => {
|
|
|
679
675
|
transform: `translateY(${e.start}px)`,
|
|
680
676
|
width: "100%"
|
|
681
677
|
},
|
|
682
|
-
"data-testid": `select-option-wrapper-${
|
|
678
|
+
"data-testid": `select-option-wrapper-${se}-${Y}`,
|
|
683
679
|
children: [
|
|
684
680
|
/* @__PURE__ */ a(
|
|
685
681
|
"div",
|
|
@@ -693,21 +689,21 @@ const gt = (ie) => {
|
|
|
693
689
|
paddingLeft: `${t.depth * 16 + 12}px`
|
|
694
690
|
},
|
|
695
691
|
onClick: () => {
|
|
696
|
-
l || (N && t.isGroup || v && t.isSubmenuParent) && !
|
|
692
|
+
l || (N && t.isGroup || v && t.isSubmenuParent) && !U || Ne(t);
|
|
697
693
|
},
|
|
698
|
-
onMouseEnter: (
|
|
694
|
+
onMouseEnter: ($) => {
|
|
699
695
|
if (v && t.isSubmenuParent) {
|
|
700
|
-
|
|
701
|
-
const z =
|
|
696
|
+
ee(t.value);
|
|
697
|
+
const z = $.currentTarget.getBoundingClientRect();
|
|
702
698
|
t.rect = z;
|
|
703
699
|
} else
|
|
704
|
-
|
|
700
|
+
ee(null);
|
|
705
701
|
},
|
|
706
|
-
"data-testid": `select-option-${
|
|
702
|
+
"data-testid": `select-option-${se}-${Y}`,
|
|
707
703
|
"data-state": n ? "checked" : "unchecked",
|
|
708
704
|
"data-disabled": l || void 0,
|
|
709
705
|
"data-component": "select-option",
|
|
710
|
-
children:
|
|
706
|
+
children: he ? he(
|
|
711
707
|
{
|
|
712
708
|
onClick: () => {
|
|
713
709
|
},
|
|
@@ -716,9 +712,9 @@ const gt = (ie) => {
|
|
|
716
712
|
disabled: l
|
|
717
713
|
},
|
|
718
714
|
t
|
|
719
|
-
) : /* @__PURE__ */
|
|
720
|
-
f && (N && t.isGroup || v && t.isSubmenuParent ?
|
|
721
|
-
|
|
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,
|
|
722
718
|
{
|
|
723
719
|
checked: m ? "indeterminate" : n,
|
|
724
720
|
disabled: l || b,
|
|
@@ -726,15 +722,15 @@ const gt = (ie) => {
|
|
|
726
722
|
}
|
|
727
723
|
}
|
|
728
724
|
),
|
|
729
|
-
|
|
730
|
-
|
|
725
|
+
ce && !(N && t.isGroup) && !(v && t.isSubmenuParent) ? /* @__PURE__ */ a(
|
|
726
|
+
ot,
|
|
731
727
|
{
|
|
732
|
-
label:
|
|
728
|
+
label: W(
|
|
733
729
|
t
|
|
734
730
|
),
|
|
735
|
-
sequence:
|
|
731
|
+
sequence: nt(t)
|
|
736
732
|
}
|
|
737
|
-
) : /* @__PURE__ */
|
|
733
|
+
) : /* @__PURE__ */ h("div", { className: "flex items-center gap-2 overflow-hidden w-full", children: [
|
|
738
734
|
/* @__PURE__ */ a(
|
|
739
735
|
"span",
|
|
740
736
|
{
|
|
@@ -743,16 +739,16 @@ const gt = (ie) => {
|
|
|
743
739
|
N && t.isGroup ? "text-xs font-semibold text-gray-400 uppercase tracking-wider" : n && !(v && t.isSubmenuParent) ? "font-medium" : "font-normal",
|
|
744
740
|
!(N && t.isGroup) && "text-[14px]"
|
|
745
741
|
),
|
|
746
|
-
"data-testid": `select-option-label-${
|
|
742
|
+
"data-testid": `select-option-label-${se}-${Y}`,
|
|
747
743
|
"data-state": n ? "checked" : "unchecked",
|
|
748
|
-
title:
|
|
749
|
-
children:
|
|
744
|
+
title: it,
|
|
745
|
+
children: ie
|
|
750
746
|
}
|
|
751
747
|
),
|
|
752
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 })
|
|
753
749
|
] }),
|
|
754
750
|
v && t.isSubmenuParent && /* @__PURE__ */ a(
|
|
755
|
-
|
|
751
|
+
Pe,
|
|
756
752
|
{
|
|
757
753
|
size: "12px",
|
|
758
754
|
className: "text-gray-400"
|
|
@@ -761,19 +757,19 @@ const gt = (ie) => {
|
|
|
761
757
|
] })
|
|
762
758
|
}
|
|
763
759
|
),
|
|
764
|
-
v &&
|
|
765
|
-
|
|
760
|
+
v && Ke === t.value && t.isSubmenuParent && t.rect && /* @__PURE__ */ a(
|
|
761
|
+
ct,
|
|
766
762
|
{
|
|
767
763
|
parentOption: t,
|
|
768
764
|
isMulti: !!f,
|
|
769
765
|
isReadOnly: !!b,
|
|
770
|
-
isSelected: (
|
|
771
|
-
getIndeterminateState: (
|
|
772
|
-
const z =
|
|
766
|
+
isSelected: ($) => pt($, d, !!f),
|
|
767
|
+
getIndeterminateState: ($) => {
|
|
768
|
+
const z = ne($);
|
|
773
769
|
return z ? z.selected > 0 && z.selected < z.total : !1;
|
|
774
770
|
},
|
|
775
|
-
getSelectedCount: (
|
|
776
|
-
handleSelect:
|
|
771
|
+
getSelectedCount: ($) => ne($)?.selected || 0,
|
|
772
|
+
handleSelect: Ne,
|
|
777
773
|
id: V
|
|
778
774
|
}
|
|
779
775
|
)
|
|
@@ -786,31 +782,31 @@ const gt = (ie) => {
|
|
|
786
782
|
)
|
|
787
783
|
}
|
|
788
784
|
),
|
|
789
|
-
(
|
|
790
|
-
/* @__PURE__ */ a(
|
|
791
|
-
/* @__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: [
|
|
792
788
|
"Maximum ",
|
|
793
|
-
|
|
789
|
+
p,
|
|
794
790
|
" selections"
|
|
795
791
|
] })
|
|
796
|
-
] }) :
|
|
797
|
-
/* @__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" }),
|
|
798
794
|
/* @__PURE__ */ a("span", { className: "text-xs font-medium leading-4 text-[#60697d]", children: "Large dataset detected. Operations might be slower." })
|
|
799
|
-
] }) :
|
|
795
|
+
] }) : me })
|
|
800
796
|
]
|
|
801
797
|
}
|
|
802
798
|
) })
|
|
803
799
|
] }),
|
|
804
|
-
|
|
800
|
+
de && /* @__PURE__ */ h(
|
|
805
801
|
"p",
|
|
806
802
|
{
|
|
807
803
|
className: O(
|
|
808
804
|
"text-[12px] mt-1 flex items-center gap-1",
|
|
809
|
-
|
|
805
|
+
Q ? "text-[#e15554]" : "text-gray-500"
|
|
810
806
|
),
|
|
811
807
|
children: [
|
|
812
|
-
|
|
813
|
-
|
|
808
|
+
Q && /* @__PURE__ */ a(ae, { size: "12px" }),
|
|
809
|
+
de
|
|
814
810
|
]
|
|
815
811
|
}
|
|
816
812
|
)
|
|
@@ -818,7 +814,7 @@ const gt = (ie) => {
|
|
|
818
814
|
}
|
|
819
815
|
);
|
|
820
816
|
};
|
|
821
|
-
|
|
817
|
+
wt.displayName = "Select";
|
|
822
818
|
export {
|
|
823
|
-
|
|
819
|
+
wt as default
|
|
824
820
|
};
|