react-modular-datepicker 0.0.6 → 0.0.8
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/classNames.d.ts +12 -0
- package/dist/components/Calendar.d.ts +3 -3
- package/dist/components/Day.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +84 -109
- package/dist/index.js +199 -189
- package/dist/index.js.map +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +23 -4
package/dist/index.js
CHANGED
|
@@ -2,36 +2,59 @@ import { n as e, r as t, t as n } from "./useDates-CjPuu-VA.js";
|
|
|
2
2
|
import { addMonth as r, composeEventHandlers as i, getCalendars as a, isBackDisabled as o, isForwardDisabled as s, subtractMonth as c } from "./utils.js";
|
|
3
3
|
import { useEffect as l, useRef as u, useState as d } from "react";
|
|
4
4
|
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
5
|
-
//#region src/
|
|
6
|
-
var m =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
5
|
+
//#region src/classNames.ts
|
|
6
|
+
var m = {
|
|
7
|
+
root: "w-fit flex flex-col p-4 bg-white rounded-lg shadow-lg",
|
|
8
|
+
header: "flex items-center justify-between border-b-2 border-brand-gray-light/40 pb-2",
|
|
9
|
+
headerMultiMonth: "border-b-0 pb-0",
|
|
10
|
+
calendarsContainer: "flex flex-wrap gap-4",
|
|
11
|
+
calendarContainer: "flex-1 min-w-[280px] max-w-full",
|
|
12
|
+
navButtonSlotStart: "w-9 flex justify-start",
|
|
13
|
+
navButtonSlotEnd: "w-9 flex justify-end",
|
|
14
|
+
headerTitleContainer: "font-semibold text-brand-text text-center flex-1",
|
|
15
|
+
weekdayGrid: "grid grid-cols-7 gap-1 mb-1 border-b border-brand-gray-light/40",
|
|
16
|
+
weekday: "text-center text-xs text-gray-400 py-2",
|
|
17
|
+
daysGrid: "grid grid-cols-7 gap-px bg-brand-gray-light/20",
|
|
18
|
+
footer: "mt-4",
|
|
19
|
+
navButton: "p-2 text-brand-text hover:bg-gray-100 rounded-full transition-colors cursor-pointer disabled:opacity-30 disabled:pointer-events-none",
|
|
20
|
+
navButtonHidden: "invisible pointer-events-none",
|
|
21
|
+
monthYearContainer: "flex gap-8",
|
|
22
|
+
monthYearLabel: "flex gap-1 items-center font-semibold text-brand-text",
|
|
23
|
+
monthYearButton: "hover:bg-gray-100 px-2 py-1 rounded cursor-pointer",
|
|
24
|
+
day: {
|
|
25
|
+
day: "rmdp-day group",
|
|
26
|
+
selected: "rmdp-day-selected",
|
|
27
|
+
unselected: "rmdp-day-unselected",
|
|
28
|
+
disabled: "rmdp-day-disabled",
|
|
29
|
+
empty: "rmdp-day-empty",
|
|
30
|
+
rangeStart: "rmdp-day-range-start",
|
|
31
|
+
rangeEnd: "rmdp-day-range-end",
|
|
32
|
+
rangeBetween: "rmdp-day-range-between",
|
|
33
|
+
rangeHovering: "rmdp-day-range-hovering"
|
|
34
|
+
},
|
|
35
|
+
monthsGrid: "grid grid-cols-3 gap-2 animate-slide-in-top",
|
|
36
|
+
monthButton: "py-3 rounded-lg hover:bg-brand-gray-light transition-colors cursor-pointer disabled:opacity-30 disabled:pointer-events-none",
|
|
37
|
+
monthButtonSelected: "bg-brand-gold text-white",
|
|
38
|
+
monthButtonUnselected: "text-brand-text",
|
|
39
|
+
yearsGrid: "grid grid-cols-3 gap-2 max-h-[210px] overflow-y-auto pr-2 animate-slide-in-top rmdp-scrollbar",
|
|
40
|
+
yearButton: "py-3 rounded-lg hover:bg-brand-gray-light transition-colors cursor-pointer disabled:opacity-30 disabled:pointer-events-none",
|
|
41
|
+
yearButtonSelected: "bg-brand-gold text-white",
|
|
42
|
+
yearButtonUnselected: "text-brand-text"
|
|
43
|
+
}, h = (e) => {
|
|
44
|
+
let t = { ...m };
|
|
45
|
+
if (!e) return t;
|
|
46
|
+
for (let n in e) {
|
|
47
|
+
let r = n;
|
|
48
|
+
r === "day" && e.day ? t.day = {
|
|
49
|
+
...m.day,
|
|
50
|
+
...e.day
|
|
51
|
+
} : e[r] && (t[r] = e[r]);
|
|
52
|
+
}
|
|
53
|
+
return t;
|
|
31
54
|
};
|
|
32
55
|
//#endregion
|
|
33
56
|
//#region src/i18n.ts
|
|
34
|
-
function
|
|
57
|
+
function g(e = t, n) {
|
|
35
58
|
return {
|
|
36
59
|
months: e.getMonths(n),
|
|
37
60
|
weekdays: e.getWeekdays(n),
|
|
@@ -39,15 +62,15 @@ function h(e = t, n) {
|
|
|
39
62
|
forward: "Next month"
|
|
40
63
|
};
|
|
41
64
|
}
|
|
42
|
-
function
|
|
65
|
+
function _(e = t, n, r) {
|
|
43
66
|
return {
|
|
44
|
-
...
|
|
67
|
+
...g(e, n),
|
|
45
68
|
...r
|
|
46
69
|
};
|
|
47
70
|
}
|
|
48
71
|
//#endregion
|
|
49
72
|
//#region src/components/CalendarHeader.tsx
|
|
50
|
-
var
|
|
73
|
+
var v = () => /* @__PURE__ */ f("svg", {
|
|
51
74
|
width: "20",
|
|
52
75
|
height: "20",
|
|
53
76
|
viewBox: "0 0 24 24",
|
|
@@ -57,7 +80,7 @@ var _ = () => /* @__PURE__ */ f("svg", {
|
|
|
57
80
|
strokeLinecap: "round",
|
|
58
81
|
strokeLinejoin: "round",
|
|
59
82
|
children: /* @__PURE__ */ f("polyline", { points: "15 18 9 12 15 6" })
|
|
60
|
-
}),
|
|
83
|
+
}), y = () => /* @__PURE__ */ f("svg", {
|
|
61
84
|
width: "20",
|
|
62
85
|
height: "20",
|
|
63
86
|
viewBox: "0 0 24 24",
|
|
@@ -67,103 +90,65 @@ var _ = () => /* @__PURE__ */ f("svg", {
|
|
|
67
90
|
strokeLinecap: "round",
|
|
68
91
|
strokeLinejoin: "round",
|
|
69
92
|
children: /* @__PURE__ */ f("polyline", { points: "9 18 15 12 9 6" })
|
|
70
|
-
}),
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
" - ",
|
|
110
|
-
i[n.month],
|
|
111
|
-
" ",
|
|
112
|
-
n.year
|
|
113
|
-
] });
|
|
114
|
-
})()
|
|
93
|
+
}), b = ({ calendars: e, getBackProps: t, getForwardProps: n, setView: r, monthNames: i, t: a, classNames: o, slideDirection: s, currentView: c }) => {
|
|
94
|
+
if (e.length > 1 && e.length < 12) return null;
|
|
95
|
+
let l = e[0], u = e[e.length - 1], d = [o.header, e.length > 1 ? o.headerMultiMonth : ""].filter(Boolean).join(" "), m = (e) => [o.navButton, e ? o.navButtonHidden : ""].filter(Boolean).join(" "), h = !!(c && c !== "days");
|
|
96
|
+
return /* @__PURE__ */ p("div", {
|
|
97
|
+
className: d,
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ f("button", {
|
|
100
|
+
...t({ calendars: e }),
|
|
101
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
102
|
+
className: m(h),
|
|
103
|
+
"aria-label": a.back,
|
|
104
|
+
children: /* @__PURE__ */ f(v, {})
|
|
105
|
+
}),
|
|
106
|
+
/* @__PURE__ */ f("div", {
|
|
107
|
+
className: o.monthYearContainer,
|
|
108
|
+
children: e.length === 1 ? /* @__PURE__ */ p("div", {
|
|
109
|
+
className: `${o.monthYearLabel} ${s === "left" ? "animate-slide-in-left" : s === "right" ? "animate-slide-in-right" : ""}`,
|
|
110
|
+
children: [/* @__PURE__ */ f("button", {
|
|
111
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
112
|
+
onClick: () => r(c === "months" ? "days" : "months"),
|
|
113
|
+
className: o.monthYearButton,
|
|
114
|
+
children: i[e[0].month]
|
|
115
|
+
}), /* @__PURE__ */ f("button", {
|
|
116
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
117
|
+
onClick: () => r(c === "years" ? "days" : "years"),
|
|
118
|
+
className: o.monthYearButton,
|
|
119
|
+
children: e[0].year
|
|
120
|
+
})]
|
|
121
|
+
}, `${e[0].month}-${e[0].year}`) : /* @__PURE__ */ f("div", {
|
|
122
|
+
className: `${o.monthYearLabel} ${s === "left" ? "animate-slide-in-left" : s === "right" ? "animate-slide-in-right" : ""}`,
|
|
123
|
+
children: /* @__PURE__ */ f("span", { children: l.year === u.year ? l.year : `${l.year} - ${u.year}` })
|
|
124
|
+
})
|
|
125
|
+
}),
|
|
126
|
+
/* @__PURE__ */ f("button", {
|
|
127
|
+
...n({ calendars: e }),
|
|
128
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
129
|
+
className: m(h),
|
|
130
|
+
"aria-label": a.forward,
|
|
131
|
+
children: /* @__PURE__ */ f(y, {})
|
|
115
132
|
})
|
|
133
|
+
]
|
|
134
|
+
});
|
|
135
|
+
}, x = ({ dateObj: e, getDateProps: t, dayProps: n, classNames: r }) => {
|
|
136
|
+
if (!e) return /* @__PURE__ */ f("div", { className: r.day.empty });
|
|
137
|
+
let { date: i, selected: a, selectable: o, isRangeStart: s, isRangeEnd: c, isRangeBetween: l, isRangeHovering: u, isRangeActive: d } = e, p = r.day, m = "rounded-full";
|
|
138
|
+
m = s && c ? `${p.selected} rounded-full` : s ? `${p.rangeStart} ${d ? "rounded-l-full rounded-r-none" : "rounded-full"}` : c ? `${p.rangeEnd} ${d ? "rounded-r-full rounded-l-none" : "rounded-full"}` : l ? p.rangeBetween || "" : u ? p.rangeHovering || "" : a ? p.selected || "" : o ? p.unselected || "" : p.disabled || "";
|
|
139
|
+
let h = (e.modifiers || []).map((e) => p[e] || e).filter(Boolean).join(" "), g = [
|
|
140
|
+
p.day,
|
|
141
|
+
m,
|
|
142
|
+
h
|
|
143
|
+
].filter(Boolean).join(" ");
|
|
144
|
+
return /* @__PURE__ */ f("button", {
|
|
145
|
+
...t({
|
|
146
|
+
dateObj: e,
|
|
147
|
+
...n
|
|
116
148
|
}),
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
className: `${o.navButton} ${c && c !== "days" ? "invisible pointer-events-none" : ""}`,
|
|
121
|
-
"aria-label": a.forward,
|
|
122
|
-
children: /* @__PURE__ */ f(v, {})
|
|
123
|
-
})
|
|
124
|
-
]
|
|
125
|
-
}), b = {
|
|
126
|
-
root: "w-fit flex flex-col p-4 bg-white rounded-lg shadow-lg",
|
|
127
|
-
header: "flex items-center justify-between border-b-2 border-brand-gray-light/40 pb-2",
|
|
128
|
-
calendarsContainer: "flex flex-wrap gap-4 mt-3",
|
|
129
|
-
calendarContainer: "flex-1 min-w-[280px] max-w-full",
|
|
130
|
-
weekdayGrid: "grid grid-cols-7 gap-1 mb-1 border-b border-brand-gray-light/40",
|
|
131
|
-
weekday: "text-center text-xs text-gray-400 py-2",
|
|
132
|
-
daysGrid: "grid grid-cols-7 gap-px bg-brand-gray-light/20",
|
|
133
|
-
footer: "mt-4",
|
|
134
|
-
navButton: "p-2 text-brand-text hover:bg-gray-100 rounded-full transition-colors cursor-pointer disabled:opacity-30 disabled:pointer-events-none",
|
|
135
|
-
monthYearContainer: "flex gap-8",
|
|
136
|
-
monthYearLabel: "flex gap-1 items-center font-semibold text-brand-text",
|
|
137
|
-
monthYearButton: "hover:bg-gray-100 px-2 py-1 rounded cursor-pointer",
|
|
138
|
-
day: {
|
|
139
|
-
day: "aspect-square flex items-center justify-center text-sm font-medium transition-all relative group cursor-pointer p-px",
|
|
140
|
-
selected: "bg-brand-gold text-white rounded-full",
|
|
141
|
-
unselected: "bg-white hover:bg-brand-gray-light text-brand-text",
|
|
142
|
-
disabled: "bg-white text-gray-300 cursor-not-allowed",
|
|
143
|
-
rangeStart: "bg-brand-gold text-white",
|
|
144
|
-
rangeEnd: "bg-brand-gold text-white",
|
|
145
|
-
rangeBetween: "bg-brand-gold/25 text-brand-text",
|
|
146
|
-
rangeHovering: "bg-brand-gold/25 text-brand-text"
|
|
147
|
-
},
|
|
148
|
-
monthsGrid: "grid grid-cols-3 gap-2 animate-slide-in-top",
|
|
149
|
-
monthButton: "py-3 rounded-lg hover:bg-brand-gray-light transition-colors cursor-pointer disabled:opacity-30 disabled:pointer-events-none",
|
|
150
|
-
monthButtonSelected: "bg-brand-gold text-white",
|
|
151
|
-
monthButtonUnselected: "text-brand-text",
|
|
152
|
-
yearsGrid: "grid grid-cols-3 gap-2 max-h-[300px] overflow-y-auto pr-2 animate-slide-in-top",
|
|
153
|
-
yearButton: "py-3 rounded-lg hover:bg-brand-gray-light transition-colors cursor-pointer disabled:opacity-30 disabled:pointer-events-none",
|
|
154
|
-
yearButtonSelected: "bg-brand-gold text-white",
|
|
155
|
-
yearButtonUnselected: "text-brand-text"
|
|
156
|
-
}, x = (e) => {
|
|
157
|
-
let t = { ...b };
|
|
158
|
-
if (!e) return t;
|
|
159
|
-
for (let n in e) {
|
|
160
|
-
let r = n;
|
|
161
|
-
r === "day" && e.day ? t.day = {
|
|
162
|
-
...b.day,
|
|
163
|
-
...e.day
|
|
164
|
-
} : e[r] && (t[r] = e[r]);
|
|
165
|
-
}
|
|
166
|
-
return t;
|
|
149
|
+
className: g,
|
|
150
|
+
children: i.getDate()
|
|
151
|
+
});
|
|
167
152
|
}, S = ({ year: e, month: t, monthNames: n, minDate: r, maxDate: i, onMonthSelect: a, classNames: o }) => {
|
|
168
153
|
let s = (t) => !!(r && e === r.getFullYear() && t < r.getMonth() || i && e === i.getFullYear() && t > i.getMonth());
|
|
169
154
|
return /* @__PURE__ */ f("div", {
|
|
@@ -201,123 +186,148 @@ var _ = () => /* @__PURE__ */ f("svg", {
|
|
|
201
186
|
}, t))
|
|
202
187
|
});
|
|
203
188
|
}, w = (e) => {
|
|
204
|
-
let { classNames: r, locale: i, translations: a, adapter: o = t, firstDayOfWeek: s = 0, header: c, footer: l,
|
|
205
|
-
...
|
|
189
|
+
let { classNames: r, locale: i, translations: a, adapter: o = t, firstDayOfWeek: s = 0, header: c, footer: l, getDayProps: u, ...m } = e, g = h(r), [w, T] = d("days"), [E, D] = d(null), O = _(o, i, a), k = O.weekdays, A = O.months, { calendars: j, getBackProps: M, getForwardProps: N, getDateProps: P, setOffset: F } = n({
|
|
190
|
+
...m,
|
|
206
191
|
adapter: o,
|
|
207
192
|
firstDayOfWeek: s
|
|
208
|
-
}),
|
|
209
|
-
let n = o.set(o.set(o.date(e.date || /* @__PURE__ */ new Date()), "year",
|
|
210
|
-
|
|
211
|
-
},
|
|
212
|
-
let n = o.set(o.set(o.date(e.date || /* @__PURE__ */ new Date()), "year",
|
|
213
|
-
|
|
214
|
-
},
|
|
215
|
-
let t =
|
|
193
|
+
}), I = [...k.slice(s), ...k.slice(0, s)], { month: L, year: R } = j[0], z = (t) => {
|
|
194
|
+
let n = o.set(o.set(o.date(e.date || /* @__PURE__ */ new Date()), "year", R), "month", L), r = o.set(n, "month", t), i = o.startOf(o.date(e.date || /* @__PURE__ */ new Date()), "month"), a = o.diff(r, i, "month");
|
|
195
|
+
D(null), F(a), T("days");
|
|
196
|
+
}, B = (t) => {
|
|
197
|
+
let n = o.set(o.set(o.date(e.date || /* @__PURE__ */ new Date()), "year", R), "month", L), r = o.set(n, "year", t), i = o.startOf(o.date(e.date || /* @__PURE__ */ new Date()), "month"), a = o.diff(r, i, "month");
|
|
198
|
+
D(null), F(a), T("days");
|
|
199
|
+
}, V = m.monthsToDisplay || 1, H = (e) => {
|
|
200
|
+
let t = M({
|
|
201
|
+
offset: V,
|
|
202
|
+
...e
|
|
203
|
+
});
|
|
216
204
|
return {
|
|
217
205
|
...t,
|
|
218
206
|
onClick: (e) => {
|
|
219
|
-
|
|
207
|
+
D("left"), t.onClick?.(e);
|
|
220
208
|
}
|
|
221
209
|
};
|
|
222
|
-
},
|
|
223
|
-
let t =
|
|
210
|
+
}, U = (e) => {
|
|
211
|
+
let t = N({
|
|
212
|
+
offset: V,
|
|
213
|
+
...e
|
|
214
|
+
});
|
|
224
215
|
return {
|
|
225
216
|
...t,
|
|
226
217
|
onClick: (e) => {
|
|
227
|
-
|
|
218
|
+
D("right"), t.onClick?.(e);
|
|
228
219
|
}
|
|
229
220
|
};
|
|
230
221
|
};
|
|
231
222
|
return /* @__PURE__ */ p("div", {
|
|
232
|
-
className: `rmdp ${
|
|
223
|
+
className: `rmdp ${g.root}`,
|
|
233
224
|
children: [
|
|
234
225
|
typeof c == "function" ? c({
|
|
235
|
-
calendars:
|
|
236
|
-
getBackProps:
|
|
237
|
-
getForwardProps:
|
|
238
|
-
setView:
|
|
239
|
-
monthNames:
|
|
240
|
-
t:
|
|
241
|
-
slideDirection:
|
|
242
|
-
currentView:
|
|
243
|
-
}) : c || /* @__PURE__ */ f(
|
|
244
|
-
calendars:
|
|
245
|
-
getBackProps:
|
|
246
|
-
getForwardProps:
|
|
247
|
-
setView:
|
|
248
|
-
monthNames:
|
|
249
|
-
t:
|
|
250
|
-
classNames:
|
|
251
|
-
slideDirection:
|
|
252
|
-
currentView:
|
|
226
|
+
calendars: j,
|
|
227
|
+
getBackProps: H,
|
|
228
|
+
getForwardProps: U,
|
|
229
|
+
setView: T,
|
|
230
|
+
monthNames: A,
|
|
231
|
+
t: O,
|
|
232
|
+
slideDirection: E,
|
|
233
|
+
currentView: w
|
|
234
|
+
}) : c || /* @__PURE__ */ f(b, {
|
|
235
|
+
calendars: j,
|
|
236
|
+
getBackProps: H,
|
|
237
|
+
getForwardProps: U,
|
|
238
|
+
setView: T,
|
|
239
|
+
monthNames: A,
|
|
240
|
+
t: O,
|
|
241
|
+
classNames: g,
|
|
242
|
+
slideDirection: E,
|
|
243
|
+
currentView: w
|
|
253
244
|
}),
|
|
254
245
|
/* @__PURE__ */ p("div", {
|
|
255
|
-
className:
|
|
246
|
+
className: g.calendarsContainer,
|
|
256
247
|
children: [
|
|
257
|
-
|
|
258
|
-
className:
|
|
248
|
+
w === "months" && j.map((t) => /* @__PURE__ */ f("div", {
|
|
249
|
+
className: g.calendarContainer,
|
|
259
250
|
children: /* @__PURE__ */ f(S, {
|
|
260
251
|
year: t.year,
|
|
261
252
|
month: t.month,
|
|
262
|
-
monthNames:
|
|
253
|
+
monthNames: A,
|
|
263
254
|
minDate: e.minDate,
|
|
264
255
|
maxDate: e.maxDate,
|
|
265
|
-
onMonthSelect:
|
|
266
|
-
classNames:
|
|
256
|
+
onMonthSelect: z,
|
|
257
|
+
classNames: g
|
|
267
258
|
})
|
|
268
259
|
}, `months-${t.year}`)),
|
|
269
|
-
|
|
270
|
-
className:
|
|
260
|
+
w === "years" && j.map((t) => /* @__PURE__ */ f("div", {
|
|
261
|
+
className: g.calendarContainer,
|
|
271
262
|
children: /* @__PURE__ */ f(C, {
|
|
272
263
|
year: t.year,
|
|
273
264
|
minDate: e.minDate,
|
|
274
265
|
maxDate: e.maxDate,
|
|
275
266
|
adapter: o,
|
|
276
|
-
onYearSelect:
|
|
277
|
-
classNames:
|
|
267
|
+
onYearSelect: B,
|
|
268
|
+
classNames: g
|
|
278
269
|
})
|
|
279
270
|
}, `years-${t.year}`)),
|
|
280
|
-
|
|
281
|
-
className:
|
|
271
|
+
w === "days" && j.map((e, t) => /* @__PURE__ */ p("div", {
|
|
272
|
+
className: g.calendarContainer,
|
|
282
273
|
children: [
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
"aria-label": O[e.month],
|
|
286
|
-
className: "block w-full text-center font-semibold mb-2 text-brand-text",
|
|
274
|
+
j.length > 1 && /* @__PURE__ */ p("div", {
|
|
275
|
+
className: g.header,
|
|
287
276
|
children: [
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
277
|
+
/* @__PURE__ */ f("div", {
|
|
278
|
+
className: g.navButtonSlotStart,
|
|
279
|
+
children: t === 0 && j.length < 12 && /* @__PURE__ */ f("button", {
|
|
280
|
+
...H({ calendars: j }),
|
|
281
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
282
|
+
className: g.navButton,
|
|
283
|
+
"aria-label": O.back,
|
|
284
|
+
children: /* @__PURE__ */ f(v, {})
|
|
285
|
+
})
|
|
286
|
+
}),
|
|
287
|
+
/* @__PURE__ */ p("span", {
|
|
288
|
+
className: g.headerTitleContainer,
|
|
289
|
+
children: [A[e.month], j.length < 12 ? ` ${e.year}` : ""]
|
|
290
|
+
}),
|
|
291
|
+
/* @__PURE__ */ f("div", {
|
|
292
|
+
className: g.navButtonSlotEnd,
|
|
293
|
+
children: t === j.length - 1 && j.length < 12 && /* @__PURE__ */ f("button", {
|
|
294
|
+
...U({ calendars: j }),
|
|
295
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
296
|
+
className: g.navButton,
|
|
297
|
+
"aria-label": O.forward,
|
|
298
|
+
children: /* @__PURE__ */ f(y, {})
|
|
299
|
+
})
|
|
300
|
+
})
|
|
291
301
|
]
|
|
292
302
|
}),
|
|
293
303
|
/* @__PURE__ */ f("div", {
|
|
294
|
-
className:
|
|
295
|
-
children:
|
|
296
|
-
className:
|
|
304
|
+
className: g.weekdayGrid,
|
|
305
|
+
children: I.map((e) => /* @__PURE__ */ f("div", {
|
|
306
|
+
className: g.weekday,
|
|
297
307
|
children: e
|
|
298
308
|
}, e))
|
|
299
309
|
}),
|
|
300
310
|
/* @__PURE__ */ f("div", {
|
|
301
|
-
className: `${
|
|
302
|
-
children: e.weeks.map((e, t) => e.map((e, n) => /* @__PURE__ */ f(
|
|
311
|
+
className: `${g.daysGrid} ${E === "left" ? "animate-slide-in-left" : E === "right" ? "animate-slide-in-right" : ""}`,
|
|
312
|
+
children: e.weeks.map((e, t) => e.map((e, n) => /* @__PURE__ */ f(x, {
|
|
303
313
|
dateObj: e,
|
|
304
|
-
getDateProps:
|
|
305
|
-
|
|
306
|
-
|
|
314
|
+
getDateProps: P,
|
|
315
|
+
dayProps: e ? u?.(e) : void 0,
|
|
316
|
+
classNames: g
|
|
307
317
|
}, `${t}-${n}`)))
|
|
308
|
-
})
|
|
318
|
+
}, `daysGrid-${e.month}-${e.year}`)
|
|
309
319
|
]
|
|
310
320
|
}, `${e.month}-${e.year}`))
|
|
311
321
|
]
|
|
312
322
|
}),
|
|
313
323
|
l && /* @__PURE__ */ f("div", {
|
|
314
|
-
className:
|
|
324
|
+
className: g.footer,
|
|
315
325
|
children: l
|
|
316
326
|
})
|
|
317
327
|
]
|
|
318
328
|
});
|
|
319
329
|
};
|
|
320
330
|
//#endregion
|
|
321
|
-
export { w as Calendar,
|
|
331
|
+
export { w as Calendar, b as CalendarHeader, v as ChevronLeftIcon, y as ChevronRightIcon, x as Day, e as DayjsAdapter, S as MonthSelection, C as YearSelection, r as addMonth, i as composeEventHandlers, t as defaultAdapter, m as defaultClassNames, a as getCalendars, g as getDefaults, _ as getTranslations, o as isBackDisabled, s as isForwardDisabled, h as mergeClassNames, c as subtractMonth, n as useDates };
|
|
322
332
|
|
|
323
333
|
//# sourceMappingURL=index.js.map
|