impact-nova 2.5.9 → 2.5.10
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/data-table/column-runtime-state-guard.js +42 -42
- package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +15 -0
- package/dist/components/data/data-table/data-table-column-tree-cache.js +109 -80
- package/dist/components/data/data-table/use-data-table-column-list-sync.js +65 -62
- package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +2 -3
- package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +2 -3
- package/dist/components/data-display/calendar/calendar-day-picker-classnames.d.ts +6 -1
- package/dist/components/data-display/calendar/calendar-day-picker-classnames.js +31 -23
- package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +2 -1
- package/dist/components/data-display/calendar/calendar-day-picker-components.js +194 -162
- package/dist/components/data-display/calendar/calendar-day-picker-view.d.ts +3 -2
- package/dist/components/data-display/calendar/calendar-day-picker-view.js +130 -129
- package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +5 -1
- package/dist/components/data-display/calendar/calendar-padding-week.utils.js +20 -16
- package/dist/components/data-display/calendar/calendar-week-number-cell.d.ts +2 -1
- package/dist/components/data-display/calendar/calendar-week-number-cell.js +43 -42
- package/dist/components/data-display/calendar/calendar-week-utils.d.ts +6 -0
- package/dist/components/data-display/calendar/calendar-week-utils.js +51 -47
- package/dist/components/data-display/calendar/calendar.js +102 -100
- package/dist/components/data-display/calendar/calendar.types.d.ts +2 -0
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +4 -2
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +77 -72
- package/dist/components/feedback/dialog/dialog.js +12 -12
- package/dist/components/feedback/sheet/sheet.js +22 -22
- package/dist/components/feedback/tooltip/tab-tooltip-render.js +2 -3
- package/dist/components/flows/command-palette/shortcut-settings.js +10 -10
- package/dist/components/flows/filter-panel/filter-panel.js +4 -4
- package/dist/components/forms/date-picker/calendar-selection-adapters.d.ts +2 -0
- package/dist/components/forms/date-picker/calendar-selection-adapters.js +36 -31
- package/dist/components/forms/date-picker/date-input-behavior.d.ts +10 -0
- package/dist/components/forms/date-picker/date-input-behavior.js +111 -90
- package/dist/components/forms/date-picker/date-picker.js +71 -69
- package/dist/components/forms/date-picker/date-picker.types.d.ts +2 -0
- package/dist/components/forms/date-picker/date-range-picker.js +146 -144
- package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +1 -0
- package/dist/components/forms/date-picker/fiscal-pass-through.js +1 -0
- package/dist/components/forms/date-picker/month-picker.js +82 -80
- package/dist/components/forms/date-picker/month-range-picker.js +145 -143
- package/dist/components/forms/date-picker/multi-date-picker.js +51 -49
- package/dist/components/forms/date-picker/multi-month-picker.js +49 -47
- package/dist/components/forms/date-picker/multi-quarter-picker.js +46 -44
- package/dist/components/forms/date-picker/multi-week-picker.js +53 -51
- package/dist/components/forms/date-picker/multi-year-picker.js +48 -46
- package/dist/components/forms/date-picker/picker-story-layout.d.ts +2 -0
- package/dist/components/forms/date-picker/quarter-picker.js +46 -44
- package/dist/components/forms/date-picker/quarter-range-picker.js +45 -43
- package/dist/components/forms/date-picker/week-picker.js +82 -80
- package/dist/components/forms/date-picker/week-range-picker.js +169 -164
- package/dist/components/forms/date-picker/year-picker.js +47 -45
- package/dist/components/forms/date-picker/year-range-picker.js +47 -45
- package/dist/components/forms/select/components/SelectMenuPanel.js +3 -2
- package/dist/components/forms/select/components/SelectTriggerValue.js +2 -3
- package/dist/components/forms/select/components/Submenu.js +2 -3
- package/dist/components/forms/select/select.js +1 -0
- package/dist/form-react/Fields/WeekRangePicker.js +47 -48
- package/dist/form-react/types/fields.types.d.ts +2 -0
- package/dist/impact-nova.css +1 -1
- package/dist/lib/overlay/overlay-portal-context.js +16 -16
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +1 -1
|
@@ -1,203 +1,207 @@
|
|
|
1
|
-
import { jsx as u, jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { Cross as
|
|
1
|
+
import { jsx as u, jsxs as W } from "react/jsx-runtime";
|
|
2
|
+
import * as c from "react";
|
|
3
|
+
import { Cross as Fe, CalendarMonth as et } from "impact-nova-icons";
|
|
4
4
|
import { format as g } from "date-fns";
|
|
5
5
|
import { cn as Q } from "../../../lib/utils.js";
|
|
6
|
-
import { usePickerDismissActionsRef as
|
|
7
|
-
import { useFieldChrome as
|
|
8
|
-
import { Popover as
|
|
9
|
-
import { Calendar as
|
|
10
|
-
import { buildDateBoundsMatcher as
|
|
11
|
-
import { Tooltip as
|
|
12
|
-
import { resolveWeekSelection as
|
|
13
|
-
import { useImpactNovaI18n as
|
|
14
|
-
import { getDateFnsLocale as
|
|
15
|
-
import { coerceWeekRangeApply as
|
|
16
|
-
import { fiscalCalendarPassThrough as
|
|
6
|
+
import { usePickerDismissActionsRef as tt, usePickerFooterDismissNudge as rt, createRangePickerOpenChangeHandler as ot, parseDateInput as U, normalizeOrderedRange as nt, compareDates as st, flashRangeReorder as it, isDateInputInvalid as ce, resolveRangeFieldBlur as L, resolveRangePickerDismissFlash as ct, handlePickerEscapeKeyDown as le, handlePickerSurfacePointerDown as lt, deferRangeInputBlur as at, maskDateInput as ae, resolveDateInputOnBlur as j } from "./date-input-behavior.js";
|
|
7
|
+
import { useFieldChrome as ft } from "../../../lib/primitives/use-field-chrome.js";
|
|
8
|
+
import { Popover as dt, PopoverAnchor as pt, PopoverContent as mt } from "../../feedback/popover/popover.js";
|
|
9
|
+
import { Calendar as ut } from "../../data-display/calendar/calendar.js";
|
|
10
|
+
import { buildDateBoundsMatcher as gt } from "../../../lib/date-bounds-matcher.js";
|
|
11
|
+
import { Tooltip as fe, TooltipTrigger as de, TooltipContent as pe } from "../../feedback/tooltip/tooltip.js";
|
|
12
|
+
import { resolveWeekSelection as kt } from "../../../lib/fiscal-calendar/week-selection.js";
|
|
13
|
+
import { useImpactNovaI18n as Rt } from "../../../i18n/use-impact-nova-i18n.js";
|
|
14
|
+
import { getDateFnsLocale as ht } from "../../../i18n/getDateFnsLocale.js";
|
|
15
|
+
import { coerceWeekRangeApply as Dt, isWeekRangeSelection as yt } from "./calendar-selection-adapters.js";
|
|
16
|
+
import { fiscalCalendarPassThrough as vt } from "./fiscal-pass-through.js";
|
|
17
17
|
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;
|
|
18
|
-
function
|
|
19
|
-
return !t && !
|
|
18
|
+
function me(t, l) {
|
|
19
|
+
return !t && !l ? !0 : !t || !l ? !1 : t.startDate.getTime() === l.startDate.getTime();
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
return !t && !
|
|
21
|
+
function xt(t, l) {
|
|
22
|
+
return !t && !l ? !0 : !t || !l ? !1 : me(t.from, l.from) && me(t.to, l.to);
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const Ct = c.forwardRef(
|
|
25
25
|
({
|
|
26
26
|
value: t,
|
|
27
|
-
onChange:
|
|
27
|
+
onChange: l,
|
|
28
28
|
format: n = "MM/dd/yyyy",
|
|
29
|
-
placeholder:
|
|
30
|
-
minDate:
|
|
31
|
-
maxDate:
|
|
32
|
-
startMonth:
|
|
33
|
-
endMonth:
|
|
29
|
+
placeholder: ue,
|
|
30
|
+
minDate: ge,
|
|
31
|
+
maxDate: ke,
|
|
32
|
+
startMonth: Re,
|
|
33
|
+
endMonth: he,
|
|
34
34
|
showFooter: k = !0,
|
|
35
35
|
calendarKind: N,
|
|
36
36
|
fiscalMode: q = "basic",
|
|
37
37
|
granularity: z,
|
|
38
38
|
fiscalMonthPattern: H,
|
|
39
|
-
fiscalYearStartMonth:
|
|
40
|
-
fiscalConfig:
|
|
41
|
-
weekStartsOn:
|
|
42
|
-
showPresets:
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
fiscalYearStartMonth: K = 1,
|
|
40
|
+
fiscalConfig: De,
|
|
41
|
+
weekStartsOn: M = 1,
|
|
42
|
+
showPresets: ye,
|
|
43
|
+
showPeriodBoundaries: ve,
|
|
44
|
+
comparison: xe,
|
|
45
|
+
onComparisonChange: Ce,
|
|
45
46
|
disabled: d,
|
|
46
|
-
className:
|
|
47
|
-
error:
|
|
48
|
-
isError:
|
|
47
|
+
className: be,
|
|
48
|
+
error: we,
|
|
49
|
+
isError: Ie,
|
|
49
50
|
size: X,
|
|
50
|
-
label:
|
|
51
|
-
helperText:
|
|
52
|
-
helperTextPosition:
|
|
53
|
-
required:
|
|
54
|
-
prefix:
|
|
55
|
-
prefixClick:
|
|
56
|
-
...
|
|
57
|
-
},
|
|
58
|
-
const Z =
|
|
59
|
-
label:
|
|
60
|
-
helperText:
|
|
61
|
-
helperTextPosition:
|
|
51
|
+
label: Te,
|
|
52
|
+
helperText: Ee,
|
|
53
|
+
helperTextPosition: Pe = "absolute",
|
|
54
|
+
required: We,
|
|
55
|
+
prefix: bt,
|
|
56
|
+
prefixClick: wt,
|
|
57
|
+
...Se
|
|
58
|
+
}, Be) => {
|
|
59
|
+
const Z = we ?? Ie, Ne = ft({
|
|
60
|
+
label: Te,
|
|
61
|
+
helperText: Ee,
|
|
62
|
+
helperTextPosition: Pe,
|
|
62
63
|
error: Z,
|
|
63
|
-
required:
|
|
64
|
+
required: We,
|
|
64
65
|
disabled: d ?? void 0,
|
|
65
66
|
rootClassName: "w-full min-w-[240px]"
|
|
66
|
-
}), { locale: _, t:
|
|
67
|
-
|
|
68
|
-
const [p, R] =
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
(e)
|
|
67
|
+
}), { locale: _, t: T } = Rt(), s = c.useMemo(() => ht(_), [_]), $ = ue ?? T("datePicker.selectWeekRange"), V = N === "fiscal", G = c.useRef(null), Y = c.useRef(null), F = c.useRef(null), A = c.useRef(null), J = c.useRef(null);
|
|
68
|
+
c.useImperativeHandle(Be, () => G.current);
|
|
69
|
+
const [p, R] = c.useState(!1), ee = tt(), { footerFlashKey: Ve, footerFlashTarget: Ae, popoverHandlers: Oe } = rt(k, p, ee, F), E = c.useRef(!1), [a, h] = c.useState(t), [m, D] = c.useState(t?.from ? g(t.from.startDate, n, { locale: s }) : ""), [y, v] = c.useState(x(t) ? g(x(t), n, { locale: s }) : ""), [Le, P] = c.useState(t?.from?.startDate || /* @__PURE__ */ new Date()), je = t?.from?.startDate.getTime(), qe = x(t)?.getTime(), te = c.useRef(t);
|
|
70
|
+
c.useEffect(() => {
|
|
71
|
+
te.current = t;
|
|
72
|
+
}), c.useEffect(() => {
|
|
73
|
+
const e = te.current;
|
|
74
|
+
D(e?.from ? g(e.from.startDate, n, { locale: s }) : ""), v(x(e) ? g(x(e), n, { locale: s }) : ""), h(e);
|
|
75
|
+
}, [je, qe, n, s]);
|
|
76
|
+
const ze = c.useCallback(
|
|
77
|
+
(e) => ot({
|
|
74
78
|
disabled: d ?? void 0,
|
|
75
79
|
showFooter: k,
|
|
76
|
-
containerRef:
|
|
80
|
+
containerRef: A,
|
|
77
81
|
popoverContentRef: J,
|
|
78
82
|
setOpen: R
|
|
79
83
|
})(e),
|
|
80
84
|
[d, k]
|
|
81
|
-
),
|
|
82
|
-
|
|
83
|
-
if (p && !
|
|
85
|
+
), re = c.useRef(!1);
|
|
86
|
+
c.useEffect(() => {
|
|
87
|
+
if (p && !re.current && !V) {
|
|
84
88
|
const e = U(m, n, s);
|
|
85
|
-
e.parsed ?
|
|
89
|
+
e.parsed ? P(e.parsed) : a?.from ? P(a.from.startDate) : t?.from && P(t.from.startDate);
|
|
86
90
|
}
|
|
87
|
-
|
|
88
|
-
}, [p, m, n, s, a?.from, t?.from,
|
|
89
|
-
const
|
|
90
|
-
const r =
|
|
91
|
-
h(r), r?.from ? (D(g(r.from.startDate, n, { locale: s })), v(g(x(r), n, { locale: s }))) : (D(""), v("")), !k && r?.from && r?.to && r.from.startDate.getTime() !== r.to.startDate.getTime() && (
|
|
92
|
-
}, C =
|
|
93
|
-
(e) =>
|
|
91
|
+
re.current = p;
|
|
92
|
+
}, [p, m, n, s, a?.from, t?.from, V]);
|
|
93
|
+
const He = (e) => {
|
|
94
|
+
const r = yt(e) ? e : void 0;
|
|
95
|
+
h(r), r?.from ? (D(g(r.from.startDate, n, { locale: s })), v(g(x(r), n, { locale: s }))) : (D(""), v("")), !k && r?.from && r?.to && r.from.startDate.getTime() !== r.to.startDate.getTime() && (l?.(r), R(!1));
|
|
96
|
+
}, C = c.useCallback(
|
|
97
|
+
(e) => kt(e, {
|
|
94
98
|
calendarKind: N,
|
|
95
99
|
fiscalMode: q,
|
|
96
100
|
granularity: z,
|
|
97
101
|
fiscalMonthPattern: H,
|
|
98
|
-
fiscalYearStartMonth:
|
|
99
|
-
weekStartsOn:
|
|
102
|
+
fiscalYearStartMonth: K,
|
|
103
|
+
weekStartsOn: M
|
|
100
104
|
}),
|
|
101
105
|
[
|
|
102
106
|
N,
|
|
103
107
|
q,
|
|
104
108
|
z,
|
|
105
109
|
H,
|
|
106
|
-
|
|
107
|
-
|
|
110
|
+
K,
|
|
111
|
+
M
|
|
108
112
|
]
|
|
109
|
-
), B =
|
|
110
|
-
const o =
|
|
113
|
+
), B = c.useCallback((e, r) => {
|
|
114
|
+
const o = nt(
|
|
111
115
|
e,
|
|
112
116
|
r,
|
|
113
|
-
(i, f) =>
|
|
117
|
+
(i, f) => st(i.startDate, f.startDate)
|
|
114
118
|
);
|
|
115
|
-
return o.swapped && (o.from && D(g(o.from.startDate, n, { locale: s })), o.to && v(g(x({ from: o.from, to: o.to }), n, { locale: s })),
|
|
116
|
-
}, [n, s]),
|
|
117
|
-
const r =
|
|
118
|
-
h(i),
|
|
119
|
+
return o.swapped && (o.from && D(g(o.from.startDate, n, { locale: s })), o.to && v(g(x({ from: o.from, to: o.to }), n, { locale: s })), it(A.current)), { from: o.from, to: o.to };
|
|
120
|
+
}, [n, s]), oe = (e) => {
|
|
121
|
+
const r = Dt(e, S(a)), o = B(r?.from, r?.to), i = o.from ? { from: o.from, to: o.to } : void 0;
|
|
122
|
+
h(i), l?.(i), R(!1);
|
|
119
123
|
}, O = () => {
|
|
120
124
|
h(t), D(t?.from ? g(t.from.startDate, n, { locale: s }) : ""), v(x(t) ? g(x(t), n, { locale: s }) : ""), R(!1);
|
|
121
|
-
},
|
|
122
|
-
h(void 0), D(""), v(""),
|
|
123
|
-
},
|
|
124
|
-
const r =
|
|
125
|
+
}, ne = () => {
|
|
126
|
+
h(void 0), D(""), v(""), l?.(void 0), k || R(!1);
|
|
127
|
+
}, Ke = (e) => {
|
|
128
|
+
const r = ae(e.target.value, n, m);
|
|
125
129
|
if (D(r), r === "") {
|
|
126
130
|
const f = { to: a?.to };
|
|
127
|
-
h(f), k ||
|
|
131
|
+
h(f), k || l?.(void 0);
|
|
128
132
|
return;
|
|
129
133
|
}
|
|
130
134
|
const { parsed: o, isValid: i } = U(r, n, s);
|
|
131
135
|
if (i && o) {
|
|
132
|
-
const
|
|
133
|
-
h(
|
|
136
|
+
const I = { from: C(o), to: a?.to };
|
|
137
|
+
h(I), a?.to && v(g(x(I), n, { locale: s })), V || P(o), k || l?.(S(I));
|
|
134
138
|
}
|
|
135
|
-
},
|
|
136
|
-
const r =
|
|
139
|
+
}, Me = (e) => {
|
|
140
|
+
const r = ae(e.target.value, n, y);
|
|
137
141
|
if (v(r), r === "") {
|
|
138
142
|
const f = { from: a?.from };
|
|
139
|
-
h(f), k ||
|
|
143
|
+
h(f), k || l?.(S(f));
|
|
140
144
|
return;
|
|
141
145
|
}
|
|
142
146
|
const { parsed: o, isValid: i } = U(r, n, s);
|
|
143
147
|
if (i && o) {
|
|
144
|
-
const f = C(o),
|
|
145
|
-
h(
|
|
148
|
+
const f = C(o), I = { from: a?.from, to: f };
|
|
149
|
+
h(I), a?.from && D(g(a.from.startDate, n, { locale: s })), V || P(o), k || l?.(S(I));
|
|
146
150
|
}
|
|
147
|
-
},
|
|
148
|
-
const e = j(m, n, b, s), r = j(y, n,
|
|
149
|
-
e.resetToCommitted ? D(b) : e.parsed && D(e.display), r.resetToCommitted ? v(
|
|
151
|
+
}, Ge = () => {
|
|
152
|
+
const e = j(m, n, b, s), r = j(y, n, w, s);
|
|
153
|
+
e.resetToCommitted ? D(b) : e.parsed && D(e.display), r.resetToCommitted ? v(w) : r.parsed && v(r.display);
|
|
150
154
|
let o = e.parsed ? C(e.parsed) : a?.from, i = r.parsed ? C(r.parsed) : a?.to;
|
|
151
155
|
o && i && ({ from: o, to: i } = B(o, i));
|
|
152
156
|
const f = o ? { from: o, to: i } : void 0;
|
|
153
|
-
f ? (h(f),
|
|
154
|
-
},
|
|
155
|
-
|
|
156
|
-
|
|
157
|
+
f ? (h(f), l?.(f)) : !m && !y && (h(void 0), l?.(void 0));
|
|
158
|
+
}, se = () => {
|
|
159
|
+
at(
|
|
160
|
+
A,
|
|
157
161
|
J,
|
|
158
162
|
() => {
|
|
159
|
-
const e = L(m, n, b, s), r = L(y, n,
|
|
160
|
-
e.resetToCommitted ? D(b) : e.parsed && D(e.display), r.resetToCommitted ? v(
|
|
163
|
+
const e = L(m, n, b, s), r = L(y, n, w, s);
|
|
164
|
+
e.resetToCommitted ? D(b) : e.parsed && D(e.display), r.resetToCommitted ? v(w) : r.parsed && v(r.display);
|
|
161
165
|
let o = e.parsed ? C(e.parsed) : e.resetToCommitted ? t?.from : a?.from, i = r.parsed ? C(r.parsed) : r.resetToCommitted ? t?.to : a?.to;
|
|
162
166
|
o && i && ({ from: o, to: i } = B(o, i));
|
|
163
167
|
const f = o || i ? { from: o, to: i } : void 0;
|
|
164
|
-
h(f), k || (f ?
|
|
168
|
+
h(f), k || (f ? l?.(f) : !m && !y && l?.(void 0));
|
|
165
169
|
}
|
|
166
170
|
);
|
|
167
|
-
},
|
|
171
|
+
}, ie = () => {
|
|
168
172
|
if (p && k) {
|
|
169
|
-
|
|
173
|
+
oe();
|
|
170
174
|
return;
|
|
171
175
|
}
|
|
172
176
|
if (!p) {
|
|
173
177
|
if (k) {
|
|
174
|
-
|
|
178
|
+
Ge();
|
|
175
179
|
return;
|
|
176
180
|
}
|
|
177
|
-
const e = j(m, n, b, s), r = j(y, n,
|
|
181
|
+
const e = j(m, n, b, s), r = j(y, n, w, s);
|
|
178
182
|
if (e.parsed || r.parsed) return;
|
|
179
183
|
E.current = !0, R(!0);
|
|
180
184
|
}
|
|
181
|
-
}, b = t?.from ? g(t.from.startDate, n, { locale: s }) : "",
|
|
182
|
-
const e = L(m, n, b, s), r = L(y, n,
|
|
185
|
+
}, b = t?.from ? g(t.from.startDate, n, { locale: s }) : "", w = x(t) ? g(x(t), n, { locale: s }) : "", Je = b !== m, Qe = w !== y, Ue = ce(m, n, s), Xe = ce(y, n, s), Ze = "Start Date", _e = "End Date", $e = c.useCallback(() => {
|
|
186
|
+
const e = L(m, n, b, s), r = L(y, n, w, s);
|
|
183
187
|
let o = e.parsed ? C(e.parsed) : e.resetToCommitted ? t?.from : a?.from, i = r.parsed ? C(r.parsed) : r.resetToCommitted ? t?.to : a?.to;
|
|
184
188
|
o && i && ({ from: o, to: i } = B(o, i));
|
|
185
189
|
const f = o || i ? { from: o, to: i } : void 0;
|
|
186
|
-
return
|
|
190
|
+
return ct({
|
|
187
191
|
startInput: m,
|
|
188
192
|
endInput: y,
|
|
189
193
|
committedStart: b,
|
|
190
|
-
committedEnd:
|
|
194
|
+
committedEnd: w,
|
|
191
195
|
committedRange: t,
|
|
192
196
|
pendingRange: S(a),
|
|
193
197
|
computeEffectiveRange: () => f,
|
|
194
|
-
rangesEqual: (
|
|
198
|
+
rangesEqual: (I, Ye) => xt(I, Ye)
|
|
195
199
|
});
|
|
196
200
|
}, [
|
|
197
201
|
m,
|
|
198
202
|
y,
|
|
199
203
|
b,
|
|
200
|
-
|
|
204
|
+
w,
|
|
201
205
|
t,
|
|
202
206
|
a,
|
|
203
207
|
n,
|
|
@@ -205,10 +209,10 @@ const ht = l.forwardRef(
|
|
|
205
209
|
B,
|
|
206
210
|
C
|
|
207
211
|
]);
|
|
208
|
-
return
|
|
212
|
+
return c.useLayoutEffect(() => {
|
|
209
213
|
ee.current = {
|
|
210
214
|
onDismiss: O,
|
|
211
|
-
resolveFlash:
|
|
215
|
+
resolveFlash: $e
|
|
212
216
|
};
|
|
213
217
|
}), /* @__PURE__ */ u(
|
|
214
218
|
"div",
|
|
@@ -216,14 +220,14 @@ const ht = l.forwardRef(
|
|
|
216
220
|
ref: F,
|
|
217
221
|
"data-component": "week-range-picker",
|
|
218
222
|
"data-disabled": d || void 0,
|
|
219
|
-
children:
|
|
220
|
-
/* @__PURE__ */
|
|
221
|
-
/* @__PURE__ */ u(
|
|
223
|
+
children: Ne.wrapControl(
|
|
224
|
+
/* @__PURE__ */ W(dt, { open: d ? !1 : p, onOpenChange: ze, children: [
|
|
225
|
+
/* @__PURE__ */ u(pt, { asChild: !0, children: /* @__PURE__ */ W(
|
|
222
226
|
"div",
|
|
223
227
|
{
|
|
224
|
-
ref:
|
|
228
|
+
ref: A,
|
|
225
229
|
"data-state": p ? "open" : "closed",
|
|
226
|
-
onPointerDown: (e) =>
|
|
230
|
+
onPointerDown: (e) => lt({
|
|
227
231
|
disabled: d,
|
|
228
232
|
event: e,
|
|
229
233
|
onOpen: () => R(!0),
|
|
@@ -237,31 +241,31 @@ const ht = l.forwardRef(
|
|
|
237
241
|
X === "sm" ? "h-6" : X === "md" ? "h-[28px]" : "h-8",
|
|
238
242
|
d && "pointer-events-none opacity-100 bg-disabled-surface border-stroke text-disabled-foreground hover:border-stroke",
|
|
239
243
|
"cursor-pointer",
|
|
240
|
-
|
|
244
|
+
be
|
|
241
245
|
),
|
|
242
246
|
children: [
|
|
243
|
-
/* @__PURE__ */
|
|
247
|
+
/* @__PURE__ */ W("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
|
|
244
248
|
/* @__PURE__ */ u(
|
|
245
249
|
"input",
|
|
246
250
|
{
|
|
247
251
|
ref: G,
|
|
248
252
|
type: "text",
|
|
249
253
|
value: m,
|
|
250
|
-
onChange:
|
|
251
|
-
onBlur:
|
|
254
|
+
onChange: Ke,
|
|
255
|
+
onBlur: se,
|
|
252
256
|
onClick: () => !d && R(!0),
|
|
253
257
|
onKeyDown: (e) => {
|
|
254
|
-
e.key === "Enter" && !d && (e.preventDefault(),
|
|
258
|
+
e.key === "Enter" && !d && (e.preventDefault(), ie()), e.key === "ArrowDown" && !p && !d && (e.preventDefault(), E.current = !0, R(!0)), e.key === "Escape" && p && le(e, { open: p, onCancel: O });
|
|
255
259
|
},
|
|
256
260
|
placeholder: p ? n : $,
|
|
257
261
|
disabled: !!d,
|
|
258
|
-
"aria-label":
|
|
262
|
+
"aria-label": Ze,
|
|
259
263
|
"data-field": "start",
|
|
260
264
|
className: Q(
|
|
261
265
|
"flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-content-empty disabled:cursor-not-allowed disabled:opacity-50",
|
|
262
|
-
|
|
266
|
+
Ue ? "text-destructive" : Je ? "text-content-placeholder" : ""
|
|
263
267
|
),
|
|
264
|
-
...
|
|
268
|
+
...Se
|
|
265
269
|
}
|
|
266
270
|
),
|
|
267
271
|
/* @__PURE__ */ u(
|
|
@@ -270,93 +274,94 @@ const ht = l.forwardRef(
|
|
|
270
274
|
ref: Y,
|
|
271
275
|
type: "text",
|
|
272
276
|
value: y,
|
|
273
|
-
onChange:
|
|
274
|
-
onBlur:
|
|
277
|
+
onChange: Me,
|
|
278
|
+
onBlur: se,
|
|
275
279
|
onClick: () => !d && R(!0),
|
|
276
280
|
onKeyDown: (e) => {
|
|
277
|
-
e.key === "Enter" && !d && (e.preventDefault(),
|
|
281
|
+
e.key === "Enter" && !d && (e.preventDefault(), ie()), e.key === "ArrowDown" && !p && !d && (e.preventDefault(), E.current = !0, R(!0)), e.key === "Escape" && p && le(e, { open: p, onCancel: O });
|
|
278
282
|
},
|
|
279
283
|
placeholder: p ? n : $,
|
|
280
284
|
disabled: !!d,
|
|
281
|
-
"aria-label":
|
|
285
|
+
"aria-label": _e,
|
|
282
286
|
"data-field": "end",
|
|
283
287
|
className: Q(
|
|
284
288
|
"flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-content-empty disabled:cursor-not-allowed disabled:opacity-50",
|
|
285
|
-
|
|
289
|
+
Xe ? "text-destructive" : Qe ? "text-content-placeholder" : ""
|
|
286
290
|
)
|
|
287
291
|
}
|
|
288
292
|
)
|
|
289
293
|
] }),
|
|
290
|
-
/* @__PURE__ */
|
|
291
|
-
t?.from && !d && /* @__PURE__ */
|
|
292
|
-
/* @__PURE__ */ u(
|
|
294
|
+
/* @__PURE__ */ W("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
295
|
+
t?.from && !d && /* @__PURE__ */ W(fe, { children: [
|
|
296
|
+
/* @__PURE__ */ u(de, { asChild: !0, children: /* @__PURE__ */ u(
|
|
293
297
|
"button",
|
|
294
298
|
{
|
|
295
299
|
type: "button",
|
|
296
300
|
tabIndex: 0,
|
|
297
|
-
"aria-label":
|
|
301
|
+
"aria-label": T("calendar.clear"),
|
|
298
302
|
onClick: (e) => {
|
|
299
|
-
e.stopPropagation(),
|
|
303
|
+
e.stopPropagation(), ne();
|
|
300
304
|
},
|
|
301
305
|
className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
302
|
-
children: /* @__PURE__ */ u(
|
|
306
|
+
children: /* @__PURE__ */ u(Fe, { className: "size-3 hover:text-content text-content-icon" })
|
|
303
307
|
}
|
|
304
308
|
) }),
|
|
305
|
-
/* @__PURE__ */ u(
|
|
309
|
+
/* @__PURE__ */ u(pe, { variant: "tertiary", side: "top", children: T("calendar.clear") })
|
|
306
310
|
] }),
|
|
307
|
-
/* @__PURE__ */
|
|
308
|
-
/* @__PURE__ */ u(
|
|
311
|
+
/* @__PURE__ */ W(fe, { children: [
|
|
312
|
+
/* @__PURE__ */ u(de, { asChild: !0, children: /* @__PURE__ */ u("button", { type: "button", tabIndex: 0, "aria-label": T("datePicker.selectWeekRange"), onClick: (e) => {
|
|
309
313
|
e.stopPropagation(), d || R(!p);
|
|
310
314
|
}, onKeyDown: (e) => {
|
|
311
315
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), d || (E.current = !0, R(!p)));
|
|
312
|
-
}, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ u(
|
|
313
|
-
/* @__PURE__ */ u(
|
|
316
|
+
}, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ u(et, { className: "h-4 w-4 text-secondary-foreground" }) }) }),
|
|
317
|
+
/* @__PURE__ */ u(pe, { variant: "tertiary", side: "top", children: T("datePicker.selectWeekRange") })
|
|
314
318
|
] })
|
|
315
319
|
] })
|
|
316
320
|
]
|
|
317
321
|
}
|
|
318
322
|
) }),
|
|
319
323
|
/* @__PURE__ */ u(
|
|
320
|
-
|
|
324
|
+
mt,
|
|
321
325
|
{
|
|
322
326
|
ref: J,
|
|
323
327
|
className: "w-auto p-0",
|
|
324
328
|
align: "start",
|
|
325
|
-
"aria-label":
|
|
329
|
+
"aria-label": T("datePicker.selectWeekRange"),
|
|
326
330
|
onOpenAutoFocus: (e) => {
|
|
327
331
|
E.current || e.preventDefault(), E.current = !1;
|
|
328
332
|
},
|
|
329
|
-
...
|
|
333
|
+
...Oe,
|
|
330
334
|
children: /* @__PURE__ */ u(
|
|
331
|
-
|
|
335
|
+
ut,
|
|
332
336
|
{
|
|
333
337
|
pickerType: "week",
|
|
334
338
|
weekMode: "range",
|
|
335
339
|
selectedWeeks: S(a),
|
|
336
|
-
footerFlashKey:
|
|
337
|
-
footerFlashTarget:
|
|
338
|
-
onWeekSelect:
|
|
339
|
-
month:
|
|
340
|
-
onMonthChange:
|
|
341
|
-
disabled:
|
|
342
|
-
startMonth:
|
|
343
|
-
endMonth:
|
|
340
|
+
footerFlashKey: Ve,
|
|
341
|
+
footerFlashTarget: Ae,
|
|
342
|
+
onWeekSelect: He,
|
|
343
|
+
month: Le,
|
|
344
|
+
onMonthChange: P,
|
|
345
|
+
disabled: gt(ge, ke),
|
|
346
|
+
startMonth: Re,
|
|
347
|
+
endMonth: he,
|
|
344
348
|
showFooter: k,
|
|
345
|
-
...
|
|
349
|
+
...vt({
|
|
346
350
|
calendarKind: N,
|
|
347
351
|
fiscalMode: q,
|
|
348
352
|
granularity: z,
|
|
349
353
|
fiscalMonthPattern: H,
|
|
350
|
-
fiscalYearStartMonth:
|
|
351
|
-
fiscalConfig:
|
|
352
|
-
weekStartsOn:
|
|
353
|
-
showPresets:
|
|
354
|
-
|
|
355
|
-
|
|
354
|
+
fiscalYearStartMonth: K,
|
|
355
|
+
fiscalConfig: De,
|
|
356
|
+
weekStartsOn: M,
|
|
357
|
+
showPresets: ye,
|
|
358
|
+
showPeriodBoundaries: ve,
|
|
359
|
+
comparison: xe,
|
|
360
|
+
onComparisonChange: Ce
|
|
356
361
|
}),
|
|
357
|
-
onApply:
|
|
362
|
+
onApply: oe,
|
|
358
363
|
onCancel: O,
|
|
359
|
-
onClear:
|
|
364
|
+
onClear: ne,
|
|
360
365
|
captionLayout: "dropdown"
|
|
361
366
|
}
|
|
362
367
|
)
|
|
@@ -368,7 +373,7 @@ const ht = l.forwardRef(
|
|
|
368
373
|
);
|
|
369
374
|
}
|
|
370
375
|
);
|
|
371
|
-
|
|
376
|
+
Ct.displayName = "WeekRangePicker";
|
|
372
377
|
export {
|
|
373
|
-
|
|
378
|
+
Ct as WeekRangePicker
|
|
374
379
|
};
|