@oslokommune/punkt-elements 16.7.1 → 16.7.3
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 +17 -0
- package/dist/accordionitem-_9AiCIvd.cjs +34 -0
- package/dist/{accordionitem-ZlaXvjt5.js → accordionitem-dCfSrxh5.js} +57 -55
- package/dist/alert-BtOk8yRH.cjs +33 -0
- package/dist/{alert-BuAXrnKl.js → alert-DlY2_grU.js} +48 -46
- package/dist/backlink-Ce5Vldop.js +49 -0
- package/dist/backlink-y3dwjKPC.cjs +13 -0
- package/dist/button-B_TXwNzt.cjs +27 -0
- package/dist/{button-DEyvt1LI.js → button-BiY-wlKF.js} +79 -77
- package/dist/calendar-B2pji2zn.cjs +90 -0
- package/dist/{calendar-S63oreVW.js → calendar-DhjQDC4C.js} +689 -687
- package/dist/card-BwMNB5Bb.cjs +87 -0
- package/dist/{card-DDiLfuO4.js → card-CGlmcMSR.js} +99 -97
- package/dist/checkbox-BsJZYA26.js +147 -0
- package/dist/checkbox-CTY8f_qn.cjs +31 -0
- package/dist/{combobox-BmxSecfE.js → combobox-DSB5WOxg.js} +223 -226
- package/dist/{combobox-Hb2V-fPX.cjs → combobox-DbICIgKG.cjs} +4 -4
- package/dist/consent-DkOQpbsg.cjs +11 -0
- package/dist/{consent-iXyx5v6J.js → consent-SNWV_mMU.js} +48 -46
- package/dist/datepicker-BEWl9iz3.cjs +273 -0
- package/dist/{datepicker-CZl7b8Na.js → datepicker-euHyzXnb.js} +341 -329
- package/dist/{heading-CKt7cVn7.js → heading-D2tVS6lS.js} +30 -28
- package/dist/heading-DrzbgDb6.cjs +1 -0
- package/dist/helptext-BKtU4mas.js +82 -0
- package/dist/helptext-DcRC7wW2.cjs +24 -0
- package/dist/icon-CxQcIa5F.js +105 -0
- package/dist/icon-q81vqPK_.cjs +9 -0
- package/dist/input-wrapper-Bs4CRNst.js +181 -0
- package/dist/input-wrapper-Bv9aqqVq.cjs +54 -0
- package/dist/link-C0rl-86s.cjs +7 -0
- package/dist/link-Cdqgl60z.js +55 -0
- package/dist/linkcard-Dimu7Rlx.cjs +13 -0
- package/dist/linkcard-Lbq_UhjZ.js +56 -0
- package/dist/{listbox-BQKDZvZn.js → listbox-Bia4_tvN.js} +131 -129
- package/dist/listbox-La2GZQei.cjs +106 -0
- package/dist/loader-D1ugDXGV.cjs +16 -0
- package/dist/{loader-Ci3CHU8k.js → loader-DyN6RGC5.js} +51 -49
- package/dist/messagebox-BGMVm2t9.js +71 -0
- package/dist/messagebox-M0yIgCz9.cjs +13 -0
- package/dist/modal-CMO1RtIi.cjs +36 -0
- package/dist/{modal-DzGe1g8Z.js → modal-DjPQDE-Z.js} +53 -51
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +2 -2
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +3 -4
- package/dist/pkt-backlink.cjs +1 -1
- package/dist/pkt-backlink.js +2 -3
- package/dist/pkt-breadcrumbs.cjs +11 -11
- package/dist/pkt-breadcrumbs.js +30 -28
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +3 -4
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +2 -3
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +2 -3
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +3 -4
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +3 -4
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +2 -3
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +7 -8
- package/dist/pkt-header.cjs +35 -35
- package/dist/pkt-header.js +224 -218
- package/dist/pkt-heading.cjs +1 -1
- package/dist/pkt-heading.js +3 -4
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +3 -4
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +3 -4
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +26 -26
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +2 -3
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +2 -3
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +3 -4
- package/dist/pkt-listbox.cjs +1 -1
- package/dist/pkt-listbox.js +3 -4
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +3 -4
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +3 -4
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +3 -4
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +2 -3
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +3 -4
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +3 -4
- package/dist/pkt-tabs.cjs +1 -1
- package/dist/pkt-tabs.js +2 -2
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +3 -4
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +3 -4
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +3 -4
- package/dist/pkt-timepicker.cjs +16 -16
- package/dist/pkt-timepicker.js +91 -89
- package/dist/progressbar-BqlMzkM_.cjs +21 -0
- package/dist/{progressbar-By7e0lEI.js → progressbar-sbHDFC12.js} +88 -88
- package/dist/radiobutton-5ZqVVtTT.cjs +31 -0
- package/dist/{radiobutton-6frNG9J_.js → radiobutton-D8Ai8ETa.js} +44 -42
- package/dist/select-De-n8on9.js +230 -0
- package/dist/select-dTWibR6_.cjs +49 -0
- package/dist/tabitem-B9-jeV97.js +334 -0
- package/dist/tabitem-BnhzqfW3.cjs +65 -0
- package/dist/tag-CbwO8yvD.cjs +27 -0
- package/dist/{tag-BuCpqaks.js → tag-D4FI5t3y.js} +42 -40
- package/dist/textarea-BmLaKzsc.cjs +50 -0
- package/dist/{textarea-Bzuymclz.js → textarea-CMiSJaYL.js} +62 -60
- package/dist/textinput-em9y4yrL.cjs +70 -0
- package/dist/{textinput-9lHjs4ce.js → textinput-r8udK0IX.js} +57 -55
- package/package.json +2 -2
- package/src/components/accordion/accordion.ts +6 -1
- package/src/components/accordion/accordionitem.ts +6 -1
- package/src/components/alert/alert.ts +6 -1
- package/src/components/backlink/backlink.ts +6 -1
- package/src/components/breadcrumbs/breadcrumbs.ts +6 -1
- package/src/components/button/button.ts +6 -1
- package/src/components/calendar/calendar.ts +6 -1
- package/src/components/card/card.ts +6 -1
- package/src/components/checkbox/checkbox.ts +6 -1
- package/src/components/combobox/combobox.ts +6 -1
- package/src/components/consent/consent.ts +6 -1
- package/src/components/datepicker/date-tags.ts +6 -1
- package/src/components/datepicker/datepicker-multiple.ts +6 -1
- package/src/components/datepicker/datepicker-popup.ts +6 -1
- package/src/components/datepicker/datepicker-range.ts +6 -1
- package/src/components/datepicker/datepicker-single.ts +6 -1
- package/src/components/datepicker/datepicker.ts +6 -1
- package/src/components/header/header-service.ts +6 -1
- package/src/components/header/header-user-menu.ts +6 -1
- package/src/components/header/header.ts +6 -1
- package/src/components/heading/heading.ts +6 -1
- package/src/components/helptext/helptext.ts +6 -1
- package/src/components/icon/icon.ts +6 -1
- package/src/components/input-wrapper/input-wrapper.ts +6 -1
- package/src/components/link/link.ts +6 -1
- package/src/components/linkcard/linkcard.ts +6 -1
- package/src/components/listbox/listbox.ts +6 -1
- package/src/components/loader/loader.ts +6 -1
- package/src/components/messagebox/messagebox.ts +6 -1
- package/src/components/modal/modal.ts +6 -1
- package/src/components/progressbar/progressbar.ts +6 -1
- package/src/components/radiobutton/radiobutton.ts +6 -1
- package/src/components/select/select.ts +6 -1
- package/src/components/tabs/tabitem.ts +6 -1
- package/src/components/tabs/tabs.ts +6 -1
- package/src/components/tag/tag.ts +6 -1
- package/src/components/textarea/textarea.ts +6 -1
- package/src/components/textinput/textinput.ts +6 -1
- package/src/components/timepicker/timepicker.ts +6 -1
- package/dist/accordionitem-D1Agl1bB.cjs +0 -34
- package/dist/alert-DFkFNTxh.cjs +0 -33
- package/dist/backlink-EiAXUUZP.cjs +0 -13
- package/dist/backlink-V4DAt17e.js +0 -47
- package/dist/button-DYv5Dg4M.cjs +0 -27
- package/dist/calendar-HIE9nxcc.cjs +0 -90
- package/dist/card-CyeH6l1c.cjs +0 -87
- package/dist/checkbox-BLlwTABj.cjs +0 -31
- package/dist/checkbox-ejBUa5qQ.js +0 -145
- package/dist/consent-ruWAEVXW.cjs +0 -11
- package/dist/datepicker-D2H7U6MS.cjs +0 -273
- package/dist/heading-Cvz8m1xL.cjs +0 -1
- package/dist/helptext-5Mzp65-F.cjs +0 -24
- package/dist/helptext-jIoWRcCF.js +0 -80
- package/dist/icon-BlKA8YuW.js +0 -103
- package/dist/icon-Bqj9oBbl.cjs +0 -9
- package/dist/input-wrapper-B0MkQ0IZ.cjs +0 -54
- package/dist/input-wrapper-B2JpK016.js +0 -179
- package/dist/link-R_lNhViF.cjs +0 -7
- package/dist/link-Z_GizclR.js +0 -53
- package/dist/linkcard-BlQvdB1a.js +0 -54
- package/dist/linkcard-C7HbSLlX.cjs +0 -13
- package/dist/listbox-CGgV9MAe.cjs +0 -106
- package/dist/loader-e2gs_1xz.cjs +0 -16
- package/dist/messagebox-Bf-XMlvW.js +0 -69
- package/dist/messagebox-D67w71VX.cjs +0 -13
- package/dist/modal-CyvEkbfQ.cjs +0 -36
- package/dist/progressbar-DsJ2B9Vm.cjs +0 -21
- package/dist/radiobutton-Bv-BZ1Hw.cjs +0 -31
- package/dist/select-CXZt1nHS.js +0 -228
- package/dist/select-WFhS4Vfp.cjs +0 -49
- package/dist/tabitem-CB8wkKmv.js +0 -332
- package/dist/tabitem-DZpspU4Q.cjs +0 -65
- package/dist/tag-X6xdjR0N.cjs +0 -27
- package/dist/textarea-DoeHJ7HR.cjs +0 -50
- package/dist/textinput-BNsLd26i.cjs +0 -70
|
@@ -1,102 +1,102 @@
|
|
|
1
1
|
import { e as rt } from "./class-map-CEnykyO_.js";
|
|
2
|
-
import {
|
|
2
|
+
import { t as Pt, P as Nt, b as k, A as at, n as f } from "./element-CPpT3rFQ.js";
|
|
3
3
|
import { r as Z } from "./state-C_1EOo3D.js";
|
|
4
|
-
import "./icon-
|
|
4
|
+
import "./icon-CxQcIa5F.js";
|
|
5
5
|
const yt = 6048e5, Ct = 864e5, st = Symbol.for("constructDateFrom");
|
|
6
|
-
function
|
|
7
|
-
return typeof
|
|
6
|
+
function v(e, t) {
|
|
7
|
+
return typeof e == "function" ? e(t) : e && typeof e == "object" && st in e ? e[st](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
return
|
|
9
|
+
function D(e, t) {
|
|
10
|
+
return v(t || e, e);
|
|
11
11
|
}
|
|
12
|
-
function it(
|
|
13
|
-
const r =
|
|
14
|
-
return isNaN(
|
|
12
|
+
function it(e, t, n) {
|
|
13
|
+
const r = D(e, n == null ? void 0 : n.in);
|
|
14
|
+
return isNaN(t) ? v(e, NaN) : (t && r.setDate(r.getDate() + t), r);
|
|
15
15
|
}
|
|
16
16
|
let $t = {};
|
|
17
17
|
function q() {
|
|
18
18
|
return $t;
|
|
19
19
|
}
|
|
20
|
-
function R(
|
|
21
|
-
var o, c,
|
|
22
|
-
const n = q(), r = (
|
|
20
|
+
function R(e, t) {
|
|
21
|
+
var o, c, h, m;
|
|
22
|
+
const n = q(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((c = (o = t == null ? void 0 : t.locale) == null ? void 0 : o.options) == null ? void 0 : c.weekStartsOn) ?? n.weekStartsOn ?? ((m = (h = n.locale) == null ? void 0 : h.options) == null ? void 0 : m.weekStartsOn) ?? 0, a = D(e, t == null ? void 0 : t.in), s = a.getDay(), i = (s < r ? 7 : 0) + s - r;
|
|
23
23
|
return a.setDate(a.getDate() - i), a.setHours(0, 0, 0, 0), a;
|
|
24
24
|
}
|
|
25
|
-
function B(
|
|
26
|
-
return R(
|
|
25
|
+
function B(e, t) {
|
|
26
|
+
return R(e, { ...t, weekStartsOn: 1 });
|
|
27
27
|
}
|
|
28
|
-
function pt(
|
|
29
|
-
const n =
|
|
28
|
+
function pt(e, t) {
|
|
29
|
+
const n = D(e, t == null ? void 0 : t.in), r = n.getFullYear(), a = v(n, 0);
|
|
30
30
|
a.setFullYear(r + 1, 0, 4), a.setHours(0, 0, 0, 0);
|
|
31
|
-
const s = B(a), i =
|
|
31
|
+
const s = B(a), i = v(n, 0);
|
|
32
32
|
i.setFullYear(r, 0, 4), i.setHours(0, 0, 0, 0);
|
|
33
33
|
const o = B(i);
|
|
34
34
|
return n.getTime() >= s.getTime() ? r + 1 : n.getTime() >= o.getTime() ? r : r - 1;
|
|
35
35
|
}
|
|
36
|
-
function ot(
|
|
37
|
-
const
|
|
36
|
+
function ot(e) {
|
|
37
|
+
const t = D(e), n = new Date(
|
|
38
38
|
Date.UTC(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
t.getFullYear(),
|
|
40
|
+
t.getMonth(),
|
|
41
|
+
t.getDate(),
|
|
42
|
+
t.getHours(),
|
|
43
|
+
t.getMinutes(),
|
|
44
|
+
t.getSeconds(),
|
|
45
|
+
t.getMilliseconds()
|
|
46
46
|
)
|
|
47
47
|
);
|
|
48
|
-
return n.setUTCFullYear(
|
|
48
|
+
return n.setUTCFullYear(t.getFullYear()), +e - +n;
|
|
49
49
|
}
|
|
50
|
-
function wt(
|
|
51
|
-
const n =
|
|
50
|
+
function wt(e, ...t) {
|
|
51
|
+
const n = v.bind(
|
|
52
52
|
null,
|
|
53
|
-
|
|
53
|
+
t.find((r) => typeof r == "object")
|
|
54
54
|
);
|
|
55
|
-
return
|
|
55
|
+
return t.map(n);
|
|
56
56
|
}
|
|
57
|
-
function J(
|
|
58
|
-
const n =
|
|
57
|
+
function J(e, t) {
|
|
58
|
+
const n = D(e, t == null ? void 0 : t.in);
|
|
59
59
|
return n.setHours(0, 0, 0, 0), n;
|
|
60
60
|
}
|
|
61
|
-
function Et(
|
|
61
|
+
function Et(e, t, n) {
|
|
62
62
|
const [r, a] = wt(
|
|
63
63
|
n == null ? void 0 : n.in,
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
e,
|
|
65
|
+
t
|
|
66
66
|
), s = J(r), i = J(a), o = +s - ot(s), c = +i - ot(i);
|
|
67
67
|
return Math.round((o - c) / Ct);
|
|
68
68
|
}
|
|
69
|
-
function Wt(
|
|
70
|
-
const n = pt(
|
|
69
|
+
function Wt(e, t) {
|
|
70
|
+
const n = pt(e, t), r = v(e, 0);
|
|
71
71
|
return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), B(r);
|
|
72
72
|
}
|
|
73
|
-
function _t(
|
|
74
|
-
return
|
|
73
|
+
function _t(e) {
|
|
74
|
+
return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
|
|
75
75
|
}
|
|
76
|
-
function Yt(
|
|
77
|
-
return !(!_t(
|
|
76
|
+
function Yt(e) {
|
|
77
|
+
return !(!_t(e) && typeof e != "number" || isNaN(+D(e)));
|
|
78
78
|
}
|
|
79
|
-
function Ft(
|
|
80
|
-
const n =
|
|
79
|
+
function Ft(e, t) {
|
|
80
|
+
const n = D(e, t == null ? void 0 : t.in);
|
|
81
81
|
return n.setHours(23, 59, 59, 999), n;
|
|
82
82
|
}
|
|
83
|
-
function It(
|
|
84
|
-
const [n, r] = wt(
|
|
83
|
+
function It(e, t) {
|
|
84
|
+
const [n, r] = wt(e, t.start, t.end);
|
|
85
85
|
return { start: n, end: r };
|
|
86
86
|
}
|
|
87
|
-
function bt(
|
|
88
|
-
const { start: n, end: r } = It(
|
|
87
|
+
function bt(e, t) {
|
|
88
|
+
const { start: n, end: r } = It(t == null ? void 0 : t.in, e);
|
|
89
89
|
let a = +n > +r;
|
|
90
90
|
const s = a ? +n : +r, i = a ? r : n;
|
|
91
91
|
i.setHours(0, 0, 0, 0);
|
|
92
92
|
let o = 1;
|
|
93
93
|
const c = [];
|
|
94
94
|
for (; +i <= s; )
|
|
95
|
-
c.push(
|
|
95
|
+
c.push(v(n, i)), i.setDate(i.getDate() + o), i.setHours(0, 0, 0, 0);
|
|
96
96
|
return a ? c.reverse() : c;
|
|
97
97
|
}
|
|
98
|
-
function At(
|
|
99
|
-
const n =
|
|
98
|
+
function At(e, t) {
|
|
99
|
+
const n = D(e, t == null ? void 0 : t.in);
|
|
100
100
|
return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
101
101
|
}
|
|
102
102
|
const Ht = {
|
|
@@ -161,15 +161,15 @@ const Ht = {
|
|
|
161
161
|
one: "almost 1 year",
|
|
162
162
|
other: "almost {{count}} years"
|
|
163
163
|
}
|
|
164
|
-
}, Rt = (
|
|
164
|
+
}, Rt = (e, t, n) => {
|
|
165
165
|
let r;
|
|
166
|
-
const a = Ht[
|
|
167
|
-
return typeof a == "string" ? r = a :
|
|
166
|
+
const a = Ht[e];
|
|
167
|
+
return typeof a == "string" ? r = a : t === 1 ? r = a.one : r = a.other.replace("{{count}}", t.toString()), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
|
|
168
168
|
};
|
|
169
|
-
function X(
|
|
170
|
-
return (
|
|
171
|
-
const n =
|
|
172
|
-
return
|
|
169
|
+
function X(e) {
|
|
170
|
+
return (t = {}) => {
|
|
171
|
+
const n = t.width ? String(t.width) : e.defaultWidth;
|
|
172
|
+
return e.formats[n] || e.formats[e.defaultWidth];
|
|
173
173
|
};
|
|
174
174
|
}
|
|
175
175
|
const Ut = {
|
|
@@ -207,19 +207,19 @@ const Ut = {
|
|
|
207
207
|
tomorrow: "'tomorrow at' p",
|
|
208
208
|
nextWeek: "eeee 'at' p",
|
|
209
209
|
other: "P"
|
|
210
|
-
}, jt = (
|
|
211
|
-
function F(
|
|
212
|
-
return (
|
|
210
|
+
}, jt = (e, t, n, r) => zt[e];
|
|
211
|
+
function F(e) {
|
|
212
|
+
return (t, n) => {
|
|
213
213
|
const r = n != null && n.context ? String(n.context) : "standalone";
|
|
214
214
|
let a;
|
|
215
|
-
if (r === "formatting" &&
|
|
216
|
-
const i =
|
|
217
|
-
a =
|
|
215
|
+
if (r === "formatting" && e.formattingValues) {
|
|
216
|
+
const i = e.defaultFormattingWidth || e.defaultWidth, o = n != null && n.width ? String(n.width) : i;
|
|
217
|
+
a = e.formattingValues[o] || e.formattingValues[i];
|
|
218
218
|
} else {
|
|
219
|
-
const i =
|
|
220
|
-
a =
|
|
219
|
+
const i = e.defaultWidth, o = n != null && n.width ? String(n.width) : e.defaultWidth;
|
|
220
|
+
a = e.values[o] || e.values[i];
|
|
221
221
|
}
|
|
222
|
-
const s =
|
|
222
|
+
const s = e.argumentCallback ? e.argumentCallback(t) : t;
|
|
223
223
|
return a[s];
|
|
224
224
|
};
|
|
225
225
|
}
|
|
@@ -336,8 +336,8 @@ const Qt = {
|
|
|
336
336
|
evening: "in the evening",
|
|
337
337
|
night: "at night"
|
|
338
338
|
}
|
|
339
|
-
}, Zt = (
|
|
340
|
-
const n = Number(
|
|
339
|
+
}, Zt = (e, t) => {
|
|
340
|
+
const n = Number(e), r = n % 100;
|
|
341
341
|
if (r > 20 || r < 10)
|
|
342
342
|
switch (r % 10) {
|
|
343
343
|
case 1:
|
|
@@ -357,7 +357,7 @@ const Qt = {
|
|
|
357
357
|
quarter: F({
|
|
358
358
|
values: Xt,
|
|
359
359
|
defaultWidth: "wide",
|
|
360
|
-
argumentCallback: (
|
|
360
|
+
argumentCallback: (e) => e - 1
|
|
361
361
|
}),
|
|
362
362
|
month: F({
|
|
363
363
|
values: Gt,
|
|
@@ -374,43 +374,43 @@ const Qt = {
|
|
|
374
374
|
defaultFormattingWidth: "wide"
|
|
375
375
|
})
|
|
376
376
|
};
|
|
377
|
-
function I(
|
|
378
|
-
return (
|
|
379
|
-
const r = n.width, a = r &&
|
|
377
|
+
function I(e) {
|
|
378
|
+
return (t, n = {}) => {
|
|
379
|
+
const r = n.width, a = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth], s = t.match(a);
|
|
380
380
|
if (!s)
|
|
381
381
|
return null;
|
|
382
|
-
const i = s[0], o = r &&
|
|
382
|
+
const i = s[0], o = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], c = Array.isArray(o) ? ne(o, (p) => p.test(i)) : (
|
|
383
383
|
// [TODO] -- I challenge you to fix the type
|
|
384
|
-
ee(o, (
|
|
384
|
+
ee(o, (p) => p.test(i))
|
|
385
385
|
);
|
|
386
|
-
let
|
|
387
|
-
|
|
386
|
+
let h;
|
|
387
|
+
h = e.valueCallback ? e.valueCallback(c) : c, h = n.valueCallback ? (
|
|
388
388
|
// [TODO] -- I challenge you to fix the type
|
|
389
|
-
n.valueCallback(
|
|
390
|
-
) :
|
|
391
|
-
const
|
|
392
|
-
return { value:
|
|
389
|
+
n.valueCallback(h)
|
|
390
|
+
) : h;
|
|
391
|
+
const m = t.slice(i.length);
|
|
392
|
+
return { value: h, rest: m };
|
|
393
393
|
};
|
|
394
394
|
}
|
|
395
|
-
function ee(
|
|
396
|
-
for (const n in
|
|
397
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
395
|
+
function ee(e, t) {
|
|
396
|
+
for (const n in e)
|
|
397
|
+
if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n]))
|
|
398
398
|
return n;
|
|
399
399
|
}
|
|
400
|
-
function ne(
|
|
401
|
-
for (let n = 0; n <
|
|
402
|
-
if (e
|
|
400
|
+
function ne(e, t) {
|
|
401
|
+
for (let n = 0; n < e.length; n++)
|
|
402
|
+
if (t(e[n]))
|
|
403
403
|
return n;
|
|
404
404
|
}
|
|
405
|
-
function re(
|
|
406
|
-
return (
|
|
407
|
-
const r =
|
|
405
|
+
function re(e) {
|
|
406
|
+
return (t, n = {}) => {
|
|
407
|
+
const r = t.match(e.matchPattern);
|
|
408
408
|
if (!r) return null;
|
|
409
|
-
const a = r[0], s =
|
|
409
|
+
const a = r[0], s = t.match(e.parsePattern);
|
|
410
410
|
if (!s) return null;
|
|
411
|
-
let i =
|
|
411
|
+
let i = e.valueCallback ? e.valueCallback(s[0]) : s[0];
|
|
412
412
|
i = n.valueCallback ? n.valueCallback(i) : i;
|
|
413
|
-
const o =
|
|
413
|
+
const o = t.slice(a.length);
|
|
414
414
|
return { value: i, rest: o };
|
|
415
415
|
};
|
|
416
416
|
}
|
|
@@ -485,7 +485,7 @@ const ae = /^(\d+)(th|st|nd|rd)?/i, se = /\d+/i, ie = {
|
|
|
485
485
|
ordinalNumber: re({
|
|
486
486
|
matchPattern: ae,
|
|
487
487
|
parsePattern: se,
|
|
488
|
-
valueCallback: (
|
|
488
|
+
valueCallback: (e) => parseInt(e, 10)
|
|
489
489
|
}),
|
|
490
490
|
era: I({
|
|
491
491
|
matchPatterns: ie,
|
|
@@ -498,7 +498,7 @@ const ae = /^(\d+)(th|st|nd|rd)?/i, se = /\d+/i, ie = {
|
|
|
498
498
|
defaultMatchWidth: "wide",
|
|
499
499
|
parsePatterns: ue,
|
|
500
500
|
defaultParseWidth: "any",
|
|
501
|
-
valueCallback: (
|
|
501
|
+
valueCallback: (e) => e + 1
|
|
502
502
|
}),
|
|
503
503
|
month: I({
|
|
504
504
|
matchPatterns: le,
|
|
@@ -530,55 +530,55 @@ const ae = /^(\d+)(th|st|nd|rd)?/i, se = /\d+/i, ie = {
|
|
|
530
530
|
firstWeekContainsDate: 1
|
|
531
531
|
}
|
|
532
532
|
};
|
|
533
|
-
function we(
|
|
534
|
-
const n =
|
|
533
|
+
function we(e, t) {
|
|
534
|
+
const n = D(e, t == null ? void 0 : t.in);
|
|
535
535
|
return Et(n, At(n)) + 1;
|
|
536
536
|
}
|
|
537
|
-
function be(
|
|
538
|
-
const n =
|
|
537
|
+
function be(e, t) {
|
|
538
|
+
const n = D(e, t == null ? void 0 : t.in), r = +B(n) - +Wt(n);
|
|
539
539
|
return Math.round(r / yt) + 1;
|
|
540
540
|
}
|
|
541
|
-
function Dt(
|
|
542
|
-
var
|
|
543
|
-
const n =
|
|
541
|
+
function Dt(e, t) {
|
|
542
|
+
var m, p, w, M;
|
|
543
|
+
const n = D(e, t == null ? void 0 : t.in), r = n.getFullYear(), a = q(), s = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((p = (m = t == null ? void 0 : t.locale) == null ? void 0 : m.options) == null ? void 0 : p.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((M = (w = a.locale) == null ? void 0 : w.options) == null ? void 0 : M.firstWeekContainsDate) ?? 1, i = v((t == null ? void 0 : t.in) || e, 0);
|
|
544
544
|
i.setFullYear(r + 1, 0, s), i.setHours(0, 0, 0, 0);
|
|
545
|
-
const o = R(i,
|
|
545
|
+
const o = R(i, t), c = v((t == null ? void 0 : t.in) || e, 0);
|
|
546
546
|
c.setFullYear(r, 0, s), c.setHours(0, 0, 0, 0);
|
|
547
|
-
const
|
|
548
|
-
return +n >= +o ? r + 1 : +n >= +
|
|
547
|
+
const h = R(c, t);
|
|
548
|
+
return +n >= +o ? r + 1 : +n >= +h ? r : r - 1;
|
|
549
549
|
}
|
|
550
|
-
function De(
|
|
551
|
-
var o, c,
|
|
552
|
-
const n = q(), r = (
|
|
553
|
-
return s.setFullYear(a, 0, r), s.setHours(0, 0, 0, 0), R(s,
|
|
550
|
+
function De(e, t) {
|
|
551
|
+
var o, c, h, m;
|
|
552
|
+
const n = q(), r = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((c = (o = t == null ? void 0 : t.locale) == null ? void 0 : o.options) == null ? void 0 : c.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((m = (h = n.locale) == null ? void 0 : h.options) == null ? void 0 : m.firstWeekContainsDate) ?? 1, a = Dt(e, t), s = v((t == null ? void 0 : t.in) || e, 0);
|
|
553
|
+
return s.setFullYear(a, 0, r), s.setHours(0, 0, 0, 0), R(s, t);
|
|
554
554
|
}
|
|
555
|
-
function
|
|
556
|
-
const n =
|
|
555
|
+
function kt(e, t) {
|
|
556
|
+
const n = D(e, t == null ? void 0 : t.in), r = +R(n, t) - +De(n, t);
|
|
557
557
|
return Math.round(r / yt) + 1;
|
|
558
558
|
}
|
|
559
|
-
function u(
|
|
560
|
-
const n =
|
|
559
|
+
function u(e, t) {
|
|
560
|
+
const n = e < 0 ? "-" : "", r = Math.abs(e).toString().padStart(t, "0");
|
|
561
561
|
return n + r;
|
|
562
562
|
}
|
|
563
563
|
const T = {
|
|
564
564
|
// Year
|
|
565
|
-
y(
|
|
566
|
-
const n =
|
|
567
|
-
return u(
|
|
565
|
+
y(e, t) {
|
|
566
|
+
const n = e.getFullYear(), r = n > 0 ? n : 1 - n;
|
|
567
|
+
return u(t === "yy" ? r % 100 : r, t.length);
|
|
568
568
|
},
|
|
569
569
|
// Month
|
|
570
|
-
M(
|
|
571
|
-
const n =
|
|
572
|
-
return
|
|
570
|
+
M(e, t) {
|
|
571
|
+
const n = e.getMonth();
|
|
572
|
+
return t === "M" ? String(n + 1) : u(n + 1, 2);
|
|
573
573
|
},
|
|
574
574
|
// Day of the month
|
|
575
|
-
d(
|
|
576
|
-
return u(
|
|
575
|
+
d(e, t) {
|
|
576
|
+
return u(e.getDate(), t.length);
|
|
577
577
|
},
|
|
578
578
|
// AM or PM
|
|
579
|
-
a(
|
|
580
|
-
const n =
|
|
581
|
-
switch (
|
|
579
|
+
a(e, t) {
|
|
580
|
+
const n = e.getHours() / 12 >= 1 ? "pm" : "am";
|
|
581
|
+
switch (t) {
|
|
582
582
|
case "a":
|
|
583
583
|
case "aa":
|
|
584
584
|
return n.toUpperCase();
|
|
@@ -592,27 +592,27 @@ const T = {
|
|
|
592
592
|
}
|
|
593
593
|
},
|
|
594
594
|
// Hour [1-12]
|
|
595
|
-
h(
|
|
596
|
-
return u(
|
|
595
|
+
h(e, t) {
|
|
596
|
+
return u(e.getHours() % 12 || 12, t.length);
|
|
597
597
|
},
|
|
598
598
|
// Hour [0-23]
|
|
599
|
-
H(
|
|
600
|
-
return u(
|
|
599
|
+
H(e, t) {
|
|
600
|
+
return u(e.getHours(), t.length);
|
|
601
601
|
},
|
|
602
602
|
// Minute
|
|
603
|
-
m(
|
|
604
|
-
return u(
|
|
603
|
+
m(e, t) {
|
|
604
|
+
return u(e.getMinutes(), t.length);
|
|
605
605
|
},
|
|
606
606
|
// Second
|
|
607
|
-
s(
|
|
608
|
-
return u(
|
|
607
|
+
s(e, t) {
|
|
608
|
+
return u(e.getSeconds(), t.length);
|
|
609
609
|
},
|
|
610
610
|
// Fraction of second
|
|
611
|
-
S(
|
|
612
|
-
const n =
|
|
611
|
+
S(e, t) {
|
|
612
|
+
const n = t.length, r = e.getMilliseconds(), a = Math.trunc(
|
|
613
613
|
r * Math.pow(10, n - 3)
|
|
614
614
|
);
|
|
615
|
-
return u(a,
|
|
615
|
+
return u(a, t.length);
|
|
616
616
|
}
|
|
617
617
|
}, E = {
|
|
618
618
|
midnight: "midnight",
|
|
@@ -623,9 +623,9 @@ const T = {
|
|
|
623
623
|
night: "night"
|
|
624
624
|
}, ct = {
|
|
625
625
|
// Era
|
|
626
|
-
G: function(
|
|
627
|
-
const r =
|
|
628
|
-
switch (
|
|
626
|
+
G: function(e, t, n) {
|
|
627
|
+
const r = e.getFullYear() > 0 ? 1 : 0;
|
|
628
|
+
switch (t) {
|
|
629
629
|
// AD, BC
|
|
630
630
|
case "G":
|
|
631
631
|
case "GG":
|
|
@@ -641,26 +641,26 @@ const T = {
|
|
|
641
641
|
}
|
|
642
642
|
},
|
|
643
643
|
// Year
|
|
644
|
-
y: function(
|
|
645
|
-
if (
|
|
646
|
-
const r =
|
|
644
|
+
y: function(e, t, n) {
|
|
645
|
+
if (t === "yo") {
|
|
646
|
+
const r = e.getFullYear(), a = r > 0 ? r : 1 - r;
|
|
647
647
|
return n.ordinalNumber(a, { unit: "year" });
|
|
648
648
|
}
|
|
649
|
-
return T.y(
|
|
649
|
+
return T.y(e, t);
|
|
650
650
|
},
|
|
651
651
|
// Local week-numbering year
|
|
652
|
-
Y: function(
|
|
653
|
-
const a = Dt(
|
|
654
|
-
if (
|
|
652
|
+
Y: function(e, t, n, r) {
|
|
653
|
+
const a = Dt(e, r), s = a > 0 ? a : 1 - a;
|
|
654
|
+
if (t === "YY") {
|
|
655
655
|
const i = s % 100;
|
|
656
656
|
return u(i, 2);
|
|
657
657
|
}
|
|
658
|
-
return
|
|
658
|
+
return t === "Yo" ? n.ordinalNumber(s, { unit: "year" }) : u(s, t.length);
|
|
659
659
|
},
|
|
660
660
|
// ISO week-numbering year
|
|
661
|
-
R: function(
|
|
662
|
-
const n = pt(
|
|
663
|
-
return u(n,
|
|
661
|
+
R: function(e, t) {
|
|
662
|
+
const n = pt(e);
|
|
663
|
+
return u(n, t.length);
|
|
664
664
|
},
|
|
665
665
|
// Extended year. This is a single number designating the year of this calendar system.
|
|
666
666
|
// The main difference between `y` and `u` localizers are B.C. years:
|
|
@@ -671,14 +671,14 @@ const T = {
|
|
|
671
671
|
// | BC 2 | 2 | -1 |
|
|
672
672
|
// Also `yy` always returns the last two digits of a year,
|
|
673
673
|
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
674
|
-
u: function(
|
|
675
|
-
const n =
|
|
676
|
-
return u(n,
|
|
674
|
+
u: function(e, t) {
|
|
675
|
+
const n = e.getFullYear();
|
|
676
|
+
return u(n, t.length);
|
|
677
677
|
},
|
|
678
678
|
// Quarter
|
|
679
|
-
Q: function(
|
|
680
|
-
const r = Math.ceil((
|
|
681
|
-
switch (
|
|
679
|
+
Q: function(e, t, n) {
|
|
680
|
+
const r = Math.ceil((e.getMonth() + 1) / 3);
|
|
681
|
+
switch (t) {
|
|
682
682
|
// 1, 2, 3, 4
|
|
683
683
|
case "Q":
|
|
684
684
|
return String(r);
|
|
@@ -710,9 +710,9 @@ const T = {
|
|
|
710
710
|
}
|
|
711
711
|
},
|
|
712
712
|
// Stand-alone quarter
|
|
713
|
-
q: function(
|
|
714
|
-
const r = Math.ceil((
|
|
715
|
-
switch (
|
|
713
|
+
q: function(e, t, n) {
|
|
714
|
+
const r = Math.ceil((e.getMonth() + 1) / 3);
|
|
715
|
+
switch (t) {
|
|
716
716
|
// 1, 2, 3, 4
|
|
717
717
|
case "q":
|
|
718
718
|
return String(r);
|
|
@@ -744,12 +744,12 @@ const T = {
|
|
|
744
744
|
}
|
|
745
745
|
},
|
|
746
746
|
// Month
|
|
747
|
-
M: function(
|
|
748
|
-
const r =
|
|
749
|
-
switch (
|
|
747
|
+
M: function(e, t, n) {
|
|
748
|
+
const r = e.getMonth();
|
|
749
|
+
switch (t) {
|
|
750
750
|
case "M":
|
|
751
751
|
case "MM":
|
|
752
|
-
return T.M(
|
|
752
|
+
return T.M(e, t);
|
|
753
753
|
// 1st, 2nd, ..., 12th
|
|
754
754
|
case "Mo":
|
|
755
755
|
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
@@ -772,9 +772,9 @@ const T = {
|
|
|
772
772
|
}
|
|
773
773
|
},
|
|
774
774
|
// Stand-alone month
|
|
775
|
-
L: function(
|
|
776
|
-
const r =
|
|
777
|
-
switch (
|
|
775
|
+
L: function(e, t, n) {
|
|
776
|
+
const r = e.getMonth();
|
|
777
|
+
switch (t) {
|
|
778
778
|
// 1, 2, ..., 12
|
|
779
779
|
case "L":
|
|
780
780
|
return String(r + 1);
|
|
@@ -803,28 +803,28 @@ const T = {
|
|
|
803
803
|
}
|
|
804
804
|
},
|
|
805
805
|
// Local week of year
|
|
806
|
-
w: function(
|
|
807
|
-
const a =
|
|
808
|
-
return
|
|
806
|
+
w: function(e, t, n, r) {
|
|
807
|
+
const a = kt(e, r);
|
|
808
|
+
return t === "wo" ? n.ordinalNumber(a, { unit: "week" }) : u(a, t.length);
|
|
809
809
|
},
|
|
810
810
|
// ISO week of year
|
|
811
|
-
I: function(
|
|
812
|
-
const r = be(
|
|
813
|
-
return
|
|
811
|
+
I: function(e, t, n) {
|
|
812
|
+
const r = be(e);
|
|
813
|
+
return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) : u(r, t.length);
|
|
814
814
|
},
|
|
815
815
|
// Day of the month
|
|
816
|
-
d: function(
|
|
817
|
-
return
|
|
816
|
+
d: function(e, t, n) {
|
|
817
|
+
return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : T.d(e, t);
|
|
818
818
|
},
|
|
819
819
|
// Day of year
|
|
820
|
-
D: function(
|
|
821
|
-
const r = we(
|
|
822
|
-
return
|
|
820
|
+
D: function(e, t, n) {
|
|
821
|
+
const r = we(e);
|
|
822
|
+
return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : u(r, t.length);
|
|
823
823
|
},
|
|
824
824
|
// Day of week
|
|
825
|
-
E: function(
|
|
826
|
-
const r =
|
|
827
|
-
switch (
|
|
825
|
+
E: function(e, t, n) {
|
|
826
|
+
const r = e.getDay();
|
|
827
|
+
switch (t) {
|
|
828
828
|
// Tue
|
|
829
829
|
case "E":
|
|
830
830
|
case "EE":
|
|
@@ -855,9 +855,9 @@ const T = {
|
|
|
855
855
|
}
|
|
856
856
|
},
|
|
857
857
|
// Local day of week
|
|
858
|
-
e: function(
|
|
859
|
-
const a =
|
|
860
|
-
switch (
|
|
858
|
+
e: function(e, t, n, r) {
|
|
859
|
+
const a = e.getDay(), s = (a - r.weekStartsOn + 8) % 7 || 7;
|
|
860
|
+
switch (t) {
|
|
861
861
|
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
862
862
|
case "e":
|
|
863
863
|
return String(s);
|
|
@@ -894,15 +894,15 @@ const T = {
|
|
|
894
894
|
}
|
|
895
895
|
},
|
|
896
896
|
// Stand-alone local day of week
|
|
897
|
-
c: function(
|
|
898
|
-
const a =
|
|
899
|
-
switch (
|
|
897
|
+
c: function(e, t, n, r) {
|
|
898
|
+
const a = e.getDay(), s = (a - r.weekStartsOn + 8) % 7 || 7;
|
|
899
|
+
switch (t) {
|
|
900
900
|
// Numerical value (same as in `e`)
|
|
901
901
|
case "c":
|
|
902
902
|
return String(s);
|
|
903
903
|
// Padded numerical value
|
|
904
904
|
case "cc":
|
|
905
|
-
return u(s,
|
|
905
|
+
return u(s, t.length);
|
|
906
906
|
// 1st, 2nd, ..., 7th
|
|
907
907
|
case "co":
|
|
908
908
|
return n.ordinalNumber(s, { unit: "day" });
|
|
@@ -933,15 +933,15 @@ const T = {
|
|
|
933
933
|
}
|
|
934
934
|
},
|
|
935
935
|
// ISO day of week
|
|
936
|
-
i: function(
|
|
937
|
-
const r =
|
|
938
|
-
switch (
|
|
936
|
+
i: function(e, t, n) {
|
|
937
|
+
const r = e.getDay(), a = r === 0 ? 7 : r;
|
|
938
|
+
switch (t) {
|
|
939
939
|
// 2
|
|
940
940
|
case "i":
|
|
941
941
|
return String(a);
|
|
942
942
|
// 02
|
|
943
943
|
case "ii":
|
|
944
|
-
return u(a,
|
|
944
|
+
return u(a, t.length);
|
|
945
945
|
// 2nd
|
|
946
946
|
case "io":
|
|
947
947
|
return n.ordinalNumber(a, { unit: "day" });
|
|
@@ -973,9 +973,9 @@ const T = {
|
|
|
973
973
|
}
|
|
974
974
|
},
|
|
975
975
|
// AM or PM
|
|
976
|
-
a: function(
|
|
977
|
-
const a =
|
|
978
|
-
switch (
|
|
976
|
+
a: function(e, t, n) {
|
|
977
|
+
const a = e.getHours() / 12 >= 1 ? "pm" : "am";
|
|
978
|
+
switch (t) {
|
|
979
979
|
case "a":
|
|
980
980
|
case "aa":
|
|
981
981
|
return n.dayPeriod(a, {
|
|
@@ -1001,10 +1001,10 @@ const T = {
|
|
|
1001
1001
|
}
|
|
1002
1002
|
},
|
|
1003
1003
|
// AM, PM, midnight, noon
|
|
1004
|
-
b: function(
|
|
1005
|
-
const r =
|
|
1004
|
+
b: function(e, t, n) {
|
|
1005
|
+
const r = e.getHours();
|
|
1006
1006
|
let a;
|
|
1007
|
-
switch (r === 12 ? a = E.noon : r === 0 ? a = E.midnight : a = r / 12 >= 1 ? "pm" : "am",
|
|
1007
|
+
switch (r === 12 ? a = E.noon : r === 0 ? a = E.midnight : a = r / 12 >= 1 ? "pm" : "am", t) {
|
|
1008
1008
|
case "b":
|
|
1009
1009
|
case "bb":
|
|
1010
1010
|
return n.dayPeriod(a, {
|
|
@@ -1030,10 +1030,10 @@ const T = {
|
|
|
1030
1030
|
}
|
|
1031
1031
|
},
|
|
1032
1032
|
// in the morning, in the afternoon, in the evening, at night
|
|
1033
|
-
B: function(
|
|
1034
|
-
const r =
|
|
1033
|
+
B: function(e, t, n) {
|
|
1034
|
+
const r = e.getHours();
|
|
1035
1035
|
let a;
|
|
1036
|
-
switch (r >= 17 ? a = E.evening : r >= 12 ? a = E.afternoon : r >= 4 ? a = E.morning : a = E.night,
|
|
1036
|
+
switch (r >= 17 ? a = E.evening : r >= 12 ? a = E.afternoon : r >= 4 ? a = E.morning : a = E.night, t) {
|
|
1037
1037
|
case "B":
|
|
1038
1038
|
case "BB":
|
|
1039
1039
|
case "BBB":
|
|
@@ -1055,45 +1055,45 @@ const T = {
|
|
|
1055
1055
|
}
|
|
1056
1056
|
},
|
|
1057
1057
|
// Hour [1-12]
|
|
1058
|
-
h: function(
|
|
1059
|
-
if (
|
|
1060
|
-
let r =
|
|
1058
|
+
h: function(e, t, n) {
|
|
1059
|
+
if (t === "ho") {
|
|
1060
|
+
let r = e.getHours() % 12;
|
|
1061
1061
|
return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
|
|
1062
1062
|
}
|
|
1063
|
-
return T.h(
|
|
1063
|
+
return T.h(e, t);
|
|
1064
1064
|
},
|
|
1065
1065
|
// Hour [0-23]
|
|
1066
|
-
H: function(
|
|
1067
|
-
return
|
|
1066
|
+
H: function(e, t, n) {
|
|
1067
|
+
return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) : T.H(e, t);
|
|
1068
1068
|
},
|
|
1069
1069
|
// Hour [0-11]
|
|
1070
|
-
K: function(
|
|
1071
|
-
const r =
|
|
1072
|
-
return
|
|
1070
|
+
K: function(e, t, n) {
|
|
1071
|
+
const r = e.getHours() % 12;
|
|
1072
|
+
return t === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : u(r, t.length);
|
|
1073
1073
|
},
|
|
1074
1074
|
// Hour [1-24]
|
|
1075
|
-
k: function(
|
|
1076
|
-
let r =
|
|
1077
|
-
return r === 0 && (r = 24),
|
|
1075
|
+
k: function(e, t, n) {
|
|
1076
|
+
let r = e.getHours();
|
|
1077
|
+
return r === 0 && (r = 24), t === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : u(r, t.length);
|
|
1078
1078
|
},
|
|
1079
1079
|
// Minute
|
|
1080
|
-
m: function(
|
|
1081
|
-
return
|
|
1080
|
+
m: function(e, t, n) {
|
|
1081
|
+
return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : T.m(e, t);
|
|
1082
1082
|
},
|
|
1083
1083
|
// Second
|
|
1084
|
-
s: function(
|
|
1085
|
-
return
|
|
1084
|
+
s: function(e, t, n) {
|
|
1085
|
+
return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) : T.s(e, t);
|
|
1086
1086
|
},
|
|
1087
1087
|
// Fraction of second
|
|
1088
|
-
S: function(
|
|
1089
|
-
return T.S(
|
|
1088
|
+
S: function(e, t) {
|
|
1089
|
+
return T.S(e, t);
|
|
1090
1090
|
},
|
|
1091
1091
|
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1092
|
-
X: function(
|
|
1093
|
-
const r =
|
|
1092
|
+
X: function(e, t, n) {
|
|
1093
|
+
const r = e.getTimezoneOffset();
|
|
1094
1094
|
if (r === 0)
|
|
1095
1095
|
return "Z";
|
|
1096
|
-
switch (
|
|
1096
|
+
switch (t) {
|
|
1097
1097
|
// Hours and optional minutes
|
|
1098
1098
|
case "X":
|
|
1099
1099
|
return lt(r);
|
|
@@ -1114,9 +1114,9 @@ const T = {
|
|
|
1114
1114
|
}
|
|
1115
1115
|
},
|
|
1116
1116
|
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
1117
|
-
x: function(
|
|
1118
|
-
const r =
|
|
1119
|
-
switch (
|
|
1117
|
+
x: function(e, t, n) {
|
|
1118
|
+
const r = e.getTimezoneOffset();
|
|
1119
|
+
switch (t) {
|
|
1120
1120
|
// Hours and optional minutes
|
|
1121
1121
|
case "x":
|
|
1122
1122
|
return lt(r);
|
|
@@ -1137,9 +1137,9 @@ const T = {
|
|
|
1137
1137
|
}
|
|
1138
1138
|
},
|
|
1139
1139
|
// Timezone (GMT)
|
|
1140
|
-
O: function(
|
|
1141
|
-
const r =
|
|
1142
|
-
switch (
|
|
1140
|
+
O: function(e, t, n) {
|
|
1141
|
+
const r = e.getTimezoneOffset();
|
|
1142
|
+
switch (t) {
|
|
1143
1143
|
// Short
|
|
1144
1144
|
case "O":
|
|
1145
1145
|
case "OO":
|
|
@@ -1152,9 +1152,9 @@ const T = {
|
|
|
1152
1152
|
}
|
|
1153
1153
|
},
|
|
1154
1154
|
// Timezone (specific non-location)
|
|
1155
|
-
z: function(
|
|
1156
|
-
const r =
|
|
1157
|
-
switch (
|
|
1155
|
+
z: function(e, t, n) {
|
|
1156
|
+
const r = e.getTimezoneOffset();
|
|
1157
|
+
switch (t) {
|
|
1158
1158
|
// Short
|
|
1159
1159
|
case "z":
|
|
1160
1160
|
case "zz":
|
|
@@ -1167,266 +1167,266 @@ const T = {
|
|
|
1167
1167
|
}
|
|
1168
1168
|
},
|
|
1169
1169
|
// Seconds timestamp
|
|
1170
|
-
t: function(
|
|
1171
|
-
const r = Math.trunc(+
|
|
1172
|
-
return u(r,
|
|
1170
|
+
t: function(e, t, n) {
|
|
1171
|
+
const r = Math.trunc(+e / 1e3);
|
|
1172
|
+
return u(r, t.length);
|
|
1173
1173
|
},
|
|
1174
1174
|
// Milliseconds timestamp
|
|
1175
|
-
T: function(
|
|
1176
|
-
return u(+
|
|
1175
|
+
T: function(e, t, n) {
|
|
1176
|
+
return u(+e, t.length);
|
|
1177
1177
|
}
|
|
1178
1178
|
};
|
|
1179
|
-
function ut(
|
|
1180
|
-
const n =
|
|
1181
|
-
return s === 0 ? n + String(a) : n + String(a) +
|
|
1179
|
+
function ut(e, t = "") {
|
|
1180
|
+
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.trunc(r / 60), s = r % 60;
|
|
1181
|
+
return s === 0 ? n + String(a) : n + String(a) + t + u(s, 2);
|
|
1182
1182
|
}
|
|
1183
|
-
function lt(
|
|
1184
|
-
return
|
|
1183
|
+
function lt(e, t) {
|
|
1184
|
+
return e % 60 === 0 ? (e > 0 ? "-" : "+") + u(Math.abs(e) / 60, 2) : N(e, t);
|
|
1185
1185
|
}
|
|
1186
|
-
function N(
|
|
1187
|
-
const n =
|
|
1188
|
-
return n + a +
|
|
1186
|
+
function N(e, t = "") {
|
|
1187
|
+
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = u(Math.trunc(r / 60), 2), s = u(r % 60, 2);
|
|
1188
|
+
return n + a + t + s;
|
|
1189
1189
|
}
|
|
1190
|
-
const ht = (
|
|
1191
|
-
switch (
|
|
1190
|
+
const ht = (e, t) => {
|
|
1191
|
+
switch (e) {
|
|
1192
1192
|
case "P":
|
|
1193
|
-
return
|
|
1193
|
+
return t.date({ width: "short" });
|
|
1194
1194
|
case "PP":
|
|
1195
|
-
return
|
|
1195
|
+
return t.date({ width: "medium" });
|
|
1196
1196
|
case "PPP":
|
|
1197
|
-
return
|
|
1197
|
+
return t.date({ width: "long" });
|
|
1198
1198
|
case "PPPP":
|
|
1199
1199
|
default:
|
|
1200
|
-
return
|
|
1200
|
+
return t.date({ width: "full" });
|
|
1201
1201
|
}
|
|
1202
|
-
},
|
|
1203
|
-
switch (
|
|
1202
|
+
}, St = (e, t) => {
|
|
1203
|
+
switch (e) {
|
|
1204
1204
|
case "p":
|
|
1205
|
-
return
|
|
1205
|
+
return t.time({ width: "short" });
|
|
1206
1206
|
case "pp":
|
|
1207
|
-
return
|
|
1207
|
+
return t.time({ width: "medium" });
|
|
1208
1208
|
case "ppp":
|
|
1209
|
-
return
|
|
1209
|
+
return t.time({ width: "long" });
|
|
1210
1210
|
case "pppp":
|
|
1211
1211
|
default:
|
|
1212
|
-
return
|
|
1212
|
+
return t.time({ width: "full" });
|
|
1213
1213
|
}
|
|
1214
|
-
},
|
|
1215
|
-
const n =
|
|
1214
|
+
}, ke = (e, t) => {
|
|
1215
|
+
const n = e.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
|
|
1216
1216
|
if (!a)
|
|
1217
|
-
return ht(
|
|
1217
|
+
return ht(e, t);
|
|
1218
1218
|
let s;
|
|
1219
1219
|
switch (r) {
|
|
1220
1220
|
case "P":
|
|
1221
|
-
s =
|
|
1221
|
+
s = t.dateTime({ width: "short" });
|
|
1222
1222
|
break;
|
|
1223
1223
|
case "PP":
|
|
1224
|
-
s =
|
|
1224
|
+
s = t.dateTime({ width: "medium" });
|
|
1225
1225
|
break;
|
|
1226
1226
|
case "PPP":
|
|
1227
|
-
s =
|
|
1227
|
+
s = t.dateTime({ width: "long" });
|
|
1228
1228
|
break;
|
|
1229
1229
|
case "PPPP":
|
|
1230
1230
|
default:
|
|
1231
|
-
s =
|
|
1231
|
+
s = t.dateTime({ width: "full" });
|
|
1232
1232
|
break;
|
|
1233
1233
|
}
|
|
1234
|
-
return s.replace("{{date}}", ht(r,
|
|
1235
|
-
},
|
|
1236
|
-
p:
|
|
1237
|
-
P:
|
|
1234
|
+
return s.replace("{{date}}", ht(r, t)).replace("{{time}}", St(a, t));
|
|
1235
|
+
}, Se = {
|
|
1236
|
+
p: St,
|
|
1237
|
+
P: ke
|
|
1238
1238
|
}, ve = /^D+$/, Me = /^Y+$/, Te = ["D", "DD", "YY", "YYYY"];
|
|
1239
|
-
function xe(
|
|
1240
|
-
return ve.test(
|
|
1239
|
+
function xe(e) {
|
|
1240
|
+
return ve.test(e);
|
|
1241
1241
|
}
|
|
1242
|
-
function Oe(
|
|
1243
|
-
return Me.test(
|
|
1242
|
+
function Oe(e) {
|
|
1243
|
+
return Me.test(e);
|
|
1244
1244
|
}
|
|
1245
|
-
function Pe(
|
|
1246
|
-
const r = Ne(
|
|
1247
|
-
if (console.warn(r), Te.includes(
|
|
1245
|
+
function Pe(e, t, n) {
|
|
1246
|
+
const r = Ne(e, t, n);
|
|
1247
|
+
if (console.warn(r), Te.includes(e)) throw new RangeError(r);
|
|
1248
1248
|
}
|
|
1249
|
-
function Ne(
|
|
1250
|
-
const r =
|
|
1251
|
-
return `Use \`${
|
|
1249
|
+
function Ne(e, t, n) {
|
|
1250
|
+
const r = e[0] === "Y" ? "years" : "days of the month";
|
|
1251
|
+
return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
1252
1252
|
}
|
|
1253
1253
|
const Ce = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, $e = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ee = /^'([^]*?)'?$/, We = /''/g, _e = /[a-zA-Z]/;
|
|
1254
|
-
function Ye(
|
|
1255
|
-
var
|
|
1256
|
-
const r = q(), a = r.locale ?? pe, s = r.firstWeekContainsDate ?? ((
|
|
1254
|
+
function Ye(e, t, n) {
|
|
1255
|
+
var m, p, w, M;
|
|
1256
|
+
const r = q(), a = r.locale ?? pe, s = r.firstWeekContainsDate ?? ((p = (m = r.locale) == null ? void 0 : m.options) == null ? void 0 : p.firstWeekContainsDate) ?? 1, i = r.weekStartsOn ?? ((M = (w = r.locale) == null ? void 0 : w.options) == null ? void 0 : M.weekStartsOn) ?? 0, o = D(e, n == null ? void 0 : n.in);
|
|
1257
1257
|
if (!Yt(o))
|
|
1258
1258
|
throw new RangeError("Invalid time value");
|
|
1259
|
-
let c =
|
|
1260
|
-
const
|
|
1261
|
-
if (
|
|
1262
|
-
const Y =
|
|
1263
|
-
return Y(
|
|
1259
|
+
let c = t.match($e).map((b) => {
|
|
1260
|
+
const y = b[0];
|
|
1261
|
+
if (y === "p" || y === "P") {
|
|
1262
|
+
const Y = Se[y];
|
|
1263
|
+
return Y(b, a.formatLong);
|
|
1264
1264
|
}
|
|
1265
|
-
return
|
|
1266
|
-
}).join("").match(Ce).map((
|
|
1267
|
-
if (
|
|
1265
|
+
return b;
|
|
1266
|
+
}).join("").match(Ce).map((b) => {
|
|
1267
|
+
if (b === "''")
|
|
1268
1268
|
return { isToken: !1, value: "'" };
|
|
1269
|
-
const
|
|
1270
|
-
if (
|
|
1271
|
-
return { isToken: !1, value: Fe(
|
|
1272
|
-
if (ct[
|
|
1273
|
-
return { isToken: !0, value:
|
|
1274
|
-
if (
|
|
1269
|
+
const y = b[0];
|
|
1270
|
+
if (y === "'")
|
|
1271
|
+
return { isToken: !1, value: Fe(b) };
|
|
1272
|
+
if (ct[y])
|
|
1273
|
+
return { isToken: !0, value: b };
|
|
1274
|
+
if (y.match(_e))
|
|
1275
1275
|
throw new RangeError(
|
|
1276
|
-
"Format string contains an unescaped latin alphabet character `" +
|
|
1276
|
+
"Format string contains an unescaped latin alphabet character `" + y + "`"
|
|
1277
1277
|
);
|
|
1278
|
-
return { isToken: !1, value:
|
|
1278
|
+
return { isToken: !1, value: b };
|
|
1279
1279
|
});
|
|
1280
1280
|
a.localize.preprocessor && (c = a.localize.preprocessor(o, c));
|
|
1281
|
-
const
|
|
1281
|
+
const h = {
|
|
1282
1282
|
firstWeekContainsDate: s,
|
|
1283
1283
|
weekStartsOn: i,
|
|
1284
1284
|
locale: a
|
|
1285
1285
|
};
|
|
1286
|
-
return c.map((
|
|
1287
|
-
if (!
|
|
1288
|
-
const
|
|
1289
|
-
(Oe(
|
|
1290
|
-
const Y = ct[
|
|
1291
|
-
return Y(o,
|
|
1286
|
+
return c.map((b) => {
|
|
1287
|
+
if (!b.isToken) return b.value;
|
|
1288
|
+
const y = b.value;
|
|
1289
|
+
(Oe(y) || xe(y)) && Pe(y, t, String(e));
|
|
1290
|
+
const Y = ct[y[0]];
|
|
1291
|
+
return Y(o, y, a.localize, h);
|
|
1292
1292
|
}).join("");
|
|
1293
1293
|
}
|
|
1294
|
-
function Fe(
|
|
1295
|
-
const
|
|
1296
|
-
return
|
|
1294
|
+
function Fe(e) {
|
|
1295
|
+
const t = e.match(Ee);
|
|
1296
|
+
return t ? t[1].replace(We, "'") : e;
|
|
1297
1297
|
}
|
|
1298
|
-
function Ie(
|
|
1299
|
-
const n =
|
|
1298
|
+
function Ie(e, t) {
|
|
1299
|
+
const n = D(e, t == null ? void 0 : t.in).getDay();
|
|
1300
1300
|
return n === 0 ? 7 : n;
|
|
1301
1301
|
}
|
|
1302
|
-
function Ae(
|
|
1302
|
+
function Ae(e, t, n = "long") {
|
|
1303
1303
|
return new Intl.DateTimeFormat("en-US", {
|
|
1304
1304
|
// Enforces engine to render the time. Without the option JavaScriptCore omits it.
|
|
1305
1305
|
hour: "numeric",
|
|
1306
|
-
timeZone:
|
|
1306
|
+
timeZone: e,
|
|
1307
1307
|
timeZoneName: n
|
|
1308
|
-
}).format(
|
|
1308
|
+
}).format(t).split(/\s/g).slice(2).join(" ");
|
|
1309
1309
|
}
|
|
1310
1310
|
const G = {}, H = {};
|
|
1311
|
-
function C(
|
|
1311
|
+
function C(e, t) {
|
|
1312
1312
|
try {
|
|
1313
|
-
const r = (G[
|
|
1314
|
-
timeZone:
|
|
1313
|
+
const r = (G[e] || (G[e] = new Intl.DateTimeFormat("en-US", {
|
|
1314
|
+
timeZone: e,
|
|
1315
1315
|
timeZoneName: "longOffset"
|
|
1316
|
-
}).format))(
|
|
1316
|
+
}).format))(t).split("GMT")[1];
|
|
1317
1317
|
return r in H ? H[r] : dt(r, r.split(":"));
|
|
1318
1318
|
} catch {
|
|
1319
|
-
if (
|
|
1320
|
-
const n =
|
|
1321
|
-
return n ? dt(
|
|
1319
|
+
if (e in H) return H[e];
|
|
1320
|
+
const n = e == null ? void 0 : e.match(He);
|
|
1321
|
+
return n ? dt(e, n.slice(1)) : NaN;
|
|
1322
1322
|
}
|
|
1323
1323
|
}
|
|
1324
1324
|
const He = /([+-]\d\d):?(\d\d)?/;
|
|
1325
|
-
function dt(
|
|
1326
|
-
const n = +(
|
|
1327
|
-
return H[
|
|
1325
|
+
function dt(e, t) {
|
|
1326
|
+
const n = +(t[0] || 0), r = +(t[1] || 0), a = +(t[2] || 0) / 60;
|
|
1327
|
+
return H[e] = n * 60 + r > 0 ? n * 60 + r + a : n * 60 - r - a;
|
|
1328
1328
|
}
|
|
1329
1329
|
class S extends Date {
|
|
1330
1330
|
//#region static
|
|
1331
|
-
constructor(...
|
|
1332
|
-
super(),
|
|
1331
|
+
constructor(...t) {
|
|
1332
|
+
super(), t.length > 1 && typeof t[t.length - 1] == "string" && (this.timeZone = t.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(C(this.timeZone, this)) ? this.setTime(NaN) : t.length ? typeof t[0] == "number" && (t.length === 1 || t.length === 2 && typeof t[1] != "number") ? this.setTime(t[0]) : typeof t[0] == "string" ? this.setTime(+new Date(t[0])) : t[0] instanceof Date ? this.setTime(+t[0]) : (this.setTime(+new Date(...t)), vt(this), K(this)) : this.setTime(Date.now());
|
|
1333
1333
|
}
|
|
1334
|
-
static tz(
|
|
1335
|
-
return n.length ? new S(...n,
|
|
1334
|
+
static tz(t, ...n) {
|
|
1335
|
+
return n.length ? new S(...n, t) : new S(Date.now(), t);
|
|
1336
1336
|
}
|
|
1337
1337
|
//#endregion
|
|
1338
1338
|
//#region time zone
|
|
1339
|
-
withTimeZone(
|
|
1340
|
-
return new S(+this,
|
|
1339
|
+
withTimeZone(t) {
|
|
1340
|
+
return new S(+this, t);
|
|
1341
1341
|
}
|
|
1342
1342
|
getTimezoneOffset() {
|
|
1343
|
-
const
|
|
1344
|
-
return
|
|
1343
|
+
const t = -C(this.timeZone, this);
|
|
1344
|
+
return t > 0 ? Math.floor(t) : Math.ceil(t);
|
|
1345
1345
|
}
|
|
1346
1346
|
//#endregion
|
|
1347
1347
|
//#region time
|
|
1348
|
-
setTime(
|
|
1348
|
+
setTime(t) {
|
|
1349
1349
|
return Date.prototype.setTime.apply(this, arguments), K(this), +this;
|
|
1350
1350
|
}
|
|
1351
1351
|
//#endregion
|
|
1352
1352
|
//#region date-fns integration
|
|
1353
|
-
[Symbol.for("constructDateFrom")](
|
|
1354
|
-
return new S(+new Date(
|
|
1353
|
+
[Symbol.for("constructDateFrom")](t) {
|
|
1354
|
+
return new S(+new Date(t), this.timeZone);
|
|
1355
1355
|
}
|
|
1356
1356
|
//#endregion
|
|
1357
1357
|
}
|
|
1358
1358
|
const ft = /^(get|set)(?!UTC)/;
|
|
1359
|
-
Object.getOwnPropertyNames(Date.prototype).forEach((
|
|
1360
|
-
if (!ft.test(
|
|
1361
|
-
const
|
|
1362
|
-
S.prototype[
|
|
1363
|
-
return this.internal[
|
|
1364
|
-
} : (S.prototype[
|
|
1365
|
-
return Date.prototype[
|
|
1366
|
-
}, S.prototype[
|
|
1367
|
-
return Date.prototype[
|
|
1359
|
+
Object.getOwnPropertyNames(Date.prototype).forEach((e) => {
|
|
1360
|
+
if (!ft.test(e)) return;
|
|
1361
|
+
const t = e.replace(ft, "$1UTC");
|
|
1362
|
+
S.prototype[t] && (e.startsWith("get") ? S.prototype[e] = function() {
|
|
1363
|
+
return this.internal[t]();
|
|
1364
|
+
} : (S.prototype[e] = function() {
|
|
1365
|
+
return Date.prototype[t].apply(this.internal, arguments), Re(this), +this;
|
|
1366
|
+
}, S.prototype[t] = function() {
|
|
1367
|
+
return Date.prototype[t].apply(this, arguments), K(this), +this;
|
|
1368
1368
|
}));
|
|
1369
1369
|
});
|
|
1370
|
-
function K(
|
|
1371
|
-
|
|
1370
|
+
function K(e) {
|
|
1371
|
+
e.internal.setTime(+e), e.internal.setUTCSeconds(e.internal.getUTCSeconds() - Math.round(-C(e.timeZone, e) * 60));
|
|
1372
1372
|
}
|
|
1373
|
-
function Re(
|
|
1374
|
-
Date.prototype.setFullYear.call(
|
|
1373
|
+
function Re(e) {
|
|
1374
|
+
Date.prototype.setFullYear.call(e, e.internal.getUTCFullYear(), e.internal.getUTCMonth(), e.internal.getUTCDate()), Date.prototype.setHours.call(e, e.internal.getUTCHours(), e.internal.getUTCMinutes(), e.internal.getUTCSeconds(), e.internal.getUTCMilliseconds()), vt(e);
|
|
1375
1375
|
}
|
|
1376
|
-
function vt(
|
|
1377
|
-
const
|
|
1376
|
+
function vt(e) {
|
|
1377
|
+
const t = C(e.timeZone, e), n = t > 0 ? Math.floor(t) : Math.ceil(t), r = /* @__PURE__ */ new Date(+e);
|
|
1378
1378
|
r.setUTCHours(r.getUTCHours() - 1);
|
|
1379
|
-
const a = -(/* @__PURE__ */ new Date(+
|
|
1380
|
-
i && o &&
|
|
1379
|
+
const a = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset(), s = -(/* @__PURE__ */ new Date(+r)).getTimezoneOffset(), i = a - s, o = Date.prototype.getHours.apply(e) !== e.internal.getUTCHours();
|
|
1380
|
+
i && o && e.internal.setUTCMinutes(e.internal.getUTCMinutes() + i);
|
|
1381
1381
|
const c = a - n;
|
|
1382
|
-
c && Date.prototype.setUTCMinutes.call(
|
|
1383
|
-
const
|
|
1384
|
-
|
|
1385
|
-
const
|
|
1386
|
-
(
|
|
1387
|
-
const
|
|
1382
|
+
c && Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + c);
|
|
1383
|
+
const h = /* @__PURE__ */ new Date(+e);
|
|
1384
|
+
h.setUTCSeconds(0);
|
|
1385
|
+
const m = a > 0 ? h.getSeconds() : (h.getSeconds() - 60) % 60, p = Math.round(-(C(e.timeZone, e) * 60)) % 60;
|
|
1386
|
+
(p || m) && (e.internal.setUTCSeconds(e.internal.getUTCSeconds() + p), Date.prototype.setUTCSeconds.call(e, Date.prototype.getUTCSeconds.call(e) + p + m));
|
|
1387
|
+
const w = C(e.timeZone, e), M = w > 0 ? Math.floor(w) : Math.ceil(w), y = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset() - M, Y = M !== n, nt = y - c;
|
|
1388
1388
|
if (Y && nt) {
|
|
1389
|
-
Date.prototype.setUTCMinutes.call(
|
|
1390
|
-
const j = C(
|
|
1391
|
-
Q && (
|
|
1389
|
+
Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + nt);
|
|
1390
|
+
const j = C(e.timeZone, e), Ot = j > 0 ? Math.floor(j) : Math.ceil(j), Q = M - Ot;
|
|
1391
|
+
Q && (e.internal.setUTCMinutes(e.internal.getUTCMinutes() + Q), Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + Q));
|
|
1392
1392
|
}
|
|
1393
1393
|
}
|
|
1394
1394
|
class x extends S {
|
|
1395
1395
|
//#region static
|
|
1396
|
-
static tz(
|
|
1397
|
-
return n.length ? new x(...n,
|
|
1396
|
+
static tz(t, ...n) {
|
|
1397
|
+
return n.length ? new x(...n, t) : new x(Date.now(), t);
|
|
1398
1398
|
}
|
|
1399
1399
|
//#endregion
|
|
1400
1400
|
//#region representation
|
|
1401
1401
|
toISOString() {
|
|
1402
|
-
const [
|
|
1402
|
+
const [t, n, r] = this.tzComponents(), a = `${t}${n}:${r}`;
|
|
1403
1403
|
return this.internal.toISOString().slice(0, -1) + a;
|
|
1404
1404
|
}
|
|
1405
1405
|
toString() {
|
|
1406
1406
|
return `${this.toDateString()} ${this.toTimeString()}`;
|
|
1407
1407
|
}
|
|
1408
1408
|
toDateString() {
|
|
1409
|
-
const [
|
|
1410
|
-
return `${
|
|
1409
|
+
const [t, n, r, a] = this.internal.toUTCString().split(" ");
|
|
1410
|
+
return `${t == null ? void 0 : t.slice(0, -1)} ${r} ${n} ${a}`;
|
|
1411
1411
|
}
|
|
1412
1412
|
toTimeString() {
|
|
1413
|
-
const
|
|
1414
|
-
return `${
|
|
1413
|
+
const t = this.internal.toUTCString().split(" ")[4], [n, r, a] = this.tzComponents();
|
|
1414
|
+
return `${t} GMT${n}${r}${a} (${Ae(this.timeZone, this)})`;
|
|
1415
1415
|
}
|
|
1416
|
-
toLocaleString(
|
|
1417
|
-
return Date.prototype.toLocaleString.call(this,
|
|
1416
|
+
toLocaleString(t, n) {
|
|
1417
|
+
return Date.prototype.toLocaleString.call(this, t, {
|
|
1418
1418
|
...n,
|
|
1419
1419
|
timeZone: (n == null ? void 0 : n.timeZone) || this.timeZone
|
|
1420
1420
|
});
|
|
1421
1421
|
}
|
|
1422
|
-
toLocaleDateString(
|
|
1423
|
-
return Date.prototype.toLocaleDateString.call(this,
|
|
1422
|
+
toLocaleDateString(t, n) {
|
|
1423
|
+
return Date.prototype.toLocaleDateString.call(this, t, {
|
|
1424
1424
|
...n,
|
|
1425
1425
|
timeZone: (n == null ? void 0 : n.timeZone) || this.timeZone
|
|
1426
1426
|
});
|
|
1427
1427
|
}
|
|
1428
|
-
toLocaleTimeString(
|
|
1429
|
-
return Date.prototype.toLocaleTimeString.call(this,
|
|
1428
|
+
toLocaleTimeString(t, n) {
|
|
1429
|
+
return Date.prototype.toLocaleTimeString.call(this, t, {
|
|
1430
1430
|
...n,
|
|
1431
1431
|
timeZone: (n == null ? void 0 : n.timeZone) || this.timeZone
|
|
1432
1432
|
});
|
|
@@ -1434,102 +1434,102 @@ class x extends S {
|
|
|
1434
1434
|
//#endregion
|
|
1435
1435
|
//#region private
|
|
1436
1436
|
tzComponents() {
|
|
1437
|
-
const
|
|
1437
|
+
const t = this.getTimezoneOffset(), n = t > 0 ? "-" : "+", r = String(Math.floor(Math.abs(t) / 60)).padStart(2, "0"), a = String(Math.abs(t) % 60).padStart(2, "0");
|
|
1438
1438
|
return [n, r, a];
|
|
1439
1439
|
}
|
|
1440
1440
|
//#endregion
|
|
1441
|
-
withTimeZone(
|
|
1442
|
-
return new x(+this,
|
|
1441
|
+
withTimeZone(t) {
|
|
1442
|
+
return new x(+this, t);
|
|
1443
1443
|
}
|
|
1444
1444
|
//#region date-fns integration
|
|
1445
|
-
[Symbol.for("constructDateFrom")](
|
|
1446
|
-
return new x(+new Date(
|
|
1445
|
+
[Symbol.for("constructDateFrom")](t) {
|
|
1446
|
+
return new x(+new Date(t), this.timeZone);
|
|
1447
1447
|
}
|
|
1448
1448
|
//#endregion
|
|
1449
1449
|
}
|
|
1450
1450
|
window.pktTz = window.pktTz === void 0 ? "Europe/Oslo" : window.pktTz;
|
|
1451
|
-
const Ue = (
|
|
1452
|
-
const
|
|
1453
|
-
return
|
|
1451
|
+
const Ue = (e = window.pktTz) => {
|
|
1452
|
+
const t = new x((/* @__PURE__ */ new Date()).toISOString(), e);
|
|
1453
|
+
return t.setHours(0, 0, 0, 0), isNaN(t.getTime()) ? /* @__PURE__ */ new Date() : new Date(t.getFullYear(), t.getMonth(), t.getDate());
|
|
1454
1454
|
};
|
|
1455
|
-
function O(
|
|
1456
|
-
if (!
|
|
1457
|
-
if (/^\d{4}-\d{2}-\d{2}$/.test(
|
|
1458
|
-
const [
|
|
1459
|
-
return new Date(
|
|
1460
|
-
}
|
|
1461
|
-
if (/^\d{4}-\d{2}$/.test(
|
|
1462
|
-
const [
|
|
1463
|
-
return new Date(
|
|
1464
|
-
}
|
|
1465
|
-
return /^\d{4}$/.test(
|
|
1466
|
-
}
|
|
1467
|
-
const
|
|
1468
|
-
if (!
|
|
1469
|
-
const
|
|
1470
|
-
return `${
|
|
1471
|
-
}, U = (
|
|
1472
|
-
if (!
|
|
1455
|
+
function O(e) {
|
|
1456
|
+
if (!e || e === "") return /* @__PURE__ */ new Date();
|
|
1457
|
+
if (/^\d{4}-\d{2}-\d{2}$/.test(e)) {
|
|
1458
|
+
const [t, n, r] = e.split("-").map(Number);
|
|
1459
|
+
return new Date(t, n - 1, r);
|
|
1460
|
+
}
|
|
1461
|
+
if (/^\d{4}-\d{2}$/.test(e)) {
|
|
1462
|
+
const [t, n] = e.split("-").map(Number);
|
|
1463
|
+
return new Date(t, n - 1, 1);
|
|
1464
|
+
}
|
|
1465
|
+
return /^\d{4}$/.test(e) ? new Date(Number(e), 0, 1) : new Date(e);
|
|
1466
|
+
}
|
|
1467
|
+
const g = (e) => {
|
|
1468
|
+
if (!e || isNaN(e.getTime())) return "";
|
|
1469
|
+
const t = e.getFullYear(), n = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
|
|
1470
|
+
return `${t}-${n}-${r}`;
|
|
1471
|
+
}, U = (e) => {
|
|
1472
|
+
if (!e)
|
|
1473
1473
|
return null;
|
|
1474
|
-
const
|
|
1475
|
-
return isNaN(
|
|
1476
|
-
},
|
|
1477
|
-
const n = _(
|
|
1478
|
-
return isNaN(n.getTime()) ? "" : Ye(n,
|
|
1479
|
-
}, _ = (
|
|
1480
|
-
const n = typeof
|
|
1481
|
-
return !n || isNaN(n.getTime()) ? /* @__PURE__ */ new Date() :
|
|
1482
|
-
}, $ = (
|
|
1483
|
-
if (typeof
|
|
1474
|
+
const t = O(e);
|
|
1475
|
+
return isNaN(t.getTime()) ? null : t;
|
|
1476
|
+
}, yn = (e, t) => {
|
|
1477
|
+
const n = _(e);
|
|
1478
|
+
return isNaN(n.getTime()) ? "" : Ye(n, t);
|
|
1479
|
+
}, _ = (e = "", t) => {
|
|
1480
|
+
const n = typeof e == "string" ? O(e) : e;
|
|
1481
|
+
return !n || isNaN(n.getTime()) ? /* @__PURE__ */ new Date() : t ? t === "end" ? Ft(n) : J(n) : n;
|
|
1482
|
+
}, $ = (e, t, n = 1) => {
|
|
1483
|
+
if (typeof e != "number" || typeof t != "number" || typeof n != "number" || isNaN(e) || isNaN(t) || isNaN(n))
|
|
1484
1484
|
return /* @__PURE__ */ new Date();
|
|
1485
|
-
const r = new Date(
|
|
1485
|
+
const r = new Date(e, t, n);
|
|
1486
1486
|
return isNaN(r.getTime()) ? /* @__PURE__ */ new Date() : r;
|
|
1487
|
-
}, A = (
|
|
1488
|
-
let
|
|
1489
|
-
return typeof
|
|
1487
|
+
}, A = (e) => {
|
|
1488
|
+
let t;
|
|
1489
|
+
return typeof e == "number" ? t = new x(e, window.pktTz) : t = new x(e, window.pktTz), t.setHours(12, 0, 0, 0), t;
|
|
1490
1490
|
};
|
|
1491
1491
|
let V = null, mt;
|
|
1492
|
-
const Le = (
|
|
1493
|
-
if (!
|
|
1494
|
-
const
|
|
1495
|
-
return (!V || mt !==
|
|
1496
|
-
}, Be = (
|
|
1497
|
-
if (!
|
|
1498
|
-
const r =
|
|
1499
|
-
return !(r &&
|
|
1500
|
-
}, qe = (
|
|
1501
|
-
if (!
|
|
1502
|
-
const n =
|
|
1503
|
-
return
|
|
1504
|
-
}, ze = (
|
|
1505
|
-
if (!
|
|
1506
|
-
const n =
|
|
1507
|
-
return
|
|
1508
|
-
}, Mt = (
|
|
1492
|
+
const Le = (e) => {
|
|
1493
|
+
if (!e || isNaN(e.getTime())) return "";
|
|
1494
|
+
const t = typeof window < "u" ? window.pktTz : void 0;
|
|
1495
|
+
return (!V || mt !== t) && (V = new Intl.DateTimeFormat("no", { dateStyle: "full", timeZone: t }), mt = t), V.format(e);
|
|
1496
|
+
}, Be = (e, t, n) => {
|
|
1497
|
+
if (!e || isNaN(e.getTime())) return !1;
|
|
1498
|
+
const r = t ? _(t) : null, a = n ? _(n) : null;
|
|
1499
|
+
return !(r && e < r || a && e > a);
|
|
1500
|
+
}, qe = (e, t) => {
|
|
1501
|
+
if (!e || isNaN(e.getTime()) || !Array.isArray(t)) return !1;
|
|
1502
|
+
const n = g(e);
|
|
1503
|
+
return t.includes(n);
|
|
1504
|
+
}, ze = (e, t) => {
|
|
1505
|
+
if (!e || isNaN(e.getTime()) || !Array.isArray(t)) return !1;
|
|
1506
|
+
const n = e.getDay().toString();
|
|
1507
|
+
return t.includes(n);
|
|
1508
|
+
}, Mt = (e, t, n, r, a) => !(!e || isNaN(e.getTime()) || !Be(e, t, n) || r && qe(e, r) || a && ze(e, a)), pn = (e, t, n, r, a) => e.filter((s) => {
|
|
1509
1509
|
const i = U(s);
|
|
1510
|
-
return i && Mt(i,
|
|
1511
|
-
}),
|
|
1512
|
-
const r = U(
|
|
1510
|
+
return i && Mt(i, t, n, r, a);
|
|
1511
|
+
}), wn = (e) => e.slice().sort((t, n) => {
|
|
1512
|
+
const r = U(t), a = U(n);
|
|
1513
1513
|
return !r || !a ? 0 : r.getTime() - a.getTime();
|
|
1514
|
-
}),
|
|
1515
|
-
const n = U(
|
|
1514
|
+
}), bn = (e, t) => {
|
|
1515
|
+
const n = U(e), r = U(t);
|
|
1516
1516
|
return !n || !r ? !1 : n <= r;
|
|
1517
|
-
}, je = (
|
|
1518
|
-
if (!
|
|
1519
|
-
if (Array.isArray(
|
|
1520
|
-
if (typeof
|
|
1517
|
+
}, je = (e) => {
|
|
1518
|
+
if (!e) return [];
|
|
1519
|
+
if (Array.isArray(e)) return e.filter(Boolean);
|
|
1520
|
+
if (typeof e == "string" && e.trimStart().startsWith("["))
|
|
1521
1521
|
try {
|
|
1522
|
-
const
|
|
1523
|
-
if (Array.isArray(
|
|
1524
|
-
return
|
|
1522
|
+
const t = JSON.parse(e);
|
|
1523
|
+
if (Array.isArray(t))
|
|
1524
|
+
return t.filter(Boolean);
|
|
1525
1525
|
} catch {
|
|
1526
1526
|
}
|
|
1527
|
-
return String(
|
|
1528
|
-
},
|
|
1529
|
-
if (typeof
|
|
1530
|
-
return
|
|
1531
|
-
if (Array.isArray(
|
|
1532
|
-
return
|
|
1527
|
+
return String(e).split(",").map((t) => t.trim()).filter(Boolean);
|
|
1528
|
+
}, Dn = (e) => e.join(","), Qe = (e) => je(e), Xe = (e) => e ? O(e) : null, Ge = (e) => {
|
|
1529
|
+
if (typeof e == "string")
|
|
1530
|
+
return e.split(",").map((t) => O(t));
|
|
1531
|
+
if (Array.isArray(e))
|
|
1532
|
+
return e.map((t) => O(t));
|
|
1533
1533
|
}, z = {
|
|
1534
1534
|
csvToArray: Qe,
|
|
1535
1535
|
stringToDate: Xe,
|
|
@@ -1537,36 +1537,36 @@ const Le = (t) => {
|
|
|
1537
1537
|
}, Ve = { earliest: { default: null }, latest: { default: null }, weeknumbers: { default: !1 }, withcontrols: { default: !1 }, multiple: { default: !1 }, maxMultiple: { default: 4 }, range: { default: !1 } }, P = {
|
|
1538
1538
|
props: Ve
|
|
1539
1539
|
};
|
|
1540
|
-
function Tt(
|
|
1541
|
-
const n = (
|
|
1542
|
-
(r) => typeof r == "string" ? r :
|
|
1540
|
+
function Tt(e, t) {
|
|
1541
|
+
const n = (t.excludedates ?? []).map(
|
|
1542
|
+
(r) => typeof r == "string" ? r : g(r)
|
|
1543
1543
|
);
|
|
1544
1544
|
return !Mt(
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1545
|
+
e,
|
|
1546
|
+
t.earliest,
|
|
1547
|
+
t.latest,
|
|
1548
1548
|
n,
|
|
1549
|
-
|
|
1549
|
+
t.excludeweekdays ?? []
|
|
1550
1550
|
);
|
|
1551
1551
|
}
|
|
1552
|
-
function Je(
|
|
1553
|
-
return !!(Tt(
|
|
1552
|
+
function Je(e, t, n, r) {
|
|
1553
|
+
return !!(Tt(e, n) || !t && r.multiple && r.maxMultiple > 0 && r.selectedCount >= r.maxMultiple);
|
|
1554
1554
|
}
|
|
1555
|
-
function Ke(
|
|
1556
|
-
const r = $(
|
|
1555
|
+
function Ke(e, t, n) {
|
|
1556
|
+
const r = $(e, t, 0);
|
|
1557
1557
|
return !(n && _(n) > r);
|
|
1558
1558
|
}
|
|
1559
|
-
function Ze(
|
|
1559
|
+
function Ze(e, t, n) {
|
|
1560
1560
|
const r = $(
|
|
1561
|
-
|
|
1562
|
-
|
|
1561
|
+
t === 11 ? e + 1 : e,
|
|
1562
|
+
t === 11 ? 0 : t + 1,
|
|
1563
1563
|
1
|
|
1564
1564
|
);
|
|
1565
1565
|
return !(n && _(n) < r);
|
|
1566
1566
|
}
|
|
1567
1567
|
const L = 7, tn = 6;
|
|
1568
|
-
function en(
|
|
1569
|
-
const n = $(
|
|
1568
|
+
function en(e, t) {
|
|
1569
|
+
const n = $(e, t, 1), r = $(e, t + 1, 0), a = (n.getDay() + tn) % L, s = r.getDate(), i = Math.ceil((s + a) / L), c = $(e, t, 0).getDate(), h = kt(n);
|
|
1570
1570
|
return {
|
|
1571
1571
|
firstDayOfMonth: n,
|
|
1572
1572
|
lastDayOfMonth: r,
|
|
@@ -1574,73 +1574,73 @@ function en(t, e) {
|
|
|
1574
1574
|
numDays: s,
|
|
1575
1575
|
numRows: i,
|
|
1576
1576
|
numDaysPrevMonth: c,
|
|
1577
|
-
initialWeek:
|
|
1577
|
+
initialWeek: h
|
|
1578
1578
|
};
|
|
1579
1579
|
}
|
|
1580
|
-
function nn(
|
|
1580
|
+
function nn(e, t, n, r) {
|
|
1581
1581
|
const { startingDay: a, numDays: s } = r;
|
|
1582
|
-
return
|
|
1582
|
+
return e === 0 && t < a ? "prev-month" : n > s ? "next-month" : "current-month";
|
|
1583
1583
|
}
|
|
1584
|
-
function rn(
|
|
1584
|
+
function rn(e, t, n, r) {
|
|
1585
1585
|
const { startingDay: a, numDaysPrevMonth: s, numDays: i } = r;
|
|
1586
|
-
return
|
|
1586
|
+
return e === "prev-month" ? s - (a - t - 1) : e === "next-month" ? n - i : n;
|
|
1587
1587
|
}
|
|
1588
|
-
function W(
|
|
1589
|
-
return typeof
|
|
1588
|
+
function W(e) {
|
|
1589
|
+
return typeof e == "string" && (e = e.split(",")), e.length === 1 && e[0] === "" ? [] : e.map((t) => O(t));
|
|
1590
1590
|
}
|
|
1591
|
-
function gt(
|
|
1592
|
-
const n = bt({ start:
|
|
1591
|
+
function gt(e, t) {
|
|
1592
|
+
const n = bt({ start: e, end: t }), r = {};
|
|
1593
1593
|
if (Array.isArray(n) && n.length)
|
|
1594
1594
|
for (let a = 0; a < n.length; a++) {
|
|
1595
|
-
const s = n[a], i = s >
|
|
1596
|
-
r[
|
|
1595
|
+
const s = n[a], i = s > e && s < t;
|
|
1596
|
+
r[g(s)] = i;
|
|
1597
1597
|
}
|
|
1598
1598
|
return r;
|
|
1599
1599
|
}
|
|
1600
|
-
function xt(
|
|
1601
|
-
if (
|
|
1600
|
+
function xt(e, t, n, r) {
|
|
1601
|
+
if (t.length !== 1) return !0;
|
|
1602
1602
|
const a = bt({
|
|
1603
|
-
start:
|
|
1604
|
-
end:
|
|
1603
|
+
start: t[0],
|
|
1604
|
+
end: e
|
|
1605
1605
|
});
|
|
1606
1606
|
if (!Array.isArray(a) || !a.length) return !0;
|
|
1607
1607
|
for (let s = 0; s < a.length; s++) {
|
|
1608
1608
|
for (const i of n ?? [])
|
|
1609
|
-
if (i >
|
|
1609
|
+
if (i > t[0] && i < e)
|
|
1610
1610
|
return !1;
|
|
1611
1611
|
if ((r ?? []).includes(Ie(a[s]).toString()))
|
|
1612
1612
|
return !1;
|
|
1613
1613
|
}
|
|
1614
1614
|
return !0;
|
|
1615
1615
|
}
|
|
1616
|
-
function tt(
|
|
1617
|
-
const n =
|
|
1618
|
-
return
|
|
1616
|
+
function tt(e, t) {
|
|
1617
|
+
const n = g(e);
|
|
1618
|
+
return t.includes(n) ? t : [...t, n];
|
|
1619
1619
|
}
|
|
1620
|
-
function et(
|
|
1621
|
-
const n =
|
|
1622
|
-
if (r === -1) return
|
|
1623
|
-
if (
|
|
1624
|
-
const a = [...
|
|
1620
|
+
function et(e, t) {
|
|
1621
|
+
const n = g(e), r = t.indexOf(n);
|
|
1622
|
+
if (r === -1) return t;
|
|
1623
|
+
if (t.length === 1) return [];
|
|
1624
|
+
const a = [...t];
|
|
1625
1625
|
return a.splice(r, 1), a;
|
|
1626
1626
|
}
|
|
1627
|
-
function an(
|
|
1628
|
-
const r =
|
|
1629
|
-
return
|
|
1627
|
+
function an(e, t, n) {
|
|
1628
|
+
const r = g(e);
|
|
1629
|
+
return t.includes(r) ? et(e, t) : n > 0 && t.length >= n ? t : tt(e, t);
|
|
1630
1630
|
}
|
|
1631
|
-
function sn(
|
|
1632
|
-
const r =
|
|
1633
|
-
if (
|
|
1634
|
-
return
|
|
1635
|
-
if (
|
|
1631
|
+
function sn(e, t, n) {
|
|
1632
|
+
const r = g(e), a = W(t);
|
|
1633
|
+
if (t.includes(r))
|
|
1634
|
+
return t.indexOf(r) === 0 ? [] : et(e, t);
|
|
1635
|
+
if (t.length > 1)
|
|
1636
1636
|
return [r];
|
|
1637
|
-
if (
|
|
1638
|
-
if (!xt(
|
|
1637
|
+
if (t.length === 1) {
|
|
1638
|
+
if (!xt(e, a, n.excludedates, n.excludeweekdays))
|
|
1639
1639
|
return [r];
|
|
1640
|
-
if (a[0] >
|
|
1640
|
+
if (a[0] > e)
|
|
1641
1641
|
return [r];
|
|
1642
1642
|
}
|
|
1643
|
-
return tt(
|
|
1643
|
+
return tt(e, t);
|
|
1644
1644
|
}
|
|
1645
1645
|
const on = {
|
|
1646
1646
|
ArrowLeft: -1,
|
|
@@ -1648,28 +1648,28 @@ const on = {
|
|
|
1648
1648
|
ArrowUp: -L,
|
|
1649
1649
|
ArrowDown: L
|
|
1650
1650
|
};
|
|
1651
|
-
function cn(
|
|
1651
|
+
function cn(e) {
|
|
1652
1652
|
var n;
|
|
1653
|
-
const
|
|
1654
|
-
return
|
|
1653
|
+
const t = e.nodeName;
|
|
1654
|
+
return t === "INPUT" || t === "SELECT" || t === "BUTTON" && !((n = e.dataset) != null && n.date);
|
|
1655
1655
|
}
|
|
1656
|
-
function un(
|
|
1657
|
-
let r = it(
|
|
1656
|
+
function un(e, t, n) {
|
|
1657
|
+
let r = it(e, t);
|
|
1658
1658
|
if (!r) return null;
|
|
1659
|
-
let a = n(`button[data-date="${
|
|
1659
|
+
let a = n(`button[data-date="${g(r)}"]`);
|
|
1660
1660
|
for (; a instanceof HTMLButtonElement && a.dataset.disabled; )
|
|
1661
|
-
if (r = it(r,
|
|
1661
|
+
if (r = it(r, t), a = n(`button[data-date="${g(r)}"]`), !a) return null;
|
|
1662
1662
|
return r;
|
|
1663
1663
|
}
|
|
1664
|
-
function ln(
|
|
1665
|
-
return on[
|
|
1664
|
+
function ln(e) {
|
|
1665
|
+
return on[e] ?? null;
|
|
1666
1666
|
}
|
|
1667
|
-
var hn = Object.defineProperty,
|
|
1668
|
-
for (var a =
|
|
1669
|
-
(i =
|
|
1670
|
-
return
|
|
1667
|
+
var hn = Object.defineProperty, d = (e, t, n, r) => {
|
|
1668
|
+
for (var a = void 0, s = e.length - 1, i; s >= 0; s--)
|
|
1669
|
+
(i = e[s]) && (a = i(t, n, a) || a);
|
|
1670
|
+
return a && hn(t, n, a), a;
|
|
1671
1671
|
};
|
|
1672
|
-
|
|
1672
|
+
class l extends Nt {
|
|
1673
1673
|
constructor() {
|
|
1674
1674
|
super(...arguments), this.selected = [], this.multiple = P.props.multiple.default, this.maxMultiple = P.props.maxMultiple.default, this.range = P.props.range.default, this.earliest = P.props.earliest.default, this.latest = P.props.latest.default, this.excludedates = [], this.excludeweekdays = [], this.weeknumbers = P.props.weeknumbers.default, this.withcontrols = P.props.withcontrols.default, this.currentmonth = null, this.today = null, this.dayStrings = this.strings.dates.daysShort, this.dayStringsLong = this.strings.dates.days, this.monthStrings = this.strings.dates.months, this.weekString = this.strings.dates.week, this.prevMonthString = this.strings.dates.prevMonth, this.nextMonthString = this.strings.dates.nextMonth, this._selected = [], this.inRange = {}, this.rangeHovered = null, this.year = 0, this.month = 0, this.week = 0, this.currentmonthtouched = !1, this.focusedDate = null, this.selectableDates = [], this.tabIndexSet = 0;
|
|
1675
1675
|
}
|
|
@@ -1705,27 +1705,27 @@ let l = class extends Pt {
|
|
|
1705
1705
|
* Keyboard navigation
|
|
1706
1706
|
*/
|
|
1707
1707
|
handleKeydown(t) {
|
|
1708
|
-
const
|
|
1709
|
-
|
|
1708
|
+
const n = ln(t.key);
|
|
1709
|
+
n !== null && this.handleArrowKey(t, n);
|
|
1710
1710
|
}
|
|
1711
|
-
handleArrowKey(t,
|
|
1712
|
-
const
|
|
1713
|
-
if (cn(
|
|
1711
|
+
handleArrowKey(t, n) {
|
|
1712
|
+
const r = t.target;
|
|
1713
|
+
if (cn(r)) return;
|
|
1714
1714
|
if (t.preventDefault(), !this.focusedDate) {
|
|
1715
1715
|
this.focusOnCurrentDate();
|
|
1716
1716
|
return;
|
|
1717
1717
|
}
|
|
1718
|
-
const
|
|
1719
|
-
if (
|
|
1720
|
-
const
|
|
1721
|
-
|
|
1718
|
+
const a = this.focusedDate ? _(this.focusedDate) : $(this.year, this.month, 1), s = un(a, n, this.querySelector.bind(this));
|
|
1719
|
+
if (s) {
|
|
1720
|
+
const i = this.querySelector(`button[data-date="${g(s)}"]`);
|
|
1721
|
+
i instanceof HTMLButtonElement && !i.dataset.disabled && (this.focusedDate = g(s), i.focus());
|
|
1722
1722
|
}
|
|
1723
1723
|
}
|
|
1724
1724
|
/**
|
|
1725
1725
|
* Rendering methods
|
|
1726
1726
|
*/
|
|
1727
1727
|
render() {
|
|
1728
|
-
return
|
|
1728
|
+
return k`
|
|
1729
1729
|
<div
|
|
1730
1730
|
class="pkt-calendar ${this.weeknumbers ? "pkt-cal-weeknumbers" : ""}"
|
|
1731
1731
|
@focusout=${this.closeEvent}
|
|
@@ -1754,40 +1754,40 @@ let l = class extends Pt {
|
|
|
1754
1754
|
`;
|
|
1755
1755
|
}
|
|
1756
1756
|
renderMonthNavButton(t) {
|
|
1757
|
-
const
|
|
1758
|
-
return
|
|
1757
|
+
const n = t === "prev", r = n ? this.isPrevMonthAllowed() : this.isNextMonthAllowed(), a = n ? this.prevMonthString : this.nextMonthString, s = n ? "chevron-thin-left" : "chevron-thin-right", i = n ? "pkt-calendar__prev-month" : "pkt-calendar__next-month", o = n ? () => this.prevMonth() : () => this.nextMonth();
|
|
1758
|
+
return k`<div>
|
|
1759
1759
|
<button
|
|
1760
1760
|
type="button"
|
|
1761
|
-
aria-label="${
|
|
1762
|
-
@click=${() =>
|
|
1763
|
-
@keydown=${(
|
|
1764
|
-
(
|
|
1761
|
+
aria-label="${a}"
|
|
1762
|
+
@click=${() => r && o()}
|
|
1763
|
+
@keydown=${(c) => {
|
|
1764
|
+
(c.key === "Enter" || c.key === " ") && (c.preventDefault(), r && o());
|
|
1765
1765
|
}}
|
|
1766
|
-
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only ${
|
|
1767
|
-
.data-disabled=${
|
|
1768
|
-
?aria-disabled=${!
|
|
1769
|
-
tabindex=${
|
|
1766
|
+
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only ${i} ${r ? "" : "pkt-invisible"}"
|
|
1767
|
+
.data-disabled=${r ? at : "disabled"}
|
|
1768
|
+
?aria-disabled=${!r}
|
|
1769
|
+
tabindex=${r ? "0" : "-1"}
|
|
1770
1770
|
>
|
|
1771
|
-
<pkt-icon class="pkt-btn__icon" name="${
|
|
1772
|
-
<span class="pkt-btn__text">${
|
|
1771
|
+
<pkt-icon class="pkt-btn__icon" name="${s}"></pkt-icon>
|
|
1772
|
+
<span class="pkt-btn__text">${a}</span>
|
|
1773
1773
|
</button>
|
|
1774
1774
|
</div>`;
|
|
1775
1775
|
}
|
|
1776
1776
|
renderDayNames() {
|
|
1777
1777
|
const t = [];
|
|
1778
|
-
this.weeknumbers && t.push(
|
|
1779
|
-
for (let
|
|
1778
|
+
this.weeknumbers && t.push(k`<th><div class="pkt-calendar__week-number">${this.weekString}</div></th>`);
|
|
1779
|
+
for (let n = 0; n < this.dayStrings.length; n++)
|
|
1780
1780
|
t.push(
|
|
1781
|
-
|
|
1782
|
-
<div class="pkt-calendar__day-name" aria-label="${this.dayStringsLong[
|
|
1783
|
-
${this.dayStrings[
|
|
1781
|
+
k`<th>
|
|
1782
|
+
<div class="pkt-calendar__day-name" aria-label="${this.dayStringsLong[n]}">
|
|
1783
|
+
${this.dayStrings[n]}
|
|
1784
1784
|
</div>
|
|
1785
1785
|
</th>`
|
|
1786
1786
|
);
|
|
1787
|
-
return
|
|
1787
|
+
return k`<tr class="pkt-cal-week-row">${t}</tr>`;
|
|
1788
1788
|
}
|
|
1789
1789
|
renderMonthNav() {
|
|
1790
|
-
return this.withcontrols ?
|
|
1790
|
+
return this.withcontrols ? k`<div class="pkt-cal-month-picker">
|
|
1791
1791
|
<label for="${this.id}-monthnav" class="pkt-hide">${this.strings.dates.month}</label>
|
|
1792
1792
|
<select
|
|
1793
1793
|
aria-label="${this.strings.dates.month}"
|
|
@@ -1795,12 +1795,12 @@ let l = class extends Pt {
|
|
|
1795
1795
|
id="${this.id}-monthnav"
|
|
1796
1796
|
@change=${(t) => {
|
|
1797
1797
|
t.stopImmediatePropagation();
|
|
1798
|
-
const
|
|
1799
|
-
this.changeMonth(this.year, parseInt(
|
|
1798
|
+
const n = t.target;
|
|
1799
|
+
this.changeMonth(this.year, parseInt(n.value));
|
|
1800
1800
|
}}
|
|
1801
1801
|
>
|
|
1802
1802
|
${this.monthStrings.map(
|
|
1803
|
-
(t,
|
|
1803
|
+
(t, n) => k`<option value=${n} ?selected=${this.month === n}>${t}</option>`
|
|
1804
1804
|
)}
|
|
1805
1805
|
</select>
|
|
1806
1806
|
<label for="${this.id}-yearnav" class="pkt-hide">${this.strings.dates.year}</label>
|
|
@@ -1813,25 +1813,25 @@ let l = class extends Pt {
|
|
|
1813
1813
|
placeholder="0000"
|
|
1814
1814
|
@change=${(t) => {
|
|
1815
1815
|
t.stopImmediatePropagation();
|
|
1816
|
-
const
|
|
1817
|
-
this.changeMonth(parseInt(
|
|
1816
|
+
const n = t.target;
|
|
1817
|
+
this.changeMonth(parseInt(n.value), this.month);
|
|
1818
1818
|
}}
|
|
1819
1819
|
.value=${this.year}
|
|
1820
1820
|
/>
|
|
1821
|
-
</div>` :
|
|
1821
|
+
</div>` : k`<div class="pkt-txt-16-medium pkt-calendar__month-title" aria-live="polite">
|
|
1822
1822
|
${this.monthStrings[this.month]} ${this.year}
|
|
1823
1823
|
</div>`;
|
|
1824
1824
|
}
|
|
1825
|
-
getDayViewData(t,
|
|
1826
|
-
const
|
|
1825
|
+
getDayViewData(t, n) {
|
|
1826
|
+
const r = $(this.year, this.month, t), a = g(r), s = a === g(n), i = this.selected.includes(a), o = this.isDayDisabled(r, i), c = this.calculateTabIndex(a, o, t);
|
|
1827
1827
|
return {
|
|
1828
|
-
currentDate:
|
|
1829
|
-
currentDateISO:
|
|
1830
|
-
isToday:
|
|
1831
|
-
isSelected:
|
|
1832
|
-
isDisabled:
|
|
1833
|
-
ariaLabel: Le(
|
|
1834
|
-
tabindex:
|
|
1828
|
+
currentDate: r,
|
|
1829
|
+
currentDateISO: a,
|
|
1830
|
+
isToday: s,
|
|
1831
|
+
isSelected: i,
|
|
1832
|
+
isDisabled: o,
|
|
1833
|
+
ariaLabel: Le(r),
|
|
1834
|
+
tabindex: c
|
|
1835
1835
|
};
|
|
1836
1836
|
}
|
|
1837
1837
|
getDateConstraints() {
|
|
@@ -1842,65 +1842,65 @@ let l = class extends Pt {
|
|
|
1842
1842
|
excludeweekdays: this.excludeweekdays
|
|
1843
1843
|
};
|
|
1844
1844
|
}
|
|
1845
|
-
isDayDisabled(t,
|
|
1846
|
-
return Je(t,
|
|
1845
|
+
isDayDisabled(t, n) {
|
|
1846
|
+
return Je(t, n, this.getDateConstraints(), {
|
|
1847
1847
|
multiple: this.multiple,
|
|
1848
1848
|
maxMultiple: this.maxMultiple,
|
|
1849
1849
|
selectedCount: this.selected.length
|
|
1850
1850
|
});
|
|
1851
1851
|
}
|
|
1852
|
-
calculateTabIndex(t,
|
|
1853
|
-
return this.focusedDate ? this.focusedDate === t && !
|
|
1852
|
+
calculateTabIndex(t, n, r) {
|
|
1853
|
+
return this.focusedDate ? this.focusedDate === t && !n ? "0" : "-1" : !n && this.tabIndexSet === 0 ? (this.tabIndexSet = r, "0") : this.tabIndexSet === r ? "0" : "-1";
|
|
1854
1854
|
}
|
|
1855
1855
|
getDayCellClasses(t) {
|
|
1856
|
-
const { currentDateISO:
|
|
1856
|
+
const { currentDateISO: n, isToday: r, isSelected: a } = t, s = this.range && (this.selected.length === 2 || this.rangeHovered !== null) && n === this.selected[0], i = this.range && this.selected.length === 2 && n === this.selected[1];
|
|
1857
1857
|
return {
|
|
1858
|
-
"pkt-cal-today":
|
|
1859
|
-
"pkt-cal-selected":
|
|
1860
|
-
"pkt-cal-in-range": this.inRange[
|
|
1858
|
+
"pkt-cal-today": r,
|
|
1859
|
+
"pkt-cal-selected": a,
|
|
1860
|
+
"pkt-cal-in-range": this.inRange[n],
|
|
1861
1861
|
"pkt-cal-excluded": this.isExcluded(t.currentDate),
|
|
1862
|
-
"pkt-cal-in-range-first":
|
|
1863
|
-
"pkt-cal-in-range-last":
|
|
1864
|
-
"pkt-cal-range-hover": this.rangeHovered !== null &&
|
|
1862
|
+
"pkt-cal-in-range-first": s,
|
|
1863
|
+
"pkt-cal-in-range-last": i,
|
|
1864
|
+
"pkt-cal-range-hover": this.rangeHovered !== null && n === g(this.rangeHovered)
|
|
1865
1865
|
};
|
|
1866
1866
|
}
|
|
1867
1867
|
getDayButtonClasses(t) {
|
|
1868
|
-
const { currentDateISO:
|
|
1868
|
+
const { currentDateISO: n, isToday: r, isSelected: a, isDisabled: s } = t, i = this.range && (this.selected.length === 2 || this.rangeHovered !== null) && n === this.selected[0], o = this.range && this.selected.length === 2 && n === this.selected[1];
|
|
1869
1869
|
return {
|
|
1870
1870
|
"pkt-calendar__date": !0,
|
|
1871
|
-
"pkt-calendar__date--today":
|
|
1872
|
-
"pkt-calendar__date--selected":
|
|
1873
|
-
"pkt-calendar__date--disabled":
|
|
1874
|
-
"pkt-calendar__date--in-range": this.inRange[
|
|
1875
|
-
"pkt-calendar__date--in-range-hover": this.rangeHovered !== null &&
|
|
1876
|
-
"pkt-calendar__date--range-start":
|
|
1877
|
-
"pkt-calendar__date--range-end":
|
|
1871
|
+
"pkt-calendar__date--today": r,
|
|
1872
|
+
"pkt-calendar__date--selected": a,
|
|
1873
|
+
"pkt-calendar__date--disabled": s,
|
|
1874
|
+
"pkt-calendar__date--in-range": this.inRange[n],
|
|
1875
|
+
"pkt-calendar__date--in-range-hover": this.rangeHovered !== null && n === g(this.rangeHovered),
|
|
1876
|
+
"pkt-calendar__date--range-start": i,
|
|
1877
|
+
"pkt-calendar__date--range-end": o
|
|
1878
1878
|
};
|
|
1879
1879
|
}
|
|
1880
|
-
handleDayFocus(t,
|
|
1881
|
-
this.range && !this.isExcluded(t) && this.handleRangeHover(t), this.focusedDate =
|
|
1880
|
+
handleDayFocus(t, n) {
|
|
1881
|
+
this.range && !this.isExcluded(t) && this.handleRangeHover(t), this.focusedDate = n;
|
|
1882
1882
|
}
|
|
1883
|
-
renderDayView(t,
|
|
1884
|
-
const
|
|
1885
|
-
this.selectableDates.push({ currentDateISO:
|
|
1886
|
-
const
|
|
1887
|
-
return
|
|
1883
|
+
renderDayView(t, n) {
|
|
1884
|
+
const r = this.getDayViewData(t, n), { currentDate: a, currentDateISO: s, isSelected: i, isDisabled: o, ariaLabel: c, tabindex: h } = r;
|
|
1885
|
+
this.selectableDates.push({ currentDateISO: s, isDisabled: o, tabindex: h });
|
|
1886
|
+
const m = this.getDayCellClasses(r), p = this.getDayButtonClasses(r);
|
|
1887
|
+
return k`<td class=${rt(m)}>
|
|
1888
1888
|
<button
|
|
1889
1889
|
type="button"
|
|
1890
|
-
aria-pressed=${
|
|
1891
|
-
?disabled=${
|
|
1892
|
-
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${rt(
|
|
1893
|
-
@mouseover=${() => this.range && !this.isExcluded(
|
|
1894
|
-
@focus=${() => this.handleDayFocus(
|
|
1895
|
-
aria-label="${
|
|
1896
|
-
tabindex=${
|
|
1897
|
-
data-disabled=${
|
|
1898
|
-
data-date=${
|
|
1899
|
-
@keydown=${(
|
|
1900
|
-
(
|
|
1890
|
+
aria-pressed=${i ? "true" : "false"}
|
|
1891
|
+
?disabled=${o}
|
|
1892
|
+
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only ${rt(p)}"
|
|
1893
|
+
@mouseover=${() => this.range && !this.isExcluded(a) && this.handleRangeHover(a)}
|
|
1894
|
+
@focus=${() => this.handleDayFocus(a, s)}
|
|
1895
|
+
aria-label="${c}"
|
|
1896
|
+
tabindex=${h}
|
|
1897
|
+
data-disabled=${o ? "disabled" : at}
|
|
1898
|
+
data-date=${s}
|
|
1899
|
+
@keydown=${(w) => {
|
|
1900
|
+
(w.key === "Enter" || w.key === " ") && (w.preventDefault(), this.handleDateSelect(a));
|
|
1901
1901
|
}}
|
|
1902
|
-
@click=${(
|
|
1903
|
-
|
|
1902
|
+
@click=${(w) => {
|
|
1903
|
+
o || (w.preventDefault(), this.handleDateSelect(a));
|
|
1904
1904
|
}}
|
|
1905
1905
|
>
|
|
1906
1906
|
<span class="pkt-btn__text pkt-txt-14-light">${t}</span>
|
|
@@ -1908,7 +1908,7 @@ let l = class extends Pt {
|
|
|
1908
1908
|
</td>`;
|
|
1909
1909
|
}
|
|
1910
1910
|
renderEmptyDayCell(t) {
|
|
1911
|
-
return
|
|
1911
|
+
return k`<td class="pkt-cal-other">
|
|
1912
1912
|
<div
|
|
1913
1913
|
class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
|
|
1914
1914
|
data-disabled="disabled"
|
|
@@ -1918,29 +1918,29 @@ let l = class extends Pt {
|
|
|
1918
1918
|
</td>`;
|
|
1919
1919
|
}
|
|
1920
1920
|
renderWeekRow(t) {
|
|
1921
|
-
return
|
|
1921
|
+
return k`<tr class="pkt-cal-week-row" role="row">${t}</tr>`;
|
|
1922
1922
|
}
|
|
1923
1923
|
renderCalendarBody() {
|
|
1924
|
-
const t = this.todayDate,
|
|
1924
|
+
const t = this.todayDate, n = en(this.year, this.month);
|
|
1925
1925
|
this.selectableDates = [], this.tabIndexSet = 0;
|
|
1926
|
-
let
|
|
1927
|
-
this.week =
|
|
1928
|
-
const
|
|
1929
|
-
for (let
|
|
1930
|
-
const
|
|
1931
|
-
this.weeknumbers &&
|
|
1932
|
-
for (let
|
|
1933
|
-
const
|
|
1934
|
-
if (
|
|
1935
|
-
|
|
1926
|
+
let r = 1;
|
|
1927
|
+
this.week = n.initialWeek;
|
|
1928
|
+
const a = [];
|
|
1929
|
+
for (let s = 0; s < n.numRows; s++) {
|
|
1930
|
+
const i = [];
|
|
1931
|
+
this.weeknumbers && i.push(k`<td class="pkt-cal-week">${this.week}</td>`), this.week++;
|
|
1932
|
+
for (let o = 0; o < L; o++) {
|
|
1933
|
+
const c = nn(s, o, r, n);
|
|
1934
|
+
if (c === "current-month")
|
|
1935
|
+
i.push(this.renderDayView(r, t)), r++;
|
|
1936
1936
|
else {
|
|
1937
|
-
const
|
|
1938
|
-
|
|
1937
|
+
const h = rn(c, o, r, n);
|
|
1938
|
+
i.push(this.renderEmptyDayCell(h)), c === "next-month" && r++;
|
|
1939
1939
|
}
|
|
1940
1940
|
}
|
|
1941
|
-
|
|
1941
|
+
a.push(this.renderWeekRow(i));
|
|
1942
1942
|
}
|
|
1943
|
-
return
|
|
1943
|
+
return a;
|
|
1944
1944
|
}
|
|
1945
1945
|
/**
|
|
1946
1946
|
* Date validation
|
|
@@ -1955,18 +1955,18 @@ let l = class extends Pt {
|
|
|
1955
1955
|
return Ke(this.year, this.month, this.earliest);
|
|
1956
1956
|
}
|
|
1957
1957
|
prevMonth() {
|
|
1958
|
-
const t = this.month === 0 ? 11 : this.month - 1,
|
|
1959
|
-
this.changeMonth(
|
|
1958
|
+
const t = this.month === 0 ? 11 : this.month - 1, n = this.month === 0 ? this.year - 1 : this.year;
|
|
1959
|
+
this.changeMonth(n, t);
|
|
1960
1960
|
}
|
|
1961
1961
|
isNextMonthAllowed() {
|
|
1962
1962
|
return Ze(this.year, this.month, this.latest);
|
|
1963
1963
|
}
|
|
1964
1964
|
nextMonth() {
|
|
1965
|
-
const t = this.month === 11 ? 0 : this.month + 1,
|
|
1966
|
-
this.changeMonth(
|
|
1965
|
+
const t = this.month === 11 ? 0 : this.month + 1, n = this.month === 11 ? this.year + 1 : this.year;
|
|
1966
|
+
this.changeMonth(n, t);
|
|
1967
1967
|
}
|
|
1968
|
-
changeMonth(t,
|
|
1969
|
-
this.year = typeof t == "string" ? parseInt(t) : t, this.month = typeof
|
|
1968
|
+
changeMonth(t, n) {
|
|
1969
|
+
this.year = typeof t == "string" ? parseInt(t) : t, this.month = typeof n == "string" ? parseInt(n) : n, this.currentmonth = A(new Date(this.year, this.month, 1)), this.tabIndexSet = 0, this.focusedDate = null, this.selectableDates = [];
|
|
1970
1970
|
}
|
|
1971
1971
|
/**
|
|
1972
1972
|
* Date selection logic
|
|
@@ -2003,7 +2003,7 @@ let l = class extends Pt {
|
|
|
2003
2003
|
this.rangeHovered = t, this.inRange = gt(this._selected[0], t);
|
|
2004
2004
|
}
|
|
2005
2005
|
handleDateSelect(t) {
|
|
2006
|
-
return t && (this.range ? this.handleRangeSelect(t) : this.multiple ? this.toggleSelected(t) : (this.selected.includes(
|
|
2006
|
+
return t && (this.range ? this.handleRangeSelect(t) : this.multiple ? this.toggleSelected(t) : (this.selected.includes(g(t)) ? this.emptySelected() : (this.emptySelected(), this.addToSelected(t)), this.close()), this.dispatchEvent(
|
|
2007
2007
|
new CustomEvent("date-selected", {
|
|
2008
2008
|
detail: this.selected,
|
|
2009
2009
|
bubbles: !0,
|
|
@@ -2015,17 +2015,17 @@ let l = class extends Pt {
|
|
|
2015
2015
|
* Focus management and event handlers
|
|
2016
2016
|
*/
|
|
2017
2017
|
focusOnCurrentDate() {
|
|
2018
|
-
const t =
|
|
2019
|
-
if (
|
|
2020
|
-
this.focusedDate = t,
|
|
2018
|
+
const t = g(A(this.todayDate)), n = this.querySelector(`button[data-date="${t}"]`);
|
|
2019
|
+
if (n instanceof HTMLButtonElement) {
|
|
2020
|
+
this.focusedDate = t, n.focus();
|
|
2021
2021
|
return;
|
|
2022
2022
|
}
|
|
2023
|
-
const
|
|
2024
|
-
if (
|
|
2025
|
-
const
|
|
2026
|
-
`button[data-date="${
|
|
2023
|
+
const r = this.selectableDates.find((a) => !a.isDisabled);
|
|
2024
|
+
if (r) {
|
|
2025
|
+
const a = this.querySelector(
|
|
2026
|
+
`button[data-date="${r.currentDateISO}"]`
|
|
2027
2027
|
);
|
|
2028
|
-
|
|
2028
|
+
a instanceof HTMLButtonElement && (this.focusedDate = r.currentDateISO, a.focus());
|
|
2029
2029
|
}
|
|
2030
2030
|
}
|
|
2031
2031
|
closeEvent(t) {
|
|
@@ -2040,99 +2040,101 @@ let l = class extends Pt {
|
|
|
2040
2040
|
})
|
|
2041
2041
|
);
|
|
2042
2042
|
}
|
|
2043
|
-
}
|
|
2044
|
-
|
|
2043
|
+
}
|
|
2044
|
+
d([
|
|
2045
2045
|
f({ converter: z.csvToArray })
|
|
2046
|
-
], l.prototype, "selected"
|
|
2047
|
-
|
|
2046
|
+
], l.prototype, "selected");
|
|
2047
|
+
d([
|
|
2048
2048
|
f({ type: Boolean })
|
|
2049
|
-
], l.prototype, "multiple"
|
|
2050
|
-
|
|
2049
|
+
], l.prototype, "multiple");
|
|
2050
|
+
d([
|
|
2051
2051
|
f({ type: Number, attribute: "max-multiple" })
|
|
2052
|
-
], l.prototype, "maxMultiple"
|
|
2053
|
-
|
|
2052
|
+
], l.prototype, "maxMultiple");
|
|
2053
|
+
d([
|
|
2054
2054
|
f({ type: Boolean })
|
|
2055
|
-
], l.prototype, "range"
|
|
2056
|
-
|
|
2055
|
+
], l.prototype, "range");
|
|
2056
|
+
d([
|
|
2057
2057
|
f({ type: String })
|
|
2058
|
-
], l.prototype, "earliest"
|
|
2059
|
-
|
|
2058
|
+
], l.prototype, "earliest");
|
|
2059
|
+
d([
|
|
2060
2060
|
f({ type: String })
|
|
2061
|
-
], l.prototype, "latest"
|
|
2062
|
-
|
|
2061
|
+
], l.prototype, "latest");
|
|
2062
|
+
d([
|
|
2063
2063
|
f({ converter: z.stringsToDate })
|
|
2064
|
-
], l.prototype, "excludedates"
|
|
2065
|
-
|
|
2064
|
+
], l.prototype, "excludedates");
|
|
2065
|
+
d([
|
|
2066
2066
|
f({ converter: z.csvToArray })
|
|
2067
|
-
], l.prototype, "excludeweekdays"
|
|
2068
|
-
|
|
2067
|
+
], l.prototype, "excludeweekdays");
|
|
2068
|
+
d([
|
|
2069
2069
|
f({ type: Boolean })
|
|
2070
|
-
], l.prototype, "weeknumbers"
|
|
2071
|
-
|
|
2070
|
+
], l.prototype, "weeknumbers");
|
|
2071
|
+
d([
|
|
2072
2072
|
f({ type: Boolean })
|
|
2073
|
-
], l.prototype, "withcontrols"
|
|
2074
|
-
|
|
2073
|
+
], l.prototype, "withcontrols");
|
|
2074
|
+
d([
|
|
2075
2075
|
f({ converter: z.stringToDate })
|
|
2076
|
-
], l.prototype, "currentmonth"
|
|
2077
|
-
|
|
2076
|
+
], l.prototype, "currentmonth");
|
|
2077
|
+
d([
|
|
2078
2078
|
f({ type: String })
|
|
2079
|
-
], l.prototype, "today"
|
|
2080
|
-
|
|
2079
|
+
], l.prototype, "today");
|
|
2080
|
+
d([
|
|
2081
2081
|
f({ type: Array, attribute: "day-strings" })
|
|
2082
|
-
], l.prototype, "dayStrings"
|
|
2083
|
-
|
|
2082
|
+
], l.prototype, "dayStrings");
|
|
2083
|
+
d([
|
|
2084
2084
|
f({ type: Array, attribute: "day-strings-long" })
|
|
2085
|
-
], l.prototype, "dayStringsLong"
|
|
2086
|
-
|
|
2085
|
+
], l.prototype, "dayStringsLong");
|
|
2086
|
+
d([
|
|
2087
2087
|
f({ type: Array, attribute: "month-strings" })
|
|
2088
|
-
], l.prototype, "monthStrings"
|
|
2089
|
-
|
|
2088
|
+
], l.prototype, "monthStrings");
|
|
2089
|
+
d([
|
|
2090
2090
|
f({ type: String, attribute: "week-string" })
|
|
2091
|
-
], l.prototype, "weekString"
|
|
2092
|
-
|
|
2091
|
+
], l.prototype, "weekString");
|
|
2092
|
+
d([
|
|
2093
2093
|
f({ type: String, attribute: "prev-month-string" })
|
|
2094
|
-
], l.prototype, "prevMonthString"
|
|
2095
|
-
|
|
2094
|
+
], l.prototype, "prevMonthString");
|
|
2095
|
+
d([
|
|
2096
2096
|
f({ type: String, attribute: "next-month-string" })
|
|
2097
|
-
], l.prototype, "nextMonthString"
|
|
2098
|
-
|
|
2097
|
+
], l.prototype, "nextMonthString");
|
|
2098
|
+
d([
|
|
2099
2099
|
f({ type: Array })
|
|
2100
|
-
], l.prototype, "_selected"
|
|
2101
|
-
|
|
2100
|
+
], l.prototype, "_selected");
|
|
2101
|
+
d([
|
|
2102
2102
|
Z()
|
|
2103
|
-
], l.prototype, "inRange"
|
|
2104
|
-
|
|
2103
|
+
], l.prototype, "inRange");
|
|
2104
|
+
d([
|
|
2105
2105
|
f({ type: Date })
|
|
2106
|
-
], l.prototype, "rangeHovered"
|
|
2107
|
-
|
|
2106
|
+
], l.prototype, "rangeHovered");
|
|
2107
|
+
d([
|
|
2108
2108
|
f({ type: Number })
|
|
2109
|
-
], l.prototype, "year"
|
|
2110
|
-
|
|
2109
|
+
], l.prototype, "year");
|
|
2110
|
+
d([
|
|
2111
2111
|
f({ type: Number })
|
|
2112
|
-
], l.prototype, "month"
|
|
2113
|
-
|
|
2112
|
+
], l.prototype, "month");
|
|
2113
|
+
d([
|
|
2114
2114
|
f({ type: Number })
|
|
2115
|
-
], l.prototype, "week"
|
|
2116
|
-
|
|
2115
|
+
], l.prototype, "week");
|
|
2116
|
+
d([
|
|
2117
2117
|
Z()
|
|
2118
|
-
], l.prototype, "currentmonthtouched"
|
|
2119
|
-
|
|
2118
|
+
], l.prototype, "currentmonthtouched");
|
|
2119
|
+
d([
|
|
2120
2120
|
Z()
|
|
2121
|
-
], l.prototype, "focusedDate"
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2121
|
+
], l.prototype, "focusedDate");
|
|
2122
|
+
try {
|
|
2123
|
+
Pt("pkt-calendar")(l);
|
|
2124
|
+
} catch {
|
|
2125
|
+
console.warn("Forsøker å definere <pkt-calendar>, men den er allerede definert");
|
|
2126
|
+
}
|
|
2125
2127
|
export {
|
|
2126
2128
|
l as P,
|
|
2127
|
-
|
|
2129
|
+
pn as a,
|
|
2128
2130
|
U as b,
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
+
g as c,
|
|
2132
|
+
Dn as d,
|
|
2131
2133
|
z as e,
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
+
yn as f,
|
|
2135
|
+
bn as i,
|
|
2134
2136
|
_ as n,
|
|
2135
2137
|
O as p,
|
|
2136
|
-
|
|
2138
|
+
wn as s,
|
|
2137
2139
|
je as v
|
|
2138
2140
|
};
|