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,238 +1,325 @@
|
|
|
1
|
-
import { jsx 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
|
-
|
|
1
|
+
import { jsx as u, jsxs as E } from "react/jsx-runtime";
|
|
2
|
+
import * as a from "react";
|
|
3
|
+
import { Cross as Ve, CalendarMonth as Oe } from "impact-nova-icons";
|
|
4
|
+
import { format as x } from "date-fns";
|
|
5
|
+
import { cn as O } from "../../../lib/utils.js";
|
|
6
|
+
import { usePickerDismissActionsRef as Ke, usePickerFooterDismissNudge as je, createRangePickerOpenChangeHandler as Le, parseDateInput as K, normalizeOrderedRange as qe, flashRangeReorder as ze, isDateInputInvalid as $, resolveRangeFieldBlur as N, resolveRangePickerDismissFlash as He, compareDates as j, deferRangeInputBlur as Ge, maskDateInput as F, resolveDateInputOnBlur as S } from "./date-input-behavior.js";
|
|
7
|
+
import { useFieldChrome as Je } from "../../../lib/primitives/use-field-chrome.js";
|
|
8
|
+
import { Popover as Qe, PopoverAnchor as Ue, PopoverContent as We } from "../../feedback/popover/popover.js";
|
|
9
|
+
import { Calendar as Xe } from "../../data-display/calendar/calendar.js";
|
|
10
|
+
import { Tooltip as ee, TooltipTrigger as te, TooltipContent as re } from "../../feedback/tooltip/tooltip.js";
|
|
11
|
+
import { useImpactNovaI18n as Ye } from "../../../i18n/use-impact-nova-i18n.js";
|
|
12
|
+
import { getDateFnsLocale as Ze } from "../../../i18n/getDateFnsLocale.js";
|
|
13
|
+
import { coerceDateRangeApply as _e, coerceDateRange as $e } from "./calendar-selection-adapters.js";
|
|
14
|
+
import { buildDateBoundsMatcher as Fe } from "../../../lib/date-bounds-matcher.js";
|
|
15
|
+
function et(r, c) {
|
|
16
|
+
if (!r && !c) return !0;
|
|
17
|
+
if (!r || !c) return !1;
|
|
18
|
+
const n = !r.from && !c.from || r.from && c.from && j(r.from, c.from) === 0, A = !r.to && !c.to || r.to && c.to && j(r.to, c.to) === 0;
|
|
19
|
+
return !!(n && A);
|
|
20
|
+
}
|
|
21
|
+
const tt = a.forwardRef(
|
|
15
22
|
({
|
|
16
|
-
value:
|
|
17
|
-
onChange:
|
|
18
|
-
format:
|
|
19
|
-
startPlaceholder:
|
|
20
|
-
endPlaceholder:
|
|
21
|
-
minDate:
|
|
22
|
-
maxDate:
|
|
23
|
-
startMonth:
|
|
24
|
-
endMonth:
|
|
25
|
-
showFooter:
|
|
26
|
-
weekStartsOn:
|
|
23
|
+
value: r,
|
|
24
|
+
onChange: c,
|
|
25
|
+
format: n = "MM/dd/yyyy",
|
|
26
|
+
startPlaceholder: A,
|
|
27
|
+
endPlaceholder: oe,
|
|
28
|
+
minDate: ne,
|
|
29
|
+
maxDate: se,
|
|
30
|
+
startMonth: ie,
|
|
31
|
+
endMonth: le,
|
|
32
|
+
showFooter: g = !0,
|
|
33
|
+
weekStartsOn: L,
|
|
27
34
|
disabled: f,
|
|
28
|
-
label:
|
|
29
|
-
helperText:
|
|
30
|
-
helperTextPosition:
|
|
31
|
-
prefix:
|
|
32
|
-
prefixClick:
|
|
33
|
-
isError:
|
|
34
|
-
error:
|
|
35
|
-
size:
|
|
36
|
-
required:
|
|
37
|
-
className:
|
|
38
|
-
...
|
|
39
|
-
},
|
|
40
|
-
const { locale:
|
|
41
|
-
label:
|
|
42
|
-
helperText:
|
|
43
|
-
helperTextPosition:
|
|
44
|
-
error:
|
|
45
|
-
required:
|
|
35
|
+
label: ae,
|
|
36
|
+
helperText: ce,
|
|
37
|
+
helperTextPosition: fe = "absolute",
|
|
38
|
+
prefix: rt,
|
|
39
|
+
prefixClick: ot,
|
|
40
|
+
isError: de,
|
|
41
|
+
error: pe,
|
|
42
|
+
size: q,
|
|
43
|
+
required: me,
|
|
44
|
+
className: ue,
|
|
45
|
+
...ge
|
|
46
|
+
}, he) => {
|
|
47
|
+
const { locale: z, t: b } = Ye(), s = a.useMemo(() => Ze(z), [z]), H = A ?? b("datePicker.startDate"), G = oe ?? b("datePicker.endDate"), J = pe ?? de, ye = Je({
|
|
48
|
+
label: ae,
|
|
49
|
+
helperText: ce,
|
|
50
|
+
helperTextPosition: fe,
|
|
51
|
+
error: J,
|
|
52
|
+
required: me,
|
|
46
53
|
disabled: f ?? void 0,
|
|
47
54
|
rootClassName: "w-full min-w-[240px]"
|
|
48
|
-
}),
|
|
49
|
-
|
|
50
|
-
const [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}, [
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
55
|
+
}), Q = a.useRef(null), Re = a.useRef(null), U = a.useRef(null), T = a.useRef(null), M = a.useRef(null);
|
|
56
|
+
a.useImperativeHandle(he, () => Q.current);
|
|
57
|
+
const [d, h] = a.useState(!1), W = Ke(), { footerFlashKey: xe, footerFlashTarget: De, popoverHandlers: ke } = je(g, d, W, U), I = a.useRef(!1), [p, y] = a.useState(r), [m, D] = a.useState(r?.from ? x(r.from, n, { locale: s }) : ""), [R, k] = a.useState(r?.to ? x(r.to, n, { locale: s }) : ""), [ve, P] = a.useState(r?.from || /* @__PURE__ */ new Date()), v = r?.from ? x(r.from, n, { locale: s }) : "", C = r?.to ? x(r.to, n, { locale: s }) : "";
|
|
58
|
+
a.useEffect(() => {
|
|
59
|
+
D(r?.from ? x(r.from, n, { locale: s }) : ""), k(r?.to ? x(r.to, n, { locale: s }) : ""), y(r);
|
|
60
|
+
}, [r, n, s]);
|
|
61
|
+
const Ce = a.useCallback(
|
|
62
|
+
(e) => Le({
|
|
63
|
+
disabled: f ?? void 0,
|
|
64
|
+
showFooter: g,
|
|
65
|
+
containerRef: T,
|
|
66
|
+
popoverContentRef: M,
|
|
67
|
+
setOpen: h
|
|
68
|
+
})(e),
|
|
69
|
+
[f, g]
|
|
70
|
+
), X = a.useRef(!1);
|
|
71
|
+
a.useEffect(() => {
|
|
72
|
+
if (d && !X.current) {
|
|
73
|
+
const e = K(m, n, s);
|
|
74
|
+
e.parsed ? P(e.parsed) : p?.from ? P(p.from) : r?.from && P(r.from);
|
|
75
|
+
}
|
|
76
|
+
X.current = d;
|
|
77
|
+
}, [d, m, n, s, p?.from, r?.from]);
|
|
78
|
+
const be = (e) => {
|
|
79
|
+
const t = $e(e);
|
|
80
|
+
y(t), t?.from && D(x(t.from, n, { locale: s })), t?.to && k(x(t.to, n, { locale: s })), g || t?.from && t?.to && t.from.getTime() !== t.to.getTime() && (c?.(t), h(!1));
|
|
81
|
+
}, w = a.useCallback((e, t) => {
|
|
82
|
+
const o = qe(e, t, j);
|
|
83
|
+
return o.swapped && (o.from && D(x(o.from, n, { locale: s })), o.to && k(x(o.to, n, { locale: s })), ze(T.current)), { from: o.from, to: o.to };
|
|
84
|
+
}, [n, s]), Y = (e) => {
|
|
85
|
+
let t = _e(e, p);
|
|
86
|
+
t?.from && !t.to && (t = { from: t.from, to: t.from });
|
|
87
|
+
const o = w(t?.from, t?.to);
|
|
88
|
+
y({ from: o.from, to: o.to }), c?.({ from: o.from, to: o.to }), h(!1);
|
|
89
|
+
}, B = () => {
|
|
90
|
+
y(r), D(r?.from ? x(r.from, n, { locale: s }) : ""), k(r?.to ? x(r.to, n, { locale: s }) : ""), h(!1);
|
|
91
|
+
}, V = () => {
|
|
92
|
+
y(void 0), D(""), k(""), c?.(void 0), g || h(!1);
|
|
93
|
+
}, Ie = (e) => {
|
|
94
|
+
const t = F(e.target.value, n, m);
|
|
95
|
+
if (D(t), t === "") {
|
|
96
|
+
const l = { from: void 0, to: p?.to };
|
|
97
|
+
y(l), g || c?.(l);
|
|
71
98
|
return;
|
|
72
99
|
}
|
|
73
|
-
const
|
|
74
|
-
if (
|
|
75
|
-
const l = { from:
|
|
76
|
-
|
|
100
|
+
const { parsed: o, isValid: i } = K(t, n, s);
|
|
101
|
+
if (i && o) {
|
|
102
|
+
const l = { from: o, to: p?.to };
|
|
103
|
+
y(l), P(o), g || c?.(l);
|
|
77
104
|
}
|
|
78
|
-
},
|
|
79
|
-
const
|
|
80
|
-
if (
|
|
81
|
-
const l = { from:
|
|
82
|
-
|
|
105
|
+
}, Pe = (e) => {
|
|
106
|
+
const t = F(e.target.value, n, R);
|
|
107
|
+
if (k(t), t === "") {
|
|
108
|
+
const l = { from: p?.from, to: void 0 };
|
|
109
|
+
y(l), g || c?.(l);
|
|
83
110
|
return;
|
|
84
111
|
}
|
|
85
|
-
const
|
|
86
|
-
if (
|
|
87
|
-
const l = { from:
|
|
88
|
-
|
|
112
|
+
const { parsed: o, isValid: i } = K(t, n, s);
|
|
113
|
+
if (i && o) {
|
|
114
|
+
const l = { from: p?.from, to: o };
|
|
115
|
+
y(l), P(o), g || c?.(l);
|
|
89
116
|
}
|
|
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
|
-
|
|
126
|
-
|
|
117
|
+
}, Z = () => {
|
|
118
|
+
Ge(
|
|
119
|
+
T,
|
|
120
|
+
M,
|
|
121
|
+
() => {
|
|
122
|
+
const e = N(m, n, v, s), t = N(R, n, C, s);
|
|
123
|
+
e.resetToCommitted ? D(v) : e.parsed && D(e.display), t.resetToCommitted ? k(C) : t.parsed && k(t.display);
|
|
124
|
+
let o = e.parsed ? e.parsed : e.resetToCommitted ? r?.from : p?.from, i = t.parsed ? t.parsed : t.resetToCommitted ? r?.to : p?.to;
|
|
125
|
+
o && i && ({ from: o, to: i } = w(o, i));
|
|
126
|
+
const l = o || i ? { from: o, to: i } : void 0;
|
|
127
|
+
y(l), g || (l ? c?.(l) : !m && !R && c?.(void 0));
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
}, Ee = () => {
|
|
131
|
+
const e = S(m, n, v, s), t = S(R, n, C, s);
|
|
132
|
+
e.resetToCommitted ? D(v) : e.parsed && D(e.display), t.resetToCommitted ? k(C) : t.parsed && k(t.display);
|
|
133
|
+
let o = e.parsed ?? p?.from ?? r?.from, i = t.parsed ?? p?.to ?? r?.to;
|
|
134
|
+
o && i && ({ from: o, to: i } = w(o, i));
|
|
135
|
+
const l = o || i ? { from: o, to: i } : void 0;
|
|
136
|
+
l ? (y(l), c?.(l)) : !m && !R && (y(void 0), c?.(void 0));
|
|
137
|
+
}, _ = () => {
|
|
138
|
+
if (d && g) {
|
|
139
|
+
Y();
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (!d) {
|
|
143
|
+
if (g) {
|
|
144
|
+
Ee();
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
const e = S(m, n, v, s), t = S(R, n, C, s);
|
|
148
|
+
if (e.parsed || t.parsed) return;
|
|
149
|
+
I.current = !0, h(!0);
|
|
150
|
+
}
|
|
151
|
+
}, we = m !== v, Te = R !== C, Be = $(m, n, s), Ne = $(R, n, s), Se = a.useCallback(() => {
|
|
152
|
+
const e = N(m, n, v, s), t = N(R, n, C, s);
|
|
153
|
+
let o = e.parsed ? e.parsed : e.resetToCommitted ? r?.from : p?.from, i = t.parsed ? t.parsed : t.resetToCommitted ? r?.to : p?.to;
|
|
154
|
+
o && i && ({ from: o, to: i } = w(o, i));
|
|
155
|
+
const l = o || i ? { from: o, to: i } : void 0;
|
|
156
|
+
return He({
|
|
157
|
+
startInput: m,
|
|
158
|
+
endInput: R,
|
|
159
|
+
committedStart: v,
|
|
160
|
+
committedEnd: C,
|
|
161
|
+
committedRange: r,
|
|
162
|
+
computeEffectiveRange: () => l,
|
|
163
|
+
rangesEqual: (Ae, Me) => et(Ae, Me)
|
|
164
|
+
});
|
|
165
|
+
}, [
|
|
166
|
+
m,
|
|
167
|
+
R,
|
|
168
|
+
v,
|
|
169
|
+
C,
|
|
170
|
+
r,
|
|
171
|
+
p,
|
|
172
|
+
n,
|
|
173
|
+
s,
|
|
174
|
+
w
|
|
175
|
+
]);
|
|
176
|
+
return a.useLayoutEffect(() => {
|
|
177
|
+
W.current = {
|
|
178
|
+
onDismiss: B,
|
|
179
|
+
resolveFlash: Se
|
|
180
|
+
};
|
|
181
|
+
}), /* @__PURE__ */ u(
|
|
182
|
+
"div",
|
|
183
|
+
{
|
|
184
|
+
ref: U,
|
|
185
|
+
"data-component": "date-range-picker",
|
|
186
|
+
"data-disabled": f || void 0,
|
|
187
|
+
children: ye.wrapControl(
|
|
188
|
+
/* @__PURE__ */ E(Qe, { open: f ? !1 : d, onOpenChange: Ce, children: [
|
|
189
|
+
/* @__PURE__ */ u(Ue, { asChild: !0, children: /* @__PURE__ */ E(
|
|
190
|
+
"div",
|
|
191
|
+
{
|
|
192
|
+
ref: T,
|
|
193
|
+
"data-state": d ? "open" : "closed",
|
|
194
|
+
className: O(
|
|
195
|
+
"flex w-full items-center justify-between gap-2 rounded-md border bg-canvas-elevated px-3 text-sm shadow-sm transition-colors hover:border-brand disabled:cursor-not-allowed disabled:bg-disabled-surface disabled:text-disabled-foreground disabled:border-stroke",
|
|
196
|
+
J ? "border-destructive hover:border-destructive" : "border-field",
|
|
197
|
+
q === "sm" ? "h-6" : q === "md" ? "h-[28px]" : "h-8",
|
|
198
|
+
f && "pointer-events-none opacity-100 bg-disabled-surface border-stroke text-disabled-foreground hover:border-stroke",
|
|
199
|
+
"cursor-pointer",
|
|
200
|
+
ue
|
|
201
|
+
),
|
|
202
|
+
children: [
|
|
203
|
+
/* @__PURE__ */ E("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
|
|
204
|
+
/* @__PURE__ */ u(
|
|
205
|
+
"input",
|
|
206
|
+
{
|
|
207
|
+
ref: Q,
|
|
208
|
+
type: "text",
|
|
209
|
+
value: m,
|
|
210
|
+
onChange: Ie,
|
|
211
|
+
onBlur: Z,
|
|
212
|
+
onClick: () => !f && h(!0),
|
|
213
|
+
onKeyDown: (e) => {
|
|
214
|
+
e.key === "Enter" && !f && (e.preventDefault(), _()), e.key === "ArrowDown" && !d && !f && (e.preventDefault(), I.current = !0, h(!0)), e.key === "Escape" && d && (e.preventDefault(), B());
|
|
215
|
+
},
|
|
216
|
+
placeholder: d ? n : H,
|
|
217
|
+
disabled: !!f,
|
|
218
|
+
"aria-label": H,
|
|
219
|
+
"data-field": "start",
|
|
220
|
+
className: O(
|
|
221
|
+
"flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-content-empty disabled:cursor-not-allowed disabled:opacity-50",
|
|
222
|
+
Be ? "text-destructive" : we ? "text-content-placeholder" : ""
|
|
223
|
+
),
|
|
224
|
+
...ge
|
|
127
225
|
}
|
|
128
|
-
t.key === "ArrowDown" && !c && !f && (t.preventDefault(), V.current = !0, u(!0)), t.key === "Escape" && c && (t.preventDefault(), M());
|
|
129
|
-
},
|
|
130
|
-
placeholder: c ? e : B,
|
|
131
|
-
disabled: !!f,
|
|
132
|
-
"aria-label": B,
|
|
133
|
-
"data-field": "start",
|
|
134
|
-
className: A(
|
|
135
|
-
"flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-content-empty disabled:cursor-not-allowed disabled:opacity-50",
|
|
136
|
-
De ? "text-destructive" : ge ? "text-content-placeholder" : ""
|
|
137
226
|
),
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
227
|
+
/* @__PURE__ */ u(
|
|
228
|
+
"input",
|
|
229
|
+
{
|
|
230
|
+
ref: Re,
|
|
231
|
+
type: "text",
|
|
232
|
+
value: R,
|
|
233
|
+
onChange: Pe,
|
|
234
|
+
onBlur: Z,
|
|
235
|
+
onClick: () => !f && h(!0),
|
|
236
|
+
onKeyDown: (e) => {
|
|
237
|
+
e.key === "Enter" && !f && (e.preventDefault(), _()), e.key === "ArrowDown" && !d && !f && (e.preventDefault(), I.current = !0, h(!0)), e.key === "Escape" && d && (e.preventDefault(), B());
|
|
238
|
+
},
|
|
239
|
+
placeholder: d ? n : G,
|
|
240
|
+
disabled: !!f,
|
|
241
|
+
"aria-label": G,
|
|
242
|
+
"data-field": "end",
|
|
243
|
+
className: O(
|
|
244
|
+
"flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-content-empty disabled:cursor-not-allowed disabled:opacity-50",
|
|
245
|
+
Ne ? "text-destructive" : Te ? "text-content-placeholder" : ""
|
|
246
|
+
)
|
|
155
247
|
}
|
|
156
|
-
t.key === "ArrowDown" && !c && !f && (t.preventDefault(), V.current = !0, u(!0)), t.key === "Escape" && c && (t.preventDefault(), M());
|
|
157
|
-
},
|
|
158
|
-
placeholder: c ? e : L,
|
|
159
|
-
disabled: !!f,
|
|
160
|
-
"aria-label": L,
|
|
161
|
-
"data-field": "end",
|
|
162
|
-
className: A(
|
|
163
|
-
"flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-content-empty disabled:cursor-not-allowed disabled:opacity-50",
|
|
164
|
-
be ? "text-destructive" : ye ? "text-content-placeholder" : ""
|
|
165
248
|
)
|
|
249
|
+
] }),
|
|
250
|
+
/* @__PURE__ */ E("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
251
|
+
r?.from && !f && /* @__PURE__ */ E(ee, { children: [
|
|
252
|
+
/* @__PURE__ */ u(te, { asChild: !0, children: /* @__PURE__ */ u(
|
|
253
|
+
"button",
|
|
254
|
+
{
|
|
255
|
+
type: "button",
|
|
256
|
+
tabIndex: 0,
|
|
257
|
+
"aria-label": b("calendar.clear"),
|
|
258
|
+
onClick: (e) => {
|
|
259
|
+
e.stopPropagation(), V();
|
|
260
|
+
},
|
|
261
|
+
onKeyDown: (e) => {
|
|
262
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), V());
|
|
263
|
+
},
|
|
264
|
+
className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
265
|
+
children: /* @__PURE__ */ u(Ve, { className: "size-3 hover:text-content text-content-icon" })
|
|
266
|
+
}
|
|
267
|
+
) }),
|
|
268
|
+
/* @__PURE__ */ u(re, { variant: "tertiary", side: "top", children: b("calendar.clear") })
|
|
269
|
+
] }),
|
|
270
|
+
/* @__PURE__ */ E(ee, { children: [
|
|
271
|
+
/* @__PURE__ */ u(te, { asChild: !0, children: /* @__PURE__ */ u("button", { type: "button", tabIndex: 0, "aria-label": b("datePicker.selectMonthRange"), onClick: (e) => {
|
|
272
|
+
e.stopPropagation(), f || h(!d);
|
|
273
|
+
}, onKeyDown: (e) => {
|
|
274
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), f || (I.current = !0, h(!d)));
|
|
275
|
+
}, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ u(Oe, { className: "h-4 w-4 text-secondary-foreground" }) }) }),
|
|
276
|
+
/* @__PURE__ */ u(re, { variant: "tertiary", side: "top", children: b("datePicker.selectMonthRange") })
|
|
277
|
+
] })
|
|
278
|
+
] })
|
|
279
|
+
]
|
|
280
|
+
}
|
|
281
|
+
) }),
|
|
282
|
+
/* @__PURE__ */ u(
|
|
283
|
+
We,
|
|
284
|
+
{
|
|
285
|
+
ref: M,
|
|
286
|
+
className: "w-auto p-0",
|
|
287
|
+
align: "start",
|
|
288
|
+
"aria-label": b("datePicker.selectDateRange"),
|
|
289
|
+
onOpenAutoFocus: (e) => {
|
|
290
|
+
I.current || e.preventDefault(), I.current = !1;
|
|
291
|
+
},
|
|
292
|
+
...ke,
|
|
293
|
+
children: /* @__PURE__ */ u(
|
|
294
|
+
Xe,
|
|
295
|
+
{
|
|
296
|
+
mode: "range",
|
|
297
|
+
selected: p,
|
|
298
|
+
footerFlashKey: xe,
|
|
299
|
+
footerFlashTarget: De,
|
|
300
|
+
onSelect: be,
|
|
301
|
+
month: ve,
|
|
302
|
+
onMonthChange: P,
|
|
303
|
+
disabled: Fe(ne, se),
|
|
304
|
+
startMonth: ie,
|
|
305
|
+
endMonth: le,
|
|
306
|
+
showFooter: g,
|
|
307
|
+
onApply: Y,
|
|
308
|
+
onCancel: B,
|
|
309
|
+
onClear: V,
|
|
310
|
+
captionLayout: "dropdown",
|
|
311
|
+
...L !== void 0 ? { weekStartsOn: L } : {}
|
|
166
312
|
}
|
|
167
313
|
)
|
|
168
|
-
] }),
|
|
169
|
-
/* @__PURE__ */ S("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
170
|
-
n?.from && !f && /* @__PURE__ */ S(G, { children: [
|
|
171
|
-
/* @__PURE__ */ d(J, { asChild: !0, children: /* @__PURE__ */ d(
|
|
172
|
-
"button",
|
|
173
|
-
{
|
|
174
|
-
type: "button",
|
|
175
|
-
tabIndex: 0,
|
|
176
|
-
"aria-label": P("calendar.clear"),
|
|
177
|
-
onClick: (t) => {
|
|
178
|
-
t.stopPropagation(), v();
|
|
179
|
-
},
|
|
180
|
-
onKeyDown: (t) => {
|
|
181
|
-
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), t.stopPropagation(), v());
|
|
182
|
-
},
|
|
183
|
-
className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
184
|
-
children: /* @__PURE__ */ d(we, { className: "size-3 hover:text-content text-content-icon" })
|
|
185
|
-
}
|
|
186
|
-
) }),
|
|
187
|
-
/* @__PURE__ */ d(Q, { variant: "tertiary", side: "top", children: P("calendar.clear") })
|
|
188
|
-
] }),
|
|
189
|
-
/* @__PURE__ */ S(G, { children: [
|
|
190
|
-
/* @__PURE__ */ d(J, { asChild: !0, children: /* @__PURE__ */ d("button", { type: "button", tabIndex: 0, "aria-label": P("datePicker.selectMonthRange"), onClick: (t) => {
|
|
191
|
-
t.stopPropagation(), f || u(!c);
|
|
192
|
-
}, onKeyDown: (t) => {
|
|
193
|
-
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), t.stopPropagation(), f || (V.current = !0, u(!c)));
|
|
194
|
-
}, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ d(xe, { className: "h-4 w-4 text-secondary-foreground" }) }) }),
|
|
195
|
-
/* @__PURE__ */ d(Q, { variant: "tertiary", side: "top", children: P("datePicker.selectMonthRange") })
|
|
196
|
-
] })
|
|
197
|
-
] })
|
|
198
|
-
]
|
|
199
|
-
}
|
|
200
|
-
) }),
|
|
201
|
-
/* @__PURE__ */ d(
|
|
202
|
-
Re,
|
|
203
|
-
{
|
|
204
|
-
className: "w-auto p-0",
|
|
205
|
-
align: "start",
|
|
206
|
-
"aria-label": P("datePicker.selectDateRange"),
|
|
207
|
-
onOpenAutoFocus: (t) => {
|
|
208
|
-
V.current || t.preventDefault(), V.current = !1;
|
|
209
|
-
},
|
|
210
|
-
children: /* @__PURE__ */ d(
|
|
211
|
-
Se,
|
|
212
|
-
{
|
|
213
|
-
mode: "range",
|
|
214
|
-
selected: R,
|
|
215
|
-
onSelect: fe,
|
|
216
|
-
month: ae,
|
|
217
|
-
onMonthChange: N,
|
|
218
|
-
disabled: Me(X, Y),
|
|
219
|
-
startMonth: Z,
|
|
220
|
-
endMonth: _,
|
|
221
|
-
showFooter: h,
|
|
222
|
-
onApply: de,
|
|
223
|
-
onCancel: M,
|
|
224
|
-
onClear: v,
|
|
225
|
-
captionLayout: "dropdown",
|
|
226
|
-
...T !== void 0 ? { weekStartsOn: T } : {}
|
|
227
314
|
}
|
|
228
315
|
)
|
|
229
|
-
}
|
|
316
|
+
] })
|
|
230
317
|
)
|
|
231
|
-
|
|
232
|
-
)
|
|
318
|
+
}
|
|
319
|
+
);
|
|
233
320
|
}
|
|
234
321
|
);
|
|
235
|
-
|
|
322
|
+
tt.displayName = "DateRangePicker";
|
|
236
323
|
export {
|
|
237
|
-
|
|
324
|
+
tt as DateRangePicker
|
|
238
325
|
};
|