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