@oslokommune/punkt-elements 12.37.2 → 12.37.4

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 (46) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/button-C1cqSjK2.cjs +12 -0
  3. package/dist/{button-sf_Yzx3X.js → button-DoVwr7W4.js} +45 -39
  4. package/dist/{checkbox-U8aPrLjG.cjs → checkbox-B7ObRUbU.cjs} +1 -1
  5. package/dist/{checkbox-Cz3sIWt0.js → checkbox-DCjl4VM0.js} +1 -1
  6. package/dist/{combobox-ChFttX7F.cjs → combobox-BokBs9Jo.cjs} +1 -1
  7. package/dist/{combobox-CFH5-Ioh.js → combobox-CnnTPWcA.js} +1 -1
  8. package/dist/{consent-CTX9zf81.js → consent-D_uOqrp2.js} +1 -1
  9. package/dist/{consent-BNY1XvpV.cjs → consent-HOme2Fjt.cjs} +1 -1
  10. package/dist/{datepicker-hetVXVX4.js → datepicker-B-ytA8nG.js} +1 -1
  11. package/dist/{datepicker-mhQrHoNJ.cjs → datepicker-B767w-e9.cjs} +1 -1
  12. package/dist/index.d.ts +8 -4
  13. package/dist/{input-element-aQDMXDVQ.js → input-element-B5EvsMww.js} +20 -20
  14. package/dist/input-element-KzKpjjLc.cjs +1 -0
  15. package/dist/pkt-button.cjs +1 -1
  16. package/dist/pkt-button.js +1 -1
  17. package/dist/pkt-checkbox.cjs +1 -1
  18. package/dist/pkt-checkbox.js +1 -1
  19. package/dist/pkt-combobox.cjs +1 -1
  20. package/dist/pkt-combobox.js +1 -1
  21. package/dist/pkt-consent.cjs +1 -1
  22. package/dist/pkt-consent.js +1 -1
  23. package/dist/pkt-datepicker.cjs +1 -1
  24. package/dist/pkt-datepicker.js +1 -1
  25. package/dist/pkt-index.cjs +1 -1
  26. package/dist/pkt-index.js +9 -9
  27. package/dist/pkt-radiobutton.cjs +1 -1
  28. package/dist/pkt-radiobutton.js +1 -1
  29. package/dist/pkt-select.cjs +1 -1
  30. package/dist/pkt-select.js +1 -1
  31. package/dist/pkt-textarea.cjs +1 -1
  32. package/dist/pkt-textarea.js +1 -1
  33. package/dist/pkt-textinput.cjs +1 -1
  34. package/dist/pkt-textinput.js +1 -1
  35. package/dist/{radiobutton-DtpGqoci.js → radiobutton-DKHjKH75.js} +1 -1
  36. package/dist/{radiobutton-DtL-nc1b.cjs → radiobutton-DP6RsaQc.cjs} +1 -1
  37. package/dist/{select-s98KeDqQ.cjs → select-CQs_BAKs.cjs} +1 -1
  38. package/dist/{select-CNK8uoVi.js → select-ChsSC4Os.js} +1 -1
  39. package/dist/{textarea-C9Kj6gGv.js → textarea-DAfViyIl.js} +1 -1
  40. package/dist/{textarea-CeUz6coA.cjs → textarea-DIZf7CVg.cjs} +1 -1
  41. package/dist/{textinput-BArDDwC2.cjs → textinput-DMPRHokX.cjs} +1 -1
  42. package/dist/{textinput-Dj6R0L45.js → textinput-u-UrLS8U.js} +1 -1
  43. package/package.json +2 -2
  44. package/src/components/button/button.ts +36 -6
  45. package/dist/button-jdMbbn-e.cjs +0 -12
  46. package/dist/input-element-XmmyUZmB.cjs +0 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,40 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
5
5
 
6
6
  ---
7
7
 
8
+ ## [12.37.4](https://github.com/oslokommune/punkt/compare/12.37.3...12.37.4) (2025-05-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
+
25
+ ## [12.37.3](https://github.com/oslokommune/punkt/compare/12.37.2...12.37.3) (2025-05-09)
26
+
27
+ ### ⚠ BREAKING CHANGES
28
+ Ingen
29
+
30
+ ### Features
31
+ Ingen
32
+
33
+ ### Bug Fixes
34
+ Ingen
35
+
36
+ ### Chores
37
+ Ingen
38
+
39
+ ---
40
+
41
+
8
42
  ## [12.37.2](https://github.com/oslokommune/punkt/compare/12.37.1...12.37.2) (2025-05-08)
9
43
 
10
44
  ### ⚠ BREAKING CHANGES
