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
|
@@ -6,8 +6,8 @@ import { createCompoundPart as y, wrapRadixPart as c } from "../../../lib/primit
|
|
|
6
6
|
import { cn as v } from "../../../lib/utils.js";
|
|
7
7
|
import { useImpactNovaI18n as h } from "../../../i18n/use-impact-nova-i18n.js";
|
|
8
8
|
import { Button as w } from "../../primitives/button/button.js";
|
|
9
|
-
import { mergeElementRefs as
|
|
10
|
-
import { OverlayHostProvider as
|
|
9
|
+
import { mergeElementRefs as P } from "../../../lib/overlay/merge-element-refs.js";
|
|
10
|
+
import { OverlayHostProvider as O, useOverlayHostDismissBeforeClose as x, useOverlayHostNestedDismissing as H } from "../../../lib/overlay/overlay-portal-context.js";
|
|
11
11
|
import { OVERLAY_HOST_GROUP_CLASS as R } from "../../../lib/overlay/overlay-host.constants.js";
|
|
12
12
|
import { useOverlayPortalContainerState as T } from "../../../lib/overlay/use-overlay-portal-container-state.js";
|
|
13
13
|
const K = (o) => /* @__PURE__ */ t(e.Root, { "data-component": "dialog", ...o }), U = c(
|
|
@@ -49,20 +49,20 @@ const C = u.forwardRef(
|
|
|
49
49
|
onEscapeKeyDown: m,
|
|
50
50
|
...g
|
|
51
51
|
}, p) => {
|
|
52
|
-
const f = H(),
|
|
52
|
+
const f = H(), d = x();
|
|
53
53
|
return /* @__PURE__ */ D(
|
|
54
54
|
e.Content,
|
|
55
55
|
{
|
|
56
|
-
ref:
|
|
56
|
+
ref: P(p, s),
|
|
57
57
|
"aria-describedby": void 0,
|
|
58
58
|
"data-component": "dialog-content",
|
|
59
59
|
"data-overlay-host": "",
|
|
60
60
|
"data-nested-dismissing": f || void 0,
|
|
61
|
-
onOpenAutoFocus: (
|
|
62
|
-
|
|
61
|
+
onOpenAutoFocus: (l) => {
|
|
62
|
+
l.preventDefault(), r?.(l);
|
|
63
63
|
},
|
|
64
|
-
onEscapeKeyDown: (
|
|
65
|
-
l
|
|
64
|
+
onEscapeKeyDown: (l) => {
|
|
65
|
+
m?.(l), !l.defaultPrevented && d();
|
|
66
66
|
},
|
|
67
67
|
className: v(
|
|
68
68
|
"fixed left-[50%] top-[50%] z-50 flex flex-col w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border bg-canvas shadow-xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg motion-reduce:animate-none motion-reduce:transition-none",
|
|
@@ -81,7 +81,7 @@ const C = u.forwardRef(
|
|
|
81
81
|
"data-component": "dialog-close",
|
|
82
82
|
className: "absolute end-4 top-3.5 opacity-50 ring-offset-canvas transition-opacity hover:opacity-100 focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 data-[state=open]:bg-accent data-[state=open]:text-content-icon [&_svg]:!size-3 [&_svg]:block",
|
|
83
83
|
"aria-label": a,
|
|
84
|
-
onPointerDown: () =>
|
|
84
|
+
onPointerDown: () => d(),
|
|
85
85
|
children: /* @__PURE__ */ t(N, {})
|
|
86
86
|
}
|
|
87
87
|
) })
|
|
@@ -92,8 +92,8 @@ const C = u.forwardRef(
|
|
|
92
92
|
);
|
|
93
93
|
C.displayName = "DialogHostContent";
|
|
94
94
|
const B = u.forwardRef(({ className: o, children: a, hideClose: s, onOpenAutoFocus: i, onEscapeKeyDown: n, ...r }, m) => {
|
|
95
|
-
const { t: g } = h(), p = g("aria.close"), { portalContainer: f, setPortalContainerElement:
|
|
96
|
-
return /* @__PURE__ */ t(z, { children: /* @__PURE__ */ D(
|
|
95
|
+
const { t: g } = h(), p = g("aria.close"), { portalContainer: f, setPortalContainerElement: d } = T();
|
|
96
|
+
return /* @__PURE__ */ t(z, { children: /* @__PURE__ */ D(O, { portalContainer: f, children: [
|
|
97
97
|
/* @__PURE__ */ t(b, {}),
|
|
98
98
|
/* @__PURE__ */ t(
|
|
99
99
|
C,
|
|
@@ -101,7 +101,7 @@ const B = u.forwardRef(({ className: o, children: a, hideClose: s, onOpenAutoFoc
|
|
|
101
101
|
ref: m,
|
|
102
102
|
hideClose: s,
|
|
103
103
|
closeLabel: p,
|
|
104
|
-
setPortalContainerElement:
|
|
104
|
+
setPortalContainerElement: d,
|
|
105
105
|
className: o,
|
|
106
106
|
onOpenAutoFocus: i,
|
|
107
107
|
onEscapeKeyDown: n,
|
|
@@ -10,7 +10,7 @@ import { mergeElementRefs as E } from "../../../lib/overlay/merge-element-refs.j
|
|
|
10
10
|
import { OverlayHostProvider as k, useOverlayHostDismissBeforeClose as x, useOverlayHostNestedDismissing as B } from "../../../lib/overlay/overlay-portal-context.js";
|
|
11
11
|
import { OVERLAY_HOST_GROUP_CLASS as j } from "../../../lib/overlay/overlay-host.constants.js";
|
|
12
12
|
import { useOverlayPortalContainerState as z } from "../../../lib/overlay/use-overlay-portal-container-state.js";
|
|
13
|
-
import { SheetContext as
|
|
13
|
+
import { SheetContext as P } from "./sheet-context.js";
|
|
14
14
|
import { sheetVariants as A } from "./sheet.variants.js";
|
|
15
15
|
const ee = (t) => /* @__PURE__ */ e(a.Root, { "data-component": "sheet", ...t }), te = y(
|
|
16
16
|
"sheet",
|
|
@@ -22,8 +22,8 @@ const ee = (t) => /* @__PURE__ */ e(a.Root, { "data-component": "sheet", ...t })
|
|
|
22
22
|
"close",
|
|
23
23
|
"SheetClose",
|
|
24
24
|
a.Close
|
|
25
|
-
), I = a.Portal,
|
|
26
|
-
const
|
|
25
|
+
), I = a.Portal, T = p.forwardRef(({ className: t, onPointerDown: i, ...l }, n) => {
|
|
26
|
+
const s = x();
|
|
27
27
|
return /* @__PURE__ */ e(
|
|
28
28
|
a.Overlay,
|
|
29
29
|
{
|
|
@@ -32,21 +32,21 @@ const ee = (t) => /* @__PURE__ */ e(a.Root, { "data-component": "sheet", ...t })
|
|
|
32
32
|
t
|
|
33
33
|
),
|
|
34
34
|
onPointerDown: (c) => {
|
|
35
|
-
|
|
35
|
+
s(), i?.(c);
|
|
36
36
|
},
|
|
37
37
|
...l,
|
|
38
38
|
ref: n
|
|
39
39
|
}
|
|
40
40
|
);
|
|
41
41
|
});
|
|
42
|
-
|
|
42
|
+
T.displayName = a.Overlay.displayName;
|
|
43
43
|
const D = p.forwardRef(
|
|
44
44
|
({
|
|
45
45
|
side: t,
|
|
46
46
|
isExpanded: i,
|
|
47
47
|
setPortalContainerElement: l,
|
|
48
48
|
className: n,
|
|
49
|
-
children:
|
|
49
|
+
children: s,
|
|
50
50
|
onOpenAutoFocus: c,
|
|
51
51
|
onEscapeKeyDown: h,
|
|
52
52
|
...f
|
|
@@ -59,11 +59,11 @@ const D = p.forwardRef(
|
|
|
59
59
|
"data-component": "sheet-content",
|
|
60
60
|
"data-overlay-host": "",
|
|
61
61
|
"data-nested-dismissing": r || void 0,
|
|
62
|
-
onOpenAutoFocus: (
|
|
63
|
-
|
|
62
|
+
onOpenAutoFocus: (o) => {
|
|
63
|
+
o.preventDefault(), c?.(o);
|
|
64
64
|
},
|
|
65
|
-
onEscapeKeyDown: (
|
|
66
|
-
|
|
65
|
+
onEscapeKeyDown: (o) => {
|
|
66
|
+
h?.(o), !o.defaultPrevented && d();
|
|
67
67
|
},
|
|
68
68
|
className: g(
|
|
69
69
|
A({ side: t }),
|
|
@@ -73,7 +73,7 @@ const D = p.forwardRef(
|
|
|
73
73
|
n
|
|
74
74
|
),
|
|
75
75
|
...f,
|
|
76
|
-
children:
|
|
76
|
+
children: s
|
|
77
77
|
}
|
|
78
78
|
);
|
|
79
79
|
}
|
|
@@ -85,16 +85,16 @@ const _ = p.forwardRef(
|
|
|
85
85
|
className: i,
|
|
86
86
|
children: l,
|
|
87
87
|
expandable: n = !1,
|
|
88
|
-
defaultExpanded:
|
|
88
|
+
defaultExpanded: s = !1,
|
|
89
89
|
onOpenAutoFocus: c,
|
|
90
90
|
onEscapeKeyDown: h,
|
|
91
91
|
...f
|
|
92
92
|
}, u) => {
|
|
93
|
-
const [r, d] = p.useState(
|
|
93
|
+
const [r, d] = p.useState(s), { portalContainer: o, setPortalContainerElement: H } = z(), O = p.useCallback(() => {
|
|
94
94
|
d((w) => !w);
|
|
95
95
|
}, []);
|
|
96
96
|
return /* @__PURE__ */ e(
|
|
97
|
-
|
|
97
|
+
P.Provider,
|
|
98
98
|
{
|
|
99
99
|
value: {
|
|
100
100
|
isExpanded: r,
|
|
@@ -102,8 +102,8 @@ const _ = p.forwardRef(
|
|
|
102
102
|
expandable: n,
|
|
103
103
|
side: t || void 0
|
|
104
104
|
},
|
|
105
|
-
children: /* @__PURE__ */ e(I, { children: /* @__PURE__ */ m(k, { portalContainer:
|
|
106
|
-
/* @__PURE__ */ e(
|
|
105
|
+
children: /* @__PURE__ */ e(I, { children: /* @__PURE__ */ m(k, { portalContainer: o, children: [
|
|
106
|
+
/* @__PURE__ */ e(T, {}),
|
|
107
107
|
/* @__PURE__ */ e(
|
|
108
108
|
D,
|
|
109
109
|
{
|
|
@@ -129,7 +129,7 @@ const V = ({
|
|
|
129
129
|
children: i,
|
|
130
130
|
...l
|
|
131
131
|
}) => {
|
|
132
|
-
const { t: n } = R(), { isExpanded:
|
|
132
|
+
const { t: n } = R(), { isExpanded: s, onExpandToggle: c, expandable: h, side: f } = p.useContext(P), u = x(), r = n("aria.close"), d = n("nestedList.expand"), o = n("nestedList.collapse");
|
|
133
133
|
return /* @__PURE__ */ m(
|
|
134
134
|
"div",
|
|
135
135
|
{
|
|
@@ -150,14 +150,14 @@ const V = ({
|
|
|
150
150
|
"data-component": "sheet-expand-toggle",
|
|
151
151
|
onClick: c,
|
|
152
152
|
className: "rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none",
|
|
153
|
-
"aria-label":
|
|
153
|
+
"aria-label": s ? o : d,
|
|
154
154
|
children: [
|
|
155
|
-
|
|
156
|
-
/* @__PURE__ */ e("span", { className: "sr-only", children:
|
|
155
|
+
s ? /* @__PURE__ */ e(v, { size: 19, className: " -rotate-90" }) : /* @__PURE__ */ e(v, { size: 19, className: "rotate-90" }),
|
|
156
|
+
/* @__PURE__ */ e("span", { className: "sr-only", children: s ? o : d })
|
|
157
157
|
]
|
|
158
158
|
}
|
|
159
159
|
) }),
|
|
160
|
-
/* @__PURE__ */ e(C, { variant: "tertiary", side: "top", children:
|
|
160
|
+
/* @__PURE__ */ e(C, { variant: "tertiary", side: "top", children: s ? o : d })
|
|
161
161
|
] }),
|
|
162
162
|
/* @__PURE__ */ m(N, { children: [
|
|
163
163
|
/* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ m(
|
|
@@ -211,7 +211,7 @@ export {
|
|
|
211
211
|
ne as SheetDescription,
|
|
212
212
|
se as SheetFooter,
|
|
213
213
|
V as SheetHeader,
|
|
214
|
-
|
|
214
|
+
T as SheetOverlay,
|
|
215
215
|
I as SheetPortal,
|
|
216
216
|
ae as SheetTitle,
|
|
217
217
|
te as SheetTrigger
|
|
@@ -16,6 +16,8 @@ export declare function coerceMonthRangeApply(value: CalendarApplyValue | undefi
|
|
|
16
16
|
export declare function coerceSingleWeek(value: WeekSelectValue): WeekSelection | undefined;
|
|
17
17
|
export declare function coerceWeekArray(value: WeekSelectValue): WeekSelection[] | undefined;
|
|
18
18
|
export declare function coerceWeekRangeApply(value: CalendarApplyValue | undefined, fallback?: WeekRange): WeekRange | undefined;
|
|
19
|
+
/** Range-mode first click is `{ from }` only. A single week is a valid range. */
|
|
20
|
+
export declare function completeWeekRange(range?: WeekRange): WeekRange | undefined;
|
|
19
21
|
export declare function coerceDateArray(value: DateSelectValue): Date[] | undefined;
|
|
20
22
|
export declare function coerceDateArrayApply(value: CalendarApplyValue | undefined, fallback?: Date[]): Date[] | undefined;
|
|
21
23
|
export declare function coerceMonthArrayApply(value: CalendarApplyValue | undefined, fallback?: MonthSelection[]): MonthSelection[] | undefined;
|
|
@@ -11,16 +11,16 @@ function o(r) {
|
|
|
11
11
|
const n = r.from;
|
|
12
12
|
return n === void 0 || n instanceof Date;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function c(r) {
|
|
15
15
|
return r instanceof Date ? r : void 0;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function y(r) {
|
|
18
18
|
return o(r) ? r : void 0;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function A(r, n) {
|
|
21
21
|
return r instanceof Date ? r : n;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function s(r, n) {
|
|
24
24
|
if (r == null || Array.isArray(r) || r instanceof Date || "weekOfMonth" in r || "year" in r && "month" in r && !("from" in r)) return n;
|
|
25
25
|
if ("from" in r || "to" in r) {
|
|
26
26
|
const t = r.from;
|
|
@@ -28,61 +28,66 @@ function A(r, n) {
|
|
|
28
28
|
}
|
|
29
29
|
return n;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function p(r) {
|
|
32
32
|
if (!(r == null || Array.isArray(r) || e(r)))
|
|
33
33
|
return r;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function h(r) {
|
|
36
36
|
return Array.isArray(r) ? r : void 0;
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function D(r, n) {
|
|
39
39
|
return e(r) ? r : n;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function m(r) {
|
|
42
42
|
if (!(r == null || Array.isArray(r) || i(r)))
|
|
43
43
|
return r;
|
|
44
44
|
}
|
|
45
45
|
function M(r) {
|
|
46
46
|
return Array.isArray(r) ? r : void 0;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
49
|
-
return i(r) ? r : n;
|
|
48
|
+
function u(r, n) {
|
|
49
|
+
return f(i(r) ? r : n);
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function f(r) {
|
|
52
|
+
if (r?.from)
|
|
53
|
+
return { from: r.from, to: r.to ?? r.from };
|
|
54
|
+
}
|
|
55
|
+
function g(r) {
|
|
52
56
|
return Array.isArray(r) ? r : void 0;
|
|
53
57
|
}
|
|
54
|
-
function
|
|
58
|
+
function d(r, n) {
|
|
55
59
|
return Array.isArray(r) && r.every((t) => t instanceof Date) ? r : n;
|
|
56
60
|
}
|
|
57
|
-
function
|
|
61
|
+
function S(r, n) {
|
|
58
62
|
return !Array.isArray(r) || !r.every((t) => typeof t == "object" && t !== null && "year" in t && "month" in t && !("weekOfMonth" in t)) ? n : r;
|
|
59
63
|
}
|
|
60
|
-
function
|
|
64
|
+
function w(r, n) {
|
|
61
65
|
return Array.isArray(r) && r.every((t) => "weekOfMonth" in t) ? r : n;
|
|
62
66
|
}
|
|
63
|
-
function
|
|
67
|
+
function O(r, n) {
|
|
64
68
|
return r == null || Array.isArray(r) || r instanceof Date || e(r) || "weekOfMonth" in r ? n : "year" in r && "month" in r ? r : n;
|
|
65
69
|
}
|
|
66
|
-
function
|
|
70
|
+
function R(r, n) {
|
|
67
71
|
return r == null || Array.isArray(r) || r instanceof Date || i(r) ? n : "weekOfMonth" in r ? r : n;
|
|
68
72
|
}
|
|
69
73
|
export {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
74
|
+
g as coerceDateArray,
|
|
75
|
+
d as coerceDateArrayApply,
|
|
76
|
+
y as coerceDateRange,
|
|
77
|
+
s as coerceDateRangeApply,
|
|
78
|
+
h as coerceMonthArray,
|
|
79
|
+
S as coerceMonthArrayApply,
|
|
80
|
+
D as coerceMonthRangeApply,
|
|
81
|
+
c as coerceSingleDate,
|
|
82
|
+
A as coerceSingleDateApply,
|
|
83
|
+
p as coerceSingleMonth,
|
|
84
|
+
O as coerceSingleMonthApply,
|
|
85
|
+
m as coerceSingleWeek,
|
|
86
|
+
R as coerceSingleWeekApply,
|
|
83
87
|
M as coerceWeekArray,
|
|
84
|
-
|
|
85
|
-
|
|
88
|
+
w as coerceWeekArrayApply,
|
|
89
|
+
u as coerceWeekRangeApply,
|
|
90
|
+
f as completeWeekRange,
|
|
86
91
|
o as isDateRangeSelection,
|
|
87
92
|
e as isMonthRangeSelection,
|
|
88
93
|
i as isWeekRangeSelection
|
|
@@ -25,6 +25,8 @@ export declare function createRangePickerOpenChangeHandler(options: {
|
|
|
25
25
|
popoverContentRef: RefObject<HTMLElement | null>;
|
|
26
26
|
setOpen: (open: boolean) => void;
|
|
27
27
|
}): (newOpen: boolean) => void;
|
|
28
|
+
export declare function isNestedPickerOverlayOpen(): boolean;
|
|
29
|
+
export declare function isEventOnNestedPickerOverlay(event: Event): boolean;
|
|
28
30
|
/** True when the outside-dismiss event originated on the picker field chrome (not a real outside click). */
|
|
29
31
|
export declare function isEventOnPickerSurface(event: Event, surfaceRef: RefObject<HTMLElement | null>): boolean;
|
|
30
32
|
export type PickerSurfaceField = "start" | "end";
|
|
@@ -41,6 +43,14 @@ export declare function handleReadonlyPickerKeyDown(event: React.KeyboardEvent,
|
|
|
41
43
|
onCancel: () => void;
|
|
42
44
|
onKeyboardOpen?: () => void;
|
|
43
45
|
}): void;
|
|
46
|
+
/** Close the picker on Escape unless a nested caption overlay is handling it. */
|
|
47
|
+
export declare function handlePickerEscapeKeyDown(event: {
|
|
48
|
+
key: string;
|
|
49
|
+
preventDefault: () => void;
|
|
50
|
+
}, options: {
|
|
51
|
+
open: boolean;
|
|
52
|
+
onCancel: () => void;
|
|
53
|
+
}): void;
|
|
44
54
|
/** Opens the picker when clicking dead zones on the field shell (padding, gaps, icon gutter). */
|
|
45
55
|
export declare function handlePickerSurfacePointerDown({ disabled, event, onOpen, focusField, }: PickerSurfacePointerDownOptions): void;
|
|
46
56
|
/** Block Radix outside-dismiss when the calendar footer requires explicit Apply/Cancel. */
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { parse as
|
|
2
|
-
import * as
|
|
3
|
-
import { resolveRangeFooterFlashTarget as
|
|
4
|
-
import { padValidDateString as
|
|
5
|
-
function
|
|
6
|
-
return
|
|
7
|
-
}
|
|
8
|
-
function
|
|
9
|
-
const r =
|
|
1
|
+
import { parse as D, isValid as k } from "date-fns";
|
|
2
|
+
import * as l from "react";
|
|
3
|
+
import { resolveRangeFooterFlashTarget as E } from "../../data-display/calendar/calendar-footer-emphasis.js";
|
|
4
|
+
import { padValidDateString as O, maskDate as v } from "../../../lib/utils.js";
|
|
5
|
+
function b(e, t, n) {
|
|
6
|
+
return v(e, t, n);
|
|
7
|
+
}
|
|
8
|
+
function p(e, t, n) {
|
|
9
|
+
const r = O(e, t), a = D(r, t, /* @__PURE__ */ new Date(), n ? { locale: n } : {}), i = k(a) && r.length === t.length;
|
|
10
10
|
return {
|
|
11
11
|
padded: r,
|
|
12
|
-
parsed:
|
|
12
|
+
parsed: i ? a : void 0,
|
|
13
13
|
isComplete: e.length === t.length,
|
|
14
|
-
isValid:
|
|
14
|
+
isValid: i
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
return !e || e.length !== t.length ? !1 : !
|
|
17
|
+
function B(e, t, n) {
|
|
18
|
+
return !e || e.length !== t.length ? !1 : !p(e, t, n).isValid;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function g(e, t) {
|
|
21
21
|
const n = document.activeElement;
|
|
22
22
|
return n instanceof Node ? !!(e.current?.contains(n) || t.current?.contains(n)) : !1;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function N(e) {
|
|
25
25
|
return (t) => {
|
|
26
26
|
if (!e.disabled) {
|
|
27
27
|
if (t) {
|
|
@@ -33,37 +33,55 @@ function S(e) {
|
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
35
|
queueMicrotask(() => {
|
|
36
|
-
|
|
36
|
+
g(e.containerRef, e.popoverContentRef) || e.setOpen(!1);
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
const f = '[data-component="select-menu"], [data-component="dropdown-menu-content"]';
|
|
42
|
+
function h() {
|
|
43
|
+
return !!document.querySelector(f);
|
|
44
|
+
}
|
|
45
|
+
function P(e) {
|
|
46
|
+
if ((typeof e.composedPath == "function" ? e.composedPath() : []).some(
|
|
47
|
+
(r) => r instanceof Element && r.closest(f)
|
|
48
|
+
))
|
|
49
|
+
return !0;
|
|
50
|
+
const n = e.target;
|
|
51
|
+
return n instanceof Element ? !!n.closest(f) : !1;
|
|
52
|
+
}
|
|
53
|
+
function R(e, t) {
|
|
42
54
|
const n = e.target;
|
|
43
55
|
return n instanceof Node ? !!t.current?.contains(n) : !1;
|
|
44
56
|
}
|
|
45
|
-
function
|
|
46
|
-
t.disabled || (e.key === "ArrowDown" && !t.open && (e.preventDefault(), t.onKeyboardOpen?.(), t.onOpen()), e.key === "Escape" && t.open && (e
|
|
57
|
+
function q(e, t) {
|
|
58
|
+
t.disabled || (e.key === "ArrowDown" && !t.open && (e.preventDefault(), t.onKeyboardOpen?.(), t.onOpen()), e.key === "Escape" && t.open && w(e, {
|
|
59
|
+
open: t.open,
|
|
60
|
+
onCancel: t.onCancel
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
function w(e, t) {
|
|
64
|
+
e.key !== "Escape" || !t.open || h() || (e.preventDefault(), t.onCancel());
|
|
47
65
|
}
|
|
48
|
-
function
|
|
66
|
+
function K({
|
|
49
67
|
disabled: e,
|
|
50
68
|
event: t,
|
|
51
69
|
onOpen: n,
|
|
52
70
|
focusField: r
|
|
53
71
|
}) {
|
|
54
72
|
if (e) return;
|
|
55
|
-
const
|
|
56
|
-
if (!(
|
|
57
|
-
const
|
|
58
|
-
r(
|
|
73
|
+
const a = t.target;
|
|
74
|
+
if (!(a instanceof HTMLElement) || a.closest("button") || (n(), !r)) return;
|
|
75
|
+
const s = a.closest("[data-field]")?.getAttribute("data-field");
|
|
76
|
+
r(s === "end" ? "end" : "start");
|
|
59
77
|
}
|
|
60
|
-
function
|
|
78
|
+
function C(e, t, n, r) {
|
|
61
79
|
return e ? {
|
|
62
|
-
onInteractOutside: (
|
|
63
|
-
|
|
80
|
+
onInteractOutside: (s) => {
|
|
81
|
+
s.preventDefault();
|
|
64
82
|
},
|
|
65
|
-
onPointerDownOutside: (
|
|
66
|
-
if (
|
|
83
|
+
onPointerDownOutside: (s) => {
|
|
84
|
+
if (s.preventDefault(), !(P(s) || r && R(s, r)) && t) {
|
|
67
85
|
const o = t.current.resolveFlash();
|
|
68
86
|
if (o === "dismiss") {
|
|
69
87
|
t.current.onDismiss();
|
|
@@ -72,96 +90,96 @@ function F(e, t, n, r) {
|
|
|
72
90
|
n?.(o);
|
|
73
91
|
}
|
|
74
92
|
},
|
|
75
|
-
onEscapeKeyDown: t ? (
|
|
76
|
-
|
|
93
|
+
onEscapeKeyDown: t ? (s) => {
|
|
94
|
+
s.preventDefault(), !h() && t.current.onDismiss();
|
|
77
95
|
} : void 0
|
|
78
96
|
} : {};
|
|
79
97
|
}
|
|
80
|
-
function
|
|
81
|
-
const r = e == null,
|
|
82
|
-
return r &&
|
|
98
|
+
function M(e, t, n) {
|
|
99
|
+
const r = e == null, a = t == null;
|
|
100
|
+
return r && a || !r && !a && n(e, t) ? "dismiss" : r ? "cancel" : "apply";
|
|
83
101
|
}
|
|
84
|
-
function
|
|
102
|
+
function L(e) {
|
|
85
103
|
const {
|
|
86
104
|
startInput: t,
|
|
87
105
|
endInput: n,
|
|
88
106
|
committedStart: r,
|
|
89
|
-
committedEnd:
|
|
90
|
-
committedRange:
|
|
91
|
-
pendingRange:
|
|
107
|
+
committedEnd: a,
|
|
108
|
+
committedRange: i,
|
|
109
|
+
pendingRange: s,
|
|
92
110
|
computeEffectiveRange: u,
|
|
93
111
|
rangesEqual: o
|
|
94
|
-
} = e, c = t !== r || n !==
|
|
95
|
-
return !c && !
|
|
96
|
-
c ?
|
|
112
|
+
} = e, c = t !== r || n !== a, d = u(), m = !c && s !== void 0 ? s : d, y = !o(m, i);
|
|
113
|
+
return !c && !y ? "dismiss" : E(
|
|
114
|
+
c ? d : m
|
|
97
115
|
) === "apply" ? "apply" : "cancel";
|
|
98
116
|
}
|
|
99
|
-
function
|
|
100
|
-
return
|
|
117
|
+
function X() {
|
|
118
|
+
return l.useRef({
|
|
101
119
|
onDismiss: () => {
|
|
102
120
|
},
|
|
103
121
|
resolveFlash: () => "cancel"
|
|
104
122
|
});
|
|
105
123
|
}
|
|
106
|
-
function
|
|
107
|
-
const [
|
|
108
|
-
|
|
109
|
-
|
|
124
|
+
function x(e, t, n, r) {
|
|
125
|
+
const [a, i] = l.useState({ key: 0, target: "cancel" }), s = l.useRef(t);
|
|
126
|
+
l.useLayoutEffect(() => {
|
|
127
|
+
s.current !== t && (s.current = t, i({ key: 0, target: "cancel" }));
|
|
110
128
|
}, [t]);
|
|
111
|
-
const u =
|
|
129
|
+
const u = l.useCallback(
|
|
112
130
|
(c) => {
|
|
113
|
-
e &&
|
|
131
|
+
e && i((d) => ({ key: d.key + 1, target: c }));
|
|
114
132
|
},
|
|
115
133
|
[e]
|
|
116
|
-
), o =
|
|
134
|
+
), o = C(
|
|
117
135
|
e,
|
|
118
136
|
n,
|
|
119
137
|
u,
|
|
120
138
|
r
|
|
121
139
|
);
|
|
122
140
|
return {
|
|
123
|
-
footerFlashKey:
|
|
124
|
-
footerFlashTarget:
|
|
141
|
+
footerFlashKey: a.key,
|
|
142
|
+
footerFlashTarget: a.key > 0 ? a.target : void 0,
|
|
125
143
|
triggerFooterFlash: u,
|
|
126
144
|
popoverHandlers: o
|
|
127
145
|
};
|
|
128
146
|
}
|
|
129
|
-
function
|
|
147
|
+
function H(e, t, n) {
|
|
130
148
|
queueMicrotask(() => {
|
|
131
|
-
|
|
149
|
+
g(e, t) || n();
|
|
132
150
|
});
|
|
133
151
|
}
|
|
134
|
-
function
|
|
152
|
+
function F(e, t, n, r) {
|
|
135
153
|
if (!e)
|
|
136
154
|
return { display: "", parsed: void 0, resetToCommitted: !1 };
|
|
137
|
-
const
|
|
138
|
-
return
|
|
139
|
-
display:
|
|
140
|
-
parsed:
|
|
155
|
+
const a = p(e, t, r);
|
|
156
|
+
return a.isValid ? {
|
|
157
|
+
display: a.padded,
|
|
158
|
+
parsed: a.parsed,
|
|
141
159
|
resetToCommitted: !1
|
|
142
160
|
} : e.length < t.length ? { display: e, parsed: void 0, resetToCommitted: !1 } : { display: n, parsed: void 0, resetToCommitted: !0 };
|
|
143
161
|
}
|
|
144
|
-
function
|
|
145
|
-
const
|
|
162
|
+
function _(e, t, n, r) {
|
|
163
|
+
const a = F(e, t, n, r);
|
|
146
164
|
return {
|
|
147
|
-
...
|
|
148
|
-
isPartial: !!e && e.length < t.length && !
|
|
165
|
+
...a,
|
|
166
|
+
isPartial: !!e && e.length < t.length && !a.resetToCommitted
|
|
149
167
|
};
|
|
150
168
|
}
|
|
151
|
-
function
|
|
152
|
-
const r =
|
|
169
|
+
function z(e, t, n) {
|
|
170
|
+
const r = p(e, t, n);
|
|
153
171
|
return r.isValid && r.parsed ? { parsed: r.parsed, shouldOpenPopover: !1 } : { parsed: void 0, shouldOpenPopover: !0 };
|
|
154
172
|
}
|
|
155
|
-
function
|
|
173
|
+
function A(e, t, n) {
|
|
156
174
|
return e === void 0 || t === void 0 ? { from: e, to: t, swapped: !1 } : n(e, t) <= 0 ? { from: e, to: t, swapped: !1 } : { from: t, to: e, swapped: !0 };
|
|
157
175
|
}
|
|
158
|
-
function
|
|
176
|
+
function W(e, t) {
|
|
159
177
|
return e.year * 12 + e.month - (t.year * 12 + t.month);
|
|
160
178
|
}
|
|
161
|
-
function
|
|
179
|
+
function Y(e, t) {
|
|
162
180
|
return e.getTime() - t.getTime();
|
|
163
181
|
}
|
|
164
|
-
function
|
|
182
|
+
function j(e) {
|
|
165
183
|
if (!e || typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches)
|
|
166
184
|
return;
|
|
167
185
|
const t = e.querySelector('[data-field="start"]'), n = e.querySelector('[data-field="end"]');
|
|
@@ -176,25 +194,28 @@ function W(e) {
|
|
|
176
194
|
));
|
|
177
195
|
}
|
|
178
196
|
export {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
197
|
+
Y as compareDates,
|
|
198
|
+
W as compareMonthSelection,
|
|
199
|
+
N as createRangePickerOpenChangeHandler,
|
|
200
|
+
H as deferRangeInputBlur,
|
|
201
|
+
j as flashRangeReorder,
|
|
202
|
+
w as handlePickerEscapeKeyDown,
|
|
203
|
+
K as handlePickerSurfacePointerDown,
|
|
204
|
+
q as handleReadonlyPickerKeyDown,
|
|
205
|
+
B as isDateInputInvalid,
|
|
206
|
+
P as isEventOnNestedPickerOverlay,
|
|
207
|
+
R as isEventOnPickerSurface,
|
|
208
|
+
g as isFocusInsidePicker,
|
|
209
|
+
h as isNestedPickerOverlayOpen,
|
|
210
|
+
b as maskDateInput,
|
|
211
|
+
A as normalizeOrderedRange,
|
|
212
|
+
p as parseDateInput,
|
|
213
|
+
C as preventOutsideDismissWhenFooter,
|
|
214
|
+
F as resolveDateInputOnBlur,
|
|
215
|
+
z as resolveDateInputOnEnter,
|
|
216
|
+
_ as resolveRangeFieldBlur,
|
|
217
|
+
L as resolveRangePickerDismissFlash,
|
|
218
|
+
M as resolveSingleValueDismissFlash,
|
|
219
|
+
X as usePickerDismissActionsRef,
|
|
220
|
+
x as usePickerFooterDismissNudge
|
|
200
221
|
};
|