@oslokommune/punkt-elements 12.42.11 → 12.42.13

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 (131) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/{accordionitem-aQHOrGzf.js → accordionitem-C9FI-NXW.js} +3 -3
  3. package/dist/{accordionitem-C4NQFQHo.cjs → accordionitem-DjAWPtsn.cjs} +1 -1
  4. package/dist/{alert-sBHt7DSh.js → alert-B0OUR9oD.js} +5 -5
  5. package/dist/{alert-DUWuhtFC.cjs → alert-BH0lJ2ny.cjs} +1 -1
  6. package/dist/{backlink-BnlrDl9O.js → backlink-B13JTp9D.js} +2 -2
  7. package/dist/{backlink-CcAZfB1d.cjs → backlink-C5jQRMwJ.cjs} +1 -1
  8. package/dist/{button-BT-FRGMk.cjs → button-CDocR7iN.cjs} +1 -1
  9. package/dist/{button-B4Oe8Ar0.js → button-DrrEvUy9.js} +4 -4
  10. package/dist/{calendar-D4qfcRtv.cjs → calendar-BZe2D4Sr.cjs} +1 -1
  11. package/dist/{calendar-Df6-FDRW.js → calendar-DevQhOup.js} +4 -4
  12. package/dist/{card-CXhVAeOG.cjs → card-Bx36j0q4.cjs} +1 -1
  13. package/dist/{card-0Kf9L0A_.js → card-Djnd-pgo.js} +6 -6
  14. package/dist/{checkbox-CiXWukkL.cjs → checkbox-CJ4tK9RC.cjs} +1 -1
  15. package/dist/{checkbox-B67_cfqW.js → checkbox-cD_5LDzV.js} +4 -4
  16. package/dist/{class-map-DWDPOqjO.cjs → class-map-BBG2gMX4.cjs} +1 -1
  17. package/dist/{class-map-m7ZCZ49w.js → class-map-BpTj9gtz.js} +1 -1
  18. package/dist/{combobox-Dq7F5v-u.cjs → combobox-Cv6i7BEk.cjs} +1 -1
  19. package/dist/{combobox-CsFDvh8U.js → combobox-kWGI4RHI.js} +11 -11
  20. package/dist/{consent-B17ZIuwm.js → consent-CftYu8Di.js} +3 -3
  21. package/dist/{consent-CILYIgC-.cjs → consent-DrS71kvz.cjs} +1 -1
  22. package/dist/{datepicker-DOf9XK9v.cjs → datepicker-BJe92Vor.cjs} +1 -1
  23. package/dist/{datepicker-Cz6seIz1.js → datepicker-LpbYHx8L.js} +11 -11
  24. package/dist/{directive-helpers-v9b0v7lu.cjs → directive-helpers-BBbxqP2W.cjs} +1 -1
  25. package/dist/{directive-helpers--4ibN__v.js → directive-helpers-r-kOS_Mf.js} +1 -1
  26. package/dist/element-6DBpyGQm.cjs +238 -0
  27. package/dist/{element-gAd63VwC.js → element-CgEWt74-.js} +7039 -7516
  28. package/dist/heading-BRE_iFtR.cjs +1 -0
  29. package/dist/heading-D6jXE_Mz.js +58 -0
  30. package/dist/{helptext-BG_b6ytC.js → helptext-B7eI0iBQ.js} +5 -5
  31. package/dist/{helptext-CC3qLmEz.cjs → helptext-CzQX6YVE.cjs} +1 -1
  32. package/dist/{icon-B1_BRNqf.cjs → icon-B_ryAy4Q.cjs} +1 -1
  33. package/dist/{icon-CO1TLSs5.js → icon-CC1js8eR.js} +1 -1
  34. package/dist/{if-defined-Cj-3Kdsr.js → if-defined-CmuO4Vz9.js} +1 -1
  35. package/dist/{if-defined-C8eotHpL.cjs → if-defined-Cni-RHLS.cjs} +1 -1
  36. package/dist/index.d.ts +33 -32
  37. package/dist/input-element-CHjLWeKt.cjs +1 -0
  38. package/dist/input-element-Cco4PA2M.js +700 -0
  39. package/dist/{input-wrapper-Dk0rKRlz.cjs → input-wrapper-BxZf8wEP.cjs} +1 -1
  40. package/dist/{input-wrapper-CC_R5w7V.js → input-wrapper-gz7ppKrK.js} +6 -6
  41. package/dist/{link-C9X0huxP.js → link-C76H6Qf1.js} +4 -4
  42. package/dist/{link-qTz-qNVI.cjs → link-DTkjNlmy.cjs} +1 -1
  43. package/dist/{linkcard-Bhk2ttou.js → linkcard-BVEsUPwG.js} +3 -3
  44. package/dist/{linkcard-CaBz6i7A.cjs → linkcard-BlMhPNry.cjs} +1 -1
  45. package/dist/{listbox-AjDNhDsQ.cjs → listbox-C4supLfR.cjs} +1 -1
  46. package/dist/{listbox-DCWdrjFp.js → listbox-CLsSW32I.js} +5 -5
  47. package/dist/{loader-BqYcg8Di.cjs → loader-CHPxY9c6.cjs} +1 -1
  48. package/dist/{loader-DMp859px.js → loader-Da4IOk_T.js} +5 -5
  49. package/dist/{messagebox-Do_nAUo3.cjs → messagebox-CqUBJs_D.cjs} +1 -1
  50. package/dist/{messagebox-_1f12rDq.js → messagebox-DwGdcdm7.js} +5 -5
  51. package/dist/{modal-C1inKvts.cjs → modal-BdA5aWGU.cjs} +1 -1
  52. package/dist/{modal-C3kEgTMj.js → modal-DcXPnFus.js} +5 -5
  53. package/dist/pkt-accordion.cjs +1 -1
  54. package/dist/pkt-accordion.js +2 -2
  55. package/dist/pkt-alert.cjs +1 -1
  56. package/dist/pkt-alert.js +1 -1
  57. package/dist/pkt-backlink.cjs +1 -1
  58. package/dist/pkt-backlink.js +1 -1
  59. package/dist/pkt-button.cjs +1 -1
  60. package/dist/pkt-button.js +1 -1
  61. package/dist/pkt-calendar.cjs +1 -1
  62. package/dist/pkt-calendar.js +1 -1
  63. package/dist/pkt-card.cjs +1 -1
  64. package/dist/pkt-card.js +1 -1
  65. package/dist/pkt-checkbox.cjs +1 -1
  66. package/dist/pkt-checkbox.js +1 -1
  67. package/dist/pkt-combobox.cjs +1 -1
  68. package/dist/pkt-combobox.js +1 -1
  69. package/dist/pkt-consent.cjs +1 -1
  70. package/dist/pkt-consent.js +1 -1
  71. package/dist/pkt-datepicker.cjs +1 -1
  72. package/dist/pkt-datepicker.js +1 -1
  73. package/dist/pkt-heading.cjs +1 -1
  74. package/dist/pkt-heading.js +1 -1
  75. package/dist/pkt-helptext.cjs +1 -1
  76. package/dist/pkt-helptext.js +1 -1
  77. package/dist/pkt-icon.cjs +1 -1
  78. package/dist/pkt-icon.js +1 -1
  79. package/dist/pkt-index.cjs +1 -1
  80. package/dist/pkt-index.js +29 -29
  81. package/dist/pkt-input-wrapper.cjs +1 -1
  82. package/dist/pkt-input-wrapper.js +1 -1
  83. package/dist/pkt-link.cjs +1 -1
  84. package/dist/pkt-link.js +1 -1
  85. package/dist/pkt-linkcard.cjs +1 -1
  86. package/dist/pkt-linkcard.js +1 -1
  87. package/dist/pkt-listbox.cjs +1 -1
  88. package/dist/pkt-listbox.js +1 -1
  89. package/dist/pkt-loader.cjs +1 -1
  90. package/dist/pkt-loader.js +1 -1
  91. package/dist/pkt-messagebox.cjs +1 -1
  92. package/dist/pkt-messagebox.js +1 -1
  93. package/dist/pkt-modal.cjs +1 -1
  94. package/dist/pkt-modal.js +1 -1
  95. package/dist/pkt-progressbar.cjs +1 -1
  96. package/dist/pkt-progressbar.js +2 -2
  97. package/dist/pkt-radiobutton.cjs +1 -1
  98. package/dist/pkt-radiobutton.js +1 -1
  99. package/dist/pkt-select.cjs +1 -1
  100. package/dist/pkt-select.js +1 -1
  101. package/dist/pkt-tag.cjs +1 -1
  102. package/dist/pkt-tag.js +1 -1
  103. package/dist/pkt-textarea.cjs +1 -1
  104. package/dist/pkt-textarea.js +1 -1
  105. package/dist/pkt-textinput.cjs +1 -1
  106. package/dist/pkt-textinput.js +1 -1
  107. package/dist/{progressbar-BrXtjUvh.cjs → progressbar-DhMBXkww.cjs} +1 -1
  108. package/dist/{progressbar-BSO0KWzv.js → progressbar-Dj_mI_A6.js} +5 -5
  109. package/dist/{radiobutton-x10h-JEh.cjs → radiobutton-0vVqu-GU.cjs} +1 -1
  110. package/dist/{radiobutton-BaIDDCwK.js → radiobutton-BcFRJFvI.js} +5 -5
  111. package/dist/{ref-DnSbnXsj.js → ref-BBYSqgeW.js} +2 -2
  112. package/dist/{ref-B-w1vCo8.cjs → ref-iJtiv3o2.cjs} +1 -1
  113. package/dist/{repeat-lUFq9w5d.js → repeat-C8BeHwYx.js} +2 -2
  114. package/dist/{repeat-CxQA3AeF.cjs → repeat-CDsZqct8.cjs} +1 -1
  115. package/dist/{select-BlL8T2BX.js → select-BaLHLuvH.js} +6 -6
  116. package/dist/{select-BkVSXR5K.cjs → select-CFpdOlDE.cjs} +1 -1
  117. package/dist/{state-BxrO4zNJ.js → state-Bo2bck5_.js} +1 -1
  118. package/dist/{state-D-Recv7U.cjs → state-DPobt-Yz.cjs} +1 -1
  119. package/dist/{tag-m7OTZaCG.js → tag-BWm6s48d.js} +6 -6
  120. package/dist/{tag-DrbI0ng3.cjs → tag-DPk3fpEg.cjs} +1 -1
  121. package/dist/{textarea-Dc1sUaxx.cjs → textarea-CViiuZdR.cjs} +1 -1
  122. package/dist/{textarea-Dk8hQMD2.js → textarea-EIFo7GZz.js} +9 -9
  123. package/dist/{textinput-6Ip-0aVY.js → textinput-BHS7b-Jt.js} +8 -8
  124. package/dist/{textinput-DuLZ26DB.cjs → textinput-_ZdyMA9O.cjs} +1 -1
  125. package/package.json +3 -3
  126. package/src/components/heading/heading.ts +64 -37
  127. package/dist/element-90YeMNbV.cjs +0 -238
  128. package/dist/heading-CGGKEZve.js +0 -59
  129. package/dist/heading-Cmh5bbTl.cjs +0 -1
  130. package/dist/input-element-BEvaQK4g.js +0 -229
  131. package/dist/input-element-CInrWeac.cjs +0 -1
