impact-nova 2.2.3 → 2.2.5
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/expandable-list-item/expandable-list-item-attributes.d.ts +2 -1
- package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +30 -27
- package/dist/components/data/expandable-list-item/expandable-list-item-parts.d.ts +1 -1
- package/dist/components/data/expandable-list-item/expandable-list-item-parts.js +179 -118
- package/dist/components/data/expandable-list-item/expandable-list-item-preset.js +30 -29
- package/dist/components/data/expandable-list-item/expandable-list-item.types.d.ts +8 -1
- package/dist/components/data/expandable-list-item/index.d.ts +1 -1
- 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/feedback/tooltip/tab-tooltip-render.js +3 -2
- package/dist/components/flows/filter-panel/filter-panel.js +36 -35
- package/dist/components/flows/filter-strip/filter-tag-list.js +44 -44
- 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
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { jsxs as x, jsx as
|
|
1
|
+
import { jsxs as x, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import * as r from "react";
|
|
3
3
|
import { Cross as se, CalendarMonth as le } from "impact-nova-icons";
|
|
4
|
-
import { format as
|
|
4
|
+
import { format as w } from "date-fns";
|
|
5
5
|
import { cn as ce } from "../../../lib/utils.js";
|
|
6
|
-
import { usePickerDismissActionsRef as ae, usePickerFooterDismissNudge as pe, isDateInputInvalid as ue, resolveSingleValueDismissFlash as de, maskDateInput as
|
|
7
|
-
import { Input as
|
|
8
|
-
import { Popover as
|
|
9
|
-
import { Calendar as
|
|
6
|
+
import { usePickerDismissActionsRef as ae, usePickerFooterDismissNudge as pe, isDateInputInvalid as ue, resolveSingleValueDismissFlash as fe, handlePickerSurfacePointerDown as de, maskDateInput as me, parseDateInput as he, resolveDateInputOnBlur as De, resolveDateInputOnEnter as ge } from "./date-input-behavior.js";
|
|
7
|
+
import { Input as ye } from "../input/input.js";
|
|
8
|
+
import { Popover as ke, PopoverAnchor as ve, PopoverContent as Ce } from "../../feedback/popover/popover.js";
|
|
9
|
+
import { Calendar as Ie } from "../../data-display/calendar/calendar.js";
|
|
10
10
|
import { Tooltip as j, TooltipTrigger as B, TooltipContent as K } from "../../feedback/tooltip/tooltip.js";
|
|
11
|
-
import { useImpactNovaI18n as
|
|
12
|
-
import { getDateFnsLocale as
|
|
13
|
-
import { createComponent as
|
|
14
|
-
import { coerceSingleDateApply as
|
|
15
|
-
import { buildDateBoundsMatcher as
|
|
16
|
-
const
|
|
11
|
+
import { useImpactNovaI18n as Pe } from "../../../i18n/use-impact-nova-i18n.js";
|
|
12
|
+
import { getDateFnsLocale as Me } from "../../../i18n/getDateFnsLocale.js";
|
|
13
|
+
import { createComponent as xe } from "../../../lib/primitives/create-component.js";
|
|
14
|
+
import { coerceSingleDateApply as Re, coerceSingleDate as be } from "./calendar-selection-adapters.js";
|
|
15
|
+
import { buildDateBoundsMatcher as we } from "../../../lib/date-bounds-matcher.js";
|
|
16
|
+
const Ge = xe(
|
|
17
17
|
"DatePicker",
|
|
18
18
|
({
|
|
19
19
|
value: n,
|
|
20
20
|
onChange: u,
|
|
21
|
-
format:
|
|
21
|
+
format: c = "MM/dd/yyyy",
|
|
22
22
|
placeholder: z,
|
|
23
23
|
minDate: H,
|
|
24
24
|
maxDate: q,
|
|
25
25
|
startMonth: G,
|
|
26
26
|
endMonth: J,
|
|
27
|
-
showFooter:
|
|
28
|
-
weekStartsOn:
|
|
29
|
-
disabled:
|
|
27
|
+
showFooter: a = !0,
|
|
28
|
+
weekStartsOn: S,
|
|
29
|
+
disabled: l,
|
|
30
30
|
className: Q,
|
|
31
31
|
...U
|
|
32
32
|
}, W) => {
|
|
33
|
-
const { locale: T, t:
|
|
34
|
-
r.useImperativeHandle(W, () =>
|
|
35
|
-
const [
|
|
33
|
+
const { locale: T, t: h } = Pe(), f = r.useMemo(() => Me(T), [T]), X = z ?? h("datePicker.selectDate"), g = r.useRef(null), A = r.useRef(null), I = r.useRef(null);
|
|
34
|
+
r.useImperativeHandle(W, () => g.current);
|
|
35
|
+
const [i, E] = r.useState(!1), N = ae(), { footerFlashKey: Y, footerFlashTarget: Z, popoverHandlers: _ } = pe(a, i, N, A), y = r.useRef(!1), [R, s] = r.useState(null), k = n ? w(n, c, { locale: f }) : "", d = R?.input ?? k, P = i ? R?.pending ?? n : n, $ = R?.viewMonth ?? n ?? /* @__PURE__ */ new Date(), p = r.useCallback(() => {
|
|
36
36
|
s(null), E(!1);
|
|
37
|
-
}, []),
|
|
38
|
-
if (!
|
|
37
|
+
}, []), m = (e) => {
|
|
38
|
+
if (!l) {
|
|
39
39
|
if (e) {
|
|
40
40
|
s({
|
|
41
|
-
input:
|
|
41
|
+
input: k,
|
|
42
42
|
pending: n,
|
|
43
43
|
viewMonth: n ?? /* @__PURE__ */ new Date()
|
|
44
44
|
}), E(!0);
|
|
@@ -48,54 +48,54 @@ const qe = Me(
|
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
r.useEffect(() => {
|
|
51
|
-
|
|
52
|
-
}, [
|
|
51
|
+
g.current && I.current !== null && (g.current.setSelectionRange(I.current, I.current), I.current = null);
|
|
52
|
+
}, [d]);
|
|
53
53
|
const F = (e) => {
|
|
54
|
-
const t =
|
|
54
|
+
const t = be(e), D = t ? w(t, c, { locale: f }) : "";
|
|
55
55
|
s(
|
|
56
56
|
(v) => v ? { ...v, pending: t, input: D, viewMonth: t ?? v.viewMonth } : null
|
|
57
|
-
), t && !
|
|
58
|
-
},
|
|
59
|
-
const t =
|
|
57
|
+
), t && !a && (u?.(t), p());
|
|
58
|
+
}, O = (e) => {
|
|
59
|
+
const t = Re(e, P);
|
|
60
60
|
u?.(t), p();
|
|
61
61
|
}, b = () => {
|
|
62
62
|
p();
|
|
63
|
-
},
|
|
64
|
-
u?.(void 0),
|
|
63
|
+
}, V = () => {
|
|
64
|
+
u?.(void 0), a ? s(
|
|
65
65
|
(e) => e ? { ...e, pending: void 0, input: "" } : null
|
|
66
66
|
) : p();
|
|
67
67
|
}, M = r.useCallback(
|
|
68
68
|
() => ({
|
|
69
|
-
input:
|
|
69
|
+
input: k,
|
|
70
70
|
pending: n,
|
|
71
71
|
viewMonth: n ?? /* @__PURE__ */ new Date()
|
|
72
72
|
}),
|
|
73
|
-
[
|
|
73
|
+
[k, n]
|
|
74
74
|
), ee = (e) => {
|
|
75
|
-
const t =
|
|
76
|
-
if (s((
|
|
77
|
-
s((
|
|
75
|
+
const t = me(e.target.value, c, d);
|
|
76
|
+
if (s((C) => ({ ...C ?? M(), input: t })), t === "") {
|
|
77
|
+
s((C) => ({ ...C ?? M(), input: "", pending: void 0 })), a || u?.(void 0);
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
|
-
const { parsed: D, isValid: v } =
|
|
81
|
-
v && D && (s((
|
|
82
|
-
...
|
|
80
|
+
const { parsed: D, isValid: v } = he(t, c, f);
|
|
81
|
+
v && D && (s((C) => ({
|
|
82
|
+
...C ?? M(),
|
|
83
83
|
input: t,
|
|
84
84
|
pending: D,
|
|
85
85
|
viewMonth: D
|
|
86
|
-
})),
|
|
86
|
+
})), a || u?.(D));
|
|
87
87
|
}, te = r.useCallback(
|
|
88
88
|
(e) => {
|
|
89
89
|
u?.(e), p();
|
|
90
90
|
},
|
|
91
91
|
[u, p]
|
|
92
92
|
), ne = () => {
|
|
93
|
-
if (
|
|
94
|
-
const e =
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
93
|
+
if (i) return;
|
|
94
|
+
const e = De(
|
|
95
|
+
d,
|
|
96
|
+
c,
|
|
97
|
+
k,
|
|
98
|
+
f
|
|
99
99
|
);
|
|
100
100
|
if (e.resetToCommitted) {
|
|
101
101
|
s(null);
|
|
@@ -107,23 +107,23 @@ const qe = Me(
|
|
|
107
107
|
input: e.display,
|
|
108
108
|
pending: e.parsed,
|
|
109
109
|
viewMonth: e.parsed
|
|
110
|
-
})),
|
|
110
|
+
})), a || (u?.(e.parsed), s(null));
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
113
|
s(null);
|
|
114
114
|
}, re = () => {
|
|
115
|
-
if (
|
|
116
|
-
|
|
115
|
+
if (i && a) {
|
|
116
|
+
O();
|
|
117
117
|
return;
|
|
118
118
|
}
|
|
119
|
-
const e =
|
|
119
|
+
const e = ge(d, c, f);
|
|
120
120
|
if (e.parsed) {
|
|
121
|
-
|
|
121
|
+
a && te(e.parsed);
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
|
-
|
|
125
|
-
},
|
|
126
|
-
() =>
|
|
124
|
+
i || (y.current = !0, m(!0));
|
|
125
|
+
}, L = (n ? w(n, c, { locale: f }) : "") !== d, oe = ue(d, c, f), ie = r.useCallback(
|
|
126
|
+
() => fe(
|
|
127
127
|
P,
|
|
128
128
|
n,
|
|
129
129
|
(e, t) => e.getTime() === t.getTime()
|
|
@@ -133,59 +133,65 @@ const qe = Me(
|
|
|
133
133
|
return r.useLayoutEffect(() => {
|
|
134
134
|
N.current = {
|
|
135
135
|
onDismiss: b,
|
|
136
|
-
resolveFlash:
|
|
136
|
+
resolveFlash: ie
|
|
137
137
|
};
|
|
138
|
-
}), /* @__PURE__ */ x(
|
|
139
|
-
/* @__PURE__ */
|
|
138
|
+
}), /* @__PURE__ */ x(ke, { open: l ? !1 : i, onOpenChange: m, children: [
|
|
139
|
+
/* @__PURE__ */ o(ve, { asChild: !0, children: /* @__PURE__ */ o(
|
|
140
140
|
"div",
|
|
141
141
|
{
|
|
142
142
|
ref: A,
|
|
143
143
|
"data-component": "date-picker",
|
|
144
|
-
"data-state":
|
|
145
|
-
"data-pending":
|
|
146
|
-
|
|
147
|
-
|
|
144
|
+
"data-state": i ? "open" : "closed",
|
|
145
|
+
"data-pending": L || void 0,
|
|
146
|
+
onPointerDown: (e) => de({
|
|
147
|
+
disabled: l,
|
|
148
|
+
event: e,
|
|
149
|
+
onOpen: () => m(!0),
|
|
150
|
+
focusField: () => g.current?.focus()
|
|
151
|
+
}),
|
|
152
|
+
children: /* @__PURE__ */ o(
|
|
153
|
+
ye,
|
|
148
154
|
{
|
|
149
|
-
ref:
|
|
150
|
-
value:
|
|
155
|
+
ref: g,
|
|
156
|
+
value: d,
|
|
151
157
|
onChange: ee,
|
|
152
158
|
onBlur: ne,
|
|
153
|
-
onClick: () => !
|
|
159
|
+
onClick: () => !l && m(!0),
|
|
154
160
|
onKeyDown: (e) => {
|
|
155
|
-
e.key === "Enter" && !
|
|
161
|
+
e.key === "Enter" && !l && (e.preventDefault(), re()), e.key === "ArrowDown" && !i && !l && (e.preventDefault(), y.current = !0, m(!0)), e.key === "Escape" && i && (e.preventDefault(), b());
|
|
156
162
|
},
|
|
157
|
-
placeholder:
|
|
158
|
-
disabled:
|
|
163
|
+
placeholder: i ? c : X,
|
|
164
|
+
disabled: l,
|
|
159
165
|
"data-form-control": "input",
|
|
160
166
|
className: ce(
|
|
161
167
|
"cursor-pointer",
|
|
162
|
-
|
|
168
|
+
oe ? "text-destructive" : L ? "text-content-placeholder" : "",
|
|
163
169
|
Q
|
|
164
170
|
),
|
|
165
171
|
suffix: /* @__PURE__ */ x("div", { className: "flex items-center gap-1", children: [
|
|
166
|
-
n && !
|
|
167
|
-
/* @__PURE__ */
|
|
172
|
+
n && !l && /* @__PURE__ */ x(j, { children: [
|
|
173
|
+
/* @__PURE__ */ o(B, { asChild: !0, children: /* @__PURE__ */ o(
|
|
168
174
|
"button",
|
|
169
175
|
{
|
|
170
176
|
type: "button",
|
|
171
177
|
tabIndex: 0,
|
|
172
|
-
"aria-label":
|
|
178
|
+
"aria-label": h("calendar.clear"),
|
|
173
179
|
onClick: (e) => {
|
|
174
|
-
e.stopPropagation(),
|
|
180
|
+
e.stopPropagation(), V();
|
|
175
181
|
},
|
|
176
182
|
className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
177
|
-
children: /* @__PURE__ */
|
|
183
|
+
children: /* @__PURE__ */ o(se, { className: "size-3 hover:text-content" })
|
|
178
184
|
}
|
|
179
185
|
) }),
|
|
180
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ o(K, { variant: "tertiary", side: "top", children: h("calendar.clear") })
|
|
181
187
|
] }),
|
|
182
188
|
/* @__PURE__ */ x(j, { children: [
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
-
e.stopPropagation(),
|
|
189
|
+
/* @__PURE__ */ o(B, { asChild: !0, children: /* @__PURE__ */ o("button", { type: "button", tabIndex: 0, "aria-label": h("datePicker.selectDate"), onClick: (e) => {
|
|
190
|
+
e.stopPropagation(), l || (i ? p() : m(!0));
|
|
185
191
|
}, onKeyDown: (e) => {
|
|
186
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(),
|
|
187
|
-
}, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */
|
|
188
|
-
/* @__PURE__ */
|
|
192
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), l || (y.current = !0, i ? p() : m(!0)));
|
|
193
|
+
}, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ o(le, { className: "h-4 w-4 text-secondary-foreground" }) }) }),
|
|
194
|
+
/* @__PURE__ */ o(K, { variant: "tertiary", side: "top", children: h("datePicker.selectDate") })
|
|
189
195
|
] })
|
|
190
196
|
] }),
|
|
191
197
|
...U
|
|
@@ -193,18 +199,18 @@ const qe = Me(
|
|
|
193
199
|
)
|
|
194
200
|
}
|
|
195
201
|
) }),
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
-
|
|
202
|
+
/* @__PURE__ */ o(
|
|
203
|
+
Ce,
|
|
198
204
|
{
|
|
199
205
|
className: "w-auto p-0",
|
|
200
206
|
align: "start",
|
|
201
|
-
"aria-label":
|
|
207
|
+
"aria-label": h("datePicker.selectDate"),
|
|
202
208
|
onOpenAutoFocus: (e) => {
|
|
203
|
-
|
|
209
|
+
y.current || e.preventDefault(), y.current = !1;
|
|
204
210
|
},
|
|
205
211
|
..._,
|
|
206
|
-
children: /* @__PURE__ */
|
|
207
|
-
|
|
212
|
+
children: /* @__PURE__ */ o(
|
|
213
|
+
Ie,
|
|
208
214
|
{
|
|
209
215
|
mode: "single",
|
|
210
216
|
selected: P,
|
|
@@ -215,15 +221,15 @@ const qe = Me(
|
|
|
215
221
|
onMonthChange: (e) => s(
|
|
216
222
|
(t) => t ? { ...t, viewMonth: e } : null
|
|
217
223
|
),
|
|
218
|
-
disabled:
|
|
224
|
+
disabled: we(H, q),
|
|
219
225
|
startMonth: G,
|
|
220
226
|
endMonth: J,
|
|
221
|
-
showFooter:
|
|
222
|
-
onApply:
|
|
227
|
+
showFooter: a,
|
|
228
|
+
onApply: O,
|
|
223
229
|
onCancel: b,
|
|
224
|
-
onClear:
|
|
230
|
+
onClear: V,
|
|
225
231
|
captionLayout: "dropdown",
|
|
226
|
-
...
|
|
232
|
+
...S !== void 0 ? { weekStartsOn: S } : {}
|
|
227
233
|
}
|
|
228
234
|
)
|
|
229
235
|
}
|
|
@@ -232,5 +238,5 @@ const qe = Me(
|
|
|
232
238
|
}
|
|
233
239
|
);
|
|
234
240
|
export {
|
|
235
|
-
|
|
241
|
+
Ge as DatePicker
|
|
236
242
|
};
|