impact-nova 2.1.0-alpha.9 → 2.2.1
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/README.md +6 -0
- package/dist/components/data/ag-grid-react/cell-renderers/editors/split-cell-editor.js +73 -94
- package/dist/components/data/ag-grid-react/cell-renderers/editors/split-cell-focus.d.ts +53 -0
- package/dist/components/data/ag-grid-react/cell-renderers/editors/split-cell-focus.js +98 -0
- package/dist/components/data/ag-grid-react/headers/column-menu/column-settings-menu.js +15 -13
- package/dist/components/data/ag-grid-react/headers/custom-header.js +56 -58
- package/dist/components/data/ag-grid-react/headers/custom-inner-header-group.d.ts +12 -0
- package/dist/components/data/ag-grid-react/headers/custom-inner-header-group.js +31 -0
- package/dist/components/data/ag-grid-react/headers/header-search-active-state.d.ts +10 -0
- package/dist/components/data/ag-grid-react/headers/header-search-active-state.js +38 -0
- package/dist/components/data/ag-grid-react/index.js +166 -163
- package/dist/components/data/ag-grid-react/notify-column-indicator-sync.d.ts +3 -4
- package/dist/components/data/ag-grid-react/theme.js +0 -2
- package/dist/components/data/data-table/data-table-column-list.js +1 -1
- package/dist/components/data/data-table/data-table-saved-views.js +1 -1
- package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +7 -6
- package/dist/components/data/nested-list/components/SortableItem.d.ts +3 -1
- package/dist/components/data/nested-list/components/SortableItem.js +111 -109
- package/dist/components/data-display/calendar/calendar-footer-emphasis.d.ts +28 -0
- package/dist/components/data-display/calendar/calendar-footer-emphasis.js +8 -0
- package/dist/components/data-display/calendar/calendar-footer.d.ts +4 -1
- package/dist/components/data-display/calendar/calendar-footer.js +60 -38
- package/dist/components/data-display/calendar/calendar.js +86 -82
- package/dist/components/data-display/calendar/calendar.types.d.ts +2 -0
- package/dist/components/data-display/calendar/use-calendar-state.d.ts +3 -0
- package/dist/components/feedback/tooltip/tab-tooltip-render.js +3 -2
- package/dist/components/flows/filter-strip/filter-strip.js +36 -29
- package/dist/components/flows/filter-strip/filter-summary.js +2 -2
- package/dist/components/forms/date-picker/date-input-behavior.d.ts +118 -0
- package/dist/components/forms/date-picker/date-input-behavior.js +164 -0
- package/dist/components/forms/date-picker/date-picker.js +202 -138
- package/dist/components/forms/date-picker/date-range-picker.js +302 -215
- package/dist/components/forms/date-picker/month-picker.js +160 -119
- package/dist/components/forms/date-picker/month-range-picker.js +302 -245
- package/dist/components/forms/date-picker/multi-date-picker.js +94 -80
- package/dist/components/forms/date-picker/multi-month-picker.js +97 -83
- package/dist/components/forms/date-picker/multi-week-picker.js +107 -93
- package/dist/components/forms/date-picker/week-picker.js +230 -140
- package/dist/components/forms/date-picker/week-range-picker.js +332 -226
- package/dist/components/forms/file-upload/file-upload.js +312 -174
- package/dist/components/forms/file-upload/file-upload.types.d.ts +17 -2
- package/dist/components/layout/dynamic-layout/dynamic-layout.variants.d.ts +1 -1
- package/dist/components/layout/header/header.js +45 -38
- package/dist/components/layout/horizontal-scroller/index.d.ts +1 -0
- package/dist/components/layout/horizontal-scroller/index.js +3 -2
- package/dist/components/ui/local-raster-icons/assets/excel-error-icon.webp.js +4 -0
- package/dist/components/ui/local-raster-icons/assets/file-upload-error.webp.js +4 -0
- package/dist/components/ui/local-raster-icons/rasterIcons.d.ts +2 -0
- package/dist/components/ui/local-raster-icons/rasterIcons.js +32 -22
- package/dist/components/ui/show.d.ts +10 -0
- package/dist/components/ui/show.js +7 -0
- package/dist/components/ui/show.types.d.ts +5 -0
- package/dist/i18n/defaultMessages.d.ts +17 -0
- package/dist/i18n/defaultMessages.js +29 -17
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/locales/de.js +12 -0
- package/dist/i18n/locales/es.js +12 -0
- package/dist/i18n/locales/hi.js +12 -0
- package/dist/i18n/locales/kn.js +12 -0
- package/dist/impact-nova-base.scss +6 -2
- package/dist/impact-nova-components.css +141 -16
- package/dist/impact-nova-tokens.scss +12 -0
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +273 -271
- package/dist/lib/utils.js +40 -24
- package/dist/llms/rules/ag-grid.js +1 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/dist/tailwind.config.js +36 -4
- package/dist/theme/tailwind-colors.js +3 -1
- package/package.json +15 -6
- package/tailwind.config.d.ts +3 -0
- package/dist/components/data/ag-grid-react/headers/custom-header-group.d.ts +0 -10
- package/dist/components/data/ag-grid-react/headers/custom-header-group.js +0 -58
|
@@ -1,135 +1,176 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { Cross as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { Input as
|
|
7
|
-
import { Popover as
|
|
8
|
-
import { Calendar as
|
|
9
|
-
import { Tooltip as
|
|
10
|
-
import { useImpactNovaI18n as
|
|
11
|
-
import { coerceSingleMonthApply as
|
|
12
|
-
import { buildDateBoundsMatcher as
|
|
13
|
-
const
|
|
1
|
+
import { jsxs as k, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import * as o from "react";
|
|
3
|
+
import { Cross as _, CalendarMonth as ee } from "impact-nova-icons";
|
|
4
|
+
import { cn as te } from "../../../lib/utils.js";
|
|
5
|
+
import { usePickerDismissActionsRef as ne, usePickerFooterDismissNudge as re, isDateInputInvalid as oe, compareMonthSelection as se, resolveDateInputOnBlur as ie, maskDateInput as ae, parseDateInput as ce, resolveDateInputOnEnter as le } from "./date-input-behavior.js";
|
|
6
|
+
import { Input as pe } from "../input/input.js";
|
|
7
|
+
import { Popover as fe, PopoverAnchor as de, PopoverContent as me } from "../../feedback/popover/popover.js";
|
|
8
|
+
import { Calendar as ue } from "../../data-display/calendar/calendar.js";
|
|
9
|
+
import { Tooltip as E, TooltipTrigger as b, TooltipContent as V } from "../../feedback/tooltip/tooltip.js";
|
|
10
|
+
import { useImpactNovaI18n as he } from "../../../i18n/use-impact-nova-i18n.js";
|
|
11
|
+
import { coerceSingleMonthApply as ye, coerceSingleMonth as Me } from "./calendar-selection-adapters.js";
|
|
12
|
+
import { buildDateBoundsMatcher as ge } from "../../../lib/date-bounds-matcher.js";
|
|
13
|
+
const u = (e) => `${(e.month + 1).toString().padStart(2, "0")}/${e.year}`, De = o.forwardRef(
|
|
14
14
|
({
|
|
15
|
-
value:
|
|
16
|
-
onChange:
|
|
17
|
-
placeholder:
|
|
18
|
-
minDate:
|
|
19
|
-
maxDate:
|
|
20
|
-
startMonth:
|
|
21
|
-
endMonth:
|
|
22
|
-
showFooter:
|
|
23
|
-
disabled:
|
|
24
|
-
className:
|
|
25
|
-
...
|
|
26
|
-
},
|
|
27
|
-
const { t: d } =
|
|
28
|
-
|
|
29
|
-
const [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}, [
|
|
33
|
-
|
|
34
|
-
}, [
|
|
35
|
-
const
|
|
36
|
-
const n =
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
const n =
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
const n =
|
|
47
|
-
if (
|
|
48
|
-
|
|
15
|
+
value: e,
|
|
16
|
+
onChange: p,
|
|
17
|
+
placeholder: w,
|
|
18
|
+
minDate: v,
|
|
19
|
+
maxDate: B,
|
|
20
|
+
startMonth: O,
|
|
21
|
+
endMonth: Y,
|
|
22
|
+
showFooter: i = !0,
|
|
23
|
+
disabled: f,
|
|
24
|
+
className: j,
|
|
25
|
+
...K
|
|
26
|
+
}, z) => {
|
|
27
|
+
const { t: d } = he(), F = w ?? d("datePicker.selectMonth"), P = o.useRef(null), S = o.useRef(null);
|
|
28
|
+
o.useImperativeHandle(z, () => P.current);
|
|
29
|
+
const [r, c] = o.useState(!1), R = ne(), { footerFlashKey: H, footerFlashTarget: $, popoverHandlers: L } = re(i, r, R, S), [h, a] = o.useState(e), [m, l] = o.useState(e ? u(e) : ""), [q, I] = o.useState(e ? new Date(e.year, e.month) : /* @__PURE__ */ new Date());
|
|
30
|
+
o.useEffect(() => {
|
|
31
|
+
r || (l(e ? u(e) : ""), a(e));
|
|
32
|
+
}, [r, e]), o.useEffect(() => {
|
|
33
|
+
r && (a(e), I(e ? new Date(e.year, e.month) : /* @__PURE__ */ new Date()), l(e ? u(e) : ""));
|
|
34
|
+
}, [r, e]);
|
|
35
|
+
const G = (t) => {
|
|
36
|
+
const n = Me(t);
|
|
37
|
+
a(n), n && l(u(n)), i || (p?.(n), c(!1));
|
|
38
|
+
}, x = (t) => {
|
|
39
|
+
const n = ye(t, h);
|
|
40
|
+
p?.(n), c(!1);
|
|
41
|
+
}, C = () => {
|
|
42
|
+
a(e), l(e ? u(e) : ""), c(!1);
|
|
43
|
+
}, A = () => {
|
|
44
|
+
a(void 0), l(""), p?.(void 0), i || c(!1);
|
|
45
|
+
}, y = "MM/yyyy", M = e ? u(e) : "", g = o.useRef(!1), J = (t) => {
|
|
46
|
+
const n = ae(t.target.value, y, m);
|
|
47
|
+
if (l(n), n === "") {
|
|
48
|
+
a(void 0), i || p?.(void 0);
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
53
|
-
const
|
|
54
|
-
|
|
51
|
+
const { parsed: D, isValid: Z } = ce(n, y);
|
|
52
|
+
if (Z && D) {
|
|
53
|
+
const T = { month: D.getMonth(), year: D.getFullYear() };
|
|
54
|
+
a(T), I(D), i || p?.(T);
|
|
55
55
|
}
|
|
56
|
-
},
|
|
57
|
-
if (
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
56
|
+
}, Q = () => {
|
|
57
|
+
if (r) return;
|
|
58
|
+
const t = ie(m, y, M);
|
|
59
|
+
if (t.resetToCommitted) {
|
|
60
|
+
l(M), a(e);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (t.parsed) {
|
|
64
|
+
const n = { month: t.parsed.getMonth(), year: t.parsed.getFullYear() };
|
|
65
|
+
l(t.display), a(n), i || p?.(n);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
l(M), a(e);
|
|
69
|
+
}, U = () => {
|
|
70
|
+
if (r && i) {
|
|
71
|
+
x();
|
|
72
|
+
return;
|
|
64
73
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
74
|
+
const t = le(m, y);
|
|
75
|
+
if (t.parsed) {
|
|
76
|
+
const n = {
|
|
77
|
+
month: t.parsed.getMonth(),
|
|
78
|
+
year: t.parsed.getFullYear()
|
|
79
|
+
};
|
|
80
|
+
i && (p?.(n), c(!1));
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
r || (g.current = !0, c(!0));
|
|
84
|
+
}, N = M !== m, W = oe(m, y), X = o.useCallback(() => h && (!e || se(h, e) !== 0) ? "apply" : "cancel", [h, e]);
|
|
85
|
+
return o.useLayoutEffect(() => {
|
|
86
|
+
R.current = {
|
|
87
|
+
onDismiss: C,
|
|
88
|
+
resolveFlash: X
|
|
89
|
+
};
|
|
90
|
+
}), /* @__PURE__ */ k(fe, { open: f ? !1 : r, onOpenChange: (t) => {
|
|
91
|
+
f || !t && i || c(t);
|
|
68
92
|
}, children: [
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
|
|
93
|
+
/* @__PURE__ */ s(de, { asChild: !0, children: /* @__PURE__ */ s(
|
|
94
|
+
"div",
|
|
71
95
|
{
|
|
72
|
-
ref:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
96
|
+
ref: S,
|
|
97
|
+
"data-component": "month-picker",
|
|
98
|
+
"data-state": r ? "open" : "closed",
|
|
99
|
+
"data-pending": N || void 0,
|
|
100
|
+
children: /* @__PURE__ */ s(
|
|
101
|
+
pe,
|
|
102
|
+
{
|
|
103
|
+
ref: P,
|
|
104
|
+
value: m,
|
|
105
|
+
onChange: J,
|
|
106
|
+
onBlur: Q,
|
|
107
|
+
onClick: () => !f && c(!0),
|
|
108
|
+
onKeyDown: (t) => {
|
|
109
|
+
t.key === "Enter" && !f && (t.preventDefault(), U()), t.key === "ArrowDown" && !r && !f && (t.preventDefault(), g.current = !0, c(!0)), t.key === "Escape" && r && (t.preventDefault(), C());
|
|
110
|
+
},
|
|
111
|
+
placeholder: r ? d("datePicker.monthYearFormat") : F,
|
|
112
|
+
disabled: f,
|
|
113
|
+
"data-form-control": "input",
|
|
114
|
+
className: te(
|
|
115
|
+
"cursor-pointer",
|
|
116
|
+
W ? "text-destructive" : N ? "text-content-placeholder" : "",
|
|
117
|
+
j
|
|
118
|
+
),
|
|
119
|
+
suffix: /* @__PURE__ */ k("div", { className: "flex items-center gap-1", children: [
|
|
120
|
+
e && !f && /* @__PURE__ */ k(E, { children: [
|
|
121
|
+
/* @__PURE__ */ s(b, { asChild: !0, children: /* @__PURE__ */ s(
|
|
122
|
+
"button",
|
|
123
|
+
{
|
|
124
|
+
type: "button",
|
|
125
|
+
tabIndex: 0,
|
|
126
|
+
"aria-label": d("calendar.clear"),
|
|
127
|
+
onClick: (t) => {
|
|
128
|
+
t.stopPropagation(), A();
|
|
129
|
+
},
|
|
130
|
+
className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
131
|
+
children: /* @__PURE__ */ s(_, { className: "size-3 hover:text-content" })
|
|
132
|
+
}
|
|
133
|
+
) }),
|
|
134
|
+
/* @__PURE__ */ s(V, { variant: "tertiary", side: "top", children: d("calendar.clear") })
|
|
135
|
+
] }),
|
|
136
|
+
/* @__PURE__ */ k(E, { children: [
|
|
137
|
+
/* @__PURE__ */ s(b, { asChild: !0, children: /* @__PURE__ */ s(ee, { className: "h-4 w-4 text-secondary-foreground" }) }),
|
|
138
|
+
/* @__PURE__ */ s(V, { variant: "tertiary", side: "top", children: d("datePicker.selectMonth") })
|
|
139
|
+
] })
|
|
140
|
+
] }),
|
|
141
|
+
...K
|
|
142
|
+
}
|
|
143
|
+
)
|
|
108
144
|
}
|
|
109
|
-
) })
|
|
110
|
-
/* @__PURE__ */
|
|
111
|
-
|
|
145
|
+
) }),
|
|
146
|
+
/* @__PURE__ */ s(
|
|
147
|
+
me,
|
|
112
148
|
{
|
|
113
149
|
className: "w-auto p-0",
|
|
114
150
|
align: "start",
|
|
115
151
|
"aria-label": d("datePicker.selectMonth"),
|
|
116
|
-
onOpenAutoFocus: (
|
|
117
|
-
|
|
118
|
-
|
|
152
|
+
onOpenAutoFocus: (t) => {
|
|
153
|
+
g.current || t.preventDefault(), g.current = !1;
|
|
154
|
+
},
|
|
155
|
+
...L,
|
|
156
|
+
children: /* @__PURE__ */ s(
|
|
157
|
+
ue,
|
|
119
158
|
{
|
|
120
159
|
pickerType: "month",
|
|
121
160
|
monthMode: "single",
|
|
122
|
-
selectedMonths:
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
161
|
+
selectedMonths: h,
|
|
162
|
+
footerFlashKey: H,
|
|
163
|
+
footerFlashTarget: $,
|
|
164
|
+
onMonthSelect: G,
|
|
165
|
+
month: q,
|
|
166
|
+
onMonthChange: I,
|
|
167
|
+
disabled: ge(v, B),
|
|
168
|
+
startMonth: O,
|
|
169
|
+
endMonth: Y,
|
|
170
|
+
showFooter: i,
|
|
171
|
+
onApply: x,
|
|
172
|
+
onCancel: C,
|
|
173
|
+
onClear: A
|
|
133
174
|
}
|
|
134
175
|
)
|
|
135
176
|
}
|
|
@@ -137,7 +178,7 @@ const l = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, at =
|
|
|
137
178
|
] });
|
|
138
179
|
}
|
|
139
180
|
);
|
|
140
|
-
|
|
181
|
+
De.displayName = "MonthPicker";
|
|
141
182
|
export {
|
|
142
|
-
|
|
183
|
+
De as MonthPicker
|
|
143
184
|
};
|