impact-nova 2.2.3 → 2.2.4
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/headers/custom-header.js +133 -110
- package/dist/components/data/ag-grid-react/headers/header-search-input.js +23 -23
- package/dist/components/data/ag-grid-react/index.js +202 -206
- package/dist/components/data/data-table/build-column-tree-from-grid.js +65 -67
- package/dist/components/data/data-table/data-table-column-list-sync.js +5 -10
- package/dist/components/data/data-table/data-table-column-list.js +64 -61
- package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +29 -0
- package/dist/components/data/data-table/data-table-column-tree-cache.js +117 -0
- package/dist/components/data/data-table/data-table-constants.d.ts +2 -0
- package/dist/components/data/data-table/data-table-constants.js +3 -2
- package/dist/components/data/data-table/data-table-sheet.js +46 -49
- package/dist/components/data/data-table/data-table.js +137 -119
- package/dist/components/data/data-table/index.js +24 -23
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.d.ts +3 -0
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.js +24 -0
- package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +2 -1
- package/dist/components/data/data-table/use-data-table-column-list-sync.js +249 -150
- package/dist/components/data/nested-list/components/NestedListContent.js +158 -96
- package/dist/components/data/nested-list/nested-list-constants.d.ts +4 -0
- package/dist/components/data/nested-list/nested-list-constants.js +6 -0
- package/dist/components/data/nested-list/nested-list-tree-utils.d.ts +3 -0
- package/dist/components/data/nested-list/nested-list-tree-utils.js +24 -0
- package/dist/components/data/nested-list/nested-list.js +214 -215
- package/dist/components/data-display/card/card.js +6 -5
- package/dist/components/feedback/dialog/dialog.js +7 -5
- package/dist/components/feedback/sheet/sheet.js +28 -27
- package/dist/components/flows/filter-panel/filter-panel.js +36 -35
- package/dist/components/flows/filter-strip/filter-tag-list.js +33 -33
- package/dist/components/forms/combobox/combobox.js +110 -100
- package/dist/components/forms/date-picker/date-input-behavior.d.ts +9 -0
- package/dist/components/forms/date-picker/date-input-behavior.js +32 -19
- package/dist/components/forms/date-picker/date-picker.js +96 -90
- package/dist/components/forms/date-picker/date-range-picker.js +160 -152
- package/dist/components/forms/date-picker/month-picker.js +71 -65
- package/dist/components/forms/date-picker/month-range-picker.js +153 -145
- package/dist/components/forms/date-picker/multi-date-picker.js +127 -99
- package/dist/components/forms/date-picker/multi-month-picker.js +109 -97
- package/dist/components/forms/date-picker/multi-week-picker.js +98 -86
- package/dist/components/forms/date-picker/week-picker.js +82 -76
- package/dist/components/forms/date-picker/week-range-picker.js +127 -119
- package/dist/impact-nova-base.scss +10 -5
- package/dist/impact-nova-components.css +9 -5
- package/dist/impact-nova.css +1 -1
- package/dist/index.js +189 -188
- package/dist/lib/overlay/overlay-portal-context.d.ts +11 -2
- package/dist/lib/overlay/overlay-portal-context.js +39 -28
- package/dist/lib/primitives/create-compound.d.ts +5 -0
- package/dist/lib/primitives/create-compound.js +17 -16
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as m, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import * as n from "react";
|
|
3
3
|
import { Cross as Y, CalendarMonth as Z } from "impact-nova-icons";
|
|
4
4
|
import { format as b } from "date-fns";
|
|
@@ -9,48 +9,48 @@ import { Calendar as oe } from "../../data-display/calendar/calendar.js";
|
|
|
9
9
|
import { Tooltip as x, TooltipTrigger as A, TooltipContent as M } from "../../feedback/tooltip/tooltip.js";
|
|
10
10
|
import { useImpactNovaI18n as se } from "../../../i18n/use-impact-nova-i18n.js";
|
|
11
11
|
import { getDateFnsLocale as ae } from "../../../i18n/getDateFnsLocale.js";
|
|
12
|
-
import { coerceWeekArrayApply as
|
|
13
|
-
import { usePickerDismissActionsRef as le, usePickerFooterDismissNudge as pe } from "./date-input-behavior.js";
|
|
14
|
-
import { buildDateBoundsMatcher as
|
|
15
|
-
const
|
|
16
|
-
const h = b(t.startDate, a,
|
|
12
|
+
import { coerceWeekArrayApply as ce, coerceWeekArray as ie } from "./calendar-selection-adapters.js";
|
|
13
|
+
import { usePickerDismissActionsRef as le, usePickerFooterDismissNudge as pe, handlePickerSurfacePointerDown as de } from "./date-input-behavior.js";
|
|
14
|
+
import { buildDateBoundsMatcher as fe } from "../../../lib/date-bounds-matcher.js";
|
|
15
|
+
const ue = (t, a = "MM/dd/yyyy", c) => {
|
|
16
|
+
const h = b(t.startDate, a, c ? { locale: c } : {}), y = b(t.endDate, a, c ? { locale: c } : {});
|
|
17
17
|
return `${h} - ${y}`;
|
|
18
18
|
}, me = n.forwardRef(
|
|
19
19
|
({
|
|
20
20
|
value: t,
|
|
21
21
|
onChange: a,
|
|
22
|
-
format:
|
|
22
|
+
format: c = "MM/dd/yyyy",
|
|
23
23
|
placeholder: h,
|
|
24
24
|
minDate: y,
|
|
25
25
|
maxDate: N,
|
|
26
26
|
startMonth: T,
|
|
27
27
|
endMonth: R,
|
|
28
28
|
showFooter: d = !0,
|
|
29
|
-
calendarType:
|
|
30
|
-
fiscalMode:
|
|
31
|
-
selectionMode:
|
|
29
|
+
calendarType: S = "calendar",
|
|
30
|
+
fiscalMode: w = "basic",
|
|
31
|
+
selectionMode: v = "week",
|
|
32
32
|
fiscalMonthPattern: I,
|
|
33
33
|
fiscalYearStartMonth: L = 1,
|
|
34
|
-
weekStartsOn:
|
|
34
|
+
weekStartsOn: O = 1,
|
|
35
35
|
disabled: o,
|
|
36
|
-
className:
|
|
37
|
-
...
|
|
38
|
-
},
|
|
39
|
-
const { locale:
|
|
36
|
+
className: j,
|
|
37
|
+
...F
|
|
38
|
+
}, E) => {
|
|
39
|
+
const { locale: P, t: i } = se(), K = n.useMemo(() => ae(P), [P]), $ = h ?? i("datePicker.selectWeeks"), [l, s] = n.useState(!1), k = n.useRef(!1), g = n.useRef(null), C = le(), { footerFlashKey: z, footerFlashTarget: V, popoverHandlers: q } = pe(d, l, C, g), [f, u] = n.useState(t);
|
|
40
40
|
n.useEffect(() => {
|
|
41
|
-
|
|
41
|
+
u(t);
|
|
42
42
|
}, [l, t]);
|
|
43
|
-
const
|
|
44
|
-
const p =
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
const p =
|
|
43
|
+
const B = (e) => {
|
|
44
|
+
const p = ie(e);
|
|
45
|
+
u(p), d || a?.(p);
|
|
46
|
+
}, H = (e) => {
|
|
47
|
+
const p = ce(e, f);
|
|
48
48
|
a?.(p), s(!1);
|
|
49
49
|
}, D = () => {
|
|
50
|
-
|
|
50
|
+
u(t), s(!1);
|
|
51
51
|
}, W = () => {
|
|
52
|
-
|
|
53
|
-
}, G = t && t.length > 0 ? t.length === 1 ?
|
|
52
|
+
u(void 0), a?.(void 0), d || s(!1);
|
|
53
|
+
}, G = t && t.length > 0 ? t.length === 1 ? ue(t[0], c, K) : `${t.length} weeks selected` : "", J = (e) => {
|
|
54
54
|
o || !e && d || s(e);
|
|
55
55
|
}, Q = n.useCallback(() => {
|
|
56
56
|
const e = f?.length ?? 0, p = t?.length ?? 0;
|
|
@@ -59,74 +59,86 @@ const fe = (t, a = "MM/dd/yyyy", i) => {
|
|
|
59
59
|
) ? "dismiss" : e > 0 ? "apply" : "cancel";
|
|
60
60
|
}, [f, t]);
|
|
61
61
|
return n.useLayoutEffect(() => {
|
|
62
|
-
|
|
62
|
+
C.current = {
|
|
63
63
|
onDismiss: D,
|
|
64
64
|
resolveFlash: Q
|
|
65
65
|
};
|
|
66
|
-
}), /* @__PURE__ */
|
|
67
|
-
/* @__PURE__ */ r(re, { asChild: !0, children: /* @__PURE__ */ r(
|
|
68
|
-
|
|
66
|
+
}), /* @__PURE__ */ m(te, { open: o ? !1 : l, onOpenChange: J, children: [
|
|
67
|
+
/* @__PURE__ */ r(re, { asChild: !0, children: /* @__PURE__ */ r(
|
|
68
|
+
"div",
|
|
69
69
|
{
|
|
70
|
-
ref:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
70
|
+
ref: g,
|
|
71
|
+
onPointerDown: (e) => de({
|
|
72
|
+
disabled: o,
|
|
73
|
+
event: e,
|
|
74
|
+
onOpen: () => s(!0),
|
|
75
|
+
focusField: () => g.current?.querySelector("input")?.focus()
|
|
76
|
+
}),
|
|
77
|
+
children: /* @__PURE__ */ r(
|
|
78
|
+
ee,
|
|
79
|
+
{
|
|
80
|
+
ref: E,
|
|
81
|
+
value: G,
|
|
82
|
+
placeholder: $,
|
|
83
|
+
readOnly: !0,
|
|
84
|
+
disabled: o,
|
|
85
|
+
onClick: () => {
|
|
86
|
+
!o && !l && s(!0);
|
|
87
|
+
},
|
|
88
|
+
className: _("cursor-pointer", j),
|
|
89
|
+
suffix: /* @__PURE__ */ m("div", { className: "flex items-center gap-1", children: [
|
|
90
|
+
t && t.length > 0 && !o && /* @__PURE__ */ m(x, { children: [
|
|
91
|
+
/* @__PURE__ */ r(A, { asChild: !0, children: /* @__PURE__ */ r(
|
|
92
|
+
"button",
|
|
93
|
+
{
|
|
94
|
+
type: "button",
|
|
95
|
+
tabIndex: 0,
|
|
96
|
+
"aria-label": i("calendar.clear"),
|
|
97
|
+
onClick: (e) => {
|
|
98
|
+
e.stopPropagation(), W();
|
|
99
|
+
},
|
|
100
|
+
className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
101
|
+
children: /* @__PURE__ */ r(Y, { className: "size-3 hover:text-content" })
|
|
102
|
+
}
|
|
103
|
+
) }),
|
|
104
|
+
/* @__PURE__ */ r(M, { variant: "tertiary", side: "top", children: i("calendar.clear") })
|
|
105
|
+
] }),
|
|
106
|
+
/* @__PURE__ */ m(x, { children: [
|
|
107
|
+
/* @__PURE__ */ r(A, { asChild: !0, children: /* @__PURE__ */ r(
|
|
108
|
+
"button",
|
|
109
|
+
{
|
|
110
|
+
type: "button",
|
|
111
|
+
tabIndex: 0,
|
|
112
|
+
"data-component": "calendar-trigger",
|
|
113
|
+
"aria-label": i("datePicker.selectWeeks"),
|
|
114
|
+
onPointerDown: (e) => {
|
|
115
|
+
e.preventDefault(), e.stopPropagation(), o || s(!l);
|
|
116
|
+
},
|
|
117
|
+
onKeyDown: (e) => {
|
|
118
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), o || (k.current = !0, s(!l)));
|
|
119
|
+
},
|
|
120
|
+
className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
121
|
+
children: /* @__PURE__ */ r(Z, { className: "h-4 w-4 text-secondary-foreground" })
|
|
122
|
+
}
|
|
123
|
+
) }),
|
|
124
|
+
/* @__PURE__ */ r(M, { variant: "tertiary", side: "top", children: i("datePicker.selectWeeks") })
|
|
125
|
+
] })
|
|
126
|
+
] }),
|
|
127
|
+
...F
|
|
128
|
+
}
|
|
129
|
+
)
|
|
118
130
|
}
|
|
119
|
-
) })
|
|
131
|
+
) }),
|
|
120
132
|
/* @__PURE__ */ r(
|
|
121
133
|
ne,
|
|
122
134
|
{
|
|
123
135
|
className: "w-auto p-0",
|
|
124
136
|
align: "start",
|
|
125
|
-
"aria-label":
|
|
137
|
+
"aria-label": i("datePicker.selectWeeks"),
|
|
126
138
|
onOpenAutoFocus: (e) => {
|
|
127
139
|
k.current || e.preventDefault(), k.current = !1;
|
|
128
140
|
},
|
|
129
|
-
...
|
|
141
|
+
...q,
|
|
130
142
|
children: /* @__PURE__ */ r(
|
|
131
143
|
oe,
|
|
132
144
|
{
|
|
@@ -135,18 +147,18 @@ const fe = (t, a = "MM/dd/yyyy", i) => {
|
|
|
135
147
|
selectedWeeks: f,
|
|
136
148
|
footerFlashKey: z,
|
|
137
149
|
footerFlashTarget: V,
|
|
138
|
-
onWeekSelect:
|
|
139
|
-
disabled:
|
|
150
|
+
onWeekSelect: B,
|
|
151
|
+
disabled: fe(y, N),
|
|
140
152
|
startMonth: T,
|
|
141
153
|
endMonth: R,
|
|
142
154
|
showFooter: d,
|
|
143
|
-
calendarType:
|
|
144
|
-
fiscalMode:
|
|
145
|
-
selectionMode:
|
|
155
|
+
calendarType: S,
|
|
156
|
+
fiscalMode: w,
|
|
157
|
+
selectionMode: v,
|
|
146
158
|
fiscalMonthPattern: I,
|
|
147
159
|
fiscalYearStartMonth: L,
|
|
148
|
-
weekStartsOn:
|
|
149
|
-
onApply:
|
|
160
|
+
weekStartsOn: O,
|
|
161
|
+
onApply: H,
|
|
150
162
|
onCancel: D,
|
|
151
163
|
onClear: W,
|
|
152
164
|
captionLayout: "dropdown"
|
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
import { jsxs as C, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import * as s from "react";
|
|
3
3
|
import { Cross as Ie, CalendarMonth as Ce } from "impact-nova-icons";
|
|
4
|
-
import { format as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { usePickerDismissActionsRef as
|
|
7
|
-
import { Input as
|
|
8
|
-
import { Popover as Ve, PopoverAnchor as
|
|
9
|
-
import { Calendar as
|
|
4
|
+
import { format as j } from "date-fns";
|
|
5
|
+
import { cn as Pe } from "../../../lib/utils.js";
|
|
6
|
+
import { usePickerDismissActionsRef as We, usePickerFooterDismissNudge as Re, isDateInputInvalid as be, resolveSingleValueDismissFlash as xe, handlePickerSurfacePointerDown as Se, resolveDateInputOnBlur as Ee, maskDateInput as Ae, parseDateInput as Ne, resolveDateInputOnEnter as Te } from "./date-input-behavior.js";
|
|
7
|
+
import { Input as we } from "../input/input.js";
|
|
8
|
+
import { Popover as Ve, PopoverAnchor as Le, PopoverContent as Oe } from "../../feedback/popover/popover.js";
|
|
9
|
+
import { Calendar as je } from "../../data-display/calendar/calendar.js";
|
|
10
10
|
import { Tooltip as X, TooltipTrigger as Z, TooltipContent as _ } 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
|
|
11
|
+
import { resolveWeekSelection as Be } from "../../../lib/fiscal-calendar.js";
|
|
12
|
+
import { useImpactNovaI18n as Ke } from "../../../i18n/use-impact-nova-i18n.js";
|
|
13
|
+
import { getDateFnsLocale as Me } from "../../../i18n/getDateFnsLocale.js";
|
|
14
|
+
import { coerceSingleWeekApply as ze, coerceSingleWeek as He } from "./calendar-selection-adapters.js";
|
|
15
|
+
import { buildDateBoundsMatcher as $e } from "../../../lib/date-bounds-matcher.js";
|
|
16
16
|
const Y = (n, c = "MM/dd/yyyy", t) => {
|
|
17
|
-
const
|
|
18
|
-
return `${
|
|
19
|
-
}, h = (n, c, t) => n ?
|
|
17
|
+
const P = j(n.startDate, c, t ? { locale: t } : {}), W = j(n.endDate, c, t ? { locale: t } : {});
|
|
18
|
+
return `${P} - ${W}`;
|
|
19
|
+
}, h = (n, c, t) => n ? j(n.startDate, c, t ? { locale: t } : {}) : "", qe = s.forwardRef(
|
|
20
20
|
({
|
|
21
21
|
value: n,
|
|
22
22
|
onChange: c,
|
|
23
23
|
format: t = "MM/dd/yyyy",
|
|
24
|
-
placeholder:
|
|
25
|
-
minDate:
|
|
24
|
+
placeholder: P,
|
|
25
|
+
minDate: W,
|
|
26
26
|
maxDate: F,
|
|
27
27
|
startMonth: ee,
|
|
28
28
|
endMonth: te,
|
|
29
29
|
showFooter: l = !0,
|
|
30
|
-
calendarType:
|
|
30
|
+
calendarType: R = "calendar",
|
|
31
31
|
fiscalMode: b = "basic",
|
|
32
32
|
selectionMode: x = "week",
|
|
33
|
-
fiscalMonthPattern:
|
|
34
|
-
fiscalYearStartMonth:
|
|
33
|
+
fiscalMonthPattern: S,
|
|
34
|
+
fiscalYearStartMonth: E = 1,
|
|
35
35
|
weekStartsOn: A = 1,
|
|
36
36
|
disabled: p,
|
|
37
37
|
className: ne,
|
|
38
38
|
...re
|
|
39
39
|
}, se) => {
|
|
40
|
-
const { locale:
|
|
41
|
-
s.useImperativeHandle(se, () =>
|
|
42
|
-
const [i, M] = s.useState(!1), z =
|
|
43
|
-
f(n), m(h(n, t, o)),
|
|
40
|
+
const { locale: B, t: D } = Ke(), o = s.useMemo(() => Me(B), [B]), ie = P ?? D("datePicker.selectWeek"), N = s.useRef(null), K = s.useRef(null), v = s.useRef(!1);
|
|
41
|
+
s.useImperativeHandle(se, () => N.current);
|
|
42
|
+
const [i, M] = s.useState(!1), z = We(), { footerFlashKey: oe, footerFlashTarget: ce, popoverHandlers: ae } = Re(l, i, z, K), [le, T] = s.useState(!1), [u, f] = s.useState(n), [y, m] = s.useState(""), [pe, g] = s.useState(n?.startDate || /* @__PURE__ */ new Date()), ue = n ? Y(n, t, o) : "", H = u ? Y(u, t, o) : "", w = i || le, fe = w ? y : H, $ = s.useCallback(() => {
|
|
43
|
+
f(n), m(h(n, t, o)), g(n?.startDate || /* @__PURE__ */ new Date());
|
|
44
44
|
}, [n, t, o]), I = s.useCallback(() => {
|
|
45
|
-
m(h(u ?? n, t, o)),
|
|
45
|
+
m(h(u ?? n, t, o)), g((u ?? n)?.startDate || /* @__PURE__ */ new Date());
|
|
46
46
|
}, [u, n, t, o]);
|
|
47
47
|
s.useEffect(() => {
|
|
48
48
|
i || f(n);
|
|
@@ -52,8 +52,8 @@ const Y = (n, c = "MM/dd/yyyy", t) => {
|
|
|
52
52
|
i && !q.current && I(), q.current = i;
|
|
53
53
|
}, [i, I]);
|
|
54
54
|
const d = () => {
|
|
55
|
-
|
|
56
|
-
},
|
|
55
|
+
T(!1), M(!1);
|
|
56
|
+
}, k = (e) => {
|
|
57
57
|
if (!p) {
|
|
58
58
|
if (e) {
|
|
59
59
|
I(), M(!0);
|
|
@@ -62,48 +62,48 @@ const Y = (n, c = "MM/dd/yyyy", t) => {
|
|
|
62
62
|
l || d();
|
|
63
63
|
}
|
|
64
64
|
}, V = s.useCallback(
|
|
65
|
-
(e) =>
|
|
66
|
-
calendarType:
|
|
65
|
+
(e) => Be(e, {
|
|
66
|
+
calendarType: R,
|
|
67
67
|
fiscalMode: b,
|
|
68
68
|
selectionMode: x,
|
|
69
|
-
fiscalMonthPattern:
|
|
70
|
-
fiscalYearStartMonth:
|
|
69
|
+
fiscalMonthPattern: S,
|
|
70
|
+
fiscalYearStartMonth: E,
|
|
71
71
|
weekStartsOn: A
|
|
72
72
|
}),
|
|
73
73
|
[
|
|
74
|
-
|
|
74
|
+
R,
|
|
75
75
|
b,
|
|
76
76
|
x,
|
|
77
|
-
E,
|
|
78
77
|
S,
|
|
78
|
+
E,
|
|
79
79
|
A
|
|
80
80
|
]
|
|
81
81
|
), de = (e) => {
|
|
82
|
-
const r =
|
|
83
|
-
f(r), r && (m(h(r, t, o)),
|
|
82
|
+
const r = He(e);
|
|
83
|
+
f(r), r && (m(h(r, t, o)), g(r.startDate)), l || (c?.(r), d());
|
|
84
84
|
}, G = (e) => {
|
|
85
|
-
const r =
|
|
85
|
+
const r = ze(e, u);
|
|
86
86
|
c?.(r), d();
|
|
87
|
-
},
|
|
87
|
+
}, L = () => {
|
|
88
88
|
$(), d();
|
|
89
89
|
}, J = () => {
|
|
90
90
|
f(void 0), m(""), c?.(void 0), l || d();
|
|
91
91
|
}, me = (e) => {
|
|
92
92
|
const r = V(e);
|
|
93
|
-
f(r), m(h(r, t, o)),
|
|
93
|
+
f(r), m(h(r, t, o)), g(e), c?.(r), d();
|
|
94
94
|
}, ke = (e) => {
|
|
95
|
-
const r =
|
|
95
|
+
const r = Ae(e.target.value, t, y);
|
|
96
96
|
if (m(r), r === "") {
|
|
97
97
|
f(void 0), l || c?.(void 0);
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
|
-
const { parsed:
|
|
101
|
-
if (ve &&
|
|
102
|
-
const U = V(
|
|
103
|
-
f(U),
|
|
100
|
+
const { parsed: O, isValid: ve } = Ne(r, t, o);
|
|
101
|
+
if (ve && O) {
|
|
102
|
+
const U = V(O);
|
|
103
|
+
f(U), g(O), l || c?.(U);
|
|
104
104
|
}
|
|
105
|
-
},
|
|
106
|
-
if (
|
|
105
|
+
}, De = () => {
|
|
106
|
+
if (T(!1), i) return;
|
|
107
107
|
const e = Ee(
|
|
108
108
|
y,
|
|
109
109
|
t,
|
|
@@ -120,18 +120,18 @@ const Y = (n, c = "MM/dd/yyyy", t) => {
|
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
y || (f(void 0), l || c?.(void 0));
|
|
123
|
-
},
|
|
123
|
+
}, ye = () => {
|
|
124
124
|
if (i && l) {
|
|
125
125
|
G();
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
|
-
const e =
|
|
128
|
+
const e = Te(y, t, o);
|
|
129
129
|
if (e.parsed) {
|
|
130
130
|
l && me(e.parsed);
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
|
-
i || (v.current = !0,
|
|
134
|
-
}, Q = ue !== H, ge =
|
|
133
|
+
i || (v.current = !0, k(!0));
|
|
134
|
+
}, Q = ue !== H, ge = w && be(y, t, o), he = s.useCallback(
|
|
135
135
|
() => xe(
|
|
136
136
|
u,
|
|
137
137
|
n,
|
|
@@ -141,35 +141,41 @@ const Y = (n, c = "MM/dd/yyyy", t) => {
|
|
|
141
141
|
);
|
|
142
142
|
return s.useLayoutEffect(() => {
|
|
143
143
|
z.current = {
|
|
144
|
-
onDismiss:
|
|
144
|
+
onDismiss: L,
|
|
145
145
|
resolveFlash: he
|
|
146
146
|
};
|
|
147
|
-
}), /* @__PURE__ */ C(Ve, { open: p ? !1 : i, onOpenChange:
|
|
148
|
-
/* @__PURE__ */ a(
|
|
147
|
+
}), /* @__PURE__ */ C(Ve, { open: p ? !1 : i, onOpenChange: k, children: [
|
|
148
|
+
/* @__PURE__ */ a(Le, { asChild: !0, children: /* @__PURE__ */ a(
|
|
149
149
|
"div",
|
|
150
150
|
{
|
|
151
151
|
ref: K,
|
|
152
152
|
"data-component": "week-picker",
|
|
153
153
|
"data-state": i ? "open" : "closed",
|
|
154
154
|
"data-pending": Q || void 0,
|
|
155
|
+
onPointerDown: (e) => Se({
|
|
156
|
+
disabled: p,
|
|
157
|
+
event: e,
|
|
158
|
+
onOpen: () => k(!0),
|
|
159
|
+
focusField: () => N.current?.focus()
|
|
160
|
+
}),
|
|
155
161
|
children: /* @__PURE__ */ a(
|
|
156
|
-
|
|
162
|
+
we,
|
|
157
163
|
{
|
|
158
|
-
ref:
|
|
164
|
+
ref: N,
|
|
159
165
|
value: fe,
|
|
160
166
|
onChange: ke,
|
|
161
167
|
onFocus: () => {
|
|
162
|
-
p || (
|
|
168
|
+
p || (T(!0), I());
|
|
163
169
|
},
|
|
164
|
-
onBlur:
|
|
165
|
-
onClick: () => !p &&
|
|
170
|
+
onBlur: De,
|
|
171
|
+
onClick: () => !p && k(!0),
|
|
166
172
|
onKeyDown: (e) => {
|
|
167
|
-
e.key === "Enter" && !p && (e.preventDefault(),
|
|
173
|
+
e.key === "Enter" && !p && (e.preventDefault(), ye()), e.key === "ArrowDown" && !i && !p && (e.preventDefault(), v.current = !0, k(!0)), e.key === "Escape" && i && (e.preventDefault(), L());
|
|
168
174
|
},
|
|
169
|
-
placeholder:
|
|
175
|
+
placeholder: w ? t : ie,
|
|
170
176
|
disabled: p,
|
|
171
177
|
"data-form-control": "input",
|
|
172
|
-
className:
|
|
178
|
+
className: Pe(
|
|
173
179
|
"cursor-pointer",
|
|
174
180
|
ge ? "text-destructive" : Q ? "text-content-placeholder" : "",
|
|
175
181
|
ne
|
|
@@ -181,7 +187,7 @@ const Y = (n, c = "MM/dd/yyyy", t) => {
|
|
|
181
187
|
{
|
|
182
188
|
type: "button",
|
|
183
189
|
tabIndex: 0,
|
|
184
|
-
"aria-label":
|
|
190
|
+
"aria-label": D("calendar.clear"),
|
|
185
191
|
onClick: (e) => {
|
|
186
192
|
e.stopPropagation(), J();
|
|
187
193
|
},
|
|
@@ -189,7 +195,7 @@ const Y = (n, c = "MM/dd/yyyy", t) => {
|
|
|
189
195
|
children: /* @__PURE__ */ a(Ie, { className: "size-3 hover:text-content" })
|
|
190
196
|
}
|
|
191
197
|
) }),
|
|
192
|
-
/* @__PURE__ */ a(_, { variant: "tertiary", side: "top", children:
|
|
198
|
+
/* @__PURE__ */ a(_, { variant: "tertiary", side: "top", children: D("calendar.clear") })
|
|
193
199
|
] }),
|
|
194
200
|
/* @__PURE__ */ C(X, { children: [
|
|
195
201
|
/* @__PURE__ */ a(Z, { asChild: !0, children: /* @__PURE__ */ a(
|
|
@@ -197,18 +203,18 @@ const Y = (n, c = "MM/dd/yyyy", t) => {
|
|
|
197
203
|
{
|
|
198
204
|
type: "button",
|
|
199
205
|
tabIndex: 0,
|
|
200
|
-
"aria-label":
|
|
206
|
+
"aria-label": D("datePicker.selectWeek"),
|
|
201
207
|
onClick: (e) => {
|
|
202
|
-
e.stopPropagation(), p || (i ? d() :
|
|
208
|
+
e.stopPropagation(), p || (i ? d() : k(!0));
|
|
203
209
|
},
|
|
204
210
|
onKeyDown: (e) => {
|
|
205
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), p || (v.current = !0, i ? d() :
|
|
211
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), p || (v.current = !0, i ? d() : k(!0)));
|
|
206
212
|
},
|
|
207
213
|
className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
208
214
|
children: /* @__PURE__ */ a(Ce, { className: "h-4 w-4 text-secondary-foreground" })
|
|
209
215
|
}
|
|
210
216
|
) }),
|
|
211
|
-
/* @__PURE__ */ a(_, { variant: "tertiary", side: "top", children:
|
|
217
|
+
/* @__PURE__ */ a(_, { variant: "tertiary", side: "top", children: D("datePicker.selectWeek") })
|
|
212
218
|
] })
|
|
213
219
|
] }),
|
|
214
220
|
...re
|
|
@@ -217,17 +223,17 @@ const Y = (n, c = "MM/dd/yyyy", t) => {
|
|
|
217
223
|
}
|
|
218
224
|
) }),
|
|
219
225
|
/* @__PURE__ */ a(
|
|
220
|
-
|
|
226
|
+
Oe,
|
|
221
227
|
{
|
|
222
228
|
className: "w-auto p-0",
|
|
223
229
|
align: "start",
|
|
224
|
-
"aria-label":
|
|
230
|
+
"aria-label": D("datePicker.selectWeek"),
|
|
225
231
|
onOpenAutoFocus: (e) => {
|
|
226
232
|
v.current || e.preventDefault(), v.current = !1;
|
|
227
233
|
},
|
|
228
234
|
...ae,
|
|
229
235
|
children: /* @__PURE__ */ a(
|
|
230
|
-
|
|
236
|
+
je,
|
|
231
237
|
{
|
|
232
238
|
pickerType: "week",
|
|
233
239
|
weekMode: "single",
|
|
@@ -236,19 +242,19 @@ const Y = (n, c = "MM/dd/yyyy", t) => {
|
|
|
236
242
|
footerFlashTarget: ce,
|
|
237
243
|
onWeekSelect: de,
|
|
238
244
|
month: pe,
|
|
239
|
-
onMonthChange:
|
|
240
|
-
disabled:
|
|
245
|
+
onMonthChange: g,
|
|
246
|
+
disabled: $e(W, F),
|
|
241
247
|
startMonth: ee,
|
|
242
248
|
endMonth: te,
|
|
243
249
|
showFooter: l,
|
|
244
|
-
calendarType:
|
|
250
|
+
calendarType: R,
|
|
245
251
|
fiscalMode: b,
|
|
246
252
|
selectionMode: x,
|
|
247
|
-
fiscalMonthPattern:
|
|
248
|
-
fiscalYearStartMonth:
|
|
253
|
+
fiscalMonthPattern: S,
|
|
254
|
+
fiscalYearStartMonth: E,
|
|
249
255
|
weekStartsOn: A,
|
|
250
256
|
onApply: G,
|
|
251
|
-
onCancel:
|
|
257
|
+
onCancel: L,
|
|
252
258
|
onClear: J,
|
|
253
259
|
captionLayout: "dropdown"
|
|
254
260
|
}
|
|
@@ -258,7 +264,7 @@ const Y = (n, c = "MM/dd/yyyy", t) => {
|
|
|
258
264
|
] });
|
|
259
265
|
}
|
|
260
266
|
);
|
|
261
|
-
|
|
267
|
+
qe.displayName = "WeekPicker";
|
|
262
268
|
export {
|
|
263
|
-
|
|
269
|
+
qe as WeekPicker
|
|
264
270
|
};
|