@helsenorge/datepicker 9.2.0 → 9.4.0
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 +20 -0
- package/components/DatePicker/index.js +448 -445
- package/components/DatePicker/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { isSameDay as N, subDays as Ce, addDays as
|
|
4
|
-
import { enUS as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
import { jsx as s, jsxs as L, Fragment as A } from "react/jsx-runtime";
|
|
2
|
+
import J, { createContext as ne, forwardRef as Ut, useContext as re, useState as B, useEffect as z, useLayoutEffect as Xt, useRef as oe } from "react";
|
|
3
|
+
import { isSameDay as N, subDays as Ce, addDays as W, differenceInCalendarDays as U, startOfMonth as S, endOfMonth as Fe, startOfDay as rt, addMonths as j, differenceInCalendarMonths as le, isSameMonth as Ae, isBefore as He, isAfter as ge, getUnixTime as Zt, getWeeksInMonth as Gt, addWeeks as Ee, isSameYear as $t, setMonth as Pe, setYear as at, startOfYear as qt, max as Jt, min as Qt, endOfISOWeek as ht, endOfWeek as pt, startOfISOWeek as Ye, startOfWeek as je, getISOWeek as zt, getWeek as en, format as O, isDate as yt, addYears as tn, isValid as se, parse as ie, isWithinInterval as nn } from "date-fns";
|
|
4
|
+
import { enUS as rn, nb as an } from "date-fns/locale";
|
|
5
|
+
import on from "@helsenorge/designsystem-react/components/Button";
|
|
6
|
+
import ln from "@helsenorge/designsystem-react/components/Icon";
|
|
7
|
+
import sn from "@helsenorge/designsystem-react/components/Icons/Calendar";
|
|
8
8
|
import Re from "@helsenorge/designsystem-react/components/Input";
|
|
9
|
-
import { PopOverVariant as
|
|
10
|
-
import { ZIndex as
|
|
9
|
+
import { PopOverVariant as F } from "@helsenorge/designsystem-react/components/PopOver";
|
|
10
|
+
import { ZIndex as dn, KeyboardEventKey as ot } from "@helsenorge/designsystem-react/constants";
|
|
11
11
|
import { useKeyboardEvent as it } from "@helsenorge/designsystem-react/hooks/useKeyboardEvent";
|
|
12
|
-
import { useOutsideEvent as
|
|
12
|
+
import { useOutsideEvent as un } from "@helsenorge/designsystem-react/hooks/useOutsideEvent";
|
|
13
13
|
import { usePseudoClasses as bt } from "@helsenorge/designsystem-react/hooks/usePseudoClasses";
|
|
14
|
-
import { isMobileUA as
|
|
14
|
+
import { isMobileUA as cn } from "@helsenorge/designsystem-react/utils/mobile";
|
|
15
15
|
import { isMutableRefObject as gt, mergeRefs as _t } from "@helsenorge/designsystem-react/utils/refs";
|
|
16
16
|
import Be from "classnames";
|
|
17
|
-
import
|
|
18
|
-
import { useFocusTrap as
|
|
19
|
-
import { useInterval as
|
|
20
|
-
import { useIsVisible as
|
|
21
|
-
import { useLayoutEvent as
|
|
22
|
-
import { useSize as
|
|
23
|
-
import { getSpacer as
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import { useUuid as
|
|
17
|
+
import fn from "react-day-picker/dist/style.module.css";
|
|
18
|
+
import { useFocusTrap as vn } from "@helsenorge/designsystem-react/hooks/useFocusTrap";
|
|
19
|
+
import { useInterval as mn } from "@helsenorge/designsystem-react/hooks/useInterval";
|
|
20
|
+
import { useIsVisible as hn } from "@helsenorge/designsystem-react/hooks/useIsVisible";
|
|
21
|
+
import { useLayoutEvent as pn } from "@helsenorge/designsystem-react/hooks/useLayoutEvent";
|
|
22
|
+
import { useSize as yn } from "@helsenorge/designsystem-react/hooks/useSize";
|
|
23
|
+
import { getSpacer as bn } from "@helsenorge/designsystem-react/theme/currys/spacing";
|
|
24
|
+
import P from "./styles.module.scss";
|
|
25
|
+
import gn from "@helsenorge/designsystem-react/components/ErrorWrapper";
|
|
26
|
+
import { useUuid as _n } from "@helsenorge/designsystem-react/hooks/useUuid";
|
|
27
27
|
import { isComponent as lt } from "@helsenorge/designsystem-react/utils/component";
|
|
28
28
|
var g = function() {
|
|
29
29
|
return g = Object.assign || function(t) {
|
|
@@ -34,7 +34,7 @@ var g = function() {
|
|
|
34
34
|
return t;
|
|
35
35
|
}, g.apply(this, arguments);
|
|
36
36
|
};
|
|
37
|
-
function
|
|
37
|
+
function wn(e, t) {
|
|
38
38
|
var n = {};
|
|
39
39
|
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
40
40
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -47,16 +47,16 @@ function wt(e, t, n) {
|
|
|
47
47
|
(o || !(r in t)) && (o || (o = Array.prototype.slice.call(t, 0, r)), o[r] = t[r]);
|
|
48
48
|
return e.concat(o || Array.prototype.slice.call(t));
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function de(e) {
|
|
51
51
|
return e.mode === "multiple";
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function ue(e) {
|
|
54
54
|
return e.mode === "range";
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function we(e) {
|
|
57
57
|
return e.mode === "single";
|
|
58
58
|
}
|
|
59
|
-
var
|
|
59
|
+
var Dn = {
|
|
60
60
|
root: "rdp",
|
|
61
61
|
multiple_months: "rdp-multiple_months",
|
|
62
62
|
with_weeknumber: "rdp-with_weeknumber",
|
|
@@ -99,63 +99,63 @@ var Mn = {
|
|
|
99
99
|
day_range_end: "rdp-day_range_end",
|
|
100
100
|
day_range_middle: "rdp-day_range_middle"
|
|
101
101
|
};
|
|
102
|
+
function Mn(e, t) {
|
|
103
|
+
return O(e, "LLLL y", t);
|
|
104
|
+
}
|
|
102
105
|
function kn(e, t) {
|
|
103
|
-
return
|
|
106
|
+
return O(e, "d", t);
|
|
104
107
|
}
|
|
105
108
|
function Nn(e, t) {
|
|
106
|
-
return
|
|
107
|
-
}
|
|
108
|
-
function Cn(e, t) {
|
|
109
|
-
return W(e, "LLLL", t);
|
|
109
|
+
return O(e, "LLLL", t);
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function Cn(e) {
|
|
112
112
|
return "".concat(e);
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
return
|
|
114
|
+
function Pn(e, t) {
|
|
115
|
+
return O(e, "cccccc", t);
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
return
|
|
117
|
+
function xn(e, t) {
|
|
118
|
+
return O(e, "yyyy", t);
|
|
119
119
|
}
|
|
120
120
|
var On = /* @__PURE__ */ Object.freeze({
|
|
121
121
|
__proto__: null,
|
|
122
|
-
formatCaption:
|
|
123
|
-
formatDay:
|
|
124
|
-
formatMonthCaption:
|
|
125
|
-
formatWeekNumber:
|
|
126
|
-
formatWeekdayName:
|
|
127
|
-
formatYearCaption:
|
|
128
|
-
}),
|
|
129
|
-
return
|
|
130
|
-
},
|
|
122
|
+
formatCaption: Mn,
|
|
123
|
+
formatDay: kn,
|
|
124
|
+
formatMonthCaption: Nn,
|
|
125
|
+
formatWeekNumber: Cn,
|
|
126
|
+
formatWeekdayName: Pn,
|
|
127
|
+
formatYearCaption: xn
|
|
128
|
+
}), In = function(e, t, n) {
|
|
129
|
+
return O(e, "do MMMM (EEEE)", n);
|
|
130
|
+
}, Wn = function() {
|
|
131
131
|
return "Month: ";
|
|
132
|
-
},
|
|
132
|
+
}, Sn = function() {
|
|
133
133
|
return "Go to next month";
|
|
134
|
-
},
|
|
134
|
+
}, Ln = function() {
|
|
135
135
|
return "Go to previous month";
|
|
136
|
-
},
|
|
137
|
-
return
|
|
138
|
-
},
|
|
136
|
+
}, En = function(e, t) {
|
|
137
|
+
return O(e, "cccc", t);
|
|
138
|
+
}, Rn = function(e) {
|
|
139
139
|
return "Week n. ".concat(e);
|
|
140
|
-
},
|
|
140
|
+
}, Bn = function() {
|
|
141
141
|
return "Year: ";
|
|
142
|
-
},
|
|
142
|
+
}, Tn = /* @__PURE__ */ Object.freeze({
|
|
143
143
|
__proto__: null,
|
|
144
|
-
labelDay:
|
|
145
|
-
labelMonthDropdown:
|
|
146
|
-
labelNext:
|
|
147
|
-
labelPrevious:
|
|
148
|
-
labelWeekNumber:
|
|
149
|
-
labelWeekday:
|
|
150
|
-
labelYearDropdown:
|
|
144
|
+
labelDay: In,
|
|
145
|
+
labelMonthDropdown: Wn,
|
|
146
|
+
labelNext: Sn,
|
|
147
|
+
labelPrevious: Ln,
|
|
148
|
+
labelWeekNumber: Rn,
|
|
149
|
+
labelWeekday: En,
|
|
150
|
+
labelYearDropdown: Bn
|
|
151
151
|
});
|
|
152
|
-
function
|
|
153
|
-
var e = "buttons", t =
|
|
152
|
+
function Fn() {
|
|
153
|
+
var e = "buttons", t = Dn, n = rn, r = {}, a = {}, o = 1, i = {}, l = /* @__PURE__ */ new Date();
|
|
154
154
|
return {
|
|
155
155
|
captionLayout: e,
|
|
156
156
|
classNames: t,
|
|
157
157
|
formatters: On,
|
|
158
|
-
labels:
|
|
158
|
+
labels: Tn,
|
|
159
159
|
locale: n,
|
|
160
160
|
modifiersClassNames: r,
|
|
161
161
|
modifiers: a,
|
|
@@ -165,19 +165,19 @@ function An() {
|
|
|
165
165
|
mode: "default"
|
|
166
166
|
};
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function An(e) {
|
|
169
169
|
var t = e.fromYear, n = e.toYear, r = e.fromMonth, a = e.toMonth, o = e.fromDate, i = e.toDate;
|
|
170
|
-
return r ? o =
|
|
170
|
+
return r ? o = S(r) : t && (o = new Date(t, 0, 1)), a ? i = Fe(a) : n && (i = new Date(n, 11, 31)), {
|
|
171
171
|
fromDate: o ? rt(o) : void 0,
|
|
172
172
|
toDate: i ? rt(i) : void 0
|
|
173
173
|
};
|
|
174
174
|
}
|
|
175
175
|
var Dt = ne(void 0);
|
|
176
|
-
function
|
|
177
|
-
var t, n = e.initialProps, r =
|
|
176
|
+
function Hn(e) {
|
|
177
|
+
var t, n = e.initialProps, r = Fn(), a = An(n), o = a.fromDate, i = a.toDate, l = (t = n.captionLayout) !== null && t !== void 0 ? t : r.captionLayout;
|
|
178
178
|
l !== "buttons" && (!o || !i) && (l = "buttons");
|
|
179
179
|
var d;
|
|
180
|
-
(
|
|
180
|
+
(we(n) || de(n) || ue(n)) && (d = n.onSelect);
|
|
181
181
|
var u = g(g(g({}, r), n), { captionLayout: l, classNames: g(g({}, r.classNames), n.classNames), components: g({}, n.components), formatters: g(g({}, r.formatters), n.formatters), fromDate: o, labels: g(g({}, r.labels), n.labels), mode: n.mode || r.mode, modifiers: g(g({}, r.modifiers), n.modifiers), modifiersClassNames: g(g({}, r.modifiersClassNames), n.modifiersClassNames), onSelect: d, styles: g(g({}, r.styles), n.styles), toDate: i });
|
|
182
182
|
return s(Dt.Provider, { value: u, children: e.children });
|
|
183
183
|
}
|
|
@@ -191,107 +191,107 @@ function Mt(e) {
|
|
|
191
191
|
var t = k(), n = t.locale, r = t.classNames, a = t.styles, o = t.formatters.formatCaption;
|
|
192
192
|
return s("div", { className: r.caption_label, style: a.caption_label, "aria-live": "polite", role: "presentation", id: e.id, children: o(e.displayMonth, { locale: n }) });
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function Yn(e) {
|
|
195
195
|
return s("svg", g({ width: "8px", height: "8px", viewBox: "0 0 120 120", "data-testid": "iconDropdown" }, e, { children: s("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 kt(e) {
|
|
198
|
-
var t, n, r = e.onChange, a = e.value, o = e.children, i = e.caption, l = e.className, d = e.style, u = k(), c = (n = (t = u.components) === null || t === void 0 ? void 0 : t.IconDropdown) !== null && n !== void 0 ? n :
|
|
199
|
-
return
|
|
198
|
+
var t, n, r = e.onChange, a = e.value, o = e.children, i = e.caption, l = e.className, d = e.style, u = k(), c = (n = (t = u.components) === null || t === void 0 ? void 0 : t.IconDropdown) !== null && n !== void 0 ? n : Yn;
|
|
199
|
+
return L("div", { className: l, style: d, children: [s("span", { className: u.classNames.vhidden, children: e["aria-label"] }), s("select", { name: e.name, "aria-label": e["aria-label"], className: u.classNames.dropdown, style: u.styles.dropdown, value: a, onChange: r, children: o }), L("div", { className: u.classNames.caption_label, style: u.styles.caption_label, "aria-hidden": "true", children: [i, s(c, { className: u.classNames.dropdown_icon, style: u.styles.dropdown_icon })] })] });
|
|
200
200
|
}
|
|
201
|
-
function
|
|
201
|
+
function jn(e) {
|
|
202
202
|
var t, n = k(), r = n.fromDate, a = n.toDate, o = n.styles, i = n.locale, l = n.formatters.formatMonthCaption, d = n.classNames, u = n.components, c = n.labels.labelMonthDropdown;
|
|
203
203
|
if (!r)
|
|
204
|
-
return s(
|
|
204
|
+
return s(A, {});
|
|
205
205
|
if (!a)
|
|
206
|
-
return s(
|
|
206
|
+
return s(A, {});
|
|
207
207
|
var f = [];
|
|
208
|
-
if (
|
|
209
|
-
for (var v =
|
|
208
|
+
if ($t(r, a))
|
|
209
|
+
for (var v = S(r), m = r.getMonth(); m <= a.getMonth(); m++)
|
|
210
210
|
f.push(Pe(v, m));
|
|
211
211
|
else
|
|
212
|
-
for (var v =
|
|
212
|
+
for (var v = S(/* @__PURE__ */ new Date()), m = 0; m <= 11; m++)
|
|
213
213
|
f.push(Pe(v, m));
|
|
214
214
|
var y = function(p) {
|
|
215
|
-
var D = Number(p.target.value), M = Pe(
|
|
215
|
+
var D = Number(p.target.value), M = Pe(S(e.displayMonth), D);
|
|
216
216
|
e.onChange(M);
|
|
217
217
|
}, _ = (t = u == null ? void 0 : u.Dropdown) !== null && t !== void 0 ? t : kt;
|
|
218
218
|
return s(_, { name: "months", "aria-label": c(), className: d.dropdown_month, style: o.dropdown_month, onChange: y, value: e.displayMonth.getMonth(), caption: l(e.displayMonth, { locale: i }), children: f.map(function(p) {
|
|
219
219
|
return s("option", { value: p.getMonth(), children: l(p, { locale: i }) }, p.getMonth());
|
|
220
220
|
}) });
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function Vn(e) {
|
|
223
223
|
var t, n = e.displayMonth, r = k(), a = r.fromDate, o = r.toDate, i = r.locale, l = r.styles, d = r.classNames, u = r.components, c = r.formatters.formatYearCaption, f = r.labels.labelYearDropdown, v = [];
|
|
224
224
|
if (!a)
|
|
225
|
-
return s(
|
|
225
|
+
return s(A, {});
|
|
226
226
|
if (!o)
|
|
227
|
-
return s(
|
|
227
|
+
return s(A, {});
|
|
228
228
|
for (var m = a.getFullYear(), y = o.getFullYear(), _ = m; _ <= y; _++)
|
|
229
|
-
v.push(at(
|
|
229
|
+
v.push(at(qt(/* @__PURE__ */ new Date()), _));
|
|
230
230
|
var p = function(M) {
|
|
231
|
-
var
|
|
232
|
-
e.onChange(
|
|
231
|
+
var I = at(S(n), Number(M.target.value));
|
|
232
|
+
e.onChange(I);
|
|
233
233
|
}, D = (t = u == null ? void 0 : u.Dropdown) !== null && t !== void 0 ? t : kt;
|
|
234
234
|
return s(D, { name: "years", "aria-label": f(), className: d.dropdown_year, style: l.dropdown_year, onChange: p, value: n.getFullYear(), caption: c(n, { locale: i }), children: v.map(function(M) {
|
|
235
235
|
return s("option", { value: M.getFullYear(), children: c(M, { locale: i }) }, M.getFullYear());
|
|
236
236
|
}) });
|
|
237
237
|
}
|
|
238
|
-
function
|
|
239
|
-
var n =
|
|
238
|
+
function Kn(e, t) {
|
|
239
|
+
var n = B(e), r = n[0], a = n[1], o = t === void 0 ? r : t;
|
|
240
240
|
return [o, a];
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function Un(e) {
|
|
243
243
|
var t = e.month, n = e.defaultMonth, r = e.today, a = t || n || r || /* @__PURE__ */ new Date(), o = e.toDate, i = e.fromDate, l = e.numberOfMonths, d = l === void 0 ? 1 : l;
|
|
244
|
-
if (o &&
|
|
244
|
+
if (o && le(o, a) < 0) {
|
|
245
245
|
var u = -1 * (d - 1);
|
|
246
|
-
a =
|
|
246
|
+
a = j(o, u);
|
|
247
247
|
}
|
|
248
|
-
return i &&
|
|
248
|
+
return i && le(a, i) < 0 && (a = i), S(a);
|
|
249
249
|
}
|
|
250
|
-
function
|
|
251
|
-
var e = k(), t =
|
|
250
|
+
function Xn() {
|
|
251
|
+
var e = k(), t = Un(e), n = Kn(t, e.month), r = n[0], a = n[1], o = function(i) {
|
|
252
252
|
var l;
|
|
253
253
|
if (!e.disableNavigation) {
|
|
254
|
-
var d =
|
|
254
|
+
var d = S(i);
|
|
255
255
|
a(d), (l = e.onMonthChange) === null || l === void 0 || l.call(e, d);
|
|
256
256
|
}
|
|
257
257
|
};
|
|
258
258
|
return [r, o];
|
|
259
259
|
}
|
|
260
|
-
function
|
|
261
|
-
for (var n = t.reverseMonths, r = t.numberOfMonths, a =
|
|
262
|
-
var u =
|
|
260
|
+
function Zn(e, t) {
|
|
261
|
+
for (var n = t.reverseMonths, r = t.numberOfMonths, a = S(e), o = S(j(a, r)), i = le(o, a), l = [], d = 0; d < i; d++) {
|
|
262
|
+
var u = j(a, d);
|
|
263
263
|
l.push(u);
|
|
264
264
|
}
|
|
265
265
|
return n && (l = l.reverse()), l;
|
|
266
266
|
}
|
|
267
|
-
function
|
|
267
|
+
function Gn(e, t) {
|
|
268
268
|
if (!t.disableNavigation) {
|
|
269
|
-
var n = t.toDate, r = t.pagedNavigation, a = t.numberOfMonths, o = a === void 0 ? 1 : a, i = r ? o : 1, l =
|
|
269
|
+
var n = t.toDate, r = t.pagedNavigation, a = t.numberOfMonths, o = a === void 0 ? 1 : a, i = r ? o : 1, l = S(e);
|
|
270
270
|
if (!n)
|
|
271
|
-
return
|
|
272
|
-
var d =
|
|
271
|
+
return j(l, i);
|
|
272
|
+
var d = le(n, e);
|
|
273
273
|
if (!(d < o))
|
|
274
|
-
return
|
|
274
|
+
return j(l, i);
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
|
-
function
|
|
277
|
+
function $n(e, t) {
|
|
278
278
|
if (!t.disableNavigation) {
|
|
279
|
-
var n = t.fromDate, r = t.pagedNavigation, a = t.numberOfMonths, o = a === void 0 ? 1 : a, i = r ? o : 1, l =
|
|
279
|
+
var n = t.fromDate, r = t.pagedNavigation, a = t.numberOfMonths, o = a === void 0 ? 1 : a, i = r ? o : 1, l = S(e);
|
|
280
280
|
if (!n)
|
|
281
|
-
return
|
|
282
|
-
var d =
|
|
281
|
+
return j(l, -i);
|
|
282
|
+
var d = le(l, n);
|
|
283
283
|
if (!(d <= 0))
|
|
284
|
-
return
|
|
284
|
+
return j(l, -i);
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
287
|
var Nt = ne(void 0);
|
|
288
|
-
function
|
|
289
|
-
var t = k(), n =
|
|
288
|
+
function qn(e) {
|
|
289
|
+
var t = k(), n = Xn(), r = n[0], a = n[1], o = Zn(r, t), i = Gn(r, t), l = $n(r, t), d = function(f) {
|
|
290
290
|
return o.some(function(v) {
|
|
291
291
|
return Ae(f, v);
|
|
292
292
|
});
|
|
293
293
|
}, u = function(f, v) {
|
|
294
|
-
d(f) || (v && He(f, v) ? a(
|
|
294
|
+
d(f) || (v && He(f, v) ? a(j(f, 1 + t.numberOfMonths * -1)) : a(f));
|
|
295
295
|
}, c = {
|
|
296
296
|
currentMonth: r,
|
|
297
297
|
displayMonths: o,
|
|
@@ -303,85 +303,85 @@ function Jn(e) {
|
|
|
303
303
|
};
|
|
304
304
|
return s(Nt.Provider, { value: c, children: e.children });
|
|
305
305
|
}
|
|
306
|
-
function
|
|
306
|
+
function ce() {
|
|
307
307
|
var e = re(Nt);
|
|
308
308
|
if (!e)
|
|
309
309
|
throw new Error("useNavigation must be used within a NavigationProvider");
|
|
310
310
|
return e;
|
|
311
311
|
}
|
|
312
312
|
function st(e) {
|
|
313
|
-
var t, n = k(), r = n.classNames, a = n.styles, o = n.components, i =
|
|
314
|
-
i(
|
|
313
|
+
var t, n = k(), r = n.classNames, a = n.styles, o = n.components, i = ce().goToMonth, l = function(c) {
|
|
314
|
+
i(j(c, e.displayIndex ? -e.displayIndex : 0));
|
|
315
315
|
}, d = (t = o == null ? void 0 : o.CaptionLabel) !== null && t !== void 0 ? t : Mt, u = s(d, { id: e.id, displayMonth: e.displayMonth });
|
|
316
|
-
return
|
|
316
|
+
return L("div", { className: r.caption_dropdowns, style: a.caption_dropdowns, children: [s("div", { className: r.vhidden, children: u }), s(jn, { onChange: l, displayMonth: e.displayMonth }), s(Vn, { onChange: l, displayMonth: e.displayMonth })] });
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function Jn(e) {
|
|
319
319
|
return s("svg", g({ width: "16px", height: "16px", viewBox: "0 0 120 120" }, e, { children: s("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
|
-
function
|
|
321
|
+
function Qn(e) {
|
|
322
322
|
return s("svg", g({ width: "16px", height: "16px", viewBox: "0 0 120 120" }, e, { children: s("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
|
-
var
|
|
324
|
+
var _e = Ut(function(e, t) {
|
|
325
325
|
var n = k(), r = n.classNames, a = n.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
328
|
return e.style && Object.assign(l, e.style), s("button", g({}, e, { ref: t, type: "button", className: i, style: l }));
|
|
329
329
|
});
|
|
330
|
-
function
|
|
330
|
+
function zn(e) {
|
|
331
331
|
var t, n, r = k(), a = r.dir, o = r.locale, i = r.classNames, l = r.styles, d = r.labels, u = d.labelPrevious, c = d.labelNext, f = r.components;
|
|
332
332
|
if (!e.nextMonth && !e.previousMonth)
|
|
333
|
-
return s(
|
|
333
|
+
return s(A, {});
|
|
334
334
|
var v = u(e.previousMonth, { locale: o }), m = [
|
|
335
335
|
i.nav_button,
|
|
336
336
|
i.nav_button_previous
|
|
337
337
|
].join(" "), y = c(e.nextMonth, { locale: o }), _ = [
|
|
338
338
|
i.nav_button,
|
|
339
339
|
i.nav_button_next
|
|
340
|
-
].join(" "), p = (t = f == null ? void 0 : f.IconRight) !== null && t !== void 0 ? t :
|
|
341
|
-
return
|
|
340
|
+
].join(" "), p = (t = f == null ? void 0 : f.IconRight) !== null && t !== void 0 ? t : Qn, D = (n = f == null ? void 0 : f.IconLeft) !== null && n !== void 0 ? n : Jn;
|
|
341
|
+
return L("div", { className: i.nav, style: l.nav, children: [!e.hidePrevious && s(_e, { name: "previous-month", "aria-label": v, className: m, style: l.nav_button_previous, disabled: !e.previousMonth, onClick: e.onPreviousClick, children: a === "rtl" ? s(p, { className: i.nav_icon, style: l.nav_icon }) : s(D, { className: i.nav_icon, style: l.nav_icon }) }), !e.hideNext && s(_e, { name: "next-month", "aria-label": y, className: _, style: l.nav_button_next, disabled: !e.nextMonth, onClick: e.onNextClick, children: a === "rtl" ? s(D, { className: i.nav_icon, style: l.nav_icon }) : s(p, { className: i.nav_icon, style: l.nav_icon }) })] });
|
|
342
342
|
}
|
|
343
343
|
function dt(e) {
|
|
344
|
-
var t = k().numberOfMonths, n =
|
|
344
|
+
var t = k().numberOfMonths, n = ce(), r = n.previousMonth, a = n.nextMonth, o = n.goToMonth, i = n.displayMonths, l = i.findIndex(function(y) {
|
|
345
345
|
return Ae(e.displayMonth, y);
|
|
346
346
|
}), d = l === 0, u = l === i.length - 1, c = t > 1 && (d || !u), f = t > 1 && (u || !d), v = function() {
|
|
347
347
|
r && o(r);
|
|
348
348
|
}, m = function() {
|
|
349
349
|
a && o(a);
|
|
350
350
|
};
|
|
351
|
-
return s(
|
|
351
|
+
return s(zn, { displayMonth: e.displayMonth, hideNext: c, hidePrevious: f, nextMonth: a, previousMonth: r, onPreviousClick: v, onNextClick: m });
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function er(e) {
|
|
354
354
|
var t, n = k(), r = n.classNames, a = n.disableNavigation, o = n.styles, i = n.captionLayout, l = n.components, d = (t = l == null ? void 0 : l.CaptionLabel) !== null && t !== void 0 ? t : Mt, u;
|
|
355
|
-
return a ? u = s(d, { id: e.id, displayMonth: e.displayMonth }) : i === "dropdown" ? u = s(st, { displayMonth: e.displayMonth, id: e.id }) : i === "dropdown-buttons" ? u =
|
|
355
|
+
return a ? u = s(d, { id: e.id, displayMonth: e.displayMonth }) : i === "dropdown" ? u = s(st, { displayMonth: e.displayMonth, id: e.id }) : i === "dropdown-buttons" ? u = L(A, { children: [s(st, { displayMonth: e.displayMonth, displayIndex: e.displayIndex, id: e.id }), s(dt, { displayMonth: e.displayMonth, displayIndex: e.displayIndex, id: e.id })] }) : u = L(A, { children: [s(d, { id: e.id, displayMonth: e.displayMonth, displayIndex: e.displayIndex }), s(dt, { displayMonth: e.displayMonth, id: e.id })] }), s("div", { className: r.caption, style: o.caption, children: u });
|
|
356
356
|
}
|
|
357
|
-
function
|
|
357
|
+
function tr(e) {
|
|
358
358
|
var t = k(), n = t.footer, r = t.styles, a = t.classNames.tfoot;
|
|
359
|
-
return n ? s("tfoot", { className: a, style: r.tfoot, children: s("tr", { children: s("td", { colSpan: 8, children: n }) }) }) : s(
|
|
359
|
+
return n ? s("tfoot", { className: a, style: r.tfoot, children: s("tr", { children: s("td", { colSpan: 8, children: n }) }) }) : s(A, {});
|
|
360
360
|
}
|
|
361
|
-
function
|
|
361
|
+
function nr(e, t, n) {
|
|
362
362
|
for (var r = n ? Ye(/* @__PURE__ */ new Date()) : je(/* @__PURE__ */ new Date(), { locale: e, weekStartsOn: t }), a = [], o = 0; o < 7; o++) {
|
|
363
|
-
var i =
|
|
363
|
+
var i = W(r, o);
|
|
364
364
|
a.push(i);
|
|
365
365
|
}
|
|
366
366
|
return a;
|
|
367
367
|
}
|
|
368
|
-
function
|
|
369
|
-
var e = k(), t = e.classNames, n = e.styles, r = e.showWeekNumber, a = e.locale, o = e.weekStartsOn, i = e.ISOWeek, l = e.formatters.formatWeekdayName, d = e.labels.labelWeekday, u =
|
|
370
|
-
return
|
|
368
|
+
function rr() {
|
|
369
|
+
var e = k(), t = e.classNames, n = e.styles, r = e.showWeekNumber, a = e.locale, o = e.weekStartsOn, i = e.ISOWeek, l = e.formatters.formatWeekdayName, d = e.labels.labelWeekday, u = nr(a, o, i);
|
|
370
|
+
return L("tr", { style: n.head_row, className: t.head_row, children: [r && s("td", { style: n.head_cell, className: t.head_cell }), u.map(function(c, f) {
|
|
371
371
|
return s("th", { scope: "col", className: t.head_cell, style: n.head_cell, "aria-label": d(c, { locale: a }), children: l(c, { locale: a }) }, f);
|
|
372
372
|
})] });
|
|
373
373
|
}
|
|
374
|
-
function
|
|
375
|
-
var e, t = k(), n = t.classNames, r = t.styles, a = t.components, o = (e = a == null ? void 0 : a.HeadRow) !== null && e !== void 0 ? e :
|
|
374
|
+
function ar() {
|
|
375
|
+
var e, t = k(), n = t.classNames, r = t.styles, a = t.components, o = (e = a == null ? void 0 : a.HeadRow) !== null && e !== void 0 ? e : rr;
|
|
376
376
|
return s("thead", { style: r.head, className: n.head, children: s(o, {}) });
|
|
377
377
|
}
|
|
378
|
-
function
|
|
378
|
+
function or(e) {
|
|
379
379
|
var t = k(), n = t.locale, r = t.formatters.formatDay;
|
|
380
|
-
return s(
|
|
380
|
+
return s(A, { children: r(e.date, { locale: n }) });
|
|
381
381
|
}
|
|
382
382
|
var Ve = ne(void 0);
|
|
383
|
-
function
|
|
384
|
-
if (!
|
|
383
|
+
function ir(e) {
|
|
384
|
+
if (!de(e.initialProps)) {
|
|
385
385
|
var t = {
|
|
386
386
|
selected: void 0,
|
|
387
387
|
modifiers: {
|
|
@@ -390,9 +390,9 @@ function lr(e) {
|
|
|
390
390
|
};
|
|
391
391
|
return s(Ve.Provider, { value: t, children: e.children });
|
|
392
392
|
}
|
|
393
|
-
return s(
|
|
393
|
+
return s(lr, { initialProps: e.initialProps, children: e.children });
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function lr(e) {
|
|
396
396
|
var t = e.initialProps, n = e.children, r = t.selected, a = t.min, o = t.max, i = function(u, c, f) {
|
|
397
397
|
var v, m;
|
|
398
398
|
(v = t.onDayClick) === null || v === void 0 || v.call(t, u, c, f);
|
|
@@ -433,13 +433,13 @@ function Ke() {
|
|
|
433
433
|
throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");
|
|
434
434
|
return e;
|
|
435
435
|
}
|
|
436
|
-
function
|
|
436
|
+
function sr(e, t) {
|
|
437
437
|
var n = t || {}, r = n.from, a = n.to;
|
|
438
|
-
return r && a ? N(a, e) && N(r, e) ? void 0 : N(a, e) ? { from: a, to: void 0 } : N(r, e) ? void 0 :
|
|
438
|
+
return r && a ? N(a, e) && N(r, e) ? void 0 : N(a, e) ? { from: a, to: void 0 } : N(r, e) ? void 0 : ge(r, e) ? { from: e, to: a } : { from: r, to: e } : a ? ge(e, a) ? { from: a, to: e } : { from: e, to: a } : r ? He(e, r) ? { from: e, to: r } : { from: r, to: e } : { from: e, to: void 0 };
|
|
439
439
|
}
|
|
440
440
|
var Ue = ne(void 0);
|
|
441
|
-
function
|
|
442
|
-
if (!
|
|
441
|
+
function dr(e) {
|
|
442
|
+
if (!ue(e.initialProps)) {
|
|
443
443
|
var t = {
|
|
444
444
|
selected: void 0,
|
|
445
445
|
modifiers: {
|
|
@@ -451,13 +451,13 @@ function ur(e) {
|
|
|
451
451
|
};
|
|
452
452
|
return s(Ue.Provider, { value: t, children: e.children });
|
|
453
453
|
}
|
|
454
|
-
return s(
|
|
454
|
+
return s(ur, { initialProps: e.initialProps, children: e.children });
|
|
455
455
|
}
|
|
456
|
-
function
|
|
456
|
+
function ur(e) {
|
|
457
457
|
var t = e.initialProps, n = e.children, r = t.selected, a = r || {}, o = a.from, i = a.to, l = t.min, d = t.max, u = function(m, y, _) {
|
|
458
458
|
var p, D;
|
|
459
459
|
(p = t.onDayClick) === null || p === void 0 || p.call(t, m, y, _);
|
|
460
|
-
var M =
|
|
460
|
+
var M = sr(m, r);
|
|
461
461
|
(D = t.onSelect) === null || D === void 0 || D.call(t, M, m, y, _);
|
|
462
462
|
}, c = {
|
|
463
463
|
range_start: [],
|
|
@@ -472,30 +472,30 @@ function cr(e) {
|
|
|
472
472
|
}
|
|
473
473
|
])) : c.range_end = [o]) : i && (c.range_start = [i], c.range_end = [i]), l && (o && !i && c.disabled.push({
|
|
474
474
|
after: Ce(o, l - 1),
|
|
475
|
-
before:
|
|
475
|
+
before: W(o, l - 1)
|
|
476
476
|
}), o && i && c.disabled.push({
|
|
477
477
|
after: o,
|
|
478
|
-
before:
|
|
478
|
+
before: W(o, l - 1)
|
|
479
479
|
}), !o && i && c.disabled.push({
|
|
480
480
|
after: Ce(i, l - 1),
|
|
481
|
-
before:
|
|
481
|
+
before: W(i, l - 1)
|
|
482
482
|
})), d) {
|
|
483
483
|
if (o && !i && (c.disabled.push({
|
|
484
|
-
before:
|
|
484
|
+
before: W(o, -d + 1)
|
|
485
485
|
}), c.disabled.push({
|
|
486
|
-
after:
|
|
486
|
+
after: W(o, d - 1)
|
|
487
487
|
})), o && i) {
|
|
488
|
-
var f =
|
|
488
|
+
var f = U(i, o) + 1, v = d - f;
|
|
489
489
|
c.disabled.push({
|
|
490
490
|
before: Ce(o, v)
|
|
491
491
|
}), c.disabled.push({
|
|
492
|
-
after:
|
|
492
|
+
after: W(i, v)
|
|
493
493
|
});
|
|
494
494
|
}
|
|
495
495
|
!o && i && (c.disabled.push({
|
|
496
|
-
before:
|
|
496
|
+
before: W(i, -d + 1)
|
|
497
497
|
}), c.disabled.push({
|
|
498
|
-
after:
|
|
498
|
+
after: W(i, d - 1)
|
|
499
499
|
}));
|
|
500
500
|
}
|
|
501
501
|
return s(Ue.Provider, { value: { selected: r, onDayClick: u, modifiers: c }, children: n });
|
|
@@ -506,28 +506,28 @@ function Xe() {
|
|
|
506
506
|
throw new Error("useSelectRange must be used within a SelectRangeProvider");
|
|
507
507
|
return e;
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function be(e) {
|
|
510
510
|
return Array.isArray(e) ? wt([], e) : e !== void 0 ? [e] : [];
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function cr(e) {
|
|
513
513
|
var t = {};
|
|
514
514
|
return Object.entries(e).forEach(function(n) {
|
|
515
515
|
var r = n[0], a = n[1];
|
|
516
|
-
t[r] =
|
|
516
|
+
t[r] = be(a);
|
|
517
517
|
}), t;
|
|
518
518
|
}
|
|
519
|
-
var
|
|
519
|
+
var H;
|
|
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
|
|
524
|
-
function
|
|
525
|
-
var r, a = (r = {}, r[
|
|
526
|
-
return e.fromDate && a[
|
|
522
|
+
})(H || (H = {}));
|
|
523
|
+
var fr = H.Selected, K = H.Disabled, vr = H.Hidden, mr = H.Today, xe = H.RangeEnd, Oe = H.RangeMiddle, Ie = H.RangeStart, hr = H.Outside;
|
|
524
|
+
function pr(e, t, n) {
|
|
525
|
+
var r, a = (r = {}, r[fr] = be(e.selected), r[K] = be(e.disabled), r[vr] = be(e.hidden), r[mr] = [e.today], r[xe] = [], r[Oe] = [], r[Ie] = [], r[hr] = [], r);
|
|
526
|
+
return e.fromDate && a[K].push({ before: e.fromDate }), e.toDate && a[K].push({ after: e.toDate }), de(e) ? a[K] = a[K].concat(t.modifiers[K]) : ue(e) && (a[K] = a[K].concat(n.modifiers[K]), a[Ie] = n.modifiers[Ie], a[Oe] = n.modifiers[Oe], a[xe] = n.modifiers[xe]), a;
|
|
527
527
|
}
|
|
528
528
|
var Ct = ne(void 0);
|
|
529
|
-
function
|
|
530
|
-
var t = k(), n = Ke(), r = Xe(), a =
|
|
529
|
+
function yr(e) {
|
|
530
|
+
var t = k(), n = Ke(), r = Xe(), a = pr(t, n, r), o = cr(t.modifiers), i = g(g({}, a), o);
|
|
531
531
|
return s(Ct.Provider, { value: i, children: e.children });
|
|
532
532
|
}
|
|
533
533
|
function Pt() {
|
|
@@ -536,85 +536,85 @@ function Pt() {
|
|
|
536
536
|
throw new Error("useModifiers must be used within a ModifiersProvider");
|
|
537
537
|
return e;
|
|
538
538
|
}
|
|
539
|
-
function
|
|
539
|
+
function br(e) {
|
|
540
540
|
return !!(e && typeof e == "object" && "before" in e && "after" in e);
|
|
541
541
|
}
|
|
542
|
-
function
|
|
542
|
+
function gr(e) {
|
|
543
543
|
return !!(e && typeof e == "object" && "from" in e);
|
|
544
544
|
}
|
|
545
|
-
function
|
|
545
|
+
function _r(e) {
|
|
546
546
|
return !!(e && typeof e == "object" && "after" in e);
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function wr(e) {
|
|
549
549
|
return !!(e && typeof e == "object" && "before" in e);
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function Dr(e) {
|
|
552
552
|
return !!(e && typeof e == "object" && "dayOfWeek" in e);
|
|
553
553
|
}
|
|
554
|
-
function
|
|
554
|
+
function Mr(e, t) {
|
|
555
555
|
var n, r = t.from, a = t.to;
|
|
556
556
|
if (r && a) {
|
|
557
|
-
var o =
|
|
557
|
+
var o = U(a, r) < 0;
|
|
558
558
|
o && (n = [a, r], r = n[0], a = n[1]);
|
|
559
|
-
var i =
|
|
559
|
+
var i = U(e, r) >= 0 && U(a, e) >= 0;
|
|
560
560
|
return i;
|
|
561
561
|
}
|
|
562
562
|
return a ? N(a, e) : r ? N(r, e) : !1;
|
|
563
563
|
}
|
|
564
|
-
function
|
|
564
|
+
function kr(e) {
|
|
565
565
|
return yt(e);
|
|
566
566
|
}
|
|
567
|
-
function
|
|
567
|
+
function Nr(e) {
|
|
568
568
|
return Array.isArray(e) && e.every(yt);
|
|
569
569
|
}
|
|
570
|
-
function
|
|
570
|
+
function Cr(e, t) {
|
|
571
571
|
return t.some(function(n) {
|
|
572
572
|
if (typeof n == "boolean")
|
|
573
573
|
return n;
|
|
574
|
-
if (
|
|
574
|
+
if (kr(n))
|
|
575
575
|
return N(e, n);
|
|
576
|
-
if (
|
|
576
|
+
if (Nr(n))
|
|
577
577
|
return n.includes(e);
|
|
578
|
-
if (
|
|
579
|
-
return
|
|
580
|
-
if (
|
|
578
|
+
if (gr(n))
|
|
579
|
+
return Mr(e, n);
|
|
580
|
+
if (Dr(n))
|
|
581
581
|
return n.dayOfWeek.includes(e.getDay());
|
|
582
|
-
if (
|
|
583
|
-
var r =
|
|
582
|
+
if (br(n)) {
|
|
583
|
+
var r = U(n.before, e), a = U(n.after, e), o = r > 0, i = a < 0, l = ge(n.before, n.after);
|
|
584
584
|
return l ? i && o : o || i;
|
|
585
585
|
}
|
|
586
|
-
return
|
|
586
|
+
return _r(n) ? U(e, n.after) > 0 : wr(n) ? U(n.before, e) > 0 : typeof n == "function" ? n(e) : !1;
|
|
587
587
|
});
|
|
588
588
|
}
|
|
589
589
|
function Ze(e, t, n) {
|
|
590
590
|
var r = Object.keys(t).reduce(function(o, i) {
|
|
591
591
|
var l = t[i];
|
|
592
|
-
return
|
|
592
|
+
return Cr(e, l) && o.push(i), o;
|
|
593
593
|
}, []), a = {};
|
|
594
594
|
return r.forEach(function(o) {
|
|
595
595
|
return a[o] = !0;
|
|
596
596
|
}), n && !Ae(e, n) && (a.outside = !0), a;
|
|
597
597
|
}
|
|
598
|
-
function
|
|
599
|
-
for (var n =
|
|
598
|
+
function Pr(e, t) {
|
|
599
|
+
for (var n = S(e[0]), r = Fe(e[e.length - 1]), a, o, i = n; i <= r; ) {
|
|
600
600
|
var l = Ze(i, t), d = !l.disabled && !l.hidden;
|
|
601
601
|
if (!d) {
|
|
602
|
-
i =
|
|
602
|
+
i = W(i, 1);
|
|
603
603
|
continue;
|
|
604
604
|
}
|
|
605
605
|
if (l.selected)
|
|
606
606
|
return i;
|
|
607
|
-
l.today && !o && (o = i), a || (a = i), i =
|
|
607
|
+
l.today && !o && (o = i), a || (a = i), i = W(i, 1);
|
|
608
608
|
}
|
|
609
609
|
return o || a;
|
|
610
610
|
}
|
|
611
|
-
var
|
|
611
|
+
var xr = 365;
|
|
612
612
|
function xt(e, t) {
|
|
613
613
|
var n = t.moveBy, r = t.direction, a = t.context, o = t.modifiers, i = t.retry, l = i === void 0 ? { count: 0, lastFocused: e } : i, d = a.weekStartsOn, u = a.fromDate, c = a.toDate, f = a.locale, v = {
|
|
614
|
-
day:
|
|
614
|
+
day: W,
|
|
615
615
|
week: Ee,
|
|
616
|
-
month:
|
|
617
|
-
year:
|
|
616
|
+
month: j,
|
|
617
|
+
year: tn,
|
|
618
618
|
startOfWeek: function(p) {
|
|
619
619
|
return a.ISOWeek ? Ye(p) : je(p, { locale: f, weekStartsOn: d });
|
|
620
620
|
},
|
|
@@ -622,13 +622,13 @@ function xt(e, t) {
|
|
|
622
622
|
return a.ISOWeek ? ht(p) : pt(p, { locale: f, weekStartsOn: d });
|
|
623
623
|
}
|
|
624
624
|
}, m = v[n](e, r === "after" ? 1 : -1);
|
|
625
|
-
r === "before" && u ? m =
|
|
625
|
+
r === "before" && u ? m = Jt([u, m]) : r === "after" && c && (m = Qt([c, m]));
|
|
626
626
|
var y = !0;
|
|
627
627
|
if (o) {
|
|
628
628
|
var _ = Ze(m, o);
|
|
629
629
|
y = !_.disabled && !_.hidden;
|
|
630
630
|
}
|
|
631
|
-
return y ? m : l.count >
|
|
631
|
+
return y ? m : l.count > xr ? l.lastFocused : xt(m, {
|
|
632
632
|
moveBy: n,
|
|
633
633
|
direction: r,
|
|
634
634
|
context: a,
|
|
@@ -636,9 +636,9 @@ function xt(e, t) {
|
|
|
636
636
|
retry: g(g({}, l), { count: l.count + 1 })
|
|
637
637
|
});
|
|
638
638
|
}
|
|
639
|
-
var
|
|
639
|
+
var Ot = ne(void 0);
|
|
640
640
|
function Or(e) {
|
|
641
|
-
var t =
|
|
641
|
+
var t = ce(), n = Pt(), r = B(), a = r[0], o = r[1], i = B(), l = i[0], d = i[1], u = Pr(t.displayMonths, n), c = a ?? (l && t.isDateDisplayed(l)) ? l : u, f = function() {
|
|
642
642
|
d(a), o(void 0);
|
|
643
643
|
}, v = function(p) {
|
|
644
644
|
o(p);
|
|
@@ -688,29 +688,29 @@ function Or(e) {
|
|
|
688
688
|
return y("endOfWeek", "after");
|
|
689
689
|
}
|
|
690
690
|
};
|
|
691
|
-
return s(
|
|
691
|
+
return s(Ot.Provider, { value: _, children: e.children });
|
|
692
692
|
}
|
|
693
693
|
function Ge() {
|
|
694
|
-
var e = re(
|
|
694
|
+
var e = re(Ot);
|
|
695
695
|
if (!e)
|
|
696
696
|
throw new Error("useFocusContext must be used within a FocusProvider");
|
|
697
697
|
return e;
|
|
698
698
|
}
|
|
699
|
-
function
|
|
699
|
+
function Ir(e, t) {
|
|
700
700
|
var n = Pt(), r = Ze(e, n, t);
|
|
701
701
|
return r;
|
|
702
702
|
}
|
|
703
703
|
var $e = ne(void 0);
|
|
704
|
-
function
|
|
705
|
-
if (!
|
|
704
|
+
function Wr(e) {
|
|
705
|
+
if (!we(e.initialProps)) {
|
|
706
706
|
var t = {
|
|
707
707
|
selected: void 0
|
|
708
708
|
};
|
|
709
709
|
return s($e.Provider, { value: t, children: e.children });
|
|
710
710
|
}
|
|
711
|
-
return s(
|
|
711
|
+
return s(Sr, { initialProps: e.initialProps, children: e.children });
|
|
712
712
|
}
|
|
713
|
-
function
|
|
713
|
+
function Sr(e) {
|
|
714
714
|
var t = e.initialProps, n = e.children, r = function(o, i, l) {
|
|
715
715
|
var d, u, c;
|
|
716
716
|
if ((d = t.onDayClick) === null || d === void 0 || d.call(t, o, i, l), i.selected && !t.required) {
|
|
@@ -724,50 +724,50 @@ function Lr(e) {
|
|
|
724
724
|
};
|
|
725
725
|
return s($e.Provider, { value: a, children: n });
|
|
726
726
|
}
|
|
727
|
-
function
|
|
727
|
+
function It() {
|
|
728
728
|
var e = re($e);
|
|
729
729
|
if (!e)
|
|
730
730
|
throw new Error("useSelectSingle must be used within a SelectSingleProvider");
|
|
731
731
|
return e;
|
|
732
732
|
}
|
|
733
|
-
function
|
|
734
|
-
var n = k(), r =
|
|
735
|
-
var h,
|
|
736
|
-
|
|
737
|
-
},
|
|
733
|
+
function Lr(e, t) {
|
|
734
|
+
var n = k(), r = It(), a = Ke(), o = Xe(), i = Ge(), l = i.focusDayAfter, d = i.focusDayBefore, u = i.focusWeekAfter, c = i.focusWeekBefore, f = i.blur, v = i.focus, m = i.focusMonthBefore, y = i.focusMonthAfter, _ = i.focusYearBefore, p = i.focusYearAfter, D = i.focusStartOfWeek, M = i.focusEndOfWeek, I = function(b) {
|
|
735
|
+
var h, $, T, te;
|
|
736
|
+
we(n) ? (h = r.onDayClick) === null || h === void 0 || h.call(r, e, t, b) : de(n) ? ($ = a.onDayClick) === null || $ === void 0 || $.call(a, e, t, b) : ue(n) ? (T = o.onDayClick) === null || T === void 0 || T.call(o, e, t, b) : (te = n.onDayClick) === null || te === void 0 || te.call(n, e, t, b);
|
|
737
|
+
}, E = function(b) {
|
|
738
738
|
var h;
|
|
739
739
|
v(e), (h = n.onDayFocus) === null || h === void 0 || h.call(n, e, t, b);
|
|
740
|
-
},
|
|
740
|
+
}, X = function(b) {
|
|
741
741
|
var h;
|
|
742
742
|
f(), (h = n.onDayBlur) === null || h === void 0 || h.call(n, e, t, b);
|
|
743
|
-
},
|
|
743
|
+
}, x = function(b) {
|
|
744
744
|
var h;
|
|
745
745
|
(h = n.onDayMouseEnter) === null || h === void 0 || h.call(n, e, t, b);
|
|
746
746
|
}, C = function(b) {
|
|
747
747
|
var h;
|
|
748
748
|
(h = n.onDayMouseLeave) === null || h === void 0 || h.call(n, e, t, b);
|
|
749
|
-
},
|
|
749
|
+
}, Y = function(b) {
|
|
750
750
|
var h;
|
|
751
751
|
(h = n.onDayPointerEnter) === null || h === void 0 || h.call(n, e, t, b);
|
|
752
|
-
},
|
|
752
|
+
}, Z = function(b) {
|
|
753
753
|
var h;
|
|
754
754
|
(h = n.onDayPointerLeave) === null || h === void 0 || h.call(n, e, t, b);
|
|
755
|
-
},
|
|
755
|
+
}, Me = function(b) {
|
|
756
756
|
var h;
|
|
757
757
|
(h = n.onDayTouchCancel) === null || h === void 0 || h.call(n, e, t, b);
|
|
758
|
-
},
|
|
758
|
+
}, ke = function(b) {
|
|
759
759
|
var h;
|
|
760
760
|
(h = n.onDayTouchEnd) === null || h === void 0 || h.call(n, e, t, b);
|
|
761
|
-
},
|
|
761
|
+
}, fe = function(b) {
|
|
762
762
|
var h;
|
|
763
763
|
(h = n.onDayTouchMove) === null || h === void 0 || h.call(n, e, t, b);
|
|
764
|
-
},
|
|
764
|
+
}, G = function(b) {
|
|
765
765
|
var h;
|
|
766
766
|
(h = n.onDayTouchStart) === null || h === void 0 || h.call(n, e, t, b);
|
|
767
|
-
},
|
|
767
|
+
}, ee = function(b) {
|
|
768
768
|
var h;
|
|
769
769
|
(h = n.onDayKeyUp) === null || h === void 0 || h.call(n, e, t, b);
|
|
770
|
-
},
|
|
770
|
+
}, Ne = function(b) {
|
|
771
771
|
var h;
|
|
772
772
|
switch (b.key) {
|
|
773
773
|
case "ArrowLeft":
|
|
@@ -797,53 +797,53 @@ function Er(e, t) {
|
|
|
797
797
|
}
|
|
798
798
|
(h = n.onDayKeyDown) === null || h === void 0 || h.call(n, e, t, b);
|
|
799
799
|
}, ae = {
|
|
800
|
-
onClick:
|
|
801
|
-
onFocus:
|
|
802
|
-
onBlur:
|
|
803
|
-
onKeyDown:
|
|
804
|
-
onKeyUp:
|
|
805
|
-
onMouseEnter:
|
|
800
|
+
onClick: I,
|
|
801
|
+
onFocus: E,
|
|
802
|
+
onBlur: X,
|
|
803
|
+
onKeyDown: Ne,
|
|
804
|
+
onKeyUp: ee,
|
|
805
|
+
onMouseEnter: x,
|
|
806
806
|
onMouseLeave: C,
|
|
807
|
-
onPointerEnter:
|
|
808
|
-
onPointerLeave:
|
|
809
|
-
onTouchCancel:
|
|
810
|
-
onTouchEnd:
|
|
811
|
-
onTouchMove:
|
|
812
|
-
onTouchStart:
|
|
807
|
+
onPointerEnter: Y,
|
|
808
|
+
onPointerLeave: Z,
|
|
809
|
+
onTouchCancel: Me,
|
|
810
|
+
onTouchEnd: ke,
|
|
811
|
+
onTouchMove: fe,
|
|
812
|
+
onTouchStart: G
|
|
813
813
|
};
|
|
814
814
|
return ae;
|
|
815
815
|
}
|
|
816
|
-
function
|
|
817
|
-
var e = k(), t =
|
|
816
|
+
function Er() {
|
|
817
|
+
var e = k(), t = It(), n = Ke(), r = Xe(), a = we(e) ? t.selected : de(e) ? n.selected : ue(e) ? r.selected : void 0;
|
|
818
818
|
return a;
|
|
819
819
|
}
|
|
820
|
-
function
|
|
821
|
-
return Object.values(
|
|
820
|
+
function Rr(e) {
|
|
821
|
+
return Object.values(H).includes(e);
|
|
822
822
|
}
|
|
823
|
-
function
|
|
823
|
+
function Br(e, t) {
|
|
824
824
|
var n = [e.classNames.day];
|
|
825
825
|
return Object.keys(t).forEach(function(r) {
|
|
826
826
|
var a = e.modifiersClassNames[r];
|
|
827
827
|
if (a)
|
|
828
828
|
n.push(a);
|
|
829
|
-
else if (
|
|
829
|
+
else if (Rr(r)) {
|
|
830
830
|
var o = e.classNames["day_".concat(r)];
|
|
831
831
|
o && n.push(o);
|
|
832
832
|
}
|
|
833
833
|
}), n;
|
|
834
834
|
}
|
|
835
|
-
function
|
|
835
|
+
function Tr(e, t) {
|
|
836
836
|
var n = g({}, e.styles.day);
|
|
837
837
|
return Object.keys(t).forEach(function(r) {
|
|
838
838
|
var a;
|
|
839
839
|
n = g(g({}, n), (a = e.modifiersStyles) === null || a === void 0 ? void 0 : a[r]);
|
|
840
840
|
}), n;
|
|
841
841
|
}
|
|
842
|
-
function
|
|
843
|
-
var r, a, o, i = k(), l = Ge(), d =
|
|
844
|
-
|
|
845
|
-
var
|
|
846
|
-
d.outside || l.focusedDay && f && N(l.focusedDay, e) && ((
|
|
842
|
+
function Fr(e, t, n) {
|
|
843
|
+
var r, a, o, i = k(), l = Ge(), d = Ir(e, t), u = Lr(e, d), c = Er(), f = !!(i.onDayClick || i.mode !== "default");
|
|
844
|
+
z(function() {
|
|
845
|
+
var x;
|
|
846
|
+
d.outside || l.focusedDay && f && N(l.focusedDay, e) && ((x = n.current) === null || x === void 0 || x.focus());
|
|
847
847
|
}, [
|
|
848
848
|
l.focusedDay,
|
|
849
849
|
e,
|
|
@@ -851,45 +851,45 @@ function Ar(e, t, n) {
|
|
|
851
851
|
f,
|
|
852
852
|
d.outside
|
|
853
853
|
]);
|
|
854
|
-
var v =
|
|
854
|
+
var v = Br(i, d).join(" "), m = Tr(i, d), y = !!(d.outside && !i.showOutsideDays || d.hidden), _ = (o = (a = i.components) === null || a === void 0 ? void 0 : a.DayContent) !== null && o !== void 0 ? o : or, p = s(_, { date: e, displayMonth: t, activeModifiers: d }), D = {
|
|
855
855
|
style: m,
|
|
856
856
|
className: v,
|
|
857
857
|
children: p,
|
|
858
858
|
role: "gridcell"
|
|
859
|
-
}, M = l.focusTarget && N(l.focusTarget, e) && !d.outside,
|
|
859
|
+
}, M = l.focusTarget && N(l.focusTarget, e) && !d.outside, I = l.focusedDay && N(l.focusedDay, e), E = g(g(g({}, D), (r = { disabled: d.disabled, role: "gridcell" }, r["aria-selected"] = d.selected, r.tabIndex = I || M ? 0 : -1, r)), u), X = {
|
|
860
860
|
isButton: f,
|
|
861
861
|
isHidden: y,
|
|
862
862
|
activeModifiers: d,
|
|
863
863
|
selectedDays: c,
|
|
864
|
-
buttonProps:
|
|
864
|
+
buttonProps: E,
|
|
865
865
|
divProps: D
|
|
866
866
|
};
|
|
867
|
-
return
|
|
867
|
+
return X;
|
|
868
868
|
}
|
|
869
|
-
function
|
|
870
|
-
var t = oe(null), n =
|
|
871
|
-
return n.isHidden ? s("div", { role: "gridcell" }) : n.isButton ? s(
|
|
869
|
+
function Ar(e) {
|
|
870
|
+
var t = oe(null), n = Fr(e.date, e.displayMonth, t);
|
|
871
|
+
return n.isHidden ? s("div", { role: "gridcell" }) : n.isButton ? s(_e, g({ name: "day", ref: t }, n.buttonProps)) : s("div", g({}, n.divProps));
|
|
872
872
|
}
|
|
873
|
-
function
|
|
873
|
+
function Hr(e) {
|
|
874
874
|
var t = e.number, n = e.dates, r = k(), a = r.onWeekNumberClick, o = r.styles, i = r.classNames, l = r.locale, d = r.labels.labelWeekNumber, u = r.formatters.formatWeekNumber, c = u(Number(t), { locale: l });
|
|
875
875
|
if (!a)
|
|
876
876
|
return s("span", { className: i.weeknumber, style: o.weeknumber, children: c });
|
|
877
877
|
var f = d(Number(t), { locale: l }), v = function(m) {
|
|
878
878
|
a(t, n, m);
|
|
879
879
|
};
|
|
880
|
-
return s(
|
|
880
|
+
return s(_e, { name: "week-number", "aria-label": f, className: i.weeknumber, style: o.weeknumber, onClick: v, children: c });
|
|
881
881
|
}
|
|
882
|
-
function
|
|
883
|
-
var t, n, r = k(), a = r.styles, o = r.classNames, i = r.showWeekNumber, l = r.components, d = (t = l == null ? void 0 : l.Day) !== null && t !== void 0 ? t :
|
|
884
|
-
return i && (c = s("td", { className: o.cell, style: a.cell, children: s(u, { number: e.weekNumber, dates: e.dates }) })),
|
|
885
|
-
return s("td", { className: o.cell, style: a.cell, role: "presentation", children: s(d, { displayMonth: e.displayMonth, date: f }) },
|
|
882
|
+
function Yr(e) {
|
|
883
|
+
var t, n, r = k(), a = r.styles, o = r.classNames, i = r.showWeekNumber, l = r.components, d = (t = l == null ? void 0 : l.Day) !== null && t !== void 0 ? t : Ar, u = (n = l == null ? void 0 : l.WeekNumber) !== null && n !== void 0 ? n : Hr, c;
|
|
884
|
+
return i && (c = s("td", { className: o.cell, style: a.cell, children: s(u, { number: e.weekNumber, dates: e.dates }) })), L("tr", { className: o.row, style: a.row, children: [c, e.dates.map(function(f) {
|
|
885
|
+
return s("td", { className: o.cell, style: a.cell, role: "presentation", children: s(d, { displayMonth: e.displayMonth, date: f }) }, Zt(f));
|
|
886
886
|
})] });
|
|
887
887
|
}
|
|
888
888
|
function ut(e, t, n) {
|
|
889
|
-
for (var r = n != null && n.ISOWeek ? ht(t) : pt(t, n), a = n != null && n.ISOWeek ? Ye(e) : je(e, n), o =
|
|
890
|
-
i.push(
|
|
889
|
+
for (var r = n != null && n.ISOWeek ? ht(t) : pt(t, n), a = n != null && n.ISOWeek ? Ye(e) : je(e, n), o = U(r, a), i = [], l = 0; l <= o; l++)
|
|
890
|
+
i.push(W(a, l));
|
|
891
891
|
var d = i.reduce(function(u, c) {
|
|
892
|
-
var f = n != null && n.ISOWeek ?
|
|
892
|
+
var f = n != null && n.ISOWeek ? zt(c) : en(c, n), v = u.find(function(m) {
|
|
893
893
|
return m.weekNumber === f;
|
|
894
894
|
});
|
|
895
895
|
return v ? (v.dates.push(c), u) : (u.push({
|
|
@@ -899,10 +899,10 @@ function ut(e, t, n) {
|
|
|
899
899
|
}, []);
|
|
900
900
|
return d;
|
|
901
901
|
}
|
|
902
|
-
function
|
|
903
|
-
var n = ut(
|
|
902
|
+
function jr(e, t) {
|
|
903
|
+
var n = ut(S(e), Fe(e), t);
|
|
904
904
|
if (t != null && t.useFixedWeeks) {
|
|
905
|
-
var r =
|
|
905
|
+
var r = Gt(e, t);
|
|
906
906
|
if (r < 6) {
|
|
907
907
|
var a = n[n.length - 1], o = a.dates[a.dates.length - 1], i = Ee(o, 6 - r), l = ut(Ee(o, 1), i, t);
|
|
908
908
|
n.push.apply(n, l);
|
|
@@ -910,46 +910,46 @@ function Vr(e, t) {
|
|
|
910
910
|
}
|
|
911
911
|
return n;
|
|
912
912
|
}
|
|
913
|
-
function
|
|
914
|
-
var t, n, r, a = k(), o = a.locale, i = a.classNames, l = a.styles, d = a.hideHead, u = a.fixedWeeks, c = a.components, f = a.weekStartsOn, v = a.firstWeekContainsDate, m = a.ISOWeek, y =
|
|
913
|
+
function Vr(e) {
|
|
914
|
+
var t, n, r, a = k(), o = a.locale, i = a.classNames, l = a.styles, d = a.hideHead, u = a.fixedWeeks, c = a.components, f = a.weekStartsOn, v = a.firstWeekContainsDate, m = a.ISOWeek, y = jr(e.displayMonth, {
|
|
915
915
|
useFixedWeeks: !!u,
|
|
916
916
|
ISOWeek: m,
|
|
917
917
|
locale: o,
|
|
918
918
|
weekStartsOn: f,
|
|
919
919
|
firstWeekContainsDate: v
|
|
920
|
-
}), _ = (t = c == null ? void 0 : c.Head) !== null && t !== void 0 ? t :
|
|
921
|
-
return
|
|
920
|
+
}), _ = (t = c == null ? void 0 : c.Head) !== null && t !== void 0 ? t : ar, p = (n = c == null ? void 0 : c.Row) !== null && n !== void 0 ? n : Yr, D = (r = c == null ? void 0 : c.Footer) !== null && r !== void 0 ? r : tr;
|
|
921
|
+
return L("table", { id: e.id, className: i.table, style: l.table, role: "grid", "aria-labelledby": e["aria-labelledby"], children: [!d && s(_, {}), s("tbody", { className: i.tbody, style: l.tbody, children: y.map(function(M) {
|
|
922
922
|
return s(p, { displayMonth: e.displayMonth, dates: M.dates, weekNumber: M.weekNumber }, M.weekNumber);
|
|
923
923
|
}) }), s(D, { displayMonth: e.displayMonth })] });
|
|
924
924
|
}
|
|
925
|
-
function
|
|
925
|
+
function Kr() {
|
|
926
926
|
return !!(typeof window < "u" && window.document && window.document.createElement);
|
|
927
927
|
}
|
|
928
|
-
var
|
|
928
|
+
var Ur = Kr() ? Xt : z, We = !1, Xr = 0;
|
|
929
929
|
function ct() {
|
|
930
|
-
return "react-day-picker-".concat(++
|
|
930
|
+
return "react-day-picker-".concat(++Xr);
|
|
931
931
|
}
|
|
932
|
-
function
|
|
933
|
-
var t, n = e ?? (We ? ct() : null), r =
|
|
934
|
-
return
|
|
932
|
+
function Zr(e) {
|
|
933
|
+
var t, n = e ?? (We ? ct() : null), r = B(n), a = r[0], o = r[1];
|
|
934
|
+
return Ur(function() {
|
|
935
935
|
a === null && o(ct());
|
|
936
|
-
}, []),
|
|
936
|
+
}, []), z(function() {
|
|
937
937
|
We === !1 && (We = !0);
|
|
938
938
|
}, []), (t = e ?? a) !== null && t !== void 0 ? t : void 0;
|
|
939
939
|
}
|
|
940
|
-
function
|
|
941
|
-
var t, n, r = k(), a = r.dir, o = r.classNames, i = r.styles, l = r.components, d =
|
|
940
|
+
function Gr(e) {
|
|
941
|
+
var t, n, r = k(), a = r.dir, o = r.classNames, i = r.styles, l = r.components, d = ce().displayMonths, u = Zr(r.id ? "".concat(r.id, "-").concat(e.displayIndex) : void 0), c = r.id ? "".concat(r.id, "-grid-").concat(e.displayIndex) : void 0, f = [o.month], v = i.month, m = e.displayIndex === 0, y = e.displayIndex === d.length - 1, _ = !m && !y;
|
|
942
942
|
a === "rtl" && (t = [m, y], y = t[0], m = t[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));
|
|
943
|
-
var p = (n = l == null ? void 0 : l.Caption) !== null && n !== void 0 ? n :
|
|
944
|
-
return
|
|
943
|
+
var p = (n = l == null ? void 0 : l.Caption) !== null && n !== void 0 ? n : er;
|
|
944
|
+
return L("div", { className: f.join(" "), style: v, children: [s(p, { id: u, displayMonth: e.displayMonth, displayIndex: e.displayIndex }), s(Vr, { id: c, "aria-labelledby": u, displayMonth: e.displayMonth })] }, e.displayIndex);
|
|
945
945
|
}
|
|
946
|
-
function
|
|
946
|
+
function $r(e) {
|
|
947
947
|
var t = k(), n = t.classNames, r = t.styles;
|
|
948
948
|
return s("div", { className: n.months, style: r.months, children: e.children });
|
|
949
949
|
}
|
|
950
|
-
function
|
|
951
|
-
var t, n, r = e.initialProps, a = k(), o = Ge(), i =
|
|
952
|
-
|
|
950
|
+
function qr(e) {
|
|
951
|
+
var t, n, r = e.initialProps, a = k(), o = Ge(), i = ce(), l = B(!1), d = l[0], u = l[1];
|
|
952
|
+
z(function() {
|
|
953
953
|
a.initialFocus && o.focusTarget && (d || (o.focus(o.focusTarget), u(!0)));
|
|
954
954
|
}, [
|
|
955
955
|
a.initialFocus,
|
|
@@ -965,80 +965,80 @@ function Jr(e) {
|
|
|
965
965
|
}).reduce(function(y, _) {
|
|
966
966
|
var p;
|
|
967
967
|
return g(g({}, y), (p = {}, p[_] = r[_], p));
|
|
968
|
-
}, {}), m = (n = (t = r.components) === null || t === void 0 ? void 0 : t.Months) !== null && n !== void 0 ? n :
|
|
968
|
+
}, {}), m = (n = (t = r.components) === null || t === void 0 ? void 0 : t.Months) !== null && n !== void 0 ? n : $r;
|
|
969
969
|
return s("div", g({ className: c.join(" "), style: f, dir: a.dir, id: a.id, nonce: r.nonce, title: r.title, lang: r.lang }, v, { children: s(m, { children: i.displayMonths.map(function(y, _) {
|
|
970
|
-
return s(
|
|
970
|
+
return s(Gr, { displayIndex: _, displayMonth: y }, _);
|
|
971
971
|
}) }) }));
|
|
972
972
|
}
|
|
973
|
-
function
|
|
974
|
-
var t = e.children, n =
|
|
975
|
-
return s(
|
|
973
|
+
function Jr(e) {
|
|
974
|
+
var t = e.children, n = wn(e, ["children"]);
|
|
975
|
+
return s(Hn, { initialProps: n, children: s(qn, { children: s(Wr, { initialProps: n, children: s(ir, { initialProps: n, children: s(dr, { initialProps: n, children: s(yr, { children: s(Or, { children: t }) }) }) }) }) }) });
|
|
976
976
|
}
|
|
977
|
-
function
|
|
978
|
-
return s(
|
|
977
|
+
function Qr(e) {
|
|
978
|
+
return s(Jr, g({}, e, { children: s(qr, { initialProps: e }) }));
|
|
979
979
|
}
|
|
980
|
-
const
|
|
981
|
-
const r =
|
|
982
|
-
return r === "left" ? a ===
|
|
983
|
-
},
|
|
984
|
-
const r =
|
|
980
|
+
const zr = 329, Q = 12, De = 26, Wt = 20, Te = 9, ft = 12, St = (e, t, n) => n !== F.positionautomatic && n !== void 0 ? n : e.top > t.height + De ? F.positionabove : F.positionbelow, ea = (e) => e.left + e.width / 4, ta = (e) => document.documentElement.clientWidth - e.right + e.width / 4, na = (e, t) => e.left + t.width, ra = (e) => e.left > Q, aa = (e, t) => na(e, t) < document.documentElement.clientWidth - Q, oa = (e, t) => aa(e, t) ? ra(e) ? "floating" : "left" : "right", Se = (e, t) => e.top - De - t.height, Le = (e) => e.bottom + De, ia = () => document.documentElement.clientWidth - Q * 2, la = () => document.documentElement.clientWidth > zr + Q * 2, vt = (e) => e.top - De - Te + 5, sa = (e) => ea(e) - Wt / 2, da = (e) => ta(e) - Wt / 2, ua = (e, t, n) => {
|
|
981
|
+
const r = oa(e, t), a = St(e, t, n);
|
|
982
|
+
return r === "left" ? a === F.positionabove ? "leftabove" : "leftbelow" : r === "right" ? a === F.positionabove ? "rightabove" : "rightbelow" : a === F.positionabove ? "floatingabove" : "floatingbelow";
|
|
983
|
+
}, ca = (e, t, n) => {
|
|
984
|
+
const r = ua(e, t, n), a = la() ? void 0 : ia();
|
|
985
985
|
return r === "leftabove" ? {
|
|
986
|
-
left:
|
|
986
|
+
left: Q,
|
|
987
987
|
top: Se(e, t),
|
|
988
988
|
width: a
|
|
989
|
-
} : r === "leftbelow" ? { left:
|
|
990
|
-
}, mt = (e, t) =>
|
|
991
|
-
const r =
|
|
992
|
-
return e.right ? n ===
|
|
989
|
+
} : r === "leftbelow" ? { left: Q, top: Le(e), width: a } : r === "rightabove" ? { right: Q, top: Se(e, t), width: a } : r === "rightbelow" ? { right: Q, top: Le(e), width: a } : r === "floatingbelow" ? { left: mt(e, t), top: Le(e), width: a } : { left: mt(e, t), top: Se(e, t), width: a };
|
|
990
|
+
}, mt = (e, t) => fa(e) - t.width / 2, fa = (e) => e.left + e.width / 2, va = (e, t, n) => {
|
|
991
|
+
const r = sa(t), a = da(t), o = e.left + ft, i = e.right + ft;
|
|
992
|
+
return e.right ? n === F.positionabove ? {
|
|
993
993
|
right: a > i ? a : i,
|
|
994
994
|
top: vt(t)
|
|
995
995
|
} : {
|
|
996
996
|
right: a > i ? a : i,
|
|
997
997
|
top: t.bottom + Te
|
|
998
|
-
} : n ===
|
|
998
|
+
} : n === F.positionabove ? {
|
|
999
999
|
left: r > o ? r : o,
|
|
1000
1000
|
top: vt(t)
|
|
1001
1001
|
} : {
|
|
1002
1002
|
left: r > o ? r : o,
|
|
1003
1003
|
top: t.bottom + Te
|
|
1004
1004
|
};
|
|
1005
|
-
},
|
|
1006
|
-
const { datepickerWrapperRef: t, footer: n, inputRef: r, testId: a, variant: o, zIndex: i, ...l } = e, d = oe(null), [u, c] =
|
|
1007
|
-
|
|
1005
|
+
}, ma = (e) => {
|
|
1006
|
+
const { datepickerWrapperRef: t, footer: n, inputRef: r, testId: a, variant: o, zIndex: i, ...l } = e, d = oe(null), [u, c] = B(), f = yn(t), v = hn(r, 0);
|
|
1007
|
+
vn(t, !0);
|
|
1008
1008
|
const m = () => {
|
|
1009
|
-
var
|
|
1010
|
-
c((
|
|
1009
|
+
var E;
|
|
1010
|
+
c((E = r.current) == null ? void 0 : E.getBoundingClientRect());
|
|
1011
1011
|
};
|
|
1012
|
-
|
|
1012
|
+
J.useEffect(() => {
|
|
1013
1013
|
m();
|
|
1014
|
-
}, []),
|
|
1015
|
-
const y = Be(
|
|
1016
|
-
[
|
|
1017
|
-
}), _ = u && f && St(u, f, o), p = Be(
|
|
1018
|
-
[
|
|
1019
|
-
[
|
|
1020
|
-
[
|
|
1021
|
-
}), D = u && f &&
|
|
1022
|
-
...
|
|
1023
|
-
...
|
|
1014
|
+
}, []), mn(m, 500), pn(m, ["scroll", "resize"], 10);
|
|
1015
|
+
const y = Be(P["datepicker-popup-container"], {
|
|
1016
|
+
[P["datepicker-popup-container--visible"]]: v
|
|
1017
|
+
}), _ = u && f && St(u, f, o), p = Be(P["datepicker-popup-arrow"], {
|
|
1018
|
+
[P["datepicker-popup-arrow--visible"]]: v,
|
|
1019
|
+
[P["datepicker-popup-arrow--over"]]: _ === F.positionbelow,
|
|
1020
|
+
[P["datepicker-popup-arrow--under"]]: _ === F.positionabove
|
|
1021
|
+
}), D = u && f && ca(u, f, o), M = D && u && _ && va(D, u, _), I = {
|
|
1022
|
+
...fn,
|
|
1023
|
+
...P
|
|
1024
1024
|
};
|
|
1025
|
-
return /* @__PURE__ */
|
|
1025
|
+
return /* @__PURE__ */ L(A, { children: [
|
|
1026
1026
|
/* @__PURE__ */ s("div", { className: y, "data-testid": a, ref: t, style: { ...D, zIndex: i }, children: /* @__PURE__ */ s(
|
|
1027
|
-
|
|
1027
|
+
Qr,
|
|
1028
1028
|
{
|
|
1029
1029
|
captionLayout: "dropdown-buttons",
|
|
1030
|
-
classNames:
|
|
1030
|
+
classNames: I,
|
|
1031
1031
|
mode: "single",
|
|
1032
|
-
style: { "--rdp-cell-size":
|
|
1033
|
-
modifiersClassNames: { today:
|
|
1034
|
-
footer: /* @__PURE__ */ s("span", { className:
|
|
1032
|
+
style: { "--rdp-cell-size": bn("l") },
|
|
1033
|
+
modifiersClassNames: { today: P["day--today"], selected: P.day_selected, disabled: P["day--disabled"] },
|
|
1034
|
+
footer: /* @__PURE__ */ s("span", { className: P["footer-wrapper"], children: n }),
|
|
1035
1035
|
fixedWeeks: !0,
|
|
1036
1036
|
...l
|
|
1037
1037
|
}
|
|
1038
1038
|
) }),
|
|
1039
1039
|
/* @__PURE__ */ s("div", { ref: d, className: p, style: { ...M, zIndex: i } })
|
|
1040
1040
|
] });
|
|
1041
|
-
}, Lt =
|
|
1041
|
+
}, Lt = J.forwardRef((e, t) => {
|
|
1042
1042
|
const {
|
|
1043
1043
|
className: n,
|
|
1044
1044
|
dateButtonAriaLabel: r,
|
|
@@ -1056,72 +1056,75 @@ const ea = 329, J = 12, we = 26, Wt = 20, Te = 9, ft = 12, St = (e, t, n) => n !
|
|
|
1056
1056
|
footerContent: _,
|
|
1057
1057
|
label: p,
|
|
1058
1058
|
inputId: D,
|
|
1059
|
-
locale: M =
|
|
1060
|
-
maxDate:
|
|
1061
|
-
minDate:
|
|
1062
|
-
onBlur:
|
|
1063
|
-
onChange:
|
|
1059
|
+
locale: M = an,
|
|
1060
|
+
maxDate: I,
|
|
1061
|
+
minDate: E,
|
|
1062
|
+
onBlur: X,
|
|
1063
|
+
onChange: x,
|
|
1064
1064
|
onDatePopupClosed: C,
|
|
1065
|
-
testId:
|
|
1066
|
-
autoComplete:
|
|
1067
|
-
variant:
|
|
1068
|
-
zIndex:
|
|
1069
|
-
...
|
|
1070
|
-
} = e, [
|
|
1065
|
+
testId: Y,
|
|
1066
|
+
autoComplete: Z = "off",
|
|
1067
|
+
variant: Me = F.positionautomatic,
|
|
1068
|
+
zIndex: ke = dn.PopOver,
|
|
1069
|
+
...fe
|
|
1070
|
+
} = e, [G, ee] = B(o), [Ne, ae] = B(G ? O(G, a) : ""), [b, h] = B(i), [$, T] = B(!1), [te, qe] = B(!1), Bt = {
|
|
1071
1071
|
dayOfWeek: [0, 6]
|
|
1072
|
-
}, Tt = c ? [...u, Bt] : u, Je = oe(null),
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
}),
|
|
1078
|
-
|
|
1079
|
-
}, [o, a]), Q(() => {
|
|
1080
|
-
te && F.current && F.current.focus();
|
|
1072
|
+
}, Tt = c ? [...u, Bt] : u, Je = oe(null), ve = oe(null), me = oe(null), { refObject: R } = bt(gt(t) ? t : null), Qe = _t([t, R]), he = oe(!1);
|
|
1073
|
+
un(ve, (w) => {
|
|
1074
|
+
ve.current && me.current && !(w != null && w.composedPath().includes(ve.current)) && !(w != null && w.composedPath().includes(me.current)) && T(!1);
|
|
1075
|
+
}), z(() => {
|
|
1076
|
+
se(o) ? (ae(o ? O(o, a) : ""), ee(o), h(o)) : (ae(""), ee(void 0), h(void 0));
|
|
1077
|
+
}, [o, a]), z(() => {
|
|
1078
|
+
te && R.current && R.current.focus();
|
|
1081
1079
|
}, [te]);
|
|
1082
1080
|
const ze = () => {
|
|
1083
|
-
|
|
1081
|
+
R != null && R.current && R.current.focus(), T(!1);
|
|
1084
1082
|
};
|
|
1085
|
-
it(
|
|
1086
|
-
const et = (w,
|
|
1083
|
+
it(me, ze, [ot.Escape]), it(Je, ze, [ot.Escape]);
|
|
1084
|
+
const et = (w, V) => {
|
|
1087
1085
|
ae(w.currentTarget.value);
|
|
1088
|
-
const
|
|
1089
|
-
|
|
1086
|
+
const q = ie(w.currentTarget.value, V, /* @__PURE__ */ new Date());
|
|
1087
|
+
se(q) ? (ee(q), h(q)) : ee(void 0), x && x(w, w.currentTarget.value);
|
|
1090
1088
|
}, Ft = () => {
|
|
1091
|
-
te ? qe(!1) :
|
|
1092
|
-
}, At = (w,
|
|
1089
|
+
te ? qe(!1) : T(!0);
|
|
1090
|
+
}, At = (w, V, q, nt) => {
|
|
1093
1091
|
if (qe(!0), !w) {
|
|
1094
|
-
|
|
1092
|
+
T(!1);
|
|
1095
1093
|
return;
|
|
1096
1094
|
}
|
|
1097
|
-
|
|
1098
|
-
}, Ht = (w,
|
|
1095
|
+
ee(w), R.current && (ae(O(w, a)), T(!1)), x && x(nt, w), Ht(R, O(w, a), w), C && C(w);
|
|
1096
|
+
}, Ht = (w, V, q, nt) => {
|
|
1099
1097
|
if (w.current) {
|
|
1100
|
-
w.current.value =
|
|
1101
|
-
const
|
|
1102
|
-
|
|
1098
|
+
w.current.value = V;
|
|
1099
|
+
const pe = new Event("change", { bubbles: !0 });
|
|
1100
|
+
Object.defineProperty(pe, "target", {
|
|
1101
|
+
value: w.current,
|
|
1102
|
+
writable: !1,
|
|
1103
|
+
enumerable: !0,
|
|
1104
|
+
configurable: !0
|
|
1105
|
+
}), Object.defineProperty(pe, "currentTarget", {
|
|
1106
|
+
value: w.current,
|
|
1107
|
+
writable: !1,
|
|
1108
|
+
enumerable: !0,
|
|
1109
|
+
configurable: !0
|
|
1110
|
+
}), w.current.dispatchEvent(pe), x && x(pe, q);
|
|
1103
1111
|
}
|
|
1104
|
-
}, Yt = (w) => {
|
|
1105
|
-
var P;
|
|
1106
|
-
(P = ie.current) != null && P.contains(w.relatedTarget) || L(!1), tt(w);
|
|
1107
1112
|
}, tt = (w) => {
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
}, jt = (w) => {
|
|
1112
|
-
w == null || w.stopPropagation(), L(!ee);
|
|
1113
|
+
!$ && (typeof C > "u" || he.current) && X && X(w), he.current = !1;
|
|
1114
|
+
}, Yt = (w) => {
|
|
1115
|
+
w == null || w.stopPropagation(), T(!$);
|
|
1113
1116
|
};
|
|
1114
|
-
|
|
1115
|
-
const w = (
|
|
1116
|
-
["Escape", "Enter", "Tab"].includes(
|
|
1117
|
-
},
|
|
1118
|
-
return
|
|
1119
|
-
|
|
1117
|
+
z(() => {
|
|
1118
|
+
const w = (q) => {
|
|
1119
|
+
["Escape", "Enter", "Tab"].includes(q.key) || (he.current = !0, T(!1));
|
|
1120
|
+
}, V = R.current;
|
|
1121
|
+
return V && V.addEventListener("keydown", w), () => {
|
|
1122
|
+
V && V.removeEventListener("keydown", w);
|
|
1120
1123
|
};
|
|
1121
|
-
}, [
|
|
1122
|
-
const
|
|
1123
|
-
et(w, "yyyy-MM-dd"), he.current || C && C(
|
|
1124
|
-
},
|
|
1124
|
+
}, [R]);
|
|
1125
|
+
const jt = (w) => {
|
|
1126
|
+
et(w, "yyyy-MM-dd"), he.current || C && C(G);
|
|
1127
|
+
}, Vt = /* @__PURE__ */ s(
|
|
1125
1128
|
Re,
|
|
1126
1129
|
{
|
|
1127
1130
|
disabled: d,
|
|
@@ -1130,18 +1133,18 @@ const ea = 329, J = 12, we = 26, Wt = 20, Te = 9, ft = 12, St = (e, t, n) => n !
|
|
|
1130
1133
|
errorTextId: m,
|
|
1131
1134
|
inputId: D,
|
|
1132
1135
|
label: p,
|
|
1133
|
-
max:
|
|
1134
|
-
min:
|
|
1136
|
+
max: I ? O(I, "yyyy-MM-dd") : "",
|
|
1137
|
+
min: E ? O(E, "yyyy-MM-dd") : "",
|
|
1135
1138
|
type: "date",
|
|
1136
1139
|
ref: Qe,
|
|
1137
|
-
value:
|
|
1140
|
+
value: G ? O(G, "yyyy-MM-dd") : "",
|
|
1138
1141
|
width: 14,
|
|
1139
|
-
...
|
|
1142
|
+
...fe,
|
|
1140
1143
|
onBlur: tt,
|
|
1141
|
-
onChange:
|
|
1142
|
-
autoComplete:
|
|
1144
|
+
onChange: jt,
|
|
1145
|
+
autoComplete: Z || void 0
|
|
1143
1146
|
}
|
|
1144
|
-
),
|
|
1147
|
+
), Kt = /* @__PURE__ */ L(A, { children: [
|
|
1145
1148
|
/* @__PURE__ */ s("div", { children: /* @__PURE__ */ s(
|
|
1146
1149
|
Re,
|
|
1147
1150
|
{
|
|
@@ -1151,60 +1154,60 @@ const ea = 329, J = 12, we = 26, Wt = 20, Te = 9, ft = 12, St = (e, t, n) => n !
|
|
|
1151
1154
|
errorText: v,
|
|
1152
1155
|
errorTextId: m,
|
|
1153
1156
|
inputId: D,
|
|
1154
|
-
inputContainerRef:
|
|
1157
|
+
inputContainerRef: ve,
|
|
1155
1158
|
inputWrapperRef: Je,
|
|
1156
1159
|
label: p,
|
|
1157
1160
|
onFocus: Ft,
|
|
1158
1161
|
type: "text",
|
|
1159
1162
|
ref: Qe,
|
|
1160
|
-
value:
|
|
1163
|
+
value: Ne,
|
|
1161
1164
|
width: 12,
|
|
1162
|
-
...
|
|
1163
|
-
onBlur:
|
|
1165
|
+
...fe,
|
|
1166
|
+
onBlur: tt,
|
|
1164
1167
|
onChange: (w) => et(w, "yyyy-MM-dd"),
|
|
1165
1168
|
rightOfInput: /* @__PURE__ */ s(
|
|
1166
|
-
|
|
1169
|
+
on,
|
|
1167
1170
|
{
|
|
1168
1171
|
disabled: d,
|
|
1169
1172
|
ariaLabel: r ?? "Velg dato",
|
|
1170
|
-
onClick:
|
|
1171
|
-
tabIndex:
|
|
1173
|
+
onClick: Yt,
|
|
1174
|
+
tabIndex: $ ? -1 : 0,
|
|
1172
1175
|
variant: "borderless",
|
|
1173
|
-
wrapperClassName:
|
|
1174
|
-
className:
|
|
1175
|
-
children: /* @__PURE__ */ s(
|
|
1176
|
+
wrapperClassName: P["date-button"],
|
|
1177
|
+
className: P["date-button__inner"],
|
|
1178
|
+
children: /* @__PURE__ */ s(ln, { color: "black", svgIcon: sn })
|
|
1176
1179
|
}
|
|
1177
1180
|
),
|
|
1178
|
-
autoComplete:
|
|
1181
|
+
autoComplete: Z || void 0
|
|
1179
1182
|
}
|
|
1180
1183
|
) }),
|
|
1181
|
-
|
|
1182
|
-
|
|
1184
|
+
$ && !d && /* @__PURE__ */ s(
|
|
1185
|
+
ma,
|
|
1183
1186
|
{
|
|
1184
1187
|
dir: l,
|
|
1185
1188
|
disabled: Tt,
|
|
1186
|
-
datepickerWrapperRef:
|
|
1189
|
+
datepickerWrapperRef: me,
|
|
1187
1190
|
footer: _,
|
|
1188
|
-
fromDate:
|
|
1189
|
-
toDate:
|
|
1190
|
-
inputRef:
|
|
1191
|
+
fromDate: E,
|
|
1192
|
+
toDate: I,
|
|
1193
|
+
inputRef: R,
|
|
1191
1194
|
locale: M,
|
|
1192
1195
|
month: b,
|
|
1193
|
-
selected:
|
|
1196
|
+
selected: G,
|
|
1194
1197
|
onSelect: At,
|
|
1195
1198
|
onMonthChange: h,
|
|
1196
|
-
variant:
|
|
1197
|
-
zIndex:
|
|
1199
|
+
variant: Me,
|
|
1200
|
+
zIndex: ke
|
|
1198
1201
|
}
|
|
1199
1202
|
)
|
|
1200
1203
|
] });
|
|
1201
|
-
return /* @__PURE__ */ s("div", { className: n, "data-testid":
|
|
1204
|
+
return /* @__PURE__ */ s("div", { className: n, "data-testid": Y, children: cn() ? Vt : Kt });
|
|
1202
1205
|
});
|
|
1203
1206
|
Lt.displayName = "DatePicker";
|
|
1204
|
-
const
|
|
1207
|
+
const ye = (e) => {
|
|
1205
1208
|
const t = String(e);
|
|
1206
1209
|
return t.length === 1 ? "0" + t : t;
|
|
1207
|
-
},
|
|
1210
|
+
}, ha = (e) => !e || /^\d+$/.test(e) && e.length <= 2, Et = J.forwardRef((e, t) => {
|
|
1208
1211
|
const {
|
|
1209
1212
|
error: n,
|
|
1210
1213
|
errorText: r,
|
|
@@ -1219,22 +1222,22 @@ const pe = (e) => {
|
|
|
1219
1222
|
value: v,
|
|
1220
1223
|
autoComplete: m = "off",
|
|
1221
1224
|
...y
|
|
1222
|
-
} = e, [_, p] =
|
|
1223
|
-
typeof v < "u" ?
|
|
1225
|
+
} = e, [_, p] = B(
|
|
1226
|
+
typeof v < "u" ? ye(v) : void 0
|
|
1224
1227
|
), { refObject: D } = bt(gt(t) ? t : null), M = _t([t, D]);
|
|
1225
|
-
|
|
1226
|
-
p(v ?
|
|
1228
|
+
z(() => {
|
|
1229
|
+
p(v ? ye(v) : void 0);
|
|
1227
1230
|
}, [v]);
|
|
1228
|
-
const
|
|
1229
|
-
const
|
|
1230
|
-
|
|
1231
|
-
},
|
|
1232
|
-
const
|
|
1233
|
-
p(
|
|
1234
|
-
},
|
|
1235
|
-
const
|
|
1236
|
-
!
|
|
1237
|
-
},
|
|
1231
|
+
const I = (C) => {
|
|
1232
|
+
const Y = C.target.value;
|
|
1233
|
+
ha(Y) && (p(Y), d && d(C));
|
|
1234
|
+
}, E = (C) => {
|
|
1235
|
+
const Y = ye(C.target.value);
|
|
1236
|
+
p(Y), d && d(C), l && l(C);
|
|
1237
|
+
}, X = (C) => {
|
|
1238
|
+
const Y = /[0-9]/, Z = ["Backspace", " ", "Enter", "Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"];
|
|
1239
|
+
!Y.test(C.key) && !Z.includes(C.key) && C.preventDefault();
|
|
1240
|
+
}, x = () => u === "hours" && /* @__PURE__ */ s("span", { className: P["time-separator"], children: ":" });
|
|
1238
1241
|
return /* @__PURE__ */ s("div", { "data-testid": c, children: /* @__PURE__ */ s(
|
|
1239
1242
|
Re,
|
|
1240
1243
|
{
|
|
@@ -1250,62 +1253,62 @@ const pe = (e) => {
|
|
|
1250
1253
|
ref: M,
|
|
1251
1254
|
value: _,
|
|
1252
1255
|
width: 5,
|
|
1253
|
-
defaultValue: typeof e.defaultValue < "u" ?
|
|
1256
|
+
defaultValue: typeof e.defaultValue < "u" ? ye(e.defaultValue) : void 0,
|
|
1254
1257
|
...y,
|
|
1255
|
-
onChange:
|
|
1256
|
-
onBlur:
|
|
1257
|
-
rightOfInput:
|
|
1258
|
-
onKeyDown:
|
|
1258
|
+
onChange: I,
|
|
1259
|
+
onBlur: E,
|
|
1260
|
+
rightOfInput: x(),
|
|
1261
|
+
onKeyDown: X,
|
|
1259
1262
|
autoComplete: m || void 0
|
|
1260
1263
|
}
|
|
1261
1264
|
) });
|
|
1262
1265
|
});
|
|
1263
1266
|
Et.displayName = "DateTime";
|
|
1264
|
-
const
|
|
1265
|
-
const { children: n, errorWrapperClassName: r, errorText: a, legend: o, testId: i } = e, l =
|
|
1266
|
-
className: Be(
|
|
1267
|
+
const pa = J.forwardRef((e, t) => {
|
|
1268
|
+
const { children: n, errorWrapperClassName: r, errorText: a, legend: o, testId: i } = e, l = _n(), d = (u) => lt(u, Lt) ? J.cloneElement(u, {
|
|
1269
|
+
className: Be(P["date-time-picker-wrapper__date-picker"]),
|
|
1267
1270
|
error: !!a,
|
|
1268
1271
|
errorTextId: l
|
|
1269
|
-
}) : lt(u, Et) ?
|
|
1272
|
+
}) : lt(u, Et) ? J.cloneElement(u, {
|
|
1270
1273
|
error: !!a,
|
|
1271
1274
|
errorTextId: l
|
|
1272
1275
|
}) : u;
|
|
1273
|
-
return /* @__PURE__ */ s("div", { ref: t, tabIndex: -1, children: /* @__PURE__ */ s(
|
|
1274
|
-
e.legend && /* @__PURE__ */ s("legend", { className:
|
|
1275
|
-
|
|
1276
|
-
] }) : /* @__PURE__ */ s("div", { className:
|
|
1276
|
+
return /* @__PURE__ */ s("div", { ref: t, tabIndex: -1, children: /* @__PURE__ */ s(gn, { className: r, errorText: a, errorTextId: l, children: e.legend ? /* @__PURE__ */ L("fieldset", { className: P["date-time-picker-wrapper"], "data-testid": i, children: [
|
|
1277
|
+
e.legend && /* @__PURE__ */ s("legend", { className: P["date-time-picker-wrapper__legend"], children: o }),
|
|
1278
|
+
J.Children.map(n, d)
|
|
1279
|
+
] }) : /* @__PURE__ */ s("div", { className: P["date-time-picker-wrapper"], children: J.Children.map(n, d) }) }) });
|
|
1277
1280
|
});
|
|
1278
|
-
|
|
1281
|
+
pa.displayName = "DateTimePickerWrapper";
|
|
1279
1282
|
const Rt = (e) => {
|
|
1280
1283
|
const t = ["yyyy-MM-dd", "dd.MM.yyyy"];
|
|
1281
1284
|
for (const n of t) {
|
|
1282
|
-
const r =
|
|
1283
|
-
if (
|
|
1285
|
+
const r = ie(e, n, /* @__PURE__ */ new Date());
|
|
1286
|
+
if (se(r))
|
|
1284
1287
|
return r;
|
|
1285
1288
|
}
|
|
1286
1289
|
return null;
|
|
1287
|
-
},
|
|
1290
|
+
}, Ka = (e) => {
|
|
1288
1291
|
const t = new Date(e);
|
|
1289
1292
|
return t instanceof Date && !isNaN(t.getTime());
|
|
1290
|
-
},
|
|
1293
|
+
}, Ua = (e, t, n, r, a) => {
|
|
1291
1294
|
const o = Rt(e), i = typeof r < "u", l = typeof a < "u";
|
|
1292
|
-
return !o || i && !
|
|
1293
|
-
},
|
|
1295
|
+
return !o || i && !se(r) || l && !se(a) ? n || "Invalid date format" : i && !l && (N(o, r) || ge(o, r)) || l && !i && (N(o, a) || He(o, a)) || i && l && (N(o, r) || N(o, a) || nn(o, { start: r, end: a })) ? !0 : t;
|
|
1296
|
+
}, Xa = (e, t, n, r) => {
|
|
1294
1297
|
const a = Rt(e);
|
|
1295
1298
|
return a ? t.some((o) => N(o, a)) ? n : !0 : r || "Invalid date format";
|
|
1296
|
-
},
|
|
1297
|
-
const a =
|
|
1299
|
+
}, Za = (e, t, n, r) => {
|
|
1300
|
+
const a = ie((e.hour + ":" + e.minute).toString(), "HH:mm", /* @__PURE__ */ new Date()), o = ie(((n == null ? void 0 : n.hour) + ":" + (n == null ? void 0 : n.minute)).toString(), "HH:mm", /* @__PURE__ */ new Date()), i = ie(((r == null ? void 0 : r.hour) + ":" + (r == null ? void 0 : r.minute)).toString(), "HH:mm", /* @__PURE__ */ new Date());
|
|
1298
1301
|
return (typeof n > "u" || a >= o) && (typeof r > "u" || a <= i) ? !0 : t;
|
|
1299
1302
|
};
|
|
1300
1303
|
export {
|
|
1301
1304
|
Lt as DatePicker,
|
|
1302
1305
|
Et as DateTime,
|
|
1303
|
-
|
|
1306
|
+
pa as DateTimePickerWrapper,
|
|
1304
1307
|
Lt as default,
|
|
1305
|
-
|
|
1308
|
+
Ka as isValidDate,
|
|
1306
1309
|
Rt as parseInputDate,
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
+
Xa as validateDisabledDates,
|
|
1311
|
+
Ua as validateMinMaxDate,
|
|
1312
|
+
Za as validateMinTimeMaxTime
|
|
1310
1313
|
};
|
|
1311
1314
|
//# sourceMappingURL=index.js.map
|