@oslokommune/punkt-elements 12.39.6 → 12.39.8

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 (45) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/{card-CZG7XGlj.js → card-Bx2WyoYH.js} +62 -62
  3. package/dist/card-C8wbJJyj.cjs +87 -0
  4. package/dist/{checkbox-zqd3KVfz.cjs → checkbox-7ct89AUo.cjs} +1 -1
  5. package/dist/{checkbox-Ds1FrhqK.js → checkbox-D5fSFvhs.js} +1 -1
  6. package/dist/{combobox-B6x7Qukm.js → combobox-DewmPXyJ.js} +1 -1
  7. package/dist/{combobox-yUrUarU_.cjs → combobox-dwkB9Yv_.cjs} +1 -1
  8. package/dist/{datepicker-CH5ZmFhf.cjs → datepicker-BDnncwne.cjs} +1 -1
  9. package/dist/{datepicker-WpOJS948.js → datepicker-CISpFZSs.js} +1 -1
  10. package/dist/index.d.ts +5 -6
  11. package/dist/{input-element-4hgBpSNJ.js → input-element-B2GjFOXX.js} +1 -1
  12. package/dist/input-element-DK0UmdGZ.cjs +1 -0
  13. package/dist/pkt-card.cjs +1 -1
  14. package/dist/pkt-card.js +1 -1
  15. package/dist/pkt-checkbox.cjs +1 -1
  16. package/dist/pkt-checkbox.js +1 -1
  17. package/dist/pkt-combobox.cjs +1 -1
  18. package/dist/pkt-combobox.js +1 -1
  19. package/dist/pkt-datepicker.cjs +1 -1
  20. package/dist/pkt-datepicker.js +1 -1
  21. package/dist/pkt-index.cjs +1 -1
  22. package/dist/pkt-index.js +8 -8
  23. package/dist/pkt-radiobutton.cjs +1 -1
  24. package/dist/pkt-radiobutton.js +1 -1
  25. package/dist/pkt-select.cjs +1 -1
  26. package/dist/pkt-select.js +1 -1
  27. package/dist/pkt-textarea.cjs +1 -1
  28. package/dist/pkt-textarea.js +1 -1
  29. package/dist/pkt-textinput.cjs +1 -1
  30. package/dist/pkt-textinput.js +1 -1
  31. package/dist/radiobutton-CET0zjgD.js +86 -0
  32. package/dist/radiobutton-DGWTMdAZ.cjs +25 -0
  33. package/dist/{select-BCL790jM.cjs → select-Brv7vglu.cjs} +1 -1
  34. package/dist/{select-D3LR5zgE.js → select-C36Z4gui.js} +1 -1
  35. package/dist/{textarea-B8H6-8qY.js → textarea-l10XGym1.js} +1 -1
  36. package/dist/{textarea-DxbylapQ.cjs → textarea-yUzqcBYY.cjs} +1 -1
  37. package/dist/{textinput-B__c4c1z.cjs → textinput-8mT0npMY.cjs} +1 -1
  38. package/dist/{textinput-CPYLokFV.js → textinput-B1n0gFaS.js} +1 -1
  39. package/package.json +3 -3
  40. package/src/components/card/card.ts +12 -12
  41. package/src/components/radiobutton/radiobutton.ts +2 -15
  42. package/dist/card-Di1MQneh.cjs +0 -87
  43. package/dist/input-element-CwUniARD.cjs +0 -1
  44. package/dist/radiobutton-CI2xaqAB.cjs +0 -25
  45. package/dist/radiobutton-CYJawqxD.js +0 -89
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./radiobutton-CI2xaqAB.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-DGWTMdAZ.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-CYJawqxD.js";
1
+ import { P as t } from "./radiobutton-CET0zjgD.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-BCL790jM.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-Brv7vglu.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-D3LR5zgE.js";
1
+ import { P as t } from "./select-C36Z4gui.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-DxbylapQ.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-yUzqcBYY.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-B8H6-8qY.js";
1
+ import { P as a } from "./textarea-l10XGym1.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-B__c4c1z.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-8mT0npMY.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-CPYLokFV.js";
1
+ import { P as t } from "./textinput-B1n0gFaS.js";
2
2
  const p = t;
