@helsenorge/datepicker 7.13.3 → 8.0.0-beta.6
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.
|
@@ -20,9 +20,10 @@ import { useInterval as an } from "@helsenorge/designsystem-react/hooks/useInter
|
|
|
20
20
|
import { useIsVisible as on } from "@helsenorge/designsystem-react/hooks/useIsVisible";
|
|
21
21
|
import { useLayoutEvent as ln } from "@helsenorge/designsystem-react/hooks/useLayoutEvent";
|
|
22
22
|
import { useSize as sn } from "@helsenorge/designsystem-react/hooks/useSize";
|
|
23
|
+
import { getSpacer as dn } from "@helsenorge/designsystem-react/theme/currys/spacing";
|
|
23
24
|
import x from "./styles.module.scss";
|
|
24
|
-
import
|
|
25
|
-
import { useUuid as
|
|
25
|
+
import un from "@helsenorge/designsystem-react/components/ErrorWrapper";
|
|
26
|
+
import { useUuid as cn } from "@helsenorge/designsystem-react/hooks/useUuid";
|
|
26
27
|
import { isComponent as et } from "@helsenorge/designsystem-react/utils/component";
|
|
27
28
|
var g = function() {
|
|
28
29
|
return g = Object.assign || function(n) {
|
|
@@ -33,7 +34,7 @@ var g = function() {
|
|
|
33
34
|
return n;
|
|
34
35
|
}, g.apply(this, arguments);
|
|
35
36
|
};
|
|
36
|
-
function
|
|
37
|
+
function fn(e, n) {
|
|
37
38
|
var t = {};
|
|
38
39
|
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && n.indexOf(r) < 0 && (t[r] = e[r]);
|
|
39
40
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -55,7 +56,7 @@ function de(e) {
|
|
|
55
56
|
function ge(e) {
|
|
56
57
|
return e.mode === "single";
|
|
57
58
|
}
|
|
58
|
-
var
|
|
59
|
+
var vn = {
|
|
59
60
|
root: "rdp",
|
|
60
61
|
multiple_months: "rdp-multiple_months",
|
|
61
62
|
with_weeknumber: "rdp-with_weeknumber",
|
|
@@ -98,63 +99,63 @@ var fn = {
|
|
|
98
99
|
day_range_end: "rdp-day_range_end",
|
|
99
100
|
day_range_middle: "rdp-day_range_middle"
|
|
100
101
|
};
|
|
101
|
-
function
|
|
102
|
+
function mn(e, n) {
|
|
102
103
|
return L(e, "LLLL y", n);
|
|
103
104
|
}
|
|
104
|
-
function
|
|
105
|
+
function hn(e, n) {
|
|
105
106
|
return L(e, "d", n);
|
|
106
107
|
}
|
|
107
|
-
function
|
|
108
|
+
function pn(e, n) {
|
|
108
109
|
return L(e, "LLLL", n);
|
|
109
110
|
}
|
|
110
|
-
function
|
|
111
|
+
function yn(e) {
|
|
111
112
|
return "".concat(e);
|
|
112
113
|
}
|
|
113
|
-
function
|
|
114
|
+
function bn(e, n) {
|
|
114
115
|
return L(e, "cccccc", n);
|
|
115
116
|
}
|
|
116
|
-
function
|
|
117
|
+
function gn(e, n) {
|
|
117
118
|
return L(e, "yyyy", n);
|
|
118
119
|
}
|
|
119
|
-
var
|
|
120
|
+
var _n = /* @__PURE__ */ Object.freeze({
|
|
120
121
|
__proto__: null,
|
|
121
|
-
formatCaption:
|
|
122
|
-
formatDay:
|
|
123
|
-
formatMonthCaption:
|
|
124
|
-
formatWeekNumber:
|
|
125
|
-
formatWeekdayName:
|
|
126
|
-
formatYearCaption:
|
|
127
|
-
}),
|
|
122
|
+
formatCaption: mn,
|
|
123
|
+
formatDay: hn,
|
|
124
|
+
formatMonthCaption: pn,
|
|
125
|
+
formatWeekNumber: yn,
|
|
126
|
+
formatWeekdayName: bn,
|
|
127
|
+
formatYearCaption: gn
|
|
128
|
+
}), wn = function(e, n, t) {
|
|
128
129
|
return L(e, "do MMMM (EEEE)", t);
|
|
129
|
-
}, wn = function() {
|
|
130
|
-
return "Month: ";
|
|
131
130
|
}, Dn = function() {
|
|
132
|
-
return "
|
|
131
|
+
return "Month: ";
|
|
133
132
|
}, Mn = function() {
|
|
133
|
+
return "Go to next month";
|
|
134
|
+
}, kn = function() {
|
|
134
135
|
return "Go to previous month";
|
|
135
|
-
},
|
|
136
|
+
}, Nn = function(e, n) {
|
|
136
137
|
return L(e, "cccc", n);
|
|
137
|
-
},
|
|
138
|
+
}, Cn = function(e) {
|
|
138
139
|
return "Week n. ".concat(e);
|
|
139
|
-
},
|
|
140
|
+
}, Pn = function() {
|
|
140
141
|
return "Year: ";
|
|
141
|
-
},
|
|
142
|
+
}, xn = /* @__PURE__ */ Object.freeze({
|
|
142
143
|
__proto__: null,
|
|
143
|
-
labelDay:
|
|
144
|
-
labelMonthDropdown:
|
|
145
|
-
labelNext:
|
|
146
|
-
labelPrevious:
|
|
147
|
-
labelWeekNumber:
|
|
148
|
-
labelWeekday:
|
|
149
|
-
labelYearDropdown:
|
|
144
|
+
labelDay: wn,
|
|
145
|
+
labelMonthDropdown: Dn,
|
|
146
|
+
labelNext: Mn,
|
|
147
|
+
labelPrevious: kn,
|
|
148
|
+
labelWeekNumber: Cn,
|
|
149
|
+
labelWeekday: Nn,
|
|
150
|
+
labelYearDropdown: Pn
|
|
150
151
|
});
|
|
151
|
-
function
|
|
152
|
-
var e = "buttons", n =
|
|
152
|
+
function On() {
|
|
153
|
+
var e = "buttons", n = vn, t = Gt, r = {}, a = {}, o = 1, i = {}, l = /* @__PURE__ */ new Date();
|
|
153
154
|
return {
|
|
154
155
|
captionLayout: e,
|
|
155
156
|
classNames: n,
|
|
156
|
-
formatters:
|
|
157
|
-
labels:
|
|
157
|
+
formatters: _n,
|
|
158
|
+
labels: xn,
|
|
158
159
|
locale: t,
|
|
159
160
|
modifiersClassNames: r,
|
|
160
161
|
modifiers: a,
|
|
@@ -164,7 +165,7 @@ function xn() {
|
|
|
164
165
|
mode: "default"
|
|
165
166
|
};
|
|
166
167
|
}
|
|
167
|
-
function
|
|
168
|
+
function In(e) {
|
|
168
169
|
var n = e.fromYear, t = e.toYear, r = e.fromMonth, a = e.toMonth, o = e.fromDate, i = e.toDate;
|
|
169
170
|
return r ? o = E(r) : n && (o = new Date(n, 0, 1)), a ? i = Re(a) : t && (i = new Date(t, 11, 31)), {
|
|
170
171
|
fromDate: o ? qe(o) : void 0,
|
|
@@ -172,8 +173,8 @@ function On(e) {
|
|
|
172
173
|
};
|
|
173
174
|
}
|
|
174
175
|
var ht = G(void 0);
|
|
175
|
-
function
|
|
176
|
-
var n, t = e.initialProps, r =
|
|
176
|
+
function Wn(e) {
|
|
177
|
+
var n, t = e.initialProps, r = On(), a = In(t), o = a.fromDate, i = a.toDate, l = (n = t.captionLayout) !== null && n !== void 0 ? n : r.captionLayout;
|
|
177
178
|
l !== "buttons" && (!o || !i) && (l = "buttons");
|
|
178
179
|
var s;
|
|
179
180
|
(ge(t) || se(t) || de(t)) && (s = t.onSelect);
|
|
@@ -190,14 +191,14 @@ function pt(e) {
|
|
|
190
191
|
var n = k(), t = n.locale, r = n.classNames, a = n.styles, o = n.formatters.formatCaption;
|
|
191
192
|
return u("div", { className: r.caption_label, style: a.caption_label, "aria-live": "polite", role: "presentation", id: e.id, children: o(e.displayMonth, { locale: t }) });
|
|
192
193
|
}
|
|
193
|
-
function
|
|
194
|
+
function En(e) {
|
|
194
195
|
return u("svg", g({ width: "8px", height: "8px", viewBox: "0 0 120 120", "data-testid": "iconDropdown" }, e, { children: u("path", { d: "M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z", fill: "currentColor", fillRule: "nonzero" }) }));
|
|
195
196
|
}
|
|
196
197
|
function yt(e) {
|
|
197
|
-
var n, t, r = e.onChange, a = e.value, o = e.children, i = e.caption, l = e.className, s = e.style, c = k(), d = (t = (n = c.components) === null || n === void 0 ? void 0 : n.IconDropdown) !== null && t !== void 0 ? t :
|
|
198
|
+
var n, t, r = e.onChange, a = e.value, o = e.children, i = e.caption, l = e.className, s = e.style, c = k(), d = (t = (n = c.components) === null || n === void 0 ? void 0 : n.IconDropdown) !== null && t !== void 0 ? t : En;
|
|
198
199
|
return F("div", { className: l, style: s, children: [u("span", { className: c.classNames.vhidden, children: e["aria-label"] }), u("select", { name: e.name, "aria-label": e["aria-label"], className: c.classNames.dropdown, style: c.styles.dropdown, value: a, onChange: r, children: o }), F("div", { className: c.classNames.caption_label, style: c.styles.caption_label, "aria-hidden": "true", children: [i, u(d, { className: c.classNames.dropdown_icon, style: c.styles.dropdown_icon })] })] });
|
|
199
200
|
}
|
|
200
|
-
function
|
|
201
|
+
function Sn(e) {
|
|
201
202
|
var n, t = k(), r = t.fromDate, a = t.toDate, o = t.styles, i = t.locale, l = t.formatters.formatMonthCaption, s = t.classNames, c = t.components, d = t.labels.labelMonthDropdown;
|
|
202
203
|
if (!r)
|
|
203
204
|
return u(V, {});
|
|
@@ -218,7 +219,7 @@ function En(e) {
|
|
|
218
219
|
return u("option", { value: b.getMonth(), children: l(b, { locale: i }) }, b.getMonth());
|
|
219
220
|
}) });
|
|
220
221
|
}
|
|
221
|
-
function
|
|
222
|
+
function Ln(e) {
|
|
222
223
|
var n, t = e.displayMonth, r = k(), a = r.fromDate, o = r.toDate, i = r.locale, l = r.styles, s = r.classNames, c = r.components, d = r.formatters.formatYearCaption, f = r.labels.labelYearDropdown, v = [];
|
|
223
224
|
if (!a)
|
|
224
225
|
return u(V, {});
|
|
@@ -234,11 +235,11 @@ function Sn(e) {
|
|
|
234
235
|
return u("option", { value: D.getFullYear(), children: d(D, { locale: i }) }, D.getFullYear());
|
|
235
236
|
}) });
|
|
236
237
|
}
|
|
237
|
-
function
|
|
238
|
+
function Rn(e, n) {
|
|
238
239
|
var t = S(e), r = t[0], a = t[1], o = n === void 0 ? r : n;
|
|
239
240
|
return [o, a];
|
|
240
241
|
}
|
|
241
|
-
function
|
|
242
|
+
function Bn(e) {
|
|
242
243
|
var n = e.month, t = e.defaultMonth, r = e.today, a = n || t || r || /* @__PURE__ */ new Date(), o = e.toDate, i = e.fromDate, l = e.numberOfMonths, s = l === void 0 ? 1 : l;
|
|
243
244
|
if (o && ie(o, a) < 0) {
|
|
244
245
|
var c = -1 * (s - 1);
|
|
@@ -246,8 +247,8 @@ function Rn(e) {
|
|
|
246
247
|
}
|
|
247
248
|
return i && ie(a, i) < 0 && (a = i), E(a);
|
|
248
249
|
}
|
|
249
|
-
function
|
|
250
|
-
var e = k(), n =
|
|
250
|
+
function Tn() {
|
|
251
|
+
var e = k(), n = Bn(e), t = Rn(n, e.month), r = t[0], a = t[1], o = function(i) {
|
|
251
252
|
var l;
|
|
252
253
|
if (!e.disableNavigation) {
|
|
253
254
|
var s = E(i);
|
|
@@ -256,14 +257,14 @@ function Bn() {
|
|
|
256
257
|
};
|
|
257
258
|
return [r, o];
|
|
258
259
|
}
|
|
259
|
-
function
|
|
260
|
+
function Fn(e, n) {
|
|
260
261
|
for (var t = n.reverseMonths, r = n.numberOfMonths, a = E(e), o = E(T(a, r)), i = ie(o, a), l = [], s = 0; s < i; s++) {
|
|
261
262
|
var c = T(a, s);
|
|
262
263
|
l.push(c);
|
|
263
264
|
}
|
|
264
265
|
return t && (l = l.reverse()), l;
|
|
265
266
|
}
|
|
266
|
-
function
|
|
267
|
+
function An(e, n) {
|
|
267
268
|
if (!n.disableNavigation) {
|
|
268
269
|
var t = n.toDate, r = n.pagedNavigation, a = n.numberOfMonths, o = a === void 0 ? 1 : a, i = r ? o : 1, l = E(e);
|
|
269
270
|
if (!t)
|
|
@@ -273,7 +274,7 @@ function Fn(e, n) {
|
|
|
273
274
|
return T(l, i);
|
|
274
275
|
}
|
|
275
276
|
}
|
|
276
|
-
function
|
|
277
|
+
function Yn(e, n) {
|
|
277
278
|
if (!n.disableNavigation) {
|
|
278
279
|
var t = n.fromDate, r = n.pagedNavigation, a = n.numberOfMonths, o = a === void 0 ? 1 : a, i = r ? o : 1, l = E(e);
|
|
279
280
|
if (!t)
|
|
@@ -284,8 +285,8 @@ function An(e, n) {
|
|
|
284
285
|
}
|
|
285
286
|
}
|
|
286
287
|
var bt = G(void 0);
|
|
287
|
-
function
|
|
288
|
-
var n = k(), t =
|
|
288
|
+
function Hn(e) {
|
|
289
|
+
var n = k(), t = Tn(), r = t[0], a = t[1], o = Fn(r, n), i = An(r, n), l = Yn(r, n), s = function(f) {
|
|
289
290
|
return o.some(function(v) {
|
|
290
291
|
return Be(f, v);
|
|
291
292
|
});
|
|
@@ -312,12 +313,12 @@ function tt(e) {
|
|
|
312
313
|
var n, t = k(), r = t.classNames, a = t.styles, o = t.components, i = ue().goToMonth, l = function(d) {
|
|
313
314
|
i(T(d, e.displayIndex ? -e.displayIndex : 0));
|
|
314
315
|
}, s = (n = o == null ? void 0 : o.CaptionLabel) !== null && n !== void 0 ? n : pt, c = u(s, { id: e.id, displayMonth: e.displayMonth });
|
|
315
|
-
return F("div", { className: r.caption_dropdowns, style: a.caption_dropdowns, children: [u("div", { className: r.vhidden, children: c }), u(
|
|
316
|
+
return F("div", { className: r.caption_dropdowns, style: a.caption_dropdowns, children: [u("div", { className: r.vhidden, children: c }), u(Sn, { onChange: l, displayMonth: e.displayMonth }), u(Ln, { onChange: l, displayMonth: e.displayMonth })] });
|
|
316
317
|
}
|
|
317
|
-
function
|
|
318
|
+
function jn(e) {
|
|
318
319
|
return u("svg", g({ width: "16px", height: "16px", viewBox: "0 0 120 120" }, e, { children: u("path", { d: "M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z", fill: "currentColor", fillRule: "nonzero" }) }));
|
|
319
320
|
}
|
|
320
|
-
function
|
|
321
|
+
function Vn(e) {
|
|
321
322
|
return u("svg", g({ width: "16px", height: "16px", viewBox: "0 0 120 120" }, e, { children: u("path", { d: "M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z", fill: "currentColor" }) }));
|
|
322
323
|
}
|
|
323
324
|
var ye = Bt(function(e, n) {
|
|
@@ -326,7 +327,7 @@ var ye = Bt(function(e, n) {
|
|
|
326
327
|
var i = o.join(" "), l = g(g({}, a.button_reset), a.button);
|
|
327
328
|
return e.style && Object.assign(l, e.style), u("button", g({}, e, { ref: n, type: "button", className: i, style: l }));
|
|
328
329
|
});
|
|
329
|
-
function
|
|
330
|
+
function Kn(e) {
|
|
330
331
|
var n, t, r = k(), a = r.dir, o = r.locale, i = r.classNames, l = r.styles, s = r.labels, c = s.labelPrevious, d = s.labelNext, f = r.components;
|
|
331
332
|
if (!e.nextMonth && !e.previousMonth)
|
|
332
333
|
return u(V, {});
|
|
@@ -336,7 +337,7 @@ function Vn(e) {
|
|
|
336
337
|
].join(" "), y = d(e.nextMonth, { locale: o }), _ = [
|
|
337
338
|
i.nav_button,
|
|
338
339
|
i.nav_button_next
|
|
339
|
-
].join(" "), b = (n = f == null ? void 0 : f.IconRight) !== null && n !== void 0 ? n :
|
|
340
|
+
].join(" "), b = (n = f == null ? void 0 : f.IconRight) !== null && n !== void 0 ? n : Vn, M = (t = f == null ? void 0 : f.IconLeft) !== null && t !== void 0 ? t : jn;
|
|
340
341
|
return F("div", { className: i.nav, style: l.nav, children: [!e.hidePrevious && u(ye, { name: "previous-month", "aria-label": v, className: m, style: l.nav_button_previous, disabled: !e.previousMonth, onClick: e.onPreviousClick, children: a === "rtl" ? u(b, { className: i.nav_icon, style: l.nav_icon }) : u(M, { className: i.nav_icon, style: l.nav_icon }) }), !e.hideNext && u(ye, { name: "next-month", "aria-label": y, className: _, style: l.nav_button_next, disabled: !e.nextMonth, onClick: e.onNextClick, children: a === "rtl" ? u(M, { className: i.nav_icon, style: l.nav_icon }) : u(b, { className: i.nav_icon, style: l.nav_icon }) })] });
|
|
341
342
|
}
|
|
342
343
|
function nt(e) {
|
|
@@ -347,39 +348,39 @@ function nt(e) {
|
|
|
347
348
|
}, m = function() {
|
|
348
349
|
a && o(a);
|
|
349
350
|
};
|
|
350
|
-
return u(
|
|
351
|
+
return u(Kn, { displayMonth: e.displayMonth, hideNext: d, hidePrevious: f, nextMonth: a, previousMonth: r, onPreviousClick: v, onNextClick: m });
|
|
351
352
|
}
|
|
352
|
-
function
|
|
353
|
+
function Un(e) {
|
|
353
354
|
var n, t = k(), r = t.classNames, a = t.disableNavigation, o = t.styles, i = t.captionLayout, l = t.components, s = (n = l == null ? void 0 : l.CaptionLabel) !== null && n !== void 0 ? n : pt, c;
|
|
354
355
|
return a ? c = u(s, { id: e.id, displayMonth: e.displayMonth }) : i === "dropdown" ? c = u(tt, { displayMonth: e.displayMonth, id: e.id }) : i === "dropdown-buttons" ? c = F(V, { children: [u(tt, { displayMonth: e.displayMonth, displayIndex: e.displayIndex, id: e.id }), u(nt, { displayMonth: e.displayMonth, displayIndex: e.displayIndex, id: e.id })] }) : c = F(V, { children: [u(s, { id: e.id, displayMonth: e.displayMonth, displayIndex: e.displayIndex }), u(nt, { displayMonth: e.displayMonth, id: e.id })] }), u("div", { className: r.caption, style: o.caption, children: c });
|
|
355
356
|
}
|
|
356
|
-
function
|
|
357
|
+
function Xn(e) {
|
|
357
358
|
var n = k(), t = n.footer, r = n.styles, a = n.classNames.tfoot;
|
|
358
359
|
return t ? u("tfoot", { className: a, style: r.tfoot, children: u("tr", { children: u("td", { colSpan: 8, children: t }) }) }) : u(V, {});
|
|
359
360
|
}
|
|
360
|
-
function
|
|
361
|
+
function Zn(e, n, t) {
|
|
361
362
|
for (var r = t ? Fe(/* @__PURE__ */ new Date()) : Ae(/* @__PURE__ */ new Date(), { locale: e, weekStartsOn: n }), a = [], o = 0; o < 7; o++) {
|
|
362
363
|
var i = W(r, o);
|
|
363
364
|
a.push(i);
|
|
364
365
|
}
|
|
365
366
|
return a;
|
|
366
367
|
}
|
|
367
|
-
function
|
|
368
|
-
var e = k(), n = e.classNames, t = e.styles, r = e.showWeekNumber, a = e.locale, o = e.weekStartsOn, i = e.ISOWeek, l = e.formatters.formatWeekdayName, s = e.labels.labelWeekday, c =
|
|
368
|
+
function Gn() {
|
|
369
|
+
var e = k(), n = e.classNames, t = e.styles, r = e.showWeekNumber, a = e.locale, o = e.weekStartsOn, i = e.ISOWeek, l = e.formatters.formatWeekdayName, s = e.labels.labelWeekday, c = Zn(a, o, i);
|
|
369
370
|
return F("tr", { style: t.head_row, className: n.head_row, children: [r && u("td", { style: t.head_cell, className: n.head_cell }), c.map(function(d, f) {
|
|
370
371
|
return u("th", { scope: "col", className: n.head_cell, style: t.head_cell, "aria-label": s(d, { locale: a }), children: l(d, { locale: a }) }, f);
|
|
371
372
|
})] });
|
|
372
373
|
}
|
|
373
|
-
function
|
|
374
|
-
var e, n = k(), t = n.classNames, r = n.styles, a = n.components, o = (e = a == null ? void 0 : a.HeadRow) !== null && e !== void 0 ? e :
|
|
374
|
+
function $n() {
|
|
375
|
+
var e, n = k(), t = n.classNames, r = n.styles, a = n.components, o = (e = a == null ? void 0 : a.HeadRow) !== null && e !== void 0 ? e : Gn;
|
|
375
376
|
return u("thead", { style: r.head, className: t.head, children: u(o, {}) });
|
|
376
377
|
}
|
|
377
|
-
function
|
|
378
|
+
function qn(e) {
|
|
378
379
|
var n = k(), t = n.locale, r = n.formatters.formatDay;
|
|
379
380
|
return u(V, { children: r(e.date, { locale: t }) });
|
|
380
381
|
}
|
|
381
382
|
var Ye = G(void 0);
|
|
382
|
-
function
|
|
383
|
+
function Jn(e) {
|
|
383
384
|
if (!se(e.initialProps)) {
|
|
384
385
|
var n = {
|
|
385
386
|
selected: void 0,
|
|
@@ -389,9 +390,9 @@ function qn(e) {
|
|
|
389
390
|
};
|
|
390
391
|
return u(Ye.Provider, { value: n, children: e.children });
|
|
391
392
|
}
|
|
392
|
-
return u(
|
|
393
|
+
return u(Qn, { initialProps: e.initialProps, children: e.children });
|
|
393
394
|
}
|
|
394
|
-
function
|
|
395
|
+
function Qn(e) {
|
|
395
396
|
var n = e.initialProps, t = e.children, r = n.selected, a = n.min, o = n.max, i = function(c, d, f) {
|
|
396
397
|
var v, m;
|
|
397
398
|
(v = n.onDayClick) === null || v === void 0 || v.call(n, c, d, f);
|
|
@@ -432,12 +433,12 @@ function He() {
|
|
|
432
433
|
throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");
|
|
433
434
|
return e;
|
|
434
435
|
}
|
|
435
|
-
function
|
|
436
|
+
function zn(e, n) {
|
|
436
437
|
var t = n || {}, r = t.from, a = t.to;
|
|
437
438
|
return r && a ? C(a, e) && C(r, e) ? void 0 : C(a, e) ? { from: a, to: void 0 } : C(r, e) ? void 0 : pe(r, e) ? { from: e, to: a } : { from: r, to: e } : a ? pe(e, a) ? { from: a, to: e } : { from: e, to: a } : r ? Te(e, r) ? { from: e, to: r } : { from: r, to: e } : { from: e, to: void 0 };
|
|
438
439
|
}
|
|
439
440
|
var je = G(void 0);
|
|
440
|
-
function
|
|
441
|
+
function er(e) {
|
|
441
442
|
if (!de(e.initialProps)) {
|
|
442
443
|
var n = {
|
|
443
444
|
selected: void 0,
|
|
@@ -450,13 +451,13 @@ function zn(e) {
|
|
|
450
451
|
};
|
|
451
452
|
return u(je.Provider, { value: n, children: e.children });
|
|
452
453
|
}
|
|
453
|
-
return u(
|
|
454
|
+
return u(tr, { initialProps: e.initialProps, children: e.children });
|
|
454
455
|
}
|
|
455
|
-
function
|
|
456
|
+
function tr(e) {
|
|
456
457
|
var n = e.initialProps, t = e.children, r = n.selected, a = r || {}, o = a.from, i = a.to, l = n.min, s = n.max, c = function(m, y, _) {
|
|
457
458
|
var b, M;
|
|
458
459
|
(b = n.onDayClick) === null || b === void 0 || b.call(n, m, y, _);
|
|
459
|
-
var D =
|
|
460
|
+
var D = zn(m, r);
|
|
460
461
|
(M = n.onSelect) === null || M === void 0 || M.call(n, D, m, y, _);
|
|
461
462
|
}, d = {
|
|
462
463
|
range_start: [],
|
|
@@ -508,7 +509,7 @@ function Ve() {
|
|
|
508
509
|
function me(e) {
|
|
509
510
|
return Array.isArray(e) ? mt([], e) : e !== void 0 ? [e] : [];
|
|
510
511
|
}
|
|
511
|
-
function
|
|
512
|
+
function nr(e) {
|
|
512
513
|
var n = {};
|
|
513
514
|
return Object.entries(e).forEach(function(t) {
|
|
514
515
|
var r = t[0], a = t[1];
|
|
@@ -519,14 +520,14 @@ var R;
|
|
|
519
520
|
(function(e) {
|
|
520
521
|
e.Outside = "outside", e.Disabled = "disabled", e.Selected = "selected", e.Hidden = "hidden", e.Today = "today", e.RangeStart = "range_start", e.RangeEnd = "range_end", e.RangeMiddle = "range_middle";
|
|
521
522
|
})(R || (R = {}));
|
|
522
|
-
var
|
|
523
|
-
function
|
|
524
|
-
var r, a = (r = {}, r[
|
|
523
|
+
var rr = R.Selected, Y = R.Disabled, ar = R.Hidden, or = R.Today, Ne = R.RangeEnd, Ce = R.RangeMiddle, Pe = R.RangeStart, ir = R.Outside;
|
|
524
|
+
function lr(e, n, t) {
|
|
525
|
+
var r, a = (r = {}, r[rr] = me(e.selected), r[Y] = me(e.disabled), r[ar] = me(e.hidden), r[or] = [e.today], r[Ne] = [], r[Ce] = [], r[Pe] = [], r[ir] = [], r);
|
|
525
526
|
return e.fromDate && a[Y].push({ before: e.fromDate }), e.toDate && a[Y].push({ after: e.toDate }), se(e) ? a[Y] = a[Y].concat(n.modifiers[Y]) : de(e) && (a[Y] = a[Y].concat(t.modifiers[Y]), a[Pe] = t.modifiers[Pe], a[Ce] = t.modifiers[Ce], a[Ne] = t.modifiers[Ne]), a;
|
|
526
527
|
}
|
|
527
528
|
var gt = G(void 0);
|
|
528
|
-
function
|
|
529
|
-
var n = k(), t = He(), r = Ve(), a =
|
|
529
|
+
function sr(e) {
|
|
530
|
+
var n = k(), t = He(), r = Ve(), a = lr(n, t, r), o = nr(n.modifiers), i = g(g({}, a), o);
|
|
530
531
|
return u(gt.Provider, { value: i, children: e.children });
|
|
531
532
|
}
|
|
532
533
|
function _t() {
|
|
@@ -535,22 +536,22 @@ function _t() {
|
|
|
535
536
|
throw new Error("useModifiers must be used within a ModifiersProvider");
|
|
536
537
|
return e;
|
|
537
538
|
}
|
|
538
|
-
function
|
|
539
|
+
function dr(e) {
|
|
539
540
|
return !!(e && typeof e == "object" && "before" in e && "after" in e);
|
|
540
541
|
}
|
|
541
|
-
function
|
|
542
|
+
function ur(e) {
|
|
542
543
|
return !!(e && typeof e == "object" && "from" in e);
|
|
543
544
|
}
|
|
544
|
-
function
|
|
545
|
+
function cr(e) {
|
|
545
546
|
return !!(e && typeof e == "object" && "after" in e);
|
|
546
547
|
}
|
|
547
|
-
function
|
|
548
|
+
function fr(e) {
|
|
548
549
|
return !!(e && typeof e == "object" && "before" in e);
|
|
549
550
|
}
|
|
550
|
-
function
|
|
551
|
+
function vr(e) {
|
|
551
552
|
return !!(e && typeof e == "object" && "dayOfWeek" in e);
|
|
552
553
|
}
|
|
553
|
-
function
|
|
554
|
+
function mr(e, n) {
|
|
554
555
|
var t, r = n.from, a = n.to;
|
|
555
556
|
if (r && a) {
|
|
556
557
|
var o = H(a, r) < 0;
|
|
@@ -560,41 +561,41 @@ function vr(e, n) {
|
|
|
560
561
|
}
|
|
561
562
|
return a ? C(a, e) : r ? C(r, e) : !1;
|
|
562
563
|
}
|
|
563
|
-
function
|
|
564
|
+
function hr(e) {
|
|
564
565
|
return ut(e);
|
|
565
566
|
}
|
|
566
|
-
function
|
|
567
|
+
function pr(e) {
|
|
567
568
|
return Array.isArray(e) && e.every(ut);
|
|
568
569
|
}
|
|
569
|
-
function
|
|
570
|
+
function yr(e, n) {
|
|
570
571
|
return n.some(function(t) {
|
|
571
572
|
if (typeof t == "boolean")
|
|
572
573
|
return t;
|
|
573
|
-
if (mr(t))
|
|
574
|
-
return C(e, t);
|
|
575
574
|
if (hr(t))
|
|
575
|
+
return C(e, t);
|
|
576
|
+
if (pr(t))
|
|
576
577
|
return t.includes(e);
|
|
577
|
-
if (
|
|
578
|
-
return
|
|
579
|
-
if (
|
|
578
|
+
if (ur(t))
|
|
579
|
+
return mr(e, t);
|
|
580
|
+
if (vr(t))
|
|
580
581
|
return t.dayOfWeek.includes(e.getDay());
|
|
581
|
-
if (
|
|
582
|
+
if (dr(t)) {
|
|
582
583
|
var r = H(t.before, e), a = H(t.after, e), o = r > 0, i = a < 0, l = pe(t.before, t.after);
|
|
583
584
|
return l ? i && o : o || i;
|
|
584
585
|
}
|
|
585
|
-
return
|
|
586
|
+
return cr(t) ? H(e, t.after) > 0 : fr(t) ? H(t.before, e) > 0 : typeof t == "function" ? t(e) : !1;
|
|
586
587
|
});
|
|
587
588
|
}
|
|
588
589
|
function Ke(e, n, t) {
|
|
589
590
|
var r = Object.keys(n).reduce(function(o, i) {
|
|
590
591
|
var l = n[i];
|
|
591
|
-
return
|
|
592
|
+
return yr(e, l) && o.push(i), o;
|
|
592
593
|
}, []), a = {};
|
|
593
594
|
return r.forEach(function(o) {
|
|
594
595
|
return a[o] = !0;
|
|
595
596
|
}), t && !Be(e, t) && (a.outside = !0), a;
|
|
596
597
|
}
|
|
597
|
-
function
|
|
598
|
+
function br(e, n) {
|
|
598
599
|
for (var t = E(e[0]), r = Re(e[e.length - 1]), a, o, i = t; i <= r; ) {
|
|
599
600
|
var l = Ke(i, n), s = !l.disabled && !l.hidden;
|
|
600
601
|
if (!s) {
|
|
@@ -607,7 +608,7 @@ function yr(e, n) {
|
|
|
607
608
|
}
|
|
608
609
|
return o || a;
|
|
609
610
|
}
|
|
610
|
-
var
|
|
611
|
+
var gr = 365;
|
|
611
612
|
function wt(e, n) {
|
|
612
613
|
var t = n.moveBy, r = n.direction, a = n.context, o = n.modifiers, i = n.retry, l = i === void 0 ? { count: 0, lastFocused: e } : i, s = a.weekStartsOn, c = a.fromDate, d = a.toDate, f = a.locale, v = {
|
|
613
614
|
day: W,
|
|
@@ -627,7 +628,7 @@ function wt(e, n) {
|
|
|
627
628
|
var _ = Ke(m, o);
|
|
628
629
|
y = !_.disabled && !_.hidden;
|
|
629
630
|
}
|
|
630
|
-
return y ? m : l.count >
|
|
631
|
+
return y ? m : l.count > gr ? l.lastFocused : wt(m, {
|
|
631
632
|
moveBy: t,
|
|
632
633
|
direction: r,
|
|
633
634
|
context: a,
|
|
@@ -636,8 +637,8 @@ function wt(e, n) {
|
|
|
636
637
|
});
|
|
637
638
|
}
|
|
638
639
|
var Dt = G(void 0);
|
|
639
|
-
function
|
|
640
|
-
var n = ue(), t = _t(), r = S(), a = r[0], o = r[1], i = S(), l = i[0], s = i[1], c =
|
|
640
|
+
function _r(e) {
|
|
641
|
+
var n = ue(), t = _t(), r = S(), a = r[0], o = r[1], i = S(), l = i[0], s = i[1], c = br(n.displayMonths, t), d = a ?? (l && n.isDateDisplayed(l)) ? l : c, f = function() {
|
|
641
642
|
s(a), o(void 0);
|
|
642
643
|
}, v = function(b) {
|
|
643
644
|
o(b);
|
|
@@ -695,21 +696,21 @@ function Ue() {
|
|
|
695
696
|
throw new Error("useFocusContext must be used within a FocusProvider");
|
|
696
697
|
return e;
|
|
697
698
|
}
|
|
698
|
-
function
|
|
699
|
+
function wr(e, n) {
|
|
699
700
|
var t = _t(), r = Ke(e, t, n);
|
|
700
701
|
return r;
|
|
701
702
|
}
|
|
702
703
|
var Xe = G(void 0);
|
|
703
|
-
function
|
|
704
|
+
function Dr(e) {
|
|
704
705
|
if (!ge(e.initialProps)) {
|
|
705
706
|
var n = {
|
|
706
707
|
selected: void 0
|
|
707
708
|
};
|
|
708
709
|
return u(Xe.Provider, { value: n, children: e.children });
|
|
709
710
|
}
|
|
710
|
-
return u(
|
|
711
|
+
return u(Mr, { initialProps: e.initialProps, children: e.children });
|
|
711
712
|
}
|
|
712
|
-
function
|
|
713
|
+
function Mr(e) {
|
|
713
714
|
var n = e.initialProps, t = e.children, r = function(o, i, l) {
|
|
714
715
|
var s, c, d;
|
|
715
716
|
if ((s = n.onDayClick) === null || s === void 0 || s.call(n, o, i, l), i.selected && !n.required) {
|
|
@@ -729,7 +730,7 @@ function Mt() {
|
|
|
729
730
|
throw new Error("useSelectSingle must be used within a SelectSingleProvider");
|
|
730
731
|
return e;
|
|
731
732
|
}
|
|
732
|
-
function
|
|
733
|
+
function kr(e, n) {
|
|
733
734
|
var t = k(), r = Mt(), a = He(), o = Ve(), i = Ue(), l = i.focusDayAfter, s = i.focusDayBefore, c = i.focusWeekAfter, d = i.focusWeekBefore, f = i.blur, v = i.focus, m = i.focusMonthBefore, y = i.focusMonthAfter, _ = i.focusYearBefore, b = i.focusYearAfter, M = i.focusStartOfWeek, D = i.focusEndOfWeek, O = function(h) {
|
|
734
735
|
var p, J, ne, re;
|
|
735
736
|
ge(t) ? (p = r.onDayClick) === null || p === void 0 || p.call(r, e, n, h) : se(t) ? (J = a.onDayClick) === null || J === void 0 || J.call(a, e, n, h) : de(t) ? (ne = o.onDayClick) === null || ne === void 0 || ne.call(o, e, n, h) : (re = t.onDayClick) === null || re === void 0 || re.call(t, e, n, h);
|
|
@@ -812,34 +813,34 @@ function Mr(e, n) {
|
|
|
812
813
|
};
|
|
813
814
|
return te;
|
|
814
815
|
}
|
|
815
|
-
function
|
|
816
|
+
function Nr() {
|
|
816
817
|
var e = k(), n = Mt(), t = He(), r = Ve(), a = ge(e) ? n.selected : se(e) ? t.selected : de(e) ? r.selected : void 0;
|
|
817
818
|
return a;
|
|
818
819
|
}
|
|
819
|
-
function
|
|
820
|
+
function Cr(e) {
|
|
820
821
|
return Object.values(R).includes(e);
|
|
821
822
|
}
|
|
822
|
-
function
|
|
823
|
+
function Pr(e, n) {
|
|
823
824
|
var t = [e.classNames.day];
|
|
824
825
|
return Object.keys(n).forEach(function(r) {
|
|
825
826
|
var a = e.modifiersClassNames[r];
|
|
826
827
|
if (a)
|
|
827
828
|
t.push(a);
|
|
828
|
-
else if (
|
|
829
|
+
else if (Cr(r)) {
|
|
829
830
|
var o = e.classNames["day_".concat(r)];
|
|
830
831
|
o && t.push(o);
|
|
831
832
|
}
|
|
832
833
|
}), t;
|
|
833
834
|
}
|
|
834
|
-
function
|
|
835
|
+
function xr(e, n) {
|
|
835
836
|
var t = g({}, e.styles.day);
|
|
836
837
|
return Object.keys(n).forEach(function(r) {
|
|
837
838
|
var a;
|
|
838
839
|
t = g(g({}, t), (a = e.modifiersStyles) === null || a === void 0 ? void 0 : a[r]);
|
|
839
840
|
}), t;
|
|
840
841
|
}
|
|
841
|
-
function
|
|
842
|
-
var r, a, o, i = k(), l = Ue(), s =
|
|
842
|
+
function Or(e, n, t) {
|
|
843
|
+
var r, a, o, i = k(), l = Ue(), s = wr(e, n), c = kr(e, s), d = Nr(), f = !!(i.onDayClick || i.mode !== "default");
|
|
843
844
|
be(function() {
|
|
844
845
|
var I;
|
|
845
846
|
s.outside || l.focusedDay && f && C(l.focusedDay, e) && ((I = t.current) === null || I === void 0 || I.focus());
|
|
@@ -850,7 +851,7 @@ function xr(e, n, t) {
|
|
|
850
851
|
f,
|
|
851
852
|
s.outside
|
|
852
853
|
]);
|
|
853
|
-
var v =
|
|
854
|
+
var v = Pr(i, s).join(" "), m = xr(i, s), y = !!(s.outside && !i.showOutsideDays || s.hidden), _ = (o = (a = i.components) === null || a === void 0 ? void 0 : a.DayContent) !== null && o !== void 0 ? o : qn, b = u(_, { date: e, displayMonth: n, activeModifiers: s }), M = {
|
|
854
855
|
style: m,
|
|
855
856
|
className: v,
|
|
856
857
|
children: b,
|
|
@@ -865,11 +866,11 @@ function xr(e, n, t) {
|
|
|
865
866
|
};
|
|
866
867
|
return P;
|
|
867
868
|
}
|
|
868
|
-
function
|
|
869
|
-
var n = he(null), t =
|
|
869
|
+
function Ir(e) {
|
|
870
|
+
var n = he(null), t = Or(e.date, e.displayMonth, n);
|
|
870
871
|
return t.isHidden ? u("div", { role: "gridcell" }) : t.isButton ? u(ye, g({ name: "day", ref: n }, t.buttonProps)) : u("div", g({}, t.divProps));
|
|
871
872
|
}
|
|
872
|
-
function
|
|
873
|
+
function Wr(e) {
|
|
873
874
|
var n = e.number, t = e.dates, r = k(), a = r.onWeekNumberClick, o = r.styles, i = r.classNames, l = r.locale, s = r.labels.labelWeekNumber, c = r.formatters.formatWeekNumber, d = c(Number(n), { locale: l });
|
|
874
875
|
if (!a)
|
|
875
876
|
return u("span", { className: i.weeknumber, style: o.weeknumber, children: d });
|
|
@@ -878,8 +879,8 @@ function Ir(e) {
|
|
|
878
879
|
};
|
|
879
880
|
return u(ye, { name: "week-number", "aria-label": f, className: i.weeknumber, style: o.weeknumber, onClick: v, children: d });
|
|
880
881
|
}
|
|
881
|
-
function
|
|
882
|
-
var n, t, r = k(), a = r.styles, o = r.classNames, i = r.showWeekNumber, l = r.components, s = (n = l == null ? void 0 : l.Day) !== null && n !== void 0 ? n :
|
|
882
|
+
function Er(e) {
|
|
883
|
+
var n, t, r = k(), a = r.styles, o = r.classNames, i = r.showWeekNumber, l = r.components, s = (n = l == null ? void 0 : l.Day) !== null && n !== void 0 ? n : Ir, c = (t = l == null ? void 0 : l.WeekNumber) !== null && t !== void 0 ? t : Wr, d;
|
|
883
884
|
return i && (d = u("td", { className: o.cell, style: a.cell, children: u(c, { number: e.weekNumber, dates: e.dates }) })), F("tr", { className: o.row, style: a.row, children: [d, e.dates.map(function(f) {
|
|
884
885
|
return u("td", { className: o.cell, style: a.cell, role: "presentation", children: u(s, { displayMonth: e.displayMonth, date: f }) }, Ft(f));
|
|
885
886
|
})] });
|
|
@@ -898,7 +899,7 @@ function rt(e, n, t) {
|
|
|
898
899
|
}, []);
|
|
899
900
|
return s;
|
|
900
901
|
}
|
|
901
|
-
function
|
|
902
|
+
function Sr(e, n) {
|
|
902
903
|
var t = rt(E(e), Re(e), n);
|
|
903
904
|
if (n != null && n.useFixedWeeks) {
|
|
904
905
|
var r = At(e, n);
|
|
@@ -909,44 +910,44 @@ function Er(e, n) {
|
|
|
909
910
|
}
|
|
910
911
|
return t;
|
|
911
912
|
}
|
|
912
|
-
function
|
|
913
|
-
var n, t, r, a = k(), o = a.locale, i = a.classNames, l = a.styles, s = a.hideHead, c = a.fixedWeeks, d = a.components, f = a.weekStartsOn, v = a.firstWeekContainsDate, m = a.ISOWeek, y =
|
|
913
|
+
function Lr(e) {
|
|
914
|
+
var n, t, r, a = k(), o = a.locale, i = a.classNames, l = a.styles, s = a.hideHead, c = a.fixedWeeks, d = a.components, f = a.weekStartsOn, v = a.firstWeekContainsDate, m = a.ISOWeek, y = Sr(e.displayMonth, {
|
|
914
915
|
useFixedWeeks: !!c,
|
|
915
916
|
ISOWeek: m,
|
|
916
917
|
locale: o,
|
|
917
918
|
weekStartsOn: f,
|
|
918
919
|
firstWeekContainsDate: v
|
|
919
|
-
}), _ = (n = d == null ? void 0 : d.Head) !== null && n !== void 0 ? n :
|
|
920
|
+
}), _ = (n = d == null ? void 0 : d.Head) !== null && n !== void 0 ? n : $n, b = (t = d == null ? void 0 : d.Row) !== null && t !== void 0 ? t : Er, M = (r = d == null ? void 0 : d.Footer) !== null && r !== void 0 ? r : Xn;
|
|
920
921
|
return F("table", { id: e.id, className: i.table, style: l.table, role: "grid", "aria-labelledby": e["aria-labelledby"], children: [!s && u(_, {}), u("tbody", { className: i.tbody, style: l.tbody, children: y.map(function(D) {
|
|
921
922
|
return u(b, { displayMonth: e.displayMonth, dates: D.dates, weekNumber: D.weekNumber }, D.weekNumber);
|
|
922
923
|
}) }), u(M, { displayMonth: e.displayMonth })] });
|
|
923
924
|
}
|
|
924
|
-
function
|
|
925
|
+
function Rr() {
|
|
925
926
|
return !!(typeof window < "u" && window.document && window.document.createElement);
|
|
926
927
|
}
|
|
927
|
-
var
|
|
928
|
+
var Br = Rr() ? Tt : be, xe = !1, Tr = 0;
|
|
928
929
|
function at() {
|
|
929
|
-
return "react-day-picker-".concat(++
|
|
930
|
+
return "react-day-picker-".concat(++Tr);
|
|
930
931
|
}
|
|
931
|
-
function
|
|
932
|
+
function Fr(e) {
|
|
932
933
|
var n, t = e ?? (xe ? at() : null), r = S(t), a = r[0], o = r[1];
|
|
933
|
-
return
|
|
934
|
+
return Br(function() {
|
|
934
935
|
a === null && o(at());
|
|
935
936
|
}, []), be(function() {
|
|
936
937
|
xe === !1 && (xe = !0);
|
|
937
938
|
}, []), (n = e ?? a) !== null && n !== void 0 ? n : void 0;
|
|
938
939
|
}
|
|
939
|
-
function
|
|
940
|
-
var n, t, r = k(), a = r.dir, o = r.classNames, i = r.styles, l = r.components, s = ue().displayMonths, c =
|
|
940
|
+
function Ar(e) {
|
|
941
|
+
var n, t, r = k(), a = r.dir, o = r.classNames, i = r.styles, l = r.components, s = ue().displayMonths, c = Fr(r.id ? "".concat(r.id, "-").concat(e.displayIndex) : void 0), d = r.id ? "".concat(r.id, "-grid-").concat(e.displayIndex) : void 0, f = [o.month], v = i.month, m = e.displayIndex === 0, y = e.displayIndex === s.length - 1, _ = !m && !y;
|
|
941
942
|
a === "rtl" && (n = [m, y], y = n[0], m = n[1]), m && (f.push(o.caption_start), v = g(g({}, v), i.caption_start)), y && (f.push(o.caption_end), v = g(g({}, v), i.caption_end)), _ && (f.push(o.caption_between), v = g(g({}, v), i.caption_between));
|
|
942
|
-
var b = (t = l == null ? void 0 : l.Caption) !== null && t !== void 0 ? t :
|
|
943
|
-
return F("div", { className: f.join(" "), style: v, children: [u(b, { id: c, displayMonth: e.displayMonth, displayIndex: e.displayIndex }), u(
|
|
943
|
+
var b = (t = l == null ? void 0 : l.Caption) !== null && t !== void 0 ? t : Un;
|
|
944
|
+
return F("div", { className: f.join(" "), style: v, children: [u(b, { id: c, displayMonth: e.displayMonth, displayIndex: e.displayIndex }), u(Lr, { id: d, "aria-labelledby": c, displayMonth: e.displayMonth })] }, e.displayIndex);
|
|
944
945
|
}
|
|
945
|
-
function
|
|
946
|
+
function Yr(e) {
|
|
946
947
|
var n = k(), t = n.classNames, r = n.styles;
|
|
947
948
|
return u("div", { className: t.months, style: r.months, children: e.children });
|
|
948
949
|
}
|
|
949
|
-
function
|
|
950
|
+
function Hr(e) {
|
|
950
951
|
var n, t, r = e.initialProps, a = k(), o = Ue(), i = ue(), l = S(!1), s = l[0], c = l[1];
|
|
951
952
|
be(function() {
|
|
952
953
|
a.initialFocus && o.focusTarget && (s || (o.focus(o.focusTarget), c(!0)));
|
|
@@ -964,30 +965,30 @@ function Yr(e) {
|
|
|
964
965
|
}).reduce(function(y, _) {
|
|
965
966
|
var b;
|
|
966
967
|
return g(g({}, y), (b = {}, b[_] = r[_], b));
|
|
967
|
-
}, {}), m = (t = (n = r.components) === null || n === void 0 ? void 0 : n.Months) !== null && t !== void 0 ? t :
|
|
968
|
+
}, {}), m = (t = (n = r.components) === null || n === void 0 ? void 0 : n.Months) !== null && t !== void 0 ? t : Yr;
|
|
968
969
|
return u("div", g({ className: d.join(" "), style: f, dir: a.dir, id: a.id, nonce: r.nonce, title: r.title, lang: r.lang }, v, { children: u(m, { children: i.displayMonths.map(function(y, _) {
|
|
969
|
-
return u(
|
|
970
|
+
return u(Ar, { displayIndex: _, displayMonth: y }, _);
|
|
970
971
|
}) }) }));
|
|
971
972
|
}
|
|
972
|
-
function Hr(e) {
|
|
973
|
-
var n = e.children, t = cn(e, ["children"]);
|
|
974
|
-
return u(In, { initialProps: t, children: u(Yn, { children: u(wr, { initialProps: t, children: u(qn, { initialProps: t, children: u(zn, { initialProps: t, children: u(lr, { children: u(gr, { children: n }) }) }) }) }) }) });
|
|
975
|
-
}
|
|
976
973
|
function jr(e) {
|
|
977
|
-
|
|
974
|
+
var n = e.children, t = fn(e, ["children"]);
|
|
975
|
+
return u(Wn, { initialProps: t, children: u(Hn, { children: u(Dr, { initialProps: t, children: u(Jn, { initialProps: t, children: u(er, { initialProps: t, children: u(sr, { children: u(_r, { children: n }) }) }) }) }) }) });
|
|
976
|
+
}
|
|
977
|
+
function Vr(e) {
|
|
978
|
+
return u(jr, g({}, e, { children: u(Hr, { initialProps: e }) }));
|
|
978
979
|
}
|
|
979
|
-
const
|
|
980
|
-
const t =
|
|
980
|
+
const Kr = 329, U = 12, _e = 26, kt = 20, Le = 9, ot = 12, Nt = (e, n) => e.top > n.height + _e ? j.positionabove : j.positionbelow, Ur = (e) => e.left + e.width / 4, Xr = (e) => document.documentElement.clientWidth - e.right + e.width / 4, Zr = (e, n) => e.left + n.width, Gr = (e) => e.left > U, $r = (e, n) => Zr(e, n) < document.documentElement.clientWidth - U, qr = (e, n) => $r(e, n) ? Gr(e) ? "floating" : "left" : "right", Oe = (e, n) => e.top - _e - n.height, Ie = (e) => e.bottom + _e, Jr = () => document.documentElement.clientWidth - U * 2, Qr = () => document.documentElement.clientWidth > Kr + U * 2, it = (e) => e.top - _e - Le + 5, zr = (e) => Ur(e) - kt / 2, ea = (e) => Xr(e) - kt / 2, ta = (e, n) => {
|
|
981
|
+
const t = qr(e, n), r = Nt(e, n);
|
|
981
982
|
return t === "left" ? r === j.positionabove ? "leftabove" : "leftbelow" : t === "right" ? r === j.positionabove ? "rightabove" : "rightbelow" : r === j.positionabove ? "floatingabove" : "floatingbelow";
|
|
982
|
-
},
|
|
983
|
-
const t =
|
|
983
|
+
}, na = (e, n) => {
|
|
984
|
+
const t = ta(e, n), r = Qr() ? void 0 : Jr();
|
|
984
985
|
return t === "leftabove" ? {
|
|
985
986
|
left: U,
|
|
986
987
|
top: Oe(e, n),
|
|
987
988
|
width: r
|
|
988
989
|
} : t === "leftbelow" ? { left: U, top: Ie(e), width: r } : t === "rightabove" ? { right: U, top: Oe(e, n), width: r } : t === "rightbelow" ? { right: U, top: Ie(e), width: r } : t === "floatingbelow" ? { left: e.left, top: Ie(e), width: r } : { left: e.left, top: Oe(e, n), width: r };
|
|
989
|
-
},
|
|
990
|
-
const r =
|
|
990
|
+
}, ra = (e, n, t) => {
|
|
991
|
+
const r = zr(n), a = ea(n), o = e.left + ot, i = e.right + ot;
|
|
991
992
|
return e.right ? t === j.positionabove ? {
|
|
992
993
|
right: a > i ? a : i,
|
|
993
994
|
top: it(n)
|
|
@@ -1001,7 +1002,7 @@ const Vr = 329, U = 12, _e = 26, kt = 20, Le = 9, ot = 12, Nt = (e, n) => e.top
|
|
|
1001
1002
|
left: r > o ? r : o,
|
|
1002
1003
|
top: n.bottom + Le
|
|
1003
1004
|
};
|
|
1004
|
-
},
|
|
1005
|
+
}, aa = (e) => {
|
|
1005
1006
|
const { datepickerWrapperRef: n, footer: t, inputRef: r, testId: a, zIndex: o, ...i } = e, l = he(null), [s, c] = S(), d = sn(n), f = on(r, 0);
|
|
1006
1007
|
rn(n, !0);
|
|
1007
1008
|
const v = () => {
|
|
@@ -1017,16 +1018,17 @@ const Vr = 329, U = 12, _e = 26, kt = 20, Le = 9, ot = 12, Nt = (e, n) => e.top
|
|
|
1017
1018
|
[x["datepicker-popup-arrow--visible"]]: f,
|
|
1018
1019
|
[x["datepicker-popup-arrow--over"]]: y === j.positionbelow,
|
|
1019
1020
|
[x["datepicker-popup-arrow--under"]]: y === j.positionabove
|
|
1020
|
-
}), b = s && d &&
|
|
1021
|
+
}), b = s && d && na(s, d), M = b && s && y && ra(b, s, y), D = {
|
|
1021
1022
|
...nn,
|
|
1022
1023
|
...x
|
|
1023
1024
|
};
|
|
1024
1025
|
return /* @__PURE__ */ w.createElement(w.Fragment, null, /* @__PURE__ */ w.createElement("div", { className: m, "data-testid": a, ref: n, style: { ...b, zIndex: o } }, /* @__PURE__ */ w.createElement(
|
|
1025
|
-
|
|
1026
|
+
Vr,
|
|
1026
1027
|
{
|
|
1027
1028
|
captionLayout: "dropdown-buttons",
|
|
1028
1029
|
classNames: D,
|
|
1029
1030
|
mode: "single",
|
|
1031
|
+
style: { "--rdp-cell-size": dn("l") },
|
|
1030
1032
|
modifiersClassNames: { today: x["day--today"], selected: x.day_selected, disabled: x["day--disabled"] },
|
|
1031
1033
|
footer: /* @__PURE__ */ w.createElement("span", { className: x["footer-wrapper"] }, t),
|
|
1032
1034
|
fixedWeeks: !0,
|
|
@@ -1148,7 +1150,7 @@ const Vr = 329, U = 12, _e = 26, kt = 20, Le = 9, ot = 12, Nt = (e, n) => e.top
|
|
|
1148
1150
|
autoComplete: K || void 0
|
|
1149
1151
|
}
|
|
1150
1152
|
)), te && !s && /* @__PURE__ */ w.createElement(
|
|
1151
|
-
|
|
1153
|
+
aa,
|
|
1152
1154
|
{
|
|
1153
1155
|
dir: l,
|
|
1154
1156
|
disabled: re,
|
|
@@ -1171,12 +1173,12 @@ Ct.displayName = "DatePicker";
|
|
|
1171
1173
|
const lt = (e) => {
|
|
1172
1174
|
const n = String(e);
|
|
1173
1175
|
return n.length === 1 ? "0" + n : n;
|
|
1174
|
-
},
|
|
1176
|
+
}, oa = (e) => !e || /^\d+$/.test(e) && e.length <= 2, Pt = w.forwardRef((e, n) => {
|
|
1175
1177
|
const { defaultValue: t, error: r, errorText: a, errorTextId: o, label: i, onChange: l, timeUnit: s, testId: c, inputId: d, autoComplete: f = "off", ...v } = e, [m, y] = S(
|
|
1176
1178
|
typeof t < "u" ? lt(t) : ""
|
|
1177
1179
|
), { refObject: _ } = ct(ft(n) ? n : null), b = vt([n, _]), M = (P) => {
|
|
1178
1180
|
const I = P.target.value;
|
|
1179
|
-
|
|
1181
|
+
oa(I) && (y(I), l && l(P));
|
|
1180
1182
|
}, D = (P) => {
|
|
1181
1183
|
const I = lt(P.target.value);
|
|
1182
1184
|
y(I), l && l(P);
|
|
@@ -1208,8 +1210,8 @@ const lt = (e) => {
|
|
|
1208
1210
|
));
|
|
1209
1211
|
});
|
|
1210
1212
|
Pt.displayName = "DateTime";
|
|
1211
|
-
const
|
|
1212
|
-
const { children: t, errorText: r, legend: a, testId: o } = e, i =
|
|
1213
|
+
const ia = w.forwardRef((e, n) => {
|
|
1214
|
+
const { children: t, errorText: r, legend: a, testId: o } = e, i = cn(), l = (s) => et(s, Ct) ? w.cloneElement(s, {
|
|
1213
1215
|
className: Se(x["date-time-picker-wrapper__date-picker"]),
|
|
1214
1216
|
error: !!r,
|
|
1215
1217
|
errorTextId: i
|
|
@@ -1217,9 +1219,9 @@ const oa = w.forwardRef((e, n) => {
|
|
|
1217
1219
|
error: !!r,
|
|
1218
1220
|
errorTextId: i
|
|
1219
1221
|
}) : s;
|
|
1220
|
-
return /* @__PURE__ */ w.createElement("div", { ref: n, tabIndex: -1 }, /* @__PURE__ */ w.createElement(
|
|
1222
|
+
return /* @__PURE__ */ w.createElement("div", { ref: n, tabIndex: -1 }, /* @__PURE__ */ w.createElement(un, { errorText: r, errorTextId: i }, e.legend ? /* @__PURE__ */ w.createElement("fieldset", { className: x["date-time-picker-wrapper"], "data-testid": o }, e.legend && /* @__PURE__ */ w.createElement("legend", { className: x["date-time-picker-wrapper__legend"] }, a), w.Children.map(t, l)) : /* @__PURE__ */ w.createElement("div", { className: x["date-time-picker-wrapper"] }, w.Children.map(t, l))));
|
|
1221
1223
|
});
|
|
1222
|
-
|
|
1224
|
+
ia.displayName = "DateTimePickerWrapper";
|
|
1223
1225
|
const xt = (e) => {
|
|
1224
1226
|
const n = ["yyyy-MM-dd", "dd.MM.yyyy"];
|
|
1225
1227
|
for (const t of n) {
|
|
@@ -1228,28 +1230,28 @@ const xt = (e) => {
|
|
|
1228
1230
|
return r;
|
|
1229
1231
|
}
|
|
1230
1232
|
return null;
|
|
1231
|
-
},
|
|
1233
|
+
}, La = (e) => {
|
|
1232
1234
|
const n = new Date(e);
|
|
1233
1235
|
return n instanceof Date && !isNaN(n.getTime());
|
|
1234
|
-
},
|
|
1236
|
+
}, Ra = (e, n, t, r) => {
|
|
1235
1237
|
const a = xt(e), o = typeof t < "u", i = typeof r < "u";
|
|
1236
1238
|
return !a || o && !le(t) || i && !le(r) ? "Invalid date format" : o && !i && (C(a, t) || pe(a, t)) || i && !o && (C(a, r) || Te(a, r)) || o && i && (C(a, t) || C(a, r) || Zt(a, { start: t, end: r })) ? !0 : n;
|
|
1237
|
-
},
|
|
1239
|
+
}, Ba = (e, n, t) => {
|
|
1238
1240
|
const r = xt(e);
|
|
1239
1241
|
return r ? n.some((a) => C(a, r)) ? t : !0 : "Invalid date format";
|
|
1240
|
-
},
|
|
1242
|
+
}, Ta = (e, n, t, r) => {
|
|
1241
1243
|
const a = oe((e.hour + ":" + e.minute).toString(), "HH:mm", /* @__PURE__ */ new Date()), o = oe(((t == null ? void 0 : t.hour) + ":" + (t == null ? void 0 : t.minute)).toString(), "HH:mm", /* @__PURE__ */ new Date()), i = oe(((r == null ? void 0 : r.hour) + ":" + (r == null ? void 0 : r.minute)).toString(), "HH:mm", /* @__PURE__ */ new Date());
|
|
1242
1244
|
return (typeof t > "u" || a >= o) && (typeof r > "u" || a <= i) ? !0 : n;
|
|
1243
1245
|
};
|
|
1244
1246
|
export {
|
|
1245
1247
|
Ct as DatePicker,
|
|
1246
1248
|
Pt as DateTime,
|
|
1247
|
-
|
|
1249
|
+
ia as DateTimePickerWrapper,
|
|
1248
1250
|
Ct as default,
|
|
1249
|
-
|
|
1251
|
+
La as isValidDate,
|
|
1250
1252
|
xt as parseInputDate,
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1253
|
+
Ba as validateDisabledDates,
|
|
1254
|
+
Ra as validateMinMaxDate,
|
|
1255
|
+
Ta as validateMinTimeMaxTime
|
|
1254
1256
|
};
|
|
1255
1257
|
//# sourceMappingURL=index.js.map
|