@oslokommune/punkt-elements 13.18.0 → 13.18.2

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/{checkbox-CqoOG2KJ.cjs → checkbox-BP5zOlPy.cjs} +1 -1
  3. package/dist/{checkbox-CCmRUWTH.js → checkbox-CfXOh6Lw.js} +1 -1
  4. package/dist/{combobox-6WP1urZS.cjs → combobox-CGIvxIvQ.cjs} +2 -2
  5. package/dist/{combobox-CtHgl1n2.js → combobox-fxki3LT7.js} +2 -2
  6. package/dist/{datepicker-DEO1C69C.cjs → datepicker-BldfV7vp.cjs} +2 -2
  7. package/dist/{datepicker-q9haFM81.js → datepicker-DHHVRmYw.js} +2 -2
  8. package/dist/index.d.ts +4 -2
  9. package/dist/{input-element-Dqu8udwd.js → input-element-B0VPRK_E.js} +91 -83
  10. package/dist/input-element-BmXkhljw.cjs +1 -0
  11. package/dist/pkt-checkbox.cjs +1 -1
  12. package/dist/pkt-checkbox.js +1 -1
  13. package/dist/pkt-combobox.cjs +1 -1
  14. package/dist/pkt-combobox.js +1 -1
  15. package/dist/pkt-datepicker.cjs +1 -1
  16. package/dist/pkt-datepicker.js +2 -2
  17. package/dist/pkt-index.cjs +1 -1
  18. package/dist/pkt-index.js +7 -7
  19. package/dist/pkt-radiobutton.cjs +1 -1
  20. package/dist/pkt-radiobutton.js +1 -1
  21. package/dist/pkt-select.cjs +1 -1
  22. package/dist/pkt-select.js +1 -1
  23. package/dist/pkt-textarea.cjs +1 -1
  24. package/dist/pkt-textarea.js +1 -1
  25. package/dist/pkt-textinput.cjs +1 -1
  26. package/dist/pkt-textinput.js +1 -1
  27. package/dist/{radiobutton-FwxpKELo.cjs → radiobutton-BuKXgQm_.cjs} +1 -1
  28. package/dist/{radiobutton-DuAo3CdN.js → radiobutton-C_MzK8dE.js} +1 -1
  29. package/dist/{select-wak-jukY.js → select-BHEtNwcz.js} +2 -2
  30. package/dist/{select-BbmLn1qh.cjs → select-BWnw7CJy.cjs} +2 -2
  31. package/dist/{textarea-CzN0E0TV.cjs → textarea-BC962syN.cjs} +2 -2
  32. package/dist/{textarea-CIb4VWtN.js → textarea-O0r9TzqP.js} +2 -2
  33. package/dist/{textinput-D5_RTkRY.js → textinput-COK0LcXj.js} +2 -2
  34. package/dist/{textinput-D8v6D6ie.cjs → textinput-DdcR7OZ-.cjs} +2 -2
  35. package/package.json +3 -3
  36. package/src/components/combobox/combobox.ts +1 -1
  37. package/src/components/datepicker/datepicker.ts +1 -1
  38. package/src/components/select/select.ts +1 -1
  39. package/src/components/textarea/textarea.ts +1 -1
  40. package/src/components/textinput/textinput.ts +1 -1
  41. package/dist/input-element-KUsQQ-1d.cjs +0 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,23 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
5
5
 
6
6
  ---
7
7
 
8
+ ## [13.18.2](https://github.com/oslokommune/punkt/compare/13.18.1...13.18.2) (2026-01-12)
9
+
10
+ ### ⚠ BREAKING CHANGES
11
+ Ingen
12
+
13
+ ### Features
14
+ Ingen
15
+
16
+ ### Bug Fixes
17
+ Ingen
18
+
19
+ ### Chores
20
+ Ingen
21
+
22
+ ---
23
+
24
+
8
25
  ## [13.18.0](https://github.com/oslokommune/punkt/compare/13.17.0...13.18.0) (2025-12-22)
9
26
 
10
27
  ### ⚠ BREAKING CHANGES
