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