@oslokommune/punkt-elements 19.17.1 → 19.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/{accordion-B0zAUNUV.js → accordion-GheghzDV.js} +1 -1
- package/dist/{accordion-Cx-Gh3hc.cjs → accordion-XX12Iouj.cjs} +1 -1
- package/dist/{alert-BRZDpVMt.cjs → alert-SQdshv-F.cjs} +1 -1
- package/dist/{alert-JnRrtTOW.js → alert-gty76GoA.js} +3 -3
- package/dist/{backlink-CsFeerTH.cjs → backlink-CNRyH73A.cjs} +1 -1
- package/dist/{backlink-D8Rv46lA.js → backlink-HF3DMgLc.js} +1 -1
- package/dist/{breadcrumbs-D03id_ha.cjs → breadcrumbs-YQ1orAK_.cjs} +1 -1
- package/dist/{breadcrumbs-ybOBe_op.js → breadcrumbs-qyZMkJtA.js} +1 -1
- package/dist/{button-ChdHZYBF.js → button-Cf5ReNPj.js} +22 -25
- package/dist/button-DMytp-Jt.cjs +32 -0
- package/dist/{calendar-BQCjUQvP.js → calendar-D5xCL3xC.js} +1 -1
- package/dist/{calendar-CFTrX0C5.cjs → calendar-xmCeJYlb.cjs} +1 -1
- package/dist/{card-COseC8ZL.cjs → card-Dc9p91TY.cjs} +1 -1
- package/dist/{card-DSTEL8Kv.js → card-k-3UP5NP.js} +3 -3
- package/dist/{checkbox-CKYNnLDh.js → checkbox-C4faOikK.js} +1 -1
- package/dist/{checkbox-DkFswqr-.cjs → checkbox-CbogvdEA.cjs} +1 -1
- package/dist/{checkbox-group-1ghi5uHp.js → checkbox-group-6vOqwCRi.js} +2 -2
- package/dist/{checkbox-group-lcxR3cYR.cjs → checkbox-group-YyhtneCi.cjs} +1 -1
- package/dist/{combobox-iXYiaWbN.js → combobox-D0J03ikb.js} +6 -6
- package/dist/{combobox-CaWnlvTX.cjs → combobox-hbHEJIxp.cjs} +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/textarea/index.d.ts +1 -0
- package/dist/components/textarea/textarea.d.ts +17 -1
- package/dist/{consent-BwH89xk_.cjs → consent-BCrPGLXe.cjs} +1 -1
- package/dist/{consent-DiD0iQ5h.js → consent-hhwIP8m5.js} +1 -1
- package/dist/{datepicker-Da8SfyVG.cjs → datepicker-BSQV2yhB.cjs} +3 -3
- package/dist/{datepicker-DTcow1ih.js → datepicker-ChGCD7Gf.js} +134 -137
- package/dist/{element-with-slot-C0bH0T0H.js → element-with-slot-BP-IBGq0.js} +107 -108
- package/dist/element-with-slot-gdQbNteD.cjs +1 -0
- package/dist/{fileupload-Cb1c7ul0.cjs → fileupload-BKae4SiP.cjs} +1 -1
- package/dist/{fileupload-BNAQ9tNR.js → fileupload-CAZrdubx.js} +5 -5
- package/dist/{footer-BOwcLSsz.js → footer-JAQGiWJh.js} +2 -2
- package/dist/{footer-Cl_Da5Iq.cjs → footer-wmH_UXCd.cjs} +1 -1
- package/dist/{header-CvER8wo6.cjs → header-CB-CiwsK.cjs} +1 -1
- package/dist/{header-Cwr995oK.js → header-bvY1RA0W.js} +7 -7
- package/dist/{header-menu-CsL4DZE2.js → header-menu-BJNxDdhj.js} +2 -2
- package/dist/{header-menu-D-wOwG1V.cjs → header-menu-BlvU5Y1U.cjs} +1 -1
- package/dist/{heading-DhTyaJms.js → heading-Br5s4zO0.js} +1 -1
- package/dist/{heading-D4Kkb6-N.cjs → heading-CBxJ3UCj.cjs} +1 -1
- package/dist/{helptext-p0nwJsyf.cjs → helptext-5_uOsEMN.cjs} +1 -1
- package/dist/{helptext-DN0jjgVu.js → helptext-B6xxUfvv.js} +2 -2
- package/dist/{icon-CLMJYuTL.js → icon-D3XT49vM.js} +7 -1
- package/dist/icon-Dk8y6odR.cjs +1 -0
- package/dist/{input-element-BOi7rBbw.cjs → input-element-CCV_e85v.cjs} +1 -1
- package/dist/{input-element-0yYtRu0p.js → input-element-DhNSPDnG.js} +1 -1
- package/dist/{input-wrapper-BSjQc4Vx.js → input-wrapper-D-w6uRXZ.js} +4 -4
- package/dist/{input-wrapper-4PTk8aX3.cjs → input-wrapper-D1RqTzm4.cjs} +1 -1
- package/dist/{link-Dj6SbcaD.cjs → link-DW6O3Ko1.cjs} +1 -1
- package/dist/{link-39EvU2ng.js → link-DzWPIXm1.js} +2 -2
- package/dist/{linkcard-K9vvKg1u.js → linkcard-Dda2K5te.js} +2 -2
- package/dist/{linkcard-BoQIfci8.cjs → linkcard-EOwwQZeY.cjs} +1 -1
- package/dist/{loader-BRYL5kTN.cjs → loader-CnsELZFa.cjs} +1 -1
- package/dist/{loader-MoI2VRFr.js → loader-DXKGCBqh.js} +2 -2
- package/dist/{messagebox-CiOQUt0C.cjs → messagebox-CIgUgKhu.cjs} +1 -1
- package/dist/{messagebox-Dr-k3pnZ.js → messagebox-DPVRQ3PY.js} +2 -2
- package/dist/{modal-DbzEnZNF.js → modal-BWaMErv7.js} +2 -2
- package/dist/{modal-DGiq84MG.cjs → modal-Cp10a22a.cjs} +1 -1
- package/dist/{option-group-element-CH0sgVIl.cjs → option-group-element-D_UW097C.cjs} +1 -1
- package/dist/{option-group-element-DC364Rw_.js → option-group-element-d9TouZ2M.js} +2 -2
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +1 -1
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +1 -1
- package/dist/pkt-backlink.cjs +1 -1
- package/dist/pkt-backlink.js +1 -1
- package/dist/pkt-breadcrumbs.cjs +1 -1
- package/dist/pkt-breadcrumbs.js +1 -1
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +1 -1
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +1 -1
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +1 -1
- package/dist/pkt-checkbox-group.cjs +1 -1
- package/dist/pkt-checkbox-group.js +1 -1
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +1 -1
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +1 -1
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +1 -1
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +1 -1
- package/dist/pkt-fileupload.cjs +1 -1
- package/dist/pkt-fileupload.js +1 -1
- package/dist/pkt-footer.cjs +1 -1
- package/dist/pkt-footer.js +1 -1
- package/dist/pkt-header-menu.cjs +1 -1
- package/dist/pkt-header-menu.js +1 -1
- package/dist/pkt-header.cjs +1 -1
- package/dist/pkt-header.js +1 -1
- package/dist/pkt-heading.cjs +1 -1
- package/dist/pkt-heading.js +1 -1
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +36 -36
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +1 -1
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +1 -1
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +1 -1
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +1 -1
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -1
- package/dist/{pkt-options-controller-D1sKTkbR.cjs → pkt-options-controller-DcwERZzm.cjs} +1 -1
- package/dist/{pkt-options-controller-BikFfGcZ.js → pkt-options-controller-LiApNBoZ.js} +1 -1
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +1 -1
- package/dist/pkt-radio-group.cjs +1 -1
- package/dist/pkt-radio-group.js +1 -1
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +1 -1
- package/dist/pkt-searchinput.cjs +1 -1
- package/dist/pkt-searchinput.js +1 -1
- package/dist/pkt-select.cjs +1 -1
- package/dist/pkt-select.js +1 -1
- package/dist/pkt-tabs.cjs +1 -1
- package/dist/pkt-tabs.js +1 -1
- package/dist/pkt-tag.cjs +1 -1
- package/dist/pkt-tag.js +1 -1
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +1 -1
- package/dist/pkt-textinput.cjs +1 -1
- package/dist/pkt-textinput.js +1 -1
- package/dist/pkt-timepicker.cjs +1 -1
- package/dist/pkt-timepicker.js +1 -1
- package/dist/{progressbar-t0zgEke0.js → progressbar-CMwFXEMB.js} +1 -1
- package/dist/{progressbar-CnX4fFfR.cjs → progressbar-eRJU41Uc.cjs} +1 -1
- package/dist/{radio-group-DJikniZi.js → radio-group-B_NEwwP7.js} +2 -2
- package/dist/{radio-group-XCYKqoLD.cjs → radio-group-dQrEQ1pX.cjs} +1 -1
- package/dist/{radiobutton-PYQKVnNQ.js → radiobutton-DWZ4VgYg.js} +1 -1
- package/dist/{radiobutton-DgkML7sd.cjs → radiobutton-mXqSvSQE.cjs} +1 -1
- package/dist/{searchinput-Mdc9Ihld.cjs → searchinput-CVpPmZAJ.cjs} +1 -1
- package/dist/{searchinput-BzYifHBf.js → searchinput-Ca6zFqH5.js} +1 -1
- package/dist/{select-CorofYxz.js → select-DhQk3S6t.js} +4 -4
- package/dist/{select-D8TC1msV.cjs → select-DkO-UPUY.cjs} +1 -1
- package/dist/shared-types/index.d.ts +2 -0
- package/dist/shared-types/textarea.d.ts +67 -0
- package/dist/{tabs-B63J6MXb.cjs → tabs-DvVYDYVh.cjs} +1 -1
- package/dist/{tabs-DDakCTkY.js → tabs-Y2-2pD42.js} +2 -2
- package/dist/{tag-BPvGZcKf.js → tag-B9GawuIf.js} +2 -2
- package/dist/{tag-6IPe9bwQ.cjs → tag-BEFxzKsm.cjs} +1 -1
- package/dist/textarea-CEHqACey.cjs +50 -0
- package/dist/{textarea-BZCUHjEj.js → textarea-S0pRMEnT.js} +25 -13
- package/dist/{textinput-BZPGcxZV.cjs → textinput-BdQ3FZ8R.cjs} +1 -1
- package/dist/{textinput-D_oEaI41.js → textinput-DkfjnDvX.js} +4 -4
- package/dist/{timepicker-C0d92R8u.cjs → timepicker-BssDur6k.cjs} +1 -1
- package/dist/{timepicker-JBOeZg-7.js → timepicker-DI3oiK4L.js} +4 -4
- package/package.json +14 -15
- package/src/components/icon/icon.test.ts +21 -0
- package/src/components/icon/icon.ts +7 -2
- package/src/components/index.ts +1 -0
- package/src/components/textarea/index.ts +1 -0
- package/src/components/textarea/textarea.ts +34 -2
- package/dist/button-Ca_V13cQ.cjs +0 -32
- package/dist/element-with-slot-DkyaNnm0.cjs +0 -1
- package/dist/icon-jPhyZD1z.cjs +0 -1
- package/dist/textarea-BiCZBjOe.cjs +0 -50
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { _ as e, d as t, h as n, l as r, n as i, s as a, t as o, u as s } from "./element-ckeMVgMz.js";
|
|
2
2
|
import { t as c } from "./class-map-BkEYw5uE.js";
|
|
3
|
-
import { n as
|
|
4
|
-
import "./icon-
|
|
5
|
-
import "./input-wrapper-
|
|
6
|
-
import "./calendar-
|
|
7
|
-
import { t as
|
|
8
|
-
import { n as
|
|
9
|
-
import { a as
|
|
10
|
-
import "./tag-
|
|
11
|
-
import { t as
|
|
12
|
-
import { n as
|
|
13
|
-
import { t as
|
|
3
|
+
import { n as l } from "./element-with-slot-BP-IBGq0.js";
|
|
4
|
+
import "./icon-D3XT49vM.js";
|
|
5
|
+
import "./input-wrapper-D-w6uRXZ.js";
|
|
6
|
+
import "./calendar-D5xCL3xC.js";
|
|
7
|
+
import { t as u } from "./if-defined-D18nY_K_.js";
|
|
8
|
+
import { n as d, t as f } from "./ref-D4OwQYdf.js";
|
|
9
|
+
import { a as p, c as m, d as h, h as g, i as _, m as v, n as y, r as b, s as x, t as S, u as ee } from "./converters-CYgQrWVm.js";
|
|
10
|
+
import "./tag-B9GawuIf.js";
|
|
11
|
+
import { t as te } from "./repeat-BGbBqnfz.js";
|
|
12
|
+
import { n as C, t as w } from "./utils-BwF4QSrq.js";
|
|
13
|
+
import { t as T } from "./input-element-DhNSPDnG.js";
|
|
14
14
|
//#region src/components/datepicker/date-tags.ts
|
|
15
|
-
var
|
|
15
|
+
var E = class extends o {
|
|
16
16
|
constructor(...e) {
|
|
17
|
-
super(...e), this.dates = [], this.dateformat = "dd.MM.yyyy", this.className = "pkt-datepicker__tags", this.idBase =
|
|
17
|
+
super(...e), this.dates = [], this.dateformat = "dd.MM.yyyy", this.className = "pkt-datepicker__tags", this.idBase = C();
|
|
18
18
|
}
|
|
19
19
|
render() {
|
|
20
20
|
return this.classes = {
|
|
@@ -22,33 +22,33 @@ var D = class extends o {
|
|
|
22
22
|
[this.className]: !0
|
|
23
23
|
}, e`
|
|
24
24
|
<div class=${c(this.classes)} aria-live="polite">
|
|
25
|
-
${Array.isArray(this.dates) && this.dates[0] ?
|
|
25
|
+
${Array.isArray(this.dates) && this.dates[0] ? te(g((this.dates ?? []).filter(Boolean)), (e) => e, (t) => e` <pkt-tag
|
|
26
26
|
id=${this.idBase + t + "-tag"}
|
|
27
27
|
closeTag
|
|
28
28
|
@close=${() => {
|
|
29
29
|
this.dispatchEvent(new CustomEvent("date-tag-removed", { detail: t }));
|
|
30
30
|
}}
|
|
31
|
-
.ariaLabel=${`${this.pktStrings.get("datepicker").deleteDate} ${
|
|
31
|
+
.ariaLabel=${`${this.pktStrings.get("datepicker").deleteDate} ${m(t, this.dateformat)}`}
|
|
32
32
|
>
|
|
33
|
-
<time datetime=${t}>${
|
|
33
|
+
<time datetime=${t}>${m(t, this.dateformat)}</time>
|
|
34
34
|
</pkt-tag>`) : n}
|
|
35
35
|
</div>
|
|
36
36
|
`;
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
|
-
i([s({ type: Array })],
|
|
39
|
+
i([s({ type: Array })], E.prototype, "dates", void 0), i([s({ type: String })], E.prototype, "dateformat", void 0), i([s({
|
|
40
40
|
type: String,
|
|
41
41
|
attribute: "class"
|
|
42
|
-
})],
|
|
42
|
+
})], E.prototype, "className", void 0), i([s({
|
|
43
43
|
type: String,
|
|
44
44
|
attribute: "id-base"
|
|
45
|
-
})],
|
|
45
|
+
})], E.prototype, "idBase", void 0);
|
|
46
46
|
try {
|
|
47
|
-
t("pkt-date-tags")(
|
|
47
|
+
t("pkt-date-tags")(E);
|
|
48
48
|
} catch {
|
|
49
49
|
console.warn("Forsøker å definere <pkt-date-tags>, men den er allerede definert");
|
|
50
50
|
}
|
|
51
|
-
var
|
|
51
|
+
var D = {
|
|
52
52
|
name: "pkt-datepicker",
|
|
53
53
|
react: "PktDatepicker",
|
|
54
54
|
"css-class": "pkt-datepicker",
|
|
@@ -335,10 +335,10 @@ var O = {
|
|
|
335
335
|
description: "Returnerer en <code>string[]</code> med valgte datoer i ISO-format. I range-modus utløses kun når begge datoer er valgt."
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
|
-
},
|
|
338
|
+
}, O = () => {
|
|
339
339
|
let e = navigator.userAgent;
|
|
340
340
|
return !!(/iP(hone|od|ad)/.test(e) || /Macintosh/.test(e) && "ontouchend" in document);
|
|
341
|
-
},
|
|
341
|
+
}, k = () => O() ? "text" : "date", A = (e) => !e || e.length !== 2 || ee(e[0], e[1]), j = (e) => g(e), M = (e, t, n, r, i) => _(e, t, n, r, i), N = (e, t, n, r, i, a, o = "medium") => ({
|
|
342
342
|
"pkt-input": !0,
|
|
343
343
|
"pkt-datepicker__input": !0,
|
|
344
344
|
[`pkt-input--${o}`]: !0,
|
|
@@ -347,31 +347,31 @@ var O = {
|
|
|
347
347
|
"pkt-datepicker--multiple": n,
|
|
348
348
|
"pkt-datepicker--range": r,
|
|
349
349
|
"ios-readonly-hack": i === !1 && a === "text"
|
|
350
|
-
}),
|
|
350
|
+
}), P = (e = "medium") => ({
|
|
351
351
|
"pkt-input-icon": !0,
|
|
352
352
|
"pkt-btn": !0,
|
|
353
353
|
"pkt-btn--icon-only": !0,
|
|
354
354
|
"pkt-btn--tertiary": !0,
|
|
355
355
|
[`pkt-btn--${e}`]: !0,
|
|
356
356
|
"pkt-datepicker__calendar-button": !0
|
|
357
|
-
}),
|
|
357
|
+
}), F = (e) => ({
|
|
358
358
|
"pkt-input-prefix": e,
|
|
359
359
|
"pkt-hide": !e
|
|
360
|
-
}),
|
|
360
|
+
}), I = (e, t, n) => !t && !n ? Array.isArray(e) ? e[0] || "" : e : Array.isArray(e) ? e.join(",") : e, L = (e, t, n = !1) => {
|
|
361
361
|
if (!e || !t) return;
|
|
362
362
|
let r = t.parentElement?.getBoundingClientRect() || t.getBoundingClientRect(), i = n ? r.height + 30 : r.height, a = e.getBoundingClientRect().height, o = n ? "calc(100% - 30px)" : "100%";
|
|
363
363
|
r && typeof window < "u" && r.top + a > window.innerHeight && r.top - a > 0 && (o = `calc(100% - ${i}px - ${a}px)`), e.style.top = o;
|
|
364
|
-
},
|
|
364
|
+
}, R = (e, t, n, r, i, a) => {
|
|
365
365
|
let { key: o } = e;
|
|
366
366
|
o === "," && (e.preventDefault(), a ? a(e) : i && i()), (o === "Space" || o === " ") && (e.preventDefault(), t(e)), o === "Enter" && (e.preventDefault(), n ? n() : r ? r() : i && i());
|
|
367
|
-
},
|
|
367
|
+
}, z = (e, t) => {
|
|
368
368
|
let { key: n } = e;
|
|
369
369
|
(n === "Enter" || n === " " || n === "Space") && (e.preventDefault(), t(e));
|
|
370
|
-
},
|
|
371
|
-
validateRangeOrder:
|
|
372
|
-
sortDates:
|
|
373
|
-
filterSelectableDates:
|
|
374
|
-
},
|
|
370
|
+
}, B = {
|
|
371
|
+
validateRangeOrder: A,
|
|
372
|
+
sortDates: j,
|
|
373
|
+
filterSelectableDates: M
|
|
374
|
+
}, V = { getInputType: k }, H = {
|
|
375
375
|
submitForm(e) {
|
|
376
376
|
let t = e.internals?.form;
|
|
377
377
|
t && t.requestSubmit();
|
|
@@ -389,22 +389,22 @@ var O = {
|
|
|
389
389
|
};
|
|
390
390
|
n && n > o ? t.setValidity({ rangeUnderflow: !0 }, s.dateUnderflow, e) : r && r < o && t.setValidity({ rangeOverflow: !0 }, s.dateOverflow, e);
|
|
391
391
|
}
|
|
392
|
-
},
|
|
392
|
+
}, U = {
|
|
393
393
|
addToSelected(e, t, n, r) {
|
|
394
394
|
let i = e.target;
|
|
395
395
|
if (!i.value) return;
|
|
396
|
-
let a = n ?
|
|
396
|
+
let a = n ? h(n) : null, o = r ? h(r) : null, s = h(i.value.split(",")[0]);
|
|
397
397
|
s && !isNaN(s.getTime()) && (!a || s >= a) && (!o || s <= o) && t.value && t.value.handleDateSelect(s), i.value = "";
|
|
398
398
|
},
|
|
399
399
|
handleCalendarPosition(e, t, n = !1) {
|
|
400
|
-
|
|
400
|
+
L(e.value ?? null, t.value ?? null, n);
|
|
401
401
|
}
|
|
402
|
+
}, W = {
|
|
403
|
+
getInputClasses: N,
|
|
404
|
+
getButtonClasses: P,
|
|
405
|
+
getRangeLabelClasses: F
|
|
402
406
|
}, G = {
|
|
403
|
-
|
|
404
|
-
getButtonClasses: F,
|
|
405
|
-
getRangeLabelClasses: I
|
|
406
|
-
}, K = {
|
|
407
|
-
processDateSelection: L,
|
|
407
|
+
processDateSelection: I,
|
|
408
408
|
updateInputValues(e, t, n, r, i, a) {
|
|
409
409
|
e.value && (r && t?.value ? (e.value.value = n[0] ?? "", t.value.value = n[1] ?? "", a(e.value), a(t.value)) : i || (e.value.value = n.length ? n[0] : "", a(e.value)));
|
|
410
410
|
},
|
|
@@ -412,16 +412,16 @@ var O = {
|
|
|
412
412
|
let a = e.target;
|
|
413
413
|
if (a.value) {
|
|
414
414
|
i(a);
|
|
415
|
-
let e =
|
|
415
|
+
let e = x(a.value);
|
|
416
416
|
e && n?.value?.handleDateSelect(e);
|
|
417
417
|
} else t[0] && r();
|
|
418
418
|
}
|
|
419
|
-
},
|
|
420
|
-
handleInputKeydown:
|
|
421
|
-
handleButtonKeydown:
|
|
422
|
-
},
|
|
419
|
+
}, K = {
|
|
420
|
+
handleInputKeydown: R,
|
|
421
|
+
handleButtonKeydown: z
|
|
422
|
+
}, q = class extends o {
|
|
423
423
|
constructor(...e) {
|
|
424
|
-
super(...e), this.open = !1, this.multiple = !1, this.range = !1, this.weeknumbers = !1, this.withcontrols = !1, this.maxMultiple = null, this.selected = [], this.earliest = null, this.latest = null, this.excludedates = [], this.excludeweekdays = [], this.currentmonth = null, this.today = null, this._hasBeenOpened = !1, this.popupRef =
|
|
424
|
+
super(...e), this.open = !1, this.multiple = !1, this.range = !1, this.weeknumbers = !1, this.withcontrols = !1, this.maxMultiple = null, this.selected = [], this.earliest = null, this.latest = null, this.excludedates = [], this.excludeweekdays = [], this.currentmonth = null, this.today = null, this._hasBeenOpened = !1, this.popupRef = f(), this.calendarRef = f(), this.handleDocumentClick = (e) => {
|
|
425
425
|
if (!this.open) return;
|
|
426
426
|
let t = e.composedPath(), n = this.parentElement, r = this.popupRef.value;
|
|
427
427
|
!t.includes(this) && !t.includes(r) && !(n && t.includes(n)) && (this.hide(), this.dispatchEvent(new CustomEvent("close", {
|
|
@@ -461,16 +461,16 @@ var O = {
|
|
|
461
461
|
e && typeof e.focusOnCurrentDate == "function" && e.focusOnCurrentDate();
|
|
462
462
|
}
|
|
463
463
|
addToSelected(e, t, n) {
|
|
464
|
-
if (this.calendarRef.value && typeof
|
|
464
|
+
if (this.calendarRef.value && typeof U.addToSelected == "function") return U.addToSelected(e, this.calendarRef, t, n);
|
|
465
465
|
let r = e.target;
|
|
466
466
|
if (!r.value) return;
|
|
467
|
-
let i = t ?
|
|
467
|
+
let i = t ? h(t) : null, a = n ? h(n) : null, o = h(r.value.split(",")[0]);
|
|
468
468
|
o && !isNaN(o.getTime()) && (!i || o >= i) && (!a || o <= a) && this.handleDateSelect(o), r.value = "";
|
|
469
469
|
}
|
|
470
470
|
handleDateSelect(e) {
|
|
471
471
|
let t = this.calendarRef.value;
|
|
472
472
|
if (t && typeof t.handleDateSelect == "function") return t.handleDateSelect(e);
|
|
473
|
-
let n =
|
|
473
|
+
let n = p(e), r = this.selected.indexOf(n) >= 0 ? this.selected.filter((e) => e !== n) : [...this.selected, n];
|
|
474
474
|
this.selected = r, this.dispatchEvent(new CustomEvent("date-selected", {
|
|
475
475
|
detail: r,
|
|
476
476
|
bubbles: !0,
|
|
@@ -486,13 +486,13 @@ var O = {
|
|
|
486
486
|
return e`
|
|
487
487
|
<div
|
|
488
488
|
class="${c(t)}"
|
|
489
|
-
${
|
|
489
|
+
${d(this.popupRef)}
|
|
490
490
|
id="date-popup"
|
|
491
491
|
?hidden=${!this.open}
|
|
492
492
|
aria-hidden="${!this.open}"
|
|
493
493
|
>
|
|
494
494
|
${this.open || this._hasBeenOpened ? e`<pkt-calendar
|
|
495
|
-
${
|
|
495
|
+
${d(this.calendarRef)}
|
|
496
496
|
?multiple=${this.multiple}
|
|
497
497
|
?range=${this.range}
|
|
498
498
|
?weeknumbers=${this.weeknumbers}
|
|
@@ -526,17 +526,17 @@ var O = {
|
|
|
526
526
|
i([s({
|
|
527
527
|
type: Boolean,
|
|
528
528
|
reflect: !0
|
|
529
|
-
})],
|
|
529
|
+
})], q.prototype, "open", void 0), i([s({ type: Boolean })], q.prototype, "multiple", void 0), i([s({ type: Boolean })], q.prototype, "range", void 0), i([s({ type: Boolean })], q.prototype, "weeknumbers", void 0), i([s({ type: Boolean })], q.prototype, "withcontrols", void 0), i([s({ type: Number })], q.prototype, "maxMultiple", void 0), i([s({ type: Array })], q.prototype, "selected", void 0), i([s({ type: String })], q.prototype, "earliest", void 0), i([s({ type: String })], q.prototype, "latest", void 0), i([s({ type: Array })], q.prototype, "excludedates", void 0), i([s({ type: Array })], q.prototype, "excludeweekdays", void 0), i([s({ type: String })], q.prototype, "currentmonth", void 0), i([s({ type: String })], q.prototype, "today", void 0), i([r()], q.prototype, "_hasBeenOpened", void 0);
|
|
530
530
|
try {
|
|
531
|
-
t("pkt-datepicker-popup")(
|
|
531
|
+
t("pkt-datepicker-popup")(q);
|
|
532
532
|
} catch {
|
|
533
533
|
console.warn("Forsøker å definere <pkt-datepicker-popup>, men den er allerede definert");
|
|
534
534
|
}
|
|
535
535
|
//#endregion
|
|
536
536
|
//#region src/components/datepicker/datepicker-base.ts
|
|
537
|
-
var
|
|
537
|
+
var J = class extends o {
|
|
538
538
|
constructor(...e) {
|
|
539
|
-
super(...e), this.inputType = "date", this.id = "", this.readonly = !1, this.disabled = !1, this.inputClasses = {}, this.inputSize = "medium", this.hasError = !1, this.hasHelptext = !1, this.inputRef =
|
|
539
|
+
super(...e), this.inputType = "date", this.id = "", this.readonly = !1, this.disabled = !1, this.inputClasses = {}, this.inputSize = "medium", this.hasError = !1, this.hasHelptext = !1, this.inputRef = f(), this.btnRef = f();
|
|
540
540
|
}
|
|
541
541
|
get describedBy() {
|
|
542
542
|
return this.hasHelptext ? `${this.id}-input-helptext` : void 0;
|
|
@@ -590,7 +590,7 @@ var Y = class extends o {
|
|
|
590
590
|
renderCalendarButton() {
|
|
591
591
|
return e`
|
|
592
592
|
<button
|
|
593
|
-
class="${c(
|
|
593
|
+
class="${c(W.getButtonClasses(this.inputSize))}"
|
|
594
594
|
type="button"
|
|
595
595
|
@click=${(e) => this.dispatchToggleCalendar(e)}
|
|
596
596
|
@keydown=${(e) => {
|
|
@@ -609,10 +609,10 @@ var Y = class extends o {
|
|
|
609
609
|
return this;
|
|
610
610
|
}
|
|
611
611
|
};
|
|
612
|
-
i([s({ type: String })],
|
|
612
|
+
i([s({ type: String })], J.prototype, "inputType", void 0), i([s({ type: String })], J.prototype, "id", void 0), i([s({ type: String })], J.prototype, "min", void 0), i([s({ type: String })], J.prototype, "max", void 0), i([s({ type: String })], J.prototype, "placeholder", void 0), i([s({ type: Boolean })], J.prototype, "readonly", void 0), i([s({ type: Boolean })], J.prototype, "disabled", void 0), i([s({ type: Object })], J.prototype, "inputClasses", void 0), i([s({ type: String })], J.prototype, "inputSize", void 0), i([s({ type: Object })], J.prototype, "internals", void 0), i([s({ type: Boolean })], J.prototype, "hasError", void 0), i([s({ type: Boolean })], J.prototype, "hasHelptext", void 0);
|
|
613
613
|
//#endregion
|
|
614
614
|
//#region src/components/datepicker/datepicker-single.ts
|
|
615
|
-
var
|
|
615
|
+
var Y = class extends J {
|
|
616
616
|
constructor(...e) {
|
|
617
617
|
super(...e), this.value = "";
|
|
618
618
|
}
|
|
@@ -631,13 +631,13 @@ var X = class extends Y {
|
|
|
631
631
|
.type=${this.inputType}
|
|
632
632
|
id="${this.id}-input"
|
|
633
633
|
.value=${this.value}
|
|
634
|
-
min=${
|
|
635
|
-
max=${
|
|
636
|
-
placeholder=${
|
|
634
|
+
min=${u(this.min)}
|
|
635
|
+
max=${u(this.max)}
|
|
636
|
+
placeholder=${u(this.placeholder)}
|
|
637
637
|
?readonly=${this.isInputReadonly}
|
|
638
|
-
aria-describedby=${
|
|
638
|
+
aria-describedby=${u(this.describedBy)}
|
|
639
639
|
aria-invalid=${this.hasError}
|
|
640
|
-
aria-errormessage=${
|
|
640
|
+
aria-errormessage=${u(this.errorMessageId)}
|
|
641
641
|
@click=${(e) => {
|
|
642
642
|
e.preventDefault(), this.dispatchToggleCalendar(e);
|
|
643
643
|
}}
|
|
@@ -645,12 +645,12 @@ var X = class extends Y {
|
|
|
645
645
|
e.preventDefault(), this.dispatchToggleCalendar(e);
|
|
646
646
|
}}
|
|
647
647
|
?disabled=${this.disabled}
|
|
648
|
-
@keydown=${(e) =>
|
|
648
|
+
@keydown=${(e) => K.handleInputKeydown(e, (e) => this.dispatchToggleCalendar(e), () => H.submitFormOrFallback(this.internals, () => this.inputRef.value?.blur()), void 0, () => this.inputRef.value?.blur())}
|
|
649
649
|
@input=${(e) => {
|
|
650
650
|
this.dispatchInput(e), e.stopImmediatePropagation();
|
|
651
651
|
}}
|
|
652
652
|
@focus=${() => {
|
|
653
|
-
this.dispatchFocus(),
|
|
653
|
+
this.dispatchFocus(), O() && this.dispatchToggleCalendar(new Event("focus"));
|
|
654
654
|
}}
|
|
655
655
|
@blur=${(e) => {
|
|
656
656
|
this.dispatchBlur(e), this.dispatchManageValidity(e.target), this.dispatchEvent(new CustomEvent("value-change", {
|
|
@@ -662,45 +662,45 @@ var X = class extends Y {
|
|
|
662
662
|
@change=${(e) => {
|
|
663
663
|
this.dispatchChange(e), e.stopImmediatePropagation();
|
|
664
664
|
}}
|
|
665
|
-
${
|
|
665
|
+
${d(this.inputRef)}
|
|
666
666
|
/>
|
|
667
667
|
${this.renderCalendarButton()}
|
|
668
668
|
</div>
|
|
669
669
|
`;
|
|
670
670
|
}
|
|
671
671
|
};
|
|
672
|
-
i([s({ type: String })],
|
|
672
|
+
i([s({ type: String })], Y.prototype, "value", void 0);
|
|
673
673
|
try {
|
|
674
|
-
t("pkt-datepicker-single")(
|
|
674
|
+
t("pkt-datepicker-single")(Y);
|
|
675
675
|
} catch {
|
|
676
676
|
console.warn("Forsøker å definere <pkt-datepicker-single>, men den er allerede definert");
|
|
677
677
|
}
|
|
678
678
|
//#endregion
|
|
679
679
|
//#region src/components/datepicker/datepicker-range.ts
|
|
680
|
-
var
|
|
680
|
+
var X = class extends J {
|
|
681
681
|
constructor(...e) {
|
|
682
|
-
super(...e), this.value = [], this.label = "", this.showRangeLabels = !1, this.inputRefTo =
|
|
682
|
+
super(...e), this.value = [], this.label = "", this.showRangeLabels = !1, this.inputRefTo = f();
|
|
683
683
|
}
|
|
684
684
|
get inputElementTo() {
|
|
685
685
|
return this.inputRefTo.value;
|
|
686
686
|
}
|
|
687
687
|
render() {
|
|
688
|
-
let t =
|
|
688
|
+
let t = W.getRangeLabelClasses(this.showRangeLabels);
|
|
689
689
|
return e`
|
|
690
690
|
<div class="pkt-input__container">
|
|
691
691
|
${this.showRangeLabels ? e` <div class="pkt-input-prefix">${this.pktStrings.get("generic").from}</div> ` : n}
|
|
692
692
|
<input
|
|
693
|
-
aria-describedby=${
|
|
693
|
+
aria-describedby=${u(this.describedBy)}
|
|
694
694
|
aria-invalid=${this.hasError}
|
|
695
|
-
aria-errormessage=${
|
|
695
|
+
aria-errormessage=${u(this.errorMessageId)}
|
|
696
696
|
class=${c(this.inputClasses)}
|
|
697
697
|
.type=${this.inputType}
|
|
698
698
|
id="${this.id}-input"
|
|
699
699
|
aria-label="${this.label} ${this.pktStrings.get("generic").from}"
|
|
700
700
|
.value=${this.value[0] ?? ""}
|
|
701
|
-
min=${
|
|
702
|
-
max=${
|
|
703
|
-
placeholder=${
|
|
701
|
+
min=${u(this.min)}
|
|
702
|
+
max=${u(this.max)}
|
|
703
|
+
placeholder=${u(this.placeholder)}
|
|
704
704
|
?readonly=${this.isInputReadonly}
|
|
705
705
|
?disabled=${this.disabled}
|
|
706
706
|
@click=${(e) => {
|
|
@@ -709,12 +709,12 @@ var Z = class extends Y {
|
|
|
709
709
|
@touchend=${(e) => {
|
|
710
710
|
e.preventDefault(), this.dispatchToggleCalendar(e);
|
|
711
711
|
}}
|
|
712
|
-
@keydown=${(e) =>
|
|
712
|
+
@keydown=${(e) => K.handleInputKeydown(e, (e) => this.dispatchToggleCalendar(e), () => H.submitFormOrFallback(this.internals, () => this.inputRefTo.value?.focus()), () => this.inputRefTo.value?.focus(), () => this.inputRef.value?.blur())}
|
|
713
713
|
@input=${(e) => {
|
|
714
714
|
this.dispatchInput(e), e.stopImmediatePropagation();
|
|
715
715
|
}}
|
|
716
716
|
@focus=${() => {
|
|
717
|
-
this.dispatchFocus(),
|
|
717
|
+
this.dispatchFocus(), O() && this.dispatchToggleCalendar(new Event("focus"));
|
|
718
718
|
}}
|
|
719
719
|
@blur=${(e) => {
|
|
720
720
|
this.dispatchBlur(e), this.dispatchEvent(new CustomEvent("range-blur", {
|
|
@@ -730,24 +730,24 @@ var Z = class extends Y {
|
|
|
730
730
|
@change=${(e) => {
|
|
731
731
|
this.dispatchChange(e), e.stopImmediatePropagation();
|
|
732
732
|
}}
|
|
733
|
-
${
|
|
733
|
+
${d(this.inputRef)}
|
|
734
734
|
/>
|
|
735
735
|
<div class="${c(t)}" id="${this.id}-to-label">
|
|
736
736
|
${this.pktStrings.get("generic").to}
|
|
737
737
|
</div>
|
|
738
738
|
${this.showRangeLabels ? n : e` <div class="pkt-input-separator">–</div> `}
|
|
739
739
|
<input
|
|
740
|
-
aria-describedby=${
|
|
740
|
+
aria-describedby=${u(this.describedBy)}
|
|
741
741
|
aria-invalid=${this.hasError}
|
|
742
|
-
aria-errormessage=${
|
|
742
|
+
aria-errormessage=${u(this.errorMessageId)}
|
|
743
743
|
class=${c(this.inputClasses)}
|
|
744
744
|
.type=${this.inputType}
|
|
745
745
|
id="${this.id}-to"
|
|
746
746
|
aria-label="${this.label} ${this.pktStrings.get("generic").to}"
|
|
747
747
|
.value=${this.value[1] ?? ""}
|
|
748
|
-
min=${
|
|
749
|
-
max=${
|
|
750
|
-
placeholder=${
|
|
748
|
+
min=${u(this.min)}
|
|
749
|
+
max=${u(this.max)}
|
|
750
|
+
placeholder=${u(this.placeholder)}
|
|
751
751
|
?readonly=${this.isInputReadonly}
|
|
752
752
|
?disabled=${this.disabled}
|
|
753
753
|
@click=${(e) => {
|
|
@@ -756,12 +756,12 @@ var Z = class extends Y {
|
|
|
756
756
|
@touchend=${(e) => {
|
|
757
757
|
e.preventDefault(), this.dispatchToggleCalendar(e);
|
|
758
758
|
}}
|
|
759
|
-
@keydown=${(e) =>
|
|
759
|
+
@keydown=${(e) => K.handleInputKeydown(e, (e) => this.dispatchToggleCalendar(e), () => H.submitFormOrFallback(this.internals, () => this.inputRefTo.value?.blur()), void 0, () => this.inputRefTo.value?.blur())}
|
|
760
760
|
@input=${(e) => {
|
|
761
761
|
this.dispatchInput(e), e.stopImmediatePropagation();
|
|
762
762
|
}}
|
|
763
763
|
@focus=${() => {
|
|
764
|
-
this.dispatchFocus(),
|
|
764
|
+
this.dispatchFocus(), O() && this.dispatchToggleCalendar(new Event("focus"));
|
|
765
765
|
}}
|
|
766
766
|
@blur=${(e) => {
|
|
767
767
|
this.dispatchBlur(e), this.dispatchEvent(new CustomEvent("range-blur", {
|
|
@@ -777,22 +777,22 @@ var Z = class extends Y {
|
|
|
777
777
|
@change=${(e) => {
|
|
778
778
|
this.dispatchChange(e), e.stopImmediatePropagation();
|
|
779
779
|
}}
|
|
780
|
-
${
|
|
780
|
+
${d(this.inputRefTo)}
|
|
781
781
|
/>
|
|
782
782
|
${this.renderCalendarButton()}
|
|
783
783
|
</div>
|
|
784
784
|
`;
|
|
785
785
|
}
|
|
786
786
|
};
|
|
787
|
-
i([s({ type: Array })],
|
|
787
|
+
i([s({ type: Array })], X.prototype, "value", void 0), i([s({ type: String })], X.prototype, "label", void 0), i([s({ type: Boolean })], X.prototype, "showRangeLabels", void 0);
|
|
788
788
|
try {
|
|
789
|
-
t("pkt-datepicker-range")(
|
|
789
|
+
t("pkt-datepicker-range")(X);
|
|
790
790
|
} catch {
|
|
791
791
|
console.warn("Forsøker å definere <pkt-datepicker-range>, men den er allerede definert");
|
|
792
792
|
}
|
|
793
793
|
//#endregion
|
|
794
794
|
//#region src/components/datepicker/datepicker-multiple.ts
|
|
795
|
-
var
|
|
795
|
+
var Z = class extends J {
|
|
796
796
|
constructor(...e) {
|
|
797
797
|
super(...e), this.value = [];
|
|
798
798
|
}
|
|
@@ -810,15 +810,15 @@ var Q = class extends Y {
|
|
|
810
810
|
return e`
|
|
811
811
|
<div class="pkt-input__container">
|
|
812
812
|
<input
|
|
813
|
-
aria-describedby=${
|
|
813
|
+
aria-describedby=${u(this.describedBy)}
|
|
814
814
|
aria-invalid=${this.hasError}
|
|
815
|
-
aria-errormessage=${
|
|
815
|
+
aria-errormessage=${u(this.errorMessageId)}
|
|
816
816
|
class=${c(this.inputClasses)}
|
|
817
817
|
.type=${this.inputType}
|
|
818
818
|
id="${this.id}-input"
|
|
819
|
-
min=${
|
|
820
|
-
max=${
|
|
821
|
-
placeholder=${
|
|
819
|
+
min=${u(this.min)}
|
|
820
|
+
max=${u(this.max)}
|
|
821
|
+
placeholder=${u(this.placeholder)}
|
|
822
822
|
?readonly=${this.isInputReadonly}
|
|
823
823
|
?disabled=${this.isInputDisabled}
|
|
824
824
|
@click=${(e) => {
|
|
@@ -834,32 +834,32 @@ var Q = class extends Y {
|
|
|
834
834
|
this.dispatchInput(e), e.stopImmediatePropagation();
|
|
835
835
|
}}
|
|
836
836
|
@focus=${() => {
|
|
837
|
-
this.dispatchFocus(),
|
|
837
|
+
this.dispatchFocus(), O() && this.dispatchToggleCalendar(new Event("focus"));
|
|
838
838
|
}}
|
|
839
|
-
@keydown=${(e) =>
|
|
839
|
+
@keydown=${(e) => K.handleInputKeydown(e, (e) => this.dispatchToggleCalendar(e), () => H.submitFormOrFallback(this.internals, () => this.inputRef.value?.blur()), void 0, void 0, (e) => this.dispatchAddToSelected(e))}
|
|
840
840
|
@change=${(e) => {
|
|
841
841
|
this.dispatchChange(e), e.stopImmediatePropagation();
|
|
842
842
|
}}
|
|
843
|
-
${
|
|
843
|
+
${d(this.inputRef)}
|
|
844
844
|
/>
|
|
845
845
|
${this.renderCalendarButton()}
|
|
846
846
|
</div>
|
|
847
847
|
`;
|
|
848
848
|
}
|
|
849
849
|
};
|
|
850
|
-
i([s({ type: Array })],
|
|
850
|
+
i([s({ type: Array })], Z.prototype, "value", void 0), i([s({ type: Number })], Z.prototype, "maxlength", void 0);
|
|
851
851
|
try {
|
|
852
|
-
t("pkt-datepicker-multiple")(
|
|
852
|
+
t("pkt-datepicker-multiple")(Z);
|
|
853
853
|
} catch {
|
|
854
854
|
console.warn("Forsøker å definere <pkt-datepicker-multiple>, men den er allerede definert");
|
|
855
855
|
}
|
|
856
856
|
//#endregion
|
|
857
857
|
//#region src/components/datepicker/datepicker.ts
|
|
858
|
-
var $ = class t extends
|
|
858
|
+
var Q, $ = class t extends T {
|
|
859
859
|
constructor(...e) {
|
|
860
|
-
super(...e), this._valueProperty = "", this.datepickerPopupRef =
|
|
860
|
+
super(...e), this._valueProperty = "", this.datepickerPopupRef = f(), this._value = [], this.label = "Datovelger", this.dateformat = D.props.dateformat.default, this.multiple = D.props.multiple.default, this.maxlength = null, this.range = D.props.range.default, this.showRangeLabels = !1, this.min = null, this.max = null, this.weeknumbers = D.props.weeknumbers.default, this.withcontrols = D.props.withcontrols.default, this.excludedates = [], this.excludeweekdays = [], this.currentmonth = null, this.today = null, this.calendarOpen = !1, this.timezone = "Europe/Oslo", this.inputClasses = {}, this.calRef = f(), this.popupRef = f(), this.singleInputRef = f(), this.rangeInputRef = f(), this.multipleInputRef = f(), this.addToSelected = (e) => {
|
|
861
861
|
let t = this.datepickerPopupRef.value;
|
|
862
|
-
return t && typeof t.addToSelected == "function" ? t.addToSelected(e, this.min, this.max) :
|
|
862
|
+
return t && typeof t.addToSelected == "function" ? t.addToSelected(e, this.min, this.max) : U.addToSelected(e, this.calRef, this.min, this.max);
|
|
863
863
|
};
|
|
864
864
|
}
|
|
865
865
|
get value() {
|
|
@@ -870,7 +870,7 @@ var $ = class t extends E {
|
|
|
870
870
|
n !== t && (this._valueProperty = n, this.requestUpdate("value", t));
|
|
871
871
|
}
|
|
872
872
|
get inputType() {
|
|
873
|
-
return
|
|
873
|
+
return V.getInputType();
|
|
874
874
|
}
|
|
875
875
|
connectedCallback() {
|
|
876
876
|
super.connectedCallback(), this.timezone && this.timezone !== window.pktTz && (window.pktTz = this.timezone);
|
|
@@ -885,22 +885,11 @@ var $ = class t extends E {
|
|
|
885
885
|
e !== t && (this.value = e ?? "", this.deriveValue(t));
|
|
886
886
|
}
|
|
887
887
|
deriveValue(e) {
|
|
888
|
-
let t =
|
|
889
|
-
this.range && !
|
|
888
|
+
let t = b(this._valueProperty), n = this.multiple && t.length > 1 ? B.filterSelectableDates(t, this.min, this.max, this.excludedates, this.excludeweekdays) : t;
|
|
889
|
+
this.range && !B.validateRangeOrder(n) ? (this._valueProperty = "", super.valueChanged("", e), this._value = []) : (this._valueProperty = y(n), this.range && n.length === 1 || super.valueChanged(this._valueProperty, e), this._value = n);
|
|
890
890
|
}
|
|
891
891
|
attributeChangedCallback(e, t, n) {
|
|
892
|
-
e === "excludedates" && typeof this.excludedates == "string" && (this.excludedates =
|
|
893
|
-
}
|
|
894
|
-
static {
|
|
895
|
-
this.DERIVED_FROM = [
|
|
896
|
-
"value",
|
|
897
|
-
"multiple",
|
|
898
|
-
"range",
|
|
899
|
-
"min",
|
|
900
|
-
"max",
|
|
901
|
-
"excludedates",
|
|
902
|
-
"excludeweekdays"
|
|
903
|
-
];
|
|
892
|
+
e === "excludedates" && typeof this.excludedates == "string" && (this.excludedates = b(n || "")), e === "excludeweekdays" && typeof this.excludeweekdays == "string" && (this.excludeweekdays = b(n || "")), super.attributeChangedCallback(e, t, n);
|
|
904
893
|
}
|
|
905
894
|
willUpdate(e) {
|
|
906
895
|
if (super.willUpdate(e), t.DERIVED_FROM.some((t) => e.has(t))) {
|
|
@@ -959,7 +948,7 @@ var $ = class t extends E {
|
|
|
959
948
|
@input-changed=${() => {
|
|
960
949
|
this.touched = !0;
|
|
961
950
|
}}
|
|
962
|
-
${
|
|
951
|
+
${d(this.singleInputRef)}
|
|
963
952
|
></pkt-datepicker-single>
|
|
964
953
|
`;
|
|
965
954
|
}
|
|
@@ -998,23 +987,23 @@ var $ = class t extends E {
|
|
|
998
987
|
t.length > 0 && (t[0] !== this._value[0] || t[1] !== this._value[1]) && (this._value = t, this.value = t.join(","));
|
|
999
988
|
}
|
|
1000
989
|
}
|
|
1001
|
-
|
|
990
|
+
G.processRangeBlur(e.detail.event, e.detail.values, this.calRef, () => this.clearInputValue(), (e) => this.manageValidity(e));
|
|
1002
991
|
}}
|
|
1003
992
|
@manage-validity=${(e) => this.manageValidity(e.detail)}
|
|
1004
993
|
@validate-date-input=${(e) => {
|
|
1005
|
-
|
|
994
|
+
H.validateDateInput(e.detail, this.internals, this.min, this.max, this.pktStrings.get("validation"));
|
|
1006
995
|
}}
|
|
1007
996
|
@handle-date-select=${(e) => {
|
|
1008
|
-
let t =
|
|
997
|
+
let t = x(e.detail);
|
|
1009
998
|
if (t) {
|
|
1010
|
-
let e =
|
|
999
|
+
let e = p(t);
|
|
1011
1000
|
this._value[0] !== e && this._value[1] !== e && this.calRef?.value?.handleDateSelect(t);
|
|
1012
1001
|
}
|
|
1013
1002
|
}}
|
|
1014
1003
|
@input-changed=${() => {
|
|
1015
1004
|
this.touched = !0;
|
|
1016
1005
|
}}
|
|
1017
|
-
${
|
|
1006
|
+
${d(this.rangeInputRef)}
|
|
1018
1007
|
></pkt-datepicker-range>
|
|
1019
1008
|
`;
|
|
1020
1009
|
}
|
|
@@ -1046,7 +1035,7 @@ var $ = class t extends E {
|
|
|
1046
1035
|
@input-changed=${() => {
|
|
1047
1036
|
this.touched = !0;
|
|
1048
1037
|
}}
|
|
1049
|
-
${
|
|
1038
|
+
${d(this.multipleInputRef)}
|
|
1050
1039
|
></pkt-datepicker-multiple>
|
|
1051
1040
|
`;
|
|
1052
1041
|
}
|
|
@@ -1065,22 +1054,22 @@ var $ = class t extends E {
|
|
|
1065
1054
|
.latest=${this.max}
|
|
1066
1055
|
.excludedates=${Array.isArray(this.excludedates) ? this.excludedates : this.excludedates.split(",")}
|
|
1067
1056
|
.excludeweekdays=${this.excludeweekdays}
|
|
1068
|
-
.currentmonth=${this.currentmonth ?
|
|
1057
|
+
.currentmonth=${this.currentmonth ? v(this.currentmonth) : null}
|
|
1069
1058
|
.today=${this.today}
|
|
1070
1059
|
@date-selected=${(e) => {
|
|
1071
|
-
this.value =
|
|
1060
|
+
this.value = G.processDateSelection(e.detail, this.multiple, this.range), this._value = e.detail, G.updateInputValues(this.inputRef, this.inputRefTo, this._value, this.range, this.multiple, (e) => this.manageValidity(e));
|
|
1072
1061
|
}}
|
|
1073
1062
|
@close=${() => {
|
|
1074
1063
|
this.onBlur(), this.hideCalendar();
|
|
1075
1064
|
}}
|
|
1076
|
-
${
|
|
1065
|
+
${d(this.datepickerPopupRef)}
|
|
1077
1066
|
></pkt-datepicker-popup>
|
|
1078
1067
|
`;
|
|
1079
1068
|
}
|
|
1080
1069
|
render() {
|
|
1081
|
-
return this.inputClasses =
|
|
1070
|
+
return this.inputClasses = W.getInputClasses(this.fullwidth, this.showRangeLabels, this.multiple, this.range, this.readonly, this.inputType, this.inputSize), e`
|
|
1082
1071
|
<pkt-input-wrapper
|
|
1083
|
-
${
|
|
1072
|
+
${l(this, ["helptext"])}
|
|
1084
1073
|
.strings=${this.strings}
|
|
1085
1074
|
label="${this.label}"
|
|
1086
1075
|
forId="${this.id}-input"
|
|
@@ -1111,7 +1100,7 @@ var $ = class t extends E {
|
|
|
1111
1100
|
strings=${this.strings}
|
|
1112
1101
|
id-base=${this.id}
|
|
1113
1102
|
@date-tag-removed=${(e) => {
|
|
1114
|
-
let t = this.datepickerPopupRef.value, n =
|
|
1103
|
+
let t = this.datepickerPopupRef.value, n = x(e.detail);
|
|
1115
1104
|
t && n && typeof t.handleDateSelect == "function" ? t.handleDateSelect(n) : this.calRef.value?.handleDateSelect(n);
|
|
1116
1105
|
}}
|
|
1117
1106
|
></pkt-date-tags>` : n}
|
|
@@ -1124,11 +1113,11 @@ var $ = class t extends E {
|
|
|
1124
1113
|
}
|
|
1125
1114
|
handleCalendarPosition() {
|
|
1126
1115
|
let e = this.multiple && !!this.maxlength;
|
|
1127
|
-
|
|
1116
|
+
U.handleCalendarPosition(this.popupRef, this.inputRef, e);
|
|
1128
1117
|
}
|
|
1129
1118
|
async showCalendar() {
|
|
1130
1119
|
let e = this.datepickerPopupRef.value;
|
|
1131
|
-
this.calendarOpen = !0, e && typeof e.show == "function" ? (e.show(),
|
|
1120
|
+
this.calendarOpen = !0, e && typeof e.show == "function" ? (e.show(), O() && e.focusOnCurrentDate()) : (await w(20), this.handleCalendarPosition(), O() && this.calRef.value?.focusOnCurrentDate());
|
|
1132
1121
|
}
|
|
1133
1122
|
hideCalendar() {
|
|
1134
1123
|
let e = this.datepickerPopupRef.value;
|
|
@@ -1153,7 +1142,15 @@ var $ = class t extends E {
|
|
|
1153
1142
|
}));
|
|
1154
1143
|
}
|
|
1155
1144
|
};
|
|
1156
|
-
|
|
1145
|
+
Q = $, Q.DERIVED_FROM = [
|
|
1146
|
+
"value",
|
|
1147
|
+
"multiple",
|
|
1148
|
+
"range",
|
|
1149
|
+
"min",
|
|
1150
|
+
"max",
|
|
1151
|
+
"excludedates",
|
|
1152
|
+
"excludeweekdays"
|
|
1153
|
+
], i([s({
|
|
1157
1154
|
type: String,
|
|
1158
1155
|
reflect: !0
|
|
1159
1156
|
})], $.prototype, "value", null), i([r()], $.prototype, "_value", void 0), i([s({
|
|
@@ -1180,7 +1177,7 @@ i([s({
|
|
|
1180
1177
|
})], $.prototype, "max", void 0), i([s({ type: Boolean })], $.prototype, "weeknumbers", void 0), i([s({
|
|
1181
1178
|
type: Boolean,
|
|
1182
1179
|
reflect: !0
|
|
1183
|
-
})], $.prototype, "withcontrols", void 0), i([s({ converter:
|
|
1180
|
+
})], $.prototype, "withcontrols", void 0), i([s({ converter: S.csvToArray })], $.prototype, "excludedates", void 0), i([s({ converter: S.csvToArray })], $.prototype, "excludeweekdays", void 0), i([s({ type: String })], $.prototype, "currentmonth", void 0), i([s({ type: String })], $.prototype, "today", void 0), i([s({
|
|
1184
1181
|
type: Boolean,
|
|
1185
1182
|
reflect: !0,
|
|
1186
1183
|
attribute: "calendar-open"
|
|
@@ -1191,4 +1188,4 @@ try {
|
|
|
1191
1188
|
console.warn("Forsøker å definere <pkt-datepicker>, men den er allerede definert");
|
|
1192
1189
|
}
|
|
1193
1190
|
//#endregion
|
|
1194
|
-
export {
|
|
1191
|
+
export { E as a, Y as i, Z as n, X as r, $ as t };
|