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,18 +1,18 @@
|
|
|
1
1
|
import { jsx as r, jsxs as y } 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 Z, CalendarMonth as _ } from "impact-nova-icons";
|
|
4
|
+
import { cn as $ } from "../../../lib/utils.js";
|
|
5
|
+
import { Input as ee } from "../input/input.js";
|
|
6
|
+
import { Calendar as re } from "../../data-display/calendar/calendar.js";
|
|
7
7
|
import { Tooltip as x, TooltipTrigger as R, TooltipContent as D } 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
|
|
13
|
-
import { formatYearInput as
|
|
14
|
-
import { viewMonthFromYear as
|
|
15
|
-
const
|
|
8
|
+
import { useImpactNovaI18n as te } from "../../../i18n/use-impact-nova-i18n.js";
|
|
9
|
+
import { buildDateBoundsMatcher as ne } from "../../../lib/date-bounds-matcher.js";
|
|
10
|
+
import { fiscalCalendarPassThrough as oe } from "./fiscal-pass-through.js";
|
|
11
|
+
import { DatePickerShell as ae } from "./date-picker-shell.js";
|
|
12
|
+
import { usePickerDismissActionsRef as ie, usePickerFooterDismissNudge as ce, handleReadonlyPickerKeyDown as se, handlePickerSurfacePointerDown as le } from "./date-input-behavior.js";
|
|
13
|
+
import { formatYearInput as pe } from "../../data-display/calendar/calendar-fiscal-labels.js";
|
|
14
|
+
import { viewMonthFromYear as fe } from "../../data-display/calendar/calendar-year-utils.js";
|
|
15
|
+
const de = t.forwardRef(
|
|
16
16
|
({
|
|
17
17
|
value: n,
|
|
18
18
|
onChange: d,
|
|
@@ -31,27 +31,31 @@ const pe = t.forwardRef(
|
|
|
31
31
|
fiscalYearStartMonth: K,
|
|
32
32
|
fiscalConfig: k,
|
|
33
33
|
showPresets: j,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const
|
|
34
|
+
showPeriodBoundaries: F,
|
|
35
|
+
autoNavigateToAvailable: L,
|
|
36
|
+
showIntervalCaption: z = !1,
|
|
37
|
+
...E
|
|
38
|
+
}, H) => {
|
|
39
|
+
const { t: a } = te(), V = Y ?? a("datePicker.selectYear"), m = t.useRef(null), P = t.useRef(null);
|
|
40
|
+
t.useImperativeHandle(H, () => m.current);
|
|
41
|
+
const [i, c] = t.useState(!1), u = t.useRef(!1), g = ie(), { footerFlashKey: B, footerFlashTarget: q, popoverHandlers: G } = ce(s, i, g, P), [C, l] = t.useState(n), [J, Q] = t.useState(fe(n));
|
|
40
42
|
t.useEffect(() => {
|
|
41
43
|
i || l(n);
|
|
42
44
|
}, [i, n]);
|
|
43
|
-
const p = t.useCallback(() => c(!1), []),
|
|
45
|
+
const p = t.useCallback(() => c(!1), []), U = oe({
|
|
44
46
|
calendarKind: O,
|
|
45
47
|
fiscalMode: T,
|
|
46
48
|
granularity: w,
|
|
47
49
|
fiscalMonthPattern: M,
|
|
48
50
|
fiscalYearStartMonth: K,
|
|
49
51
|
fiscalConfig: k,
|
|
50
|
-
showPresets: j
|
|
51
|
-
|
|
52
|
+
showPresets: j,
|
|
53
|
+
showPeriodBoundaries: F,
|
|
54
|
+
autoNavigateToAvailable: L
|
|
55
|
+
}), W = (e) => {
|
|
52
56
|
const f = e && !Array.isArray(e) && !("from" in e) && !("to" in e) ? e : void 0;
|
|
53
57
|
l(f), s || (d?.(f), p());
|
|
54
|
-
},
|
|
58
|
+
}, X = () => {
|
|
55
59
|
d?.(C), p();
|
|
56
60
|
}, h = () => {
|
|
57
61
|
l(n), p();
|
|
@@ -61,7 +65,7 @@ const pe = t.forwardRef(
|
|
|
61
65
|
return t.useLayoutEffect(() => {
|
|
62
66
|
g.current = { onDismiss: h, resolveFlash: () => "cancel" };
|
|
63
67
|
}), /* @__PURE__ */ r(
|
|
64
|
-
|
|
68
|
+
ae,
|
|
65
69
|
{
|
|
66
70
|
open: i,
|
|
67
71
|
disabled: o,
|
|
@@ -72,26 +76,26 @@ const pe = t.forwardRef(
|
|
|
72
76
|
onOpenAutoFocus: (e) => {
|
|
73
77
|
u.current || e.preventDefault(), u.current = !1;
|
|
74
78
|
},
|
|
75
|
-
popoverHandlers:
|
|
79
|
+
popoverHandlers: G,
|
|
76
80
|
trigger: /* @__PURE__ */ r(
|
|
77
81
|
"div",
|
|
78
82
|
{
|
|
79
83
|
ref: P,
|
|
80
84
|
"data-component": "year-picker",
|
|
81
85
|
"data-state": i ? "open" : "closed",
|
|
82
|
-
onPointerDown: (e) =>
|
|
86
|
+
onPointerDown: (e) => le({
|
|
83
87
|
disabled: o,
|
|
84
88
|
event: e,
|
|
85
89
|
onOpen: () => c(!0),
|
|
86
90
|
focusField: () => m.current?.focus()
|
|
87
91
|
}),
|
|
88
92
|
children: /* @__PURE__ */ r(
|
|
89
|
-
|
|
93
|
+
ee,
|
|
90
94
|
{
|
|
91
95
|
ref: m,
|
|
92
|
-
value: n ?
|
|
96
|
+
value: n ? pe(n, k?.fyLabel ?? "fy-long") : "",
|
|
93
97
|
readOnly: !0,
|
|
94
|
-
onKeyDown: (e) =>
|
|
98
|
+
onKeyDown: (e) => se(e, {
|
|
95
99
|
disabled: o,
|
|
96
100
|
open: i,
|
|
97
101
|
onOpen: () => c(!0),
|
|
@@ -101,10 +105,10 @@ const pe = t.forwardRef(
|
|
|
101
105
|
}
|
|
102
106
|
}),
|
|
103
107
|
onClick: () => !o && c(!0),
|
|
104
|
-
placeholder:
|
|
108
|
+
placeholder: V,
|
|
105
109
|
disabled: o,
|
|
106
110
|
"data-form-control": "input",
|
|
107
|
-
className:
|
|
111
|
+
className: $("cursor-pointer", I),
|
|
108
112
|
suffix: /* @__PURE__ */ y("div", { className: "flex items-center gap-1", children: [
|
|
109
113
|
n && !o ? /* @__PURE__ */ y(x, { children: [
|
|
110
114
|
/* @__PURE__ */ r(R, { asChild: !0, children: /* @__PURE__ */ r(
|
|
@@ -117,7 +121,7 @@ const pe = t.forwardRef(
|
|
|
117
121
|
e.stopPropagation(), b();
|
|
118
122
|
},
|
|
119
123
|
className: "inline-flex size-4 items-center justify-center border-none bg-transparent p-0",
|
|
120
|
-
children: /* @__PURE__ */ r(
|
|
124
|
+
children: /* @__PURE__ */ r(Z, { className: "size-3 hover:text-content" })
|
|
121
125
|
}
|
|
122
126
|
) }),
|
|
123
127
|
/* @__PURE__ */ r(D, { variant: "tertiary", side: "top", children: a("calendar.clear") })
|
|
@@ -134,43 +138,43 @@ const pe = t.forwardRef(
|
|
|
134
138
|
e.stopPropagation(), o || c((f) => !f);
|
|
135
139
|
},
|
|
136
140
|
className: "inline-flex items-center justify-center border-none bg-transparent p-0",
|
|
137
|
-
children: /* @__PURE__ */ r(
|
|
141
|
+
children: /* @__PURE__ */ r(_, { className: "h-4 w-4 text-secondary-foreground" })
|
|
138
142
|
}
|
|
139
143
|
) }),
|
|
140
144
|
/* @__PURE__ */ r(D, { variant: "tertiary", side: "top", children: a("datePicker.selectYear") })
|
|
141
145
|
] })
|
|
142
146
|
] }),
|
|
143
|
-
...
|
|
147
|
+
...E
|
|
144
148
|
}
|
|
145
149
|
)
|
|
146
150
|
}
|
|
147
151
|
),
|
|
148
152
|
children: /* @__PURE__ */ r(
|
|
149
|
-
|
|
153
|
+
re,
|
|
150
154
|
{
|
|
151
155
|
pickerType: "year",
|
|
152
156
|
selectedYear: C,
|
|
153
|
-
footerFlashKey:
|
|
154
|
-
footerFlashTarget:
|
|
155
|
-
onYearSelect:
|
|
156
|
-
month:
|
|
157
|
-
onMonthChange:
|
|
158
|
-
disabled:
|
|
157
|
+
footerFlashKey: B,
|
|
158
|
+
footerFlashTarget: q,
|
|
159
|
+
onYearSelect: W,
|
|
160
|
+
month: J,
|
|
161
|
+
onMonthChange: Q,
|
|
162
|
+
disabled: ne(v, N),
|
|
159
163
|
startMonth: S,
|
|
160
164
|
endMonth: A,
|
|
161
165
|
showFooter: s,
|
|
162
|
-
onApply:
|
|
166
|
+
onApply: X,
|
|
163
167
|
onCancel: h,
|
|
164
168
|
onClear: b,
|
|
165
|
-
showIntervalCaption:
|
|
166
|
-
...
|
|
169
|
+
showIntervalCaption: z,
|
|
170
|
+
...U
|
|
167
171
|
}
|
|
168
172
|
)
|
|
169
173
|
}
|
|
170
174
|
);
|
|
171
175
|
}
|
|
172
176
|
);
|
|
173
|
-
|
|
177
|
+
de.displayName = "YearPicker";
|
|
174
178
|
export {
|
|
175
|
-
|
|
179
|
+
de as YearPicker
|
|
176
180
|
};
|
|
@@ -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 ee, CalendarMonth as re } from "impact-nova-icons";
|
|
4
|
+
import { cn as te } from "../../../lib/utils.js";
|
|
5
|
+
import { Input as ne } from "../input/input.js";
|
|
6
|
+
import { Calendar as oe } from "../../data-display/calendar/calendar.js";
|
|
7
7
|
import { Tooltip as x, TooltipTrigger as D, TooltipContent as Y } 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 ae } from "../../../i18n/use-impact-nova-i18n.js";
|
|
9
|
+
import { buildDateBoundsMatcher as ie } from "../../../lib/date-bounds-matcher.js";
|
|
10
|
+
import { fiscalCalendarPassThrough as ce } from "./fiscal-pass-through.js";
|
|
11
|
+
import { DatePickerShell as se } from "./date-picker-shell.js";
|
|
12
|
+
import { usePickerDismissActionsRef as le, usePickerFooterDismissNudge as fe, handleReadonlyPickerKeyDown as pe, handlePickerSurfacePointerDown as de } from "./date-input-behavior.js";
|
|
13
13
|
import { formatYearInput as N } from "../../data-display/calendar/calendar-fiscal-labels.js";
|
|
14
|
-
import { viewMonthFromYear as
|
|
15
|
-
const
|
|
14
|
+
import { viewMonthFromYear as me } from "../../data-display/calendar/calendar-year-utils.js";
|
|
15
|
+
const ue = t.forwardRef(
|
|
16
16
|
({
|
|
17
17
|
value: n,
|
|
18
18
|
onChange: d,
|
|
@@ -31,27 +31,31 @@ const de = t.forwardRef(
|
|
|
31
31
|
fiscalYearStartMonth: F,
|
|
32
32
|
fiscalConfig: y,
|
|
33
33
|
showPresets: L,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const
|
|
34
|
+
showPeriodBoundaries: $,
|
|
35
|
+
autoNavigateToAvailable: z,
|
|
36
|
+
showIntervalCaption: E = !1,
|
|
37
|
+
...H
|
|
38
|
+
}, V) => {
|
|
39
|
+
const { t: a } = ae(), B = S ?? a("datePicker.selectYearRange"), k = y?.fyLabel ?? "fy-long", m = t.useRef(null), P = t.useRef(null);
|
|
40
|
+
t.useImperativeHandle(V, () => m.current);
|
|
41
|
+
const [i, c] = t.useState(!1), u = t.useRef(!1), R = le(), { footerFlashKey: q, footerFlashTarget: G, popoverHandlers: J } = fe(l, i, R, P), [C, f] = t.useState(n), [Q, U] = t.useState(me(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), []), W = ce({
|
|
44
46
|
calendarKind: T,
|
|
45
47
|
fiscalMode: w,
|
|
46
48
|
granularity: K,
|
|
47
49
|
fiscalMonthPattern: j,
|
|
48
50
|
fiscalYearStartMonth: F,
|
|
49
51
|
fiscalConfig: y,
|
|
50
|
-
showPresets: L
|
|
51
|
-
|
|
52
|
+
showPresets: L,
|
|
53
|
+
showPeriodBoundaries: $,
|
|
54
|
+
autoNavigateToAvailable: z
|
|
55
|
+
}), X = (e) => {
|
|
52
56
|
const s = e && !Array.isArray(e) && ("from" in e || "to" in e) ? e : void 0;
|
|
53
57
|
f(s), l || (d?.(s), s?.to && p());
|
|
54
|
-
},
|
|
58
|
+
}, Z = () => {
|
|
55
59
|
d?.(C), p();
|
|
56
60
|
}, h = () => {
|
|
57
61
|
f(n), p();
|
|
@@ -61,9 +65,9 @@ const de = t.forwardRef(
|
|
|
61
65
|
t.useLayoutEffect(() => {
|
|
62
66
|
R.current = { onDismiss: h, resolveFlash: () => "cancel" };
|
|
63
67
|
});
|
|
64
|
-
const
|
|
68
|
+
const _ = n?.from ? `${N(n.from, k)}${n.to ? ` – ${N(n.to, k)}` : ""}` : "";
|
|
65
69
|
return /* @__PURE__ */ r(
|
|
66
|
-
|
|
70
|
+
se,
|
|
67
71
|
{
|
|
68
72
|
open: i,
|
|
69
73
|
disabled: o,
|
|
@@ -74,26 +78,26 @@ const de = t.forwardRef(
|
|
|
74
78
|
onOpenAutoFocus: (e) => {
|
|
75
79
|
u.current || e.preventDefault(), u.current = !1;
|
|
76
80
|
},
|
|
77
|
-
popoverHandlers:
|
|
81
|
+
popoverHandlers: J,
|
|
78
82
|
trigger: /* @__PURE__ */ r(
|
|
79
83
|
"div",
|
|
80
84
|
{
|
|
81
85
|
ref: P,
|
|
82
86
|
"data-component": "year-range-picker",
|
|
83
87
|
"data-state": i ? "open" : "closed",
|
|
84
|
-
onPointerDown: (e) =>
|
|
88
|
+
onPointerDown: (e) => de({
|
|
85
89
|
disabled: o,
|
|
86
90
|
event: e,
|
|
87
91
|
onOpen: () => c(!0),
|
|
88
92
|
focusField: () => m.current?.focus()
|
|
89
93
|
}),
|
|
90
94
|
children: /* @__PURE__ */ r(
|
|
91
|
-
|
|
95
|
+
ne,
|
|
92
96
|
{
|
|
93
97
|
ref: m,
|
|
94
|
-
value:
|
|
98
|
+
value: _,
|
|
95
99
|
readOnly: !0,
|
|
96
|
-
onKeyDown: (e) =>
|
|
100
|
+
onKeyDown: (e) => pe(e, {
|
|
97
101
|
disabled: o,
|
|
98
102
|
open: i,
|
|
99
103
|
onOpen: () => c(!0),
|
|
@@ -103,10 +107,10 @@ const de = t.forwardRef(
|
|
|
103
107
|
}
|
|
104
108
|
}),
|
|
105
109
|
onClick: () => !o && c(!0),
|
|
106
|
-
placeholder:
|
|
110
|
+
placeholder: B,
|
|
107
111
|
disabled: o,
|
|
108
112
|
"data-form-control": "input",
|
|
109
|
-
className:
|
|
113
|
+
className: te("cursor-pointer", O),
|
|
110
114
|
suffix: /* @__PURE__ */ g("div", { className: "flex items-center gap-1", children: [
|
|
111
115
|
n?.from && !o ? /* @__PURE__ */ g(x, { children: [
|
|
112
116
|
/* @__PURE__ */ r(D, { asChild: !0, children: /* @__PURE__ */ r(
|
|
@@ -119,7 +123,7 @@ const de = t.forwardRef(
|
|
|
119
123
|
e.stopPropagation(), b();
|
|
120
124
|
},
|
|
121
125
|
className: "inline-flex size-4 items-center justify-center border-none bg-transparent p-0",
|
|
122
|
-
children: /* @__PURE__ */ r(
|
|
126
|
+
children: /* @__PURE__ */ r(ee, { className: "size-3 hover:text-content" })
|
|
123
127
|
}
|
|
124
128
|
) }),
|
|
125
129
|
/* @__PURE__ */ r(Y, { variant: "tertiary", side: "top", children: a("calendar.clear") })
|
|
@@ -136,44 +140,44 @@ const de = t.forwardRef(
|
|
|
136
140
|
e.stopPropagation(), o || c((s) => !s);
|
|
137
141
|
},
|
|
138
142
|
className: "inline-flex items-center justify-center border-none bg-transparent p-0",
|
|
139
|
-
children: /* @__PURE__ */ r(
|
|
143
|
+
children: /* @__PURE__ */ r(re, { className: "h-4 w-4 text-secondary-foreground" })
|
|
140
144
|
}
|
|
141
145
|
) }),
|
|
142
146
|
/* @__PURE__ */ r(Y, { variant: "tertiary", side: "top", children: a("datePicker.selectYearRange") })
|
|
143
147
|
] })
|
|
144
148
|
] }),
|
|
145
|
-
...
|
|
149
|
+
...H
|
|
146
150
|
}
|
|
147
151
|
)
|
|
148
152
|
}
|
|
149
153
|
),
|
|
150
154
|
children: /* @__PURE__ */ r(
|
|
151
|
-
|
|
155
|
+
oe,
|
|
152
156
|
{
|
|
153
157
|
pickerType: "year",
|
|
154
158
|
yearMode: "range",
|
|
155
159
|
selectedYear: C,
|
|
156
|
-
footerFlashKey:
|
|
157
|
-
footerFlashTarget:
|
|
158
|
-
onYearSelect:
|
|
159
|
-
month:
|
|
160
|
-
onMonthChange:
|
|
161
|
-
disabled:
|
|
160
|
+
footerFlashKey: q,
|
|
161
|
+
footerFlashTarget: G,
|
|
162
|
+
onYearSelect: X,
|
|
163
|
+
month: Q,
|
|
164
|
+
onMonthChange: U,
|
|
165
|
+
disabled: ie(v, A),
|
|
162
166
|
startMonth: I,
|
|
163
167
|
endMonth: M,
|
|
164
168
|
showFooter: l,
|
|
165
|
-
onApply:
|
|
169
|
+
onApply: Z,
|
|
166
170
|
onCancel: h,
|
|
167
171
|
onClear: b,
|
|
168
|
-
showIntervalCaption:
|
|
169
|
-
...
|
|
172
|
+
showIntervalCaption: E,
|
|
173
|
+
...W
|
|
170
174
|
}
|
|
171
175
|
)
|
|
172
176
|
}
|
|
173
177
|
);
|
|
174
178
|
}
|
|
175
179
|
);
|
|
176
|
-
|
|
180
|
+
ue.displayName = "YearRangePicker";
|
|
177
181
|
export {
|
|
178
|
-
|
|
182
|
+
ue as YearRangePicker
|
|
179
183
|
};
|
|
@@ -4,7 +4,7 @@ import { cn as a } from "../../../../lib/utils.js";
|
|
|
4
4
|
import { preventDismissOnTooltipOutside as t } from "../../../../lib/overlay/prevent-dismiss-on-tooltip-outside.js";
|
|
5
5
|
import { useOverlayPortalContainer as v } from "../../../../lib/overlay/overlay-portal-context.js";
|
|
6
6
|
import { OVERLAY_NESTED_FLOATING_INSTANT_HIDE_CLASS as f } from "../../../../lib/overlay/overlay-host.constants.js";
|
|
7
|
-
function
|
|
7
|
+
function P({
|
|
8
8
|
menuRef: l,
|
|
9
9
|
menuMinHeight: i,
|
|
10
10
|
menuWidth: s,
|
|
@@ -25,6 +25,7 @@ function O({
|
|
|
25
25
|
collisionPadding: 8,
|
|
26
26
|
"aria-label": p,
|
|
27
27
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
28
|
+
onPointerDown: (e) => e.stopPropagation(),
|
|
28
29
|
onPointerDownOutside: t,
|
|
29
30
|
onInteractOutside: t,
|
|
30
31
|
onFocusOutside: t,
|
|
@@ -58,5 +59,5 @@ function O({
|
|
|
58
59
|
) });
|
|
59
60
|
}
|
|
60
61
|
export {
|
|
61
|
-
|
|
62
|
+
P as SelectMenuPanel
|
|
62
63
|
};
|
|
@@ -126,6 +126,7 @@ function ne(R) {
|
|
|
126
126
|
), V = dt({
|
|
127
127
|
count: o.length,
|
|
128
128
|
getScrollElement: () => T.current,
|
|
129
|
+
enabled: l,
|
|
129
130
|
// Estimates only seed unmeasured rows — mounted rows self-measure via
|
|
130
131
|
// `measureElement` refs. Consumers rendering taller custom `renderOption`
|
|
131
132
|
// rows should pass `estimateRowSize` to keep scroll offsets sane.
|
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { useWatch as
|
|
1
|
+
import { jsx as x, jsxs as N } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as F, useRef as K, useEffect as Y } from "react";
|
|
3
|
+
import { useWatch as S, Controller as k } from "react-hook-form";
|
|
4
4
|
import { DatePicker as q } from "../../components/forms/date-picker/date-picker.js";
|
|
5
5
|
import { getEffectiveMinOffsetDaysFromToday as O } from "../utils/formDate.utils.js";
|
|
6
|
-
import { startOfDayDate as
|
|
6
|
+
import { startOfDayDate as I, addDaysDate as A, handleDateFnsFormat as L } from "../utils/date.utils.js";
|
|
7
7
|
import { parseYmdString as f, formatYmd as $ } from "../utils/calendar-boundary.js";
|
|
8
|
-
const
|
|
8
|
+
const M = "__dateInputPairedSentinel__", H = ({
|
|
9
9
|
field: n,
|
|
10
|
-
validationRules:
|
|
10
|
+
validationRules: W,
|
|
11
11
|
isDisabled: u,
|
|
12
12
|
formHelpers: h
|
|
13
13
|
}) => {
|
|
14
|
-
const m = n.fieldType === "date", e = m ? n : null, g = h.form.control,
|
|
14
|
+
const m = n.fieldType === "date", e = m ? n : null, g = h.form.control, y = h.form.trigger, T = h.getValues, i = F(() => e?.dateAfterFieldId ? Array.isArray(e.dateAfterFieldId) ? e.dateAfterFieldId : [e.dateAfterFieldId] : [], [e]), s = F(() => e?.dateBeforeFieldId ? Array.isArray(e.dateBeforeFieldId) ? e.dateBeforeFieldId : [e.dateBeforeFieldId] : [], [e]), B = i.length > 0 ? i : [M], p = S({
|
|
15
15
|
control: g,
|
|
16
16
|
name: B,
|
|
17
|
-
disabled: !m ||
|
|
18
|
-
}), E =
|
|
17
|
+
disabled: !m || i.length === 0
|
|
18
|
+
}), E = s.length > 0 ? s : [M], D = S({
|
|
19
19
|
control: g,
|
|
20
20
|
name: E,
|
|
21
|
-
disabled: !m ||
|
|
22
|
-
}),
|
|
21
|
+
disabled: !m || s.length === 0
|
|
22
|
+
}), P = i.length > 0 || s.length > 0, b = K(!0), _ = i.length > 0 ? p.join("|") : "", C = s.length > 0 ? D.join("|") : "";
|
|
23
23
|
Y(() => {
|
|
24
|
-
if (!e || !
|
|
25
|
-
if (
|
|
26
|
-
|
|
24
|
+
if (!e || !P) return;
|
|
25
|
+
if (b.current) {
|
|
26
|
+
b.current = !1;
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
-
const
|
|
30
|
-
|
|
29
|
+
const a = T()[e.id];
|
|
30
|
+
a != null && String(a).trim() !== "" && y(e.id);
|
|
31
31
|
}, [
|
|
32
32
|
_,
|
|
33
33
|
C,
|
|
34
34
|
e,
|
|
35
|
-
P,
|
|
36
35
|
T,
|
|
37
|
-
|
|
36
|
+
P,
|
|
37
|
+
y
|
|
38
38
|
]);
|
|
39
|
-
const { minDate: R, maxDate: V } =
|
|
39
|
+
const { minDate: R, maxDate: V } = F(() => {
|
|
40
40
|
if (!e)
|
|
41
41
|
return {
|
|
42
42
|
minDate: void 0,
|
|
43
43
|
maxDate: void 0
|
|
44
44
|
};
|
|
45
|
-
const
|
|
46
|
-
if (l != null && l >= 0 &&
|
|
45
|
+
const a = [], l = O(e);
|
|
46
|
+
if (l != null && l >= 0 && a.push(I(A(/* @__PURE__ */ new Date(), l))), e.minDate) {
|
|
47
47
|
const t = f(e.minDate);
|
|
48
|
-
t &&
|
|
48
|
+
t && a.push(t);
|
|
49
49
|
}
|
|
50
|
-
if (
|
|
51
|
-
const t =
|
|
52
|
-
for (const
|
|
53
|
-
if (!
|
|
54
|
-
const c = f(String(
|
|
50
|
+
if (i.length > 0) {
|
|
51
|
+
const t = i.length > 0 ? p : [];
|
|
52
|
+
for (const r of t) {
|
|
53
|
+
if (!r) continue;
|
|
54
|
+
const c = f(String(r));
|
|
55
55
|
if (c) {
|
|
56
|
-
const
|
|
57
|
-
|
|
56
|
+
const v = e.dateAfterFieldIdInclusive ? 0 : 1;
|
|
57
|
+
a.push(I(A(c, v)));
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
let d;
|
|
62
|
-
|
|
63
|
-
(t,
|
|
62
|
+
a.length > 0 && (d = a.reduce(
|
|
63
|
+
(t, r) => t.getTime() >= r.getTime() ? t : r
|
|
64
64
|
));
|
|
65
65
|
let o;
|
|
66
66
|
if (e.maxDate) {
|
|
67
67
|
const t = f(e.maxDate);
|
|
68
68
|
t && (o = t);
|
|
69
69
|
}
|
|
70
|
-
if (
|
|
71
|
-
const t =
|
|
72
|
-
for (const
|
|
73
|
-
if (!
|
|
74
|
-
const c = f(String(
|
|
70
|
+
if (s.length > 0) {
|
|
71
|
+
const t = s.length > 0 ? D : [];
|
|
72
|
+
for (const r of t) {
|
|
73
|
+
if (!r) continue;
|
|
74
|
+
const c = f(String(r));
|
|
75
75
|
if (c) {
|
|
76
|
-
const
|
|
77
|
-
o = o == null ||
|
|
76
|
+
const v = e.dateBeforeFieldIdInclusive ? 0 : -1, w = I(A(c, v));
|
|
77
|
+
o = o == null || w.getTime() < o.getTime() ? w : o;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
return { minDate: d, maxDate: o };
|
|
82
|
-
}, [e,
|
|
82
|
+
}, [e, i, s, p, D]);
|
|
83
83
|
if (!m || !e) return null;
|
|
84
84
|
const j = L(e.dateFormat);
|
|
85
|
-
return /* @__PURE__ */
|
|
85
|
+
return /* @__PURE__ */ x(
|
|
86
86
|
k,
|
|
87
87
|
{
|
|
88
88
|
name: n.id,
|
|
89
89
|
control: g,
|
|
90
90
|
disabled: u,
|
|
91
|
-
rules:
|
|
92
|
-
render: ({ field:
|
|
93
|
-
const d = !!l.error, o =
|
|
94
|
-
return /* @__PURE__ */
|
|
95
|
-
/* @__PURE__ */
|
|
91
|
+
rules: W,
|
|
92
|
+
render: ({ field: a, fieldState: l }) => {
|
|
93
|
+
const d = !!l.error, o = a.value, t = o ? f(String(o)) : void 0;
|
|
94
|
+
return /* @__PURE__ */ N("div", { className: "flex w-full min-w-0 flex-col gap-[6px]", children: [
|
|
95
|
+
/* @__PURE__ */ N(
|
|
96
96
|
"label",
|
|
97
97
|
{
|
|
98
98
|
htmlFor: n.id,
|
|
@@ -100,11 +100,11 @@ const b = "__dateInputPairedSentinel__", H = ({
|
|
|
100
100
|
children: [
|
|
101
101
|
n.label,
|
|
102
102
|
" ",
|
|
103
|
-
n.isRequired ? /* @__PURE__ */
|
|
103
|
+
n.isRequired ? /* @__PURE__ */ x("span", { className: "text-[red]", children: "*" }) : null
|
|
104
104
|
]
|
|
105
105
|
}
|
|
106
106
|
),
|
|
107
|
-
/* @__PURE__ */
|
|
107
|
+
/* @__PURE__ */ x(
|
|
108
108
|
q,
|
|
109
109
|
{
|
|
110
110
|
id: n.id,
|
|
@@ -113,8 +113,8 @@ const b = "__dateInputPairedSentinel__", H = ({
|
|
|
113
113
|
minDate: R,
|
|
114
114
|
maxDate: V,
|
|
115
115
|
value: t,
|
|
116
|
-
onChange: (
|
|
117
|
-
|
|
116
|
+
onChange: (r) => {
|
|
117
|
+
a.onChange(r ? $(r) : "");
|
|
118
118
|
},
|
|
119
119
|
placeholder: n.placeholder,
|
|
120
120
|
required: n.isRequired,
|
|
@@ -126,7 +126,8 @@ const b = "__dateInputPairedSentinel__", H = ({
|
|
|
126
126
|
fiscalMode: e.fiscalMode,
|
|
127
127
|
fiscalYearStartMonth: e.fiscalYearStartMonth,
|
|
128
128
|
fiscalMonthPattern: e.fiscalMonthPattern,
|
|
129
|
-
showPresets: e.showPresets
|
|
129
|
+
showPresets: e.showPresets,
|
|
130
|
+
autoNavigateToAvailable: e.autoNavigateToAvailable
|
|
130
131
|
}
|
|
131
132
|
)
|
|
132
133
|
] });
|