@oslokommune/punkt-elements 17.1.3 → 18.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/{accordion-BeLvLPrB.js → accordion-1_pdxTgJ.js} +27 -27
- package/dist/{accordion-B3GBlvUC.cjs → accordion-DobbH-Sv.cjs} +5 -5
- package/dist/{alert-Cs4Rmq_J.cjs → alert-COeHz6o2.cjs} +6 -6
- package/dist/{alert-DKK_Tb9J.js → alert-xspFetQ8.js} +26 -26
- package/dist/{async-directive-Da7TJpnq.cjs → async-directive-B5pcIMfO.cjs} +1 -1
- package/dist/{async-directive-BPf6K-V2.js → async-directive-D2Sht790.js} +5 -5
- package/dist/{backlink-D1y26pj3.js → backlink-C0jZFnZ2.js} +8 -8
- package/dist/{backlink-CMmrKTe4.cjs → backlink-ZMhqHaVs.cjs} +3 -3
- package/dist/base-elements/element.d.ts +13 -1
- package/dist/base-elements/input-element.d.ts +4 -2
- package/dist/{breadcrumbs-B6JGhJgC.cjs → breadcrumbs-BS64xd1s.cjs} +7 -7
- package/dist/{breadcrumbs-CcTQ3Grm.js → breadcrumbs-BvMownZN.js} +16 -16
- package/dist/{button-2-OSPJkj.js → button-C44vNLFC.js} +28 -28
- package/dist/{button-CE97NQIk.cjs → button-CR4CXtnj.cjs} +7 -7
- package/dist/{calendar-kn4SrtJy.cjs → calendar-DQ4byeom.cjs} +28 -27
- package/dist/{calendar-pOW3R5Pw.js → calendar-DgjCKMMV.js} +82 -68
- package/dist/{card-zQ0eKRMV.js → card-DhHqC265.js} +44 -44
- package/dist/{card-CETDFkxR.cjs → card-Dpqi6HVt.cjs} +26 -26
- package/dist/{checkbox-CH7NpINF.js → checkbox-BQ1K57AB.js} +23 -23
- package/dist/{checkbox-CQNr_sEg.cjs → checkbox-CXQxbiaX.cjs} +11 -11
- package/dist/{class-map-BeimMvPv.cjs → class-map-CzCE5pqG.cjs} +1 -1
- package/dist/{class-map-CnWCnBSX.js → class-map-F1DJHyb7.js} +3 -3
- package/dist/{combobox-Bvg0UO9w.cjs → combobox-BV4oDiII.cjs} +19 -18
- package/dist/{combobox-CRdYYlxu.js → combobox-DPck39I2.js} +55 -54
- package/dist/components/calendar/calendar.d.ts +21 -6
- package/dist/components/checkbox/checkbox.d.ts +4 -2
- package/dist/components/combobox/combobox-base.d.ts +2 -1
- package/dist/components/consent/strings.d.ts +1 -85
- package/dist/components/datepicker/datepicker-base.d.ts +0 -3
- package/dist/components/datepicker/datepicker-multiple.d.ts +0 -2
- package/dist/components/datepicker/datepicker-range.d.ts +0 -2
- package/dist/components/datepicker/datepicker-single.d.ts +0 -2
- package/dist/components/datepicker/datepicker-utils.d.ts +2 -1
- package/dist/components/fileupload/fileupload-base.d.ts +3 -2
- package/dist/components/header/header-service.d.ts +3 -1
- package/dist/components/header/header.d.ts +2 -1
- package/dist/components/helptext/helptext.d.ts +2 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/input-wrapper/input-wrapper.d.ts +4 -2
- package/dist/components/radiobutton/radiobutton.d.ts +4 -2
- package/dist/components/searchinput/searchinput.d.ts +2 -1
- package/dist/{consent-DZEkhgJ1.js → consent-BneInZov.js} +10 -10
- package/dist/{consent-CyY3RyoC.cjs → consent-_N9foluG.cjs} +5 -5
- package/dist/controllers/strings-controller.d.ts +27 -0
- package/dist/{datepicker-VTqSDQk5.cjs → datepicker-9NX5qt2z.cjs} +38 -37
- package/dist/{datepicker-ButIas85.js → datepicker-nSSSr1U7.js} +104 -104
- package/dist/{directive-helpers-CI8YZqku.js → directive-helpers-BARw3nEZ.js} +1 -1
- package/dist/{directive-helpers-BlAV5EQD.cjs → directive-helpers-D6AAMFKs.cjs} +1 -1
- package/dist/docs/components/fileupload.d.ts +1 -0
- package/dist/element-B8OGznK0.cjs +2 -0
- package/dist/{element-ChsFgr_B.js → element-BKSPVgs2.js} +240 -100
- package/dist/{element-with-slot-Bj7nm7fO.cjs → element-with-slot-DTxILHVv.cjs} +1 -1
- package/dist/{element-with-slot-BvG9ctC-.js → element-with-slot-YUAUFRqw.js} +4 -4
- package/dist/fileupload-D05VSbEP.cjs +402 -0
- package/dist/{fileupload-D5IQ9HDe.js → fileupload-E0LGGNgj.js} +370 -380
- package/dist/{footer-DbYQUYNR.cjs → footer-DBApIdGh.cjs} +32 -32
- package/dist/{footer-DrR64HiK.js → footer-DYilVBMC.js} +91 -91
- package/dist/format-B8meU8Tm.cjs +1 -0
- package/dist/format-BTeSVkED.js +18 -0
- package/dist/{header-ClgIac6n.cjs → header-B7tbX-Ok.cjs} +84 -84
- package/dist/{header-menu-BAsUNKSx.cjs → header-menu-1FFWhvNc.cjs} +24 -24
- package/dist/{header-menu-hVPXsb8g.js → header-menu-D522-VTV.js} +75 -75
- package/dist/{header-KvJ1mGwA.js → header-v3GWAzOK.js} +267 -264
- package/dist/{heading-CFmiSuCQ.cjs → heading-CvytvcL7.cjs} +1 -1
- package/dist/{heading-g-_IUB5T.js → heading-rx_oSCqe.js} +16 -16
- package/dist/helptext-DYFdcylX.cjs +27 -0
- package/dist/{helptext-DZng1D5i.js → helptext-LShGPm-b.js} +18 -19
- package/dist/{icon-9iwd2F2l.cjs → icon-BmMC09mi.cjs} +1 -1
- package/dist/{icon-D-LA22xD.js → icon-HYU1f54x.js} +17 -17
- package/dist/{if-defined-CGzIlZ9-.js → if-defined-BF8XcDi5.js} +1 -1
- package/dist/if-defined-CVYApOgK.cjs +1 -0
- package/dist/{input-element-DBMNBplu.js → input-element-D07DmR34.js} +121 -120
- package/dist/input-element-DumGj_oJ.cjs +1 -0
- package/dist/input-wrapper-Cci_wTvD.js +308 -0
- package/dist/input-wrapper-DDfapoRX.cjs +58 -0
- package/dist/{link-DK7gvmnj.cjs → link-11g2ZNin.cjs} +4 -4
- package/dist/{link-D-Eqm5KH.js → link-CQK0SH4H.js} +13 -13
- package/dist/{linkcard-zqbg7Oqm.js → linkcard-B4GlmjJ6.js} +16 -16
- package/dist/linkcard-DNYsVlV6.cjs +13 -0
- package/dist/{listbox-Dc4rGdPi.cjs → listbox-BlFRhyI7.cjs} +15 -15
- package/dist/{listbox-va_E8afs.js → listbox-wd_OofyF.js} +100 -99
- package/dist/{loader-D_RDICnw.js → loader-0C3qVk16.js} +14 -14
- package/dist/{loader-CMUkVJmE.cjs → loader-B9u2qUlR.cjs} +5 -5
- package/dist/{messagebox-Cv8LaSxv.cjs → messagebox-BD5tGmT-.cjs} +5 -5
- package/dist/{messagebox-Cw-OWDya.js → messagebox-C-y1ICmr.js} +15 -15
- package/dist/{modal-BtInv031.cjs → modal-BzPGQYCs.cjs} +8 -8
- package/dist/{modal-D0t_X2dX.js → modal-Cghs3w-d.js} +20 -20
- 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.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 +35 -34
- 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-listbox.cjs +1 -1
- package/dist/pkt-listbox.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-C5EBX2T0.cjs → pkt-options-controller-CEEAqXaB.cjs} +1 -1
- package/dist/{pkt-options-controller-B77vH3PE.js → pkt-options-controller-PtjhmTGk.js} +1 -1
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.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-CbcfLerF.js → progressbar-BexQQw1o.js} +21 -21
- package/dist/{progressbar-D5MmnQId.cjs → progressbar-X9mSvpjw.cjs} +5 -5
- package/dist/{radiobutton-BUnf3EPi.js → radiobutton-CkhTasn4.js} +24 -24
- package/dist/{radiobutton-DpsO1F-8.cjs → radiobutton-ln29Ad3U.cjs} +8 -8
- package/dist/{ref-CQoEIIp0.cjs → ref-CHbJYtKE.cjs} +1 -1
- package/dist/{ref-CWD6PjVd.js → ref-Chc_DZAb.js} +2 -2
- package/dist/{repeat-sY6B7fAT.cjs → repeat-CHDs__rN.cjs} +1 -1
- package/dist/{repeat-C02g7d5S.js → repeat-P9SMlKd5.js} +4 -4
- package/dist/searchinput-CPgMEAZZ.cjs +60 -0
- package/dist/{searchinput-DwnjsvJ1.js → searchinput-Da7dKHBH.js} +43 -43
- package/dist/{select-BOJi6H6T.cjs → select-DCuvdAuK.cjs} +4 -3
- package/dist/{select-DMre80qs.js → select-jabMSjft.js} +21 -20
- package/dist/shared-strings/consent.d.ts +71 -0
- package/dist/shared-strings/format.d.ts +21 -0
- package/dist/shared-strings/index.d.ts +14 -0
- package/dist/shared-strings/nb.d.ts +118 -0
- package/dist/shared-strings/resolve.d.ts +12 -0
- package/dist/shared-strings/store.d.ts +27 -0
- package/dist/shared-strings/types.d.ts +29 -0
- package/dist/shared-types/fileupload.d.ts +0 -27
- package/dist/shared-types/index.d.ts +1 -2
- package/dist/shared-utils/combobox/index.d.ts +1 -0
- package/dist/shared-utils/combobox/input-utils.d.ts +2 -1
- package/dist/shared-utils/combobox/messages.d.ts +7 -0
- package/dist/shared-utils/combobox/option-utils.d.ts +2 -1
- package/dist/shared-utils/combobox/selection-manager.d.ts +3 -2
- package/dist/{tabs-Cf9ai0FD.cjs → tabs-DV5CQNDL.cjs} +7 -7
- package/dist/{tabs-TvxgbrCF.js → tabs-D_hoi1zu.js} +32 -32
- package/dist/tag-BxYulmZn.cjs +27 -0
- package/dist/{tag-Ds6n1LIs.js → tag-DK5SgKry.js} +33 -32
- package/dist/tests/strings-override.test.d.ts +0 -0
- package/dist/{textarea-vfzIcXhX.js → textarea-BR7Riace.js} +30 -29
- package/dist/{textarea-BydiLM9Z.cjs → textarea-ffBD_VHq.cjs} +3 -2
- package/dist/{textinput-CMP2jPP_.js → textinput-CRNrsRNV.js} +28 -27
- package/dist/{textinput-DGdicNSx.cjs → textinput-CtHFzAux.cjs} +13 -12
- package/dist/timepicker-AfgJipo6.cjs +196 -0
- package/dist/{timepicker-ClwgYywH.js → timepicker-ixs_E5RY.js} +67 -64
- package/package.json +3 -3
- package/src/components/backlink/backlink.ts +1 -1
- package/src/components/breadcrumbs/breadcrumbs.ts +1 -1
- package/src/components/calendar/calendar.ts +56 -26
- package/src/components/checkbox/checkbox.test.ts +0 -2
- package/src/components/checkbox/checkbox.ts +8 -4
- package/src/components/combobox/combobox-base.ts +2 -1
- package/src/components/combobox/combobox-value.ts +10 -9
- package/src/components/combobox/combobox.selection.test.ts +5 -1
- package/src/components/combobox/combobox.ts +4 -1
- package/src/components/consent/strings.ts +1 -125
- package/src/components/datepicker/date-tags.ts +4 -1
- package/src/components/datepicker/datepicker-base.ts +2 -6
- package/src/components/datepicker/datepicker-multiple.ts +0 -3
- package/src/components/datepicker/datepicker-range.ts +4 -7
- package/src/components/datepicker/datepicker-single.ts +0 -3
- package/src/components/datepicker/datepicker-utils.test.ts +5 -5
- package/src/components/datepicker/datepicker-utils.ts +6 -11
- package/src/components/datepicker/datepicker.ts +8 -1
- package/src/components/fileupload/fileupload-base.ts +25 -16
- package/src/components/fileupload/fileupload-renderers.ts +2 -1
- package/src/components/fileupload/fileupload.test.ts +16 -0
- package/src/components/fileupload/fileupload.ts +19 -15
- package/src/components/header/header-global.ts +3 -3
- package/src/components/header/header-service.ts +13 -8
- package/src/components/header/header.ts +2 -1
- package/src/components/helptext/helptext.test.ts +1 -1
- package/src/components/helptext/helptext.ts +3 -3
- package/src/components/index.ts +9 -0
- package/src/components/input-wrapper/input-wrapper.ts +18 -10
- package/src/components/listbox/listbox.ts +3 -3
- package/src/components/radiobutton/radiobutton.ts +8 -4
- package/src/components/searchinput/searchinput.ts +5 -3
- package/src/components/select/select.ts +1 -0
- package/src/components/tag/tag.ts +2 -1
- package/src/components/textarea/textarea.ts +1 -0
- package/src/components/textinput/textinput.ts +1 -0
- package/src/components/timepicker/timepicker.ts +23 -21
- package/dist/element-BA8v6S7z.cjs +0 -2
- package/dist/fileupload-BeWiTAoW.cjs +0 -401
- package/dist/helptext-CTtKJcML.cjs +0 -27
- package/dist/if-defined-B89_ZeCj.cjs +0 -1
- package/dist/input-element-DYmQw-fH.cjs +0 -1
- package/dist/input-wrapper-BmxNvznr.js +0 -128
- package/dist/input-wrapper-D-fPaTbY.js +0 -176
- package/dist/input-wrapper-D5PR0rJn.cjs +0 -1
- package/dist/input-wrapper-Q-B-aBeb.cjs +0 -54
- package/dist/linkcard-B29cmZqh.cjs +0 -13
- package/dist/searchinput-Bh975rjX.cjs +0 -60
- package/dist/tag-CzojNU7z.cjs +0 -27
- package/dist/timepicker-DYrnLHqN.cjs +0 -195
- package/dist/translations/no.json.d.ts +0 -94
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { n as e,
|
|
2
|
-
import { t as
|
|
1
|
+
import { n as e, u as t } from "./element-BKSPVgs2.js";
|
|
2
|
+
import { t as n } from "./format-BTeSVkED.js";
|
|
3
|
+
import { t as r } from "./element-with-slot-YUAUFRqw.js";
|
|
3
4
|
import { n as i } from "./utils-BwF4QSrq.js";
|
|
4
5
|
import { n as a, t as o } from "./booleanish-OQJTYSrw.js";
|
|
5
|
-
import { t as s } from "./input-wrapper-D-fPaTbY.js";
|
|
6
6
|
//#region ../../node_modules/element-internals-polyfill/dist/maps.js
|
|
7
|
-
var
|
|
7
|
+
var s = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), d = /* @__PURE__ */ new WeakMap(), ee = /* @__PURE__ */ new WeakMap(), f = /* @__PURE__ */ new WeakMap(), p = /* @__PURE__ */ new WeakMap(), m = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap(), _ = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), b = /* @__PURE__ */ new WeakMap(), x = (e, t, n) => {
|
|
8
8
|
e.getAttribute(t) !== n && e.setAttribute(t, n);
|
|
9
|
-
},
|
|
10
|
-
e.toggleAttribute("internals-disabled", t), t ?
|
|
11
|
-
},
|
|
12
|
-
|
|
9
|
+
}, S = (e, t) => {
|
|
10
|
+
e.toggleAttribute("internals-disabled", t), t ? x(e, "aria-disabled", "true") : e.removeAttribute("aria-disabled"), e.formDisabledCallback && e.formDisabledCallback.apply(e, [t]);
|
|
11
|
+
}, C = (e) => {
|
|
12
|
+
l.get(e).forEach((e) => {
|
|
13
13
|
e.remove();
|
|
14
|
-
}),
|
|
15
|
-
},
|
|
14
|
+
}), l.set(e, []);
|
|
15
|
+
}, w = (e, t) => {
|
|
16
16
|
let n = document.createElement("input");
|
|
17
|
-
return n.type = "hidden", n.name = e.getAttribute("name"), e.after(n),
|
|
18
|
-
},
|
|
17
|
+
return n.type = "hidden", n.name = e.getAttribute("name"), e.after(n), l.get(t).push(n), n;
|
|
18
|
+
}, T = (e, t) => {
|
|
19
19
|
if (t.length) {
|
|
20
20
|
let n = Array.from(t);
|
|
21
21
|
n.forEach((t) => t.addEventListener("click", e.click.bind(e)));
|
|
22
22
|
let [r] = n, i = r.id;
|
|
23
|
-
r.id ||= (i = `${r.htmlFor}_Label`, i),
|
|
23
|
+
r.id ||= (i = `${r.htmlFor}_Label`, i), x(e, "aria-labelledby", i);
|
|
24
24
|
}
|
|
25
|
-
},
|
|
26
|
-
let t = Array.from(e.elements).filter((e) => !e.tagName.includes("-") && e.validity).map((e) => e.validity.valid), n =
|
|
25
|
+
}, E = (e) => {
|
|
26
|
+
let t = Array.from(e.elements).filter((e) => !e.tagName.includes("-") && e.validity).map((e) => e.validity.valid), n = p.get(e) || [], r = Array.from(n).filter((e) => e.isConnected).map((e) => u.get(e).validity.valid), i = [...t, ...r].includes(!1);
|
|
27
27
|
e.toggleAttribute("internals-invalid", i), e.toggleAttribute("internals-valid", !i);
|
|
28
28
|
}, te = (e) => {
|
|
29
|
-
|
|
29
|
+
E(O(e.target));
|
|
30
30
|
}, ne = (e) => {
|
|
31
|
-
|
|
31
|
+
E(O(e.target));
|
|
32
32
|
}, re = (e) => {
|
|
33
33
|
let t = [
|
|
34
34
|
"button[type=submit]",
|
|
@@ -37,57 +37,57 @@ var c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), u = /*
|
|
|
37
37
|
].map((e) => `${e}:not([disabled])`).map((t) => `${t}:not([form])${e.id ? `,${t}[form='${e.id}']` : ""}`).join(",");
|
|
38
38
|
e.addEventListener("click", (n) => {
|
|
39
39
|
if (n.target.closest(t)) {
|
|
40
|
-
let t =
|
|
40
|
+
let t = p.get(e);
|
|
41
41
|
if (e.noValidate) return;
|
|
42
|
-
t.size && Array.from(t).reverse().map((e) =>
|
|
42
|
+
t.size && Array.from(t).reverse().map((e) => u.get(e).reportValidity()).includes(!1) && n.preventDefault();
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
}, ie = (e) => {
|
|
46
|
-
let t =
|
|
46
|
+
let t = p.get(e.target);
|
|
47
47
|
t && t.size && t.forEach((e) => {
|
|
48
48
|
e.constructor.formAssociated && e.formResetCallback && e.formResetCallback.apply(e);
|
|
49
49
|
});
|
|
50
|
-
},
|
|
50
|
+
}, D = (e, t, n) => {
|
|
51
51
|
if (t) {
|
|
52
|
-
let r =
|
|
52
|
+
let r = p.get(t);
|
|
53
53
|
if (r) r.add(e);
|
|
54
54
|
else {
|
|
55
55
|
let n = /* @__PURE__ */ new Set();
|
|
56
|
-
n.add(e),
|
|
56
|
+
n.add(e), p.set(t, n), re(t), t.addEventListener("reset", ie), t.addEventListener("input", te), t.addEventListener("change", ne);
|
|
57
57
|
}
|
|
58
58
|
ee.set(t, {
|
|
59
59
|
ref: e,
|
|
60
60
|
internals: n
|
|
61
61
|
}), e.constructor.formAssociated && e.formAssociatedCallback && setTimeout(() => {
|
|
62
62
|
e.formAssociatedCallback.apply(e, [t]);
|
|
63
|
-
}, 0),
|
|
63
|
+
}, 0), E(t);
|
|
64
64
|
}
|
|
65
|
-
},
|
|
65
|
+
}, O = (e) => {
|
|
66
66
|
let t = e.parentNode;
|
|
67
|
-
return t && t.tagName !== "FORM" && (t =
|
|
68
|
-
},
|
|
67
|
+
return t && t.tagName !== "FORM" && (t = O(t)), t;
|
|
68
|
+
}, k = (e, t, n = DOMException) => {
|
|
69
69
|
if (!e.constructor.formAssociated) throw new n(t);
|
|
70
|
-
},
|
|
71
|
-
let r =
|
|
70
|
+
}, A = (e, t, n) => {
|
|
71
|
+
let r = p.get(e);
|
|
72
72
|
return r && r.size && r.forEach((e) => {
|
|
73
|
-
|
|
73
|
+
u.get(e)[n]() || (t = !1);
|
|
74
74
|
}), t;
|
|
75
|
-
},
|
|
75
|
+
}, j = (e) => {
|
|
76
76
|
let t = !1;
|
|
77
77
|
if (e.constructor.formAssociated) {
|
|
78
|
-
let n =
|
|
79
|
-
n === void 0 && (e.attachInternals(), n =
|
|
78
|
+
let n = u.get(e);
|
|
79
|
+
n === void 0 && (e.attachInternals(), n = u.get(e), t = !0);
|
|
80
80
|
let { labels: r, form: i } = n;
|
|
81
|
-
|
|
81
|
+
T(e, r), D(e, i, n);
|
|
82
82
|
}
|
|
83
83
|
return t;
|
|
84
84
|
};
|
|
85
|
-
function
|
|
85
|
+
function M() {
|
|
86
86
|
return typeof MutationObserver < "u";
|
|
87
87
|
}
|
|
88
88
|
//#endregion
|
|
89
89
|
//#region ../../node_modules/element-internals-polyfill/dist/aom.js
|
|
90
|
-
var
|
|
90
|
+
var N = {
|
|
91
91
|
ariaAtomic: "aria-atomic",
|
|
92
92
|
ariaAutoComplete: "aria-autocomplete",
|
|
93
93
|
ariaBrailleLabel: "aria-braillelabel",
|
|
@@ -133,66 +133,66 @@ var P = {
|
|
|
133
133
|
ariaValueText: "aria-valuetext",
|
|
134
134
|
role: "role"
|
|
135
135
|
}, ae = (e, t) => {
|
|
136
|
-
for (let n in
|
|
136
|
+
for (let n in N) {
|
|
137
137
|
t[n] = null;
|
|
138
|
-
let r = null, i =
|
|
138
|
+
let r = null, i = N[n];
|
|
139
139
|
Object.defineProperty(t, n, {
|
|
140
140
|
get() {
|
|
141
141
|
return r;
|
|
142
142
|
},
|
|
143
143
|
set(n) {
|
|
144
|
-
r = n, e.isConnected ?
|
|
144
|
+
r = n, e.isConnected ? x(e, i, n) : h.set(e, t);
|
|
145
145
|
}
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
}, oe = (e, t) => {
|
|
149
|
-
|
|
149
|
+
l.set(t, []), L.observe?.(e, I);
|
|
150
150
|
};
|
|
151
|
-
function
|
|
152
|
-
let t =
|
|
153
|
-
|
|
151
|
+
function P(e) {
|
|
152
|
+
let t = u.get(e), { form: n } = t;
|
|
153
|
+
D(e, n, t), T(e, t.labels);
|
|
154
154
|
}
|
|
155
|
-
var
|
|
155
|
+
var F = (e, t = !1) => {
|
|
156
156
|
let n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode(e) {
|
|
157
|
-
return
|
|
157
|
+
return u.has(e) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
158
158
|
} }), r = n.nextNode(), i = !t || e.disabled;
|
|
159
|
-
for (; r;) r.formDisabledCallback && i &&
|
|
160
|
-
},
|
|
159
|
+
for (; r;) r.formDisabledCallback && i && S(r, e.disabled), r = n.nextNode();
|
|
160
|
+
}, I = {
|
|
161
161
|
attributes: !0,
|
|
162
162
|
attributeFilter: ["disabled", "name"]
|
|
163
|
-
},
|
|
163
|
+
}, L = M() ? new MutationObserver((e) => {
|
|
164
164
|
for (let t of e) {
|
|
165
165
|
let e = t.target;
|
|
166
|
-
if (t.attributeName === "disabled" && (e.constructor.formAssociated ?
|
|
167
|
-
let t =
|
|
166
|
+
if (t.attributeName === "disabled" && (e.constructor.formAssociated ? S(e, e.hasAttribute("disabled")) : e.localName === "fieldset" && F(e)), t.attributeName === "name" && e.constructor.formAssociated) {
|
|
167
|
+
let t = u.get(e), n = m.get(e);
|
|
168
168
|
t.setFormValue(n);
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
}) : {};
|
|
172
|
-
function
|
|
172
|
+
function R(e) {
|
|
173
173
|
e.forEach((e) => {
|
|
174
174
|
let { addedNodes: t, removedNodes: n } = e, r = Array.from(t), i = Array.from(n);
|
|
175
175
|
r.forEach((e) => {
|
|
176
|
-
if (
|
|
177
|
-
let t =
|
|
178
|
-
Object.keys(
|
|
179
|
-
|
|
180
|
-
}),
|
|
176
|
+
if (u.has(e) && e.constructor.formAssociated && P(e), h.has(e)) {
|
|
177
|
+
let t = h.get(e);
|
|
178
|
+
Object.keys(N).filter((e) => t[e] !== null).forEach((n) => {
|
|
179
|
+
x(e, N[n], t[n]);
|
|
180
|
+
}), h.delete(e);
|
|
181
181
|
}
|
|
182
|
-
if (
|
|
183
|
-
let t =
|
|
184
|
-
|
|
182
|
+
if (b.has(e)) {
|
|
183
|
+
let t = b.get(e);
|
|
184
|
+
x(e, "internals-valid", t.validity.valid.toString()), x(e, "internals-invalid", (!t.validity.valid).toString()), x(e, "aria-invalid", (!t.validity.valid).toString()), b.delete(e);
|
|
185
185
|
}
|
|
186
186
|
if (e.localName === "form") {
|
|
187
|
-
let t =
|
|
188
|
-
return
|
|
187
|
+
let t = p.get(e), n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode(e) {
|
|
188
|
+
return u.has(e) && e.constructor.formAssociated && !(t && t.has(e)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
189
189
|
} }), r = n.nextNode();
|
|
190
|
-
for (; r;)
|
|
190
|
+
for (; r;) P(r), r = n.nextNode();
|
|
191
191
|
}
|
|
192
|
-
e.localName === "fieldset" && (
|
|
192
|
+
e.localName === "fieldset" && (L.observe?.(e, I), F(e, !0));
|
|
193
193
|
}), i.forEach((e) => {
|
|
194
|
-
let t =
|
|
195
|
-
t &&
|
|
194
|
+
let t = u.get(e);
|
|
195
|
+
t && l.get(t) && C(t), f.has(e) && f.get(e).disconnect();
|
|
196
196
|
});
|
|
197
197
|
});
|
|
198
198
|
}
|
|
@@ -200,24 +200,24 @@ function se(e) {
|
|
|
200
200
|
e.forEach((e) => {
|
|
201
201
|
let { removedNodes: t } = e;
|
|
202
202
|
t.forEach((t) => {
|
|
203
|
-
let n =
|
|
204
|
-
|
|
203
|
+
let n = v.get(e.target);
|
|
204
|
+
u.has(t) && j(t), n.disconnect();
|
|
205
205
|
});
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
208
|
var ce = (e) => {
|
|
209
209
|
let t = new MutationObserver(se);
|
|
210
|
-
window?.ShadyDOM?.inUse && e.mode && e.host && (e = e.host), t.observe?.(e, { childList: !0 }),
|
|
210
|
+
window?.ShadyDOM?.inUse && e.mode && e.host && (e = e.host), t.observe?.(e, { childList: !0 }), v.set(e, t);
|
|
211
211
|
};
|
|
212
|
-
|
|
213
|
-
var
|
|
212
|
+
M() && new MutationObserver(R);
|
|
213
|
+
var z = {
|
|
214
214
|
childList: !0,
|
|
215
215
|
subtree: !0
|
|
216
216
|
}, le = class {
|
|
217
217
|
constructor() {
|
|
218
218
|
this.badInput = !1, this.customError = !1, this.patternMismatch = !1, this.rangeOverflow = !1, this.rangeUnderflow = !1, this.stepMismatch = !1, this.tooLong = !1, this.tooShort = !1, this.typeMismatch = !1, this.valid = !0, this.valueMissing = !1, Object.seal(this);
|
|
219
219
|
}
|
|
220
|
-
}, ue = (e) => (e.badInput = !1, e.customError = !1, e.patternMismatch = !1, e.rangeOverflow = !1, e.rangeUnderflow = !1, e.stepMismatch = !1, e.tooLong = !1, e.tooShort = !1, e.typeMismatch = !1, e.valid = !0, e.valueMissing = !1, e),
|
|
220
|
+
}, ue = (e) => (e.badInput = !1, e.customError = !1, e.patternMismatch = !1, e.rangeOverflow = !1, e.rangeUnderflow = !1, e.stepMismatch = !1, e.tooLong = !1, e.tooShort = !1, e.typeMismatch = !1, e.valid = !0, e.valueMissing = !1, e), B = (e, t, n) => (e.valid = de(t), Object.keys(t).forEach((n) => e[n] = t[n]), n && E(n), e), de = (e) => {
|
|
221
221
|
let t = !0;
|
|
222
222
|
for (let n in e) n !== "valid" && e[n] !== !1 && (t = !1);
|
|
223
223
|
return t;
|
|
@@ -250,7 +250,7 @@ var U = class extends Set {
|
|
|
250
250
|
n.toggleAttribute(`state${e}`, !1), n.part && n.part.remove(`state${e}`);
|
|
251
251
|
}), t;
|
|
252
252
|
}
|
|
253
|
-
},
|
|
253
|
+
}, fe = function(e, t, n, r, i) {
|
|
254
254
|
if (r === "m") throw TypeError("Private method is not writable");
|
|
255
255
|
if (r === "a" && !i) throw TypeError("Private accessor was defined without a setter");
|
|
256
256
|
if (typeof t == "function" ? e !== t || !i : !t.has(e)) throw TypeError("Cannot write private member to an object whose class did not declare it");
|
|
@@ -259,9 +259,9 @@ var U = class extends Set {
|
|
|
259
259
|
if (n === "a" && !r) throw TypeError("Private accessor was defined without a getter");
|
|
260
260
|
if (typeof t == "function" ? e !== t || !r : !t.has(e)) throw TypeError("Cannot read private member from an object whose class did not declare it");
|
|
261
261
|
return n === "m" ? r : n === "a" ? r.call(e) : r ? r.value : t.get(e);
|
|
262
|
-
}, G,
|
|
262
|
+
}, G, pe = class {
|
|
263
263
|
constructor(e) {
|
|
264
|
-
G.set(this, void 0),
|
|
264
|
+
G.set(this, void 0), fe(this, G, e, "f");
|
|
265
265
|
for (let t = 0; t < e.length; t++) {
|
|
266
266
|
let n = e[t];
|
|
267
267
|
this[t] = n, n.hasAttribute("name") && (this[n.getAttribute("name")] = n);
|
|
@@ -283,23 +283,23 @@ var U = class extends Set {
|
|
|
283
283
|
};
|
|
284
284
|
//#endregion
|
|
285
285
|
//#region ../../node_modules/element-internals-polyfill/dist/patch-form-prototype.js
|
|
286
|
-
function
|
|
286
|
+
function me() {
|
|
287
287
|
let e = HTMLFormElement.prototype.checkValidity;
|
|
288
288
|
HTMLFormElement.prototype.checkValidity = n;
|
|
289
289
|
let t = HTMLFormElement.prototype.reportValidity;
|
|
290
290
|
HTMLFormElement.prototype.reportValidity = r;
|
|
291
291
|
function n(...t) {
|
|
292
292
|
let n = e.apply(this, t);
|
|
293
|
-
return
|
|
293
|
+
return A(this, n, "checkValidity");
|
|
294
294
|
}
|
|
295
295
|
function r(...e) {
|
|
296
296
|
let n = t.apply(this, e);
|
|
297
|
-
return
|
|
297
|
+
return A(this, n, "reportValidity");
|
|
298
298
|
}
|
|
299
299
|
let { get: i } = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, "elements");
|
|
300
300
|
Object.defineProperty(HTMLFormElement.prototype, "elements", { get(...e) {
|
|
301
|
-
let t = i.call(this, ...e), n = Array.from(
|
|
302
|
-
return n.length === 0 ? t : new
|
|
301
|
+
let t = i.call(this, ...e), n = Array.from(p.get(this) || []);
|
|
302
|
+
return n.length === 0 ? t : new pe(Array.from(t).concat(n).sort((e, t) => e.compareDocumentPosition ? e.compareDocumentPosition(t) & 2 ? 1 : -1 : 0));
|
|
303
303
|
} });
|
|
304
304
|
}
|
|
305
305
|
//#endregion
|
|
@@ -311,12 +311,12 @@ var K = class {
|
|
|
311
311
|
constructor(e) {
|
|
312
312
|
if (!e || !e.tagName || e.tagName.indexOf("-") === -1) throw TypeError("Illegal constructor");
|
|
313
313
|
let t = e.getRootNode(), n = new le();
|
|
314
|
-
this.states = new U(e),
|
|
314
|
+
this.states = new U(e), s.set(this, e), c.set(this, n), u.set(e, this), ae(e, this), oe(e, this), Object.seal(this), t instanceof DocumentFragment && ce(t);
|
|
315
315
|
}
|
|
316
316
|
checkValidity() {
|
|
317
|
-
let e =
|
|
318
|
-
if (
|
|
319
|
-
let t =
|
|
317
|
+
let e = s.get(this);
|
|
318
|
+
if (k(e, "Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate) return !0;
|
|
319
|
+
let t = c.get(this);
|
|
320
320
|
if (!t.valid) {
|
|
321
321
|
let t = new Event("invalid", {
|
|
322
322
|
bubbles: !1,
|
|
@@ -328,44 +328,44 @@ var K = class {
|
|
|
328
328
|
return t.valid;
|
|
329
329
|
}
|
|
330
330
|
get form() {
|
|
331
|
-
let e =
|
|
332
|
-
|
|
331
|
+
let e = s.get(this);
|
|
332
|
+
k(e, "Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");
|
|
333
333
|
let t;
|
|
334
|
-
return e.constructor.formAssociated === !0 && (t =
|
|
334
|
+
return e.constructor.formAssociated === !0 && (t = O(e)), t;
|
|
335
335
|
}
|
|
336
336
|
get labels() {
|
|
337
|
-
let e =
|
|
338
|
-
|
|
337
|
+
let e = s.get(this);
|
|
338
|
+
k(e, "Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");
|
|
339
339
|
let t = e.getAttribute("id"), n = e.getRootNode();
|
|
340
340
|
return n && t ? n.querySelectorAll(`[for="${t}"]`) : [];
|
|
341
341
|
}
|
|
342
342
|
reportValidity() {
|
|
343
|
-
let e =
|
|
344
|
-
if (
|
|
345
|
-
let t = this.checkValidity(), n =
|
|
343
|
+
let e = s.get(this);
|
|
344
|
+
if (k(e, "Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate) return !0;
|
|
345
|
+
let t = this.checkValidity(), n = _.get(this);
|
|
346
346
|
if (n && !e.constructor.formAssociated) throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");
|
|
347
347
|
return !t && n && (e.focus(), n.focus()), t;
|
|
348
348
|
}
|
|
349
349
|
setFormValue(e) {
|
|
350
|
-
let t =
|
|
351
|
-
if (
|
|
350
|
+
let t = s.get(this);
|
|
351
|
+
if (k(t, "Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."), C(this), e != null && !(e instanceof FormData)) {
|
|
352
352
|
if (t.getAttribute("name")) {
|
|
353
|
-
let n =
|
|
353
|
+
let n = w(t, this);
|
|
354
354
|
n.value = e;
|
|
355
355
|
}
|
|
356
356
|
} else e != null && e instanceof FormData && Array.from(e).reverse().forEach(([e, n]) => {
|
|
357
357
|
if (typeof n == "string") {
|
|
358
|
-
let r =
|
|
358
|
+
let r = w(t, this);
|
|
359
359
|
r.name = e, r.value = n;
|
|
360
360
|
}
|
|
361
361
|
});
|
|
362
|
-
|
|
362
|
+
m.set(t, e);
|
|
363
363
|
}
|
|
364
364
|
setValidity(e, t, n) {
|
|
365
|
-
let r =
|
|
366
|
-
if (
|
|
367
|
-
|
|
368
|
-
let i =
|
|
365
|
+
let r = s.get(this);
|
|
366
|
+
if (k(r, "Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !e) throw TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");
|
|
367
|
+
_.set(this, n);
|
|
368
|
+
let i = c.get(this), a = {};
|
|
369
369
|
for (let t in e) a[t] = e[t];
|
|
370
370
|
Object.keys(a).length === 0 && ue(i);
|
|
371
371
|
let o = {
|
|
@@ -373,26 +373,26 @@ var K = class {
|
|
|
373
373
|
...a
|
|
374
374
|
};
|
|
375
375
|
delete o.valid;
|
|
376
|
-
let { valid:
|
|
377
|
-
if (!
|
|
378
|
-
|
|
376
|
+
let { valid: l } = B(i, o, this.form);
|
|
377
|
+
if (!l && !t) throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");
|
|
378
|
+
d.set(this, l ? "" : t), r.isConnected ? (r.toggleAttribute("internals-invalid", !l), r.toggleAttribute("internals-valid", l), x(r, "aria-invalid", `${!l}`)) : b.set(r, this);
|
|
379
379
|
}
|
|
380
380
|
get shadowRoot() {
|
|
381
|
-
let e =
|
|
382
|
-
return
|
|
381
|
+
let e = s.get(this);
|
|
382
|
+
return g.get(e) || null;
|
|
383
383
|
}
|
|
384
384
|
get validationMessage() {
|
|
385
|
-
return
|
|
385
|
+
return k(s.get(this), "Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."), d.get(this);
|
|
386
386
|
}
|
|
387
387
|
get validity() {
|
|
388
|
-
return
|
|
388
|
+
return k(s.get(this), "Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."), c.get(this);
|
|
389
389
|
}
|
|
390
390
|
get willValidate() {
|
|
391
|
-
let e =
|
|
392
|
-
return
|
|
391
|
+
let e = s.get(this);
|
|
392
|
+
return k(e, "Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."), !(e.matches(":disabled") || e.disabled || e.hasAttribute("disabled") || e.hasAttribute("readonly"));
|
|
393
393
|
}
|
|
394
394
|
};
|
|
395
|
-
function
|
|
395
|
+
function he() {
|
|
396
396
|
if (typeof window > "u" || !window.ElementInternals || !HTMLElement.prototype.attachInternals) return !1;
|
|
397
397
|
class e extends HTMLElement {
|
|
398
398
|
constructor() {
|
|
@@ -422,7 +422,7 @@ function Y(e) {
|
|
|
422
422
|
return n.states = new U(this), n;
|
|
423
423
|
}));
|
|
424
424
|
}
|
|
425
|
-
function
|
|
425
|
+
function ge(e = !0) {
|
|
426
426
|
let t = !1;
|
|
427
427
|
if (!q) {
|
|
428
428
|
if (q = !0, typeof window < "u" && (window.ElementInternals = K), typeof CustomElementRegistry < "u") {
|
|
@@ -431,7 +431,7 @@ function _e(e = !0) {
|
|
|
431
431
|
if (r.formAssociated) {
|
|
432
432
|
let e = r.prototype.connectedCallback;
|
|
433
433
|
r.prototype.connectedCallback = function() {
|
|
434
|
-
|
|
434
|
+
y.has(this) || (y.set(this, !0), this.hasAttribute("disabled") && S(this, !0)), e?.apply(this), t = j(this);
|
|
435
435
|
};
|
|
436
436
|
}
|
|
437
437
|
e.call(this, n, r, i);
|
|
@@ -440,26 +440,26 @@ function _e(e = !0) {
|
|
|
440
440
|
if (typeof HTMLElement < "u" && (HTMLElement.prototype.attachInternals = function() {
|
|
441
441
|
if (!this.tagName) return {};
|
|
442
442
|
if (this.tagName.indexOf("-") === -1) throw Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.");
|
|
443
|
-
if (
|
|
443
|
+
if (u.has(this) && !t) throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");
|
|
444
444
|
return new K(this);
|
|
445
445
|
}), typeof Element < "u") {
|
|
446
446
|
function e(...e) {
|
|
447
447
|
let n = t.apply(this, e);
|
|
448
|
-
if (
|
|
449
|
-
let e = new MutationObserver(
|
|
450
|
-
window.ShadyDOM ? e.observe(this,
|
|
448
|
+
if (g.set(this, n), M()) {
|
|
449
|
+
let e = new MutationObserver(R);
|
|
450
|
+
window.ShadyDOM ? e.observe(this, z) : e.observe(n, z), f.set(this, e);
|
|
451
451
|
}
|
|
452
452
|
return n;
|
|
453
453
|
}
|
|
454
454
|
let t = Element.prototype.attachShadow;
|
|
455
455
|
Element.prototype.attachShadow = e;
|
|
456
456
|
}
|
|
457
|
-
|
|
457
|
+
M() && typeof document < "u" && new MutationObserver(R).observe(document.documentElement, z), typeof HTMLFormElement < "u" && me(), (e || typeof window < "u" && !window.CustomStateSet) && Y();
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
460
|
//#endregion
|
|
461
461
|
//#region ../../node_modules/element-internals-polyfill/dist/index.js
|
|
462
|
-
customElements.polyfillWrapFlushCallback || (
|
|
462
|
+
customElements.polyfillWrapFlushCallback || (he() ? typeof window < "u" && !window.CustomStateSet && Y(HTMLElement.prototype.attachInternals) : ge(!1));
|
|
463
463
|
//#endregion
|
|
464
464
|
//#region src/base-elements/input-element.ts
|
|
465
465
|
var X = "on", Z = "--checked", Q = ",", $ = class extends r {
|
|
@@ -479,14 +479,15 @@ var X = "on", Z = "--checked", Q = ",", $ = class extends r {
|
|
|
479
479
|
return this.hasFieldset ?? e;
|
|
480
480
|
}
|
|
481
481
|
constructor() {
|
|
482
|
-
super(), this.defaultValue = null, this.disabled = !1, this.readonly = !1, this.required = !1, this.max = null, this.maxlength = null, this.min = null, this.minlength = null, this.step = null, this.ariaDescribedby = null, this.ariaLabelledby = null, this.name = "", this.pattern = null, this.placeholder = null, this.id = i(), this.counter = null, this.hasError = !1, this.inline = !1, this.hasFieldset = null, this.optionalTag = !1, this.requiredTag = !1, this.skipForwardTestid = !1, this.useWrapper = !0, this.fullwidth = !1, this.counterMaxLength = 0, this.errorMessage = "", this.helptext = "", this.helptextDropdown = "", this.helptextDropdownButton =
|
|
482
|
+
super(), this.defaultValue = null, this.disabled = !1, this.readonly = !1, this.required = !1, this.max = null, this.maxlength = null, this.min = null, this.minlength = null, this.step = null, this.ariaDescribedby = null, this.ariaLabelledby = null, this.name = "", this.pattern = null, this.placeholder = null, this.id = i(), this.counter = null, this.hasError = !1, this.inline = !1, this.hasFieldset = null, this.optionalTag = !1, this.requiredTag = !1, this.skipForwardTestid = !1, this.useWrapper = !0, this.fullwidth = !1, this.counterMaxLength = 0, this.errorMessage = "", this.helptext = "", this.helptextDropdown = "", this.helptextDropdownButton = null, this.label = null, this.tagText = null, this.inputSize = "medium", this.dataTestid = "", this.touched = !1, this._initialized = !1, this.internals = this.attachInternals();
|
|
483
483
|
}
|
|
484
484
|
manageValidity(e) {
|
|
485
485
|
if (!e) {
|
|
486
486
|
console.warn("manageValidity called without valid input element");
|
|
487
487
|
return;
|
|
488
488
|
}
|
|
489
|
-
|
|
489
|
+
let t = this.pktStrings.get("validation");
|
|
490
|
+
this.required && !this.value ? this.internals.setValidity({ valueMissing: !0 }, t.valueMissing, e) : e.validity?.typeMismatch || e.validity?.badInput ? this.internals.setValidity({ typeMismatch: !0 }, t.typeMismatch, e) : e.validity?.patternMismatch ? this.internals.setValidity({ patternMismatch: !0 }, t.patternMismatch, e) : e.validity?.tooShort || this.minlength && this.minlength > 0 && this.value.length < this.minlength ? this.internals.setValidity({ tooShort: !0 }, t.tooShort, e) : e.validity?.tooLong || this.maxlength && this.maxlength > 0 && this.value.length > this.maxlength ? this.internals.setValidity({ tooLong: !0 }, t.tooLong, e) : e.validity?.rangeUnderflow ? this.internals.setValidity({ rangeUnderflow: !0 }, this.min ? n(t.rangeUnderflowMin, { min: this.min.toString() }) : t.rangeUnderflow, e) : e.validity?.stepMismatch ? this.internals.setValidity({ stepMismatch: !0 }, t.typeMismatch, e) : e.validity?.rangeOverflow ? this.internals.setValidity({ rangeOverflow: !0 }, this.max ? n(t.rangeOverflowMax, { max: this.max.toString() }) : t.rangeOverflow, e) : e.validity?.customError ? this.internals.setValidity({ customError: !0 }, e.validationMessage, e) : this.internals.setValidity({});
|
|
490
491
|
}
|
|
491
492
|
setFormValue(e) {
|
|
492
493
|
if (this.internals) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./element-B8OGznK0.cjs"),t=require("./format-B8meU8Tm.cjs"),n=require("./element-with-slot-DTxILHVv.cjs"),r=require("./utils-63cRpWut.cjs"),i=require("./booleanish-BF8l4scU.cjs");var a=new WeakMap,o=new WeakMap,s=new WeakMap,c=new WeakMap,l=new WeakMap,u=new WeakMap,d=new WeakMap,f=new WeakMap,p=new WeakMap,m=new WeakMap,h=new WeakMap,g=new WeakMap,_=new WeakMap,v=new WeakMap,y=new WeakMap,b=(e,t,n)=>{e.getAttribute(t)!==n&&e.setAttribute(t,n)},x=(e,t)=>{e.toggleAttribute(`internals-disabled`,t),t?b(e,`aria-disabled`,`true`):e.removeAttribute(`aria-disabled`),e.formDisabledCallback&&e.formDisabledCallback.apply(e,[t])},S=e=>{s.get(e).forEach(e=>{e.remove()}),s.set(e,[])},C=(e,t)=>{let n=document.createElement(`input`);return n.type=`hidden`,n.name=e.getAttribute(`name`),e.after(n),s.get(t).push(n),n},w=(e,t)=>{if(t.length){let n=Array.from(t);n.forEach(t=>t.addEventListener(`click`,e.click.bind(e)));let[r]=n,i=r.id;r.id||=(i=`${r.htmlFor}_Label`,i),b(e,`aria-labelledby`,i)}},T=e=>{let t=Array.from(e.elements).filter(e=>!e.tagName.includes(`-`)&&e.validity).map(e=>e.validity.valid),n=f.get(e)||[],r=Array.from(n).filter(e=>e.isConnected).map(e=>c.get(e).validity.valid),i=[...t,...r].includes(!1);e.toggleAttribute(`internals-invalid`,i),e.toggleAttribute(`internals-valid`,!i)},ee=e=>{T(O(e.target))},E=e=>{T(O(e.target))},te=e=>{let t=[`button[type=submit]`,`input[type=submit]`,`button:not([type])`].map(e=>`${e}:not([disabled])`).map(t=>`${t}:not([form])${e.id?`,${t}[form='${e.id}']`:``}`).join(`,`);e.addEventListener(`click`,n=>{if(n.target.closest(t)){let t=f.get(e);if(e.noValidate)return;t.size&&Array.from(t).reverse().map(e=>c.get(e).reportValidity()).includes(!1)&&n.preventDefault()}})},ne=e=>{let t=f.get(e.target);t&&t.size&&t.forEach(e=>{e.constructor.formAssociated&&e.formResetCallback&&e.formResetCallback.apply(e)})},D=(e,t,n)=>{if(t){let r=f.get(t);if(r)r.add(e);else{let n=new Set;n.add(e),f.set(t,n),te(t),t.addEventListener(`reset`,ne),t.addEventListener(`input`,ee),t.addEventListener(`change`,E)}u.set(t,{ref:e,internals:n}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout(()=>{e.formAssociatedCallback.apply(e,[t])},0),T(t)}},O=e=>{let t=e.parentNode;return t&&t.tagName!==`FORM`&&(t=O(t)),t},k=(e,t,n=DOMException)=>{if(!e.constructor.formAssociated)throw new n(t)},A=(e,t,n)=>{let r=f.get(e);return r&&r.size&&r.forEach(e=>{c.get(e)[n]()||(t=!1)}),t},j=e=>{let t=!1;if(e.constructor.formAssociated){let n=c.get(e);n===void 0&&(e.attachInternals(),n=c.get(e),t=!0);let{labels:r,form:i}=n;w(e,r),D(e,i,n)}return t};function M(){return typeof MutationObserver<`u`}var N={ariaAtomic:`aria-atomic`,ariaAutoComplete:`aria-autocomplete`,ariaBrailleLabel:`aria-braillelabel`,ariaBrailleRoleDescription:`aria-brailleroledescription`,ariaBusy:`aria-busy`,ariaChecked:`aria-checked`,ariaColCount:`aria-colcount`,ariaColIndex:`aria-colindex`,ariaColIndexText:`aria-colindextext`,ariaColSpan:`aria-colspan`,ariaCurrent:`aria-current`,ariaDescription:`aria-description`,ariaDisabled:`aria-disabled`,ariaExpanded:`aria-expanded`,ariaHasPopup:`aria-haspopup`,ariaHidden:`aria-hidden`,ariaInvalid:`aria-invalid`,ariaKeyShortcuts:`aria-keyshortcuts`,ariaLabel:`aria-label`,ariaLevel:`aria-level`,ariaLive:`aria-live`,ariaModal:`aria-modal`,ariaMultiLine:`aria-multiline`,ariaMultiSelectable:`aria-multiselectable`,ariaOrientation:`aria-orientation`,ariaPlaceholder:`aria-placeholder`,ariaPosInSet:`aria-posinset`,ariaPressed:`aria-pressed`,ariaReadOnly:`aria-readonly`,ariaRelevant:`aria-relevant`,ariaRequired:`aria-required`,ariaRoleDescription:`aria-roledescription`,ariaRowCount:`aria-rowcount`,ariaRowIndex:`aria-rowindex`,ariaRowIndexText:`aria-rowindextext`,ariaRowSpan:`aria-rowspan`,ariaSelected:`aria-selected`,ariaSetSize:`aria-setsize`,ariaSort:`aria-sort`,ariaValueMax:`aria-valuemax`,ariaValueMin:`aria-valuemin`,ariaValueNow:`aria-valuenow`,ariaValueText:`aria-valuetext`,role:`role`},P=(e,t)=>{for(let n in N){t[n]=null;let r=null,i=N[n];Object.defineProperty(t,n,{get(){return r},set(n){r=n,e.isConnected?b(e,i,n):m.set(e,t)}})}},re=(e,t)=>{s.set(t,[]),R.observe?.(e,L)};function F(e){let t=c.get(e),{form:n}=t;D(e,n,t),w(e,t.labels)}var I=(e,t=!1)=>{let n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return c.has(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),r=n.nextNode(),i=!t||e.disabled;for(;r;)r.formDisabledCallback&&i&&x(r,e.disabled),r=n.nextNode()},L={attributes:!0,attributeFilter:[`disabled`,`name`]},R=M()?new MutationObserver(e=>{for(let t of e){let e=t.target;if(t.attributeName===`disabled`&&(e.constructor.formAssociated?x(e,e.hasAttribute(`disabled`)):e.localName===`fieldset`&&I(e)),t.attributeName===`name`&&e.constructor.formAssociated){let t=c.get(e),n=p.get(e);t.setFormValue(n)}}}):{};function z(e){e.forEach(e=>{let{addedNodes:t,removedNodes:n}=e,r=Array.from(t),i=Array.from(n);r.forEach(e=>{if(c.has(e)&&e.constructor.formAssociated&&F(e),m.has(e)){let t=m.get(e);Object.keys(N).filter(e=>t[e]!==null).forEach(n=>{b(e,N[n],t[n])}),m.delete(e)}if(y.has(e)){let t=y.get(e);b(e,`internals-valid`,t.validity.valid.toString()),b(e,`internals-invalid`,(!t.validity.valid).toString()),b(e,`aria-invalid`,(!t.validity.valid).toString()),y.delete(e)}if(e.localName===`form`){let t=f.get(e),n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return c.has(e)&&e.constructor.formAssociated&&!(t&&t.has(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),r=n.nextNode();for(;r;)F(r),r=n.nextNode()}e.localName===`fieldset`&&(R.observe?.(e,L),I(e,!0))}),i.forEach(e=>{let t=c.get(e);t&&s.get(t)&&S(t),d.has(e)&&d.get(e).disconnect()})})}function ie(e){e.forEach(e=>{let{removedNodes:t}=e;t.forEach(t=>{let n=_.get(e.target);c.has(t)&&j(t),n.disconnect()})})}var ae=e=>{let t=new MutationObserver(ie);window?.ShadyDOM?.inUse&&e.mode&&e.host&&(e=e.host),t.observe?.(e,{childList:!0}),_.set(e,t)};M()&&new MutationObserver(z);var B={childList:!0,subtree:!0},oe=class{constructor(){this.badInput=!1,this.customError=!1,this.patternMismatch=!1,this.rangeOverflow=!1,this.rangeUnderflow=!1,this.stepMismatch=!1,this.tooLong=!1,this.tooShort=!1,this.typeMismatch=!1,this.valid=!0,this.valueMissing=!1,Object.seal(this)}},se=e=>(e.badInput=!1,e.customError=!1,e.patternMismatch=!1,e.rangeOverflow=!1,e.rangeUnderflow=!1,e.stepMismatch=!1,e.tooLong=!1,e.tooShort=!1,e.typeMismatch=!1,e.valid=!0,e.valueMissing=!1,e),ce=(e,t,n)=>(e.valid=le(t),Object.keys(t).forEach(n=>e[n]=t[n]),n&&T(n),e),le=e=>{let t=!0;for(let n in e)n!==`valid`&&e[n]!==!1&&(t=!1);return t},V=new WeakMap;function H(e,t){e.toggleAttribute(t,!0),e.part&&e.part.add(t)}var U=class extends Set{static get isPolyfilled(){return!0}constructor(e){if(super(),!e||!e.tagName||e.tagName.indexOf(`-`)===-1)throw TypeError(`Illegal constructor`);V.set(this,e)}add(e){if(!/^--/.test(e)||typeof e!=`string`)throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${e} must start with '--'.`);let t=super.add(e),n=V.get(this),r=`state${e}`;return n.isConnected?H(n,r):setTimeout(()=>{H(n,r)}),t}clear(){for(let[e]of this.entries())this.delete(e);super.clear()}delete(e){let t=super.delete(e),n=V.get(this);return n.isConnected?(n.toggleAttribute(`state${e}`,!1),n.part&&n.part.remove(`state${e}`)):setTimeout(()=>{n.toggleAttribute(`state${e}`,!1),n.part&&n.part.remove(`state${e}`)}),t}},ue=function(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n},W=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},G,de=class{constructor(e){G.set(this,void 0),ue(this,G,e,`f`);for(let t=0;t<e.length;t++){let n=e[t];this[t]=n,n.hasAttribute(`name`)&&(this[n.getAttribute(`name`)]=n)}Object.freeze(this)}get length(){return W(this,G,`f`).length}[(G=new WeakMap,Symbol.iterator)](){return W(this,G,`f`)[Symbol.iterator]()}item(e){return this[e]==null?null:this[e]}namedItem(e){return this[e]==null?null:this[e]}};function fe(){let e=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=n;let t=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=r;function n(...t){let n=e.apply(this,t);return A(this,n,`checkValidity`)}function r(...e){let n=t.apply(this,e);return A(this,n,`reportValidity`)}let{get:i}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,`elements`);Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...e){let t=i.call(this,...e),n=Array.from(f.get(this)||[]);return n.length===0?t:new de(Array.from(t).concat(n).sort((e,t)=>e.compareDocumentPosition?e.compareDocumentPosition(t)&2?1:-1:0))}})}var K=class{static get isPolyfilled(){return!0}constructor(e){if(!e||!e.tagName||e.tagName.indexOf(`-`)===-1)throw TypeError(`Illegal constructor`);let t=e.getRootNode(),n=new oe;this.states=new U(e),a.set(this,e),o.set(this,n),c.set(e,this),P(e,this),re(e,this),Object.seal(this),t instanceof DocumentFragment&&ae(t)}checkValidity(){let e=a.get(this);if(k(e,`Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element.`),!this.willValidate)return!0;let t=o.get(this);if(!t.valid){let t=new Event(`invalid`,{bubbles:!1,cancelable:!0,composed:!1});e.dispatchEvent(t)}return t.valid}get form(){let e=a.get(this);k(e,`Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.`);let t;return e.constructor.formAssociated===!0&&(t=O(e)),t}get labels(){let e=a.get(this);k(e,`Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.`);let t=e.getAttribute(`id`),n=e.getRootNode();return n&&t?n.querySelectorAll(`[for="${t}"]`):[]}reportValidity(){let e=a.get(this);if(k(e,`Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.`),!this.willValidate)return!0;let t=this.checkValidity(),n=g.get(this);if(n&&!e.constructor.formAssociated)throw new DOMException(`Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.`);return!t&&n&&(e.focus(),n.focus()),t}setFormValue(e){let t=a.get(this);if(k(t,`Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element.`),S(this),e!=null&&!(e instanceof FormData)){if(t.getAttribute(`name`)){let n=C(t,this);n.value=e}}else e!=null&&e instanceof FormData&&Array.from(e).reverse().forEach(([e,n])=>{if(typeof n==`string`){let r=C(t,this);r.name=e,r.value=n}});p.set(t,e)}setValidity(e,t,n){let r=a.get(this);if(k(r,`Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element.`),!e)throw TypeError(`Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.`);g.set(this,n);let i=o.get(this),s={};for(let t in e)s[t]=e[t];Object.keys(s).length===0&&se(i);let c={...i,...s};delete c.valid;let{valid:u}=ce(i,c,this.form);if(!u&&!t)throw new DOMException(`Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.`);l.set(this,u?``:t),r.isConnected?(r.toggleAttribute(`internals-invalid`,!u),r.toggleAttribute(`internals-valid`,u),b(r,`aria-invalid`,`${!u}`)):y.set(r,this)}get shadowRoot(){let e=a.get(this);return h.get(e)||null}get validationMessage(){return k(a.get(this),`Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element.`),l.get(this)}get validity(){return k(a.get(this),`Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element.`),o.get(this)}get willValidate(){let e=a.get(this);return k(e,`Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element.`),!(e.matches(`:disabled`)||e.disabled||e.hasAttribute(`disabled`)||e.hasAttribute(`readonly`))}};function pe(){if(typeof window>`u`||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class e extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}let t=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,``)}`;customElements.define(t,e);let n=new e;return[`shadowRoot`,`form`,`willValidate`,`validity`,`validationMessage`,`labels`,`setFormValue`,`setValidity`,`checkValidity`,`reportValidity`].every(e=>e in n.internals)}var q=!1,J=!1;function Y(e){J||(J=!0,window.CustomStateSet=U,e&&(HTMLElement.prototype.attachInternals=function(...t){let n=e.call(this,t);return n.states=new U(this),n}))}function me(e=!0){let t=!1;if(!q){if(q=!0,typeof window<`u`&&(window.ElementInternals=K),typeof CustomElementRegistry<`u`){let e=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(n,r,i){if(r.formAssociated){let e=r.prototype.connectedCallback;r.prototype.connectedCallback=function(){v.has(this)||(v.set(this,!0),this.hasAttribute(`disabled`)&&x(this,!0)),e?.apply(this),t=j(this)}}e.call(this,n,r,i)}}if(typeof HTMLElement<`u`&&(HTMLElement.prototype.attachInternals=function(){if(!this.tagName)return{};if(this.tagName.indexOf(`-`)===-1)throw Error(`Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.`);if(c.has(this)&&!t)throw new DOMException(`DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.`);return new K(this)}),typeof Element<`u`){function n(...t){let n=e.apply(this,t);if(h.set(this,n),M()){let e=new MutationObserver(z);window.ShadyDOM?e.observe(this,B):e.observe(n,B),d.set(this,e)}return n}let e=Element.prototype.attachShadow;Element.prototype.attachShadow=n}M()&&typeof document<`u`&&new MutationObserver(z).observe(document.documentElement,B),typeof HTMLFormElement<`u`&&fe(),(e||typeof window<`u`&&!window.CustomStateSet)&&Y()}}customElements.polyfillWrapFlushCallback||(pe()?typeof window<`u`&&!window.CustomStateSet&&Y(HTMLElement.prototype.attachInternals):me(!1));var X=`on`,Z=`--checked`,Q=`,`,$=class extends n.t{static get formAssociated(){return!0}get ariaDescribedBy(){return this.ariaDescribedby}set ariaDescribedBy(e){this.ariaDescribedby=e}effectiveCounter(e){return this.counter??e}effectiveHasFieldset(e){return this.hasFieldset??e}constructor(){super(),this.defaultValue=null,this.disabled=!1,this.readonly=!1,this.required=!1,this.max=null,this.maxlength=null,this.min=null,this.minlength=null,this.step=null,this.ariaDescribedby=null,this.ariaLabelledby=null,this.name=``,this.pattern=null,this.placeholder=null,this.id=r.n(),this.counter=null,this.hasError=!1,this.inline=!1,this.hasFieldset=null,this.optionalTag=!1,this.requiredTag=!1,this.skipForwardTestid=!1,this.useWrapper=!0,this.fullwidth=!1,this.counterMaxLength=0,this.errorMessage=``,this.helptext=``,this.helptextDropdown=``,this.helptextDropdownButton=null,this.label=null,this.tagText=null,this.inputSize=`medium`,this.dataTestid=``,this.touched=!1,this._initialized=!1,this.internals=this.attachInternals()}manageValidity(e){if(!e){console.warn(`manageValidity called without valid input element`);return}let n=this.pktStrings.get(`validation`);this.required&&!this.value?this.internals.setValidity({valueMissing:!0},n.valueMissing,e):e.validity?.typeMismatch||e.validity?.badInput?this.internals.setValidity({typeMismatch:!0},n.typeMismatch,e):e.validity?.patternMismatch?this.internals.setValidity({patternMismatch:!0},n.patternMismatch,e):e.validity?.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},n.tooShort,e):e.validity?.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},n.tooLong,e):e.validity?.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?t.t(n.rangeUnderflowMin,{min:this.min.toString()}):n.rangeUnderflow,e):e.validity?.stepMismatch?this.internals.setValidity({stepMismatch:!0},n.typeMismatch,e):e.validity?.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?t.t(n.rangeOverflowMax,{max:this.max.toString()}):n.rangeOverflow,e):e.validity?.customError?this.internals.setValidity({customError:!0},e.validationMessage,e):this.internals.setValidity({})}setFormValue(e){if(this.internals){if(Array.isArray(e)){let t=new FormData;e.forEach(e=>{t.append(this.name,e)}),this.internals.setFormValue(t)}else this.internals.setFormValue(e)}}coordinateRadioGroup(){if(!this.form||!this.name||this.type!==`radio`)return;let e=`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`;this.form.querySelectorAll(e).forEach(e=>{if(e!==this&&e.getAttribute(`name`)===this.name&&e.getAttribute(`value`)!==this.value){let t=e;t.checked&&(t.checked=!1,t.internals&&(t.internals.setFormValue(null),t.internals.states?.delete(Z)))}})}valueChecked(e){if(!this.touched)return;let t=this.internals.form||this.closest(`form`),n=t?new FormData(t):null;if(this.type===`radio`&&this.coordinateRadioGroup(),typeof e==`string`?(this.checked=e===`true`,this.internals.ariaChecked=String(e===`true`)):typeof e==`boolean`&&(this.checked=e,this.internals.ariaChecked=String(e)),this.checked){let e=(typeof this.value==`string`?this.value:``)||X;this.internals.setFormValue(e),n&&n.append(this.name,e),this.internals.states.add(Z)}else this.internals.setFormValue(null),n&&n.delete(this.name),this.internals.states.delete(Z);this.dispatchChangeEvents(this.checked),this.internals.reportValidity()}valueChanged(e,t){let n=e;if(typeof n==`number`||typeof n==`boolean`)e=String(n);else if(n!=null&&typeof n!=`string`&&!Array.isArray(n)){let e=typeof n==`object`?n?.constructor?.name??`object`:typeof n;console.warn(`${this.localName}: value må være en streng eller et tall, men fikk ${e}. Verdien ignoreres. For dato-/tidsfelt, send en ISO-formatert streng (f.eks. "2026-07-09" eller "13:45").`)}(t!==this.value||t!==this._value)&&(typeof e==`string`?((this.multiple||this.range)&&e.includes(Q)&&(e=e.split(Q)),this.value=e,this._value=Array.isArray(e)?e:[e]):Array.isArray(e)?(this.value=this.multiple||this.range?e:e[0],this._value=e):(this.value=``,this._value=[]),(!this.value||this.value.length===0)&&t&&t.length!==0?this.clearInputValue():this.value&&this.value.toString()!==t?.toString()&&this.onChange(this.value))}dispatchChangeEvents(e){this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`value-change`,{detail:e,bubbles:!0,composed:!0}))}clearInputValue(){let e=this.multiple||this.range?[]:``;this.value=e,this.setFormValue(e),this.dispatchChangeEvents(e)}onFocus(){this.dispatchEvent(new FocusEvent(`focus`,{bubbles:!0,composed:!0}))}onBlur(){this.dispatchEvent(new FocusEvent(`blur`,{bubbles:!0,composed:!0}))}onInput(){this.dispatchEvent(new InputEvent(`input`,{bubbles:!0,composed:!0}))}normalizeValue(e){return(this.range||this.multiple)&&typeof e==`string`&&e.includes(Q)?e.split(Q):!this.multiple&&!this.range&&Array.isArray(e)?e[0]||``:e}validate(){this.inputRef?.value&&this.manageValidity(this.inputRef.value),this.inputRefTo?.value&&this.manageValidity(this.inputRefTo.value)}onChange(e){if(this.touched=!0,typeof e!=`string`&&!Array.isArray(e))return;let t=this.normalizeValue(e);this.setFormValue(t),this.validate(),this._initialized&&this.dispatchChangeEvents(t)}formResetCallback(){if(this.touched=!1,this._options&&this._options.length&&this._options.forEach(e=>{`selected`in e&&(e.selected=!1)}),this.checked!==void 0)this.checked=!1,this.internals.ariaChecked=`false`,this.internals.setFormValue(``),this.inputRef?.value&&`checked`in this.inputRef.value&&(this.inputRef.value.checked=!1),this.valueChecked(this.checked);else{this.internals.setFormValue(``);let e=this.defaultValue||(this.multiple||this.range?[]:``);this.value=e,this._value=Array.isArray(e)?e:[e],this.valueChanged(this.value,null)}this.internals.ariaInvalid=`false`}updated(e){super.updated(e),e.has(`dataTestid`)&&this.dataTestid&&this.inputRef.value&&(this.skipForwardTestid?this.hasAttribute(`data-testid`)||this.setAttribute(`data-testid`,this.dataTestid):(this.inputRef.value.dataset.testid=this.dataTestid,this.removeAttribute(`data-testid`)))}firstUpdated(e){if(super.firstUpdated(e),!this.form){let e=this.internals.form||this.closest(`form`);this.form=e}if(this.value&&this.defaultValue===null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked=`true`,this.checked=!0),this.required&&(this.internals.ariaRequired=`true`),this.disabled&&(this.internals.ariaDisabled=`true`),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){let e=this.checked===``||this.checked===`true`||this.checked===!0;this.internals.ariaChecked=String(e);let t=e?(typeof this.value==`string`?this.value:``)||X:null;this.internals.setFormValue(t)}else this.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute(`form`,``),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute(`form`,``),this.manageValidity(this.inputRefTo.value)),this.updateComplete.then(()=>{this._initialized=!0})}};e.n([e.u({type:Boolean,reflect:!0})],$.prototype,`checked`,void 0),e.n([e.u({type:Boolean})],$.prototype,`defaultChecked`,void 0),e.n([e.u({type:Boolean})],$.prototype,`multiple`,void 0),e.n([e.u({type:Boolean})],$.prototype,`range`,void 0),e.n([e.u({type:String,reflect:!0})],$.prototype,`type`,void 0),e.n([e.u()],$.prototype,`defaultValue`,void 0),e.n([e.u({type:Boolean,reflect:!0})],$.prototype,`disabled`,void 0),e.n([e.u({type:Boolean,reflect:!0})],$.prototype,`readonly`,void 0),e.n([e.u({type:Boolean,reflect:!0})],$.prototype,`required`,void 0),e.n([e.u({reflect:!0,converter:{fromAttribute:e=>e,toAttribute:e=>e?.toString()??null}})],$.prototype,`max`,void 0),e.n([e.u({type:Number,reflect:!0})],$.prototype,`maxlength`,void 0),e.n([e.u({reflect:!0,converter:{fromAttribute:e=>e,toAttribute:e=>e?.toString()??null}})],$.prototype,`min`,void 0),e.n([e.u({type:Number,reflect:!0})],$.prototype,`minlength`,void 0),e.n([e.u({type:Number,reflect:!0})],$.prototype,`step`,void 0),e.n([e.u({type:String,attribute:`aria-describedby`})],$.prototype,`ariaDescribedby`,void 0),e.n([e.u({type:String,attribute:`aria-labelledby`})],$.prototype,`ariaLabelledby`,void 0),e.n([e.u({type:String,reflect:!0})],$.prototype,`name`,void 0),e.n([e.u({type:String,reflect:!0})],$.prototype,`pattern`,void 0),e.n([e.u({type:String,reflect:!0})],$.prototype,`placeholder`,void 0),e.n([e.u({type:String,reflect:!0})],$.prototype,`id`,void 0),e.n([e.u({type:Boolean,converter:i.n})],$.prototype,`counter`,void 0),e.n([e.u({type:Boolean})],$.prototype,`hasError`,void 0),e.n([e.u({type:Boolean})],$.prototype,`inline`,void 0),e.n([e.u({type:Boolean,converter:i.n})],$.prototype,`hasFieldset`,void 0),e.n([e.u({type:Boolean})],$.prototype,`optionalTag`,void 0),e.n([e.u({type:Boolean})],$.prototype,`requiredTag`,void 0),e.n([e.u({type:Boolean})],$.prototype,`skipForwardTestid`,void 0),e.n([e.u({type:Boolean,reflect:!0,converter:i.t})],$.prototype,`useWrapper`,void 0),e.n([e.u({type:Boolean,reflect:!0})],$.prototype,`fullwidth`,void 0),e.n([e.u({type:Number})],$.prototype,`counterMaxLength`,void 0),e.n([e.u({type:String})],$.prototype,`errorMessage`,void 0),e.n([e.u({type:String})],$.prototype,`helptext`,void 0),e.n([e.u({type:String})],$.prototype,`helptextDropdown`,void 0),e.n([e.u({type:String,reflect:!1})],$.prototype,`helptextDropdownButton`,void 0),e.n([e.u({type:String})],$.prototype,`label`,void 0),e.n([e.u({type:String,reflect:!1})],$.prototype,`optionalText`,void 0),e.n([e.u({type:String,reflect:!1})],$.prototype,`requiredText`,void 0),e.n([e.u({type:String,reflect:!1})],$.prototype,`tagText`,void 0),e.n([e.u({type:String,attribute:`input-size`})],$.prototype,`inputSize`,void 0),e.n([e.u({type:String,attribute:`data-testid`})],$.prototype,`dataTestid`,void 0),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return $}});
|