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,26 +1,26 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
1
|
+
import { jsx as l, jsxs as F } from "react/jsx-runtime";
|
|
2
2
|
import * as o from "react";
|
|
3
|
-
import { Cross as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { usePickerDismissActionsRef as
|
|
6
|
-
import { Input as
|
|
7
|
-
import { Calendar as
|
|
8
|
-
import { Tooltip as
|
|
9
|
-
import { useImpactNovaI18n as
|
|
10
|
-
import { coerceSingleMonthApply as
|
|
11
|
-
import { buildDateBoundsMatcher as
|
|
12
|
-
import { fiscalCalendarPassThrough as
|
|
13
|
-
import { DatePickerShell as
|
|
14
|
-
import { looksLikeFiscalPeriodInput as
|
|
15
|
-
import { resolveFiscalConfig as
|
|
3
|
+
import { Cross as ke, CalendarMonth as De } from "impact-nova-icons";
|
|
4
|
+
import { cn as Me } from "../../../lib/utils.js";
|
|
5
|
+
import { usePickerDismissActionsRef as Pe, usePickerFooterDismissNudge as Ie, isDateInputInvalid as $, resolveSingleValueDismissFlash as Se, compareMonthSelection as Ce, handlePickerEscapeKeyDown as xe, handlePickerSurfacePointerDown as Re, maskDateInput as be, parseDateInput as we, resolveDateInputOnEnter as Fe, resolveDateInputOnBlur as Ee } from "./date-input-behavior.js";
|
|
6
|
+
import { Input as Ne } from "../input/input.js";
|
|
7
|
+
import { Calendar as Te } from "../../data-display/calendar/calendar.js";
|
|
8
|
+
import { Tooltip as v, TooltipTrigger as q, TooltipContent as G } from "../../feedback/tooltip/tooltip.js";
|
|
9
|
+
import { useImpactNovaI18n as Ae } from "../../../i18n/use-impact-nova-i18n.js";
|
|
10
|
+
import { coerceSingleMonthApply as Oe, coerceSingleMonth as Ve } from "./calendar-selection-adapters.js";
|
|
11
|
+
import { buildDateBoundsMatcher as Be } from "../../../lib/date-bounds-matcher.js";
|
|
12
|
+
import { fiscalCalendarPassThrough as je } from "./fiscal-pass-through.js";
|
|
13
|
+
import { DatePickerShell as Ke } from "./date-picker-shell.js";
|
|
14
|
+
import { looksLikeFiscalPeriodInput as E, monthSelectionFromFiscalInput as N, formatFiscalPeriod as Le } from "./fiscal-period-format.js";
|
|
15
|
+
import { resolveFiscalConfig as Ye } from "../../data-display/calendar/calendar-config.js";
|
|
16
16
|
const y = (t) => {
|
|
17
|
-
const s =
|
|
17
|
+
const s = Le(t);
|
|
18
18
|
return s || `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`;
|
|
19
|
-
},
|
|
19
|
+
}, ze = o.forwardRef(
|
|
20
20
|
({
|
|
21
21
|
value: t,
|
|
22
22
|
onChange: s,
|
|
23
|
-
placeholder:
|
|
23
|
+
placeholder: T,
|
|
24
24
|
minDate: J,
|
|
25
25
|
maxDate: Q,
|
|
26
26
|
startMonth: U,
|
|
@@ -30,78 +30,82 @@ const y = (t) => {
|
|
|
30
30
|
className: X,
|
|
31
31
|
onBlur: Z,
|
|
32
32
|
calendarKind: S,
|
|
33
|
-
fiscalMode:
|
|
33
|
+
fiscalMode: A,
|
|
34
34
|
granularity: _,
|
|
35
35
|
fiscalMonthPattern: O,
|
|
36
36
|
fiscalYearStartMonth: V,
|
|
37
37
|
fiscalConfig: B,
|
|
38
38
|
showPresets: ee,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
39
|
+
showPeriodBoundaries: te,
|
|
40
|
+
autoNavigateToAvailable: ne,
|
|
41
|
+
...re
|
|
42
|
+
}, oe) => {
|
|
43
|
+
const { t: d } = Ae(), ie = T ?? d("datePicker.selectMonth"), C = o.useRef(null), j = o.useRef(null);
|
|
44
|
+
o.useImperativeHandle(oe, () => C.current);
|
|
45
|
+
const [r, K] = o.useState(!1), u = o.useCallback(() => {
|
|
46
|
+
K(!1);
|
|
45
47
|
}, []), h = (e) => {
|
|
46
48
|
if (!f) {
|
|
47
49
|
if (e) {
|
|
48
|
-
|
|
50
|
+
K(!0);
|
|
49
51
|
return;
|
|
50
52
|
}
|
|
51
53
|
u();
|
|
52
54
|
}
|
|
53
|
-
},
|
|
55
|
+
}, L = Pe(), { footerFlashKey: se, footerFlashTarget: ce, popoverHandlers: ae } = Ie(p, r, L, j), [M, i] = o.useState(t), [c, a] = o.useState(t ? y(t) : ""), [le, P] = o.useState(t ? new Date(t.year, t.month) : /* @__PURE__ */ new Date());
|
|
54
56
|
o.useEffect(() => {
|
|
55
57
|
r || (a(t ? y(t) : ""), i(t));
|
|
56
58
|
}, [r, t]), o.useEffect(() => {
|
|
57
59
|
r && (i(t), P(t ? new Date(t.year, t.month) : /* @__PURE__ */ new Date()), a(t ? y(t) : ""));
|
|
58
60
|
}, [r, t]);
|
|
59
|
-
const
|
|
60
|
-
const n =
|
|
61
|
+
const pe = (e) => {
|
|
62
|
+
const n = Ve(e);
|
|
61
63
|
i(n), n && a(y(n)), p || (s?.(n), u());
|
|
62
|
-
},
|
|
63
|
-
const n =
|
|
64
|
+
}, Y = (e) => {
|
|
65
|
+
const n = Oe(e, M);
|
|
64
66
|
s?.(n), u();
|
|
65
67
|
}, x = () => {
|
|
66
68
|
i(t), a(t ? y(t) : ""), u();
|
|
67
69
|
}, z = () => {
|
|
68
70
|
i(void 0), a(""), s?.(void 0), p || u();
|
|
69
|
-
},
|
|
71
|
+
}, fe = je({
|
|
70
72
|
calendarKind: S,
|
|
71
|
-
fiscalMode:
|
|
73
|
+
fiscalMode: A,
|
|
72
74
|
granularity: _,
|
|
73
75
|
fiscalMonthPattern: O,
|
|
74
76
|
fiscalYearStartMonth: V,
|
|
75
77
|
fiscalConfig: B,
|
|
76
|
-
showPresets: ee
|
|
77
|
-
|
|
78
|
+
showPresets: ee,
|
|
79
|
+
showPeriodBoundaries: te,
|
|
80
|
+
autoNavigateToAvailable: ne
|
|
81
|
+
}), R = Ye({
|
|
78
82
|
fiscalConfig: B,
|
|
79
83
|
calendarKind: S,
|
|
80
|
-
fiscalMode:
|
|
84
|
+
fiscalMode: A,
|
|
81
85
|
fiscalMonthPattern: O,
|
|
82
86
|
fiscalYearStartMonth: V
|
|
83
|
-
}), b = S === "fiscal", g = "MM/yyyy", k = t ? y(t) : "", D = o.useRef(!1),
|
|
87
|
+
}), b = S === "fiscal", g = "MM/yyyy", k = t ? y(t) : "", D = o.useRef(!1), ue = (e) => {
|
|
84
88
|
const n = e.target.value;
|
|
85
|
-
if (b &&
|
|
89
|
+
if (b && E(n)) {
|
|
86
90
|
a(n);
|
|
87
|
-
const m =
|
|
91
|
+
const m = N(n, R);
|
|
88
92
|
m && (i(m), P(new Date(m.year, m.month, 1)), p || s?.(m));
|
|
89
93
|
return;
|
|
90
94
|
}
|
|
91
|
-
const
|
|
92
|
-
if (a(
|
|
95
|
+
const w = be(n, g, c);
|
|
96
|
+
if (a(w), w === "") {
|
|
93
97
|
i(void 0), p || s?.(void 0);
|
|
94
98
|
return;
|
|
95
99
|
}
|
|
96
|
-
const { parsed: I, isValid:
|
|
97
|
-
if (
|
|
100
|
+
const { parsed: I, isValid: ge } = we(w, g);
|
|
101
|
+
if (ge && I) {
|
|
98
102
|
const m = { month: I.getMonth(), year: I.getFullYear() };
|
|
99
103
|
i(m), P(I), p || s?.(m);
|
|
100
104
|
}
|
|
101
|
-
},
|
|
105
|
+
}, me = () => {
|
|
102
106
|
if (r) return;
|
|
103
|
-
if (b &&
|
|
104
|
-
const n =
|
|
107
|
+
if (b && E(c)) {
|
|
108
|
+
const n = N(c, R);
|
|
105
109
|
if (n) {
|
|
106
110
|
a(y(n)), i(n), p || s?.(n);
|
|
107
111
|
return;
|
|
@@ -109,7 +113,7 @@ const y = (t) => {
|
|
|
109
113
|
a(k), i(t);
|
|
110
114
|
return;
|
|
111
115
|
}
|
|
112
|
-
const e =
|
|
116
|
+
const e = Ee(c, g, k);
|
|
113
117
|
if (e.resetToCommitted) {
|
|
114
118
|
a(k), i(t);
|
|
115
119
|
return;
|
|
@@ -120,12 +124,12 @@ const y = (t) => {
|
|
|
120
124
|
return;
|
|
121
125
|
}
|
|
122
126
|
a(k), i(t);
|
|
123
|
-
},
|
|
127
|
+
}, de = () => {
|
|
124
128
|
if (r && p) {
|
|
125
|
-
|
|
129
|
+
Y();
|
|
126
130
|
return;
|
|
127
131
|
}
|
|
128
|
-
const e =
|
|
132
|
+
const e = Fe(c, g);
|
|
129
133
|
if (e.parsed) {
|
|
130
134
|
const n = {
|
|
131
135
|
month: e.parsed.getMonth(),
|
|
@@ -135,21 +139,21 @@ const y = (t) => {
|
|
|
135
139
|
return;
|
|
136
140
|
}
|
|
137
141
|
r || (D.current = !0, h(!0));
|
|
138
|
-
}, H = k !== c,
|
|
139
|
-
() =>
|
|
142
|
+
}, H = k !== c, he = b ? E(c) ? N(c, R) == null && c !== "" : $(c, g) : $(c, g), ye = o.useCallback(
|
|
143
|
+
() => Se(
|
|
140
144
|
M,
|
|
141
145
|
t,
|
|
142
|
-
(e, n) =>
|
|
146
|
+
(e, n) => Ce(e, n) === 0
|
|
143
147
|
),
|
|
144
148
|
[M, t]
|
|
145
149
|
);
|
|
146
150
|
return o.useLayoutEffect(() => {
|
|
147
|
-
|
|
151
|
+
L.current = {
|
|
148
152
|
onDismiss: x,
|
|
149
|
-
resolveFlash:
|
|
153
|
+
resolveFlash: ye
|
|
150
154
|
};
|
|
151
155
|
}), /* @__PURE__ */ l(
|
|
152
|
-
|
|
156
|
+
Ke,
|
|
153
157
|
{
|
|
154
158
|
open: r,
|
|
155
159
|
disabled: f,
|
|
@@ -158,7 +162,7 @@ const y = (t) => {
|
|
|
158
162
|
onOpenAutoFocus: (e) => {
|
|
159
163
|
D.current || e.preventDefault(), D.current = !1;
|
|
160
164
|
},
|
|
161
|
-
popoverHandlers:
|
|
165
|
+
popoverHandlers: ae,
|
|
162
166
|
trigger: /* @__PURE__ */ l(
|
|
163
167
|
"div",
|
|
164
168
|
{
|
|
@@ -166,35 +170,35 @@ const y = (t) => {
|
|
|
166
170
|
"data-component": "month-picker",
|
|
167
171
|
"data-state": r ? "open" : "closed",
|
|
168
172
|
"data-pending": H || void 0,
|
|
169
|
-
onPointerDown: (e) =>
|
|
173
|
+
onPointerDown: (e) => Re({
|
|
170
174
|
disabled: f,
|
|
171
175
|
event: e,
|
|
172
176
|
onOpen: () => h(!0),
|
|
173
177
|
focusField: () => C.current?.focus()
|
|
174
178
|
}),
|
|
175
179
|
children: /* @__PURE__ */ l(
|
|
176
|
-
|
|
180
|
+
Ne,
|
|
177
181
|
{
|
|
178
182
|
ref: C,
|
|
179
183
|
value: c,
|
|
180
|
-
onChange:
|
|
184
|
+
onChange: ue,
|
|
181
185
|
onBlur: (e) => {
|
|
182
|
-
|
|
186
|
+
me(), Z?.(e);
|
|
183
187
|
},
|
|
184
188
|
onClick: () => !f && h(!0),
|
|
185
189
|
onKeyDown: (e) => {
|
|
186
|
-
e.key === "Enter" && !f && (e.preventDefault(),
|
|
190
|
+
e.key === "Enter" && !f && (e.preventDefault(), de()), e.key === "ArrowDown" && !r && !f && (e.preventDefault(), D.current = !0, h(!0)), e.key === "Escape" && r && xe(e, { open: r, onCancel: x });
|
|
187
191
|
},
|
|
188
|
-
placeholder: r ? d("datePicker.monthYearFormat") :
|
|
192
|
+
placeholder: r ? d("datePicker.monthYearFormat") : ie,
|
|
189
193
|
disabled: f,
|
|
190
194
|
"data-form-control": "input",
|
|
191
|
-
className:
|
|
195
|
+
className: Me(
|
|
192
196
|
"cursor-pointer",
|
|
193
|
-
|
|
197
|
+
he ? "text-destructive" : H ? "text-content-placeholder" : "",
|
|
194
198
|
X
|
|
195
199
|
),
|
|
196
|
-
suffix: /* @__PURE__ */
|
|
197
|
-
t && !f && /* @__PURE__ */
|
|
200
|
+
suffix: /* @__PURE__ */ F("div", { className: "flex items-center gap-1", children: [
|
|
201
|
+
t && !f && /* @__PURE__ */ F(v, { children: [
|
|
198
202
|
/* @__PURE__ */ l(q, { asChild: !0, children: /* @__PURE__ */ l(
|
|
199
203
|
"button",
|
|
200
204
|
{
|
|
@@ -205,12 +209,12 @@ const y = (t) => {
|
|
|
205
209
|
e.stopPropagation(), z();
|
|
206
210
|
},
|
|
207
211
|
className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
208
|
-
children: /* @__PURE__ */ l(
|
|
212
|
+
children: /* @__PURE__ */ l(ke, { className: "size-3 hover:text-content" })
|
|
209
213
|
}
|
|
210
214
|
) }),
|
|
211
215
|
/* @__PURE__ */ l(G, { variant: "tertiary", side: "top", children: d("calendar.clear") })
|
|
212
216
|
] }),
|
|
213
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ F(v, { children: [
|
|
214
218
|
/* @__PURE__ */ l(q, { asChild: !0, children: /* @__PURE__ */ l(
|
|
215
219
|
"button",
|
|
216
220
|
{
|
|
@@ -225,43 +229,43 @@ const y = (t) => {
|
|
|
225
229
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), f || (D.current = !0, r ? u() : h(!0)));
|
|
226
230
|
},
|
|
227
231
|
className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
228
|
-
children: /* @__PURE__ */ l(
|
|
232
|
+
children: /* @__PURE__ */ l(De, { className: "h-4 w-4 text-secondary-foreground" })
|
|
229
233
|
}
|
|
230
234
|
) }),
|
|
231
235
|
/* @__PURE__ */ l(G, { variant: "tertiary", side: "top", children: d("datePicker.selectMonth") })
|
|
232
236
|
] })
|
|
233
237
|
] }),
|
|
234
|
-
...
|
|
238
|
+
...re
|
|
235
239
|
}
|
|
236
240
|
)
|
|
237
241
|
}
|
|
238
242
|
),
|
|
239
243
|
children: /* @__PURE__ */ l(
|
|
240
|
-
|
|
244
|
+
Te,
|
|
241
245
|
{
|
|
242
246
|
pickerType: "month",
|
|
243
247
|
monthMode: "single",
|
|
244
248
|
selectedMonths: M,
|
|
245
|
-
footerFlashKey:
|
|
246
|
-
footerFlashTarget:
|
|
247
|
-
onMonthSelect:
|
|
248
|
-
month:
|
|
249
|
+
footerFlashKey: se,
|
|
250
|
+
footerFlashTarget: ce,
|
|
251
|
+
onMonthSelect: pe,
|
|
252
|
+
month: le,
|
|
249
253
|
onMonthChange: P,
|
|
250
|
-
disabled:
|
|
254
|
+
disabled: Be(J, Q),
|
|
251
255
|
startMonth: U,
|
|
252
256
|
endMonth: W,
|
|
253
257
|
showFooter: p,
|
|
254
|
-
onApply:
|
|
258
|
+
onApply: Y,
|
|
255
259
|
onCancel: x,
|
|
256
260
|
onClear: z,
|
|
257
|
-
...
|
|
261
|
+
...fe
|
|
258
262
|
}
|
|
259
263
|
)
|
|
260
264
|
}
|
|
261
265
|
);
|
|
262
266
|
}
|
|
263
267
|
);
|
|
264
|
-
|
|
268
|
+
ze.displayName = "MonthPicker";
|
|
265
269
|
export {
|
|
266
|
-
|
|
270
|
+
ze as MonthPicker
|
|
267
271
|
};
|