@helsenorge/datepicker 8.0.2 → 8.1.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.
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import w, { createContext as
|
|
2
|
-
import { isSameDay as C, subDays as Me, addDays as W, differenceInCalendarDays as H, startOfMonth as E, endOfMonth as Re, startOfDay as
|
|
3
|
-
import { enUS as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import w, { createContext as $, forwardRef as Tt, useContext as q, useState as S, useEffect as ye, useLayoutEffect as Ft, useRef as oe } from "react";
|
|
2
|
+
import { isSameDay as C, subDays as Me, addDays as W, differenceInCalendarDays as H, startOfMonth as E, endOfMonth as Re, startOfDay as Je, addMonths as T, differenceInCalendarMonths as le, isSameMonth as Be, isBefore as Te, isAfter as he, getUnixTime as At, getWeeksInMonth as Yt, addWeeks as We, isSameYear as Ht, setMonth as ke, setYear as Qe, startOfYear as jt, max as Vt, min as Kt, endOfISOWeek as dt, endOfWeek as ut, startOfISOWeek as Fe, startOfWeek as Ae, getISOWeek as Ut, getWeek as Xt, format as L, isDate as ct, addYears as Zt, isValid as se, parse as ie, isWithinInterval as Gt } from "date-fns";
|
|
3
|
+
import { enUS as $t, nb as qt } from "date-fns/locale";
|
|
4
|
+
import Jt from "@helsenorge/designsystem-react/components/Button";
|
|
5
|
+
import Qt from "@helsenorge/designsystem-react/components/Icon";
|
|
6
|
+
import zt from "@helsenorge/designsystem-react/components/Icons/Calendar";
|
|
7
7
|
import Ee from "@helsenorge/designsystem-react/components/Input";
|
|
8
|
-
import { ZIndex as
|
|
9
|
-
import { useKeyboardEvent as
|
|
10
|
-
import { useOutsideEvent as
|
|
11
|
-
import { usePseudoClasses as
|
|
12
|
-
import { isMobileUA as
|
|
13
|
-
import { isMutableRefObject as
|
|
8
|
+
import { ZIndex as en, KeyboardEventKey as ze } from "@helsenorge/designsystem-react/constants";
|
|
9
|
+
import { useKeyboardEvent as et } from "@helsenorge/designsystem-react/hooks/useKeyboardEvent";
|
|
10
|
+
import { useOutsideEvent as tn } from "@helsenorge/designsystem-react/hooks/useOutsideEvent";
|
|
11
|
+
import { usePseudoClasses as ft } from "@helsenorge/designsystem-react/hooks/usePseudoClasses";
|
|
12
|
+
import { isMobileUA as nn } from "@helsenorge/designsystem-react/utils/mobile";
|
|
13
|
+
import { isMutableRefObject as vt, mergeRefs as mt } from "@helsenorge/designsystem-react/utils/refs";
|
|
14
14
|
import Se from "classnames";
|
|
15
15
|
import { jsx as u, jsxs as F, Fragment as V } from "react/jsx-runtime";
|
|
16
|
-
import
|
|
16
|
+
import rn from "react-day-picker/dist/style.module.css";
|
|
17
17
|
import { PopOverVariant as j } from "@helsenorge/designsystem-react/components/PopOver";
|
|
18
|
-
import { useFocusTrap as
|
|
19
|
-
import { useInterval as
|
|
20
|
-
import { useIsVisible as
|
|
21
|
-
import { useLayoutEvent as
|
|
22
|
-
import { useSize as
|
|
23
|
-
import { getSpacer as
|
|
18
|
+
import { useFocusTrap as an } from "@helsenorge/designsystem-react/hooks/useFocusTrap";
|
|
19
|
+
import { useInterval as on } from "@helsenorge/designsystem-react/hooks/useInterval";
|
|
20
|
+
import { useIsVisible as ln } from "@helsenorge/designsystem-react/hooks/useIsVisible";
|
|
21
|
+
import { useLayoutEvent as sn } from "@helsenorge/designsystem-react/hooks/useLayoutEvent";
|
|
22
|
+
import { useSize as dn } from "@helsenorge/designsystem-react/hooks/useSize";
|
|
23
|
+
import { getSpacer as un } from "@helsenorge/designsystem-react/theme/currys/spacing";
|
|
24
24
|
import x from "./styles.module.scss";
|
|
25
|
-
import
|
|
26
|
-
import { useUuid as
|
|
27
|
-
import { isComponent as
|
|
25
|
+
import cn from "@helsenorge/designsystem-react/components/ErrorWrapper";
|
|
26
|
+
import { useUuid as fn } from "@helsenorge/designsystem-react/hooks/useUuid";
|
|
27
|
+
import { isComponent as tt } from "@helsenorge/designsystem-react/utils/component";
|
|
28
28
|
var g = function() {
|
|
29
29
|
return g = Object.assign || function(n) {
|
|
30
30
|
for (var t, r = 1, a = arguments.length; r < a; r++) {
|
|
@@ -34,7 +34,7 @@ var g = function() {
|
|
|
34
34
|
return n;
|
|
35
35
|
}, g.apply(this, arguments);
|
|
36
36
|
};
|
|
37
|
-
function
|
|
37
|
+
function vn(e, n) {
|
|
38
38
|
var t = {};
|
|
39
39
|
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && n.indexOf(r) < 0 && (t[r] = e[r]);
|
|
40
40
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -42,21 +42,21 @@ function fn(e, n) {
|
|
|
42
42
|
n.indexOf(r[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[a]) && (t[r[a]] = e[r[a]]);
|
|
43
43
|
return t;
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function ht(e, n, t) {
|
|
46
46
|
for (var r = 0, a = n.length, o; r < a; r++)
|
|
47
47
|
(o || !(r in n)) && (o || (o = Array.prototype.slice.call(n, 0, r)), o[r] = n[r]);
|
|
48
48
|
return e.concat(o || Array.prototype.slice.call(n));
|
|
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 be(e) {
|
|
57
57
|
return e.mode === "single";
|
|
58
58
|
}
|
|
59
|
-
var
|
|
59
|
+
var mn = {
|
|
60
60
|
root: "rdp",
|
|
61
61
|
multiple_months: "rdp-multiple_months",
|
|
62
62
|
with_weeknumber: "rdp-with_weeknumber",
|
|
@@ -99,63 +99,63 @@ var vn = {
|
|
|
99
99
|
day_range_end: "rdp-day_range_end",
|
|
100
100
|
day_range_middle: "rdp-day_range_middle"
|
|
101
101
|
};
|
|
102
|
-
function
|
|
102
|
+
function hn(e, n) {
|
|
103
103
|
return L(e, "LLLL y", n);
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function pn(e, n) {
|
|
106
106
|
return L(e, "d", n);
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function yn(e, n) {
|
|
109
109
|
return L(e, "LLLL", n);
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function bn(e) {
|
|
112
112
|
return "".concat(e);
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function gn(e, n) {
|
|
115
115
|
return L(e, "cccccc", n);
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function _n(e, n) {
|
|
118
118
|
return L(e, "yyyy", n);
|
|
119
119
|
}
|
|
120
|
-
var
|
|
120
|
+
var wn = /* @__PURE__ */ Object.freeze({
|
|
121
121
|
__proto__: null,
|
|
122
|
-
formatCaption:
|
|
123
|
-
formatDay:
|
|
124
|
-
formatMonthCaption:
|
|
125
|
-
formatWeekNumber:
|
|
126
|
-
formatWeekdayName:
|
|
127
|
-
formatYearCaption:
|
|
128
|
-
}),
|
|
122
|
+
formatCaption: hn,
|
|
123
|
+
formatDay: pn,
|
|
124
|
+
formatMonthCaption: yn,
|
|
125
|
+
formatWeekNumber: bn,
|
|
126
|
+
formatWeekdayName: gn,
|
|
127
|
+
formatYearCaption: _n
|
|
128
|
+
}), Dn = function(e, n, t) {
|
|
129
129
|
return L(e, "do MMMM (EEEE)", t);
|
|
130
|
-
}, Dn = function() {
|
|
131
|
-
return "Month: ";
|
|
132
130
|
}, Mn = function() {
|
|
133
|
-
return "
|
|
131
|
+
return "Month: ";
|
|
134
132
|
}, kn = function() {
|
|
133
|
+
return "Go to next month";
|
|
134
|
+
}, Nn = function() {
|
|
135
135
|
return "Go to previous month";
|
|
136
|
-
},
|
|
136
|
+
}, Cn = function(e, n) {
|
|
137
137
|
return L(e, "cccc", n);
|
|
138
|
-
},
|
|
138
|
+
}, Pn = function(e) {
|
|
139
139
|
return "Week n. ".concat(e);
|
|
140
|
-
},
|
|
140
|
+
}, xn = function() {
|
|
141
141
|
return "Year: ";
|
|
142
|
-
},
|
|
142
|
+
}, On = /* @__PURE__ */ Object.freeze({
|
|
143
143
|
__proto__: null,
|
|
144
|
-
labelDay:
|
|
145
|
-
labelMonthDropdown:
|
|
146
|
-
labelNext:
|
|
147
|
-
labelPrevious:
|
|
148
|
-
labelWeekNumber:
|
|
149
|
-
labelWeekday:
|
|
150
|
-
labelYearDropdown:
|
|
144
|
+
labelDay: Dn,
|
|
145
|
+
labelMonthDropdown: Mn,
|
|
146
|
+
labelNext: kn,
|
|
147
|
+
labelPrevious: Nn,
|
|
148
|
+
labelWeekNumber: Pn,
|
|
149
|
+
labelWeekday: Cn,
|
|
150
|
+
labelYearDropdown: xn
|
|
151
151
|
});
|
|
152
|
-
function
|
|
153
|
-
var e = "buttons", n =
|
|
152
|
+
function In() {
|
|
153
|
+
var e = "buttons", n = mn, t = $t, r = {}, a = {}, o = 1, i = {}, l = /* @__PURE__ */ new Date();
|
|
154
154
|
return {
|
|
155
155
|
captionLayout: e,
|
|
156
156
|
classNames: n,
|
|
157
|
-
formatters:
|
|
158
|
-
labels:
|
|
157
|
+
formatters: wn,
|
|
158
|
+
labels: On,
|
|
159
159
|
locale: t,
|
|
160
160
|
modifiersClassNames: r,
|
|
161
161
|
modifiers: a,
|
|
@@ -165,47 +165,47 @@ function On() {
|
|
|
165
165
|
mode: "default"
|
|
166
166
|
};
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function Wn(e) {
|
|
169
169
|
var n = e.fromYear, t = e.toYear, r = e.fromMonth, a = e.toMonth, o = e.fromDate, i = e.toDate;
|
|
170
170
|
return r ? o = E(r) : n && (o = new Date(n, 0, 1)), a ? i = Re(a) : t && (i = new Date(t, 11, 31)), {
|
|
171
|
-
fromDate: o ?
|
|
172
|
-
toDate: i ?
|
|
171
|
+
fromDate: o ? Je(o) : void 0,
|
|
172
|
+
toDate: i ? Je(i) : void 0
|
|
173
173
|
};
|
|
174
174
|
}
|
|
175
|
-
var
|
|
176
|
-
function
|
|
177
|
-
var n, t = e.initialProps, r =
|
|
175
|
+
var pt = $(void 0);
|
|
176
|
+
function En(e) {
|
|
177
|
+
var n, t = e.initialProps, r = In(), a = Wn(t), o = a.fromDate, i = a.toDate, l = (n = t.captionLayout) !== null && n !== void 0 ? n : r.captionLayout;
|
|
178
178
|
l !== "buttons" && (!o || !i) && (l = "buttons");
|
|
179
179
|
var s;
|
|
180
|
-
(
|
|
180
|
+
(be(t) || de(t) || ue(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 u(
|
|
182
|
+
return u(pt.Provider, { value: c, children: e.children });
|
|
183
183
|
}
|
|
184
184
|
function k() {
|
|
185
|
-
var e =
|
|
185
|
+
var e = q(pt);
|
|
186
186
|
if (!e)
|
|
187
187
|
throw new Error("useDayPicker must be used within a DayPickerProvider.");
|
|
188
188
|
return e;
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function yt(e) {
|
|
191
191
|
var n = k(), t = n.locale, r = n.classNames, a = n.styles, o = n.formatters.formatCaption;
|
|
192
192
|
return u("div", { className: r.caption_label, style: a.caption_label, "aria-live": "polite", role: "presentation", id: e.id, children: o(e.displayMonth, { locale: t }) });
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function Sn(e) {
|
|
195
195
|
return u("svg", g({ width: "8px", height: "8px", viewBox: "0 0 120 120", "data-testid": "iconDropdown" }, e, { children: u("path", { d: "M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z", fill: "currentColor", fillRule: "nonzero" }) }));
|
|
196
196
|
}
|
|
197
|
-
function
|
|
198
|
-
var n, t, r = e.onChange, a = e.value, o = e.children, i = e.caption, l = e.className, s = e.style, c = k(), d = (t = (n = c.components) === null || n === void 0 ? void 0 : n.IconDropdown) !== null && t !== void 0 ? t :
|
|
197
|
+
function bt(e) {
|
|
198
|
+
var n, t, r = e.onChange, a = e.value, o = e.children, i = e.caption, l = e.className, s = e.style, c = k(), d = (t = (n = c.components) === null || n === void 0 ? void 0 : n.IconDropdown) !== null && t !== void 0 ? t : Sn;
|
|
199
199
|
return F("div", { className: l, style: s, children: [u("span", { className: c.classNames.vhidden, children: e["aria-label"] }), u("select", { name: e.name, "aria-label": e["aria-label"], className: c.classNames.dropdown, style: c.styles.dropdown, value: a, onChange: r, children: o }), F("div", { className: c.classNames.caption_label, style: c.styles.caption_label, "aria-hidden": "true", children: [i, u(d, { className: c.classNames.dropdown_icon, style: c.styles.dropdown_icon })] })] });
|
|
200
200
|
}
|
|
201
|
-
function
|
|
201
|
+
function Ln(e) {
|
|
202
202
|
var n, t = k(), r = t.fromDate, a = t.toDate, o = t.styles, i = t.locale, l = t.formatters.formatMonthCaption, s = t.classNames, c = t.components, d = t.labels.labelMonthDropdown;
|
|
203
203
|
if (!r)
|
|
204
204
|
return u(V, {});
|
|
205
205
|
if (!a)
|
|
206
206
|
return u(V, {});
|
|
207
207
|
var f = [];
|
|
208
|
-
if (
|
|
208
|
+
if (Ht(r, a))
|
|
209
209
|
for (var v = E(r), m = r.getMonth(); m <= a.getMonth(); m++)
|
|
210
210
|
f.push(ke(v, m));
|
|
211
211
|
else
|
|
@@ -214,41 +214,41 @@ function Sn(e) {
|
|
|
214
214
|
var y = function(b) {
|
|
215
215
|
var M = Number(b.target.value), D = ke(E(e.displayMonth), M);
|
|
216
216
|
e.onChange(D);
|
|
217
|
-
}, _ = (n = c == null ? void 0 : c.Dropdown) !== null && n !== void 0 ? n :
|
|
217
|
+
}, _ = (n = c == null ? void 0 : c.Dropdown) !== null && n !== void 0 ? n : bt;
|
|
218
218
|
return u(_, { name: "months", "aria-label": d(), className: s.dropdown_month, style: o.dropdown_month, onChange: y, value: e.displayMonth.getMonth(), caption: l(e.displayMonth, { locale: i }), children: f.map(function(b) {
|
|
219
219
|
return u("option", { value: b.getMonth(), children: l(b, { locale: i }) }, b.getMonth());
|
|
220
220
|
}) });
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function Rn(e) {
|
|
223
223
|
var n, t = e.displayMonth, r = k(), a = r.fromDate, o = r.toDate, i = r.locale, l = r.styles, s = r.classNames, c = r.components, d = r.formatters.formatYearCaption, f = r.labels.labelYearDropdown, v = [];
|
|
224
224
|
if (!a)
|
|
225
225
|
return u(V, {});
|
|
226
226
|
if (!o)
|
|
227
227
|
return u(V, {});
|
|
228
228
|
for (var m = a.getFullYear(), y = o.getFullYear(), _ = m; _ <= y; _++)
|
|
229
|
-
v.push(
|
|
229
|
+
v.push(Qe(jt(/* @__PURE__ */ new Date()), _));
|
|
230
230
|
var b = function(D) {
|
|
231
|
-
var O =
|
|
231
|
+
var O = Qe(E(t), Number(D.target.value));
|
|
232
232
|
e.onChange(O);
|
|
233
|
-
}, M = (n = c == null ? void 0 : c.Dropdown) !== null && n !== void 0 ? n :
|
|
233
|
+
}, M = (n = c == null ? void 0 : c.Dropdown) !== null && n !== void 0 ? n : bt;
|
|
234
234
|
return u(M, { name: "years", "aria-label": f(), className: s.dropdown_year, style: l.dropdown_year, onChange: b, value: t.getFullYear(), caption: d(t, { locale: i }), children: v.map(function(D) {
|
|
235
235
|
return u("option", { value: D.getFullYear(), children: d(D, { locale: i }) }, D.getFullYear());
|
|
236
236
|
}) });
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function Bn(e, n) {
|
|
239
239
|
var t = S(e), r = t[0], a = t[1], o = n === void 0 ? r : n;
|
|
240
240
|
return [o, a];
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function Tn(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
|
-
if (o &&
|
|
244
|
+
if (o && le(o, a) < 0) {
|
|
245
245
|
var c = -1 * (s - 1);
|
|
246
246
|
a = T(o, c);
|
|
247
247
|
}
|
|
248
|
-
return i &&
|
|
248
|
+
return i && le(a, i) < 0 && (a = i), E(a);
|
|
249
249
|
}
|
|
250
|
-
function
|
|
251
|
-
var e = k(), n =
|
|
250
|
+
function Fn() {
|
|
251
|
+
var e = k(), n = Tn(e), t = Bn(n, e.month), r = t[0], a = t[1], o = function(i) {
|
|
252
252
|
var l;
|
|
253
253
|
if (!e.disableNavigation) {
|
|
254
254
|
var s = E(i);
|
|
@@ -257,36 +257,36 @@ function Tn() {
|
|
|
257
257
|
};
|
|
258
258
|
return [r, o];
|
|
259
259
|
}
|
|
260
|
-
function
|
|
261
|
-
for (var t = n.reverseMonths, r = n.numberOfMonths, a = E(e), o = E(T(a, r)), i =
|
|
260
|
+
function An(e, n) {
|
|
261
|
+
for (var t = n.reverseMonths, r = n.numberOfMonths, a = E(e), o = E(T(a, r)), i = le(o, a), l = [], s = 0; s < i; s++) {
|
|
262
262
|
var c = T(a, s);
|
|
263
263
|
l.push(c);
|
|
264
264
|
}
|
|
265
265
|
return t && (l = l.reverse()), l;
|
|
266
266
|
}
|
|
267
|
-
function
|
|
267
|
+
function Yn(e, n) {
|
|
268
268
|
if (!n.disableNavigation) {
|
|
269
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
271
|
return T(l, i);
|
|
272
|
-
var s =
|
|
272
|
+
var s = le(t, e);
|
|
273
273
|
if (!(s < o))
|
|
274
274
|
return T(l, i);
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
|
-
function
|
|
277
|
+
function Hn(e, n) {
|
|
278
278
|
if (!n.disableNavigation) {
|
|
279
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
281
|
return T(l, -i);
|
|
282
|
-
var s =
|
|
282
|
+
var s = le(l, t);
|
|
283
283
|
if (!(s <= 0))
|
|
284
284
|
return T(l, -i);
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
|
-
var
|
|
288
|
-
function
|
|
289
|
-
var n = k(), t =
|
|
287
|
+
var gt = $(void 0);
|
|
288
|
+
function jn(e) {
|
|
289
|
+
var n = k(), t = Fn(), r = t[0], a = t[1], o = An(r, n), i = Yn(r, n), l = Hn(r, n), s = function(f) {
|
|
290
290
|
return o.some(function(v) {
|
|
291
291
|
return Be(f, v);
|
|
292
292
|
});
|
|
@@ -301,33 +301,33 @@ function Hn(e) {
|
|
|
301
301
|
nextMonth: i,
|
|
302
302
|
isDateDisplayed: s
|
|
303
303
|
};
|
|
304
|
-
return u(
|
|
304
|
+
return u(gt.Provider, { value: d, children: e.children });
|
|
305
305
|
}
|
|
306
|
-
function
|
|
307
|
-
var e =
|
|
306
|
+
function ce() {
|
|
307
|
+
var e = q(gt);
|
|
308
308
|
if (!e)
|
|
309
309
|
throw new Error("useNavigation must be used within a NavigationProvider");
|
|
310
310
|
return e;
|
|
311
311
|
}
|
|
312
|
-
function
|
|
313
|
-
var n, t = k(), r = t.classNames, a = t.styles, o = t.components, i =
|
|
312
|
+
function nt(e) {
|
|
313
|
+
var n, t = k(), r = t.classNames, a = t.styles, o = t.components, i = ce().goToMonth, l = function(d) {
|
|
314
314
|
i(T(d, e.displayIndex ? -e.displayIndex : 0));
|
|
315
|
-
}, s = (n = o == null ? void 0 : o.CaptionLabel) !== null && n !== void 0 ? n :
|
|
316
|
-
return F("div", { className: r.caption_dropdowns, style: a.caption_dropdowns, children: [u("div", { className: r.vhidden, children: c }), u(
|
|
315
|
+
}, s = (n = o == null ? void 0 : o.CaptionLabel) !== null && n !== void 0 ? n : yt, c = u(s, { id: e.id, displayMonth: e.displayMonth });
|
|
316
|
+
return F("div", { className: r.caption_dropdowns, style: a.caption_dropdowns, children: [u("div", { className: r.vhidden, children: c }), u(Ln, { onChange: l, displayMonth: e.displayMonth }), u(Rn, { onChange: l, displayMonth: e.displayMonth })] });
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function Vn(e) {
|
|
319
319
|
return u("svg", g({ width: "16px", height: "16px", viewBox: "0 0 120 120" }, e, { children: u("path", { d: "M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z", fill: "currentColor", fillRule: "nonzero" }) }));
|
|
320
320
|
}
|
|
321
|
-
function
|
|
321
|
+
function Kn(e) {
|
|
322
322
|
return u("svg", g({ width: "16px", height: "16px", viewBox: "0 0 120 120" }, e, { children: u("path", { d: "M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z", fill: "currentColor" }) }));
|
|
323
323
|
}
|
|
324
|
-
var
|
|
324
|
+
var pe = Tt(function(e, n) {
|
|
325
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
328
|
return e.style && Object.assign(l, e.style), u("button", g({}, e, { ref: n, type: "button", className: i, style: l }));
|
|
329
329
|
});
|
|
330
|
-
function
|
|
330
|
+
function Un(e) {
|
|
331
331
|
var n, t, r = k(), a = r.dir, o = r.locale, i = r.classNames, l = r.styles, s = r.labels, c = s.labelPrevious, d = s.labelNext, f = r.components;
|
|
332
332
|
if (!e.nextMonth && !e.previousMonth)
|
|
333
333
|
return u(V, {});
|
|
@@ -337,51 +337,51 @@ function Kn(e) {
|
|
|
337
337
|
].join(" "), y = d(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 :
|
|
341
|
-
return F("div", { className: i.nav, style: l.nav, children: [!e.hidePrevious && u(
|
|
340
|
+
].join(" "), b = (n = f == null ? void 0 : f.IconRight) !== null && n !== void 0 ? n : Kn, M = (t = f == null ? void 0 : f.IconLeft) !== null && t !== void 0 ? t : Vn;
|
|
341
|
+
return F("div", { className: i.nav, style: l.nav, children: [!e.hidePrevious && u(pe, { name: "previous-month", "aria-label": v, className: m, style: l.nav_button_previous, disabled: !e.previousMonth, onClick: e.onPreviousClick, children: a === "rtl" ? u(b, { className: i.nav_icon, style: l.nav_icon }) : u(M, { className: i.nav_icon, style: l.nav_icon }) }), !e.hideNext && u(pe, { name: "next-month", "aria-label": y, className: _, style: l.nav_button_next, disabled: !e.nextMonth, onClick: e.onNextClick, children: a === "rtl" ? u(M, { className: i.nav_icon, style: l.nav_icon }) : u(b, { className: i.nav_icon, style: l.nav_icon }) })] });
|
|
342
342
|
}
|
|
343
|
-
function
|
|
344
|
-
var n = k().numberOfMonths, t =
|
|
343
|
+
function rt(e) {
|
|
344
|
+
var n = k().numberOfMonths, t = ce(), r = t.previousMonth, a = t.nextMonth, o = t.goToMonth, i = t.displayMonths, l = i.findIndex(function(y) {
|
|
345
345
|
return Be(e.displayMonth, y);
|
|
346
346
|
}), s = l === 0, c = l === i.length - 1, d = n > 1 && (s || !c), f = n > 1 && (c || !s), v = function() {
|
|
347
347
|
r && o(r);
|
|
348
348
|
}, m = function() {
|
|
349
349
|
a && o(a);
|
|
350
350
|
};
|
|
351
|
-
return u(
|
|
352
|
-
}
|
|
353
|
-
function Un(e) {
|
|
354
|
-
var n, t = k(), r = t.classNames, a = t.disableNavigation, o = t.styles, i = t.captionLayout, l = t.components, s = (n = l == null ? void 0 : l.CaptionLabel) !== null && n !== void 0 ? n : pt, c;
|
|
355
|
-
return a ? c = u(s, { id: e.id, displayMonth: e.displayMonth }) : i === "dropdown" ? c = u(tt, { displayMonth: e.displayMonth, id: e.id }) : i === "dropdown-buttons" ? c = F(V, { children: [u(tt, { displayMonth: e.displayMonth, displayIndex: e.displayIndex, id: e.id }), u(nt, { displayMonth: e.displayMonth, displayIndex: e.displayIndex, id: e.id })] }) : c = F(V, { children: [u(s, { id: e.id, displayMonth: e.displayMonth, displayIndex: e.displayIndex }), u(nt, { displayMonth: e.displayMonth, id: e.id })] }), u("div", { className: r.caption, style: o.caption, children: c });
|
|
351
|
+
return u(Un, { displayMonth: e.displayMonth, hideNext: d, hidePrevious: f, nextMonth: a, previousMonth: r, onPreviousClick: v, onNextClick: m });
|
|
356
352
|
}
|
|
357
353
|
function Xn(e) {
|
|
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 : yt, c;
|
|
355
|
+
return a ? c = u(s, { id: e.id, displayMonth: e.displayMonth }) : i === "dropdown" ? c = u(nt, { displayMonth: e.displayMonth, id: e.id }) : i === "dropdown-buttons" ? c = F(V, { children: [u(nt, { displayMonth: e.displayMonth, displayIndex: e.displayIndex, id: e.id }), u(rt, { displayMonth: e.displayMonth, displayIndex: e.displayIndex, id: e.id })] }) : c = F(V, { children: [u(s, { id: e.id, displayMonth: e.displayMonth, displayIndex: e.displayIndex }), u(rt, { displayMonth: e.displayMonth, id: e.id })] }), u("div", { className: r.caption, style: o.caption, children: c });
|
|
356
|
+
}
|
|
357
|
+
function Zn(e) {
|
|
358
358
|
var n = k(), t = n.footer, r = n.styles, a = n.classNames.tfoot;
|
|
359
359
|
return t ? u("tfoot", { className: a, style: r.tfoot, children: u("tr", { children: u("td", { colSpan: 8, children: t }) }) }) : u(V, {});
|
|
360
360
|
}
|
|
361
|
-
function
|
|
361
|
+
function Gn(e, n, t) {
|
|
362
362
|
for (var r = t ? Fe(/* @__PURE__ */ new Date()) : Ae(/* @__PURE__ */ new Date(), { locale: e, weekStartsOn: n }), a = [], o = 0; o < 7; o++) {
|
|
363
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(), n = e.classNames, t = e.styles, r = e.showWeekNumber, a = e.locale, o = e.weekStartsOn, i = e.ISOWeek, l = e.formatters.formatWeekdayName, s = e.labels.labelWeekday, c =
|
|
368
|
+
function $n() {
|
|
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 = Gn(a, o, i);
|
|
370
370
|
return F("tr", { style: t.head_row, className: n.head_row, children: [r && u("td", { style: t.head_cell, className: n.head_cell }), c.map(function(d, f) {
|
|
371
371
|
return u("th", { scope: "col", className: n.head_cell, style: t.head_cell, "aria-label": s(d, { locale: a }), children: l(d, { locale: a }) }, f);
|
|
372
372
|
})] });
|
|
373
373
|
}
|
|
374
|
-
function
|
|
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 :
|
|
374
|
+
function qn() {
|
|
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 : $n;
|
|
376
376
|
return u("thead", { style: r.head, className: t.head, children: u(o, {}) });
|
|
377
377
|
}
|
|
378
|
-
function
|
|
378
|
+
function Jn(e) {
|
|
379
379
|
var n = k(), t = n.locale, r = n.formatters.formatDay;
|
|
380
380
|
return u(V, { children: r(e.date, { locale: t }) });
|
|
381
381
|
}
|
|
382
|
-
var Ye =
|
|
383
|
-
function
|
|
384
|
-
if (!
|
|
382
|
+
var Ye = $(void 0);
|
|
383
|
+
function Qn(e) {
|
|
384
|
+
if (!de(e.initialProps)) {
|
|
385
385
|
var n = {
|
|
386
386
|
selected: void 0,
|
|
387
387
|
modifiers: {
|
|
@@ -390,9 +390,9 @@ function Jn(e) {
|
|
|
390
390
|
};
|
|
391
391
|
return u(Ye.Provider, { value: n, children: e.children });
|
|
392
392
|
}
|
|
393
|
-
return u(
|
|
393
|
+
return u(zn, { initialProps: e.initialProps, children: e.children });
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function zn(e) {
|
|
396
396
|
var n = e.initialProps, t = e.children, r = n.selected, a = n.min, o = n.max, i = function(c, d, f) {
|
|
397
397
|
var v, m;
|
|
398
398
|
(v = n.onDayClick) === null || v === void 0 || v.call(n, c, d, f);
|
|
@@ -400,7 +400,7 @@ function Qn(e) {
|
|
|
400
400
|
if (!y) {
|
|
401
401
|
var _ = !!(!d.selected && o && (r == null ? void 0 : r.length) === o);
|
|
402
402
|
if (!_) {
|
|
403
|
-
var b = r ?
|
|
403
|
+
var b = r ? ht([], r) : [];
|
|
404
404
|
if (d.selected) {
|
|
405
405
|
var M = b.findIndex(function(D) {
|
|
406
406
|
return C(c, D);
|
|
@@ -428,18 +428,18 @@ function Qn(e) {
|
|
|
428
428
|
return u(Ye.Provider, { value: s, children: t });
|
|
429
429
|
}
|
|
430
430
|
function He() {
|
|
431
|
-
var e =
|
|
431
|
+
var e = q(Ye);
|
|
432
432
|
if (!e)
|
|
433
433
|
throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");
|
|
434
434
|
return e;
|
|
435
435
|
}
|
|
436
|
-
function
|
|
436
|
+
function er(e, n) {
|
|
437
437
|
var t = n || {}, r = t.from, a = t.to;
|
|
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 :
|
|
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 : he(r, e) ? { from: e, to: a } : { from: r, to: e } : a ? he(e, a) ? { from: a, to: e } : { from: e, to: a } : r ? Te(e, r) ? { from: e, to: r } : { from: r, to: e } : { from: e, to: void 0 };
|
|
439
439
|
}
|
|
440
|
-
var je =
|
|
441
|
-
function
|
|
442
|
-
if (!
|
|
440
|
+
var je = $(void 0);
|
|
441
|
+
function tr(e) {
|
|
442
|
+
if (!ue(e.initialProps)) {
|
|
443
443
|
var n = {
|
|
444
444
|
selected: void 0,
|
|
445
445
|
modifiers: {
|
|
@@ -451,13 +451,13 @@ function er(e) {
|
|
|
451
451
|
};
|
|
452
452
|
return u(je.Provider, { value: n, children: e.children });
|
|
453
453
|
}
|
|
454
|
-
return u(
|
|
454
|
+
return u(nr, { initialProps: e.initialProps, children: e.children });
|
|
455
455
|
}
|
|
456
|
-
function
|
|
456
|
+
function nr(e) {
|
|
457
457
|
var n = e.initialProps, t = e.children, r = n.selected, a = r || {}, o = a.from, i = a.to, l = n.min, s = n.max, c = function(m, y, _) {
|
|
458
458
|
var b, M;
|
|
459
459
|
(b = n.onDayClick) === null || b === void 0 || b.call(n, m, y, _);
|
|
460
|
-
var D =
|
|
460
|
+
var D = er(m, r);
|
|
461
461
|
(M = n.onSelect) === null || M === void 0 || M.call(n, D, m, y, _);
|
|
462
462
|
}, d = {
|
|
463
463
|
range_start: [],
|
|
@@ -501,15 +501,15 @@ function tr(e) {
|
|
|
501
501
|
return u(je.Provider, { value: { selected: r, onDayClick: c, modifiers: d }, children: t });
|
|
502
502
|
}
|
|
503
503
|
function Ve() {
|
|
504
|
-
var e =
|
|
504
|
+
var e = q(je);
|
|
505
505
|
if (!e)
|
|
506
506
|
throw new Error("useSelectRange must be used within a SelectRangeProvider");
|
|
507
507
|
return e;
|
|
508
508
|
}
|
|
509
509
|
function me(e) {
|
|
510
|
-
return Array.isArray(e) ?
|
|
510
|
+
return Array.isArray(e) ? ht([], e) : e !== void 0 ? [e] : [];
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function rr(e) {
|
|
513
513
|
var n = {};
|
|
514
514
|
return Object.entries(e).forEach(function(t) {
|
|
515
515
|
var r = t[0], a = t[1];
|
|
@@ -520,38 +520,38 @@ var R;
|
|
|
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
522
|
})(R || (R = {}));
|
|
523
|
-
var
|
|
524
|
-
function
|
|
525
|
-
var r, a = (r = {}, r[
|
|
526
|
-
return e.fromDate && a[Y].push({ before: e.fromDate }), e.toDate && a[Y].push({ after: e.toDate }),
|
|
527
|
-
}
|
|
528
|
-
var
|
|
529
|
-
function
|
|
530
|
-
var n = k(), t = He(), r = Ve(), a =
|
|
531
|
-
return u(
|
|
532
|
-
}
|
|
533
|
-
function
|
|
534
|
-
var e =
|
|
523
|
+
var ar = R.Selected, Y = R.Disabled, or = R.Hidden, ir = R.Today, Ne = R.RangeEnd, Ce = R.RangeMiddle, Pe = R.RangeStart, lr = R.Outside;
|
|
524
|
+
function sr(e, n, t) {
|
|
525
|
+
var r, a = (r = {}, r[ar] = me(e.selected), r[Y] = me(e.disabled), r[or] = me(e.hidden), r[ir] = [e.today], r[Ne] = [], r[Ce] = [], r[Pe] = [], r[lr] = [], r);
|
|
526
|
+
return e.fromDate && a[Y].push({ before: e.fromDate }), e.toDate && a[Y].push({ after: e.toDate }), de(e) ? a[Y] = a[Y].concat(n.modifiers[Y]) : ue(e) && (a[Y] = a[Y].concat(t.modifiers[Y]), a[Pe] = t.modifiers[Pe], a[Ce] = t.modifiers[Ce], a[Ne] = t.modifiers[Ne]), a;
|
|
527
|
+
}
|
|
528
|
+
var _t = $(void 0);
|
|
529
|
+
function dr(e) {
|
|
530
|
+
var n = k(), t = He(), r = Ve(), a = sr(n, t, r), o = rr(n.modifiers), i = g(g({}, a), o);
|
|
531
|
+
return u(_t.Provider, { value: i, children: e.children });
|
|
532
|
+
}
|
|
533
|
+
function wt() {
|
|
534
|
+
var e = q(_t);
|
|
535
535
|
if (!e)
|
|
536
536
|
throw new Error("useModifiers must be used within a ModifiersProvider");
|
|
537
537
|
return e;
|
|
538
538
|
}
|
|
539
|
-
function
|
|
539
|
+
function ur(e) {
|
|
540
540
|
return !!(e && typeof e == "object" && "before" in e && "after" in e);
|
|
541
541
|
}
|
|
542
|
-
function
|
|
542
|
+
function cr(e) {
|
|
543
543
|
return !!(e && typeof e == "object" && "from" in e);
|
|
544
544
|
}
|
|
545
|
-
function
|
|
545
|
+
function fr(e) {
|
|
546
546
|
return !!(e && typeof e == "object" && "after" in e);
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function vr(e) {
|
|
549
549
|
return !!(e && typeof e == "object" && "before" in e);
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function mr(e) {
|
|
552
552
|
return !!(e && typeof e == "object" && "dayOfWeek" in e);
|
|
553
553
|
}
|
|
554
|
-
function
|
|
554
|
+
function hr(e, n) {
|
|
555
555
|
var t, r = n.from, a = n.to;
|
|
556
556
|
if (r && a) {
|
|
557
557
|
var o = H(a, r) < 0;
|
|
@@ -561,41 +561,41 @@ function mr(e, n) {
|
|
|
561
561
|
}
|
|
562
562
|
return a ? C(a, e) : r ? C(r, e) : !1;
|
|
563
563
|
}
|
|
564
|
-
function hr(e) {
|
|
565
|
-
return ut(e);
|
|
566
|
-
}
|
|
567
564
|
function pr(e) {
|
|
568
|
-
return
|
|
565
|
+
return ct(e);
|
|
569
566
|
}
|
|
570
|
-
function yr(e
|
|
567
|
+
function yr(e) {
|
|
568
|
+
return Array.isArray(e) && e.every(ct);
|
|
569
|
+
}
|
|
570
|
+
function br(e, n) {
|
|
571
571
|
return n.some(function(t) {
|
|
572
572
|
if (typeof t == "boolean")
|
|
573
573
|
return t;
|
|
574
|
-
if (hr(t))
|
|
575
|
-
return C(e, t);
|
|
576
574
|
if (pr(t))
|
|
575
|
+
return C(e, t);
|
|
576
|
+
if (yr(t))
|
|
577
577
|
return t.includes(e);
|
|
578
|
-
if (
|
|
579
|
-
return
|
|
580
|
-
if (
|
|
578
|
+
if (cr(t))
|
|
579
|
+
return hr(e, t);
|
|
580
|
+
if (mr(t))
|
|
581
581
|
return t.dayOfWeek.includes(e.getDay());
|
|
582
|
-
if (
|
|
583
|
-
var r = H(t.before, e), a = H(t.after, e), o = r > 0, i = a < 0, l =
|
|
582
|
+
if (ur(t)) {
|
|
583
|
+
var r = H(t.before, e), a = H(t.after, e), o = r > 0, i = a < 0, l = he(t.before, t.after);
|
|
584
584
|
return l ? i && o : o || i;
|
|
585
585
|
}
|
|
586
|
-
return
|
|
586
|
+
return fr(t) ? H(e, t.after) > 0 : vr(t) ? H(t.before, e) > 0 : typeof t == "function" ? t(e) : !1;
|
|
587
587
|
});
|
|
588
588
|
}
|
|
589
589
|
function Ke(e, n, t) {
|
|
590
590
|
var r = Object.keys(n).reduce(function(o, i) {
|
|
591
591
|
var l = n[i];
|
|
592
|
-
return
|
|
592
|
+
return br(e, l) && o.push(i), o;
|
|
593
593
|
}, []), a = {};
|
|
594
594
|
return r.forEach(function(o) {
|
|
595
595
|
return a[o] = !0;
|
|
596
596
|
}), t && !Be(e, t) && (a.outside = !0), a;
|
|
597
597
|
}
|
|
598
|
-
function
|
|
598
|
+
function gr(e, n) {
|
|
599
599
|
for (var t = E(e[0]), r = Re(e[e.length - 1]), a, o, i = t; i <= r; ) {
|
|
600
600
|
var l = Ke(i, n), s = !l.disabled && !l.hidden;
|
|
601
601
|
if (!s) {
|
|
@@ -608,27 +608,27 @@ function br(e, n) {
|
|
|
608
608
|
}
|
|
609
609
|
return o || a;
|
|
610
610
|
}
|
|
611
|
-
var
|
|
612
|
-
function
|
|
611
|
+
var _r = 365;
|
|
612
|
+
function Dt(e, n) {
|
|
613
613
|
var t = n.moveBy, r = n.direction, a = n.context, o = n.modifiers, i = n.retry, l = i === void 0 ? { count: 0, lastFocused: e } : i, s = a.weekStartsOn, c = a.fromDate, d = a.toDate, f = a.locale, v = {
|
|
614
614
|
day: W,
|
|
615
615
|
week: We,
|
|
616
616
|
month: T,
|
|
617
|
-
year:
|
|
617
|
+
year: Zt,
|
|
618
618
|
startOfWeek: function(b) {
|
|
619
619
|
return a.ISOWeek ? Fe(b) : Ae(b, { locale: f, weekStartsOn: s });
|
|
620
620
|
},
|
|
621
621
|
endOfWeek: function(b) {
|
|
622
|
-
return a.ISOWeek ?
|
|
622
|
+
return a.ISOWeek ? dt(b) : ut(b, { locale: f, weekStartsOn: s });
|
|
623
623
|
}
|
|
624
624
|
}, m = v[t](e, r === "after" ? 1 : -1);
|
|
625
|
-
r === "before" && c ? m =
|
|
625
|
+
r === "before" && c ? m = Vt([c, m]) : r === "after" && d && (m = Kt([d, m]));
|
|
626
626
|
var y = !0;
|
|
627
627
|
if (o) {
|
|
628
628
|
var _ = Ke(m, o);
|
|
629
629
|
y = !_.disabled && !_.hidden;
|
|
630
630
|
}
|
|
631
|
-
return y ? m : l.count >
|
|
631
|
+
return y ? m : l.count > _r ? l.lastFocused : Dt(m, {
|
|
632
632
|
moveBy: t,
|
|
633
633
|
direction: r,
|
|
634
634
|
context: a,
|
|
@@ -636,15 +636,15 @@ function wt(e, n) {
|
|
|
636
636
|
retry: g(g({}, l), { count: l.count + 1 })
|
|
637
637
|
});
|
|
638
638
|
}
|
|
639
|
-
var
|
|
640
|
-
function
|
|
641
|
-
var n =
|
|
639
|
+
var Mt = $(void 0);
|
|
640
|
+
function wr(e) {
|
|
641
|
+
var n = ce(), t = wt(), r = S(), a = r[0], o = r[1], i = S(), l = i[0], s = i[1], c = gr(n.displayMonths, t), d = a ?? (l && n.isDateDisplayed(l)) ? l : c, f = function() {
|
|
642
642
|
s(a), o(void 0);
|
|
643
643
|
}, v = function(b) {
|
|
644
644
|
o(b);
|
|
645
645
|
}, m = k(), y = function(b, M) {
|
|
646
646
|
if (a) {
|
|
647
|
-
var D =
|
|
647
|
+
var D = Dt(a, {
|
|
648
648
|
moveBy: b,
|
|
649
649
|
direction: M,
|
|
650
650
|
context: m,
|
|
@@ -688,29 +688,29 @@ function _r(e) {
|
|
|
688
688
|
return y("endOfWeek", "after");
|
|
689
689
|
}
|
|
690
690
|
};
|
|
691
|
-
return u(
|
|
691
|
+
return u(Mt.Provider, { value: _, children: e.children });
|
|
692
692
|
}
|
|
693
693
|
function Ue() {
|
|
694
|
-
var e =
|
|
694
|
+
var e = q(Mt);
|
|
695
695
|
if (!e)
|
|
696
696
|
throw new Error("useFocusContext must be used within a FocusProvider");
|
|
697
697
|
return e;
|
|
698
698
|
}
|
|
699
|
-
function
|
|
700
|
-
var t =
|
|
699
|
+
function Dr(e, n) {
|
|
700
|
+
var t = wt(), r = Ke(e, t, n);
|
|
701
701
|
return r;
|
|
702
702
|
}
|
|
703
|
-
var Xe =
|
|
704
|
-
function
|
|
705
|
-
if (!
|
|
703
|
+
var Xe = $(void 0);
|
|
704
|
+
function Mr(e) {
|
|
705
|
+
if (!be(e.initialProps)) {
|
|
706
706
|
var n = {
|
|
707
707
|
selected: void 0
|
|
708
708
|
};
|
|
709
709
|
return u(Xe.Provider, { value: n, children: e.children });
|
|
710
710
|
}
|
|
711
|
-
return u(
|
|
711
|
+
return u(kr, { initialProps: e.initialProps, children: e.children });
|
|
712
712
|
}
|
|
713
|
-
function
|
|
713
|
+
function kr(e) {
|
|
714
714
|
var n = e.initialProps, t = e.children, r = function(o, i, l) {
|
|
715
715
|
var s, c, d;
|
|
716
716
|
if ((s = n.onDayClick) === null || s === void 0 || s.call(n, o, i, l), i.selected && !n.required) {
|
|
@@ -724,16 +724,16 @@ function Mr(e) {
|
|
|
724
724
|
};
|
|
725
725
|
return u(Xe.Provider, { value: a, children: t });
|
|
726
726
|
}
|
|
727
|
-
function
|
|
728
|
-
var e =
|
|
727
|
+
function kt() {
|
|
728
|
+
var e = q(Xe);
|
|
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 t = k(), r =
|
|
735
|
-
var p,
|
|
736
|
-
|
|
733
|
+
function Nr(e, n) {
|
|
734
|
+
var t = k(), r = kt(), a = He(), o = Ve(), i = Ue(), l = i.focusDayAfter, s = i.focusDayBefore, c = i.focusWeekAfter, d = i.focusWeekBefore, f = i.blur, v = i.focus, m = i.focusMonthBefore, y = i.focusMonthAfter, _ = i.focusYearBefore, b = i.focusYearAfter, M = i.focusStartOfWeek, D = i.focusEndOfWeek, O = function(h) {
|
|
735
|
+
var p, z, ne, re;
|
|
736
|
+
be(t) ? (p = r.onDayClick) === null || p === void 0 || p.call(r, e, n, h) : de(t) ? (z = a.onDayClick) === null || z === void 0 || z.call(a, e, n, h) : ue(t) ? (ne = o.onDayClick) === null || ne === void 0 || ne.call(o, e, n, h) : (re = t.onDayClick) === null || re === void 0 || re.call(t, e, n, h);
|
|
737
737
|
}, B = function(h) {
|
|
738
738
|
var p;
|
|
739
739
|
v(e), (p = t.onDayFocus) === null || p === void 0 || p.call(t, e, n, h);
|
|
@@ -746,28 +746,28 @@ function kr(e, n) {
|
|
|
746
746
|
}, K = function(h) {
|
|
747
747
|
var p;
|
|
748
748
|
(p = t.onDayMouseLeave) === null || p === void 0 || p.call(t, e, n, h);
|
|
749
|
-
},
|
|
749
|
+
}, _e = function(h) {
|
|
750
750
|
var p;
|
|
751
751
|
(p = t.onDayPointerEnter) === null || p === void 0 || p.call(t, e, n, h);
|
|
752
|
-
},
|
|
752
|
+
}, fe = function(h) {
|
|
753
753
|
var p;
|
|
754
754
|
(p = t.onDayPointerLeave) === null || p === void 0 || p.call(t, e, n, h);
|
|
755
|
-
},
|
|
755
|
+
}, ee = function(h) {
|
|
756
756
|
var p;
|
|
757
757
|
(p = t.onDayTouchCancel) === null || p === void 0 || p.call(t, e, n, h);
|
|
758
|
-
},
|
|
758
|
+
}, X = function(h) {
|
|
759
759
|
var p;
|
|
760
760
|
(p = t.onDayTouchEnd) === null || p === void 0 || p.call(t, e, n, h);
|
|
761
|
-
},
|
|
761
|
+
}, ve = function(h) {
|
|
762
762
|
var p;
|
|
763
763
|
(p = t.onDayTouchMove) === null || p === void 0 || p.call(t, e, n, h);
|
|
764
|
-
},
|
|
764
|
+
}, J = function(h) {
|
|
765
765
|
var p;
|
|
766
766
|
(p = t.onDayTouchStart) === null || p === void 0 || p.call(t, e, n, h);
|
|
767
|
-
},
|
|
767
|
+
}, we = function(h) {
|
|
768
768
|
var p;
|
|
769
769
|
(p = t.onDayKeyUp) === null || p === void 0 || p.call(t, e, n, h);
|
|
770
|
-
},
|
|
770
|
+
}, Q = function(h) {
|
|
771
771
|
var p;
|
|
772
772
|
switch (h.key) {
|
|
773
773
|
case "ArrowLeft":
|
|
@@ -800,48 +800,48 @@ function kr(e, n) {
|
|
|
800
800
|
onClick: O,
|
|
801
801
|
onFocus: B,
|
|
802
802
|
onBlur: P,
|
|
803
|
-
onKeyDown:
|
|
804
|
-
onKeyUp:
|
|
803
|
+
onKeyDown: Q,
|
|
804
|
+
onKeyUp: we,
|
|
805
805
|
onMouseEnter: I,
|
|
806
806
|
onMouseLeave: K,
|
|
807
|
-
onPointerEnter:
|
|
808
|
-
onPointerLeave:
|
|
809
|
-
onTouchCancel:
|
|
810
|
-
onTouchEnd:
|
|
811
|
-
onTouchMove:
|
|
812
|
-
onTouchStart:
|
|
807
|
+
onPointerEnter: _e,
|
|
808
|
+
onPointerLeave: fe,
|
|
809
|
+
onTouchCancel: ee,
|
|
810
|
+
onTouchEnd: X,
|
|
811
|
+
onTouchMove: ve,
|
|
812
|
+
onTouchStart: J
|
|
813
813
|
};
|
|
814
814
|
return te;
|
|
815
815
|
}
|
|
816
|
-
function
|
|
817
|
-
var e = k(), n =
|
|
816
|
+
function Cr() {
|
|
817
|
+
var e = k(), n = kt(), t = He(), r = Ve(), a = be(e) ? n.selected : de(e) ? t.selected : ue(e) ? r.selected : void 0;
|
|
818
818
|
return a;
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function Pr(e) {
|
|
821
821
|
return Object.values(R).includes(e);
|
|
822
822
|
}
|
|
823
|
-
function
|
|
823
|
+
function xr(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 (Pr(r)) {
|
|
830
830
|
var o = e.classNames["day_".concat(r)];
|
|
831
831
|
o && t.push(o);
|
|
832
832
|
}
|
|
833
833
|
}), t;
|
|
834
834
|
}
|
|
835
|
-
function
|
|
835
|
+
function Or(e, n) {
|
|
836
836
|
var t = g({}, e.styles.day);
|
|
837
837
|
return Object.keys(n).forEach(function(r) {
|
|
838
838
|
var a;
|
|
839
839
|
t = g(g({}, t), (a = e.modifiersStyles) === null || a === void 0 ? void 0 : a[r]);
|
|
840
840
|
}), t;
|
|
841
841
|
}
|
|
842
|
-
function
|
|
843
|
-
var r, a, o, i = k(), l = Ue(), s =
|
|
844
|
-
|
|
842
|
+
function Ir(e, n, t) {
|
|
843
|
+
var r, a, o, i = k(), l = Ue(), s = Dr(e, n), c = Nr(e, s), d = Cr(), f = !!(i.onDayClick || i.mode !== "default");
|
|
844
|
+
ye(function() {
|
|
845
845
|
var I;
|
|
846
846
|
s.outside || l.focusedDay && f && C(l.focusedDay, e) && ((I = t.current) === null || I === void 0 || I.focus());
|
|
847
847
|
}, [
|
|
@@ -851,7 +851,7 @@ function Or(e, n, t) {
|
|
|
851
851
|
f,
|
|
852
852
|
s.outside
|
|
853
853
|
]);
|
|
854
|
-
var v =
|
|
854
|
+
var v = xr(i, s).join(" "), m = Or(i, s), y = !!(s.outside && !i.showOutsideDays || s.hidden), _ = (o = (a = i.components) === null || a === void 0 ? void 0 : a.DayContent) !== null && o !== void 0 ? o : Jn, b = u(_, { date: e, displayMonth: n, activeModifiers: s }), M = {
|
|
855
855
|
style: m,
|
|
856
856
|
className: v,
|
|
857
857
|
children: b,
|
|
@@ -866,30 +866,30 @@ function Or(e, n, t) {
|
|
|
866
866
|
};
|
|
867
867
|
return P;
|
|
868
868
|
}
|
|
869
|
-
function Ir(e) {
|
|
870
|
-
var n = he(null), t = Or(e.date, e.displayMonth, n);
|
|
871
|
-
return t.isHidden ? u("div", { role: "gridcell" }) : t.isButton ? u(ye, g({ name: "day", ref: n }, t.buttonProps)) : u("div", g({}, t.divProps));
|
|
872
|
-
}
|
|
873
869
|
function Wr(e) {
|
|
870
|
+
var n = oe(null), t = Ir(e.date, e.displayMonth, n);
|
|
871
|
+
return t.isHidden ? u("div", { role: "gridcell" }) : t.isButton ? u(pe, g({ name: "day", ref: n }, t.buttonProps)) : u("div", g({}, t.divProps));
|
|
872
|
+
}
|
|
873
|
+
function Er(e) {
|
|
874
874
|
var n = e.number, t = e.dates, r = k(), a = r.onWeekNumberClick, o = r.styles, i = r.classNames, l = r.locale, s = r.labels.labelWeekNumber, c = r.formatters.formatWeekNumber, d = c(Number(n), { locale: l });
|
|
875
875
|
if (!a)
|
|
876
876
|
return u("span", { className: i.weeknumber, style: o.weeknumber, children: d });
|
|
877
877
|
var f = s(Number(n), { locale: l }), v = function(m) {
|
|
878
878
|
a(n, t, m);
|
|
879
879
|
};
|
|
880
|
-
return u(
|
|
880
|
+
return u(pe, { name: "week-number", "aria-label": f, className: i.weeknumber, style: o.weeknumber, onClick: v, children: d });
|
|
881
881
|
}
|
|
882
|
-
function
|
|
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 :
|
|
882
|
+
function Sr(e) {
|
|
883
|
+
var n, t, r = k(), a = r.styles, o = r.classNames, i = r.showWeekNumber, l = r.components, s = (n = l == null ? void 0 : l.Day) !== null && n !== void 0 ? n : Wr, c = (t = l == null ? void 0 : l.WeekNumber) !== null && t !== void 0 ? t : Er, d;
|
|
884
884
|
return i && (d = u("td", { className: o.cell, style: a.cell, children: u(c, { number: e.weekNumber, dates: e.dates }) })), F("tr", { className: o.row, style: a.row, children: [d, e.dates.map(function(f) {
|
|
885
|
-
return u("td", { className: o.cell, style: a.cell, role: "presentation", children: u(s, { displayMonth: e.displayMonth, date: f }) },
|
|
885
|
+
return u("td", { className: o.cell, style: a.cell, role: "presentation", children: u(s, { displayMonth: e.displayMonth, date: f }) }, At(f));
|
|
886
886
|
})] });
|
|
887
887
|
}
|
|
888
|
-
function
|
|
889
|
-
for (var r = t != null && t.ISOWeek ?
|
|
888
|
+
function at(e, n, t) {
|
|
889
|
+
for (var r = t != null && t.ISOWeek ? dt(n) : ut(n, t), a = t != null && t.ISOWeek ? Fe(e) : Ae(e, t), o = H(r, a), i = [], l = 0; l <= o; l++)
|
|
890
890
|
i.push(W(a, l));
|
|
891
891
|
var s = i.reduce(function(c, d) {
|
|
892
|
-
var f = t != null && t.ISOWeek ?
|
|
892
|
+
var f = t != null && t.ISOWeek ? Ut(d) : Xt(d, t), v = c.find(function(m) {
|
|
893
893
|
return m.weekNumber === f;
|
|
894
894
|
});
|
|
895
895
|
return v ? (v.dates.push(d), c) : (c.push({
|
|
@@ -899,57 +899,57 @@ function rt(e, n, t) {
|
|
|
899
899
|
}, []);
|
|
900
900
|
return s;
|
|
901
901
|
}
|
|
902
|
-
function
|
|
903
|
-
var t =
|
|
902
|
+
function Lr(e, n) {
|
|
903
|
+
var t = at(E(e), Re(e), n);
|
|
904
904
|
if (n != null && n.useFixedWeeks) {
|
|
905
|
-
var r =
|
|
905
|
+
var r = Yt(e, n);
|
|
906
906
|
if (r < 6) {
|
|
907
|
-
var a = t[t.length - 1], o = a.dates[a.dates.length - 1], i = We(o, 6 - r), l =
|
|
907
|
+
var a = t[t.length - 1], o = a.dates[a.dates.length - 1], i = We(o, 6 - r), l = at(We(o, 1), i, n);
|
|
908
908
|
t.push.apply(t, l);
|
|
909
909
|
}
|
|
910
910
|
}
|
|
911
911
|
return t;
|
|
912
912
|
}
|
|
913
|
-
function
|
|
914
|
-
var n, t, r, a = k(), o = a.locale, i = a.classNames, l = a.styles, s = a.hideHead, c = a.fixedWeeks, d = a.components, f = a.weekStartsOn, v = a.firstWeekContainsDate, m = a.ISOWeek, y =
|
|
913
|
+
function Rr(e) {
|
|
914
|
+
var n, t, r, a = k(), o = a.locale, i = a.classNames, l = a.styles, s = a.hideHead, c = a.fixedWeeks, d = a.components, f = a.weekStartsOn, v = a.firstWeekContainsDate, m = a.ISOWeek, y = Lr(e.displayMonth, {
|
|
915
915
|
useFixedWeeks: !!c,
|
|
916
916
|
ISOWeek: m,
|
|
917
917
|
locale: o,
|
|
918
918
|
weekStartsOn: f,
|
|
919
919
|
firstWeekContainsDate: v
|
|
920
|
-
}), _ = (n = d == null ? void 0 : d.Head) !== null && n !== void 0 ? n :
|
|
920
|
+
}), _ = (n = d == null ? void 0 : d.Head) !== null && n !== void 0 ? n : qn, b = (t = d == null ? void 0 : d.Row) !== null && t !== void 0 ? t : Sr, M = (r = d == null ? void 0 : d.Footer) !== null && r !== void 0 ? r : Zn;
|
|
921
921
|
return F("table", { id: e.id, className: i.table, style: l.table, role: "grid", "aria-labelledby": e["aria-labelledby"], children: [!s && u(_, {}), u("tbody", { className: i.tbody, style: l.tbody, children: y.map(function(D) {
|
|
922
922
|
return u(b, { displayMonth: e.displayMonth, dates: D.dates, weekNumber: D.weekNumber }, D.weekNumber);
|
|
923
923
|
}) }), u(M, { displayMonth: e.displayMonth })] });
|
|
924
924
|
}
|
|
925
|
-
function
|
|
925
|
+
function Br() {
|
|
926
926
|
return !!(typeof window < "u" && window.document && window.document.createElement);
|
|
927
927
|
}
|
|
928
|
-
var
|
|
929
|
-
function
|
|
930
|
-
return "react-day-picker-".concat(++
|
|
928
|
+
var Tr = Br() ? Ft : ye, xe = !1, Fr = 0;
|
|
929
|
+
function ot() {
|
|
930
|
+
return "react-day-picker-".concat(++Fr);
|
|
931
931
|
}
|
|
932
|
-
function
|
|
933
|
-
var n, t = e ?? (xe ?
|
|
934
|
-
return
|
|
935
|
-
a === null && o(
|
|
936
|
-
}, []),
|
|
932
|
+
function Ar(e) {
|
|
933
|
+
var n, t = e ?? (xe ? ot() : null), r = S(t), a = r[0], o = r[1];
|
|
934
|
+
return Tr(function() {
|
|
935
|
+
a === null && o(ot());
|
|
936
|
+
}, []), ye(function() {
|
|
937
937
|
xe === !1 && (xe = !0);
|
|
938
938
|
}, []), (n = e ?? a) !== null && n !== void 0 ? n : void 0;
|
|
939
939
|
}
|
|
940
|
-
function
|
|
941
|
-
var n, t, r = k(), a = r.dir, o = r.classNames, i = r.styles, l = r.components, s =
|
|
940
|
+
function Yr(e) {
|
|
941
|
+
var n, t, r = k(), a = r.dir, o = r.classNames, i = r.styles, l = r.components, s = ce().displayMonths, c = Ar(r.id ? "".concat(r.id, "-").concat(e.displayIndex) : void 0), d = r.id ? "".concat(r.id, "-grid-").concat(e.displayIndex) : void 0, f = [o.month], v = i.month, m = e.displayIndex === 0, y = e.displayIndex === s.length - 1, _ = !m && !y;
|
|
942
942
|
a === "rtl" && (n = [m, y], y = n[0], m = n[1]), m && (f.push(o.caption_start), v = g(g({}, v), i.caption_start)), y && (f.push(o.caption_end), v = g(g({}, v), i.caption_end)), _ && (f.push(o.caption_between), v = g(g({}, v), i.caption_between));
|
|
943
|
-
var b = (t = l == null ? void 0 : l.Caption) !== null && t !== void 0 ? t :
|
|
944
|
-
return F("div", { className: f.join(" "), style: v, children: [u(b, { id: c, displayMonth: e.displayMonth, displayIndex: e.displayIndex }), u(
|
|
943
|
+
var b = (t = l == null ? void 0 : l.Caption) !== null && t !== void 0 ? t : Xn;
|
|
944
|
+
return F("div", { className: f.join(" "), style: v, children: [u(b, { id: c, displayMonth: e.displayMonth, displayIndex: e.displayIndex }), u(Rr, { id: d, "aria-labelledby": c, displayMonth: e.displayMonth })] }, e.displayIndex);
|
|
945
945
|
}
|
|
946
|
-
function
|
|
946
|
+
function Hr(e) {
|
|
947
947
|
var n = k(), t = n.classNames, r = n.styles;
|
|
948
948
|
return u("div", { className: t.months, style: r.months, children: e.children });
|
|
949
949
|
}
|
|
950
|
-
function
|
|
951
|
-
var n, t, r = e.initialProps, a = k(), o = Ue(), i =
|
|
952
|
-
|
|
950
|
+
function jr(e) {
|
|
951
|
+
var n, t, r = e.initialProps, a = k(), o = Ue(), i = ce(), l = S(!1), s = l[0], c = l[1];
|
|
952
|
+
ye(function() {
|
|
953
953
|
a.initialFocus && o.focusTarget && (s || (o.focus(o.focusTarget), c(!0)));
|
|
954
954
|
}, [
|
|
955
955
|
a.initialFocus,
|
|
@@ -965,77 +965,77 @@ function Hr(e) {
|
|
|
965
965
|
}).reduce(function(y, _) {
|
|
966
966
|
var b;
|
|
967
967
|
return g(g({}, y), (b = {}, b[_] = r[_], b));
|
|
968
|
-
}, {}), m = (t = (n = r.components) === null || n === void 0 ? void 0 : n.Months) !== null && t !== void 0 ? t :
|
|
968
|
+
}, {}), m = (t = (n = r.components) === null || n === void 0 ? void 0 : n.Months) !== null && t !== void 0 ? t : Hr;
|
|
969
969
|
return u("div", g({ className: d.join(" "), style: f, dir: a.dir, id: a.id, nonce: r.nonce, title: r.title, lang: r.lang }, v, { children: u(m, { children: i.displayMonths.map(function(y, _) {
|
|
970
|
-
return u(
|
|
970
|
+
return u(Yr, { displayIndex: _, displayMonth: y }, _);
|
|
971
971
|
}) }) }));
|
|
972
972
|
}
|
|
973
|
-
function jr(e) {
|
|
974
|
-
var n = e.children, t = fn(e, ["children"]);
|
|
975
|
-
return u(Wn, { initialProps: t, children: u(Hn, { children: u(Dr, { initialProps: t, children: u(Jn, { initialProps: t, children: u(er, { initialProps: t, children: u(sr, { children: u(_r, { children: n }) }) }) }) }) }) });
|
|
976
|
-
}
|
|
977
973
|
function Vr(e) {
|
|
978
|
-
|
|
974
|
+
var n = e.children, t = vn(e, ["children"]);
|
|
975
|
+
return u(En, { initialProps: t, children: u(jn, { children: u(Mr, { initialProps: t, children: u(Qn, { initialProps: t, children: u(tr, { initialProps: t, children: u(dr, { children: u(wr, { children: n }) }) }) }) }) }) });
|
|
979
976
|
}
|
|
980
|
-
|
|
981
|
-
|
|
977
|
+
function Kr(e) {
|
|
978
|
+
return u(Vr, g({}, e, { children: u(jr, { initialProps: e }) }));
|
|
979
|
+
}
|
|
980
|
+
const Ur = 329, U = 12, ge = 26, Nt = 20, Le = 9, it = 12, Ct = (e, n) => e.top > n.height + ge ? j.positionabove : j.positionbelow, Xr = (e) => e.left + e.width / 4, Zr = (e) => document.documentElement.clientWidth - e.right + e.width / 4, Gr = (e, n) => e.left + n.width, $r = (e) => e.left > U, qr = (e, n) => Gr(e, n) < document.documentElement.clientWidth - U, Jr = (e, n) => qr(e, n) ? $r(e) ? "floating" : "left" : "right", Oe = (e, n) => e.top - ge - n.height, Ie = (e) => e.bottom + ge, Qr = () => document.documentElement.clientWidth - U * 2, zr = () => document.documentElement.clientWidth > Ur + U * 2, lt = (e) => e.top - ge - Le + 5, ea = (e) => Xr(e) - Nt / 2, ta = (e) => Zr(e) - Nt / 2, na = (e, n) => {
|
|
981
|
+
const t = Jr(e, n), r = Ct(e, n);
|
|
982
982
|
return t === "left" ? r === j.positionabove ? "leftabove" : "leftbelow" : t === "right" ? r === j.positionabove ? "rightabove" : "rightbelow" : r === j.positionabove ? "floatingabove" : "floatingbelow";
|
|
983
|
-
},
|
|
984
|
-
const t =
|
|
983
|
+
}, ra = (e, n) => {
|
|
984
|
+
const t = na(e, n), r = zr() ? void 0 : Qr();
|
|
985
985
|
return t === "leftabove" ? {
|
|
986
986
|
left: U,
|
|
987
987
|
top: Oe(e, n),
|
|
988
988
|
width: r
|
|
989
989
|
} : t === "leftbelow" ? { left: U, top: Ie(e), width: r } : t === "rightabove" ? { right: U, top: Oe(e, n), width: r } : t === "rightbelow" ? { right: U, top: Ie(e), width: r } : t === "floatingbelow" ? { left: e.left, top: Ie(e), width: r } : { left: e.left, top: Oe(e, n), width: r };
|
|
990
|
-
},
|
|
991
|
-
const r =
|
|
990
|
+
}, aa = (e, n, t) => {
|
|
991
|
+
const r = ea(n), a = ta(n), o = e.left + it, i = e.right + it;
|
|
992
992
|
return e.right ? t === j.positionabove ? {
|
|
993
993
|
right: a > i ? a : i,
|
|
994
|
-
top:
|
|
994
|
+
top: lt(n)
|
|
995
995
|
} : {
|
|
996
996
|
right: a > i ? a : i,
|
|
997
997
|
top: n.bottom + Le
|
|
998
998
|
} : t === j.positionabove ? {
|
|
999
999
|
left: r > o ? r : o,
|
|
1000
|
-
top:
|
|
1000
|
+
top: lt(n)
|
|
1001
1001
|
} : {
|
|
1002
1002
|
left: r > o ? r : o,
|
|
1003
1003
|
top: n.bottom + Le
|
|
1004
1004
|
};
|
|
1005
|
-
},
|
|
1006
|
-
const { datepickerWrapperRef: n, footer: t, inputRef: r, testId: a, zIndex: o, ...i } = e, l =
|
|
1007
|
-
|
|
1005
|
+
}, oa = (e) => {
|
|
1006
|
+
const { datepickerWrapperRef: n, footer: t, inputRef: r, testId: a, zIndex: o, ...i } = e, l = oe(null), [s, c] = S(), d = dn(n), f = ln(r, 0);
|
|
1007
|
+
an(n, !0);
|
|
1008
1008
|
const v = () => {
|
|
1009
1009
|
var O;
|
|
1010
1010
|
c((O = r.current) == null ? void 0 : O.getBoundingClientRect());
|
|
1011
1011
|
};
|
|
1012
1012
|
w.useEffect(() => {
|
|
1013
1013
|
v();
|
|
1014
|
-
}, []),
|
|
1014
|
+
}, []), on(v, 500), sn(v, ["scroll", "resize"], 10);
|
|
1015
1015
|
const m = Se(x["datepicker-popup-container"], {
|
|
1016
1016
|
[x["datepicker-popup-container--visible"]]: f
|
|
1017
|
-
}), y = s && d &&
|
|
1017
|
+
}), y = s && d && Ct(s, d), _ = Se(x["datepicker-popup-arrow"], {
|
|
1018
1018
|
[x["datepicker-popup-arrow--visible"]]: f,
|
|
1019
1019
|
[x["datepicker-popup-arrow--over"]]: y === j.positionbelow,
|
|
1020
1020
|
[x["datepicker-popup-arrow--under"]]: y === j.positionabove
|
|
1021
|
-
}), b = s && d &&
|
|
1022
|
-
...
|
|
1021
|
+
}), b = s && d && ra(s, d), M = b && s && y && aa(b, s, y), D = {
|
|
1022
|
+
...rn,
|
|
1023
1023
|
...x
|
|
1024
1024
|
};
|
|
1025
1025
|
return /* @__PURE__ */ w.createElement(w.Fragment, null, /* @__PURE__ */ w.createElement("div", { className: m, "data-testid": a, ref: n, style: { ...b, zIndex: o } }, /* @__PURE__ */ w.createElement(
|
|
1026
|
-
|
|
1026
|
+
Kr,
|
|
1027
1027
|
{
|
|
1028
1028
|
captionLayout: "dropdown-buttons",
|
|
1029
1029
|
classNames: D,
|
|
1030
1030
|
mode: "single",
|
|
1031
|
-
style: { "--rdp-cell-size":
|
|
1031
|
+
style: { "--rdp-cell-size": un("l") },
|
|
1032
1032
|
modifiersClassNames: { today: x["day--today"], selected: x.day_selected, disabled: x["day--disabled"] },
|
|
1033
1033
|
footer: /* @__PURE__ */ w.createElement("span", { className: x["footer-wrapper"] }, t),
|
|
1034
1034
|
fixedWeeks: !0,
|
|
1035
1035
|
...i
|
|
1036
1036
|
}
|
|
1037
1037
|
)), /* @__PURE__ */ w.createElement("div", { ref: l, className: _, style: { ...M, zIndex: o } }));
|
|
1038
|
-
},
|
|
1038
|
+
}, Pt = w.forwardRef((e, n) => {
|
|
1039
1039
|
const {
|
|
1040
1040
|
className: t,
|
|
1041
1041
|
dateButtonAriaLabel: r,
|
|
@@ -1052,49 +1052,49 @@ const Kr = 329, U = 12, _e = 26, kt = 20, Le = 9, ot = 12, Nt = (e, n) => e.top
|
|
|
1052
1052
|
footerContent: y,
|
|
1053
1053
|
label: _,
|
|
1054
1054
|
inputId: b,
|
|
1055
|
-
locale: M =
|
|
1055
|
+
locale: M = qt,
|
|
1056
1056
|
maxDate: D,
|
|
1057
1057
|
minDate: O,
|
|
1058
1058
|
onBlur: B,
|
|
1059
1059
|
onChange: P,
|
|
1060
1060
|
testId: I,
|
|
1061
1061
|
autoComplete: K = "off",
|
|
1062
|
-
zIndex:
|
|
1063
|
-
...
|
|
1064
|
-
} = e, [
|
|
1062
|
+
zIndex: _e = en.PopOver,
|
|
1063
|
+
...fe
|
|
1064
|
+
} = e, [ee, X] = S(o), [ve, J] = S(ee ? L(ee, a) : ""), [we, Q] = S(i), [te, h] = S(!1), [p, z] = S(!1), ne = {
|
|
1065
1065
|
dayOfWeek: [0, 6]
|
|
1066
|
-
}, re = d ? [...c, ne] : c, ae =
|
|
1067
|
-
|
|
1068
|
-
var
|
|
1069
|
-
const
|
|
1070
|
-
(
|
|
1066
|
+
}, re = d ? [...c, ne] : c, Ze = oe(null), ae = oe(null), De = oe(null), { refObject: A } = ft(vt(n) ? n : null), Ge = mt([n, A]);
|
|
1067
|
+
tn(ae, (N) => {
|
|
1068
|
+
var G;
|
|
1069
|
+
const Z = N.target;
|
|
1070
|
+
(G = ae == null ? void 0 : ae.current) != null && G.contains(Z) || h(!1);
|
|
1071
1071
|
}), w.useEffect(() => {
|
|
1072
|
-
|
|
1072
|
+
se(o) ? (J(o ? L(o, a) : ""), X(o), Q(o)) : (J(""), X(void 0), Q(void 0));
|
|
1073
1073
|
}, [o]), w.useEffect(() => {
|
|
1074
1074
|
p && A.current && A.current.focus();
|
|
1075
1075
|
}, [p]);
|
|
1076
|
-
const
|
|
1076
|
+
const $e = () => {
|
|
1077
1077
|
A != null && A.current && A.current.focus(), h(!1);
|
|
1078
1078
|
};
|
|
1079
|
-
|
|
1080
|
-
const
|
|
1081
|
-
|
|
1082
|
-
const
|
|
1083
|
-
|
|
1084
|
-
},
|
|
1085
|
-
p ?
|
|
1086
|
-
},
|
|
1087
|
-
if (
|
|
1079
|
+
et(De, $e, [ze.Escape]), et(Ze, $e, [ze.Escape]);
|
|
1080
|
+
const qe = (N, Z) => {
|
|
1081
|
+
J(N.currentTarget.value);
|
|
1082
|
+
const G = ie(N.currentTarget.value, Z, /* @__PURE__ */ new Date());
|
|
1083
|
+
se(G) ? (X(G), Q(G)) : X(void 0), P && P(N, N.currentTarget.value);
|
|
1084
|
+
}, It = () => {
|
|
1085
|
+
p ? z(!1) : h(!0);
|
|
1086
|
+
}, Wt = (N, Z, G, Bt) => {
|
|
1087
|
+
if (z(!0), !N) {
|
|
1088
1088
|
h(!1);
|
|
1089
1089
|
return;
|
|
1090
1090
|
}
|
|
1091
|
-
|
|
1092
|
-
}, Wt = (N) => {
|
|
1093
|
-
var X;
|
|
1094
|
-
(X = ve.current) != null && X.contains(N.relatedTarget) || h(!1), B && B(N);
|
|
1091
|
+
X(N), A.current && (J(L(N, a)), h(!1)), P && P(Bt, N);
|
|
1095
1092
|
}, Et = (N) => {
|
|
1093
|
+
var Z;
|
|
1094
|
+
(Z = De.current) != null && Z.contains(N.relatedTarget) || h(!1), B && B(N);
|
|
1095
|
+
}, St = (N) => {
|
|
1096
1096
|
N == null || N.stopPropagation(), h(!te);
|
|
1097
|
-
},
|
|
1097
|
+
}, Lt = /* @__PURE__ */ w.createElement(
|
|
1098
1098
|
Ee,
|
|
1099
1099
|
{
|
|
1100
1100
|
disabled: s,
|
|
@@ -1106,17 +1106,17 @@ const Kr = 329, U = 12, _e = 26, kt = 20, Le = 9, ot = 12, Nt = (e, n) => e.top
|
|
|
1106
1106
|
max: D ? L(D, "yyyy-MM-dd") : "",
|
|
1107
1107
|
min: O ? L(O, "yyyy-MM-dd") : "",
|
|
1108
1108
|
type: "date",
|
|
1109
|
-
ref:
|
|
1110
|
-
value:
|
|
1109
|
+
ref: Ge,
|
|
1110
|
+
value: ve,
|
|
1111
1111
|
width: 14,
|
|
1112
|
-
...
|
|
1112
|
+
...fe,
|
|
1113
1113
|
onBlur: (N) => {
|
|
1114
1114
|
B && B(N);
|
|
1115
1115
|
},
|
|
1116
|
-
onChange: (N) =>
|
|
1116
|
+
onChange: (N) => qe(N, "yyyy-MM-dd"),
|
|
1117
1117
|
autoComplete: K || void 0
|
|
1118
1118
|
}
|
|
1119
|
-
),
|
|
1119
|
+
), Rt = /* @__PURE__ */ w.createElement(w.Fragment, null, /* @__PURE__ */ w.createElement("div", null, /* @__PURE__ */ w.createElement(
|
|
1120
1120
|
Ee,
|
|
1121
1121
|
{
|
|
1122
1122
|
disabled: s,
|
|
@@ -1124,63 +1124,64 @@ const Kr = 329, U = 12, _e = 26, kt = 20, Le = 9, ot = 12, Nt = (e, n) => e.top
|
|
|
1124
1124
|
errorText: v,
|
|
1125
1125
|
errorTextId: m,
|
|
1126
1126
|
inputId: b,
|
|
1127
|
-
|
|
1127
|
+
inputContainerRef: ae,
|
|
1128
|
+
inputWrapperRef: Ze,
|
|
1128
1129
|
label: _,
|
|
1129
|
-
onFocus:
|
|
1130
|
+
onFocus: It,
|
|
1130
1131
|
type: "text",
|
|
1131
|
-
ref:
|
|
1132
|
-
value:
|
|
1132
|
+
ref: Ge,
|
|
1133
|
+
value: ve,
|
|
1133
1134
|
width: 12,
|
|
1134
|
-
...
|
|
1135
|
-
onBlur:
|
|
1136
|
-
onChange: (N) =>
|
|
1135
|
+
...fe,
|
|
1136
|
+
onBlur: Et,
|
|
1137
|
+
onChange: (N) => qe(N, a),
|
|
1137
1138
|
rightOfInput: /* @__PURE__ */ w.createElement(
|
|
1138
|
-
|
|
1139
|
+
Jt,
|
|
1139
1140
|
{
|
|
1140
1141
|
disabled: s,
|
|
1141
1142
|
ariaLabel: r ?? "Velg dato",
|
|
1142
|
-
onClick:
|
|
1143
|
+
onClick: St,
|
|
1143
1144
|
tabIndex: te ? -1 : 0,
|
|
1144
1145
|
variant: "borderless",
|
|
1145
1146
|
wrapperClassName: x["date-button"],
|
|
1146
1147
|
className: x["date-button__inner"]
|
|
1147
1148
|
},
|
|
1148
|
-
/* @__PURE__ */ w.createElement(
|
|
1149
|
+
/* @__PURE__ */ w.createElement(Qt, { color: "black", svgIcon: zt })
|
|
1149
1150
|
),
|
|
1150
1151
|
autoComplete: K || void 0
|
|
1151
1152
|
}
|
|
1152
1153
|
)), te && !s && /* @__PURE__ */ w.createElement(
|
|
1153
|
-
|
|
1154
|
+
oa,
|
|
1154
1155
|
{
|
|
1155
1156
|
dir: l,
|
|
1156
1157
|
disabled: re,
|
|
1157
|
-
datepickerWrapperRef:
|
|
1158
|
+
datepickerWrapperRef: De,
|
|
1158
1159
|
footer: y,
|
|
1159
1160
|
fromDate: O,
|
|
1160
1161
|
toDate: D,
|
|
1161
1162
|
inputRef: A,
|
|
1162
1163
|
locale: M,
|
|
1163
|
-
month:
|
|
1164
|
-
selected:
|
|
1165
|
-
onSelect:
|
|
1166
|
-
onMonthChange:
|
|
1167
|
-
zIndex:
|
|
1164
|
+
month: we,
|
|
1165
|
+
selected: ee,
|
|
1166
|
+
onSelect: Wt,
|
|
1167
|
+
onMonthChange: Q,
|
|
1168
|
+
zIndex: _e
|
|
1168
1169
|
}
|
|
1169
1170
|
));
|
|
1170
|
-
return /* @__PURE__ */ w.createElement("div", { className: t, "data-testid": I },
|
|
1171
|
+
return /* @__PURE__ */ w.createElement("div", { className: t, "data-testid": I }, nn() ? Lt : Rt);
|
|
1171
1172
|
});
|
|
1172
|
-
|
|
1173
|
-
const
|
|
1173
|
+
Pt.displayName = "DatePicker";
|
|
1174
|
+
const st = (e) => {
|
|
1174
1175
|
const n = String(e);
|
|
1175
1176
|
return n.length === 1 ? "0" + n : n;
|
|
1176
|
-
},
|
|
1177
|
+
}, ia = (e) => !e || /^\d+$/.test(e) && e.length <= 2, xt = w.forwardRef((e, n) => {
|
|
1177
1178
|
const { defaultValue: t, error: r, errorText: a, errorTextId: o, label: i, onChange: l, timeUnit: s, testId: c, inputId: d, autoComplete: f = "off", ...v } = e, [m, y] = S(
|
|
1178
|
-
typeof t < "u" ?
|
|
1179
|
-
), { refObject: _ } =
|
|
1179
|
+
typeof t < "u" ? st(t) : ""
|
|
1180
|
+
), { refObject: _ } = ft(vt(n) ? n : null), b = mt([n, _]), M = (P) => {
|
|
1180
1181
|
const I = P.target.value;
|
|
1181
|
-
|
|
1182
|
+
ia(I) && (y(I), l && l(P));
|
|
1182
1183
|
}, D = (P) => {
|
|
1183
|
-
const I =
|
|
1184
|
+
const I = st(P.target.value);
|
|
1184
1185
|
y(I), l && l(P);
|
|
1185
1186
|
}, O = (P) => {
|
|
1186
1187
|
const I = /[0-9]/, K = ["Backspace", " ", "Enter", "Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"];
|
|
@@ -1209,49 +1210,49 @@ const lt = (e) => {
|
|
|
1209
1210
|
}
|
|
1210
1211
|
));
|
|
1211
1212
|
});
|
|
1212
|
-
|
|
1213
|
-
const
|
|
1214
|
-
const { children: t, errorText: r, legend: a, testId: o } = e, i =
|
|
1213
|
+
xt.displayName = "DateTime";
|
|
1214
|
+
const la = w.forwardRef((e, n) => {
|
|
1215
|
+
const { children: t, errorText: r, legend: a, testId: o } = e, i = fn(), l = (s) => tt(s, Pt) ? w.cloneElement(s, {
|
|
1215
1216
|
className: Se(x["date-time-picker-wrapper__date-picker"]),
|
|
1216
1217
|
error: !!r,
|
|
1217
1218
|
errorTextId: i
|
|
1218
|
-
}) :
|
|
1219
|
+
}) : tt(s, xt) ? w.cloneElement(s, {
|
|
1219
1220
|
error: !!r,
|
|
1220
1221
|
errorTextId: i
|
|
1221
1222
|
}) : s;
|
|
1222
|
-
return /* @__PURE__ */ w.createElement("div", { ref: n, tabIndex: -1 }, /* @__PURE__ */ w.createElement(
|
|
1223
|
+
return /* @__PURE__ */ w.createElement("div", { ref: n, tabIndex: -1 }, /* @__PURE__ */ w.createElement(cn, { errorText: r, errorTextId: i }, e.legend ? /* @__PURE__ */ w.createElement("fieldset", { className: x["date-time-picker-wrapper"], "data-testid": o }, e.legend && /* @__PURE__ */ w.createElement("legend", { className: x["date-time-picker-wrapper__legend"] }, a), w.Children.map(t, l)) : /* @__PURE__ */ w.createElement("div", { className: x["date-time-picker-wrapper"] }, w.Children.map(t, l))));
|
|
1223
1224
|
});
|
|
1224
|
-
|
|
1225
|
-
const
|
|
1225
|
+
la.displayName = "DateTimePickerWrapper";
|
|
1226
|
+
const Ot = (e) => {
|
|
1226
1227
|
const n = ["yyyy-MM-dd", "dd.MM.yyyy"];
|
|
1227
1228
|
for (const t of n) {
|
|
1228
|
-
const r =
|
|
1229
|
-
if (
|
|
1229
|
+
const r = ie(e, t, /* @__PURE__ */ new Date());
|
|
1230
|
+
if (se(r))
|
|
1230
1231
|
return r;
|
|
1231
1232
|
}
|
|
1232
1233
|
return null;
|
|
1233
|
-
},
|
|
1234
|
+
}, Ra = (e) => {
|
|
1234
1235
|
const n = new Date(e);
|
|
1235
1236
|
return n instanceof Date && !isNaN(n.getTime());
|
|
1236
|
-
},
|
|
1237
|
-
const a =
|
|
1238
|
-
return !a || o && !
|
|
1239
|
-
},
|
|
1240
|
-
const r =
|
|
1237
|
+
}, Ba = (e, n, t, r) => {
|
|
1238
|
+
const a = Ot(e), o = typeof t < "u", i = typeof r < "u";
|
|
1239
|
+
return !a || o && !se(t) || i && !se(r) ? "Invalid date format" : o && !i && (C(a, t) || he(a, t)) || i && !o && (C(a, r) || Te(a, r)) || o && i && (C(a, t) || C(a, r) || Gt(a, { start: t, end: r })) ? !0 : n;
|
|
1240
|
+
}, Ta = (e, n, t) => {
|
|
1241
|
+
const r = Ot(e);
|
|
1241
1242
|
return r ? n.some((a) => C(a, r)) ? t : !0 : "Invalid date format";
|
|
1242
|
-
},
|
|
1243
|
-
const a =
|
|
1243
|
+
}, Fa = (e, n, t, r) => {
|
|
1244
|
+
const a = ie((e.hour + ":" + e.minute).toString(), "HH:mm", /* @__PURE__ */ new Date()), o = ie(((t == null ? void 0 : t.hour) + ":" + (t == null ? void 0 : t.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());
|
|
1244
1245
|
return (typeof t > "u" || a >= o) && (typeof r > "u" || a <= i) ? !0 : n;
|
|
1245
1246
|
};
|
|
1246
1247
|
export {
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1248
|
+
Pt as DatePicker,
|
|
1249
|
+
xt as DateTime,
|
|
1250
|
+
la as DateTimePickerWrapper,
|
|
1251
|
+
Pt as default,
|
|
1252
|
+
Ra as isValidDate,
|
|
1253
|
+
Ot as parseInputDate,
|
|
1254
|
+
Ta as validateDisabledDates,
|
|
1255
|
+
Ba as validateMinMaxDate,
|
|
1256
|
+
Fa as validateMinTimeMaxTime
|
|
1256
1257
|
};
|
|
1257
1258
|
//# sourceMappingURL=index.js.map
|