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