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