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