@helsenorge/datepicker 8.5.0 → 8.5.1
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/CHANGELOG.md +28 -3
- package/components/DatePicker/index.js +401 -392
- package/components/DatePicker/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { jsx as d, jsxs as R, Fragment as F } from "react/jsx-runtime";
|
|
2
|
+
import U, { createContext as J, forwardRef as Vt, useContext as Q, useState as T, useEffect as q, useLayoutEffect as Kt, useRef as re } from "react";
|
|
3
|
+
import { isSameDay as C, subDays as Ne, addDays as L, differenceInCalendarDays as j, startOfMonth as E, endOfMonth as Te, startOfDay as tt, addMonths as Y, differenceInCalendarMonths as de, isSameMonth as Fe, isBefore as Ae, isAfter as ye, getUnixTime as Ut, getWeeksInMonth as Xt, addWeeks as Le, isSameYear as Zt, setMonth as Ce, setYear as nt, startOfYear as Gt, max as $t, min as qt, endOfISOWeek as vt, endOfWeek as ht, startOfISOWeek as Ye, startOfWeek as He, getISOWeek as Jt, getWeek as Qt, format as S, isDate as mt, addYears as zt, isValid as ue, parse as se, isWithinInterval as en } from "date-fns";
|
|
3
4
|
import { enUS as tn, nb as nn } from "date-fns/locale";
|
|
4
5
|
import rn from "@helsenorge/designsystem-react/components/Button";
|
|
5
6
|
import an from "@helsenorge/designsystem-react/components/Icon";
|
|
6
7
|
import on from "@helsenorge/designsystem-react/components/Icons/Calendar";
|
|
7
|
-
import
|
|
8
|
+
import Ee from "@helsenorge/designsystem-react/components/Input";
|
|
8
9
|
import { ZIndex as ln, KeyboardEventKey as rt } from "@helsenorge/designsystem-react/constants";
|
|
9
10
|
import { useKeyboardEvent as at } from "@helsenorge/designsystem-react/hooks/useKeyboardEvent";
|
|
10
11
|
import { useOutsideEvent as sn } from "@helsenorge/designsystem-react/hooks/useOutsideEvent";
|
|
@@ -12,16 +13,15 @@ import { usePseudoClasses as pt } from "@helsenorge/designsystem-react/hooks/use
|
|
|
12
13
|
import { isMobileUA as dn } from "@helsenorge/designsystem-react/utils/mobile";
|
|
13
14
|
import { isMutableRefObject as yt, mergeRefs as bt } from "@helsenorge/designsystem-react/utils/refs";
|
|
14
15
|
import Re from "classnames";
|
|
15
|
-
import { jsx as u, jsxs as Y, Fragment as K } from "react/jsx-runtime";
|
|
16
16
|
import un from "react-day-picker/dist/style.module.css";
|
|
17
17
|
import { PopOverVariant as V } from "@helsenorge/designsystem-react/components/PopOver";
|
|
18
18
|
import { useFocusTrap as cn } from "@helsenorge/designsystem-react/hooks/useFocusTrap";
|
|
19
19
|
import { useInterval as fn } from "@helsenorge/designsystem-react/hooks/useInterval";
|
|
20
20
|
import { useIsVisible as vn } from "@helsenorge/designsystem-react/hooks/useIsVisible";
|
|
21
|
-
import { useLayoutEvent as
|
|
22
|
-
import { useSize as
|
|
21
|
+
import { useLayoutEvent as hn } from "@helsenorge/designsystem-react/hooks/useLayoutEvent";
|
|
22
|
+
import { useSize as mn } from "@helsenorge/designsystem-react/hooks/useSize";
|
|
23
23
|
import { getSpacer as pn } from "@helsenorge/designsystem-react/theme/currys/spacing";
|
|
24
|
-
import
|
|
24
|
+
import I from "./styles.module.scss";
|
|
25
25
|
import yn from "@helsenorge/designsystem-react/components/ErrorWrapper";
|
|
26
26
|
import { useUuid as bn } from "@helsenorge/designsystem-react/hooks/useUuid";
|
|
27
27
|
import { isComponent as ot } from "@helsenorge/designsystem-react/utils/component";
|
|
@@ -133,11 +133,11 @@ var Pn = /* @__PURE__ */ Object.freeze({
|
|
|
133
133
|
return "Go to next month";
|
|
134
134
|
}, Wn = function() {
|
|
135
135
|
return "Go to previous month";
|
|
136
|
-
},
|
|
136
|
+
}, Sn = function(e, n) {
|
|
137
137
|
return S(e, "cccc", n);
|
|
138
|
-
},
|
|
138
|
+
}, Ln = function(e) {
|
|
139
139
|
return "Week n. ".concat(e);
|
|
140
|
-
},
|
|
140
|
+
}, En = function() {
|
|
141
141
|
return "Year: ";
|
|
142
142
|
}, Rn = /* @__PURE__ */ Object.freeze({
|
|
143
143
|
__proto__: null,
|
|
@@ -145,9 +145,9 @@ var Pn = /* @__PURE__ */ Object.freeze({
|
|
|
145
145
|
labelMonthDropdown: In,
|
|
146
146
|
labelNext: On,
|
|
147
147
|
labelPrevious: Wn,
|
|
148
|
-
labelWeekNumber:
|
|
149
|
-
labelWeekday:
|
|
150
|
-
labelYearDropdown:
|
|
148
|
+
labelWeekNumber: Ln,
|
|
149
|
+
labelWeekday: Sn,
|
|
150
|
+
labelYearDropdown: En
|
|
151
151
|
});
|
|
152
152
|
function Bn() {
|
|
153
153
|
var e = "buttons", n = _n, t = tn, r = {}, a = {}, o = 1, i = {}, l = /* @__PURE__ */ new Date();
|
|
@@ -167,7 +167,7 @@ function Bn() {
|
|
|
167
167
|
}
|
|
168
168
|
function Tn(e) {
|
|
169
169
|
var n = e.fromYear, t = e.toYear, r = e.fromMonth, a = e.toMonth, o = e.fromDate, i = e.toDate;
|
|
170
|
-
return r ? o =
|
|
170
|
+
return r ? o = E(r) : n && (o = new Date(n, 0, 1)), a ? i = Te(a) : t && (i = new Date(t, 11, 31)), {
|
|
171
171
|
fromDate: o ? tt(o) : void 0,
|
|
172
172
|
toDate: i ? tt(i) : void 0
|
|
173
173
|
};
|
|
@@ -179,60 +179,60 @@ function Fn(e) {
|
|
|
179
179
|
var s;
|
|
180
180
|
(ge(t) || ce(t) || fe(t)) && (s = t.onSelect);
|
|
181
181
|
var c = g(g(g({}, r), t), { captionLayout: l, classNames: g(g({}, r.classNames), t.classNames), components: g({}, t.components), formatters: g(g({}, r.formatters), t.formatters), fromDate: o, labels: g(g({}, r.labels), t.labels), mode: t.mode || r.mode, modifiers: g(g({}, r.modifiers), t.modifiers), modifiersClassNames: g(g({}, r.modifiersClassNames), t.modifiersClassNames), onSelect: s, styles: g(g({}, r.styles), t.styles), toDate: i });
|
|
182
|
-
return
|
|
182
|
+
return d(_t.Provider, { value: c, children: e.children });
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function k() {
|
|
185
185
|
var e = Q(_t);
|
|
186
186
|
if (!e)
|
|
187
187
|
throw new Error("useDayPicker must be used within a DayPickerProvider.");
|
|
188
188
|
return e;
|
|
189
189
|
}
|
|
190
190
|
function wt(e) {
|
|
191
|
-
var n =
|
|
192
|
-
return
|
|
191
|
+
var n = k(), t = n.locale, r = n.classNames, a = n.styles, o = n.formatters.formatCaption;
|
|
192
|
+
return d("div", { className: r.caption_label, style: a.caption_label, "aria-live": "polite", role: "presentation", id: e.id, children: o(e.displayMonth, { locale: t }) });
|
|
193
193
|
}
|
|
194
194
|
function An(e) {
|
|
195
|
-
return
|
|
195
|
+
return d("svg", g({ width: "8px", height: "8px", viewBox: "0 0 120 120", "data-testid": "iconDropdown" }, e, { children: d("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" }) }));
|
|
196
196
|
}
|
|
197
197
|
function Dt(e) {
|
|
198
|
-
var n, t, r = e.onChange, a = e.value, o = e.children, i = e.caption, l = e.className, s = e.style, c =
|
|
199
|
-
return
|
|
198
|
+
var n, t, r = e.onChange, a = e.value, o = e.children, i = e.caption, l = e.className, s = e.style, c = k(), u = (t = (n = c.components) === null || n === void 0 ? void 0 : n.IconDropdown) !== null && t !== void 0 ? t : An;
|
|
199
|
+
return R("div", { className: l, style: s, children: [d("span", { className: c.classNames.vhidden, children: e["aria-label"] }), d("select", { name: e.name, "aria-label": e["aria-label"], className: c.classNames.dropdown, style: c.styles.dropdown, value: a, onChange: r, children: o }), R("div", { className: c.classNames.caption_label, style: c.styles.caption_label, "aria-hidden": "true", children: [i, d(u, { className: c.classNames.dropdown_icon, style: c.styles.dropdown_icon })] })] });
|
|
200
200
|
}
|
|
201
201
|
function Yn(e) {
|
|
202
|
-
var n, t =
|
|
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, u = t.labels.labelMonthDropdown;
|
|
203
203
|
if (!r)
|
|
204
|
-
return
|
|
204
|
+
return d(F, {});
|
|
205
205
|
if (!a)
|
|
206
|
-
return
|
|
206
|
+
return d(F, {});
|
|
207
207
|
var f = [];
|
|
208
208
|
if (Zt(r, a))
|
|
209
|
-
for (var
|
|
210
|
-
f.push(Ce(
|
|
209
|
+
for (var h = E(r), m = r.getMonth(); m <= a.getMonth(); m++)
|
|
210
|
+
f.push(Ce(h, m));
|
|
211
211
|
else
|
|
212
|
-
for (var
|
|
213
|
-
f.push(Ce(
|
|
212
|
+
for (var h = E(/* @__PURE__ */ new Date()), m = 0; m <= 11; m++)
|
|
213
|
+
f.push(Ce(h, m));
|
|
214
214
|
var p = function(b) {
|
|
215
|
-
var
|
|
215
|
+
var M = Number(b.target.value), D = Ce(E(e.displayMonth), M);
|
|
216
216
|
e.onChange(D);
|
|
217
217
|
}, _ = (n = c == null ? void 0 : c.Dropdown) !== null && n !== void 0 ? n : Dt;
|
|
218
|
-
return
|
|
219
|
-
return
|
|
218
|
+
return d(_, { name: "months", "aria-label": u(), className: s.dropdown_month, style: o.dropdown_month, onChange: p, value: e.displayMonth.getMonth(), caption: l(e.displayMonth, { locale: i }), children: f.map(function(b) {
|
|
219
|
+
return d("option", { value: b.getMonth(), children: l(b, { locale: i }) }, b.getMonth());
|
|
220
220
|
}) });
|
|
221
221
|
}
|
|
222
222
|
function Hn(e) {
|
|
223
|
-
var n, t = e.displayMonth, r =
|
|
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, u = r.formatters.formatYearCaption, f = r.labels.labelYearDropdown, h = [];
|
|
224
224
|
if (!a)
|
|
225
|
-
return
|
|
225
|
+
return d(F, {});
|
|
226
226
|
if (!o)
|
|
227
|
-
return
|
|
228
|
-
for (var
|
|
229
|
-
|
|
227
|
+
return d(F, {});
|
|
228
|
+
for (var m = a.getFullYear(), p = o.getFullYear(), _ = m; _ <= p; _++)
|
|
229
|
+
h.push(nt(Gt(/* @__PURE__ */ new Date()), _));
|
|
230
230
|
var b = function(D) {
|
|
231
|
-
var
|
|
232
|
-
e.onChange(
|
|
233
|
-
},
|
|
234
|
-
return
|
|
235
|
-
return
|
|
231
|
+
var O = nt(E(t), Number(D.target.value));
|
|
232
|
+
e.onChange(O);
|
|
233
|
+
}, M = (n = c == null ? void 0 : c.Dropdown) !== null && n !== void 0 ? n : Dt;
|
|
234
|
+
return d(M, { name: "years", "aria-label": f(), className: s.dropdown_year, style: l.dropdown_year, onChange: b, value: t.getFullYear(), caption: u(t, { locale: i }), children: h.map(function(D) {
|
|
235
|
+
return d("option", { value: D.getFullYear(), children: u(D, { locale: i }) }, D.getFullYear());
|
|
236
236
|
}) });
|
|
237
237
|
}
|
|
238
238
|
function jn(e, n) {
|
|
@@ -243,56 +243,56 @@ function Vn(e) {
|
|
|
243
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;
|
|
244
244
|
if (o && de(o, a) < 0) {
|
|
245
245
|
var c = -1 * (s - 1);
|
|
246
|
-
a =
|
|
246
|
+
a = Y(o, c);
|
|
247
247
|
}
|
|
248
|
-
return i && de(a, i) < 0 && (a = i),
|
|
248
|
+
return i && de(a, i) < 0 && (a = i), E(a);
|
|
249
249
|
}
|
|
250
250
|
function Kn() {
|
|
251
|
-
var e =
|
|
251
|
+
var e = k(), n = Vn(e), t = jn(n, e.month), r = t[0], a = t[1], o = function(i) {
|
|
252
252
|
var l;
|
|
253
253
|
if (!e.disableNavigation) {
|
|
254
|
-
var s =
|
|
254
|
+
var s = E(i);
|
|
255
255
|
a(s), (l = e.onMonthChange) === null || l === void 0 || l.call(e, s);
|
|
256
256
|
}
|
|
257
257
|
};
|
|
258
258
|
return [r, o];
|
|
259
259
|
}
|
|
260
260
|
function Un(e, n) {
|
|
261
|
-
for (var t = n.reverseMonths, r = n.numberOfMonths, a =
|
|
262
|
-
var c =
|
|
261
|
+
for (var t = n.reverseMonths, r = n.numberOfMonths, a = E(e), o = E(Y(a, r)), i = de(o, a), l = [], s = 0; s < i; s++) {
|
|
262
|
+
var c = Y(a, s);
|
|
263
263
|
l.push(c);
|
|
264
264
|
}
|
|
265
265
|
return t && (l = l.reverse()), l;
|
|
266
266
|
}
|
|
267
267
|
function Xn(e, n) {
|
|
268
268
|
if (!n.disableNavigation) {
|
|
269
|
-
var t = n.toDate, r = n.pagedNavigation, a = n.numberOfMonths, o = a === void 0 ? 1 : a, i = r ? o : 1, l =
|
|
269
|
+
var t = n.toDate, r = n.pagedNavigation, a = n.numberOfMonths, o = a === void 0 ? 1 : a, i = r ? o : 1, l = E(e);
|
|
270
270
|
if (!t)
|
|
271
|
-
return
|
|
271
|
+
return Y(l, i);
|
|
272
272
|
var s = de(t, e);
|
|
273
273
|
if (!(s < o))
|
|
274
|
-
return
|
|
274
|
+
return Y(l, i);
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
function Zn(e, n) {
|
|
278
278
|
if (!n.disableNavigation) {
|
|
279
|
-
var t = n.fromDate, r = n.pagedNavigation, a = n.numberOfMonths, o = a === void 0 ? 1 : a, i = r ? o : 1, l =
|
|
279
|
+
var t = n.fromDate, r = n.pagedNavigation, a = n.numberOfMonths, o = a === void 0 ? 1 : a, i = r ? o : 1, l = E(e);
|
|
280
280
|
if (!t)
|
|
281
|
-
return
|
|
281
|
+
return Y(l, -i);
|
|
282
282
|
var s = de(l, t);
|
|
283
283
|
if (!(s <= 0))
|
|
284
|
-
return
|
|
284
|
+
return Y(l, -i);
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
287
|
var Mt = J(void 0);
|
|
288
288
|
function Gn(e) {
|
|
289
|
-
var n =
|
|
290
|
-
return o.some(function(
|
|
291
|
-
return Fe(f,
|
|
289
|
+
var n = k(), t = Kn(), r = t[0], a = t[1], o = Un(r, n), i = Xn(r, n), l = Zn(r, n), s = function(f) {
|
|
290
|
+
return o.some(function(h) {
|
|
291
|
+
return Fe(f, h);
|
|
292
292
|
});
|
|
293
|
-
}, c = function(f,
|
|
294
|
-
s(f) || (
|
|
295
|
-
},
|
|
293
|
+
}, c = function(f, h) {
|
|
294
|
+
s(f) || (h && Ae(f, h) ? a(Y(f, 1 + n.numberOfMonths * -1)) : a(f));
|
|
295
|
+
}, u = {
|
|
296
296
|
currentMonth: r,
|
|
297
297
|
displayMonths: o,
|
|
298
298
|
goToMonth: a,
|
|
@@ -301,7 +301,7 @@ function Gn(e) {
|
|
|
301
301
|
nextMonth: i,
|
|
302
302
|
isDateDisplayed: s
|
|
303
303
|
};
|
|
304
|
-
return
|
|
304
|
+
return d(Mt.Provider, { value: u, children: e.children });
|
|
305
305
|
}
|
|
306
306
|
function ve() {
|
|
307
307
|
var e = Q(Mt);
|
|
@@ -310,53 +310,53 @@ function ve() {
|
|
|
310
310
|
return e;
|
|
311
311
|
}
|
|
312
312
|
function it(e) {
|
|
313
|
-
var n, t =
|
|
314
|
-
i(
|
|
315
|
-
}, s = (n = o == null ? void 0 : o.CaptionLabel) !== null && n !== void 0 ? n : wt, c =
|
|
316
|
-
return
|
|
313
|
+
var n, t = k(), r = t.classNames, a = t.styles, o = t.components, i = ve().goToMonth, l = function(u) {
|
|
314
|
+
i(Y(u, e.displayIndex ? -e.displayIndex : 0));
|
|
315
|
+
}, s = (n = o == null ? void 0 : o.CaptionLabel) !== null && n !== void 0 ? n : wt, c = d(s, { id: e.id, displayMonth: e.displayMonth });
|
|
316
|
+
return R("div", { className: r.caption_dropdowns, style: a.caption_dropdowns, children: [d("div", { className: r.vhidden, children: c }), d(Yn, { onChange: l, displayMonth: e.displayMonth }), d(Hn, { onChange: l, displayMonth: e.displayMonth })] });
|
|
317
317
|
}
|
|
318
318
|
function $n(e) {
|
|
319
|
-
return
|
|
319
|
+
return d("svg", g({ width: "16px", height: "16px", viewBox: "0 0 120 120" }, e, { children: d("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" }) }));
|
|
320
320
|
}
|
|
321
321
|
function qn(e) {
|
|
322
|
-
return
|
|
322
|
+
return d("svg", g({ width: "16px", height: "16px", viewBox: "0 0 120 120" }, e, { children: d("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" }) }));
|
|
323
323
|
}
|
|
324
324
|
var be = Vt(function(e, n) {
|
|
325
|
-
var t =
|
|
325
|
+
var t = k(), r = t.classNames, a = t.styles, o = [r.button_reset, r.button];
|
|
326
326
|
e.className && o.push(e.className);
|
|
327
327
|
var i = o.join(" "), l = g(g({}, a.button_reset), a.button);
|
|
328
|
-
return e.style && Object.assign(l, e.style),
|
|
328
|
+
return e.style && Object.assign(l, e.style), d("button", g({}, e, { ref: n, type: "button", className: i, style: l }));
|
|
329
329
|
});
|
|
330
330
|
function Jn(e) {
|
|
331
|
-
var n, t, r =
|
|
331
|
+
var n, t, r = k(), a = r.dir, o = r.locale, i = r.classNames, l = r.styles, s = r.labels, c = s.labelPrevious, u = s.labelNext, f = r.components;
|
|
332
332
|
if (!e.nextMonth && !e.previousMonth)
|
|
333
|
-
return
|
|
334
|
-
var
|
|
333
|
+
return d(F, {});
|
|
334
|
+
var h = c(e.previousMonth, { locale: o }), m = [
|
|
335
335
|
i.nav_button,
|
|
336
336
|
i.nav_button_previous
|
|
337
|
-
].join(" "), p =
|
|
337
|
+
].join(" "), p = u(e.nextMonth, { locale: o }), _ = [
|
|
338
338
|
i.nav_button,
|
|
339
339
|
i.nav_button_next
|
|
340
|
-
].join(" "), b = (n = f == null ? void 0 : f.IconRight) !== null && n !== void 0 ? n : qn,
|
|
341
|
-
return
|
|
340
|
+
].join(" "), b = (n = f == null ? void 0 : f.IconRight) !== null && n !== void 0 ? n : qn, M = (t = f == null ? void 0 : f.IconLeft) !== null && t !== void 0 ? t : $n;
|
|
341
|
+
return R("div", { className: i.nav, style: l.nav, children: [!e.hidePrevious && d(be, { name: "previous-month", "aria-label": h, className: m, style: l.nav_button_previous, disabled: !e.previousMonth, onClick: e.onPreviousClick, children: a === "rtl" ? d(b, { className: i.nav_icon, style: l.nav_icon }) : d(M, { className: i.nav_icon, style: l.nav_icon }) }), !e.hideNext && d(be, { name: "next-month", "aria-label": p, className: _, style: l.nav_button_next, disabled: !e.nextMonth, onClick: e.onNextClick, children: a === "rtl" ? d(M, { className: i.nav_icon, style: l.nav_icon }) : d(b, { className: i.nav_icon, style: l.nav_icon }) })] });
|
|
342
342
|
}
|
|
343
343
|
function lt(e) {
|
|
344
|
-
var n =
|
|
344
|
+
var n = k().numberOfMonths, t = ve(), r = t.previousMonth, a = t.nextMonth, o = t.goToMonth, i = t.displayMonths, l = i.findIndex(function(p) {
|
|
345
345
|
return Fe(e.displayMonth, p);
|
|
346
|
-
}), s = l === 0, c = l === i.length - 1,
|
|
346
|
+
}), s = l === 0, c = l === i.length - 1, u = n > 1 && (s || !c), f = n > 1 && (c || !s), h = function() {
|
|
347
347
|
r && o(r);
|
|
348
|
-
},
|
|
348
|
+
}, m = function() {
|
|
349
349
|
a && o(a);
|
|
350
350
|
};
|
|
351
|
-
return
|
|
351
|
+
return d(Jn, { displayMonth: e.displayMonth, hideNext: u, hidePrevious: f, nextMonth: a, previousMonth: r, onPreviousClick: h, onNextClick: m });
|
|
352
352
|
}
|
|
353
353
|
function Qn(e) {
|
|
354
|
-
var n, t =
|
|
355
|
-
return a ? c =
|
|
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 : wt, c;
|
|
355
|
+
return a ? c = d(s, { id: e.id, displayMonth: e.displayMonth }) : i === "dropdown" ? c = d(it, { displayMonth: e.displayMonth, id: e.id }) : i === "dropdown-buttons" ? c = R(F, { children: [d(it, { displayMonth: e.displayMonth, displayIndex: e.displayIndex, id: e.id }), d(lt, { displayMonth: e.displayMonth, displayIndex: e.displayIndex, id: e.id })] }) : c = R(F, { children: [d(s, { id: e.id, displayMonth: e.displayMonth, displayIndex: e.displayIndex }), d(lt, { displayMonth: e.displayMonth, id: e.id })] }), d("div", { className: r.caption, style: o.caption, children: c });
|
|
356
356
|
}
|
|
357
357
|
function zn(e) {
|
|
358
|
-
var n =
|
|
359
|
-
return t ?
|
|
358
|
+
var n = k(), t = n.footer, r = n.styles, a = n.classNames.tfoot;
|
|
359
|
+
return t ? d("tfoot", { className: a, style: r.tfoot, children: d("tr", { children: d("td", { colSpan: 8, children: t }) }) }) : d(F, {});
|
|
360
360
|
}
|
|
361
361
|
function er(e, n, t) {
|
|
362
362
|
for (var r = t ? Ye(/* @__PURE__ */ new Date()) : He(/* @__PURE__ */ new Date(), { locale: e, weekStartsOn: n }), a = [], o = 0; o < 7; o++) {
|
|
@@ -366,18 +366,18 @@ function er(e, n, t) {
|
|
|
366
366
|
return a;
|
|
367
367
|
}
|
|
368
368
|
function tr() {
|
|
369
|
-
var e =
|
|
370
|
-
return
|
|
371
|
-
return
|
|
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 = er(a, o, i);
|
|
370
|
+
return R("tr", { style: t.head_row, className: n.head_row, children: [r && d("td", { style: t.head_cell, className: n.head_cell }), c.map(function(u, f) {
|
|
371
|
+
return d("th", { scope: "col", className: n.head_cell, style: t.head_cell, "aria-label": s(u, { locale: a }), children: l(u, { locale: a }) }, f);
|
|
372
372
|
})] });
|
|
373
373
|
}
|
|
374
374
|
function nr() {
|
|
375
|
-
var e, n =
|
|
376
|
-
return
|
|
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 : tr;
|
|
376
|
+
return d("thead", { style: r.head, className: t.head, children: d(o, {}) });
|
|
377
377
|
}
|
|
378
378
|
function rr(e) {
|
|
379
|
-
var n =
|
|
380
|
-
return
|
|
379
|
+
var n = k(), t = n.locale, r = n.formatters.formatDay;
|
|
380
|
+
return d(F, { children: r(e.date, { locale: t }) });
|
|
381
381
|
}
|
|
382
382
|
var je = J(void 0);
|
|
383
383
|
function ar(e) {
|
|
@@ -388,44 +388,44 @@ function ar(e) {
|
|
|
388
388
|
disabled: []
|
|
389
389
|
}
|
|
390
390
|
};
|
|
391
|
-
return
|
|
391
|
+
return d(je.Provider, { value: n, children: e.children });
|
|
392
392
|
}
|
|
393
|
-
return
|
|
393
|
+
return d(or, { initialProps: e.initialProps, children: e.children });
|
|
394
394
|
}
|
|
395
395
|
function or(e) {
|
|
396
|
-
var n = e.initialProps, t = e.children, r = n.selected, a = n.min, o = n.max, i = function(c,
|
|
397
|
-
var
|
|
398
|
-
(
|
|
399
|
-
var p = !!(
|
|
396
|
+
var n = e.initialProps, t = e.children, r = n.selected, a = n.min, o = n.max, i = function(c, u, f) {
|
|
397
|
+
var h, m;
|
|
398
|
+
(h = n.onDayClick) === null || h === void 0 || h.call(n, c, u, f);
|
|
399
|
+
var p = !!(u.selected && a && (r == null ? void 0 : r.length) === a);
|
|
400
400
|
if (!p) {
|
|
401
|
-
var _ = !!(!
|
|
401
|
+
var _ = !!(!u.selected && o && (r == null ? void 0 : r.length) === o);
|
|
402
402
|
if (!_) {
|
|
403
403
|
var b = r ? gt([], r) : [];
|
|
404
|
-
if (
|
|
405
|
-
var
|
|
406
|
-
return
|
|
404
|
+
if (u.selected) {
|
|
405
|
+
var M = b.findIndex(function(D) {
|
|
406
|
+
return C(c, D);
|
|
407
407
|
});
|
|
408
|
-
b.splice(
|
|
408
|
+
b.splice(M, 1);
|
|
409
409
|
} else
|
|
410
410
|
b.push(c);
|
|
411
|
-
(
|
|
411
|
+
(m = n.onSelect) === null || m === void 0 || m.call(n, b, c, u, f);
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
414
|
}, l = {
|
|
415
415
|
disabled: []
|
|
416
416
|
};
|
|
417
417
|
r && l.disabled.push(function(c) {
|
|
418
|
-
var
|
|
419
|
-
return
|
|
418
|
+
var u = o && r.length > o - 1, f = r.some(function(h) {
|
|
419
|
+
return C(h, c);
|
|
420
420
|
});
|
|
421
|
-
return !!(
|
|
421
|
+
return !!(u && !f);
|
|
422
422
|
});
|
|
423
423
|
var s = {
|
|
424
424
|
selected: r,
|
|
425
425
|
onDayClick: i,
|
|
426
426
|
modifiers: l
|
|
427
427
|
};
|
|
428
|
-
return
|
|
428
|
+
return d(je.Provider, { value: s, children: t });
|
|
429
429
|
}
|
|
430
430
|
function Ve() {
|
|
431
431
|
var e = Q(je);
|
|
@@ -435,7 +435,7 @@ function Ve() {
|
|
|
435
435
|
}
|
|
436
436
|
function ir(e, n) {
|
|
437
437
|
var t = n || {}, r = t.from, a = t.to;
|
|
438
|
-
return r && a ?
|
|
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 : ye(r, e) ? { from: e, to: a } : { from: r, to: e } : a ? ye(e, a) ? { from: a, to: e } : { from: e, to: a } : r ? Ae(e, r) ? { from: e, to: r } : { from: r, to: e } : { from: e, to: void 0 };
|
|
439
439
|
}
|
|
440
440
|
var Ke = J(void 0);
|
|
441
441
|
function lr(e) {
|
|
@@ -449,56 +449,56 @@ function lr(e) {
|
|
|
449
449
|
disabled: []
|
|
450
450
|
}
|
|
451
451
|
};
|
|
452
|
-
return
|
|
452
|
+
return d(Ke.Provider, { value: n, children: e.children });
|
|
453
453
|
}
|
|
454
|
-
return
|
|
454
|
+
return d(sr, { initialProps: e.initialProps, children: e.children });
|
|
455
455
|
}
|
|
456
456
|
function sr(e) {
|
|
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(
|
|
458
|
-
var b,
|
|
459
|
-
(b = n.onDayClick) === null || b === void 0 || b.call(n,
|
|
460
|
-
var D = ir(
|
|
461
|
-
(
|
|
462
|
-
},
|
|
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, p, _) {
|
|
458
|
+
var b, M;
|
|
459
|
+
(b = n.onDayClick) === null || b === void 0 || b.call(n, m, p, _);
|
|
460
|
+
var D = ir(m, r);
|
|
461
|
+
(M = n.onSelect) === null || M === void 0 || M.call(n, D, m, p, _);
|
|
462
|
+
}, u = {
|
|
463
463
|
range_start: [],
|
|
464
464
|
range_end: [],
|
|
465
465
|
range_middle: [],
|
|
466
466
|
disabled: []
|
|
467
467
|
};
|
|
468
|
-
if (o ? (
|
|
468
|
+
if (o ? (u.range_start = [o], i ? (u.range_end = [i], C(o, i) || (u.range_middle = [
|
|
469
469
|
{
|
|
470
470
|
after: o,
|
|
471
471
|
before: i
|
|
472
472
|
}
|
|
473
|
-
])) :
|
|
473
|
+
])) : u.range_end = [o]) : i && (u.range_start = [i], u.range_end = [i]), l && (o && !i && u.disabled.push({
|
|
474
474
|
after: Ne(o, l - 1),
|
|
475
475
|
before: L(o, l - 1)
|
|
476
|
-
}), o && i &&
|
|
476
|
+
}), o && i && u.disabled.push({
|
|
477
477
|
after: o,
|
|
478
478
|
before: L(o, l - 1)
|
|
479
|
-
}), !o && i &&
|
|
479
|
+
}), !o && i && u.disabled.push({
|
|
480
480
|
after: Ne(i, l - 1),
|
|
481
481
|
before: L(i, l - 1)
|
|
482
482
|
})), s) {
|
|
483
|
-
if (o && !i && (
|
|
483
|
+
if (o && !i && (u.disabled.push({
|
|
484
484
|
before: L(o, -s + 1)
|
|
485
|
-
}),
|
|
485
|
+
}), u.disabled.push({
|
|
486
486
|
after: L(o, s - 1)
|
|
487
487
|
})), o && i) {
|
|
488
|
-
var f = j(i, o) + 1,
|
|
489
|
-
|
|
490
|
-
before: Ne(o,
|
|
491
|
-
}),
|
|
492
|
-
after: L(i,
|
|
488
|
+
var f = j(i, o) + 1, h = s - f;
|
|
489
|
+
u.disabled.push({
|
|
490
|
+
before: Ne(o, h)
|
|
491
|
+
}), u.disabled.push({
|
|
492
|
+
after: L(i, h)
|
|
493
493
|
});
|
|
494
494
|
}
|
|
495
|
-
!o && i && (
|
|
495
|
+
!o && i && (u.disabled.push({
|
|
496
496
|
before: L(i, -s + 1)
|
|
497
|
-
}),
|
|
497
|
+
}), u.disabled.push({
|
|
498
498
|
after: L(i, s - 1)
|
|
499
499
|
}));
|
|
500
500
|
}
|
|
501
|
-
return
|
|
501
|
+
return d(Ke.Provider, { value: { selected: r, onDayClick: c, modifiers: u }, children: t });
|
|
502
502
|
}
|
|
503
503
|
function Ue() {
|
|
504
504
|
var e = Q(Ke);
|
|
@@ -516,19 +516,19 @@ function dr(e) {
|
|
|
516
516
|
n[r] = pe(a);
|
|
517
517
|
}), n;
|
|
518
518
|
}
|
|
519
|
-
var
|
|
519
|
+
var A;
|
|
520
520
|
(function(e) {
|
|
521
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";
|
|
522
|
-
})(
|
|
523
|
-
var ur =
|
|
524
|
-
function
|
|
522
|
+
})(A || (A = {}));
|
|
523
|
+
var ur = A.Selected, H = A.Disabled, cr = A.Hidden, fr = A.Today, Pe = A.RangeEnd, xe = A.RangeMiddle, Ie = A.RangeStart, vr = A.Outside;
|
|
524
|
+
function hr(e, n, t) {
|
|
525
525
|
var r, a = (r = {}, r[ur] = pe(e.selected), r[H] = pe(e.disabled), r[cr] = pe(e.hidden), r[fr] = [e.today], r[Pe] = [], r[xe] = [], r[Ie] = [], r[vr] = [], r);
|
|
526
526
|
return e.fromDate && a[H].push({ before: e.fromDate }), e.toDate && a[H].push({ after: e.toDate }), ce(e) ? a[H] = a[H].concat(n.modifiers[H]) : fe(e) && (a[H] = a[H].concat(t.modifiers[H]), a[Ie] = t.modifiers[Ie], a[xe] = t.modifiers[xe], a[Pe] = t.modifiers[Pe]), a;
|
|
527
527
|
}
|
|
528
528
|
var kt = J(void 0);
|
|
529
|
-
function
|
|
530
|
-
var n =
|
|
531
|
-
return
|
|
529
|
+
function mr(e) {
|
|
530
|
+
var n = k(), t = Ve(), r = Ue(), a = hr(n, t, r), o = dr(n.modifiers), i = g(g({}, a), o);
|
|
531
|
+
return d(kt.Provider, { value: i, children: e.children });
|
|
532
532
|
}
|
|
533
533
|
function Nt() {
|
|
534
534
|
var e = Q(kt);
|
|
@@ -559,20 +559,20 @@ function wr(e, n) {
|
|
|
559
559
|
var i = j(e, r) >= 0 && j(a, e) >= 0;
|
|
560
560
|
return i;
|
|
561
561
|
}
|
|
562
|
-
return a ?
|
|
562
|
+
return a ? C(a, e) : r ? C(r, e) : !1;
|
|
563
563
|
}
|
|
564
564
|
function Dr(e) {
|
|
565
|
-
return
|
|
565
|
+
return mt(e);
|
|
566
566
|
}
|
|
567
567
|
function Mr(e) {
|
|
568
|
-
return Array.isArray(e) && e.every(
|
|
568
|
+
return Array.isArray(e) && e.every(mt);
|
|
569
569
|
}
|
|
570
570
|
function kr(e, n) {
|
|
571
571
|
return n.some(function(t) {
|
|
572
572
|
if (typeof t == "boolean")
|
|
573
573
|
return t;
|
|
574
574
|
if (Dr(t))
|
|
575
|
-
return
|
|
575
|
+
return C(e, t);
|
|
576
576
|
if (Mr(t))
|
|
577
577
|
return t.includes(e);
|
|
578
578
|
if (yr(t))
|
|
@@ -596,7 +596,7 @@ function Xe(e, n, t) {
|
|
|
596
596
|
}), t && !Fe(e, t) && (a.outside = !0), a;
|
|
597
597
|
}
|
|
598
598
|
function Nr(e, n) {
|
|
599
|
-
for (var t =
|
|
599
|
+
for (var t = E(e[0]), r = Te(e[e.length - 1]), a, o, i = t; i <= r; ) {
|
|
600
600
|
var l = Xe(i, n), s = !l.disabled && !l.hidden;
|
|
601
601
|
if (!s) {
|
|
602
602
|
i = L(i, 1);
|
|
@@ -610,25 +610,25 @@ function Nr(e, n) {
|
|
|
610
610
|
}
|
|
611
611
|
var Cr = 365;
|
|
612
612
|
function Ct(e, n) {
|
|
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,
|
|
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, u = a.toDate, f = a.locale, h = {
|
|
614
614
|
day: L,
|
|
615
|
-
week:
|
|
616
|
-
month:
|
|
615
|
+
week: Le,
|
|
616
|
+
month: Y,
|
|
617
617
|
year: zt,
|
|
618
618
|
startOfWeek: function(b) {
|
|
619
619
|
return a.ISOWeek ? Ye(b) : He(b, { locale: f, weekStartsOn: s });
|
|
620
620
|
},
|
|
621
621
|
endOfWeek: function(b) {
|
|
622
|
-
return a.ISOWeek ? vt(b) :
|
|
622
|
+
return a.ISOWeek ? vt(b) : ht(b, { locale: f, weekStartsOn: s });
|
|
623
623
|
}
|
|
624
|
-
},
|
|
625
|
-
r === "before" && c ?
|
|
624
|
+
}, m = h[t](e, r === "after" ? 1 : -1);
|
|
625
|
+
r === "before" && c ? m = $t([c, m]) : r === "after" && u && (m = qt([u, m]));
|
|
626
626
|
var p = !0;
|
|
627
627
|
if (o) {
|
|
628
|
-
var _ = Xe(
|
|
628
|
+
var _ = Xe(m, o);
|
|
629
629
|
p = !_.disabled && !_.hidden;
|
|
630
630
|
}
|
|
631
|
-
return p ?
|
|
631
|
+
return p ? m : l.count > Cr ? l.lastFocused : Ct(m, {
|
|
632
632
|
moveBy: t,
|
|
633
633
|
direction: r,
|
|
634
634
|
context: a,
|
|
@@ -638,25 +638,25 @@ function Ct(e, n) {
|
|
|
638
638
|
}
|
|
639
639
|
var Pt = J(void 0);
|
|
640
640
|
function Pr(e) {
|
|
641
|
-
var n = ve(), t = Nt(), r = T(), a = r[0], o = r[1], i = T(), l = i[0], s = i[1], c = Nr(n.displayMonths, t),
|
|
641
|
+
var n = ve(), t = Nt(), r = T(), a = r[0], o = r[1], i = T(), l = i[0], s = i[1], c = Nr(n.displayMonths, t), u = a ?? (l && n.isDateDisplayed(l)) ? l : c, f = function() {
|
|
642
642
|
s(a), o(void 0);
|
|
643
|
-
},
|
|
643
|
+
}, h = function(b) {
|
|
644
644
|
o(b);
|
|
645
|
-
},
|
|
645
|
+
}, m = k(), p = function(b, M) {
|
|
646
646
|
if (a) {
|
|
647
647
|
var D = Ct(a, {
|
|
648
648
|
moveBy: b,
|
|
649
|
-
direction:
|
|
650
|
-
context:
|
|
649
|
+
direction: M,
|
|
650
|
+
context: m,
|
|
651
651
|
modifiers: t
|
|
652
652
|
});
|
|
653
|
-
|
|
653
|
+
C(a, D) || (n.goToDate(D, a), h(D));
|
|
654
654
|
}
|
|
655
655
|
}, _ = {
|
|
656
656
|
focusedDay: a,
|
|
657
|
-
focusTarget:
|
|
657
|
+
focusTarget: u,
|
|
658
658
|
blur: f,
|
|
659
|
-
focus:
|
|
659
|
+
focus: h,
|
|
660
660
|
focusDayAfter: function() {
|
|
661
661
|
return p("day", "after");
|
|
662
662
|
},
|
|
@@ -688,7 +688,7 @@ function Pr(e) {
|
|
|
688
688
|
return p("endOfWeek", "after");
|
|
689
689
|
}
|
|
690
690
|
};
|
|
691
|
-
return
|
|
691
|
+
return d(Pt.Provider, { value: _, children: e.children });
|
|
692
692
|
}
|
|
693
693
|
function Ze() {
|
|
694
694
|
var e = Q(Pt);
|
|
@@ -706,23 +706,23 @@ function Ir(e) {
|
|
|
706
706
|
var n = {
|
|
707
707
|
selected: void 0
|
|
708
708
|
};
|
|
709
|
-
return
|
|
709
|
+
return d(Ge.Provider, { value: n, children: e.children });
|
|
710
710
|
}
|
|
711
|
-
return
|
|
711
|
+
return d(Or, { initialProps: e.initialProps, children: e.children });
|
|
712
712
|
}
|
|
713
713
|
function Or(e) {
|
|
714
714
|
var n = e.initialProps, t = e.children, r = function(o, i, l) {
|
|
715
|
-
var s, c,
|
|
715
|
+
var s, c, u;
|
|
716
716
|
if ((s = n.onDayClick) === null || s === void 0 || s.call(n, o, i, l), i.selected && !n.required) {
|
|
717
717
|
(c = n.onSelect) === null || c === void 0 || c.call(n, void 0, o, i, l);
|
|
718
718
|
return;
|
|
719
719
|
}
|
|
720
|
-
(
|
|
720
|
+
(u = n.onSelect) === null || u === void 0 || u.call(n, o, o, i, l);
|
|
721
721
|
}, a = {
|
|
722
722
|
selected: n.selected,
|
|
723
723
|
onDayClick: r
|
|
724
724
|
};
|
|
725
|
-
return
|
|
725
|
+
return d(Ge.Provider, { value: a, children: t });
|
|
726
726
|
}
|
|
727
727
|
function xt() {
|
|
728
728
|
var e = Q(Ge);
|
|
@@ -731,16 +731,16 @@ function xt() {
|
|
|
731
731
|
return e;
|
|
732
732
|
}
|
|
733
733
|
function Wr(e, n) {
|
|
734
|
-
var t =
|
|
734
|
+
var t = k(), r = xt(), a = Ve(), o = Ue(), i = Ze(), l = i.focusDayAfter, s = i.focusDayBefore, c = i.focusWeekAfter, u = i.focusWeekBefore, f = i.blur, h = i.focus, m = i.focusMonthBefore, p = i.focusMonthAfter, _ = i.focusYearBefore, b = i.focusYearAfter, M = i.focusStartOfWeek, D = i.focusEndOfWeek, O = function(y) {
|
|
735
735
|
var v, $, ne, oe;
|
|
736
736
|
ge(t) ? (v = r.onDayClick) === null || v === void 0 || v.call(r, e, n, y) : ce(t) ? ($ = a.onDayClick) === null || $ === void 0 || $.call(a, e, n, y) : fe(t) ? (ne = o.onDayClick) === null || ne === void 0 || ne.call(o, e, n, y) : (oe = t.onDayClick) === null || oe === void 0 || oe.call(t, e, n, y);
|
|
737
|
-
},
|
|
737
|
+
}, Z = function(y) {
|
|
738
738
|
var v;
|
|
739
|
-
|
|
740
|
-
},
|
|
739
|
+
h(e), (v = t.onDayFocus) === null || v === void 0 || v.call(t, e, n, y);
|
|
740
|
+
}, N = function(y) {
|
|
741
741
|
var v;
|
|
742
742
|
f(), (v = t.onDayBlur) === null || v === void 0 || v.call(t, e, n, y);
|
|
743
|
-
},
|
|
743
|
+
}, P = function(y) {
|
|
744
744
|
var v;
|
|
745
745
|
(v = t.onDayMouseEnter) === null || v === void 0 || v.call(t, e, n, y);
|
|
746
746
|
}, ae = function(y) {
|
|
@@ -752,10 +752,10 @@ function Wr(e, n) {
|
|
|
752
752
|
}, we = function(y) {
|
|
753
753
|
var v;
|
|
754
754
|
(v = t.onDayPointerLeave) === null || v === void 0 || v.call(t, e, n, y);
|
|
755
|
-
},
|
|
755
|
+
}, he = function(y) {
|
|
756
756
|
var v;
|
|
757
757
|
(v = t.onDayTouchCancel) === null || v === void 0 || v.call(t, e, n, y);
|
|
758
|
-
},
|
|
758
|
+
}, K = function(y) {
|
|
759
759
|
var v;
|
|
760
760
|
(v = t.onDayTouchEnd) === null || v === void 0 || v.call(t, e, n, y);
|
|
761
761
|
}, G = function(y) {
|
|
@@ -780,16 +780,16 @@ function Wr(e, n) {
|
|
|
780
780
|
y.preventDefault(), y.stopPropagation(), c();
|
|
781
781
|
break;
|
|
782
782
|
case "ArrowUp":
|
|
783
|
-
y.preventDefault(), y.stopPropagation(),
|
|
783
|
+
y.preventDefault(), y.stopPropagation(), u();
|
|
784
784
|
break;
|
|
785
785
|
case "PageUp":
|
|
786
|
-
y.preventDefault(), y.stopPropagation(), y.shiftKey ? _() :
|
|
786
|
+
y.preventDefault(), y.stopPropagation(), y.shiftKey ? _() : m();
|
|
787
787
|
break;
|
|
788
788
|
case "PageDown":
|
|
789
789
|
y.preventDefault(), y.stopPropagation(), y.shiftKey ? b() : p();
|
|
790
790
|
break;
|
|
791
791
|
case "Home":
|
|
792
|
-
y.preventDefault(), y.stopPropagation(),
|
|
792
|
+
y.preventDefault(), y.stopPropagation(), M();
|
|
793
793
|
break;
|
|
794
794
|
case "End":
|
|
795
795
|
y.preventDefault(), y.stopPropagation(), D();
|
|
@@ -797,36 +797,36 @@ function Wr(e, n) {
|
|
|
797
797
|
}
|
|
798
798
|
(v = t.onDayKeyDown) === null || v === void 0 || v.call(t, e, n, y);
|
|
799
799
|
}, te = {
|
|
800
|
-
onClick:
|
|
801
|
-
onFocus:
|
|
802
|
-
onBlur:
|
|
800
|
+
onClick: O,
|
|
801
|
+
onFocus: Z,
|
|
802
|
+
onBlur: N,
|
|
803
803
|
onKeyDown: Me,
|
|
804
804
|
onKeyUp: ee,
|
|
805
|
-
onMouseEnter:
|
|
805
|
+
onMouseEnter: P,
|
|
806
806
|
onMouseLeave: ae,
|
|
807
807
|
onPointerEnter: z,
|
|
808
808
|
onPointerLeave: we,
|
|
809
|
-
onTouchCancel:
|
|
810
|
-
onTouchEnd:
|
|
809
|
+
onTouchCancel: he,
|
|
810
|
+
onTouchEnd: K,
|
|
811
811
|
onTouchMove: G,
|
|
812
812
|
onTouchStart: De
|
|
813
813
|
};
|
|
814
814
|
return te;
|
|
815
815
|
}
|
|
816
|
-
function
|
|
817
|
-
var e =
|
|
816
|
+
function Sr() {
|
|
817
|
+
var e = k(), n = xt(), t = Ve(), r = Ue(), a = ge(e) ? n.selected : ce(e) ? t.selected : fe(e) ? r.selected : void 0;
|
|
818
818
|
return a;
|
|
819
819
|
}
|
|
820
|
-
function
|
|
821
|
-
return Object.values(
|
|
820
|
+
function Lr(e) {
|
|
821
|
+
return Object.values(A).includes(e);
|
|
822
822
|
}
|
|
823
|
-
function
|
|
823
|
+
function Er(e, n) {
|
|
824
824
|
var t = [e.classNames.day];
|
|
825
825
|
return Object.keys(n).forEach(function(r) {
|
|
826
826
|
var a = e.modifiersClassNames[r];
|
|
827
827
|
if (a)
|
|
828
828
|
t.push(a);
|
|
829
|
-
else if (
|
|
829
|
+
else if (Lr(r)) {
|
|
830
830
|
var o = e.classNames["day_".concat(r)];
|
|
831
831
|
o && t.push(o);
|
|
832
832
|
}
|
|
@@ -840,10 +840,10 @@ function Rr(e, n) {
|
|
|
840
840
|
}), t;
|
|
841
841
|
}
|
|
842
842
|
function Br(e, n, t) {
|
|
843
|
-
var r, a, o, i =
|
|
843
|
+
var r, a, o, i = k(), l = Ze(), s = xr(e, n), c = Wr(e, s), u = Sr(), f = !!(i.onDayClick || i.mode !== "default");
|
|
844
844
|
q(function() {
|
|
845
|
-
var
|
|
846
|
-
s.outside || l.focusedDay && f &&
|
|
845
|
+
var P;
|
|
846
|
+
s.outside || l.focusedDay && f && C(l.focusedDay, e) && ((P = t.current) === null || P === void 0 || P.focus());
|
|
847
847
|
}, [
|
|
848
848
|
l.focusedDay,
|
|
849
849
|
e,
|
|
@@ -851,76 +851,76 @@ function Br(e, n, t) {
|
|
|
851
851
|
f,
|
|
852
852
|
s.outside
|
|
853
853
|
]);
|
|
854
|
-
var
|
|
855
|
-
style:
|
|
856
|
-
className:
|
|
854
|
+
var h = Er(i, s).join(" "), m = Rr(i, s), p = !!(s.outside && !i.showOutsideDays || s.hidden), _ = (o = (a = i.components) === null || a === void 0 ? void 0 : a.DayContent) !== null && o !== void 0 ? o : rr, b = d(_, { date: e, displayMonth: n, activeModifiers: s }), M = {
|
|
855
|
+
style: m,
|
|
856
|
+
className: h,
|
|
857
857
|
children: b,
|
|
858
858
|
role: "gridcell"
|
|
859
|
-
}, D = l.focusTarget &&
|
|
859
|
+
}, D = l.focusTarget && C(l.focusTarget, e) && !s.outside, O = l.focusedDay && C(l.focusedDay, e), Z = g(g(g({}, M), (r = { disabled: s.disabled, role: "gridcell" }, r["aria-selected"] = s.selected, r.tabIndex = O || D ? 0 : -1, r)), c), N = {
|
|
860
860
|
isButton: f,
|
|
861
861
|
isHidden: p,
|
|
862
862
|
activeModifiers: s,
|
|
863
|
-
selectedDays:
|
|
864
|
-
buttonProps:
|
|
865
|
-
divProps:
|
|
863
|
+
selectedDays: u,
|
|
864
|
+
buttonProps: Z,
|
|
865
|
+
divProps: M
|
|
866
866
|
};
|
|
867
|
-
return
|
|
867
|
+
return N;
|
|
868
868
|
}
|
|
869
869
|
function Tr(e) {
|
|
870
870
|
var n = re(null), t = Br(e.date, e.displayMonth, n);
|
|
871
|
-
return t.isHidden ?
|
|
871
|
+
return t.isHidden ? d("div", { role: "gridcell" }) : t.isButton ? d(be, g({ name: "day", ref: n }, t.buttonProps)) : d("div", g({}, t.divProps));
|
|
872
872
|
}
|
|
873
873
|
function Fr(e) {
|
|
874
|
-
var n = e.number, t = e.dates, r =
|
|
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, u = c(Number(n), { locale: l });
|
|
875
875
|
if (!a)
|
|
876
|
-
return
|
|
877
|
-
var f = s(Number(n), { locale: l }),
|
|
878
|
-
a(n, t,
|
|
876
|
+
return d("span", { className: i.weeknumber, style: o.weeknumber, children: u });
|
|
877
|
+
var f = s(Number(n), { locale: l }), h = function(m) {
|
|
878
|
+
a(n, t, m);
|
|
879
879
|
};
|
|
880
|
-
return
|
|
880
|
+
return d(be, { name: "week-number", "aria-label": f, className: i.weeknumber, style: o.weeknumber, onClick: h, children: u });
|
|
881
881
|
}
|
|
882
882
|
function Ar(e) {
|
|
883
|
-
var n, t, r =
|
|
884
|
-
return i && (
|
|
885
|
-
return
|
|
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 : Tr, c = (t = l == null ? void 0 : l.WeekNumber) !== null && t !== void 0 ? t : Fr, u;
|
|
884
|
+
return i && (u = d("td", { className: o.cell, style: a.cell, children: d(c, { number: e.weekNumber, dates: e.dates }) })), R("tr", { className: o.row, style: a.row, children: [u, e.dates.map(function(f) {
|
|
885
|
+
return d("td", { className: o.cell, style: a.cell, role: "presentation", children: d(s, { displayMonth: e.displayMonth, date: f }) }, Ut(f));
|
|
886
886
|
})] });
|
|
887
887
|
}
|
|
888
888
|
function st(e, n, t) {
|
|
889
|
-
for (var r = t != null && t.ISOWeek ? vt(n) :
|
|
889
|
+
for (var r = t != null && t.ISOWeek ? vt(n) : ht(n, t), a = t != null && t.ISOWeek ? Ye(e) : He(e, t), o = j(r, a), i = [], l = 0; l <= o; l++)
|
|
890
890
|
i.push(L(a, l));
|
|
891
|
-
var s = i.reduce(function(c,
|
|
892
|
-
var f = t != null && t.ISOWeek ? Jt(
|
|
893
|
-
return
|
|
891
|
+
var s = i.reduce(function(c, u) {
|
|
892
|
+
var f = t != null && t.ISOWeek ? Jt(u) : Qt(u, t), h = c.find(function(m) {
|
|
893
|
+
return m.weekNumber === f;
|
|
894
894
|
});
|
|
895
|
-
return
|
|
895
|
+
return h ? (h.dates.push(u), c) : (c.push({
|
|
896
896
|
weekNumber: f,
|
|
897
|
-
dates: [
|
|
897
|
+
dates: [u]
|
|
898
898
|
}), c);
|
|
899
899
|
}, []);
|
|
900
900
|
return s;
|
|
901
901
|
}
|
|
902
902
|
function Yr(e, n) {
|
|
903
|
-
var t = st(
|
|
903
|
+
var t = st(E(e), Te(e), n);
|
|
904
904
|
if (n != null && n.useFixedWeeks) {
|
|
905
905
|
var r = Xt(e, n);
|
|
906
906
|
if (r < 6) {
|
|
907
|
-
var a = t[t.length - 1], o = a.dates[a.dates.length - 1], i =
|
|
907
|
+
var a = t[t.length - 1], o = a.dates[a.dates.length - 1], i = Le(o, 6 - r), l = st(Le(o, 1), i, n);
|
|
908
908
|
t.push.apply(t, l);
|
|
909
909
|
}
|
|
910
910
|
}
|
|
911
911
|
return t;
|
|
912
912
|
}
|
|
913
913
|
function Hr(e) {
|
|
914
|
-
var n, t, r, a =
|
|
914
|
+
var n, t, r, a = k(), o = a.locale, i = a.classNames, l = a.styles, s = a.hideHead, c = a.fixedWeeks, u = a.components, f = a.weekStartsOn, h = a.firstWeekContainsDate, m = a.ISOWeek, p = Yr(e.displayMonth, {
|
|
915
915
|
useFixedWeeks: !!c,
|
|
916
|
-
ISOWeek:
|
|
916
|
+
ISOWeek: m,
|
|
917
917
|
locale: o,
|
|
918
918
|
weekStartsOn: f,
|
|
919
|
-
firstWeekContainsDate:
|
|
920
|
-
}), _ = (n =
|
|
921
|
-
return
|
|
922
|
-
return
|
|
923
|
-
}) }),
|
|
919
|
+
firstWeekContainsDate: h
|
|
920
|
+
}), _ = (n = u == null ? void 0 : u.Head) !== null && n !== void 0 ? n : nr, b = (t = u == null ? void 0 : u.Row) !== null && t !== void 0 ? t : Ar, M = (r = u == null ? void 0 : u.Footer) !== null && r !== void 0 ? r : zn;
|
|
921
|
+
return R("table", { id: e.id, className: i.table, style: l.table, role: "grid", "aria-labelledby": e["aria-labelledby"], children: [!s && d(_, {}), d("tbody", { className: i.tbody, style: l.tbody, children: p.map(function(D) {
|
|
922
|
+
return d(b, { displayMonth: e.displayMonth, dates: D.dates, weekNumber: D.weekNumber }, D.weekNumber);
|
|
923
|
+
}) }), d(M, { displayMonth: e.displayMonth })] });
|
|
924
924
|
}
|
|
925
925
|
function jr() {
|
|
926
926
|
return !!(typeof window < "u" && window.document && window.document.createElement);
|
|
@@ -938,17 +938,17 @@ function Ur(e) {
|
|
|
938
938
|
}, []), (n = e ?? a) !== null && n !== void 0 ? n : void 0;
|
|
939
939
|
}
|
|
940
940
|
function Xr(e) {
|
|
941
|
-
var n, t, r =
|
|
942
|
-
a === "rtl" && (n = [
|
|
941
|
+
var n, t, r = k(), a = r.dir, o = r.classNames, i = r.styles, l = r.components, s = ve().displayMonths, c = Ur(r.id ? "".concat(r.id, "-").concat(e.displayIndex) : void 0), u = r.id ? "".concat(r.id, "-grid-").concat(e.displayIndex) : void 0, f = [o.month], h = i.month, m = e.displayIndex === 0, p = e.displayIndex === s.length - 1, _ = !m && !p;
|
|
942
|
+
a === "rtl" && (n = [m, p], p = n[0], m = n[1]), m && (f.push(o.caption_start), h = g(g({}, h), i.caption_start)), p && (f.push(o.caption_end), h = g(g({}, h), i.caption_end)), _ && (f.push(o.caption_between), h = g(g({}, h), i.caption_between));
|
|
943
943
|
var b = (t = l == null ? void 0 : l.Caption) !== null && t !== void 0 ? t : Qn;
|
|
944
|
-
return
|
|
944
|
+
return R("div", { className: f.join(" "), style: h, children: [d(b, { id: c, displayMonth: e.displayMonth, displayIndex: e.displayIndex }), d(Hr, { id: u, "aria-labelledby": c, displayMonth: e.displayMonth })] }, e.displayIndex);
|
|
945
945
|
}
|
|
946
946
|
function Zr(e) {
|
|
947
|
-
var n =
|
|
948
|
-
return
|
|
947
|
+
var n = k(), t = n.classNames, r = n.styles;
|
|
948
|
+
return d("div", { className: t.months, style: r.months, children: e.children });
|
|
949
949
|
}
|
|
950
950
|
function Gr(e) {
|
|
951
|
-
var n, t, r = e.initialProps, a =
|
|
951
|
+
var n, t, r = e.initialProps, a = k(), o = Ze(), i = ve(), l = T(!1), s = l[0], c = l[1];
|
|
952
952
|
q(function() {
|
|
953
953
|
a.initialFocus && o.focusTarget && (s || (o.focus(o.focusTarget), c(!0)));
|
|
954
954
|
}, [
|
|
@@ -958,35 +958,35 @@ function Gr(e) {
|
|
|
958
958
|
o.focusTarget,
|
|
959
959
|
o
|
|
960
960
|
]);
|
|
961
|
-
var
|
|
962
|
-
a.numberOfMonths > 1 &&
|
|
963
|
-
var f = g(g({}, a.styles.root), a.style),
|
|
961
|
+
var u = [a.classNames.root, a.className];
|
|
962
|
+
a.numberOfMonths > 1 && u.push(a.classNames.multiple_months), a.showWeekNumber && u.push(a.classNames.with_weeknumber);
|
|
963
|
+
var f = g(g({}, a.styles.root), a.style), h = Object.keys(r).filter(function(p) {
|
|
964
964
|
return p.startsWith("data-");
|
|
965
965
|
}).reduce(function(p, _) {
|
|
966
966
|
var b;
|
|
967
967
|
return g(g({}, p), (b = {}, b[_] = r[_], b));
|
|
968
|
-
}, {}),
|
|
969
|
-
return
|
|
970
|
-
return
|
|
968
|
+
}, {}), m = (t = (n = r.components) === null || n === void 0 ? void 0 : n.Months) !== null && t !== void 0 ? t : Zr;
|
|
969
|
+
return d("div", g({ className: u.join(" "), style: f, dir: a.dir, id: a.id, nonce: r.nonce, title: r.title, lang: r.lang }, h, { children: d(m, { children: i.displayMonths.map(function(p, _) {
|
|
970
|
+
return d(Xr, { displayIndex: _, displayMonth: p }, _);
|
|
971
971
|
}) }) }));
|
|
972
972
|
}
|
|
973
973
|
function $r(e) {
|
|
974
974
|
var n = e.children, t = gn(e, ["children"]);
|
|
975
|
-
return
|
|
975
|
+
return d(Fn, { initialProps: t, children: d(Gn, { children: d(Ir, { initialProps: t, children: d(ar, { initialProps: t, children: d(lr, { initialProps: t, children: d(mr, { children: d(Pr, { children: n }) }) }) }) }) }) });
|
|
976
976
|
}
|
|
977
977
|
function qr(e) {
|
|
978
|
-
return
|
|
978
|
+
return d($r, g({}, e, { children: d(Gr, { initialProps: e }) }));
|
|
979
979
|
}
|
|
980
|
-
const Jr = 329,
|
|
980
|
+
const Jr = 329, X = 12, _e = 26, It = 20, Be = 9, ut = 12, Ot = (e, n) => e.top > n.height + _e ? V.positionabove : V.positionbelow, Qr = (e) => e.left + e.width / 4, zr = (e) => document.documentElement.clientWidth - e.right + e.width / 4, ea = (e, n) => e.left + n.width, ta = (e) => e.left > X, na = (e, n) => ea(e, n) < document.documentElement.clientWidth - X, ra = (e, n) => na(e, n) ? ta(e) ? "floating" : "left" : "right", We = (e, n) => e.top - _e - n.height, Se = (e) => e.bottom + _e, aa = () => document.documentElement.clientWidth - X * 2, oa = () => document.documentElement.clientWidth > Jr + X * 2, ct = (e) => e.top - _e - Be + 5, ia = (e) => Qr(e) - It / 2, la = (e) => zr(e) - It / 2, sa = (e, n) => {
|
|
981
981
|
const t = ra(e, n), r = Ot(e, n);
|
|
982
982
|
return t === "left" ? r === V.positionabove ? "leftabove" : "leftbelow" : t === "right" ? r === V.positionabove ? "rightabove" : "rightbelow" : r === V.positionabove ? "floatingabove" : "floatingbelow";
|
|
983
983
|
}, da = (e, n) => {
|
|
984
984
|
const t = sa(e, n), r = oa() ? void 0 : aa();
|
|
985
985
|
return t === "leftabove" ? {
|
|
986
|
-
left:
|
|
986
|
+
left: X,
|
|
987
987
|
top: We(e, n),
|
|
988
988
|
width: r
|
|
989
|
-
} : t === "leftbelow" ? { left:
|
|
989
|
+
} : t === "leftbelow" ? { left: X, top: Se(e), width: r } : t === "rightabove" ? { right: X, top: We(e, n), width: r } : t === "rightbelow" ? { right: X, top: Se(e), width: r } : t === "floatingbelow" ? { left: e.left, top: Se(e), width: r } : { left: e.left, top: We(e, n), width: r };
|
|
990
990
|
}, ua = (e, n, t) => {
|
|
991
991
|
const r = ia(n), a = la(n), o = e.left + ut, i = e.right + ut;
|
|
992
992
|
return e.right ? t === V.positionabove ? {
|
|
@@ -1003,39 +1003,42 @@ const Jr = 329, Z = 12, _e = 26, It = 20, Be = 9, ut = 12, Ot = (e, n) => e.top
|
|
|
1003
1003
|
top: n.bottom + Be
|
|
1004
1004
|
};
|
|
1005
1005
|
}, ca = (e) => {
|
|
1006
|
-
const { datepickerWrapperRef: n, footer: t, inputRef: r, testId: a, zIndex: o, ...i } = e, l = re(null), [s, c] = T(),
|
|
1006
|
+
const { datepickerWrapperRef: n, footer: t, inputRef: r, testId: a, zIndex: o, ...i } = e, l = re(null), [s, c] = T(), u = mn(n), f = vn(r, 0);
|
|
1007
1007
|
cn(n, !0);
|
|
1008
|
-
const
|
|
1009
|
-
var
|
|
1010
|
-
c((
|
|
1008
|
+
const h = () => {
|
|
1009
|
+
var O;
|
|
1010
|
+
c((O = r.current) == null ? void 0 : O.getBoundingClientRect());
|
|
1011
1011
|
};
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
}, []), fn(
|
|
1015
|
-
const
|
|
1016
|
-
[
|
|
1017
|
-
}), p = s &&
|
|
1018
|
-
[
|
|
1019
|
-
[
|
|
1020
|
-
[
|
|
1021
|
-
}), b = s &&
|
|
1012
|
+
U.useEffect(() => {
|
|
1013
|
+
h();
|
|
1014
|
+
}, []), fn(h, 500), hn(h, ["scroll", "resize"], 10);
|
|
1015
|
+
const m = Re(I["datepicker-popup-container"], {
|
|
1016
|
+
[I["datepicker-popup-container--visible"]]: f
|
|
1017
|
+
}), p = s && u && Ot(s, u), _ = Re(I["datepicker-popup-arrow"], {
|
|
1018
|
+
[I["datepicker-popup-arrow--visible"]]: f,
|
|
1019
|
+
[I["datepicker-popup-arrow--over"]]: p === V.positionbelow,
|
|
1020
|
+
[I["datepicker-popup-arrow--under"]]: p === V.positionabove
|
|
1021
|
+
}), b = s && u && da(s, u), M = b && s && p && ua(b, s, p), D = {
|
|
1022
1022
|
...un,
|
|
1023
|
-
...
|
|
1023
|
+
...I
|
|
1024
1024
|
};
|
|
1025
|
-
return /* @__PURE__ */
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
},
|
|
1025
|
+
return /* @__PURE__ */ R(F, { children: [
|
|
1026
|
+
/* @__PURE__ */ d("div", { className: m, "data-testid": a, ref: n, style: { ...b, zIndex: o }, children: /* @__PURE__ */ d(
|
|
1027
|
+
qr,
|
|
1028
|
+
{
|
|
1029
|
+
captionLayout: "dropdown-buttons",
|
|
1030
|
+
classNames: D,
|
|
1031
|
+
mode: "single",
|
|
1032
|
+
style: { "--rdp-cell-size": pn("l") },
|
|
1033
|
+
modifiersClassNames: { today: I["day--today"], selected: I.day_selected, disabled: I["day--disabled"] },
|
|
1034
|
+
footer: /* @__PURE__ */ d("span", { className: I["footer-wrapper"], children: t }),
|
|
1035
|
+
fixedWeeks: !0,
|
|
1036
|
+
...i
|
|
1037
|
+
}
|
|
1038
|
+
) }),
|
|
1039
|
+
/* @__PURE__ */ d("div", { ref: l, className: _, style: { ...M, zIndex: o } })
|
|
1040
|
+
] });
|
|
1041
|
+
}, Wt = U.forwardRef((e, n) => {
|
|
1039
1042
|
const {
|
|
1040
1043
|
className: t,
|
|
1041
1044
|
dateButtonAriaLabel: r,
|
|
@@ -1045,30 +1048,30 @@ const Jr = 329, Z = 12, _e = 26, It = 20, Be = 9, ut = 12, Ot = (e, n) => e.top
|
|
|
1045
1048
|
dir: l,
|
|
1046
1049
|
disabled: s,
|
|
1047
1050
|
disableDays: c = [],
|
|
1048
|
-
disableWeekends:
|
|
1051
|
+
disableWeekends: u,
|
|
1049
1052
|
error: f,
|
|
1050
|
-
errorText:
|
|
1051
|
-
errorTextId:
|
|
1053
|
+
errorText: h,
|
|
1054
|
+
errorTextId: m,
|
|
1052
1055
|
footerContent: p,
|
|
1053
1056
|
label: _,
|
|
1054
1057
|
inputId: b,
|
|
1055
|
-
locale:
|
|
1058
|
+
locale: M = nn,
|
|
1056
1059
|
maxDate: D,
|
|
1057
|
-
minDate:
|
|
1058
|
-
onBlur:
|
|
1059
|
-
onChange:
|
|
1060
|
-
onDatePopupClosed:
|
|
1060
|
+
minDate: O,
|
|
1061
|
+
onBlur: Z,
|
|
1062
|
+
onChange: N,
|
|
1063
|
+
onDatePopupClosed: P,
|
|
1061
1064
|
testId: ae,
|
|
1062
1065
|
autoComplete: z = "off",
|
|
1063
1066
|
zIndex: we = ln.PopOver,
|
|
1064
|
-
...
|
|
1065
|
-
} = e, [
|
|
1067
|
+
...he
|
|
1068
|
+
} = e, [K, G] = T(o), [De, ee] = T(K ? S(K, a) : ""), [Me, te] = T(i), [y, v] = T(!1), [$, ne] = T(!1), oe = {
|
|
1066
1069
|
dayOfWeek: [0, 6]
|
|
1067
|
-
},
|
|
1070
|
+
}, Et = u ? [...c, oe] : c, $e = re(null), ke = re(null), ie = re(null), { refObject: B } = pt(yt(n) ? n : null), qe = bt([n, B]), me = re(!1);
|
|
1068
1071
|
sn(ke, (w) => {
|
|
1069
|
-
var
|
|
1070
|
-
const
|
|
1071
|
-
!((
|
|
1072
|
+
var W, le;
|
|
1073
|
+
const x = w.target;
|
|
1074
|
+
!((W = ke.current) != null && W.contains(x)) && !((le = ie.current) != null && le.contains(x)) && v(!1);
|
|
1072
1075
|
}), q(() => {
|
|
1073
1076
|
ue(o) ? (ee(o ? S(o, a) : ""), G(o), te(o)) : (ee(""), G(void 0), te(void 0));
|
|
1074
1077
|
}, [o, a]), q(() => {
|
|
@@ -1078,139 +1081,142 @@ const Jr = 329, Z = 12, _e = 26, It = 20, Be = 9, ut = 12, Ot = (e, n) => e.top
|
|
|
1078
1081
|
B != null && B.current && B.current.focus(), v(!1);
|
|
1079
1082
|
};
|
|
1080
1083
|
at(ie, Je, [rt.Escape]), at($e, Je, [rt.Escape]);
|
|
1081
|
-
const Qe = (w,
|
|
1084
|
+
const Qe = (w, x) => {
|
|
1082
1085
|
ee(w.currentTarget.value);
|
|
1083
|
-
const
|
|
1084
|
-
ue(
|
|
1086
|
+
const W = se(w.currentTarget.value, x, /* @__PURE__ */ new Date());
|
|
1087
|
+
ue(W) ? (G(W), te(W)) : G(void 0), N && N(w, w.currentTarget.value);
|
|
1085
1088
|
}, Rt = () => {
|
|
1086
1089
|
$ ? ne(!1) : v(!0);
|
|
1087
|
-
}, Bt = (w,
|
|
1090
|
+
}, Bt = (w, x, W, le) => {
|
|
1088
1091
|
if (ne(!0), !w) {
|
|
1089
1092
|
v(!1);
|
|
1090
1093
|
return;
|
|
1091
1094
|
}
|
|
1092
|
-
G(w), B.current && (ee(S(w, a)), v(!1)),
|
|
1093
|
-
}, Tt = (w,
|
|
1095
|
+
G(w), B.current && (ee(S(w, a)), v(!1)), N && N(le, w), Tt(B, S(w, a), w), P && P(w);
|
|
1096
|
+
}, Tt = (w, x, W, le) => {
|
|
1094
1097
|
if (w.current) {
|
|
1095
|
-
w.current.value =
|
|
1098
|
+
w.current.value = x;
|
|
1096
1099
|
const et = new Event("change", { bubbles: !0 });
|
|
1097
|
-
w.current.dispatchEvent(et),
|
|
1100
|
+
w.current.dispatchEvent(et), N && N(et, W);
|
|
1098
1101
|
}
|
|
1099
1102
|
}, Ft = (w) => {
|
|
1100
|
-
var
|
|
1101
|
-
(
|
|
1103
|
+
var x;
|
|
1104
|
+
(x = ie.current) != null && x.contains(w.relatedTarget) || v(!1), ze(w);
|
|
1102
1105
|
}, ze = (w) => {
|
|
1103
|
-
var
|
|
1104
|
-
const
|
|
1105
|
-
|
|
1106
|
+
var W;
|
|
1107
|
+
const x = (W = ie.current) == null ? void 0 : W.contains(w.relatedTarget);
|
|
1108
|
+
x || v(!1), !x && (typeof P > "u" || me.current) && Z && Z(w), me.current = !1;
|
|
1106
1109
|
}, At = (w) => {
|
|
1107
1110
|
w == null || w.stopPropagation(), v(!y);
|
|
1108
1111
|
};
|
|
1109
1112
|
q(() => {
|
|
1110
|
-
const w = (
|
|
1111
|
-
["Escape", "Enter", "Tab"].includes(
|
|
1112
|
-
},
|
|
1113
|
-
return
|
|
1114
|
-
|
|
1113
|
+
const w = (W) => {
|
|
1114
|
+
["Escape", "Enter", "Tab"].includes(W.key) || (me.current = !0, v(!1));
|
|
1115
|
+
}, x = B.current;
|
|
1116
|
+
return x && x.addEventListener("keydown", w), () => {
|
|
1117
|
+
x && x.removeEventListener("keydown", w);
|
|
1115
1118
|
};
|
|
1116
1119
|
}, [B]);
|
|
1117
1120
|
const Yt = (w) => {
|
|
1118
|
-
Qe(w, "yyyy-MM-dd"),
|
|
1119
|
-
}, Ht = /* @__PURE__ */
|
|
1120
|
-
|
|
1121
|
+
Qe(w, "yyyy-MM-dd"), me.current || P && P(K);
|
|
1122
|
+
}, Ht = /* @__PURE__ */ d(
|
|
1123
|
+
Ee,
|
|
1121
1124
|
{
|
|
1122
1125
|
disabled: s,
|
|
1123
1126
|
error: f,
|
|
1124
|
-
errorText:
|
|
1125
|
-
errorTextId:
|
|
1127
|
+
errorText: h,
|
|
1128
|
+
errorTextId: m,
|
|
1126
1129
|
inputId: b,
|
|
1127
1130
|
label: _,
|
|
1128
1131
|
max: D ? S(D, "yyyy-MM-dd") : "",
|
|
1129
|
-
min:
|
|
1132
|
+
min: O ? S(O, "yyyy-MM-dd") : "",
|
|
1130
1133
|
type: "date",
|
|
1131
1134
|
ref: qe,
|
|
1132
|
-
value:
|
|
1135
|
+
value: K ? S(K, "yyyy-MM-dd") : "",
|
|
1133
1136
|
width: 14,
|
|
1134
|
-
...
|
|
1137
|
+
...he,
|
|
1135
1138
|
onBlur: ze,
|
|
1136
1139
|
onChange: Yt,
|
|
1137
1140
|
autoComplete: z || void 0
|
|
1138
1141
|
}
|
|
1139
|
-
), jt = /* @__PURE__ */
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1142
|
+
), jt = /* @__PURE__ */ R(F, { children: [
|
|
1143
|
+
/* @__PURE__ */ d("div", { children: /* @__PURE__ */ d(
|
|
1144
|
+
Ee,
|
|
1145
|
+
{
|
|
1146
|
+
disabled: s,
|
|
1147
|
+
error: f,
|
|
1148
|
+
errorText: h,
|
|
1149
|
+
errorTextId: m,
|
|
1150
|
+
inputId: b,
|
|
1151
|
+
inputContainerRef: ke,
|
|
1152
|
+
inputWrapperRef: $e,
|
|
1153
|
+
label: _,
|
|
1154
|
+
onFocus: Rt,
|
|
1155
|
+
type: "text",
|
|
1156
|
+
ref: qe,
|
|
1157
|
+
value: De,
|
|
1158
|
+
width: 12,
|
|
1159
|
+
...he,
|
|
1160
|
+
onBlur: Ft,
|
|
1161
|
+
onChange: (w) => Qe(w, "yyyy-MM-dd"),
|
|
1162
|
+
rightOfInput: /* @__PURE__ */ d(
|
|
1163
|
+
rn,
|
|
1164
|
+
{
|
|
1165
|
+
disabled: s,
|
|
1166
|
+
ariaLabel: r ?? "Velg dato",
|
|
1167
|
+
onClick: At,
|
|
1168
|
+
tabIndex: y ? -1 : 0,
|
|
1169
|
+
variant: "borderless",
|
|
1170
|
+
wrapperClassName: I["date-button"],
|
|
1171
|
+
className: I["date-button__inner"],
|
|
1172
|
+
children: /* @__PURE__ */ d(an, { color: "black", svgIcon: on })
|
|
1173
|
+
}
|
|
1174
|
+
),
|
|
1175
|
+
autoComplete: z || void 0
|
|
1176
|
+
}
|
|
1177
|
+
) }),
|
|
1178
|
+
y && !s && /* @__PURE__ */ d(
|
|
1179
|
+
ca,
|
|
1180
|
+
{
|
|
1181
|
+
dir: l,
|
|
1182
|
+
disabled: Et,
|
|
1183
|
+
datepickerWrapperRef: ie,
|
|
1184
|
+
footer: p,
|
|
1185
|
+
fromDate: O,
|
|
1186
|
+
toDate: D,
|
|
1187
|
+
inputRef: B,
|
|
1188
|
+
locale: M,
|
|
1189
|
+
month: Me,
|
|
1190
|
+
selected: K,
|
|
1191
|
+
onSelect: Bt,
|
|
1192
|
+
onMonthChange: te,
|
|
1193
|
+
zIndex: we
|
|
1194
|
+
}
|
|
1195
|
+
)
|
|
1196
|
+
] });
|
|
1197
|
+
return /* @__PURE__ */ d("div", { className: t, "data-testid": ae, children: dn() ? Ht : jt });
|
|
1192
1198
|
});
|
|
1193
1199
|
Wt.displayName = "DatePicker";
|
|
1194
1200
|
const ft = (e) => {
|
|
1195
1201
|
const n = String(e);
|
|
1196
1202
|
return n.length === 1 ? "0" + n : n;
|
|
1197
|
-
}, fa = (e) => !e || /^\d+$/.test(e) && e.length <= 2,
|
|
1198
|
-
const { defaultValue: t, error: r, errorText: a, errorTextId: o, label: i, onChange: l, timeUnit: s, testId: c, inputId:
|
|
1203
|
+
}, fa = (e) => !e || /^\d+$/.test(e) && e.length <= 2, St = U.forwardRef((e, n) => {
|
|
1204
|
+
const { defaultValue: t, error: r, errorText: a, errorTextId: o, label: i, onChange: l, timeUnit: s, testId: c, inputId: u, autoComplete: f = "off", ...h } = e, [m, p] = T(
|
|
1199
1205
|
typeof t < "u" ? ft(t) : ""
|
|
1200
|
-
), { refObject: _ } = pt(yt(n) ? n : null), b = bt([n, _]),
|
|
1201
|
-
const
|
|
1202
|
-
fa(
|
|
1203
|
-
}, D = (
|
|
1204
|
-
const
|
|
1205
|
-
p(
|
|
1206
|
-
},
|
|
1207
|
-
const
|
|
1208
|
-
!
|
|
1209
|
-
}
|
|
1210
|
-
return /* @__PURE__ */
|
|
1211
|
-
|
|
1206
|
+
), { refObject: _ } = pt(yt(n) ? n : null), b = bt([n, _]), M = (N) => {
|
|
1207
|
+
const P = N.target.value;
|
|
1208
|
+
fa(P) && (p(P), l && l(N));
|
|
1209
|
+
}, D = (N) => {
|
|
1210
|
+
const P = ft(N.target.value);
|
|
1211
|
+
p(P), l && l(N);
|
|
1212
|
+
}, O = (N) => {
|
|
1213
|
+
const P = /[0-9]/, ae = ["Backspace", " ", "Enter", "Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"];
|
|
1214
|
+
!P.test(N.key) && !ae.includes(N.key) && N.preventDefault();
|
|
1215
|
+
};
|
|
1216
|
+
return /* @__PURE__ */ d("div", { "data-testid": c, children: /* @__PURE__ */ d(
|
|
1217
|
+
Ee,
|
|
1212
1218
|
{
|
|
1213
|
-
inputId:
|
|
1219
|
+
inputId: u,
|
|
1214
1220
|
error: r,
|
|
1215
1221
|
errorText: a,
|
|
1216
1222
|
errorTextId: o,
|
|
@@ -1219,31 +1225,34 @@ const ft = (e) => {
|
|
|
1219
1225
|
min: 0,
|
|
1220
1226
|
type: "number",
|
|
1221
1227
|
ref: b,
|
|
1222
|
-
value:
|
|
1228
|
+
value: m,
|
|
1223
1229
|
width: 5,
|
|
1224
|
-
...
|
|
1225
|
-
onChange:
|
|
1230
|
+
...h,
|
|
1231
|
+
onChange: M,
|
|
1226
1232
|
onBlur: D,
|
|
1227
|
-
rightOfInput:
|
|
1228
|
-
onKeyDown:
|
|
1233
|
+
rightOfInput: s === "hours" && /* @__PURE__ */ d("span", { className: I["time-separator"], children: ":" }),
|
|
1234
|
+
onKeyDown: O,
|
|
1229
1235
|
autoComplete: f || void 0
|
|
1230
1236
|
}
|
|
1231
|
-
));
|
|
1237
|
+
) });
|
|
1232
1238
|
});
|
|
1233
|
-
|
|
1234
|
-
const va =
|
|
1235
|
-
const { children: t, errorText: r, legend: a, testId: o } = e, i = bn(), l = (s) => ot(s, Wt) ?
|
|
1236
|
-
className: Re(
|
|
1239
|
+
St.displayName = "DateTime";
|
|
1240
|
+
const va = U.forwardRef((e, n) => {
|
|
1241
|
+
const { children: t, errorText: r, legend: a, testId: o } = e, i = bn(), l = (s) => ot(s, Wt) ? U.cloneElement(s, {
|
|
1242
|
+
className: Re(I["date-time-picker-wrapper__date-picker"]),
|
|
1237
1243
|
error: !!r,
|
|
1238
1244
|
errorTextId: i
|
|
1239
|
-
}) : ot(s,
|
|
1245
|
+
}) : ot(s, St) ? U.cloneElement(s, {
|
|
1240
1246
|
error: !!r,
|
|
1241
1247
|
errorTextId: i
|
|
1242
1248
|
}) : s;
|
|
1243
|
-
return /* @__PURE__ */
|
|
1249
|
+
return /* @__PURE__ */ d("div", { ref: n, tabIndex: -1, children: /* @__PURE__ */ d(yn, { errorText: r, errorTextId: i, children: e.legend ? /* @__PURE__ */ R("fieldset", { className: I["date-time-picker-wrapper"], "data-testid": o, children: [
|
|
1250
|
+
e.legend && /* @__PURE__ */ d("legend", { className: I["date-time-picker-wrapper__legend"], children: a }),
|
|
1251
|
+
U.Children.map(t, l)
|
|
1252
|
+
] }) : /* @__PURE__ */ d("div", { className: I["date-time-picker-wrapper"], children: U.Children.map(t, l) }) }) });
|
|
1244
1253
|
});
|
|
1245
1254
|
va.displayName = "DateTimePickerWrapper";
|
|
1246
|
-
const
|
|
1255
|
+
const Lt = (e) => {
|
|
1247
1256
|
const n = ["yyyy-MM-dd", "dd.MM.yyyy"];
|
|
1248
1257
|
for (const t of n) {
|
|
1249
1258
|
const r = se(e, t, /* @__PURE__ */ new Date());
|
|
@@ -1255,22 +1264,22 @@ const St = (e) => {
|
|
|
1255
1264
|
const n = new Date(e);
|
|
1256
1265
|
return n instanceof Date && !isNaN(n.getTime());
|
|
1257
1266
|
}, ja = (e, n, t, r) => {
|
|
1258
|
-
const a =
|
|
1259
|
-
return !a || o && !ue(t) || i && !ue(r) ? "Invalid date format" : o && !i && (
|
|
1267
|
+
const a = Lt(e), o = typeof t < "u", i = typeof r < "u";
|
|
1268
|
+
return !a || o && !ue(t) || i && !ue(r) ? "Invalid date format" : o && !i && (C(a, t) || ye(a, t)) || i && !o && (C(a, r) || Ae(a, r)) || o && i && (C(a, t) || C(a, r) || en(a, { start: t, end: r })) ? !0 : n;
|
|
1260
1269
|
}, Va = (e, n, t) => {
|
|
1261
|
-
const r =
|
|
1262
|
-
return r ? n.some((a) =>
|
|
1270
|
+
const r = Lt(e);
|
|
1271
|
+
return r ? n.some((a) => C(a, r)) ? t : !0 : "Invalid date format";
|
|
1263
1272
|
}, Ka = (e, n, t, r) => {
|
|
1264
1273
|
const a = se((e.hour + ":" + e.minute).toString(), "HH:mm", /* @__PURE__ */ new Date()), o = se(((t == null ? void 0 : t.hour) + ":" + (t == null ? void 0 : t.minute)).toString(), "HH:mm", /* @__PURE__ */ new Date()), i = se(((r == null ? void 0 : r.hour) + ":" + (r == null ? void 0 : r.minute)).toString(), "HH:mm", /* @__PURE__ */ new Date());
|
|
1265
1274
|
return (typeof t > "u" || a >= o) && (typeof r > "u" || a <= i) ? !0 : n;
|
|
1266
1275
|
};
|
|
1267
1276
|
export {
|
|
1268
1277
|
Wt as DatePicker,
|
|
1269
|
-
|
|
1278
|
+
St as DateTime,
|
|
1270
1279
|
va as DateTimePickerWrapper,
|
|
1271
1280
|
Wt as default,
|
|
1272
1281
|
Ha as isValidDate,
|
|
1273
|
-
|
|
1282
|
+
Lt as parseInputDate,
|
|
1274
1283
|
Va as validateDisabledDates,
|
|
1275
1284
|
ja as validateMinMaxDate,
|
|
1276
1285
|
Ka as validateMinTimeMaxTime
|