impact-nova 2.2.3 → 2.2.4
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/ag-grid-react/headers/custom-header.js +133 -110
- package/dist/components/data/ag-grid-react/headers/header-search-input.js +23 -23
- package/dist/components/data/ag-grid-react/index.js +202 -206
- package/dist/components/data/data-table/build-column-tree-from-grid.js +65 -67
- package/dist/components/data/data-table/data-table-column-list-sync.js +5 -10
- package/dist/components/data/data-table/data-table-column-list.js +64 -61
- package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +29 -0
- package/dist/components/data/data-table/data-table-column-tree-cache.js +117 -0
- package/dist/components/data/data-table/data-table-constants.d.ts +2 -0
- package/dist/components/data/data-table/data-table-constants.js +3 -2
- package/dist/components/data/data-table/data-table-sheet.js +46 -49
- package/dist/components/data/data-table/data-table.js +137 -119
- package/dist/components/data/data-table/index.js +24 -23
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.d.ts +3 -0
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.js +24 -0
- package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +2 -1
- package/dist/components/data/data-table/use-data-table-column-list-sync.js +249 -150
- package/dist/components/data/nested-list/components/NestedListContent.js +158 -96
- package/dist/components/data/nested-list/nested-list-constants.d.ts +4 -0
- package/dist/components/data/nested-list/nested-list-constants.js +6 -0
- package/dist/components/data/nested-list/nested-list-tree-utils.d.ts +3 -0
- package/dist/components/data/nested-list/nested-list-tree-utils.js +24 -0
- package/dist/components/data/nested-list/nested-list.js +214 -215
- package/dist/components/data-display/card/card.js +6 -5
- package/dist/components/feedback/dialog/dialog.js +7 -5
- package/dist/components/feedback/sheet/sheet.js +28 -27
- package/dist/components/flows/filter-panel/filter-panel.js +36 -35
- package/dist/components/flows/filter-strip/filter-tag-list.js +33 -33
- package/dist/components/forms/combobox/combobox.js +110 -100
- package/dist/components/forms/date-picker/date-input-behavior.d.ts +9 -0
- package/dist/components/forms/date-picker/date-input-behavior.js +32 -19
- package/dist/components/forms/date-picker/date-picker.js +96 -90
- package/dist/components/forms/date-picker/date-range-picker.js +160 -152
- package/dist/components/forms/date-picker/month-picker.js +71 -65
- package/dist/components/forms/date-picker/month-range-picker.js +153 -145
- package/dist/components/forms/date-picker/multi-date-picker.js +127 -99
- package/dist/components/forms/date-picker/multi-month-picker.js +109 -97
- package/dist/components/forms/date-picker/multi-week-picker.js +98 -86
- package/dist/components/forms/date-picker/week-picker.js +82 -76
- package/dist/components/forms/date-picker/week-range-picker.js +127 -119
- package/dist/impact-nova-base.scss +10 -5
- package/dist/impact-nova-components.css +9 -5
- package/dist/impact-nova.css +1 -1
- package/dist/index.js +189 -188
- package/dist/lib/overlay/overlay-portal-context.d.ts +11 -2
- package/dist/lib/overlay/overlay-portal-context.js +39 -28
- package/dist/lib/primitives/create-compound.d.ts +5 -0
- package/dist/lib/primitives/create-compound.js +17 -16
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +1 -1
|
@@ -2,86 +2,86 @@ import { jsxs as k, jsx as s } from "react/jsx-runtime";
|
|
|
2
2
|
import * as o from "react";
|
|
3
3
|
import { Cross as _, CalendarMonth as ee } from "impact-nova-icons";
|
|
4
4
|
import { cn as te } from "../../../lib/utils.js";
|
|
5
|
-
import { usePickerDismissActionsRef as ne, usePickerFooterDismissNudge as re, isDateInputInvalid as oe, resolveSingleValueDismissFlash as se, compareMonthSelection as ie,
|
|
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
|
|
5
|
+
import { usePickerDismissActionsRef as ne, usePickerFooterDismissNudge as re, isDateInputInvalid as oe, resolveSingleValueDismissFlash as se, compareMonthSelection as ie, handlePickerSurfacePointerDown as ae, resolveDateInputOnBlur as ce, maskDateInput as le, parseDateInput as pe, resolveDateInputOnEnter as fe } from "./date-input-behavior.js";
|
|
6
|
+
import { Input as de } from "../input/input.js";
|
|
7
|
+
import { Popover as ue, PopoverAnchor as me, PopoverContent as he } from "../../feedback/popover/popover.js";
|
|
8
|
+
import { Calendar as ye } from "../../data-display/calendar/calendar.js";
|
|
9
|
+
import { Tooltip as w, TooltipTrigger as E, TooltipContent as V } from "../../feedback/tooltip/tooltip.js";
|
|
10
|
+
import { useImpactNovaI18n as Me } from "../../../i18n/use-impact-nova-i18n.js";
|
|
11
|
+
import { coerceSingleMonthApply as De, coerceSingleMonth as ge } from "./calendar-selection-adapters.js";
|
|
12
|
+
import { buildDateBoundsMatcher as ke } from "../../../lib/date-bounds-matcher.js";
|
|
13
|
+
const m = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, Ie = o.forwardRef(
|
|
14
14
|
({
|
|
15
15
|
value: t,
|
|
16
16
|
onChange: p,
|
|
17
17
|
placeholder: v,
|
|
18
|
-
minDate:
|
|
19
|
-
maxDate:
|
|
20
|
-
startMonth:
|
|
21
|
-
endMonth:
|
|
18
|
+
minDate: b,
|
|
19
|
+
maxDate: O,
|
|
20
|
+
startMonth: B,
|
|
21
|
+
endMonth: F,
|
|
22
22
|
showFooter: i = !0,
|
|
23
23
|
disabled: f,
|
|
24
|
-
className:
|
|
25
|
-
...
|
|
24
|
+
className: Y,
|
|
25
|
+
...j
|
|
26
26
|
}, K) => {
|
|
27
|
-
const { t: d } =
|
|
28
|
-
o.useImperativeHandle(K, () =>
|
|
29
|
-
const [r,
|
|
27
|
+
const { t: d } = Me(), z = v ?? d("datePicker.selectMonth"), I = o.useRef(null), C = o.useRef(null);
|
|
28
|
+
o.useImperativeHandle(K, () => I.current);
|
|
29
|
+
const [r, a] = o.useState(!1), R = ne(), { footerFlashKey: H, footerFlashTarget: $, popoverHandlers: L } = re(i, r, R, C), [y, c] = o.useState(t), [u, l] = o.useState(t ? m(t) : ""), [q, P] = o.useState(t ? new Date(t.year, t.month) : /* @__PURE__ */ new Date());
|
|
30
30
|
o.useEffect(() => {
|
|
31
|
-
r || (l(t ?
|
|
31
|
+
r || (l(t ? m(t) : ""), c(t));
|
|
32
32
|
}, [r, t]), o.useEffect(() => {
|
|
33
|
-
r && (
|
|
33
|
+
r && (c(t), P(t ? new Date(t.year, t.month) : /* @__PURE__ */ new Date()), l(t ? m(t) : ""));
|
|
34
34
|
}, [r, t]);
|
|
35
35
|
const G = (e) => {
|
|
36
36
|
const n = ge(e);
|
|
37
|
-
|
|
37
|
+
c(n), n && l(m(n)), i || (p?.(n), a(!1));
|
|
38
38
|
}, x = (e) => {
|
|
39
|
-
const n =
|
|
40
|
-
p?.(n),
|
|
39
|
+
const n = De(e, y);
|
|
40
|
+
p?.(n), a(!1);
|
|
41
41
|
}, S = () => {
|
|
42
|
-
|
|
42
|
+
c(t), l(t ? m(t) : ""), a(!1);
|
|
43
43
|
}, A = () => {
|
|
44
|
-
|
|
45
|
-
}, h = "MM/yyyy", M = t ?
|
|
46
|
-
const n =
|
|
44
|
+
c(void 0), l(""), p?.(void 0), i || a(!1);
|
|
45
|
+
}, h = "MM/yyyy", M = t ? m(t) : "", D = o.useRef(!1), J = (e) => {
|
|
46
|
+
const n = le(e.target.value, h, u);
|
|
47
47
|
if (l(n), n === "") {
|
|
48
|
-
|
|
48
|
+
c(void 0), i || p?.(void 0);
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
const { parsed:
|
|
52
|
-
if (Z &&
|
|
53
|
-
const T = { month:
|
|
54
|
-
|
|
51
|
+
const { parsed: g, isValid: Z } = pe(n, h);
|
|
52
|
+
if (Z && g) {
|
|
53
|
+
const T = { month: g.getMonth(), year: g.getFullYear() };
|
|
54
|
+
c(T), P(g), i || p?.(T);
|
|
55
55
|
}
|
|
56
56
|
}, Q = () => {
|
|
57
57
|
if (r) return;
|
|
58
|
-
const e =
|
|
58
|
+
const e = ce(u, h, M);
|
|
59
59
|
if (e.resetToCommitted) {
|
|
60
|
-
l(M),
|
|
60
|
+
l(M), c(t);
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
63
|
if (e.parsed) {
|
|
64
64
|
const n = { month: e.parsed.getMonth(), year: e.parsed.getFullYear() };
|
|
65
|
-
l(e.display),
|
|
65
|
+
l(e.display), c(n), i || p?.(n);
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
|
-
l(M),
|
|
68
|
+
l(M), c(t);
|
|
69
69
|
}, U = () => {
|
|
70
70
|
if (r && i) {
|
|
71
71
|
x();
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
|
-
const e =
|
|
74
|
+
const e = fe(u, h);
|
|
75
75
|
if (e.parsed) {
|
|
76
76
|
const n = {
|
|
77
77
|
month: e.parsed.getMonth(),
|
|
78
78
|
year: e.parsed.getFullYear()
|
|
79
79
|
};
|
|
80
|
-
i && (p?.(n),
|
|
80
|
+
i && (p?.(n), a(!1));
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
|
-
r || (
|
|
84
|
-
}, N = M !==
|
|
83
|
+
r || (D.current = !0, a(!0));
|
|
84
|
+
}, N = M !== u, W = oe(u, h), X = o.useCallback(
|
|
85
85
|
() => se(
|
|
86
86
|
y,
|
|
87
87
|
t,
|
|
@@ -94,26 +94,32 @@ const u = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, ke =
|
|
|
94
94
|
onDismiss: S,
|
|
95
95
|
resolveFlash: X
|
|
96
96
|
};
|
|
97
|
-
}), /* @__PURE__ */ k(
|
|
98
|
-
f || !e && i ||
|
|
97
|
+
}), /* @__PURE__ */ k(ue, { open: f ? !1 : r, onOpenChange: (e) => {
|
|
98
|
+
f || !e && i || a(e);
|
|
99
99
|
}, children: [
|
|
100
100
|
/* @__PURE__ */ s(me, { asChild: !0, children: /* @__PURE__ */ s(
|
|
101
101
|
"div",
|
|
102
102
|
{
|
|
103
|
-
ref:
|
|
103
|
+
ref: C,
|
|
104
104
|
"data-component": "month-picker",
|
|
105
105
|
"data-state": r ? "open" : "closed",
|
|
106
106
|
"data-pending": N || void 0,
|
|
107
|
+
onPointerDown: (e) => ae({
|
|
108
|
+
disabled: f,
|
|
109
|
+
event: e,
|
|
110
|
+
onOpen: () => a(!0),
|
|
111
|
+
focusField: () => I.current?.focus()
|
|
112
|
+
}),
|
|
107
113
|
children: /* @__PURE__ */ s(
|
|
108
|
-
|
|
114
|
+
de,
|
|
109
115
|
{
|
|
110
|
-
ref:
|
|
111
|
-
value:
|
|
116
|
+
ref: I,
|
|
117
|
+
value: u,
|
|
112
118
|
onChange: J,
|
|
113
119
|
onBlur: Q,
|
|
114
|
-
onClick: () => !f &&
|
|
120
|
+
onClick: () => !f && a(!0),
|
|
115
121
|
onKeyDown: (e) => {
|
|
116
|
-
e.key === "Enter" && !f && (e.preventDefault(), U()), e.key === "ArrowDown" && !r && !f && (e.preventDefault(),
|
|
122
|
+
e.key === "Enter" && !f && (e.preventDefault(), U()), e.key === "ArrowDown" && !r && !f && (e.preventDefault(), D.current = !0, a(!0)), e.key === "Escape" && r && (e.preventDefault(), S());
|
|
117
123
|
},
|
|
118
124
|
placeholder: r ? d("datePicker.monthYearFormat") : z,
|
|
119
125
|
disabled: f,
|
|
@@ -121,11 +127,11 @@ const u = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, ke =
|
|
|
121
127
|
className: te(
|
|
122
128
|
"cursor-pointer",
|
|
123
129
|
W ? "text-destructive" : N ? "text-content-placeholder" : "",
|
|
124
|
-
|
|
130
|
+
Y
|
|
125
131
|
),
|
|
126
132
|
suffix: /* @__PURE__ */ k("div", { className: "flex items-center gap-1", children: [
|
|
127
|
-
t && !f && /* @__PURE__ */ k(
|
|
128
|
-
/* @__PURE__ */ s(
|
|
133
|
+
t && !f && /* @__PURE__ */ k(w, { children: [
|
|
134
|
+
/* @__PURE__ */ s(E, { asChild: !0, children: /* @__PURE__ */ s(
|
|
129
135
|
"button",
|
|
130
136
|
{
|
|
131
137
|
type: "button",
|
|
@@ -138,30 +144,30 @@ const u = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, ke =
|
|
|
138
144
|
children: /* @__PURE__ */ s(_, { className: "size-3 hover:text-content" })
|
|
139
145
|
}
|
|
140
146
|
) }),
|
|
141
|
-
/* @__PURE__ */ s(
|
|
147
|
+
/* @__PURE__ */ s(V, { variant: "tertiary", side: "top", children: d("calendar.clear") })
|
|
142
148
|
] }),
|
|
143
|
-
/* @__PURE__ */ k(
|
|
144
|
-
/* @__PURE__ */ s(
|
|
145
|
-
/* @__PURE__ */ s(
|
|
149
|
+
/* @__PURE__ */ k(w, { children: [
|
|
150
|
+
/* @__PURE__ */ s(E, { asChild: !0, children: /* @__PURE__ */ s(ee, { className: "h-4 w-4 text-secondary-foreground" }) }),
|
|
151
|
+
/* @__PURE__ */ s(V, { variant: "tertiary", side: "top", children: d("datePicker.selectMonth") })
|
|
146
152
|
] })
|
|
147
153
|
] }),
|
|
148
|
-
...
|
|
154
|
+
...j
|
|
149
155
|
}
|
|
150
156
|
)
|
|
151
157
|
}
|
|
152
158
|
) }),
|
|
153
159
|
/* @__PURE__ */ s(
|
|
154
|
-
|
|
160
|
+
he,
|
|
155
161
|
{
|
|
156
162
|
className: "w-auto p-0",
|
|
157
163
|
align: "start",
|
|
158
164
|
"aria-label": d("datePicker.selectMonth"),
|
|
159
165
|
onOpenAutoFocus: (e) => {
|
|
160
|
-
|
|
166
|
+
D.current || e.preventDefault(), D.current = !1;
|
|
161
167
|
},
|
|
162
168
|
...L,
|
|
163
169
|
children: /* @__PURE__ */ s(
|
|
164
|
-
|
|
170
|
+
ye,
|
|
165
171
|
{
|
|
166
172
|
pickerType: "month",
|
|
167
173
|
monthMode: "single",
|
|
@@ -170,10 +176,10 @@ const u = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, ke =
|
|
|
170
176
|
footerFlashTarget: $,
|
|
171
177
|
onMonthSelect: G,
|
|
172
178
|
month: q,
|
|
173
|
-
onMonthChange:
|
|
174
|
-
disabled:
|
|
175
|
-
startMonth:
|
|
176
|
-
endMonth:
|
|
179
|
+
onMonthChange: P,
|
|
180
|
+
disabled: ke(b, O),
|
|
181
|
+
startMonth: B,
|
|
182
|
+
endMonth: F,
|
|
177
183
|
showFooter: i,
|
|
178
184
|
onApply: x,
|
|
179
185
|
onCancel: S,
|
|
@@ -185,7 +191,7 @@ const u = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, ke =
|
|
|
185
191
|
] });
|
|
186
192
|
}
|
|
187
193
|
);
|
|
188
|
-
|
|
194
|
+
Ie.displayName = "MonthPicker";
|
|
189
195
|
export {
|
|
190
|
-
|
|
196
|
+
Ie as MonthPicker
|
|
191
197
|
};
|