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