@@ -0,0 +1 @@
1
+ "use strict";const i=require("./element-6DBpyGQm.cjs");var h=Object.defineProperty,p=Object.getOwnPropertyDescriptor,l=(n,t,a,e)=>{for(var s=e>1?void 0:e?p(t,a):t,d=n.length-1,r;d>=0;d--)(r=n[d])&&(s=(e?r(t,a,s):r(s))||s);return e&&s&&h(t,a,s),s};exports.PktHeading=class extends i.PktShadowElement{constructor(){super(...arguments),this.size="medium",this.level=2,this.visuallyHidden=!1,this.align="start"}connectedCallback(){super.connectedCallback(),this.setAttribute("role","heading"),this.setAttribute("aria-level",String(this.level)),this.updateHostClasses()}attributeChangedCallback(t,a,e){super.attributeChangedCallback(t,a,e),t==="level"&&e&&this.setLevel(Number(e)),(t==="size"||t==="visuallyHidden"||t==="align")&&this.updateHostClasses()}updated(t){super.updated(t),t.has("level")&&this.setLevel(this.level),(t.has("size")||t.has("visuallyHidden")||t.has("align"))&&this.updateHostClasses()}setLevel(t){t>=1&&t<=6?(this.level=t,this.setAttribute("aria-level",String(t))):console.warn(`Invalid heading level: ${t}. Must be between 1 and 6.`)}updateHostClasses(){this.classList.remove("pkt-heading","pkt-heading--xsmall","pkt-heading--small","pkt-heading--medium","pkt-heading--large","pkt-heading--xlarge","pkt-sr-only","pkt-heading--start","pkt-heading--center","pkt-heading--end"),this.classList.add("pkt-heading"),this.size&&this.classList.add(`pkt-heading--${this.size}`),this.visuallyHidden&&this.classList.add("pkt-sr-only"),this.align&&this.classList.add(`pkt-heading--${this.align}`)}render(){return i.x`<slot></slot>`}};l([i.n({type:String,reflect:!0})],exports.PktHeading.prototype,"size",2);l([i.n({type:Number,reflect:!0})],exports.PktHeading.prototype,"level",2);l([i.n({type:Boolean,reflect:!0})],exports.PktHeading.prototype,"visuallyHidden",2);l([i.n({type:String,reflect:!0})],exports.PktHeading.prototype,"align",2);exports.PktHeading=l([i.t("pkt-heading")],exports.PktHeading);
@@ -0,0 +1,58 @@
1
+ import { b as p, x as u, n as d, a as o } from "./element-CgEWt74-.js";
2
+ var g = Object.defineProperty, c = Object.getOwnPropertyDescriptor, l = (t, i, e, r) => {
3
+ for (var s = r > 1 ? void 0 : r ? c(i, e) : i, n = t.length - 1, h; n >= 0; n--)
4
+ (h = t[n]) && (s = (r ? h(i, e, s) : h(s)) || s);
5
+ return r && s && g(i, e, s), s;
6
+ };
7
+ let a = class extends p {
8
+ constructor() {
9
+ super(...arguments), this.size = "medium", this.level = 2, this.visuallyHidden = !1, this.align = "start";
10
+ }
11
+ connectedCallback() {
12
+ super.connectedCallback(), this.setAttribute("role", "heading"), this.setAttribute("aria-level", String(this.level)), this.updateHostClasses();
13
+ }
14
+ attributeChangedCallback(t, i, e) {
15
+ super.attributeChangedCallback(t, i, e), t === "level" && e && this.setLevel(Number(e)), (t === "size" || t === "visuallyHidden" || t === "align") && this.updateHostClasses();
16
+ }
17
+ updated(t) {
18
+ super.updated(t), t.has("level") && this.setLevel(this.level), (t.has("size") || t.has("visuallyHidden") || t.has("align")) && this.updateHostClasses();
19
+ }
20
+ setLevel(t) {
21
+ t >= 1 && t <= 6 ? (this.level = t, this.setAttribute("aria-level", String(t))) : console.warn(`Invalid heading level: ${t}. Must be between 1 and 6.`);
22
+ }
23
+ updateHostClasses() {
24
+ this.classList.remove(
25
+ "pkt-heading",
26
+ "pkt-heading--xsmall",
27
+ "pkt-heading--small",
28
+ "pkt-heading--medium",
29
+ "pkt-heading--large",
30
+ "pkt-heading--xlarge",
31
+ "pkt-sr-only",
32
+ "pkt-heading--start",
33
+ "pkt-heading--center",
34
+ "pkt-heading--end"
35
+ ), this.classList.add("pkt-heading"), this.size && this.classList.add(`pkt-heading--${this.size}`), this.visuallyHidden && this.classList.add("pkt-sr-only"), this.align && this.classList.add(`pkt-heading--${this.align}`);
36
+ }
37
+ render() {
38
+ return u`<slot></slot>`;
39
+ }
40
+ };
41
+ l([
42
+ d({ type: String, reflect: !0 })
43
+ ], a.prototype, "size", 2);
44
+ l([
45
+ d({ type: Number, reflect: !0 })
46
+ ], a.prototype, "level", 2);
47
+ l([
48
+ d({ type: Boolean, reflect: !0 })
49
+ ], a.prototype, "visuallyHidden", 2);
50
+ l([
51
+ d({ type: String, reflect: !0 })
52
+ ], a.prototype, "align", 2);
53
+ a = l([
54
+ o("pkt-heading")
55
+ ], a);
56
+ export {
57
+ a as P
58
+ };
@@ -1,8 +1,8 @@
1
- import { P as c, x as a, E as f, n as r, a as w } from "./element-gAd63VwC.js";
2
- import { e as _, n as m } from "./ref-DnSbnXsj.js";
3
- import { o as x } from "./icon-CO1TLSs5.js";
4
- import { e as d } from "./class-map-m7ZCZ49w.js";
5
- import { r as u } from "./state-BxrO4zNJ.js";
1
+ import { P as c, x as a, E as f, n as r, a as w } from "./element-CgEWt74-.js";
2
+ import { e as _, n as m } from "./ref-BBYSqgeW.js";
3
+ import { o as x } from "./icon-CC1js8eR.js";
4
+ import { e as d } from "./class-map-BpTj9gtz.js";
5
+ import { r as u } from "./state-Bo2bck5_.js";
6
6
  import { u as k } from "./stringutils-DJjRa8dG.js";
