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