@oslokommune/punkt-elements 16.16.1 → 16.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/{accordion-nNH87Y60.js → accordion-CU2tJ5vn.js} +23 -9
- package/dist/{accordion-BB1JrONI.cjs → accordion-DDZkjXFb.cjs} +20 -7
- package/dist/{checkbox-Bjp43NxA.js → checkbox-BxNrOGUf.js} +1 -1
- package/dist/{checkbox-nTbihMxW.cjs → checkbox-rmSCYDgR.cjs} +1 -1
- package/dist/{combobox-C4Q6kQEs.cjs → combobox-C8Iwfalo.cjs} +1 -1
- package/dist/{combobox-CL9BLuxt.js → combobox-haqD3OH4.js} +3 -3
- package/dist/components/header-menu/header-menu.d.ts +41 -0
- package/dist/components/header-menu/header-menu.test.d.ts +0 -0
- package/dist/components/header-menu/index.d.ts +5 -0
- package/dist/components/header-menu/types.d.ts +6 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/{datepicker-BUK1Qanw.js → datepicker-DbkWEh8e.js} +2 -2
- package/dist/{datepicker-DYd3JCs_.cjs → datepicker-xZFsUaXB.cjs} +1 -1
- package/dist/docs/components/header-full.d.ts +13 -0
- package/dist/docs/components/header-menu.d.ts +8 -0
- package/dist/{fileupload-DbmqRkz3.js → fileupload-CTnjLOnj.js} +3 -3
- package/dist/{fileupload-DjUAvBcP.cjs → fileupload-D2z1Ngrt.cjs} +1 -1
- package/dist/{header-Dps8o-ZY.cjs → header-BHU7qpA_.cjs} +2 -2
- package/dist/{header-T5O6sfCN.js → header-Zqs7F1pI.js} +4 -3
- package/dist/header-menu-CPI1_5oZ.cjs +126 -0
- package/dist/header-menu-zhGYdnvz.js +319 -0
- package/dist/header-menu.d.ts +1 -0
- package/dist/{helptext-C5rG4VkA.js → helptext-BdqoW19r.js} +1 -1
- package/dist/{helptext-DQgStO4D.cjs → helptext-KWXjKljV.cjs} +1 -1
- package/dist/{input-element-CjebcQd1.js → input-element-B1ciW1N2.js} +1 -1
- package/dist/{input-element-FGcr5hGd.cjs → input-element-D0egtEnr.cjs} +1 -1
- package/dist/{input-wrapper-B_XFi211.cjs → input-wrapper-BJfspAt7.cjs} +1 -1
- package/dist/{input-wrapper-DBpMVSxt.js → input-wrapper-CGSrvrlb.js} +2 -2
- package/dist/{modal-DyIC3uhs.js → modal-DYc5M-Pn.js} +1 -1
- package/dist/{modal-B6591sWa.cjs → modal-J5uWdD1M.cjs} +1 -1
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +1 -1
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +1 -1
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +1 -1
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +1 -1
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +1 -1
- package/dist/pkt-fileupload.cjs +1 -1
- package/dist/pkt-fileupload.js +1 -1
- package/dist/pkt-header-menu.cjs +1 -0
- package/dist/pkt-header-menu.js +2 -0
- package/dist/pkt-header.cjs +1 -1
- package/dist/pkt-header.js +1 -1
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +23 -22
- package/dist/pkt-input-wrapper.cjs +1 -1
- package/dist/pkt-input-wrapper.js +1 -1
- package/dist/pkt-link.cjs +1 -1
- package/dist/pkt-link.js +1 -1
- package/dist/pkt-linkcard.cjs +1 -1
- package/dist/pkt-linkcard.js +1 -1
- package/dist/pkt-loader.cjs +1 -1
- package/dist/pkt-loader.js +1 -1
- package/dist/pkt-messagebox.cjs +1 -1
- package/dist/pkt-messagebox.js +1 -1
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +1 -1
- package/dist/pkt-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +1 -1
- package/dist/pkt-radiobutton.cjs +1 -1
- package/dist/pkt-radiobutton.js +1 -1
- package/dist/pkt-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-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/{radiobutton-DvXr7tDk.cjs → radiobutton-Crl2w27S.cjs} +1 -1
- package/dist/{radiobutton-B-8-wWFf.js → radiobutton-CzNQ4OLz.js} +1 -1
- package/dist/{select-B75wzvyz.cjs → select-BvlbaxYf.cjs} +1 -1
- package/dist/{select-D9B8Ighz.js → select-DpxXnNje.js} +3 -3
- package/dist/shared-types/header-menu.d.ts +108 -0
- package/dist/shared-types/index.d.ts +2 -0
- package/dist/shared-types/skin.d.ts +1 -1
- package/dist/shared-utils/header-menu/example-data.d.ts +11 -0
- package/dist/shared-utils/header-menu/fetch-header-footer-data.d.ts +12 -0
- package/dist/shared-utils/header-menu/icon-map.d.ts +34 -0
- package/dist/shared-utils/header-menu/index.d.ts +11 -0
- package/dist/shared-utils/header-menu/select-megamenu.d.ts +16 -0
- package/dist/{textarea-CIWXMaAD.js → textarea-BgsX_PHm.js} +2 -2
- package/dist/{textarea-CjqprL6Y.cjs → textarea-BjQ_37ji.cjs} +1 -1
- package/dist/{textinput-CxzAxM8E.js → textinput-BmuQREJY.js} +2 -2
- package/dist/{textinput-B0VWmVIF.cjs → textinput-mjmYIwxr.cjs} +1 -1
- package/dist/{timepicker-DXrpg5C7.js → timepicker-Bj_esO1U.js} +2 -2
- package/dist/{timepicker-Cv9juQeB.cjs → timepicker-C7vU_hTg.cjs} +1 -1
- package/package.json +2 -2
- package/src/components/accordion/accordionitem.ts +22 -5
- package/src/components/header/header-service.ts +1 -0
- package/src/components/header-menu/header-menu.test.ts +314 -0
- package/src/components/header-menu/header-menu.ts +401 -0
- package/src/components/header-menu/index.ts +6 -0
- package/src/components/header-menu/types.ts +31 -0
- package/src/components/index.ts +3 -0
- /package/dist/{consent-f_IGyHss.js → consent-CsX3DABo.js} +0 -0
- /package/dist/{consent-zh2npq2K.cjs → consent-DjXqLn2K.cjs} +0 -0
- /package/dist/{dialog-polyfill.esm-CXDsb3l-.cjs → dialog-polyfill.esm-C6RtqFbz.cjs} +0 -0
- /package/dist/{dialog-polyfill.esm-BmVHGRTX.js → dialog-polyfill.esm-DrODM08x.js} +0 -0
- /package/dist/{input-wrapper-CYCCx8MP.cjs → input-wrapper-CQGoyLdZ.cjs} +0 -0
- /package/dist/{input-wrapper-kw2y6Jp_.js → input-wrapper-DwSsP39J.js} +0 -0
- /package/dist/{link-B8zYc5WK.cjs → link-H7BhqdWV.cjs} +0 -0
- /package/dist/{link-CjJcwcxR.js → link-X9H6zi7W.js} +0 -0
- /package/dist/{linkcard-Ddh5R_L-.js → linkcard-CSWzphQK.js} +0 -0
- /package/dist/{linkcard-C4x-NJMi.cjs → linkcard-zS3WuhAY.cjs} +0 -0
- /package/dist/{loader-DeizpX45.js → loader-B4EGLEoa.js} +0 -0
- /package/dist/{loader-CGQXAuyM.cjs → loader-BWcSsK7i.cjs} +0 -0
- /package/dist/{messagebox-Ccu29rDv.cjs → messagebox-BSvU998N.cjs} +0 -0
- /package/dist/{messagebox-DqoPqo4K.js → messagebox-DsrTKauA.js} +0 -0
- /package/dist/{pkt-options-controller-DbLrdRwH.js → pkt-options-controller-CCB15L_G.js} +0 -0
- /package/dist/{pkt-options-controller-BPBb_O2K.cjs → pkt-options-controller-CeAQ-D-i.cjs} +0 -0
- /package/dist/{progressbar-CrwpnIkv.cjs → progressbar-8RYeaOQe.cjs} +0 -0
- /package/dist/{progressbar-uC-0W6o4.js → progressbar-hQSIzdof.js} +0 -0
- /package/dist/{tabs-RnDtIFv3.cjs → tabs-CDLdEDGH.cjs} +0 -0
- /package/dist/{tabs-4eWA7CsK.js → tabs-DDBYA5c8.js} +0 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
const e=require(`./element-DjtxO-1r.cjs`),t=require(`./class-map-CJ-msbHs.cjs`);require(`./icon-Dr8sfT2X.cjs`),require(`./accordion-DDZkjXFb.cjs`);const n=require(`./booleanish-B5EFqFpJ.cjs`);var r=`https://cdn.web.oslo.kommune.no/header-footer/header-footer.json`,i={automat:`parking-meter`,bike:`bicycle`,corona:`virus`,directions:`arrow-directions`,document:`document-plain`,"download-document":`document-download`,elcar:`electric-car`,"error-hexa":`alert-error`,"fire-emblem":`shield-fire`,"link-arrow":`arrow-link`,"linked-in":`linkedin`,"map-layer":`map-layers`,mobile:`mobile-phone`,neutral:`smiley-neutral`,placeholder:`placeholder-icon`,sad:`smiley-sad`,signing:`signature`,sky:`cloud`,smile:`smiley-smile`,"success-square":`alert-success`,trash:`trash-can`,treatment:`processing`,"warning-triangle":`alert-warning`};function a(e){return e&&(i[e]??e)}var o={"facebook.com":`facebook`,"fb.com":`facebook`,"instagram.com":`instagram`,"linkedin.com":`linkedin`,"x.com":`x`,"github.com":`github`};function s(e){return e.toLowerCase().replace(/^(?:www|m)\./,``)}function c(e,t){if(e)try{let t=o[s(new URL(e).hostname)];if(t)return t}catch{}if(t){let e=t.trim().toLowerCase().replace(/\s+/g,`-`);if(e){let t=a(e);if(t)return t}}}var l=`nb-NO`;function u(e,t=l){if(e)return e[t]??e[l]}async function d(e=r,t){let n=await fetch(e,{signal:t});if(!n.ok)throw Error(`pkt-header-menu: failed to fetch ${e} (HTTP ${n.status})`);let i=await n.json();if(!i||typeof i!=`object`)throw Error(`pkt-header-menu: ${e} returned a non-object payload`);return i}var f=class extends e.t{constructor(...e){super(...e),this.dataUrl=r,this.locale=`nb-NO`,this.open=!1,this.ariaLabelledBy=``,this.mobileBreakpoint=768,this.loadState=`idle`,this.isMobile=!1,this.handleMediaChange=e=>{this.isMobile=e.matches}}connectedCallback(){super.connectedCallback(),this.classList.add(`pkt-header-menu`),this.updateOpenClass(),this.setupMediaQuery(),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.teardownMediaQuery()}updated(e){super.updated(e),e.has(`open`)&&this.updateOpenClass(),e.has(`mobileBreakpoint`)&&e.get(`mobileBreakpoint`)!==void 0&&this.setupMediaQuery(),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})))}setupMediaQuery(){this.teardownMediaQuery(),!(typeof window>`u`||typeof window.matchMedia!=`function`)&&(this.mediaQuery=window.matchMedia(`(max-width: ${this.mobileBreakpoint-1}px)`),this.isMobile=this.mediaQuery.matches,this.mediaQuery.addEventListener(`change`,this.handleMediaChange))}teardownMediaQuery(){this.mediaQuery?.removeEventListener(`change`,this.handleMediaChange),this.mediaQuery=void 0}async loadData(){this.abortController?.abort(),this.abortController=new AbortController,this.loadState=`loading`;try{let e=await d(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 u(this.effectiveData,this.locale)}render(){if(this.loadState===`loading`)return e.d`
|
|
2
|
+
<nav aria-busy="true">
|
|
3
|
+
<p class="pkt-header-menu__loading">Laster meny…</p>
|
|
4
|
+
</nav>
|
|
5
|
+
`;if(this.loadState===`error`||!this.localeData)return e.d`
|
|
6
|
+
<nav aria-hidden=${!this.open}>
|
|
7
|
+
<p class="pkt-header-menu__error">Kunne ikke laste meny.</p>
|
|
8
|
+
</nav>
|
|
9
|
+
`;let{megamenu:t,i18n:n}=this.localeData,r=n?.navAriaLabel||`Hovedmeny`;return this.isMobile?e.d`
|
|
10
|
+
<nav aria-label=${r}>
|
|
11
|
+
${this.renderMobileAccordion(t.services,t.sections)}
|
|
12
|
+
${this.renderButtons(t.buttons,!0)}
|
|
13
|
+
${this.renderFooter(t.links,t.some)}
|
|
14
|
+
</nav>
|
|
15
|
+
`:e.d`
|
|
16
|
+
<nav aria-label=${r}>
|
|
17
|
+
${this.renderServices(t.services)} ${this.renderButtons(t.buttons,!1)}
|
|
18
|
+
${this.renderSections(t.sections)}
|
|
19
|
+
${this.renderFooter(t.links,t.some)}
|
|
20
|
+
</nav>
|
|
21
|
+
`}renderMobileAccordion(t,n){return e.d`
|
|
22
|
+
<div class="pkt-header-menu__sections">
|
|
23
|
+
<pkt-accordion
|
|
24
|
+
class="pkt-header-menu__sections-inner"
|
|
25
|
+
skin="plus-minus"
|
|
26
|
+
name="header-menu-accordion"
|
|
27
|
+
>
|
|
28
|
+
<pkt-accordion-item
|
|
29
|
+
class="pkt-header-menu__section"
|
|
30
|
+
skin="plus-minus"
|
|
31
|
+
id="pkt-header-menu-services"
|
|
32
|
+
title=${t.title}
|
|
33
|
+
>
|
|
34
|
+
${this.renderServicesList(t)}
|
|
35
|
+
</pkt-accordion-item>
|
|
36
|
+
${n.map((t,n)=>e.d`
|
|
37
|
+
<pkt-accordion-item
|
|
38
|
+
class="pkt-header-menu__section"
|
|
39
|
+
skin="plus-minus"
|
|
40
|
+
id=${`pkt-header-menu-section-${n}`}
|
|
41
|
+
title=${t.title}
|
|
42
|
+
>
|
|
43
|
+
${this.renderSectionList(t.links)}
|
|
44
|
+
</pkt-accordion-item>
|
|
45
|
+
`)}
|
|
46
|
+
</pkt-accordion>
|
|
47
|
+
</div>
|
|
48
|
+
`}renderServicesList(t){return e.d`
|
|
49
|
+
<ul class="pkt-header-menu__services-list">
|
|
50
|
+
${t.links.map(t=>e.d`
|
|
51
|
+
<li class="pkt-header-menu__service">
|
|
52
|
+
<a class="pkt-header-menu__service-link" href=${t.url}>
|
|
53
|
+
<pkt-icon
|
|
54
|
+
class="pkt-header-menu__service-icon"
|
|
55
|
+
name=${a(t.icon)}
|
|
56
|
+
aria-hidden="true"
|
|
57
|
+
></pkt-icon>
|
|
58
|
+
<span class="pkt-header-menu__service-text">${t.text}</span>
|
|
59
|
+
</a>
|
|
60
|
+
</li>
|
|
61
|
+
`)}
|
|
62
|
+
</ul>
|
|
63
|
+
`}renderServices(t){return e.d`
|
|
64
|
+
<div class="pkt-header-menu__services">
|
|
65
|
+
<h2 class="pkt-header-menu__services-title">${t.title}</h2>
|
|
66
|
+
${this.renderServicesList(t)}
|
|
67
|
+
</div>
|
|
68
|
+
`}renderButtons(n,r){return!n||n.length===0?e.l:e.d`
|
|
69
|
+
<div class=${t.t({"pkt-header-menu__buttons":!0,"pkt-header-menu__buttons--mobile":r})}>
|
|
70
|
+
${n.map(t=>e.d`
|
|
71
|
+
<a
|
|
72
|
+
class="pkt-btn pkt-btn--secondary pkt-btn--icon-right pkt-btn--small"
|
|
73
|
+
href=${t.url}
|
|
74
|
+
>
|
|
75
|
+
<pkt-icon
|
|
76
|
+
class="pkt-btn__icon"
|
|
77
|
+
name=${t.iconName?a(t.iconName):`user`}
|
|
78
|
+
aria-hidden="true"
|
|
79
|
+
></pkt-icon>
|
|
80
|
+
<span class="pkt-btn__text">${t.text}</span>
|
|
81
|
+
</a>
|
|
82
|
+
`)}
|
|
83
|
+
</div>
|
|
84
|
+
`}renderSections(t){return!t||t.length===0?e.l:e.d`
|
|
85
|
+
<div class="pkt-header-menu__sections">
|
|
86
|
+
<div class="pkt-header-menu__sections-inner">
|
|
87
|
+
${t.map(t=>e.d`
|
|
88
|
+
<div class="pkt-header-menu__section">
|
|
89
|
+
<h2 class="pkt-header-menu__section-title">${t.title}</h2>
|
|
90
|
+
${this.renderSectionList(t.links)}
|
|
91
|
+
</div>
|
|
92
|
+
`)}
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
`}renderSectionList(t){return e.d`
|
|
96
|
+
<ul class="pkt-header-menu__section-list">
|
|
97
|
+
${t.map(t=>e.d`
|
|
98
|
+
<li>
|
|
99
|
+
<a class="pkt-header-menu__section-link" href=${t.url}>${t.text}</a>
|
|
100
|
+
</li>
|
|
101
|
+
`)}
|
|
102
|
+
</ul>
|
|
103
|
+
`}renderFooter(t,n){return(!t||t.length===0)&&(!n||n.length===0)?e.l:e.d`
|
|
104
|
+
<div class="pkt-header-menu__footer">
|
|
105
|
+
${t&&t.length>0?e.d`
|
|
106
|
+
<ul class="pkt-header-menu__footer-list">
|
|
107
|
+
${t.map(t=>e.d`
|
|
108
|
+
<li>
|
|
109
|
+
<a class="pkt-header-menu__footer-link" href=${t.url}>${t.text}</a>
|
|
110
|
+
</li>
|
|
111
|
+
`)}
|
|
112
|
+
</ul>
|
|
113
|
+
`:e.l}
|
|
114
|
+
${n&&n.length>0?e.d`
|
|
115
|
+
<ul class="pkt-header-menu__footer-list pkt-header-menu__footer-list--social">
|
|
116
|
+
${n.map(e=>this.renderSocialLink(e))}
|
|
117
|
+
</ul>
|
|
118
|
+
`:e.l}
|
|
119
|
+
</div>
|
|
120
|
+
`}renderSocialLink(t){let n=c(t.url,t.text);return e.d`
|
|
121
|
+
<li>
|
|
122
|
+
<a class="pkt-header-menu__social-link" href=${t.url} aria-label=${t.text}>
|
|
123
|
+
${n?e.d`<pkt-icon name=${n} aria-hidden="true"></pkt-icon>`:e.d`<span>${t.text}</span>`}
|
|
124
|
+
</a>
|
|
125
|
+
</li>
|
|
126
|
+
`}};e.r([e.s({type:String,attribute:`data-url`})],f.prototype,`dataUrl`,void 0),e.r([e.s({type:Object,attribute:!1})],f.prototype,`data`,void 0),e.r([e.s({type:String})],f.prototype,`locale`,void 0),e.r([e.s({type:Boolean,reflect:!0,converter:n.t})],f.prototype,`open`,void 0),e.r([e.s({type:String,attribute:`aria-labelledby`,reflect:!0})],f.prototype,`ariaLabelledBy`,void 0),e.r([e.s({type:Number,attribute:`mobile-breakpoint`})],f.prototype,`mobileBreakpoint`,void 0),e.r([e.o()],f.prototype,`loadState`,void 0),e.r([e.o()],f.prototype,`fetchedData`,void 0),e.r([e.o()],f.prototype,`isMobile`,void 0);try{e.c(`pkt-header-menu`)(f)}catch{console.warn(`Forsøker å definere <pkt-header-menu>, men den er allerede definert`)}var p=f;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return p}});
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { c as e, d as t, l as n, o as r, r as i, s as a, t as o } from "./element-cZ85T_aa.js";
|
|
2
|
+
import { t as s } from "./class-map-C8HuhNzZ.js";
|
|
3
|
+
import "./icon-Co72KtgF.js";
|
|
4
|
+
import "./accordion-CU2tJ5vn.js";
|
|
5
|
+
import { t as c } from "./booleanish-CRaKZ75t.js";
|
|
6
|
+
//#region ../../shared-types/header-menu.ts
|
|
7
|
+
var l = "https://cdn.web.oslo.kommune.no/header-footer/header-footer.json", u = {
|
|
8
|
+
automat: "parking-meter",
|
|
9
|
+
bike: "bicycle",
|
|
10
|
+
corona: "virus",
|
|
11
|
+
directions: "arrow-directions",
|
|
12
|
+
document: "document-plain",
|
|
13
|
+
"download-document": "document-download",
|
|
14
|
+
elcar: "electric-car",
|
|
15
|
+
"error-hexa": "alert-error",
|
|
16
|
+
"fire-emblem": "shield-fire",
|
|
17
|
+
"link-arrow": "arrow-link",
|
|
18
|
+
"linked-in": "linkedin",
|
|
19
|
+
"map-layer": "map-layers",
|
|
20
|
+
mobile: "mobile-phone",
|
|
21
|
+
neutral: "smiley-neutral",
|
|
22
|
+
placeholder: "placeholder-icon",
|
|
23
|
+
sad: "smiley-sad",
|
|
24
|
+
signing: "signature",
|
|
25
|
+
sky: "cloud",
|
|
26
|
+
smile: "smiley-smile",
|
|
27
|
+
"success-square": "alert-success",
|
|
28
|
+
trash: "trash-can",
|
|
29
|
+
treatment: "processing",
|
|
30
|
+
"warning-triangle": "alert-warning"
|
|
31
|
+
};
|
|
32
|
+
function d(e) {
|
|
33
|
+
return e && (u[e] ?? e);
|
|
34
|
+
}
|
|
35
|
+
var f = {
|
|
36
|
+
"facebook.com": "facebook",
|
|
37
|
+
"fb.com": "facebook",
|
|
38
|
+
"instagram.com": "instagram",
|
|
39
|
+
"linkedin.com": "linkedin",
|
|
40
|
+
"x.com": "x",
|
|
41
|
+
"github.com": "github"
|
|
42
|
+
};
|
|
43
|
+
function p(e) {
|
|
44
|
+
return e.toLowerCase().replace(/^(?:www|m)\./, "");
|
|
45
|
+
}
|
|
46
|
+
function m(e, t) {
|
|
47
|
+
if (e) try {
|
|
48
|
+
let t = f[p(new URL(e).hostname)];
|
|
49
|
+
if (t) return t;
|
|
50
|
+
} catch {}
|
|
51
|
+
if (t) {
|
|
52
|
+
let e = t.trim().toLowerCase().replace(/\s+/g, "-");
|
|
53
|
+
if (e) {
|
|
54
|
+
let t = d(e);
|
|
55
|
+
if (t) return t;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region ../../shared-utils/header-menu/select-megamenu.ts
|
|
61
|
+
var h = "nb-NO";
|
|
62
|
+
function g(e, t = h) {
|
|
63
|
+
if (e) return e[t] ?? e[h];
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region ../../shared-utils/header-menu/fetch-header-footer-data.ts
|
|
67
|
+
async function _(e = l, t) {
|
|
68
|
+
let n = await fetch(e, { signal: t });
|
|
69
|
+
if (!n.ok) throw Error(`pkt-header-menu: failed to fetch ${e} (HTTP ${n.status})`);
|
|
70
|
+
let r = await n.json();
|
|
71
|
+
if (!r || typeof r != "object") throw Error(`pkt-header-menu: ${e} returned a non-object payload`);
|
|
72
|
+
return r;
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/components/header-menu/header-menu.ts
|
|
76
|
+
var v = class extends o {
|
|
77
|
+
constructor(...e) {
|
|
78
|
+
super(...e), this.dataUrl = l, this.locale = "nb-NO", this.open = !1, this.ariaLabelledBy = "", this.mobileBreakpoint = 768, this.loadState = "idle", this.isMobile = !1, this.handleMediaChange = (e) => {
|
|
79
|
+
this.isMobile = e.matches;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
connectedCallback() {
|
|
83
|
+
super.connectedCallback(), this.classList.add("pkt-header-menu"), this.updateOpenClass(), this.setupMediaQuery(), this.data ? (this.loadState = "ready", this.dispatchEvent(new CustomEvent("data-loaded", {
|
|
84
|
+
detail: { data: this.data },
|
|
85
|
+
bubbles: !0,
|
|
86
|
+
composed: !0
|
|
87
|
+
}))) : this.loadData();
|
|
88
|
+
}
|
|
89
|
+
updateOpenClass() {
|
|
90
|
+
this.classList.toggle("pkt-header-menu--open", !!this.open);
|
|
91
|
+
}
|
|
92
|
+
disconnectedCallback() {
|
|
93
|
+
super.disconnectedCallback(), this.abortController?.abort(), this.teardownMediaQuery();
|
|
94
|
+
}
|
|
95
|
+
updated(e) {
|
|
96
|
+
super.updated(e), e.has("open") && this.updateOpenClass(), e.has("mobileBreakpoint") && e.get("mobileBreakpoint") !== void 0 && this.setupMediaQuery(), 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", {
|
|
97
|
+
detail: { data: this.data },
|
|
98
|
+
bubbles: !0,
|
|
99
|
+
composed: !0
|
|
100
|
+
})));
|
|
101
|
+
}
|
|
102
|
+
setupMediaQuery() {
|
|
103
|
+
this.teardownMediaQuery(), !(typeof window > "u" || typeof window.matchMedia != "function") && (this.mediaQuery = window.matchMedia(`(max-width: ${this.mobileBreakpoint - 1}px)`), this.isMobile = this.mediaQuery.matches, this.mediaQuery.addEventListener("change", this.handleMediaChange));
|
|
104
|
+
}
|
|
105
|
+
teardownMediaQuery() {
|
|
106
|
+
this.mediaQuery?.removeEventListener("change", this.handleMediaChange), this.mediaQuery = void 0;
|
|
107
|
+
}
|
|
108
|
+
async loadData() {
|
|
109
|
+
this.abortController?.abort(), this.abortController = new AbortController(), this.loadState = "loading";
|
|
110
|
+
try {
|
|
111
|
+
let e = await _(this.dataUrl, this.abortController.signal);
|
|
112
|
+
this.fetchedData = e, this.loadState = "ready", this.dispatchEvent(new CustomEvent("data-loaded", {
|
|
113
|
+
detail: { data: e },
|
|
114
|
+
bubbles: !0,
|
|
115
|
+
composed: !0
|
|
116
|
+
}));
|
|
117
|
+
} catch (e) {
|
|
118
|
+
if (e.name === "AbortError") return;
|
|
119
|
+
this.loadState = "error", this.dispatchEvent(new CustomEvent("data-error", {
|
|
120
|
+
detail: { error: e },
|
|
121
|
+
bubbles: !0,
|
|
122
|
+
composed: !0
|
|
123
|
+
}));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
get effectiveData() {
|
|
127
|
+
return this.data ?? this.fetchedData;
|
|
128
|
+
}
|
|
129
|
+
get localeData() {
|
|
130
|
+
return g(this.effectiveData, this.locale);
|
|
131
|
+
}
|
|
132
|
+
render() {
|
|
133
|
+
if (this.loadState === "loading") return t`
|
|
134
|
+
<nav aria-busy="true">
|
|
135
|
+
<p class="pkt-header-menu__loading">Laster meny…</p>
|
|
136
|
+
</nav>
|
|
137
|
+
`;
|
|
138
|
+
if (this.loadState === "error" || !this.localeData) return t`
|
|
139
|
+
<nav aria-hidden=${!this.open}>
|
|
140
|
+
<p class="pkt-header-menu__error">Kunne ikke laste meny.</p>
|
|
141
|
+
</nav>
|
|
142
|
+
`;
|
|
143
|
+
let { megamenu: e, i18n: n } = this.localeData, r = n?.navAriaLabel || "Hovedmeny";
|
|
144
|
+
return this.isMobile ? t`
|
|
145
|
+
<nav aria-label=${r}>
|
|
146
|
+
${this.renderMobileAccordion(e.services, e.sections)}
|
|
147
|
+
${this.renderButtons(e.buttons, !0)}
|
|
148
|
+
${this.renderFooter(e.links, e.some)}
|
|
149
|
+
</nav>
|
|
150
|
+
` : t`
|
|
151
|
+
<nav aria-label=${r}>
|
|
152
|
+
${this.renderServices(e.services)} ${this.renderButtons(e.buttons, !1)}
|
|
153
|
+
${this.renderSections(e.sections)}
|
|
154
|
+
${this.renderFooter(e.links, e.some)}
|
|
155
|
+
</nav>
|
|
156
|
+
`;
|
|
157
|
+
}
|
|
158
|
+
renderMobileAccordion(e, n) {
|
|
159
|
+
return t`
|
|
160
|
+
<div class="pkt-header-menu__sections">
|
|
161
|
+
<pkt-accordion
|
|
162
|
+
class="pkt-header-menu__sections-inner"
|
|
163
|
+
skin="plus-minus"
|
|
164
|
+
name="header-menu-accordion"
|
|
165
|
+
>
|
|
166
|
+
<pkt-accordion-item
|
|
167
|
+
class="pkt-header-menu__section"
|
|
168
|
+
skin="plus-minus"
|
|
169
|
+
id="pkt-header-menu-services"
|
|
170
|
+
title=${e.title}
|
|
171
|
+
>
|
|
172
|
+
${this.renderServicesList(e)}
|
|
173
|
+
</pkt-accordion-item>
|
|
174
|
+
${n.map((e, n) => t`
|
|
175
|
+
<pkt-accordion-item
|
|
176
|
+
class="pkt-header-menu__section"
|
|
177
|
+
skin="plus-minus"
|
|
178
|
+
id=${`pkt-header-menu-section-${n}`}
|
|
179
|
+
title=${e.title}
|
|
180
|
+
>
|
|
181
|
+
${this.renderSectionList(e.links)}
|
|
182
|
+
</pkt-accordion-item>
|
|
183
|
+
`)}
|
|
184
|
+
</pkt-accordion>
|
|
185
|
+
</div>
|
|
186
|
+
`;
|
|
187
|
+
}
|
|
188
|
+
renderServicesList(e) {
|
|
189
|
+
return t`
|
|
190
|
+
<ul class="pkt-header-menu__services-list">
|
|
191
|
+
${e.links.map((e) => t`
|
|
192
|
+
<li class="pkt-header-menu__service">
|
|
193
|
+
<a class="pkt-header-menu__service-link" href=${e.url}>
|
|
194
|
+
<pkt-icon
|
|
195
|
+
class="pkt-header-menu__service-icon"
|
|
196
|
+
name=${d(e.icon)}
|
|
197
|
+
aria-hidden="true"
|
|
198
|
+
></pkt-icon>
|
|
199
|
+
<span class="pkt-header-menu__service-text">${e.text}</span>
|
|
200
|
+
</a>
|
|
201
|
+
</li>
|
|
202
|
+
`)}
|
|
203
|
+
</ul>
|
|
204
|
+
`;
|
|
205
|
+
}
|
|
206
|
+
renderServices(e) {
|
|
207
|
+
return t`
|
|
208
|
+
<div class="pkt-header-menu__services">
|
|
209
|
+
<h2 class="pkt-header-menu__services-title">${e.title}</h2>
|
|
210
|
+
${this.renderServicesList(e)}
|
|
211
|
+
</div>
|
|
212
|
+
`;
|
|
213
|
+
}
|
|
214
|
+
renderButtons(e, r) {
|
|
215
|
+
return !e || e.length === 0 ? n : t`
|
|
216
|
+
<div class=${s({
|
|
217
|
+
"pkt-header-menu__buttons": !0,
|
|
218
|
+
"pkt-header-menu__buttons--mobile": r
|
|
219
|
+
})}>
|
|
220
|
+
${e.map((e) => t`
|
|
221
|
+
<a
|
|
222
|
+
class="pkt-btn pkt-btn--secondary pkt-btn--icon-right pkt-btn--small"
|
|
223
|
+
href=${e.url}
|
|
224
|
+
>
|
|
225
|
+
<pkt-icon
|
|
226
|
+
class="pkt-btn__icon"
|
|
227
|
+
name=${e.iconName ? d(e.iconName) : "user"}
|
|
228
|
+
aria-hidden="true"
|
|
229
|
+
></pkt-icon>
|
|
230
|
+
<span class="pkt-btn__text">${e.text}</span>
|
|
231
|
+
</a>
|
|
232
|
+
`)}
|
|
233
|
+
</div>
|
|
234
|
+
`;
|
|
235
|
+
}
|
|
236
|
+
renderSections(e) {
|
|
237
|
+
return !e || e.length === 0 ? n : t`
|
|
238
|
+
<div class="pkt-header-menu__sections">
|
|
239
|
+
<div class="pkt-header-menu__sections-inner">
|
|
240
|
+
${e.map((e) => t`
|
|
241
|
+
<div class="pkt-header-menu__section">
|
|
242
|
+
<h2 class="pkt-header-menu__section-title">${e.title}</h2>
|
|
243
|
+
${this.renderSectionList(e.links)}
|
|
244
|
+
</div>
|
|
245
|
+
`)}
|
|
246
|
+
</div>
|
|
247
|
+
</div>
|
|
248
|
+
`;
|
|
249
|
+
}
|
|
250
|
+
renderSectionList(e) {
|
|
251
|
+
return t`
|
|
252
|
+
<ul class="pkt-header-menu__section-list">
|
|
253
|
+
${e.map((e) => t`
|
|
254
|
+
<li>
|
|
255
|
+
<a class="pkt-header-menu__section-link" href=${e.url}>${e.text}</a>
|
|
256
|
+
</li>
|
|
257
|
+
`)}
|
|
258
|
+
</ul>
|
|
259
|
+
`;
|
|
260
|
+
}
|
|
261
|
+
renderFooter(e, r) {
|
|
262
|
+
return (!e || e.length === 0) && (!r || r.length === 0) ? n : t`
|
|
263
|
+
<div class="pkt-header-menu__footer">
|
|
264
|
+
${e && e.length > 0 ? t`
|
|
265
|
+
<ul class="pkt-header-menu__footer-list">
|
|
266
|
+
${e.map((e) => t`
|
|
267
|
+
<li>
|
|
268
|
+
<a class="pkt-header-menu__footer-link" href=${e.url}>${e.text}</a>
|
|
269
|
+
</li>
|
|
270
|
+
`)}
|
|
271
|
+
</ul>
|
|
272
|
+
` : n}
|
|
273
|
+
${r && r.length > 0 ? t`
|
|
274
|
+
<ul class="pkt-header-menu__footer-list pkt-header-menu__footer-list--social">
|
|
275
|
+
${r.map((e) => this.renderSocialLink(e))}
|
|
276
|
+
</ul>
|
|
277
|
+
` : n}
|
|
278
|
+
</div>
|
|
279
|
+
`;
|
|
280
|
+
}
|
|
281
|
+
renderSocialLink(e) {
|
|
282
|
+
let n = m(e.url, e.text);
|
|
283
|
+
return t`
|
|
284
|
+
<li>
|
|
285
|
+
<a class="pkt-header-menu__social-link" href=${e.url} aria-label=${e.text}>
|
|
286
|
+
${n ? t`<pkt-icon name=${n} aria-hidden="true"></pkt-icon>` : t`<span>${e.text}</span>`}
|
|
287
|
+
</a>
|
|
288
|
+
</li>
|
|
289
|
+
`;
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
i([a({
|
|
293
|
+
type: String,
|
|
294
|
+
attribute: "data-url"
|
|
295
|
+
})], v.prototype, "dataUrl", void 0), i([a({
|
|
296
|
+
type: Object,
|
|
297
|
+
attribute: !1
|
|
298
|
+
})], v.prototype, "data", void 0), i([a({ type: String })], v.prototype, "locale", void 0), i([a({
|
|
299
|
+
type: Boolean,
|
|
300
|
+
reflect: !0,
|
|
301
|
+
converter: c
|
|
302
|
+
})], v.prototype, "open", void 0), i([a({
|
|
303
|
+
type: String,
|
|
304
|
+
attribute: "aria-labelledby",
|
|
305
|
+
reflect: !0
|
|
306
|
+
})], v.prototype, "ariaLabelledBy", void 0), i([a({
|
|
307
|
+
type: Number,
|
|
308
|
+
attribute: "mobile-breakpoint"
|
|
309
|
+
})], v.prototype, "mobileBreakpoint", void 0), i([r()], v.prototype, "loadState", void 0), i([r()], v.prototype, "fetchedData", void 0), i([r()], v.prototype, "isMobile", void 0);
|
|
310
|
+
try {
|
|
311
|
+
e("pkt-header-menu")(v);
|
|
312
|
+
} catch {
|
|
313
|
+
console.warn("Forsøker å definere <pkt-header-menu>, men den er allerede definert");
|
|
314
|
+
}
|
|
315
|
+
//#endregion
|
|
316
|
+
//#region src/components/header-menu/index.ts
|
|
317
|
+
var y = v;
|
|
318
|
+
//#endregion
|
|
319
|
+
export { v as n, y as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -3,7 +3,7 @@ import { t as o } from "./class-map-C8HuhNzZ.js";
|
|
|
3
3
|
import { n as s, t as c } from "./element-with-slot-4J2o3SeU.js";
|
|
4
4
|
import { r as l } from "./icon-Co72KtgF.js";
|
|
5
5
|
import { n as u } from "./utils-BOOZ0ppt.js";
|
|
6
|
-
import { t as d } from "./input-wrapper-
|
|
6
|
+
import { t as d } from "./input-wrapper-DwSsP39J.js";
|
|
7
7
|
//#region src/components/helptext/helptext.ts
|
|
8
8
|
var f = class extends c {
|
|
9
9
|
constructor(...e) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require(`./element-DjtxO-1r.cjs`),t=require(`./class-map-CJ-msbHs.cjs`),n=require(`./element-with-slot-CWoTGA1B.cjs`),r=require(`./icon-Dr8sfT2X.cjs`),i=require(`./utils-CM67Oudc.cjs`),a=require(`./input-wrapper-
|
|
1
|
+
const e=require(`./element-DjtxO-1r.cjs`),t=require(`./class-map-CJ-msbHs.cjs`),n=require(`./element-with-slot-CWoTGA1B.cjs`),r=require(`./icon-Dr8sfT2X.cjs`),i=require(`./utils-CM67Oudc.cjs`),a=require(`./input-wrapper-CQGoyLdZ.cjs`);var o=class extends n.t{constructor(...e){super(...e),this.forId=i.n(),this.helptext=``,this.helptextDropdown=``,this.helptextDropdownButton=a.t.props.helptextDropdownButton.default,this.isHelpTextOpen=!1}render(){let i=()=>{let e=!this.isHelpTextOpen;this.isHelpTextOpen=e,this.dispatchEvent(new CustomEvent(`toggleHelpText`,{bubbles:!0,detail:{isOpen:e}}))},a=t.t({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.hasSlotContent()});return e.d`${e.d`<div class="${a}">
|
|
2
2
|
<div class="pkt-inputwrapper__helptext" id="${this.forId}-helptext">
|
|
3
3
|
<div class="pkt-contents" name="helptext">${n.n(this)}</div>
|
|
4
4
|
${this.helptext&&r.r(this.helptext)}
|
|
@@ -2,7 +2,7 @@ import { i as e, r as t, s as n } from "./element-cZ85T_aa.js";
|
|
|
2
2
|
import { t as r } from "./element-with-slot-4J2o3SeU.js";
|
|
3
3
|
import { n as i } from "./utils-BOOZ0ppt.js";
|
|
4
4
|
import { t as a } from "./booleanish-CRaKZ75t.js";
|
|
5
|
-
import { t as o } from "./input-wrapper-
|
|
5
|
+
import { t as o } from "./input-wrapper-DwSsP39J.js";
|
|
6
6
|
//#region ../../node_modules/element-internals-polyfill/dist/index.js
|
|
7
7
|
(function(e) {
|
|
8
8
|
let t = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap(), r = /* @__PURE__ */ new WeakMap(), i = /* @__PURE__ */ new WeakMap(), a = /* @__PURE__ */ new WeakMap(), o = /* @__PURE__ */ new WeakMap(), s = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), d = /* @__PURE__ */ new WeakMap(), f = /* @__PURE__ */ new WeakMap(), p = /* @__PURE__ */ new WeakMap(), m = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), g = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./element-DjtxO-1r.cjs`),t=require(`./element-with-slot-CWoTGA1B.cjs`),n=require(`./utils-CM67Oudc.cjs`),r=require(`./booleanish-B5EFqFpJ.cjs`),i=require(`./input-wrapper-CYCCx8MP.cjs`);(function(e){"use strict";let t=new WeakMap,n=new WeakMap,r=new WeakMap,i=new WeakMap,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={ariaAtomic:`aria-atomic`,ariaAutoComplete:`aria-autocomplete`,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`},_=(e,t)=>{for(let n in g){t[n]=null;let r=null,i=g[n];Object.defineProperty(t,n,{get(){return r},set(n){r=n,e.isConnected?T(e,i,n):u.set(e,t)}})}};function v(e){let t=i.get(e),{form:n}=t;P(e,n,t),A(e,t.labels)}let y=(e,t=!1)=>{let n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return i.has(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),r=n.nextNode(),a=!t||e.disabled;for(;r;)r.formDisabledCallback&&a&&E(r,e.disabled),r=n.nextNode()},b={attributes:!0,attributeFilter:[`disabled`,`name`]},x=z()?new MutationObserver(e=>{for(let t of e){let e=t.target;if(t.attributeName===`disabled`&&(e.constructor.formAssociated?E(e,e.hasAttribute(`disabled`)):e.localName===`fieldset`&&y(e)),t.attributeName===`name`&&e.constructor.formAssociated){let t=i.get(e),n=l.get(e);t.setFormValue(n)}}}):{};function S(e){e.forEach(e=>{let{addedNodes:t,removedNodes:n}=e,a=Array.from(t),o=Array.from(n);a.forEach(e=>{var t;if(i.has(e)&&e.constructor.formAssociated&&v(e),u.has(e)){let t=u.get(e);Object.keys(g).filter(e=>t[e]!==null).forEach(n=>{T(e,g[n],t[n])}),u.delete(e)}if(h.has(e)){let t=h.get(e);T(e,`internals-valid`,t.validity.valid.toString()),T(e,`internals-invalid`,(!t.validity.valid).toString()),T(e,`aria-invalid`,(!t.validity.valid).toString()),h.delete(e)}if(e.localName===`form`){let t=c.get(e),n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return i.has(e)&&e.constructor.formAssociated&&!(t&&t.has(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),r=n.nextNode();for(;r;)v(r),r=n.nextNode()}e.localName===`fieldset`&&((t=x.observe)==null||t.call(x,e,b),y(e,!0))}),o.forEach(e=>{let t=i.get(e);t&&r.get(t)&&D(t),s.has(e)&&s.get(e).disconnect()})})}function C(e){e.forEach(e=>{let{removedNodes:t}=e;t.forEach(t=>{let n=p.get(e.target);i.has(t)&&R(t),n.disconnect()})})}let ee=e=>{var t;let n=new MutationObserver(C);(window==null?void 0:window.ShadyDOM)?.inUse&&e.mode&&e.host&&(e=e.host),(t=n.observe)==null||t.call(n,e,{childList:!0}),p.set(e,n)};z()&&new MutationObserver(S);let w={childList:!0,subtree:!0},T=(e,t,n)=>{e.getAttribute(t)!==n&&e.setAttribute(t,n)},E=(e,t)=>{e.toggleAttribute(`internals-disabled`,t),t?T(e,`aria-disabled`,`true`):e.removeAttribute(`aria-disabled`),e.formDisabledCallback&&e.formDisabledCallback.apply(e,[t])},D=e=>{r.get(e).forEach(e=>{e.remove()}),r.set(e,[])},O=(e,t)=>{let n=document.createElement(`input`);return n.type=`hidden`,n.name=e.getAttribute(`name`),e.after(n),r.get(t).push(n),n},k=(e,t)=>{var n;r.set(t,[]),(n=x.observe)==null||n.call(x,e,b)},A=(e,t)=>{if(t.length){Array.from(t).forEach(t=>t.addEventListener(`click`,e.click.bind(e)));let n=t[0].id;t[0].id||(n=`${t[0].htmlFor}_Label`,t[0].id=n),T(e,`aria-labelledby`,n)}},j=e=>{let t=Array.from(e.elements).filter(e=>!e.tagName.includes(`-`)&&e.validity).map(e=>e.validity.valid),n=c.get(e)||[],r=Array.from(n).filter(e=>e.isConnected).map(e=>i.get(e).validity.valid),a=[...t,...r].includes(!1);e.toggleAttribute(`internals-invalid`,a),e.toggleAttribute(`internals-valid`,!a)},M=e=>{j(F(e.target))},N=e=>{j(F(e.target))},te=e=>{let t=[`button[type=submit]`,`input[type=submit]`,`button:not([type])`].map(e=>`${e}:not([disabled])`).map(t=>`${t}:not([form])${e.id?`,${t}[form='${e.id}']`:``}`).join(`,`);e.addEventListener(`click`,n=>{if(n.target.closest(t)){let t=c.get(e);if(e.noValidate)return;t.size&&Array.from(t).reverse().map(e=>i.get(e).reportValidity()).includes(!1)&&n.preventDefault()}})},ne=e=>{let t=c.get(e.target);t&&t.size&&t.forEach(e=>{e.constructor.formAssociated&&e.formResetCallback&&e.formResetCallback.apply(e)})},P=(e,t,n)=>{if(t){let r=c.get(t);if(r)r.add(e);else{let n=new Set;n.add(e),c.set(t,n),te(t),t.addEventListener(`reset`,ne),t.addEventListener(`input`,M),t.addEventListener(`change`,N)}o.set(t,{ref:e,internals:n}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout(()=>{e.formAssociatedCallback.apply(e,[t])},0),j(t)}},F=e=>{let t=e.parentNode;return t&&t.tagName!==`FORM`&&(t=F(t)),t},I=(e,t,n=DOMException)=>{if(!e.constructor.formAssociated)throw new n(t)},L=(e,t,n)=>{let r=c.get(e);return r&&r.size&&r.forEach(e=>{i.get(e)[n]()||(t=!1)}),t},R=e=>{if(e.constructor.formAssociated){let t=i.get(e),{labels:n,form:r}=t;A(e,n),P(e,r,t)}};function z(){return typeof MutationObserver<`u`}class B{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)}}let re=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),ie=(e,t,n)=>(e.valid=V(t),Object.keys(t).forEach(n=>e[n]=t[n]),n&&j(n),e),V=e=>{let t=!0;for(let n in e)n!==`valid`&&e[n]!==!1&&(t=!1);return t},H=new WeakMap;function U(e,t){e.toggleAttribute(t,!0),e.part&&e.part.add(t)}class W extends Set{static get isPolyfilled(){return!0}constructor(e){if(super(),!e||!e.tagName||e.tagName.indexOf(`-`)===-1)throw TypeError(`Illegal constructor`);H.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=H.get(this),r=`state${e}`;return n.isConnected?U(n,r):setTimeout(()=>{U(n,r)}),t}clear(){for(let[e]of this.entries())this.delete(e);super.clear()}delete(e){let t=super.delete(e),n=H.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}}function G(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)}function K(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}var q;class J{constructor(e){q.set(this,void 0),K(this,q,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 G(this,q,`f`).length}[(q=new WeakMap,Symbol.iterator)](){return G(this,q,`f`)[Symbol.iterator]()}item(e){return this[e]==null?null:this[e]}namedItem(e){return this[e]==null?null:this[e]}}function ae(){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 L(this,n,`checkValidity`)}function r(...e){let n=t.apply(this,e);return L(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(c.get(this)||[]);return n.length===0?t:new J(Array.from(t).concat(n).sort((e,t)=>e.compareDocumentPosition?e.compareDocumentPosition(t)&2?1:-1:0))}})}class Y{static get isPolyfilled(){return!0}constructor(e){if(!e||!e.tagName||e.tagName.indexOf(`-`)===-1)throw TypeError(`Illegal constructor`);let r=e.getRootNode(),a=new B;this.states=new W(e),t.set(this,e),n.set(this,a),i.set(e,this),_(e,this),k(e,this),Object.seal(this),r instanceof DocumentFragment&&ee(r)}checkValidity(){let e=t.get(this);if(I(e,`Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element.`),!this.willValidate)return!0;let r=n.get(this);if(!r.valid){let t=new Event(`invalid`,{bubbles:!1,cancelable:!0,composed:!1});e.dispatchEvent(t)}return r.valid}get form(){let e=t.get(this);I(e,`Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.`);let n;return e.constructor.formAssociated===!0&&(n=F(e)),n}get labels(){let e=t.get(this);I(e,`Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.`);let n=e.getAttribute(`id`),r=e.getRootNode();return r&&n?r.querySelectorAll(`[for="${n}"]`):[]}reportValidity(){let e=t.get(this);if(I(e,`Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.`),!this.willValidate)return!0;let n=this.checkValidity(),r=f.get(this);if(r&&!e.constructor.formAssociated)throw new DOMException(`Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.`);return!n&&r&&(e.focus(),r.focus()),n}setFormValue(e){let n=t.get(this);if(I(n,`Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element.`),D(this),e!=null&&!(e instanceof FormData)){if(n.getAttribute(`name`)){let t=O(n,this);t.value=e}}else e!=null&&e instanceof FormData&&Array.from(e).reverse().forEach(([e,t])=>{if(typeof t==`string`){let r=O(n,this);r.name=e,r.value=t}});l.set(n,e)}setValidity(e,r,i){let o=t.get(this);if(I(o,`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.`);f.set(this,i);let s=n.get(this),c={};for(let t in e)c[t]=e[t];Object.keys(c).length===0&&re(s);let l=Object.assign(Object.assign({},s),c);delete l.valid;let{valid:u}=ie(s,l,this.form);if(!u&&!r)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.`);a.set(this,u?``:r),o.isConnected?(o.toggleAttribute(`internals-invalid`,!u),o.toggleAttribute(`internals-valid`,u),T(o,`aria-invalid`,`${!u}`)):h.set(o,this)}get shadowRoot(){let e=t.get(this);return d.get(e)||null}get validationMessage(){return I(t.get(this),`Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element.`),a.get(this)}get validity(){return I(t.get(this),`Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element.`),n.get(this)}get willValidate(){let e=t.get(this);return I(e,`Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element.`),!(e.disabled||e.hasAttribute(`disabled`)||e.hasAttribute(`readonly`))}}function oe(){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)}let X=!1,Z=!1;function Q(e){Z||(Z=!0,window.CustomStateSet=W,e&&(HTMLElement.prototype.attachInternals=function(...t){let n=e.call(this,t);return n.states=new W(this),n}))}function $(e=!0){if(!X){if(X=!0,typeof window<`u`&&(window.ElementInternals=Y),typeof CustomElementRegistry<`u`){let e=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(t,n,r){if(n.formAssociated){let e=n.prototype.connectedCallback;n.prototype.connectedCallback=function(){m.has(this)||(m.set(this,!0),this.hasAttribute(`disabled`)&&E(this,!0)),e?.apply(this),R(this)}}e.call(this,t,n,r)}}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(i.has(this))throw new DOMException(`DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.`);return new Y(this)}),typeof Element<`u`){function e(...e){let n=t.apply(this,e);if(d.set(this,n),z()){let e=new MutationObserver(S);window.ShadyDOM?e.observe(this,w):e.observe(n,w),s.set(this,e)}return n}let t=Element.prototype.attachShadow;Element.prototype.attachShadow=e}z()&&typeof document<`u`&&new MutationObserver(S).observe(document.documentElement,w),typeof HTMLFormElement<`u`&&ae(),(e||typeof window<`u`&&!window.CustomStateSet)&&Q()}}return customElements.polyfillWrapFlushCallback||(oe()?typeof window<`u`&&!window.CustomStateSet&&Q(HTMLElement.prototype.attachInternals):$(!1)),e.forceCustomStateSetPolyfill=Q,e.forceElementInternalsPolyfill=$,Object.defineProperty(e,`__esModule`,{value:!0}),e})({});var a=`on`,o=`--checked`,s=`,`,c=class extends t.t{static get formAssociated(){return!0}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=n.n(),this.counter=!1,this.hasError=!1,this.inline=!1,this.hasFieldset=!1,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=i.t.props.helptextDropdownButton.default,this.label=null,this.optionalText=e.i.forms.labels.optional,this.requiredText=e.i.forms.labels.required,this.tagText=null,this.dataTestid=``,this.touched=!1,this.internals=this.attachInternals()}manageValidity(t){if(!t){console.warn(`manageValidity called without valid input element`);return}this.required&&!this.value?this.internals.setValidity({valueMissing:!0},e.i.forms.messages.required,t):t.validity?.typeMismatch||t.validity?.badInput?this.internals.setValidity({typeMismatch:!0},e.i.forms.messages.invalid,t):t.validity?.patternMismatch?this.internals.setValidity({patternMismatch:!0},e.i.forms.messages.invalidPattern,t):t.validity?.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},e.i.forms.messages.tooShort,t):t.validity?.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},e.i.forms.messages.tooLong,t):t.validity?.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?e.i.forms.messages.rangeUnderflowMin.replace(`{min}`,this.min?.toString()):e.i.forms.messages.rangeUnderflow,t):t.validity?.stepMismatch?this.internals.setValidity({stepMismatch:!0},e.i.forms.messages.invalid,t):t.validity?.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?e.i.forms.messages.rangeOverflowMax.replace(`{max}`,this.max?.toString()):e.i.forms.messages.rangeOverflow,t):t.validity?.customError?this.internals.setValidity({customError:!0},t.validationMessage,t):this.internals.setValidity({})}setFormValue(e){if(this.internals)if(Array.isArray(e)){let t=new FormData;e.forEach(e=>{t.append(this.name,e)}),this.internals.setFormValue(t)}else this.internals.setFormValue(e)}coordinateRadioGroup(){if(!this.form||!this.name||this.type!==`radio`)return;let e=`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`;this.form.querySelectorAll(e).forEach(e=>{if(e!==this&&e.getAttribute(`name`)===this.name&&e.getAttribute(`value`)!==this.value){let t=e;t.checked&&(t.checked=!1,t.internals&&(t.internals.setFormValue(null),t.internals.states?.delete(o)))}})}valueChecked(e){if(!this.touched)return;let t=this.internals.form||this.closest(`form`),n=t?new FormData(t):null;if(this.type===`radio`&&this.coordinateRadioGroup(),typeof e==`string`?(this.checked=e===`true`,this.internals.ariaChecked=String(e===`true`)):typeof e==`boolean`&&(this.checked=e,this.internals.ariaChecked=String(e)),this.checked){let e=(typeof this.value==`string`?this.value:``)||a;this.internals.setFormValue(e),n&&n.append(this.name,e),this.internals.states.add(o)}else this.internals.setFormValue(null),n&&n.delete(this.name),this.internals.states.delete(o);this.dispatchChangeEvents(this.checked),this.internals.reportValidity()}valueChanged(e,t){(t!==this.value||t!==this._value)&&(typeof e==`string`?((this.multiple||this.range)&&e.includes(s)&&(e=e.split(s)),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(s)?e.split(s):!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){this.touched=!0,e&&this.setFormValue(e),this.validate();return}if(typeof e!=`string`&&!Array.isArray(e))return;let t=this.normalizeValue(e);this.setFormValue(t),this.validate(),this.dispatchChangeEvents(t)}formResetCallback(){if(this.touched=!1,this._options&&this._options.length&&this._options.forEach(e=>{`selected`in e&&(e.selected=!1)}),this.checked!==void 0)this.checked=!1,this.internals.ariaChecked=`false`,this.internals.setFormValue(``),this.inputRef?.value&&`checked`in this.inputRef.value&&(this.inputRef.value.checked=!1),this.valueChecked(this.checked);else{this.internals.setFormValue(``);let e=this.defaultValue||(this.multiple||this.range?[]:``);this.value=e,this._value=Array.isArray(e)?e:[e],this.valueChanged(this.value,null)}this.internals.ariaInvalid=`false`}updated(e){super.updated(e),e.has(`dataTestid`)&&this.dataTestid&&this.inputRef.value&&(this.skipForwardTestid?this.hasAttribute(`data-testid`)||this.setAttribute(`data-testid`,this.dataTestid):(this.inputRef.value.dataset.testid=this.dataTestid,this.removeAttribute(`data-testid`)))}firstUpdated(e){if(super.firstUpdated(e),this.form||=this.internals.form||this.closest(`form`),this.value&&this.defaultValue===null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked=`true`,this.checked=!0),this.required&&(this.internals.ariaRequired=`true`),this.disabled&&(this.internals.ariaDisabled=`true`),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){let e=this.checked===``||this.checked===`true`||this.checked===!0;this.internals.ariaChecked=String(e);let t=e?(typeof this.value==`string`?this.value:``)||a:null;this.internals.setFormValue(t)}else this.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute(`form`,``),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute(`form`,``),this.manageValidity(this.inputRefTo.value))}};e.r([e.s({type:Boolean,reflect:!0})],c.prototype,`checked`,void 0),e.r([e.s({type:Boolean})],c.prototype,`defaultChecked`,void 0),e.r([e.s({type:Boolean})],c.prototype,`multiple`,void 0),e.r([e.s({type:Boolean})],c.prototype,`range`,void 0),e.r([e.s({type:String,reflect:!0})],c.prototype,`type`,void 0),e.r([e.s()],c.prototype,`defaultValue`,void 0),e.r([e.s({type:Boolean,reflect:!0})],c.prototype,`disabled`,void 0),e.r([e.s({type:Boolean,reflect:!0})],c.prototype,`readonly`,void 0),e.r([e.s({type:Boolean,reflect:!0})],c.prototype,`required`,void 0),e.r([e.s({reflect:!0,converter:{fromAttribute:e=>e,toAttribute:e=>e?.toString()??null}})],c.prototype,`max`,void 0),e.r([e.s({type:Number,reflect:!0})],c.prototype,`maxlength`,void 0),e.r([e.s({reflect:!0,converter:{fromAttribute:e=>e,toAttribute:e=>e?.toString()??null}})],c.prototype,`min`,void 0),e.r([e.s({type:Number,reflect:!0})],c.prototype,`minlength`,void 0),e.r([e.s({type:Number,reflect:!0})],c.prototype,`step`,void 0),e.r([e.s({type:String})],c.prototype,`ariaDescribedBy`,void 0),e.r([e.s({type:String})],c.prototype,`ariaLabelledby`,void 0),e.r([e.s({type:String,reflect:!0})],c.prototype,`name`,void 0),e.r([e.s({type:String,reflect:!0})],c.prototype,`pattern`,void 0),e.r([e.s({type:String,reflect:!0})],c.prototype,`placeholder`,void 0),e.r([e.s({type:String,reflect:!0})],c.prototype,`id`,void 0),e.r([e.s({type:Boolean})],c.prototype,`counter`,void 0),e.r([e.s({type:Boolean})],c.prototype,`hasError`,void 0),e.r([e.s({type:Boolean})],c.prototype,`inline`,void 0),e.r([e.s({type:Boolean})],c.prototype,`hasFieldset`,void 0),e.r([e.s({type:Boolean})],c.prototype,`optionalTag`,void 0),e.r([e.s({type:Boolean})],c.prototype,`requiredTag`,void 0),e.r([e.s({type:Boolean})],c.prototype,`skipForwardTestid`,void 0),e.r([e.s({type:Boolean,reflect:!0,converter:r.t})],c.prototype,`useWrapper`,void 0),e.r([e.s({type:Boolean,reflect:!0})],c.prototype,`fullwidth`,void 0),e.r([e.s({type:Number})],c.prototype,`counterMaxLength`,void 0),e.r([e.s({type:String})],c.prototype,`errorMessage`,void 0),e.r([e.s({type:String})],c.prototype,`helptext`,void 0),e.r([e.s({type:String})],c.prototype,`helptextDropdown`,void 0),e.r([e.s({type:String,reflect:!1})],c.prototype,`helptextDropdownButton`,void 0),e.r([e.s({type:String})],c.prototype,`label`,void 0),e.r([e.s({type:String,reflect:!1})],c.prototype,`optionalText`,void 0),e.r([e.s({type:String,reflect:!1})],c.prototype,`requiredText`,void 0),e.r([e.s({type:String,reflect:!1})],c.prototype,`tagText`,void 0),e.r([e.s({type:String,attribute:`data-testid`})],c.prototype,`dataTestid`,void 0),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return c}});
|
|
1
|
+
const e=require(`./element-DjtxO-1r.cjs`),t=require(`./element-with-slot-CWoTGA1B.cjs`),n=require(`./utils-CM67Oudc.cjs`),r=require(`./booleanish-B5EFqFpJ.cjs`),i=require(`./input-wrapper-CQGoyLdZ.cjs`);(function(e){"use strict";let t=new WeakMap,n=new WeakMap,r=new WeakMap,i=new WeakMap,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={ariaAtomic:`aria-atomic`,ariaAutoComplete:`aria-autocomplete`,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`},_=(e,t)=>{for(let n in g){t[n]=null;let r=null,i=g[n];Object.defineProperty(t,n,{get(){return r},set(n){r=n,e.isConnected?T(e,i,n):u.set(e,t)}})}};function v(e){let t=i.get(e),{form:n}=t;P(e,n,t),A(e,t.labels)}let y=(e,t=!1)=>{let n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return i.has(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),r=n.nextNode(),a=!t||e.disabled;for(;r;)r.formDisabledCallback&&a&&E(r,e.disabled),r=n.nextNode()},b={attributes:!0,attributeFilter:[`disabled`,`name`]},x=z()?new MutationObserver(e=>{for(let t of e){let e=t.target;if(t.attributeName===`disabled`&&(e.constructor.formAssociated?E(e,e.hasAttribute(`disabled`)):e.localName===`fieldset`&&y(e)),t.attributeName===`name`&&e.constructor.formAssociated){let t=i.get(e),n=l.get(e);t.setFormValue(n)}}}):{};function S(e){e.forEach(e=>{let{addedNodes:t,removedNodes:n}=e,a=Array.from(t),o=Array.from(n);a.forEach(e=>{var t;if(i.has(e)&&e.constructor.formAssociated&&v(e),u.has(e)){let t=u.get(e);Object.keys(g).filter(e=>t[e]!==null).forEach(n=>{T(e,g[n],t[n])}),u.delete(e)}if(h.has(e)){let t=h.get(e);T(e,`internals-valid`,t.validity.valid.toString()),T(e,`internals-invalid`,(!t.validity.valid).toString()),T(e,`aria-invalid`,(!t.validity.valid).toString()),h.delete(e)}if(e.localName===`form`){let t=c.get(e),n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return i.has(e)&&e.constructor.formAssociated&&!(t&&t.has(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),r=n.nextNode();for(;r;)v(r),r=n.nextNode()}e.localName===`fieldset`&&((t=x.observe)==null||t.call(x,e,b),y(e,!0))}),o.forEach(e=>{let t=i.get(e);t&&r.get(t)&&D(t),s.has(e)&&s.get(e).disconnect()})})}function C(e){e.forEach(e=>{let{removedNodes:t}=e;t.forEach(t=>{let n=p.get(e.target);i.has(t)&&R(t),n.disconnect()})})}let ee=e=>{var t;let n=new MutationObserver(C);(window==null?void 0:window.ShadyDOM)?.inUse&&e.mode&&e.host&&(e=e.host),(t=n.observe)==null||t.call(n,e,{childList:!0}),p.set(e,n)};z()&&new MutationObserver(S);let w={childList:!0,subtree:!0},T=(e,t,n)=>{e.getAttribute(t)!==n&&e.setAttribute(t,n)},E=(e,t)=>{e.toggleAttribute(`internals-disabled`,t),t?T(e,`aria-disabled`,`true`):e.removeAttribute(`aria-disabled`),e.formDisabledCallback&&e.formDisabledCallback.apply(e,[t])},D=e=>{r.get(e).forEach(e=>{e.remove()}),r.set(e,[])},O=(e,t)=>{let n=document.createElement(`input`);return n.type=`hidden`,n.name=e.getAttribute(`name`),e.after(n),r.get(t).push(n),n},k=(e,t)=>{var n;r.set(t,[]),(n=x.observe)==null||n.call(x,e,b)},A=(e,t)=>{if(t.length){Array.from(t).forEach(t=>t.addEventListener(`click`,e.click.bind(e)));let n=t[0].id;t[0].id||(n=`${t[0].htmlFor}_Label`,t[0].id=n),T(e,`aria-labelledby`,n)}},j=e=>{let t=Array.from(e.elements).filter(e=>!e.tagName.includes(`-`)&&e.validity).map(e=>e.validity.valid),n=c.get(e)||[],r=Array.from(n).filter(e=>e.isConnected).map(e=>i.get(e).validity.valid),a=[...t,...r].includes(!1);e.toggleAttribute(`internals-invalid`,a),e.toggleAttribute(`internals-valid`,!a)},M=e=>{j(F(e.target))},N=e=>{j(F(e.target))},te=e=>{let t=[`button[type=submit]`,`input[type=submit]`,`button:not([type])`].map(e=>`${e}:not([disabled])`).map(t=>`${t}:not([form])${e.id?`,${t}[form='${e.id}']`:``}`).join(`,`);e.addEventListener(`click`,n=>{if(n.target.closest(t)){let t=c.get(e);if(e.noValidate)return;t.size&&Array.from(t).reverse().map(e=>i.get(e).reportValidity()).includes(!1)&&n.preventDefault()}})},ne=e=>{let t=c.get(e.target);t&&t.size&&t.forEach(e=>{e.constructor.formAssociated&&e.formResetCallback&&e.formResetCallback.apply(e)})},P=(e,t,n)=>{if(t){let r=c.get(t);if(r)r.add(e);else{let n=new Set;n.add(e),c.set(t,n),te(t),t.addEventListener(`reset`,ne),t.addEventListener(`input`,M),t.addEventListener(`change`,N)}o.set(t,{ref:e,internals:n}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout(()=>{e.formAssociatedCallback.apply(e,[t])},0),j(t)}},F=e=>{let t=e.parentNode;return t&&t.tagName!==`FORM`&&(t=F(t)),t},I=(e,t,n=DOMException)=>{if(!e.constructor.formAssociated)throw new n(t)},L=(e,t,n)=>{let r=c.get(e);return r&&r.size&&r.forEach(e=>{i.get(e)[n]()||(t=!1)}),t},R=e=>{if(e.constructor.formAssociated){let t=i.get(e),{labels:n,form:r}=t;A(e,n),P(e,r,t)}};function z(){return typeof MutationObserver<`u`}class B{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)}}let re=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),ie=(e,t,n)=>(e.valid=V(t),Object.keys(t).forEach(n=>e[n]=t[n]),n&&j(n),e),V=e=>{let t=!0;for(let n in e)n!==`valid`&&e[n]!==!1&&(t=!1);return t},H=new WeakMap;function U(e,t){e.toggleAttribute(t,!0),e.part&&e.part.add(t)}class W extends Set{static get isPolyfilled(){return!0}constructor(e){if(super(),!e||!e.tagName||e.tagName.indexOf(`-`)===-1)throw TypeError(`Illegal constructor`);H.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=H.get(this),r=`state${e}`;return n.isConnected?U(n,r):setTimeout(()=>{U(n,r)}),t}clear(){for(let[e]of this.entries())this.delete(e);super.clear()}delete(e){let t=super.delete(e),n=H.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}}function G(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)}function K(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}var q;class J{constructor(e){q.set(this,void 0),K(this,q,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 G(this,q,`f`).length}[(q=new WeakMap,Symbol.iterator)](){return G(this,q,`f`)[Symbol.iterator]()}item(e){return this[e]==null?null:this[e]}namedItem(e){return this[e]==null?null:this[e]}}function ae(){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 L(this,n,`checkValidity`)}function r(...e){let n=t.apply(this,e);return L(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(c.get(this)||[]);return n.length===0?t:new J(Array.from(t).concat(n).sort((e,t)=>e.compareDocumentPosition?e.compareDocumentPosition(t)&2?1:-1:0))}})}class Y{static get isPolyfilled(){return!0}constructor(e){if(!e||!e.tagName||e.tagName.indexOf(`-`)===-1)throw TypeError(`Illegal constructor`);let r=e.getRootNode(),a=new B;this.states=new W(e),t.set(this,e),n.set(this,a),i.set(e,this),_(e,this),k(e,this),Object.seal(this),r instanceof DocumentFragment&&ee(r)}checkValidity(){let e=t.get(this);if(I(e,`Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element.`),!this.willValidate)return!0;let r=n.get(this);if(!r.valid){let t=new Event(`invalid`,{bubbles:!1,cancelable:!0,composed:!1});e.dispatchEvent(t)}return r.valid}get form(){let e=t.get(this);I(e,`Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.`);let n;return e.constructor.formAssociated===!0&&(n=F(e)),n}get labels(){let e=t.get(this);I(e,`Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.`);let n=e.getAttribute(`id`),r=e.getRootNode();return r&&n?r.querySelectorAll(`[for="${n}"]`):[]}reportValidity(){let e=t.get(this);if(I(e,`Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.`),!this.willValidate)return!0;let n=this.checkValidity(),r=f.get(this);if(r&&!e.constructor.formAssociated)throw new DOMException(`Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.`);return!n&&r&&(e.focus(),r.focus()),n}setFormValue(e){let n=t.get(this);if(I(n,`Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element.`),D(this),e!=null&&!(e instanceof FormData)){if(n.getAttribute(`name`)){let t=O(n,this);t.value=e}}else e!=null&&e instanceof FormData&&Array.from(e).reverse().forEach(([e,t])=>{if(typeof t==`string`){let r=O(n,this);r.name=e,r.value=t}});l.set(n,e)}setValidity(e,r,i){let o=t.get(this);if(I(o,`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.`);f.set(this,i);let s=n.get(this),c={};for(let t in e)c[t]=e[t];Object.keys(c).length===0&&re(s);let l=Object.assign(Object.assign({},s),c);delete l.valid;let{valid:u}=ie(s,l,this.form);if(!u&&!r)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.`);a.set(this,u?``:r),o.isConnected?(o.toggleAttribute(`internals-invalid`,!u),o.toggleAttribute(`internals-valid`,u),T(o,`aria-invalid`,`${!u}`)):h.set(o,this)}get shadowRoot(){let e=t.get(this);return d.get(e)||null}get validationMessage(){return I(t.get(this),`Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element.`),a.get(this)}get validity(){return I(t.get(this),`Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element.`),n.get(this)}get willValidate(){let e=t.get(this);return I(e,`Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element.`),!(e.disabled||e.hasAttribute(`disabled`)||e.hasAttribute(`readonly`))}}function oe(){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)}let X=!1,Z=!1;function Q(e){Z||(Z=!0,window.CustomStateSet=W,e&&(HTMLElement.prototype.attachInternals=function(...t){let n=e.call(this,t);return n.states=new W(this),n}))}function $(e=!0){if(!X){if(X=!0,typeof window<`u`&&(window.ElementInternals=Y),typeof CustomElementRegistry<`u`){let e=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(t,n,r){if(n.formAssociated){let e=n.prototype.connectedCallback;n.prototype.connectedCallback=function(){m.has(this)||(m.set(this,!0),this.hasAttribute(`disabled`)&&E(this,!0)),e?.apply(this),R(this)}}e.call(this,t,n,r)}}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(i.has(this))throw new DOMException(`DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.`);return new Y(this)}),typeof Element<`u`){function e(...e){let n=t.apply(this,e);if(d.set(this,n),z()){let e=new MutationObserver(S);window.ShadyDOM?e.observe(this,w):e.observe(n,w),s.set(this,e)}return n}let t=Element.prototype.attachShadow;Element.prototype.attachShadow=e}z()&&typeof document<`u`&&new MutationObserver(S).observe(document.documentElement,w),typeof HTMLFormElement<`u`&&ae(),(e||typeof window<`u`&&!window.CustomStateSet)&&Q()}}return customElements.polyfillWrapFlushCallback||(oe()?typeof window<`u`&&!window.CustomStateSet&&Q(HTMLElement.prototype.attachInternals):$(!1)),e.forceCustomStateSetPolyfill=Q,e.forceElementInternalsPolyfill=$,Object.defineProperty(e,`__esModule`,{value:!0}),e})({});var a=`on`,o=`--checked`,s=`,`,c=class extends t.t{static get formAssociated(){return!0}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=n.n(),this.counter=!1,this.hasError=!1,this.inline=!1,this.hasFieldset=!1,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=i.t.props.helptextDropdownButton.default,this.label=null,this.optionalText=e.i.forms.labels.optional,this.requiredText=e.i.forms.labels.required,this.tagText=null,this.dataTestid=``,this.touched=!1,this.internals=this.attachInternals()}manageValidity(t){if(!t){console.warn(`manageValidity called without valid input element`);return}this.required&&!this.value?this.internals.setValidity({valueMissing:!0},e.i.forms.messages.required,t):t.validity?.typeMismatch||t.validity?.badInput?this.internals.setValidity({typeMismatch:!0},e.i.forms.messages.invalid,t):t.validity?.patternMismatch?this.internals.setValidity({patternMismatch:!0},e.i.forms.messages.invalidPattern,t):t.validity?.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},e.i.forms.messages.tooShort,t):t.validity?.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},e.i.forms.messages.tooLong,t):t.validity?.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?e.i.forms.messages.rangeUnderflowMin.replace(`{min}`,this.min?.toString()):e.i.forms.messages.rangeUnderflow,t):t.validity?.stepMismatch?this.internals.setValidity({stepMismatch:!0},e.i.forms.messages.invalid,t):t.validity?.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?e.i.forms.messages.rangeOverflowMax.replace(`{max}`,this.max?.toString()):e.i.forms.messages.rangeOverflow,t):t.validity?.customError?this.internals.setValidity({customError:!0},t.validationMessage,t):this.internals.setValidity({})}setFormValue(e){if(this.internals)if(Array.isArray(e)){let t=new FormData;e.forEach(e=>{t.append(this.name,e)}),this.internals.setFormValue(t)}else this.internals.setFormValue(e)}coordinateRadioGroup(){if(!this.form||!this.name||this.type!==`radio`)return;let e=`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`;this.form.querySelectorAll(e).forEach(e=>{if(e!==this&&e.getAttribute(`name`)===this.name&&e.getAttribute(`value`)!==this.value){let t=e;t.checked&&(t.checked=!1,t.internals&&(t.internals.setFormValue(null),t.internals.states?.delete(o)))}})}valueChecked(e){if(!this.touched)return;let t=this.internals.form||this.closest(`form`),n=t?new FormData(t):null;if(this.type===`radio`&&this.coordinateRadioGroup(),typeof e==`string`?(this.checked=e===`true`,this.internals.ariaChecked=String(e===`true`)):typeof e==`boolean`&&(this.checked=e,this.internals.ariaChecked=String(e)),this.checked){let e=(typeof this.value==`string`?this.value:``)||a;this.internals.setFormValue(e),n&&n.append(this.name,e),this.internals.states.add(o)}else this.internals.setFormValue(null),n&&n.delete(this.name),this.internals.states.delete(o);this.dispatchChangeEvents(this.checked),this.internals.reportValidity()}valueChanged(e,t){(t!==this.value||t!==this._value)&&(typeof e==`string`?((this.multiple||this.range)&&e.includes(s)&&(e=e.split(s)),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(s)?e.split(s):!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){this.touched=!0,e&&this.setFormValue(e),this.validate();return}if(typeof e!=`string`&&!Array.isArray(e))return;let t=this.normalizeValue(e);this.setFormValue(t),this.validate(),this.dispatchChangeEvents(t)}formResetCallback(){if(this.touched=!1,this._options&&this._options.length&&this._options.forEach(e=>{`selected`in e&&(e.selected=!1)}),this.checked!==void 0)this.checked=!1,this.internals.ariaChecked=`false`,this.internals.setFormValue(``),this.inputRef?.value&&`checked`in this.inputRef.value&&(this.inputRef.value.checked=!1),this.valueChecked(this.checked);else{this.internals.setFormValue(``);let e=this.defaultValue||(this.multiple||this.range?[]:``);this.value=e,this._value=Array.isArray(e)?e:[e],this.valueChanged(this.value,null)}this.internals.ariaInvalid=`false`}updated(e){super.updated(e),e.has(`dataTestid`)&&this.dataTestid&&this.inputRef.value&&(this.skipForwardTestid?this.hasAttribute(`data-testid`)||this.setAttribute(`data-testid`,this.dataTestid):(this.inputRef.value.dataset.testid=this.dataTestid,this.removeAttribute(`data-testid`)))}firstUpdated(e){if(super.firstUpdated(e),this.form||=this.internals.form||this.closest(`form`),this.value&&this.defaultValue===null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked=`true`,this.checked=!0),this.required&&(this.internals.ariaRequired=`true`),this.disabled&&(this.internals.ariaDisabled=`true`),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){let e=this.checked===``||this.checked===`true`||this.checked===!0;this.internals.ariaChecked=String(e);let t=e?(typeof this.value==`string`?this.value:``)||a:null;this.internals.setFormValue(t)}else this.setFormValue(this.value);this.inputRef&&this.inputRef.value&&(this.inputRef.value.setAttribute(`form`,``),this.manageValidity(this.inputRef.value)),this.inputRefTo&&this.inputRefTo.value&&(this.inputRefTo.value.setAttribute(`form`,``),this.manageValidity(this.inputRefTo.value))}};e.r([e.s({type:Boolean,reflect:!0})],c.prototype,`checked`,void 0),e.r([e.s({type:Boolean})],c.prototype,`defaultChecked`,void 0),e.r([e.s({type:Boolean})],c.prototype,`multiple`,void 0),e.r([e.s({type:Boolean})],c.prototype,`range`,void 0),e.r([e.s({type:String,reflect:!0})],c.prototype,`type`,void 0),e.r([e.s()],c.prototype,`defaultValue`,void 0),e.r([e.s({type:Boolean,reflect:!0})],c.prototype,`disabled`,void 0),e.r([e.s({type:Boolean,reflect:!0})],c.prototype,`readonly`,void 0),e.r([e.s({type:Boolean,reflect:!0})],c.prototype,`required`,void 0),e.r([e.s({reflect:!0,converter:{fromAttribute:e=>e,toAttribute:e=>e?.toString()??null}})],c.prototype,`max`,void 0),e.r([e.s({type:Number,reflect:!0})],c.prototype,`maxlength`,void 0),e.r([e.s({reflect:!0,converter:{fromAttribute:e=>e,toAttribute:e=>e?.toString()??null}})],c.prototype,`min`,void 0),e.r([e.s({type:Number,reflect:!0})],c.prototype,`minlength`,void 0),e.r([e.s({type:Number,reflect:!0})],c.prototype,`step`,void 0),e.r([e.s({type:String})],c.prototype,`ariaDescribedBy`,void 0),e.r([e.s({type:String})],c.prototype,`ariaLabelledby`,void 0),e.r([e.s({type:String,reflect:!0})],c.prototype,`name`,void 0),e.r([e.s({type:String,reflect:!0})],c.prototype,`pattern`,void 0),e.r([e.s({type:String,reflect:!0})],c.prototype,`placeholder`,void 0),e.r([e.s({type:String,reflect:!0})],c.prototype,`id`,void 0),e.r([e.s({type:Boolean})],c.prototype,`counter`,void 0),e.r([e.s({type:Boolean})],c.prototype,`hasError`,void 0),e.r([e.s({type:Boolean})],c.prototype,`inline`,void 0),e.r([e.s({type:Boolean})],c.prototype,`hasFieldset`,void 0),e.r([e.s({type:Boolean})],c.prototype,`optionalTag`,void 0),e.r([e.s({type:Boolean})],c.prototype,`requiredTag`,void 0),e.r([e.s({type:Boolean})],c.prototype,`skipForwardTestid`,void 0),e.r([e.s({type:Boolean,reflect:!0,converter:r.t})],c.prototype,`useWrapper`,void 0),e.r([e.s({type:Boolean,reflect:!0})],c.prototype,`fullwidth`,void 0),e.r([e.s({type:Number})],c.prototype,`counterMaxLength`,void 0),e.r([e.s({type:String})],c.prototype,`errorMessage`,void 0),e.r([e.s({type:String})],c.prototype,`helptext`,void 0),e.r([e.s({type:String})],c.prototype,`helptextDropdown`,void 0),e.r([e.s({type:String,reflect:!1})],c.prototype,`helptextDropdownButton`,void 0),e.r([e.s({type:String})],c.prototype,`label`,void 0),e.r([e.s({type:String,reflect:!1})],c.prototype,`optionalText`,void 0),e.r([e.s({type:String,reflect:!1})],c.prototype,`requiredText`,void 0),e.r([e.s({type:String,reflect:!1})],c.prototype,`tagText`,void 0),e.r([e.s({type:String,attribute:`data-testid`})],c.prototype,`dataTestid`,void 0),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return c}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require(`./element-DjtxO-1r.cjs`),t=require(`./class-map-CJ-msbHs.cjs`),n=require(`./element-with-slot-CWoTGA1B.cjs`);require(`./alert-BEEnTiCb.cjs`);const r=require(`./icon-Dr8sfT2X.cjs`),i=require(`./if-defined-XKOD_t_V.cjs`),a=require(`./utils-CM67Oudc.cjs`),o=require(`./booleanish-B5EFqFpJ.cjs`),s=require(`./input-wrapper-
|
|
1
|
+
const e=require(`./element-DjtxO-1r.cjs`),t=require(`./class-map-CJ-msbHs.cjs`),n=require(`./element-with-slot-CWoTGA1B.cjs`);require(`./alert-BEEnTiCb.cjs`);const r=require(`./icon-Dr8sfT2X.cjs`),i=require(`./if-defined-XKOD_t_V.cjs`),a=require(`./utils-CM67Oudc.cjs`),o=require(`./booleanish-B5EFqFpJ.cjs`),s=require(`./input-wrapper-CQGoyLdZ.cjs`);require(`./helptext-KWXjKljV.cjs`);var c=class{constructor(e,t=null){this.pointerJustUsed=!1,this.handlePointerDown=()=>{this.pointerJustUsed=!0,this.pointerTimeoutId!==void 0&&clearTimeout(this.pointerTimeoutId),this.pointerTimeoutId=window.setTimeout(()=>{this.pointerJustUsed=!1,this.pointerTimeoutId=void 0},0)},this.handleFocusIn=()=>{this.setNavtype(this.pointerJustUsed?`pointer`:void 0)},this.handleFocusOut=e=>{this.host.contains(e.relatedTarget)||this.setNavtype(void 0)},this.host=e,this.targetSelector=t,e.addController(this)}hostConnected(){this.host.addEventListener(`pointerdown`,this.handlePointerDown,!0),this.host.addEventListener(`focusin`,this.handleFocusIn),this.host.addEventListener(`focusout`,this.handleFocusOut)}hostDisconnected(){this.host.removeEventListener(`pointerdown`,this.handlePointerDown,!0),this.host.removeEventListener(`focusin`,this.handleFocusIn),this.host.removeEventListener(`focusout`,this.handleFocusOut),this.pointerTimeoutId!==void 0&&(clearTimeout(this.pointerTimeoutId),this.pointerTimeoutId=void 0)}getTarget(){return this.targetSelector===null?this.host:this.host.querySelector(this.targetSelector)}setNavtype(e){let t=this.getTarget();t&&(e===void 0?delete t.dataset.navtype:t.dataset.navtype=e)}},l=class extends n.t{constructor(...e){super(...e),this.forId=a.n(),this.label=``,this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=s.t.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.counterError=null,this.counterPosition=`bottom`,this.optionalTag=s.t.props.optionalTag.default,this.optionalText=s.t.props.optionalText.default,this.requiredTag=s.t.props.requiredTag.default,this.requiredText=s.t.props.requiredText.default,this.tagText=null,this.hasError=s.t.props.hasError.default,this.errorMessage=``,this.disabled=s.t.props.disabled.default,this.inline=s.t.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=s.t.props.hasFieldset.default,this.role=`group`,this.useWrapper=s.t.props.useWrapper.default,this.focusModality=new c(this,`.pkt-inputwrapper`)}updated(e){super.updated(e)}render(){let a={"pkt-inputwrapper":!0,"pkt-inputwrapper--error":this.hasError,"pkt-inputwrapper--disabled":this.disabled,"pkt-inputwrapper--inline":this.inline},o=`pkt-tag pkt-tag--small pkt-tag--thin-text`,c=this.ariaDescribedby?this.ariaDescribedby:this.helptext?`${this.forId}-helptext`:e.l,l=()=>e.d`
|
|
2
2
|
${this.tagText?e.d`<span class=${o+` pkt-tag--gray`}>${this.tagText}</span>`:e.l}
|
|
3
3
|
${this.optionalTag?e.d`<span class=${o+` pkt-tag--blue-light`}>${this.optionalText}</span>`:e.l}
|
|
4
4
|
${this.requiredTag?e.d`<span class=${o+` pkt-tag--beige`}>${this.requiredText}</span>`:e.l}
|
|
@@ -6,8 +6,8 @@ import { r as c } from "./icon-Co72KtgF.js";
|
|
|
6
6
|
import { t as l } from "./if-defined-Cjj8qN-Z.js";
|
|
7
7
|
import { n as u } from "./utils-BOOZ0ppt.js";
|
|
8
8
|
import { t as d } from "./booleanish-CRaKZ75t.js";
|
|
9
|
-
import { t as f } from "./input-wrapper-
|
|
10
|
-
import "./helptext-
|
|
9
|
+
import { t as f } from "./input-wrapper-DwSsP39J.js";
|
|
10
|
+
import "./helptext-BdqoW19r.js";
|
|
11
11
|
//#region src/controllers/focus-modality-controller.ts
|
|
12
12
|
var p = class {
|
|
13
13
|
constructor(e, t = null) {
|
|
@@ -122,7 +122,7 @@ var d = {
|
|
|
122
122
|
super.updated(e), e.has("open") && (this.open && !this._isOpen ? this.showModal() : !this.open && this._isOpen && this.close(new Event("close"), !1));
|
|
123
123
|
}
|
|
124
124
|
async firstUpdated(e) {
|
|
125
|
-
super.firstUpdated(e), this.dialogRef.value && !window.HTMLDialogElement && !this.dialogRef.value.showModal && ("document" in window && "createElement" in document && (await import("./dialog-polyfill.esm-
|
|
125
|
+
super.firstUpdated(e), this.dialogRef.value && !window.HTMLDialogElement && !this.dialogRef.value.showModal && ("document" in window && "createElement" in document && (await import("./dialog-polyfill.esm-DrODM08x.js").then((e) => e.default)).registerDialog(this.dialogRef.value), this.dialogRef.value.addEventListener("close", () => {
|
|
126
126
|
this.close(new Event("close"), !0);
|
|
127
127
|
}));
|
|
128
128
|
}
|