7
7
  import { s as v } from "./input-wrapper-8iKEzDRZ.js";
8
8
  import { P as b } from "./pkt-slot-controller-BPGj-LC5.js";
@@ -1,4 +1,4 @@
1
- "use strict";const t=require("./element-90YeMNbV.cjs"),x=require("./ref-B-w1vCo8.cjs"),h=require("./icon-B1_BRNqf.cjs"),u=require("./class-map-DWDPOqjO.cjs"),a=require("./state-D-Recv7U.cjs"),c=require("./stringutils-CkVRq4jP.cjs"),d=require("./input-wrapper-EoSAbU-U.cjs"),k=require("./pkt-slot-controller-BzddBp7z.cjs");var w=Object.defineProperty,_=Object.getOwnPropertyDescriptor,n=(o,p,r,l)=>{for(var e=l>1?void 0:l?_(p,r):p,s=o.length-1,i;s>=0;s--)(i=o[s])&&(e=(l?i(p,r,e):i(e))||e);return l&&e&&w(p,r,e),e};exports.PktHelptext=class extends t.PktElement{constructor(){super(),this.defaultSlot=x.e(),this.forId=c.uuidish(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=d.specs.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.filledSlots=new Set,this.slotController=new k.PktSlotController(this,this.defaultSlot)}updateSlots(p){this.filledSlots=new Set(p)}render(){const p=()=>{const s=!this.isHelpTextOpen;this.isHelpTextOpen=s,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:s}}))},r=u.e({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.filledSlots.size>0}),l=()=>this.helptextDropdown?t.x`<div class="pkt-inputwrapper__helptext-expandable">
1
+ "use strict";const t=require("./element-6DBpyGQm.cjs"),x=require("./ref-iJtiv3o2.cjs"),h=require("./icon-B_ryAy4Q.cjs"),u=require("./class-map-BBG2gMX4.cjs"),a=require("./state-DPobt-Yz.cjs"),c=require("./stringutils-CkVRq4jP.cjs"),d=require("./input-wrapper-EoSAbU-U.cjs"),k=require("./pkt-slot-controller-BzddBp7z.cjs");var w=Object.defineProperty,_=Object.getOwnPropertyDescriptor,n=(o,p,r,l)=>{for(var e=l>1?void 0:l?_(p,r):p,s=o.length-1,i;s>=0;s--)(i=o[s])&&(e=(l?i(p,r,e):i(e))||e);return l&&e&&w(p,r,e),e};exports.PktHelptext=class extends t.PktElement{constructor(){super(),this.defaultSlot=x.e(),this.forId=c.uuidish(),this.helptext="",this.helptextDropdown="",this.helptextDropdownButton=d.specs.props.helptextDropdownButton.default,this.isHelpTextOpen=!1,this.filledSlots=new Set,this.slotController=new k.PktSlotController(this,this.defaultSlot)}updateSlots(p){this.filledSlots=new Set(p)}render(){const p=()=>{const s=!this.isHelpTextOpen;this.isHelpTextOpen=s,this.dispatchEvent(new CustomEvent("toggleHelpText",{bubbles:!0,detail:{isOpen:s}}))},r=u.e({"pkt-inputwrapper__helptext-container":!0,"pkt-inputwrapper__has-helptext":this.helptext||this.helptextDropdown||this.filledSlots.size>0}),l=()=>this.helptextDropdown?t.x`<div class="pkt-inputwrapper__helptext-expandable">
2
2
  <button
