@oslokommune/punkt-elements 13.15.2 → 13.15.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,23 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
5
5
 
6
6
  ---
7
7
 
8
+ ## [13.15.3](https://github.com/oslokommune/punkt/compare/13.15.2...13.15.3) (2025-11-10)
9
+
10
+ ### ⚠ BREAKING CHANGES
11
+ Ingen
12
+
13
+ ### Features
14
+ Ingen
15
+
16
+ ### Bug Fixes
17
+ Ingen
18
+
19
+ ### Chores
20
+ Ingen
21
+
22
+ ---
23
+
24
+
8
25
  ## [13.15.2](https://github.com/oslokommune/punkt/compare/13.15.1...13.15.2) (2025-11-07)
9
26
 
10
27
  ### ⚠ BREAKING CHANGES
@@ -0,0 +1,31 @@
1
+ "use strict";const t=require("./element-CJ_QKaki.cjs"),r=require("./input-element-j9znzLWz.cjs"),o=require("./ref-BFa5Utho.cjs"),n=require("./class-map-C_erArZz.cjs");var k=Object.defineProperty,u=Object.getOwnPropertyDescriptor,i=(p,e,h,c)=>{for(var s=c>1?void 0:c?u(e,h):e,l=p.length-1,a;l>=0;l--)(a=p[l])&&(s=(c?a(e,h,s):a(s))||s);return c&&s&&k(e,h,s),s};exports.PktCheckbox=class extends r.PktInputElement{constructor(){super(...arguments),this.inputRef=o.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",this.tagText=null,this.optionalTag=!1,this.optionalText="Valgfritt",this.requiredTag=!1,this.requiredText="Må fylles ut"}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,h,c){e==="defaultChecked"&&!this.checked&&(this.checked=this.defaultChecked),e==="checked"&&(this.checked=this.checked===""||this.checked==="true"||this.checked===!0,this.inputRef.value&&(this.inputRef.value.checked=this.checked)),super.attributeChangedCallback(e,h,c)}firstUpdated(e){e.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),super.firstUpdated(e)}updated(e){e.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),e.has("checked")&&this.inputRef.value&&(this.inputRef.value.checked=this.checked===""||this.checked==="true"||this.checked===!0),super.updated(e)}render(){const e=n.e({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),h=n.e({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),c=n.e({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-input-check__input-label--left":this.labelPosition==="left","pkt-input-check__input-label--right":this.labelPosition==="right","pkt-sr-only":this.hideLabel}),s="pkt-tag pkt-tag--small pkt-tag--thin-text",l=()=>t.x`
2
+ ${this.tagText?t.x`<span class=${s+" pkt-tag--gray"}>${this.tagText}</span>`:t.E}
3
+ ${this.optionalTag?t.x`<span class=${s+" pkt-tag--blue-light"}>${this.optionalText}</span>`:t.E}
4
+ ${this.requiredTag?t.x`<span class=${s+" pkt-tag--beige"}>${this.requiredText}</span>`:t.E}
5
+ `,a=()=>t.x`
6
+ <label class=${c} for=${this.id+"-internal"}>
7
+ ${this.label} ${l()}
8
+ ${this.checkHelptext?t.x`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:t.E}
9
+ </label>
10
+ `;return t.x`
11
+ <div class="pkt-input-check">
12
+ <div class=${e}>
13
+ ${this.labelPosition==="left"?a():t.E}
14
+ <input
15
+ id=${this.id+"-internal"}
16
+ class=${h}
17
+ type="checkbox"
18
+ ?disabled=${this.disabled}
19
+ name=${this.name+"-internal"}
20
+ ${o.n(this.inputRef)}
21
+ @change=${this.handleChange}
22
+ @click=${this.handleClick}
23
+ @blur=${this.onBlur}
24
+ @focus=${this.onFocus}
25
+ ?checked=${this.checked}
26
+ role=${this.isSwitch?"switch":"checkbox"}
27
+ />
28
+ ${this.labelPosition==="right"?a():t.E}
29
+ </div>
30
+ </div>
31
+ `}handleClick(e){if(this.disabled)return e.preventDefault(),e.stopImmediatePropagation(),!1}handleChange(e){if(this.disabled)return e.preventDefault(),e.stopImmediatePropagation(),!1;this.toggleChecked(e)}toggleChecked(e){if(this.disabled){e.preventDefault(),e.stopImmediatePropagation();return}const h=e.target;if(h&&h.disabled){e.preventDefault(),e.stopImmediatePropagation();return}e.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this.checked=this.inputRef.value.matches(":checked"),this.valueChecked(this.checked))}};i([t.n({type:String,reflect:!0})],exports.PktCheckbox.prototype,"value",2);i([t.n({type:String})],exports.PktCheckbox.prototype,"checkHelptext",2);i([t.n({type:Boolean})],exports.PktCheckbox.prototype,"defaultChecked",2);i([t.n({type:Boolean})],exports.PktCheckbox.prototype,"hasTile",2);i([t.n({type:Boolean})],exports.PktCheckbox.prototype,"isSwitch",2);i([t.n({type:String})],exports.PktCheckbox.prototype,"labelPosition",2);i([t.n({type:Boolean})],exports.PktCheckbox.prototype,"hideLabel",2);i([t.n({type:Boolean,reflect:!0})],exports.PktCheckbox.prototype,"checked",2);i([t.n({type:String,reflect:!0})],exports.PktCheckbox.prototype,"type",2);i([t.n({type:String})],exports.PktCheckbox.prototype,"tagText",2);i([t.n({type:Boolean})],exports.PktCheckbox.prototype,"optionalTag",2);i([t.n({type:String})],exports.PktCheckbox.prototype,"optionalText",2);i([t.n({type:Boolean})],exports.PktCheckbox.prototype,"requiredTag",2);i([t.n({type:String})],exports.PktCheckbox.prototype,"requiredText",2);exports.PktCheckbox=i([t.t("pkt-checkbox")],exports.PktCheckbox);
@@ -1,11 +1,11 @@
1
- import { E as n, x as c, n as s, a as u } from "./element-CRDRygXu.js";
1
+ import { E as o, x as p, n as s, a as u } from "./element-CRDRygXu.js";
2
2
  import { P as k } from "./input-element-BcFmygSF.js";
3
3
  import { e as f, n as g } from "./ref-Xa5dbh--.js";
4
4
  import { e as d } from "./class-map-wy7PUk0P.js";
5
- var b = Object.defineProperty, y = Object.getOwnPropertyDescriptor, i = (t, a, p, h) => {
6
- for (var l = h > 1 ? void 0 : h ? y(a, p) : a, o = t.length - 1, r; o >= 0; o--)
7
- (r = t[o]) && (l = (h ? r(a, p, l) : r(l)) || l);
8
- return h && l && b(a, p, l), l;
5
+ var b = Object.defineProperty, y = Object.getOwnPropertyDescriptor, i = (t, a, c, l) => {
6
+ for (var h = l > 1 ? void 0 : l ? y(a, c) : a, n = t.length - 1, r; n >= 0; n--)
7
+ (r = t[n]) && (h = (l ? r(a, c, h) : r(h)) || h);
8
+ return l && h && b(a, c, h), h;
9
9
  };
10
10
  let e = class extends k {
11
11
  constructor() {
@@ -14,14 +14,14 @@ let e = class extends k {
14
14
  connectedCallback() {
15
15
  super.connectedCallback();
16
16
  }
17
- attributeChangedCallback(t, a, p) {
18
- t === "defaultChecked" && !this.checked && (this.checked = this.defaultChecked), t === "checked" && (this.checked = this.checked === "" || this.checked === "true" || this.checked === !0), super.attributeChangedCallback(t, a, p);
17
+ attributeChangedCallback(t, a, c) {
18
+ t === "defaultChecked" && !this.checked && (this.checked = this.defaultChecked), t === "checked" && (this.checked = this.checked === "" || this.checked === "true" || this.checked === !0, this.inputRef.value && (this.inputRef.value.checked = this.checked)), super.attributeChangedCallback(t, a, c);
19
19
  }
20
20
  firstUpdated(t) {
21
21
  t.has("defaultChecked") && !this.checked && (this.checked = this.defaultChecked), super.firstUpdated(t);
22
22
  }
23
23
  updated(t) {
24
- t.has("defaultChecked") && !this.checked && (this.checked = this.defaultChecked), super.updated(t);
24
+ t.has("defaultChecked") && !this.checked && (this.checked = this.defaultChecked), t.has("checked") && this.inputRef.value && (this.inputRef.value.checked = this.checked === "" || this.checked === "true" || this.checked === !0), super.updated(t);
25
25
  }
26
26
  render() {
27
27
  const t = d({
@@ -31,26 +31,26 @@ let e = class extends k {
31
31
  }), a = d({
32
32
  "pkt-input-check__input-checkbox": !0,
33
33
  "pkt-input-check__input-checkbox--error": this.hasError
34
- }), p = d({
34
+ }), c = d({
35
35
  "pkt-input-check__input-label": !0,
36
36
  "pkt-input-check__input-label--disabled": this.disabled,
37
37
  "pkt-input-check__input-label--left": this.labelPosition === "left",
38
38
  "pkt-input-check__input-label--right": this.labelPosition === "right",
39
39
  "pkt-sr-only": this.hideLabel
40
- }), h = "pkt-tag pkt-tag--small pkt-tag--thin-text", l = () => c`
41
- ${this.tagText ? c`<span class=${h + " pkt-tag--gray"}>${this.tagText}</span>` : n}
42
- ${this.optionalTag ? c`<span class=${h + " pkt-tag--blue-light"}>${this.optionalText}</span>` : n}
43
- ${this.requiredTag ? c`<span class=${h + " pkt-tag--beige"}>${this.requiredText}</span>` : n}
44
- `, o = () => c`
45
- <label class=${p} for=${this.id + "-internal"}>
46
- ${this.label} ${l()}
47
- ${this.checkHelptext ? c`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>` : n}
40
+ }), l = "pkt-tag pkt-tag--small pkt-tag--thin-text", h = () => p`
41
+ ${this.tagText ? p`<span class=${l + " pkt-tag--gray"}>${this.tagText}</span>` : o}
42
+ ${this.optionalTag ? p`<span class=${l + " pkt-tag--blue-light"}>${this.optionalText}</span>` : o}
43
+ ${this.requiredTag ? p`<span class=${l + " pkt-tag--beige"}>${this.requiredText}</span>` : o}
44
+ `, n = () => p`
45
+ <label class=${c} for=${this.id + "-internal"}>
46
+ ${this.label} ${h()}
47
+ ${this.checkHelptext ? p`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>` : o}
48
48
  </label>
49
49
  `;
