@oslokommune/punkt-elements 15.2.0 → 15.4.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/dist/{accordionitem-BbeS44TD.js → accordionitem-CHXGzgLv.js} +4 -4
- package/dist/accordionitem-To95GT6b.cjs +34 -0
- package/dist/{alert-B9flMht5.cjs → alert-BDXWFRcf.cjs} +5 -5
- package/dist/{alert-BpFxQviu.js → alert-BHSd2Vpj.js} +6 -6
- package/dist/{backlink-DfMabyBp.js → backlink-C68H4Z3b.js} +5 -5
- package/dist/{backlink-Bn16ZEIX.cjs → backlink-CQoNgoa-.cjs} +1 -1
- package/dist/{button-CKgpX5QA.js → button-CHUuxLQV.js} +10 -10
- package/dist/{button-BgCKV0zW.cjs → button-VWxZW89G.cjs} +7 -7
- package/dist/{calendar-BMarIeVp.js → calendar-DTnx3DDH.js} +22 -22
- package/dist/{calendar-C6xgAJ7Z.cjs → calendar-DjbO2g5L.cjs} +11 -11
- package/dist/{card-DI3KodEc.cjs → card-5S2r9UD1.cjs} +27 -27
- package/dist/{card-h8ekgJRr.js → card-CnPjrdre.js} +7 -7
- package/dist/{checkbox-BJ9pz3kV.js → checkbox-BSz71IeT.js} +4 -4
- package/dist/{checkbox-B2t7wfxe.cjs → checkbox-D98_NjcU.cjs} +9 -9
- package/dist/{class-map-Dt2jXOlF.js → class-map-3ADKve8g.js} +3 -3
- package/dist/class-map-Bokp1SoS.cjs +5 -0
- package/dist/{combobox-BjAvk8Y-.js → combobox-CXBYVeh-.js} +11 -11
- package/dist/{combobox-HNN7GTzh.cjs → combobox-CZsCRADa.cjs} +12 -12
- package/dist/{consent-C37tuFwZ.cjs → consent-BQLkfN3d.cjs} +3 -3
- package/dist/{consent-DAk2BJ7I.js → consent-knPF4PS_.js} +3 -3
- package/dist/{datepicker-DvcH2QD9.js → datepicker-BOW852c2.js} +13 -13
- package/dist/{datepicker-2bneToiA.cjs → datepicker-BqGkvUmw.cjs} +21 -21
- package/dist/directive-helpers-B3Vpl3xV.cjs +5 -0
- package/dist/directive-helpers-CyPtA1_i.js +38 -0
- package/dist/element-CMTfByxQ.cjs +27 -0
- package/dist/{element-BXsf_NlG.js → element-CV9utnHJ.js} +114 -114
- package/dist/{heading-CBepYb7H.cjs → heading-B0XRE0lq.cjs} +1 -1
- package/dist/{heading-J7dN9nRi.js → heading-D9R5UBcv.js} +1 -1
- package/dist/{helptext-BG1P_9j0.cjs → helptext-BjW1WdOn.cjs} +3 -3
- package/dist/{helptext-Cm6FLBVf.js → helptext-TFpeGJ1P.js} +5 -5
- package/dist/{icon-DBZvMard.js → icon-D0IQAVwS.js} +3 -3
- package/dist/{icon-n4-ve48P.cjs → icon-Dj0oZZSa.cjs} +3 -3
- package/dist/if-defined-hKKmbsI8.cjs +5 -0
- package/dist/{if-defined-CxHgig4I.js → if-defined-rXcLNTzN.js} +1 -1
- package/dist/{input-element-CbjYtVou.js → input-element-Bkv6Yxld.js} +1 -1
- package/dist/{input-element-BBv4xjPb.cjs → input-element-DM0tY799.cjs} +1 -1
- package/dist/{input-wrapper-Bwmva-69.js → input-wrapper-CaUY90qz.js} +12 -12
- package/dist/{input-wrapper-CJqmwe3I.cjs → input-wrapper-JU4D2TGu.cjs} +19 -19
- package/dist/{link-BKnT-97D.js → link-Bscfb6s9.js} +4 -4
- package/dist/{link-DRPFqqEn.cjs → link-CDuv1jxx.cjs} +3 -3
- package/dist/{linkcard-02fxYQ2g.cjs → linkcard-3WUL0CpY.cjs} +3 -3
- package/dist/{linkcard-C2UENcqo.js → linkcard-wNgRxJ-S.js} +4 -4
- package/dist/{listbox-CLtowV6W.js → listbox-CI7Wfn_e.js} +8 -8
- package/dist/{listbox-C_0RhGhk.cjs → listbox-TRqKskJT.cjs} +12 -12
- package/dist/{loader-BW-AWQiE.js → loader-BF9K1VCZ.js} +5 -5
- package/dist/{loader-Cj4kUNRE.cjs → loader-C1LI8Q4z.cjs} +4 -4
- package/dist/{messagebox-CK0sSRep.cjs → messagebox-Dmot5szX.cjs} +4 -4
- package/dist/{messagebox-DB8tEXrV.js → messagebox-LBEzcr6B.js} +12 -12
- package/dist/{modal-ClYfWW2a.js → modal-CGHWsjk8.js} +5 -5
- package/dist/{modal-BzVQSQy2.cjs → modal-S9MOKOaz.cjs} +6 -6
- package/dist/pkt-accordion.cjs +1 -1
- package/dist/pkt-accordion.js +2 -2
- package/dist/pkt-alert.cjs +1 -1
- package/dist/pkt-alert.js +1 -1
- package/dist/pkt-backlink.cjs +1 -1
- package/dist/pkt-backlink.js +1 -1
- package/dist/pkt-button.cjs +1 -1
- package/dist/pkt-button.js +1 -1
- package/dist/pkt-calendar.cjs +1 -1
- package/dist/pkt-calendar.js +1 -1
- package/dist/pkt-card.cjs +1 -1
- package/dist/pkt-card.js +1 -1
- package/dist/pkt-checkbox.cjs +1 -1
- package/dist/pkt-checkbox.js +1 -1
- package/dist/pkt-combobox.cjs +1 -1
- package/dist/pkt-combobox.js +1 -1
- package/dist/pkt-consent.cjs +1 -1
- package/dist/pkt-consent.js +1 -1
- package/dist/pkt-datepicker.cjs +1 -1
- package/dist/pkt-datepicker.js +2 -2
- package/dist/pkt-header.cjs +52 -52
- package/dist/pkt-header.js +9 -9
- package/dist/pkt-heading.cjs +1 -1
- package/dist/pkt-heading.js +1 -1
- package/dist/pkt-helptext.cjs +1 -1
- package/dist/pkt-helptext.js +1 -1
- package/dist/pkt-icon.cjs +1 -1
- package/dist/pkt-icon.js +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +26 -26
- 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-progressbar.cjs +1 -1
- package/dist/pkt-progressbar.js +2 -2
- 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 +2 -2
- 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/{progressbar-ClZOyCz9.cjs → progressbar-Bxh335uT.cjs} +5 -5
- package/dist/{progressbar-CJa70NEo.js → progressbar-GSA4Md1u.js} +7 -7
- package/dist/{radiobutton-DWoYQn8H.cjs → radiobutton-95wp024h.cjs} +7 -7
- package/dist/{radiobutton-CvKKNFMd.js → radiobutton-CTFAV5GU.js} +9 -9
- package/dist/{ref-C5iJMIE1.cjs → ref-CxLwrCxt.cjs} +3 -3
- package/dist/{ref-BxiKhrfa.js → ref-Dma3n3i8.js} +5 -5
- package/dist/repeat-C-FJ2vfy.cjs +5 -0
- package/dist/repeat-DnlRNf63.js +61 -0
- package/dist/{select-BQUp88lY.cjs → select-CZ_Lx5W6.cjs} +2 -2
- package/dist/{select-CFkxir_l.js → select-YLvYAQX6.js} +6 -6
- package/dist/{state-GDzxl12x.cjs → state-BNgpvY-A.cjs} +1 -1
- package/dist/{state-DgnkjP0q.js → state-l4hGZdFJ.js} +1 -1
- package/dist/tabitem-BKv4eN0a.cjs +65 -0
- package/dist/{tabitem-C8-tZyc_.js → tabitem-DQRzgAT4.js} +10 -10
- package/dist/{tag-DIJMJhyp.js → tag-68q0_Sn0.js} +6 -6
- package/dist/{tag-h0vD2Na0.cjs → tag-BnT5onW2.cjs} +4 -4
- package/dist/{textarea-DcCOfNlr.cjs → textarea-CuTsE1WX.cjs} +3 -3
- package/dist/{textarea-CMuiBUee.js → textarea-DhWH99qN.js} +16 -16
- package/dist/{textinput-D30TCADP.js → textinput-BCi9p0Du.js} +8 -8
- package/dist/{textinput-DR3aaHTH.cjs → textinput-st4Vml5J.cjs} +11 -11
- package/package.json +3 -3
- package/dist/accordionitem-DUWhTUEI.cjs +0 -34
- package/dist/class-map-CApIYSRo.cjs +0 -5
- package/dist/directive-helpers-CQef4qUQ.js +0 -38
- package/dist/directive-helpers-CYIEJ8pI.cjs +0 -5
- package/dist/element-aUzIoa1s.cjs +0 -27
- package/dist/if-defined-BElHLTlB.cjs +0 -5
- package/dist/repeat-B55jMEsG.js +0 -61
- package/dist/repeat-DcYSFU2y.cjs +0 -5
- package/dist/tabitem-DaYfUaxw.cjs +0 -65
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as y, E as P, P as k, b as I, n as p, t as _ } from "./element-CV9utnHJ.js";
|
|
2
2
|
import { e as m, i as S, t as b } from "./directive-oAbCiebi.js";
|
|
3
3
|
/**
|
|
4
4
|
* @license
|
|
@@ -47,7 +47,7 @@ const a = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',
|
|
|
47
47
|
} catch {
|
|
48
48
|
return t > 0 ? (await new Promise((s) => setTimeout(s, F)), v(e, t - 1)) : (console.error("Failed to fetch icon: " + e), a);
|
|
49
49
|
}
|
|
50
|
-
},
|
|
50
|
+
}, A = async (e, t) => {
|
|
51
51
|
const n = t + e + ".svg";
|
|
52
52
|
return g && sessionStorage.getItem(n) ? sessionStorage.getItem(n) : n in r ? r[n] : typeof window < "u" && typeof window.pktFetch == "function" ? (r[n] = v(n).then((s) => (s !== a && g && sessionStorage.setItem(n, s), delete r[n], s)), r[n]) : a;
|
|
53
53
|
};
|
|
@@ -69,7 +69,7 @@ let i = class extends k {
|
|
|
69
69
|
this.path || (this.path = typeof window < "u" ? window.pktIconPath : w);
|
|
70
70
|
try {
|
|
71
71
|
this.icon = f(
|
|
72
|
-
await
|
|
72
|
+
await A(this.name || "", this.path)
|
|
73
73
|
);
|
|
74
74
|
} catch {
|
|
75
75
|
this.icon = f(a);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";const s=require("./element-
|
|
1
|
+
"use strict";const s=require("./element-CMTfByxQ.cjs"),h=require("./directive-C7oCP5Bh.cjs");/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/class p extends h.i{constructor(t){if(super(t),this.it=s.
|
|
5
|
+
*/class p extends h.i{constructor(t){if(super(t),this.it=s.A,t.type!==h.t.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===s.A||t==null)return this._t=void 0,this.it=t;if(t===s.E)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}p.directiveName="unsafeHTML",p.resultType=1;const k=h.e(p);/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/class l extends p{}l.directiveName="unsafeSVG",l.resultType=2;const f=h.e(l);var I=Object.defineProperty,P=Object.getOwnPropertyDescriptor,a=(n,t,e,o)=>{for(var i=o>1?void 0:o?P(t,e):t,d=n.length-1,u;d>=0;d--)(u=n[d])&&(i=(o?u(t,e,i):u(i))||i);return o&&i&&I(t,e,i),i};const w="https://punkt-cdn.oslo.kommune.no/latest/icons/";typeof window<"u"&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||w);const c='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',r={},m=2,v=1500,y=typeof Storage<"u"&&typeof sessionStorage<"u",_=n=>window.pktFetch(n).then(t=>{if(!t.ok)throw new Error("Missing icon: "+n);return t.text()}),g=async(n,t=m)=>{try{return await _(n)}catch{return t>0?(await new Promise(o=>setTimeout(o,v)),g(n,t-1)):(console.error("Failed to fetch icon: "+n),c)}},S=async(n,t)=>{const e=t+n+".svg";return y&&sessionStorage.getItem(e)?sessionStorage.getItem(e):e in r?r[e]:typeof window<"u"&&typeof window.pktFetch=="function"?(r[e]=g(e).then(o=>(o!==c&&y&&sessionStorage.setItem(e,o),delete r[e],o)),r[e]):c};exports.PktIcon=class extends s.PktElement{constructor(){super(...arguments),this.path=typeof window<"u"?window.pktIconPath:w,this.name="",this.icon=f(c),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(t,e,o){super.attributeChangedCallback(t,e,o),(t==="name"||t==="path")&&this.getIcon(this.name)}async updated(t){super.updated(t),(t.has("name")||t.has("path"))&&this.getIcon(this.name)}async getIcon(t=""){if(this._updatedProps.length>0){this.path||(this.path=typeof window<"u"?window.pktIconPath:w);try{this.icon=f(await S(this.name||"",this.path))}catch{this.icon=f(c)}this._updatedProps=[]}else this._updatedProps.includes(t)||this._updatedProps.push(t)}render(){return s.
|
|
9
|
+
*/class l extends p{}l.directiveName="unsafeSVG",l.resultType=2;const f=h.e(l);var I=Object.defineProperty,P=Object.getOwnPropertyDescriptor,a=(n,t,e,o)=>{for(var i=o>1?void 0:o?P(t,e):t,d=n.length-1,u;d>=0;d--)(u=n[d])&&(i=(o?u(t,e,i):u(i))||i);return o&&i&&I(t,e,i),i};const w="https://punkt-cdn.oslo.kommune.no/latest/icons/";typeof window<"u"&&(window.pktFetch=window.pktFetch===void 0?fetch:window.pktFetch,window.pktIconPath=window.pktIconPath||w);const c='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"></svg>',r={},m=2,v=1500,y=typeof Storage<"u"&&typeof sessionStorage<"u",_=n=>window.pktFetch(n).then(t=>{if(!t.ok)throw new Error("Missing icon: "+n);return t.text()}),g=async(n,t=m)=>{try{return await _(n)}catch{return t>0?(await new Promise(o=>setTimeout(o,v)),g(n,t-1)):(console.error("Failed to fetch icon: "+n),c)}},S=async(n,t)=>{const e=t+n+".svg";return y&&sessionStorage.getItem(e)?sessionStorage.getItem(e):e in r?r[e]:typeof window<"u"&&typeof window.pktFetch=="function"?(r[e]=g(e).then(o=>(o!==c&&y&&sessionStorage.setItem(e,o),delete r[e],o)),r[e]):c};exports.PktIcon=class extends s.PktElement{constructor(){super(...arguments),this.path=typeof window<"u"?window.pktIconPath:w,this.name="",this.icon=f(c),this._updatedProps=[]}connectedCallback(){super.connectedCallback(),this.classList.add("pkt-icon")}async attributeChangedCallback(t,e,o){super.attributeChangedCallback(t,e,o),(t==="name"||t==="path")&&this.getIcon(this.name)}async updated(t){super.updated(t),(t.has("name")||t.has("path"))&&this.getIcon(this.name)}async getIcon(t=""){if(this._updatedProps.length>0){this.path||(this.path=typeof window<"u"?window.pktIconPath:w);try{this.icon=f(await S(this.name||"",this.path))}catch{this.icon=f(c)}this._updatedProps=[]}else this._updatedProps.includes(t)||this._updatedProps.push(t)}render(){return s.b`${this.name&&this.icon}`}};a([s.n({type:String,reflect:!1})],exports.PktIcon.prototype,"path",2);a([s.n({type:String,reflect:!0})],exports.PktIcon.prototype,"name",2);a([s.n({type:SVGElement})],exports.PktIcon.prototype,"icon",2);a([s.n({type:Array,noAccessor:!0})],exports.PktIcon.prototype,"_updatedProps",2);exports.PktIcon=a([s.t("pkt-icon")],exports.PktIcon);exports.o=k;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as Ft, s as g, n as o } from "./element-
|
|
1
|
+
import { P as Ft, s as g, n as o } from "./element-CV9utnHJ.js";
|
|
2
2
|
import { u as Tt } from "./utils-DznhwRXm.js";
|
|
3
3
|
import { b as xt } from "./booleanish-C9R0tdXH.js";
|
|
4
4
|
import { s as It } from "./input-wrapper-CDgenrYA.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const r=require("./element-aUzIoa1s.cjs"),St=require("./utils-byXsEz1u.cjs"),Ft=require("./booleanish-BKVonob4.cjs"),Tt=require("./input-wrapper-EoSAbU-U.cjs");var lt={},ct;function xt(){return ct||(ct=1,(function(){(function(p){const a=new WeakMap,n=new WeakMap,f=new WeakMap,u=new WeakMap,b=new WeakMap,k=new WeakMap,A=new WeakMap,g=new WeakMap,C=new WeakMap,V=new WeakMap,S=new WeakMap,F=new WeakMap,z=new WeakMap,K=new WeakMap,x=new WeakMap,I={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"},ht=(e,t)=>{for(let i in I){t[i]=null;let s=null;const o=I[i];Object.defineProperty(t,i,{get(){return s},set(d){s=d,e.isConnected?M(e,o,d):V.set(e,t)}})}};function j(e){const t=u.get(e),{form:i}=t;Z(e,i,t),Y(e,t.labels)}const G=(e,t=!1)=>{const i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(d){return u.has(d)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let s=i.nextNode();const o=!t||e.disabled;for(;s;)s.formDisabledCallback&&o&&_(s,e.disabled),s=i.nextNode()},J={attributes:!0,attributeFilter:["disabled","name"]},R=O()?new MutationObserver(e=>{for(const t of e){const i=t.target;if(t.attributeName==="disabled"&&(i.constructor.formAssociated?_(i,i.hasAttribute("disabled")):i.localName==="fieldset"&&G(i)),t.attributeName==="name"&&i.constructor.formAssociated){const s=u.get(i),o=C.get(i);s.setFormValue(o)}}}):{};function P(e){e.forEach(t=>{const{addedNodes:i,removedNodes:s}=t,o=Array.from(i),d=Array.from(s);o.forEach(h=>{var y;if(u.has(h)&&h.constructor.formAssociated&&j(h),V.has(h)){const m=V.get(h);Object.keys(I).filter(v=>m[v]!==null).forEach(v=>{M(h,I[v],m[v])}),V.delete(h)}if(x.has(h)){const m=x.get(h);M(h,"internals-valid",m.validity.valid.toString()),M(h,"internals-invalid",(!m.validity.valid).toString()),M(h,"aria-invalid",(!m.validity.valid).toString()),x.delete(h)}if(h.localName==="form"){const m=g.get(h),E=document.createTreeWalker(h,NodeFilter.SHOW_ELEMENT,{acceptNode($){return u.has($)&&$.constructor.formAssociated&&!(m&&m.has($))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let v=E.nextNode();for(;v;)j(v),v=E.nextNode()}h.localName==="fieldset"&&((y=R.observe)===null||y===void 0||y.call(R,h,J),G(h,!0))}),d.forEach(h=>{const y=u.get(h);y&&f.get(y)&&Q(y),A.has(h)&&A.get(h).disconnect()})})}function ut(e){e.forEach(t=>{const{removedNodes:i}=t;i.forEach(s=>{const o=z.get(t.target);u.has(s)&&et(s),o.disconnect()})})}const ft=e=>{var t,i;const s=new MutationObserver(ut);!((t=window==null?void 0:window.ShadyDOM)===null||t===void 0)&&t.inUse&&e.mode&&e.host&&(e=e.host),(i=s.observe)===null||i===void 0||i.call(s,e,{childList:!0}),z.set(e,s)};O()&&new MutationObserver(P);const B={childList:!0,subtree:!0},M=(e,t,i)=>{e.getAttribute(t)!==i&&e.setAttribute(t,i)},_=(e,t)=>{e.toggleAttribute("internals-disabled",t),t?M(e,"aria-disabled","true"):e.removeAttribute("aria-disabled"),e.formDisabledCallback&&e.formDisabledCallback.apply(e,[t])},Q=e=>{f.get(e).forEach(i=>{i.remove()}),f.set(e,[])},X=(e,t)=>{const i=document.createElement("input");return i.type="hidden",i.name=e.getAttribute("name"),e.after(i),f.get(t).push(i),i},pt=(e,t)=>{var i;f.set(t,[]),(i=R.observe)===null||i===void 0||i.call(R,e,J)},Y=(e,t)=>{if(t.length){Array.from(t).forEach(s=>s.addEventListener("click",e.click.bind(e)));let i=t[0].id;t[0].id||(i=`${t[0].htmlFor}_Label`,t[0].id=i),M(e,"aria-labelledby",i)}},L=e=>{const t=Array.from(e.elements).filter(d=>!d.tagName.includes("-")&&d.validity).map(d=>d.validity.valid),i=g.get(e)||[],s=Array.from(i).filter(d=>d.isConnected).map(d=>u.get(d).validity.valid),o=[...t,...s].includes(!1);e.toggleAttribute("internals-invalid",o),e.toggleAttribute("internals-valid",!o)},mt=e=>{L(N(e.target))},yt=e=>{L(N(e.target))},gt=e=>{const t=["button[type=submit]","input[type=submit]","button:not([type])"].map(i=>`${i}:not([disabled])`).map(i=>`${i}:not([form])${e.id?`,${i}[form='${e.id}']`:""}`).join(",");e.addEventListener("click",i=>{if(i.target.closest(t)){const o=g.get(e);if(e.noValidate)return;o.size&&Array.from(o).reverse().map(y=>u.get(y).reportValidity()).includes(!1)&&i.preventDefault()}})},vt=e=>{const t=g.get(e.target);t&&t.size&&t.forEach(i=>{i.constructor.formAssociated&&i.formResetCallback&&i.formResetCallback.apply(i)})},Z=(e,t,i)=>{if(t){const s=g.get(t);if(s)s.add(e);else{const o=new Set;o.add(e),g.set(t,o),gt(t),t.addEventListener("reset",vt),t.addEventListener("input",mt),t.addEventListener("change",yt)}k.set(t,{ref:e,internals:i}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout(()=>{e.formAssociatedCallback.apply(e,[t])},0),L(t)}},N=e=>{let t=e.parentNode;return t&&t.tagName!=="FORM"&&(t=N(t)),t},w=(e,t,i=DOMException)=>{if(!e.constructor.formAssociated)throw new i(t)},tt=(e,t,i)=>{const s=g.get(e);return s&&s.size&&s.forEach(o=>{u.get(o)[i]()||(t=!1)}),t},et=e=>{if(e.constructor.formAssociated){const t=u.get(e),{labels:i,form:s}=t;Y(e,i),Z(e,s,t)}};function O(){return typeof MutationObserver<"u"}class bt{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)}}const wt=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),Et=(e,t,i)=>(e.valid=Mt(t),Object.keys(t).forEach(s=>e[s]=t[s]),i&&L(i),e),Mt=e=>{let t=!0;for(let i in e)i!=="valid"&&e[i]!==!1&&(t=!1);return t},H=new WeakMap;function it(e,t){e.toggleAttribute(t,!0),e.part&&e.part.add(t)}class W extends Set{static get isPolyfilled(){return!0}constructor(t){if(super(),!t||!t.tagName||t.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");H.set(this,t)}add(t){if(!/^--/.test(t)||typeof t!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${t} must start with '--'.`);const i=super.add(t),s=H.get(this),o=`state${t}`;return s.isConnected?it(s,o):setTimeout(()=>{it(s,o)}),i}clear(){for(let[t]of this.entries())this.delete(t);super.clear()}delete(t){const i=super.delete(t),s=H.get(this);return s.isConnected?(s.toggleAttribute(`state${t}`,!1),s.part&&s.part.remove(`state${t}`)):setTimeout(()=>{s.toggleAttribute(`state${t}`,!1),s.part&&s.part.remove(`state${t}`)}),i}}function at(e,t,i,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?s:i==="a"?s.call(e):s?s.value:t.get(e)}function kt(e,t,i,s,o){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,i),i}var T;class Vt{constructor(t){T.set(this,void 0),kt(this,T,t);for(let i=0;i<t.length;i++){let s=t[i];this[i]=s,s.hasAttribute("name")&&(this[s.getAttribute("name")]=s)}Object.freeze(this)}get length(){return at(this,T,"f").length}[(T=new WeakMap,Symbol.iterator)](){return at(this,T,"f")[Symbol.iterator]()}item(t){return this[t]==null?null:this[t]}namedItem(t){return this[t]==null?null:this[t]}}function At(){const e=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=i;const t=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=s;function i(...d){let h=e.apply(this,d);return tt(this,h,"checkValidity")}function s(...d){let h=t.apply(this,d);return tt(this,h,"reportValidity")}const{get:o}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...d){const h=o.call(this,...d),y=Array.from(g.get(this)||[]);if(y.length===0)return h;const m=Array.from(h).concat(y).sort((E,v)=>E.compareDocumentPosition?E.compareDocumentPosition(v)&2?1:-1:0);return new Vt(m)}})}class st{static get isPolyfilled(){return!0}constructor(t){if(!t||!t.tagName||t.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const i=t.getRootNode(),s=new bt;this.states=new W(t),a.set(this,t),n.set(this,s),u.set(t,this),ht(t,this),pt(t,this),Object.seal(this),i instanceof DocumentFragment&&ft(i)}checkValidity(){const t=a.get(this);if(w(t,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const i=n.get(this);if(!i.valid){const s=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});t.dispatchEvent(s)}return i.valid}get form(){const t=a.get(this);w(t,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let i;return t.constructor.formAssociated===!0&&(i=N(t)),i}get labels(){const t=a.get(this);w(t,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const i=t.getAttribute("id"),s=t.getRootNode();return s&&i?s.querySelectorAll(`[for="${i}"]`):[]}reportValidity(){const t=a.get(this);if(w(t,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const i=this.checkValidity(),s=F.get(this);if(s&&!t.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!i&&s&&(t.focus(),s.focus()),i}setFormValue(t){const i=a.get(this);if(w(i,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),Q(this),t!=null&&!(t instanceof FormData)){if(i.getAttribute("name")){const s=X(i,this);s.value=t}}else t!=null&&t instanceof FormData&&Array.from(t).reverse().forEach(([s,o])=>{if(typeof o=="string"){const d=X(i,this);d.name=s,d.value=o}});C.set(i,t)}setValidity(t,i,s){const o=a.get(this);if(w(o,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!t)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");F.set(this,s);const d=n.get(this),h={};for(const E in t)h[E]=t[E];Object.keys(h).length===0&&wt(d);const y=Object.assign(Object.assign({},d),h);delete y.valid;const{valid:m}=Et(d,y,this.form);if(!m&&!i)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.");b.set(this,m?"":i),o.isConnected?(o.toggleAttribute("internals-invalid",!m),o.toggleAttribute("internals-valid",m),M(o,"aria-invalid",`${!m}`)):x.set(o,this)}get shadowRoot(){const t=a.get(this),i=S.get(t);return i||null}get validationMessage(){const t=a.get(this);return w(t,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),b.get(this)}get validity(){const t=a.get(this);return w(t,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),n.get(this)}get willValidate(){const t=a.get(this);return w(t,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(t.disabled||t.hasAttribute("disabled")||t.hasAttribute("readonly"))}}function Ct(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class e extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const t=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(t,e);const i=new e;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(s=>s in i.internals)}let rt=!1,nt=!1;function q(e){nt||(nt=!0,window.CustomStateSet=W,e&&(HTMLElement.prototype.attachInternals=function(...t){const i=e.call(this,t);return i.states=new W(this),i}))}function ot(e=!0){if(!rt){if(rt=!0,typeof window<"u"&&(window.ElementInternals=st),typeof CustomElementRegistry<"u"){const t=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(i,s,o){if(s.formAssociated){const d=s.prototype.connectedCallback;s.prototype.connectedCallback=function(){K.has(this)||(K.set(this,!0),this.hasAttribute("disabled")&&_(this,!0)),d!=null&&d.apply(this),et(this)}}t.call(this,i,s,o)}}if(typeof HTMLElement<"u"&&(HTMLElement.prototype.attachInternals=function(){if(this.tagName){if(this.tagName.indexOf("-")===-1)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.")}else return{};if(u.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new st(this)}),typeof Element<"u"){let t=function(...s){const o=i.apply(this,s);if(S.set(this,o),O()){const d=new MutationObserver(P);window.ShadyDOM?d.observe(this,B):d.observe(o,B),A.set(this,d)}return o};const i=Element.prototype.attachShadow;Element.prototype.attachShadow=t}O()&&typeof document<"u"&&new MutationObserver(P).observe(document.documentElement,B),typeof HTMLFormElement<"u"&&At(),(e||typeof window<"u"&&!window.CustomStateSet)&&q()}}return!!customElements.polyfillWrapFlushCallback||(Ct()?typeof window<"u"&&!window.CustomStateSet&&q(HTMLElement.prototype.attachInternals):ot(!1)),p.forceCustomStateSetPolyfill=q,p.forceElementInternalsPolyfill=ot,Object.defineProperty(p,"__esModule",{value:!0}),p})({})})()),lt}xt();var It=Object.defineProperty,c=(p,a,n,f)=>{for(var u=void 0,b=p.length-1,k;b>=0;b--)(k=p[b])&&(u=k(a,n,u)||u);return u&&It(a,n,u),u};const dt="on",U="--checked",D=",";class l extends r.PktElement{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=St.uuidish(),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=Tt.specs.props.helptextDropdownButton.default,this.label=null,this.optionalText=r.strings.forms.labels.optional,this.requiredText=r.strings.forms.labels.required,this.tagText=null,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(a){var n,f,u,b,k,A,g,C,V,S,F;if(!a){console.warn("manageValidity called without valid input element");return}this.required&&!this.value?this.internals.setValidity({valueMissing:!0},r.strings.forms.messages.required,a):(n=a.validity)!=null&&n.typeMismatch||(f=a.validity)!=null&&f.badInput?this.internals.setValidity({typeMismatch:!0},r.strings.forms.messages.invalid,a):(u=a.validity)!=null&&u.patternMismatch?this.internals.setValidity({patternMismatch:!0},r.strings.forms.messages.invalidPattern,a):(b=a.validity)!=null&&b.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},r.strings.forms.messages.tooShort,a):(k=a.validity)!=null&&k.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},r.strings.forms.messages.tooLong,a):(A=a.validity)!=null&&A.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?r.strings.forms.messages.rangeUnderflowMin.replace("{min}",(g=this.min)==null?void 0:g.toString()):r.strings.forms.messages.rangeUnderflow,a):(C=a.validity)!=null&&C.stepMismatch?this.internals.setValidity({stepMismatch:!0},r.strings.forms.messages.invalid,a):(V=a.validity)!=null&&V.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?r.strings.forms.messages.rangeOverflowMax.replace("{max}",(S=this.max)==null?void 0:S.toString()):r.strings.forms.messages.rangeOverflow,a):(F=a.validity)!=null&&F.customError?this.internals.setValidity({customError:!0},a.validationMessage,a):this.internals.setValidity({})}setFormValue(a){if(this.internals)if(Array.isArray(a)){const n=new FormData;a.forEach(f=>{n.append(this.name,f)}),this.internals.setFormValue(n)}else this.internals.setFormValue(a)}coordinateRadioGroup(){if(!this.form||!this.name||this.type!=="radio")return;const a=`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`;this.form.querySelectorAll(a).forEach(n=>{var f;if(n!==this&&n.getAttribute("name")===this.name&&n.getAttribute("value")!==this.value){const u=n;u.checked&&(u.checked=!1,u.internals&&(u.internals.setFormValue(null),(f=u.internals.states)==null||f.delete(U)))}})}valueChecked(a){if(!this.touched)return;const n=this.internals.form||this.closest("form"),f=n?new FormData(n):null;if(this.type==="radio"&&this.coordinateRadioGroup(),typeof a=="string"?(this.checked=a==="true",this.internals.ariaChecked=String(a==="true")):typeof a=="boolean"&&(this.checked=a,this.internals.ariaChecked=String(a)),this.checked){const u=(typeof this.value=="string"?this.value:"")||dt;this.internals.setFormValue(u),f&&f.append(this.name,u),this.internals.states.add(U)}else this.internals.setFormValue(null),f&&f.delete(this.name),this.internals.states.delete(U);this.dispatchChangeEvents(this.checked),this.internals.reportValidity()}valueChanged(a,n){(n!==this.value||n!==this._value)&&(typeof a=="string"?((this.multiple||this.range)&&a.includes(D)&&(a=a.split(D)),this.value=a,this._value=Array.isArray(a)?a:[a]):Array.isArray(a)?(this.value=this.multiple||this.range?a:a[0],this._value=a):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&n&&n.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(n==null?void 0:n.toString())&&this.onChange(this.value))}dispatchChangeEvents(a){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:a,bubbles:!0,composed:!0}))}clearInputValue(){const a=this.multiple||this.range?[]:"";this.value=a,this.setFormValue(a),this.dispatchChangeEvents(a)}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(a){return(this.range||this.multiple)&&typeof a=="string"&&a.includes(D)?a.split(D):!this.multiple&&!this.range&&Array.isArray(a)?a[0]||"":a}validate(){var a,n;(a=this.inputRef)!=null&&a.value&&this.manageValidity(this.inputRef.value),(n=this.inputRefTo)!=null&&n.value&&this.manageValidity(this.inputRefTo.value)}onChange(a){if(!this.touched){this.touched=!0,a&&this.setFormValue(a);return}if(typeof a!="string"&&!Array.isArray(a))return;const n=this.normalizeValue(a);this.setFormValue(n),this.validate(),this.dispatchChangeEvents(n)}formResetCallback(){var a;if(this.touched=!1,this._options&&this._options.length&&this._options.forEach(n=>{"selected"in n&&(n.selected=!1)}),this.checked!==void 0)this.checked=!1,this.internals.ariaChecked="false",this.internals.setFormValue(""),(a=this.inputRef)!=null&&a.value&&"checked"in this.inputRef.value&&(this.inputRef.value.checked=!1),this.valueChecked(this.checked);else{this.internals.setFormValue("");const n=this.defaultValue||(this.multiple||this.range?[]:"");this.value=n,this._value=Array.isArray(n)?n:[n],this.valueChanged(this.value,null)}this.internals.ariaInvalid="false"}updated(a){super.updated(a),a.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(a){if(super.firstUpdated(a),!this.form){const n=this.internals.form||this.closest("form");this.form=n}if(this.value&&this.defaultValue!==null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked="true",this.checked=!0),this.required&&(this.internals.ariaRequired="true"),this.disabled&&(this.internals.ariaDisabled="true"),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const n=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=String(n);const f=n?(typeof this.value=="string"?this.value:"")||dt:null;this.internals.setFormValue(f)}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))}}c([r.n({type:Boolean,reflect:!0})],l.prototype,"checked");c([r.n({type:Boolean})],l.prototype,"defaultChecked");c([r.n({type:Boolean})],l.prototype,"multiple");c([r.n({type:Boolean})],l.prototype,"range");c([r.n({type:String,reflect:!0})],l.prototype,"type");c([r.n()],l.prototype,"defaultValue");c([r.n({type:Boolean,reflect:!0})],l.prototype,"disabled");c([r.n({type:Boolean,reflect:!0})],l.prototype,"readonly");c([r.n({type:Boolean,reflect:!0})],l.prototype,"required");c([r.n({reflect:!0,converter:{fromAttribute:p=>p,toAttribute:p=>(p==null?void 0:p.toString())??null}})],l.prototype,"max");c([r.n({type:Number,reflect:!0})],l.prototype,"maxlength");c([r.n({reflect:!0,converter:{fromAttribute:p=>p,toAttribute:p=>(p==null?void 0:p.toString())??null}})],l.prototype,"min");c([r.n({type:Number,reflect:!0})],l.prototype,"minlength");c([r.n({type:Number,reflect:!0})],l.prototype,"step");c([r.n({type:String})],l.prototype,"ariaDescribedBy");c([r.n({type:String})],l.prototype,"ariaLabelledby");c([r.n({type:String,reflect:!0})],l.prototype,"name");c([r.n({type:String,reflect:!0})],l.prototype,"pattern");c([r.n({type:String,reflect:!0})],l.prototype,"placeholder");c([r.n({type:String,reflect:!0})],l.prototype,"id");c([r.n({type:Boolean})],l.prototype,"counter");c([r.n({type:Boolean})],l.prototype,"hasError");c([r.n({type:Boolean})],l.prototype,"inline");c([r.n({type:Boolean})],l.prototype,"hasFieldset");c([r.n({type:Boolean})],l.prototype,"optionalTag");c([r.n({type:Boolean})],l.prototype,"requiredTag");c([r.n({type:Boolean})],l.prototype,"skipForwardTestid");c([r.n({type:Boolean,reflect:!0,converter:Ft.booleanishConverter})],l.prototype,"useWrapper");c([r.n({type:Boolean,reflect:!0})],l.prototype,"fullwidth");c([r.n({type:Number})],l.prototype,"counterMaxLength");c([r.n({type:String})],l.prototype,"errorMessage");c([r.n({type:String})],l.prototype,"helptext");c([r.n({type:String})],l.prototype,"helptextDropdown");c([r.n({type:String,reflect:!1})],l.prototype,"helptextDropdownButton");c([r.n({type:String})],l.prototype,"label");c([r.n({type:String,reflect:!1})],l.prototype,"optionalText");c([r.n({type:String,reflect:!1})],l.prototype,"requiredText");c([r.n({type:String,reflect:!1})],l.prototype,"tagText");c([r.n({type:String,attribute:"data-testid"})],l.prototype,"dataTestid");exports.PktInputElement=l;
|
|
1
|
+
"use strict";const r=require("./element-CMTfByxQ.cjs"),St=require("./utils-byXsEz1u.cjs"),Ft=require("./booleanish-BKVonob4.cjs"),Tt=require("./input-wrapper-EoSAbU-U.cjs");var lt={},ct;function xt(){return ct||(ct=1,(function(){(function(p){const a=new WeakMap,n=new WeakMap,f=new WeakMap,u=new WeakMap,b=new WeakMap,k=new WeakMap,A=new WeakMap,g=new WeakMap,C=new WeakMap,V=new WeakMap,S=new WeakMap,F=new WeakMap,z=new WeakMap,K=new WeakMap,x=new WeakMap,I={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"},ht=(e,t)=>{for(let i in I){t[i]=null;let s=null;const o=I[i];Object.defineProperty(t,i,{get(){return s},set(d){s=d,e.isConnected?M(e,o,d):V.set(e,t)}})}};function j(e){const t=u.get(e),{form:i}=t;Z(e,i,t),Y(e,t.labels)}const G=(e,t=!1)=>{const i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(d){return u.has(d)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let s=i.nextNode();const o=!t||e.disabled;for(;s;)s.formDisabledCallback&&o&&_(s,e.disabled),s=i.nextNode()},J={attributes:!0,attributeFilter:["disabled","name"]},R=O()?new MutationObserver(e=>{for(const t of e){const i=t.target;if(t.attributeName==="disabled"&&(i.constructor.formAssociated?_(i,i.hasAttribute("disabled")):i.localName==="fieldset"&&G(i)),t.attributeName==="name"&&i.constructor.formAssociated){const s=u.get(i),o=C.get(i);s.setFormValue(o)}}}):{};function P(e){e.forEach(t=>{const{addedNodes:i,removedNodes:s}=t,o=Array.from(i),d=Array.from(s);o.forEach(h=>{var y;if(u.has(h)&&h.constructor.formAssociated&&j(h),V.has(h)){const m=V.get(h);Object.keys(I).filter(v=>m[v]!==null).forEach(v=>{M(h,I[v],m[v])}),V.delete(h)}if(x.has(h)){const m=x.get(h);M(h,"internals-valid",m.validity.valid.toString()),M(h,"internals-invalid",(!m.validity.valid).toString()),M(h,"aria-invalid",(!m.validity.valid).toString()),x.delete(h)}if(h.localName==="form"){const m=g.get(h),E=document.createTreeWalker(h,NodeFilter.SHOW_ELEMENT,{acceptNode($){return u.has($)&&$.constructor.formAssociated&&!(m&&m.has($))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let v=E.nextNode();for(;v;)j(v),v=E.nextNode()}h.localName==="fieldset"&&((y=R.observe)===null||y===void 0||y.call(R,h,J),G(h,!0))}),d.forEach(h=>{const y=u.get(h);y&&f.get(y)&&Q(y),A.has(h)&&A.get(h).disconnect()})})}function ut(e){e.forEach(t=>{const{removedNodes:i}=t;i.forEach(s=>{const o=z.get(t.target);u.has(s)&&et(s),o.disconnect()})})}const ft=e=>{var t,i;const s=new MutationObserver(ut);!((t=window==null?void 0:window.ShadyDOM)===null||t===void 0)&&t.inUse&&e.mode&&e.host&&(e=e.host),(i=s.observe)===null||i===void 0||i.call(s,e,{childList:!0}),z.set(e,s)};O()&&new MutationObserver(P);const B={childList:!0,subtree:!0},M=(e,t,i)=>{e.getAttribute(t)!==i&&e.setAttribute(t,i)},_=(e,t)=>{e.toggleAttribute("internals-disabled",t),t?M(e,"aria-disabled","true"):e.removeAttribute("aria-disabled"),e.formDisabledCallback&&e.formDisabledCallback.apply(e,[t])},Q=e=>{f.get(e).forEach(i=>{i.remove()}),f.set(e,[])},X=(e,t)=>{const i=document.createElement("input");return i.type="hidden",i.name=e.getAttribute("name"),e.after(i),f.get(t).push(i),i},pt=(e,t)=>{var i;f.set(t,[]),(i=R.observe)===null||i===void 0||i.call(R,e,J)},Y=(e,t)=>{if(t.length){Array.from(t).forEach(s=>s.addEventListener("click",e.click.bind(e)));let i=t[0].id;t[0].id||(i=`${t[0].htmlFor}_Label`,t[0].id=i),M(e,"aria-labelledby",i)}},L=e=>{const t=Array.from(e.elements).filter(d=>!d.tagName.includes("-")&&d.validity).map(d=>d.validity.valid),i=g.get(e)||[],s=Array.from(i).filter(d=>d.isConnected).map(d=>u.get(d).validity.valid),o=[...t,...s].includes(!1);e.toggleAttribute("internals-invalid",o),e.toggleAttribute("internals-valid",!o)},mt=e=>{L(N(e.target))},yt=e=>{L(N(e.target))},gt=e=>{const t=["button[type=submit]","input[type=submit]","button:not([type])"].map(i=>`${i}:not([disabled])`).map(i=>`${i}:not([form])${e.id?`,${i}[form='${e.id}']`:""}`).join(",");e.addEventListener("click",i=>{if(i.target.closest(t)){const o=g.get(e);if(e.noValidate)return;o.size&&Array.from(o).reverse().map(y=>u.get(y).reportValidity()).includes(!1)&&i.preventDefault()}})},vt=e=>{const t=g.get(e.target);t&&t.size&&t.forEach(i=>{i.constructor.formAssociated&&i.formResetCallback&&i.formResetCallback.apply(i)})},Z=(e,t,i)=>{if(t){const s=g.get(t);if(s)s.add(e);else{const o=new Set;o.add(e),g.set(t,o),gt(t),t.addEventListener("reset",vt),t.addEventListener("input",mt),t.addEventListener("change",yt)}k.set(t,{ref:e,internals:i}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout(()=>{e.formAssociatedCallback.apply(e,[t])},0),L(t)}},N=e=>{let t=e.parentNode;return t&&t.tagName!=="FORM"&&(t=N(t)),t},w=(e,t,i=DOMException)=>{if(!e.constructor.formAssociated)throw new i(t)},tt=(e,t,i)=>{const s=g.get(e);return s&&s.size&&s.forEach(o=>{u.get(o)[i]()||(t=!1)}),t},et=e=>{if(e.constructor.formAssociated){const t=u.get(e),{labels:i,form:s}=t;Y(e,i),Z(e,s,t)}};function O(){return typeof MutationObserver<"u"}class bt{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)}}const wt=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),Et=(e,t,i)=>(e.valid=Mt(t),Object.keys(t).forEach(s=>e[s]=t[s]),i&&L(i),e),Mt=e=>{let t=!0;for(let i in e)i!=="valid"&&e[i]!==!1&&(t=!1);return t},H=new WeakMap;function it(e,t){e.toggleAttribute(t,!0),e.part&&e.part.add(t)}class W extends Set{static get isPolyfilled(){return!0}constructor(t){if(super(),!t||!t.tagName||t.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");H.set(this,t)}add(t){if(!/^--/.test(t)||typeof t!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${t} must start with '--'.`);const i=super.add(t),s=H.get(this),o=`state${t}`;return s.isConnected?it(s,o):setTimeout(()=>{it(s,o)}),i}clear(){for(let[t]of this.entries())this.delete(t);super.clear()}delete(t){const i=super.delete(t),s=H.get(this);return s.isConnected?(s.toggleAttribute(`state${t}`,!1),s.part&&s.part.remove(`state${t}`)):setTimeout(()=>{s.toggleAttribute(`state${t}`,!1),s.part&&s.part.remove(`state${t}`)}),i}}function at(e,t,i,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?s:i==="a"?s.call(e):s?s.value:t.get(e)}function kt(e,t,i,s,o){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,i),i}var T;class Vt{constructor(t){T.set(this,void 0),kt(this,T,t);for(let i=0;i<t.length;i++){let s=t[i];this[i]=s,s.hasAttribute("name")&&(this[s.getAttribute("name")]=s)}Object.freeze(this)}get length(){return at(this,T,"f").length}[(T=new WeakMap,Symbol.iterator)](){return at(this,T,"f")[Symbol.iterator]()}item(t){return this[t]==null?null:this[t]}namedItem(t){return this[t]==null?null:this[t]}}function At(){const e=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=i;const t=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=s;function i(...d){let h=e.apply(this,d);return tt(this,h,"checkValidity")}function s(...d){let h=t.apply(this,d);return tt(this,h,"reportValidity")}const{get:o}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...d){const h=o.call(this,...d),y=Array.from(g.get(this)||[]);if(y.length===0)return h;const m=Array.from(h).concat(y).sort((E,v)=>E.compareDocumentPosition?E.compareDocumentPosition(v)&2?1:-1:0);return new Vt(m)}})}class st{static get isPolyfilled(){return!0}constructor(t){if(!t||!t.tagName||t.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const i=t.getRootNode(),s=new bt;this.states=new W(t),a.set(this,t),n.set(this,s),u.set(t,this),ht(t,this),pt(t,this),Object.seal(this),i instanceof DocumentFragment&&ft(i)}checkValidity(){const t=a.get(this);if(w(t,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const i=n.get(this);if(!i.valid){const s=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});t.dispatchEvent(s)}return i.valid}get form(){const t=a.get(this);w(t,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let i;return t.constructor.formAssociated===!0&&(i=N(t)),i}get labels(){const t=a.get(this);w(t,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const i=t.getAttribute("id"),s=t.getRootNode();return s&&i?s.querySelectorAll(`[for="${i}"]`):[]}reportValidity(){const t=a.get(this);if(w(t,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const i=this.checkValidity(),s=F.get(this);if(s&&!t.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!i&&s&&(t.focus(),s.focus()),i}setFormValue(t){const i=a.get(this);if(w(i,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),Q(this),t!=null&&!(t instanceof FormData)){if(i.getAttribute("name")){const s=X(i,this);s.value=t}}else t!=null&&t instanceof FormData&&Array.from(t).reverse().forEach(([s,o])=>{if(typeof o=="string"){const d=X(i,this);d.name=s,d.value=o}});C.set(i,t)}setValidity(t,i,s){const o=a.get(this);if(w(o,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!t)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");F.set(this,s);const d=n.get(this),h={};for(const E in t)h[E]=t[E];Object.keys(h).length===0&&wt(d);const y=Object.assign(Object.assign({},d),h);delete y.valid;const{valid:m}=Et(d,y,this.form);if(!m&&!i)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.");b.set(this,m?"":i),o.isConnected?(o.toggleAttribute("internals-invalid",!m),o.toggleAttribute("internals-valid",m),M(o,"aria-invalid",`${!m}`)):x.set(o,this)}get shadowRoot(){const t=a.get(this),i=S.get(t);return i||null}get validationMessage(){const t=a.get(this);return w(t,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),b.get(this)}get validity(){const t=a.get(this);return w(t,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),n.get(this)}get willValidate(){const t=a.get(this);return w(t,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(t.disabled||t.hasAttribute("disabled")||t.hasAttribute("readonly"))}}function Ct(){if(typeof window>"u"||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class e extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const t=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(t,e);const i=new e;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(s=>s in i.internals)}let rt=!1,nt=!1;function q(e){nt||(nt=!0,window.CustomStateSet=W,e&&(HTMLElement.prototype.attachInternals=function(...t){const i=e.call(this,t);return i.states=new W(this),i}))}function ot(e=!0){if(!rt){if(rt=!0,typeof window<"u"&&(window.ElementInternals=st),typeof CustomElementRegistry<"u"){const t=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(i,s,o){if(s.formAssociated){const d=s.prototype.connectedCallback;s.prototype.connectedCallback=function(){K.has(this)||(K.set(this,!0),this.hasAttribute("disabled")&&_(this,!0)),d!=null&&d.apply(this),et(this)}}t.call(this,i,s,o)}}if(typeof HTMLElement<"u"&&(HTMLElement.prototype.attachInternals=function(){if(this.tagName){if(this.tagName.indexOf("-")===-1)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.")}else return{};if(u.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new st(this)}),typeof Element<"u"){let t=function(...s){const o=i.apply(this,s);if(S.set(this,o),O()){const d=new MutationObserver(P);window.ShadyDOM?d.observe(this,B):d.observe(o,B),A.set(this,d)}return o};const i=Element.prototype.attachShadow;Element.prototype.attachShadow=t}O()&&typeof document<"u"&&new MutationObserver(P).observe(document.documentElement,B),typeof HTMLFormElement<"u"&&At(),(e||typeof window<"u"&&!window.CustomStateSet)&&q()}}return!!customElements.polyfillWrapFlushCallback||(Ct()?typeof window<"u"&&!window.CustomStateSet&&q(HTMLElement.prototype.attachInternals):ot(!1)),p.forceCustomStateSetPolyfill=q,p.forceElementInternalsPolyfill=ot,Object.defineProperty(p,"__esModule",{value:!0}),p})({})})()),lt}xt();var It=Object.defineProperty,c=(p,a,n,f)=>{for(var u=void 0,b=p.length-1,k;b>=0;b--)(k=p[b])&&(u=k(a,n,u)||u);return u&&It(a,n,u),u};const dt="on",U="--checked",D=",";class l extends r.PktElement{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=St.uuidish(),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=Tt.specs.props.helptextDropdownButton.default,this.label=null,this.optionalText=r.strings.forms.labels.optional,this.requiredText=r.strings.forms.labels.required,this.tagText=null,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(a){var n,f,u,b,k,A,g,C,V,S,F;if(!a){console.warn("manageValidity called without valid input element");return}this.required&&!this.value?this.internals.setValidity({valueMissing:!0},r.strings.forms.messages.required,a):(n=a.validity)!=null&&n.typeMismatch||(f=a.validity)!=null&&f.badInput?this.internals.setValidity({typeMismatch:!0},r.strings.forms.messages.invalid,a):(u=a.validity)!=null&&u.patternMismatch?this.internals.setValidity({patternMismatch:!0},r.strings.forms.messages.invalidPattern,a):(b=a.validity)!=null&&b.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},r.strings.forms.messages.tooShort,a):(k=a.validity)!=null&&k.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},r.strings.forms.messages.tooLong,a):(A=a.validity)!=null&&A.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?r.strings.forms.messages.rangeUnderflowMin.replace("{min}",(g=this.min)==null?void 0:g.toString()):r.strings.forms.messages.rangeUnderflow,a):(C=a.validity)!=null&&C.stepMismatch?this.internals.setValidity({stepMismatch:!0},r.strings.forms.messages.invalid,a):(V=a.validity)!=null&&V.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?r.strings.forms.messages.rangeOverflowMax.replace("{max}",(S=this.max)==null?void 0:S.toString()):r.strings.forms.messages.rangeOverflow,a):(F=a.validity)!=null&&F.customError?this.internals.setValidity({customError:!0},a.validationMessage,a):this.internals.setValidity({})}setFormValue(a){if(this.internals)if(Array.isArray(a)){const n=new FormData;a.forEach(f=>{n.append(this.name,f)}),this.internals.setFormValue(n)}else this.internals.setFormValue(a)}coordinateRadioGroup(){if(!this.form||!this.name||this.type!=="radio")return;const a=`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`;this.form.querySelectorAll(a).forEach(n=>{var f;if(n!==this&&n.getAttribute("name")===this.name&&n.getAttribute("value")!==this.value){const u=n;u.checked&&(u.checked=!1,u.internals&&(u.internals.setFormValue(null),(f=u.internals.states)==null||f.delete(U)))}})}valueChecked(a){if(!this.touched)return;const n=this.internals.form||this.closest("form"),f=n?new FormData(n):null;if(this.type==="radio"&&this.coordinateRadioGroup(),typeof a=="string"?(this.checked=a==="true",this.internals.ariaChecked=String(a==="true")):typeof a=="boolean"&&(this.checked=a,this.internals.ariaChecked=String(a)),this.checked){const u=(typeof this.value=="string"?this.value:"")||dt;this.internals.setFormValue(u),f&&f.append(this.name,u),this.internals.states.add(U)}else this.internals.setFormValue(null),f&&f.delete(this.name),this.internals.states.delete(U);this.dispatchChangeEvents(this.checked),this.internals.reportValidity()}valueChanged(a,n){(n!==this.value||n!==this._value)&&(typeof a=="string"?((this.multiple||this.range)&&a.includes(D)&&(a=a.split(D)),this.value=a,this._value=Array.isArray(a)?a:[a]):Array.isArray(a)?(this.value=this.multiple||this.range?a:a[0],this._value=a):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&n&&n.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(n==null?void 0:n.toString())&&this.onChange(this.value))}dispatchChangeEvents(a){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:a,bubbles:!0,composed:!0}))}clearInputValue(){const a=this.multiple||this.range?[]:"";this.value=a,this.setFormValue(a),this.dispatchChangeEvents(a)}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(a){return(this.range||this.multiple)&&typeof a=="string"&&a.includes(D)?a.split(D):!this.multiple&&!this.range&&Array.isArray(a)?a[0]||"":a}validate(){var a,n;(a=this.inputRef)!=null&&a.value&&this.manageValidity(this.inputRef.value),(n=this.inputRefTo)!=null&&n.value&&this.manageValidity(this.inputRefTo.value)}onChange(a){if(!this.touched){this.touched=!0,a&&this.setFormValue(a);return}if(typeof a!="string"&&!Array.isArray(a))return;const n=this.normalizeValue(a);this.setFormValue(n),this.validate(),this.dispatchChangeEvents(n)}formResetCallback(){var a;if(this.touched=!1,this._options&&this._options.length&&this._options.forEach(n=>{"selected"in n&&(n.selected=!1)}),this.checked!==void 0)this.checked=!1,this.internals.ariaChecked="false",this.internals.setFormValue(""),(a=this.inputRef)!=null&&a.value&&"checked"in this.inputRef.value&&(this.inputRef.value.checked=!1),this.valueChecked(this.checked);else{this.internals.setFormValue("");const n=this.defaultValue||(this.multiple||this.range?[]:"");this.value=n,this._value=Array.isArray(n)?n:[n],this.valueChanged(this.value,null)}this.internals.ariaInvalid="false"}updated(a){super.updated(a),a.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(a){if(super.firstUpdated(a),!this.form){const n=this.internals.form||this.closest("form");this.form=n}if(this.value&&this.defaultValue!==null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked="true",this.checked=!0),this.required&&(this.internals.ariaRequired="true"),this.disabled&&(this.internals.ariaDisabled="true"),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const n=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=String(n);const f=n?(typeof this.value=="string"?this.value:"")||dt:null;this.internals.setFormValue(f)}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))}}c([r.n({type:Boolean,reflect:!0})],l.prototype,"checked");c([r.n({type:Boolean})],l.prototype,"defaultChecked");c([r.n({type:Boolean})],l.prototype,"multiple");c([r.n({type:Boolean})],l.prototype,"range");c([r.n({type:String,reflect:!0})],l.prototype,"type");c([r.n()],l.prototype,"defaultValue");c([r.n({type:Boolean,reflect:!0})],l.prototype,"disabled");c([r.n({type:Boolean,reflect:!0})],l.prototype,"readonly");c([r.n({type:Boolean,reflect:!0})],l.prototype,"required");c([r.n({reflect:!0,converter:{fromAttribute:p=>p,toAttribute:p=>(p==null?void 0:p.toString())??null}})],l.prototype,"max");c([r.n({type:Number,reflect:!0})],l.prototype,"maxlength");c([r.n({reflect:!0,converter:{fromAttribute:p=>p,toAttribute:p=>(p==null?void 0:p.toString())??null}})],l.prototype,"min");c([r.n({type:Number,reflect:!0})],l.prototype,"minlength");c([r.n({type:Number,reflect:!0})],l.prototype,"step");c([r.n({type:String})],l.prototype,"ariaDescribedBy");c([r.n({type:String})],l.prototype,"ariaLabelledby");c([r.n({type:String,reflect:!0})],l.prototype,"name");c([r.n({type:String,reflect:!0})],l.prototype,"pattern");c([r.n({type:String,reflect:!0})],l.prototype,"placeholder");c([r.n({type:String,reflect:!0})],l.prototype,"id");c([r.n({type:Boolean})],l.prototype,"counter");c([r.n({type:Boolean})],l.prototype,"hasError");c([r.n({type:Boolean})],l.prototype,"inline");c([r.n({type:Boolean})],l.prototype,"hasFieldset");c([r.n({type:Boolean})],l.prototype,"optionalTag");c([r.n({type:Boolean})],l.prototype,"requiredTag");c([r.n({type:Boolean})],l.prototype,"skipForwardTestid");c([r.n({type:Boolean,reflect:!0,converter:Ft.booleanishConverter})],l.prototype,"useWrapper");c([r.n({type:Boolean,reflect:!0})],l.prototype,"fullwidth");c([r.n({type:Number})],l.prototype,"counterMaxLength");c([r.n({type:String})],l.prototype,"errorMessage");c([r.n({type:String})],l.prototype,"helptext");c([r.n({type:String})],l.prototype,"helptextDropdown");c([r.n({type:String,reflect:!1})],l.prototype,"helptextDropdownButton");c([r.n({type:String})],l.prototype,"label");c([r.n({type:String,reflect:!1})],l.prototype,"optionalText");c([r.n({type:String,reflect:!1})],l.prototype,"requiredText");c([r.n({type:String,reflect:!1})],l.prototype,"tagText");c([r.n({type:String,attribute:"data-testid"})],l.prototype,"dataTestid");exports.PktInputElement=l;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { P as x,
|
|
1
|
+
import { P as x, A as s, b as o, n as r, t as m } from "./element-CV9utnHJ.js";
|
|
2
2
|
import { P as k } from "./pkt-slot-controller-D7CrjM52.js";
|
|
3
|
-
import { e as
|
|
4
|
-
import { o as w } from "./if-defined-
|
|
5
|
-
import { o as v } from "./icon-
|
|
6
|
-
import { e as T } from "./class-map-
|
|
3
|
+
import { e as b, n as g } from "./ref-Dma3n3i8.js";
|
|
4
|
+
import { o as w } from "./if-defined-rXcLNTzN.js";
|
|
5
|
+
import { o as v } from "./icon-D0IQAVwS.js";
|
|
6
|
+
import { e as T } from "./class-map-3ADKve8g.js";
|
|
7
7
|
import { u as E } from "./utils-DznhwRXm.js";
|
|
8
8
|
import { b as S } from "./booleanish-C9R0tdXH.js";
|
|
9
9
|
import { s as p } from "./input-wrapper-CDgenrYA.js";
|
|
10
|
-
import "./helptext-
|
|
11
|
-
import "./alert-
|
|
10
|
+
import "./helptext-TFpeGJ1P.js";
|
|
11
|
+
import "./alert-BHSd2Vpj.js";
|
|
12
12
|
var D = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, e = (l, a, n, h) => {
|
|
13
13
|
for (var i = h > 1 ? void 0 : h ? _(a, n) : a, d = l.length - 1, u; d >= 0; d--)
|
|
14
14
|
(u = l[d]) && (i = (h ? u(a, n, i) : u(i)) || i);
|
|
@@ -16,7 +16,7 @@ var D = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, e = (l, a, n
|
|
|
16
16
|
};
|
|
17
17
|
let t = class extends x {
|
|
18
18
|
constructor() {
|
|
19
|
-
super(), this.defaultSlot =
|
|
19
|
+
super(), this.defaultSlot = b(), this.helptextSlot = b(), this.forId = E(), this.label = "", this.helptext = null, this.helptextDropdown = null, this.helptextDropdownButton = null, this.counter = p.props.counter.default, this.counterCurrent = 0, this.counterMaxLength = 0, this.counterError = null, this.counterPosition = "bottom", this.optionalTag = p.props.optionalTag.default, this.optionalText = p.props.optionalText.default, this.requiredTag = p.props.requiredTag.default, this.requiredText = p.props.requiredText.default, this.tagText = null, this.hasError = p.props.hasError.default, this.errorMessage = "", this.disabled = p.props.disabled.default, this.inline = p.props.inline.default, this.ariaDescribedby = void 0, this.hasFieldset = p.props.hasFieldset.default, this.role = "group", this.useWrapper = p.props.useWrapper.default, this.slotController = new k(this, this.defaultSlot, this.helptextSlot);
|
|
20
20
|
}
|
|
21
21
|
updated(l) {
|
|
22
22
|
super.updated(l);
|
|
@@ -61,13 +61,13 @@ let t = class extends x {
|
|
|
61
61
|
@toggleHelpText=${($) => {
|
|
62
62
|
this.toggleDropdown($);
|
|
63
63
|
}}
|
|
64
|
-
${
|
|
64
|
+
${g(this.helptextSlot)}
|
|
65
65
|
name="helptext"
|
|
66
66
|
></pkt-helptext>
|
|
67
67
|
`, u = () => this.counter ? o`<div class="pkt-input__counter" aria-live="polite" aria-atomic="true">
|
|
68
68
|
${this.counterError ? this.counterError : s} ${this.counterCurrent || 0}
|
|
69
69
|
${this.counterMaxLength ? `/${this.counterMaxLength}` : s}
|
|
70
|
-
</div>` : s,
|
|
70
|
+
</div>` : s, y = () => this.hasError && this.errorMessage ? o`<pkt-alert
|
|
71
71
|
skin="error"
|
|
72
72
|
compact
|
|
73
73
|
id=${`${this.forId}-error`}
|
|
@@ -79,9 +79,9 @@ let t = class extends x {
|
|
|
79
79
|
${i()}
|
|
80
80
|
${d()}
|
|
81
81
|
${this.counterPosition === "top" ? u() : s}
|
|
82
|
-
<div class="pkt-contents" ${
|
|
82
|
+
<div class="pkt-contents" ${g(this.defaultSlot)}></div>
|
|
83
83
|
${this.counterPosition === "bottom" ? u() : s}
|
|
84
|
-
${
|
|
84
|
+
${y()}
|
|
85
85
|
`, f = () => this.hasFieldset ? o`<fieldset class="pkt-inputwrapper__fieldset" aria-describedby="${n}">
|
|
86
86
|
${c()}
|
|
87
87
|
</fieldset>` : o`<div class="pkt-inputwrapper__fieldset">${c()}</div>`;
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
"use strict";const t=require("./element-
|
|
2
|
-
${this.tagText?t.
|
|
3
|
-
${this.optionalTag?t.
|
|
4
|
-
${this.requiredTag?t.
|
|
5
|
-
`,i=()=>this.useWrapper?this.hasFieldset?t.
|
|
1
|
+
"use strict";const t=require("./element-CMTfByxQ.cjs"),k=require("./pkt-slot-controller-D4nKlom5.cjs"),a=require("./ref-CxLwrCxt.cjs"),y=require("./if-defined-hKKmbsI8.cjs"),$=require("./icon-Dj0oZZSa.cjs"),f=require("./class-map-Bokp1SoS.cjs"),x=require("./utils-byXsEz1u.cjs"),I=require("./booleanish-BKVonob4.cjs"),r=require("./input-wrapper-EoSAbU-U.cjs");require("./helptext-BjW1WdOn.cjs");require("./alert-BDXWFRcf.cjs");var P=Object.defineProperty,W=Object.getOwnPropertyDescriptor,e=(u,p,n,o)=>{for(var s=o>1?void 0:o?W(p,n):p,i=u.length-1,l;i>=0;i--)(l=u[i])&&(s=(o?l(p,n,s):l(s))||s);return o&&s&&P(p,n,s),s};exports.PktInputWrapper=class extends t.PktElement{constructor(){super(),this.defaultSlot=a.e(),this.helptextSlot=a.e(),this.forId=x.uuidish(),this.label="",this.helptext=null,this.helptextDropdown=null,this.helptextDropdownButton=null,this.counter=r.specs.props.counter.default,this.counterCurrent=0,this.counterMaxLength=0,this.counterError=null,this.counterPosition="bottom",this.optionalTag=r.specs.props.optionalTag.default,this.optionalText=r.specs.props.optionalText.default,this.requiredTag=r.specs.props.requiredTag.default,this.requiredText=r.specs.props.requiredText.default,this.tagText=null,this.hasError=r.specs.props.hasError.default,this.errorMessage="",this.disabled=r.specs.props.disabled.default,this.inline=r.specs.props.inline.default,this.ariaDescribedby=void 0,this.hasFieldset=r.specs.props.hasFieldset.default,this.role="group",this.useWrapper=r.specs.props.useWrapper.default,this.slotController=new k.PktSlotController(this,this.defaultSlot,this.helptextSlot)}updated(p){super.updated(p)}render(){const p={"pkt-inputwrapper":!0,"pkt-inputwrapper--error":this.hasError,"pkt-inputwrapper--disabled":this.disabled,"pkt-inputwrapper--inline":this.inline},n="pkt-tag pkt-tag--small pkt-tag--thin-text",o=this.ariaDescribedby?this.ariaDescribedby:this.helptext?`${this.forId}-helptext`:t.A,s=()=>t.b`
|
|
2
|
+
${this.tagText?t.b`<span class=${n+" pkt-tag--gray"}>${this.tagText}</span>`:t.A}
|
|
3
|
+
${this.optionalTag?t.b`<span class=${n+" pkt-tag--blue-light"}>${this.optionalText}</span>`:t.A}
|
|
4
|
+
${this.requiredTag?t.b`<span class=${n+" pkt-tag--beige"}>${this.requiredText}</span>`:t.A}
|
|
5
|
+
`,i=()=>this.useWrapper?this.hasFieldset?t.b`<legend
|
|
6
6
|
class="pkt-inputwrapper__legend"
|
|
7
7
|
id="${this.forId}-label"
|
|
8
8
|
@click=${this.handleLabelClick}
|
|
9
9
|
>
|
|
10
10
|
${this.label} ${s()}
|
|
11
|
-
</legend>`:t.
|
|
11
|
+
</legend>`:t.b`<label
|
|
12
12
|
class="pkt-inputwrapper__label"
|
|
13
13
|
for="${this.forId}"
|
|
14
14
|
aria-describedby="${o}"
|
|
15
15
|
id="${this.forId}-label"
|
|
16
16
|
@click=${this.handleLabelClick}
|
|
17
17
|
>${this.label}${s()}</label
|
|
18
|
-
>`:t.
|
|
18
|
+
>`:t.b`<label
|
|
19
19
|
for="${this.forId}"
|
|
20
20
|
class="pkt-sr-only"
|
|
21
21
|
aria-describedby="${o}"
|
|
22
22
|
id="${this.forId}-label"
|
|
23
23
|
>
|
|
24
24
|
${this.label}
|
|
25
|
-
</label>`,l=()=>t.
|
|
25
|
+
</label>`,l=()=>t.b`
|
|
26
26
|
<pkt-helptext
|
|
27
27
|
class="${y.o(this.useWrapper?void 0:"pkt-hide")}"
|
|
28
28
|
.forId=${this.forId}
|
|
29
29
|
.helptext=${this.helptext}
|
|
30
30
|
.helptextDropdown=${this.helptextDropdown}
|
|
31
31
|
.helptextDropdownButton=${this.helptextDropdownButton||r.specs.props.helptextDropdownButton.default}
|
|
32
|
-
@toggleHelpText=${
|
|
32
|
+
@toggleHelpText=${g=>{this.toggleDropdown(g)}}
|
|
33
33
|
${a.n(this.helptextSlot)}
|
|
34
34
|
name="helptext"
|
|
35
35
|
></pkt-helptext>
|
|
36
|
-
`,h=()=>this.counter?t.
|
|
37
|
-
${this.counterError?this.counterError:t.
|
|
38
|
-
${this.counterMaxLength?`/${this.counterMaxLength}`:t.
|
|
39
|
-
</div>`:t.
|
|
36
|
+
`,h=()=>this.counter?t.b`<div class="pkt-input__counter" aria-live="polite" aria-atomic="true">
|
|
37
|
+
${this.counterError?this.counterError:t.A} ${this.counterCurrent||0}
|
|
38
|
+
${this.counterMaxLength?`/${this.counterMaxLength}`:t.A}
|
|
39
|
+
</div>`:t.A,c=()=>this.hasError&&this.errorMessage?t.b`<pkt-alert
|
|
40
40
|
skin="error"
|
|
41
41
|
compact
|
|
42
42
|
id=${`${this.forId}-error`}
|
|
43
43
|
aria-live="assertive"
|
|
44
44
|
aria-atomic="true"
|
|
45
45
|
>
|
|
46
|
-
${
|
|
47
|
-
</pkt-alert>`:t.
|
|
46
|
+
${$.o(this.errorMessage)}
|
|
47
|
+
</pkt-alert>`:t.A,d=()=>t.b`
|
|
48
48
|
${i()}
|
|
49
49
|
${l()}
|
|
50
|
-
${this.counterPosition==="top"?h():t.
|
|
50
|
+
${this.counterPosition==="top"?h():t.A}
|
|
51
51
|
<div class="pkt-contents" ${a.n(this.defaultSlot)}></div>
|
|
52
|
-
${this.counterPosition==="bottom"?h():t.
|
|
52
|
+
${this.counterPosition==="bottom"?h():t.A}
|
|
53
53
|
${c()}
|
|
54
|
-
`,
|
|
54
|
+
`,b=()=>this.hasFieldset?t.b`<fieldset class="pkt-inputwrapper__fieldset" aria-describedby="${o}">
|
|
55
55
|
${d()}
|
|
56
|
-
</fieldset>`:t.
|
|
56
|
+
</fieldset>`:t.b`<div class="pkt-inputwrapper__fieldset">${d()}</div>`;return t.b`<div class=${f.e(p)}>${b()}</div> `}toggleDropdown(p){this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!1,detail:{isOpen:p.detail.isOpen}}))}handleLabelClick(){this.dispatchEvent(new CustomEvent("labelClick",{bubbles:!0,composed:!0,detail:"label clicked"}))}};e([t.n({type:String})],exports.PktInputWrapper.prototype,"forId",2);e([t.n({type:String})],exports.PktInputWrapper.prototype,"label",2);e([t.n({type:String})],exports.PktInputWrapper.prototype,"helptext",2);e([t.n({type:String})],exports.PktInputWrapper.prototype,"helptextDropdown",2);e([t.n({type:String})],exports.PktInputWrapper.prototype,"helptextDropdownButton",2);e([t.n({type:Boolean})],exports.PktInputWrapper.prototype,"counter",2);e([t.n({type:Number})],exports.PktInputWrapper.prototype,"counterCurrent",2);e([t.n({type:Number})],exports.PktInputWrapper.prototype,"counterMaxLength",2);e([t.n({type:String})],exports.PktInputWrapper.prototype,"counterError",2);e([t.n({type:String,reflect:!1})],exports.PktInputWrapper.prototype,"counterPosition",2);e([t.n({type:Boolean})],exports.PktInputWrapper.prototype,"optionalTag",2);e([t.n({type:String})],exports.PktInputWrapper.prototype,"optionalText",2);e([t.n({type:Boolean})],exports.PktInputWrapper.prototype,"requiredTag",2);e([t.n({type:String})],exports.PktInputWrapper.prototype,"requiredText",2);e([t.n({type:String})],exports.PktInputWrapper.prototype,"tagText",2);e([t.n({type:Boolean})],exports.PktInputWrapper.prototype,"hasError",2);e([t.n({type:String})],exports.PktInputWrapper.prototype,"errorMessage",2);e([t.n({type:Boolean})],exports.PktInputWrapper.prototype,"disabled",2);e([t.n({type:Boolean})],exports.PktInputWrapper.prototype,"inline",2);e([t.n({type:String})],exports.PktInputWrapper.prototype,"ariaDescribedby",2);e([t.n({type:Boolean})],exports.PktInputWrapper.prototype,"hasFieldset",2);e([t.n({type:String,reflect:!0})],exports.PktInputWrapper.prototype,"role",2);e([t.n({type:Boolean,reflect:!0,converter:I.booleanishConverter})],exports.PktInputWrapper.prototype,"useWrapper",2);exports.PktInputWrapper=e([t.t("pkt-input-wrapper")],exports.PktInputWrapper);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { P as h,
|
|
1
|
+
import { P as h, A as m, b as c, n as o, t as u } from "./element-CV9utnHJ.js";
|
|
2
2
|
import { P } from "./pkt-slot-controller-D7CrjM52.js";
|
|
3
|
-
import { e as k, n as g } from "./ref-
|
|
4
|
-
import { e as y } from "./class-map-
|
|
5
|
-
import "./icon-
|
|
3
|
+
import { e as k, n as g } from "./ref-Dma3n3i8.js";
|
|
4
|
+
import { e as y } from "./class-map-3ADKve8g.js";
|
|
5
|
+
import "./icon-D0IQAVwS.js";
|
|
6
6
|
const d = { href: { default: "#" }, target: { default: "_self" } }, f = {
|
|
7
7
|
props: d
|
|
8
8
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";const t=require("./element-
|
|
1
|
+
"use strict";const t=require("./element-CMTfByxQ.cjs"),h=require("./pkt-slot-controller-D4nKlom5.cjs"),c=require("./ref-CxLwrCxt.cjs"),k=require("./class-map-Bokp1SoS.cjs");require("./icon-Dj0oZZSa.cjs");const f={href:{default:"#"},target:{default:"_self"}},a={props:f};var u=Object.defineProperty,P=Object.getOwnPropertyDescriptor,i=(o,r,s,n)=>{for(var e=n>1?void 0:n?P(r,s):r,l=o.length-1,p;l>=0;l--)(p=o[l])&&(e=(n?p(r,s,e):p(e))||e);return n&&e&&u(r,s,e),e};exports.PktLink=class extends t.PktElement{constructor(){super(),this.defaultSlot=c.e(),this.href=a.props.href.default,this.iconName=void 0,this.iconPosition=void 0,this.external=!1,this.target=a.props.target.default,this.slotController=new h.PktSlotController(this,this.defaultSlot)}render(){const r={"pkt-link":!0,"pkt-link--icon-left":!!this.iconName&&this.iconPosition==="left"||!!(this.iconName&&!this.iconPosition),"pkt-link--icon-right":!!this.iconName&&this.iconPosition==="right","pkt-link--external":this.external};return t.b`<a
|
|
2
2
|
class=${k.e(r)}
|
|
3
3
|
href=${this.href}
|
|
4
4
|
.target=${this.target}
|
|
5
|
-
.rel=${this.external?"noopener noreferrer":t.
|
|
6
|
-
>${this.iconName?t.
|
|
5
|
+
.rel=${this.external?"noopener noreferrer":t.A}
|
|
6
|
+
>${this.iconName?t.b`<pkt-icon name=${this.iconName} class="pkt-link__icon"></pkt-icon>`:""} <span ${c.n(this.defaultSlot)}>Link</span></a
|
|
7
7
|
>`}};i([t.n({type:String,reflect:!0})],exports.PktLink.prototype,"href",2);i([t.n({type:String,reflect:!0})],exports.PktLink.prototype,"iconName",2);i([t.n({type:String,reflect:!0})],exports.PktLink.prototype,"iconPosition",2);i([t.n({type:Boolean,reflect:!0})],exports.PktLink.prototype,"external",2);i([t.n({type:String,reflect:!0})],exports.PktLink.prototype,"target",2);exports.PktLink=i([t.t("pkt-link")],exports.PktLink);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";const t=require("./element-
|
|
1
|
+
"use strict";const t=require("./element-CMTfByxQ.cjs"),k=require("./ref-CxLwrCxt.cjs"),p=require("./pkt-slot-controller-D4nKlom5.cjs");require("./icon-Dj0oZZSa.cjs");const c=require("./if-defined-hKKmbsI8.cjs");var f=Object.defineProperty,h=Object.getOwnPropertyDescriptor,r=(o,n,i,l)=>{for(var e=l>1?void 0:l?h(n,i):n,s=o.length-1,a;s>=0;s--)(a=o[s])&&(e=(l?a(n,i,e):a(e))||e);return l&&e&&f(n,i,e),e};exports.PktLinkCard=class extends t.PktElement{constructor(){super(),this.defaultSlot=k.e(),this.title="",this.href="#",this.iconName="",this.external=!1,this.openInNewTab=!1,this.skin="normal",this.slotController=new p.PktSlotController(this,this.defaultSlot)}render(){const n=["pkt-linkcard",this.skin&&`pkt-linkcard--${this.skin}`].filter(Boolean).join(" "),i=["pkt-linkcard__title",this.external&&"pkt-link pkt-link--external"].filter(Boolean).join(" ");return t.b`
|
|
2
2
|
<a
|
|
3
3
|
href=${this.href}
|
|
4
4
|
class=${n}
|
|
5
5
|
target=${this.openInNewTab?"_blank":"_self"}
|
|
6
6
|
rel=${c.o(this.openInNewTab?"noopener noreferrer":void 0)}
|
|
7
7
|
>
|
|
8
|
-
${this.iconName&&t.
|
|
9
|
-
${this.title&&t.
|
|
8
|
+
${this.iconName&&t.b`<pkt-icon class="pkt-link__icon" name="${this.iconName}" />`}
|
|
9
|
+
${this.title&&t.b`<div class=${i}>${this.title}</div>`}
|
|
10
10
|
|
|
11
11
|
<div class="pkt-linkcard__text" ${k.n(this.defaultSlot)}></div>
|
|
12
12
|
</a>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { P as f,
|
|
2
|
-
import { e as k, n as m } from "./ref-
|
|
1
|
+
import { P as f, b as c, n as o, t as h } from "./element-CV9utnHJ.js";
|
|
2
|
+
import { e as k, n as m } from "./ref-Dma3n3i8.js";
|
|
3
3
|
import { P as d } from "./pkt-slot-controller-D7CrjM52.js";
|
|
4
|
-
import "./icon-
|
|
5
|
-
import { o as u } from "./if-defined-
|
|
4
|
+
import "./icon-D0IQAVwS.js";
|
|
5
|
+
import { o as u } from "./if-defined-rXcLNTzN.js";
|
|
6
6
|
var _ = Object.defineProperty, y = Object.getOwnPropertyDescriptor, r = (n, i, s, l) => {
|
|
7
7
|
for (var e = l > 1 ? void 0 : l ? y(i, s) : i, a = n.length - 1, p; a >= 0; a--)
|
|
8
8
|
(p = n[a]) && (e = (l ? p(i, s, e) : p(e)) || e);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { P as d,
|
|
2
|
-
import { r as m } from "./state-
|
|
3
|
-
import { o as y } from "./if-defined-
|
|
4
|
-
import { c as
|
|
5
|
-
import { e as u } from "./class-map-
|
|
6
|
-
import { u as
|
|
1
|
+
import { P as d, b as r, A as p, s as b, n as a, t as f } from "./element-CV9utnHJ.js";
|
|
2
|
+
import { r as m } from "./state-l4hGZdFJ.js";
|
|
3
|
+
import { o as y } from "./if-defined-rXcLNTzN.js";
|
|
4
|
+
import { c as k } from "./repeat-DnlRNf63.js";
|
|
5
|
+
import { e as u } from "./class-map-3ADKve8g.js";
|
|
6
|
+
import { u as x } from "./utils-DznhwRXm.js";
|
|
7
7
|
var O = Object.defineProperty, g = Object.getOwnPropertyDescriptor, l = (e, t, s, o) => {
|
|
8
8
|
for (var n = o > 1 ? void 0 : o ? g(t, s) : t, c = e.length - 1, h; c >= 0; c--)
|
|
9
9
|
(h = e[c]) && (n = (o ? h(t, s, n) : h(n)) || n);
|
|
@@ -11,7 +11,7 @@ var O = Object.defineProperty, g = Object.getOwnPropertyDescriptor, l = (e, t, s
|
|
|
11
11
|
};
|
|
12
12
|
let i = class extends d {
|
|
13
13
|
constructor() {
|
|
14
|
-
super(...arguments), this.id =
|
|
14
|
+
super(...arguments), this.id = x(), this.label = null, this.options = [], this.isOpen = !1, this.disabled = !1, this.includeSearch = !1, this.isMultiSelect = !1, this.allowUserInput = !1, this.maxIsReached = !1, this.customUserInput = null, this.searchPlaceholder = null, this.searchValue = null, this.maxLength = 0, this.userMessage = null, this._selectedOptions = 0, this._filteredOptions = [];
|
|
15
15
|
}
|
|
16
16
|
// Lifecycle methods
|
|
17
17
|
connectedCallback() {
|
|
@@ -61,7 +61,7 @@ let i = class extends d {
|
|
|
61
61
|
}
|
|
62
62
|
renderList() {
|
|
63
63
|
return r`
|
|
64
|
-
${
|
|
64
|
+
${k(
|
|
65
65
|
this._filteredOptions,
|
|
66
66
|
(e) => e.value,
|
|
67
67
|
(e, t) => r`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const s=require("./element-
|
|
1
|
+
"use strict";const s=require("./element-CMTfByxQ.cjs"),p=require("./state-BNgpvY-A.cjs"),h=require("./if-defined-hKKmbsI8.cjs"),u=require("./repeat-C-FJ2vfy.cjs"),c=require("./class-map-Bokp1SoS.cjs"),d=require("./utils-byXsEz1u.cjs");var b=Object.defineProperty,f=Object.getOwnPropertyDescriptor,n=(r,e,t,i)=>{for(var l=i>1?void 0:i?f(e,t):e,o=r.length-1,a;o>=0;o--)(a=r[o])&&(l=(i?a(e,t,l):a(l))||l);return i&&l&&b(e,t,l),l};exports.PktListbox=class extends s.PktElement{constructor(){super(...arguments),this.id=d.uuidish(),this.label=null,this.options=[],this.isOpen=!1,this.disabled=!1,this.includeSearch=!1,this.isMultiSelect=!1,this.allowUserInput=!1,this.maxIsReached=!1,this.customUserInput=null,this.searchPlaceholder=null,this.searchValue=null,this.maxLength=0,this.userMessage=null,this._selectedOptions=0,this._filteredOptions=[]}connectedCallback(){super.connectedCallback(),this.includeSearch&&!this.searchValue&&(this.searchValue=""),this.options.length>0&&this.filterOptions(),this.setAttribute("tabindex","-1"),this.addEventListener("focus",this.focusFirstOrSelectedOption)}updated(e){(e.has("options")||e.has("searchValue"))&&this.filterOptions(),super.updated(e)}attributeChangedCallback(e,t,i){(e==="options"||e==="searchValue"||e==="search-value")&&this.filterOptions(),super.attributeChangedCallback(e,t,i)}render(){return s.b`
|
|
2
2
|
<div
|
|
3
3
|
class=${c.e({"pkt-listbox":!0,"pkt-listbox__open":this.isOpen,"pkt-txt-16-light":!0})}
|
|
4
4
|
role="listbox"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
${this.renderList()}
|
|
13
13
|
</ul>
|
|
14
14
|
</div>
|
|
15
|
-
`}renderCheckboxOrCheckIcon(e,t){return this.isMultiSelect?s.
|
|
15
|
+
`}renderCheckboxOrCheckIcon(e,t){return this.isMultiSelect?s.b`
|
|
16
16
|
<input
|
|
17
17
|
class="pkt-input-check__input-checkbox"
|
|
18
18
|
type="checkbox"
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
aria-labelledby=${this.id+"-option-label-"+t}
|
|
24
24
|
?disabled=${this.disabled||e.disabled||this.maxIsReached&&!e.selected}
|
|
25
25
|
/>
|
|
26
|
-
`:e.selected?s.
|
|
27
|
-
${u.c(this._filteredOptions,e=>e.value,(e,t)=>s.
|
|
26
|
+
`:e.selected?s.b`<pkt-icon name="check-big"></pkt-icon>`:s.A}renderList(){return s.b`
|
|
27
|
+
${u.c(this._filteredOptions,e=>e.value,(e,t)=>s.b`
|
|
28
28
|
<li
|
|
29
29
|
@click=${()=>{this.toggleOption(e)}}
|
|
30
30
|
aria-selected=${e.selected?"true":"false"}
|
|
@@ -40,15 +40,15 @@
|
|
|
40
40
|
>
|
|
41
41
|
${this.renderCheckboxOrCheckIcon(e,t)}
|
|
42
42
|
<span class="pkt-listbox__option-label" id=${this.id+"-option-label-"+t}>
|
|
43
|
-
${e.prefix?s.
|
|
43
|
+
${e.prefix?s.b`<span class="pkt-listbox__option-prefix">${e.prefix}</span>`:s.A}
|
|
44
44
|
${e.label||e.value}
|
|
45
45
|
</span>
|
|
46
|
-
${e.description?s.
|
|
46
|
+
${e.description?s.b`<span class="pkt-listbox__option-description pkt-txt-14-light"
|
|
47
47
|
>${e.description}</span
|
|
48
|
-
>`:s.
|
|
48
|
+
>`:s.A}
|
|
49
49
|
</li>
|
|
50
50
|
`)}
|
|
51
|
-
`}renderNewOptionBanner(){return this.allowUserInput&&this.customUserInput?s.
|
|
51
|
+
`}renderNewOptionBanner(){return this.allowUserInput&&this.customUserInput?s.b`
|
|
52
52
|
<div
|
|
53
53
|
class="pkt-listbox__banner pkt-listbox__banner--new-option pkt-listbox__option"
|
|
54
54
|
data-type="new-option"
|
|
@@ -61,18 +61,18 @@
|
|
|
61
61
|
<pkt-icon class="pkt-listbox__banner-icon" name="plus-sign" size="large"></pkt-icon>
|
|
62
62
|
Legg til “${this.customUserInput}”
|
|
63
63
|
</div>
|
|
64
|
-
`:s.
|
|
64
|
+
`:s.A}renderMaximumReachedBanner(){return this._selectedOptions=this.options.filter(e=>e.selected).length,this.isMultiSelect&&this._selectedOptions>0&&this.maxLength>0?s.b`
|
|
65
65
|
<div class="pkt-listbox__banner pkt-listbox__banner--maximum-reached">
|
|
66
66
|
${this._selectedOptions} av maks ${this.maxLength} mulige er valgt.
|
|
67
67
|
</div>
|
|
68
|
-
`:s.
|
|
68
|
+
`:s.A}renderUserMessage(){return this.userMessage?s.b`<div class="pkt-listbox__banner pkt-listbox__banner--user-message">
|
|
69
69
|
<pkt-icon
|
|
70
70
|
class="pkt-listbox__banner-icon"
|
|
71
71
|
name="exclamation-mark-circle"
|
|
72
72
|
size="large"
|
|
73
73
|
></pkt-icon>
|
|
74
74
|
${this.userMessage}
|
|
75
|
-
</div>`:s.
|
|
75
|
+
</div>`:s.A}renderSearch(){return this.includeSearch?s.b`
|
|
76
76
|
<div class="pkt-listbox__search">
|
|
77
77
|
<span class="pkt-listbox__search-icon">
|
|
78
78
|
<pkt-icon name="magnifying-glass-small" size="large"></pkt-icon>
|
|
@@ -92,4 +92,4 @@
|
|
|
92
92
|
role="searchbox"
|
|
93
93
|
/>
|
|
94
94
|
</div>
|
|
95
|
-
`:s.
|
|
95
|
+
`:s.A}handleSearchInput(e){this.searchValue=e.target.value,this.dispatchEvent(new CustomEvent("search",{detail:this.searchValue,bubbles:!1}))}handleSearchKeydown(e){switch(e.key){case"Enter":e.preventDefault();break;case"ArrowUp":case"Escape":this.closeOptions(),e.preventDefault();break;case"ArrowDown":case"Tab":this.focusFirstOrSelectedOption();break}}handleOptionKeydown(e){const t=e.currentTarget,i=t.dataset.value,l=t.dataset.type,o=t.dataset.selected==="true";if(!(!this.getOptionElements().length&&(!this.customUserInput||!this.allowUserInput&&this.customUserInput)&&l!=="new-option"&&l!=="searchbox"))switch(e.key){case" ":case"Enter":this.toggleOption(t),e.preventDefault();break;case"Backspace":i&&(o?this.toggleOption(t):this.closeOptions()),e.preventDefault();break;case"Escape":case"Tab":this.closeOptions();break;case"ArrowDown":e.altKey?this.focusLastOption():l==="searchbox"||l==="new-option"?this.focusFirstOption():this.focusNextOption(t),e.preventDefault();break;case"ArrowUp":if(e.altKey)this.focusFirstOption();else if(t.dataset.index==="0"&&this.includeSearch){const a=this.querySelector('[role="searchbox"]');a&&a.focus()}else if(t.dataset.index==="0"&&this.customUserInput){const a=this.querySelector('[data-type="new-option"]');a&&a.focus()}else this.focusPreviousOption(t);e.preventDefault();break;case"Home":this.focusFirstOption(),e.preventDefault();break;case"End":this.focusLastOption(),e.preventDefault();break;default:(e.metaKey||e.ctrlKey)&&e.key==="a"&&(this.selectAll(),e.preventDefault()),this.isLetterOrSpace(e.key)&&(this.handleTypeAhead(e.key),e.preventDefault());break}}focusAndScrollIntoView(e){e.scrollIntoView({block:"nearest"}),window.setTimeout(()=>e.focus(),0)}focusNextOption(e){const t=e.nextElementSibling;t&&this.focusAndScrollIntoView(t)}focusPreviousOption(e){const t=e.previousElementSibling;if(e.dataset.index==="0"&&this.includeSearch){const i=this.querySelector('[role="searchbox"]');i&&this.focusAndScrollIntoView(i)}else t&&this.focusAndScrollIntoView(t)}focusFirstOption(){const e=this.getOptionElements()[0];e&&this.focusAndScrollIntoView(e)}focusLastOption(){const e=this.getOptionElements().pop();e&&this.focusAndScrollIntoView(e)}focusFirstOrSelectedOption(){if(this.disabled)return;const e=this.getOptionElements().find(t=>t.dataset.selected==="true");if(this.allowUserInput&&this.customUserInput){const t=this.querySelector('[data-type="new-option"]');this.focusAndScrollIntoView(t)}else if(e)this.focusAndScrollIntoView(e);else if(this.includeSearch&&!(document.activeElement instanceof HTMLInputElement)){const t=this.querySelector('[role="searchbox"]');window.setTimeout(()=>t.focus(),0)}else this.focusFirstOption()}toggleOption(e){const t=e instanceof HTMLElement?e.dataset.disabled:e.disabled;if(this.disabled||t)return;const i=e instanceof HTMLElement?e.dataset.value:e.value;this.dispatchEvent(new CustomEvent("option-toggle",{detail:i,bubbles:!1}))}selectAll(){this.dispatchEvent(new CustomEvent("select-all",{bubbles:!1}))}closeOptions(){this.dispatchEvent(new CustomEvent("close-options",{bubbles:!1}))}filterOptions(){this.searchValue?this._filteredOptions=this.options.filter(e=>{var i;return(e.fulltext||e.label+e.value+(e.prefix||"")).toLowerCase().includes(((i=this.searchValue)==null?void 0:i.toLowerCase())||"")}):this._filteredOptions=[...this.options]}isLetterOrSpace(e){return/^[\p{L} ]$/u.test(e)}handleTypeAhead(e){this.typeAheadString+=e.toLowerCase(),this.typeAheadTimeout&&clearTimeout(this.typeAheadTimeout),this.typeAheadTimeout=window.setTimeout(()=>{this.typeAheadString=""},500);const i=this.getOptionElements().find(l=>{var o;return(o=l.textContent)==null?void 0:o.trim().toLowerCase().startsWith(this.typeAheadString)});i&&this.focusAndScrollIntoView(i)}getOptionElements(){return this._filteredOptions.length?Array.from(this.querySelectorAll('[role="option"]:not([data-disabled])')||[]):[]}};n([s.n({type:String})],exports.PktListbox.prototype,"id",2);n([s.n({type:String})],exports.PktListbox.prototype,"label",2);n([s.n({type:Array})],exports.PktListbox.prototype,"options",2);n([s.n({type:Boolean,reflect:!0})],exports.PktListbox.prototype,"isOpen",2);n([s.n({type:Boolean})],exports.PktListbox.prototype,"disabled",2);n([s.n({type:Boolean})],exports.PktListbox.prototype,"includeSearch",2);n([s.n({type:Boolean})],exports.PktListbox.prototype,"isMultiSelect",2);n([s.n({type:Boolean})],exports.PktListbox.prototype,"allowUserInput",2);n([s.n({type:Boolean})],exports.PktListbox.prototype,"maxIsReached",2);n([s.n({type:String})],exports.PktListbox.prototype,"customUserInput",2);n([s.n({type:String})],exports.PktListbox.prototype,"searchPlaceholder",2);n([s.n({type:String})],exports.PktListbox.prototype,"searchValue",2);n([s.n({type:Number})],exports.PktListbox.prototype,"maxLength",2);n([s.n({type:String})],exports.PktListbox.prototype,"userMessage",2);n([p.r()],exports.PktListbox.prototype,"_filteredOptions",2);exports.PktListbox=n([s.t("pkt-listbox")],exports.PktListbox);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { P as u,
|
|
2
|
-
import { e as h } from "./class-map-
|
|
3
|
-
import { r as c } from "./state-
|
|
4
|
-
import { e as f, n as g } from "./ref-
|
|
1
|
+
import { P as u, A as m, b as d, n as a, t as y } from "./element-CV9utnHJ.js";
|
|
2
|
+
import { e as h } from "./class-map-3ADKve8g.js";
|
|
3
|
+
import { r as c } from "./state-l4hGZdFJ.js";
|
|
4
|
+
import { e as f, n as g } from "./ref-Dma3n3i8.js";
|
|
5
5
|
import { P as v } from "./pkt-slot-controller-D7CrjM52.js";
|
|
6
|
-
import "./icon-
|
|
6
|
+
import "./icon-D0IQAVwS.js";
|
|
7
7
|
var _ = Object.defineProperty, k = Object.getOwnPropertyDescriptor, e = (s, o, n, r) => {
|
|
8
8
|
for (var i = r > 1 ? void 0 : r ? k(o, n) : o, l = s.length - 1, p; l >= 0; l--)
|
|
9
9
|
(p = s[l]) && (i = (r ? p(o, n, i) : p(i)) || i);
|