3
3
  class="pkt-link pkt-link--icon-right pkt-btn pkt-btn--small pkt-btn--tertiary pkt-btn--icon-right"
4
4
  type="button"
@@ -1,4 +1,4 @@
1
- "use strict";const o=require("./element-90YeMNbV.cjs"),a=require("./directive-C7oCP5Bh.cjs");/**
1
+ "use strict";const o=require("./element-6DBpyGQm.cjs"),a=require("./directive-C7oCP5Bh.cjs");/**
2
2
  * @license
3
3
  * Copyright 2017 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
@@ -1,4 +1,4 @@
1
- import { E as f, T as v, P as m, x as y, n as h, a as P } from "./element-gAd63VwC.js";
1
+ import { E as f, T as v, P as m, x as y, n as h, a as P } from "./element-CgEWt74-.js";
2
2
  import { e as g, i as k, t as _ } from "./directive-oAbCiebi.js";
3
3
  /**
4
4
  * @license
@@ -1,4 +1,4 @@
1
- import { E as r } from "./element-gAd63VwC.js";
1
+ import { E as r } from "./element-CgEWt74-.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2018 Google LLC
@@ -1,4 +1,4 @@
1
- "use strict";const t=require("./element-90YeMNbV.cjs");/**
1
+ "use strict";const t=require("./element-6DBpyGQm.cjs");/**
2
2
  * @license
3
3
  * Copyright 2018 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
package/dist/index.d.ts CHANGED
@@ -201,9 +201,8 @@ export declare interface IPktConsent {
201
201
  export declare interface IPktHeading {
202
202
  size?: TPktHeadingSize;
203
203
  level?: TPktHeadingLevel;
204
- spacing?: boolean;
205
204
  visuallyHidden?: boolean;
206
- textAlign?: 'start' | 'center' | 'end';
205
+ align?: 'start' | 'center' | 'end';
207
206
  }
208
207
 
209
208
  declare interface IPktLinkCard {
@@ -703,47 +702,27 @@ export declare class PktDatepicker extends PktInputElement {
703
702
  }
704
703
 
705
704
  /**
706
- * Base class for all Punkt elements
707
- * @extends LitElement
705
+ * Base class for Punkt light DOM elements
706
+ * This class extends PktShadowElement but renders in light DOM instead of shadow DOM
707
+ * @extends PktShadowElement
708
708
  */