50
- return c`
50
+ return p`
51
51
  <div class="pkt-input-check">
52
52
  <div class=${t}>
53
- ${this.labelPosition === "left" ? o() : n}
53
+ ${this.labelPosition === "left" ? n() : o}
54
54
  <input
55
55
  id=${this.id + "-internal"}
56
56
  class=${a}
@@ -65,7 +65,7 @@ let e = class extends k {
65
65
  ?checked=${this.checked}
66
66
  role=${this.isSwitch ? "switch" : "checkbox"}
67
67
  />
68
- ${this.labelPosition === "right" ? o() : n}
68
+ ${this.labelPosition === "right" ? n() : o}
69
69
  </div>
70
70
  </div>
71
71
  `;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./checkbox-CTxc8wQe.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-BIph-958.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-_5LbXU7N.js";
1
+ import { P as o } from "./checkbox-DgTtlDZM.js";
2
2
  const k = o;
3
3
  export {
4
4
  o as PktCheckbox,
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./alert-BXbmjri0.cjs"),l=require("./accordionitem-DCZrHVNR.cjs"),m=require("./backlink-BzEvli8m.cjs"),g=require("./button-1jYzMALk.cjs"),P=require("./calendar-BaMrdMDZ.cjs"),h=require("./card-Cf-UcGAP.cjs"),f=require("./combobox-BX1YbDHV.cjs"),y=require("./consent-Cgc6nuiP.cjs"),O=require("./checkbox-CTxc8wQe.cjs"),t=require("./element-CJ_QKaki.cjs"),j=require("./pkt-slot-controller-BzddBp7z.cjs"),s=require("./ref-BFa5Utho.cjs"),q=require("./class-map-C_erArZz.cjs"),k=require("./datepicker-C4joeEiQ.cjs"),x=require("./helptext-CVQP3pis.cjs"),C=require("./heading--JKFppLS.cjs"),v=require("./icon-BGuizDwk.cjs"),S=require("./input-wrapper-D9kFsTCN.cjs"),T=require("./link-Da3pZ_CW.cjs"),$=require("./linkcard-BM23gzhS.cjs"),L=require("./loader-Bo8RCbCJ.cjs"),_=require("./messagebox-C76IcXTl.cjs"),I=require("./modal-Cdz9JcCX.cjs"),A=require("./progressbar-CazcIzVT.cjs"),p=require("./radiobutton-D1fihs8R.cjs"),B=require("./tag-EFUKrc8q.cjs"),d=require("./tabitem-D5zyipN1.cjs"),D=require("./textarea-CYHYvdCf.cjs"),M=require("./textinput-DYVtoRMy.cjs"),R=require("./select-D7Ne5gv0.cjs");var H=Object.defineProperty,w=Object.getOwnPropertyDescriptor,o=(a,e,r,i)=>{for(var n=i>1?void 0:i?w(e,r):e,u=a.length-1,c;u>=0;u--)(c=a[u])&&(n=(i?c(e,r,n):c(n))||n);return i&&n&&H(e,r,n),n};exports.PktComponent=class extends t.PktElement{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=s.e(),this.namedSlot=s.e(),this.slotController=new j.PktSlotController(this,this.defaultSlot,this.namedSlot)}connectedCallback(){this.strings.length&&this.strings.forEach(e=>{this._list.push(e.toUpperCase())}),super.connectedCallback()}render(){const e={"pkt-component":!0,"pkt-component--has-list":this.strings.length>0,"pkt-darkmode":this.darkmode};return t.x`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./alert-BXbmjri0.cjs"),l=require("./accordionitem-DCZrHVNR.cjs"),m=require("./backlink-BzEvli8m.cjs"),g=require("./button-1jYzMALk.cjs"),P=require("./calendar-BaMrdMDZ.cjs"),h=require("./card-Cf-UcGAP.cjs"),f=require("./combobox-BX1YbDHV.cjs"),y=require("./consent-Cgc6nuiP.cjs"),O=require("./checkbox-BIph-958.cjs"),t=require("./element-CJ_QKaki.cjs"),j=require("./pkt-slot-controller-BzddBp7z.cjs"),s=require("./ref-BFa5Utho.cjs"),q=require("./class-map-C_erArZz.cjs"),k=require("./datepicker-C4joeEiQ.cjs"),x=require("./helptext-CVQP3pis.cjs"),C=require("./heading--JKFppLS.cjs"),v=require("./icon-BGuizDwk.cjs"),S=require("./input-wrapper-D9kFsTCN.cjs"),T=require("./link-Da3pZ_CW.cjs"),$=require("./linkcard-BM23gzhS.cjs"),L=require("./loader-Bo8RCbCJ.cjs"),_=require("./messagebox-C76IcXTl.cjs"),I=require("./modal-Cdz9JcCX.cjs"),A=require("./progressbar-CazcIzVT.cjs"),p=require("./radiobutton-D1fihs8R.cjs"),B=require("./tag-EFUKrc8q.cjs"),d=require("./tabitem-D5zyipN1.cjs"),D=require("./textarea-CYHYvdCf.cjs"),M=require("./textinput-DYVtoRMy.cjs"),R=require("./select-D7Ne5gv0.cjs");var H=Object.defineProperty,w=Object.getOwnPropertyDescriptor,o=(a,e,r,i)=>{for(var n=i>1?void 0:i?w(e,r):e,u=a.length-1,c;u>=0;u--)(c=a[u])&&(n=(i?c(e,r,n):c(n))||n);return i&&n&&H(e,r,n),n};exports.PktComponent=class extends t.PktElement{constructor(){super(),this.string="",this.strings=[],this.darkmode=!1,this._list=[],this.defaultSlot=s.e(),this.namedSlot=s.e(),this.slotController=new j.PktSlotController(this,this.defaultSlot,this.namedSlot)}connectedCallback(){this.strings.length&&this.strings.forEach(e=>{this._list.push(e.toUpperCase())}),super.connectedCallback()}render(){const e={"pkt-component":!0,"pkt-component--has-list":this.strings.length>0,"pkt-darkmode":this.darkmode};return t.x`
2
2
  <div class="${q.e(e)}">
3
3
  <h1 class="pkt-txt-28">${this.string}</h1>
4
4
 
package/dist/pkt-index.js CHANGED
@@ -7,7 +7,7 @@ import { P as j } from "./calendar-DtJh7UYD.js";
7
7
  import { P as G } from "./card-M1X36b6i.js";
8
8
  import { P as K } from "./combobox-BdDZU1bk.js";
9
9
  import { P as U } from "./consent-CYFXjOXF.js";
10
- import { P as q } from "./checkbox-_5LbXU7N.js";
10
+ import { P as q } from "./checkbox-DgTtlDZM.js";
11
11
  import { P as d, t as h, x as P, n, a as c } from "./element-CRDRygXu.js";
12
12
  import { P as x } from "./pkt-slot-controller-BPGj-LC5.js";
13
13
  import { e as m, n as k } from "./ref-Xa5dbh--.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-elements",
3
- "version": "13.15.2",
3
+ "version": "13.15.3",
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",
@@ -81,5 +81,5 @@
81
81
  "url": "https://github.com/oslokommune/punkt/issues"
82
82
  },
