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