react-modular-datepicker 0.0.7 → 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 +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +68 -48
- package/dist/index.js +198 -180
- 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 +1 -1
package/dist/index.js
CHANGED
|
@@ -2,28 +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
|
-
|
|
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;
|
|
23
54
|
};
|
|
24
55
|
//#endregion
|
|
25
56
|
//#region src/i18n.ts
|
|
26
|
-
function
|
|
57
|
+
function g(e = t, n) {
|
|
27
58
|
return {
|
|
28
59
|
months: e.getMonths(n),
|
|
29
60
|
weekdays: e.getWeekdays(n),
|
|
@@ -31,15 +62,15 @@ function h(e = t, n) {
|
|
|
31
62
|
forward: "Next month"
|
|
32
63
|
};
|
|
33
64
|
}
|
|
34
|
-
function
|
|
65
|
+
function _(e = t, n, r) {
|
|
35
66
|
return {
|
|
36
|
-
...
|
|
67
|
+
...g(e, n),
|
|
37
68
|
...r
|
|
38
69
|
};
|
|
39
70
|
}
|
|
40
71
|
//#endregion
|
|
41
72
|
//#region src/components/CalendarHeader.tsx
|
|
42
|
-
var
|
|
73
|
+
var v = () => /* @__PURE__ */ f("svg", {
|
|
43
74
|
width: "20",
|
|
44
75
|
height: "20",
|
|
45
76
|
viewBox: "0 0 24 24",
|
|
@@ -49,7 +80,7 @@ var _ = () => /* @__PURE__ */ f("svg", {
|
|
|
49
80
|
strokeLinecap: "round",
|
|
50
81
|
strokeLinejoin: "round",
|
|
51
82
|
children: /* @__PURE__ */ f("polyline", { points: "15 18 9 12 15 6" })
|
|
52
|
-
}),
|
|
83
|
+
}), y = () => /* @__PURE__ */ f("svg", {
|
|
53
84
|
width: "20",
|
|
54
85
|
height: "20",
|
|
55
86
|
viewBox: "0 0 24 24",
|
|
@@ -59,103 +90,65 @@ var _ = () => /* @__PURE__ */ f("svg", {
|
|
|
59
90
|
strokeLinecap: "round",
|
|
60
91
|
strokeLinejoin: "round",
|
|
61
92
|
children: /* @__PURE__ */ f("polyline", { points: "9 18 15 12 9 6" })
|
|
62
|
-
}),
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
i[n.month],
|
|
103
|
-
" ",
|
|
104
|
-
n.year
|
|
105
|
-
] });
|
|
106
|
-
})()
|
|
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, {})
|
|
107
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
|
|
108
148
|
}),
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
className: `${o.navButton} ${c && c !== "days" ? "invisible pointer-events-none" : ""}`,
|
|
113
|
-
"aria-label": a.forward,
|
|
114
|
-
children: /* @__PURE__ */ f(v, {})
|
|
115
|
-
})
|
|
116
|
-
]
|
|
117
|
-
}), b = {
|
|
118
|
-
root: "w-fit flex flex-col p-4 bg-white rounded-lg shadow-lg",
|
|
119
|
-
header: "flex items-center justify-between border-b-2 border-brand-gray-light/40 pb-2",
|
|
120
|
-
calendarsContainer: "flex flex-wrap gap-4",
|
|
121
|
-
calendarContainer: "flex-1 min-w-[280px] max-w-full",
|
|
122
|
-
weekdayGrid: "grid grid-cols-7 gap-1 mb-1 border-b border-brand-gray-light/40",
|
|
123
|
-
weekday: "text-center text-xs text-gray-400 py-2",
|
|
124
|
-
daysGrid: "grid grid-cols-7 gap-px bg-brand-gray-light/20",
|
|
125
|
-
footer: "mt-4",
|
|
126
|
-
navButton: "p-2 text-brand-text hover:bg-gray-100 rounded-full transition-colors cursor-pointer disabled:opacity-30 disabled:pointer-events-none",
|
|
127
|
-
monthYearContainer: "flex gap-8",
|
|
128
|
-
monthYearLabel: "flex gap-1 items-center font-semibold text-brand-text",
|
|
129
|
-
monthYearButton: "hover:bg-gray-100 px-2 py-1 rounded cursor-pointer",
|
|
130
|
-
day: {
|
|
131
|
-
day: "aspect-square flex items-center justify-center text-sm font-medium transition-all relative group cursor-pointer p-px",
|
|
132
|
-
selected: "bg-brand-gold text-white rounded-full",
|
|
133
|
-
unselected: "bg-white hover:bg-brand-gray-light text-brand-text",
|
|
134
|
-
disabled: "bg-white text-gray-300 cursor-not-allowed",
|
|
135
|
-
rangeStart: "bg-brand-gold text-white",
|
|
136
|
-
rangeEnd: "bg-brand-gold text-white",
|
|
137
|
-
rangeBetween: "bg-brand-gold/25 text-brand-text",
|
|
138
|
-
rangeHovering: "bg-brand-gold/25 text-brand-text"
|
|
139
|
-
},
|
|
140
|
-
monthsGrid: "grid grid-cols-3 gap-2 animate-slide-in-top",
|
|
141
|
-
monthButton: "py-3 rounded-lg hover:bg-brand-gray-light transition-colors cursor-pointer disabled:opacity-30 disabled:pointer-events-none",
|
|
142
|
-
monthButtonSelected: "bg-brand-gold text-white",
|
|
143
|
-
monthButtonUnselected: "text-brand-text",
|
|
144
|
-
yearsGrid: "grid grid-cols-3 gap-2 max-h-[210px] overflow-y-auto pr-2 animate-slide-in-top rmdp-scrollbar",
|
|
145
|
-
yearButton: "py-3 rounded-lg hover:bg-brand-gray-light transition-colors cursor-pointer disabled:opacity-30 disabled:pointer-events-none",
|
|
146
|
-
yearButtonSelected: "bg-brand-gold text-white",
|
|
147
|
-
yearButtonUnselected: "text-brand-text"
|
|
148
|
-
}, x = (e) => {
|
|
149
|
-
let t = { ...b };
|
|
150
|
-
if (!e) return t;
|
|
151
|
-
for (let n in e) {
|
|
152
|
-
let r = n;
|
|
153
|
-
r === "day" && e.day ? t.day = {
|
|
154
|
-
...b.day,
|
|
155
|
-
...e.day
|
|
156
|
-
} : e[r] && (t[r] = e[r]);
|
|
157
|
-
}
|
|
158
|
-
return t;
|
|
149
|
+
className: g,
|
|
150
|
+
children: i.getDate()
|
|
151
|
+
});
|
|
159
152
|
}, S = ({ year: e, month: t, monthNames: n, minDate: r, maxDate: i, onMonthSelect: a, classNames: o }) => {
|
|
160
153
|
let s = (t) => !!(r && e === r.getFullYear() && t < r.getMonth() || i && e === i.getFullYear() && t > i.getMonth());
|
|
161
154
|
return /* @__PURE__ */ f("div", {
|
|
@@ -193,123 +186,148 @@ var _ = () => /* @__PURE__ */ f("svg", {
|
|
|
193
186
|
}, t))
|
|
194
187
|
});
|
|
195
188
|
}, w = (e) => {
|
|
196
|
-
let { classNames: r, locale: i, translations: a, adapter: o = t, firstDayOfWeek: s = 0, header: c, footer: l, getDayProps: u, ...
|
|
197
|
-
...
|
|
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,
|
|
198
191
|
adapter: o,
|
|
199
192
|
firstDayOfWeek: s
|
|
200
|
-
}),
|
|
201
|
-
let n = o.set(o.set(o.date(e.date || /* @__PURE__ */ new Date()), "year",
|
|
202
|
-
|
|
203
|
-
},
|
|
204
|
-
let n = o.set(o.set(o.date(e.date || /* @__PURE__ */ new Date()), "year",
|
|
205
|
-
|
|
206
|
-
},
|
|
207
|
-
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
|
+
});
|
|
208
204
|
return {
|
|
209
205
|
...t,
|
|
210
206
|
onClick: (e) => {
|
|
211
|
-
|
|
207
|
+
D("left"), t.onClick?.(e);
|
|
212
208
|
}
|
|
213
209
|
};
|
|
214
|
-
},
|
|
215
|
-
let t =
|
|
210
|
+
}, U = (e) => {
|
|
211
|
+
let t = N({
|
|
212
|
+
offset: V,
|
|
213
|
+
...e
|
|
214
|
+
});
|
|
216
215
|
return {
|
|
217
216
|
...t,
|
|
218
217
|
onClick: (e) => {
|
|
219
|
-
|
|
218
|
+
D("right"), t.onClick?.(e);
|
|
220
219
|
}
|
|
221
220
|
};
|
|
222
221
|
};
|
|
223
222
|
return /* @__PURE__ */ p("div", {
|
|
224
|
-
className: `rmdp ${
|
|
223
|
+
className: `rmdp ${g.root}`,
|
|
225
224
|
children: [
|
|
226
225
|
typeof c == "function" ? c({
|
|
227
|
-
calendars:
|
|
228
|
-
getBackProps:
|
|
229
|
-
getForwardProps:
|
|
230
|
-
setView:
|
|
231
|
-
monthNames:
|
|
232
|
-
t:
|
|
233
|
-
slideDirection:
|
|
234
|
-
currentView:
|
|
235
|
-
}) : c || /* @__PURE__ */ f(
|
|
236
|
-
calendars:
|
|
237
|
-
getBackProps:
|
|
238
|
-
getForwardProps:
|
|
239
|
-
setView:
|
|
240
|
-
monthNames:
|
|
241
|
-
t:
|
|
242
|
-
classNames:
|
|
243
|
-
slideDirection:
|
|
244
|
-
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
|
|
245
244
|
}),
|
|
246
245
|
/* @__PURE__ */ p("div", {
|
|
247
|
-
className:
|
|
246
|
+
className: g.calendarsContainer,
|
|
248
247
|
children: [
|
|
249
|
-
|
|
250
|
-
className:
|
|
248
|
+
w === "months" && j.map((t) => /* @__PURE__ */ f("div", {
|
|
249
|
+
className: g.calendarContainer,
|
|
251
250
|
children: /* @__PURE__ */ f(S, {
|
|
252
251
|
year: t.year,
|
|
253
252
|
month: t.month,
|
|
254
|
-
monthNames:
|
|
253
|
+
monthNames: A,
|
|
255
254
|
minDate: e.minDate,
|
|
256
255
|
maxDate: e.maxDate,
|
|
257
|
-
onMonthSelect:
|
|
258
|
-
classNames:
|
|
256
|
+
onMonthSelect: z,
|
|
257
|
+
classNames: g
|
|
259
258
|
})
|
|
260
259
|
}, `months-${t.year}`)),
|
|
261
|
-
|
|
262
|
-
className:
|
|
260
|
+
w === "years" && j.map((t) => /* @__PURE__ */ f("div", {
|
|
261
|
+
className: g.calendarContainer,
|
|
263
262
|
children: /* @__PURE__ */ f(C, {
|
|
264
263
|
year: t.year,
|
|
265
264
|
minDate: e.minDate,
|
|
266
265
|
maxDate: e.maxDate,
|
|
267
266
|
adapter: o,
|
|
268
|
-
onYearSelect:
|
|
269
|
-
classNames:
|
|
267
|
+
onYearSelect: B,
|
|
268
|
+
classNames: g
|
|
270
269
|
})
|
|
271
270
|
}, `years-${t.year}`)),
|
|
272
|
-
|
|
273
|
-
className:
|
|
271
|
+
w === "days" && j.map((e, t) => /* @__PURE__ */ p("div", {
|
|
272
|
+
className: g.calendarContainer,
|
|
274
273
|
children: [
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
"aria-label": O[e.month],
|
|
278
|
-
className: "block w-full text-center font-semibold mb-2 text-brand-text",
|
|
274
|
+
j.length > 1 && /* @__PURE__ */ p("div", {
|
|
275
|
+
className: g.header,
|
|
279
276
|
children: [
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
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
|
+
})
|
|
283
301
|
]
|
|
284
302
|
}),
|
|
285
303
|
/* @__PURE__ */ f("div", {
|
|
286
|
-
className:
|
|
287
|
-
children:
|
|
288
|
-
className:
|
|
304
|
+
className: g.weekdayGrid,
|
|
305
|
+
children: I.map((e) => /* @__PURE__ */ f("div", {
|
|
306
|
+
className: g.weekday,
|
|
289
307
|
children: e
|
|
290
308
|
}, e))
|
|
291
309
|
}),
|
|
292
310
|
/* @__PURE__ */ f("div", {
|
|
293
|
-
className: `${
|
|
294
|
-
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, {
|
|
295
313
|
dateObj: e,
|
|
296
|
-
getDateProps:
|
|
314
|
+
getDateProps: P,
|
|
297
315
|
dayProps: e ? u?.(e) : void 0,
|
|
298
|
-
classNames:
|
|
316
|
+
classNames: g
|
|
299
317
|
}, `${t}-${n}`)))
|
|
300
|
-
})
|
|
318
|
+
}, `daysGrid-${e.month}-${e.year}`)
|
|
301
319
|
]
|
|
302
320
|
}, `${e.month}-${e.year}`))
|
|
303
321
|
]
|
|
304
322
|
}),
|
|
305
323
|
l && /* @__PURE__ */ f("div", {
|
|
306
|
-
className:
|
|
324
|
+
className: g.footer,
|
|
307
325
|
children: l
|
|
308
326
|
})
|
|
309
327
|
]
|
|
310
328
|
});
|
|
311
329
|
};
|
|
312
330
|
//#endregion
|
|
313
|
-
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 };
|
|
314
332
|
|
|
315
333
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/components/Day.tsx","../src/i18n.ts","../src/components/CalendarHeader.tsx","../src/classNames.ts","../src/components/MonthSelection.tsx","../src/components/YearSelection.tsx","../src/components/Calendar.tsx"],"sourcesContent":["import React from 'react';\nimport type { CalendarClassNames, DateObj } from '../types';\n\ninterface DayProps {\n dateObj: DateObj | null;\n getDateProps: (args: { dateObj: DateObj, [key: string]: any }) => any;\n dayProps?: Record<string, any>;\n classNames: Required<CalendarClassNames>;\n}\n\nexport const Day: React.FC<DayProps> = ({ dateObj, getDateProps, dayProps, classNames }) => {\n if (!dateObj) {\n return <div className=\"aspect-square bg-white\" />;\n }\n\n const { date, selected, selectable, isRangeStart, isRangeEnd, isRangeBetween, isRangeHovering, isRangeActive } = dateObj;\n const dayClasses = classNames.day;\n\n let stateClasses = \"rounded-full\";\n if (isRangeStart && isRangeEnd) {\n stateClasses = `${dayClasses.selected} rounded-full`;\n } else if (isRangeStart) {\n stateClasses = `${dayClasses.rangeStart} ${isRangeActive ? 'rounded-l-full rounded-r-none' : 'rounded-full'}`;\n } else if (isRangeEnd) {\n stateClasses = `${dayClasses.rangeEnd} ${isRangeActive ? 'rounded-r-full rounded-l-none' : 'rounded-full'}`;\n } else if (isRangeBetween) {\n stateClasses = dayClasses.rangeBetween || '';\n } else if (isRangeHovering) {\n stateClasses = dayClasses.rangeHovering || '';\n } else if (selected) {\n stateClasses = dayClasses.selected || '';\n } else if (!selectable) {\n stateClasses = dayClasses.disabled || '';\n } else {\n stateClasses = dayClasses.unselected || '';\n }\n\n const className = [\n dayClasses.day,\n stateClasses,\n ...(dateObj.modifiers || []).map(m => (dayClasses as any)[m] || m)\n ].filter(Boolean).join(' ');\n\n return (\n <button\n {...getDateProps({ dateObj, ...dayProps })}\n className={className}\n >\n {date.getDate()}\n </button>\n );\n};\n","import { DateAdapter } from \"./types\";\nimport { defaultAdapter } from \"./adapters/dayjs\";\n\nexport interface Translations {\n months: string[];\n weekdays: string[];\n back: string;\n forward: string;\n}\n\nexport function getDefaults(adapter: DateAdapter = defaultAdapter, locale?: string): Translations {\n return {\n months: adapter.getMonths(locale),\n weekdays: adapter.getWeekdays(locale),\n back: 'Previous month',\n forward: 'Next month'\n };\n}\n\nexport function getTranslations(\n adapter: DateAdapter = defaultAdapter,\n locale?: string,\n custom?: Partial<Translations>\n): Translations {\n const base = getDefaults(adapter, locale);\n return { ...base, ...custom };\n}\n","import React from 'react';\nimport { Calendar, CalendarClassNames } from '../types';\n\nexport interface HeaderProps {\n calendars: Calendar[];\n getBackProps: (args: any) => any;\n getForwardProps: (args: any) => any;\n setView: (view: 'days' | 'months' | 'years') => void;\n monthNames: string[];\n t: { back: string; forward: string };\n classNames: Required<CalendarClassNames>;\n slideDirection?: 'left' | 'right' | null;\n currentView?: 'days' | 'months' | 'years';\n}\n\nexport const ChevronLeftIcon = () => (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <polyline points=\"15 18 9 12 15 6\"></polyline>\n </svg>\n);\n\nexport const ChevronRightIcon = () => (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <polyline points=\"9 18 15 12 9 6\"></polyline>\n </svg>\n);\n\nexport const CalendarHeader: React.FC<HeaderProps> = ({\n calendars,\n getBackProps,\n getForwardProps,\n setView,\n monthNames,\n t,\n classNames,\n slideDirection,\n currentView\n}) => {\n return (\n <div className={classNames.header}>\n <button\n {...getBackProps({ calendars })}\n onMouseDown={(e) => e.preventDefault()}\n className={`${classNames.navButton} ${currentView && currentView !== 'days' ? 'invisible pointer-events-none' : ''}`}\n aria-label={t.back}\n >\n <ChevronLeftIcon />\n </button>\n\n <div className={classNames.monthYearContainer}>\n {calendars.length === 1 ? (\n <div key={`${calendars[0].month}-${calendars[0].year}`} className={`${classNames.monthYearLabel} ${slideDirection === 'left' ? 'animate-slide-in-left' : slideDirection === 'right' ? 'animate-slide-in-right' : ''}`}>\n <button\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => setView(currentView === 'months' ? 'days' : 'months')}\n className={classNames.monthYearButton}\n >\n {monthNames[calendars[0].month]}\n </button>\n <button\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => setView(currentView === 'years' ? 'days' : 'years')}\n className={classNames.monthYearButton}\n >\n {calendars[0].year}\n </button>\n </div>\n ) : (\n <div className={`${classNames.monthYearLabel} ${slideDirection === 'left' ? 'animate-slide-in-left' : slideDirection === 'right' ? 'animate-slide-in-right' : ''}`}>\n {(() => {\n const first = calendars[0];\n const last = calendars[calendars.length - 1];\n const isFullYear = calendars.length === 12 && first.month === 0 && last.month === 11 && first.year === last.year;\n\n if (isFullYear) {\n return <span>{first.year}</span>;\n } else if (first.year === last.year) {\n return <span>{monthNames[first.month]} - {monthNames[last.month]} {first.year}</span>;\n } else {\n return <span>{monthNames[first.month]} {first.year} - {monthNames[last.month]} {last.year}</span>;\n }\n })()}\n </div>\n )}\n </div>\n\n <button\n {...getForwardProps({ calendars })}\n onMouseDown={(e) => e.preventDefault()}\n className={`${classNames.navButton} ${currentView && currentView !== 'days' ? 'invisible pointer-events-none' : ''}`}\n aria-label={t.forward}\n >\n <ChevronRightIcon />\n </button>\n </div>\n );\n};\n","export interface DayClassNames {\n day?: string;\n selected?: string;\n unselected?: string;\n disabled?: string;\n rangeStart?: string;\n rangeEnd?: string;\n rangeBetween?: string;\n rangeHovering?: string;\n [key: string]: string | undefined;\n}\n\nexport const defaultClassNames = {\n root: \"w-fit flex flex-col p-4 bg-white rounded-lg shadow-lg\",\n header: \"flex items-center justify-between border-b-2 border-brand-gray-light/40 pb-2\",\n calendarsContainer: \"flex flex-wrap gap-4\",\n calendarContainer: \"flex-1 min-w-[280px] max-w-full\",\n weekdayGrid: \"grid grid-cols-7 gap-1 mb-1 border-b border-brand-gray-light/40\",\n weekday: \"text-center text-xs text-gray-400 py-2\",\n daysGrid: \"grid grid-cols-7 gap-px bg-brand-gray-light/20\",\n footer: \"mt-4\",\n\n navButton: \"p-2 text-brand-text hover:bg-gray-100 rounded-full transition-colors cursor-pointer disabled:opacity-30 disabled:pointer-events-none\",\n monthYearContainer: \"flex gap-8\",\n monthYearLabel: \"flex gap-1 items-center font-semibold text-brand-text\",\n monthYearButton: \"hover:bg-gray-100 px-2 py-1 rounded cursor-pointer\",\n\n day: {\n day: \"aspect-square flex items-center justify-center text-sm font-medium transition-all relative group cursor-pointer p-px\",\n selected: \"bg-brand-gold text-white rounded-full\",\n unselected: \"bg-white hover:bg-brand-gray-light text-brand-text\",\n disabled: \"bg-white text-gray-300 cursor-not-allowed\",\n rangeStart: \"bg-brand-gold text-white\",\n rangeEnd: \"bg-brand-gold text-white\",\n rangeBetween: \"bg-brand-gold/25 text-brand-text\",\n rangeHovering: \"bg-brand-gold/25 text-brand-text\",\n },\n\n monthsGrid: \"grid grid-cols-3 gap-2 animate-slide-in-top\",\n monthButton: \"py-3 rounded-lg hover:bg-brand-gray-light transition-colors cursor-pointer disabled:opacity-30 disabled:pointer-events-none\",\n monthButtonSelected: \"bg-brand-gold text-white\",\n monthButtonUnselected: \"text-brand-text\",\n\n yearsGrid: \"grid grid-cols-3 gap-2 max-h-[210px] overflow-y-auto pr-2 animate-slide-in-top rmdp-scrollbar\",\n yearButton: \"py-3 rounded-lg hover:bg-brand-gray-light transition-colors cursor-pointer disabled:opacity-30 disabled:pointer-events-none\",\n yearButtonSelected: \"bg-brand-gold text-white\",\n yearButtonUnselected: \"text-brand-text\",\n}\n\nexport interface CalendarClassNames {\n root?: string;\n header?: string;\n calendarsContainer?: string;\n calendarContainer?: string;\n weekdayGrid?: string;\n weekday?: string;\n daysGrid?: string;\n footer?: string;\n\n navButton?: string;\n monthYearContainer?: string;\n monthYearLabel?: string;\n monthYearButton?: string;\n\n day?: DayClassNames;\n\n monthsGrid?: string;\n monthButton?: string;\n monthButtonSelected?: string;\n monthButtonUnselected?: string;\n\n yearsGrid?: string;\n yearButton?: string;\n yearButtonSelected?: string;\n yearButtonUnselected?: string;\n}\n\nexport const mergeClassNames = (custom?: CalendarClassNames): Required<CalendarClassNames> => {\n const result = { ...defaultClassNames };\n if (!custom) return result;\n\n for (const key in custom) {\n const k = key as keyof CalendarClassNames;\n if (k === 'day' && custom.day) {\n result.day = { ...defaultClassNames.day, ...custom.day };\n } else if (custom[k]) {\n (result as any)[k] = custom[k];\n }\n }\n return result;\n};\n","import React from 'react';\nimport { CalendarClassNames } from '../types';\n\ninterface MonthSelectionProps {\n year: number;\n month: number;\n monthNames: string[];\n minDate?: Date | null;\n maxDate?: Date | null;\n onMonthSelect: (month: number) => void;\n classNames: Required<CalendarClassNames>;\n}\n\nexport const MonthSelection: React.FC<MonthSelectionProps> = ({\n year,\n month,\n monthNames,\n minDate,\n maxDate,\n onMonthSelect,\n classNames,\n}) => {\n const isMonthDisabled = (monthIdx: number) => {\n if (minDate && year === minDate.getFullYear() && monthIdx < minDate.getMonth()) {\n return true;\n }\n if (maxDate && year === maxDate.getFullYear() && monthIdx > maxDate.getMonth()) {\n return true;\n }\n return false;\n };\n\n return (\n <div className={classNames.monthsGrid}>\n {monthNames.map((name, idx) => {\n const disabled = isMonthDisabled(idx);\n return (\n <button\n key={name}\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => !disabled && onMonthSelect(idx)}\n className={`${classNames.monthButton} ${idx === month ? classNames.monthButtonSelected : classNames.monthButtonUnselected}`}\n disabled={disabled}\n >\n {name}\n </button>\n );\n })}\n </div>\n );\n};\n","import React, { useEffect, useRef } from 'react';\nimport { CalendarClassNames, DateAdapter } from '../types';\n\ninterface YearSelectionProps {\n year: number;\n minDate?: Date | null;\n maxDate?: Date | null;\n adapter: DateAdapter;\n onYearSelect: (year: number) => void;\n classNames: Required<CalendarClassNames>;\n}\n\nexport const YearSelection: React.FC<YearSelectionProps> = ({\n year,\n minDate,\n maxDate,\n adapter,\n onYearSelect,\n classNames,\n}) => {\n const yearListRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (yearListRef.current) {\n const selectedYearBtn = yearListRef.current.querySelector('[data-selected=\"true\"]');\n if (selectedYearBtn) {\n selectedYearBtn.scrollIntoView({ block: 'center' });\n }\n }\n }, []);\n\n const startYear = minDate ? adapter.get(adapter.date(minDate), 'year') : year - 50;\n const endYear = maxDate ? adapter.get(adapter.date(maxDate), 'year') : year + 50;\n const years = [];\n for (let y = startYear; y <= endYear; y++) {\n years.push(y);\n }\n\n return (\n <div ref={yearListRef} className={classNames.yearsGrid}>\n {years.map((y) => (\n <button\n key={y}\n data-selected={y === year}\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => onYearSelect(y)}\n className={`${classNames.yearButton} ${y === year ? classNames.yearButtonSelected : classNames.yearButtonUnselected}`}\n >\n {y}\n </button>\n ))}\n </div>\n );\n};\n","import React, { useState } from 'react';\nimport { useDates, UseDatesProps } from '../useDates';\nimport { Day } from './Day';\nimport { defaultAdapter } from '../adapters/dayjs';\nimport { getTranslations, Translations } from '../i18n';\nimport { CalendarHeader } from './CalendarHeader';\nimport { DateObj, CalendarClassNames } from '../types';\nimport { mergeClassNames } from '../classNames';\nimport { MonthSelection } from './MonthSelection';\nimport { YearSelection } from './YearSelection';\n\ninterface CalendarProps extends UseDatesProps {\n classNames?: CalendarClassNames;\n locale?: string;\n translations?: Partial<Translations>;\n header?: React.ReactNode | ((props: any) => React.ReactNode);\n footer?: React.ReactNode;\n getDayProps?: (dateObj: DateObj) => Record<string, any>;\n}\n\ntype CalendarView = 'days' | 'months' | 'years';\n\nexport const Calendar: React.FC<CalendarProps> = (props) => {\n const {\n classNames: customClassNames,\n locale,\n translations: customTranslations,\n adapter = defaultAdapter,\n firstDayOfWeek = 0,\n header,\n footer,\n getDayProps,\n ...useDatesProps\n } = props;\n\n const classNames = mergeClassNames(customClassNames);\n\n const [view, setView] = useState<CalendarView>('days');\n const [slideDirection, setSlideDirection] = useState<'left' | 'right' | null>(null);\n\n const t = getTranslations(adapter, locale, customTranslations);\n const weekdayNames = t.weekdays;\n const monthNames = t.months;\n\n const {\n calendars,\n getBackProps,\n getForwardProps,\n getDateProps,\n setOffset\n } = useDates({ ...useDatesProps, adapter, firstDayOfWeek });\n\n // Adjust weekday names based on firstDayOfWeek\n const sortedWeekdays = [...weekdayNames.slice(firstDayOfWeek), ...weekdayNames.slice(0, firstDayOfWeek)];\n\n const currentCalendar = calendars[0];\n const { month, year } = currentCalendar;\n\n const handleMonthSelect = (newMonth: number) => {\n const currentMonth = adapter.set(adapter.set(adapter.date(props.date || new Date()), 'year', year), 'month', month);\n const targetMonth = adapter.set(currentMonth, 'month', newMonth);\n const baseMonth = adapter.startOf(adapter.date(props.date || new Date()), 'month');\n const newOffset = adapter.diff(targetMonth, baseMonth, 'month');\n setSlideDirection(null);\n setOffset(newOffset);\n setView('days');\n };\n\n const handleYearSelect = (newYear: number) => {\n const currentMonth = adapter.set(adapter.set(adapter.date(props.date || new Date()), 'year', year), 'month', month);\n const targetMonth = adapter.set(currentMonth, 'year', newYear);\n const baseMonth = adapter.startOf(adapter.date(props.date || new Date()), 'month');\n const newOffset = adapter.diff(targetMonth, baseMonth, 'month');\n setSlideDirection(null);\n setOffset(newOffset);\n setView('days');\n };\n\n const wrappedGetBackProps = (args: any) => {\n const props = getBackProps(args);\n return {\n ...props,\n onClick: (e: any) => {\n setSlideDirection('left');\n props.onClick?.(e);\n }\n };\n };\n\n const wrappedGetForwardProps = (args: any) => {\n const props = getForwardProps(args);\n return {\n ...props,\n onClick: (e: any) => {\n setSlideDirection('right');\n props.onClick?.(e);\n }\n };\n };\n\n const renderDefaultHeader = () => (\n <CalendarHeader\n calendars={calendars}\n getBackProps={wrappedGetBackProps}\n getForwardProps={wrappedGetForwardProps}\n setView={setView}\n monthNames={monthNames}\n t={t}\n classNames={classNames}\n slideDirection={slideDirection}\n currentView={view}\n />\n );\n\n return (\n <div className={`rmdp ${classNames.root}`}>\n {typeof header === 'function' ? header({\n calendars,\n getBackProps: wrappedGetBackProps,\n getForwardProps: wrappedGetForwardProps,\n setView,\n monthNames,\n t,\n slideDirection,\n currentView: view\n }) : (header || renderDefaultHeader())}\n\n <div className={classNames.calendarsContainer}>\n {view === 'months' && calendars.map((calendar) => (\n <div key={`months-${calendar.year}`} className={classNames.calendarContainer}>\n <MonthSelection\n year={calendar.year}\n month={calendar.month}\n monthNames={monthNames}\n minDate={props.minDate}\n maxDate={props.maxDate}\n onMonthSelect={handleMonthSelect}\n classNames={classNames}\n />\n </div>\n ))}\n {view === 'years' && calendars.map((calendar) => (\n <div key={`years-${calendar.year}`} className={classNames.calendarContainer}>\n <YearSelection\n year={calendar.year}\n minDate={props.minDate}\n maxDate={props.maxDate}\n adapter={adapter}\n onYearSelect={handleYearSelect}\n classNames={classNames}\n />\n </div>\n ))}\n {view === 'days' && calendars.map((calendar) => (\n <div key={`${calendar.month}-${calendar.year}`} className={classNames.calendarContainer}>\n {calendars.length > 1 && (\n <button\n type=\"button\"\n aria-label={monthNames[calendar.month]}\n className=\"block w-full text-center font-semibold mb-2 text-brand-text\"\n >\n {monthNames[calendar.month]} {calendars[0].year !== calendars[calendars.length - 1].year ? calendar.year : ''}\n </button>\n )}\n <div className={classNames.weekdayGrid}>\n {sortedWeekdays.map((day) => (\n <div key={day} className={classNames.weekday}>{day}</div>\n ))}\n </div>\n <div className={`${classNames.daysGrid} ${slideDirection === 'left' ? 'animate-slide-in-left' : slideDirection === 'right' ? 'animate-slide-in-right' : ''}`}>\n {calendar.weeks.map((week, wi) =>\n week.map((dateObj, di) => (\n <Day\n key={`${wi}-${di}`}\n dateObj={dateObj}\n getDateProps={getDateProps}\n dayProps={dateObj ? getDayProps?.(dateObj) : undefined}\n classNames={classNames}\n />\n ))\n )}\n </div>\n </div>\n ))}\n </div>\n {footer && <div className={classNames.footer}>{footer}</div>}\n </div>\n );\n};\n"],"mappings":";;;;;AAUA,IAAa,KAA2B,EAAE,YAAS,iBAAc,aAAU,oBAAiB;CAC1F,IAAI,CAAC,GACH,OAAO,kBAAC,OAAD,EAAK,WAAU,yBAA0B,CAAA;CAGlD,IAAM,EAAE,SAAM,aAAU,eAAY,iBAAc,eAAY,mBAAgB,oBAAiB,qBAAkB,GAC3G,IAAa,EAAW,KAE1B,IAAe;CACnB,A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UAAD;QACE,MAAK;QACL,cAAY,EAAW,EAAS;QAChC,WAAU;QAHZ,UAAA;SAKG,EAAW,EAAS;SAAO;SAAE,EAAU,EAAE,CAAC,SAAS,EAAU,EAAU,SAAS,EAAE,CAAC,OAAuB,KAAhB,EAAS;QAC9F;;OAEV,kBAAC,OAAD;QAAK,WAAW,EAAW;QACxB,UAAA,EAAe,KAAK,MACnB,kBAAC,OAAD;SAAe,WAAW,EAAW;SAAU,UAAA;QAAS,GAA9C,CAA8C,CACzD;OACE,CAAA;OACL,kBAAC,OAAD;QAAK,WAAW,GAAG,EAAW,SAAS,GAAG,MAAmB,SAAS,0BAA0B,MAAmB,UAAU,2BAA2B;QACrJ,UAAA,EAAS,MAAM,KAAK,GAAM,MACzB,EAAK,KAAK,GAAS,MACjB,kBAAC,GAAD;SAEW;SACK;SACd,UAAU,IAAU,IAAc,CAAO,IAAI,KAAA;SACjC;QACb,GALM,GAAG,EAAG,GAAG,GAKf,CACF,CACH;OACG,CAAA;MACF;KA5BK,GAAA,GAAG,EAAS,MAAM,GAAG,EAAS,MA4BnC,CACN;IACE;;GACJ,KAAU,kBAAC,OAAD;IAAK,WAAW,EAAW;IAAS,UAAA;GAAY,CAAA;EACxD;;AAET"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/classNames.ts","../src/i18n.ts","../src/components/CalendarHeader.tsx","../src/components/Day.tsx","../src/components/MonthSelection.tsx","../src/components/YearSelection.tsx","../src/components/Calendar.tsx"],"sourcesContent":["export interface DayClassNames {\n day?: string;\n selected?: string;\n unselected?: string;\n disabled?: string;\n empty?: string;\n rangeStart?: string;\n rangeEnd?: string;\n rangeBetween?: string;\n rangeHovering?: string;\n [key: string]: string | undefined;\n}\n\nexport const defaultClassNames = {\n root: \"w-fit flex flex-col p-4 bg-white rounded-lg shadow-lg\",\n header: \"flex items-center justify-between border-b-2 border-brand-gray-light/40 pb-2\",\n headerMultiMonth: \"border-b-0 pb-0\",\n calendarsContainer: \"flex flex-wrap gap-4\",\n calendarContainer: \"flex-1 min-w-[280px] max-w-full\",\n navButtonSlotStart: \"w-9 flex justify-start\",\n navButtonSlotEnd: \"w-9 flex justify-end\",\n headerTitleContainer: \"font-semibold text-brand-text text-center flex-1\",\n weekdayGrid: \"grid grid-cols-7 gap-1 mb-1 border-b border-brand-gray-light/40\",\n weekday: \"text-center text-xs text-gray-400 py-2\",\n daysGrid: \"grid grid-cols-7 gap-px bg-brand-gray-light/20\",\n footer: \"mt-4\",\n\n navButton: \"p-2 text-brand-text hover:bg-gray-100 rounded-full transition-colors cursor-pointer disabled:opacity-30 disabled:pointer-events-none\",\n navButtonHidden: \"invisible pointer-events-none\",\n monthYearContainer: \"flex gap-8\",\n monthYearLabel: \"flex gap-1 items-center font-semibold text-brand-text\",\n monthYearButton: \"hover:bg-gray-100 px-2 py-1 rounded cursor-pointer\",\n\n day: {\n day: \"rmdp-day group\",\n selected: \"rmdp-day-selected\",\n unselected: \"rmdp-day-unselected\",\n disabled: \"rmdp-day-disabled\",\n empty: \"rmdp-day-empty\",\n rangeStart: \"rmdp-day-range-start\",\n rangeEnd: \"rmdp-day-range-end\",\n rangeBetween: \"rmdp-day-range-between\",\n rangeHovering: \"rmdp-day-range-hovering\",\n },\n\n monthsGrid: \"grid grid-cols-3 gap-2 animate-slide-in-top\",\n monthButton: \"py-3 rounded-lg hover:bg-brand-gray-light transition-colors cursor-pointer disabled:opacity-30 disabled:pointer-events-none\",\n monthButtonSelected: \"bg-brand-gold text-white\",\n monthButtonUnselected: \"text-brand-text\",\n\n yearsGrid: \"grid grid-cols-3 gap-2 max-h-[210px] overflow-y-auto pr-2 animate-slide-in-top rmdp-scrollbar\",\n yearButton: \"py-3 rounded-lg hover:bg-brand-gray-light transition-colors cursor-pointer disabled:opacity-30 disabled:pointer-events-none\",\n yearButtonSelected: \"bg-brand-gold text-white\",\n yearButtonUnselected: \"text-brand-text\",\n}\n\nexport interface CalendarClassNames {\n root?: string;\n header?: string;\n headerMultiMonth?: string;\n calendarsContainer?: string;\n calendarContainer?: string;\n navButtonSlotStart?: string;\n navButtonSlotEnd?: string;\n headerTitleContainer?: string;\n weekdayGrid?: string;\n weekday?: string;\n daysGrid?: string;\n footer?: string;\n\n navButton?: string;\n navButtonHidden?: string;\n monthYearContainer?: string;\n monthYearLabel?: string;\n monthYearButton?: string;\n\n day?: DayClassNames;\n\n monthsGrid?: string;\n monthButton?: string;\n monthButtonSelected?: string;\n monthButtonUnselected?: string;\n\n yearsGrid?: string;\n yearButton?: string;\n yearButtonSelected?: string;\n yearButtonUnselected?: string;\n}\n\nexport const mergeClassNames = (custom?: CalendarClassNames): Required<CalendarClassNames> => {\n const result = { ...defaultClassNames };\n if (!custom) return result;\n\n for (const key in custom) {\n const k = key as keyof CalendarClassNames;\n if (k === 'day' && custom.day) {\n result.day = { ...defaultClassNames.day, ...custom.day };\n } else if (custom[k]) {\n (result as any)[k] = custom[k];\n }\n }\n return result;\n};\n","import { DateAdapter } from \"./types\";\nimport { defaultAdapter } from \"./adapters/dayjs\";\n\nexport interface Translations {\n months: string[];\n weekdays: string[];\n back: string;\n forward: string;\n}\n\nexport function getDefaults(adapter: DateAdapter = defaultAdapter, locale?: string): Translations {\n return {\n months: adapter.getMonths(locale),\n weekdays: adapter.getWeekdays(locale),\n back: 'Previous month',\n forward: 'Next month'\n };\n}\n\nexport function getTranslations(\n adapter: DateAdapter = defaultAdapter,\n locale?: string,\n custom?: Partial<Translations>\n): Translations {\n const base = getDefaults(adapter, locale);\n return { ...base, ...custom };\n}\n","import React from 'react';\nimport { Calendar, CalendarClassNames } from '../types';\n\nexport interface HeaderProps {\n calendars: Calendar[];\n getBackProps: (args: any) => any;\n getForwardProps: (args: any) => any;\n setView: (view: 'days' | 'months' | 'years') => void;\n monthNames: string[];\n t: { back: string; forward: string };\n classNames: Required<CalendarClassNames>;\n slideDirection?: 'left' | 'right' | null;\n currentView?: 'days' | 'months' | 'years';\n}\n\nexport const ChevronLeftIcon = () => (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <polyline points=\"15 18 9 12 15 6\"></polyline>\n </svg>\n);\n\nexport const ChevronRightIcon = () => (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <polyline points=\"9 18 15 12 9 6\"></polyline>\n </svg>\n);\n\nexport const CalendarHeader: React.FC<HeaderProps> = ({\n calendars,\n getBackProps,\n getForwardProps,\n setView,\n monthNames,\n t,\n classNames,\n slideDirection,\n currentView\n}) => {\n if (calendars.length > 1 && calendars.length < 12) {\n return null;\n }\n\n const first = calendars[0];\n const last = calendars[calendars.length - 1];\n\n const headerClassName = [\n classNames.header,\n calendars.length > 1 ? classNames.headerMultiMonth : ''\n ].filter(Boolean).join(' ');\n\n const navButtonClassName = (isHidden: boolean) => [\n classNames.navButton,\n isHidden ? classNames.navButtonHidden : ''\n ].filter(Boolean).join(' ');\n\n const isNavHidden = !!(currentView && currentView !== 'days');\n\n return (\n <div className={headerClassName}>\n <button\n {...getBackProps({ calendars })}\n onMouseDown={(e) => e.preventDefault()}\n className={navButtonClassName(isNavHidden)}\n aria-label={t.back}\n >\n <ChevronLeftIcon />\n </button>\n\n <div className={classNames.monthYearContainer}>\n {calendars.length === 1 ? (\n <div key={`${calendars[0].month}-${calendars[0].year}`} className={`${classNames.monthYearLabel} ${slideDirection === 'left' ? 'animate-slide-in-left' : slideDirection === 'right' ? 'animate-slide-in-right' : ''}`}>\n <button\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => setView(currentView === 'months' ? 'days' : 'months')}\n className={classNames.monthYearButton}\n >\n {monthNames[calendars[0].month]}\n </button>\n <button\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => setView(currentView === 'years' ? 'days' : 'years')}\n className={classNames.monthYearButton}\n >\n {calendars[0].year}\n </button>\n </div>\n ) : (\n <div className={`${classNames.monthYearLabel} ${slideDirection === 'left' ? 'animate-slide-in-left' : slideDirection === 'right' ? 'animate-slide-in-right' : ''}`}>\n <span>\n {first.year === last.year ? first.year : `${first.year} - ${last.year}`}\n </span>\n </div>\n )}\n </div>\n\n <button\n {...getForwardProps({ calendars })}\n onMouseDown={(e) => e.preventDefault()}\n className={navButtonClassName(isNavHidden)}\n aria-label={t.forward}\n >\n <ChevronRightIcon />\n </button>\n </div>\n );\n};\n","import React from 'react';\nimport type { CalendarClassNames, DateObj } from '../types';\n\ninterface DayProps {\n dateObj: DateObj | null;\n getDateProps: (args: { dateObj: DateObj, [key: string]: any }) => any;\n dayProps?: Record<string, any>;\n classNames: Required<CalendarClassNames>;\n}\n\nexport const Day: React.FC<DayProps> = ({ dateObj, getDateProps, dayProps, classNames }) => {\n if (!dateObj) {\n return <div className={classNames.day.empty} />;\n }\n\n const { date, selected, selectable, isRangeStart, isRangeEnd, isRangeBetween, isRangeHovering, isRangeActive } = dateObj;\n const dayClasses = classNames.day;\n\n let stateClasses = \"rounded-full\";\n if (isRangeStart && isRangeEnd) {\n stateClasses = `${dayClasses.selected} rounded-full`;\n } else if (isRangeStart) {\n stateClasses = `${dayClasses.rangeStart} ${isRangeActive ? 'rounded-l-full rounded-r-none' : 'rounded-full'}`;\n } else if (isRangeEnd) {\n stateClasses = `${dayClasses.rangeEnd} ${isRangeActive ? 'rounded-r-full rounded-l-none' : 'rounded-full'}`;\n } else if (isRangeBetween) {\n stateClasses = dayClasses.rangeBetween || '';\n } else if (isRangeHovering) {\n stateClasses = dayClasses.rangeHovering || '';\n } else if (selected) {\n stateClasses = dayClasses.selected || '';\n } else if (!selectable) {\n stateClasses = dayClasses.disabled || '';\n } else {\n stateClasses = dayClasses.unselected || '';\n }\n\n const modifierClasses = (dateObj.modifiers || [])\n .map(m => (dayClasses as any)[m] || m)\n .filter(Boolean)\n .join(' ');\n\n const className = [dayClasses.day, stateClasses, modifierClasses]\n .filter(Boolean)\n .join(' ');\n\n return (\n <button\n {...getDateProps({ dateObj, ...dayProps })}\n className={className}\n >\n {date.getDate()}\n </button>\n );\n};\n","import React from 'react';\nimport { CalendarClassNames } from '../types';\n\ninterface MonthSelectionProps {\n year: number;\n month: number;\n monthNames: string[];\n minDate?: Date | null;\n maxDate?: Date | null;\n onMonthSelect: (month: number) => void;\n classNames: Required<CalendarClassNames>;\n}\n\nexport const MonthSelection: React.FC<MonthSelectionProps> = ({\n year,\n month,\n monthNames,\n minDate,\n maxDate,\n onMonthSelect,\n classNames,\n}) => {\n const isMonthDisabled = (monthIdx: number) => {\n if (minDate && year === minDate.getFullYear() && monthIdx < minDate.getMonth()) {\n return true;\n }\n if (maxDate && year === maxDate.getFullYear() && monthIdx > maxDate.getMonth()) {\n return true;\n }\n return false;\n };\n\n return (\n <div className={classNames.monthsGrid}>\n {monthNames.map((name, idx) => {\n const disabled = isMonthDisabled(idx);\n return (\n <button\n key={name}\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => !disabled && onMonthSelect(idx)}\n className={`${classNames.monthButton} ${idx === month ? classNames.monthButtonSelected : classNames.monthButtonUnselected}`}\n disabled={disabled}\n >\n {name}\n </button>\n );\n })}\n </div>\n );\n};\n","import React, { useEffect, useRef } from 'react';\nimport { CalendarClassNames, DateAdapter } from '../types';\n\ninterface YearSelectionProps {\n year: number;\n minDate?: Date | null;\n maxDate?: Date | null;\n adapter: DateAdapter;\n onYearSelect: (year: number) => void;\n classNames: Required<CalendarClassNames>;\n}\n\nexport const YearSelection: React.FC<YearSelectionProps> = ({\n year,\n minDate,\n maxDate,\n adapter,\n onYearSelect,\n classNames,\n}) => {\n const yearListRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (yearListRef.current) {\n const selectedYearBtn = yearListRef.current.querySelector('[data-selected=\"true\"]');\n if (selectedYearBtn) {\n selectedYearBtn.scrollIntoView({ block: 'center' });\n }\n }\n }, []);\n\n const startYear = minDate ? adapter.get(adapter.date(minDate), 'year') : year - 50;\n const endYear = maxDate ? adapter.get(adapter.date(maxDate), 'year') : year + 50;\n const years = [];\n for (let y = startYear; y <= endYear; y++) {\n years.push(y);\n }\n\n return (\n <div ref={yearListRef} className={classNames.yearsGrid}>\n {years.map((y) => (\n <button\n key={y}\n data-selected={y === year}\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => onYearSelect(y)}\n className={`${classNames.yearButton} ${y === year ? classNames.yearButtonSelected : classNames.yearButtonUnselected}`}\n >\n {y}\n </button>\n ))}\n </div>\n );\n};\n","import React, { useState } from 'react';\nimport { defaultAdapter } from '../adapters/dayjs';\nimport { mergeClassNames } from '../classNames';\nimport { getTranslations, Translations } from '../i18n';\nimport { CalendarClassNames, DateObj } from '../types';\nimport { useDates, UseDatesProps } from '../useDates';\nimport { CalendarHeader, ChevronLeftIcon, ChevronRightIcon } from './CalendarHeader';\nimport { Day } from './Day';\nimport { MonthSelection } from './MonthSelection';\nimport { YearSelection } from './YearSelection';\n\ninterface CalendarProps extends UseDatesProps {\n classNames?: CalendarClassNames;\n locale?: string;\n translations?: Partial<Translations>;\n header?: React.ReactNode | ((props: any) => React.ReactNode);\n footer?: React.ReactNode;\n getDayProps?: (dateObj: DateObj) => Record<string, any>;\n}\n\ntype CalendarView = 'days' | 'months' | 'years';\n\nexport const Calendar: React.FC<CalendarProps> = (props) => {\n const {\n classNames: customClassNames,\n locale,\n translations: customTranslations,\n adapter = defaultAdapter,\n firstDayOfWeek = 0,\n header,\n footer,\n getDayProps,\n ...useDatesProps\n } = props;\n\n const classNames = mergeClassNames(customClassNames);\n\n const [view, setView] = useState<CalendarView>('days');\n const [slideDirection, setSlideDirection] = useState<'left' | 'right' | null>(null);\n\n const t = getTranslations(adapter, locale, customTranslations);\n const weekdayNames = t.weekdays;\n const monthNames = t.months;\n\n const {\n calendars,\n getBackProps,\n getForwardProps,\n getDateProps,\n setOffset\n } = useDates({ ...useDatesProps, adapter, firstDayOfWeek });\n\n // Adjust weekday names based on firstDayOfWeek\n const sortedWeekdays = [...weekdayNames.slice(firstDayOfWeek), ...weekdayNames.slice(0, firstDayOfWeek)];\n\n const currentCalendar = calendars[0];\n const { month, year } = currentCalendar;\n\n const handleMonthSelect = (newMonth: number) => {\n const currentMonth = adapter.set(adapter.set(adapter.date(props.date || new Date()), 'year', year), 'month', month);\n const targetMonth = adapter.set(currentMonth, 'month', newMonth);\n const baseMonth = adapter.startOf(adapter.date(props.date || new Date()), 'month');\n const newOffset = adapter.diff(targetMonth, baseMonth, 'month');\n setSlideDirection(null);\n setOffset(newOffset);\n setView('days');\n };\n\n const handleYearSelect = (newYear: number) => {\n const currentMonth = adapter.set(adapter.set(adapter.date(props.date || new Date()), 'year', year), 'month', month);\n const targetMonth = adapter.set(currentMonth, 'year', newYear);\n const baseMonth = adapter.startOf(adapter.date(props.date || new Date()), 'month');\n const newOffset = adapter.diff(targetMonth, baseMonth, 'month');\n setSlideDirection(null);\n setOffset(newOffset);\n setView('days');\n };\n\n const stepOffset = useDatesProps.monthsToDisplay || 1;\n\n const wrappedGetBackProps = (args: any) => {\n const props = getBackProps({ offset: stepOffset, ...args });\n return {\n ...props,\n onClick: (e: any) => {\n setSlideDirection('left');\n props.onClick?.(e);\n }\n };\n };\n\n const wrappedGetForwardProps = (args: any) => {\n const props = getForwardProps({ offset: stepOffset, ...args });\n return {\n ...props,\n onClick: (e: any) => {\n setSlideDirection('right');\n props.onClick?.(e);\n }\n };\n };\n\n const renderDefaultHeader = () => (\n <CalendarHeader\n calendars={calendars}\n getBackProps={wrappedGetBackProps}\n getForwardProps={wrappedGetForwardProps}\n setView={setView}\n monthNames={monthNames}\n t={t}\n classNames={classNames}\n slideDirection={slideDirection}\n currentView={view}\n />\n );\n\n return (\n <div className={`rmdp ${classNames.root}`}>\n {typeof header === 'function' ? header({\n calendars,\n getBackProps: wrappedGetBackProps,\n getForwardProps: wrappedGetForwardProps,\n setView,\n monthNames,\n t,\n slideDirection,\n currentView: view\n }) : (header || renderDefaultHeader())}\n\n <div className={classNames.calendarsContainer}>\n {view === 'months' && calendars.map((calendar) => (\n <div key={`months-${calendar.year}`} className={classNames.calendarContainer}>\n <MonthSelection\n year={calendar.year}\n month={calendar.month}\n monthNames={monthNames}\n minDate={props.minDate}\n maxDate={props.maxDate}\n onMonthSelect={handleMonthSelect}\n classNames={classNames}\n />\n </div>\n ))}\n {view === 'years' && calendars.map((calendar) => (\n <div key={`years-${calendar.year}`} className={classNames.calendarContainer}>\n <YearSelection\n year={calendar.year}\n minDate={props.minDate}\n maxDate={props.maxDate}\n adapter={adapter}\n onYearSelect={handleYearSelect}\n classNames={classNames}\n />\n </div>\n ))}\n {view === 'days' && calendars.map((calendar, index) => (\n <div key={`${calendar.month}-${calendar.year}`} className={classNames.calendarContainer}>\n {calendars.length > 1 && (\n <div className={classNames.header}>\n <div className={classNames.navButtonSlotStart}>\n {index === 0 && calendars.length < 12 && (\n <button\n {...wrappedGetBackProps({ calendars })}\n onMouseDown={(e) => e.preventDefault()}\n className={classNames.navButton}\n aria-label={t.back}\n >\n <ChevronLeftIcon />\n </button>\n )}\n </div>\n <span className={classNames.headerTitleContainer}>\n {monthNames[calendar.month]}\n {calendars.length < 12 ? ` ${calendar.year}` : ''}\n </span>\n <div className={classNames.navButtonSlotEnd}>\n {index === calendars.length - 1 && calendars.length < 12 && (\n <button\n {...wrappedGetForwardProps({ calendars })}\n onMouseDown={(e) => e.preventDefault()}\n className={classNames.navButton}\n aria-label={t.forward}\n >\n <ChevronRightIcon />\n </button>\n )}\n </div>\n </div>\n )}\n <div className={classNames.weekdayGrid}>\n {sortedWeekdays.map((day) => (\n <div key={day} className={classNames.weekday}>{day}</div>\n ))}\n </div>\n <div key={`daysGrid-${calendar.month}-${calendar.year}`} className={`${classNames.daysGrid} ${slideDirection === 'left' ? 'animate-slide-in-left' : slideDirection === 'right' ? 'animate-slide-in-right' : ''}`}>\n {calendar.weeks.map((week, wi) =>\n week.map((dateObj, di) => (\n <Day\n key={`${wi}-${di}`}\n dateObj={dateObj}\n getDateProps={getDateProps}\n dayProps={dateObj ? getDayProps?.(dateObj) : undefined}\n classNames={classNames}\n />\n ))\n )}\n </div>\n </div>\n ))}\n </div>\n {footer && <div className={classNames.footer}>{footer}</div>}\n </div>\n );\n};\n"],"mappings":";;;;;AAaA,IAAa,IAAoB;CAC/B,MAAM;CACN,QAAQ;CACR,kBAAkB;CAClB,oBAAoB;CACpB,mBAAmB;CACnB,oBAAoB;CACpB,kBAAkB;CAClB,sBAAsB;CACtB,aAAa;CACb,SAAS;CACT,UAAU;CACV,QAAQ;CAER,WAAW;CACX,iBAAiB;CACjB,oBAAoB;CACpB,gBAAgB;CAChB,iBAAiB;CAEjB,KAAK;EACH,KAAK;EACL,UAAU;EACV,YAAY;EACZ,UAAU;EACV,OAAO;EACP,YAAY;EACZ,UAAU;EACV,cAAc;EACd,eAAe;CACjB;CAEA,YAAY;CACZ,aAAa;CACb,qBAAqB;CACrB,uBAAuB;CAEvB,WAAW;CACX,YAAY;CACZ,oBAAoB;CACpB,sBAAsB;AACxB,GAmCa,KAAmB,MAA8D;CAC5F,IAAM,IAAS,EAAE,GAAG,EAAkB;CACtC,IAAI,CAAC,GAAQ,OAAO;CAEpB,KAAK,IAAM,KAAO,GAAQ;EACxB,IAAM,IAAI;EACV,AAAI,MAAM,SAAS,EAAO,MACxB,EAAO,MAAM;GAAE,GAAG,EAAkB;GAAK,GAAG,EAAO;EAAI,IAC9C,EAAO,OAChB,EAAgB,KAAK,EAAO;CAEhC;CACA,OAAO;AACT;;;AC5FA,SAAgB,EAAY,IAAuB,GAAgB,GAA+B;CAChG,OAAO;EACL,QAAQ,EAAQ,UAAU,CAAM;EAChC,UAAU,EAAQ,YAAY,CAAM;EACpC,MAAM;EACN,SAAS;CACX;AACF;AAEA,SAAgB,EACZ,IAAuB,GACvB,GACA,GACY;CAEd,OAAO;EAAE,GADI,EAAY,GAAS,CACtB;EAAM,GAAG;CAAO;AAC9B;;;ACXA,IAAa,UACX,kBAAC,OA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