impact-nova 1.6.1 → 1.6.3
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/ui/accordion-nested-list/accordion-nested-list.js +7 -7
- package/dist/components/ui/accordion.d.ts +0 -1
- package/dist/components/ui/accordion.js +30 -33
- package/dist/components/ui/ag-grid-react/index.js +38 -35
- package/dist/components/ui/ag-grid-react/process-backend-columndefs.js +10 -10
- package/dist/components/ui/ag-grid-react/value-formatters.js +18 -18
- package/dist/components/ui/calendar.js +254 -247
- package/dist/components/ui/command-palette/shortcut-settings.js +122 -116
- package/dist/components/ui/data-table/data-table.d.ts +0 -4
- package/dist/components/ui/data-table/data-table.js +94 -60
- package/dist/components/ui/date-picker/date-picker.js +90 -81
- package/dist/components/ui/date-picker/date-range-picker.js +144 -130
- package/dist/components/ui/date-picker/week-range-picker.js +157 -143
- package/dist/components/ui/filter-strip/filter-summary.js +161 -234
- package/dist/components/ui/filter-strip/filter-tag-list.js +97 -124
- package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +29 -29
- package/dist/components/ui/select/select.js +521 -493
- package/dist/components/ui/sheet.js +71 -94
- package/dist/impact-nova.css +1 -1
- package/package.json +1 -1
|
@@ -1,73 +1,73 @@
|
|
|
1
1
|
import { jsxs as Y, jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import * as d from "react";
|
|
3
|
-
import { ChevronLeftIcon as
|
|
4
|
-
import { getDefaultClassNames as
|
|
3
|
+
import { ChevronLeftIcon as ye, ChevronRightIcon as Ne } from "lucide-react";
|
|
4
|
+
import { getDefaultClassNames as Be, DayPicker as Fe } from "react-day-picker";
|
|
5
5
|
import { cn as f } from "../../lib/utils.js";
|
|
6
|
-
import { Button as
|
|
6
|
+
import { Button as P } from "./button.js";
|
|
7
7
|
import "./button-variants.js";
|
|
8
|
-
import
|
|
9
|
-
import { FISCAL_PATTERNS as
|
|
10
|
-
import { getIntlLocale as
|
|
11
|
-
import { useImpactNovaI18n as
|
|
12
|
-
const
|
|
13
|
-
function
|
|
14
|
-
className:
|
|
15
|
-
classNames:
|
|
8
|
+
import ue from "./select/select.js";
|
|
9
|
+
import { FISCAL_PATTERNS as Te, resolveWeekSelection as Ke } from "../../lib/fiscal-calendar.js";
|
|
10
|
+
import { getIntlLocale as We, getDateFnsLocale as qe } from "../../i18n/getDateFnsLocale.js";
|
|
11
|
+
import { useImpactNovaI18n as Ge } from "../../i18n/ImpactNovaI18nContext.js";
|
|
12
|
+
const fe = d.createContext(0);
|
|
13
|
+
function ot({
|
|
14
|
+
className: se,
|
|
15
|
+
classNames: J,
|
|
16
16
|
showOutsideDays: y = !1,
|
|
17
|
-
captionLayout:
|
|
18
|
-
buttonVariant:
|
|
19
|
-
formatters:
|
|
20
|
-
components:
|
|
17
|
+
captionLayout: Q = "dropdown",
|
|
18
|
+
buttonVariant: F = "ghost",
|
|
19
|
+
formatters: X,
|
|
20
|
+
components: Ce,
|
|
21
21
|
showFooter: x = !0,
|
|
22
|
-
onApply:
|
|
23
|
-
onCancel:
|
|
24
|
-
onClear:
|
|
25
|
-
mode:
|
|
22
|
+
onApply: Z,
|
|
23
|
+
onCancel: de,
|
|
24
|
+
onClear: me,
|
|
25
|
+
mode: T = "single",
|
|
26
26
|
selected: D,
|
|
27
27
|
onSelect: U,
|
|
28
28
|
// Week picker props
|
|
29
29
|
pickerType: m = "date",
|
|
30
|
-
weekMode:
|
|
30
|
+
weekMode: p = "single",
|
|
31
31
|
selectedWeeks: C,
|
|
32
|
-
onWeekSelect:
|
|
33
|
-
calendarType:
|
|
34
|
-
fiscalMode:
|
|
35
|
-
selectionMode:
|
|
32
|
+
onWeekSelect: k,
|
|
33
|
+
calendarType: R = "calendar",
|
|
34
|
+
fiscalMode: V = "basic",
|
|
35
|
+
selectionMode: oe = "week",
|
|
36
36
|
fiscalMonthPattern: le,
|
|
37
|
-
fiscalYearStartMonth:
|
|
38
|
-
weekStartsOn:
|
|
37
|
+
fiscalYearStartMonth: ge = 1,
|
|
38
|
+
weekStartsOn: K = 1,
|
|
39
39
|
// Default Monday
|
|
40
40
|
// Month picker props
|
|
41
41
|
monthMode: w = "single",
|
|
42
42
|
selectedMonths: N,
|
|
43
43
|
onMonthSelect: _,
|
|
44
|
-
month:
|
|
45
|
-
defaultMonth:
|
|
46
|
-
onMonthChange:
|
|
47
|
-
startMonth:
|
|
48
|
-
endMonth:
|
|
49
|
-
...
|
|
44
|
+
month: B,
|
|
45
|
+
defaultMonth: he,
|
|
46
|
+
onMonthChange: Se,
|
|
47
|
+
startMonth: _e,
|
|
48
|
+
endMonth: Ye,
|
|
49
|
+
...xe
|
|
50
50
|
}) {
|
|
51
|
-
const { locale:
|
|
51
|
+
const { locale: ee, t: h } = Ge(), W = d.useMemo(() => We(ee), [ee]), ke = d.useMemo(() => qe(ee), [ee]), be = d.useMemo(
|
|
52
52
|
() => Array.from(
|
|
53
53
|
{ length: 12 },
|
|
54
|
-
(e, n) => new Date(2024, n, 1).toLocaleString(
|
|
54
|
+
(e, n) => new Date(2024, n, 1).toLocaleString(W, { month: "long" })
|
|
55
55
|
),
|
|
56
|
-
[
|
|
56
|
+
[W]
|
|
57
57
|
), Ae = d.useMemo(
|
|
58
58
|
() => Array.from(
|
|
59
59
|
{ length: 12 },
|
|
60
|
-
(e, n) => new Date(2024, n, 1).toLocaleString(
|
|
60
|
+
(e, n) => new Date(2024, n, 1).toLocaleString(W, { month: "short" })
|
|
61
61
|
),
|
|
62
|
-
[
|
|
63
|
-
),
|
|
64
|
-
if (
|
|
62
|
+
[W]
|
|
63
|
+
), te = d.useMemo(() => {
|
|
64
|
+
if (R === "fiscal") {
|
|
65
65
|
if (le) return le;
|
|
66
|
-
if (
|
|
66
|
+
if (V === "advanced") return Te["4-4-5"];
|
|
67
67
|
}
|
|
68
|
-
}, [
|
|
69
|
-
if (
|
|
70
|
-
if (
|
|
68
|
+
}, [R, V, le]), b = Be(), je = d.useMemo(() => new Date(1900, 0, 1), []), Me = d.useMemo(() => new Date(2100, 11, 31), []), E = _e || je, L = Ye || Me, [q, ne] = d.useState(D), [A, pe] = d.useState(() => {
|
|
69
|
+
if (B) return B;
|
|
70
|
+
if (he) return he;
|
|
71
71
|
if (D) {
|
|
72
72
|
if (Array.isArray(D))
|
|
73
73
|
return D[0] || /* @__PURE__ */ new Date();
|
|
@@ -79,35 +79,35 @@ function st({
|
|
|
79
79
|
return /* @__PURE__ */ new Date();
|
|
80
80
|
});
|
|
81
81
|
d.useEffect(() => {
|
|
82
|
-
|
|
83
|
-
}, [
|
|
84
|
-
const [$,
|
|
82
|
+
B && (pe(B), ve(B.getFullYear()));
|
|
83
|
+
}, [B]);
|
|
84
|
+
const [$, re] = d.useState(C), [j, ae] = d.useState(N), [ze, ve] = d.useState(A.getFullYear());
|
|
85
85
|
d.useEffect(() => {
|
|
86
|
-
|
|
86
|
+
ne(D), re(C), ae(N);
|
|
87
87
|
}, [D, C, N]);
|
|
88
88
|
const O = (e) => {
|
|
89
|
-
|
|
90
|
-
},
|
|
89
|
+
pe(e), ve(e.getFullYear()), Se?.(e);
|
|
90
|
+
}, ie = d.useCallback((e) => {
|
|
91
91
|
let n;
|
|
92
|
-
return e instanceof Date ? n = e : n = e.days.find((t) => !t.outside)?.date || e.days[0]?.date || /* @__PURE__ */ new Date(),
|
|
93
|
-
calendarType:
|
|
94
|
-
fiscalMode:
|
|
95
|
-
selectionMode:
|
|
96
|
-
fiscalMonthPattern:
|
|
97
|
-
fiscalYearStartMonth:
|
|
98
|
-
weekStartsOn:
|
|
92
|
+
return e instanceof Date ? n = e : n = e.days.find((t) => !t.outside)?.date || e.days[0]?.date || /* @__PURE__ */ new Date(), Ke(n, {
|
|
93
|
+
calendarType: R,
|
|
94
|
+
fiscalMode: V,
|
|
95
|
+
selectionMode: oe,
|
|
96
|
+
fiscalMonthPattern: te,
|
|
97
|
+
fiscalYearStartMonth: ge,
|
|
98
|
+
weekStartsOn: K
|
|
99
99
|
});
|
|
100
|
-
}, [
|
|
100
|
+
}, [R, V, oe, te, ge, K]), ce = d.useCallback((e) => {
|
|
101
101
|
const n = (t, r) => t.year === r.year && t.month === r.month && t.weekOfMonth === r.weekOfMonth;
|
|
102
102
|
if (x)
|
|
103
|
-
|
|
103
|
+
re((t) => {
|
|
104
104
|
let r;
|
|
105
|
-
if (
|
|
105
|
+
if (p === "single")
|
|
106
106
|
r = e;
|
|
107
|
-
else if (
|
|
107
|
+
else if (p === "multiple") {
|
|
108
108
|
const a = t || [];
|
|
109
|
-
r = a.some((
|
|
110
|
-
} else if (
|
|
109
|
+
r = a.some((o) => n(o, e)) ? a.filter((o) => !n(o, e)) : [...a, e];
|
|
110
|
+
} else if (p === "range") {
|
|
111
111
|
const a = t;
|
|
112
112
|
if (!a?.from || a.to)
|
|
113
113
|
r = { from: e };
|
|
@@ -116,39 +116,39 @@ function st({
|
|
|
116
116
|
e.startDate < a.from.startDate && (s.from = e, s.to = a.from), r = s;
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
return
|
|
119
|
+
return k?.(r), r;
|
|
120
120
|
});
|
|
121
|
-
else if (
|
|
122
|
-
|
|
123
|
-
else if (
|
|
121
|
+
else if (p === "single")
|
|
122
|
+
k?.(e);
|
|
123
|
+
else if (p === "multiple") {
|
|
124
124
|
const t = C || [], a = t.some((s) => n(s, e)) ? t.filter((s) => !n(s, e)) : [...t, e];
|
|
125
|
-
|
|
126
|
-
} else if (
|
|
125
|
+
k?.(a.length > 0 ? a : void 0);
|
|
126
|
+
} else if (p === "range") {
|
|
127
127
|
const t = C;
|
|
128
128
|
if (!t?.from || t.to)
|
|
129
|
-
|
|
129
|
+
k?.({ from: e });
|
|
130
130
|
else {
|
|
131
131
|
const r = { from: t.from, to: e };
|
|
132
|
-
e.startDate < t.from.startDate && (r.from = e, r.to = t.from),
|
|
132
|
+
e.startDate < t.from.startDate && (r.from = e, r.to = t.from), k?.(r);
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
}, [
|
|
135
|
+
}, [p, x, C, k]), Ie = d.useCallback((e, n) => {
|
|
136
136
|
const t = { year: e, month: n }, r = (a, s) => a.year === s.year && a.month === s.month;
|
|
137
137
|
if (x)
|
|
138
|
-
|
|
138
|
+
ae((a) => {
|
|
139
139
|
let s;
|
|
140
140
|
if (w === "single")
|
|
141
141
|
s = t;
|
|
142
142
|
else if (w === "multiple") {
|
|
143
|
-
const
|
|
144
|
-
s =
|
|
143
|
+
const o = a || [];
|
|
144
|
+
s = o.some((u) => r(u, t)) ? o.filter((u) => !r(u, t)) : [...o, t];
|
|
145
145
|
} else if (w === "range") {
|
|
146
|
-
const
|
|
147
|
-
if (!
|
|
146
|
+
const o = a;
|
|
147
|
+
if (!o?.from || o.to)
|
|
148
148
|
s = { from: t };
|
|
149
149
|
else {
|
|
150
|
-
const
|
|
151
|
-
new Date(t.year, t.month, 1) <
|
|
150
|
+
const l = new Date(o.from.year, o.from.month, 1);
|
|
151
|
+
new Date(t.year, t.month, 1) < l ? s = { from: t, to: o.from } : s = { from: o.from, to: t };
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
return _?.(s), s;
|
|
@@ -156,8 +156,8 @@ function st({
|
|
|
156
156
|
else if (w === "single")
|
|
157
157
|
_?.(t);
|
|
158
158
|
else if (w === "multiple") {
|
|
159
|
-
const a = N || [],
|
|
160
|
-
_?.(
|
|
159
|
+
const a = N || [], o = a.some((l) => r(l, t)) ? a.filter((l) => !r(l, t)) : [...a, t];
|
|
160
|
+
_?.(o.length > 0 ? o : void 0);
|
|
161
161
|
} else if (w === "range") {
|
|
162
162
|
const a = N;
|
|
163
163
|
if (!a?.from || a.to)
|
|
@@ -167,18 +167,18 @@ function st({
|
|
|
167
167
|
new Date(t.year, t.month, 1) < s ? _?.({ from: t, to: a.from }) : _?.({ from: a.from, to: t });
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
}, [w, x, N, _]),
|
|
171
|
-
const e = E.getFullYear(), n =
|
|
170
|
+
}, [w, x, N, _]), De = d.useCallback(() => {
|
|
171
|
+
const e = E.getFullYear(), n = L.getFullYear(), t = [];
|
|
172
172
|
for (let r = e; r <= n; r++)
|
|
173
173
|
t.push({ label: r.toString(), value: r.toString() });
|
|
174
174
|
return t;
|
|
175
|
-
}, [E,
|
|
175
|
+
}, [E, L]), Pe = d.useCallback((e) => be.map((t, r) => ({
|
|
176
176
|
label: t,
|
|
177
177
|
value: r.toString()
|
|
178
178
|
})).filter((t, r) => {
|
|
179
179
|
const a = new Date(e, r, 1);
|
|
180
|
-
return !(E && a < new Date(E.getFullYear(), E.getMonth(), 1) ||
|
|
181
|
-
}), [E,
|
|
180
|
+
return !(E && a < new Date(E.getFullYear(), E.getMonth(), 1) || L && a > new Date(L.getFullYear(), L.getMonth(), 1));
|
|
181
|
+
}), [E, L, be]), G = d.useMemo(() => {
|
|
182
182
|
if (m !== "week") return;
|
|
183
183
|
const e = x ? $ : C;
|
|
184
184
|
if (!e) return;
|
|
@@ -206,73 +206,73 @@ function st({
|
|
|
206
206
|
t(e);
|
|
207
207
|
return n;
|
|
208
208
|
}, [m, x, $, C]), Re = d.useMemo(() => {
|
|
209
|
-
if (m !== "week" || !
|
|
209
|
+
if (m !== "week" || !G || G.length === 0)
|
|
210
210
|
return { range_start: [], range_middle: [], range_end: [] };
|
|
211
|
-
const e = [...
|
|
212
|
-
|
|
213
|
-
const g = i.startDate.toISOString().split("T")[0],
|
|
214
|
-
s.add(g),
|
|
211
|
+
const e = [...G].sort((i, g) => i.getTime() - g.getTime()), n = [], t = [], r = [], a = x ? $ : C, s = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
|
|
212
|
+
p === "multiple" && Array.isArray(a) && a.forEach((i) => {
|
|
213
|
+
const g = i.startDate.toISOString().split("T")[0], v = i.endDate.toISOString().split("T")[0];
|
|
214
|
+
s.add(g), o.add(v);
|
|
215
215
|
});
|
|
216
|
-
const
|
|
216
|
+
const l = (i, g) => {
|
|
217
217
|
if (g === 0) return !1;
|
|
218
|
-
const
|
|
219
|
-
return i.getTime() -
|
|
218
|
+
const v = e[g - 1];
|
|
219
|
+
return i.getTime() - v.getTime() <= 1440 * 60 * 1e3;
|
|
220
220
|
}, u = (i, g) => g === e.length - 1 ? !1 : e[g + 1].getTime() - i.getTime() <= 1440 * 60 * 1e3;
|
|
221
221
|
return e.forEach((i, g) => {
|
|
222
|
-
const
|
|
223
|
-
|
|
222
|
+
const v = i.toISOString().split("T")[0], M = s.has(v), S = o.has(v), z = l(i, g), I = u(i, g);
|
|
223
|
+
p === "multiple" ? M ? n.push(i) : S ? r.push(i) : t.push(i) : !z && !I ? (n.push(i), r.push(i)) : z ? I ? t.push(i) : r.push(i) : n.push(i);
|
|
224
224
|
}), {
|
|
225
225
|
range_start: n,
|
|
226
226
|
range_middle: t,
|
|
227
227
|
range_end: r
|
|
228
228
|
};
|
|
229
|
-
}, [m,
|
|
229
|
+
}, [m, G, p, x, $, C]), Ee = d.useCallback((e) => {
|
|
230
230
|
if (m === "week" && e) {
|
|
231
231
|
const n = Array.isArray(e) ? e[e.length - 1] : e instanceof Date ? e : void 0;
|
|
232
232
|
if (n) {
|
|
233
|
-
const t =
|
|
234
|
-
|
|
233
|
+
const t = ie(n);
|
|
234
|
+
ce(t);
|
|
235
235
|
return;
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
|
-
x &&
|
|
239
|
-
}, [x, U, m,
|
|
240
|
-
m === "week" ? (
|
|
241
|
-
}, [
|
|
242
|
-
m === "week" ?
|
|
243
|
-
}, [D, C, N,
|
|
244
|
-
m === "week" ? (
|
|
245
|
-
}, [x, U,
|
|
246
|
-
const t = x ?
|
|
238
|
+
x && ne(e), U?.(e);
|
|
239
|
+
}, [x, U, m, ie, ce]), Le = d.useCallback(() => {
|
|
240
|
+
m === "week" ? (k?.($), Z?.($)) : m === "month" ? (_?.(j), Z?.(j)) : (U?.(q), Z?.(q));
|
|
241
|
+
}, [q, $, j, U, k, _, Z, m]), $e = d.useCallback(() => {
|
|
242
|
+
m === "week" ? re(C) : m === "month" ? ae(N) : ne(D), de?.();
|
|
243
|
+
}, [D, C, N, de, m]), Oe = d.useCallback(() => {
|
|
244
|
+
m === "week" ? (re(void 0), x || k?.(void 0)) : m === "month" ? (ae(void 0), x || _?.(void 0)) : (ne(void 0), x || U?.(void 0)), me?.();
|
|
245
|
+
}, [x, U, k, _, me, m]), Ue = d.useCallback((e, n) => {
|
|
246
|
+
const t = x ? j : N;
|
|
247
247
|
if (!t) return !1;
|
|
248
248
|
if (Array.isArray(t))
|
|
249
249
|
return t.some((r) => r.year === e && r.month === n);
|
|
250
250
|
if ("from" in t) {
|
|
251
|
-
const r = t, a = r.from, s = r.to,
|
|
252
|
-
if (!s) return
|
|
251
|
+
const r = t, a = r.from, s = r.to, o = new Date(e, n, 1).getTime(), l = new Date(a.year, a.month, 1).getTime();
|
|
252
|
+
if (!s) return o === l;
|
|
253
253
|
const u = new Date(s.year, s.month, 1).getTime();
|
|
254
|
-
return
|
|
254
|
+
return o >= l && o <= u;
|
|
255
255
|
} else {
|
|
256
256
|
const r = t;
|
|
257
257
|
return r.year === e && r.month === n;
|
|
258
258
|
}
|
|
259
|
-
}, [x,
|
|
260
|
-
const t = x ?
|
|
259
|
+
}, [x, j, N]), He = d.useCallback((e, n) => {
|
|
260
|
+
const t = x ? j : N;
|
|
261
261
|
if (!t || !("from" in t)) return { isStart: !1, isEnd: !1, isMiddle: !1 };
|
|
262
|
-
const r = t, a = r.from, s = r.to,
|
|
263
|
-
if (!s) return { isStart:
|
|
262
|
+
const r = t, a = r.from, s = r.to, o = new Date(e, n, 1).getTime(), l = new Date(a.year, a.month, 1).getTime();
|
|
263
|
+
if (!s) return { isStart: o === l, isEnd: !1, isMiddle: !1 };
|
|
264
264
|
const u = new Date(s.year, s.month, 1).getTime();
|
|
265
265
|
return {
|
|
266
|
-
isStart:
|
|
267
|
-
isEnd:
|
|
268
|
-
isMiddle:
|
|
266
|
+
isStart: o === l,
|
|
267
|
+
isEnd: o === u,
|
|
268
|
+
isMiddle: o > l && o < u
|
|
269
269
|
};
|
|
270
|
-
}, [x,
|
|
271
|
-
const n =
|
|
270
|
+
}, [x, j, N]), we = ({ yearOffset: e = 0 }) => {
|
|
271
|
+
const n = ze + e;
|
|
272
272
|
return /* @__PURE__ */ Y("div", { className: "flex flex-col gap-4 p-3 min-w-[280px]", children: [
|
|
273
273
|
/* @__PURE__ */ Y("div", { className: "flex items-center justify-between", children: [
|
|
274
274
|
e === 0 && /* @__PURE__ */ c(
|
|
275
|
-
|
|
275
|
+
P,
|
|
276
276
|
{
|
|
277
277
|
variant: "ghost",
|
|
278
278
|
size: "icon",
|
|
@@ -280,62 +280,62 @@ function st({
|
|
|
280
280
|
"aria-label": h("calendar.previousYear"),
|
|
281
281
|
title: h("calendar.previousYear"),
|
|
282
282
|
disabled: n <= E.getFullYear(),
|
|
283
|
-
onClick: () => O(new Date(n - 1,
|
|
284
|
-
children: /* @__PURE__ */ c(
|
|
283
|
+
onClick: () => O(new Date(n - 1, A.getMonth(), 1)),
|
|
284
|
+
children: /* @__PURE__ */ c(ye, { className: "h-4 w-4" })
|
|
285
285
|
}
|
|
286
286
|
),
|
|
287
287
|
/* @__PURE__ */ c("div", { className: "flex-1 flex justify-center items-center", children: /* @__PURE__ */ c(
|
|
288
|
-
|
|
288
|
+
ue,
|
|
289
289
|
{
|
|
290
290
|
value: { label: n.toString(), value: n.toString() },
|
|
291
291
|
onChange: (t) => {
|
|
292
292
|
if (t && "value" in t) {
|
|
293
293
|
const r = parseInt(t.value) - e;
|
|
294
|
-
O(new Date(r,
|
|
294
|
+
O(new Date(r, A.getMonth(), 1));
|
|
295
295
|
}
|
|
296
296
|
},
|
|
297
297
|
scrollToSelectedOnOpen: !0,
|
|
298
|
-
options:
|
|
298
|
+
options: De(),
|
|
299
299
|
parentClassName: "flex justify-center items-center",
|
|
300
300
|
className: "w-[200px]",
|
|
301
301
|
menuWidth: "140px"
|
|
302
302
|
}
|
|
303
303
|
) }),
|
|
304
304
|
(w === "single" || e === 1) && /* @__PURE__ */ c(
|
|
305
|
-
|
|
305
|
+
P,
|
|
306
306
|
{
|
|
307
307
|
variant: "ghost",
|
|
308
308
|
size: "icon",
|
|
309
309
|
className: "h-7 w-7",
|
|
310
310
|
"aria-label": h("calendar.nextYear"),
|
|
311
311
|
title: h("calendar.nextYear"),
|
|
312
|
-
disabled: n >=
|
|
313
|
-
onClick: () => O(new Date(n + 1,
|
|
314
|
-
children: /* @__PURE__ */ c(
|
|
312
|
+
disabled: n >= L.getFullYear(),
|
|
313
|
+
onClick: () => O(new Date(n + 1, A.getMonth(), 1)),
|
|
314
|
+
children: /* @__PURE__ */ c(Ne, { className: "h-4 w-4" })
|
|
315
315
|
}
|
|
316
316
|
)
|
|
317
317
|
] }),
|
|
318
318
|
/* @__PURE__ */ c("div", { className: "grid grid-cols-4 gap-y-4 gap-x-0", children: Ae.map((t, r) => {
|
|
319
|
-
const a =
|
|
319
|
+
const a = Ue(n, r), { isStart: s, isEnd: o, isMiddle: l } = He(n, r), u = w === "range", i = x ? j : N, g = i && "to" in i && !!i.to;
|
|
320
320
|
return /* @__PURE__ */ Y("div", { className: "relative flex items-center justify-center h-10 w-full group", children: [
|
|
321
|
-
u && g && (
|
|
321
|
+
u && g && (l || s || o) && /* @__PURE__ */ c("div", { className: f(
|
|
322
322
|
"absolute inset-y-0 inset-x-0 bg-accent",
|
|
323
323
|
s && "rounded-l-full left-1/2 -ml-5",
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
s &&
|
|
324
|
+
o && "rounded-r-full right-1/2 -mr-5",
|
|
325
|
+
l && "inset-x-0",
|
|
326
|
+
s && o && "rounded-full inset-x-2"
|
|
327
327
|
) }),
|
|
328
328
|
/* @__PURE__ */ c(
|
|
329
|
-
|
|
329
|
+
P,
|
|
330
330
|
{
|
|
331
331
|
variant: "ghost",
|
|
332
|
-
onClick: () =>
|
|
332
|
+
onClick: () => Ie(n, r),
|
|
333
333
|
className: f(
|
|
334
334
|
"relative z-10 w-10 h-10 p-0 text-sm font-normal rounded-lg transition-all",
|
|
335
335
|
a && !u && "bg-brand text-brand-foreground hover:bg-brand/90 hover:text-brand-foreground",
|
|
336
|
-
u && (s ||
|
|
336
|
+
u && (s || o) && "bg-brand text-brand-foreground hover:bg-brand/90 hover:text-brand-foreground rounded-lg",
|
|
337
337
|
!a && "hover:bg-accent hover:text-accent-foreground border border-transparent hover:border-brand",
|
|
338
|
-
|
|
338
|
+
l && "text-accent-foreground"
|
|
339
339
|
),
|
|
340
340
|
children: t
|
|
341
341
|
}
|
|
@@ -346,42 +346,42 @@ function st({
|
|
|
346
346
|
};
|
|
347
347
|
return /* @__PURE__ */ Y("div", { className: "flex flex-col ", "data-component": "calendar", children: [
|
|
348
348
|
m === "month" ? /* @__PURE__ */ Y("div", { className: "flex flex-col md:flex-row", children: [
|
|
349
|
-
/* @__PURE__ */ c(
|
|
349
|
+
/* @__PURE__ */ c(we, { yearOffset: 0 }),
|
|
350
350
|
(w === "range" || w === "multiple") && /* @__PURE__ */ Y("div", { className: "flex flex-row gap-0", children: [
|
|
351
351
|
/* @__PURE__ */ c("div", { className: "w-[1px] bg-stroke-hairline my-4" }),
|
|
352
|
-
/* @__PURE__ */ c(
|
|
352
|
+
/* @__PURE__ */ c(we, { yearOffset: 1 })
|
|
353
353
|
] })
|
|
354
354
|
] }) : (
|
|
355
355
|
// @ts-ignore: TS mismatch due to dynamic union types.
|
|
356
356
|
// FIX: Split rendering into separate `DayPicker` calls for 'single' | 'multiple' | 'range' to strictly match discriminated unions.
|
|
357
357
|
/* @__PURE__ */ c(
|
|
358
|
-
|
|
358
|
+
Fe,
|
|
359
359
|
{
|
|
360
|
-
mode: m === "week" ? "multiple" :
|
|
361
|
-
selected: m === "week" ?
|
|
362
|
-
onSelect:
|
|
363
|
-
month:
|
|
360
|
+
mode: m === "week" ? "multiple" : T,
|
|
361
|
+
selected: m === "week" ? G : x ? q : D,
|
|
362
|
+
onSelect: Ee,
|
|
363
|
+
month: A,
|
|
364
364
|
onMonthChange: O,
|
|
365
|
-
showOutsideDays:
|
|
366
|
-
weekStartsOn:
|
|
365
|
+
showOutsideDays: R === "fiscal" ? !0 : y,
|
|
366
|
+
weekStartsOn: K,
|
|
367
367
|
modifiers: m === "week" ? Re : void 0,
|
|
368
|
-
locale:
|
|
368
|
+
locale: ke,
|
|
369
369
|
className: f(
|
|
370
370
|
"bg-canvas group/calendar p-2 [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
|
|
371
371
|
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
372
372
|
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
373
|
-
|
|
373
|
+
se
|
|
374
374
|
),
|
|
375
|
-
captionLayout:
|
|
375
|
+
captionLayout: Q,
|
|
376
376
|
startMonth: E,
|
|
377
|
-
endMonth:
|
|
378
|
-
disabled:
|
|
379
|
-
numberOfMonths:
|
|
377
|
+
endMonth: L,
|
|
378
|
+
disabled: xe.disabled,
|
|
379
|
+
numberOfMonths: T === "range" || T === "multiple" || p === "range" || p === "multiple" ? 2 : 1,
|
|
380
380
|
showWeekNumber: !0,
|
|
381
381
|
formatters: {
|
|
382
|
-
formatMonthDropdown: (e) => e.toLocaleString(
|
|
382
|
+
formatMonthDropdown: (e) => e.toLocaleString(W, { month: "short" }),
|
|
383
383
|
formatWeekNumber: (e) => h("calendar.weekNumber", { number: e }),
|
|
384
|
-
...
|
|
384
|
+
...X
|
|
385
385
|
},
|
|
386
386
|
classNames: {
|
|
387
387
|
root: f("w-fit", b.root),
|
|
@@ -441,7 +441,7 @@ function st({
|
|
|
441
441
|
"group/day relative select-none p-0 text-center flex-1 h-[30px] flex items-center justify-center [&:nth-child(2)]:pl-2 rdp-day",
|
|
442
442
|
m === "week" && "group-hover/week:bg-accent [&:nth-child(2)]:group-hover/week:rounded-l-full [&:nth-child(8)]:group-hover/week:rounded-r-full",
|
|
443
443
|
m === "week" && "[&.rdp-selected:nth-child(2)]:rounded-l-full [&.rdp-selected:nth-child(8)]:rounded-r-full",
|
|
444
|
-
|
|
444
|
+
J?.day
|
|
445
445
|
),
|
|
446
446
|
range_start: f(
|
|
447
447
|
"bg-accent rounded-l-full",
|
|
@@ -454,7 +454,7 @@ function st({
|
|
|
454
454
|
b.today
|
|
455
455
|
),
|
|
456
456
|
outside: f(
|
|
457
|
-
|
|
457
|
+
R === "fiscal" || y ? "text-content-muted opacity-50" : "invisible",
|
|
458
458
|
b.outside
|
|
459
459
|
),
|
|
460
460
|
disabled: f(
|
|
@@ -462,7 +462,7 @@ function st({
|
|
|
462
462
|
b.disabled
|
|
463
463
|
),
|
|
464
464
|
hidden: f("invisible", b.hidden),
|
|
465
|
-
...
|
|
465
|
+
...J
|
|
466
466
|
},
|
|
467
467
|
components: {
|
|
468
468
|
Root: ({ className: e, rootRef: n, ...t }) => /* @__PURE__ */ c(
|
|
@@ -474,17 +474,17 @@ function st({
|
|
|
474
474
|
...t
|
|
475
475
|
}
|
|
476
476
|
),
|
|
477
|
-
Chevron: ({ className: e, orientation: n, ...t }) => n === "left" ? /* @__PURE__ */ c(
|
|
478
|
-
|
|
477
|
+
Chevron: ({ className: e, orientation: n, ...t }) => n === "left" ? /* @__PURE__ */ c(ye, { className: f("size-4 text-content", e), ...t }) : n === "right" ? /* @__PURE__ */ c(
|
|
478
|
+
Ne,
|
|
479
479
|
{
|
|
480
480
|
className: f("size-4 text-content", e),
|
|
481
481
|
...t
|
|
482
482
|
}
|
|
483
483
|
) : /* @__PURE__ */ c("span", {}),
|
|
484
484
|
PreviousMonthButton: (e) => /* @__PURE__ */ c(
|
|
485
|
-
|
|
485
|
+
P,
|
|
486
486
|
{
|
|
487
|
-
variant:
|
|
487
|
+
variant: F,
|
|
488
488
|
size: "icon",
|
|
489
489
|
className: "h-7 w-7",
|
|
490
490
|
"aria-label": h("calendar.previousMonth"),
|
|
@@ -493,9 +493,9 @@ function st({
|
|
|
493
493
|
}
|
|
494
494
|
),
|
|
495
495
|
NextMonthButton: (e) => /* @__PURE__ */ c(
|
|
496
|
-
|
|
496
|
+
P,
|
|
497
497
|
{
|
|
498
|
-
variant:
|
|
498
|
+
variant: F,
|
|
499
499
|
size: "icon",
|
|
500
500
|
className: "h-7 w-7",
|
|
501
501
|
"aria-label": h("calendar.nextMonth"),
|
|
@@ -503,21 +503,21 @@ function st({
|
|
|
503
503
|
...e
|
|
504
504
|
}
|
|
505
505
|
),
|
|
506
|
-
MonthCaption: ({ displayIndex: e, ...n }) => /* @__PURE__ */ c(
|
|
506
|
+
MonthCaption: ({ displayIndex: e, ...n }) => /* @__PURE__ */ c(fe.Provider, { value: e, children: /* @__PURE__ */ c("div", { ...n }) }),
|
|
507
507
|
MonthsDropdown: ({ value: e }) => {
|
|
508
|
-
const n = d.useContext(
|
|
508
|
+
const n = d.useContext(fe), t = n > 0, a = new Date(A.getFullYear(), A.getMonth() + n, 1).getFullYear(), s = Pe(a);
|
|
509
509
|
return /* @__PURE__ */ c(
|
|
510
|
-
|
|
510
|
+
ue,
|
|
511
511
|
{
|
|
512
|
-
value: s.find((
|
|
513
|
-
onChange: (
|
|
514
|
-
if (
|
|
515
|
-
const
|
|
512
|
+
value: s.find((o) => o.value === e?.toString()),
|
|
513
|
+
onChange: (o) => {
|
|
514
|
+
if (o && "value" in o) {
|
|
515
|
+
const l = parseInt(o.value);
|
|
516
516
|
if (t) {
|
|
517
|
-
const u = new Date(a,
|
|
517
|
+
const u = new Date(a, l - 1, 1);
|
|
518
518
|
O(u);
|
|
519
519
|
} else {
|
|
520
|
-
const u = new Date(a,
|
|
520
|
+
const u = new Date(a, l, 1);
|
|
521
521
|
O(u);
|
|
522
522
|
}
|
|
523
523
|
}
|
|
@@ -533,20 +533,20 @@ function st({
|
|
|
533
533
|
);
|
|
534
534
|
},
|
|
535
535
|
YearsDropdown: ({ value: e }) => {
|
|
536
|
-
const t = d.useContext(
|
|
536
|
+
const t = d.useContext(fe) > 0, r = De();
|
|
537
537
|
return /* @__PURE__ */ c(
|
|
538
|
-
|
|
538
|
+
ue,
|
|
539
539
|
{
|
|
540
540
|
value: r.find((a) => a.value === e?.toString()),
|
|
541
541
|
onChange: (a) => {
|
|
542
542
|
if (a && "value" in a) {
|
|
543
543
|
const s = parseInt(a.value);
|
|
544
544
|
if (t) {
|
|
545
|
-
const
|
|
546
|
-
O(o);
|
|
547
|
-
} else {
|
|
548
|
-
const l = new Date(s, j.getMonth(), 1);
|
|
545
|
+
const o = new Date(A.getFullYear(), A.getMonth() + 1, 1).getMonth(), l = new Date(s, o - 1, 1);
|
|
549
546
|
O(l);
|
|
547
|
+
} else {
|
|
548
|
+
const o = new Date(s, A.getMonth(), 1);
|
|
549
|
+
O(o);
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
552
|
},
|
|
@@ -561,7 +561,7 @@ function st({
|
|
|
561
561
|
);
|
|
562
562
|
},
|
|
563
563
|
DayButton: (e) => /* @__PURE__ */ c(
|
|
564
|
-
|
|
564
|
+
Je,
|
|
565
565
|
{
|
|
566
566
|
...e,
|
|
567
567
|
pickerType: m
|
|
@@ -571,28 +571,35 @@ function st({
|
|
|
571
571
|
const t = e.days.find((I) => !I.outside)?.date;
|
|
572
572
|
if (!t)
|
|
573
573
|
return /* @__PURE__ */ c("td", { ...n, className: f("select-none flex items-center justify-center h-8 text-[11px] text-content-muted w-8 flex-shrink-0 rdp-week_number", n.className), children: /* @__PURE__ */ c("div", { className: "flex size-[--cell-size] items-center justify-center text-center" }) });
|
|
574
|
-
const r = t.getFullYear(), a = t.getMonth(),
|
|
575
|
-
i.setDate(t.getDate() -
|
|
574
|
+
const r = t.getFullYear(), a = t.getMonth(), l = (new Date(r, a, 1).getDay() + 7 - K) % 7, u = new Date(r, a, 1 - l), i = new Date(t), v = (t.getDay() + 7 - K) % 7;
|
|
575
|
+
i.setDate(t.getDate() - v);
|
|
576
576
|
const S = Math.round((i.getTime() - u.getTime()) / (10080 * 60 * 1e3)) + 1, z = h("calendar.weekLabel", { number: S });
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
"
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
"
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
577
|
+
if (m === "week") {
|
|
578
|
+
const I = () => {
|
|
579
|
+
t && ce(ie(t));
|
|
580
|
+
};
|
|
581
|
+
return /* @__PURE__ */ c(
|
|
582
|
+
"td",
|
|
583
|
+
{
|
|
584
|
+
"aria-label": z,
|
|
585
|
+
"data-week-index": S,
|
|
586
|
+
"data-week-number": S,
|
|
587
|
+
tabIndex: 0,
|
|
588
|
+
role: "button",
|
|
589
|
+
className: f(
|
|
590
|
+
"select-none flex items-center justify-center h-[30px] w-[30px] flex-shrink-0 rdp-week_number cursor-pointer hover:bg-accent hover:text-accent-foreground group-hover/week:bg-accent group-hover/week:rounded-l-lg rounded-lg transition-colors"
|
|
591
|
+
),
|
|
592
|
+
onClick: (H) => {
|
|
593
|
+
H.preventDefault(), H.stopPropagation(), I();
|
|
594
|
+
},
|
|
595
|
+
onKeyDown: (H) => {
|
|
596
|
+
(H.key === "Enter" || H.key === " ") && (H.preventDefault(), H.stopPropagation(), I());
|
|
597
|
+
},
|
|
598
|
+
children: /* @__PURE__ */ c("div", { className: "flex h-8 w-full items-center justify-center text-center text-[11px] text-content-muted", children: h("calendar.weekNumber", { number: S }) })
|
|
599
|
+
}
|
|
600
|
+
);
|
|
601
|
+
}
|
|
602
|
+
return /* @__PURE__ */ c(
|
|
596
603
|
"td",
|
|
597
604
|
{
|
|
598
605
|
...n,
|
|
@@ -607,17 +614,17 @@ function st({
|
|
|
607
614
|
}
|
|
608
615
|
);
|
|
609
616
|
},
|
|
610
|
-
...
|
|
617
|
+
...Ce
|
|
611
618
|
},
|
|
612
|
-
...
|
|
619
|
+
...xe
|
|
613
620
|
}
|
|
614
621
|
)
|
|
615
622
|
),
|
|
616
|
-
x && /* @__PURE__ */ Y("div", { className: f("flex items-center gap-2 border-t pt-3 p-3", m === "month" && w !== "single" ||
|
|
617
|
-
|
|
623
|
+
x && /* @__PURE__ */ Y("div", { className: f("flex items-center gap-2 border-t pt-3 p-3", m === "month" && w !== "single" || T === "range" || p === "range" || p === "multiple" ? "justify-between" : "justify-end"), children: [
|
|
624
|
+
T === "range" && m === "date" && /* @__PURE__ */ Y("div", { className: "flex flex-row items-center gap-1 text-content-tertiary text-xs leading-[18px] font-medium", children: [
|
|
618
625
|
"Selected:",
|
|
619
626
|
/* @__PURE__ */ c("span", { className: "text-content font-semibold", children: (() => {
|
|
620
|
-
const e =
|
|
627
|
+
const e = q;
|
|
621
628
|
if (e?.from && e?.to) {
|
|
622
629
|
const n = Math.abs(e.to.getTime() - e.from.getTime()), t = Math.ceil(n / (1e3 * 60 * 60 * 24)) + 1;
|
|
623
630
|
return `${t} day${t !== 1 ? "s" : ""}`;
|
|
@@ -625,43 +632,43 @@ function st({
|
|
|
625
632
|
return "0 days";
|
|
626
633
|
})() })
|
|
627
634
|
] }),
|
|
628
|
-
m === "week" && (
|
|
635
|
+
m === "week" && (p === "range" || p === "multiple") && /* @__PURE__ */ Y("div", { className: "flex flex-row items-center gap-1 text-content-tertiary text-xs leading-[18px] font-medium", children: [
|
|
629
636
|
"Selected:",
|
|
630
637
|
/* @__PURE__ */ c("span", { className: "text-content font-semibold", children: (() => {
|
|
631
638
|
const e = $;
|
|
632
639
|
if (!e) return "0 weeks";
|
|
633
|
-
const n = (
|
|
634
|
-
const u = Math.floor(
|
|
640
|
+
const n = (l) => Date.UTC(l.getFullYear(), l.getMonth(), l.getDate()), t = (l) => {
|
|
641
|
+
const u = Math.floor(l / 7), i = l % 7, g = [];
|
|
635
642
|
return u > 0 && g.push(`${u} week${u !== 1 ? "s" : ""}`), (i > 0 || u === 0) && g.push(`${i} day${i !== 1 ? "s" : ""}`), g.join(" ");
|
|
636
|
-
}, r =
|
|
643
|
+
}, r = R === "fiscal" && oe === "fiscalMonth", a = R === "fiscal", s = r ? "fiscal month" : a ? "fiscal week" : "week", o = r ? "fiscal months" : a ? "fiscal weeks" : "weeks";
|
|
637
644
|
if (Array.isArray(e))
|
|
638
645
|
if (a || r) {
|
|
639
|
-
const
|
|
640
|
-
return `${
|
|
646
|
+
const l = e.length;
|
|
647
|
+
return `${l} ${l !== 1 ? o : s}`;
|
|
641
648
|
} else {
|
|
642
|
-
let
|
|
649
|
+
let l = 0;
|
|
643
650
|
return e.forEach((u) => {
|
|
644
651
|
const i = n(u.startDate), g = n(u.endDate);
|
|
645
|
-
|
|
646
|
-
}), t(
|
|
652
|
+
l += Math.round((g - i) / (1e3 * 60 * 60 * 24)) + 1;
|
|
653
|
+
}), t(l);
|
|
647
654
|
}
|
|
648
655
|
else if ("from" in e) {
|
|
649
|
-
const { from:
|
|
656
|
+
const { from: l, to: u } = e;
|
|
650
657
|
if (r) {
|
|
651
658
|
if (!u) return `1 ${s}`;
|
|
652
|
-
const i = n(
|
|
653
|
-
return `${S} ${S !== 1 ?
|
|
659
|
+
const i = n(l.startDate), g = n(u.endDate), v = Math.round(Math.abs(g - i) / (1e3 * 60 * 60 * 24)) + 1, M = te ? te.reduce((z, I) => z + I, 0) / 12 : 4.33, S = Math.max(1, Math.round(v / (M * 7)));
|
|
660
|
+
return `${S} ${S !== 1 ? o : s}`;
|
|
654
661
|
} else if (a) {
|
|
655
662
|
if (!u) return `1 ${s}`;
|
|
656
|
-
const i = n(
|
|
657
|
-
return `${
|
|
663
|
+
const i = n(l.startDate), g = n(u.endDate), v = Math.round((g - i) / (10080 * 60 * 1e3)), M = v > 0 ? v : 1;
|
|
664
|
+
return `${M} ${M !== 1 ? o : s}`;
|
|
658
665
|
} else {
|
|
659
666
|
if (!u) {
|
|
660
|
-
const
|
|
667
|
+
const M = n(l.startDate), S = n(l.endDate), z = Math.round((S - M) / (1e3 * 60 * 60 * 24)) + 1;
|
|
661
668
|
return t(z);
|
|
662
669
|
}
|
|
663
|
-
const i = n(
|
|
664
|
-
return t(
|
|
670
|
+
const i = n(l.startDate), g = n(u.endDate), v = Math.round(Math.abs(g - i) / (1e3 * 60 * 60 * 24)) + 1;
|
|
671
|
+
return t(v);
|
|
665
672
|
}
|
|
666
673
|
} else
|
|
667
674
|
return `1 ${s}`;
|
|
@@ -670,7 +677,7 @@ function st({
|
|
|
670
677
|
m === "month" && (w === "range" || w === "multiple") && /* @__PURE__ */ Y("div", { className: "flex flex-row items-center gap-1 text-content-tertiary text-xs leading-[18px] font-medium", children: [
|
|
671
678
|
"Selected:",
|
|
672
679
|
/* @__PURE__ */ c("span", { className: "text-content font-semibold", children: (() => {
|
|
673
|
-
const e =
|
|
680
|
+
const e = j;
|
|
674
681
|
if (!e) return "0 months";
|
|
675
682
|
if (Array.isArray(e)) {
|
|
676
683
|
const n = e.length;
|
|
@@ -686,29 +693,29 @@ function st({
|
|
|
686
693
|
] }),
|
|
687
694
|
/* @__PURE__ */ Y("div", { className: "flex items-center gap-2", children: [
|
|
688
695
|
/* @__PURE__ */ c(
|
|
689
|
-
|
|
696
|
+
P,
|
|
690
697
|
{
|
|
691
698
|
variant: "link",
|
|
692
699
|
size: "sm",
|
|
693
|
-
onClick:
|
|
700
|
+
onClick: Oe,
|
|
694
701
|
children: h("calendar.clear")
|
|
695
702
|
}
|
|
696
703
|
),
|
|
697
704
|
/* @__PURE__ */ c(
|
|
698
|
-
|
|
705
|
+
P,
|
|
699
706
|
{
|
|
700
707
|
variant: "outline",
|
|
701
708
|
size: "sm",
|
|
702
|
-
onClick:
|
|
709
|
+
onClick: $e,
|
|
703
710
|
children: h("calendar.cancel")
|
|
704
711
|
}
|
|
705
712
|
),
|
|
706
713
|
/* @__PURE__ */ c(
|
|
707
|
-
|
|
714
|
+
P,
|
|
708
715
|
{
|
|
709
716
|
variant: "default",
|
|
710
717
|
size: "sm",
|
|
711
|
-
onClick:
|
|
718
|
+
onClick: Le,
|
|
712
719
|
children: h("calendar.apply")
|
|
713
720
|
}
|
|
714
721
|
)
|
|
@@ -716,23 +723,23 @@ function st({
|
|
|
716
723
|
] })
|
|
717
724
|
] });
|
|
718
725
|
}
|
|
719
|
-
function
|
|
720
|
-
className:
|
|
721
|
-
day:
|
|
726
|
+
function Je({
|
|
727
|
+
className: se,
|
|
728
|
+
day: J,
|
|
722
729
|
modifiers: y,
|
|
723
|
-
pickerType:
|
|
724
|
-
...
|
|
730
|
+
pickerType: Q,
|
|
731
|
+
...F
|
|
725
732
|
}) {
|
|
726
|
-
const
|
|
733
|
+
const X = d.useRef(null);
|
|
727
734
|
return d.useEffect(() => {
|
|
728
|
-
y.focused &&
|
|
735
|
+
y.focused && X.current?.focus();
|
|
729
736
|
}, [y.focused]), /* @__PURE__ */ c(
|
|
730
|
-
|
|
737
|
+
P,
|
|
731
738
|
{
|
|
732
|
-
ref:
|
|
739
|
+
ref: X,
|
|
733
740
|
variant: "ghost",
|
|
734
741
|
size: "sm",
|
|
735
|
-
"data-day":
|
|
742
|
+
"data-day": J.date.toLocaleDateString(),
|
|
736
743
|
"data-selected-single": y.selected && !y.range_start && !y.range_end && !y.range_middle,
|
|
737
744
|
"data-range-start": y.range_start,
|
|
738
745
|
"data-range-end": y.range_end,
|
|
@@ -740,22 +747,22 @@ function Ge({
|
|
|
740
747
|
className: f(
|
|
741
748
|
"gap-2 whitespace-nowrap focus-visible:ring-1 focus-visible:ring-focus-ring disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 px-3 rounded-lg flex items-center justify-center font-normal transition-colors w-5 h-5 border border-transparent focus-visible:outline-none text-sm rdp-day rdp-day_button",
|
|
742
749
|
// Hover styling
|
|
743
|
-
|
|
744
|
-
|
|
750
|
+
Q !== "week" && "hover:bg-accent hover:text-accent-foreground hover:border-brand",
|
|
751
|
+
Q === "week" && "hover:bg-transparent hover:text-inherit hover:border-transparent",
|
|
745
752
|
// Selection state
|
|
746
753
|
"data-[selected-single=true]:bg-brand data-[selected-single=true]:text-brand-foreground data-[selected-single=true]:rounded-lg data-[selected-single=true]:border-transparent",
|
|
747
754
|
"data-[range-start=true]:bg-brand data-[range-start=true]:text-brand-foreground data-[range-start=true]:rounded-lg data-[range-start=true]:border-transparent",
|
|
748
755
|
"data-[range-end=true]:bg-brand data-[range-end=true]:text-brand-foreground data-[range-end=true]:rounded-lg data-[range-end=true]:border-transparent",
|
|
749
756
|
"data-[range-middle=true]:text-accent-foreground data-[range-middle=true]:rounded-none",
|
|
750
|
-
|
|
757
|
+
se
|
|
751
758
|
),
|
|
752
759
|
"data-component": "calendar-day",
|
|
753
|
-
...
|
|
754
|
-
disabled:
|
|
760
|
+
...F,
|
|
761
|
+
disabled: F.disabled || y.disabled
|
|
755
762
|
}
|
|
756
763
|
);
|
|
757
764
|
}
|
|
758
765
|
export {
|
|
759
|
-
|
|
760
|
-
|
|
766
|
+
ot as Calendar,
|
|
767
|
+
Je as CalendarDayButton
|
|
761
768
|
};
|