@@ -1,4 +1,4 @@
1
- "use strict";const t=require("./element-CJ_QKaki.cjs"),o=require("./input-element-KUsQQ-1d.cjs"),r=require("./ref-BFa5Utho.cjs"),p=require("./class-map-C_erArZz.cjs");var u=Object.defineProperty,d=Object.getOwnPropertyDescriptor,i=(l,e,h,a)=>{for(var s=a>1?void 0:a?d(e,h):e,c=l.length-1,n;c>=0;c--)(n=l[c])&&(s=(a?n(e,h,s):n(s))||s);return a&&s&&u(e,h,s),s};exports.PktCheckbox=class extends o.PktInputElement{constructor(){super(...arguments),this.inputRef=r.e(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.isSwitch=!1,this.labelPosition="right",this.hideLabel=!1,this.checked=null,this.indeterminate=!1,this.type="checkbox",this.tagText=null,this.optionalTag=!1,this.optionalText="Valgfritt",this.requiredTag=!1,this.requiredText="Må fylles ut"}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,h,a){e==="defaultChecked"&&!this.checked&&(this.checked=this.defaultChecked),e==="checked"&&(this.checked=this.checked===""||this.checked==="true"||this.checked===!0,this.inputRef.value&&(this.inputRef.value.checked=this.checked)),e==="indeterminate"&&(this.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0,this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate)),super.attributeChangedCallback(e,h,a)}firstUpdated(e){e.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.firstUpdated(e)}updated(e){e.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),e.has("checked")&&this.inputRef.value&&(this.inputRef.value.checked=this.checked===""||this.checked==="true"||this.checked===!0),e.has("indeterminate")&&this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.updated(e)}render(){const e=p.e({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),h=p.e({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),a=p.e({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-input-check__input-label--left":this.labelPosition==="left","pkt-input-check__input-label--right":this.labelPosition==="right","pkt-sr-only":this.hideLabel}),s="pkt-tag pkt-tag--small pkt-tag--thin-text",c=()=>t.x`
1
+ "use strict";const t=require("./element-CJ_QKaki.cjs"),o=require("./input-element-BmXkhljw.cjs"),r=require("./ref-BFa5Utho.cjs"),p=require("./class-map-C_erArZz.cjs");var u=Object.defineProperty,d=Object.getOwnPropertyDescriptor,i=(l,e,h,a)=>{for(var s=a>1?void 0:a?d(e,h):e,c=l.length-1,n;c>=0;c--)(n=l[c])&&(s=(a?n(e,h,s):n(s))||s);return a&&s&&u(e,h,s),s};exports.PktCheckbox=class extends o.PktInputElement{constructor(){super(...arguments),this.inputRef=r.e(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.isSwitch=!1,this.labelPosition="right",this.hideLabel=!1,this.checked=null,this.indeterminate=!1,this.type="checkbox",this.tagText=null,this.optionalTag=!1,this.optionalText="Valgfritt",this.requiredTag=!1,this.requiredText="Må fylles ut"}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,h,a){e==="defaultChecked"&&!this.checked&&(this.checked=this.defaultChecked),e==="checked"&&(this.checked=this.checked===""||this.checked==="true"||this.checked===!0,this.inputRef.value&&(this.inputRef.value.checked=this.checked)),e==="indeterminate"&&(this.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0,this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate)),super.attributeChangedCallback(e,h,a)}firstUpdated(e){e.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.firstUpdated(e)}updated(e){e.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),e.has("checked")&&this.inputRef.value&&(this.inputRef.value.checked=this.checked===""||this.checked==="true"||this.checked===!0),e.has("indeterminate")&&this.inputRef.value&&(this.inputRef.value.indeterminate=this.indeterminate===""||this.indeterminate==="true"||this.indeterminate===!0),super.updated(e)}render(){const e=p.e({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),h=p.e({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),a=p.e({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-input-check__input-label--left":this.labelPosition==="left","pkt-input-check__input-label--right":this.labelPosition==="right","pkt-sr-only":this.hideLabel}),s="pkt-tag pkt-tag--small pkt-tag--thin-text",c=()=>t.x`
2
2
  ${this.tagText?t.x`<span class=${s+" pkt-tag--gray"}>${this.tagText}</span>`:t.E}
3
3
  ${this.optionalTag?t.x`<span class=${s+" pkt-tag--blue-light"}>${this.optionalText}</span>`:t.E}
4
4
  ${this.requiredTag?t.x`<span class=${s+" pkt-tag--beige"}>${this.requiredText}</span>`:t.E}
@@ -1,5 +1,5 @@
1
1
  import { E as r, x as p, n as s, a as d } from "./element-CRDRygXu.js";
2
- import { P as k } from "./input-element-Dqu8udwd.js";
2
+ import { P as k } from "./input-element-B0VPRK_E.js";
3
3
  import { e as f, n as b } from "./ref-Xa5dbh--.js";
4
4
  import { e as u } from "./class-map-wy7PUk0P.js";
5
5
  var g = Object.defineProperty, m = Object.getOwnPropertyDescriptor, i = (t, a, n, l) => {
@@ -1,4 +1,4 @@
1
- "use strict";const a=require("./element-CJ_QKaki.cjs"),c=require("./if-defined-Bc9-_I01.cjs"),d=require("./state-DSjcvzDN.cjs"),r=require("./ref-BFa5Utho.cjs"),y=require("./class-map-C_erArZz.cjs"),O=require("./repeat-BZb41H64.cjs"),$=require("./input-element-KUsQQ-1d.cjs"),I=require("./pkt-options-controller-CiuBG6Lt.cjs"),w=require("./pkt-slot-controller-BzddBp7z.cjs");require("./input-wrapper-B-Qseywc.cjs");require("./icon-BGuizDwk.cjs");require("./tag-EFUKrc8q.cjs");require("./listbox-DnoqOo5u.cjs");const C={displayValueAs:{default:"label"}},R={props:C};var V=Object.defineProperty,A=Object.getOwnPropertyDescriptor,h=(v,e,t,i)=>{for(var s=i>1?void 0:i?A(e,t):e,n=v.length-1,l;n>=0;n--)(l=v[n])&&(s=(i?l(e,t,s):l(s))||s);return i&&s&&V(e,t,s),s};exports.PktCombobox=class extends $.PktInputElement{constructor(){super(),this.helptextSlot=r.e(),this.value="",this.options=[],this.defaultOptions=[],this.allowUserInput=!1,this.typeahead=!1,this.includeSearch=!1,this.searchPlaceholder="",this.multiple=!1,this.maxlength=null,this.displayValueAs=R.props.displayValueAs.default,this.tagPlacement=null,this._options=[],this._isOptionsOpen=!1,this._value=[],this._userInfoMessage="",this._addValueText=null,this._maxIsReached=!1,this._search="",this._inputFocus=!1,this._editingSingleValue=!1,this.inputRef=r.e(),this.arrowRef=r.e(),this.listboxRef=r.e(),this.focusRef=r.e(),this.optionTagRef=r.e(),this.optionsController=new I.PktOptionsSlotController(this),this.slotController=new w.PktSlotController(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){var e;if(super.connectedCallback(),document&&document.body.addEventListener("click",t=>{this._isOptionsOpen&&!this.contains(t.target)&&this.handleFocusOut(t)}),this._options=[],this.defaultOptions&&this.defaultOptions.length){const t=((e=this.options)==null?void 0:e.filter(i=>i.userAdded))||[];this.options=[...t,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(this.optionsController.nodes.length){const t=[];this.optionsController.nodes.forEach(i=>{if(!i.textContent&&!i.getAttribute("value"))return null;const s={value:i.getAttribute("value")||i.textContent||"",label:i.textContent||i.getAttribute("value")||""};i.getAttribute("data-prefix")&&(s.prefix=i.getAttribute("data-prefix")||void 0),i.getAttribute("tagskincolor")&&(s.tagSkinColor=i.getAttribute("tagskincolor")),i.getAttribute("description")&&(s.description=i.getAttribute("description")||void 0),s.fulltext=s.value+s.label+(s.prefix||""),t.push(s)}),t.length&&(this.options=[...t],this._options=[...t])}}updated(e){if(e.has("_value")&&this.valueChanged(this._value,e.get("_value")),e.has("value")&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]]),this.isMaxItemsReached()),e.has("defaultOptions")&&this.defaultOptions.length){const t=(Array.isArray(this.options)?this.options:[]).filter(i=>i.userAdded)||[];this.options=[...t,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(e.has("options")){const s=(e.get("options")||this._options||[]).filter(l=>l&&l.userAdded).filter(l=>!(Array.isArray(this.options)?this.options:[]).some(o=>o.value===l.value)),n=[...s,...this.options];this._options=n,s.length>0&&(this.options=n),this._options.forEach(l=>{if(l.value&&!l.label&&(l.label=l.value),l.selected&&!this._value.includes(l.value)){const o=[...this._value];this._value=[...this._value,l.value],this.valueChanged(this._value,o)}l.fulltext=l.value+l.label+(l.prefix||""),l.selected=l.selected||this._value.includes(l.value)})}e.has("_search")&&this.dispatchEvent(new CustomEvent("search",{detail:this._search,bubbles:!1})),super.updated(e)}attributeChangedCallback(e,t,i){e==="value"&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]])),e==="options"&&(this._options=Array.isArray(this.options)?[...this.options]:[],this._options.forEach(s=>{s.value&&!s.label&&(s.label=s.value),s.selected&&!this._value.includes(s.value)&&(this._value=[...this._value,s.value]),s.fulltext=s.value+s.label+(s.prefix||"")}),this._search=""),super.attributeChangedCallback(e,t,i)}render(){return a.x`
1
+ "use strict";const a=require("./element-CJ_QKaki.cjs"),c=require("./if-defined-Bc9-_I01.cjs"),d=require("./state-DSjcvzDN.cjs"),r=require("./ref-BFa5Utho.cjs"),y=require("./class-map-C_erArZz.cjs"),O=require("./repeat-BZb41H64.cjs"),$=require("./input-element-BmXkhljw.cjs"),I=require("./pkt-options-controller-CiuBG6Lt.cjs"),w=require("./pkt-slot-controller-BzddBp7z.cjs");require("./input-wrapper-B-Qseywc.cjs");require("./icon-BGuizDwk.cjs");require("./tag-EFUKrc8q.cjs");require("./listbox-DnoqOo5u.cjs");const C={displayValueAs:{default:"label"}},R={props:C};var V=Object.defineProperty,A=Object.getOwnPropertyDescriptor,h=(v,e,t,i)=>{for(var s=i>1?void 0:i?A(e,t):e,n=v.length-1,l;n>=0;n--)(l=v[n])&&(s=(i?l(e,t,s):l(s))||s);return i&&s&&V(e,t,s),s};exports.PktCombobox=class extends $.PktInputElement{constructor(){super(),this.helptextSlot=r.e(),this.value="",this.options=[],this.defaultOptions=[],this.allowUserInput=!1,this.typeahead=!1,this.includeSearch=!1,this.searchPlaceholder="",this.multiple=!1,this.maxlength=null,this.displayValueAs=R.props.displayValueAs.default,this.tagPlacement=null,this._options=[],this._isOptionsOpen=!1,this._value=[],this._userInfoMessage="",this._addValueText=null,this._maxIsReached=!1,this._search="",this._inputFocus=!1,this._editingSingleValue=!1,this.inputRef=r.e(),this.arrowRef=r.e(),this.listboxRef=r.e(),this.focusRef=r.e(),this.optionTagRef=r.e(),this.optionsController=new I.PktOptionsSlotController(this),this.slotController=new w.PktSlotController(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){var e;if(super.connectedCallback(),document&&document.body.addEventListener("click",t=>{this._isOptionsOpen&&!this.contains(t.target)&&this.handleFocusOut(t)}),this._options=[],this.defaultOptions&&this.defaultOptions.length){const t=((e=this.options)==null?void 0:e.filter(i=>i.userAdded))||[];this.options=[...t,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(this.optionsController.nodes.length){const t=[];this.optionsController.nodes.forEach(i=>{if(!i.textContent&&!i.getAttribute("value"))return null;const s={value:i.getAttribute("value")||i.textContent||"",label:i.textContent||i.getAttribute("value")||""};i.getAttribute("data-prefix")&&(s.prefix=i.getAttribute("data-prefix")||void 0),i.getAttribute("tagskincolor")&&(s.tagSkinColor=i.getAttribute("tagskincolor")),i.getAttribute("description")&&(s.description=i.getAttribute("description")||void 0),s.fulltext=s.value+s.label+(s.prefix||""),t.push(s)}),t.length&&(this.options=[...t],this._options=[...t])}}updated(e){if(e.has("_value")&&this.valueChanged(this._value,e.get("_value")),e.has("value")&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]]),this.isMaxItemsReached()),e.has("defaultOptions")&&this.defaultOptions.length){const t=(Array.isArray(this.options)?this.options:[]).filter(i=>i.userAdded)||[];this.options=[...t,...JSON.parse(JSON.stringify(this.defaultOptions))],this._options=Array.isArray(this.options)?[...this.options]:[]}if(e.has("options")){const s=(e.get("options")||this._options||[]).filter(l=>l&&l.userAdded).filter(l=>!(Array.isArray(this.options)?this.options:[]).some(o=>o.value===l.value)),n=[...s,...this.options];this._options=n,s.length>0&&(this.options=n),this._options.forEach(l=>{if(l.value&&!l.label&&(l.label=l.value),l.selected&&!this._value.includes(l.value)){const o=[...this._value];this._value=[...this._value,l.value],this.valueChanged(this._value,o)}l.fulltext=l.value+l.label+(l.prefix||""),l.selected=l.selected||this._value.includes(l.value)})}e.has("_search")&&this.dispatchEvent(new CustomEvent("search",{detail:this._search,bubbles:!1})),super.updated(e)}attributeChangedCallback(e,t,i){e==="value"&&(Array.isArray(this.value)?this._value=this.value:this.value&&this.multiple?this._value=this.value.split(","):this.value?this._value=[this.value]:this._value=[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]])),e==="options"&&(this._options=Array.isArray(this.options)?[...this.options]:[],this._options.forEach(s=>{s.value&&!s.label&&(s.label=s.value),s.selected&&!this._value.includes(s.value)&&(this._value=[...this._value,s.value]),s.fulltext=s.value+s.label+(s.prefix||"")}),this._search=""),super.attributeChangedCallback(e,t,i)}render(){return a.x`
2
2
  <pkt-input-wrapper
3
3
  .label=${this.label}
4
4
  .helptext=${this.helptext}
@@ -14,7 +14,7 @@
14
14
  ?requiredTag=${this.requiredTag}
15
15
  .requiredText=${this.requiredText}
16
16
  .tagText=${this.tagText}
17
- ?useWrapper=${this.useWrapper}
17
+ useWrapper=${this.useWrapper}
18
18
  .forId=${this.allowUserInput||this.typeahead?this.id+"-input":this.id+"-arrow"}
19
19
  class="pkt-combobox__wrapper"
20
20
  @labelClick=${this.handleInputClick}
@@ -4,7 +4,7 @@ import { r as c } from "./state-DS_kr2Fy.js";
4
4
  import { e as _, n as v } from "./ref-Xa5dbh--.js";
5
5
  import { e as k } from "./class-map-wy7PUk0P.js";
6
6
  import { c as R } from "./repeat-CJ79egkN.js";
7
- import { P as V } from "./input-element-Dqu8udwd.js";
7
+ import { P as V } from "./input-element-B0VPRK_E.js";
8
8
  import { P as A } from "./pkt-options-controller-CZO1nxZ8.js";
9
9
  import { P as C } from "./pkt-slot-controller-BPGj-LC5.js";
10
10
  import "./input-wrapper-Wu3Yv-bn.js";
@@ -93,7 +93,7 @@ let o = class extends V {
93
93
  ?requiredTag=${this.requiredTag}
94
94
  .requiredText=${this.requiredText}
95
95
  .tagText=${this.tagText}
96
- ?useWrapper=${this.useWrapper}
96
+ useWrapper=${this.useWrapper}
97
97
  .forId=${this.allowUserInput || this.typeahead ? this.id + "-input" : this.id + "-arrow"}
98
98
  class="pkt-combobox__wrapper"
99
99
  @labelClick=${this.handleInputClick}
@@ -1,4 +1,4 @@
1
- "use strict";const a=require("./element-CJ_QKaki.cjs"),_=require("./state-DSjcvzDN.cjs"),u=require("./calendar-Dz1Cnzx5.cjs"),I=require("./input-element-KUsQQ-1d.cjs"),p=require("./ref-BFa5Utho.cjs");require("./icon-BGuizDwk.cjs");require("./input-wrapper-B-Qseywc.cjs");const f=require("./class-map-C_erArZz.cjs"),O=require("./repeat-BZb41H64.cjs");require("./tag-EFUKrc8q.cjs");const S=require("./utils-byXsEz1u.cjs"),y=require("./if-defined-Bc9-_I01.cjs"),B=require("./pkt-slot-controller-BzddBp7z.cjs");var A=Object.defineProperty,M=Object.getOwnPropertyDescriptor,w=(i,e,t,s)=>{for(var n=s>1?void 0:s?M(e,t):e,l=i.length-1,r;l>=0;l--)(r=i[l])&&(n=(s?r(e,t,n):r(n))||n);return s&&n&&A(e,t,n),n};exports.PktDateTags=class extends a.PktElement{constructor(){super(...arguments),this.dates=[],this.dateformat="dd.MM.yyyy",this.className="pkt-datepicker__tags",this.idBase=S.uuidish()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},a.x`
1
+ "use strict";const a=require("./element-CJ_QKaki.cjs"),_=require("./state-DSjcvzDN.cjs"),u=require("./calendar-Dz1Cnzx5.cjs"),I=require("./input-element-BmXkhljw.cjs"),p=require("./ref-BFa5Utho.cjs");require("./icon-BGuizDwk.cjs");require("./input-wrapper-B-Qseywc.cjs");const f=require("./class-map-C_erArZz.cjs"),O=require("./repeat-BZb41H64.cjs");require("./tag-EFUKrc8q.cjs");const S=require("./utils-byXsEz1u.cjs"),y=require("./if-defined-Bc9-_I01.cjs"),B=require("./pkt-slot-controller-BzddBp7z.cjs");var A=Object.defineProperty,M=Object.getOwnPropertyDescriptor,w=(i,e,t,s)=>{for(var n=s>1?void 0:s?M(e,t):e,l=i.length-1,r;l>=0;l--)(r=i[l])&&(n=(s?r(e,t,n):r(n))||n);return s&&n&&A(e,t,n),n};exports.PktDateTags=class extends a.PktElement{constructor(){super(...arguments),this.dates=[],this.dateformat="dd.MM.yyyy",this.className="pkt-datepicker__tags",this.idBase=S.uuidish()}render(){return this.classes={"pkt-date-tags":!0,[this.className]:!0},a.x`
2
2
  <div class=${f.e(this.classes)} aria-live="polite">
3
3
  ${Array.isArray(this.dates)&&this.dates[0]?O.c(u.sortDateStrings((this.dates??[]).filter(Boolean)),e=>e,e=>{var t;return a.x` <pkt-tag
4
4
  id=${this.idBase+e+"-tag"}
@@ -260,7 +260,7 @@
260
260
  ?required=${this.required}
261
261
  ?optionalTag=${this.optionalTag}
262
262
  ?requiredTag=${this.requiredTag}
263
- ?useWrapper=${this.useWrapper}
263
+ useWrapper=${this.useWrapper}
264
264
  .optionalText=${this.optionalText}
265
265
  .requiredText=${this.requiredText}
266
266
  .tagText=${this.tagText}
@@ -1,7 +1,7 @@
1
1
  import { P as I, E as A, x as d, n as a, a as R } from "./element-CRDRygXu.js";
2
2
  import { r as q } from "./state-DS_kr2Fy.js";
3
3
  import { s as U, f as N, n as j, a as W, i as H, b as L, v as O, d as G, e as J, p as Q, g as z } from "./calendar-Bz27nuTP.js";
4
- import { P as X } from "./input-element-Dqu8udwd.js";
4
+ import { P as X } from "./input-element-B0VPRK_E.js";
5
5
  import { e as u, n as c } from "./ref-Xa5dbh--.js";
6
6
  import "./icon-1dy7UZcu.js";
7
7
  import "./input-wrapper-Wu3Yv-bn.js";
@@ -1217,7 +1217,7 @@ let p = class extends X {
1217
1217
  ?required=${this.required}
1218
1218
  ?optionalTag=${this.optionalTag}
1219
1219
  ?requiredTag=${this.requiredTag}
1220
- ?useWrapper=${this.useWrapper}
1220
+ useWrapper=${this.useWrapper}
1221
1221
  .optionalText=${this.optionalText}
1222
1222
  .requiredText=${this.requiredText}
1223
1223
  .tagText=${this.tagText}
package/dist/index.d.ts CHANGED
@@ -11,6 +11,8 @@ declare type Booleanish = boolean | 'true' | 'false';
11
11
 
12
12
  declare type Booleanish_2 = boolean | 'true' | 'false';
13
13
 
14
+ declare type Booleanish_3 = boolean | 'true' | 'false';
15
+
14
16
  /**
15
17
  * We define all props as optional. Native HTML attributes are optional by default,
16
18
  * but the TS definition require either null or value. This way we can support showing a value as optional
@@ -959,7 +961,7 @@ declare class PktInputElement<T = {}> extends PktElement<Props_2 & T> {
959
961
  optionalTag: boolean;
960
962
  requiredTag: boolean;
961
963
  skipForwardTestid: boolean;
962
- useWrapper: boolean;
964
+ useWrapper: Booleanish_2;
963
965
  fullwidth: boolean;
964
966
  counterMaxLength: number;
965
967
  errorMessage: string;
@@ -1017,7 +1019,7 @@ export declare class PktInputWrapper extends PktElement<Props_6> {
1017
1019
  ariaDescribedby: string | undefined;
1018
1020
  hasFieldset: boolean;
1019
1021
  role: string | null;
1020
- useWrapper: Booleanish_2;
1022
+ useWrapper: Booleanish_3;
1021
1023
  protected updated(changedProperties: PropertyValues): void;
1022
1024
  render(): TemplateResult<1>;
1023
1025
  private toggleDropdown;
@@ -1,12 +1,12 @@
1
- import { P as Fe, t as g, n as d } from "./element-CRDRygXu.js";
2
- import { r as Ce } from "./state-DS_kr2Fy.js";
1
+ import { P as Ce, t as b, n as d } from "./element-CRDRygXu.js";
2
+ import { r as Fe } from "./state-DS_kr2Fy.js";
3
3
  import { u as Te } from "./utils-DznhwRXm.js";
4
- import { s as Se } from "./input-wrapper-CDgenrYA.js";
4
+ import { s as Ae } from "./input-wrapper-CDgenrYA.js";
5
5
  var oe = {}, le;
6
- function Ae() {
6
+ function Se() {
7
7
  return le || (le = 1, (function() {
8
- (function(M) {
9
- const s = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), p = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), C = /* @__PURE__ */ new WeakMap(), b = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), A = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), L = {
8
+ (function(f) {
9
+ const s = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), m = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), F = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), C = /* @__PURE__ */ new WeakMap(), A = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), L = {
10
10
  ariaAtomic: "aria-atomic",
11
11
  ariaAutoComplete: "aria-autocomplete",
12
12
  ariaBusy: "aria-busy",
@@ -59,7 +59,7 @@ function Ae() {
59
59
  return a;
60
60
  },
61
61
  set(n) {
62
- a = n, t.isConnected ? k(t, r, n) : F.set(t, e);
62
+ a = n, t.isConnected ? k(t, r, n) : C.set(t, e);
63
63
  }
64
64
  });
65
65
  }
@@ -91,31 +91,31 @@ function Ae() {
91
91
  t.forEach((e) => {
92
92
  const { addedNodes: i, removedNodes: a } = e, r = Array.from(i), n = Array.from(a);
93
93
  r.forEach((o) => {
94
- var m;
95
- if (u.has(o) && o.constructor.formAssociated && K(o), F.has(o)) {
96
- const f = F.get(o);
97
- Object.keys(L).filter((v) => f[v] !== null).forEach((v) => {
98
- k(o, L[v], f[v]);
99
- }), F.delete(o);
94
+ var y;
95
+ if (u.has(o) && o.constructor.formAssociated && K(o), C.has(o)) {
96
+ const p = C.get(o);
97
+ Object.keys(L).filter((w) => p[w] !== null).forEach((w) => {
98
+ k(o, L[w], p[w]);
99
+ }), C.delete(o);
100
100
  }
101
101
  if (I.has(o)) {
102
- const f = I.get(o);
103
- k(o, "internals-valid", f.validity.valid.toString()), k(o, "internals-invalid", (!f.validity.valid).toString()), k(o, "aria-invalid", (!f.validity.valid).toString()), I.delete(o);
102
+ const p = I.get(o);
103
+ k(o, "internals-valid", p.validity.valid.toString()), k(o, "internals-invalid", (!p.validity.valid).toString()), k(o, "aria-invalid", (!p.validity.valid).toString()), I.delete(o);
104
104
  }
105
105
  if (o.localName === "form") {
106
- const f = b.get(o), E = document.createTreeWalker(o, NodeFilter.SHOW_ELEMENT, {
106
+ const p = v.get(o), M = document.createTreeWalker(o, NodeFilter.SHOW_ELEMENT, {
107
107
  acceptNode($) {
108
- return u.has($) && $.constructor.formAssociated && !(f && f.has($)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
108
+ return u.has($) && $.constructor.formAssociated && !(p && p.has($)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
109
109
  }
110
110
  });
111
- let v = E.nextNode();
112
- for (; v; )
113
- K(v), v = E.nextNode();
111
+ let w = M.nextNode();
112
+ for (; w; )
113
+ K(w), w = M.nextNode();
114
114
  }
115
- o.localName === "fieldset" && ((m = N.observe) === null || m === void 0 || m.call(N, o, G), j(o, !0));
115
+ o.localName === "fieldset" && ((y = N.observe) === null || y === void 0 || y.call(N, o, G), j(o, !0));
116
116
  }), n.forEach((o) => {
117
- const m = u.get(o);
118
- m && p.get(m) && J(m), C.has(o) && C.get(o).disconnect();
117
+ const y = u.get(o);
118
+ y && m.get(y) && J(y), F.has(o) && F.get(o).disconnect();
119
119
  });
120
120
  });
121
121
  }
@@ -142,15 +142,15 @@ function Ae() {
142
142
  }, W = (t, e) => {
143
143
  t.toggleAttribute("internals-disabled", e), e ? k(t, "aria-disabled", "true") : t.removeAttribute("aria-disabled"), t.formDisabledCallback && t.formDisabledCallback.apply(t, [e]);
144
144
  }, J = (t) => {
145
- p.get(t).forEach((i) => {
145
+ m.get(t).forEach((i) => {
146
146
  i.remove();
147
- }), p.set(t, []);
147
+ }), m.set(t, []);
148
148
  }, Q = (t, e) => {
149
149
  const i = document.createElement("input");
150
- return i.type = "hidden", i.name = t.getAttribute("name"), t.after(i), p.get(e).push(i), i;
150
+ return i.type = "hidden", i.name = t.getAttribute("name"), t.after(i), m.get(e).push(i), i;
151
151
  }, ue = (t, e) => {
152
152
  var i;
153
- p.set(e, []), (i = N.observe) === null || i === void 0 || i.call(N, t, G);
153
+ m.set(e, []), (i = N.observe) === null || i === void 0 || i.call(N, t, G);
154
154
  }, X = (t, e) => {
155
155
  if (e.length) {
156
156
  Array.from(e).forEach((a) => a.addEventListener("click", t.click.bind(t)));
@@ -158,7 +158,7 @@ function Ae() {
158
158
  e[0].id || (i = `${e[0].htmlFor}_Label`, e[0].id = i), k(t, "aria-labelledby", i);
159
159
  }
160
160
  }, R = (t) => {
161
- const e = Array.from(t.elements).filter((n) => !n.tagName.includes("-") && n.validity).map((n) => n.validity.valid), i = b.get(t) || [], a = Array.from(i).filter((n) => n.isConnected).map((n) => u.get(n).validity.valid), r = [...e, ...a].includes(!1);
161
+ const e = Array.from(t.elements).filter((n) => !n.tagName.includes("-") && n.validity).map((n) => n.validity.valid), i = v.get(t) || [], a = Array.from(i).filter((n) => n.isConnected).map((n) => u.get(n).validity.valid), r = [...e, ...a].includes(!1);
162
162
  t.toggleAttribute("internals-invalid", r), t.toggleAttribute("internals-valid", !r);
163
163
  }, fe = (t) => {
164
164
  R(O(t.target));
@@ -168,25 +168,25 @@ function Ae() {
168
168
  const e = ["button[type=submit]", "input[type=submit]", "button:not([type])"].map((i) => `${i}:not([disabled])`).map((i) => `${i}:not([form])${t.id ? `,${i}[form='${t.id}']` : ""}`).join(",");
169
169
  t.addEventListener("click", (i) => {
170
170
  if (i.target.closest(e)) {
171
- const r = b.get(t);
171
+ const r = v.get(t);
172
172
  if (t.noValidate)
173
173
  return;
174
- r.size && Array.from(r).reverse().map((m) => u.get(m).reportValidity()).includes(!1) && i.preventDefault();
174
+ r.size && Array.from(r).reverse().map((y) => u.get(y).reportValidity()).includes(!1) && i.preventDefault();
175
175
  }
176
176
  });
177
177
  }, ye = (t) => {
178
- const e = b.get(t.target);
178
+ const e = v.get(t.target);
179
179
  e && e.size && e.forEach((i) => {
180
180
  i.constructor.formAssociated && i.formResetCallback && i.formResetCallback.apply(i);
181
181
  });
182
182
  }, Y = (t, e, i) => {
183
183
  if (e) {
184
- const a = b.get(e);
184
+ const a = v.get(e);
185
185
  if (a)
186
186
  a.add(t);
187
187
  else {
188
188
  const r = /* @__PURE__ */ new Set();
189
- r.add(t), b.set(e, r), me(e), e.addEventListener("reset", ye), e.addEventListener("input", fe), e.addEventListener("change", pe);
189
+ r.add(t), v.set(e, r), me(e), e.addEventListener("reset", ye), e.addEventListener("input", fe), e.addEventListener("change", pe);
190
190
  }
191
191
  V.set(e, { ref: t, internals: i }), t.constructor.formAssociated && t.formAssociatedCallback && setTimeout(() => {
192
192
  t.formAssociatedCallback.apply(t, [e]);
@@ -195,11 +195,11 @@ function Ae() {
195
195
  }, O = (t) => {
196
196
  let e = t.parentNode;
197
197
  return e && e.tagName !== "FORM" && (e = O(e)), e;
198
- }, w = (t, e, i = DOMException) => {
198
+ }, E = (t, e, i = DOMException) => {
199
199
  if (!t.constructor.formAssociated)
200
200
  throw new i(e);
201
201
  }, Z = (t, e, i) => {
202
- const a = b.get(t);
202
+ const a = v.get(t);
203
203
  return a && a.size && a.forEach((r) => {
204
204
  u.get(r)[i]() || (e = !1);
205
205
  }), e;
@@ -302,11 +302,11 @@ function Ae() {
302
302
  const { get: r } = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, "elements");
303
303
  Object.defineProperty(HTMLFormElement.prototype, "elements", {
304
304
  get(...n) {
305
- const o = r.call(this, ...n), m = Array.from(b.get(this) || []);
306
- if (m.length === 0)
305
+ const o = r.call(this, ...n), y = Array.from(v.get(this) || []);
306
+ if (y.length === 0)
307
307
  return o;
308
- const f = Array.from(o).concat(m).sort((E, v) => E.compareDocumentPosition ? E.compareDocumentPosition(v) & 2 ? 1 : -1 : 0);
309
- return new Me(f);
308
+ const p = Array.from(o).concat(y).sort((M, w) => M.compareDocumentPosition ? M.compareDocumentPosition(w) & 2 ? 1 : -1 : 0);
309
+ return new Me(p);
310
310
  }
311
311
  });
312
312
  }
@@ -322,7 +322,7 @@ function Ae() {
322
322
  }
323
323
  checkValidity() {
324
324
  const e = s.get(this);
325
- if (w(e, "Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
325
+ if (E(e, "Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
326
326
  return !0;
327
327
  const i = h.get(this);
328
328
  if (!i.valid) {
@@ -337,28 +337,28 @@ function Ae() {
337
337
  }
338
338
  get form() {
339
339
  const e = s.get(this);
340
- w(e, "Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");
340
+ E(e, "Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");
341
341
  let i;
342
342
  return e.constructor.formAssociated === !0 && (i = O(e)), i;
343
343
  }
344
344
  get labels() {
345
345
  const e = s.get(this);
346
- w(e, "Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");
346
+ E(e, "Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");
347
347
  const i = e.getAttribute("id"), a = e.getRootNode();
348
348
  return a && i ? a.querySelectorAll(`[for="${i}"]`) : [];
349
349
  }
350
350
  reportValidity() {
351
351
  const e = s.get(this);
352
- if (w(e, "Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
352
+ if (E(e, "Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate)
353
353
  return !0;
354
- const i = this.checkValidity(), a = A.get(this);
354
+ const i = this.checkValidity(), a = S.get(this);
355
355
  if (a && !e.constructor.formAssociated)
356
356
  throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");
357
357
  return !i && a && (e.focus(), a.focus()), i;
358
358
  }
359
359
  setFormValue(e) {
360
360
  const i = s.get(this);
361
- if (w(i, "Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."), J(this), e != null && !(e instanceof FormData)) {
361
+ if (E(i, "Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."), J(this), e != null && !(e instanceof FormData)) {
362
362
  if (i.getAttribute("name")) {
363
363
  const a = Q(i, this);
364
364
  a.value = e;
@@ -373,35 +373,35 @@ function Ae() {
373
373
  }
374
374
  setValidity(e, i, a) {
375
375
  const r = s.get(this);
376
- if (w(r, "Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !e)
376
+ if (E(r, "Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !e)
377
377
  throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");
378
- A.set(this, a);
378
+ S.set(this, a);
379
379
  const n = h.get(this), o = {};
380
- for (const E in e)
381
- o[E] = e[E];
380
+ for (const M in e)
381
+ o[M] = e[M];
382
382
  Object.keys(o).length === 0 && be(n);
383
- const m = Object.assign(Object.assign({}, n), o);
384
- delete m.valid;
385
- const { valid: f } = ve(n, m, this.form);
386
- if (!f && !i)
383
+ const y = Object.assign(Object.assign({}, n), o);
384
+ delete y.valid;
385
+ const { valid: p } = ve(n, y, this.form);
386
+ if (!p && !i)
387
387
  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.");
388
- y.set(this, f ? "" : i), r.isConnected ? (r.toggleAttribute("internals-invalid", !f), r.toggleAttribute("internals-valid", f), k(r, "aria-invalid", `${!f}`)) : I.set(r, this);
388
+ g.set(this, p ? "" : i), r.isConnected ? (r.toggleAttribute("internals-invalid", !p), r.toggleAttribute("internals-valid", p), k(r, "aria-invalid", `${!p}`)) : I.set(r, this);
389
389
  }
390
390
  get shadowRoot() {
391
- const e = s.get(this), i = S.get(e);
391
+ const e = s.get(this), i = A.get(e);
392
392
  return i || null;
393
393
  }
394
394
  get validationMessage() {
395
395
  const e = s.get(this);
396
- return w(e, "Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."), y.get(this);
396
+ return E(e, "Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."), g.get(this);
397
397
  }
398
398
  get validity() {
399
399
  const e = s.get(this);
400
- return w(e, "Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."), h.get(this);
400
+ return E(e, "Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."), h.get(this);
401
401
  }
402
402
  get willValidate() {
403
403
  const e = s.get(this);
404
- return w(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"));
404
+ return E(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"));
405
405
  }
406
406
  }
407
407
  function Ve() {
@@ -460,9 +460,9 @@ function Ae() {
460
460
  }), typeof Element < "u") {
461
461
  let e = function(...a) {
462
462
  const r = i.apply(this, a);
463
- if (S.set(this, r), D()) {
463
+ if (A.set(this, r), D()) {
464
464
  const n = new MutationObserver(P);
465
- window.ShadyDOM ? n.observe(this, H) : n.observe(r, H), C.set(this, n);
465
+ window.ShadyDOM ? n.observe(this, H) : n.observe(r, H), F.set(this, n);
466
466
  }
467
467
  return r;
468
468
  };
@@ -472,45 +472,53 @@ function Ae() {
472
472
  D() && typeof document < "u" && new MutationObserver(P).observe(document.documentElement, H), typeof HTMLFormElement < "u" && ke(), (t || typeof window < "u" && !window.CustomStateSet) && q();
473
473
  }
474
474
  }
475
- return !!customElements.polyfillWrapFlushCallback || (Ve() ? typeof window < "u" && !window.CustomStateSet && q(HTMLElement.prototype.attachInternals) : ne(!1)), M.forceCustomStateSetPolyfill = q, M.forceElementInternalsPolyfill = ne, Object.defineProperty(M, "__esModule", { value: !0 }), M;
475
+ return !!customElements.polyfillWrapFlushCallback || (Ve() ? typeof window < "u" && !window.CustomStateSet && q(HTMLElement.prototype.attachInternals) : ne(!1)), f.forceCustomStateSetPolyfill = q, f.forceElementInternalsPolyfill = ne, Object.defineProperty(f, "__esModule", { value: !0 }), f;
476
476
  })({});
477
477
  })()), oe;
478
478
  }
479
- Ae();
480
- var xe = Object.defineProperty, l = (M, s, h, p) => {
481
- for (var u = void 0, y = M.length - 1, V; y >= 0; y--)
482
- (V = M[y]) && (u = V(s, h, u) || u);
479
+ Se();
480
+ var xe = Object.defineProperty, l = (f, s, h, m) => {
481
+ for (var u = void 0, g = f.length - 1, V; g >= 0; g--)
482
+ (V = f[g]) && (u = V(s, h, u) || u);
483
483
  return u && xe(s, h, u), u;
484
484
  };
485
- class c extends Fe {
485
+ const Ie = {
486
+ fromAttribute(f) {
487
+ return f == null ? !1 : f === "" || f === "true" || f === !0 ? !0 : f === "false" || f === !1 ? !1 : !!f;
488
+ },
489
+ toAttribute(f) {
490
+ return f ? "true" : "false";
491
+ }
492
+ };
493
+ class c extends Ce {
486
494
  constructor() {
487
- 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 = Te(), 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 = Se.props.helptextDropdownButton.default, this.label = null, this.optionalText = g.forms.labels.optional, this.requiredText = g.forms.labels.required, this.tagText = null, this.dataTestid = "", this.touched = !1, this.internals = this.attachInternals();
495
+ 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 = Te(), 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 = Ae.props.helptextDropdownButton.default, this.label = null, this.optionalText = b.forms.labels.optional, this.requiredText = b.forms.labels.required, this.tagText = null, this.dataTestid = "", this.touched = !1, this.internals = this.attachInternals();
488
496
  }
489
497
  static get formAssociated() {
490
498
  return !0;
491
499
  }
492
500
  manageValidity(s) {
493
- var h, p, u, y, V, C, b, T, F, S, A;
494
- s && (this.required && !this.value ? this.internals.setValidity({ valueMissing: !0 }, g.forms.messages.required, s) : (h = s.validity) != null && h.typeMismatch || (p = s.validity) != null && p.badInput ? this.internals.setValidity({ typeMismatch: !0 }, g.forms.messages.invalid, s) : (u = s.validity) != null && u.patternMismatch ? this.internals.setValidity(
501
+ var h, m, u, g, V, F, v, T, C, A, S;
502
+ s && (this.required && !this.value ? this.internals.setValidity({ valueMissing: !0 }, b.forms.messages.required, s) : (h = s.validity) != null && h.typeMismatch || (m = s.validity) != null && m.badInput ? this.internals.setValidity({ typeMismatch: !0 }, b.forms.messages.invalid, s) : (u = s.validity) != null && u.patternMismatch ? this.internals.setValidity(
495
503
  { patternMismatch: !0 },
496
- g.forms.messages.invalidPattern,
504
+ b.forms.messages.invalidPattern,
497
505
  s
498
- ) : (y = s.validity) != null && y.tooShort || this.minlength && this.minlength > 0 && this.value.length < this.minlength ? this.internals.setValidity({ tooShort: !0 }, g.forms.messages.tooShort, s) : (V = s.validity) != null && V.tooLong || this.maxlength && this.maxlength > 0 && this.value.length > this.maxlength ? this.internals.setValidity({ tooLong: !0 }, g.forms.messages.tooLong, s) : (C = s.validity) != null && C.rangeUnderflow ? this.internals.setValidity(
506
+ ) : (g = s.validity) != null && g.tooShort || this.minlength && this.minlength > 0 && this.value.length < this.minlength ? this.internals.setValidity({ tooShort: !0 }, b.forms.messages.tooShort, s) : (V = s.validity) != null && V.tooLong || this.maxlength && this.maxlength > 0 && this.value.length > this.maxlength ? this.internals.setValidity({ tooLong: !0 }, b.forms.messages.tooLong, s) : (F = s.validity) != null && F.rangeUnderflow ? this.internals.setValidity(
499
507
  { rangeUnderflow: !0 },
500
- this.min ? g.forms.messages.rangeUnderflowMin.replace("{min}", (b = this.min) == null ? void 0 : b.toString()) : g.forms.messages.rangeUnderflow,
508
+ this.min ? b.forms.messages.rangeUnderflowMin.replace("{min}", (v = this.min) == null ? void 0 : v.toString()) : b.forms.messages.rangeUnderflow,
501
509
  s
502
- ) : (T = s.validity) != null && T.stepMismatch ? this.internals.setValidity({ stepMismatch: !0 }, g.forms.messages.invalid, s) : (F = s.validity) != null && F.rangeOverflow ? this.internals.setValidity(
510
+ ) : (T = s.validity) != null && T.stepMismatch ? this.internals.setValidity({ stepMismatch: !0 }, b.forms.messages.invalid, s) : (C = s.validity) != null && C.rangeOverflow ? this.internals.setValidity(
503
511
  { rangeOverflow: !0 },
504
- this.max ? g.forms.messages.rangeOverflowMax.replace("{max}", (S = this.max) == null ? void 0 : S.toString()) : g.forms.messages.rangeOverflow,
512
+ this.max ? b.forms.messages.rangeOverflowMax.replace("{max}", (A = this.max) == null ? void 0 : A.toString()) : b.forms.messages.rangeOverflow,
505
513
  s
506
- ) : (A = s.validity) != null && A.customError ? this.internals.setValidity({ customError: !0 }, s.validationMessage, s) : this.internals.setValidity({}));
514
+ ) : (S = s.validity) != null && S.customError ? this.internals.setValidity({ customError: !0 }, s.validationMessage, s) : this.internals.setValidity({}));
507
515
  }
508
516
  setFormValue(s) {
509
517
  if (this.internals)
510
518
  if (Array.isArray(s)) {
511
519
  const h = new FormData();
512
- s.forEach((p) => {
513
- h.append(this.name, p);
520
+ s.forEach((m) => {
521
+ h.append(this.name, m);
514
522
  }), this.internals.setFormValue(h);
515
523
  } else
516
524
  this.internals.setFormValue(s);
@@ -519,13 +527,13 @@ class c extends Fe {
519
527
  // Do not use valueChanged or onChange for radios and checkboxes!
520
528
  valueChecked(s) {
521
529
  if (!this.touched) return;
522
- const h = this.internals.form || this.closest("form"), p = h ? new FormData(h) : null;
530
+ const h = this.internals.form || this.closest("form"), m = h ? new FormData(h) : null;
523
531
  h && h.querySelectorAll(
524
532
  `pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`
525
533
  ).forEach((u) => {
526
- const y = u;
527
- y.name === this.name && y.value !== this.value && y.checked && (y.checked = !1);
528
- }), typeof s == "string" ? (this.checked = s === "true", this.internals.ariaChecked = s === "true") : typeof s == "boolean" && (this.checked = s, this.internals.ariaChecked = s), this.checked ? (this.internals.setFormValue(this.value || "on", this.value || "on"), p && p.append(this.name, this.value || "on"), this.internals.states.add("--checked")) : (this.internals.setFormValue(null, null), p && p.delete(this.name), this.internals.states.delete("--checked")), this.dispatchEvent(new Event("change", { bubbles: !0, composed: !0 })), this.dispatchEvent(
534
+ const g = u;
535
+ g.name === this.name && g.value !== this.value && g.checked && (g.checked = !1);
536
+ }), typeof s == "string" ? (this.checked = s === "true", this.internals.ariaChecked = s === "true") : typeof s == "boolean" && (this.checked = s, this.internals.ariaChecked = s), this.checked ? (this.internals.setFormValue(this.value || "on", this.value || "on"), m && m.append(this.name, this.value || "on"), this.internals.states.add("--checked")) : (this.internals.setFormValue(null, null), m && m.delete(this.name), this.internals.states.delete("--checked")), this.dispatchEvent(new Event("change", { bubbles: !0, composed: !0 })), this.dispatchEvent(
529
537
  new CustomEvent("value-change", {
530
538
  detail: this.checked,
531
539
  bubbles: !0,
@@ -664,7 +672,7 @@ l([
664
672
  d({ type: Boolean })
665
673
  ], c.prototype, "skipForwardTestid");
666
674
  l([
667
- d({ type: Boolean, reflect: !1 })
675
+ d({ type: Boolean, reflect: !0, converter: Ie })
668
676
  ], c.prototype, "useWrapper");
669
677
  l([
670
678
  d({ type: Boolean, reflect: !0 })
@@ -700,7 +708,7 @@ l([
700
708
  d({ type: String, attribute: "data-testid" })
701
709
  ], c.prototype, "dataTestid");
702
710
  l([
703
- Ce()
711
+ Fe()
704
712
  ], c.prototype, "touched");
705
713
  export {
706
714
  c as P
@@ -0,0 +1 @@
1
+ "use strict";const r=require("./element-CJ_QKaki.cjs"),Vt=require("./state-DSjcvzDN.cjs"),Ct=require("./utils-byXsEz1u.cjs"),Ft=require("./input-wrapper-EoSAbU-U.cjs");var nt={},ot;function Tt(){return ot||(ot=1,(function(){(function(f){const s=new WeakMap,u=new WeakMap,m=new WeakMap,h=new WeakMap,g=new WeakMap,k=new WeakMap,C=new WeakMap,b=new WeakMap,F=new WeakMap,V=new WeakMap,T=new WeakMap,A=new WeakMap,$=new WeakMap,U=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"},lt=(e,t)=>{for(let i in I){t[i]=null;let a=null;const n=I[i];Object.defineProperty(t,i,{get(){return a},set(o){a=o,e.isConnected?M(e,n,o):V.set(e,t)}})}};function z(e){const t=h.get(e),{form:i}=t;X(e,i,t),Q(e,t.labels)}const K=(e,t=!1)=>{const i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(o){return h.has(o)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let a=i.nextNode();const n=!t||e.disabled;for(;a;)a.formDisabledCallback&&n&&W(a,e.disabled),a=i.nextNode()},j={attributes:!0,attributeFilter:["disabled","name"]},L=O()?new MutationObserver(e=>{for(const t of e){const i=t.target;if(t.attributeName==="disabled"&&(i.constructor.formAssociated?W(i,i.hasAttribute("disabled")):i.localName==="fieldset"&&K(i)),t.attributeName==="name"&&i.constructor.formAssociated){const a=h.get(i),n=F.get(i);a.setFormValue(n)}}}):{};function D(e){e.forEach(t=>{const{addedNodes:i,removedNodes:a}=t,n=Array.from(i),o=Array.from(a);n.forEach(l=>{var y;if(h.has(l)&&l.constructor.formAssociated&&z(l),V.has(l)){const p=V.get(l);Object.keys(I).filter(v=>p[v]!==null).forEach(v=>{M(l,I[v],p[v])}),V.delete(l)}if(x.has(l)){const p=x.get(l);M(l,"internals-valid",p.validity.valid.toString()),M(l,"internals-invalid",(!p.validity.valid).toString()),M(l,"aria-invalid",(!p.validity.valid).toString()),x.delete(l)}if(l.localName==="form"){const p=b.get(l),E=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode(_){return h.has(_)&&_.constructor.formAssociated&&!(p&&p.has(_))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let v=E.nextNode();for(;v;)z(v),v=E.nextNode()}l.localName==="fieldset"&&((y=L.observe)===null||y===void 0||y.call(L,l,j),K(l,!0))}),o.forEach(l=>{const y=h.get(l);y&&m.get(y)&&G(y),C.has(l)&&C.get(l).disconnect()})})}function ct(e){e.forEach(t=>{const{removedNodes:i}=t;i.forEach(a=>{const n=$.get(t.target);h.has(a)&&Z(a),n.disconnect()})})}const dt=e=>{var t,i;const a=new MutationObserver(ct);!((t=window==null?void 0:window.ShadyDOM)===null||t===void 0)&&t.inUse&&e.mode&&e.host&&(e=e.host),(i=a.observe)===null||i===void 0||i.call(a,e,{childList:!0}),$.set(e,a)};O()&&new MutationObserver(D);const P={childList:!0,subtree:!0},M=(e,t,i)=>{e.getAttribute(t)!==i&&e.setAttribute(t,i)},W=(e,t)=>{e.toggleAttribute("internals-disabled",t),t?M(e,"aria-disabled","true"):e.removeAttribute("aria-disabled"),e.formDisabledCallback&&e.formDisabledCallback.apply(e,[t])},G=e=>{m.get(e).forEach(i=>{i.remove()}),m.set(e,[])},J=(e,t)=>{const i=document.createElement("input");return i.type="hidden",i.name=e.getAttribute("name"),e.after(i),m.get(t).push(i),i},ut=(e,t)=>{var i;m.set(t,[]),(i=L.observe)===null||i===void 0||i.call(L,e,j)},Q=(e,t)=>{if(t.length){Array.from(t).forEach(a=>a.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)}},N=e=>{const t=Array.from(e.elements).filter(o=>!o.tagName.includes("-")&&o.validity).map(o=>o.validity.valid),i=b.get(e)||[],a=Array.from(i).filter(o=>o.isConnected).map(o=>h.get(o).validity.valid),n=[...t,...a].includes(!1);e.toggleAttribute("internals-invalid",n),e.toggleAttribute("internals-valid",!n)},ht=e=>{N(R(e.target))},ft=e=>{N(R(e.target))},pt=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 n=b.get(e);if(e.noValidate)return;n.size&&Array.from(n).reverse().map(y=>h.get(y).reportValidity()).includes(!1)&&i.preventDefault()}})},mt=e=>{const t=b.get(e.target);t&&t.size&&t.forEach(i=>{i.constructor.formAssociated&&i.formResetCallback&&i.formResetCallback.apply(i)})},X=(e,t,i)=>{if(t){const a=b.get(t);if(a)a.add(e);else{const n=new Set;n.add(e),b.set(t,n),pt(t),t.addEventListener("reset",mt),t.addEventListener("input",ht),t.addEventListener("change",ft)}k.set(t,{ref:e,internals:i}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout(()=>{e.formAssociatedCallback.apply(e,[t])},0),N(t)}},R=e=>{let t=e.parentNode;return t&&t.tagName!=="FORM"&&(t=R(t)),t},w=(e,t,i=DOMException)=>{if(!e.constructor.formAssociated)throw new i(t)},Y=(e,t,i)=>{const a=b.get(e);return a&&a.size&&a.forEach(n=>{h.get(n)[i]()||(t=!1)}),t},Z=e=>{if(e.constructor.formAssociated){const t=h.get(e),{labels:i,form:a}=t;Q(e,i),X(e,a,t)}};function O(){return typeof MutationObserver<"u"}class yt{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 gt=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),bt=(e,t,i)=>(e.valid=vt(t),Object.keys(t).forEach(a=>e[a]=t[a]),i&&N(i),e),vt=e=>{let t=!0;for(let i in e)i!=="valid"&&e[i]!==!1&&(t=!1);return t},H=new WeakMap;function tt(e,t){e.toggleAttribute(t,!0),e.part&&e.part.add(t)}class q 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),a=H.get(this),n=`state${t}`;return a.isConnected?tt(a,n):setTimeout(()=>{tt(a,n)}),i}clear(){for(let[t]of this.entries())this.delete(t);super.clear()}delete(t){const i=super.delete(t),a=H.get(this);return a.isConnected?(a.toggleAttribute(`state${t}`,!1),a.part&&a.part.remove(`state${t}`)):setTimeout(()=>{a.toggleAttribute(`state${t}`,!1),a.part&&a.part.remove(`state${t}`)}),i}}function et(e,t,i,a){if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?a:i==="a"?a.call(e):a?a.value:t.get(e)}function wt(e,t,i,a,n){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 S;class Et{constructor(t){S.set(this,void 0),wt(this,S,t);for(let i=0;i<t.length;i++){let a=t[i];this[i]=a,a.hasAttribute("name")&&(this[a.getAttribute("name")]=a)}Object.freeze(this)}get length(){return et(this,S,"f").length}[(S=new WeakMap,Symbol.iterator)](){return et(this,S,"f")[Symbol.iterator]()}item(t){return this[t]==null?null:this[t]}namedItem(t){return this[t]==null?null:this[t]}}function Mt(){const e=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=i;const t=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=a;function i(...o){let l=e.apply(this,o);return Y(this,l,"checkValidity")}function a(...o){let l=t.apply(this,o);return Y(this,l,"reportValidity")}const{get:n}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...o){const l=n.call(this,...o),y=Array.from(b.get(this)||[]);if(y.length===0)return l;const p=Array.from(l).concat(y).sort((E,v)=>E.compareDocumentPosition?E.compareDocumentPosition(v)&2?1:-1:0);return new Et(p)}})}class it{static get isPolyfilled(){return!0}constructor(t){if(!t||!t.tagName||t.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const i=t.getRootNode(),a=new yt;this.states=new q(t),s.set(this,t),u.set(this,a),h.set(t,this),lt(t,this),ut(t,this),Object.seal(this),i instanceof DocumentFragment&&dt(i)}checkValidity(){const t=s.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=u.get(this);if(!i.valid){const a=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});t.dispatchEvent(a)}return i.valid}get form(){const t=s.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=R(t)),i}get labels(){const t=s.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"),a=t.getRootNode();return a&&i?a.querySelectorAll(`[for="${i}"]`):[]}reportValidity(){const t=s.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(),a=A.get(this);if(a&&!t.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!i&&a&&(t.focus(),a.focus()),i}setFormValue(t){const i=s.get(this);if(w(i,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),G(this),t!=null&&!(t instanceof FormData)){if(i.getAttribute("name")){const a=J(i,this);a.value=t}}else t!=null&&t instanceof FormData&&Array.from(t).reverse().forEach(([a,n])=>{if(typeof n=="string"){const o=J(i,this);o.name=a,o.value=n}});F.set(i,t)}setValidity(t,i,a){const n=s.get(this);if(w(n,"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.");A.set(this,a);const o=u.get(this),l={};for(const E in t)l[E]=t[E];Object.keys(l).length===0&&gt(o);const y=Object.assign(Object.assign({},o),l);delete y.valid;const{valid:p}=bt(o,y,this.form);if(!p&&!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.");g.set(this,p?"":i),n.isConnected?(n.toggleAttribute("internals-invalid",!p),n.toggleAttribute("internals-valid",p),M(n,"aria-invalid",`${!p}`)):x.set(n,this)}get shadowRoot(){const t=s.get(this),i=T.get(t);return i||null}get validationMessage(){const t=s.get(this);return w(t,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),g.get(this)}get validity(){const t=s.get(this);return w(t,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),u.get(this)}get willValidate(){const t=s.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 kt(){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(a=>a in i.internals)}let at=!1,st=!1;function B(e){st||(st=!0,window.CustomStateSet=q,e&&(HTMLElement.prototype.attachInternals=function(...t){const i=e.call(this,t);return i.states=new q(this),i}))}function rt(e=!0){if(!at){if(at=!0,typeof window<"u"&&(window.ElementInternals=it),typeof CustomElementRegistry<"u"){const t=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(i,a,n){if(a.formAssociated){const o=a.prototype.connectedCallback;a.prototype.connectedCallback=function(){U.has(this)||(U.set(this,!0),this.hasAttribute("disabled")&&W(this,!0)),o!=null&&o.apply(this),Z(this)}}t.call(this,i,a,n)}}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(h.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new it(this)}),typeof Element<"u"){let t=function(...a){const n=i.apply(this,a);if(T.set(this,n),O()){const o=new MutationObserver(D);window.ShadyDOM?o.observe(this,P):o.observe(n,P),C.set(this,o)}return n};const i=Element.prototype.attachShadow;Element.prototype.attachShadow=t}O()&&typeof document<"u"&&new MutationObserver(D).observe(document.documentElement,P),typeof HTMLFormElement<"u"&&Mt(),(e||typeof window<"u"&&!window.CustomStateSet)&&B()}}return!!customElements.polyfillWrapFlushCallback||(kt()?typeof window<"u"&&!window.CustomStateSet&&B(HTMLElement.prototype.attachInternals):rt(!1)),f.forceCustomStateSetPolyfill=B,f.forceElementInternalsPolyfill=rt,Object.defineProperty(f,"__esModule",{value:!0}),f})({})})()),nt}Tt();var At=Object.defineProperty,d=(f,s,u,m)=>{for(var h=void 0,g=f.length-1,k;g>=0;g--)(k=f[g])&&(h=k(s,u,h)||h);return h&&At(s,u,h),h};const St={fromAttribute(f){return f==null?!1:f===""||f==="true"||f===!0?!0:f==="false"||f===!1?!1:!!f},toAttribute(f){return f?"true":"false"}};class c 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=Ct.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=Ft.specs.props.helptextDropdownButton.default,this.label=null,this.optionalText=r.translations.forms.labels.optional,this.requiredText=r.translations.forms.labels.required,this.tagText=null,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(s){var u,m,h,g,k,C,b,F,V,T,A;s&&(this.required&&!this.value?this.internals.setValidity({valueMissing:!0},r.translations.forms.messages.required,s):(u=s.validity)!=null&&u.typeMismatch||(m=s.validity)!=null&&m.badInput?this.internals.setValidity({typeMismatch:!0},r.translations.forms.messages.invalid,s):(h=s.validity)!=null&&h.patternMismatch?this.internals.setValidity({patternMismatch:!0},r.translations.forms.messages.invalidPattern,s):(g=s.validity)!=null&&g.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},r.translations.forms.messages.tooShort,s):(k=s.validity)!=null&&k.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},r.translations.forms.messages.tooLong,s):(C=s.validity)!=null&&C.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?r.translations.forms.messages.rangeUnderflowMin.replace("{min}",(b=this.min)==null?void 0:b.toString()):r.translations.forms.messages.rangeUnderflow,s):(F=s.validity)!=null&&F.stepMismatch?this.internals.setValidity({stepMismatch:!0},r.translations.forms.messages.invalid,s):(V=s.validity)!=null&&V.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?r.translations.forms.messages.rangeOverflowMax.replace("{max}",(T=this.max)==null?void 0:T.toString()):r.translations.forms.messages.rangeOverflow,s):(A=s.validity)!=null&&A.customError?this.internals.setValidity({customError:!0},s.validationMessage,s):this.internals.setValidity({}))}setFormValue(s){if(this.internals)if(Array.isArray(s)){const u=new FormData;s.forEach(m=>{u.append(this.name,m)}),this.internals.setFormValue(u)}else this.internals.setFormValue(s)}valueChecked(s){if(!this.touched)return;const u=this.internals.form||this.closest("form"),m=u?new FormData(u):null;u&&u.querySelectorAll(`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`).forEach(h=>{const g=h;g.name===this.name&&g.value!==this.value&&g.checked&&(g.checked=!1)}),typeof s=="string"?(this.checked=s==="true",this.internals.ariaChecked=s==="true"):typeof s=="boolean"&&(this.checked=s,this.internals.ariaChecked=s),this.checked?(this.internals.setFormValue(this.value||"on",this.value||"on"),m&&m.append(this.name,this.value||"on"),this.internals.states.add("--checked")):(this.internals.setFormValue(null,null),m&&m.delete(this.name),this.internals.states.delete("--checked")),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:this.checked,bubbles:!0,composed:!0})),this.internals.reportValidity()}valueChanged(s,u){(u!==this.value||u!==this._value)&&(typeof s=="string"?((this.multiple||this.range)&&s.includes(",")&&(s=s.split(",")),this.value=s,this._value=Array.isArray(s)?s:[s]):Array.isArray(s)?(this.value=this.multiple||this.range?s:s[0],this._value=s):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&u&&u.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(u==null?void 0:u.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate()))}clearInputValue(){const s=this.multiple||this.range?[]:"";this.value=s,this.internals.setFormValue(s),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:s,bubbles:!0,composed:!0}))}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}))}onChange(s){if(!this.touched){this.touched=!0,s&&this.setFormValue(s);return}typeof s!="string"&&!Array.isArray(s)||((this.range||this.multiple)&&!Array.isArray(s)&&s.includes(",")&&(s=s.split(",")),!this.multiple&&!this.range&&Array.isArray(s)&&(s=s[0]),this.setFormValue(s),this.manageValidity(this.inputRef.value),this.inputRefTo&&this.manageValidity(this.inputRefTo.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:s,bubbles:!0,composed:!0})))}formResetCallback(){this.touched=!1,this._options&&this._options.length&&this._options.forEach(s=>{"selected"in s&&(s.selected=!1)}),this.checked!==void 0?(this.checked=!1,this.internals.ariaChecked=!1,this.internals.setFormValue("",""),this.inputRef.value.checked=!1,this.valueChecked(this.checked)):(this.internals.setFormValue(""),this.value=this.defaultValue||(this.multiple||this.range?[]:""),this._value=this.value,this.valueChanged(this.value,null)),this.internals.ariaInvalid=!1}updated(s){super.updated(s),s.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(s){if(super.firstUpdated(s),!this.form){const u=this.internals.form||this.closest("form");this.form=u}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=!0,this.checked=!0),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.ariaDisabled=!0),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const u=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=u,this.internals.setFormValue(u?this.value||"on":"",u?this.value||"on":"")}else this.internals.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))}}d([r.n()],c.prototype,"defaultValue");d([r.n({type:Boolean,reflect:!0})],c.prototype,"disabled");d([r.n({type:Boolean,reflect:!0})],c.prototype,"readonly");d([r.n({type:Boolean,reflect:!0})],c.prototype,"required");d([r.n({type:Number,reflect:!0})],c.prototype,"max");d([r.n({type:Number,reflect:!0})],c.prototype,"maxlength");d([r.n({type:Number,reflect:!0})],c.prototype,"min");d([r.n({type:Number,reflect:!0})],c.prototype,"minlength");d([r.n({type:Number,reflect:!0})],c.prototype,"step");d([r.n({type:String})],c.prototype,"ariaDescribedBy");d([r.n({type:String})],c.prototype,"ariaLabelledby");d([r.n({type:String,reflect:!0})],c.prototype,"name");d([r.n({type:String,reflect:!0})],c.prototype,"pattern");d([r.n({type:String,reflect:!0})],c.prototype,"placeholder");d([r.n({type:String,reflect:!0})],c.prototype,"id");d([r.n({type:Boolean})],c.prototype,"counter");d([r.n({type:Boolean})],c.prototype,"hasError");d([r.n({type:Boolean})],c.prototype,"inline");d([r.n({type:Boolean})],c.prototype,"hasFieldset");d([r.n({type:Boolean})],c.prototype,"optionalTag");d([r.n({type:Boolean})],c.prototype,"requiredTag");d([r.n({type:Boolean})],c.prototype,"skipForwardTestid");d([r.n({type:Boolean,reflect:!0,converter:St})],c.prototype,"useWrapper");d([r.n({type:Boolean,reflect:!0})],c.prototype,"fullwidth");d([r.n({type:Number})],c.prototype,"counterMaxLength");d([r.n({type:String})],c.prototype,"errorMessage");d([r.n({type:String})],c.prototype,"helptext");d([r.n({type:String})],c.prototype,"helptextDropdown");d([r.n({type:String,reflect:!1})],c.prototype,"helptextDropdownButton");d([r.n({type:String})],c.prototype,"label");d([r.n({type:String,reflect:!1})],c.prototype,"optionalText");d([r.n({type:String,reflect:!1})],c.prototype,"requiredText");d([r.n({type:String,reflect:!1})],c.prototype,"tagText");d([r.n({type:String,attribute:"data-testid"})],c.prototype,"dataTestid");d([Vt.r()],c.prototype,"touched");exports.PktInputElement=c;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./checkbox-CqoOG2KJ.cjs"),t=e.PktCheckbox;Object.defineProperty(exports,"PktCheckbox",{enumerable:!0,get:()=>e.PktCheckbox});exports.default=t;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./checkbox-BP5zOlPy.cjs"),t=e.PktCheckbox;Object.defineProperty(exports,"PktCheckbox",{enumerable:!0,get:()=>e.PktCheckbox});exports.default=t;
@@ -1,4 +1,4 @@
1
- import { P as o } from "./checkbox-CCmRUWTH.js";
1
+ import { P as o } from "./checkbox-CfXOh6Lw.js";
2
2
  const k = o;
3
3
  export {
4
4
  o as PktCheckbox,
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./combobox-6WP1urZS.cjs"),o=e.PktCombobox;Object.defineProperty(exports,"PktCombobox",{enumerable:!0,get:()=>e.PktCombobox});exports.default=o;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./combobox-CGIvxIvQ.cjs"),o=e.PktCombobox;Object.defineProperty(exports,"PktCombobox",{enumerable:!0,get:()=>e.PktCombobox});exports.default=o;
@@ -1,4 +1,4 @@
1
- import { P as o } from "./combobox-CtHgl1n2.js";
1
+ import { P as o } from "./combobox-fxki3LT7.js";
2
2
  const b = o;
3
3
  export {
4
4
  o as PktCombobox,
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./datepicker-DEO1C69C.cjs"),t=e.PktDatepicker;Object.defineProperty(exports,"PktDatepicker",{enumerable:!0,get:()=>e.PktDatepicker});Object.defineProperty(exports,"PktDatepickerMultiple",{enumerable:!0,get:()=>e.PktDatepickerMultiple});Object.defineProperty(exports,"PktDatepickerRange",{enumerable:!0,get:()=>e.PktDatepickerRange});Object.defineProperty(exports,"PktDatepickerSingle",{enumerable:!0,get:()=>e.PktDatepickerSingle});exports.default=t;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./datepicker-BldfV7vp.cjs"),t=e.PktDatepicker;Object.defineProperty(exports,"PktDatepicker",{enumerable:!0,get:()=>e.PktDatepicker});Object.defineProperty(exports,"PktDatepickerMultiple",{enumerable:!0,get:()=>e.PktDatepickerMultiple});Object.defineProperty(exports,"PktDatepickerRange",{enumerable:!0,get:()=>e.PktDatepickerRange});Object.defineProperty(exports,"PktDatepickerSingle",{enumerable:!0,get:()=>e.PktDatepickerSingle});exports.default=t;
@@ -1,5 +1,5 @@
1
- import { a as e } from "./datepicker-q9haFM81.js";
2
- import { d as p, c as i, b as c } from "./datepicker-q9haFM81.js";
1
+ import { a as e } from "./datepicker-DHHVRmYw.js";
2
+ import { d as p, c as i, b as c } from "./datepicker-DHHVRmYw.js";
3
3
  const a = e;
4
4
  export {
5
5
  e as PktDatepicker,
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./alert-BXbmjri0.cjs"),l=require("./accordionitem-DCZrHVNR.cjs"),m=require("./backlink-BzEvli8m.cjs"),g=require("./button-1jYzMALk.cjs"),P=require("./calendar-Dz1Cnzx5.cjs"),h=require("./card-Cf-UcGAP.cjs"),f=require("./combobox-6WP1urZS.cjs"),y=require("./consent-Cgc6nuiP.cjs"),O=require("./checkbox-CqoOG2KJ.cjs"),t=require("./element-CJ_QKaki.cjs"),j=require("./pkt-slot-controller-BzddBp7z.cjs"),s=require("./ref-BFa5Utho.cjs"),q=require("./class-map-C_erArZz.cjs"),k=require("./datepicker-DEO1C69C.cjs"),x=require("./helptext-EPTR9AIl.cjs"),C=require("./heading--JKFppLS.cjs"),v=require("./icon-BGuizDwk.cjs"),S=require("./input-wrapper-B-Qseywc.cjs"),T=require("./link-Da3pZ_CW.cjs"),$=require("./linkcard-BM23gzhS.cjs"),L=require("./loader-Bo8RCbCJ.cjs"),_=require("./messagebox-C76IcXTl.cjs"),I=require("./modal-Cdz9JcCX.cjs"),A=require("./progressbar-8gzOtJyh.cjs"),p=require("./radiobutton-FwxpKELo.cjs"),B=require("./tag-EFUKrc8q.cjs"),d=require("./tabitem-D5zyipN1.cjs"),D=require("./textarea-CzN0E0TV.cjs"),M=require("./textinput-D8v6D6ie.cjs"),R=require("./select-BbmLn1qh.cjs");var H=Object.defineProperty,w=Object.getOwnPropertyDescriptor,o=(a,e,r,i)=>{for(var n=i>1?void 0:i?w(e,r):e,u=a.length-1,c;u>=0;u--)(c=a[u])&&(n=(i?c(e,r,n):c(n))||n);return i&&n&&H(e,r,n),n};exports.PktComponent=class extends t.PktElement{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=s.e(),this.namedSlot=s.e(),this.slotController=new j.PktSlotController(this,this.defaultSlot,this.namedSlot)}connectedCallback(){this.strings.length&&this.strings.forEach(e=>{this._list.push(e.toUpperCase())}),super.connectedCallback()}render(){const e={"pkt-component":!0,"pkt-component--has-list":this.strings.length>0,"pkt-darkmode":this.darkmode};return t.x`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./alert-BXbmjri0.cjs"),l=require("./accordionitem-DCZrHVNR.cjs"),m=require("./backlink-BzEvli8m.cjs"),g=require("./button-1jYzMALk.cjs"),P=require("./calendar-Dz1Cnzx5.cjs"),h=require("./card-Cf-UcGAP.cjs"),f=require("./combobox-CGIvxIvQ.cjs"),y=require("./consent-Cgc6nuiP.cjs"),O=require("./checkbox-BP5zOlPy.cjs"),t=require("./element-CJ_QKaki.cjs"),j=require("./pkt-slot-controller-BzddBp7z.cjs"),s=require("./ref-BFa5Utho.cjs"),q=require("./class-map-C_erArZz.cjs"),k=require("./datepicker-BldfV7vp.cjs"),x=require("./helptext-EPTR9AIl.cjs"),C=require("./heading--JKFppLS.cjs"),v=require("./icon-BGuizDwk.cjs"),S=require("./input-wrapper-B-Qseywc.cjs"),T=require("./link-Da3pZ_CW.cjs"),$=require("./linkcard-BM23gzhS.cjs"),L=require("./loader-Bo8RCbCJ.cjs"),_=require("./messagebox-C76IcXTl.cjs"),I=require("./modal-Cdz9JcCX.cjs"),A=require("./progressbar-8gzOtJyh.cjs"),p=require("./radiobutton-BuKXgQm_.cjs"),B=require("./tag-EFUKrc8q.cjs"),d=require("./tabitem-D5zyipN1.cjs"),D=require("./textarea-BC962syN.cjs"),M=require("./textinput-DdcR7OZ-.cjs"),R=require("./select-BWnw7CJy.cjs");var H=Object.defineProperty,w=Object.getOwnPropertyDescriptor,o=(a,e,r,i)=>{for(var n=i>1?void 0:i?w(e,r):e,u=a.length-1,c;u>=0;u--)(c=a[u])&&(n=(i?c(e,r,n):c(n))||n);return i&&n&&H(e,r,n),n};exports.PktComponent=class extends t.PktElement{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=s.e(),this.namedSlot=s.e(),this.slotController=new j.PktSlotController(this,this.defaultSlot,this.namedSlot)}connectedCallback(){this.strings.length&&this.strings.forEach(e=>{this._list.push(e.toUpperCase())}),super.connectedCallback()}render(){const e={"pkt-component":!0,"pkt-component--has-list":this.strings.length>0,"pkt-darkmode":this.darkmode};return t.x`
2
2
  <div class="${q.e(e)}">
3
3
  <h1 class="pkt-txt-28">${this.string}</h1>
4
4
 
package/dist/pkt-index.js CHANGED
@@ -5,14 +5,14 @@ import { P as O } from "./button-lDOnZON6.js";
5
5
  import { c as f } from "./calendar-Bz27nuTP.js";
6
6
  import { P as j } from "./calendar-Bz27nuTP.js";
7
7
  import { P as G } from "./card-M1X36b6i.js";
8
- import { P as K } from "./combobox-CtHgl1n2.js";
8
+ import { P as K } from "./combobox-fxki3LT7.js";
9
9
  import { P as U } from "./consent-CYFXjOXF.js";
10
- import { P as q } from "./checkbox-CCmRUWTH.js";
10
+ import { P as q } from "./checkbox-CfXOh6Lw.js";
11
11
  import { P as d, t as h, x as P, n, a as c } from "./element-CRDRygXu.js";
12
12
  import { P as x } from "./pkt-slot-controller-BPGj-LC5.js";
13
13
  import { e as m, n as k } from "./ref-Xa5dbh--.js";
14
14
  import { e as u } from "./class-map-wy7PUk0P.js";
15
- import { P as F, a as J } from "./datepicker-q9haFM81.js";
15
+ import { P as F, a as J } from "./datepicker-DHHVRmYw.js";
16
16
  import { P as V } from "./helptext-Cs3QHeEy.js";
17
17
  import { P as Y } from "./heading-Cs5yGnJg.js";
18
18
  import { P as tt } from "./icon-1dy7UZcu.js";
@@ -23,12 +23,12 @@ import { P as pt } from "./loader-BVvBzaPI.js";
23
23
  import { P as Pt } from "./messagebox-DwdMXoAe.js";
24
24
  import { P as kt } from "./modal-BGXk3f9u.js";
25
25
  import { P as dt } from "./progressbar-kxcBEspG.js";
26
- import { P as ct, P as xt } from "./radiobutton-DuAo3CdN.js";
26
+ import { P as ct, P as xt } from "./radiobutton-C_MzK8dE.js";
27
27
  import { P as gt } from "./tag-CqMgt01I.js";
28
28
  import { a as bt, P as St } from "./tabitem-NV2fzs_-.js";
29
- import { P as $t } from "./textarea-CIb4VWtN.js";
30
- import { P as _t } from "./textinput-D5_RTkRY.js";
31
- import { P as Tt } from "./select-wak-jukY.js";
29
+ import { P as $t } from "./textarea-O0r9TzqP.js";
30
+ import { P as _t } from "./textinput-COK0LcXj.js";
31
+ import { P as Tt } from "./select-BHEtNwcz.js";
32
32
  var g = Object.defineProperty, v = Object.getOwnPropertyDescriptor, s = (t, e, i, a) => {
33
33
  for (var r = a > 1 ? void 0 : a ? v(e, i) : e, p = t.length - 1, l; p >= 0; p--)
34
34
  (l = t[p]) && (r = (a ? l(e, i, r) : l(r)) || r);
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./radiobutton-FwxpKELo.cjs"),e=t.PktRadioButton;Object.defineProperty(exports,"PktRadioButton",{enumerable:!0,get:()=>t.PktRadioButton});exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./radiobutton-BuKXgQm_.cjs"),e=t.PktRadioButton;Object.defineProperty(exports,"PktRadioButton",{enumerable:!0,get:()=>t.PktRadioButton});exports.default=e;
@@ -1,4 +1,4 @@
1
- import { P as t } from "./radiobutton-DuAo3CdN.js";
1
+ import { P as t } from "./radiobutton-C_MzK8dE.js";
2
2
  const a = t;
3
3
  export {
4
4
  t as PktRadioButton,
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./select-BbmLn1qh.cjs"),t=e.PktSelect;Object.defineProperty(exports,"PktSelect",{enumerable:!0,get:()=>e.PktSelect});exports.default=t;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./select-BWnw7CJy.cjs"),t=e.PktSelect;Object.defineProperty(exports,"PktSelect",{enumerable:!0,get:()=>e.PktSelect});exports.default=t;
@@ -1,4 +1,4 @@
1
- import { P as t } from "./select-wak-jukY.js";
1
+ import { P as t } from "./select-BHEtNwcz.js";
2
2
  const a = t;
3
3
  export {
4
4
  t as PktSelect,
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./textarea-CzN0E0TV.cjs"),t=e.PktTextarea;Object.defineProperty(exports,"PktTextarea",{enumerable:!0,get:()=>e.PktTextarea});exports.default=t;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./textarea-BC962syN.cjs"),t=e.PktTextarea;Object.defineProperty(exports,"PktTextarea",{enumerable:!0,get:()=>e.PktTextarea});exports.default=t;
@@ -1,4 +1,4 @@
1
- import { P as a } from "./textarea-CIb4VWtN.js";
1
+ import { P as a } from "./textarea-O0r9TzqP.js";
2
2
  const e = a;
3
3
  export {
4
4
  a as PktTextarea,
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./textinput-D8v6D6ie.cjs"),t=e.PktTextinput;Object.defineProperty(exports,"PktTextinput",{enumerable:!0,get:()=>e.PktTextinput});exports.default=t;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./textinput-DdcR7OZ-.cjs"),t=e.PktTextinput;Object.defineProperty(exports,"PktTextinput",{enumerable:!0,get:()=>e.PktTextinput});exports.default=t;
@@ -1,4 +1,4 @@
1
- import { P as t } from "./textinput-D5_RTkRY.js";
1
+ import { P as t } from "./textinput-COK0LcXj.js";
2
2
  const p = t;
3
3
  export {
4
4
  t as PktTextinput,
@@ -1,4 +1,4 @@
1
- "use strict";const t=require("./element-CJ_QKaki.cjs"),r=require("./state-DSjcvzDN.cjs"),u=require("./input-element-KUsQQ-1d.cjs"),h=require("./ref-BFa5Utho.cjs"),c=require("./class-map-C_erArZz.cjs");var d=Object.defineProperty,k=Object.getOwnPropertyDescriptor,i=(p,e,n,a)=>{for(var s=a>1?void 0:a?k(e,n):e,o=p.length-1,l;o>=0;o--)(l=p[o])&&(s=(a?l(e,n,s):l(s))||s);return a&&s&&d(e,n,s),s};exports.PktRadioButton=class extends u.PktInputElement{constructor(){super(...arguments),this.inputRef=h.e(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.checked=null,this.type="radio",this.tagText=null,this.optionalTag=!1,this.optionalText="Valgfritt",this.requiredTag=!1,this.requiredText="Må fylles ut",this._checked=!1}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,n,a){e==="defaultChecked"&&(this._checked=this.defaultChecked),e==="checked"&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(e,n,a)}render(){const e=c.e({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),n=c.e({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),a=c.e({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-sr-only":this.hideLabel}),s="pkt-tag pkt-tag--small pkt-tag--thin-text",o=()=>t.x`
1
+ "use strict";const t=require("./element-CJ_QKaki.cjs"),r=require("./state-DSjcvzDN.cjs"),u=require("./input-element-BmXkhljw.cjs"),h=require("./ref-BFa5Utho.cjs"),c=require("./class-map-C_erArZz.cjs");var d=Object.defineProperty,k=Object.getOwnPropertyDescriptor,i=(p,e,n,a)=>{for(var s=a>1?void 0:a?k(e,n):e,o=p.length-1,l;o>=0;o--)(l=p[o])&&(s=(a?l(e,n,s):l(s))||s);return a&&s&&d(e,n,s),s};exports.PktRadioButton=class extends u.PktInputElement{constructor(){super(...arguments),this.inputRef=h.e(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.checked=null,this.type="radio",this.tagText=null,this.optionalTag=!1,this.optionalText="Valgfritt",this.requiredTag=!1,this.requiredText="Må fylles ut",this._checked=!1}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,n,a){e==="defaultChecked"&&(this._checked=this.defaultChecked),e==="checked"&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(e,n,a)}render(){const e=c.e({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),n=c.e({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),a=c.e({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-sr-only":this.hideLabel}),s="pkt-tag pkt-tag--small pkt-tag--thin-text",o=()=>t.x`
2
2
  ${this.tagText?t.x`<span class=${s+" pkt-tag--gray"}>${this.tagText}</span>`:t.E}
3
3
  ${this.optionalTag?t.x`<span class=${s+" pkt-tag--blue-light"}>${this.optionalText}</span>`:t.E}
4
4
  ${this.requiredTag?t.x`<span class=${s+" pkt-tag--beige"}>${this.requiredText}</span>`:t.E}
@@ -1,6 +1,6 @@
1
1
  import { x as h, E as n, n as s, a as d } from "./element-CRDRygXu.js";
2
2
  import { r as k } from "./state-DS_kr2Fy.js";
3
- import { P as f } from "./input-element-Dqu8udwd.js";
3
+ import { P as f } from "./input-element-B0VPRK_E.js";
4
4
  import { e as g, n as y } from "./ref-Xa5dbh--.js";
5
5
  import { e as u } from "./class-map-wy7PUk0P.js";
6
6
  var $ = Object.defineProperty, b = Object.getOwnPropertyDescriptor, i = (e, p, c, l) => {
@@ -2,7 +2,7 @@ import { x as r, n as c, a as v } from "./element-CRDRygXu.js";
2
2
  import { r as f } from "./state-DS_kr2Fy.js";
3
3
  import { e as u, n as d } from "./ref-Xa5dbh--.js";
4
4
  import { o as l } from "./if-defined-BWZGb3bh.js";
5
- import { P as _ } from "./input-element-Dqu8udwd.js";
5
+ import { P as _ } from "./input-element-B0VPRK_E.js";
6
6
  import { P as x } from "./pkt-options-controller-CZO1nxZ8.js";
7
7
  import { P as b } from "./pkt-slot-controller-BPGj-LC5.js";
8
8
  import "./input-wrapper-Wu3Yv-bn.js";
@@ -101,7 +101,7 @@ let h = class extends _ {
101
101
  ?inline=${this.inline}
102
102
  ?optionalTag=${this.optionalTag}
103
103
  ?requiredTag=${this.requiredTag}
104
- ?useWrapper=${this.useWrapper}
104
+ useWrapper=${this.useWrapper}
105
105
  ariaDescribedBy=${l(this.ariaDescribedBy)}
106
106
  class="pkt-select"
107
107
  errorMessage=${l(this.errorMessage)}
@@ -1,4 +1,4 @@
1
- "use strict";const h=require("./element-CJ_QKaki.cjs"),u=require("./state-DSjcvzDN.cjs"),r=require("./ref-BFa5Utho.cjs"),o=require("./if-defined-Bc9-_I01.cjs"),d=require("./input-element-KUsQQ-1d.cjs"),c=require("./pkt-options-controller-CiuBG6Lt.cjs"),v=require("./pkt-slot-controller-BzddBp7z.cjs");require("./input-wrapper-B-Qseywc.cjs");var f=Object.defineProperty,_=Object.getOwnPropertyDescriptor,a=(p,t,e,s)=>{for(var i=s>1?void 0:s?_(t,e):t,l=p.length-1,n;l>=0;l--)(n=p[l])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&f(t,e,i),i};exports.PktSelect=class extends d.PktInputElement{constructor(){super(),this.inputRef=r.e(),this.helptextSlot=r.e(),this._optionsProp=[],this.value="",this._options=[],this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new c.PktOptionsSlotController(this),this.slotController=new v.PktSlotController(this,this.helptextSlot),this.slotController.skipOptions=!0}get options(){return this._options.map(t=>({...t,selected:t.value===this.value}))}set options(t){this._optionsProp=t,this.requestUpdate("_optionsProp",this._options)}connectedCallback(){super.connectedCallback();const t=this._optionsProp.length>0,e=this.optionsController.nodes.length&&this.optionsController.nodes.length>0;!t&&e?this.optionsController.nodes.forEach(s=>{const i={value:s.hasAttribute("value")?s.getAttribute("value")??"":s.textContent??"",label:s.textContent||s.getAttribute("value")||"",disabled:s.hasAttribute("disabled"),selected:s.hasAttribute("selected"),hidden:s.hasAttribute("data-hidden")};s.getAttribute("selected")&&!this.value&&(this.value=i.value),this._options.push(i)}):(this._options=this._optionsProp,this._options.forEach(s=>{s.selected&&!this.value&&(this.value=s.value)}))}add(t,e){const s={value:t.value||t.text,label:t.text||t.value,selected:t.selected,disabled:t.disabled};if(e===void 0)this._options.push(s);else if(typeof e=="number")this._options.splice(e,0,s);else{const i=e.value||e.text,l=this._options.findIndex(n=>n.value===i);l>=0?this._options.splice(l,0,s):this._options.push(s)}t.selected&&(this.value=t.value||t.text,this.selectedIndex=this._options.findIndex(i=>i.value===this.value)),this.requestUpdate()}remove(t){var e;typeof t=="number"&&(this.selectedIndex===t&&(this.value=((e=this._options[0])==null?void 0:e.value)||""),this._options.splice(t,1),this.requestUpdate())}item(t){var e;return(e=this.inputRef.value)==null?void 0:e.item(t)}namedItem(t){var e;return(e=this.inputRef.value)==null?void 0:e.namedItem(t)}showPicker(){this.inputRef.value&&"showPicker"in this.inputRef.value&&this.inputRef.value.showPicker()}attributeChangedCallback(t,e,s){var i,l;t==="options"&&(this._options=s?JSON.parse(s):[]),t==="value"&&this.value!==e&&(this.selectedIndex=this.touched?this.returnNumberOrNull((i=this.inputRef.value)==null?void 0:i.selectedIndex):this._options.findIndex(n=>n.value===s),this.selectedOptions=(l=this.inputRef.value)==null?void 0:l.selectedOptions,this.valueChanged(s,e)),super.attributeChangedCallback(t,e,s)}update(t){var e,s;super.update(t),t.has("_optionsProp")&&this._optionsProp.length>0&&(this._options=this._optionsProp,this.requestUpdate("_options"),!this.value&&this._options.length>0&&(this.value=this._options[0].value,this.selectedIndex=0)),t.has("value")&&this.value!==t.get("value")&&(this.selectedIndex=this.touched?this.returnNumberOrNull((e=this.inputRef.value)==null?void 0:e.selectedIndex):this._options.findIndex(i=>i.value===this.value),this.selectedOptions=(s=this.inputRef.value)==null?void 0:s.selectedOptions,this.valueChanged(this.value,t.get("value"))),t.has("id")&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(t){var e;super.firstUpdated(t),this._optionsProp.length&&(this._options=this._optionsProp),!this.value&&this._options.length>0?(this.value=this._options[0].value,this.selectedIndex=0):this.selectedIndex=this._options.findIndex(s=>s.value===this.value),this.selectedOptions=(e=this.inputRef.value)==null?void 0:e.selectedOptions}render(){const t=`pkt-input ${this.fullwidth?"pkt-input--fullwidth":""}`;return h.x`
1
+ "use strict";const h=require("./element-CJ_QKaki.cjs"),u=require("./state-DSjcvzDN.cjs"),r=require("./ref-BFa5Utho.cjs"),o=require("./if-defined-Bc9-_I01.cjs"),d=require("./input-element-BmXkhljw.cjs"),c=require("./pkt-options-controller-CiuBG6Lt.cjs"),v=require("./pkt-slot-controller-BzddBp7z.cjs");require("./input-wrapper-B-Qseywc.cjs");var f=Object.defineProperty,_=Object.getOwnPropertyDescriptor,a=(p,t,e,s)=>{for(var i=s>1?void 0:s?_(t,e):t,l=p.length-1,n;l>=0;l--)(n=p[l])&&(i=(s?n(t,e,i):n(i))||i);return s&&i&&f(t,e,i),i};exports.PktSelect=class extends d.PktInputElement{constructor(){super(),this.inputRef=r.e(),this.helptextSlot=r.e(),this._optionsProp=[],this.value="",this._options=[],this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new c.PktOptionsSlotController(this),this.slotController=new v.PktSlotController(this,this.helptextSlot),this.slotController.skipOptions=!0}get options(){return this._options.map(t=>({...t,selected:t.value===this.value}))}set options(t){this._optionsProp=t,this.requestUpdate("_optionsProp",this._options)}connectedCallback(){super.connectedCallback();const t=this._optionsProp.length>0,e=this.optionsController.nodes.length&&this.optionsController.nodes.length>0;!t&&e?this.optionsController.nodes.forEach(s=>{const i={value:s.hasAttribute("value")?s.getAttribute("value")??"":s.textContent??"",label:s.textContent||s.getAttribute("value")||"",disabled:s.hasAttribute("disabled"),selected:s.hasAttribute("selected"),hidden:s.hasAttribute("data-hidden")};s.getAttribute("selected")&&!this.value&&(this.value=i.value),this._options.push(i)}):(this._options=this._optionsProp,this._options.forEach(s=>{s.selected&&!this.value&&(this.value=s.value)}))}add(t,e){const s={value:t.value||t.text,label:t.text||t.value,selected:t.selected,disabled:t.disabled};if(e===void 0)this._options.push(s);else if(typeof e=="number")this._options.splice(e,0,s);else{const i=e.value||e.text,l=this._options.findIndex(n=>n.value===i);l>=0?this._options.splice(l,0,s):this._options.push(s)}t.selected&&(this.value=t.value||t.text,this.selectedIndex=this._options.findIndex(i=>i.value===this.value)),this.requestUpdate()}remove(t){var e;typeof t=="number"&&(this.selectedIndex===t&&(this.value=((e=this._options[0])==null?void 0:e.value)||""),this._options.splice(t,1),this.requestUpdate())}item(t){var e;return(e=this.inputRef.value)==null?void 0:e.item(t)}namedItem(t){var e;return(e=this.inputRef.value)==null?void 0:e.namedItem(t)}showPicker(){this.inputRef.value&&"showPicker"in this.inputRef.value&&this.inputRef.value.showPicker()}attributeChangedCallback(t,e,s){var i,l;t==="options"&&(this._options=s?JSON.parse(s):[]),t==="value"&&this.value!==e&&(this.selectedIndex=this.touched?this.returnNumberOrNull((i=this.inputRef.value)==null?void 0:i.selectedIndex):this._options.findIndex(n=>n.value===s),this.selectedOptions=(l=this.inputRef.value)==null?void 0:l.selectedOptions,this.valueChanged(s,e)),super.attributeChangedCallback(t,e,s)}update(t){var e,s;super.update(t),t.has("_optionsProp")&&this._optionsProp.length>0&&(this._options=this._optionsProp,this.requestUpdate("_options"),!this.value&&this._options.length>0&&(this.value=this._options[0].value,this.selectedIndex=0)),t.has("value")&&this.value!==t.get("value")&&(this.selectedIndex=this.touched?this.returnNumberOrNull((e=this.inputRef.value)==null?void 0:e.selectedIndex):this._options.findIndex(i=>i.value===this.value),this.selectedOptions=(s=this.inputRef.value)==null?void 0:s.selectedOptions,this.valueChanged(this.value,t.get("value"))),t.has("id")&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(t){var e;super.firstUpdated(t),this._optionsProp.length&&(this._options=this._optionsProp),!this.value&&this._options.length>0?(this.value=this._options[0].value,this.selectedIndex=0):this.selectedIndex=this._options.findIndex(s=>s.value===this.value),this.selectedOptions=(e=this.inputRef.value)==null?void 0:e.selectedOptions}render(){const t=`pkt-input ${this.fullwidth?"pkt-input--fullwidth":""}`;return h.x`
2
2
  <pkt-input-wrapper
3
3
  ?counter=${this.counter}
4
4
  ?disabled=${this.disabled}
@@ -7,7 +7,7 @@
7
7
  ?inline=${this.inline}
8
8
  ?optionalTag=${this.optionalTag}
9
9
  ?requiredTag=${this.requiredTag}
10
- ?useWrapper=${this.useWrapper}
10
+ useWrapper=${this.useWrapper}
11
11
  ariaDescribedBy=${o.o(this.ariaDescribedBy)}
12
12
  class="pkt-select"
13
13
  errorMessage=${o.o(this.errorMessage)}
@@ -1,4 +1,4 @@
1
- "use strict";const s=require("./element-CJ_QKaki.cjs"),p=require("./if-defined-Bc9-_I01.cjs"),c=require("./state-DSjcvzDN.cjs"),l=require("./ref-BFa5Utho.cjs"),$=require("./class-map-C_erArZz.cjs"),a=require("./directive-C7oCP5Bh.cjs"),d=require("./directive-helpers-4oOjKnGY.cjs"),x=require("./input-element-KUsQQ-1d.cjs"),T=require("./pkt-slot-controller-BzddBp7z.cjs");require("./input-wrapper-B-Qseywc.cjs");require("./icon-BGuizDwk.cjs");/**
1
+ "use strict";const s=require("./element-CJ_QKaki.cjs"),p=require("./if-defined-Bc9-_I01.cjs"),c=require("./state-DSjcvzDN.cjs"),l=require("./ref-BFa5Utho.cjs"),$=require("./class-map-C_erArZz.cjs"),a=require("./directive-C7oCP5Bh.cjs"),d=require("./directive-helpers-4oOjKnGY.cjs"),x=require("./input-element-BmXkhljw.cjs"),T=require("./pkt-slot-controller-BzddBp7z.cjs");require("./input-wrapper-B-Qseywc.cjs");require("./icon-BGuizDwk.cjs");/**
2
2
  * @license
3
3
  * Copyright 2020 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
@@ -11,7 +11,7 @@
11
11
  ?optionalTag=${this.optionalTag}
12
12
  ?required=${this.required}
13
13
  ?requiredTag=${this.requiredTag}
14
- ?useWrapper=${this.useWrapper}
14
+ useWrapper=${this.useWrapper}
15
15
  .ariaDescribedBy=${this.ariaDescribedBy}
16
16
  .counterCurrent=${this.counterCurrent}
17
17
  .counterMaxLength=${this.counterMaxLength}
@@ -5,7 +5,7 @@ import { e as m, n as c } from "./ref-Xa5dbh--.js";
5
5
  import { e as v } from "./class-map-wy7PUk0P.js";
6
6
  import { e as T, i as b, t as a } from "./directive-oAbCiebi.js";
7
7
  import { f as y, m as w } from "./directive-helpers-BzAtj9by.js";
8
- import { P as C } from "./input-element-Dqu8udwd.js";
8
+ import { P as C } from "./input-element-B0VPRK_E.js";
9
9
  import { P as E } from "./pkt-slot-controller-BPGj-LC5.js";
10
10
  import "./input-wrapper-Wu3Yv-bn.js";
11
11
  import "./icon-1dy7UZcu.js";
@@ -64,7 +64,7 @@ let o = class extends C {
64
64
  ?optionalTag=${this.optionalTag}
65
65
  ?required=${this.required}
66
66
  ?requiredTag=${this.requiredTag}
67
- ?useWrapper=${this.useWrapper}
67
+ useWrapper=${this.useWrapper}
68
68
  .ariaDescribedBy=${this.ariaDescribedBy}
69
69
  .counterCurrent=${this.counterCurrent}
70
70
  .counterMaxLength=${this.counterMaxLength}
@@ -3,7 +3,7 @@ import { o as u } from "./if-defined-BWZGb3bh.js";
3
3
  import { r as f } from "./state-DS_kr2Fy.js";
4
4
  import { e as d, n as m } from "./ref-Xa5dbh--.js";
5
5
  import { e as g } from "./class-map-wy7PUk0P.js";
6
- import { P as x } from "./input-element-Dqu8udwd.js";
6
+ import { P as x } from "./input-element-B0VPRK_E.js";
7
7
  import { P as v } from "./pkt-slot-controller-BPGj-LC5.js";
8
8
  import "./input-wrapper-Wu3Yv-bn.js";
9
9
  import "./icon-1dy7UZcu.js";
@@ -40,7 +40,7 @@ let s = class extends x {
40
40
  ?optionalTag=${this.optionalTag}
41
41
  ?required=${this.required}
42
42
  ?requiredTag=${this.requiredTag}
43
- ?useWrapper=${this.useWrapper}
43
+ useWrapper=${this.useWrapper}
44
44
  .ariaDescribedBy=${this.ariaDescribedBy}
45
45
  .counterCurrent=${this.counterCurrent}
46
46
  .counterMaxLength=${this.counterMaxLength}
@@ -1,4 +1,4 @@
1
- "use strict";const t=require("./element-CJ_QKaki.cjs"),a=require("./if-defined-Bc9-_I01.cjs"),l=require("./state-DSjcvzDN.cjs"),h=require("./ref-BFa5Utho.cjs"),c=require("./class-map-C_erArZz.cjs"),d=require("./input-element-KUsQQ-1d.cjs"),x=require("./pkt-slot-controller-BzddBp7z.cjs");require("./input-wrapper-B-Qseywc.cjs");require("./icon-BGuizDwk.cjs");var $=Object.defineProperty,f=Object.getOwnPropertyDescriptor,r=(u,i,s,n)=>{for(var e=n>1?void 0:n?f(i,s):i,o=u.length-1,p;o>=0;o--)(p=u[o])&&(e=(n?p(i,s,e):p(e))||e);return n&&e&&$(i,s,e),e};exports.PktTextinput=class extends d.PktInputElement{constructor(){super(),this.inputRef=h.e(),this.helptextSlot=h.e(),this.value="",this.type="text",this.size=null,this.autocomplete=null,this.iconNameRight=null,this.prefix=null,this.suffix=null,this.omitSearchIcon=!1,this.counterCurrent=0,this.slotController=new x.PktSlotController(this,this.helptextSlot)}attributeChangedCallback(i,s,n){i==="value"&&this.value!==s&&(this.counterCurrent=n?n.length:0,this.valueChanged(n,s)),super.attributeChangedCallback(i,s,n)}updated(i){var s;super.updated(i),i.has("value")&&(this.counterCurrent=((s=this.value)==null?void 0:s.length)||0,this.valueChanged(this.value,i.get("value"))),i.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const i=this.type==="search"&&!this.iconNameRight&&!this.omitSearchIcon,s=c.e({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),n=this.ariaLabelledby||`${this.id}-input-label`;return t.x`
1
+ "use strict";const t=require("./element-CJ_QKaki.cjs"),a=require("./if-defined-Bc9-_I01.cjs"),l=require("./state-DSjcvzDN.cjs"),h=require("./ref-BFa5Utho.cjs"),c=require("./class-map-C_erArZz.cjs"),d=require("./input-element-BmXkhljw.cjs"),x=require("./pkt-slot-controller-BzddBp7z.cjs");require("./input-wrapper-B-Qseywc.cjs");require("./icon-BGuizDwk.cjs");var $=Object.defineProperty,f=Object.getOwnPropertyDescriptor,r=(u,i,s,n)=>{for(var e=n>1?void 0:n?f(i,s):i,o=u.length-1,p;o>=0;o--)(p=u[o])&&(e=(n?p(i,s,e):p(e))||e);return n&&e&&$(i,s,e),e};exports.PktTextinput=class extends d.PktInputElement{constructor(){super(),this.inputRef=h.e(),this.helptextSlot=h.e(),this.value="",this.type="text",this.size=null,this.autocomplete=null,this.iconNameRight=null,this.prefix=null,this.suffix=null,this.omitSearchIcon=!1,this.counterCurrent=0,this.slotController=new x.PktSlotController(this,this.helptextSlot)}attributeChangedCallback(i,s,n){i==="value"&&this.value!==s&&(this.counterCurrent=n?n.length:0,this.valueChanged(n,s)),super.attributeChangedCallback(i,s,n)}updated(i){var s;super.updated(i),i.has("value")&&(this.counterCurrent=((s=this.value)==null?void 0:s.length)||0,this.valueChanged(this.value,i.get("value"))),i.has("id")&&!this.name&&this.id&&(this.name=this.id)}render(){const i=this.type==="search"&&!this.iconNameRight&&!this.omitSearchIcon,s=c.e({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),n=this.ariaLabelledby||`${this.id}-input-label`;return t.x`
2
2
  <pkt-input-wrapper
3
3
  label="${this.label}"
4
4
  ?counter=${this.counter}
@@ -9,7 +9,7 @@
9
9
  ?optionalTag=${this.optionalTag}
10
10
  ?required=${this.required}
11
11
  ?requiredTag=${this.requiredTag}
12
- ?useWrapper=${this.useWrapper}
12
+ useWrapper=${this.useWrapper}
13
13
  .ariaDescribedBy=${this.ariaDescribedBy}
14
14
  .counterCurrent=${this.counterCurrent}
15
15
  .counterMaxLength=${this.counterMaxLength}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-elements",
3
- "version": "13.18.0",
3
+ "version": "13.18.2",
4
4
  "description": "Komponentbiblioteket til Punkt, et designsystem laget av Oslo Origo",
5
5
  "homepage": "https://punkt.oslo.kommune.no",
6
6
  "author": "Team Designsystem, Oslo Origo",
@@ -42,7 +42,7 @@
42
42
  "@babel/preset-env": "^7.28.3",
43
43
  "@babel/preset-typescript": "^7.25.9",
44
44
  "@oslokommune/punkt-assets": "^13.16.0",
45
- "@oslokommune/punkt-css": "^13.18.0",
45
+ "@oslokommune/punkt-css": "^13.18.1",
46
46
  "@testing-library/jest-dom": "^6.6.3",
47
47
  "@typescript-eslint/eslint-plugin": "^8.46.0",
48
48
  "@typescript-eslint/parser": "^8.46.0",
@@ -79,5 +79,5 @@
79
79
  "url": "https://github.com/oslokommune/punkt/issues"
80
80
  },
81
81
  "license": "MIT",
82
- "gitHead": "d1f7500eed274abde4ea0532a746a54d74a38877"
82
+ "gitHead": "7a161befee37835e0c0ffb91b0ea2cef51d27a1c"
83
83
  }
@@ -276,7 +276,7 @@ export class PktCombobox extends PktInputElement implements IPktCombobox {
276
276
  ?requiredTag=${this.requiredTag}
277
277
  .requiredText=${this.requiredText}
278
278
  .tagText=${this.tagText}
279
- ?useWrapper=${this.useWrapper}
279
+ useWrapper=${this.useWrapper}
280
280
  .forId=${this.allowUserInput || this.typeahead ? this.id + '-input' : this.id + '-arrow'}
281
281
  class="pkt-combobox__wrapper"
282
282
  @labelClick=${this.handleInputClick}
@@ -470,7 +470,7 @@ export class PktDatepicker extends PktInputElement<Props> {
470
470
  ?required=${this.required}
471
471
  ?optionalTag=${this.optionalTag}
472
472
  ?requiredTag=${this.requiredTag}
473
- ?useWrapper=${this.useWrapper}
473
+ useWrapper=${this.useWrapper}
474
474
  .optionalText=${this.optionalText}
475
475
  .requiredText=${this.requiredText}
476
476
  .tagText=${this.tagText}
@@ -229,7 +229,7 @@ export class PktSelect extends PktInputElement implements IPktSelect {
229
229
  ?inline=${this.inline}
230
230
  ?optionalTag=${this.optionalTag}
231
231
  ?requiredTag=${this.requiredTag}
232
- ?useWrapper=${this.useWrapper}
232
+ useWrapper=${this.useWrapper}
233
233
  ariaDescribedBy=${ifDefined(this.ariaDescribedBy)}
234
234
  class="pkt-select"
235
235
  errorMessage=${ifDefined(this.errorMessage)}
@@ -69,7 +69,7 @@ export class PktTextarea extends PktInputElement<Props> {
69
69
  ?optionalTag=${this.optionalTag}
70
70
  ?required=${this.required}
71
71
  ?requiredTag=${this.requiredTag}
72
- ?useWrapper=${this.useWrapper}
72
+ useWrapper=${this.useWrapper}
73
73
  .ariaDescribedBy=${this.ariaDescribedBy}
74
74
  .counterCurrent=${this.counterCurrent}
75
75
  .counterMaxLength=${this.counterMaxLength}
@@ -87,7 +87,7 @@ export class PktTextinput extends PktInputElement<Props> {
87
87
  ?optionalTag=${this.optionalTag}
88
88
  ?required=${this.required}
89
89
  ?requiredTag=${this.requiredTag}
90
- ?useWrapper=${this.useWrapper}
90
+ useWrapper=${this.useWrapper}
91
91
  .ariaDescribedBy=${this.ariaDescribedBy}
92
92
  .counterCurrent=${this.counterCurrent}
93
93
  .counterMaxLength=${this.counterMaxLength}
@@ -1 +0,0 @@
1
- "use strict";const r=require("./element-CJ_QKaki.cjs"),Vt=require("./state-DSjcvzDN.cjs"),Ft=require("./utils-byXsEz1u.cjs"),Ct=require("./input-wrapper-EoSAbU-U.cjs");var nt={},ot;function Tt(){return ot||(ot=1,(function(){(function(E){const s=new WeakMap,h=new WeakMap,p=new WeakMap,u=new WeakMap,y=new WeakMap,k=new WeakMap,F=new WeakMap,g=new WeakMap,C=new WeakMap,V=new WeakMap,T=new WeakMap,S=new WeakMap,$=new WeakMap,U=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"},lt=(e,t)=>{for(let i in I){t[i]=null;let a=null;const n=I[i];Object.defineProperty(t,i,{get(){return a},set(o){a=o,e.isConnected?M(e,n,o):V.set(e,t)}})}};function z(e){const t=u.get(e),{form:i}=t;X(e,i,t),Q(e,t.labels)}const K=(e,t=!1)=>{const i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(o){return u.has(o)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let a=i.nextNode();const n=!t||e.disabled;for(;a;)a.formDisabledCallback&&n&&W(a,e.disabled),a=i.nextNode()},j={attributes:!0,attributeFilter:["disabled","name"]},L=O()?new MutationObserver(e=>{for(const t of e){const i=t.target;if(t.attributeName==="disabled"&&(i.constructor.formAssociated?W(i,i.hasAttribute("disabled")):i.localName==="fieldset"&&K(i)),t.attributeName==="name"&&i.constructor.formAssociated){const a=u.get(i),n=C.get(i);a.setFormValue(n)}}}):{};function D(e){e.forEach(t=>{const{addedNodes:i,removedNodes:a}=t,n=Array.from(i),o=Array.from(a);n.forEach(l=>{var m;if(u.has(l)&&l.constructor.formAssociated&&z(l),V.has(l)){const f=V.get(l);Object.keys(I).filter(b=>f[b]!==null).forEach(b=>{M(l,I[b],f[b])}),V.delete(l)}if(x.has(l)){const f=x.get(l);M(l,"internals-valid",f.validity.valid.toString()),M(l,"internals-invalid",(!f.validity.valid).toString()),M(l,"aria-invalid",(!f.validity.valid).toString()),x.delete(l)}if(l.localName==="form"){const f=g.get(l),w=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode(_){return u.has(_)&&_.constructor.formAssociated&&!(f&&f.has(_))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let b=w.nextNode();for(;b;)z(b),b=w.nextNode()}l.localName==="fieldset"&&((m=L.observe)===null||m===void 0||m.call(L,l,j),K(l,!0))}),o.forEach(l=>{const m=u.get(l);m&&p.get(m)&&G(m),F.has(l)&&F.get(l).disconnect()})})}function ct(e){e.forEach(t=>{const{removedNodes:i}=t;i.forEach(a=>{const n=$.get(t.target);u.has(a)&&Z(a),n.disconnect()})})}const dt=e=>{var t,i;const a=new MutationObserver(ct);!((t=window==null?void 0:window.ShadyDOM)===null||t===void 0)&&t.inUse&&e.mode&&e.host&&(e=e.host),(i=a.observe)===null||i===void 0||i.call(a,e,{childList:!0}),$.set(e,a)};O()&&new MutationObserver(D);const P={childList:!0,subtree:!0},M=(e,t,i)=>{e.getAttribute(t)!==i&&e.setAttribute(t,i)},W=(e,t)=>{e.toggleAttribute("internals-disabled",t),t?M(e,"aria-disabled","true"):e.removeAttribute("aria-disabled"),e.formDisabledCallback&&e.formDisabledCallback.apply(e,[t])},G=e=>{p.get(e).forEach(i=>{i.remove()}),p.set(e,[])},J=(e,t)=>{const i=document.createElement("input");return i.type="hidden",i.name=e.getAttribute("name"),e.after(i),p.get(t).push(i),i},ht=(e,t)=>{var i;p.set(t,[]),(i=L.observe)===null||i===void 0||i.call(L,e,j)},Q=(e,t)=>{if(t.length){Array.from(t).forEach(a=>a.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)}},N=e=>{const t=Array.from(e.elements).filter(o=>!o.tagName.includes("-")&&o.validity).map(o=>o.validity.valid),i=g.get(e)||[],a=Array.from(i).filter(o=>o.isConnected).map(o=>u.get(o).validity.valid),n=[...t,...a].includes(!1);e.toggleAttribute("internals-invalid",n),e.toggleAttribute("internals-valid",!n)},ut=e=>{N(R(e.target))},ft=e=>{N(R(e.target))},pt=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 n=g.get(e);if(e.noValidate)return;n.size&&Array.from(n).reverse().map(m=>u.get(m).reportValidity()).includes(!1)&&i.preventDefault()}})},mt=e=>{const t=g.get(e.target);t&&t.size&&t.forEach(i=>{i.constructor.formAssociated&&i.formResetCallback&&i.formResetCallback.apply(i)})},X=(e,t,i)=>{if(t){const a=g.get(t);if(a)a.add(e);else{const n=new Set;n.add(e),g.set(t,n),pt(t),t.addEventListener("reset",mt),t.addEventListener("input",ut),t.addEventListener("change",ft)}k.set(t,{ref:e,internals:i}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout(()=>{e.formAssociatedCallback.apply(e,[t])},0),N(t)}},R=e=>{let t=e.parentNode;return t&&t.tagName!=="FORM"&&(t=R(t)),t},v=(e,t,i=DOMException)=>{if(!e.constructor.formAssociated)throw new i(t)},Y=(e,t,i)=>{const a=g.get(e);return a&&a.size&&a.forEach(n=>{u.get(n)[i]()||(t=!1)}),t},Z=e=>{if(e.constructor.formAssociated){const t=u.get(e),{labels:i,form:a}=t;Q(e,i),X(e,a,t)}};function O(){return typeof MutationObserver<"u"}class yt{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 gt=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),bt=(e,t,i)=>(e.valid=vt(t),Object.keys(t).forEach(a=>e[a]=t[a]),i&&N(i),e),vt=e=>{let t=!0;for(let i in e)i!=="valid"&&e[i]!==!1&&(t=!1);return t},H=new WeakMap;function tt(e,t){e.toggleAttribute(t,!0),e.part&&e.part.add(t)}class q 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),a=H.get(this),n=`state${t}`;return a.isConnected?tt(a,n):setTimeout(()=>{tt(a,n)}),i}clear(){for(let[t]of this.entries())this.delete(t);super.clear()}delete(t){const i=super.delete(t),a=H.get(this);return a.isConnected?(a.toggleAttribute(`state${t}`,!1),a.part&&a.part.remove(`state${t}`)):setTimeout(()=>{a.toggleAttribute(`state${t}`,!1),a.part&&a.part.remove(`state${t}`)}),i}}function et(e,t,i,a){if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?a:i==="a"?a.call(e):a?a.value:t.get(e)}function wt(e,t,i,a,n){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 A;class Et{constructor(t){A.set(this,void 0),wt(this,A,t);for(let i=0;i<t.length;i++){let a=t[i];this[i]=a,a.hasAttribute("name")&&(this[a.getAttribute("name")]=a)}Object.freeze(this)}get length(){return et(this,A,"f").length}[(A=new WeakMap,Symbol.iterator)](){return et(this,A,"f")[Symbol.iterator]()}item(t){return this[t]==null?null:this[t]}namedItem(t){return this[t]==null?null:this[t]}}function Mt(){const e=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=i;const t=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=a;function i(...o){let l=e.apply(this,o);return Y(this,l,"checkValidity")}function a(...o){let l=t.apply(this,o);return Y(this,l,"reportValidity")}const{get:n}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...o){const l=n.call(this,...o),m=Array.from(g.get(this)||[]);if(m.length===0)return l;const f=Array.from(l).concat(m).sort((w,b)=>w.compareDocumentPosition?w.compareDocumentPosition(b)&2?1:-1:0);return new Et(f)}})}class it{static get isPolyfilled(){return!0}constructor(t){if(!t||!t.tagName||t.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");const i=t.getRootNode(),a=new yt;this.states=new q(t),s.set(this,t),h.set(this,a),u.set(t,this),lt(t,this),ht(t,this),Object.seal(this),i instanceof DocumentFragment&&dt(i)}checkValidity(){const t=s.get(this);if(v(t,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const i=h.get(this);if(!i.valid){const a=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});t.dispatchEvent(a)}return i.valid}get form(){const t=s.get(this);v(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=R(t)),i}get labels(){const t=s.get(this);v(t,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const i=t.getAttribute("id"),a=t.getRootNode();return a&&i?a.querySelectorAll(`[for="${i}"]`):[]}reportValidity(){const t=s.get(this);if(v(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(),a=S.get(this);if(a&&!t.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!i&&a&&(t.focus(),a.focus()),i}setFormValue(t){const i=s.get(this);if(v(i,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),G(this),t!=null&&!(t instanceof FormData)){if(i.getAttribute("name")){const a=J(i,this);a.value=t}}else t!=null&&t instanceof FormData&&Array.from(t).reverse().forEach(([a,n])=>{if(typeof n=="string"){const o=J(i,this);o.name=a,o.value=n}});C.set(i,t)}setValidity(t,i,a){const n=s.get(this);if(v(n,"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.");S.set(this,a);const o=h.get(this),l={};for(const w in t)l[w]=t[w];Object.keys(l).length===0&&gt(o);const m=Object.assign(Object.assign({},o),l);delete m.valid;const{valid:f}=bt(o,m,this.form);if(!f&&!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.");y.set(this,f?"":i),n.isConnected?(n.toggleAttribute("internals-invalid",!f),n.toggleAttribute("internals-valid",f),M(n,"aria-invalid",`${!f}`)):x.set(n,this)}get shadowRoot(){const t=s.get(this),i=T.get(t);return i||null}get validationMessage(){const t=s.get(this);return v(t,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),y.get(this)}get validity(){const t=s.get(this);return v(t,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),h.get(this)}get willValidate(){const t=s.get(this);return v(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 kt(){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(a=>a in i.internals)}let at=!1,st=!1;function B(e){st||(st=!0,window.CustomStateSet=q,e&&(HTMLElement.prototype.attachInternals=function(...t){const i=e.call(this,t);return i.states=new q(this),i}))}function rt(e=!0){if(!at){if(at=!0,typeof window<"u"&&(window.ElementInternals=it),typeof CustomElementRegistry<"u"){const t=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(i,a,n){if(a.formAssociated){const o=a.prototype.connectedCallback;a.prototype.connectedCallback=function(){U.has(this)||(U.set(this,!0),this.hasAttribute("disabled")&&W(this,!0)),o!=null&&o.apply(this),Z(this)}}t.call(this,i,a,n)}}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 it(this)}),typeof Element<"u"){let t=function(...a){const n=i.apply(this,a);if(T.set(this,n),O()){const o=new MutationObserver(D);window.ShadyDOM?o.observe(this,P):o.observe(n,P),F.set(this,o)}return n};const i=Element.prototype.attachShadow;Element.prototype.attachShadow=t}O()&&typeof document<"u"&&new MutationObserver(D).observe(document.documentElement,P),typeof HTMLFormElement<"u"&&Mt(),(e||typeof window<"u"&&!window.CustomStateSet)&&B()}}return!!customElements.polyfillWrapFlushCallback||(kt()?typeof window<"u"&&!window.CustomStateSet&&B(HTMLElement.prototype.attachInternals):rt(!1)),E.forceCustomStateSetPolyfill=B,E.forceElementInternalsPolyfill=rt,Object.defineProperty(E,"__esModule",{value:!0}),E})({})})()),nt}Tt();var St=Object.defineProperty,d=(E,s,h,p)=>{for(var u=void 0,y=E.length-1,k;y>=0;y--)(k=E[y])&&(u=k(s,h,u)||u);return u&&St(s,h,u),u};class c 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=Ft.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=Ct.specs.props.helptextDropdownButton.default,this.label=null,this.optionalText=r.translations.forms.labels.optional,this.requiredText=r.translations.forms.labels.required,this.tagText=null,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(s){var h,p,u,y,k,F,g,C,V,T,S;s&&(this.required&&!this.value?this.internals.setValidity({valueMissing:!0},r.translations.forms.messages.required,s):(h=s.validity)!=null&&h.typeMismatch||(p=s.validity)!=null&&p.badInput?this.internals.setValidity({typeMismatch:!0},r.translations.forms.messages.invalid,s):(u=s.validity)!=null&&u.patternMismatch?this.internals.setValidity({patternMismatch:!0},r.translations.forms.messages.invalidPattern,s):(y=s.validity)!=null&&y.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},r.translations.forms.messages.tooShort,s):(k=s.validity)!=null&&k.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},r.translations.forms.messages.tooLong,s):(F=s.validity)!=null&&F.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},this.min?r.translations.forms.messages.rangeUnderflowMin.replace("{min}",(g=this.min)==null?void 0:g.toString()):r.translations.forms.messages.rangeUnderflow,s):(C=s.validity)!=null&&C.stepMismatch?this.internals.setValidity({stepMismatch:!0},r.translations.forms.messages.invalid,s):(V=s.validity)!=null&&V.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},this.max?r.translations.forms.messages.rangeOverflowMax.replace("{max}",(T=this.max)==null?void 0:T.toString()):r.translations.forms.messages.rangeOverflow,s):(S=s.validity)!=null&&S.customError?this.internals.setValidity({customError:!0},s.validationMessage,s):this.internals.setValidity({}))}setFormValue(s){if(this.internals)if(Array.isArray(s)){const h=new FormData;s.forEach(p=>{h.append(this.name,p)}),this.internals.setFormValue(h)}else this.internals.setFormValue(s)}valueChecked(s){if(!this.touched)return;const h=this.internals.form||this.closest("form"),p=h?new FormData(h):null;h&&h.querySelectorAll(`pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`).forEach(u=>{const y=u;y.name===this.name&&y.value!==this.value&&y.checked&&(y.checked=!1)}),typeof s=="string"?(this.checked=s==="true",this.internals.ariaChecked=s==="true"):typeof s=="boolean"&&(this.checked=s,this.internals.ariaChecked=s),this.checked?(this.internals.setFormValue(this.value||"on",this.value||"on"),p&&p.append(this.name,this.value||"on"),this.internals.states.add("--checked")):(this.internals.setFormValue(null,null),p&&p.delete(this.name),this.internals.states.delete("--checked")),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:this.checked,bubbles:!0,composed:!0})),this.internals.reportValidity()}valueChanged(s,h){(h!==this.value||h!==this._value)&&(typeof s=="string"?((this.multiple||this.range)&&s.includes(",")&&(s=s.split(",")),this.value=s,this._value=Array.isArray(s)?s:[s]):Array.isArray(s)?(this.value=this.multiple||this.range?s:s[0],this._value=s):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&h&&h.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(h==null?void 0:h.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate()))}clearInputValue(){const s=this.multiple||this.range?[]:"";this.value=s,this.internals.setFormValue(s),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:s,bubbles:!0,composed:!0}))}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}))}onChange(s){if(!this.touched){this.touched=!0,s&&this.setFormValue(s);return}typeof s!="string"&&!Array.isArray(s)||((this.range||this.multiple)&&!Array.isArray(s)&&s.includes(",")&&(s=s.split(",")),!this.multiple&&!this.range&&Array.isArray(s)&&(s=s[0]),this.setFormValue(s),this.manageValidity(this.inputRef.value),this.inputRefTo&&this.manageValidity(this.inputRefTo.value),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:s,bubbles:!0,composed:!0})))}formResetCallback(){this.touched=!1,this._options&&this._options.length&&this._options.forEach(s=>{"selected"in s&&(s.selected=!1)}),this.checked!==void 0?(this.checked=!1,this.internals.ariaChecked=!1,this.internals.setFormValue("",""),this.inputRef.value.checked=!1,this.valueChecked(this.checked)):(this.internals.setFormValue(""),this.value=this.defaultValue||(this.multiple||this.range?[]:""),this._value=this.value,this.valueChanged(this.value,null)),this.internals.ariaInvalid=!1}updated(s){super.updated(s),s.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(s){if(super.firstUpdated(s),!this.form){const h=this.internals.form||this.closest("form");this.form=h}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=!0,this.checked=!0),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.ariaDisabled=!0),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const h=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=h,this.internals.setFormValue(h?this.value||"on":"",h?this.value||"on":"")}else this.internals.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))}}d([r.n()],c.prototype,"defaultValue");d([r.n({type:Boolean,reflect:!0})],c.prototype,"disabled");d([r.n({type:Boolean,reflect:!0})],c.prototype,"readonly");d([r.n({type:Boolean,reflect:!0})],c.prototype,"required");d([r.n({type:Number,reflect:!0})],c.prototype,"max");d([r.n({type:Number,reflect:!0})],c.prototype,"maxlength");d([r.n({type:Number,reflect:!0})],c.prototype,"min");d([r.n({type:Number,reflect:!0})],c.prototype,"minlength");d([r.n({type:Number,reflect:!0})],c.prototype,"step");d([r.n({type:String})],c.prototype,"ariaDescribedBy");d([r.n({type:String})],c.prototype,"ariaLabelledby");d([r.n({type:String,reflect:!0})],c.prototype,"name");d([r.n({type:String,reflect:!0})],c.prototype,"pattern");d([r.n({type:String,reflect:!0})],c.prototype,"placeholder");d([r.n({type:String,reflect:!0})],c.prototype,"id");d([r.n({type:Boolean})],c.prototype,"counter");d([r.n({type:Boolean})],c.prototype,"hasError");d([r.n({type:Boolean})],c.prototype,"inline");d([r.n({type:Boolean})],c.prototype,"hasFieldset");d([r.n({type:Boolean})],c.prototype,"optionalTag");d([r.n({type:Boolean})],c.prototype,"requiredTag");d([r.n({type:Boolean})],c.prototype,"skipForwardTestid");d([r.n({type:Boolean,reflect:!1})],c.prototype,"useWrapper");d([r.n({type:Boolean,reflect:!0})],c.prototype,"fullwidth");d([r.n({type:Number})],c.prototype,"counterMaxLength");d([r.n({type:String})],c.prototype,"errorMessage");d([r.n({type:String})],c.prototype,"helptext");d([r.n({type:String})],c.prototype,"helptextDropdown");d([r.n({type:String,reflect:!1})],c.prototype,"helptextDropdownButton");d([r.n({type:String})],c.prototype,"label");d([r.n({type:String,reflect:!1})],c.prototype,"optionalText");d([r.n({type:String,reflect:!1})],c.prototype,"requiredText");d([r.n({type:String,reflect:!1})],c.prototype,"tagText");d([r.n({type:String,attribute:"data-testid"})],c.prototype,"dataTestid");d([Vt.r()],c.prototype,"touched");exports.PktInputElement=c;