@oslokommune/punkt-elements 20.0.3 → 20.1.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 +13 -0
- package/dist/{accordion-5N_ptxrN.cjs → accordion-CSSp30G1.cjs} +1 -1
- package/dist/{accordion-C5cu1xXT.js → accordion-DIjltHSH.js} +11 -14
- package/dist/{alert-DkyTTo7S.cjs → alert-0a5lX0pL.cjs} +12 -12
- package/dist/{alert-CA1fDbyc.js → alert-ZrB-P881.js} +36 -38
- package/dist/{async-directive-DCLIOGR8.cjs → async-directive-Bn7zgxUy.cjs} +1 -1
- package/dist/{async-directive-BcS8rfeC.js → async-directive-Ct3Mrb1M.js} +10 -11
- package/dist/{backlink-CXOxMeyt.cjs → backlink-BAvqdPlG.cjs} +1 -1
- package/dist/{backlink-CDBRcaAu.js → backlink-MBTAhQuD.js} +5 -7
- package/dist/{booleanish-OQJTYSrw.js → booleanish-CBa3Cr2h.js} +1 -2
- package/dist/{breadcrumbs-5oUaCef3.js → breadcrumbs-DtEt1-wn.js} +3 -4
- package/dist/{button-Bswo1C0M.js → button-CJzu0l5A.js} +45 -35
- package/dist/button-DHVRpzpS.cjs +32 -0
- package/dist/{calendar-BOd-9PDd.js → calendar-CkAAgviq.js} +66 -76
- package/dist/calendar-xYEsKilS.cjs +85 -0
- package/dist/{card-CKStAH0Q.js → card-CsEfBJcP.js} +10 -12
- package/dist/{card-BbV4OBqb.cjs → card-XznwedEG.cjs} +1 -1
- package/dist/{checkbox-iMOdzpJ_.cjs → checkbox-Cg7wnn8U.cjs} +1 -1
- package/dist/{checkbox-DIJbuqWm.js → checkbox-XvlUQmg5.js} +8 -10
- package/dist/{checkbox-group-Kua6HuRE.cjs → checkbox-group-BF29zyLd.cjs} +1 -1
- package/dist/{checkbox-group-DLLbWgQb.js → checkbox-group-CRIV5CX0.js} +8 -10
- package/dist/{class-map-BDwVSgLb.js → class-map-C9n5CNC8.js} +2 -3
- package/dist/{classutils-DcYnSgfc.js → classutils-C4jETHHk.js} +1 -2
- package/dist/{combobox-Pxa80TeZ.js → combobox-CDJcIkNJ.js} +63 -66
- package/dist/combobox-DuXavWEY.cjs +139 -0
- package/dist/{consent-UkinU27V.cjs → consent-BOSXNt4Y.cjs} +1 -1
- package/dist/{consent-p-0n2b9x.js → consent-DwppvYBR.js} +5 -7
- package/dist/{consume-Bp12si68.js → consume-C6aWEFx-.js} +4 -8
- package/dist/{converters-CW6SN0TT.cjs → converters-Dp64-kF1.cjs} +1 -1
- package/dist/{converters-CYgQrWVm.js → converters-v_GK06o3.js} +36 -72
- package/dist/{datepicker-Cpiu_Nrf.cjs → datepicker-Cnrbqm62.cjs} +53 -53
- package/dist/{datepicker-BpxUWiIC.js → datepicker-DHdFA8Dx.js} +82 -88
- package/dist/define-component-spec-wHP10r2x.js +5 -0
- package/dist/{dialog-polyfill.esm-D39dWbRt.js → dialog-polyfill.esm-BGBREnq_.js} +2 -3
- package/dist/dialog-polyfill.esm-BPk0-8XP.cjs +1 -0
- package/dist/{directive-helpers-BoDzpPID.js → directive-helpers-KMRvtO9j.js} +2 -3
- package/dist/{element-DLgZkx5L.js → element-Bwc-likm.js} +9 -18
- package/dist/{element-with-slot-mG-h7Sjw.js → element-with-slot-47quDZRt.js} +4 -6
- package/dist/{element-with-slot-CeKuRE3_.cjs → element-with-slot-D_8fAzCW.cjs} +1 -1
- package/dist/{fetch-header-footer-data-Pc32etrk.js → fetch-header-footer-data-CPVt_P8s.js} +3 -6
- package/dist/{fileupload-vPDmtXiM.js → fileupload-BQw5nlzQ.js} +25 -36
- package/dist/{fileupload-DXJtAagE.cjs → fileupload-Cjde62AR.cjs} +1 -1
- package/dist/{focus-modality-controller-Dc2S-KqR.js → focus-modality-controller-DVsT6GeR.js} +1 -2
- package/dist/focus-trap-C-PcFOw6.js +42 -0
- package/dist/focus-trap-C9tsr-xL.cjs +1 -0
- package/dist/{footer-CpE05IW2.cjs → footer-NQaQc2DH.cjs} +9 -9
- package/dist/{footer-D8t0PCPC.js → footer-SbOYv50e.js} +20 -24
- package/dist/{format-BTeSVkED.js → format-DwjTfa9h.js} +1 -2
- package/dist/{header-ChT1hHNA.js → header-CZnKVVt4.js} +22 -26
- package/dist/{header-CiwHNHKD.cjs → header-YbbGgmsD.cjs} +2 -2
- package/dist/{header-menu-Dq9lwNr1.cjs → header-menu-BJMMwrCR.cjs} +1 -1
- package/dist/{header-menu-BrjsNjBH.js → header-menu-k2ACrfOv.js} +9 -11
- package/dist/{heading-DAkjw2Am.cjs → heading-BNlor2MU.cjs} +1 -1
- package/dist/{heading-CMZmPEL9.js → heading-SYKHysr8.js} +19 -21
- package/dist/{helptext-Bse1LpRd.cjs → helptext-CQaNvbiv.cjs} +9 -9
- package/dist/{helptext-BFQzrOw4.js → helptext-kKmVQkwo.js} +20 -22
- package/dist/{icon-C1oCGwEe.js → icon-CZDw42U7.js} +5 -8
- package/dist/if-defined-B3pYog2C.js +4 -0
- package/dist/{input-element-2LHxo0em.cjs → input-element-CfZIyfon.cjs} +1 -1
- package/dist/{input-element-De40zUox.js → input-element-DE0FzjgP.js} +19 -25
- package/dist/{input-wrapper-C_Rzwxx7.cjs → input-wrapper-CbYMk21W.cjs} +1 -1
- package/dist/{input-wrapper-DkpJS1hR.js → input-wrapper-DYg1VHPv.js} +13 -15
- package/dist/{link-DLPpwjq4.js → link-Bc4zf-Dj.js} +19 -22
- package/dist/link-lPrxhYq0.cjs +7 -0
- package/dist/{linkcard-DIG6VYpl.cjs → linkcard-Bih7HS2t.cjs} +1 -1
- package/dist/{linkcard-Dr-r8jBO.js → linkcard-LCFAdVsG.js} +7 -9
- package/dist/{listbox-HrH4JonS.cjs → listbox-Du8llYth.cjs} +10 -10
- package/dist/{listbox-DAvIBH4P.js → listbox-df8gHweY.js} +17 -19
- package/dist/{loader-CFidlqSG.js → loader-C-2b3bGK.js} +9 -12
- package/dist/{loader-DTIrOtTo.cjs → loader-DiQSwWpb.cjs} +1 -1
- package/dist/{messagebox-BLYx3AL7.cjs → messagebox-BiG-fJX9.cjs} +1 -1
- package/dist/{messagebox-B_07P0QA.js → messagebox-CH3bKoJO.js} +9 -11
- package/dist/modal-B3rnE83a.cjs +37 -0
- package/dist/{modal-CA_M2Ix6.js → modal-SBJ8aGvM.js} +33 -35
- package/dist/{option-group-element-DzM8YznZ.js → option-group-element-DtSw52Dr.js} +7 -8
- package/dist/{option-group-element-CVNaBIlP.cjs → option-group-element-dN0ntPZk.cjs} +1 -1
- 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.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 +2 -3
- 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.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +37 -37
- 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-CzvBlEPD.js → pkt-options-controller-Dz7DP0wC.js} +2 -3
- package/dist/{pkt-options-controller-9zoH1OBW.cjs → pkt-options-controller-WsHVdPJA.cjs} +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-CfCc2zhp.js → progressbar-DlbkKRgP.js} +9 -11
- package/dist/{progressbar-BdqIhC1Z.cjs → progressbar-Wyq_Q1Ur.cjs} +1 -1
- package/dist/{provide-_MnlMGnw.js → provide-DFu2tSv_.js} +3 -5
- package/dist/{radio-group-BRY_74od.js → radio-group-bRF8fnPW.js} +8 -10
- package/dist/{radio-group-CsUgnEv0.cjs → radio-group-u1IH7g-4.cjs} +1 -1
- package/dist/{radiobutton-CQhuG2lj.cjs → radiobutton-86ZvvDmJ.cjs} +1 -1
- package/dist/{radiobutton-lHnq8wX_.js → radiobutton-Bf6aFfYt.js} +8 -10
- package/dist/{ref-B6p6mQkO.cjs → ref-C6VUWwmF.cjs} +1 -1
- package/dist/{ref-BAegS9BR.js → ref-qE1RBrI7.js} +3 -4
- package/dist/{repeat-Cy1M16Di.js → repeat-c2P6osbb.js} +3 -4
- package/dist/{scroll-lock-CR-g54ai.js → scroll-lock-C9jzbJ4E.js} +1 -2
- package/dist/{searchinput-TAqMUJ0B.cjs → searchinput-D5l64Mkb.cjs} +7 -7
- package/dist/{searchinput-BLGaXkP6.js → searchinput-DN8kDZQ1.js} +18 -20
- package/dist/{select-Dle67Uwv.cjs → select-C7kAlSxs.cjs} +15 -15
- package/dist/{select-BvtUxW0Q.js → select-CXIEM2qY.js} +15 -18
- package/dist/shared-types/button.d.ts +13 -0
- package/dist/shared-types/index.d.ts +1 -1
- package/dist/shared-types-BvRk9kiK.js +0 -0
- package/dist/{tabs-BmmTUKuC.js → tabs-Cg16Sl3u.js} +57 -60
- package/dist/tabs-n7hQWwyI.cjs +40 -0
- package/dist/{tag-BZdC0voc.cjs → tag-BAikRN2Y.cjs} +1 -1
- package/dist/{tag-Cam7ISOF.js → tag-HXcXopyA.js} +9 -11
- package/dist/{textarea-Djp5L2Zd.js → textarea-12le8b4I.js} +12 -14
- package/dist/{textarea-DSX3jMlI.cjs → textarea-CRcSfWgX.cjs} +1 -1
- package/dist/{textinput-CBrOZcvL.js → textinput-CC0zxUBT.js} +11 -13
- package/dist/{textinput-CN2F3Q3H.cjs → textinput-Dooq2n8W.cjs} +1 -1
- package/dist/{timepicker-CkaJkIGn.cjs → timepicker-BM4I5w-i.cjs} +20 -20
- package/dist/{timepicker-CT4wfrgQ.js → timepicker-Cz81VQu3.js} +27 -28
- package/dist/{utils-BwF4QSrq.js → utils-Dn5ykFtS.js} +1 -2
- package/package.json +10 -10
- package/src/components/button/button.ts +14 -14
- package/dist/button-bVWAX98x.cjs +0 -32
- package/dist/calendar-CDTCgTJn.cjs +0 -85
- package/dist/combobox-CWL8T3UK.cjs +0 -139
- package/dist/define-component-spec-BYOSeplU.js +0 -6
- package/dist/dialog-polyfill.esm-CW51hN2p.cjs +0 -1
- package/dist/focus-trap-DG3pEuyJ.js +0 -60
- package/dist/focus-trap-DSv4Ifqm.cjs +0 -1
- package/dist/if-defined-DiYi2v_Q.js +0 -5
- package/dist/link-pkFJ11Zd.cjs +0 -7
- package/dist/modal-BvTfLfFq.cjs +0 -37
- package/dist/shared-types-A6iGIX-f.js +0 -1
- package/dist/tabs-B96Orh6O.cjs +0 -40
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { _ as e, d as t, h as n, l as r, n as i, t as a, u as o } from "./element-
|
|
2
|
-
import { t as s } from "./class-map-
|
|
3
|
-
import { t as c } from "./format-
|
|
4
|
-
import { i as l, t as u } from "./element-with-slot-
|
|
5
|
-
import { t as d } from "./booleanish-
|
|
6
|
-
import "./shared-types-
|
|
7
|
-
import { n as f, o as p, t as m } from "./fetch-header-footer-data-
|
|
8
|
-
import "./icon-
|
|
9
|
-
import "./
|
|
10
|
-
import
|
|
11
|
-
import "./
|
|
12
|
-
import { n as g, t as _ } from "./ref-
|
|
13
|
-
import { n as v, t as y } from "./focus-trap-
|
|
14
|
-
import { n as b, t as x } from "./scroll-lock-
|
|
15
|
-
import "./link-
|
|
16
|
-
import "./searchinput-
|
|
17
|
-
import "./header-menu-
|
|
18
|
-
|
|
1
|
+
import { _ as e, d as t, h as n, l as r, n as i, t as a, u as o } from "./element-Bwc-likm.js";
|
|
2
|
+
import { t as s } from "./class-map-C9n5CNC8.js";
|
|
3
|
+
import { t as c } from "./format-DwjTfa9h.js";
|
|
4
|
+
import { i as l, t as u } from "./element-with-slot-47quDZRt.js";
|
|
5
|
+
import { t as d } from "./booleanish-CBa3Cr2h.js";
|
|
6
|
+
import "./shared-types-BvRk9kiK.js";
|
|
7
|
+
import { n as f, o as p, t as m } from "./fetch-header-footer-data-CPVt_P8s.js";
|
|
8
|
+
import "./icon-CZDw42U7.js";
|
|
9
|
+
import "./button-CJzu0l5A.js";
|
|
10
|
+
import "./textinput-CC0zxUBT.js";
|
|
11
|
+
import { t as h } from "./if-defined-B3pYog2C.js";
|
|
12
|
+
import { n as g, t as _ } from "./ref-qE1RBrI7.js";
|
|
13
|
+
import { n as v, t as y } from "./focus-trap-C-PcFOw6.js";
|
|
14
|
+
import { n as b, t as x } from "./scroll-lock-C9jzbJ4E.js";
|
|
15
|
+
import "./link-Bc4zf-Dj.js";
|
|
16
|
+
import "./searchinput-DN8kDZQ1.js";
|
|
17
|
+
import "./header-menu-k2ACrfOv.js";
|
|
18
|
+
// ../../shared-types/header.ts
|
|
19
19
|
var S = (e) => typeof e.target == "string" ? {
|
|
20
20
|
title: e.title,
|
|
21
21
|
iconName: e.iconName,
|
|
@@ -227,8 +227,7 @@ try {
|
|
|
227
227
|
} catch {
|
|
228
228
|
console.warn("Forsøker å definere <pkt-header-user-menu>, men den er allerede definert");
|
|
229
229
|
}
|
|
230
|
-
|
|
231
|
-
//#region src/components/header/header-service.ts
|
|
230
|
+
// src/components/header/header-service.ts
|
|
232
231
|
var D = "https://punkt-cdn.oslo.kommune.no/latest/logos/";
|
|
233
232
|
typeof window < "u" && (window.pktLogoPath = window.pktLogoPath || D);
|
|
234
233
|
var O = class extends u {
|
|
@@ -260,7 +259,7 @@ var O = class extends u {
|
|
|
260
259
|
default: return;
|
|
261
260
|
}
|
|
262
261
|
let i = r.value;
|
|
263
|
-
i && (
|
|
262
|
+
i && (n && i.contains(n) || (this.openMenu = "none"));
|
|
264
263
|
}, this.handleEscapeKey = (e) => {
|
|
265
264
|
e.key === "Escape" && this.openMenu !== "none" && (e.preventDefault(), this.chrome.flagRestoreFocus(), this.openMenu = "none");
|
|
266
265
|
};
|
|
@@ -706,8 +705,7 @@ try {
|
|
|
706
705
|
} catch {
|
|
707
706
|
console.warn("Forsøker å definere <pkt-header-service>, men den er allerede definert");
|
|
708
707
|
}
|
|
709
|
-
|
|
710
|
-
//#region src/components/header/header-global.ts
|
|
708
|
+
// src/components/header/header-global.ts
|
|
711
709
|
var k = "https://punkt-cdn.oslo.kommune.no/latest/logos/";
|
|
712
710
|
typeof window < "u" && (window.pktLogoPath = window.pktLogoPath || k);
|
|
713
711
|
var A = "pkt-header-global-menu", j = "pkt-header-global-menu-toggle", M = "pkt-header-global-search-panel", N = "pkt-header-global-search-toggle", P = class extends a {
|
|
@@ -1164,8 +1162,7 @@ try {
|
|
|
1164
1162
|
} catch {
|
|
1165
1163
|
console.warn("Forsøker å definere <pkt-header-global>, men den er allerede definert");
|
|
1166
1164
|
}
|
|
1167
|
-
|
|
1168
|
-
//#region src/components/header/header.ts
|
|
1165
|
+
// src/components/header/header.ts
|
|
1169
1166
|
var F = class extends u {
|
|
1170
1167
|
constructor(...e) {
|
|
1171
1168
|
super(...e), this.type = "service", this.searchValue = "", this.mobileBreakpoint = 768, this.tabletBreakpoint = 1280, this.openedMenu = "none", this.logOutButtonPlacement = "none", this.position = "fixed", this.scrollBehavior = "hide", this.slotMenuVariant = "icon-only", this.slotMenuText = "Meny", this.hideLogo = !1, this.compact = !1, this.canChangeRepresentation = !1, this.hasLogOut = !1, this.showContact = !0;
|
|
@@ -1322,5 +1319,4 @@ try {
|
|
|
1322
1319
|
} catch {
|
|
1323
1320
|
console.warn("Forsøker å definere <pkt-header>, men den er allerede definert");
|
|
1324
1321
|
}
|
|
1325
|
-
//#endregion
|
|
1326
1322
|
export { w as a, E as i, P as n, O as r, F as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-CEarCnHH.cjs"),t=require("./class-map-C82GtM1w.cjs"),n=require("./format-B8meU8Tm.cjs"),r=require("./element-with-slot-
|
|
1
|
+
const e=require("./element-CEarCnHH.cjs"),t=require("./class-map-C82GtM1w.cjs"),n=require("./format-B8meU8Tm.cjs"),r=require("./element-with-slot-D_8fAzCW.cjs"),i=require("./booleanish-BF8l4scU.cjs");require("./shared-types-BvRk9kiK.cjs");const a=require("./fetch-header-footer-data-CUKV0biS.cjs");require("./icon-5A378_yh.cjs"),require("./button-DHVRpzpS.cjs"),require("./textinput-Dooq2n8W.cjs");const o=require("./if-defined-Ci4ZQsgL.cjs"),s=require("./ref-C6VUWwmF.cjs"),c=require("./focus-trap-C9tsr-xL.cjs"),l=require("./scroll-lock-x0VxhKWZ.cjs");require("./link-lPrxhYq0.cjs"),require("./searchinput-D5l64Mkb.cjs"),require("./header-menu-BJMMwrCR.cjs");var u=e=>typeof e.target==`string`?{title:e.title,iconName:e.iconName,href:e.target}:{title:e.title,iconName:e.iconName,onClick:e.target},d=e=>u(e),f=e=>{if(!e)return;let t=typeof e==`string`?new Date(e):e;if(!isNaN(t.getTime()))return t.toLocaleDateString(`nb-NO`,{day:`numeric`,month:`long`,year:`numeric`,hour:`2-digit`,minute:`2-digit`})},p=class{constructor(e,t){this.isMobile=!1,this.isTablet=!1,this.isHidden=!1,this.pauseScrollHide=!1,this.componentWidth=typeof window<`u`?window.innerWidth:0,this.lastScrollPosition=0,this.scrollLockToken=l.t(),this.lastFocusedElement=null,this.shouldRestoreFocus=!1,this.initialWidthEstimated=!1,this.handleScroll=()=>{if(this.getOptions().scrollBehavior!==`hide`||this.pauseScrollHide)return;let e=window.pageYOffset||document.documentElement.scrollTop;if(e<0||Math.abs(e-this.lastScrollPosition)<60)return;let t=e>this.lastScrollPosition;this.lastScrollPosition=e,t!==this.isHidden&&(this.isHidden=t,this.host.requestUpdate())},this.host=e,this.getOptions=t,e.addController(this)}hostConnected(){window.addEventListener(`scroll`,this.handleScroll)}hostUpdate(){this.initialWidthEstimated||(this.initialWidthEstimated=!0,this.componentWidth=this.host.offsetWidth,this.applyBreakpoints())}hostDisconnected(){this.resizeObserver?.disconnect(),window.removeEventListener(`scroll`,this.handleScroll),l.n(this.scrollLockToken,!1)}observe(e){e&&(this.componentWidth=e.offsetWidth,this.refreshBreakpoints(),this.resizeObserver=new ResizeObserver(e=>{for(let t of e)this.componentWidth=t.borderBoxSize&&t.borderBoxSize.length>0?t.borderBoxSize[0].inlineSize:t.contentRect.width,this.refreshBreakpoints()}),this.resizeObserver.observe(e))}refreshBreakpoints(){this.applyBreakpoints()&&this.host.requestUpdate()}applyBreakpoints(){let{mobileBreakpoint:e,tabletBreakpoint:t}=this.getOptions(),n=this.componentWidth<e,r=this.componentWidth<t;return n===this.isMobile&&r===this.isTablet?!1:(this.isMobile=n,this.isTablet=r,!0)}setScrollLock(e){l.n(this.scrollLockToken,e)}captureFocus(){this.lastFocusedElement=document.activeElement}flagRestoreFocus(){this.shouldRestoreFocus=!0}restoreFocus(){this.shouldRestoreFocus&&this.lastFocusedElement&&document.contains(this.lastFocusedElement)&&this.lastFocusedElement.focus(),this.lastFocusedElement=null,this.shouldRestoreFocus=!1}},m=class extends e.t{constructor(...e){super(...e),this.canChangeRepresentation=!1,this.logoutOnClick=!1}handleChangeRepresentation(){this.dispatchEvent(new CustomEvent(`change-representation`,{bubbles:!0,composed:!0}))}handleLogout(){this.dispatchEvent(new CustomEvent(`log-out`,{bubbles:!0,composed:!0}))}handleMenuItemClick(e){`onClick`in e&&typeof e.onClick==`function`&&e.onClick()}renderLinkOrButton(n,r){let i=`href`in n,a=t.t({"pkt-user-menu__link":!0,"pkt-link-button":!i,"pkt-link":!i,"pkt-link--icon-left":!i,[r||``]:!!r});return i?e._`
|
|
2
2
|
<pkt-link
|
|
3
3
|
iconName=${n.iconName||e.h}
|
|
4
4
|
href=${n.href}
|
|
@@ -79,7 +79,7 @@ const e=require("./element-CEarCnHH.cjs"),t=require("./class-map-C82GtM1w.cjs"),
|
|
|
79
79
|
`:e.h}
|
|
80
80
|
</ul>
|
|
81
81
|
</nav>
|
|
82
|
-
`}};e.n([e.u({type:Object})],m.prototype,`user`,void 0),e.n([e.u({type:String,attribute:`formatted-last-logged-in`})],m.prototype,`formattedLastLoggedIn`,void 0),e.n([e.u({type:Object})],m.prototype,`representing`,void 0),e.n([e.u({type:Array,attribute:`user-menu`})],m.prototype,`userMenu`,void 0),e.n([e.u({type:Boolean,attribute:`can-change-representation`,converter:i.t})],m.prototype,`canChangeRepresentation`,void 0),e.n([e.u({type:Boolean,attribute:`logout-on-click`,converter:i.t})],m.prototype,`logoutOnClick`,void 0);try{e.d(`pkt-header-user-menu`)(m)}catch{console.warn(`Forsøker å definere <pkt-header-user-menu>, men den er allerede definert`)}var h=`https://punkt-cdn.oslo.kommune.no/latest/logos/`;typeof window<`u`&&(window.pktLogoPath=window.pktLogoPath||h);var g=class extends r.t{constructor(...e){super(...e),this.logoLink=a.o,this.logoPath=typeof window<`u`?window.pktLogoPath:h,this.searchValue=``,this.mobileBreakpoint=768,this.tabletBreakpoint=1280,this.openedMenu=`none`,this.logOutButtonPlacement=`none`,this.position=`fixed`,this.scrollBehavior=`hide`,this.slotMenuVariant=`icon-only`,this.hideLogo=!1,this.compact=!1,this.showSearch=!1,this.canChangeRepresentation=!1,this.hasLogOut=!1,this.openMenu=`none`,this.alignSlotRight=!1,this.alignSearchRight=!1,this.headerRef=s.t(),this.userContainerRef=s.t(),this.slotContainerRef=s.t(),this.searchContainerRef=s.t(),this.slotContentRef=s.t(),this.searchMenuRef=s.t(),this.chrome=new p(this,()=>({mobileBreakpoint:this.mobileBreakpoint,tabletBreakpoint:this.tabletBreakpoint,position:this.position,scrollBehavior:this.scrollBehavior})),this.handleClickOutside=e=>{let t=e.target;this.user&&this.openMenu===`user`&&!t.closest(`.pkt-header-service__user-container`)&&(this.openMenu=`none`),this.openMenu===`slot`&&!t.closest(`.pkt-header-service__slot-container`)&&(this.openMenu=`none`),this.openMenu===`search`&&!t.closest(`.pkt-header-service__search-container`)&&!t.closest(`.pkt-header-service__search-input`)&&(this.openMenu=`none`)},this.handleSlotContentClick=e=>{if(!this.isTablet||this.openMenu!==`slot`)return;let t=e.target.closest(`a[href], button, [role="link"], [role="button"], [role="menuitem"], [role="menuitemradio"], [role="menuitemcheckbox"]`);t&&this.slotContentRef.value?.contains(t)&&(t.closest(`[data-pkt-header-keep-open]`)||t.disabled||t.getAttribute(`aria-disabled`)===`true`||(this.openMenu=`none`))},this.handleFocusOut=(e,t)=>{let n=e.relatedTarget,r;switch(t){case`user`:r=this.userContainerRef;break;case`slot`:r=this.slotContainerRef;break;case`search`:r=this.searchContainerRef;break;default:return}let i=r.value;i&&(
|
|
82
|
+
`}};e.n([e.u({type:Object})],m.prototype,`user`,void 0),e.n([e.u({type:String,attribute:`formatted-last-logged-in`})],m.prototype,`formattedLastLoggedIn`,void 0),e.n([e.u({type:Object})],m.prototype,`representing`,void 0),e.n([e.u({type:Array,attribute:`user-menu`})],m.prototype,`userMenu`,void 0),e.n([e.u({type:Boolean,attribute:`can-change-representation`,converter:i.t})],m.prototype,`canChangeRepresentation`,void 0),e.n([e.u({type:Boolean,attribute:`logout-on-click`,converter:i.t})],m.prototype,`logoutOnClick`,void 0);try{e.d(`pkt-header-user-menu`)(m)}catch{console.warn(`Forsøker å definere <pkt-header-user-menu>, men den er allerede definert`)}var h=`https://punkt-cdn.oslo.kommune.no/latest/logos/`;typeof window<`u`&&(window.pktLogoPath=window.pktLogoPath||h);var g=class extends r.t{constructor(...e){super(...e),this.logoLink=a.o,this.logoPath=typeof window<`u`?window.pktLogoPath:h,this.searchValue=``,this.mobileBreakpoint=768,this.tabletBreakpoint=1280,this.openedMenu=`none`,this.logOutButtonPlacement=`none`,this.position=`fixed`,this.scrollBehavior=`hide`,this.slotMenuVariant=`icon-only`,this.hideLogo=!1,this.compact=!1,this.showSearch=!1,this.canChangeRepresentation=!1,this.hasLogOut=!1,this.openMenu=`none`,this.alignSlotRight=!1,this.alignSearchRight=!1,this.headerRef=s.t(),this.userContainerRef=s.t(),this.slotContainerRef=s.t(),this.searchContainerRef=s.t(),this.slotContentRef=s.t(),this.searchMenuRef=s.t(),this.chrome=new p(this,()=>({mobileBreakpoint:this.mobileBreakpoint,tabletBreakpoint:this.tabletBreakpoint,position:this.position,scrollBehavior:this.scrollBehavior})),this.handleClickOutside=e=>{let t=e.target;this.user&&this.openMenu===`user`&&!t.closest(`.pkt-header-service__user-container`)&&(this.openMenu=`none`),this.openMenu===`slot`&&!t.closest(`.pkt-header-service__slot-container`)&&(this.openMenu=`none`),this.openMenu===`search`&&!t.closest(`.pkt-header-service__search-container`)&&!t.closest(`.pkt-header-service__search-input`)&&(this.openMenu=`none`)},this.handleSlotContentClick=e=>{if(!this.isTablet||this.openMenu!==`slot`)return;let t=e.target.closest(`a[href], button, [role="link"], [role="button"], [role="menuitem"], [role="menuitemradio"], [role="menuitemcheckbox"]`);t&&this.slotContentRef.value?.contains(t)&&(t.closest(`[data-pkt-header-keep-open]`)||t.disabled||t.getAttribute(`aria-disabled`)===`true`||(this.openMenu=`none`))},this.handleFocusOut=(e,t)=>{let n=e.relatedTarget,r;switch(t){case`user`:r=this.userContainerRef;break;case`slot`:r=this.slotContainerRef;break;case`search`:r=this.searchContainerRef;break;default:return}let i=r.value;i&&(n&&i.contains(n)||(this.openMenu=`none`))},this.handleEscapeKey=e=>{e.key===`Escape`&&this.openMenu!==`none`&&(e.preventDefault(),this.chrome.flagRestoreFocus(),this.openMenu=`none`)}}get isMobile(){return this.chrome.isMobile}get isTablet(){return this.chrome.isTablet}get isHidden(){return this.chrome.isHidden}firstUpdated(){this.chrome.observe(this.headerRef.value)}willUpdate(e){super.willUpdate(e),e.has(`openedMenu`)&&this.openedMenu!==this.openMenu&&(this.openMenu=this.openedMenu)}updated(e){if(super.updated(e),(e.has(`mobileBreakpoint`)||e.has(`tabletBreakpoint`))&&this.chrome.refreshBreakpoints(),e.has(`openMenu`)){let t=e.get(`openMenu`);this.openMenu!==`none`&&(t===`none`||t===void 0)?(document.addEventListener(`mousedown`,this.handleClickOutside),document.addEventListener(`keydown`,this.handleEscapeKey),(this.openMenu===`slot`||this.openMenu===`search`)&&requestAnimationFrame(()=>{this.checkDropdownAlignment(this.openMenu)})):this.openMenu===`none`&&t!==`none`&&(document.removeEventListener(`mousedown`,this.handleClickOutside),document.removeEventListener(`keydown`,this.handleEscapeKey),this.chrome.restoreFocus())}this.chrome.setScrollLock((this.isFixed||this.isSticky)&&this.isMobile&&this.openMenu!==`none`)}checkDropdownAlignment(e){let t=e===`slot`?this.slotContainerRef:this.searchContainerRef,n=e===`slot`?this.slotContentRef:this.searchMenuRef;if(!t.value||!n.value||!this.isTablet||this.isMobile)return;let r=t.value.getBoundingClientRect(),i=n.value.offsetWidth,a=r.left+i>window.innerWidth;e===`slot`?this.alignSlotRight=a:this.alignSearchRight=a}handleMenuToggle(e){this.openMenu===`none`?(this.chrome.captureFocus(),this.openMenu=e):this.openMenu=`none`}handleLogoClick(e){this.dispatchEvent(new CustomEvent(`logo-click`,{bubbles:!0,composed:!0,detail:{originalEvent:e}}))}handleServiceClick(e){this.dispatchEvent(new CustomEvent(`service-click`,{bubbles:!0,composed:!0,detail:{originalEvent:e}}))}handleLogout(){this.dispatchEvent(new CustomEvent(`log-out`,{bubbles:!0,composed:!0}))}handleSearch(e){this.dispatchEvent(new CustomEvent(`search`,{detail:{query:e},bubbles:!0,composed:!0}))}handleSearchChange(e){this.dispatchEvent(new CustomEvent(`search-change`,{detail:{query:e},bubbles:!0,composed:!0}))}handleSearchInputChange(e){let t=e.target.value;this.handleSearchChange(t)}handleSearchKeyDown(e){e.key===`Enter`&&this.handleSearch(e.target.value)}get formattedLastLoggedIn(){return f(this.user?.lastLoggedIn)}get isFixed(){return this.position===`fixed`}get isSticky(){return this.position===`sticky`}get shouldHideOnScroll(){return this.scrollBehavior===`hide`}get showLogoutInHeader(){return this.hasLogOut&&(this.logOutButtonPlacement===`header`||this.logOutButtonPlacement===`both`)}get showLogoutInUserMenu(){return this.hasLogOut&&(this.logOutButtonPlacement===`userMenu`||this.logOutButtonPlacement===`both`)}get headerStrings(){return this.pktStrings.get(`header`)}renderLogo(){if(this.hideLogo)return e.h;let t=e._`
|
|
83
83
|
<pkt-icon name="oslologo" aria-hidden="true" path=${this.logoPath}></pkt-icon>
|
|
84
84
|
`;return this.logoLink?e._`
|
|
85
85
|
<span class="pkt-header-service__logo">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-CEarCnHH.cjs"),t=require("./class-map-C82GtM1w.cjs"),n=require("./booleanish-BF8l4scU.cjs");require("./shared-types-BvRk9kiK.cjs");const r=require("./fetch-header-footer-data-CUKV0biS.cjs");require("./
|
|
1
|
+
const e=require("./element-CEarCnHH.cjs"),t=require("./class-map-C82GtM1w.cjs"),n=require("./booleanish-BF8l4scU.cjs");require("./shared-types-BvRk9kiK.cjs");const r=require("./fetch-header-footer-data-CUKV0biS.cjs");require("./accordion-CSSp30G1.cjs"),require("./icon-5A378_yh.cjs");var i=class extends e.t{constructor(...e){super(...e),this.dataUrl=r.a,this.locale=`nb-NO`,this.open=!1,this.mobileBreakpoint=768,this.loadState=`idle`,this.isMobile=!1,this.menuWidth=0}connectedCallback(){super.connectedCallback(),this.classList.add(`pkt-header-menu`),this.updateOpenClass(),this.observeWidth(),this.data?(this.loadState=`ready`,this.dispatchEvent(new CustomEvent(`data-loaded`,{detail:{data:this.data},bubbles:!0,composed:!0}))):this.loadData()}updateOpenClass(){this.classList.toggle(`pkt-header-menu--open`,!!this.open)}disconnectedCallback(){super.disconnectedCallback(),this.abortController?.abort(),this.resizeObserver?.disconnect(),this.resizeObserver=void 0}updated(e){super.updated(e),e.has(`open`)&&this.updateOpenClass(),e.has(`mobileBreakpoint`)&&e.get(`mobileBreakpoint`)!==void 0&&this.refreshIsMobile(),e.has(`dataUrl`)&&e.get(`dataUrl`)!==void 0&&!this.data&&this.loadData(),e.has(`data`)&&e.get(`data`)!==void 0&&this.data&&(this.loadState=`ready`,this.dispatchEvent(new CustomEvent(`data-loaded`,{detail:{data:this.data},bubbles:!0,composed:!0})))}observeWidth(){typeof ResizeObserver<`u`&&(this.menuWidth=this.offsetWidth,this.refreshIsMobile(),this.resizeObserver=new ResizeObserver(e=>{for(let t of e)this.menuWidth=t.borderBoxSize&&t.borderBoxSize.length>0?t.borderBoxSize[0].inlineSize:t.contentRect.width,this.refreshIsMobile()}),this.resizeObserver.observe(this))}refreshIsMobile(){this.isMobile=this.menuWidth<this.mobileBreakpoint}async loadData(){this.abortController?.abort(),this.abortController=new AbortController,this.loadState=`loading`;try{let e=await r.t(this.dataUrl,this.abortController.signal);this.fetchedData=e,this.loadState=`ready`,this.dispatchEvent(new CustomEvent(`data-loaded`,{detail:{data:e},bubbles:!0,composed:!0}))}catch(e){if(e.name===`AbortError`)return;this.loadState=`error`,this.dispatchEvent(new CustomEvent(`data-error`,{detail:{error:e},bubbles:!0,composed:!0}))}}get effectiveData(){return this.data??this.fetchedData}get localeData(){return r.n(this.effectiveData,this.locale)}render(){if(this.loadState===`loading`)return e._`
|
|
2
2
|
<nav aria-busy="true">
|
|
3
3
|
<p class="pkt-header-menu__loading">${this.pktStrings.get(`header`).menuLoading}</p>
|
|
4
4
|
</nav>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { _ as e, d as t, h as n, l as r, n as i, t as a, u as o } from "./element-
|
|
2
|
-
import { t as s } from "./class-map-
|
|
3
|
-
import { t as c } from "./booleanish-
|
|
4
|
-
import "./shared-types-
|
|
5
|
-
import { a as l, i as u, n as d, r as f, t as p } from "./fetch-header-footer-data-
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
8
|
-
|
|
1
|
+
import { _ as e, d as t, h as n, l as r, n as i, t as a, u as o } from "./element-Bwc-likm.js";
|
|
2
|
+
import { t as s } from "./class-map-C9n5CNC8.js";
|
|
3
|
+
import { t as c } from "./booleanish-CBa3Cr2h.js";
|
|
4
|
+
import "./shared-types-BvRk9kiK.js";
|
|
5
|
+
import { a as l, i as u, n as d, r as f, t as p } from "./fetch-header-footer-data-CPVt_P8s.js";
|
|
6
|
+
import "./accordion-DIjltHSH.js";
|
|
7
|
+
import "./icon-CZDw42U7.js";
|
|
8
|
+
// src/components/header-menu/header-menu.ts
|
|
9
9
|
var m = class extends a {
|
|
10
10
|
constructor(...e) {
|
|
11
11
|
super(...e), this.dataUrl = l, this.locale = "nb-NO", this.open = !1, this.mobileBreakpoint = 768, this.loadState = "idle", this.isMobile = !1, this.menuWidth = 0;
|
|
@@ -243,8 +243,6 @@ try {
|
|
|
243
243
|
} catch {
|
|
244
244
|
console.warn("Forsøker å definere <pkt-header-menu>, men den er allerede definert");
|
|
245
245
|
}
|
|
246
|
-
|
|
247
|
-
//#region src/components/header-menu/index.ts
|
|
246
|
+
// src/components/header-menu/index.ts
|
|
248
247
|
var h = m;
|
|
249
|
-
//#endregion
|
|
250
248
|
export { m as n, h as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./element-
|
|
1
|
+
const e=require("./element-with-slot-D_8fAzCW.cjs"),t=require("./element-CEarCnHH.cjs");var n=class extends e.t{constructor(...e){super(...e),this.size=void 0,this.level=2,this.weight=void 0,this.visuallyHidden=!1,this.align=void 0}willUpdate(e){super.willUpdate(e),e.has(`level`)&&(this.level<1||this.level>6)&&console.warn(`Invalid heading level: ${this.level}. Must be between 1 and 6.`),this.size===void 0&&(this.size=this.defaultSizeForLevel),this.weight===void 0&&(this.weight=this.defaultWeightForLevel)}get defaultSizeForLevel(){switch(this.level){case 1:return`xlarge`;case 2:return`large`;case 3:return`medium`;case 4:return`small`;case 5:case 6:return`xsmall`;default:return`medium`}}get defaultWeightForLevel(){switch(this.level){case 1:case 2:return`regular`;case 3:case 4:case 5:case 6:return`medium`;default:return`medium`}}get headingClasses(){return[`pkt-heading`,this.size&&`pkt-heading--${this.size}`,this.weight&&`pkt-heading--fw-${this.weight}`,this.visuallyHidden&&`pkt-sr-only`,this.align&&`pkt-heading--${this.align}`].filter(Boolean).join(` `)}render(){let n=this.headingClasses,r=e.i(this);switch(this.level>=1&&this.level<=6?this.level:2){case 1:return t._`<h1 class=${n}>${r}</h1>`;case 2:return t._`<h2 class=${n}>${r}</h2>`;case 3:return t._`<h3 class=${n}>${r}</h3>`;case 4:return t._`<h4 class=${n}>${r}</h4>`;case 5:return t._`<h5 class=${n}>${r}</h5>`;case 6:return t._`<h6 class=${n}>${r}</h6>`;default:return t._`<h2 class=${n}>${r}</h2>`}}};t.n([t.u({type:String,reflect:!0})],n.prototype,`size`,void 0),t.n([t.u({type:Number,reflect:!0})],n.prototype,`level`,void 0),t.n([t.u({type:String,reflect:!0})],n.prototype,`weight`,void 0),t.n([t.u({type:Boolean,reflect:!0})],n.prototype,`visuallyHidden`,void 0),t.n([t.u({type:String,reflect:!0})],n.prototype,`align`,void 0);try{t.d(`pkt-heading`)(n)}catch{console.warn(`Forsøker å definere <pkt-heading>, men den er allerede definert`)}var r=n;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i,
|
|
3
|
-
|
|
4
|
-
var o = class extends
|
|
1
|
+
import { i as e, t } from "./element-with-slot-47quDZRt.js";
|
|
2
|
+
import { _ as n, d as r, n as i, u as a } from "./element-Bwc-likm.js";
|
|
3
|
+
// src/components/heading/heading.ts
|
|
4
|
+
var o = class extends t {
|
|
5
5
|
constructor(...e) {
|
|
6
6
|
super(...e), this.size = void 0, this.level = 2, this.weight = void 0, this.visuallyHidden = !1, this.align = void 0;
|
|
7
7
|
}
|
|
@@ -40,41 +40,39 @@ var o = class extends a {
|
|
|
40
40
|
].filter(Boolean).join(" ");
|
|
41
41
|
}
|
|
42
42
|
render() {
|
|
43
|
-
let t = this.headingClasses,
|
|
43
|
+
let t = this.headingClasses, r = e(this);
|
|
44
44
|
switch (this.level >= 1 && this.level <= 6 ? this.level : 2) {
|
|
45
|
-
case 1: return
|
|
46
|
-
case 2: return
|
|
47
|
-
case 3: return
|
|
48
|
-
case 4: return
|
|
49
|
-
case 5: return
|
|
50
|
-
case 6: return
|
|
51
|
-
default: return
|
|
45
|
+
case 1: return n`<h1 class=${t}>${r}</h1>`;
|
|
46
|
+
case 2: return n`<h2 class=${t}>${r}</h2>`;
|
|
47
|
+
case 3: return n`<h3 class=${t}>${r}</h3>`;
|
|
48
|
+
case 4: return n`<h4 class=${t}>${r}</h4>`;
|
|
49
|
+
case 5: return n`<h5 class=${t}>${r}</h5>`;
|
|
50
|
+
case 6: return n`<h6 class=${t}>${r}</h6>`;
|
|
51
|
+
default: return n`<h2 class=${t}>${r}</h2>`;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
-
|
|
55
|
+
i([a({
|
|
56
56
|
type: String,
|
|
57
57
|
reflect: !0
|
|
58
|
-
})], o.prototype, "size", void 0),
|
|
58
|
+
})], o.prototype, "size", void 0), i([a({
|
|
59
59
|
type: Number,
|
|
60
60
|
reflect: !0
|
|
61
|
-
})], o.prototype, "level", void 0),
|
|
61
|
+
})], o.prototype, "level", void 0), i([a({
|
|
62
62
|
type: String,
|
|
63
63
|
reflect: !0
|
|
64
|
-
})], o.prototype, "weight", void 0),
|
|
64
|
+
})], o.prototype, "weight", void 0), i([a({
|
|
65
65
|
type: Boolean,
|
|
66
66
|
reflect: !0
|
|
67
|
-
})], o.prototype, "visuallyHidden", void 0),
|
|
67
|
+
})], o.prototype, "visuallyHidden", void 0), i([a({
|
|
68
68
|
type: String,
|
|
69
69
|
reflect: !0
|
|
70
70
|
})], o.prototype, "align", void 0);
|
|
71
71
|
try {
|
|
72
|
-
|
|
72
|
+
r("pkt-heading")(o);
|
|
73
73
|
} catch {
|
|
74
74
|
console.warn("Forsøker å definere <pkt-heading>, men den er allerede definert");
|
|
75
75
|
}
|
|
76
|
-
|
|
77
|
-
//#region src/components/heading/index.ts
|
|
76
|
+
// src/components/heading/index.ts
|
|
78
77
|
var s = o;
|
|
79
|
-
//#endregion
|
|
80
78
|
export { o as n, s as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const e=require("./element-
|
|
1
|
+
const e=require("./element-with-slot-D_8fAzCW.cjs"),t=require("./element-CEarCnHH.cjs"),n=require("./icon-5A378_yh.cjs"),r=require("./class-map-C82GtM1w.cjs"),i=require("./utils-63cRpWut.cjs");var a=class extends e.t{constructor(...e){super(...e),this.forId=i.n(),this.helptext=``,this.helptextDropdown=``,this.isHelpTextOpen=!1}render(){let i=()=>{let e=!this.isHelpTextOpen;this.isHelpTextOpen=e,this.dispatchEvent(new CustomEvent(`toggleHelpText`,{bubbles:!0,detail:{isOpen:e}}))},a=r.t({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.hasSlotContent()});return t._`${t._`<div class="${a}">
|
|
2
2
|
<div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
|
|
3
|
-
<div class="pkt-contents">${
|
|
4
|
-
${this.helptext?
|
|
3
|
+
<div class="pkt-contents">${e.i(this)}</div>
|
|
4
|
+
${this.helptext?t._`<span>${n.r(this.helptext)}</span>`:t.h}
|
|
5
5
|
</div>
|
|
6
|
-
${this.helptextDropdown?
|
|
6
|
+
${this.helptextDropdown?t._`<div class="pkt-inputwrapper__helptext-expandable">
|
|
7
7
|
<button
|
|
8
8
|
class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
|
|
9
9
|
type="button"
|
|
@@ -15,13 +15,13 @@ const e=require("./element-CEarCnHH.cjs"),t=require("./class-map-C82GtM1w.cjs"),
|
|
|
15
15
|
class="pkt-btn__icon"
|
|
16
16
|
name="${this.isHelpTextOpen?`chevron-thin-up`:`chevron-thin-down`}"
|
|
17
17
|
></pkt-icon>
|
|
18
|
-
<span class="pkt-btn__text">${
|
|
18
|
+
<span class="pkt-btn__text">${n.r(this.helptextDropdownButton??this.pktStrings.get(`forms`).readMore)}</span>
|
|
19
19
|
</button>
|
|
20
20
|
<div
|
|
21
21
|
id="${this.forId}-helptext-expandable"
|
|
22
|
-
class="${
|
|
22
|
+
class="${r.t({"pkt-inputwrapper__helptext":!0,"pkt-inputwrapper__helptext-expandable-open":this.isHelpTextOpen,"pkt-inputwrapper__helptext-expandable-closed":!this.isHelpTextOpen})}"
|
|
23
23
|
>
|
|
24
|
-
${
|
|
24
|
+
${n.r(this.helptextDropdown)}
|
|
25
25
|
</div>
|
|
26
|
-
</div>`:
|
|
27
|
-
</div>`}`}};
|
|
26
|
+
</div>`:t.h}
|
|
27
|
+
</div>`}`}};t.n([t.u({type:String,reflect:!0})],a.prototype,`forId`,void 0),t.n([t.u({type:String})],a.prototype,`helptext`,void 0),t.n([t.u({type:String})],a.prototype,`helptextDropdown`,void 0),t.n([t.u({type:String})],a.prototype,`helptextDropdownButton`,void 0),t.n([t.l()],a.prototype,`isHelpTextOpen`,void 0);try{t.d(`pkt-helptext`)(a)}catch{console.warn(`Forsøker å definere <pkt-helptext>, men den er allerede definert`)}var o=a;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return o}});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { n as u } from "./utils-
|
|
6
|
-
|
|
7
|
-
var d = class extends
|
|
1
|
+
import { i as e, t } from "./element-with-slot-47quDZRt.js";
|
|
2
|
+
import { _ as n, d as r, h as i, l as a, n as o, u as s } from "./element-Bwc-likm.js";
|
|
3
|
+
import { r as c } from "./icon-CZDw42U7.js";
|
|
4
|
+
import { t as l } from "./class-map-C9n5CNC8.js";
|
|
5
|
+
import { n as u } from "./utils-Dn5ykFtS.js";
|
|
6
|
+
// src/components/helptext/helptext.ts
|
|
7
|
+
var d = class extends t {
|
|
8
8
|
constructor(...e) {
|
|
9
9
|
super(...e), this.forId = u(), this.helptext = "", this.helptextDropdown = "", this.isHelpTextOpen = !1;
|
|
10
10
|
}
|
|
@@ -15,16 +15,16 @@ var d = class extends c {
|
|
|
15
15
|
bubbles: !0,
|
|
16
16
|
detail: { isOpen: e }
|
|
17
17
|
}));
|
|
18
|
-
}, r =
|
|
18
|
+
}, r = l({
|
|
19
19
|
"pkt-inputwrapper__helptext-container": !0,
|
|
20
20
|
"pkt-inputwrapper__has-helptext": this.helptext || this.helptextDropdown || this.hasSlotContent()
|
|
21
21
|
});
|
|
22
|
-
return
|
|
22
|
+
return n`${n`<div class="${r}">
|
|
23
23
|
<div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
|
|
24
|
-
<div class="pkt-contents">${
|
|
25
|
-
${this.helptext ?
|
|
24
|
+
<div class="pkt-contents">${e(this)}</div>
|
|
25
|
+
${this.helptext ? n`<span>${c(this.helptext)}</span>` : i}
|
|
26
26
|
</div>
|
|
27
|
-
${this.helptextDropdown ?
|
|
27
|
+
${this.helptextDropdown ? n`<div class="pkt-inputwrapper__helptext-expandable">
|
|
28
28
|
<button
|
|
29
29
|
class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
|
|
30
30
|
type="button"
|
|
@@ -36,33 +36,31 @@ var d = class extends c {
|
|
|
36
36
|
class="pkt-btn__icon"
|
|
37
37
|
name="${this.isHelpTextOpen ? "chevron-thin-up" : "chevron-thin-down"}"
|
|
38
38
|
></pkt-icon>
|
|
39
|
-
<span class="pkt-btn__text">${
|
|
39
|
+
<span class="pkt-btn__text">${c(this.helptextDropdownButton ?? this.pktStrings.get("forms").readMore)}</span>
|
|
40
40
|
</button>
|
|
41
41
|
<div
|
|
42
42
|
id="${this.forId}-helptext-expandable"
|
|
43
|
-
class="${
|
|
43
|
+
class="${l({
|
|
44
44
|
"pkt-inputwrapper__helptext": !0,
|
|
45
45
|
"pkt-inputwrapper__helptext-expandable-open": this.isHelpTextOpen,
|
|
46
46
|
"pkt-inputwrapper__helptext-expandable-closed": !this.isHelpTextOpen
|
|
47
47
|
})}"
|
|
48
48
|
>
|
|
49
|
-
${
|
|
49
|
+
${c(this.helptextDropdown)}
|
|
50
50
|
</div>
|
|
51
|
-
</div>` :
|
|
51
|
+
</div>` : i}
|
|
52
52
|
</div>`}`;
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
-
|
|
55
|
+
o([s({
|
|
56
56
|
type: String,
|
|
57
57
|
reflect: !0
|
|
58
|
-
})], d.prototype, "forId", void 0),
|
|
58
|
+
})], d.prototype, "forId", void 0), o([s({ type: String })], d.prototype, "helptext", void 0), o([s({ type: String })], d.prototype, "helptextDropdown", void 0), o([s({ type: String })], d.prototype, "helptextDropdownButton", void 0), o([a()], d.prototype, "isHelpTextOpen", void 0);
|
|
59
59
|
try {
|
|
60
|
-
|
|
60
|
+
r("pkt-helptext")(d);
|
|
61
61
|
} catch {
|
|
62
62
|
console.warn("Forsøker å definere <pkt-helptext>, men den er allerede definert");
|
|
63
63
|
}
|
|
64
|
-
|
|
65
|
-
//#region src/components/helptext/index.ts
|
|
64
|
+
// src/components/helptext/index.ts
|
|
66
65
|
var f = d;
|
|
67
|
-
//#endregion
|
|
68
66
|
export { d as n, f as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as e, d as t, f as n, g as r, h as i, m as a, n as o, p as s, t as c, u as l } from "./element-
|
|
2
|
-
import "./shared-types-
|
|
3
|
-
|
|
1
|
+
import { _ as e, d as t, f as n, g as r, h as i, m as a, n as o, p as s, t as c, u as l } from "./element-Bwc-likm.js";
|
|
2
|
+
import "./shared-types-BvRk9kiK.js";
|
|
3
|
+
// ../../shared-types/icon.ts
|
|
4
4
|
var u = "https://cdn.ikoner.oslo.kommune.no/icons/", d = "https://punkt-cdn.oslo.kommune.no/latest/animations/", f = {
|
|
5
5
|
name: "",
|
|
6
6
|
path: u
|
|
@@ -26,8 +26,7 @@ p.directiveName = "unsafeHTML", p.resultType = 1;
|
|
|
26
26
|
var m = n(p), h = class extends p {};
|
|
27
27
|
h.directiveName = "unsafeSVG", h.resultType = 2;
|
|
28
28
|
var g = n(h);
|
|
29
|
-
|
|
30
|
-
//#region src/components/icon/icon.ts
|
|
29
|
+
// src/components/icon/icon.ts
|
|
31
30
|
typeof window < "u" && (window.pktFetch = window.pktFetch === void 0 ? fetch : window.pktFetch, window.pktIconPath = window.pktIconPath || f.path);
|
|
32
31
|
var _ = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\"></svg>", v = {}, y = 2, b = 1500, x = (() => {
|
|
33
32
|
try {
|
|
@@ -111,8 +110,6 @@ try {
|
|
|
111
110
|
} catch {
|
|
112
111
|
console.warn("Forsøker å definere <pkt-icon>, men den er allerede definert");
|
|
113
112
|
}
|
|
114
|
-
|
|
115
|
-
//#region src/components/icon/index.ts
|
|
113
|
+
// src/components/icon/index.ts
|
|
116
114
|
var E = T;
|
|
117
|
-
//#endregion
|
|
118
115
|
export { d as i, T as n, m as r, E as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./element-CEarCnHH.cjs"),t=require("./format-B8meU8Tm.cjs"),n=require("./element-with-slot-CeKuRE3_.cjs"),r=require("./booleanish-BF8l4scU.cjs");require("./shared-types-BvRk9kiK.cjs");const i=require("./utils-63cRpWut.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(E(e.target))},te=e=>{T(E(e.target))},ne=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()}})},re=e=>{let t=f.get(e.target);t&&t.size&&t.forEach(e=>{e.constructor.formAssociated&&e.formResetCallback&&e.formResetCallback.apply(e)})},ie=(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),ne(t),t.addEventListener(`reset`,re),t.addEventListener(`input`,ee),t.addEventListener(`change`,te)}u.set(t,{ref:e,internals:n}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout(()=>{e.formAssociatedCallback.apply(e,[t])},0),T(t)}},E=e=>{let t=e.parentNode;return t&&t.tagName!==`FORM`&&(t=E(t)),t},D=(e,t,n=DOMException)=>{if(!e.constructor.formAssociated)throw new n(t)},O=(e,t,n)=>{let r=f.get(e);return r&&r.size&&r.forEach(e=>{c.get(e)[n]()||(t=!1)}),t},k=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),ie(e,i,n)}return t};function A(){return typeof MutationObserver<`u`}var j={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`},ae=(e,t)=>{for(let n in j){t[n]=null;let r=null,i=j[n];Object.defineProperty(t,n,{get(){return r},set(n){r=n,e.isConnected?b(e,i,n):m.set(e,t)}})}},oe=(e,t)=>{s.set(t,[]),F.observe?.(e,P)};function M(e){let t=c.get(e),{form:n}=t;ie(e,n,t),w(e,t.labels)}var N=(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()},P={attributes:!0,attributeFilter:[`disabled`,`name`]},F=A()?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`&&N(e)),t.attributeName===`name`&&e.constructor.formAssociated){let t=c.get(e),n=p.get(e);t.setFormValue(n)}}}):{};function I(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&&M(e),m.has(e)){let t=m.get(e);Object.keys(j).filter(e=>t[e]!==null).forEach(n=>{b(e,j[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;)M(r),r=n.nextNode()}e.localName===`fieldset`&&(F.observe?.(e,P),N(e,!0))}),i.forEach(e=>{let t=c.get(e);t&&s.get(t)&&S(t),d.has(e)&&d.get(e).disconnect()})})}function se(e){e.forEach(e=>{let{removedNodes:t}=e;t.forEach(t=>{let n=_.get(e.target);c.has(t)&&k(t),n.disconnect()})})}var ce=e=>{let t=new MutationObserver(se);window?.ShadyDOM?.inUse&&e.mode&&e.host&&(e=e.host),t.observe?.(e,{childList:!0}),_.set(e,t)};A()&&new MutationObserver(I);var L={childList:!0,subtree:!0},le=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)}},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),de=(e,t,n)=>(e.valid=fe(t),Object.keys(t).forEach(n=>e[n]=t[n]),n&&T(n),e),fe=e=>{let t=!0;for(let n in e)n!==`valid`&&e[n]!==!1&&(t=!1);return t},R=new WeakMap;function z(e,t){e.toggleAttribute(t,!0),e.part&&e.part.add(t)}var B=class extends Set{static get isPolyfilled(){return!0}constructor(e){if(super(),!e||!e.tagName||e.tagName.indexOf(`-`)===-1)throw TypeError(`Illegal constructor`);R.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=R.get(this),r=`state${e}`;return n.isConnected?z(n,r):setTimeout(()=>{z(n,r)}),t}clear(){for(let[e]of this.entries())this.delete(e);super.clear()}delete(e){let t=super.delete(e),n=R.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}},pe=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},V=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)},H,me=class{constructor(e){H.set(this,void 0),pe(this,H,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 V(this,H,`f`).length}[(H=new WeakMap,Symbol.iterator)](){return V(this,H,`f`)[Symbol.iterator]()}item(e){return this[e]==null?null:this[e]}namedItem(e){return this[e]==null?null:this[e]}};function he(){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 O(this,n,`checkValidity`)}function r(...e){let n=t.apply(this,e);return O(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 me(Array.from(t).concat(n).sort((e,t)=>e.compareDocumentPosition?e.compareDocumentPosition(t)&2?1:-1:0))}})}var U=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 le;this.states=new B(e),a.set(this,e),o.set(this,n),c.set(e,this),ae(e,this),oe(e,this),Object.seal(this),t instanceof DocumentFragment&&ce(t)}checkValidity(){let e=a.get(this);if(D(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);D(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=E(e)),t}get labels(){let e=a.get(this);D(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(D(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(D(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(D(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&&ue(i);let c={...i,...s};delete c.valid;let{valid:u}=de(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 D(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 D(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 D(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 ge(){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 W=!1,G=!1;function K(e){G||(G=!0,window.CustomStateSet=B,e&&(HTMLElement.prototype.attachInternals=function(...t){let n=e.call(this,t);return n.states=new B(this),n}))}function _e(e=!0){let t=!1;if(!W){if(W=!0,typeof window<`u`&&(window.ElementInternals=U),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=k(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 U(this)}),typeof Element<`u`){function n(...t){let n=e.apply(this,t);if(h.set(this,n),A()){let e=new MutationObserver(I);window.ShadyDOM?e.observe(this,L):e.observe(n,L),d.set(this,e)}return n}let e=Element.prototype.attachShadow;Element.prototype.attachShadow=n}A()&&typeof document<`u`&&new MutationObserver(I).observe(document.documentElement,L),typeof HTMLFormElement<`u`&&he(),(e||typeof window<`u`&&!window.CustomStateSet)&&K()}}customElements.polyfillWrapFlushCallback||(ge()?typeof window<`u`&&!window.CustomStateSet&&K(HTMLElement.prototype.attachInternals):_e(!1));var q=`on`,J=`--checked`,Y=`,`,X=e=>e===!0||e===``||e===`true`,Z=new WeakMap,ve=0,ye=e=>{let t=Z.get(e);return t||(t=e.id||`form${++ve}`,Z.set(e,t)),t},Q=()=>!!globalThis.ElementInternals?.isPolyfilled,$=class e extends n.t{static get formAssociated(){return!0}get form(){let e=this.getAttribute(`form`);if(e!==null){if(!e)return null;let t=this.getRootNode(),n=typeof t.getElementById==`function`?t.getElementById(e):this.ownerDocument?.getElementById(e);return n instanceof HTMLFormElement?n:null}return this.internals?.form??this.closest(`form`)}get ariaDescribedBy(){return this.ariaDescribedby}set ariaDescribedBy(e){this.ariaDescribedby=e}formDisabledCallback(e){this.formDisabled=e}get isDisabled(){return this.disabled||this.formDisabled}get optionGroup(){return this.groupContext}setGroupValidity(e){this.groupValidityMessage!==e&&(this.groupValidityMessage=e,this.inputRef?.value&&this.manageValidity(this.inputRef.value))}syncGroupName(){let e=this.optionGroup?.name;if(!e)return;let t=!this.name||this.name===this.derivedName;t&&this.name!==e&&(this.name=e),t&&(this.derivedName=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=i.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.formDisabled=!1,this.derivedName=null,this.groupValidityMessage=``,this.touched=!1,this._initialized=!1,this.polyfillFormValue=null,this._didInitDerivedState=!1,this._defaultCheckedState=!1,this.internals=this.attachInternals()}connectedCallback(){super.connectedCallback(),Q()&&queueMicrotask(()=>{this.isConnected&&this.polyfillFormValue&&this.internals.setFormValue(this.polyfillFormValue.value)})}get internalName(){let e=this.form;return e?`${this.name}-internal-${ye(e)}`:`${this.name}-internal`}formAssociatedCallback(){this.requestUpdate()}writeFormValue(e){this.internals.setFormValue(e),Q()&&(this.polyfillFormValue={value:e})}manageValidity(e,n){if(!e){console.warn(`manageValidity called without valid input element`);return}let r=this.pktStrings.get(`validation`);(this.isCheckable?this.checkableValueMissing(n??this.checkableGroup()):this.required&&!this.value)?this.internals.setValidity(this.groupValidityMessage?{valueMissing:!0,customError:!0}:{valueMissing:!0},this.groupValidityMessage||r.valueMissing,e):e.validity?.typeMismatch||e.validity?.badInput?this.internals.setValidity({typeMismatch:!0},r.typeMismatch,e):e.validity?.patternMismatch?this.internals.setValidity({patternMismatch:!0},r.patternMismatch,e):e.validity?.tooShort||this.minlength&&this.minlength>0&&this.valueLength<this.minlength?this.internals.setValidity({tooShort:!0},r.tooShort,e):e.validity?.tooLong||this.maxlength&&this.maxlength>0&&this.valueLength>this.maxlength?this.internals.setValidity({tooLong:!0},r.tooLong,e):e.validity?.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?t.t(r.rangeUnderflowMin,{min:this.min.toString()}):r.rangeUnderflow,e):e.validity?.stepMismatch?this.internals.setValidity({stepMismatch:!0},r.typeMismatch,e):e.validity?.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?t.t(r.rangeOverflowMax,{max:this.max.toString()}):r.rangeOverflow,e):e.validity?.customError?this.internals.setValidity({customError:!0},e.validationMessage,e):this.groupValidityMessage?this.internals.setValidity({customError:!0},this.groupValidityMessage,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.writeFormValue(t)}else this.writeFormValue(e)}}radioGroupMembers(){let e=this.getRootNode();if(typeof e.querySelectorAll!=`function`)return[];let t=this.form;return Array.from(e.querySelectorAll(`pkt-radiobutton, input[type="radio"]`)).filter(e=>e!==this&&e.getAttribute(`name`)===this.name&&e.form===t)}get valueLength(){return!this.multiple||Array.isArray(this.value)?this.value.length:this.value?this.value.split(Y).length:0}get isCheckable(){return this.type===`checkbox`||this.type===`radio`}checkableGroup(){return this.type===`radio`?[this,...this.radioGroupMembers()]:[this]}get isRequired(){return this.required||this.type===`radio`&&!!this.optionGroup?.required}checkableValueMissing(t){return this.type===`radio`?t.some(t=>t instanceof e?t.isRequired:t.required)&&!t.some(e=>X(e.checked)):this.required&&!X(this.checked)}syncCheckedState(){if(!this.internals)return;let e=X(this.checked);this.internals.ariaChecked=String(e),e?(this.writeFormValue((typeof this.value==`string`?this.value:``)||q),this.internals.states?.add(J)):(this.writeFormValue(null),this.internals.states?.delete(J)),this.inputRef?.value&&this.inputRef.value.checked!==e&&(this.inputRef.value.checked=e)}validateCheckable(){let t=this.checkableGroup();t.forEach(n=>{if(!(n instanceof e))return;let r=n;r.inputRef?.value&&r.manageValidity(r.inputRef.value,t)})}coordinateRadioGroup(){this.name&&this.type===`radio`&&this.radioGroupMembers().forEach(t=>{t instanceof e?X(t.checked)&&(t.checked=!1,t.syncCheckedState()):t.checked&&=!1})}valueChecked(e){this.touched&&(this.type===`radio`&&this.coordinateRadioGroup(),typeof e==`string`?this.checked=e===`true`:typeof e==`boolean`&&(this.checked=e),this.syncCheckedState(),this.validateCheckable(),this.onInput(),this.dispatchChangeEvents(this.checked))}warnInvalidValue(e){let t=typeof e==`object`?e?.constructor?.name??`object`:typeof e;console.warn(`${this.localName}: value må være en streng eller et tall, men fikk ${t}. Verdien ignoreres. For dato-/tidsfelt, send en ISO-formatert streng (f.eks. "2026-07-09" eller "13:45").`)}coerceToString(e){return typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):(e!=null&&this.warnInvalidValue(e),``)}valueChanged(e,t){let n=e;typeof n==`number`||typeof n==`boolean`?e=String(n):n!=null&&typeof n!=`string`&&!Array.isArray(n)&&this.warnInvalidValue(n),(t!==this.value||t!==this._value)&&(typeof e==`string`?((this.multiple||this.range)&&e.includes(Y)&&(e=e.split(Y)),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(Y)?e.split(Y):!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=this._defaultCheckedState,this.syncCheckedState(),this.validateCheckable();else{this.writeFormValue(``);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),this.isCheckable&&this._initialized&&(e.has(`defaultChecked`)&&e.get(`defaultChecked`)!==void 0&&(this._defaultCheckedState=!!this.defaultChecked),e.has(`groupContext`)&&this.isRequired&&(this.internals.ariaRequired=`true`),[`checked`,`value`,`required`,`name`,`groupContext`].some(t=>e.has(t))&&(this.syncCheckedState(),this.validateCheckable())),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`)))}willUpdate(e){super.willUpdate(e),e.has(`disabled`)&&this.toggleAttribute(`disabled`,this.disabled),this.syncGroupName(),!this._didInitDerivedState&&(this._didInitDerivedState=!0,this.defaultChecked&&(this.checked=!0),this.id&&!this.name&&(this.name=this.id,this.derivedName=this.id),this.value&&this.defaultValue===null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null))}firstUpdated(e){if(super.firstUpdated(e),this.defaultChecked&&(this.internals.ariaChecked=`true`),this.isRequired&&(this.internals.ariaRequired=`true`),this.disabled&&(this.internals.ariaDisabled=`true`),this.checked!==void 0){let e=X(this.checked);this._defaultCheckedState=e,this.internals.ariaChecked=String(e);let t=e?(typeof this.value==`string`?this.value:``)||q:null;this.writeFormValue(t)}else this.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute(`form`,``),this.isCheckable?this.validateCheckable():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:r.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:r.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:r.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`,hasChanged:(e,t)=>!!e&&e!==t})],$.prototype,`dataTestid`,void 0),e.n([e.l()],$.prototype,`formDisabled`,void 0),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return $}});
|
|
1
|
+
const e=require("./element-CEarCnHH.cjs"),t=require("./utils-63cRpWut.cjs");require("./shared-types-BvRk9kiK.cjs");const n=require("./booleanish-BF8l4scU.cjs"),r=require("./format-B8meU8Tm.cjs"),i=require("./element-with-slot-D_8fAzCW.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(E(e.target))},te=e=>{T(E(e.target))},ne=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()}})},re=e=>{let t=f.get(e.target);t&&t.size&&t.forEach(e=>{e.constructor.formAssociated&&e.formResetCallback&&e.formResetCallback.apply(e)})},ie=(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),ne(t),t.addEventListener(`reset`,re),t.addEventListener(`input`,ee),t.addEventListener(`change`,te)}u.set(t,{ref:e,internals:n}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout(()=>{e.formAssociatedCallback.apply(e,[t])},0),T(t)}},E=e=>{let t=e.parentNode;return t&&t.tagName!==`FORM`&&(t=E(t)),t},D=(e,t,n=DOMException)=>{if(!e.constructor.formAssociated)throw new n(t)},O=(e,t,n)=>{let r=f.get(e);return r&&r.size&&r.forEach(e=>{c.get(e)[n]()||(t=!1)}),t},k=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),ie(e,i,n)}return t};function A(){return typeof MutationObserver<`u`}var j={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`},ae=(e,t)=>{for(let n in j){t[n]=null;let r=null,i=j[n];Object.defineProperty(t,n,{get(){return r},set(n){r=n,e.isConnected?b(e,i,n):m.set(e,t)}})}},oe=(e,t)=>{s.set(t,[]),F.observe?.(e,P)};function M(e){let t=c.get(e),{form:n}=t;ie(e,n,t),w(e,t.labels)}var N=(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()},P={attributes:!0,attributeFilter:[`disabled`,`name`]},F=A()?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`&&N(e)),t.attributeName===`name`&&e.constructor.formAssociated){let t=c.get(e),n=p.get(e);t.setFormValue(n)}}}):{};function I(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&&M(e),m.has(e)){let t=m.get(e);Object.keys(j).filter(e=>t[e]!==null).forEach(n=>{b(e,j[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;)M(r),r=n.nextNode()}e.localName===`fieldset`&&(F.observe?.(e,P),N(e,!0))}),i.forEach(e=>{let t=c.get(e);t&&s.get(t)&&S(t),d.has(e)&&d.get(e).disconnect()})})}function se(e){e.forEach(e=>{let{removedNodes:t}=e;t.forEach(t=>{let n=_.get(e.target);c.has(t)&&k(t),n.disconnect()})})}var ce=e=>{let t=new MutationObserver(se);window?.ShadyDOM?.inUse&&e.mode&&e.host&&(e=e.host),t.observe?.(e,{childList:!0}),_.set(e,t)};A()&&new MutationObserver(I);var L={childList:!0,subtree:!0},le=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)}},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),de=(e,t,n)=>(e.valid=fe(t),Object.keys(t).forEach(n=>e[n]=t[n]),n&&T(n),e),fe=e=>{let t=!0;for(let n in e)n!==`valid`&&e[n]!==!1&&(t=!1);return t},R=new WeakMap;function z(e,t){e.toggleAttribute(t,!0),e.part&&e.part.add(t)}var B=class extends Set{static get isPolyfilled(){return!0}constructor(e){if(super(),!e||!e.tagName||e.tagName.indexOf(`-`)===-1)throw TypeError(`Illegal constructor`);R.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=R.get(this),r=`state${e}`;return n.isConnected?z(n,r):setTimeout(()=>{z(n,r)}),t}clear(){for(let[e]of this.entries())this.delete(e);super.clear()}delete(e){let t=super.delete(e),n=R.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}},pe=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},V=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)},H,me=class{constructor(e){H.set(this,void 0),pe(this,H,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 V(this,H,`f`).length}[(H=new WeakMap,Symbol.iterator)](){return V(this,H,`f`)[Symbol.iterator]()}item(e){return this[e]==null?null:this[e]}namedItem(e){return this[e]==null?null:this[e]}};function he(){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 O(this,n,`checkValidity`)}function r(...e){let n=t.apply(this,e);return O(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 me(Array.from(t).concat(n).sort((e,t)=>e.compareDocumentPosition?e.compareDocumentPosition(t)&2?1:-1:0))}})}var U=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 le;this.states=new B(e),a.set(this,e),o.set(this,n),c.set(e,this),ae(e,this),oe(e,this),Object.seal(this),t instanceof DocumentFragment&&ce(t)}checkValidity(){let e=a.get(this);if(D(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);D(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=E(e)),t}get labels(){let e=a.get(this);D(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(D(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(D(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(D(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&&ue(i);let c={...i,...s};delete c.valid;let{valid:u}=de(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 D(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 D(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 D(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 ge(){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 W=!1,G=!1;function K(e){G||(G=!0,window.CustomStateSet=B,e&&(HTMLElement.prototype.attachInternals=function(...t){let n=e.call(this,t);return n.states=new B(this),n}))}function _e(e=!0){let t=!1;if(!W){if(W=!0,typeof window<`u`&&(window.ElementInternals=U),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=k(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 U(this)}),typeof Element<`u`){function n(...t){let n=e.apply(this,t);if(h.set(this,n),A()){let e=new MutationObserver(I);window.ShadyDOM?e.observe(this,L):e.observe(n,L),d.set(this,e)}return n}let e=Element.prototype.attachShadow;Element.prototype.attachShadow=n}A()&&typeof document<`u`&&new MutationObserver(I).observe(document.documentElement,L),typeof HTMLFormElement<`u`&&he(),(e||typeof window<`u`&&!window.CustomStateSet)&&K()}}customElements.polyfillWrapFlushCallback||(ge()?typeof window<`u`&&!window.CustomStateSet&&K(HTMLElement.prototype.attachInternals):_e(!1));var q=`on`,J=`--checked`,Y=`,`,X=e=>e===!0||e===``||e===`true`,Z=new WeakMap,ve=0,ye=e=>{let t=Z.get(e);return t||(t=e.id||`form${++ve}`,Z.set(e,t)),t},Q=()=>!!globalThis.ElementInternals?.isPolyfilled,$=class e extends i.t{static get formAssociated(){return!0}get form(){let e=this.getAttribute(`form`);if(e!==null){if(!e)return null;let t=this.getRootNode(),n=typeof t.getElementById==`function`?t.getElementById(e):this.ownerDocument?.getElementById(e);return n instanceof HTMLFormElement?n:null}return this.internals?.form??this.closest(`form`)}get ariaDescribedBy(){return this.ariaDescribedby}set ariaDescribedBy(e){this.ariaDescribedby=e}formDisabledCallback(e){this.formDisabled=e}get isDisabled(){return this.disabled||this.formDisabled}get optionGroup(){return this.groupContext}setGroupValidity(e){this.groupValidityMessage!==e&&(this.groupValidityMessage=e,this.inputRef?.value&&this.manageValidity(this.inputRef.value))}syncGroupName(){let e=this.optionGroup?.name;if(!e)return;let t=!this.name||this.name===this.derivedName;t&&this.name!==e&&(this.name=e),t&&(this.derivedName=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=t.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.formDisabled=!1,this.derivedName=null,this.groupValidityMessage=``,this.touched=!1,this._initialized=!1,this.polyfillFormValue=null,this._didInitDerivedState=!1,this._defaultCheckedState=!1,this.internals=this.attachInternals()}connectedCallback(){super.connectedCallback(),Q()&&queueMicrotask(()=>{this.isConnected&&this.polyfillFormValue&&this.internals.setFormValue(this.polyfillFormValue.value)})}get internalName(){let e=this.form;return e?`${this.name}-internal-${ye(e)}`:`${this.name}-internal`}formAssociatedCallback(){this.requestUpdate()}writeFormValue(e){this.internals.setFormValue(e),Q()&&(this.polyfillFormValue={value:e})}manageValidity(e,t){if(!e){console.warn(`manageValidity called without valid input element`);return}let n=this.pktStrings.get(`validation`);(this.isCheckable?this.checkableValueMissing(t??this.checkableGroup()):this.required&&!this.value)?this.internals.setValidity(this.groupValidityMessage?{valueMissing:!0,customError:!0}:{valueMissing:!0},this.groupValidityMessage||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.valueLength<this.minlength?this.internals.setValidity({tooShort:!0},n.tooShort,e):e.validity?.tooLong||this.maxlength&&this.maxlength>0&&this.valueLength>this.maxlength?this.internals.setValidity({tooLong:!0},n.tooLong,e):e.validity?.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?r.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?r.t(n.rangeOverflowMax,{max:this.max.toString()}):n.rangeOverflow,e):e.validity?.customError?this.internals.setValidity({customError:!0},e.validationMessage,e):this.groupValidityMessage?this.internals.setValidity({customError:!0},this.groupValidityMessage,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.writeFormValue(t)}else this.writeFormValue(e)}}radioGroupMembers(){let e=this.getRootNode();if(typeof e.querySelectorAll!=`function`)return[];let t=this.form;return Array.from(e.querySelectorAll(`pkt-radiobutton, input[type="radio"]`)).filter(e=>e!==this&&e.getAttribute(`name`)===this.name&&e.form===t)}get valueLength(){return!this.multiple||Array.isArray(this.value)?this.value.length:this.value?this.value.split(Y).length:0}get isCheckable(){return this.type===`checkbox`||this.type===`radio`}checkableGroup(){return this.type===`radio`?[this,...this.radioGroupMembers()]:[this]}get isRequired(){return this.required||this.type===`radio`&&!!this.optionGroup?.required}checkableValueMissing(t){return this.type===`radio`?t.some(t=>t instanceof e?t.isRequired:t.required)&&!t.some(e=>X(e.checked)):this.required&&!X(this.checked)}syncCheckedState(){if(!this.internals)return;let e=X(this.checked);this.internals.ariaChecked=String(e),e?(this.writeFormValue((typeof this.value==`string`?this.value:``)||q),this.internals.states?.add(J)):(this.writeFormValue(null),this.internals.states?.delete(J)),this.inputRef?.value&&this.inputRef.value.checked!==e&&(this.inputRef.value.checked=e)}validateCheckable(){let t=this.checkableGroup();t.forEach(n=>{if(!(n instanceof e))return;let r=n;r.inputRef?.value&&r.manageValidity(r.inputRef.value,t)})}coordinateRadioGroup(){this.name&&this.type===`radio`&&this.radioGroupMembers().forEach(t=>{t instanceof e?X(t.checked)&&(t.checked=!1,t.syncCheckedState()):t.checked&&=!1})}valueChecked(e){this.touched&&(this.type===`radio`&&this.coordinateRadioGroup(),typeof e==`string`?this.checked=e===`true`:typeof e==`boolean`&&(this.checked=e),this.syncCheckedState(),this.validateCheckable(),this.onInput(),this.dispatchChangeEvents(this.checked))}warnInvalidValue(e){let t=typeof e==`object`?e?.constructor?.name??`object`:typeof e;console.warn(`${this.localName}: value må være en streng eller et tall, men fikk ${t}. Verdien ignoreres. For dato-/tidsfelt, send en ISO-formatert streng (f.eks. "2026-07-09" eller "13:45").`)}coerceToString(e){return typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):(e!=null&&this.warnInvalidValue(e),``)}valueChanged(e,t){let n=e;typeof n==`number`||typeof n==`boolean`?e=String(n):n!=null&&typeof n!=`string`&&!Array.isArray(n)&&this.warnInvalidValue(n),(t!==this.value||t!==this._value)&&(typeof e==`string`?((this.multiple||this.range)&&e.includes(Y)&&(e=e.split(Y)),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(Y)?e.split(Y):!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=this._defaultCheckedState,this.syncCheckedState(),this.validateCheckable();else{this.writeFormValue(``);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),this.isCheckable&&this._initialized&&(e.has(`defaultChecked`)&&e.get(`defaultChecked`)!==void 0&&(this._defaultCheckedState=!!this.defaultChecked),e.has(`groupContext`)&&this.isRequired&&(this.internals.ariaRequired=`true`),[`checked`,`value`,`required`,`name`,`groupContext`].some(t=>e.has(t))&&(this.syncCheckedState(),this.validateCheckable())),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`)))}willUpdate(e){super.willUpdate(e),e.has(`disabled`)&&this.toggleAttribute(`disabled`,this.disabled),this.syncGroupName(),this._didInitDerivedState||(this._didInitDerivedState=!0,this.defaultChecked&&(this.checked=!0),this.id&&!this.name&&(this.name=this.id,this.derivedName=this.id),this.value&&this.defaultValue===null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null))}firstUpdated(e){if(super.firstUpdated(e),this.defaultChecked&&(this.internals.ariaChecked=`true`),this.isRequired&&(this.internals.ariaRequired=`true`),this.disabled&&(this.internals.ariaDisabled=`true`),this.checked!==void 0){let e=X(this.checked);this._defaultCheckedState=e,this.internals.ariaChecked=String(e);let t=e?(typeof this.value==`string`?this.value:``)||q:null;this.writeFormValue(t)}else this.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute(`form`,``),this.isCheckable?this.validateCheckable():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:n.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:n.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:n.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`,hasChanged:(e,t)=>!!e&&e!==t})],$.prototype,`dataTestid`,void 0),e.n([e.l()],$.prototype,`formDisabled`,void 0),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return $}});
|