@@ -0,0 +1,12 @@
1
+ "use strict";const i=require("./element-BSypUpzA.cjs"),h=require("./pkt-slot-controller-Da-RgXfS.cjs"),d=require("./ref-BvbyvXRH.cjs");var p=Object.defineProperty,u=Object.getOwnPropertyDescriptor,e=(o,t,s,n)=>{for(var a=n>1?void 0:n?u(t,s):t,r=o.length-1,l;r>=0;r--)(l=o[r])&&(a=(n?l(t,s,a):l(a))||a);return n&&a&&p(t,s,a),a};exports.PktButton=class extends i.PktElement{constructor(){super(),this.internals=this.attachInternals(),this.defaultSlot=d.e(),this.iconName="user",this.secondIconName="user",this.mode="light",this.size="medium",this.skin="primary",this.variant="label-only",this.state="normal",this.type="button",this.isLoading=!1,this.disabled=!1,this.slotController=new h.PktSlotController(this,this.defaultSlot),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeydown)}attributeChangedCallback(t,s,n){super.attributeChangedCallback(t,s,n),t==="disabled"&&n==="false"&&(this.disabled=!1),(t==="isloading"||t==="isLoading")&&n==="false"&&(this.isLoading=!1)}firstUpdated(t){super.firstUpdated(t),this.disabled==="false"&&(this.disabled=!1),this.isLoading==="false"&&(this.isLoading=!1)}updated(t){super.updated(t),this.setAttribute("role","button"),this.internals.role="button",this.disabled==="false"&&(this.disabled=!1),this.isLoading==="false"&&(this.isLoading=!1),this.disabled?(this.getAttribute("tabindex")!=="-1"&&this.setAttribute("tabindex","-1"),this.getAttribute("aria-disabled")!=="true"&&this.setAttribute("aria-disabled","true")):(this.getAttribute("tabindex")!=="0"&&this.setAttribute("tabindex","0"),this.getAttribute("aria-disabled")!=="false"&&this.removeAttribute("aria-disabled")),this.isLoading?this.getAttribute("aria-busy")!=="true"&&this.setAttribute("aria-busy","true"):this.hasAttribute("aria-busy")&&this.removeAttribute("aria-busy"),this.updateElementClasses()}render(){return i.x`
2
+ <div class="pkt-contents">
3
+ ${this.isLoading?i.x`<pkt-icon
4
+ class="pkt-btn__icon pkt-btn__spinner"
5
+ name="spinner-blue"
6
+ path="https://punkt-cdn.oslo.kommune.no/latest/animations/"
7
+ ></pkt-icon>`:i.E}
8
+ ${this.variant!=="label-only"?i.x`<pkt-icon class="pkt-btn__icon pkt-icon" name=${this.iconName}></pkt-icon>`:i.E}
9
+ <span class="pkt-btn__text" ${d.n(this.defaultSlot)}></span>
10
+ ${this.variant==="icons-right-and-left"?i.x`<pkt-icon class="pkt-btn__icon" name=${this.secondIconName}></pkt-icon>`:i.E}
11
+ </div>
12
+ `}updateElementClasses(){const t=new Set,s=this.getAttribute("class");t.add("pkt-btn"),s&&s.split(" ").forEach(n=>t.add(n)),this.size&&t.add(`pkt-btn--${this.size}`),this.skin&&t.add(`pkt-btn--${this.skin}`),this.variant&&t.add(`pkt-btn--${this.variant}`),this.color&&t.add(`pkt-btn--${this.color}`),this.isLoading&&t.add("pkt-btn--active"),this.state&&t.add(`pkt-btn--${this.state}`),this.disabled&&t.add("pkt-btn--disabled"),this.className=[...t].join(" ")}handleClick(t){if(this.disabled||this.isLoading){t.preventDefault(),t.stopImmediatePropagation();return}if(this.type==="submit"&&this.internals.form){this.internals.form.requestSubmit(this);return}if(this.type==="reset"&&this.internals.form){this.internals.form.reset();return}this.onClick&&typeof this.onClick=="function"&&this.onClick!==this.handleClick&&this.onClick(t),this.dispatchEvent(new CustomEvent("button-click",{bubbles:!0,composed:!0,detail:{originalEvent:t}}))}handleKeydown(t){if(!(this.disabled||this.isLoading)&&(t.key==="Enter"||t.key===" ")){t.preventDefault();const s=t.target;s&&s.click()}}};exports.PktButton.formAssociated=!0;e([i.n({type:String})],exports.PktButton.prototype,"iconName",2);e([i.n({type:String})],exports.PktButton.prototype,"secondIconName",2);e([i.n({type:String})],exports.PktButton.prototype,"mode",2);e([i.n({type:String})],exports.PktButton.prototype,"size",2);e([i.n({type:String})],exports.PktButton.prototype,"color",2);e([i.n({type:String})],exports.PktButton.prototype,"skin",2);e([i.n({type:String})],exports.PktButton.prototype,"variant",2);e([i.n({type:String})],exports.PktButton.prototype,"state",2);e([i.n({type:String,reflect:!0})],exports.PktButton.prototype,"type",2);e([i.n({type:Boolean})],exports.PktButton.prototype,"isLoading",2);e([i.n({type:Boolean})],exports.PktButton.prototype,"disabled",2);exports.PktButton=e([i.t("pkt-button")],exports.PktButton);
@@ -1,21 +1,27 @@
1
- import { n as s, P as c, E as p, x as l, a as u } from "./element-DjjF_tEh.js";
2
- import { P as b } from "./pkt-slot-controller-DtDaD9q_.js";
3
- import { e as f, n as k } from "./ref-iIffqQAI.js";
4
- var m = Object.defineProperty, y = Object.getOwnPropertyDescriptor, e = (t, n, r, o) => {
5
- for (var a = o > 1 ? void 0 : o ? y(n, r) : n, d = t.length - 1, h; d >= 0; d--)
6
- (h = t[d]) && (a = (o ? h(n, r, a) : h(a)) || a);
7
- return o && a && m(n, r, a), a;
1
+ import { n as a, P as b, E as p, x as l, a as c } from "./element-DjjF_tEh.js";
2
+ import { P as f } from "./pkt-slot-controller-DtDaD9q_.js";
3
+ import { e as u, n as k } from "./ref-iIffqQAI.js";
4
+ var y = Object.defineProperty, m = Object.getOwnPropertyDescriptor, s = (t, e, n, o) => {
5
+ for (var r = o > 1 ? void 0 : o ? m(e, n) : e, d = t.length - 1, h; d >= 0; d--)
6
+ (h = t[d]) && (r = (o ? h(e, n, r) : h(r)) || r);
7
+ return o && r && y(e, n, r), r;
8
8
  };
9
- let i = class extends c {
9
+ let i = class extends b {
10
10
  constructor() {
11
- super(), this.internals = this.attachInternals(), this.defaultSlot = f(), this.iconName = "user", this.secondIconName = "user", this.mode = "light", this.size = "medium", this.skin = "primary", this.variant = "label-only", this.state = "normal", this.type = "button", this.isLoading = !1, this.disabled = !1, this.slotController = new b(this, this.defaultSlot), this.addEventListener("click", this.handleClick), this.addEventListener("keydown", this.handleKeydown);
11
+ super(), this.internals = this.attachInternals(), this.defaultSlot = u(), this.iconName = "user", this.secondIconName = "user", this.mode = "light", this.size = "medium", this.skin = "primary", this.variant = "label-only", this.state = "normal", this.type = "button", this.isLoading = !1, this.disabled = !1, this.slotController = new f(this, this.defaultSlot), this.addEventListener("click", this.handleClick), this.addEventListener("keydown", this.handleKeydown);
12
12
  }
13
13
  // Lifecycle
14
14
  disconnectedCallback() {
15
15
  super.disconnectedCallback(), this.removeEventListener("click", this.handleClick), this.removeEventListener("keydown", this.handleKeydown);
16
16
  }
17
+ attributeChangedCallback(t, e, n) {
18
+ super.attributeChangedCallback(t, e, n), t === "disabled" && n === "false" && (this.disabled = !1), (t === "isloading" || t === "isLoading") && n === "false" && (this.isLoading = !1);
19
+ }
20
+ firstUpdated(t) {
21
+ super.firstUpdated(t), this.disabled === "false" && (this.disabled = !1), this.isLoading === "false" && (this.isLoading = !1);
22
+ }
17
23
  updated(t) {
18
- super.updated(t), this.setAttribute("role", "button"), this.internals.role = "button", this.disabled ? (this.getAttribute("tabindex") !== "-1" && this.setAttribute("tabindex", "-1"), this.getAttribute("aria-disabled") !== "true" && this.setAttribute("aria-disabled", "true")) : (this.getAttribute("tabindex") !== "0" && this.setAttribute("tabindex", "0"), this.getAttribute("aria-disabled") !== "false" && this.removeAttribute("aria-disabled")), this.isLoading ? this.getAttribute("aria-busy") !== "true" && this.setAttribute("aria-busy", "true") : this.hasAttribute("aria-busy") && this.removeAttribute("aria-busy"), this.updateElementClasses();
24
+ super.updated(t), this.setAttribute("role", "button"), this.internals.role = "button", this.disabled === "false" && (this.disabled = !1), this.isLoading === "false" && (this.isLoading = !1), this.disabled ? (this.getAttribute("tabindex") !== "-1" && this.setAttribute("tabindex", "-1"), this.getAttribute("aria-disabled") !== "true" && this.setAttribute("aria-disabled", "true")) : (this.getAttribute("tabindex") !== "0" && this.setAttribute("tabindex", "0"), this.getAttribute("aria-disabled") !== "false" && this.removeAttribute("aria-disabled")), this.isLoading ? this.getAttribute("aria-busy") !== "true" && this.setAttribute("aria-busy", "true") : this.hasAttribute("aria-busy") && this.removeAttribute("aria-busy"), this.updateElementClasses();
19
25
  }
20
26
  // Render
21
27
  render() {
@@ -34,8 +40,8 @@ let i = class extends c {
34
40
  }
35
41
  // Methods
36
42
  updateElementClasses() {
37
- const t = /* @__PURE__ */ new Set(), n = this.getAttribute("class");
38
- t.add("pkt-btn"), n && n.split(" ").forEach((r) => t.add(r)), this.size && t.add(`pkt-btn--${this.size}`), this.skin && t.add(`pkt-btn--${this.skin}`), this.variant && t.add(`pkt-btn--${this.variant}`), this.color && t.add(`pkt-btn--${this.color}`), this.isLoading && t.add("pkt-btn--active"), this.state && t.add(`pkt-btn--${this.state}`), this.disabled && t.add("pkt-btn--disabled"), this.className = [...t].join(" ");
43
+ const t = /* @__PURE__ */ new Set(), e = this.getAttribute("class");
44
+ t.add("pkt-btn"), e && e.split(" ").forEach((n) => t.add(n)), this.size && t.add(`pkt-btn--${this.size}`), this.skin && t.add(`pkt-btn--${this.skin}`), this.variant && t.add(`pkt-btn--${this.variant}`), this.color && t.add(`pkt-btn--${this.color}`), this.isLoading && t.add("pkt-btn--active"), this.state && t.add(`pkt-btn--${this.state}`), this.disabled && t.add("pkt-btn--disabled"), this.className = [...t].join(" ");
39
45
  }
40
46
  handleClick(t) {
41
47
  if (this.disabled || this.isLoading) {
@@ -43,7 +49,7 @@ let i = class extends c {
43
49
  return;
44
50
  }
45
51
  if (this.type === "submit" && this.internals.form) {
46
- this.internals.form.requestSubmit();
52
+ this.internals.form.requestSubmit(this);
47
53
  return;
48
54
  }
49
55
  if (this.type === "reset" && this.internals.form) {
@@ -61,47 +67,47 @@ let i = class extends c {
61
67
  handleKeydown(t) {
62
68
  if (!(this.disabled || this.isLoading) && (t.key === "Enter" || t.key === " ")) {
63
69
  t.preventDefault();
64
- const n = t.target;
65
- n && n.click();
70
+ const e = t.target;
71
+ e && e.click();
66
72
  }
67
73
  }
68
74
  };
69
75
  i.formAssociated = !0;
70
- e([
71
- s({ type: String })
76
+ s([
77
+ a({ type: String })
72
78
  ], i.prototype, "iconName", 2);
73
- e([
74
- s({ type: String })
79
+ s([
80
+ a({ type: String })
75
81
  ], i.prototype, "secondIconName", 2);
76
- e([
77
- s({ type: String })
82
+ s([
83
+ a({ type: String })
78
84
  ], i.prototype, "mode", 2);
79
- e([
80
- s({ type: String })
85
+ s([
86
+ a({ type: String })
81
87
  ], i.prototype, "size", 2);
82
- e([
83
- s({ type: String })
88
+ s([
89
+ a({ type: String })
84
90
  ], i.prototype, "color", 2);
85
- e([
86
- s({ type: String })
91
+ s([
92
+ a({ type: String })
87
93
  ], i.prototype, "skin", 2);
88
- e([
89
- s({ type: String })
94
+ s([
95
+ a({ type: String })
90
96
  ], i.prototype, "variant", 2);
91
- e([
92
- s({ type: String, reflect: !0 })
97
+ s([
98
+ a({ type: String })
93
99
  ], i.prototype, "state", 2);
94
- e([
95
- s({ type: String, reflect: !0 })
100
+ s([
101
+ a({ type: String, reflect: !0 })
96
102
  ], i.prototype, "type", 2);
97
- e([
98
- s({ type: Boolean, reflect: !0 })
103
+ s([
104
+ a({ type: Boolean })
99
105
  ], i.prototype, "isLoading", 2);
100
- e([
101
- s({ type: Boolean, reflect: !0 })
106
+ s([
107
+ a({ type: Boolean })
102
108
  ], i.prototype, "disabled", 2);
103
- i = e([
104
- u("pkt-button")
109
+ i = s([
110
+ c("pkt-button")
105
111
  ], i);
106
112
  export {
107
113
  i as P
@@ -1,4 +1,4 @@
1
- "use strict";const e=require("./element-BSypUpzA.cjs"),a=require("./input-element-XmmyUZmB.cjs"),k=require("./ref-BvbyvXRH.cjs"),o=require("./class-map-DCyaICmy.cjs");var r=Object.defineProperty,u=Object.getOwnPropertyDescriptor,c=(l,t,s,h)=>{for(var i=h>1?void 0:h?u(t,s):t,n=l.length-1,p;n>=0;n--)(p=l[n])&&(i=(h?p(t,s,i):p(i))||i);return h&&i&&r(t,s,i),i};exports.PktCheckbox=class extends a.PktInputElement{constructor(){super(...arguments),this.inputRef=k.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.type="checkbox"}connectedCallback(){super.connectedCallback()}attributeChangedCallback(t,s,h){t==="defaultChecked"&&!this.checked&&(this.checked=this.defaultChecked),t==="checked"&&(this.checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(t,s,h)}firstUpdated(t){t.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),super.firstUpdated(t)}render(){const t=o.e({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),s=o.e({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),h=o.e({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--left":this.labelPosition==="left","pkt-input-check__input-label--right":this.labelPosition==="right","pkt-sr-only":this.hideLabel}),i=()=>e.x`
1
+ "use strict";const e=require("./element-BSypUpzA.cjs"),a=require("./input-element-KzKpjjLc.cjs"),k=require("./ref-BvbyvXRH.cjs"),o=require("./class-map-DCyaICmy.cjs");var r=Object.defineProperty,u=Object.getOwnPropertyDescriptor,c=(l,t,s,h)=>{for(var i=h>1?void 0:h?u(t,s):t,n=l.length-1,p;n>=0;n--)(p=l[n])&&(i=(h?p(t,s,i):p(i))||i);return h&&i&&r(t,s,i),i};exports.PktCheckbox=class extends a.PktInputElement{constructor(){super(...arguments),this.inputRef=k.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.type="checkbox"}connectedCallback(){super.connectedCallback()}attributeChangedCallback(t,s,h){t==="defaultChecked"&&!this.checked&&(this.checked=this.defaultChecked),t==="checked"&&(this.checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(t,s,h)}firstUpdated(t){t.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),super.firstUpdated(t)}render(){const t=o.e({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),s=o.e({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),h=o.e({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--left":this.labelPosition==="left","pkt-input-check__input-label--right":this.labelPosition==="right","pkt-sr-only":this.hideLabel}),i=()=>e.x`
2
2
  <label class=${h} for=${this.id+"-internal"}>
3
3
  ${this.label}
4
4
  ${this.checkHelptext?e.x`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:e.E}
@@ -1,5 +1,5 @@
1
1
  import { E as n, x as r, n as s, a as d } from "./element-DjjF_tEh.js";
2
- import { P as k } from "./input-element-aQDMXDVQ.js";
2
+ import { P as k } from "./input-element-B5EvsMww.js";
3
3
  import { e as b, n as f } from "./ref-iIffqQAI.js";
4
4
  import { e as u } from "./class-map-KyMqi0fa.js";
5
5
  var _ = Object.defineProperty, y = Object.getOwnPropertyDescriptor, i = (e, h, c, l) => {
@@ -1,4 +1,4 @@
1
- "use strict";const l=require("./element-BSypUpzA.cjs"),c=require("./if-defined-a3sotaUr.cjs"),d=require("./state-B5KCNjEd.cjs"),r=require("./ref-BvbyvXRH.cjs"),$=require("./class-map-DCyaICmy.cjs"),I=require("./repeat-BnuruAat.cjs"),w=require("./input-element-XmmyUZmB.cjs"),y=require("./pkt-options-controller-Ay9ELZTV.cjs"),O=require("./pkt-slot-controller-Da-RgXfS.cjs");require("./input-wrapper-B-f_SotM.cjs");require("./icon-BnKGwYjj.cjs");require("./tag-B9kFYxHg.cjs");require("./listbox-DqpGh7eq.cjs");const C={displayValueAs:{default:"label"}},R={props:C};var V=Object.defineProperty,S=Object.getOwnPropertyDescriptor,o=(b,e,t,i)=>{for(var s=i>1?void 0:i?S(e,t):e,h=b.length-1,n;h>=0;h--)(n=b[h])&&(s=(i?n(e,t,s):n(s))||s);return i&&s&&V(e,t,s),s};exports.PktCombobox=class extends w.PktInputElement{constructor(){super(),this.helptextSlot=r.e(),this.value="",this.options=[],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 y.PktOptionsSlotController(this),this.slotController=new O.PktSlotController(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){if(super.connectedCallback(),document&&document.body.addEventListener("click",e=>{this._isOptionsOpen&&!this.contains(e.target)&&this.handleFocusOut(e)}),this._options=[],this.optionsController.nodes.length){const e=[];this.optionsController.nodes.forEach(t=>{if(!t.textContent&&!t.getAttribute("value"))return null;const i={value:t.getAttribute("value")||t.textContent||"",label:t.textContent||t.getAttribute("value")||""};t.getAttribute("data-prefix")&&(i.prefix=t.getAttribute("data-prefix")||void 0),t.getAttribute("tagskincolor")&&(i.tagSkinColor=t.getAttribute("tagskincolor")),t.getAttribute("description")&&(i.description=t.getAttribute("description")||void 0),i.fulltext=i.value+i.label+(i.prefix||""),e.push(i)}),e.length&&(this.options=[...e],this._options=[...e])}}updated(e){e.has("_value")&&this.valueChanged(this._value,e.get("_value")),e.has("value")&&(this._value=Array.isArray(this.value)?this.value:this.value?this.value.split(","):[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]]),this.isMaxItemsReached()),e.has("options")&&this.options.length&&(this._options=this.options,this._options.forEach(t=>{if(t.value&&!t.label&&(t.label=t.value),t.selected&&!this._value.includes(t.value)){const i=[...this._value];this._value=[...this._value,t.value],this.valueChanged(this._value,i)}t.fulltext=t.value+t.label+(t.prefix||""),t.selected=t.selected||this._value.includes(t.value)})),e.has("_search")&&this.dispatchEvent(new CustomEvent("search",{detail:this._search,bubbles:!1})),super.updated(e)}attributeChangedCallback(e,t,i){e==="value"&&(this._value=Array.isArray(this.value)?this.value:this.value?this.value.split(","):[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]])),e==="options"&&(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 l.x`
1
+ "use strict";const l=require("./element-BSypUpzA.cjs"),c=require("./if-defined-a3sotaUr.cjs"),d=require("./state-B5KCNjEd.cjs"),r=require("./ref-BvbyvXRH.cjs"),$=require("./class-map-DCyaICmy.cjs"),I=require("./repeat-BnuruAat.cjs"),w=require("./input-element-KzKpjjLc.cjs"),y=require("./pkt-options-controller-Ay9ELZTV.cjs"),O=require("./pkt-slot-controller-Da-RgXfS.cjs");require("./input-wrapper-B-f_SotM.cjs");require("./icon-BnKGwYjj.cjs");require("./tag-B9kFYxHg.cjs");require("./listbox-DqpGh7eq.cjs");const C={displayValueAs:{default:"label"}},R={props:C};var V=Object.defineProperty,S=Object.getOwnPropertyDescriptor,o=(b,e,t,i)=>{for(var s=i>1?void 0:i?S(e,t):e,h=b.length-1,n;h>=0;h--)(n=b[h])&&(s=(i?n(e,t,s):n(s))||s);return i&&s&&V(e,t,s),s};exports.PktCombobox=class extends w.PktInputElement{constructor(){super(),this.helptextSlot=r.e(),this.value="",this.options=[],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 y.PktOptionsSlotController(this),this.slotController=new O.PktSlotController(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){if(super.connectedCallback(),document&&document.body.addEventListener("click",e=>{this._isOptionsOpen&&!this.contains(e.target)&&this.handleFocusOut(e)}),this._options=[],this.optionsController.nodes.length){const e=[];this.optionsController.nodes.forEach(t=>{if(!t.textContent&&!t.getAttribute("value"))return null;const i={value:t.getAttribute("value")||t.textContent||"",label:t.textContent||t.getAttribute("value")||""};t.getAttribute("data-prefix")&&(i.prefix=t.getAttribute("data-prefix")||void 0),t.getAttribute("tagskincolor")&&(i.tagSkinColor=t.getAttribute("tagskincolor")),t.getAttribute("description")&&(i.description=t.getAttribute("description")||void 0),i.fulltext=i.value+i.label+(i.prefix||""),e.push(i)}),e.length&&(this.options=[...e],this._options=[...e])}}updated(e){e.has("_value")&&this.valueChanged(this._value,e.get("_value")),e.has("value")&&(this._value=Array.isArray(this.value)?this.value:this.value?this.value.split(","):[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]]),this.isMaxItemsReached()),e.has("options")&&this.options.length&&(this._options=this.options,this._options.forEach(t=>{if(t.value&&!t.label&&(t.label=t.value),t.selected&&!this._value.includes(t.value)){const i=[...this._value];this._value=[...this._value,t.value],this.valueChanged(this._value,i)}t.fulltext=t.value+t.label+(t.prefix||""),t.selected=t.selected||this._value.includes(t.value)})),e.has("_search")&&this.dispatchEvent(new CustomEvent("search",{detail:this._search,bubbles:!1})),super.updated(e)}attributeChangedCallback(e,t,i){e==="value"&&(this._value=Array.isArray(this.value)?this.value:this.value?this.value.split(","):[],!this.multiple&&this._value.length>1&&(this._value=[this._value[0]])),e==="options"&&(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 l.x`
2
2
  <pkt-input-wrapper
3
3
  .label=${this.label}
4
4
  .helptext=${this.helptext}
@@ -4,7 +4,7 @@ import { r as c } from "./state-BtbpSrdV.js";
4
4
  import { e as _, n as v } from "./ref-iIffqQAI.js";
5
5
  import { e as k } from "./class-map-KyMqi0fa.js";
6
6
  import { c as R } from "./repeat-D4kMediE.js";
7
- import { P as V } from "./input-element-aQDMXDVQ.js";
7
+ import { P as V } from "./input-element-B5EvsMww.js";
8
8
  import { P as C } from "./pkt-options-controller-DepYQBqb.js";
9
9
  import { P as S } from "./pkt-slot-controller-DtDaD9q_.js";
10
10
  import "./input-wrapper-BdeoMGnk.js";
@@ -1,5 +1,5 @@
1
1
  import { P as k, x as l, n as a, a as u } from "./element-DjjF_tEh.js";
2
- import "./button-sf_Yzx3X.js";
2
+ import "./button-DoVwr7W4.js";
3
3
  import "./icon-Beoxup8E.js";
4
4
  const h = {
5
5
  i18n: {
@@ -1,4 +1,4 @@
1
- "use strict";const s=require("./element-BSypUpzA.cjs");require("./button-jdMbbn-e.cjs");require("./icon-BnKGwYjj.cjs");const g={i18n:{nb:{contentPresentation:{title:"Oslo kommune bruker informasjonskapsler",description:["For at nettstedet skal fungere og være trygt, bruker Oslo kommune informasjonskapsler. Noen er teknisk nødvendige, mens andre sikrer ulik funksjonalitet.","Godtar du alle informasjonskapsler, tillater du også at vi samler inn data om statistikk og brukeradferd. Da hjelper du oss med å lage et bedre nettsted uten at du trenger å dele noe personlig informasjon med oss."],buttons:{accept:"Godta alle",reject:"Kun nødvendige",settings:"Innstillinger for informasjonskapsler"}},contentSettings:{title:"Innstillinger for informasjonskapsler",description:["Her kan du velge hvilke typer informasjonskapsler du vil tillate. Tillatelsen gjelder i 90 dager. Husk at nødvendige informasjonskapsler ikke kan velges bort.","Du kan når som helst endre innstillingene og finne mer informasjon nederst på nettstedet under «Innstillinger for informasjonskapsler» og «Personvern og informasjonskapsler»."],buttons:{back:"Tilbake",save:"Lagre innstillinger"}}},en:{contentPresentation:{title:"Before you visit Oslo kommune ...",description:["This website uses cookies to make improvements. In this context, we need your consent to measure the traffic on the website in relation to statistics and feedback.","To read more about what we use cookies for, go to our privacy declaration which you will find at the bottom of our websites."],buttons:{accept:"Yes, I accept",reject:"Only necessary",settings:"Go to settings"}},contentSettings:{title:"Her kan du aktivt velge mellom ulike informasjonskapsler",description:["For å lese mer om hva vi bruker informasjonskapsler til gå til vår personvernserklering som du finner på våre nettsider"],buttons:{back:"Back",save:"Save settings"}}}}},c=globalThis,d=c.__cookieEvents||{events:{},on(t,e){this.events[t]||(this.events[t]=[]),this.events[t].push(e)},off(t,e){this.events[t]&&(this.events[t]=this.events[t].filter(n=>n!==e))},once(t,e){const n=o=>{this.off(t,n),e(o)};this.on(t,n)},emit(t,e){this.events[t]&&this.events[t].forEach(n=>n(e))}};c.__cookieEvents=d;const k=d;var p=Object.defineProperty,u=Object.getOwnPropertyDescriptor,a=(t,e,n,o)=>{for(var i=o>1?void 0:o?u(e,n):e,r=t.length-1,l;r>=0;r--)(l=t[r])&&(i=(o?l(e,n,i):l(i))||i);return o&&i&&p(e,n,i),i};exports.PktConsent=class extends s.PktElement{constructor(){super(),this.hotjarId=null,this.googleAnalyticsId=null,this.triggerType="button",this.triggerText=null,this.i18nLanguage="nb"}connectedCallback(){super.connectedCallback(),this.triggerText=this.triggerText||g.i18n[this.i18nLanguage].contentPresentation.buttons.settings,this.googleAnalyticsId&&(window.googleAnalyticsId=this.googleAnalyticsId),this.hotjarId&&(window.hotjarId=this.hotjarId),k.on("CookieManager.setCookie",e=>{this.emitCookieConsents(e)})}emitCookieConsents(e){const o=JSON.parse(e.value).items.reduce((i,r)=>(i[r.name]=r.consent,i),{});this.dispatchEvent(new CustomEvent("toggle-consent",{detail:o,bubbles:!0,composed:!0}))}firstUpdated(e){if(!document.querySelector("#oslo-consent-script")&&window.location.hostname.toLowerCase().includes("oslo.kommune.no")){window.googleAnalyticsId=this.googleAnalyticsId,window.hotjarId=this.hotjarId;const n=document.createElement("script");n.src="https://cdn.web.oslo.kommune.no/cb/cb-v1.0.0.js",n.id="oslo-consent-script",n.onload=()=>{this.triggerInit()},document.head.appendChild(n);const o=document.createElement("link");o.href="https://cdn.web.oslo.kommune.no/cb/cb-v1.0.0.css",o.type="text/css",o.rel="stylesheet",o.id="oslo-consent-styles",document.head.appendChild(o)}}triggerInit(){window.document.dispatchEvent(new Event("DOMContentLoaded",{bubbles:!0,cancelable:!0})),window.cookieBanner.cookieConsent.validateConsentCookie().then(e=>{if(e){const o={value:window.cookieBanner.cookieConsent.getConsentCookie().items};this.emitCookieConsents(o)}})}openModal(e){e.preventDefault(),window.cookieBanner.cookieConsent||this.triggerInit(),setTimeout(()=>window.cookieBanner.openCookieModal())}render(){return this.triggerType==="link"?s.x`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType==="footerlink"?s.x`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
1
+ "use strict";const s=require("./element-BSypUpzA.cjs");require("./button-C1cqSjK2.cjs");require("./icon-BnKGwYjj.cjs");const g={i18n:{nb:{contentPresentation:{title:"Oslo kommune bruker informasjonskapsler",description:["For at nettstedet skal fungere og være trygt, bruker Oslo kommune informasjonskapsler. Noen er teknisk nødvendige, mens andre sikrer ulik funksjonalitet.","Godtar du alle informasjonskapsler, tillater du også at vi samler inn data om statistikk og brukeradferd. Da hjelper du oss med å lage et bedre nettsted uten at du trenger å dele noe personlig informasjon med oss."],buttons:{accept:"Godta alle",reject:"Kun nødvendige",settings:"Innstillinger for informasjonskapsler"}},contentSettings:{title:"Innstillinger for informasjonskapsler",description:["Her kan du velge hvilke typer informasjonskapsler du vil tillate. Tillatelsen gjelder i 90 dager. Husk at nødvendige informasjonskapsler ikke kan velges bort.","Du kan når som helst endre innstillingene og finne mer informasjon nederst på nettstedet under «Innstillinger for informasjonskapsler» og «Personvern og informasjonskapsler»."],buttons:{back:"Tilbake",save:"Lagre innstillinger"}}},en:{contentPresentation:{title:"Before you visit Oslo kommune ...",description:["This website uses cookies to make improvements. In this context, we need your consent to measure the traffic on the website in relation to statistics and feedback.","To read more about what we use cookies for, go to our privacy declaration which you will find at the bottom of our websites."],buttons:{accept:"Yes, I accept",reject:"Only necessary",settings:"Go to settings"}},contentSettings:{title:"Her kan du aktivt velge mellom ulike informasjonskapsler",description:["For å lese mer om hva vi bruker informasjonskapsler til gå til vår personvernserklering som du finner på våre nettsider"],buttons:{back:"Back",save:"Save settings"}}}}},c=globalThis,d=c.__cookieEvents||{events:{},on(t,e){this.events[t]||(this.events[t]=[]),this.events[t].push(e)},off(t,e){this.events[t]&&(this.events[t]=this.events[t].filter(n=>n!==e))},once(t,e){const n=o=>{this.off(t,n),e(o)};this.on(t,n)},emit(t,e){this.events[t]&&this.events[t].forEach(n=>n(e))}};c.__cookieEvents=d;const k=d;var p=Object.defineProperty,u=Object.getOwnPropertyDescriptor,a=(t,e,n,o)=>{for(var i=o>1?void 0:o?u(e,n):e,r=t.length-1,l;r>=0;r--)(l=t[r])&&(i=(o?l(e,n,i):l(i))||i);return o&&i&&p(e,n,i),i};exports.PktConsent=class extends s.PktElement{constructor(){super(),this.hotjarId=null,this.googleAnalyticsId=null,this.triggerType="button",this.triggerText=null,this.i18nLanguage="nb"}connectedCallback(){super.connectedCallback(),this.triggerText=this.triggerText||g.i18n[this.i18nLanguage].contentPresentation.buttons.settings,this.googleAnalyticsId&&(window.googleAnalyticsId=this.googleAnalyticsId),this.hotjarId&&(window.hotjarId=this.hotjarId),k.on("CookieManager.setCookie",e=>{this.emitCookieConsents(e)})}emitCookieConsents(e){const o=JSON.parse(e.value).items.reduce((i,r)=>(i[r.name]=r.consent,i),{});this.dispatchEvent(new CustomEvent("toggle-consent",{detail:o,bubbles:!0,composed:!0}))}firstUpdated(e){if(!document.querySelector("#oslo-consent-script")&&window.location.hostname.toLowerCase().includes("oslo.kommune.no")){window.googleAnalyticsId=this.googleAnalyticsId,window.hotjarId=this.hotjarId;const n=document.createElement("script");n.src="https://cdn.web.oslo.kommune.no/cb/cb-v1.0.0.js",n.id="oslo-consent-script",n.onload=()=>{this.triggerInit()},document.head.appendChild(n);const o=document.createElement("link");o.href="https://cdn.web.oslo.kommune.no/cb/cb-v1.0.0.css",o.type="text/css",o.rel="stylesheet",o.id="oslo-consent-styles",document.head.appendChild(o)}}triggerInit(){window.document.dispatchEvent(new Event("DOMContentLoaded",{bubbles:!0,cancelable:!0})),window.cookieBanner.cookieConsent.validateConsentCookie().then(e=>{if(e){const o={value:window.cookieBanner.cookieConsent.getConsentCookie().items};this.emitCookieConsents(o)}})}openModal(e){e.preventDefault(),window.cookieBanner.cookieConsent||this.triggerInit(),setTimeout(()=>window.cookieBanner.openCookieModal())}render(){return this.triggerType==="link"?s.x`<a href="#" class="pkt-link" @click=${this.openModal}>${this.triggerText}</a>`:this.triggerType==="footerlink"?s.x`<a href="#" class="pkt-footer__link" @click=${this.openModal}>
2
2
  <pkt-icon name="chevron-right" class="pkt-footer__link-icon"></pkt-icon>
3
3
  ${this.triggerText}
4
4
  </a>`:this.triggerType==="icon"?s.x`<pkt-button
@@ -3,7 +3,7 @@ import { o } from "./if-defined-BErSJCeJ.js";
3
3
  import { x as u, E as g, n as r, a as w } from "./element-DjjF_tEh.js";
4
4
  import { r as k } from "./state-BtbpSrdV.js";
5
5
  import { n as v, f as $, a as R, b as y, d as x } from "./calendar-KDcOWD6V.js";
6
- import { P as C } from "./input-element-aQDMXDVQ.js";
6
+ import { P as C } from "./input-element-B5EvsMww.js";
7
7
  import { e as m, n as p } from "./ref-iIffqQAI.js";
8
8
  import { c as T } from "./repeat-D4kMediE.js";
9
9
  import "./icon-Beoxup8E.js";
@@ -1,4 +1,4 @@
1
- "use strict";const d=require("./class-map-DCyaICmy.cjs"),p=require("./if-defined-a3sotaUr.cjs"),s=require("./element-BSypUpzA.cjs"),m=require("./state-B5KCNjEd.cjs"),h=require("./calendar-CYY42kN4.cjs"),k=require("./input-element-XmmyUZmB.cjs"),r=require("./ref-BvbyvXRH.cjs"),v=require("./repeat-BnuruAat.cjs");require("./icon-BnKGwYjj.cjs");require("./input-wrapper-B-f_SotM.cjs");require("./tag-B9kFYxHg.cjs");const $=require("./pkt-slot-controller-Da-RgXfS.cjs"),y={dateformat:{default:"dd.MM.yyyy"},min:{default:null},max:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},range:{default:!1}},o={props:y};var b=Object.defineProperty,x=Object.getOwnPropertyDescriptor,l=(c,t,e,i)=>{for(var a=i>1?void 0:i?x(t,e):t,n=c.length-1,u;n>=0;n--)(u=c[n])&&(a=(i?u(t,e,a):u(a))||a);return i&&a&&b(t,e,a),a};const g=c=>new Promise(t=>setTimeout(t,c));exports.PktDatepicker=class extends k.PktInputElement{constructor(){super(),this.value="",this._value=this.value?Array.isArray(this.value)?this.value:this.value.split(","):[],this.label="Datovelger",this.dateformat=o.props.dateformat.default,this.multiple=o.props.multiple.default,this.maxlength=null,this.range=o.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=o.props.weeknumbers.default,this.withcontrols=o.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.calendarOpen=!1,this.timezone="Europe/Oslo",this.inputClasses={},this.buttonClasses={},this.inputRef=r.e(),this.inputRefTo=r.e(),this.btnRef=r.e(),this.calRef=r.e(),this.popupRef=r.e(),this.helptextSlot=r.e(),this.addToSelected=t=>{const e=t.target;if(!e.value)return;const i=this.min?h.newDate(this.min):null,a=this.max?h.newDate(this.max):null,n=h.newDate(e.value.split(",")[0]);n&&!isNaN(n.getTime())&&(!i||n>=i)&&(!a||n<=a)&&this.calRef.value&&this.calRef.value.handleDateSelect(n),e.value=""},this.slotController=new $.PktSlotController(this,this.helptextSlot)}async connectedCallback(){super.connectedCallback();const t=navigator.userAgent,e=/iP(hone|od|ad)/.test(t);this.inputType=e?"text":"date",document&&document.body.addEventListener("click",i=>{var a,n;(a=this.inputRef)!=null&&a.value&&((n=this.btnRef)!=null&&n.value)&&!this.inputRef.value.contains(i.target)&&!(this.inputRefTo.value&&this.inputRefTo.value.contains(i.target))&&!this.btnRef.value.contains(i.target)&&!i.target.closest(".pkt-calendar-popup")&&this.calendarOpen&&(this.onBlur(),this.hideCalendar())}),this.value.length&&this._value.length===0&&(this._value=Array.isArray(this.value)?this.value:this.value.split(",")),this.min=this.min||o.props.min.default,this.max=this.max||o.props.max.default,typeof this.excludedates=="string"&&(this.excludedates=this.excludedates.split(",")),typeof this.excludeweekdays=="string"&&(this.excludeweekdays=this.excludeweekdays.split(",")),(this.multiple||this.range)&&this.name&&!this.name.endsWith("[]")&&(this.name=this.name+"[]"),this.calendarOpen&&(await g(20),this.handleCalendarPosition())}disconnectedCallback(){super.disconnectedCallback(),document&&document.body.removeEventListener("click",t=>{var e,i;(e=this.inputRef)!=null&&e.value&&((i=this.btnRef)!=null&&i.value)&&!this.inputRef.value.contains(t.target)&&!this.btnRef.value.contains(t.target)&&this.hideCalendar()})}attributeChangedCallback(t,e,i){if(t==="value"){if(this.range&&(i==null?void 0:i.split(",").length)===1)return;this.value!==e&&this.valueChanged(i,e)}t==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=(i==null?void 0:i.split(","))??[]),t==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=(i==null?void 0:i.split(","))??[]),super.attributeChangedCallback(t,e,i)}updated(t){if(t.has("value")){if(this.range&&this.value.length===1)return;this.valueChanged(this.value,t.get("value"))}super.updated(t)}renderInput(){return s.x`
1
+ "use strict";const d=require("./class-map-DCyaICmy.cjs"),p=require("./if-defined-a3sotaUr.cjs"),s=require("./element-BSypUpzA.cjs"),m=require("./state-B5KCNjEd.cjs"),h=require("./calendar-CYY42kN4.cjs"),k=require("./input-element-KzKpjjLc.cjs"),r=require("./ref-BvbyvXRH.cjs"),v=require("./repeat-BnuruAat.cjs");require("./icon-BnKGwYjj.cjs");require("./input-wrapper-B-f_SotM.cjs");require("./tag-B9kFYxHg.cjs");const $=require("./pkt-slot-controller-Da-RgXfS.cjs"),y={dateformat:{default:"dd.MM.yyyy"},min:{default:null},max:{default:null},weeknumbers:{default:!1},withcontrols:{default:!1},multiple:{default:!1},range:{default:!1}},o={props:y};var b=Object.defineProperty,x=Object.getOwnPropertyDescriptor,l=(c,t,e,i)=>{for(var a=i>1?void 0:i?x(t,e):t,n=c.length-1,u;n>=0;n--)(u=c[n])&&(a=(i?u(t,e,a):u(a))||a);return i&&a&&b(t,e,a),a};const g=c=>new Promise(t=>setTimeout(t,c));exports.PktDatepicker=class extends k.PktInputElement{constructor(){super(),this.value="",this._value=this.value?Array.isArray(this.value)?this.value:this.value.split(","):[],this.label="Datovelger",this.dateformat=o.props.dateformat.default,this.multiple=o.props.multiple.default,this.maxlength=null,this.range=o.props.range.default,this.showRangeLabels=!1,this.min=null,this.max=null,this.weeknumbers=o.props.weeknumbers.default,this.withcontrols=o.props.withcontrols.default,this.excludedates=[],this.excludeweekdays=[],this.currentmonth=null,this.calendarOpen=!1,this.timezone="Europe/Oslo",this.inputClasses={},this.buttonClasses={},this.inputRef=r.e(),this.inputRefTo=r.e(),this.btnRef=r.e(),this.calRef=r.e(),this.popupRef=r.e(),this.helptextSlot=r.e(),this.addToSelected=t=>{const e=t.target;if(!e.value)return;const i=this.min?h.newDate(this.min):null,a=this.max?h.newDate(this.max):null,n=h.newDate(e.value.split(",")[0]);n&&!isNaN(n.getTime())&&(!i||n>=i)&&(!a||n<=a)&&this.calRef.value&&this.calRef.value.handleDateSelect(n),e.value=""},this.slotController=new $.PktSlotController(this,this.helptextSlot)}async connectedCallback(){super.connectedCallback();const t=navigator.userAgent,e=/iP(hone|od|ad)/.test(t);this.inputType=e?"text":"date",document&&document.body.addEventListener("click",i=>{var a,n;(a=this.inputRef)!=null&&a.value&&((n=this.btnRef)!=null&&n.value)&&!this.inputRef.value.contains(i.target)&&!(this.inputRefTo.value&&this.inputRefTo.value.contains(i.target))&&!this.btnRef.value.contains(i.target)&&!i.target.closest(".pkt-calendar-popup")&&this.calendarOpen&&(this.onBlur(),this.hideCalendar())}),this.value.length&&this._value.length===0&&(this._value=Array.isArray(this.value)?this.value:this.value.split(",")),this.min=this.min||o.props.min.default,this.max=this.max||o.props.max.default,typeof this.excludedates=="string"&&(this.excludedates=this.excludedates.split(",")),typeof this.excludeweekdays=="string"&&(this.excludeweekdays=this.excludeweekdays.split(",")),(this.multiple||this.range)&&this.name&&!this.name.endsWith("[]")&&(this.name=this.name+"[]"),this.calendarOpen&&(await g(20),this.handleCalendarPosition())}disconnectedCallback(){super.disconnectedCallback(),document&&document.body.removeEventListener("click",t=>{var e,i;(e=this.inputRef)!=null&&e.value&&((i=this.btnRef)!=null&&i.value)&&!this.inputRef.value.contains(t.target)&&!this.btnRef.value.contains(t.target)&&this.hideCalendar()})}attributeChangedCallback(t,e,i){if(t==="value"){if(this.range&&(i==null?void 0:i.split(",").length)===1)return;this.value!==e&&this.valueChanged(i,e)}t==="excludedates"&&typeof this.excludedates=="string"&&(this.excludedates=(i==null?void 0:i.split(","))??[]),t==="excludeweekdays"&&typeof this.excludeweekdays=="string"&&(this.excludeweekdays=(i==null?void 0:i.split(","))??[]),super.attributeChangedCallback(t,e,i)}updated(t){if(t.has("value")){if(this.range&&this.value.length===1)return;this.valueChanged(this.value,t.get("value"))}super.updated(t)}renderInput(){return s.x`
2
2
  <input
3
3
  class="${d.e(this.inputClasses)}"
4
4
  .type=${this.inputType}
package/dist/index.d.ts CHANGED
@@ -8,6 +8,8 @@ import { Ref } from 'lit/directives/ref.js';
8
8
  import { TemplateResult } from 'lit-html';
9
9
  import { TZDate } from '@date-fns/tz';
10
10
 
11
+ declare type Booleanish = boolean | 'true' | 'false';
12
+
11
13
  /**
12
14
  * We define all props as optional. Native HTML attributes are optional by default,
13
15
  * but the TS definition require either null or value. This way we can support showing a value as optional
@@ -111,8 +113,8 @@ export declare interface IPktButton {
111
113
  variant?: TPktButtonVariant;
112
114
  state?: TPktButtonState;
113
115
  type?: TPktButtonType;
114
- isLoading?: boolean;
115
- disabled?: boolean;
116
+ isLoading?: Booleanish;
117
+ disabled?: Booleanish;
116
118
  }
117
119
 
118
120
  export declare interface IPktCombobox {
@@ -334,9 +336,11 @@ export declare class PktButton extends PktElement<IPktButton> implements IPktBut
334
336
  variant: TPktButtonVariant;
335
337
  state?: TPktButtonState;
336
338
  type: TPktButtonType;
337
- isLoading: boolean;
338
- disabled: boolean;
339
+ isLoading: Booleanish;
340
+ disabled: Booleanish;
339
341
  disconnectedCallback(): void;
342
+ attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
343
+ protected firstUpdated(_changedProperties: PropertyValues): void;
340
344
  protected updated(_changedProperties: PropertyValues): void;
341
345
  render(): TemplateResult<1>;
342
346
  private updateElementClasses;
@@ -1,32 +1,32 @@
1
- import { P as c, t as l, n as s } from "./element-DjjF_tEh.js";
1
+ import { P as c, t as n, n as s } from "./element-DjjF_tEh.js";
2
2
  import { r as y } from "./state-BtbpSrdV.js";
3
3
  import { u as m } from "./stringutils-DJjRa8dG.js";
4
4
  import { s as g } from "./input-wrapper-8iKEzDRZ.js";
5
5
  var v = Object.defineProperty, e = (u, t, a, h) => {
6
- for (var r = void 0, n = u.length - 1, o; n >= 0; n--)
7
- (o = u[n]) && (r = o(t, a, r) || r);
6
+ for (var r = void 0, l = u.length - 1, o; l >= 0; l--)
7
+ (o = u[l]) && (r = o(t, a, r) || r);
8
8
  return r && v(t, a, r), r;
9
9
  };
10
10
  class i extends c {
11
11
  constructor() {
12
- 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.ariaDescribedBy = null, this.ariaLabelledby = null, this.name = "", this.pattern = null, this.placeholder = null, this.id = m(), 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 = g.props.helptextDropdownButton.default, this.label = null, this.optionalText = l.forms.labels.optional, this.requiredText = l.forms.labels.required, this.dataTestid = "", this.touched = !1, this.internals = this.attachInternals();
12
+ 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.ariaDescribedBy = null, this.ariaLabelledby = null, this.name = "", this.pattern = null, this.placeholder = null, this.id = m(), 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 = g.props.helptextDropdownButton.default, this.label = null, this.optionalText = n.forms.labels.optional, this.requiredText = n.forms.labels.required, this.dataTestid = "", this.touched = !1, this.internals = this.attachInternals();
13
13
  }
14
14
  static get formAssociated() {
15
15
  return !0;
16
16
  }
17
17
  manageValidity(t) {
18
- var a, h, r, n, o, p, d, f;
19
- t && (this.required && !this.value ? this.internals.setValidity({ valueMissing: !0 }, l.forms.messages.required, t) : (a = t.validity) != null && a.typeMismatch || (h = t.validity) != null && h.badInput ? this.internals.setValidity({ typeMismatch: !0 }, l.forms.messages.invalid, t) : (r = t.validity) != null && r.patternMismatch ? this.internals.setValidity(
18
+ var a, h, r, l, o, p, d, f;
19
+ t && (this.required && !this.value ? this.internals.setValidity({ valueMissing: !0 }, n.forms.messages.required, t) : (a = t.validity) != null && a.typeMismatch || (h = t.validity) != null && h.badInput ? this.internals.setValidity({ typeMismatch: !0 }, n.forms.messages.invalid, t) : (r = t.validity) != null && r.patternMismatch ? this.internals.setValidity(
20
20
  { patternMismatch: !0 },
21
- l.forms.messages.invalidPattern,
21
+ n.forms.messages.invalidPattern,
22
22
  t
23
- ) : (n = t.validity) != null && n.tooShort || this.minlength && this.minlength > 0 && this.value.length < this.minlength ? this.internals.setValidity({ tooShort: !0 }, l.forms.messages.tooShort, t) : (o = t.validity) != null && o.tooLong || this.maxlength && this.maxlength > 0 && this.value.length > this.maxlength ? this.internals.setValidity({ tooLong: !0 }, l.forms.messages.tooLong, t) : (p = t.validity) != null && p.rangeUnderflow ? this.internals.setValidity(
23
+ ) : (l = t.validity) != null && l.tooShort || this.minlength && this.minlength > 0 && this.value.length < this.minlength ? this.internals.setValidity({ tooShort: !0 }, n.forms.messages.tooShort, t) : (o = t.validity) != null && o.tooLong || this.maxlength && this.maxlength > 0 && this.value.length > this.maxlength ? this.internals.setValidity({ tooLong: !0 }, n.forms.messages.tooLong, t) : (p = t.validity) != null && p.rangeUnderflow ? this.internals.setValidity(
24
24
  { rangeUnderflow: !0 },
25
- l.forms.messages.rangeUnderflow,
25
+ n.forms.messages.rangeUnderflow,
26
26
  t
27
27
  ) : (d = t.validity) != null && d.rangeOverflow ? this.internals.setValidity(
28
28
  { rangeOverflow: !0 },
29
- l.forms.messages.rangeOverflow,
29
+ n.forms.messages.rangeOverflow,
30
30
  t
31
31
  ) : (f = t.validity) != null && f.customError ? this.internals.setValidity({ customError: !0 }, t.validationMessage, t) : this.internals.setValidity({}));
32
32
  }
@@ -44,13 +44,13 @@ class i extends c {
44
44
  // Do not use valueChanged or onChange for radios and checkboxes!
45
45
  valueChecked(t) {
46
46
  if (!this.touched) return;
47
- const a = this.internals.form || this.closest("form");
47
+ const a = this.internals.form || this.closest("form"), h = a ? new FormData(a) : null;
48
48
  a && a.querySelectorAll(
49
49
  `pkt-radiobutton[name=${this.name}], input[type=radio][name=${this.name}]`
50
- ).forEach((h) => {
51
- const r = h;
52
- r.name === this.name && r.value !== this.value && r.checked && (r.checked = !1);
53
- }), typeof t == "string" ? (this.checked = t === "true", this.internals.ariaChecked = t === "true") : typeof t == "boolean" && (this.checked = t, this.internals.ariaChecked = t), this.checked ? (this.internals.setFormValue(this.value || "on", this.value || "on"), this.internals.states.add("--checked")) : (this.internals.setFormValue("", ""), this.internals.states.delete("--checked")), this.dispatchEvent(new Event("change")), this.dispatchEvent(
50
+ ).forEach((r) => {
51
+ const l = r;
52
+ l.name === this.name && l.value !== this.value && l.checked && (l.checked = !1);
53
+ }), typeof t == "string" ? (this.checked = t === "true", this.internals.ariaChecked = t === "true") : typeof t == "boolean" && (this.checked = t, this.internals.ariaChecked = t), this.checked ? (this.internals.setFormValue(this.value || "on", this.value || "on"), h && h.append(this.name, this.value || "on"), this.internals.states.add("--checked")) : (this.internals.setFormValue(null, null), h && h.delete(this.name), this.internals.states.delete("--checked")), this.dispatchEvent(new Event("change", { bubbles: !0, composed: !0 })), this.dispatchEvent(
54
54
  new CustomEvent("value-change", {
55
55
  detail: this.checked,
56
56
  bubbles: !0,
@@ -64,7 +64,7 @@ class i extends c {
64
64
  // When input goes from content to no content
65
65
  clearInputValue() {
66
66
  const t = this.multiple || this.range ? [] : "";
67
- this.value = t, this.internals.setFormValue(t), this.dispatchEvent(new Event("change")), this.dispatchEvent(
67
+ this.value = t, this.internals.setFormValue(t), this.dispatchEvent(new Event("change", { bubbles: !0, composed: !0 })), this.dispatchEvent(
68
68
  new CustomEvent("value-change", {
69
69
  detail: t,
70
70
  bubbles: !0,
@@ -74,15 +74,15 @@ class i extends c {
74
74
  }
75
75
  // When user enters the input, we need to push that event out to the form
76
76
  onFocus() {
77
- this.dispatchEvent(new FocusEvent("focus"));
77
+ this.dispatchEvent(new FocusEvent("focus", { bubbles: !0, composed: !0 }));
78
78
  }
79
79
  // And also when the user leaves the input...
80
80
  onBlur() {
81
- this.dispatchEvent(new FocusEvent("blur"));
81
+ this.dispatchEvent(new FocusEvent("blur", { bubbles: !0, composed: !0 }));
82
82
  }
83
83
  // Trigger this when user types in the input
84
84
  onInput() {
85
- this.dispatchEvent(new InputEvent("input"));
85
+ this.dispatchEvent(new InputEvent("input", { bubbles: !0, composed: !0 }));
86
86
  }
87
87
  // Trigger this when you want to set the value of the input out to the form
88
88
  onChange(t) {
@@ -90,7 +90,7 @@ class i extends c {
90
90
  this.touched = !0, t && this.setFormValue(t);
91
91
  return;
92
92
  }
93
- typeof t != "string" && !Array.isArray(t) || ((this.range || this.multiple) && !Array.isArray(t) && t.includes(",") && (t = t.split(",")), !this.multiple && !this.range && Array.isArray(t) && (t = t[0]), this.setFormValue(t), this.manageValidity(this.inputRef.value), this.inputRefTo && this.manageValidity(this.inputRefTo.value), this.dispatchEvent(new Event("change")), this.dispatchEvent(
93
+ typeof t != "string" && !Array.isArray(t) || ((this.range || this.multiple) && !Array.isArray(t) && t.includes(",") && (t = t.split(",")), !this.multiple && !this.range && Array.isArray(t) && (t = t[0]), this.setFormValue(t), this.manageValidity(this.inputRef.value), this.inputRefTo && this.manageValidity(this.inputRefTo.value), this.dispatchEvent(new Event("change", { bubbles: !0, composed: !0 })), this.dispatchEvent(
94
94
  new CustomEvent("value-change", {
95
95
  detail: t,
96
96
  bubbles: !0,
@@ -0,0 +1 @@
1
+ "use strict";const e=require("./element-BSypUpzA.cjs"),f=require("./state-B5KCNjEd.cjs"),c=require("./stringutils-CkVRq4jP.cjs"),y=require("./input-wrapper-EoSAbU-U.cjs");var m=Object.defineProperty,s=(o,t,a,l)=>{for(var r=void 0,n=o.length-1,h;n>=0;n--)(h=o[n])&&(r=h(t,a,r)||r);return r&&m(t,a,r),r};class i extends e.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.ariaDescribedBy=null,this.ariaLabelledby=null,this.name="",this.pattern=null,this.placeholder=null,this.id=c.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=y.specs.props.helptextDropdownButton.default,this.label=null,this.optionalText=e.translations.forms.labels.optional,this.requiredText=e.translations.forms.labels.required,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(t){var a,l,r,n,h,u,p,d;t&&(this.required&&!this.value?this.internals.setValidity({valueMissing:!0},e.translations.forms.messages.required,t):(a=t.validity)!=null&&a.typeMismatch||(l=t.validity)!=null&&l.badInput?this.internals.setValidity({typeMismatch:!0},e.translations.forms.messages.invalid,t):(r=t.validity)!=null&&r.patternMismatch?this.internals.setValidity({patternMismatch:!0},e.translations.forms.messages.invalidPattern,t):(n=t.validity)!=null&&n.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},e.translations.forms.messages.tooShort,t):(h=t.validity)!=null&&h.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},e.translations.forms.messages.tooLong,t):(u=t.validity)!=null&&u.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},e.translations.forms.messages.rangeUnderflow,t):(p=t.validity)!=null&&p.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},e.translations.forms.messages.rangeOverflow,t):(d=t.validity)!=null&&d.customError?this.internals.setValidity({customError:!0},t.validationMessage,t):this.internals.setValidity({}))}setFormValue(t){if(this.internals)if(Array.isArray(t)){const a=new FormData;t.forEach(l=>{a.append(this.name,l)}),this.internals.setFormValue(a)}else this.internals.setFormValue(t)}valueChecked(t){if(!this.touched)return;const a=this.internals.form||this.closest("form"),l=a?new FormData(a):null;a&&a.querySelectorAll(`pkt-radiobutton[name=${this.name}], input[type=radio][name=${this.name}]`).forEach(r=>{const n=r;n.name===this.name&&n.value!==this.value&&n.checked&&(n.checked=!1)}),typeof t=="string"?(this.checked=t==="true",this.internals.ariaChecked=t==="true"):typeof t=="boolean"&&(this.checked=t,this.internals.ariaChecked=t),this.checked?(this.internals.setFormValue(this.value||"on",this.value||"on"),l&&l.append(this.name,this.value||"on"),this.internals.states.add("--checked")):(this.internals.setFormValue(null,null),l&&l.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(t,a){(a!==this.value||a!==this._value)&&(typeof t=="string"?((this.multiple||this.range)&&t.includes(",")&&(t=t.split(",")),this.value=t,this._value=Array.isArray(t)?t:[t]):Array.isArray(t)?(this.value=this.multiple||this.range?t:t[0],this._value=t):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&a&&a.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(a==null?void 0:a.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate()))}clearInputValue(){const t=this.multiple||this.range?[]:"";this.value=t,this.internals.setFormValue(t),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("value-change",{detail:t,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(t){if(!this.touched){this.touched=!0,t&&this.setFormValue(t);return}typeof t!="string"&&!Array.isArray(t)||((this.range||this.multiple)&&!Array.isArray(t)&&t.includes(",")&&(t=t.split(",")),!this.multiple&&!this.range&&Array.isArray(t)&&(t=t[0]),this.setFormValue(t),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:t,bubbles:!0,composed:!0})),this.internals.reportValidity())}formResetCallback(){this.touched=!1,this._options&&this._options.length&&this._options.forEach(t=>{t.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(t){super.updated(t),t.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(t){if(super.firstUpdated(t),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 a=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=a,this.internals.setFormValue(a?this.value||"on":"",a?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))}}s([e.n()],i.prototype,"defaultValue");s([e.n({type:Boolean,reflect:!0})],i.prototype,"disabled");s([e.n({type:Boolean,reflect:!0})],i.prototype,"readonly");s([e.n({type:Boolean,reflect:!0})],i.prototype,"required");s([e.n({type:Number,reflect:!0})],i.prototype,"max");s([e.n({type:Number,reflect:!0})],i.prototype,"maxlength");s([e.n({type:Number,reflect:!0})],i.prototype,"min");s([e.n({type:Number,reflect:!0})],i.prototype,"minlength");s([e.n({type:String})],i.prototype,"ariaDescribedBy");s([e.n({type:String})],i.prototype,"ariaLabelledby");s([e.n({type:String,reflect:!0})],i.prototype,"name");s([e.n({type:String,reflect:!0})],i.prototype,"pattern");s([e.n({type:String,reflect:!0})],i.prototype,"placeholder");s([e.n({type:String,reflect:!0})],i.prototype,"id");s([e.n({type:Boolean})],i.prototype,"counter");s([e.n({type:Boolean})],i.prototype,"hasError");s([e.n({type:Boolean})],i.prototype,"inline");s([e.n({type:Boolean})],i.prototype,"hasFieldset");s([e.n({type:Boolean})],i.prototype,"optionalTag");s([e.n({type:Boolean})],i.prototype,"requiredTag");s([e.n({type:Boolean})],i.prototype,"skipForwardTestid");s([e.n({type:Boolean,reflect:!1})],i.prototype,"useWrapper");s([e.n({type:Boolean,reflect:!0})],i.prototype,"fullwidth");s([e.n({type:Number})],i.prototype,"counterMaxLength");s([e.n({type:String})],i.prototype,"errorMessage");s([e.n({type:String})],i.prototype,"helptext");s([e.n({type:String})],i.prototype,"helptextDropdown");s([e.n({type:String,reflect:!1})],i.prototype,"helptextDropdownButton");s([e.n({type:String})],i.prototype,"label");s([e.n({type:String,reflect:!1})],i.prototype,"optionalText");s([e.n({type:String,reflect:!1})],i.prototype,"requiredText");s([e.n({type:String,attribute:"data-testid"})],i.prototype,"dataTestid");s([f.r()],i.prototype,"touched");exports.PktInputElement=i;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./button-jdMbbn-e.cjs"),e=t.PktButton;Object.defineProperty(exports,"PktButton",{enumerable:!0,get:()=>t.PktButton});exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./button-C1cqSjK2.cjs"),e=t.PktButton;Object.defineProperty(exports,"PktButton",{enumerable:!0,get:()=>t.PktButton});exports.default=e;
@@ -1,4 +1,4 @@
1
- import { P as t } from "./button-sf_Yzx3X.js";
1
+ import { P as t } from "./button-DoVwr7W4.js";
2
2
  const a = t;
3
3
  export {
4
4
  t as PktButton,
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./checkbox-U8aPrLjG.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-B7ObRUbU.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-Cz3sIWt0.js";
1
+ import { P as o } from "./checkbox-DCjl4VM0.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-ChFttX7F.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-BokBs9Jo.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-CFH5-Ioh.js";
1
+ import { P as o } from "./combobox-CnnTPWcA.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("./consent-BNY1XvpV.cjs"),t=e.PktConsent;Object.defineProperty(exports,"PktConsent",{enumerable:!0,get:()=>e.PktConsent});exports.default=t;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./consent-HOme2Fjt.cjs"),t=e.PktConsent;Object.defineProperty(exports,"PktConsent",{enumerable:!0,get:()=>e.PktConsent});exports.default=t;
@@ -1,4 +1,4 @@
1
- import { P as t } from "./consent-CTX9zf81.js";
1
+ import { P as t } from "./consent-D_uOqrp2.js";
2
2
  const o = t;
3
3
  export {
4
4
  t as PktConsent,
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./datepicker-mhQrHoNJ.cjs"),t=e.PktDatepicker;Object.defineProperty(exports,"PktDatepicker",{enumerable:!0,get:()=>e.PktDatepicker});exports.default=t;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./datepicker-B767w-e9.cjs"),t=e.PktDatepicker;Object.defineProperty(exports,"PktDatepicker",{enumerable:!0,get:()=>e.PktDatepicker});exports.default=t;
@@ -1,4 +1,4 @@
1
- import { P as t } from "./datepicker-hetVXVX4.js";
1
+ import { P as t } from "./datepicker-B-ytA8nG.js";
2
2
  const a = t;
3
3
  export {
4
4
  t as PktDatepicker,
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("./alert-C2EPmB0W.cjs"),l=require("./accordionitem-RFwXQC_0.cjs"),d=require("./backlink-HHM21crL.cjs"),b=require("./button-jdMbbn-e.cjs"),k=require("./calendar-CYY42kN4.cjs"),m=require("./card-DH-3qNgp.cjs"),g=require("./combobox-ChFttX7F.cjs"),h=require("./consent-BNY1XvpV.cjs"),f=require("./checkbox-U8aPrLjG.cjs"),t=require("./element-BSypUpzA.cjs"),y=require("./pkt-slot-controller-Da-RgXfS.cjs"),s=require("./ref-BvbyvXRH.cjs"),O=require("./class-map-DCyaICmy.cjs"),j=require("./datepicker-mhQrHoNJ.cjs"),q=require("./helptext-bMgnhZ1R.cjs"),x=require("./heading-BnJhJDMD.cjs"),C=require("./icon-BnKGwYjj.cjs"),v=require("./input-wrapper-B-f_SotM.cjs"),S=require("./link-BrDbM3GT.cjs"),$=require("./linkcard-s9yoOq90.cjs"),L=require("./loader-Bk4XPiOY.cjs"),_=require("./messagebox-B0kgftoP.cjs"),A=require("./modal-4aQZVxGl.cjs"),B=require("./progressbar-DiRfScnB.cjs"),p=require("./radiobutton-DtL-nc1b.cjs"),T=require("./tag-B9kFYxHg.cjs"),I=require("./textarea-CeUz6coA.cjs"),M=require("./textinput-BArDDwC2.cjs"),R=require("./select-s98KeDqQ.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 y.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 P=require("./alert-C2EPmB0W.cjs"),l=require("./accordionitem-RFwXQC_0.cjs"),d=require("./backlink-HHM21crL.cjs"),b=require("./button-C1cqSjK2.cjs"),k=require("./calendar-CYY42kN4.cjs"),m=require("./card-DH-3qNgp.cjs"),g=require("./combobox-BokBs9Jo.cjs"),h=require("./consent-HOme2Fjt.cjs"),f=require("./checkbox-B7ObRUbU.cjs"),t=require("./element-BSypUpzA.cjs"),y=require("./pkt-slot-controller-Da-RgXfS.cjs"),s=require("./ref-BvbyvXRH.cjs"),O=require("./class-map-DCyaICmy.cjs"),j=require("./datepicker-B767w-e9.cjs"),q=require("./helptext-bMgnhZ1R.cjs"),x=require("./heading-BnJhJDMD.cjs"),C=require("./icon-BnKGwYjj.cjs"),v=require("./input-wrapper-B-f_SotM.cjs"),S=require("./link-BrDbM3GT.cjs"),$=require("./linkcard-s9yoOq90.cjs"),L=require("./loader-Bk4XPiOY.cjs"),_=require("./messagebox-B0kgftoP.cjs"),A=require("./modal-4aQZVxGl.cjs"),B=require("./progressbar-DiRfScnB.cjs"),p=require("./radiobutton-DP6RsaQc.cjs"),T=require("./tag-B9kFYxHg.cjs"),I=require("./textarea-DIZf7CVg.cjs"),M=require("./textinput-DMPRHokX.cjs"),R=require("./select-CQs_BAKs.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 y.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="${O.e(e)}">
3
3
  <h1 class="pkt-txt-28">${this.string}</h1>
4
4
 
package/dist/pkt-index.js CHANGED
@@ -1,18 +1,18 @@
1
1
  import { P as A } from "./alert-C33z1kBf.js";
2
2
  import { P as B, a as E } from "./accordionitem-vmwqD9rr.js";
3
3
  import { P as O } from "./backlink-hvyJmwrO.js";
4
- import { P as T } from "./button-sf_Yzx3X.js";
4
+ import { P as T } from "./button-DoVwr7W4.js";
5
5
  import { c as f } from "./calendar-KDcOWD6V.js";
6
6
  import { P as D } from "./calendar-KDcOWD6V.js";
7
7
  import { P as G } from "./card-Cyww1yKr.js";
8
- import { P as K } from "./combobox-CFH5-Ioh.js";
9
- import { P as U } from "./consent-CTX9zf81.js";
10
- import { P as q } from "./checkbox-Cz3sIWt0.js";
8
+ import { P as K } from "./combobox-CnnTPWcA.js";
9
+ import { P as U } from "./consent-D_uOqrp2.js";
10
+ import { P as q } from "./checkbox-DCjl4VM0.js";
11
11
  import { P as k, t as h, x as P, n, a as c } from "./element-DjjF_tEh.js";
12
12
  import { P as x } from "./pkt-slot-controller-DtDaD9q_.js";
13
13
  import { e as m, n as d } from "./ref-iIffqQAI.js";
14
14
  import { e as u } from "./class-map-KyMqi0fa.js";
15
- import { P as F } from "./datepicker-hetVXVX4.js";
15
+ import { P as F } from "./datepicker-B-ytA8nG.js";
16
16
  import { P as Q } from "./helptext-DcSUjjEq.js";
17
17
  import { P as X } from "./heading-DNLQdsXY.js";
18
18
  import { P as Z } from "./icon-Beoxup8E.js";
@@ -23,11 +23,11 @@ import { P as it } from "./loader-C9EtX_mK.js";
23
23
  import { P as lt } from "./messagebox-DZDP8XZt.js";
24
24
  import { P as mt } from "./modal-m--Sfj_1.js";
25
25
  import { P as ft } from "./progressbar-BKt_aj7f.js";
26
- import { P as ht, P as ct } from "./radiobutton-DtpGqoci.js";
26
+ import { P as ht, P as ct } from "./radiobutton-DKHjKH75.js";
27
27
  import { P as ut } from "./tag-Cu8afZy8.js";
28
- import { P as vt } from "./textarea-C9Kj6gGv.js";
29
- import { P as bt } from "./textinput-Dj6R0L45.js";
30
- import { P as $t } from "./select-CNK8uoVi.js";
28
+ import { P as vt } from "./textarea-DAfViyIl.js";
29
+ import { P as bt } from "./textinput-u-UrLS8U.js";
30
+ import { P as $t } from "./select-ChsSC4Os.js";
31
31
  var g = Object.defineProperty, v = Object.getOwnPropertyDescriptor, s = (t, e, i, a) => {
32
32
  for (var r = a > 1 ? void 0 : a ? v(e, i) : e, p = t.length - 1, l; p >= 0; p--)
33
33
  (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-DtL-nc1b.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-DP6RsaQc.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-DtpGqoci.js";
1
+ import { P as t } from "./radiobutton-DKHjKH75.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-s98KeDqQ.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-CQs_BAKs.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-CNK8uoVi.js";
1
+ import { P as t } from "./select-ChsSC4Os.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-CeUz6coA.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-DIZf7CVg.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-C9Kj6gGv.js";
1
+ import { P as a } from "./textarea-DAfViyIl.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-BArDDwC2.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-DMPRHokX.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-Dj6R0L45.js";
1
+ import { P as t } from "./textinput-u-UrLS8U.js";
2
2
  const p = t;
3
3
  export {
4
4
  t as PktTextinput,
@@ -1,6 +1,6 @@
1
1
  import { E as n, x as r, n as s, a as o } from "./element-DjjF_tEh.js";
2
2
  import { r as k } from "./state-BtbpSrdV.js";
3
- import { P as f } from "./input-element-aQDMXDVQ.js";
3
+ import { P as f } from "./input-element-B5EvsMww.js";
4
4
  import { e as _, n as b } from "./ref-iIffqQAI.js";
5
5
  import { e as a } from "./class-map-KyMqi0fa.js";
6
6
  var C = Object.defineProperty, v = Object.getOwnPropertyDescriptor, i = (e, t, l, p) => {
@@ -1,4 +1,4 @@
1
- "use strict";const t=require("./element-BSypUpzA.cjs"),a=require("./state-B5KCNjEd.cjs"),p=require("./input-element-XmmyUZmB.cjs"),d=require("./ref-BvbyvXRH.cjs"),o=require("./class-map-DCyaICmy.cjs");var k=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=(u,e,c,s)=>{for(var h=s>1?void 0:s?r(e,c):e,n=u.length-1,l;n>=0;n--)(l=u[n])&&(h=(s?l(e,c,h):l(h))||h);return s&&h&&k(e,c,h),h};exports.PktRadioButton=class extends p.PktInputElement{constructor(){super(...arguments),this.inputRef=d.e(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.checked=null,this.type="radio",this._checked=!1}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,c,s){e==="defaultChecked"&&(this._checked=this.defaultChecked),e==="checked"&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(e,c,s)}updated(e){e.has("checked")&&this.checked!==null&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0,(e.get("checked")===""||e.get("checked")==="true"||e.get("checked")===!0)!==this._checked&&this.toggleChecked()),super.updated(e)}render(){const e=o.e({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),c=o.e({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError});return t.x`
1
+ "use strict";const t=require("./element-BSypUpzA.cjs"),a=require("./state-B5KCNjEd.cjs"),p=require("./input-element-KzKpjjLc.cjs"),d=require("./ref-BvbyvXRH.cjs"),o=require("./class-map-DCyaICmy.cjs");var k=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=(u,e,c,s)=>{for(var h=s>1?void 0:s?r(e,c):e,n=u.length-1,l;n>=0;n--)(l=u[n])&&(h=(s?l(e,c,h):l(h))||h);return s&&h&&k(e,c,h),h};exports.PktRadioButton=class extends p.PktInputElement{constructor(){super(...arguments),this.inputRef=d.e(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.checked=null,this.type="radio",this._checked=!1}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,c,s){e==="defaultChecked"&&(this._checked=this.defaultChecked),e==="checked"&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(e,c,s)}updated(e){e.has("checked")&&this.checked!==null&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0,(e.get("checked")===""||e.get("checked")==="true"||e.get("checked")===!0)!==this._checked&&this.toggleChecked()),super.updated(e)}render(){const e=o.e({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),c=o.e({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError});return t.x`
2
2
  <div class="pkt-input-check">
3
3
  <div class=${e}>
4
4
  <input
@@ -1,4 +1,4 @@
1
- "use strict";const r=require("./element-BSypUpzA.cjs"),u=require("./state-B5KCNjEd.cjs"),l=require("./ref-BvbyvXRH.cjs"),o=require("./if-defined-a3sotaUr.cjs"),d=require("./input-element-XmmyUZmB.cjs"),c=require("./pkt-options-controller-Ay9ELZTV.cjs"),$=require("./pkt-slot-controller-Da-RgXfS.cjs");require("./input-wrapper-B-f_SotM.cjs");var b=Object.defineProperty,v=Object.getOwnPropertyDescriptor,n=(a,e,t,i)=>{for(var s=i>1?void 0:i?v(e,t):e,p=a.length-1,h;p>=0;p--)(h=a[p])&&(s=(i?h(e,t,s):h(s))||s);return i&&s&&b(e,t,s),s};exports.PktSelect=class extends d.PktInputElement{constructor(){super(),this.inputRef=l.e(),this.helptextSlot=l.e(),this.options=[],this.value="",this._options=[],this.optionsController=new c.PktOptionsSlotController(this),this.slotController=new $.PktSlotController(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){super.connectedCallback();const e=this.options.length>0,t=this.optionsController.nodes.length&&this.optionsController.nodes.length>0;!e&&t?this.optionsController.nodes.forEach(i=>{const s={value:i.getAttribute("value")||i.textContent||"",label:i.textContent||i.getAttribute("value")||"",disabled:!!i.getAttribute("disabled")};i.getAttribute("selected")&&!this.value&&(this.value=s.value),this._options.push(s)}):this._options=this.options}attributeChangedCallback(e,t,i){e==="options"&&(this._options=i?JSON.parse(i):[]),e==="value"&&this.value!==t&&this.valueChanged(i,t),super.attributeChangedCallback(e,t,i)}updated(e){var t;super.updated(e),e.has("value")&&(this.counterCurrent=((t=this.value)==null?void 0:t.length)||0,this.valueChanged(this.value,e.get("value"))),e.has("id")&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(e){super.firstUpdated(e),this.options.length&&(this._options=this.options)}render(){const e=`pkt-input ${this.fullwidth?"pkt-input--fullwidth":""}`;return r.x`
1
+ "use strict";const r=require("./element-BSypUpzA.cjs"),u=require("./state-B5KCNjEd.cjs"),l=require("./ref-BvbyvXRH.cjs"),o=require("./if-defined-a3sotaUr.cjs"),d=require("./input-element-KzKpjjLc.cjs"),c=require("./pkt-options-controller-Ay9ELZTV.cjs"),$=require("./pkt-slot-controller-Da-RgXfS.cjs");require("./input-wrapper-B-f_SotM.cjs");var b=Object.defineProperty,v=Object.getOwnPropertyDescriptor,n=(a,e,t,i)=>{for(var s=i>1?void 0:i?v(e,t):e,p=a.length-1,h;p>=0;p--)(h=a[p])&&(s=(i?h(e,t,s):h(s))||s);return i&&s&&b(e,t,s),s};exports.PktSelect=class extends d.PktInputElement{constructor(){super(),this.inputRef=l.e(),this.helptextSlot=l.e(),this.options=[],this.value="",this._options=[],this.optionsController=new c.PktOptionsSlotController(this),this.slotController=new $.PktSlotController(this,this.helptextSlot),this.slotController.skipOptions=!0}connectedCallback(){super.connectedCallback();const e=this.options.length>0,t=this.optionsController.nodes.length&&this.optionsController.nodes.length>0;!e&&t?this.optionsController.nodes.forEach(i=>{const s={value:i.getAttribute("value")||i.textContent||"",label:i.textContent||i.getAttribute("value")||"",disabled:!!i.getAttribute("disabled")};i.getAttribute("selected")&&!this.value&&(this.value=s.value),this._options.push(s)}):this._options=this.options}attributeChangedCallback(e,t,i){e==="options"&&(this._options=i?JSON.parse(i):[]),e==="value"&&this.value!==t&&this.valueChanged(i,t),super.attributeChangedCallback(e,t,i)}updated(e){var t;super.updated(e),e.has("value")&&(this.counterCurrent=((t=this.value)==null?void 0:t.length)||0,this.valueChanged(this.value,e.get("value"))),e.has("id")&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(e){super.firstUpdated(e),this.options.length&&(this._options=this.options)}render(){const e=`pkt-input ${this.fullwidth?"pkt-input--fullwidth":""}`;return r.x`
2
2
  <pkt-input-wrapper
3
3
  ?counter=${this.counter}
4
4
  ?disabled=${this.disabled}
@@ -2,7 +2,7 @@ import { x as h, n as c, a as $ } from "./element-DjjF_tEh.js";
2
2
  import { r as b } from "./state-BtbpSrdV.js";
3
3
  import { e as u, n as d } from "./ref-iIffqQAI.js";
4
4
  import { o as s } from "./if-defined-BErSJCeJ.js";
5
- import { P as v } from "./input-element-aQDMXDVQ.js";
5
+ import { P as v } from "./input-element-B5EvsMww.js";
6
6
  import { P as f } from "./pkt-options-controller-DepYQBqb.js";
7
7
  import { P as m } from "./pkt-slot-controller-DtDaD9q_.js";
8
8
  import "./input-wrapper-BdeoMGnk.js";
@@ -5,7 +5,7 @@ import { e as m, n as c } from "./ref-iIffqQAI.js";
5
5
  import { e as v } from "./class-map-KyMqi0fa.js";
6
6
  import { e as b, i as T, t as a } from "./directive-oAbCiebi.js";
7
7
  import { f as y, m as w } from "./directive-helpers-8uS_Izwn.js";
8
- import { P as C } from "./input-element-aQDMXDVQ.js";
8
+ import { P as C } from "./input-element-B5EvsMww.js";
9
9
  import { P as E } from "./pkt-slot-controller-DtDaD9q_.js";
10
10
  import "./input-wrapper-BdeoMGnk.js";
11
11
  import "./icon-Beoxup8E.js";
@@ -1,4 +1,4 @@
1
- "use strict";const s=require("./element-BSypUpzA.cjs"),p=require("./if-defined-a3sotaUr.cjs"),c=require("./state-B5KCNjEd.cjs"),l=require("./ref-BvbyvXRH.cjs"),$=require("./class-map-DCyaICmy.cjs"),a=require("./directive-C7oCP5Bh.cjs"),d=require("./directive-helpers-CG7Oxal3.cjs"),x=require("./input-element-XmmyUZmB.cjs"),T=require("./pkt-slot-controller-Da-RgXfS.cjs");require("./input-wrapper-B-f_SotM.cjs");require("./icon-BnKGwYjj.cjs");/**
1
+ "use strict";const s=require("./element-BSypUpzA.cjs"),p=require("./if-defined-a3sotaUr.cjs"),c=require("./state-B5KCNjEd.cjs"),l=require("./ref-BvbyvXRH.cjs"),$=require("./class-map-DCyaICmy.cjs"),a=require("./directive-C7oCP5Bh.cjs"),d=require("./directive-helpers-CG7Oxal3.cjs"),x=require("./input-element-KzKpjjLc.cjs"),T=require("./pkt-slot-controller-Da-RgXfS.cjs");require("./input-wrapper-B-f_SotM.cjs");require("./icon-BnKGwYjj.cjs");/**
2
2
  * @license
3
3
  * Copyright 2020 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
@@ -1,4 +1,4 @@
1
- "use strict";const t=require("./element-BSypUpzA.cjs"),u=require("./if-defined-a3sotaUr.cjs"),l=require("./state-B5KCNjEd.cjs"),a=require("./ref-BvbyvXRH.cjs"),c=require("./class-map-DCyaICmy.cjs"),d=require("./input-element-XmmyUZmB.cjs"),x=require("./pkt-slot-controller-Da-RgXfS.cjs");require("./input-wrapper-B-f_SotM.cjs");require("./icon-BnKGwYjj.cjs");var $=Object.defineProperty,f=Object.getOwnPropertyDescriptor,r=(h,i,s,n)=>{for(var e=n>1?void 0:n?f(i,s):i,o=h.length-1,p;o>=0;o--)(p=h[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=a.e(),this.helptextSlot=a.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-BSypUpzA.cjs"),u=require("./if-defined-a3sotaUr.cjs"),l=require("./state-B5KCNjEd.cjs"),a=require("./ref-BvbyvXRH.cjs"),c=require("./class-map-DCyaICmy.cjs"),d=require("./input-element-KzKpjjLc.cjs"),x=require("./pkt-slot-controller-Da-RgXfS.cjs");require("./input-wrapper-B-f_SotM.cjs");require("./icon-BnKGwYjj.cjs");var $=Object.defineProperty,f=Object.getOwnPropertyDescriptor,r=(h,i,s,n)=>{for(var e=n>1?void 0:n?f(i,s):i,o=h.length-1,p;o>=0;o--)(p=h[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=a.e(),this.helptextSlot=a.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}
@@ -3,7 +3,7 @@ import { o as c } from "./if-defined-BErSJCeJ.js";
3
3
  import { r as f } from "./state-BtbpSrdV.js";
4
4
  import { e as d, n as m } from "./ref-iIffqQAI.js";
5
5
  import { e as g } from "./class-map-KyMqi0fa.js";
6
- import { P as x } from "./input-element-aQDMXDVQ.js";
6
+ import { P as x } from "./input-element-B5EvsMww.js";
7
7
  import { P as y } from "./pkt-slot-controller-DtDaD9q_.js";
8
8
  import "./input-wrapper-BdeoMGnk.js";
9
9
  import "./icon-Beoxup8E.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-elements",
3
- "version": "12.37.2",
3
+ "version": "12.37.4",
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",
@@ -59,5 +59,5 @@
59
59
  "url": "https://github.com/oslokommune/punkt/issues"
60
60
  },
61
61
  "license": "MIT",
62
- "gitHead": "d6608a66551554a1f07952e1c1f7ffe414190a54"
62
+ "gitHead": "d3af62954c720832c6aa2d39cc43689ec548465b"
63
63
  }
@@ -5,6 +5,7 @@ import { html, nothing, PropertyValues } from 'lit'
5
5
  import { property, customElement } from 'lit/decorators.js'
6
6
  import { createRef, Ref, ref } from 'lit/directives/ref.js'
7
7
 
8
+ type Booleanish = boolean | 'true' | 'false'
8
9
  export type TPktButtonMode = 'light' | 'dark'
9
10
  export type TPktButtonSize = 'small' | 'medium' | 'large'
10
11
  export type TPktButtonColor =
@@ -40,8 +41,8 @@ export interface IPktButton {
40
41
  variant?: TPktButtonVariant
41
42
  state?: TPktButtonState
42
43
  type?: TPktButtonType
43
- isLoading?: boolean
44
- disabled?: boolean
44
+ isLoading?: Booleanish
45
+ disabled?: Booleanish
45
46
  }
46
47
  @customElement('pkt-button')
47
48
  export class PktButton extends PktElement<IPktButton> implements IPktButton {
@@ -65,10 +66,10 @@ export class PktButton extends PktElement<IPktButton> implements IPktButton {
65
66
  @property({ type: String }) color?: TPktButtonColor
66
67
  @property({ type: String }) skin: TPktButtonSkin = 'primary'
67
68
  @property({ type: String }) variant: TPktButtonVariant = 'label-only'
68
- @property({ type: String, reflect: true }) state?: TPktButtonState = 'normal'
69
+ @property({ type: String }) state?: TPktButtonState = 'normal'
69
70
  @property({ type: String, reflect: true }) type: TPktButtonType = 'button'
70
- @property({ type: Boolean, reflect: true }) isLoading: boolean = false
71
- @property({ type: Boolean, reflect: true }) disabled: boolean = false
71
+ @property({ type: Boolean }) isLoading: Booleanish = false
72
+ @property({ type: Boolean }) disabled: Booleanish = false
72
73
 
73
74
  // Lifecycle
74
75
 
@@ -78,12 +79,41 @@ export class PktButton extends PktElement<IPktButton> implements IPktButton {
78
79
  this.removeEventListener('keydown', this.handleKeydown as EventListener)
79
80
  }
80
81
 
82
+ attributeChangedCallback(name: string, _old: string | null, value: string | null): void {
83
+ super.attributeChangedCallback(name, _old, value)
84
+ // Convert strings to booleans
85
+ if (name === 'disabled' && value === 'false') {
86
+ this.disabled = false
87
+ }
88
+ if ((name === 'isloading' || name === 'isLoading') && value === 'false') {
89
+ this.isLoading = false
90
+ }
91
+ }
92
+
93
+ protected firstUpdated(_changedProperties: PropertyValues): void {
94
+ super.firstUpdated(_changedProperties)
95
+
96
+ if (this.disabled === 'false') {
97
+ this.disabled = false
98
+ }
99
+ if (this.isLoading === 'false') {
100
+ this.isLoading = false
101
+ }
102
+ }
103
+
81
104
  protected updated(_changedProperties: PropertyValues): void {
82
105
  super.updated(_changedProperties)
83
106
 
84
107
  this.setAttribute('role', 'button')
85
108
  this.internals.role = 'button'
86
109
 
110
+ if (this.disabled === 'false') {
111
+ this.disabled = false
112
+ }
113
+ if (this.isLoading === 'false') {
114
+ this.isLoading = false
115
+ }
116
+
87
117
  if (this.disabled) {
88
118
  if (this.getAttribute('tabindex') !== '-1') {
89
119
  this.setAttribute('tabindex', '-1')
@@ -165,7 +195,7 @@ export class PktButton extends PktElement<IPktButton> implements IPktButton {
165
195
  }
166
196
 
167
197
  if (this.type === 'submit' && this.internals.form) {
168
- this.internals.form.requestSubmit()
198
+ this.internals.form.requestSubmit(this)
169
199
 
170
200
  return
171
201
  }
@@ -1,12 +0,0 @@
1
- "use strict";const e=require("./element-BSypUpzA.cjs"),h=require("./pkt-slot-controller-Da-RgXfS.cjs"),d=require("./ref-BvbyvXRH.cjs");var p=Object.defineProperty,u=Object.getOwnPropertyDescriptor,i=(r,t,s,o)=>{for(var n=o>1?void 0:o?u(t,s):t,a=r.length-1,l;a>=0;a--)(l=r[a])&&(n=(o?l(t,s,n):l(n))||n);return o&&n&&p(t,s,n),n};exports.PktButton=class extends e.PktElement{constructor(){super(),this.internals=this.attachInternals(),this.defaultSlot=d.e(),this.iconName="user",this.secondIconName="user",this.mode="light",this.size="medium",this.skin="primary",this.variant="label-only",this.state="normal",this.type="button",this.isLoading=!1,this.disabled=!1,this.slotController=new h.PktSlotController(this,this.defaultSlot),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeydown)}updated(t){super.updated(t),this.setAttribute("role","button"),this.internals.role="button",this.disabled?(this.getAttribute("tabindex")!=="-1"&&this.setAttribute("tabindex","-1"),this.getAttribute("aria-disabled")!=="true"&&this.setAttribute("aria-disabled","true")):(this.getAttribute("tabindex")!=="0"&&this.setAttribute("tabindex","0"),this.getAttribute("aria-disabled")!=="false"&&this.removeAttribute("aria-disabled")),this.isLoading?this.getAttribute("aria-busy")!=="true"&&this.setAttribute("aria-busy","true"):this.hasAttribute("aria-busy")&&this.removeAttribute("aria-busy"),this.updateElementClasses()}render(){return e.x`
2
- <div class="pkt-contents">
3
- ${this.isLoading?e.x`<pkt-icon
4
- class="pkt-btn__icon pkt-btn__spinner"
5
- name="spinner-blue"
6
- path="https://punkt-cdn.oslo.kommune.no/latest/animations/"
7
- ></pkt-icon>`:e.E}
8
- ${this.variant!=="label-only"?e.x`<pkt-icon class="pkt-btn__icon pkt-icon" name=${this.iconName}></pkt-icon>`:e.E}
9
- <span class="pkt-btn__text" ${d.n(this.defaultSlot)}></span>
10
- ${this.variant==="icons-right-and-left"?e.x`<pkt-icon class="pkt-btn__icon" name=${this.secondIconName}></pkt-icon>`:e.E}
11
- </div>
12
- `}updateElementClasses(){const t=new Set,s=this.getAttribute("class");t.add("pkt-btn"),s&&s.split(" ").forEach(o=>t.add(o)),this.size&&t.add(`pkt-btn--${this.size}`),this.skin&&t.add(`pkt-btn--${this.skin}`),this.variant&&t.add(`pkt-btn--${this.variant}`),this.color&&t.add(`pkt-btn--${this.color}`),this.isLoading&&t.add("pkt-btn--active"),this.state&&t.add(`pkt-btn--${this.state}`),this.disabled&&t.add("pkt-btn--disabled"),this.className=[...t].join(" ")}handleClick(t){if(this.disabled||this.isLoading){t.preventDefault(),t.stopImmediatePropagation();return}if(this.type==="submit"&&this.internals.form){this.internals.form.requestSubmit();return}if(this.type==="reset"&&this.internals.form){this.internals.form.reset();return}this.onClick&&typeof this.onClick=="function"&&this.onClick!==this.handleClick&&this.onClick(t),this.dispatchEvent(new CustomEvent("button-click",{bubbles:!0,composed:!0,detail:{originalEvent:t}}))}handleKeydown(t){if(!(this.disabled||this.isLoading)&&(t.key==="Enter"||t.key===" ")){t.preventDefault();const s=t.target;s&&s.click()}}};exports.PktButton.formAssociated=!0;i([e.n({type:String})],exports.PktButton.prototype,"iconName",2);i([e.n({type:String})],exports.PktButton.prototype,"secondIconName",2);i([e.n({type:String})],exports.PktButton.prototype,"mode",2);i([e.n({type:String})],exports.PktButton.prototype,"size",2);i([e.n({type:String})],exports.PktButton.prototype,"color",2);i([e.n({type:String})],exports.PktButton.prototype,"skin",2);i([e.n({type:String})],exports.PktButton.prototype,"variant",2);i([e.n({type:String,reflect:!0})],exports.PktButton.prototype,"state",2);i([e.n({type:String,reflect:!0})],exports.PktButton.prototype,"type",2);i([e.n({type:Boolean,reflect:!0})],exports.PktButton.prototype,"isLoading",2);i([e.n({type:Boolean,reflect:!0})],exports.PktButton.prototype,"disabled",2);exports.PktButton=i([e.t("pkt-button")],exports.PktButton);
@@ -1 +0,0 @@
1
- "use strict";const e=require("./element-BSypUpzA.cjs"),f=require("./state-B5KCNjEd.cjs"),c=require("./stringutils-CkVRq4jP.cjs"),y=require("./input-wrapper-EoSAbU-U.cjs");var m=Object.defineProperty,s=(o,t,a,n)=>{for(var r=void 0,l=o.length-1,h;l>=0;l--)(h=o[l])&&(r=h(t,a,r)||r);return r&&m(t,a,r),r};class i extends e.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.ariaDescribedBy=null,this.ariaLabelledby=null,this.name="",this.pattern=null,this.placeholder=null,this.id=c.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=y.specs.props.helptextDropdownButton.default,this.label=null,this.optionalText=e.translations.forms.labels.optional,this.requiredText=e.translations.forms.labels.required,this.dataTestid="",this.touched=!1,this.internals=this.attachInternals()}static get formAssociated(){return!0}manageValidity(t){var a,n,r,l,h,u,p,d;t&&(this.required&&!this.value?this.internals.setValidity({valueMissing:!0},e.translations.forms.messages.required,t):(a=t.validity)!=null&&a.typeMismatch||(n=t.validity)!=null&&n.badInput?this.internals.setValidity({typeMismatch:!0},e.translations.forms.messages.invalid,t):(r=t.validity)!=null&&r.patternMismatch?this.internals.setValidity({patternMismatch:!0},e.translations.forms.messages.invalidPattern,t):(l=t.validity)!=null&&l.tooShort||this.minlength&&this.minlength>0&&this.value.length<this.minlength?this.internals.setValidity({tooShort:!0},e.translations.forms.messages.tooShort,t):(h=t.validity)!=null&&h.tooLong||this.maxlength&&this.maxlength>0&&this.value.length>this.maxlength?this.internals.setValidity({tooLong:!0},e.translations.forms.messages.tooLong,t):(u=t.validity)!=null&&u.rangeUnderflow?this.internals.setValidity({rangeUnderflow:!0},e.translations.forms.messages.rangeUnderflow,t):(p=t.validity)!=null&&p.rangeOverflow?this.internals.setValidity({rangeOverflow:!0},e.translations.forms.messages.rangeOverflow,t):(d=t.validity)!=null&&d.customError?this.internals.setValidity({customError:!0},t.validationMessage,t):this.internals.setValidity({}))}setFormValue(t){if(this.internals)if(Array.isArray(t)){const a=new FormData;t.forEach(n=>{a.append(this.name,n)}),this.internals.setFormValue(a)}else this.internals.setFormValue(t)}valueChecked(t){if(!this.touched)return;const a=this.internals.form||this.closest("form");a&&a.querySelectorAll(`pkt-radiobutton[name=${this.name}], input[type=radio][name=${this.name}]`).forEach(n=>{const r=n;r.name===this.name&&r.value!==this.value&&r.checked&&(r.checked=!1)}),typeof t=="string"?(this.checked=t==="true",this.internals.ariaChecked=t==="true"):typeof t=="boolean"&&(this.checked=t,this.internals.ariaChecked=t),this.checked?(this.internals.setFormValue(this.value||"on",this.value||"on"),this.internals.states.add("--checked")):(this.internals.setFormValue("",""),this.internals.states.delete("--checked")),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:this.checked,bubbles:!0,composed:!0})),this.internals.reportValidity()}valueChanged(t,a){(a!==this.value||a!==this._value)&&(typeof t=="string"?((this.multiple||this.range)&&t.includes(",")&&(t=t.split(",")),this.value=t,this._value=Array.isArray(t)?t:[t]):Array.isArray(t)?(this.value=this.multiple||this.range?t:t[0],this._value=t):(this.value="",this._value=[]),(!this.value||this.value.length===0)&&a&&a.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(a==null?void 0:a.toString())&&this.onChange(this.value),this.updateComplete.then(()=>this.requestUpdate()))}clearInputValue(){const t=this.multiple||this.range?[]:"";this.value=t,this.internals.setFormValue(t),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0}))}onFocus(){this.dispatchEvent(new FocusEvent("focus"))}onBlur(){this.dispatchEvent(new FocusEvent("blur"))}onInput(){this.dispatchEvent(new InputEvent("input"))}onChange(t){if(!this.touched){this.touched=!0,t&&this.setFormValue(t);return}typeof t!="string"&&!Array.isArray(t)||((this.range||this.multiple)&&!Array.isArray(t)&&t.includes(",")&&(t=t.split(",")),!this.multiple&&!this.range&&Array.isArray(t)&&(t=t[0]),this.setFormValue(t),this.manageValidity(this.inputRef.value),this.inputRefTo&&this.manageValidity(this.inputRefTo.value),this.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("value-change",{detail:t,bubbles:!0,composed:!0})),this.internals.reportValidity())}formResetCallback(){this.touched=!1,this._options&&this._options.length&&this._options.forEach(t=>{t.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(t){super.updated(t),t.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(t){if(super.firstUpdated(t),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 a=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=a,this.internals.setFormValue(a?this.value||"on":"",a?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))}}s([e.n()],i.prototype,"defaultValue");s([e.n({type:Boolean,reflect:!0})],i.prototype,"disabled");s([e.n({type:Boolean,reflect:!0})],i.prototype,"readonly");s([e.n({type:Boolean,reflect:!0})],i.prototype,"required");s([e.n({type:Number,reflect:!0})],i.prototype,"max");s([e.n({type:Number,reflect:!0})],i.prototype,"maxlength");s([e.n({type:Number,reflect:!0})],i.prototype,"min");s([e.n({type:Number,reflect:!0})],i.prototype,"minlength");s([e.n({type:String})],i.prototype,"ariaDescribedBy");s([e.n({type:String})],i.prototype,"ariaLabelledby");s([e.n({type:String,reflect:!0})],i.prototype,"name");s([e.n({type:String,reflect:!0})],i.prototype,"pattern");s([e.n({type:String,reflect:!0})],i.prototype,"placeholder");s([e.n({type:String,reflect:!0})],i.prototype,"id");s([e.n({type:Boolean})],i.prototype,"counter");s([e.n({type:Boolean})],i.prototype,"hasError");s([e.n({type:Boolean})],i.prototype,"inline");s([e.n({type:Boolean})],i.prototype,"hasFieldset");s([e.n({type:Boolean})],i.prototype,"optionalTag");s([e.n({type:Boolean})],i.prototype,"requiredTag");s([e.n({type:Boolean})],i.prototype,"skipForwardTestid");s([e.n({type:Boolean,reflect:!1})],i.prototype,"useWrapper");s([e.n({type:Boolean,reflect:!0})],i.prototype,"fullwidth");s([e.n({type:Number})],i.prototype,"counterMaxLength");s([e.n({type:String})],i.prototype,"errorMessage");s([e.n({type:String})],i.prototype,"helptext");s([e.n({type:String})],i.prototype,"helptextDropdown");s([e.n({type:String,reflect:!1})],i.prototype,"helptextDropdownButton");s([e.n({type:String})],i.prototype,"label");s([e.n({type:String,reflect:!1})],i.prototype,"optionalText");s([e.n({type:String,reflect:!1})],i.prototype,"requiredText");s([e.n({type:String,attribute:"data-testid"})],i.prototype,"dataTestid");s([f.r()],i.prototype,"touched");exports.PktInputElement=i;