709
- declare class PktElement<T = {}> extends LitElement {
710
- [key: string]: any;
711
- strings: any;
712
- role: string | null;
713
- /**
714
- * Here to support prop typing in Vue
715
- */
716
- $props: T & Props;
717
- /**
718
- * Runs on mount, used to set up various values and whatever you need to run
719
- */
720
- connectedCallback(): void;
709
+ declare class PktElement<T = {}> extends PktShadowElement<T> {
721
710
  /**
722
711
  * Make sure the component renders in light DOM instead of shadow DOM
723
712
  */
724
713
  createRenderRoot(): this;
725
- /**
726
- * Add support for Hot Module Reloading in dev mode
727
- */
728
- hotReplacedCallback(): void;
729
- /**
730
- * Go through changed properties and find ReactNodes to render out
731
- */
732
- protected update(changedProperties: PropertyValues): void;
733
- /**
734
- * Add extra stuff here whenever we decide what should be added here…
735
- */
736
- constructor();
737
714
  }
738
715
 
739
- export declare class PktHeading extends PktElement<IPktHeading> implements IPktHeading {
740
- defaultSlot: Ref<HTMLElement>;
741
- constructor();
716
+ export declare class PktHeading extends PktShadowElement<IPktHeading> implements IPktHeading {
742
717
  size: TPktHeadingSize;
743
718
  level: TPktHeadingLevel;
744
- noSpacing: boolean;
745
719
  visuallyHidden: boolean;
746
720
  align: 'start' | 'center' | 'end';
721
+ connectedCallback(): void;
722
+ attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
723
+ protected updated(_changedProperties: PropertyValues): void;
724
+ private setLevel;
725
+ private updateHostClasses;
747
726
  render(): TemplateResult<1>;
748
727
  }
749
728
 
@@ -1058,6 +1037,28 @@ export declare class PktSelect extends PktInputElement implements IPktSelect {
1058
1037
  private returnNumberOrNull;
1059
1038
  }
1060
1039
 
1040
+ /**
1041
+ * Base class for Punkt shadow DOM elements
1042
+ * @extends LitElement
1043
+ */
1044
+ declare class PktShadowElement<T = {}> extends LitElement {
1045
+ [key: string]: any;
1046
+ strings: any;
1047
+ role: string | null;
1048
+ /**
1049
+ * Here to support prop typing in Vue
1050
+ */
1051
+ $props: T & Props;
1052
+ /**
1053
+ * Add support for Hot Module Reloading in dev mode
1054
+ */
1055
+ hotReplacedCallback(): void;
1056
+ /**
1057
+ * Go through changed properties and find ReactNodes to render out
1058
+ */
1059
+ protected update(changedProperties: PropertyValues): void;
1060
+ }
1061
+
1061
1062
  /**
1062
1063
  * Controls the distribution of nodes into slots WITHOUT using Shadow DOM.
1063
1064
  * This controller provides a lightweight alternative to Shadow DOM slot distribution,
@@ -0,0 +1 @@
1
+ "use strict";const r=require("./element-6DBpyGQm.cjs"),Mt=require("./state-DPobt-Yz.cjs"),kt=require("./stringutils-CkVRq4jP.cjs"),Vt=require("./input-wrapper-EoSAbU-U.cjs");(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,S=new WeakMap,T=new WeakMap,$=new WeakMap,U=new WeakMap,I=new WeakMap,x={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"},nt=(e,t)=>{for(let i in x){t[i]=null;let a=null;const n=x[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(x).filter(b=>f[b]!==null).forEach(b=>{M(l,x[b],f[b])}),V.delete(l)}if(I.has(l)){const f=I.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()),I.delete(l)}if(l.localName==="form"){const f=g.get(l),w=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode(q){return u.has(q)&&q.constructor.formAssociated&&!(f&&f.has(q))?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 ot(e){e.forEach(t=>{const{removedNodes:i}=t;i.forEach(a=>{const n=$.get(t.target);u.has(a)&&Z(a),n.disconnect()})})}const lt=e=>{var t,i;const a=new MutationObserver(ot);!((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},ct=(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)},dt=e=>{N(R(e.target))},ht=e=>{N(R(e.target))},ut=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()}})},ft=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),ut(t),t.addEventListener("reset",ft),t.addEventListener("input",dt),t.addEventListener("change",ht)}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 pt{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 mt=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),yt=(e,t,i)=>(e.valid=gt(t),Object.keys(t).forEach(a=>e[a]=t[a]),i&&N(i),e),gt=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 B 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||!0:!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 bt(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 vt{constructor(t){A.set(this,void 0),bt(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 wt(){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 vt(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 pt;this.states=new B(t),s.set(this,t),h.set(this,a),u.set(t,this),nt(t,this),ct(t,this),Object.seal(this),i instanceof DocumentFragment&&lt(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=T.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.");T.set(this,a);const o=h.get(this),l={};for(const w in t)l[w]=t[w];Object.keys(l).length===0&&mt(o);const m=Object.assign(Object.assign({},o),l);delete m.valid;const{valid:f}=yt(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}`)):I.set(n,this)}get shadowRoot(){const t=s.get(this),i=S.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 Et(){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 _(e){st||(st=!0,window.CustomStateSet=B,e&&(HTMLElement.prototype.attachInternals=function(...t){const i=e.call(this,t);return i.states=new B(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(S.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"&&wt(),(e||typeof window<"u"&&!window.CustomStateSet)&&_()}}return!!customElements.polyfillWrapFlushCallback||(Et()?typeof window<"u"&&!window.CustomStateSet&&_(HTMLElement.prototype.attachInternals):rt(!1)),E.forceCustomStateSetPolyfill=_,E.forceElementInternalsPolyfill=rt,Object.defineProperty(E,"__esModule",{value:!0}),E})({})})();var Ft=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&&Ft(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=kt.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=Vt.specs.props.helptextDropdownButton.default,this.label=null,this.optionalText=r.translations.forms.labels.optional,this.requiredText=r.translations.forms.labels.required,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,S,T;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}",(S=this.max)==null?void 0:S.toString()):r.translations.forms.messages.rangeOverflow,s):(T=s.validity)!=null&&T.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=>{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,attribute:"data-testid"})],c.prototype,"dataTestid");d([Mt.r()],c.prototype,"touched");exports.PktInputElement=c;