impact-nova 2.1.0-alpha.9 → 2.2.0
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/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/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/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 +11 -3
- 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
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { parse as g, isValid as h } from "date-fns";
|
|
2
|
+
import * as u from "react";
|
|
3
|
+
import { resolveRangeFooterFlashTarget as D } from "../../data-display/calendar/calendar-footer-emphasis.js";
|
|
4
|
+
import { padValidDateString as v, maskDate as y } from "../../../lib/utils.js";
|
|
5
|
+
function w(e, t, n) {
|
|
6
|
+
return y(e, t, n);
|
|
7
|
+
}
|
|
8
|
+
function f(e, t, n) {
|
|
9
|
+
const r = v(e, t), s = g(r, t, /* @__PURE__ */ new Date(), n ? { locale: n } : {}), i = h(s) && r.length === t.length;
|
|
10
|
+
return {
|
|
11
|
+
padded: r,
|
|
12
|
+
parsed: i ? s : void 0,
|
|
13
|
+
isComplete: e.length === t.length,
|
|
14
|
+
isValid: i
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function C(e, t, n) {
|
|
18
|
+
return !e || e.length !== t.length ? !1 : !f(e, t, n).isValid;
|
|
19
|
+
}
|
|
20
|
+
function p(e, t) {
|
|
21
|
+
const n = document.activeElement;
|
|
22
|
+
return n instanceof Node ? !!(e.current?.contains(n) || t.current?.contains(n)) : !1;
|
|
23
|
+
}
|
|
24
|
+
function T(e) {
|
|
25
|
+
return (t) => {
|
|
26
|
+
if (!e.disabled) {
|
|
27
|
+
if (t) {
|
|
28
|
+
e.setOpen(!0);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
e.showFooter || queueMicrotask(() => {
|
|
32
|
+
p(e.containerRef, e.popoverContentRef) || e.setOpen(!1);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function k(e, t) {
|
|
38
|
+
const n = e.target;
|
|
39
|
+
return n instanceof Node ? !!t.current?.contains(n) : !1;
|
|
40
|
+
}
|
|
41
|
+
function O(e, t, n, r) {
|
|
42
|
+
return e ? {
|
|
43
|
+
onInteractOutside: (a) => {
|
|
44
|
+
a.preventDefault();
|
|
45
|
+
},
|
|
46
|
+
onPointerDownOutside: (a) => {
|
|
47
|
+
a.preventDefault(), !(r && k(a, r)) && t && n && n(t.current.resolveFlash());
|
|
48
|
+
},
|
|
49
|
+
onEscapeKeyDown: t ? (a) => {
|
|
50
|
+
a.preventDefault(), t.current.onDismiss();
|
|
51
|
+
} : void 0
|
|
52
|
+
} : {};
|
|
53
|
+
}
|
|
54
|
+
function E(e) {
|
|
55
|
+
const {
|
|
56
|
+
startInput: t,
|
|
57
|
+
endInput: n,
|
|
58
|
+
committedStart: r,
|
|
59
|
+
committedEnd: s,
|
|
60
|
+
committedRange: i,
|
|
61
|
+
computeEffectiveRange: a,
|
|
62
|
+
rangesEqual: o
|
|
63
|
+
} = e, c = a(), d = D(c), l = t !== r || n !== s, m = !o(c, i);
|
|
64
|
+
return d === "apply" && (l || m) ? "apply" : "cancel";
|
|
65
|
+
}
|
|
66
|
+
function S() {
|
|
67
|
+
return u.useRef({
|
|
68
|
+
onDismiss: () => {
|
|
69
|
+
},
|
|
70
|
+
resolveFlash: () => "cancel"
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
function V(e, t, n, r) {
|
|
74
|
+
const [s, i] = u.useState({ key: 0, target: "cancel" }), a = u.useRef(t);
|
|
75
|
+
u.useLayoutEffect(() => {
|
|
76
|
+
a.current !== t && (a.current = t, i({ key: 0, target: "cancel" }));
|
|
77
|
+
}, [t]);
|
|
78
|
+
const o = u.useCallback(
|
|
79
|
+
(d) => {
|
|
80
|
+
e && i((l) => ({ key: l.key + 1, target: d }));
|
|
81
|
+
},
|
|
82
|
+
[e]
|
|
83
|
+
), c = O(
|
|
84
|
+
e,
|
|
85
|
+
n,
|
|
86
|
+
o,
|
|
87
|
+
r
|
|
88
|
+
);
|
|
89
|
+
return {
|
|
90
|
+
footerFlashKey: s.key,
|
|
91
|
+
footerFlashTarget: s.key > 0 ? s.target : void 0,
|
|
92
|
+
triggerFooterFlash: o,
|
|
93
|
+
popoverHandlers: c
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
function B(e, t, n) {
|
|
97
|
+
queueMicrotask(() => {
|
|
98
|
+
p(e, t) || n();
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function F(e, t, n, r) {
|
|
102
|
+
if (!e)
|
|
103
|
+
return { display: "", parsed: void 0, resetToCommitted: !1 };
|
|
104
|
+
const s = f(e, t, r);
|
|
105
|
+
return s.isValid ? {
|
|
106
|
+
display: s.padded,
|
|
107
|
+
parsed: s.parsed,
|
|
108
|
+
resetToCommitted: !1
|
|
109
|
+
} : e.length < t.length ? { display: e, parsed: void 0, resetToCommitted: !1 } : { display: n, parsed: void 0, resetToCommitted: !0 };
|
|
110
|
+
}
|
|
111
|
+
function q(e, t, n, r) {
|
|
112
|
+
const s = F(e, t, n, r);
|
|
113
|
+
return {
|
|
114
|
+
...s,
|
|
115
|
+
isPartial: !!e && e.length < t.length && !s.resetToCommitted
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
function b(e, t, n) {
|
|
119
|
+
const r = f(e, t, n);
|
|
120
|
+
return r.isValid && r.parsed ? { parsed: r.parsed, shouldOpenPopover: !1 } : { parsed: void 0, shouldOpenPopover: !0 };
|
|
121
|
+
}
|
|
122
|
+
function M(e, t, n) {
|
|
123
|
+
return e === void 0 || t === void 0 ? { from: e, to: t, swapped: !1 } : n(e, t) <= 0 ? { from: e, to: t, swapped: !1 } : { from: t, to: e, swapped: !0 };
|
|
124
|
+
}
|
|
125
|
+
function X(e, t) {
|
|
126
|
+
return e.year * 12 + e.month - (t.year * 12 + t.month);
|
|
127
|
+
}
|
|
128
|
+
function x(e, t) {
|
|
129
|
+
return e.getTime() - t.getTime();
|
|
130
|
+
}
|
|
131
|
+
function N(e) {
|
|
132
|
+
if (!e || typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches)
|
|
133
|
+
return;
|
|
134
|
+
const t = e.querySelector('[data-field="start"]'), n = e.querySelector('[data-field="end"]');
|
|
135
|
+
if (!t || !n) return;
|
|
136
|
+
const r = { duration: 280, easing: "ease-out", fill: "none" };
|
|
137
|
+
typeof t.animate != "function" || typeof n.animate != "function" || (t.animate(
|
|
138
|
+
[{ transform: "translateX(3px)" }, { transform: "translateX(0)" }],
|
|
139
|
+
r
|
|
140
|
+
), n.animate(
|
|
141
|
+
[{ transform: "translateX(-3px)" }, { transform: "translateX(0)" }],
|
|
142
|
+
r
|
|
143
|
+
));
|
|
144
|
+
}
|
|
145
|
+
export {
|
|
146
|
+
x as compareDates,
|
|
147
|
+
X as compareMonthSelection,
|
|
148
|
+
T as createRangePickerOpenChangeHandler,
|
|
149
|
+
B as deferRangeInputBlur,
|
|
150
|
+
N as flashRangeReorder,
|
|
151
|
+
C as isDateInputInvalid,
|
|
152
|
+
k as isEventOnPickerSurface,
|
|
153
|
+
p as isFocusInsidePicker,
|
|
154
|
+
w as maskDateInput,
|
|
155
|
+
M as normalizeOrderedRange,
|
|
156
|
+
f as parseDateInput,
|
|
157
|
+
O as preventOutsideDismissWhenFooter,
|
|
158
|
+
F as resolveDateInputOnBlur,
|
|
159
|
+
b as resolveDateInputOnEnter,
|
|
160
|
+
q as resolveRangeFieldBlur,
|
|
161
|
+
E as resolveRangePickerDismissFlash,
|
|
162
|
+
S as usePickerDismissActionsRef,
|
|
163
|
+
V as usePickerFooterDismissNudge
|
|
164
|
+
};
|
|
@@ -1,158 +1,222 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { Cross as
|
|
4
|
-
import { format as
|
|
5
|
-
import { cn as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
1
|
+
import { jsxs as x, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import * as r from "react";
|
|
3
|
+
import { Cross as se, CalendarMonth as ce } from "impact-nova-icons";
|
|
4
|
+
import { format as S } from "date-fns";
|
|
5
|
+
import { cn as le } from "../../../lib/utils.js";
|
|
6
|
+
import { usePickerDismissActionsRef as ae, usePickerFooterDismissNudge as pe, isDateInputInvalid as ue, maskDateInput as fe, parseDateInput as de, resolveDateInputOnBlur as me, resolveDateInputOnEnter as he } from "./date-input-behavior.js";
|
|
7
|
+
import { Input as De } from "../input/input.js";
|
|
8
|
+
import { Popover as ge, PopoverAnchor as ye, PopoverContent as ke } from "../../feedback/popover/popover.js";
|
|
9
|
+
import { Calendar as ve } from "../../data-display/calendar/calendar.js";
|
|
10
|
+
import { Tooltip as j, TooltipTrigger as B, TooltipContent as K } from "../../feedback/tooltip/tooltip.js";
|
|
11
|
+
import { useImpactNovaI18n as Ce } from "../../../i18n/use-impact-nova-i18n.js";
|
|
12
|
+
import { getDateFnsLocale as Ie } from "../../../i18n/getDateFnsLocale.js";
|
|
13
|
+
import { createComponent as Pe } from "../../../lib/primitives/create-component.js";
|
|
14
|
+
import { coerceSingleDateApply as Me, coerceSingleDate as xe } from "./calendar-selection-adapters.js";
|
|
15
|
+
import { buildDateBoundsMatcher as Re } from "../../../lib/date-bounds-matcher.js";
|
|
16
|
+
const He = Pe(
|
|
16
17
|
"DatePicker",
|
|
17
18
|
({
|
|
18
|
-
value:
|
|
19
|
-
onChange:
|
|
20
|
-
format:
|
|
21
|
-
placeholder:
|
|
22
|
-
minDate:
|
|
23
|
-
maxDate:
|
|
24
|
-
startMonth:
|
|
25
|
-
endMonth:
|
|
26
|
-
showFooter:
|
|
27
|
-
weekStartsOn:
|
|
28
|
-
disabled:
|
|
29
|
-
className:
|
|
30
|
-
...
|
|
31
|
-
},
|
|
32
|
-
const { locale:
|
|
33
|
-
|
|
34
|
-
const [
|
|
35
|
-
s
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
19
|
+
value: n,
|
|
20
|
+
onChange: u,
|
|
21
|
+
format: l = "MM/dd/yyyy",
|
|
22
|
+
placeholder: z,
|
|
23
|
+
minDate: H,
|
|
24
|
+
maxDate: q,
|
|
25
|
+
startMonth: G,
|
|
26
|
+
endMonth: J,
|
|
27
|
+
showFooter: c = !0,
|
|
28
|
+
weekStartsOn: T,
|
|
29
|
+
disabled: a,
|
|
30
|
+
className: Q,
|
|
31
|
+
...U
|
|
32
|
+
}, W) => {
|
|
33
|
+
const { locale: w, t: m } = Ce(), f = r.useMemo(() => Ie(w), [w]), X = z ?? m("datePicker.selectDate"), I = r.useRef(null), A = r.useRef(null), P = r.useRef(null);
|
|
34
|
+
r.useImperativeHandle(W, () => I.current);
|
|
35
|
+
const [o, E] = r.useState(!1), N = ae(), { footerFlashKey: Y, footerFlashTarget: Z, popoverHandlers: _ } = pe(c, o, N, A), g = r.useRef(!1), [R, s] = r.useState(null), y = n ? S(n, l, { locale: f }) : "", d = R?.input ?? y, k = o ? R?.pending ?? n : n, $ = R?.viewMonth ?? n ?? /* @__PURE__ */ new Date(), p = r.useCallback(() => {
|
|
36
|
+
s(null), E(!1);
|
|
37
|
+
}, []), h = (e) => {
|
|
38
|
+
if (!a) {
|
|
39
|
+
if (e) {
|
|
40
|
+
s({
|
|
41
|
+
input: y,
|
|
42
|
+
pending: n,
|
|
43
|
+
viewMonth: n ?? /* @__PURE__ */ new Date()
|
|
44
|
+
}), E(!0);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
c || p();
|
|
48
|
+
}
|
|
40
49
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}, [
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
(
|
|
48
|
-
),
|
|
49
|
-
},
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
|
|
50
|
+
r.useEffect(() => {
|
|
51
|
+
I.current && P.current !== null && (I.current.setSelectionRange(P.current, P.current), P.current = null);
|
|
52
|
+
}, [d]);
|
|
53
|
+
const F = (e) => {
|
|
54
|
+
const t = xe(e), D = t ? S(t, l, { locale: f }) : "";
|
|
55
|
+
s(
|
|
56
|
+
(v) => v ? { ...v, pending: t, input: D, viewMonth: t ?? v.viewMonth } : null
|
|
57
|
+
), t && !c && (u?.(t), p());
|
|
58
|
+
}, L = (e) => {
|
|
59
|
+
const t = Me(e, k);
|
|
60
|
+
u?.(t), p();
|
|
61
|
+
}, b = () => {
|
|
62
|
+
p();
|
|
63
|
+
}, O = () => {
|
|
64
|
+
u?.(void 0), c ? s(
|
|
56
65
|
(e) => e ? { ...e, pending: void 0, input: "" } : null
|
|
57
|
-
) :
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
) : p();
|
|
67
|
+
}, M = r.useCallback(
|
|
68
|
+
() => ({
|
|
69
|
+
input: y,
|
|
70
|
+
pending: n,
|
|
71
|
+
viewMonth: n ?? /* @__PURE__ */ new Date()
|
|
72
|
+
}),
|
|
73
|
+
[y, n]
|
|
74
|
+
), ee = (e) => {
|
|
75
|
+
const t = fe(e.target.value, l, d);
|
|
76
|
+
if (s((C) => ({ ...C ?? M(), input: t })), t === "") {
|
|
77
|
+
s((C) => ({ ...C ?? M(), input: "", pending: void 0 })), c || u?.(void 0);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const { parsed: D, isValid: v } = de(t, l, f);
|
|
81
|
+
v && D && (s((C) => ({
|
|
82
|
+
...C ?? M(),
|
|
83
|
+
input: t,
|
|
84
|
+
pending: D,
|
|
85
|
+
viewMonth: D
|
|
86
|
+
})), c || u?.(D));
|
|
87
|
+
}, te = r.useCallback(
|
|
88
|
+
(e) => {
|
|
89
|
+
u?.(e), p();
|
|
90
|
+
},
|
|
91
|
+
[u, p]
|
|
92
|
+
), ne = () => {
|
|
93
|
+
if (o) return;
|
|
94
|
+
const e = me(
|
|
95
|
+
d,
|
|
96
|
+
l,
|
|
97
|
+
y,
|
|
98
|
+
f
|
|
99
|
+
);
|
|
100
|
+
if (e.resetToCommitted) {
|
|
101
|
+
s(null);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (e.parsed) {
|
|
105
|
+
s((t) => ({
|
|
106
|
+
...t ?? M(),
|
|
107
|
+
input: e.display,
|
|
108
|
+
pending: e.parsed,
|
|
109
|
+
viewMonth: e.parsed
|
|
110
|
+
})), c || (u?.(e.parsed), s(null));
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
s(null);
|
|
114
|
+
}, re = () => {
|
|
115
|
+
if (o && c) {
|
|
116
|
+
L();
|
|
66
117
|
return;
|
|
67
118
|
}
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
119
|
+
const e = he(d, l, f);
|
|
120
|
+
if (e.parsed) {
|
|
121
|
+
c && te(e.parsed);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
o || (g.current = !0, h(!0));
|
|
125
|
+
}, V = (n ? S(n, l, { locale: f }) : "") !== d, ie = ue(d, l, f), oe = r.useCallback(() => k && (!n || k.getTime() !== n.getTime()) ? "apply" : "cancel", [k, n]);
|
|
126
|
+
return r.useLayoutEffect(() => {
|
|
127
|
+
N.current = {
|
|
128
|
+
onDismiss: b,
|
|
129
|
+
resolveFlash: oe
|
|
130
|
+
};
|
|
131
|
+
}), /* @__PURE__ */ x(ge, { open: a ? !1 : o, onOpenChange: h, children: [
|
|
132
|
+
/* @__PURE__ */ i(ye, { asChild: !0, children: /* @__PURE__ */ i(
|
|
133
|
+
"div",
|
|
82
134
|
{
|
|
83
|
-
ref:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
"
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
135
|
+
ref: A,
|
|
136
|
+
"data-component": "date-picker",
|
|
137
|
+
"data-state": o ? "open" : "closed",
|
|
138
|
+
"data-pending": V || void 0,
|
|
139
|
+
children: /* @__PURE__ */ i(
|
|
140
|
+
De,
|
|
141
|
+
{
|
|
142
|
+
ref: I,
|
|
143
|
+
value: d,
|
|
144
|
+
onChange: ee,
|
|
145
|
+
onBlur: ne,
|
|
146
|
+
onClick: () => !a && h(!0),
|
|
147
|
+
onKeyDown: (e) => {
|
|
148
|
+
e.key === "Enter" && !a && (e.preventDefault(), re()), e.key === "ArrowDown" && !o && !a && (e.preventDefault(), g.current = !0, h(!0)), e.key === "Escape" && o && (e.preventDefault(), b());
|
|
149
|
+
},
|
|
150
|
+
placeholder: o ? l : X,
|
|
151
|
+
disabled: a,
|
|
152
|
+
"data-form-control": "input",
|
|
153
|
+
className: le(
|
|
154
|
+
"cursor-pointer",
|
|
155
|
+
ie ? "text-destructive" : V ? "text-content-placeholder" : "",
|
|
156
|
+
Q
|
|
157
|
+
),
|
|
158
|
+
suffix: /* @__PURE__ */ x("div", { className: "flex items-center gap-1", children: [
|
|
159
|
+
n && !a && /* @__PURE__ */ x(j, { children: [
|
|
160
|
+
/* @__PURE__ */ i(B, { asChild: !0, children: /* @__PURE__ */ i(
|
|
161
|
+
"button",
|
|
162
|
+
{
|
|
163
|
+
type: "button",
|
|
164
|
+
tabIndex: 0,
|
|
165
|
+
"aria-label": m("calendar.clear"),
|
|
166
|
+
onClick: (e) => {
|
|
167
|
+
e.stopPropagation(), O();
|
|
168
|
+
},
|
|
169
|
+
className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
170
|
+
children: /* @__PURE__ */ i(se, { className: "size-3 hover:text-content" })
|
|
171
|
+
}
|
|
172
|
+
) }),
|
|
173
|
+
/* @__PURE__ */ i(K, { variant: "tertiary", side: "top", children: m("calendar.clear") })
|
|
174
|
+
] }),
|
|
175
|
+
/* @__PURE__ */ x(j, { children: [
|
|
176
|
+
/* @__PURE__ */ i(B, { asChild: !0, children: /* @__PURE__ */ i("button", { type: "button", tabIndex: 0, "aria-label": m("datePicker.selectDate"), onClick: (e) => {
|
|
177
|
+
e.stopPropagation(), a || (o ? p() : h(!0));
|
|
178
|
+
}, onKeyDown: (e) => {
|
|
179
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), a || (g.current = !0, o ? p() : h(!0)));
|
|
180
|
+
}, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ i(ce, { className: "h-4 w-4 text-secondary-foreground" }) }) }),
|
|
181
|
+
/* @__PURE__ */ i(K, { variant: "tertiary", side: "top", children: m("datePicker.selectDate") })
|
|
182
|
+
] })
|
|
183
|
+
] }),
|
|
184
|
+
...U
|
|
185
|
+
}
|
|
186
|
+
)
|
|
126
187
|
}
|
|
127
|
-
) })
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
-
|
|
188
|
+
) }),
|
|
189
|
+
/* @__PURE__ */ i(
|
|
190
|
+
ke,
|
|
130
191
|
{
|
|
131
192
|
className: "w-auto p-0",
|
|
132
193
|
align: "start",
|
|
133
194
|
"aria-label": m("datePicker.selectDate"),
|
|
134
195
|
onOpenAutoFocus: (e) => {
|
|
135
|
-
|
|
196
|
+
g.current || e.preventDefault(), g.current = !1;
|
|
136
197
|
},
|
|
137
|
-
|
|
138
|
-
|
|
198
|
+
..._,
|
|
199
|
+
children: /* @__PURE__ */ i(
|
|
200
|
+
ve,
|
|
139
201
|
{
|
|
140
202
|
mode: "single",
|
|
141
|
-
selected:
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
203
|
+
selected: k,
|
|
204
|
+
footerFlashKey: Y,
|
|
205
|
+
footerFlashTarget: Z,
|
|
206
|
+
onSelect: F,
|
|
207
|
+
month: $,
|
|
208
|
+
onMonthChange: (e) => s(
|
|
209
|
+
(t) => t ? { ...t, viewMonth: e } : null
|
|
146
210
|
),
|
|
147
|
-
disabled:
|
|
148
|
-
startMonth:
|
|
149
|
-
endMonth:
|
|
150
|
-
showFooter:
|
|
151
|
-
onApply:
|
|
152
|
-
onCancel:
|
|
153
|
-
onClear:
|
|
211
|
+
disabled: Re(H, q),
|
|
212
|
+
startMonth: G,
|
|
213
|
+
endMonth: J,
|
|
214
|
+
showFooter: c,
|
|
215
|
+
onApply: L,
|
|
216
|
+
onCancel: b,
|
|
217
|
+
onClear: O,
|
|
154
218
|
captionLayout: "dropdown",
|
|
155
|
-
...
|
|
219
|
+
...T !== void 0 ? { weekStartsOn: T } : {}
|
|
156
220
|
}
|
|
157
221
|
)
|
|
158
222
|
}
|
|
@@ -161,5 +225,5 @@ const Se = ue(
|
|
|
161
225
|
}
|
|
162
226
|
);
|
|
163
227
|
export {
|
|
164
|
-
|
|
228
|
+
He as DatePicker
|
|
165
229
|
};
|