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