impact-nova 2.2.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/data/ag-grid-react/ag-grid-header-dom.d.ts +8 -0
- package/dist/components/data/ag-grid-react/ag-grid-header-dom.js +11 -0
- package/dist/components/data/ag-grid-react/ag-grid-tooltip-overflow.d.ts +4 -1
- package/dist/components/data/ag-grid-react/ag-grid-tooltip-overflow.js +14 -3
- package/dist/components/data/ag-grid-react/headers/column-menu/column-header-settings-menu.d.ts +19 -0
- package/dist/components/data/ag-grid-react/headers/column-menu/column-header-settings-menu.js +74 -0
- package/dist/components/data/ag-grid-react/headers/column-menu/column-settings-menu.d.ts +4 -5
- package/dist/components/data/ag-grid-react/headers/column-menu/column-settings-menu.js +110 -144
- package/dist/components/data/ag-grid-react/headers/components/header-info.d.ts +2 -1
- package/dist/components/data/ag-grid-react/headers/components/header-info.js +73 -70
- package/dist/components/data/ag-grid-react/headers/context/grid-header-context.d.ts +0 -8
- package/dist/components/data/ag-grid-react/headers/custom-header.js +112 -118
- package/dist/components/data/ag-grid-react/headers/custom-inner-header-group.js +27 -23
- package/dist/components/data/ag-grid-react/headers/resolve-header-info-params.d.ts +10 -0
- package/dist/components/data/ag-grid-react/headers/resolve-header-info-params.js +19 -0
- package/dist/components/data/ag-grid-react/index.js +169 -210
- package/dist/components/data/ag-grid-react/info-system-story-columns.d.ts +12 -0
- package/dist/components/data/ag-grid-react/merge-column-group-defs.d.ts +3 -0
- package/dist/components/data/ag-grid-react/merge-column-group-defs.js +27 -0
- package/dist/components/data/ag-grid-react/use-ag-grid-truncation-tooltip.d.ts +2 -1
- package/dist/components/data/ag-grid-react/use-ag-grid-truncation-tooltip.js +7 -7
- package/dist/components/data/data-table/data-table-view-menu.d.ts +1 -0
- package/dist/components/feedback/dialog/dialog.js +107 -61
- package/dist/components/feedback/dropdown-menu/dropdown-menu.d.ts +1 -0
- package/dist/components/feedback/dropdown-menu/dropdown-menu.js +83 -76
- package/dist/components/feedback/popover/popover.d.ts +5 -2
- package/dist/components/feedback/popover/popover.js +43 -40
- package/dist/components/feedback/sheet/sheet.js +149 -102
- package/dist/components/forms/date-picker/date-input-behavior.d.ts +10 -4
- package/dist/components/forms/date-picker/date-input-behavior.js +86 -67
- package/dist/components/forms/date-picker/date-picker.js +59 -52
- package/dist/components/forms/date-picker/date-range-picker.js +26 -25
- package/dist/components/forms/date-picker/month-picker.js +76 -69
- package/dist/components/forms/date-picker/month-range-picker.js +41 -40
- package/dist/components/forms/date-picker/multi-date-picker.js +31 -31
- package/dist/components/forms/date-picker/multi-month-picker.js +27 -27
- package/dist/components/forms/date-picker/multi-week-picker.js +37 -37
- package/dist/components/forms/date-picker/week-picker.js +85 -78
- package/dist/components/forms/date-picker/week-range-picker.js +67 -66
- package/dist/components/forms/select/components/SelectMenuPanel.js +19 -15
- package/dist/components/forms/select/components/SelectOptionRow.js +110 -90
- package/dist/components/forms/select/components/Submenu.js +39 -34
- package/dist/components/forms/select/hooks/useSelectOpenEffects.js +65 -70
- package/dist/components/forms/select/select.js +228 -223
- package/dist/components/forms/select/select.types.d.ts +8 -0
- package/dist/impact-nova-components.css +59 -15
- package/dist/impact-nova.css +1 -1
- package/dist/lib/overlay/merge-element-refs.d.ts +2 -0
- package/dist/lib/overlay/merge-element-refs.js +17 -0
- package/dist/lib/overlay/overlay-host.constants.d.ts +4 -0
- package/dist/lib/overlay/overlay-host.constants.js +5 -0
- package/dist/lib/overlay/overlay-portal-context.d.ts +26 -0
- package/dist/lib/overlay/overlay-portal-context.js +65 -0
- package/dist/lib/overlay/use-overlay-portal-container-state.d.ts +5 -0
- package/dist/lib/overlay/use-overlay-portal-container-state.js +13 -0
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +22 -8
- package/dist/components/forms/select/components/LabelWithSequence.d.ts +0 -13
- package/dist/components/forms/select/components/LabelWithSequence.js +0 -18
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsx as u, jsxs as T } from "react/jsx-runtime";
|
|
2
2
|
import * as l from "react";
|
|
3
3
|
import { Cross as Me, CalendarMonth as Ge } from "impact-nova-icons";
|
|
4
|
-
import { format as
|
|
4
|
+
import { format as g } from "date-fns";
|
|
5
5
|
import { cn as G } from "../../../lib/utils.js";
|
|
6
|
-
import { usePickerDismissActionsRef as Je, usePickerFooterDismissNudge as Qe, createRangePickerOpenChangeHandler as Ue, parseDateInput as J, normalizeOrderedRange as Xe, compareDates as Ze, flashRangeReorder as _e, isDateInputInvalid as
|
|
6
|
+
import { usePickerDismissActionsRef as Je, usePickerFooterDismissNudge as Qe, createRangePickerOpenChangeHandler as Ue, parseDateInput as J, normalizeOrderedRange as Xe, compareDates as Ze, flashRangeReorder as _e, isDateInputInvalid as oe, resolveRangeFieldBlur as V, resolveRangePickerDismissFlash as $e, deferRangeInputBlur as Ye, maskDateInput as se, resolveDateInputOnBlur as O } from "./date-input-behavior.js";
|
|
7
7
|
import { useFieldChrome as Fe } from "../../../lib/primitives/use-field-chrome.js";
|
|
8
8
|
import { Popover as et, PopoverAnchor as tt, PopoverContent as rt } from "../../feedback/popover/popover.js";
|
|
9
|
-
import { Calendar as
|
|
10
|
-
import { buildDateBoundsMatcher as
|
|
9
|
+
import { Calendar as nt } from "../../data-display/calendar/calendar.js";
|
|
10
|
+
import { buildDateBoundsMatcher as ot } from "../../../lib/date-bounds-matcher.js";
|
|
11
11
|
import { Tooltip as ie, TooltipTrigger as le, TooltipContent as ae } from "../../feedback/tooltip/tooltip.js";
|
|
12
12
|
import { resolveWeekSelection as st } from "../../../lib/fiscal-calendar.js";
|
|
13
13
|
import { useImpactNovaI18n as it } from "../../../i18n/use-impact-nova-i18n.js";
|
|
14
14
|
import { getDateFnsLocale as lt } from "../../../i18n/getDateFnsLocale.js";
|
|
15
15
|
import { coerceWeekRangeApply as at, isWeekRangeSelection as ct } from "./calendar-selection-adapters.js";
|
|
16
|
-
const x = (t) => t?.from ? t.to ? t.to.endDate : t.from.endDate : void 0,
|
|
16
|
+
const x = (t) => t?.from ? t.to ? t.to.endDate : t.from.endDate : void 0, S = (t) => t?.from ? { from: t.from, to: t.to } : void 0;
|
|
17
17
|
function ce(t, a) {
|
|
18
18
|
return !t && !a ? !0 : !t || !a ? !1 : t.startDate.getTime() === a.startDate.getTime();
|
|
19
19
|
}
|
|
@@ -24,13 +24,13 @@ const dt = l.forwardRef(
|
|
|
24
24
|
({
|
|
25
25
|
value: t,
|
|
26
26
|
onChange: a,
|
|
27
|
-
format:
|
|
27
|
+
format: o = "MM/dd/yyyy",
|
|
28
28
|
placeholder: fe,
|
|
29
29
|
minDate: de,
|
|
30
30
|
maxDate: pe,
|
|
31
31
|
startMonth: me,
|
|
32
32
|
endMonth: ue,
|
|
33
|
-
showFooter:
|
|
33
|
+
showFooter: k = !0,
|
|
34
34
|
calendarType: L = "calendar",
|
|
35
35
|
fiscalMode: j = "basic",
|
|
36
36
|
selectionMode: K = "week",
|
|
@@ -38,8 +38,8 @@ const dt = l.forwardRef(
|
|
|
38
38
|
fiscalYearStartMonth: z = 1,
|
|
39
39
|
weekStartsOn: H = 1,
|
|
40
40
|
disabled: d,
|
|
41
|
-
className:
|
|
42
|
-
error:
|
|
41
|
+
className: ge,
|
|
42
|
+
error: ke,
|
|
43
43
|
isError: Re,
|
|
44
44
|
size: Q,
|
|
45
45
|
label: De,
|
|
@@ -50,7 +50,7 @@ const dt = l.forwardRef(
|
|
|
50
50
|
prefixClick: mt,
|
|
51
51
|
...xe
|
|
52
52
|
}, be) => {
|
|
53
|
-
const U =
|
|
53
|
+
const U = ke ?? Re, Ce = Fe({
|
|
54
54
|
label: De,
|
|
55
55
|
helperText: he,
|
|
56
56
|
helperTextPosition: ye,
|
|
@@ -60,30 +60,30 @@ const dt = l.forwardRef(
|
|
|
60
60
|
rootClassName: "w-full min-w-[240px]"
|
|
61
61
|
}), { locale: X, t: E } = it(), s = l.useMemo(() => lt(X), [X]), Z = fe ?? E("datePicker.selectWeekRange"), _ = l.useRef(null), Ie = l.useRef(null), $ = l.useRef(null), N = l.useRef(null), M = l.useRef(null);
|
|
62
62
|
l.useImperativeHandle(be, () => _.current);
|
|
63
|
-
const [p, R] = l.useState(!1), Y = Je(), { footerFlashKey: we, footerFlashTarget: Ee, popoverHandlers: We } = Qe(
|
|
63
|
+
const [p, R] = l.useState(!1), Y = Je(), { footerFlashKey: we, footerFlashTarget: Ee, popoverHandlers: We } = Qe(k, p, Y, $), W = l.useRef(!1), [c, D] = l.useState(t), [m, h] = l.useState(t?.from ? g(t.from.startDate, o, { locale: s }) : ""), [y, v] = l.useState(x(t) ? g(x(t), o, { locale: s }) : ""), [Pe, P] = l.useState(t?.from?.startDate || /* @__PURE__ */ new Date());
|
|
64
64
|
l.useEffect(() => {
|
|
65
|
-
h(t?.from ?
|
|
66
|
-
}, [t,
|
|
65
|
+
h(t?.from ? g(t.from.startDate, o, { locale: s }) : ""), v(x(t) ? g(x(t), o, { locale: s }) : ""), D(t);
|
|
66
|
+
}, [t, o, s]);
|
|
67
67
|
const Te = l.useCallback(
|
|
68
68
|
(e) => Ue({
|
|
69
69
|
disabled: d ?? void 0,
|
|
70
|
-
showFooter:
|
|
70
|
+
showFooter: k,
|
|
71
71
|
containerRef: N,
|
|
72
72
|
popoverContentRef: M,
|
|
73
73
|
setOpen: R
|
|
74
74
|
})(e),
|
|
75
|
-
[d,
|
|
75
|
+
[d, k]
|
|
76
76
|
), F = l.useRef(!1);
|
|
77
77
|
l.useEffect(() => {
|
|
78
78
|
if (p && !F.current) {
|
|
79
|
-
const e = J(m,
|
|
79
|
+
const e = J(m, o, s);
|
|
80
80
|
e.parsed ? P(e.parsed) : c?.from ? P(c.from.startDate) : t?.from && P(t.from.startDate);
|
|
81
81
|
}
|
|
82
82
|
F.current = p;
|
|
83
|
-
}, [p, m,
|
|
83
|
+
}, [p, m, o, s, c?.from, t?.from]);
|
|
84
84
|
const Se = (e) => {
|
|
85
85
|
const r = ct(e) ? e : void 0;
|
|
86
|
-
D(r), r?.from ? (h(
|
|
86
|
+
D(r), r?.from ? (h(g(r.from.startDate, o, { locale: s })), v(g(x(r), o, { locale: s }))) : (h(""), v("")), !k && r?.from && r?.to && r.from.startDate.getTime() !== r.to.startDate.getTime() && (a?.(r), R(!1));
|
|
87
87
|
}, b = l.useCallback(
|
|
88
88
|
(e) => st(e, {
|
|
89
89
|
calendarType: L,
|
|
@@ -101,89 +101,90 @@ const dt = l.forwardRef(
|
|
|
101
101
|
z,
|
|
102
102
|
H
|
|
103
103
|
]
|
|
104
|
-
),
|
|
105
|
-
const
|
|
104
|
+
), B = l.useCallback((e, r) => {
|
|
105
|
+
const n = Xe(
|
|
106
106
|
e,
|
|
107
107
|
r,
|
|
108
108
|
(i, f) => Ze(i.startDate, f.startDate)
|
|
109
109
|
);
|
|
110
|
-
return
|
|
111
|
-
}, [
|
|
112
|
-
const r = at(e,
|
|
110
|
+
return n.swapped && (n.from && h(g(n.from.startDate, o, { locale: s })), n.to && v(g(x({ from: n.from, to: n.to }), o, { locale: s })), _e(N.current)), { from: n.from, to: n.to };
|
|
111
|
+
}, [o, s]), ee = (e) => {
|
|
112
|
+
const r = at(e, S(c)), n = B(r?.from, r?.to), i = n.from ? { from: n.from, to: n.to } : void 0;
|
|
113
113
|
D(i), a?.(i), R(!1);
|
|
114
114
|
}, A = () => {
|
|
115
|
-
D(t), h(t?.from ?
|
|
115
|
+
D(t), h(t?.from ? g(t.from.startDate, o, { locale: s }) : ""), v(x(t) ? g(x(t), o, { locale: s }) : ""), R(!1);
|
|
116
116
|
}, te = () => {
|
|
117
|
-
D(void 0), h(""), v(""), a?.(void 0),
|
|
117
|
+
D(void 0), h(""), v(""), a?.(void 0), k || R(!1);
|
|
118
118
|
}, Be = (e) => {
|
|
119
|
-
const r = se(e.target.value,
|
|
119
|
+
const r = se(e.target.value, o, m);
|
|
120
120
|
if (h(r), r === "") {
|
|
121
121
|
const f = { to: c?.to };
|
|
122
|
-
D(f),
|
|
122
|
+
D(f), k || a?.(void 0);
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
|
-
const { parsed:
|
|
126
|
-
if (i &&
|
|
127
|
-
const w = { from: b(
|
|
128
|
-
D(w), c?.to && v(
|
|
125
|
+
const { parsed: n, isValid: i } = J(r, o, s);
|
|
126
|
+
if (i && n) {
|
|
127
|
+
const w = { from: b(n), to: c?.to };
|
|
128
|
+
D(w), c?.to && v(g(x(w), o, { locale: s })), P(n), k || a?.(S(w));
|
|
129
129
|
}
|
|
130
130
|
}, Ne = (e) => {
|
|
131
|
-
const r = se(e.target.value,
|
|
131
|
+
const r = se(e.target.value, o, y);
|
|
132
132
|
if (v(r), r === "") {
|
|
133
133
|
const f = { from: c?.from };
|
|
134
|
-
D(f),
|
|
134
|
+
D(f), k || a?.(S(f));
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
137
|
-
const { parsed:
|
|
138
|
-
if (i &&
|
|
139
|
-
const f = b(
|
|
140
|
-
D(w), c?.from && h(
|
|
137
|
+
const { parsed: n, isValid: i } = J(r, o, s);
|
|
138
|
+
if (i && n) {
|
|
139
|
+
const f = b(n), w = { from: c?.from, to: f };
|
|
140
|
+
D(w), c?.from && h(g(c.from.startDate, o, { locale: s })), P(n), k || a?.(S(w));
|
|
141
141
|
}
|
|
142
142
|
}, Ae = () => {
|
|
143
|
-
const e = O(m,
|
|
143
|
+
const e = O(m, o, C, s), r = O(y, o, I, s);
|
|
144
144
|
e.resetToCommitted ? h(C) : e.parsed && h(e.display), r.resetToCommitted ? v(I) : r.parsed && v(r.display);
|
|
145
|
-
let
|
|
146
|
-
|
|
147
|
-
const f =
|
|
145
|
+
let n = e.parsed ? b(e.parsed) : c?.from, i = r.parsed ? b(r.parsed) : c?.to;
|
|
146
|
+
n && i && ({ from: n, to: i } = B(n, i));
|
|
147
|
+
const f = n ? { from: n, to: i } : void 0;
|
|
148
148
|
f ? (D(f), a?.(f)) : !m && !y && (D(void 0), a?.(void 0));
|
|
149
149
|
}, re = () => {
|
|
150
150
|
Ye(
|
|
151
151
|
N,
|
|
152
152
|
M,
|
|
153
153
|
() => {
|
|
154
|
-
const e = V(m,
|
|
154
|
+
const e = V(m, o, C, s), r = V(y, o, I, s);
|
|
155
155
|
e.resetToCommitted ? h(C) : e.parsed && h(e.display), r.resetToCommitted ? v(I) : r.parsed && v(r.display);
|
|
156
|
-
let
|
|
157
|
-
|
|
158
|
-
const f =
|
|
159
|
-
D(f),
|
|
156
|
+
let n = e.parsed ? b(e.parsed) : e.resetToCommitted ? t?.from : c?.from, i = r.parsed ? b(r.parsed) : r.resetToCommitted ? t?.to : c?.to;
|
|
157
|
+
n && i && ({ from: n, to: i } = B(n, i));
|
|
158
|
+
const f = n || i ? { from: n, to: i } : void 0;
|
|
159
|
+
D(f), k || (f ? a?.(f) : !m && !y && a?.(void 0));
|
|
160
160
|
}
|
|
161
161
|
);
|
|
162
|
-
},
|
|
163
|
-
if (p &&
|
|
162
|
+
}, ne = () => {
|
|
163
|
+
if (p && k) {
|
|
164
164
|
ee();
|
|
165
165
|
return;
|
|
166
166
|
}
|
|
167
167
|
if (!p) {
|
|
168
|
-
if (
|
|
168
|
+
if (k) {
|
|
169
169
|
Ae();
|
|
170
170
|
return;
|
|
171
171
|
}
|
|
172
|
-
const e = O(m,
|
|
172
|
+
const e = O(m, o, C, s), r = O(y, o, I, s);
|
|
173
173
|
if (e.parsed || r.parsed) return;
|
|
174
174
|
W.current = !0, R(!0);
|
|
175
175
|
}
|
|
176
|
-
}, C = t?.from ?
|
|
177
|
-
const e = V(m,
|
|
178
|
-
let
|
|
179
|
-
|
|
180
|
-
const f =
|
|
176
|
+
}, C = t?.from ? g(t.from.startDate, o, { locale: s }) : "", I = x(t) ? g(x(t), o, { locale: s }) : "", Ve = C !== m, Oe = I !== y, Le = oe(m, o, s), je = oe(y, o, s), Ke = "Start Date", qe = "End Date", ze = l.useCallback(() => {
|
|
177
|
+
const e = V(m, o, C, s), r = V(y, o, I, s);
|
|
178
|
+
let n = e.parsed ? b(e.parsed) : e.resetToCommitted ? t?.from : c?.from, i = r.parsed ? b(r.parsed) : r.resetToCommitted ? t?.to : c?.to;
|
|
179
|
+
n && i && ({ from: n, to: i } = B(n, i));
|
|
180
|
+
const f = n || i ? { from: n, to: i } : void 0;
|
|
181
181
|
return $e({
|
|
182
182
|
startInput: m,
|
|
183
183
|
endInput: y,
|
|
184
184
|
committedStart: C,
|
|
185
185
|
committedEnd: I,
|
|
186
186
|
committedRange: t,
|
|
187
|
+
pendingRange: S(c),
|
|
187
188
|
computeEffectiveRange: () => f,
|
|
188
189
|
rangesEqual: (w, He) => ft(w, He)
|
|
189
190
|
});
|
|
@@ -194,9 +195,9 @@ const dt = l.forwardRef(
|
|
|
194
195
|
I,
|
|
195
196
|
t,
|
|
196
197
|
c,
|
|
197
|
-
|
|
198
|
+
o,
|
|
198
199
|
s,
|
|
199
|
-
|
|
200
|
+
B,
|
|
200
201
|
b
|
|
201
202
|
]);
|
|
202
203
|
return l.useLayoutEffect(() => {
|
|
@@ -223,7 +224,7 @@ const dt = l.forwardRef(
|
|
|
223
224
|
Q === "sm" ? "h-6" : Q === "md" ? "h-[28px]" : "h-8",
|
|
224
225
|
d && "pointer-events-none opacity-100 bg-disabled-surface border-stroke text-disabled-foreground hover:border-stroke",
|
|
225
226
|
"cursor-pointer",
|
|
226
|
-
|
|
227
|
+
ge
|
|
227
228
|
),
|
|
228
229
|
children: [
|
|
229
230
|
/* @__PURE__ */ T("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
|
|
@@ -237,9 +238,9 @@ const dt = l.forwardRef(
|
|
|
237
238
|
onBlur: re,
|
|
238
239
|
onClick: () => !d && R(!0),
|
|
239
240
|
onKeyDown: (e) => {
|
|
240
|
-
e.key === "Enter" && !d && (e.preventDefault(),
|
|
241
|
+
e.key === "Enter" && !d && (e.preventDefault(), ne()), e.key === "ArrowDown" && !p && !d && (e.preventDefault(), W.current = !0, R(!0)), e.key === "Escape" && p && (e.preventDefault(), A());
|
|
241
242
|
},
|
|
242
|
-
placeholder: p ?
|
|
243
|
+
placeholder: p ? o : Z,
|
|
243
244
|
disabled: !!d,
|
|
244
245
|
"aria-label": Ke,
|
|
245
246
|
"data-field": "start",
|
|
@@ -260,9 +261,9 @@ const dt = l.forwardRef(
|
|
|
260
261
|
onBlur: re,
|
|
261
262
|
onClick: () => !d && R(!0),
|
|
262
263
|
onKeyDown: (e) => {
|
|
263
|
-
e.key === "Enter" && !d && (e.preventDefault(),
|
|
264
|
+
e.key === "Enter" && !d && (e.preventDefault(), ne()), e.key === "ArrowDown" && !p && !d && (e.preventDefault(), W.current = !0, R(!0)), e.key === "Escape" && p && (e.preventDefault(), A());
|
|
264
265
|
},
|
|
265
|
-
placeholder: p ?
|
|
266
|
+
placeholder: p ? o : Z,
|
|
266
267
|
disabled: !!d,
|
|
267
268
|
"aria-label": qe,
|
|
268
269
|
"data-field": "end",
|
|
@@ -314,20 +315,20 @@ const dt = l.forwardRef(
|
|
|
314
315
|
},
|
|
315
316
|
...We,
|
|
316
317
|
children: /* @__PURE__ */ u(
|
|
317
|
-
|
|
318
|
+
nt,
|
|
318
319
|
{
|
|
319
320
|
pickerType: "week",
|
|
320
321
|
weekMode: "range",
|
|
321
|
-
selectedWeeks:
|
|
322
|
+
selectedWeeks: S(c),
|
|
322
323
|
footerFlashKey: we,
|
|
323
324
|
footerFlashTarget: Ee,
|
|
324
325
|
onWeekSelect: Se,
|
|
325
326
|
month: Pe,
|
|
326
327
|
onMonthChange: P,
|
|
327
|
-
disabled:
|
|
328
|
+
disabled: ot(de, pe),
|
|
328
329
|
startMonth: me,
|
|
329
330
|
endMonth: ue,
|
|
330
|
-
showFooter:
|
|
331
|
+
showFooter: k,
|
|
331
332
|
calendarType: L,
|
|
332
333
|
fiscalMode: j,
|
|
333
334
|
selectionMode: K,
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { cn as
|
|
4
|
-
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import * as a from "@radix-ui/react-popover";
|
|
3
|
+
import { cn as i } from "../../../../lib/utils.js";
|
|
4
|
+
import { useOverlayPortalContainer as m } from "../../../../lib/overlay/overlay-portal-context.js";
|
|
5
|
+
import { OVERLAY_NESTED_FLOATING_INSTANT_HIDE_CLASS as v } from "../../../../lib/overlay/overlay-host.constants.js";
|
|
6
|
+
function g({
|
|
5
7
|
menuRef: n,
|
|
6
|
-
menuMinHeight:
|
|
8
|
+
menuMinHeight: t,
|
|
7
9
|
menuWidth: l,
|
|
8
|
-
isReadOnly:
|
|
10
|
+
isReadOnly: r,
|
|
9
11
|
id: d,
|
|
10
12
|
menuLabel: s,
|
|
11
13
|
children: p
|
|
12
14
|
}) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
const c = m();
|
|
16
|
+
return /* @__PURE__ */ o(a.Portal, { container: c, children: /* @__PURE__ */ o(
|
|
17
|
+
a.Content,
|
|
15
18
|
{
|
|
16
19
|
ref: n,
|
|
17
20
|
side: "bottom",
|
|
@@ -27,21 +30,22 @@ function f({
|
|
|
27
30
|
minWidth: "var(--radix-popover-trigger-width)",
|
|
28
31
|
maxHeight: "min(320px, var(--radix-popover-content-available-height, 320px))"
|
|
29
32
|
},
|
|
30
|
-
className:
|
|
33
|
+
className: i(
|
|
31
34
|
"z-50 flex flex-col overflow-hidden rounded-[12px] p-0 text-base shadow-elevation-select focus:outline-none sm:text-sm border-none pointer-events-auto",
|
|
32
|
-
|
|
35
|
+
r ? "bg-disabled-surface" : "bg-canvas-elevated",
|
|
36
|
+
v
|
|
33
37
|
),
|
|
34
38
|
"data-testid": `select-menu-${d || "default"}`,
|
|
35
39
|
"data-component": "select-menu",
|
|
36
|
-
children: /* @__PURE__ */
|
|
40
|
+
children: /* @__PURE__ */ o(
|
|
37
41
|
"div",
|
|
38
42
|
{
|
|
39
|
-
className:
|
|
43
|
+
className: i(
|
|
40
44
|
"flex min-h-0 flex-1 flex-col overflow-hidden rounded-[12px]",
|
|
41
|
-
|
|
45
|
+
r ? "bg-disabled-surface" : "bg-canvas-elevated"
|
|
42
46
|
),
|
|
43
47
|
style: {
|
|
44
|
-
minHeight:
|
|
48
|
+
minHeight: t ? `${t}px` : void 0
|
|
45
49
|
},
|
|
46
50
|
children: p
|
|
47
51
|
}
|
|
@@ -50,5 +54,5 @@ function f({
|
|
|
50
54
|
) });
|
|
51
55
|
}
|
|
52
56
|
export {
|
|
53
|
-
|
|
57
|
+
g as SelectMenuPanel
|
|
54
58
|
};
|
|
@@ -1,136 +1,156 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { Checkmark as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { Submenu as
|
|
9
|
-
function
|
|
1
|
+
import { jsxs as w, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { memo as Y } from "react";
|
|
3
|
+
import { Checkmark as F, ChevronRight as H } from "impact-nova-icons";
|
|
4
|
+
import { Badge as J } from "../../../data-display/badge/badge.js";
|
|
5
|
+
import { cn as o } from "../../../../lib/utils.js";
|
|
6
|
+
import { selectOptionVariants as K } from "../select.variants.js";
|
|
7
|
+
import { isSelected as L } from "../utils/select.js";
|
|
8
|
+
import { Submenu as Q } from "./Submenu.js";
|
|
9
|
+
function T({
|
|
10
10
|
option: e,
|
|
11
11
|
virtualRow: s,
|
|
12
|
-
measureElement:
|
|
13
|
-
selectFieldId:
|
|
14
|
-
id:
|
|
15
|
-
isMulti:
|
|
16
|
-
isReadOnly:
|
|
17
|
-
enableGroups:
|
|
18
|
-
enableSubMenus:
|
|
19
|
-
showSequence:
|
|
20
|
-
selected:
|
|
21
|
-
isOptDisabled:
|
|
22
|
-
indeterminate:
|
|
23
|
-
selectedCount:
|
|
24
|
-
isParentSelectable:
|
|
25
|
-
highlighted:
|
|
26
|
-
activeSubmenu:
|
|
27
|
-
setActiveSubmenu:
|
|
28
|
-
optionLabel:
|
|
29
|
-
optionLabelString:
|
|
30
|
-
sequence:
|
|
31
|
-
internalValue:
|
|
32
|
-
renderOption:
|
|
33
|
-
onSelect:
|
|
12
|
+
measureElement: j,
|
|
13
|
+
selectFieldId: C,
|
|
14
|
+
id: v,
|
|
15
|
+
isMulti: f,
|
|
16
|
+
isReadOnly: u,
|
|
17
|
+
enableGroups: c,
|
|
18
|
+
enableSubMenus: a,
|
|
19
|
+
showSequence: I,
|
|
20
|
+
selected: r,
|
|
21
|
+
isOptDisabled: n,
|
|
22
|
+
indeterminate: h,
|
|
23
|
+
selectedCount: N,
|
|
24
|
+
isParentSelectable: $,
|
|
25
|
+
highlighted: z,
|
|
26
|
+
activeSubmenu: B,
|
|
27
|
+
setActiveSubmenu: y,
|
|
28
|
+
optionLabel: V,
|
|
29
|
+
optionLabelString: E,
|
|
30
|
+
sequence: d,
|
|
31
|
+
internalValue: G,
|
|
32
|
+
renderOption: S,
|
|
33
|
+
onSelect: b,
|
|
34
34
|
getGroupStats: P
|
|
35
35
|
}) {
|
|
36
|
-
const
|
|
37
|
-
return /* @__PURE__ */
|
|
36
|
+
const x = v || "default", p = String(e.value || ""), l = c && e.isGroup, g = a && e.isSubmenuParent, k = I && !l && !g;
|
|
37
|
+
return /* @__PURE__ */ w(
|
|
38
38
|
"div",
|
|
39
39
|
{
|
|
40
40
|
"data-index": s.index,
|
|
41
|
-
ref:
|
|
41
|
+
ref: j,
|
|
42
42
|
className: "absolute start-0 w-full pb-[2px]",
|
|
43
43
|
style: {
|
|
44
44
|
transform: `translateY(${s.start}px)`,
|
|
45
45
|
width: "100%"
|
|
46
46
|
},
|
|
47
|
-
"data-testid": `select-option-wrapper-${
|
|
47
|
+
"data-testid": `select-option-wrapper-${x}-${p}`,
|
|
48
48
|
children: [
|
|
49
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ t(
|
|
50
50
|
"div",
|
|
51
51
|
{
|
|
52
|
-
id: `${
|
|
53
|
-
className:
|
|
54
|
-
|
|
55
|
-
disabled:
|
|
56
|
-
readOnly:
|
|
57
|
-
selected:
|
|
58
|
-
highlighted:
|
|
52
|
+
id: `${C}-option-${s.index}`,
|
|
53
|
+
className: o(
|
|
54
|
+
K({
|
|
55
|
+
disabled: n,
|
|
56
|
+
readOnly: u,
|
|
57
|
+
selected: r && !n && !(c && e.isGroup) && !(a && e.isSubmenuParent),
|
|
58
|
+
highlighted: z && !n
|
|
59
59
|
})
|
|
60
60
|
),
|
|
61
61
|
style: {
|
|
62
62
|
paddingInlineStart: `${e.depth * 16 + 12}px`
|
|
63
63
|
},
|
|
64
64
|
onClick: () => {
|
|
65
|
-
|
|
65
|
+
n || (c && e.isGroup || a && e.isSubmenuParent) && !$ || b(e);
|
|
66
66
|
},
|
|
67
67
|
onMouseEnter: () => {
|
|
68
|
-
|
|
68
|
+
a && e.isSubmenuParent ? y(e.value) : y(null);
|
|
69
69
|
},
|
|
70
|
-
"data-testid": `select-option-${
|
|
71
|
-
"data-state":
|
|
72
|
-
"data-disabled":
|
|
70
|
+
"data-testid": `select-option-${x}-${p}`,
|
|
71
|
+
"data-state": r ? "checked" : "unchecked",
|
|
72
|
+
"data-disabled": n || void 0,
|
|
73
73
|
"data-component": "select-option",
|
|
74
74
|
role: "option",
|
|
75
|
-
"aria-selected":
|
|
76
|
-
"aria-disabled":
|
|
77
|
-
children:
|
|
75
|
+
"aria-selected": r,
|
|
76
|
+
"aria-disabled": n || void 0,
|
|
77
|
+
children: S ? S(
|
|
78
78
|
{
|
|
79
79
|
onClick: () => {
|
|
80
80
|
},
|
|
81
81
|
className: "w-full",
|
|
82
|
-
selected:
|
|
83
|
-
disabled:
|
|
82
|
+
selected: r,
|
|
83
|
+
disabled: n
|
|
84
84
|
},
|
|
85
85
|
e
|
|
86
|
-
) : /* @__PURE__ */
|
|
87
|
-
|
|
86
|
+
) : /* @__PURE__ */ w("div", { className: "flex items-center flex-1 overflow-hidden", children: [
|
|
87
|
+
f && (c && e.isGroup || a && e.isSubmenuParent ? $ : !0) && /* @__PURE__ */ t(
|
|
88
88
|
"span",
|
|
89
89
|
{
|
|
90
90
|
"aria-hidden": "true",
|
|
91
|
-
className:
|
|
91
|
+
className: o(
|
|
92
92
|
"mr-[7px] flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] border border-stroke-field bg-canvas-elevated",
|
|
93
|
-
(
|
|
94
|
-
(
|
|
93
|
+
(r || h) && "border-brand bg-accent text-brand",
|
|
94
|
+
(n || u) && "opacity-50"
|
|
95
95
|
),
|
|
96
|
-
children:
|
|
96
|
+
children: r && !h ? /* @__PURE__ */ t(F, { className: "h-3.5 w-3.5" }) : h ? /* @__PURE__ */ t("span", { className: "block h-0.5 w-2.5 bg-current" }) : null
|
|
97
97
|
}
|
|
98
98
|
),
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
99
|
+
/* @__PURE__ */ w(
|
|
100
|
+
"div",
|
|
101
|
+
{
|
|
102
|
+
className: o(
|
|
103
|
+
"flex min-w-0 flex-1 items-center overflow-hidden",
|
|
104
|
+
k ? "justify-between gap-2" : "gap-2"
|
|
105
|
+
),
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ t(
|
|
108
|
+
"span",
|
|
109
|
+
{
|
|
110
|
+
className: o(
|
|
111
|
+
"block min-w-0 truncate",
|
|
112
|
+
k && "flex-1",
|
|
113
|
+
l ? "text-xs font-semibold text-content-icon uppercase tracking-wider" : r && !g ? "font-medium" : "font-normal",
|
|
114
|
+
!l && "text-[14px]"
|
|
115
|
+
),
|
|
116
|
+
"data-testid": `select-option-label-${x}-${p}`,
|
|
117
|
+
"data-state": r ? "checked" : "unchecked",
|
|
118
|
+
title: E,
|
|
119
|
+
children: V
|
|
120
|
+
}
|
|
107
121
|
),
|
|
108
|
-
"
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
122
|
+
(l || g) && N > 0 && /* @__PURE__ */ t("span", { className: "inline-flex shrink-0 items-center justify-center rounded-full bg-brand-tint px-1.5 py-0.5 text-xs font-medium text-brand-on-subtle", children: N }),
|
|
123
|
+
k && /* @__PURE__ */ t("span", { className: "flex h-5 w-6 shrink-0 items-center justify-center", children: d !== void 0 && d > 0 ? /* @__PURE__ */ t(
|
|
124
|
+
J,
|
|
125
|
+
{
|
|
126
|
+
variant: "outline",
|
|
127
|
+
color: "primary",
|
|
128
|
+
size: "sm",
|
|
129
|
+
"data-testid": `select-option-sequence-${d}`,
|
|
130
|
+
children: d.toString()
|
|
131
|
+
}
|
|
132
|
+
) : null })
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
),
|
|
136
|
+
a && e.isSubmenuParent && /* @__PURE__ */ t(H, { size: "12px", className: "text-content-icon" })
|
|
117
137
|
] })
|
|
118
138
|
}
|
|
119
139
|
),
|
|
120
|
-
|
|
121
|
-
|
|
140
|
+
a && B === e.value && e.isSubmenuParent && /* @__PURE__ */ t(
|
|
141
|
+
Q,
|
|
122
142
|
{
|
|
123
143
|
parentOption: e,
|
|
124
|
-
isMulti: !!
|
|
125
|
-
isReadOnly: !!
|
|
126
|
-
isSelected: (
|
|
127
|
-
getIndeterminateState: (
|
|
128
|
-
const
|
|
129
|
-
return
|
|
144
|
+
isMulti: !!f,
|
|
145
|
+
isReadOnly: !!u,
|
|
146
|
+
isSelected: (i) => L(i, G, !!f),
|
|
147
|
+
getIndeterminateState: (i) => {
|
|
148
|
+
const m = P(i);
|
|
149
|
+
return m ? m.selected > 0 && m.selected < m.total : !1;
|
|
130
150
|
},
|
|
131
|
-
getSelectedCount: (
|
|
132
|
-
handleSelect:
|
|
133
|
-
id:
|
|
151
|
+
getSelectedCount: (i) => P(i)?.selected || 0,
|
|
152
|
+
handleSelect: b,
|
|
153
|
+
id: v
|
|
134
154
|
}
|
|
135
155
|
)
|
|
136
156
|
]
|
|
@@ -138,8 +158,8 @@ function H({
|
|
|
138
158
|
s.key
|
|
139
159
|
);
|
|
140
160
|
}
|
|
141
|
-
const
|
|
161
|
+
const O = Y(T);
|
|
142
162
|
export {
|
|
143
|
-
|
|
144
|
-
|
|
163
|
+
O as SelectOptionRow,
|
|
164
|
+
T as SelectOptionRowInner
|
|
145
165
|
};
|