impact-nova 2.5.10 → 2.5.12
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-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-config.js +1 -1
- package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +4 -2
- package/dist/components/data-display/calendar/calendar-day-picker-components.js +234 -164
- package/dist/components/data-display/calendar/calendar-day-picker-view.js +77 -76
- package/dist/components/data-display/calendar/calendar-fiscal-day-cell.d.ts +9 -0
- package/dist/components/data-display/calendar/calendar-fiscal-day-cell.js +45 -0
- 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-footer.js +21 -21
- package/dist/components/data-display/calendar/calendar-injected-week-row.d.ts +5 -0
- package/dist/components/data-display/calendar/calendar-injected-week-row.js +92 -0
- package/dist/components/data-display/calendar/calendar-leading-week.utils.d.ts +16 -0
- package/dist/components/data-display/calendar/calendar-leading-week.utils.js +51 -0
- package/dist/components/data-display/calendar/calendar-month-picker-panel.js +50 -49
- 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-orphan-week.d.ts +23 -0
- package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +3 -1
- package/dist/components/data-display/calendar/calendar-padding-week.utils.js +7 -5
- package/dist/components/data-display/calendar/calendar-period-cell.js +45 -46
- package/dist/components/data-display/calendar/calendar-quarter-panes.js +33 -31
- package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +10 -0
- package/dist/components/data-display/calendar/calendar-selection-appearance.js +53 -39
- package/dist/components/data-display/calendar/calendar-selection.d.ts +25 -0
- package/dist/components/data-display/calendar/calendar-selection.js +52 -23
- 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 +59 -45
- package/dist/components/data-display/calendar/calendar-week-utils.d.ts +13 -3
- package/dist/components/data-display/calendar/calendar-week-utils.js +59 -50
- package/dist/components/data-display/calendar/calendar-year-panes.d.ts +3 -0
- package/dist/components/data-display/calendar/calendar-year-panes.js +53 -49
- package/dist/components/data-display/calendar/calendar.js +146 -143
- package/dist/components/data-display/calendar/calendar.types.d.ts +5 -0
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +2 -1
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +79 -74
- 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/forms/date-picker/date-picker.js +60 -58
- package/dist/components/forms/date-picker/date-picker.types.d.ts +5 -0
- package/dist/components/forms/date-picker/date-range-picker.js +66 -64
- package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +1 -0
- package/dist/components/forms/date-picker/fiscal-pass-through.js +3 -2
- package/dist/components/forms/date-picker/fiscal-picker-fixtures.d.ts +17 -0
- package/dist/components/forms/date-picker/month-picker.js +61 -59
- package/dist/components/forms/date-picker/month-range-picker.js +63 -61
- 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 +51 -47
- package/dist/components/forms/date-picker/multi-week-picker.js +53 -51
- package/dist/components/forms/date-picker/multi-year-picker.js +53 -49
- package/dist/components/forms/date-picker/quarter-picker.js +51 -47
- package/dist/components/forms/date-picker/quarter-range-picker.js +50 -46
- package/dist/components/forms/date-picker/week-picker.js +68 -66
- package/dist/components/forms/date-picker/week-range-picker.js +82 -80
- package/dist/components/forms/date-picker/year-picker.js +52 -48
- package/dist/components/forms/date-picker/year-range-picker.js +52 -48
- 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 +35 -27
- package/dist/form-react/Fields/WeekRangePicker.js +33 -32
- package/dist/form-react/types/fields.types.d.ts +14 -0
- package/dist/impact-nova-components.css +13 -6
- package/dist/impact-nova.css +1 -1
- package/dist/lib/fiscal-calendar/week-selection.js +2 -2
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as r, jsxs as g } from "react/jsx-runtime";
|
|
2
2
|
import * as t from "react";
|
|
3
|
-
import { Cross as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { Input as
|
|
6
|
-
import { Calendar as
|
|
3
|
+
import { Cross as q, CalendarMonth as ee } from "impact-nova-icons";
|
|
4
|
+
import { cn as re } from "../../../lib/utils.js";
|
|
5
|
+
import { Input as te } from "../input/input.js";
|
|
6
|
+
import { Calendar as ne } from "../../data-display/calendar/calendar.js";
|
|
7
7
|
import { Tooltip as C, TooltipTrigger as x, TooltipContent as b } from "../../feedback/tooltip/tooltip.js";
|
|
8
|
-
import { useImpactNovaI18n as
|
|
9
|
-
import { buildDateBoundsMatcher as
|
|
10
|
-
import { fiscalCalendarPassThrough as
|
|
11
|
-
import { DatePickerShell as
|
|
12
|
-
import { usePickerDismissActionsRef as
|
|
8
|
+
import { useImpactNovaI18n as oe } from "../../../i18n/use-impact-nova-i18n.js";
|
|
9
|
+
import { buildDateBoundsMatcher as ae } from "../../../lib/date-bounds-matcher.js";
|
|
10
|
+
import { fiscalCalendarPassThrough as ie } from "./fiscal-pass-through.js";
|
|
11
|
+
import { DatePickerShell as ce } from "./date-picker-shell.js";
|
|
12
|
+
import { usePickerDismissActionsRef as se, usePickerFooterDismissNudge as le, handleReadonlyPickerKeyDown as fe, handlePickerSurfacePointerDown as pe } from "./date-input-behavior.js";
|
|
13
13
|
import { formatQuarterInput as D } from "../../data-display/calendar/calendar-fiscal-labels.js";
|
|
14
|
-
import { viewMonthFromQuarter as
|
|
15
|
-
const
|
|
14
|
+
import { viewMonthFromQuarter as de } from "../../data-display/calendar/calendar-quarter-utils.js";
|
|
15
|
+
const me = t.forwardRef(
|
|
16
16
|
({
|
|
17
17
|
value: n,
|
|
18
18
|
onChange: d,
|
|
@@ -30,29 +30,33 @@ const pe = t.forwardRef(
|
|
|
30
30
|
fiscalMonthPattern: w,
|
|
31
31
|
fiscalYearStartMonth: K,
|
|
32
32
|
fiscalConfig: j,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const
|
|
33
|
+
weekStartsOn: F,
|
|
34
|
+
showPresets: $,
|
|
35
|
+
showPeriodBoundaries: z,
|
|
36
|
+
autoNavigateToAvailable: E,
|
|
37
|
+
...H
|
|
38
|
+
}, L) => {
|
|
39
|
+
const { t: a } = oe(), V = Q ?? a("datePicker.selectQuarterRange"), m = t.useRef(null), y = t.useRef(null);
|
|
40
|
+
t.useImperativeHandle(L, () => m.current);
|
|
41
|
+
const [i, c] = t.useState(!1), u = t.useRef(!1), k = se(), { footerFlashKey: B, footerFlashTarget: G, popoverHandlers: J } = le(l, i, k, y), [P, f] = t.useState(n), [U, W] = t.useState(de(n?.from));
|
|
40
42
|
t.useEffect(() => {
|
|
41
43
|
i || f(n);
|
|
42
44
|
}, [i, n]);
|
|
43
|
-
const p = t.useCallback(() => c(!1), []),
|
|
45
|
+
const p = t.useCallback(() => c(!1), []), X = ie({
|
|
44
46
|
calendarKind: M,
|
|
45
47
|
fiscalMode: O,
|
|
46
48
|
granularity: T,
|
|
47
49
|
fiscalMonthPattern: w,
|
|
48
50
|
fiscalYearStartMonth: K,
|
|
49
51
|
fiscalConfig: j,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
weekStartsOn: F,
|
|
53
|
+
showPresets: $,
|
|
54
|
+
showPeriodBoundaries: z,
|
|
55
|
+
autoNavigateToAvailable: E
|
|
56
|
+
}), Y = (e) => {
|
|
53
57
|
const s = e && !Array.isArray(e) && ("from" in e || "to" in e) ? e : void 0;
|
|
54
58
|
f(s), l || (d?.(s), s?.to && p());
|
|
55
|
-
},
|
|
59
|
+
}, Z = () => {
|
|
56
60
|
d?.(P), p();
|
|
57
61
|
}, h = () => {
|
|
58
62
|
f(n), p();
|
|
@@ -62,9 +66,9 @@ const pe = t.forwardRef(
|
|
|
62
66
|
t.useLayoutEffect(() => {
|
|
63
67
|
k.current = { onDismiss: h, resolveFlash: () => "cancel" };
|
|
64
68
|
});
|
|
65
|
-
const
|
|
69
|
+
const _ = n?.from ? `${D(n.from)}${n.to ? ` – ${D(n.to)}` : ""}` : "";
|
|
66
70
|
return /* @__PURE__ */ r(
|
|
67
|
-
|
|
71
|
+
ce,
|
|
68
72
|
{
|
|
69
73
|
open: i,
|
|
70
74
|
disabled: o,
|
|
@@ -75,26 +79,26 @@ const pe = t.forwardRef(
|
|
|
75
79
|
onOpenAutoFocus: (e) => {
|
|
76
80
|
u.current || e.preventDefault(), u.current = !1;
|
|
77
81
|
},
|
|
78
|
-
popoverHandlers:
|
|
82
|
+
popoverHandlers: J,
|
|
79
83
|
trigger: /* @__PURE__ */ r(
|
|
80
84
|
"div",
|
|
81
85
|
{
|
|
82
86
|
ref: y,
|
|
83
87
|
"data-component": "quarter-range-picker",
|
|
84
88
|
"data-state": i ? "open" : "closed",
|
|
85
|
-
onPointerDown: (e) =>
|
|
89
|
+
onPointerDown: (e) => pe({
|
|
86
90
|
disabled: o,
|
|
87
91
|
event: e,
|
|
88
92
|
onOpen: () => c(!0),
|
|
89
93
|
focusField: () => m.current?.focus()
|
|
90
94
|
}),
|
|
91
95
|
children: /* @__PURE__ */ r(
|
|
92
|
-
|
|
96
|
+
te,
|
|
93
97
|
{
|
|
94
98
|
ref: m,
|
|
95
|
-
value:
|
|
99
|
+
value: _,
|
|
96
100
|
readOnly: !0,
|
|
97
|
-
onKeyDown: (e) =>
|
|
101
|
+
onKeyDown: (e) => fe(e, {
|
|
98
102
|
disabled: o,
|
|
99
103
|
open: i,
|
|
100
104
|
onOpen: () => c(!0),
|
|
@@ -104,10 +108,10 @@ const pe = t.forwardRef(
|
|
|
104
108
|
}
|
|
105
109
|
}),
|
|
106
110
|
onClick: () => !o && c(!0),
|
|
107
|
-
placeholder:
|
|
111
|
+
placeholder: V,
|
|
108
112
|
disabled: o,
|
|
109
113
|
"data-form-control": "input",
|
|
110
|
-
className:
|
|
114
|
+
className: re("cursor-pointer", I),
|
|
111
115
|
suffix: /* @__PURE__ */ g("div", { className: "flex items-center gap-1", children: [
|
|
112
116
|
n?.from && !o ? /* @__PURE__ */ g(C, { children: [
|
|
113
117
|
/* @__PURE__ */ r(x, { asChild: !0, children: /* @__PURE__ */ r(
|
|
@@ -120,7 +124,7 @@ const pe = t.forwardRef(
|
|
|
120
124
|
e.stopPropagation(), R();
|
|
121
125
|
},
|
|
122
126
|
className: "inline-flex size-4 items-center justify-center border-none bg-transparent p-0",
|
|
123
|
-
children: /* @__PURE__ */ r(
|
|
127
|
+
children: /* @__PURE__ */ r(q, { className: "size-3 hover:text-content" })
|
|
124
128
|
}
|
|
125
129
|
) }),
|
|
126
130
|
/* @__PURE__ */ r(b, { variant: "tertiary", side: "top", children: a("calendar.clear") })
|
|
@@ -137,43 +141,43 @@ const pe = t.forwardRef(
|
|
|
137
141
|
e.stopPropagation(), o || c((s) => !s);
|
|
138
142
|
},
|
|
139
143
|
className: "inline-flex items-center justify-center border-none bg-transparent p-0",
|
|
140
|
-
children: /* @__PURE__ */ r(
|
|
144
|
+
children: /* @__PURE__ */ r(ee, { className: "h-4 w-4 text-secondary-foreground" })
|
|
141
145
|
}
|
|
142
146
|
) }),
|
|
143
147
|
/* @__PURE__ */ r(b, { variant: "tertiary", side: "top", children: a("datePicker.selectQuarterRange") })
|
|
144
148
|
] })
|
|
145
149
|
] }),
|
|
146
|
-
...
|
|
150
|
+
...H
|
|
147
151
|
}
|
|
148
152
|
)
|
|
149
153
|
}
|
|
150
154
|
),
|
|
151
155
|
children: /* @__PURE__ */ r(
|
|
152
|
-
|
|
156
|
+
ne,
|
|
153
157
|
{
|
|
154
158
|
pickerType: "quarter",
|
|
155
159
|
monthMode: "range",
|
|
156
160
|
selectedQuarters: P,
|
|
157
|
-
footerFlashKey:
|
|
158
|
-
footerFlashTarget:
|
|
159
|
-
onQuarterSelect:
|
|
160
|
-
month:
|
|
161
|
-
onMonthChange:
|
|
162
|
-
disabled:
|
|
161
|
+
footerFlashKey: B,
|
|
162
|
+
footerFlashTarget: G,
|
|
163
|
+
onQuarterSelect: Y,
|
|
164
|
+
month: U,
|
|
165
|
+
onMonthChange: W,
|
|
166
|
+
disabled: ae(N, S),
|
|
163
167
|
startMonth: v,
|
|
164
168
|
endMonth: A,
|
|
165
169
|
showFooter: l,
|
|
166
|
-
onApply:
|
|
170
|
+
onApply: Z,
|
|
167
171
|
onCancel: h,
|
|
168
172
|
onClear: R,
|
|
169
|
-
...
|
|
173
|
+
...X
|
|
170
174
|
}
|
|
171
175
|
)
|
|
172
176
|
}
|
|
173
177
|
);
|
|
174
178
|
}
|
|
175
179
|
);
|
|
176
|
-
|
|
180
|
+
me.displayName = "QuarterRangePicker";
|
|
177
181
|
export {
|
|
178
|
-
|
|
182
|
+
me as QuarterRangePicker
|
|
179
183
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { jsxs as W, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import * as s from "react";
|
|
3
|
-
import { Cross as
|
|
3
|
+
import { Cross as Te, CalendarMonth as Ee } from "impact-nova-icons";
|
|
4
4
|
import { format as j } from "date-fns";
|
|
5
|
-
import { cn as
|
|
6
|
-
import { usePickerDismissActionsRef as
|
|
7
|
-
import { Input as
|
|
8
|
-
import { Popover as
|
|
9
|
-
import { Calendar as
|
|
5
|
+
import { cn as Se } from "../../../lib/utils.js";
|
|
6
|
+
import { usePickerDismissActionsRef as Ae, usePickerFooterDismissNudge as Ne, isDateInputInvalid as we, resolveSingleValueDismissFlash as Ve, handlePickerEscapeKeyDown as Le, handlePickerSurfacePointerDown as Oe, resolveDateInputOnBlur as Me, maskDateInput as je, parseDateInput as Be, resolveDateInputOnEnter as ze } from "./date-input-behavior.js";
|
|
7
|
+
import { Input as He } from "../input/input.js";
|
|
8
|
+
import { Popover as Ke, PopoverAnchor as $e, PopoverContent as qe } from "../../feedback/popover/popover.js";
|
|
9
|
+
import { Calendar as Ge } from "../../data-display/calendar/calendar.js";
|
|
10
10
|
import { Tooltip as Z, TooltipTrigger as _, TooltipContent as Y } from "../../feedback/tooltip/tooltip.js";
|
|
11
|
-
import { resolveWeekSelection as
|
|
12
|
-
import { useImpactNovaI18n as
|
|
13
|
-
import { getDateFnsLocale as
|
|
14
|
-
import { coerceSingleWeekApply as
|
|
15
|
-
import { buildDateBoundsMatcher as
|
|
16
|
-
import { fiscalCalendarPassThrough as
|
|
11
|
+
import { resolveWeekSelection as Je } from "../../../lib/fiscal-calendar/week-selection.js";
|
|
12
|
+
import { useImpactNovaI18n as Qe } from "../../../i18n/use-impact-nova-i18n.js";
|
|
13
|
+
import { getDateFnsLocale as Ue } from "../../../i18n/getDateFnsLocale.js";
|
|
14
|
+
import { coerceSingleWeekApply as Xe, coerceSingleWeek as Ze } from "./calendar-selection-adapters.js";
|
|
15
|
+
import { buildDateBoundsMatcher as _e } from "../../../lib/date-bounds-matcher.js";
|
|
16
|
+
import { fiscalCalendarPassThrough as Ye } from "./fiscal-pass-through.js";
|
|
17
17
|
const F = (n, c = "MM/dd/yyyy", t) => {
|
|
18
18
|
const R = j(n.startDate, c, t ? { locale: t } : {}), b = j(n.endDate, c, t ? { locale: t } : {});
|
|
19
19
|
return `${R} - ${b}`;
|
|
20
|
-
}, g = (n, c, t) => n ? j(n.startDate, c, t ? { locale: t } : {}) : "",
|
|
20
|
+
}, g = (n, c, t) => n ? j(n.startDate, c, t ? { locale: t } : {}) : "", Fe = s.forwardRef(
|
|
21
21
|
({
|
|
22
22
|
value: n,
|
|
23
23
|
onChange: c,
|
|
@@ -37,15 +37,16 @@ const F = (n, c = "MM/dd/yyyy", t) => {
|
|
|
37
37
|
weekStartsOn: A = 1,
|
|
38
38
|
showPresets: se,
|
|
39
39
|
showPeriodBoundaries: oe,
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
autoNavigateToAvailable: ie,
|
|
41
|
+
comparison: ce,
|
|
42
|
+
onComparisonChange: ae,
|
|
42
43
|
disabled: p,
|
|
43
|
-
className:
|
|
44
|
-
...
|
|
45
|
-
},
|
|
46
|
-
const { locale: B, t: D } =
|
|
47
|
-
s.useImperativeHandle(
|
|
48
|
-
const [o, H] = s.useState(!1), K =
|
|
44
|
+
className: le,
|
|
45
|
+
...pe
|
|
46
|
+
}, ue) => {
|
|
47
|
+
const { locale: B, t: D } = Qe(), i = s.useMemo(() => Ue(B), [B]), fe = R ?? D("datePicker.selectWeek"), C = I === "fiscal", N = s.useRef(null), z = s.useRef(null), v = s.useRef(!1);
|
|
48
|
+
s.useImperativeHandle(ue, () => N.current);
|
|
49
|
+
const [o, H] = s.useState(!1), K = Ae(), { footerFlashKey: de, footerFlashTarget: me, popoverHandlers: ke } = Ne(l, o, K, z), [De, w] = s.useState(!1), [u, f] = s.useState(n), [y, m] = s.useState(""), [ye, h] = s.useState(n?.startDate || /* @__PURE__ */ new Date()), he = n ? F(n, t, i) : "", $ = u ? F(u, t, i) : "", V = o || De, ge = V ? y : $, q = s.useCallback(() => {
|
|
49
50
|
f(n), m(g(n, t, i)), C || h(n?.startDate || /* @__PURE__ */ new Date());
|
|
50
51
|
}, [n, t, i, C]), P = s.useCallback(() => {
|
|
51
52
|
m(g(u ?? n, t, i)), C || h((u ?? n)?.startDate || /* @__PURE__ */ new Date());
|
|
@@ -68,7 +69,7 @@ const F = (n, c = "MM/dd/yyyy", t) => {
|
|
|
68
69
|
l || d();
|
|
69
70
|
}
|
|
70
71
|
}, L = s.useCallback(
|
|
71
|
-
(e) =>
|
|
72
|
+
(e) => Je(e, {
|
|
72
73
|
calendarKind: I,
|
|
73
74
|
fiscalMode: x,
|
|
74
75
|
granularity: T,
|
|
@@ -84,33 +85,33 @@ const F = (n, c = "MM/dd/yyyy", t) => {
|
|
|
84
85
|
S,
|
|
85
86
|
A
|
|
86
87
|
]
|
|
87
|
-
),
|
|
88
|
-
const r =
|
|
88
|
+
), Ce = (e) => {
|
|
89
|
+
const r = Ze(e);
|
|
89
90
|
f(r), r && (m(g(r, t, i)), C || h(r.startDate)), l || (c?.(r), d());
|
|
90
91
|
}, J = (e) => {
|
|
91
|
-
const r =
|
|
92
|
+
const r = Xe(e, u);
|
|
92
93
|
c?.(r), d();
|
|
93
94
|
}, O = () => {
|
|
94
95
|
q(), d();
|
|
95
96
|
}, Q = () => {
|
|
96
97
|
f(void 0), m(""), c?.(void 0), l || d();
|
|
97
|
-
},
|
|
98
|
+
}, ve = (e) => {
|
|
98
99
|
const r = L(e);
|
|
99
100
|
f(r), m(g(r, t, i)), h(e), c?.(r), d();
|
|
100
|
-
},
|
|
101
|
-
const r =
|
|
101
|
+
}, Ie = (e) => {
|
|
102
|
+
const r = je(e.target.value, t, y);
|
|
102
103
|
if (m(r), r === "") {
|
|
103
104
|
f(void 0), l || c?.(void 0);
|
|
104
105
|
return;
|
|
105
106
|
}
|
|
106
|
-
const { parsed: M, isValid:
|
|
107
|
-
if (
|
|
107
|
+
const { parsed: M, isValid: xe } = Be(r, t, i);
|
|
108
|
+
if (xe && M) {
|
|
108
109
|
const X = L(M);
|
|
109
110
|
f(X), h(M), l || c?.(X);
|
|
110
111
|
}
|
|
111
|
-
},
|
|
112
|
+
}, Pe = () => {
|
|
112
113
|
if (w(!1), o) return;
|
|
113
|
-
const e =
|
|
114
|
+
const e = Me(
|
|
114
115
|
y,
|
|
115
116
|
t,
|
|
116
117
|
g(u ?? n, t, i),
|
|
@@ -126,19 +127,19 @@ const F = (n, c = "MM/dd/yyyy", t) => {
|
|
|
126
127
|
return;
|
|
127
128
|
}
|
|
128
129
|
y || (f(void 0), l || c?.(void 0));
|
|
129
|
-
},
|
|
130
|
+
}, We = () => {
|
|
130
131
|
if (o && l) {
|
|
131
132
|
J();
|
|
132
133
|
return;
|
|
133
134
|
}
|
|
134
|
-
const e =
|
|
135
|
+
const e = ze(y, t, i);
|
|
135
136
|
if (e.parsed) {
|
|
136
|
-
l &&
|
|
137
|
+
l && ve(e.parsed);
|
|
137
138
|
return;
|
|
138
139
|
}
|
|
139
140
|
o || (v.current = !0, k(!0));
|
|
140
|
-
}, U =
|
|
141
|
-
() =>
|
|
141
|
+
}, U = he !== $, Re = V && we(y, t, i), be = s.useCallback(
|
|
142
|
+
() => Ve(
|
|
142
143
|
u,
|
|
143
144
|
n,
|
|
144
145
|
(e, r) => e.startDate.getTime() === r.startDate.getTime()
|
|
@@ -148,43 +149,43 @@ const F = (n, c = "MM/dd/yyyy", t) => {
|
|
|
148
149
|
return s.useLayoutEffect(() => {
|
|
149
150
|
K.current = {
|
|
150
151
|
onDismiss: O,
|
|
151
|
-
resolveFlash:
|
|
152
|
+
resolveFlash: be
|
|
152
153
|
};
|
|
153
|
-
}), /* @__PURE__ */ W(
|
|
154
|
-
/* @__PURE__ */ a(
|
|
154
|
+
}), /* @__PURE__ */ W(Ke, { open: p ? !1 : o, onOpenChange: k, children: [
|
|
155
|
+
/* @__PURE__ */ a($e, { asChild: !0, children: /* @__PURE__ */ a(
|
|
155
156
|
"div",
|
|
156
157
|
{
|
|
157
158
|
ref: z,
|
|
158
159
|
"data-component": "week-picker",
|
|
159
160
|
"data-state": o ? "open" : "closed",
|
|
160
161
|
"data-pending": U || void 0,
|
|
161
|
-
onPointerDown: (e) =>
|
|
162
|
+
onPointerDown: (e) => Oe({
|
|
162
163
|
disabled: p,
|
|
163
164
|
event: e,
|
|
164
165
|
onOpen: () => k(!0),
|
|
165
166
|
focusField: () => N.current?.focus()
|
|
166
167
|
}),
|
|
167
168
|
children: /* @__PURE__ */ a(
|
|
168
|
-
|
|
169
|
+
He,
|
|
169
170
|
{
|
|
170
171
|
ref: N,
|
|
171
|
-
value:
|
|
172
|
-
onChange:
|
|
172
|
+
value: ge,
|
|
173
|
+
onChange: Ie,
|
|
173
174
|
onFocus: () => {
|
|
174
175
|
p || (w(!0), P());
|
|
175
176
|
},
|
|
176
|
-
onBlur:
|
|
177
|
+
onBlur: Pe,
|
|
177
178
|
onClick: () => !p && k(!0),
|
|
178
179
|
onKeyDown: (e) => {
|
|
179
|
-
e.key === "Enter" && !p && (e.preventDefault(),
|
|
180
|
+
e.key === "Enter" && !p && (e.preventDefault(), We()), e.key === "ArrowDown" && !o && !p && (e.preventDefault(), v.current = !0, k(!0)), e.key === "Escape" && o && Le(e, { open: o, onCancel: O });
|
|
180
181
|
},
|
|
181
|
-
placeholder: V ? t :
|
|
182
|
+
placeholder: V ? t : fe,
|
|
182
183
|
disabled: p,
|
|
183
184
|
"data-form-control": "input",
|
|
184
|
-
className:
|
|
185
|
+
className: Se(
|
|
185
186
|
"cursor-pointer",
|
|
186
|
-
|
|
187
|
-
|
|
187
|
+
Re ? "text-destructive" : U ? "text-content-placeholder" : "",
|
|
188
|
+
le
|
|
188
189
|
),
|
|
189
190
|
suffix: /* @__PURE__ */ W("div", { className: "flex items-center gap-1", children: [
|
|
190
191
|
n && !p && /* @__PURE__ */ W(Z, { children: [
|
|
@@ -198,7 +199,7 @@ const F = (n, c = "MM/dd/yyyy", t) => {
|
|
|
198
199
|
e.stopPropagation(), Q();
|
|
199
200
|
},
|
|
200
201
|
className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
201
|
-
children: /* @__PURE__ */ a(
|
|
202
|
+
children: /* @__PURE__ */ a(Te, { className: "size-3 hover:text-content" })
|
|
202
203
|
}
|
|
203
204
|
) }),
|
|
204
205
|
/* @__PURE__ */ a(Y, { variant: "tertiary", side: "top", children: D("calendar.clear") })
|
|
@@ -217,19 +218,19 @@ const F = (n, c = "MM/dd/yyyy", t) => {
|
|
|
217
218
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), p || (v.current = !0, o ? d() : k(!0)));
|
|
218
219
|
},
|
|
219
220
|
className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
220
|
-
children: /* @__PURE__ */ a(
|
|
221
|
+
children: /* @__PURE__ */ a(Ee, { className: "h-4 w-4 text-secondary-foreground" })
|
|
221
222
|
}
|
|
222
223
|
) }),
|
|
223
224
|
/* @__PURE__ */ a(Y, { variant: "tertiary", side: "top", children: D("datePicker.selectWeek") })
|
|
224
225
|
] })
|
|
225
226
|
] }),
|
|
226
|
-
...
|
|
227
|
+
...pe
|
|
227
228
|
}
|
|
228
229
|
)
|
|
229
230
|
}
|
|
230
231
|
) }),
|
|
231
232
|
/* @__PURE__ */ a(
|
|
232
|
-
|
|
233
|
+
qe,
|
|
233
234
|
{
|
|
234
235
|
className: "w-auto p-0",
|
|
235
236
|
align: "start",
|
|
@@ -237,23 +238,23 @@ const F = (n, c = "MM/dd/yyyy", t) => {
|
|
|
237
238
|
onOpenAutoFocus: (e) => {
|
|
238
239
|
v.current || e.preventDefault(), v.current = !1;
|
|
239
240
|
},
|
|
240
|
-
...
|
|
241
|
+
...ke,
|
|
241
242
|
children: /* @__PURE__ */ a(
|
|
242
|
-
|
|
243
|
+
Ge,
|
|
243
244
|
{
|
|
244
245
|
pickerType: "week",
|
|
245
246
|
weekMode: "single",
|
|
246
247
|
selectedWeeks: u,
|
|
247
|
-
footerFlashKey:
|
|
248
|
-
footerFlashTarget:
|
|
249
|
-
onWeekSelect:
|
|
250
|
-
month:
|
|
248
|
+
footerFlashKey: de,
|
|
249
|
+
footerFlashTarget: me,
|
|
250
|
+
onWeekSelect: Ce,
|
|
251
|
+
month: ye,
|
|
251
252
|
onMonthChange: h,
|
|
252
|
-
disabled:
|
|
253
|
+
disabled: _e(b, ee),
|
|
253
254
|
startMonth: te,
|
|
254
255
|
endMonth: ne,
|
|
255
256
|
showFooter: l,
|
|
256
|
-
...
|
|
257
|
+
...Ye({
|
|
257
258
|
calendarKind: I,
|
|
258
259
|
fiscalMode: x,
|
|
259
260
|
granularity: T,
|
|
@@ -263,8 +264,9 @@ const F = (n, c = "MM/dd/yyyy", t) => {
|
|
|
263
264
|
weekStartsOn: A,
|
|
264
265
|
showPresets: se,
|
|
265
266
|
showPeriodBoundaries: oe,
|
|
266
|
-
|
|
267
|
-
|
|
267
|
+
autoNavigateToAvailable: ie,
|
|
268
|
+
comparison: ce,
|
|
269
|
+
onComparisonChange: ae
|
|
268
270
|
}),
|
|
269
271
|
onApply: J,
|
|
270
272
|
onCancel: O,
|
|
@@ -277,7 +279,7 @@ const F = (n, c = "MM/dd/yyyy", t) => {
|
|
|
277
279
|
] });
|
|
278
280
|
}
|
|
279
281
|
);
|
|
280
|
-
|
|
282
|
+
Fe.displayName = "WeekPicker";
|
|
281
283
|
export {
|
|
282
|
-
|
|
284
|
+
Fe as WeekPicker
|
|
283
285
|
};
|