3
3
  export {
4
4
  t as PktTextinput,
@@ -0,0 +1,86 @@
1
+ import { E as u, x as n, n as h, a as d } from "./element-DjjF_tEh.js";
2
+ import { r as k } from "./state-BtbpSrdV.js";
3
+ import { P as f } from "./input-element-B2GjFOXX.js";
4
+ import { e as _, n as b } from "./ref-iIffqQAI.js";
5
+ import { e as o } from "./class-map-KyMqi0fa.js";
6
+ var v = Object.defineProperty, C = Object.getOwnPropertyDescriptor, c = (e, i, p, l) => {
7
+ for (var s = l > 1 ? void 0 : l ? C(i, p) : i, r = e.length - 1, a; r >= 0; r--)
8
+ (a = e[r]) && (s = (l ? a(i, p, s) : a(s)) || s);
9
+ return l && s && v(i, p, s), s;
10
+ };
11
+ let t = class extends f {
12
+ constructor() {
13
+ super(...arguments), this.inputRef = _(), this.value = "", this.checkHelptext = null, this.defaultChecked = !1, this.hasTile = !1, this.checked = null, this.type = "radio", this._checked = !1;
14
+ }
15
+ connectedCallback() {
16
+ super.connectedCallback();
17
+ }
18
+ attributeChangedCallback(e, i, p) {
19
+ e === "defaultChecked" && (this._checked = this.defaultChecked), e === "checked" && (this._checked = this.checked === "" || this.checked === "true" || this.checked === !0), super.attributeChangedCallback(e, i, p);
20
+ }
21
+ render() {
22
+ const e = o({
23
+ "pkt-input-check__input": !0,
24
+ "pkt-input-check__input--tile": this.hasTile,
25
+ "pkt-input-check__input--tile-disabled": this.disabled && this.hasTile
26
+ }), i = o({
27
+ "pkt-input-check__input-checkbox": !0,
28
+ "pkt-input-check__input-checkbox--error": this.hasError
29
+ });
30
+ return n`
31
+ <div class="pkt-input-check">
32
+ <div class=${e}>
33
+ <input
34
+ id=${this.id + "-internal"}
35
+ class=${i}
36
+ type="radio"
37
+ role="radio"
38
+ ?disabled=${this.disabled}
39
+ form=""
40
+ name=${this.name + "-internal"}
41
+ ${b(this.inputRef)}
42
+ @change=${this.toggleChecked}
43
+ @input=${this.onInput}
44
+ @blur=${this.onBlur}
45
+ @focus=${this.onFocus}
46
+ ?checked=${this.checked}
47
+ />
48
+ <label class="pkt-input-check__input-label" for=${this.id + "-internal"}>
49
+ ${this.label}
50
+ ${this.checkHelptext ? n`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>` : u}
51
+ </label>
52
+ </div>
53
+ </div>
54
+ `;
55
+ }
56
+ toggleChecked(e = null) {
57
+ e && e.preventDefault(), e && e.stopImmediatePropagation(), this.touched = !0, this.inputRef.value && (this._checked = this.inputRef.value.matches(":checked"), this.valueChecked(this._checked));
58
+ }
59
+ };
60
+ c([
61
+ h({ type: String, reflect: !0 })
62
+ ], t.prototype, "value", 2);
63
+ c([
64
+ h({ type: String })
65
+ ], t.prototype, "checkHelptext", 2);
66
+ c([
67
+ h({ type: Boolean })
68
+ ], t.prototype, "defaultChecked", 2);
69
+ c([
70
+ h({ type: Boolean })
71
+ ], t.prototype, "hasTile", 2);
72
+ c([
73
+ h({ type: Boolean, reflect: !0 })
74
+ ], t.prototype, "checked", 2);
75
+ c([
76
+ h({ type: String, reflect: !0 })
77
+ ], t.prototype, "type", 2);
78
+ c([
79
+ k()
80
+ ], t.prototype, "_checked", 2);
81
+ t = c([
82
+ d("pkt-radiobutton")
83
+ ], t);
84
+ export {
85
+ t as P
86
+ };
@@ -0,0 +1,25 @@
1
+ "use strict";const e=require("./element-BSypUpzA.cjs"),p=require("./state-B5KCNjEd.cjs"),r=require("./input-element-DK0UmdGZ.cjs"),o=require("./ref-BvbyvXRH.cjs"),a=require("./class-map-DCyaICmy.cjs");var d=Object.defineProperty,k=Object.getOwnPropertyDescriptor,i=(h,t,c,n)=>{for(var s=n>1?void 0:n?k(t,c):t,l=h.length-1,u;l>=0;l--)(u=h[l])&&(s=(n?u(t,c,s):u(s))||s);return n&&s&&d(t,c,s),s};exports.PktRadioButton=class extends r.PktInputElement{constructor(){super(...arguments),this.inputRef=o.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(t,c,n){t==="defaultChecked"&&(this._checked=this.defaultChecked),t==="checked"&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(t,c,n)}render(){const t=a.e({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),c=a.e({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError});return e.x`
2
+ <div class="pkt-input-check">
3
+ <div class=${t}>
4
+ <input
5
+ id=${this.id+"-internal"}
6
+ class=${c}
7
+ type="radio"
8
+ role="radio"
9
+ ?disabled=${this.disabled}
10
+ form=""
11
+ name=${this.name+"-internal"}
12
+ ${o.n(this.inputRef)}
13
+ @change=${this.toggleChecked}
14
+ @input=${this.onInput}
15
+ @blur=${this.onBlur}
16
+ @focus=${this.onFocus}
17
+ ?checked=${this.checked}
18
+ />
19
+ <label class="pkt-input-check__input-label" for=${this.id+"-internal"}>
20
+ ${this.label}
21
+ ${this.checkHelptext?e.x`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:e.E}
22
+ </label>
23
+ </div>
24
+ </div>
25
+ `}toggleChecked(t=null){t&&t.preventDefault(),t&&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.PktRadioButton.prototype,"value",2);i([e.n({type:String})],exports.PktRadioButton.prototype,"checkHelptext",2);i([e.n({type:Boolean})],exports.PktRadioButton.prototype,"defaultChecked",2);i([e.n({type:Boolean})],exports.PktRadioButton.prototype,"hasTile",2);i([e.n({type:Boolean,reflect:!0})],exports.PktRadioButton.prototype,"checked",2);i([e.n({type:String,reflect:!0})],exports.PktRadioButton.prototype,"type",2);i([p.r()],exports.PktRadioButton.prototype,"_checked",2);exports.PktRadioButton=i([e.t("pkt-radiobutton")],exports.PktRadioButton);
@@ -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-CwUniARD.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-DK0UmdGZ.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-4hgBpSNJ.js";
5
+ import { P as v } from "./input-element-B2GjFOXX.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-4hgBpSNJ.js";
8
+ import { P as C } from "./input-element-B2GjFOXX.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-CwUniARD.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-DK0UmdGZ.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-CwUniARD.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-DK0UmdGZ.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-4hgBpSNJ.js";
6
+ import { P as x } from "./input-element-B2GjFOXX.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.39.6",
3
+ "version": "12.39.8",
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",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "devDependencies": {
34
34
  "@oslokommune/punkt-assets": "^12.39.2",
35
- "@oslokommune/punkt-css": "^12.39.5",
35
+ "@oslokommune/punkt-css": "^12.39.8",
36
36
  "sass": "^1.78.0",
37
37
  "typescript": "^5.6.2",
38
38
  "vite": "^5.4.18",
@@ -59,5 +59,5 @@
59
59
  "url": "https://github.com/oslokommune/punkt/issues"
60
60
  },
61
61
  "license": "MIT",
62
- "gitHead": "16072dee66bffd73d5729bc858e8ee0db62c98a7"
62
+ "gitHead": "9837c1edd0b49ecdc14a46ede9442d30bdb9d908"
63
63
  }
@@ -20,8 +20,8 @@ export type TCardTagPosition = 'top' | 'bottom'
20
20
 
21
21
  export interface IPktCard {
22
22
  ariaLabel?: IAriaAttributes['aria-label']
23
- author?: string | null
24
- date?: string | null
23
+ metaLead?: string | null
24
+ metaTrail?: string | null
25
25
  direction?: TDirection
26
26
  heading?: string
27
27
  headingLevel?: IPktHeading['level']
@@ -53,10 +53,10 @@ export class PktCard extends PktElement implements IPktCard {
53
53
  // Properties
54
54
 
55
55
  @property({ type: String }) ariaLabel: string = ''
56
- @property({ type: String }) author: string | null = null
56
+ @property({ type: String }) metaLead: string | null = null
57
57
  @property({ type: Boolean }) borderOnHover: boolean = true
58
58
  @property({ type: String, reflect: true }) clickCardLink: IPktCard['clickCardLink'] = null
59
- @property({ type: String }) date: string | null = null
59
+ @property({ type: String }) metaTrail: string | null = null
60
60
  @property({ type: String }) direction: TDirection = specs.props.direction.default as TDirection
61
61
  @property({ type: String }) heading: string = ''
62
62
  @property({ type: Number }) headinglevel: IPktHeading['level'] = 3
@@ -106,7 +106,7 @@ export class PktCard extends PktElement implements IPktCard {
106
106
  ${this.renderHeader()}
107
107
  ${this.renderSlot()}
108
108
  ${this.tagPosition === 'bottom' ? this.renderTags() : nothing}
109
- ${this.renderCreditline()}
109
+ ${this.renderMetadata()}
110
110
  </div>
111
111
  </article>
112
112
  `
@@ -233,16 +233,16 @@ export class PktCard extends PktElement implements IPktCard {
233
233
  `
234
234
  }
235
235
 
236
- renderCreditline() {
236
+ renderMetadata() {
237
237
  return html`
238
- ${this.author || this.date
238
+ ${this.metaLead || this.metaTrail
239
239
  ? html`
240
- <footer class="pkt-card__creditline">
241
- ${this.author
242
- ? html`<span class="pkt-card__creditline-author">${this.author}</span>`
240
+ <footer class="pkt-card__metadata">
241
+ ${this.metaLead
242
+ ? html`<span class="pkt-card__metadata-lead">${this.metaLead}</span>`
243
243
  : nothing}
244
- ${this.date
245
- ? html`<span class="pkt-card__creditline-date">${this.date}</span>`
244
+ ${this.metaTrail
245
+ ? html`<span class="pkt-card__metadata-trail">${this.metaTrail}</span>`
246
246
  : nothing}
247
247
  </footer>
248
248
  `
@@ -2,7 +2,7 @@ import { customElement, property, state } from 'lit/decorators.js'
2
2
 
3
3
  import { PktInputElement } from '@/base-elements/input-element'
4
4
  import { Ref, createRef, ref } from 'lit/directives/ref.js'
5
- import { html, nothing, PropertyValues } from 'lit'
5
+ import { html, nothing } from 'lit'
6
6
  import { classMap } from 'lit/directives/class-map.js'
7
7
 
8
8
  @customElement('pkt-radiobutton')
@@ -32,20 +32,6 @@ export class PktRadioButton extends PktInputElement {
32
32
  super.attributeChangedCallback(name, _old, value)
33
33
  }
34
34
 
35
- updated(changedProperties: PropertyValues) {
36
- if (changedProperties.has('checked') && this.checked !== null) {
37
- this._checked = this.checked === '' || this.checked === 'true' || this.checked === true
38
- const oldChecked =
39
- changedProperties.get('checked') === '' ||
40
- changedProperties.get('checked') === 'true' ||
41
- changedProperties.get('checked') === true
42
- if (oldChecked !== this._checked) {
43
- this.toggleChecked()
44
- }
45
- }
46
- super.updated(changedProperties)
47
- }
48
-
49
35
  render() {
50
36
  const inputTileClasses = classMap({
51
37
  'pkt-input-check__input': true,
@@ -88,6 +74,7 @@ export class PktRadioButton extends PktInputElement {
88
74
  }
89
75
 
90
76
  private toggleChecked(e: Event | null = null) {
77
+ if (e) e.preventDefault()
91
78
  if (e) e.stopImmediatePropagation()
92
79
  this.touched = true
93
80
  if (this.inputRef.value) {
@@ -1,87 +0,0 @@
1
- "use strict";const p=require("./class-map-DCyaICmy.cjs"),h=require("./if-defined-a3sotaUr.cjs"),t=require("./element-BSypUpzA.cjs"),g=require("./pkt-slot-controller-Da-RgXfS.cjs"),c=require("./ref-BvbyvXRH.cjs");require("./icon-BnKGwYjj.cjs");require("./tag-B9kFYxHg.cjs");const k={skin:{default:"outlined"},direction:{default:"portrait"},padding:{default:"standard"}},l={props:k};var u=Object.defineProperty,$=Object.getOwnPropertyDescriptor,e=(d,i,a,n)=>{for(var r=n>1?void 0:n?$(i,a):i,s=d.length-1,o;s>=0;s--)(o=d[s])&&(r=(n?o(i,a,r):o(r))||r);return n&&r&&u(i,a,r),r};exports.PktCard=class extends t.PktElement{constructor(){super(),this.defaultSlot=c.e(),this.ariaLabel="",this.author=null,this.borderOnHover=!0,this.clickCardLink=null,this.date=null,this.direction=l.props.direction.default,this.heading="",this.headinglevel=3,this.image={src:"",alt:""},this.imageShape="square",this.openLinkInNewTab=!1,this.padding=l.props.padding.default,this.skin=l.props.skin.default,this.subheading="",this.tagPosition="top",this.tags=[],this.slotController=new g.PktSlotController(this,this.defaultSlot)}connectedCallback(){super.connectedCallback()}render(){var r,s;const i={"pkt-card":!0,[`pkt-card--${this.skin}`]:this.skin,[`pkt-card--${this.direction}`]:this.direction,[`pkt-card--padding-${this.padding}`]:this.padding,"pkt-card--border-on-hover":this.borderOnHover},a=((r=this.ariaLabel)==null?void 0:r.trim())||(this.heading?`${this.heading} lenkekort`:"lenkekort"),n=((s=this.ariaLabel)==null?void 0:s.trim())||(this.heading?this.heading:"kort");return t.x`
2
- <article
3
- class=${p.e(i)}
4
- aria-label=${h.o(this.clickCardLink?a:n)}
5
- >
6
- ${this.renderImage()}
7
- <div class="pkt-card__wrapper">
8
- ${this.tagPosition==="top"?this.renderTags():t.E}
9
- ${this.renderHeader()}
10
- ${this.renderSlot()}
11
- ${this.tagPosition==="bottom"?this.renderTags():t.E}
12
- ${this.renderCreditline()}
13
- </div>
14
- </article>
15
- `}renderImage(){const i={"pkt-card__image":!0,[`pkt-card__image-${this.imageShape}`]:this.imageShape};return t.x`
16
- ${this.image.src&&t.x`
17
- <div class=${p.e(i)}>
18
- <img src=${this.image.src} alt=${this.image.alt||""} />
19
- </div>
20
- `}
21
- `}renderHeading(){return t.x`
22
- ${this.heading&&!this.clickCardLink?t.x`
23
- <pkt-heading
24
- class="pkt-card__heading"
25
- .level=${this.headinglevel||3}
26
- size="medium"
27
- nospacing
28
- >
29
- ${this.heading}
30
- </pkt-heading>
31
- `:t.E}
32
- `}renderLinkHeading(){return t.x`
33
- ${this.clickCardLink?t.x`
34
- <pkt-heading
35
- class="pkt-card__link-heading pkt-card__heading"
36
- .level=${this.headinglevel||3}
37
- size="medium"
38
- nospacing
39
- >
40
- <a
41
- class="pkt-card__link"
42
- href=${this.clickCardLink}
43
- target=${this.openLinkInNewTab?"_blank":"_self"}
44
- >${this.heading}</a
45
- >
46
- </pkt-heading>
47
- `:t.E}
48
- `}renderSubheading(){return t.x`
49
- ${this.subheading?t.x` <p class="pkt-card__subheading ">${this.subheading}</p> `:t.E}
50
- `}renderHeader(){const i=!!this.heading||!!this.subheading;return t.x`
51
- ${i?t.x`
52
- <header class="pkt-card__header">
53
- ${this.renderHeading()}
54
- ${this.renderLinkHeading()}
55
- ${this.renderSubheading()}
56
- </header>
57
- `:t.E}
58
- `}renderTags(){const i={"pkt-card__tags":!0,[`pkt-card__tags-${this.tagPosition}`]:this.tagPosition};return t.x`
59
- ${this.tags.length>0?t.x`
60
- <div
61
- class=${p.e(i)}
62
- role="list"
63
- aria-label=${this.tags.length>1?"merkelapper":"merkelapp"}
64
- >
65
- ${this.tags.map(a=>t.x`
66
- <pkt-tag
67
- role="listitem"
68
- textStyle="normal-text"
69
- size="medium"
70
- skin=${h.o(a.skin)}
71
- iconName=${h.o(a.iconName)}
72
- >
73
- ${a.text}
74
- </pkt-tag>
75
- `)}
76
- </div>
77
- `:t.E}
78
- `}renderSlot(){return t.x`
79
- ${this.defaultSlot&&t.x`<section class="pkt-card__content" ${c.n(this.defaultSlot)}></section>`}
80
- `}renderCreditline(){return t.x`
81
- ${this.author||this.date?t.x`
82
- <footer class="pkt-card__creditline">
83
- ${this.author?t.x`<span class="pkt-card__creditline-author">${this.author}</span>`:t.E}
84
- ${this.date?t.x`<span class="pkt-card__creditline-date">${this.date}</span>`:t.E}
85
- </footer>
86
- `:t.E}
87
- `}};e([t.n({type:String})],exports.PktCard.prototype,"ariaLabel",2);e([t.n({type:String})],exports.PktCard.prototype,"author",2);e([t.n({type:Boolean})],exports.PktCard.prototype,"borderOnHover",2);e([t.n({type:String,reflect:!0})],exports.PktCard.prototype,"clickCardLink",2);e([t.n({type:String})],exports.PktCard.prototype,"date",2);e([t.n({type:String})],exports.PktCard.prototype,"direction",2);e([t.n({type:String})],exports.PktCard.prototype,"heading",2);e([t.n({type:Number})],exports.PktCard.prototype,"headinglevel",2);e([t.n({type:Object})],exports.PktCard.prototype,"image",2);e([t.n({type:String})],exports.PktCard.prototype,"imageShape",2);e([t.n({type:Boolean})],exports.PktCard.prototype,"openLinkInNewTab",2);e([t.n({type:String})],exports.PktCard.prototype,"padding",2);e([t.n({type:String})],exports.PktCard.prototype,"skin",2);e([t.n({type:String})],exports.PktCard.prototype,"subheading",2);e([t.n({type:String})],exports.PktCard.prototype,"tagPosition",2);e([t.n({type:Array})],exports.PktCard.prototype,"tags",2);exports.PktCard=e([t.t("pkt-card")],exports.PktCard);
@@ -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,r,l)=>{for(var a=void 0,n=o.length-1,h;n>=0;n--)(h=o[n])&&(a=h(t,r,a)||a);return a&&m(t,r,a),a};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 r,l,a,n,h,u,p,d;t&&(this.required&&!this.value?this.internals.setValidity({valueMissing:!0},e.translations.forms.messages.required,t):(r=t.validity)!=null&&r.typeMismatch||(l=t.validity)!=null&&l.badInput?this.internals.setValidity({typeMismatch:!0},e.translations.forms.messages.invalid,t):(a=t.validity)!=null&&a.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 r=new FormData;t.forEach(l=>{r.append(this.name,l)}),this.internals.setFormValue(r)}else this.internals.setFormValue(t)}valueChecked(t){if(!this.touched)return;const r=this.internals.form||this.closest("form"),l=r?new FormData(r):null;r&&r.querySelectorAll(`pkt-radiobutton[name=${this.name}], input[type=radio][name=${this.name}]`).forEach(a=>{const n=a;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,r){(r!==this.value||r!==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)&&r&&r.length!==0?this.clearInputValue():this.value&&this.value.toString()!==(r==null?void 0:r.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.form){const r=this.internals.form||this.closest("form");this.form=r}if(this.value&&this.defaultValue!==null&&(this.defaultValue=this.value),this.defaultValue!==null&&!this.value&&this.valueChanged(this.defaultValue,null),this.defaultChecked&&(this.internals.ariaChecked=!0,this.checked=!0),this.required&&(this.internals.ariaRequired=!0),this.disabled&&(this.internals.ariaDisabled=!0),this.id&&!this.name&&(this.name=this.id),this.checked!==void 0){const r=this.checked===""||this.checked==="true"||this.checked===!0;this.internals.ariaChecked=r,this.internals.setFormValue(r?this.value||"on":"",r?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,25 +0,0 @@
1
- "use strict";const t=require("./element-BSypUpzA.cjs"),a=require("./state-B5KCNjEd.cjs"),p=require("./input-element-CwUniARD.cjs"),d=require("./ref-BvbyvXRH.cjs"),o=require("./class-map-DCyaICmy.cjs");var r=Object.defineProperty,k=Object.getOwnPropertyDescriptor,i=(u,e,c,s)=>{for(var h=s>1?void 0:s?k(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&&r(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
- <div class="pkt-input-check">
3
- <div class=${e}>
4
- <input
5
- id=${this.id+"-internal"}
6
- class=${c}
7
- type="radio"
8
- role="radio"
9
- ?disabled=${this.disabled}
10
- form=""
11
- name=${this.name+"-internal"}
12
- ${d.n(this.inputRef)}
13
- @change=${this.toggleChecked}
14
- @input=${this.onInput}
15
- @blur=${this.onBlur}
16
- @focus=${this.onFocus}
17
- ?checked=${this.checked}
18
- />
19
- <label class="pkt-input-check__input-label" for=${this.id+"-internal"}>
20
- ${this.label}
21
- ${this.checkHelptext?t.x`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>`:t.E}
22
- </label>
23
- </div>
24
- </div>
25
- `}toggleChecked(e=null){e&&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.PktRadioButton.prototype,"value",2);i([t.n({type:String})],exports.PktRadioButton.prototype,"checkHelptext",2);i([t.n({type:Boolean})],exports.PktRadioButton.prototype,"defaultChecked",2);i([t.n({type:Boolean})],exports.PktRadioButton.prototype,"hasTile",2);i([t.n({type:Boolean,reflect:!0})],exports.PktRadioButton.prototype,"checked",2);i([t.n({type:String,reflect:!0})],exports.PktRadioButton.prototype,"type",2);i([a.r()],exports.PktRadioButton.prototype,"_checked",2);exports.PktRadioButton=i([t.t("pkt-radiobutton")],exports.PktRadioButton);
@@ -1,89 +0,0 @@
1
- import { E as o, x as d, n as s, a as n } from "./element-DjjF_tEh.js";
2
- import { r as k } from "./state-BtbpSrdV.js";
3
- import { P as f } from "./input-element-4hgBpSNJ.js";
4
- import { e as _, n as b } from "./ref-iIffqQAI.js";
5
- import { e as a } from "./class-map-KyMqi0fa.js";
6
- var C = Object.defineProperty, v = Object.getOwnPropertyDescriptor, i = (e, t, l, p) => {
7
- for (var h = p > 1 ? void 0 : p ? v(t, l) : t, r = e.length - 1, u; r >= 0; r--)
8
- (u = e[r]) && (h = (p ? u(t, l, h) : u(h)) || h);
9
- return p && h && C(t, l, h), h;
10
- };
11
- let c = class extends f {
12
- constructor() {
13
- super(...arguments), this.inputRef = _(), this.value = "", this.checkHelptext = null, this.defaultChecked = !1, this.hasTile = !1, this.checked = null, this.type = "radio", this._checked = !1;
14
- }
15
- connectedCallback() {
16
- super.connectedCallback();
17
- }
18
- attributeChangedCallback(e, t, l) {
19
- e === "defaultChecked" && (this._checked = this.defaultChecked), e === "checked" && (this._checked = this.checked === "" || this.checked === "true" || this.checked === !0), super.attributeChangedCallback(e, t, l);
20
- }
21
- updated(e) {
22
- 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);
23
- }
24
- render() {
25
- const e = a({
26
- "pkt-input-check__input": !0,
27
- "pkt-input-check__input--tile": this.hasTile,
28
- "pkt-input-check__input--tile-disabled": this.disabled && this.hasTile
29
- }), t = a({
30
- "pkt-input-check__input-checkbox": !0,
31
- "pkt-input-check__input-checkbox--error": this.hasError
32
- });
33
- return d`
34
- <div class="pkt-input-check">
35
- <div class=${e}>
36
- <input
37
- id=${this.id + "-internal"}
38
- class=${t}
39
- type="radio"
40
- role="radio"
41
- ?disabled=${this.disabled}
42
- form=""
43
- name=${this.name + "-internal"}
44
- ${b(this.inputRef)}
45
- @change=${this.toggleChecked}
46
- @input=${this.onInput}
47
- @blur=${this.onBlur}
48
- @focus=${this.onFocus}
49
- ?checked=${this.checked}
50
- />
51
- <label class="pkt-input-check__input-label" for=${this.id + "-internal"}>
52
- ${this.label}
53
- ${this.checkHelptext ? d`<div class="pkt-input-check__input-helptext">${this.checkHelptext}</div>` : o}
54
- </label>
55
- </div>
56
- </div>
57
- `;
58
- }
59
- toggleChecked(e = null) {
60
- e && e.stopImmediatePropagation(), this.touched = !0, this.inputRef.value && (this._checked = this.inputRef.value.matches(":checked"), this.valueChecked(this._checked));
61
- }
62
- };
63
- i([
64
- s({ type: String, reflect: !0 })
65
- ], c.prototype, "value", 2);
66
- i([
67
- s({ type: String })
68
- ], c.prototype, "checkHelptext", 2);
69
- i([
70
- s({ type: Boolean })
71
- ], c.prototype, "defaultChecked", 2);
72
- i([
73
- s({ type: Boolean })
74
- ], c.prototype, "hasTile", 2);
75
- i([
76
- s({ type: Boolean, reflect: !0 })
77
- ], c.prototype, "checked", 2);
78
- i([
79
- s({ type: String, reflect: !0 })
80
- ], c.prototype, "type", 2);
81
- i([
82
- k()
83
- ], c.prototype, "_checked", 2);
84
- c = i([
85
- n("pkt-radiobutton")
86
- ], c);
87
- export {
88
- c as P
89
- };