impact-nova 2.1.0-alpha.4 → 2.1.0-alpha.6
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/data/ag-grid-react/ag-grid-tooltip-overflow.d.ts +3 -0
- package/dist/components/data/ag-grid-react/ag-grid-tooltip-overflow.js +6 -0
- package/dist/components/data/ag-grid-react/ag-grid.types.d.ts +15 -21
- package/dist/components/data/ag-grid-react/cell-renderers/date-display-renderer.js +1 -1
- package/dist/components/data/ag-grid-react/cell-renderers/default-text-cell-renderer.d.ts +1 -2
- package/dist/components/data/ag-grid-react/cell-renderers/default-text-cell-renderer.js +12 -6
- package/dist/components/data/ag-grid-react/cell-renderers/editors/textarea-cell-editor.js +19 -19
- package/dist/components/data/ag-grid-react/cell-renderers/select-display-renderer.js +1 -1
- package/dist/components/data/ag-grid-react/cell-renderers/switch-display-renderer.js +15 -15
- package/dist/components/data/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +1 -1
- package/dist/components/data/ag-grid-react/headers/advanced-filter/column-filter-section.js +33 -33
- package/dist/components/data/ag-grid-react/headers/components/header-info.js +66 -62
- package/dist/components/data/ag-grid-react/headers/components/info-modal.js +6 -6
- package/dist/components/data/ag-grid-react/headers/components/section-renderers.js +18 -18
- package/dist/components/data/ag-grid-react/headers/custom-header-group.js +40 -29
- package/dist/components/data/ag-grid-react/headers/custom-header.js +102 -98
- package/dist/components/data/ag-grid-react/index.d.ts +1 -1
- package/dist/components/data/ag-grid-react/index.js +136 -127
- package/dist/components/data/ag-grid-react/notify-column-indicator-sync.d.ts +7 -0
- package/dist/components/data/ag-grid-react/notify-column-indicator-sync.js +6 -0
- package/dist/components/data/ag-grid-react/theme.js +8 -4
- package/dist/components/data/ag-grid-react/use-ag-grid-truncation-tooltip.d.ts +5 -0
- package/dist/components/data/ag-grid-react/use-ag-grid-truncation-tooltip.js +13 -0
- package/dist/components/data/ag-grid-react/useGridAutoSizeStrategyOnResize.js +8 -5
- package/dist/components/data/data-table/build-column-tree-from-grid.d.ts +14 -0
- package/dist/components/data/data-table/build-column-tree-from-grid.js +95 -0
- package/dist/components/data/data-table/data-table-column-apply.d.ts +29 -0
- package/dist/components/data/data-table/data-table-column-apply.js +102 -0
- package/dist/components/data/data-table/data-table-column-def-pin.d.ts +25 -0
- package/dist/components/data/data-table/data-table-column-def-pin.js +66 -0
- package/dist/components/data/data-table/data-table-column-list-sync.d.ts +8 -0
- package/dist/components/data/data-table/data-table-column-list-sync.js +15 -0
- package/dist/components/data/data-table/data-table-column-list.d.ts +14 -4
- package/dist/components/data/data-table/data-table-column-list.js +74 -277
- package/dist/components/data/data-table/data-table-constants.d.ts +3 -4
- package/dist/components/data/data-table/data-table-context.d.ts +3 -6
- package/dist/components/data/data-table/data-table-context.js +21 -10
- package/dist/components/data/data-table/data-table-saved-views.js +26 -26
- package/dist/components/data/data-table/data-table-sheet-portal-store.d.ts +13 -0
- package/dist/components/data/data-table/data-table-sheet-portal-store.js +36 -0
- package/dist/components/data/data-table/data-table-sheet.d.ts +3 -6
- package/dist/components/data/data-table/data-table-sheet.js +4 -2
- package/dist/components/data/data-table/data-table-view-menu.js +40 -40
- package/dist/components/data/data-table/data-table.d.ts +8 -10
- package/dist/components/data/data-table/data-table.js +138 -111
- package/dist/components/data/data-table/data-table.types.d.ts +35 -0
- package/dist/components/data/data-table/index.js +28 -27
- package/dist/components/data/data-table/indicator-legend.js +6 -6
- package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +16 -0
- package/dist/components/data/data-table/use-data-table-column-list-sync.js +222 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-attributes.d.ts +8 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +72 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-context.d.ts +13 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-context.js +25 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-metrics.d.ts +6 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +41 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-parts.d.ts +31 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-parts.js +233 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-preset.d.ts +18 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-preset.js +133 -0
- package/dist/components/data/expandable-list-item/expandable-list-item.d.ts +5 -0
- package/dist/components/data/{expandable-sku/expandable-sku.types.d.ts → expandable-list-item/expandable-list-item.types.d.ts} +7 -7
- package/dist/components/data/expandable-list-item/index.d.ts +5 -0
- package/dist/components/data/expandable-list-item/index.js +19 -0
- package/dist/components/data/nested-list/components/NestedListHeader.js +11 -11
- package/dist/components/data/nested-list/components/SortableItem.js +2 -2
- package/dist/components/data-display/avatar/avatar.types.d.ts +2 -0
- package/dist/components/data-display/badge/badge.types.d.ts +2 -0
- package/dist/components/data-display/calendar/calendar-day-picker-classnames.js +11 -11
- package/dist/components/data-display/calendar/calendar-month-picker-panel.js +7 -7
- package/dist/components/data-display/calendar/calendar-week-number-cell.js +31 -31
- package/dist/components/data-display/card/card.js +8 -8
- package/dist/components/data-display/chart/chart.types.d.ts +9 -0
- package/dist/components/data-display/skeleton/skeleton.js +6 -6
- package/dist/components/data-display/statistics-card/statistics-card.js +14 -14
- package/dist/components/feedback/alert-dialog/alert-dialog.js +19 -19
- package/dist/components/feedback/dialog/dialog.js +1 -1
- package/dist/components/feedback/drawer/drawer.js +18 -18
- package/dist/components/feedback/dropdown-menu/dropdown-menu.js +70 -57
- package/dist/components/feedback/popover/popover.js +1 -1
- package/dist/components/feedback/sheet/sheet.js +1 -1
- package/dist/components/feedback/tooltip/tooltip.js +22 -22
- package/dist/components/feedback/tooltip/tooltip.variants.js +1 -1
- package/dist/components/flows/command-palette/command-palette.js +104 -104
- package/dist/components/flows/command-palette/shortcut-settings.js +34 -34
- package/dist/components/flows/filter-strip/filter-tag-list.js +4 -4
- package/dist/components/flows/notification-panel/notification-list.js +17 -17
- package/dist/components/flows/notification-panel/notification-panel.js +4 -4
- package/dist/components/flows/notification-panel/notification-panel.types.d.ts +3 -0
- package/dist/components/flows/wizard/wizard.js +8 -8
- package/dist/components/forms/combobox/combobox.js +20 -20
- package/dist/components/forms/date-picker/date-picker.js +17 -17
- package/dist/components/forms/date-picker/date-range-picker.js +3 -3
- package/dist/components/forms/date-picker/month-picker.js +1 -1
- package/dist/components/forms/date-picker/month-range-picker.js +42 -42
- package/dist/components/forms/date-picker/week-picker.js +15 -15
- package/dist/components/forms/date-picker/week-range-picker.js +3 -3
- package/dist/components/forms/file-upload/file-upload.js +33 -33
- package/dist/components/forms/input/input.js +8 -8
- package/dist/components/forms/input/input.variants.js +3 -3
- package/dist/components/forms/select/components/SelectMenuPanel.d.ts +1 -2
- package/dist/components/forms/select/components/SelectMenuPanel.js +18 -20
- package/dist/components/forms/select/components/SelectTrigger.d.ts +9 -6
- package/dist/components/forms/select/components/SelectTrigger.js +120 -122
- package/dist/components/forms/select/components/Submenu.js +8 -8
- package/dist/components/forms/select/hooks/useSelectKeyboardHandlers.d.ts +1 -1
- package/dist/components/forms/select/hooks/useSelectValueState.d.ts +19 -0
- package/dist/components/forms/select/hooks/useSelectValueState.js +41 -0
- package/dist/components/forms/select/index.js +4 -3
- package/dist/components/forms/select/select.js +180 -175
- package/dist/components/forms/select/select.types.d.ts +3 -2
- package/dist/components/forms/select/select.variants.js +4 -4
- package/dist/components/forms/select/utils/select.d.ts +2 -1
- package/dist/components/forms/select/utils/select.js +47 -37
- package/dist/components/layout/sidebar/sidebar.d.ts +7 -50
- package/dist/components/layout/sidebar/sidebar.js +12 -11
- package/dist/components/layout/sidebar/sidebar.types.d.ts +35 -1
- package/dist/components/primitives/button-group/button-group.js +32 -32
- package/dist/components/primitives/chips/chips.variants.js +5 -5
- package/dist/components/primitives/empty-container/empty-container.types.d.ts +3 -0
- package/dist/components/primitives/kbd/kbd.variants.js +3 -3
- package/dist/components/primitives/stepper/stepper.js +6 -6
- package/dist/impact-nova-components.css +113 -7
- package/dist/impact-nova-tokens.scss +2 -4
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +467 -433
- package/dist/lib/compose-refs.d.ts +8 -0
- package/dist/lib/compose-refs.js +14 -0
- package/dist/lib/primitives/field.types.d.ts +8 -2
- package/dist/lib/virtualized/index.d.ts +3 -0
- package/dist/lib/virtualized/index.js +33 -16
- package/dist/lib/virtualized/useVirtualizedList.d.ts +2 -0
- package/dist/lib/virtualized/useVirtualizedList.js +115 -109
- package/dist/lib/virtualized/virtualized-list-context.d.ts +12 -0
- package/dist/lib/virtualized/virtualized-list-context.js +21 -0
- package/dist/lib/virtualized/virtualized-list-parts.d.ts +51 -0
- package/dist/lib/virtualized/virtualized-list-parts.js +175 -0
- package/dist/lib/virtualized/virtualized-list-utils.d.ts +5 -0
- package/dist/lib/virtualized/virtualized-list-utils.js +6 -0
- package/dist/llms/rules/ag-grid.js +1 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/migration.js +1 -1
- package/dist/llms/rules/real-world-patterns.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +24 -15
- package/tailwind.config.js +1 -0
- package/dist/components/data/ag-grid-react/headers/components/truncated-text.d.ts +0 -15
- package/dist/components/data/ag-grid-react/headers/components/truncated-text.js +0 -27
- package/dist/components/data/expandable-sku/expandable-sku.d.ts +0 -38
- package/dist/components/data/expandable-sku/expandable-sku.js +0 -245
- package/dist/components/data/expandable-sku/index.d.ts +0 -2
- package/dist/components/data/expandable-sku/index.js +0 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as u, jsxs as Z } from "react/jsx-runtime";
|
|
2
|
-
import ee, { useState as
|
|
2
|
+
import ee, { useState as x, useRef as S } from "react";
|
|
3
3
|
import * as te from "@radix-ui/react-popover";
|
|
4
4
|
import { useVirtualizer as ut } from "@tanstack/react-virtual";
|
|
5
5
|
import { SelectMenuFooter as dt } from "./components/SelectMenuFooter.js";
|
|
@@ -11,24 +11,25 @@ import { cn as le } from "../../../lib/utils.js";
|
|
|
11
11
|
import { useFieldChrome as ht } from "../../../lib/primitives/use-field-chrome.js";
|
|
12
12
|
import { isOptionArray as gt, getSequence as bt } from "./utils/select.js";
|
|
13
13
|
import { useImpactNovaI18n as Ot } from "../../../i18n/use-impact-nova-i18n.js";
|
|
14
|
-
import { useFlattenOptions as
|
|
15
|
-
import { useSelectKeyboardHandlers as
|
|
14
|
+
import { useFlattenOptions as Mt } from "./hooks/useFlattenOptions.js";
|
|
15
|
+
import { useSelectKeyboardHandlers as Ct } from "./hooks/useSelectKeyboardHandlers.js";
|
|
16
|
+
import { useSelectValueState as It } from "./hooks/useSelectValueState.js";
|
|
16
17
|
import { useSelectMenuHeight as Vt } from "./hooks/useSelectMenuHeight.js";
|
|
17
18
|
import { useSelectMenuScroll as vt } from "./hooks/useSelectMenuScroll.js";
|
|
18
|
-
import { useSelectOpenEffects as
|
|
19
|
-
import { useSelectOutsideScrollLock as
|
|
20
|
-
import { useSelectSearchFocus as
|
|
21
|
-
import { useSelectSelectionHandlers as
|
|
22
|
-
import { useSelectionModel as
|
|
23
|
-
import { useVisibleStats as
|
|
24
|
-
import { SELECT_ALL_INDEX as
|
|
25
|
-
import { getSelectableOptionIndices as
|
|
19
|
+
import { useSelectOpenEffects as Lt } from "./hooks/useSelectOpenEffects.js";
|
|
20
|
+
import { useSelectOutsideScrollLock as xt } from "./hooks/useSelectOutsideScrollLock.js";
|
|
21
|
+
import { useSelectSearchFocus as At } from "./hooks/useSelectSearchFocus.js";
|
|
22
|
+
import { useSelectSelectionHandlers as yt } from "./hooks/useSelectSelectionHandlers.js";
|
|
23
|
+
import { useSelectionModel as Rt } from "./hooks/useSelectionModel.js";
|
|
24
|
+
import { useVisibleStats as Pt } from "./hooks/useVisibleStats.js";
|
|
25
|
+
import { SELECT_ALL_INDEX as wt } from "./select.constants.js";
|
|
26
|
+
import { getSelectableOptionIndices as Et } from "./utils/getSelectableOptionIndices.js";
|
|
26
27
|
const qt = (oe) => {
|
|
27
28
|
const {
|
|
28
|
-
options:
|
|
29
|
-
value:
|
|
30
|
-
defaultValue:
|
|
31
|
-
onChange:
|
|
29
|
+
options: C,
|
|
30
|
+
value: ne,
|
|
31
|
+
defaultValue: se,
|
|
32
|
+
onChange: F,
|
|
32
33
|
isMulti: re,
|
|
33
34
|
multiple: ie,
|
|
34
35
|
isDisabled: ae,
|
|
@@ -44,185 +45,190 @@ const qt = (oe) => {
|
|
|
44
45
|
defaultMenuIsOpen: pe = !1,
|
|
45
46
|
scrollToSelectedOnOpen: Se = !1,
|
|
46
47
|
maxSelectableOptions: g,
|
|
47
|
-
showSequence:
|
|
48
|
+
showSequence: T,
|
|
48
49
|
selectionOrder: he,
|
|
49
50
|
label: d,
|
|
50
51
|
required: ge,
|
|
51
52
|
isRequired: be,
|
|
52
53
|
error: Oe,
|
|
53
|
-
helperText:
|
|
54
|
-
helperTextPosition:
|
|
54
|
+
helperText: Me,
|
|
55
|
+
helperTextPosition: Ce = "absolute",
|
|
55
56
|
id: m,
|
|
56
|
-
className:
|
|
57
|
-
parentClassName:
|
|
58
|
-
onMenuScrollToBottom:
|
|
57
|
+
className: Ie,
|
|
58
|
+
parentClassName: Ve,
|
|
59
|
+
onMenuScrollToBottom: ve,
|
|
59
60
|
totalCount: Le,
|
|
60
61
|
name: xe,
|
|
61
|
-
isSelectAllEnabled:
|
|
62
|
-
isReadOnly:
|
|
62
|
+
isSelectAllEnabled: A = !0,
|
|
63
|
+
isReadOnly: n = !1,
|
|
63
64
|
searchPosition: b = "menu",
|
|
64
|
-
footerContent:
|
|
65
|
+
footerContent: N,
|
|
65
66
|
onInputChange: Ae,
|
|
66
67
|
getOptionLabel: H,
|
|
67
68
|
renderOption: ye,
|
|
68
69
|
onMenuOpen: Re,
|
|
69
|
-
onMenuClose:
|
|
70
|
-
labelOrientation:
|
|
70
|
+
onMenuClose: B,
|
|
71
|
+
labelOrientation: K = "top",
|
|
71
72
|
size: Pe = "default",
|
|
72
73
|
leftContent: we,
|
|
73
|
-
ignoreCase:
|
|
74
|
-
ignoreAccents:
|
|
75
|
-
matchFrom:
|
|
74
|
+
ignoreCase: Ee,
|
|
75
|
+
ignoreAccents: qe,
|
|
76
|
+
matchFrom: De,
|
|
76
77
|
stringify: Fe,
|
|
77
|
-
trim:
|
|
78
|
-
filterOption:
|
|
79
|
-
enableSubMenus:
|
|
80
|
-
enableGroups:
|
|
78
|
+
trim: Te,
|
|
79
|
+
filterOption: Ne,
|
|
80
|
+
enableSubMenus: I = !1,
|
|
81
|
+
enableGroups: y = !1,
|
|
81
82
|
enableInvertedSelection: He,
|
|
82
|
-
fetchError:
|
|
83
|
-
onRefetch:
|
|
84
|
-
menuWidth:
|
|
85
|
-
onClearAll:
|
|
83
|
+
fetchError: V,
|
|
84
|
+
onRefetch: Be,
|
|
85
|
+
menuWidth: Ke,
|
|
86
|
+
onClearAll: ze,
|
|
86
87
|
onFocus: $e,
|
|
87
88
|
onBlur: _e
|
|
88
|
-
} = oe, t = ie ?? re ?? !1, i = ce ?? ae ?? !1,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
89
|
+
} = oe, t = ie ?? re ?? !1, i = ce ?? ae ?? !1, je = ge ?? be ?? !1, ke = fe ?? !t, { t: O } = Ot(), R = de ?? O("select.placeholder"), [l, z] = x(pe), [f, v] = x(""), {
|
|
90
|
+
usesMenuSession: Ge,
|
|
91
|
+
currentValue: s,
|
|
92
|
+
setCurrentValue: We,
|
|
93
|
+
beginMenuSession: Xe,
|
|
94
|
+
endMenuSession: Je
|
|
95
|
+
} = It({
|
|
96
|
+
value: ne,
|
|
97
|
+
defaultValue: se,
|
|
98
|
+
isMulti: !!t,
|
|
99
|
+
onChange: F
|
|
100
|
+
}), [Qe, $] = x(null), [a, _] = x(-1), j = S(!1), Ue = ee.useId(), p = m ?? Ue, k = `${p}-listbox`, Ye = l && a >= 0 ? a === wt ? `${p}-option-select-all` : `${p}-option-${a}` : void 0, G = S(null), P = S(null), Ze = S(null), w = S(null), E = S(null);
|
|
101
|
+
At(l, h, b, E);
|
|
102
|
+
const { flatOptions: o, isProcessing: c, totalOptionsCount: W, workerSelectAll: et } = Mt(C, f, {
|
|
103
|
+
ignoreCase: Ee,
|
|
104
|
+
ignoreAccents: qe,
|
|
105
|
+
matchFrom: De,
|
|
101
106
|
stringify: Fe,
|
|
102
|
-
trim:
|
|
103
|
-
filterOption:
|
|
104
|
-
enableSubMenus:
|
|
105
|
-
enableGroups:
|
|
106
|
-
}),
|
|
107
|
+
trim: Te,
|
|
108
|
+
filterOption: Ne,
|
|
109
|
+
enableSubMenus: I,
|
|
110
|
+
enableGroups: y
|
|
111
|
+
}), tt = Vt(
|
|
107
112
|
l,
|
|
108
113
|
!!r,
|
|
109
114
|
c,
|
|
110
|
-
|
|
111
|
-
),
|
|
112
|
-
n,
|
|
113
|
-
U,
|
|
114
|
-
f,
|
|
115
|
-
C,
|
|
115
|
+
P
|
|
116
|
+
), M = Rt(s, t ?? !1), { stats: X, getGroupStats: lt } = Pt(
|
|
116
117
|
o,
|
|
118
|
+
W,
|
|
119
|
+
f,
|
|
120
|
+
M,
|
|
121
|
+
s,
|
|
117
122
|
t ?? !1
|
|
118
|
-
),
|
|
119
|
-
count:
|
|
120
|
-
getScrollElement: () =>
|
|
123
|
+
), L = ut({
|
|
124
|
+
count: o.length,
|
|
125
|
+
getScrollElement: () => w.current,
|
|
121
126
|
estimateSize: () => 34,
|
|
122
127
|
overscan: 5
|
|
123
128
|
});
|
|
124
|
-
|
|
129
|
+
Lt({
|
|
125
130
|
isOpen: l,
|
|
126
131
|
isSearchable: h,
|
|
127
132
|
searchPosition: b,
|
|
128
|
-
isReadOnly:
|
|
133
|
+
isReadOnly: n,
|
|
129
134
|
isLoading: r,
|
|
130
135
|
isProcessing: c,
|
|
131
|
-
fetchError:
|
|
136
|
+
fetchError: V,
|
|
132
137
|
isMulti: t,
|
|
133
|
-
isSelectAllEnabled:
|
|
134
|
-
flatOptions:
|
|
138
|
+
isSelectAllEnabled: A,
|
|
139
|
+
flatOptions: o,
|
|
135
140
|
searchValue: f,
|
|
136
141
|
highlightedIndex: a,
|
|
137
142
|
setHighlightedIndex: _,
|
|
138
|
-
openedViaKeyboardRef:
|
|
143
|
+
openedViaKeyboardRef: j,
|
|
139
144
|
scrollToSelectedOnOpen: Se,
|
|
140
|
-
selectionModel:
|
|
141
|
-
internalValue:
|
|
142
|
-
rowVirtualizer:
|
|
145
|
+
selectionModel: M,
|
|
146
|
+
internalValue: s,
|
|
147
|
+
rowVirtualizer: L
|
|
143
148
|
}), vt({
|
|
144
149
|
isOpen: l,
|
|
145
150
|
isLoading: r,
|
|
146
151
|
isProcessing: c,
|
|
147
|
-
flatOptions:
|
|
148
|
-
listRef:
|
|
149
|
-
rowVirtualizer:
|
|
150
|
-
onMenuScrollToBottom:
|
|
152
|
+
flatOptions: o,
|
|
153
|
+
listRef: w,
|
|
154
|
+
rowVirtualizer: L,
|
|
155
|
+
onMenuScrollToBottom: ve
|
|
151
156
|
});
|
|
152
|
-
const
|
|
157
|
+
const q = (e) => {
|
|
153
158
|
if (!(i && e))
|
|
154
|
-
if (
|
|
155
|
-
Re?.();
|
|
159
|
+
if (z(e), e)
|
|
160
|
+
Xe(), Re?.();
|
|
156
161
|
else {
|
|
157
|
-
const
|
|
158
|
-
|
|
162
|
+
const D = Ge ? Je() : s, at = t && gt(D) ? D.map((ct) => ct.value) : void 0;
|
|
163
|
+
B?.(D, at), v(""), $(null);
|
|
159
164
|
}
|
|
160
165
|
};
|
|
161
|
-
|
|
162
|
-
|
|
166
|
+
xt(l, P), ee.useEffect(() => {
|
|
167
|
+
}, [l]);
|
|
168
|
+
const J = (e) => H ? H(e) : e.label, { handleSelect: Q, handleSelectAll: U, clearValue: ot } = yt({
|
|
163
169
|
isMulti: t,
|
|
164
170
|
isDisabled: i,
|
|
165
|
-
isReadOnly:
|
|
166
|
-
internalValue:
|
|
171
|
+
isReadOnly: n,
|
|
172
|
+
internalValue: s,
|
|
167
173
|
setInternalValue: We,
|
|
168
|
-
onChange:
|
|
169
|
-
onMenuClose:
|
|
170
|
-
onClearAll:
|
|
171
|
-
enableSubMenus:
|
|
172
|
-
enableGroups:
|
|
174
|
+
onChange: F,
|
|
175
|
+
onMenuClose: B,
|
|
176
|
+
onClearAll: ze,
|
|
177
|
+
enableSubMenus: I,
|
|
178
|
+
enableGroups: y,
|
|
173
179
|
enableInvertedSelection: He,
|
|
174
180
|
maxSelectableOptions: g,
|
|
175
|
-
closeMenuOnSelect:
|
|
176
|
-
options:
|
|
177
|
-
flatOptions:
|
|
181
|
+
closeMenuOnSelect: ke,
|
|
182
|
+
options: C,
|
|
183
|
+
flatOptions: o,
|
|
178
184
|
searchValue: f,
|
|
179
|
-
selectionModel:
|
|
180
|
-
visibleStats:
|
|
181
|
-
workerSelectAll:
|
|
182
|
-
setIsOpen:
|
|
183
|
-
setSearchValue:
|
|
184
|
-
}),
|
|
185
|
+
selectionModel: M,
|
|
186
|
+
visibleStats: X,
|
|
187
|
+
workerSelectAll: et,
|
|
188
|
+
setIsOpen: z,
|
|
189
|
+
setSearchValue: v
|
|
190
|
+
}), nt = (e) => bt(
|
|
185
191
|
e,
|
|
186
|
-
|
|
192
|
+
T ?? !1,
|
|
187
193
|
t ?? !1,
|
|
188
194
|
he,
|
|
189
|
-
|
|
190
|
-
),
|
|
195
|
+
s
|
|
196
|
+
), st = () => Et({
|
|
191
197
|
isLoading: !!r,
|
|
192
198
|
isProcessing: c,
|
|
193
|
-
fetchError:
|
|
199
|
+
fetchError: V,
|
|
194
200
|
isMulti: t,
|
|
195
|
-
isSelectAllEnabled:
|
|
196
|
-
isReadOnly:
|
|
197
|
-
flatOptions:
|
|
198
|
-
enableSubMenus:
|
|
199
|
-
}), { handleTriggerKeyDown:
|
|
201
|
+
isSelectAllEnabled: A,
|
|
202
|
+
isReadOnly: n,
|
|
203
|
+
flatOptions: o,
|
|
204
|
+
enableSubMenus: I
|
|
205
|
+
}), { handleTriggerKeyDown: rt, handleSearchKeyDown: it } = Ct({
|
|
200
206
|
isDisabled: i,
|
|
201
|
-
isReadOnly:
|
|
207
|
+
isReadOnly: n,
|
|
202
208
|
isOpen: l,
|
|
203
209
|
isSearchable: h,
|
|
204
210
|
searchPosition: b,
|
|
205
|
-
getSelectableIndices:
|
|
211
|
+
getSelectableIndices: st,
|
|
206
212
|
highlightedIndex: a,
|
|
207
213
|
setHighlightedIndex: _,
|
|
208
|
-
flatOptions:
|
|
209
|
-
rowVirtualizer:
|
|
210
|
-
handleOpenChange:
|
|
211
|
-
handleSelect:
|
|
212
|
-
handleSelectAll:
|
|
213
|
-
openedViaKeyboardRef:
|
|
214
|
+
flatOptions: o,
|
|
215
|
+
rowVirtualizer: L,
|
|
216
|
+
handleOpenChange: q,
|
|
217
|
+
handleSelect: Q,
|
|
218
|
+
handleSelectAll: U,
|
|
219
|
+
openedViaKeyboardRef: j,
|
|
214
220
|
searchInputRef: E,
|
|
215
221
|
triggerRef: G
|
|
216
222
|
}), Y = ht({
|
|
217
223
|
label: d,
|
|
218
|
-
helperText:
|
|
219
|
-
helperTextPosition:
|
|
220
|
-
labelOrientation:
|
|
224
|
+
helperText: Me,
|
|
225
|
+
helperTextPosition: Ce,
|
|
226
|
+
labelOrientation: K,
|
|
221
227
|
error: Oe,
|
|
222
|
-
required:
|
|
228
|
+
required: je,
|
|
223
229
|
disabled: i,
|
|
224
|
-
className: le(
|
|
225
|
-
rootClassName:
|
|
230
|
+
className: le(K === "left" && "w-fit items-center"),
|
|
231
|
+
rootClassName: Ve
|
|
226
232
|
});
|
|
227
233
|
return /* @__PURE__ */ u(
|
|
228
234
|
"div",
|
|
@@ -230,20 +236,20 @@ const qt = (oe) => {
|
|
|
230
236
|
"data-testid": `select-${m || "default"}`,
|
|
231
237
|
"data-component": "select",
|
|
232
238
|
children: Y.wrapControl(
|
|
233
|
-
/* @__PURE__ */ Z(te.Root, { open: l && !i, onOpenChange:
|
|
239
|
+
/* @__PURE__ */ Z(te.Root, { open: l && !i, onOpenChange: q, modal: !1, children: [
|
|
234
240
|
/* @__PURE__ */ u(te.Anchor, { asChild: !0, children: /* @__PURE__ */ u(
|
|
235
241
|
St,
|
|
236
242
|
{
|
|
237
243
|
triggerRef: G,
|
|
238
|
-
inputRef:
|
|
244
|
+
inputRef: Ze,
|
|
239
245
|
selectFieldId: p,
|
|
240
|
-
listboxId:
|
|
246
|
+
listboxId: k,
|
|
241
247
|
id: m,
|
|
242
|
-
className:
|
|
248
|
+
className: Ie,
|
|
243
249
|
size: Pe,
|
|
244
250
|
error: Y.hasError,
|
|
245
251
|
isDisabled: i,
|
|
246
|
-
isReadOnly:
|
|
252
|
+
isReadOnly: n,
|
|
247
253
|
isOpen: l,
|
|
248
254
|
isLoading: r,
|
|
249
255
|
isProcessing: c,
|
|
@@ -251,65 +257,64 @@ const qt = (oe) => {
|
|
|
251
257
|
isSearchable: h,
|
|
252
258
|
searchPosition: b,
|
|
253
259
|
searchValue: f,
|
|
254
|
-
setSearchValue:
|
|
260
|
+
setSearchValue: v,
|
|
255
261
|
autoFocus: me,
|
|
256
262
|
name: xe,
|
|
257
263
|
label: d,
|
|
258
|
-
placeholder:
|
|
264
|
+
placeholder: R,
|
|
259
265
|
leftContent: we,
|
|
260
|
-
activeDescendantId:
|
|
261
|
-
internalValue:
|
|
266
|
+
activeDescendantId: Ye,
|
|
267
|
+
internalValue: s,
|
|
262
268
|
totalCount: Le,
|
|
263
|
-
totalOptionsCount:
|
|
269
|
+
totalOptionsCount: W,
|
|
264
270
|
formatSelectedCount: (e) => O("select.selectedCount", { count: e }),
|
|
265
|
-
resolveOptionLabel:
|
|
271
|
+
resolveOptionLabel: J,
|
|
266
272
|
isMulti: t,
|
|
267
273
|
onFocus: $e,
|
|
268
274
|
onBlur: _e,
|
|
269
|
-
onKeyDown:
|
|
270
|
-
|
|
271
|
-
onClear:
|
|
275
|
+
onKeyDown: rt,
|
|
276
|
+
onToggle: () => q(!l),
|
|
277
|
+
onClear: ot
|
|
272
278
|
}
|
|
273
279
|
) }),
|
|
274
|
-
|
|
280
|
+
/* @__PURE__ */ Z(
|
|
275
281
|
pt,
|
|
276
282
|
{
|
|
277
|
-
menuRef:
|
|
278
|
-
menuMinHeight:
|
|
279
|
-
menuWidth:
|
|
280
|
-
isReadOnly:
|
|
283
|
+
menuRef: P,
|
|
284
|
+
menuMinHeight: tt,
|
|
285
|
+
menuWidth: Ke,
|
|
286
|
+
isReadOnly: n,
|
|
281
287
|
id: m,
|
|
282
|
-
menuLabel: String(d ||
|
|
283
|
-
onClose: () => A(!1),
|
|
288
|
+
menuLabel: String(d || R),
|
|
284
289
|
children: [
|
|
285
290
|
/* @__PURE__ */ u(
|
|
286
291
|
mt,
|
|
287
292
|
{
|
|
288
293
|
id: m,
|
|
289
294
|
selectFieldId: p,
|
|
290
|
-
isReadOnly:
|
|
295
|
+
isReadOnly: n,
|
|
291
296
|
isDisabled: i,
|
|
292
297
|
isMulti: t,
|
|
293
298
|
isSearchable: h,
|
|
294
299
|
searchPosition: b,
|
|
295
|
-
fetchError:
|
|
300
|
+
fetchError: V,
|
|
296
301
|
isLoading: r,
|
|
297
302
|
isProcessing: c,
|
|
298
|
-
isSelectAllEnabled:
|
|
299
|
-
flatOptionsLength:
|
|
303
|
+
isSelectAllEnabled: A ?? !1,
|
|
304
|
+
flatOptionsLength: o.length,
|
|
300
305
|
searchInputRef: E,
|
|
301
306
|
searchValue: f,
|
|
302
307
|
searchPlaceholder: O("select.searchHere"),
|
|
303
308
|
highlightedIndex: a,
|
|
304
309
|
maxSelectableOptions: g,
|
|
305
|
-
visibleStats:
|
|
310
|
+
visibleStats: X,
|
|
306
311
|
selectAllLabel: O("select.selectAll"),
|
|
307
312
|
unselectAllLabel: O("select.unselectAll"),
|
|
308
313
|
onSearchChange: (e) => {
|
|
309
|
-
|
|
314
|
+
v(e), Ae?.(e);
|
|
310
315
|
},
|
|
311
|
-
onSearchKeyDown:
|
|
312
|
-
onSelectAll:
|
|
316
|
+
onSearchKeyDown: it,
|
|
317
|
+
onSelectAll: U
|
|
313
318
|
}
|
|
314
319
|
),
|
|
315
320
|
/* @__PURE__ */ u(
|
|
@@ -317,39 +322,39 @@ const qt = (oe) => {
|
|
|
317
322
|
{
|
|
318
323
|
className: le(
|
|
319
324
|
"flex min-h-0 flex-1 flex-col overflow-hidden",
|
|
320
|
-
!(
|
|
325
|
+
!(N || g || C.length > 5e3) && "rounded-b-[12px]"
|
|
321
326
|
),
|
|
322
327
|
children: /* @__PURE__ */ u(
|
|
323
328
|
ft,
|
|
324
329
|
{
|
|
325
|
-
fetchError:
|
|
326
|
-
onRefetch:
|
|
327
|
-
flatOptions:
|
|
330
|
+
fetchError: V,
|
|
331
|
+
onRefetch: Be,
|
|
332
|
+
flatOptions: o,
|
|
328
333
|
isLoading: r,
|
|
329
334
|
isProcessing: c,
|
|
330
335
|
isMulti: t,
|
|
331
|
-
isReadOnly:
|
|
332
|
-
enableGroups:
|
|
333
|
-
enableSubMenus:
|
|
334
|
-
showSequence:
|
|
336
|
+
isReadOnly: n,
|
|
337
|
+
enableGroups: y,
|
|
338
|
+
enableSubMenus: I,
|
|
339
|
+
showSequence: T,
|
|
335
340
|
maxSelectableOptions: g,
|
|
336
|
-
listRef:
|
|
337
|
-
listboxId:
|
|
338
|
-
listboxLabel: d ? String(d) :
|
|
339
|
-
rowVirtualizer:
|
|
341
|
+
listRef: w,
|
|
342
|
+
listboxId: k,
|
|
343
|
+
listboxLabel: d ? String(d) : R,
|
|
344
|
+
rowVirtualizer: L,
|
|
340
345
|
selectFieldId: p,
|
|
341
346
|
id: m,
|
|
342
347
|
highlightedIndex: a,
|
|
343
|
-
activeSubmenu:
|
|
348
|
+
activeSubmenu: Qe,
|
|
344
349
|
setActiveSubmenu: $,
|
|
345
|
-
internalValue:
|
|
346
|
-
selectionMode:
|
|
347
|
-
selectionSet:
|
|
348
|
-
resolveOptionLabel:
|
|
349
|
-
getSequenceForOption:
|
|
350
|
+
internalValue: s,
|
|
351
|
+
selectionMode: M.mode,
|
|
352
|
+
selectionSet: M.set,
|
|
353
|
+
resolveOptionLabel: J,
|
|
354
|
+
getSequenceForOption: nt,
|
|
350
355
|
renderOption: ye,
|
|
351
|
-
onSelect:
|
|
352
|
-
getGroupStats:
|
|
356
|
+
onSelect: Q,
|
|
357
|
+
getGroupStats: lt
|
|
353
358
|
}
|
|
354
359
|
)
|
|
355
360
|
}
|
|
@@ -357,14 +362,14 @@ const qt = (oe) => {
|
|
|
357
362
|
/* @__PURE__ */ u(
|
|
358
363
|
dt,
|
|
359
364
|
{
|
|
360
|
-
footerContent:
|
|
365
|
+
footerContent: N,
|
|
361
366
|
maxSelectableOptions: g,
|
|
362
|
-
optionCount:
|
|
367
|
+
optionCount: C.length
|
|
363
368
|
}
|
|
364
369
|
)
|
|
365
370
|
]
|
|
366
371
|
}
|
|
367
|
-
)
|
|
372
|
+
)
|
|
368
373
|
] })
|
|
369
374
|
)
|
|
370
375
|
}
|
|
@@ -82,8 +82,9 @@ export interface SelectProps<OptionType extends Option = Option, IsMulti extends
|
|
|
82
82
|
defaultValue?: PropsValue<OptionType>;
|
|
83
83
|
/**
|
|
84
84
|
* Callback fired when the value changes.
|
|
85
|
-
* Optional - if not provided,
|
|
86
|
-
*
|
|
85
|
+
* Optional - if not provided, the select keeps in-menu edits locally and
|
|
86
|
+
* commits through `onMenuClose` when the menu closes (controlled mode).
|
|
87
|
+
* Use `onChange` for immediate parent updates on every selection.
|
|
87
88
|
*/
|
|
88
89
|
onChange?: (newValue: OnChangeValue<OptionType, IsMulti>, actionMeta: ActionMeta<OptionType>) => void;
|
|
89
90
|
/**
|
|
@@ -11,7 +11,7 @@ const s = e(
|
|
|
11
11
|
},
|
|
12
12
|
error: {
|
|
13
13
|
true: "border-destructive focus-visible:ring-destructive",
|
|
14
|
-
false: "border-stroke-field hover:border-stroke focus-visible:border-brand focus-visible:ring-1 focus-visible:ring-
|
|
14
|
+
false: "border-stroke-field hover:border-stroke-strong focus-visible:border-brand focus-visible:ring-1 focus-visible:ring-brand"
|
|
15
15
|
},
|
|
16
16
|
disabled: {
|
|
17
17
|
true: "bg-canvas-disabled cursor-not-allowed opacity-75",
|
|
@@ -22,7 +22,7 @@ const s = e(
|
|
|
22
22
|
false: ""
|
|
23
23
|
},
|
|
24
24
|
open: {
|
|
25
|
-
true: "ring-1 ring-
|
|
25
|
+
true: "ring-1 ring-brand border-brand",
|
|
26
26
|
false: ""
|
|
27
27
|
}
|
|
28
28
|
},
|
|
@@ -54,11 +54,11 @@ const s = e(
|
|
|
54
54
|
false: ""
|
|
55
55
|
},
|
|
56
56
|
selected: {
|
|
57
|
-
true: "bg-brand-
|
|
57
|
+
true: "bg-brand-tint text-content",
|
|
58
58
|
false: ""
|
|
59
59
|
},
|
|
60
60
|
highlighted: {
|
|
61
|
-
true: "ring-2 ring-inset ring-brand bg-brand-
|
|
61
|
+
true: "ring-2 ring-inset ring-brand bg-brand-tint",
|
|
62
62
|
false: ""
|
|
63
63
|
}
|
|
64
64
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Option, Group, MultiValue, SingleValue, InvertedSelection } from '../select.types';
|
|
1
|
+
import { Option, Group, MultiValue, SingleValue, InvertedSelection, PropsValue } from '../select.types';
|
|
2
2
|
export declare const cx: (...classes: (string | undefined | null | false)[]) => string;
|
|
3
3
|
export declare const isInvertedSelection: <OptionType extends Option>(value: MultiValue<OptionType>) => value is InvertedSelection;
|
|
4
4
|
export declare const isOptionArray: <OptionType extends Option>(value: MultiValue<OptionType>) => value is readonly OptionType[];
|
|
@@ -10,3 +10,4 @@ export declare const getSequence: <OptionType extends Option>(option: Option | {
|
|
|
10
10
|
value: string;
|
|
11
11
|
}, showSequence: boolean, isMulti: boolean, selectionOrder: string[] | undefined, internalValue: MultiValue<OptionType> | SingleValue<OptionType> | undefined) => number | undefined;
|
|
12
12
|
export declare const getSelectedCount: <OptionType extends Option>(option: Option, isMulti: boolean, internalValue: MultiValue<OptionType> | OptionType | null) => number;
|
|
13
|
+
export declare function cloneSelectValue<OptionType extends Option>(value: PropsValue<OptionType> | undefined | null, isMulti: boolean): PropsValue<OptionType>;
|