83
83
  "license": "MIT",
84
- "gitHead": "b9f90e34e22049d0504e4583f464e86f288af2e8"
84
+ "gitHead": "ae9ae0308a5d02aafd7c27c3fb1d9f13804df269"
85
85
  }
@@ -50,6 +50,7 @@ export class PktCheckbox extends PktInputElement<Props> {
50
50
  }
51
51
  if (name === 'checked') {
52
52
  this.checked = this.checked === '' || this.checked === 'true' || this.checked === true
53
+ if (this.inputRef.value) this.inputRef.value.checked = this.checked as boolean
53
54
  }
54
55
  super.attributeChangedCallback(name, _old, value)
55
56
  }
@@ -65,6 +66,10 @@ export class PktCheckbox extends PktInputElement<Props> {
65
66
  if (changedProperties.has('defaultChecked') && !this.checked) {
66
67
  this.checked = this.defaultChecked
67
68
  }
69
+ if (changedProperties.has('checked') && this.inputRef.value) {
70
+ this.inputRef.value.checked =
71
+ this.checked === '' || this.checked === 'true' || this.checked === true
72
+ }
68
73
  super.updated(changedProperties)
69
74
  }
70
75
 
@@ -1,31 +0,0 @@
1
- "use strict";const e=require("./element-CJ_QKaki.cjs"),r=require("./input-element-j9znzLWz.cjs"),o=require("./ref-BFa5Utho.cjs"),n=require("./class-map-C_erArZz.cjs");var k=Object.defineProperty,u=Object.getOwnPropertyDescriptor,i=(p,t,h,a)=>{for(var s=a>1?void 0:a?u(t,h):t,c=p.length-1,l;c>=0;c--)(l=p[c])&&(s=(a?l(t,h,s):l(s))||s);return a&&s&&k(t,h,s),s};exports.PktCheckbox=class extends r.PktInputElement{constructor(){super(...arguments),this.inputRef=o.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",this.tagText=null,this.optionalTag=!1,this.optionalText="Valgfritt",this.requiredTag=!1,this.requiredText="Må fylles ut"}connectedCallback(){super.connectedCallback()}attributeChangedCallback(t,h,a){t==="defaultChecked"&&!this.checked&&(this.checked=this.defaultChecked),t==="checked"&&(this.checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(t,h,a)}firstUpdated(t){t.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),super.firstUpdated(t)}updated(t){t.has("defaultChecked")&&!this.checked&&(this.checked=this.defaultChecked),super.updated(t)}render(){const t=n.e({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),h=n.e({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError}),a=n.e({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.disabled,"pkt-input-check__input-label--left":this.labelPosition==="left","pkt-input-check__input-label--right":this.labelPosition==="right","pkt-sr-only":this.hideLabel}),s="pkt-tag pkt-tag--small pkt-tag--thin-text",c=()=>e.x`
2
- ${this.tagText?e.x`<span class=${s+" pkt-tag--gray"}>${this.tagText}</span>`:e.E}
3
- ${this.optionalTag?e.x`<span class=${s+" pkt-tag--blue-light"}>${this.optionalText}</span>`:e.E}
4
- ${this.requiredTag?e.x`<span class=${s+" pkt-tag--beige"}>${this.requiredText}</span>`:e.E}
5
- `,l=()=>e.x`
6
- <label class=${a} for=${this.id+"-internal"}>
7
- ${this.label} ${c()}
8
- ${this.checkHelptext?e.x`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:e.E}
9
- </label>
10
- `;return e.x`
11
- <div class="pkt-input-check">
12
- <div class=${t}>
13
- ${this.labelPosition==="left"?l():e.E}
14
- <input
15
- id=${this.id+"-internal"}
16
- class=${h}
17
- type="checkbox"
18
- ?disabled=${this.disabled}
19
- name=${this.name+"-internal"}
20
- ${o.n(this.inputRef)}
21
- @change=${this.handleChange}
22
- @click=${this.handleClick}
23
- @blur=${this.onBlur}
24
- @focus=${this.onFocus}
25
- ?checked=${this.checked}
26
- role=${this.isSwitch?"switch":"checkbox"}
27
- />
28
- ${this.labelPosition==="right"?l():e.E}
29
- </div>
30
- </div>
31
- `}handleClick(t){if(this.disabled)return t.preventDefault(),t.stopImmediatePropagation(),!1}handleChange(t){if(this.disabled)return t.preventDefault(),t.stopImmediatePropagation(),!1;this.toggleChecked(t)}toggleChecked(t){if(this.disabled){t.preventDefault(),t.stopImmediatePropagation();return}const h=t.target;if(h&&h.disabled){t.preventDefault(),t.stopImmediatePropagation();return}t.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this.checked=this.inputRef.value.matches(":checked"),this.valueChecked(this.checked))}};i([e.n({type:String,reflect:!0})],exports.PktCheckbox.prototype,"value",2);i([e.n({type:String})],exports.PktCheckbox.prototype,"checkHelptext",2);i([e.n({type:Boolean})],exports.PktCheckbox.prototype,"defaultChecked",2);i([e.n({type:Boolean})],exports.PktCheckbox.prototype,"hasTile",2);i([e.n({type:Boolean})],exports.PktCheckbox.prototype,"isSwitch",2);i([e.n({type:String})],exports.PktCheckbox.prototype,"labelPosition",2);i([e.n({type:Boolean})],exports.PktCheckbox.prototype,"hideLabel",2);i([e.n({type:Boolean,reflect:!0})],exports.PktCheckbox.prototype,"checked",2);i([e.n({type:String,reflect:!0})],exports.PktCheckbox.prototype,"type",2);i([e.n({type:String})],exports.PktCheckbox.prototype,"tagText",2);i([e.n({type:Boolean})],exports.PktCheckbox.prototype,"optionalTag",2);i([e.n({type:String})],exports.PktCheckbox.prototype,"optionalText",2);i([e.n({type:Boolean})],exports.PktCheckbox.prototype,"requiredTag",2);i([e.n({type:String})],exports.PktCheckbox.prototype,"requiredText",2);exports.PktCheckbox=i([e.t("pkt-checkbox")],exports.PktCheckbox);