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,20 +1,20 @@
|
|
|
1
1
|
import { jsx as s, jsxs as S } from "react/jsx-runtime";
|
|
2
2
|
import * as r from "react";
|
|
3
|
-
import { Cross as
|
|
3
|
+
import { Cross as ge, CalendarMonth as ye } from "impact-nova-icons";
|
|
4
4
|
import { format as b } from "date-fns";
|
|
5
|
-
import { cn as
|
|
6
|
-
import { usePickerDismissActionsRef as
|
|
7
|
-
import { Input as
|
|
8
|
-
import { Calendar as
|
|
9
|
-
import { Tooltip as
|
|
10
|
-
import { useImpactNovaI18n as
|
|
11
|
-
import { getDateFnsLocale as
|
|
12
|
-
import { createComponent as
|
|
13
|
-
import { coerceSingleDateApply as
|
|
14
|
-
import { buildDateBoundsMatcher as
|
|
15
|
-
import { fiscalCalendarPassThrough as
|
|
16
|
-
import { DatePickerShell as
|
|
17
|
-
const
|
|
5
|
+
import { cn as ke } from "../../../lib/utils.js";
|
|
6
|
+
import { usePickerDismissActionsRef as ve, usePickerFooterDismissNudge as Ce, isDateInputInvalid as Ie, resolveSingleValueDismissFlash as Pe, handlePickerEscapeKeyDown as Me, handlePickerSurfacePointerDown as xe, maskDateInput as Re, parseDateInput as Se, resolveDateInputOnBlur as be, resolveDateInputOnEnter as we } from "./date-input-behavior.js";
|
|
7
|
+
import { Input as Te } from "../input/input.js";
|
|
8
|
+
import { Calendar as Ee } from "../../data-display/calendar/calendar.js";
|
|
9
|
+
import { Tooltip as K, TooltipTrigger as j, TooltipContent as B } from "../../feedback/tooltip/tooltip.js";
|
|
10
|
+
import { useImpactNovaI18n as Ae } from "../../../i18n/use-impact-nova-i18n.js";
|
|
11
|
+
import { getDateFnsLocale as Ne } from "../../../i18n/getDateFnsLocale.js";
|
|
12
|
+
import { createComponent as Le } from "../../../lib/primitives/create-component.js";
|
|
13
|
+
import { coerceSingleDateApply as Oe, coerceSingleDate as Ve } from "./calendar-selection-adapters.js";
|
|
14
|
+
import { buildDateBoundsMatcher as Ke } from "../../../lib/date-bounds-matcher.js";
|
|
15
|
+
import { fiscalCalendarPassThrough as je } from "./fiscal-pass-through.js";
|
|
16
|
+
import { DatePickerShell as Be } from "./date-picker-shell.js";
|
|
17
|
+
const tt = Le(
|
|
18
18
|
"DatePicker",
|
|
19
19
|
({
|
|
20
20
|
value: n,
|
|
@@ -36,13 +36,15 @@ const $e = Ee(
|
|
|
36
36
|
fiscalYearStartMonth: Z,
|
|
37
37
|
fiscalConfig: _,
|
|
38
38
|
showPresets: $,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const
|
|
39
|
+
showPeriodBoundaries: F,
|
|
40
|
+
autoNavigateToAvailable: ee,
|
|
41
|
+
comparison: te,
|
|
42
|
+
onComparisonChange: ne,
|
|
43
|
+
...re
|
|
44
|
+
}, ie) => {
|
|
45
|
+
const { locale: T, t: h } = Ae(), f = r.useMemo(() => Ne(T), [T]), oe = z ?? h("datePicker.selectDate"), g = r.useRef(null), E = r.useRef(null), I = r.useRef(null);
|
|
46
|
+
r.useImperativeHandle(ie, () => g.current);
|
|
47
|
+
const [i, A] = r.useState(!1), N = ve(), { footerFlashKey: se, footerFlashTarget: ce, popoverHandlers: le } = Ce(a, i, N, E), y = r.useRef(!1), [x, o] = r.useState(null), k = n ? b(n, l, { locale: f }) : "", d = x?.input ?? k, P = i ? x?.pending ?? n : n, ae = x?.viewMonth ?? n ?? /* @__PURE__ */ new Date(), u = r.useCallback(() => {
|
|
46
48
|
o(null), A(!1);
|
|
47
49
|
}, []), m = (e) => {
|
|
48
50
|
if (!c) {
|
|
@@ -58,15 +60,15 @@ const $e = Ee(
|
|
|
58
60
|
}
|
|
59
61
|
};
|
|
60
62
|
r.useEffect(() => {
|
|
61
|
-
g.current &&
|
|
63
|
+
g.current && I.current !== null && (g.current.setSelectionRange(I.current, I.current), I.current = null);
|
|
62
64
|
}, [d]);
|
|
63
|
-
const
|
|
64
|
-
const t =
|
|
65
|
+
const ue = (e) => {
|
|
66
|
+
const t = Ve(e), D = t ? b(t, l, { locale: f }) : "";
|
|
65
67
|
o(
|
|
66
68
|
(v) => v ? { ...v, pending: t, input: D, viewMonth: t ?? v.viewMonth } : null
|
|
67
69
|
), t && !a && (p?.(t), u());
|
|
68
70
|
}, L = (e) => {
|
|
69
|
-
const t =
|
|
71
|
+
const t = Oe(e, P);
|
|
70
72
|
p?.(t), u();
|
|
71
73
|
}, R = () => {
|
|
72
74
|
u();
|
|
@@ -81,27 +83,27 @@ const $e = Ee(
|
|
|
81
83
|
viewMonth: n ?? /* @__PURE__ */ new Date()
|
|
82
84
|
}),
|
|
83
85
|
[k, n]
|
|
84
|
-
),
|
|
85
|
-
const t =
|
|
86
|
-
if (o((
|
|
87
|
-
o((
|
|
86
|
+
), pe = (e) => {
|
|
87
|
+
const t = Re(e.target.value, l, d);
|
|
88
|
+
if (o((C) => ({ ...C ?? M(), input: t })), t === "") {
|
|
89
|
+
o((C) => ({ ...C ?? M(), input: "", pending: void 0 })), a || p?.(void 0);
|
|
88
90
|
return;
|
|
89
91
|
}
|
|
90
|
-
const { parsed: D, isValid: v } =
|
|
91
|
-
v && D && (o((
|
|
92
|
-
...
|
|
92
|
+
const { parsed: D, isValid: v } = Se(t, l, f);
|
|
93
|
+
v && D && (o((C) => ({
|
|
94
|
+
...C ?? M(),
|
|
93
95
|
input: t,
|
|
94
96
|
pending: D,
|
|
95
97
|
viewMonth: D
|
|
96
98
|
})), a || p?.(D));
|
|
97
|
-
},
|
|
99
|
+
}, fe = r.useCallback(
|
|
98
100
|
(e) => {
|
|
99
101
|
p?.(e), u();
|
|
100
102
|
},
|
|
101
103
|
[p, u]
|
|
102
|
-
),
|
|
104
|
+
), de = () => {
|
|
103
105
|
if (i) return;
|
|
104
|
-
const e =
|
|
106
|
+
const e = be(
|
|
105
107
|
d,
|
|
106
108
|
l,
|
|
107
109
|
k,
|
|
@@ -121,19 +123,19 @@ const $e = Ee(
|
|
|
121
123
|
return;
|
|
122
124
|
}
|
|
123
125
|
o(null);
|
|
124
|
-
},
|
|
126
|
+
}, me = () => {
|
|
125
127
|
if (i && a) {
|
|
126
128
|
L();
|
|
127
129
|
return;
|
|
128
130
|
}
|
|
129
|
-
const e =
|
|
131
|
+
const e = we(d, l, f);
|
|
130
132
|
if (e.parsed) {
|
|
131
|
-
a &&
|
|
133
|
+
a && fe(e.parsed);
|
|
132
134
|
return;
|
|
133
135
|
}
|
|
134
136
|
i || (y.current = !0, m(!0));
|
|
135
|
-
}, V = (n ? b(n, l, { locale: f }) : "") !== d,
|
|
136
|
-
() =>
|
|
137
|
+
}, V = (n ? b(n, l, { locale: f }) : "") !== d, he = Ie(d, l, f), De = r.useCallback(
|
|
138
|
+
() => Pe(
|
|
137
139
|
P,
|
|
138
140
|
n,
|
|
139
141
|
(e, t) => e.getTime() === t.getTime()
|
|
@@ -143,10 +145,10 @@ const $e = Ee(
|
|
|
143
145
|
return r.useLayoutEffect(() => {
|
|
144
146
|
N.current = {
|
|
145
147
|
onDismiss: R,
|
|
146
|
-
resolveFlash:
|
|
148
|
+
resolveFlash: De
|
|
147
149
|
};
|
|
148
150
|
}), /* @__PURE__ */ s(
|
|
149
|
-
|
|
151
|
+
Be,
|
|
150
152
|
{
|
|
151
153
|
open: i,
|
|
152
154
|
disabled: c,
|
|
@@ -155,7 +157,7 @@ const $e = Ee(
|
|
|
155
157
|
onOpenAutoFocus: (e) => {
|
|
156
158
|
y.current || e.preventDefault(), y.current = !1;
|
|
157
159
|
},
|
|
158
|
-
popoverHandlers:
|
|
160
|
+
popoverHandlers: le,
|
|
159
161
|
trigger: /* @__PURE__ */ s(
|
|
160
162
|
"div",
|
|
161
163
|
{
|
|
@@ -163,34 +165,34 @@ const $e = Ee(
|
|
|
163
165
|
"data-component": "date-picker",
|
|
164
166
|
"data-state": i ? "open" : "closed",
|
|
165
167
|
"data-pending": V || void 0,
|
|
166
|
-
onPointerDown: (e) =>
|
|
168
|
+
onPointerDown: (e) => xe({
|
|
167
169
|
disabled: c,
|
|
168
170
|
event: e,
|
|
169
171
|
onOpen: () => m(!0),
|
|
170
172
|
focusField: () => g.current?.focus()
|
|
171
173
|
}),
|
|
172
174
|
children: /* @__PURE__ */ s(
|
|
173
|
-
|
|
175
|
+
Te,
|
|
174
176
|
{
|
|
175
177
|
ref: g,
|
|
176
178
|
value: d,
|
|
177
|
-
onChange:
|
|
178
|
-
onBlur:
|
|
179
|
+
onChange: pe,
|
|
180
|
+
onBlur: de,
|
|
179
181
|
onClick: () => !c && m(!0),
|
|
180
182
|
onKeyDown: (e) => {
|
|
181
|
-
e.key === "Enter" && !c && (e.preventDefault(),
|
|
183
|
+
e.key === "Enter" && !c && (e.preventDefault(), me()), e.key === "ArrowDown" && !i && !c && (e.preventDefault(), y.current = !0, m(!0)), e.key === "Escape" && i && Me(e, { open: i, onCancel: R });
|
|
182
184
|
},
|
|
183
|
-
placeholder: i ? l :
|
|
185
|
+
placeholder: i ? l : oe,
|
|
184
186
|
disabled: c,
|
|
185
187
|
"data-form-control": "input",
|
|
186
|
-
className:
|
|
188
|
+
className: ke(
|
|
187
189
|
"cursor-pointer",
|
|
188
|
-
|
|
190
|
+
he ? "text-destructive" : V ? "text-content-placeholder" : "",
|
|
189
191
|
Q
|
|
190
192
|
),
|
|
191
193
|
suffix: /* @__PURE__ */ S("div", { className: "flex items-center gap-1", children: [
|
|
192
|
-
n && !c && /* @__PURE__ */ S(
|
|
193
|
-
/* @__PURE__ */ s(
|
|
194
|
+
n && !c && /* @__PURE__ */ S(K, { children: [
|
|
195
|
+
/* @__PURE__ */ s(j, { asChild: !0, children: /* @__PURE__ */ s(
|
|
194
196
|
"button",
|
|
195
197
|
{
|
|
196
198
|
type: "button",
|
|
@@ -200,38 +202,38 @@ const $e = Ee(
|
|
|
200
202
|
e.stopPropagation(), O();
|
|
201
203
|
},
|
|
202
204
|
className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
203
|
-
children: /* @__PURE__ */ s(
|
|
205
|
+
children: /* @__PURE__ */ s(ge, { className: "size-3 hover:text-content" })
|
|
204
206
|
}
|
|
205
207
|
) }),
|
|
206
|
-
/* @__PURE__ */ s(
|
|
208
|
+
/* @__PURE__ */ s(B, { variant: "tertiary", side: "top", children: h("calendar.clear") })
|
|
207
209
|
] }),
|
|
208
|
-
/* @__PURE__ */ S(
|
|
209
|
-
/* @__PURE__ */ s(
|
|
210
|
+
/* @__PURE__ */ S(K, { children: [
|
|
211
|
+
/* @__PURE__ */ s(j, { asChild: !0, children: /* @__PURE__ */ s("button", { type: "button", tabIndex: 0, "aria-label": h("datePicker.selectDate"), onClick: (e) => {
|
|
210
212
|
e.stopPropagation(), c || (i ? u() : m(!0));
|
|
211
213
|
}, onKeyDown: (e) => {
|
|
212
214
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), c || (y.current = !0, i ? u() : m(!0)));
|
|
213
|
-
}, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ s(
|
|
214
|
-
/* @__PURE__ */ s(
|
|
215
|
+
}, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ s(ye, { className: "h-4 w-4 text-secondary-foreground" }) }) }),
|
|
216
|
+
/* @__PURE__ */ s(B, { variant: "tertiary", side: "top", children: h("datePicker.selectDate") })
|
|
215
217
|
] })
|
|
216
218
|
] }),
|
|
217
|
-
...
|
|
219
|
+
...re
|
|
218
220
|
}
|
|
219
221
|
)
|
|
220
222
|
}
|
|
221
223
|
),
|
|
222
224
|
children: /* @__PURE__ */ s(
|
|
223
|
-
|
|
225
|
+
Ee,
|
|
224
226
|
{
|
|
225
227
|
mode: "single",
|
|
226
228
|
selected: P,
|
|
227
|
-
footerFlashKey:
|
|
228
|
-
footerFlashTarget:
|
|
229
|
-
onSelect:
|
|
230
|
-
month:
|
|
229
|
+
footerFlashKey: se,
|
|
230
|
+
footerFlashTarget: ce,
|
|
231
|
+
onSelect: ue,
|
|
232
|
+
month: ae,
|
|
231
233
|
onMonthChange: (e) => o(
|
|
232
234
|
(t) => t ? { ...t, viewMonth: e } : null
|
|
233
235
|
),
|
|
234
|
-
disabled:
|
|
236
|
+
disabled: Ke(H, q),
|
|
235
237
|
startMonth: G,
|
|
236
238
|
endMonth: J,
|
|
237
239
|
showFooter: a,
|
|
@@ -240,7 +242,7 @@ const $e = Ee(
|
|
|
240
242
|
onClear: O,
|
|
241
243
|
captionLayout: "dropdown",
|
|
242
244
|
...w !== void 0 ? { weekStartsOn: w } : {},
|
|
243
|
-
...
|
|
245
|
+
...je({
|
|
244
246
|
calendarKind: U,
|
|
245
247
|
fiscalMode: W,
|
|
246
248
|
granularity: X,
|
|
@@ -248,8 +250,10 @@ const $e = Ee(
|
|
|
248
250
|
fiscalYearStartMonth: Z,
|
|
249
251
|
fiscalConfig: _,
|
|
250
252
|
showPresets: $,
|
|
251
|
-
|
|
252
|
-
|
|
253
|
+
showPeriodBoundaries: F,
|
|
254
|
+
autoNavigateToAvailable: ee,
|
|
255
|
+
comparison: te,
|
|
256
|
+
onComparisonChange: ne
|
|
253
257
|
})
|
|
254
258
|
}
|
|
255
259
|
)
|
|
@@ -258,5 +262,5 @@ const $e = Ee(
|
|
|
258
262
|
}
|
|
259
263
|
);
|
|
260
264
|
export {
|
|
261
|
-
|
|
265
|
+
tt as DatePicker
|
|
262
266
|
};
|
|
@@ -11,6 +11,13 @@ export interface FiscalPickerProps {
|
|
|
11
11
|
fiscalConfig?: FiscalCalendarConfig;
|
|
12
12
|
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
13
13
|
showPresets?: boolean;
|
|
14
|
+
/** Draw `(` / `)` on fiscal period start/end days. Default false. */
|
|
15
|
+
showPeriodBoundaries?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* When true and there is no selection, open on the first enabled period.
|
|
18
|
+
* Navigate only — does not select a value. Default false.
|
|
19
|
+
*/
|
|
20
|
+
autoNavigateToAvailable?: boolean;
|
|
14
21
|
comparison?: "prior-fy";
|
|
15
22
|
onComparisonChange?: (value: YoYComparison | undefined) => void;
|
|
16
23
|
}
|