@oslokommune/punkt-elements 12.39.5 → 12.39.7

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 (44) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/{checkbox-zqd3KVfz.cjs → checkbox-7ct89AUo.cjs} +1 -1
  3. package/dist/{checkbox-Ds1FrhqK.js → checkbox-D5fSFvhs.js} +1 -1
  4. package/dist/{combobox-B6x7Qukm.js → combobox-DewmPXyJ.js} +1 -1
  5. package/dist/{combobox-yUrUarU_.cjs → combobox-dwkB9Yv_.cjs} +1 -1
  6. package/dist/{datepicker-CH5ZmFhf.cjs → datepicker-BDnncwne.cjs} +1 -1
  7. package/dist/{datepicker-WpOJS948.js → datepicker-CISpFZSs.js} +1 -1
  8. package/dist/index.d.ts +0 -1
  9. package/dist/{input-element-4hgBpSNJ.js → input-element-B2GjFOXX.js} +1 -1
  10. package/dist/input-element-DK0UmdGZ.cjs +1 -0
  11. package/dist/{modal-CTh_wH8S.cjs → modal-C8GbUY8p.cjs} +8 -8
  12. package/dist/{modal-C8qYfLqF.js → modal-nU8cELiR.js} +37 -37
  13. package/dist/pkt-checkbox.cjs +1 -1
  14. package/dist/pkt-checkbox.js +1 -1
  15. package/dist/pkt-combobox.cjs +1 -1
  16. package/dist/pkt-combobox.js +1 -1
  17. package/dist/pkt-datepicker.cjs +1 -1
  18. package/dist/pkt-datepicker.js +1 -1
  19. package/dist/pkt-index.cjs +1 -1
  20. package/dist/pkt-index.js +8 -8
  21. package/dist/pkt-modal.cjs +1 -1
  22. package/dist/pkt-modal.js +1 -1
  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/modal/modal.ts +0 -1
  41. package/src/components/radiobutton/radiobutton.ts +2 -15
  42. package/dist/input-element-CwUniARD.cjs +0 -1
  43. package/dist/radiobutton-CI2xaqAB.cjs +0 -25
  44. package/dist/radiobutton-CYJawqxD.js +0 -89
package/CHANGELOG.md CHANGED
@@ -5,6 +5,41 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
5
5
 
6
6
  ---
7
7
 
8
+ ## [12.39.7](https://github.com/oslokommune/punkt/compare/12.39.6...12.39.7) (2025-05-16)
9
+
10
+ ### ⚠ BREAKING CHANGES
11
+ Ingen
12
+
13
+ ### Features
14
+ Ingen
15
+
16
+ ### Bug Fixes
17
+ * [2559](https://github.com/oslokommune/punkt/issues/2559) #2560 #2561 Bugs i Accordion og Radiobutton (#2562).
18
+
19
+
20
+ ### Chores
21
+ Ingen
22
+
23
+ ---
24
+
25
+
26
+ ## [12.39.6](https://github.com/oslokommune/punkt/compare/12.39.5...12.39.6) (2025-05-16)
27
+
28
+ ### ⚠ BREAKING CHANGES
29
+ Ingen
30
+
31
+ ### Features
32
+ Ingen
33
+
34
+ ### Bug Fixes
35
+ Ingen
36
+
37
+ ### Chores
38
+ Ingen
39
+
40
+ ---
41
+
42
+
8
43
  ## [12.39.5](https://github.com/oslokommune/punkt/compare/12.39.4...12.39.5) (2025-05-16)
9
44
 
10
45
  ### ⚠ BREAKING CHANGES
@@ -1,4 +1,4 @@
1
- "use strict";const e=require("./element-BSypUpzA.cjs"),a=require("./input-element-CwUniARD.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-DK0UmdGZ.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-4hgBpSNJ.js";
2
+ import { P as k } from "./input-element-B2GjFOXX.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) => {
@@ -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-4hgBpSNJ.js";
7
+ import { P as V } from "./input-element-B2GjFOXX.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,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-CwUniARD.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-DK0UmdGZ.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}
@@ -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-CwUniARD.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-DK0UmdGZ.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}
@@ -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-4hgBpSNJ.js";
6
+ import { P as C } from "./input-element-B2GjFOXX.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";
package/dist/index.d.ts CHANGED
@@ -1017,7 +1017,6 @@ declare class PktRadioButton extends PktInputElement {
1017
1017
  _checked: boolean;
1018
1018
  connectedCallback(): void;
1019
1019
  attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
1020
- updated(changedProperties: PropertyValues): void;
1021
1020
  render(): TemplateResult<1>;
1022
1021
  private toggleChecked;
1023
1022
  }
@@ -46,7 +46,7 @@ class i extends c {
46
46
  if (!this.touched) return;
47
47
  const r = this.internals.form || this.closest("form"), h = r ? new FormData(r) : null;
48
48
  r && r.querySelectorAll(
49
- `pkt-radiobutton[name=${this.name}], input[type=radio][name=${this.name}]`
49
+ `pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`
50
50
  ).forEach((a) => {
51
51
  const l = a;
52
52
  l.name === this.name && l.value !== this.value && l.checked && (l.checked = !1);
@@ -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,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,4 +1,4 @@
1
- "use strict";const d=require("./class-map-DCyaICmy.cjs"),i=require("./element-BSypUpzA.cjs"),u=require("./state-B5KCNjEd.cjs"),k=require("./pkt-slot-controller-Da-RgXfS.cjs"),r=require("./ref-BvbyvXRH.cjs");require("./icon-BnKGwYjj.cjs");const m={hideCloseButton:{default:!1},closeOnBackdropClick:{default:!1},size:{default:"medium"}},h={props:m};var v=Object.defineProperty,g=Object.getOwnPropertyDescriptor,l=(c,t,e,o)=>{for(var s=o>1?void 0:o?g(t,e):t,n=c.length-1,a;n>=0;n--)(a=c[n])&&(s=(o?a(t,e,s):a(s))||s);return o&&s&&v(t,e,s),s};exports.PktModal=class extends i.PktElement{constructor(){super(),this.headingText="",this.removePadding=!1,this.hideCloseButton=h.props.hideCloseButton.default,this.closeOnBackdropClick=h.props.closeOnBackdropClick.default,this.closeButtonSkin="blue",this.size=h.props.size.default,this.variant="dialog",this.drawerPosition="right",this.transparentBackdrop=!1,this.defaultSlot=r.e(),this.dialogRef=r.e(),this._isOpen=!1,this.close=(t,e=!1)=>{var s;if(!this._isOpen)return;this._isOpen=!1,document.body.classList.remove("pkt-modal--open");const o=document.activeElement;o&&!this.isElementInViewport(o)&&o.scrollIntoView({behavior:"smooth",block:"nearest"}),this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!0,composed:!0})),e||(s=this.dialogRef.value)==null||s.close(),this.requestUpdate()},this.showModal=(t=null)=>{var o;this._isOpen=!0,(o=this.dialogRef.value)==null||o.showModal();const e=document.querySelector(".pkt-modal");requestAnimationFrame(()=>{var s;this.dialogRef.value&&((s=this.dialogRef.value)==null||s.focus())}),e&&document.body.classList.add("pkt-modal--open"),this.dispatchEvent(new CustomEvent("showModal",{detail:{origin:t},bubbles:!0,composed:!0})),this.requestUpdate()},this.slotController=new k.PktSlotController(this,this.defaultSlot),this._isOpen=!1}async connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleKeyDown.bind(this)),document.addEventListener("click",this.handleBackdropClick.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("click",this.handleBackdropClick)}async firstUpdated(t){super.firstUpdated(t),this.dialogRef.value&&!window.HTMLDialogElement&&!this.dialogRef.value.showModal&&("document"in window&&"createElement"in document&&(await Promise.resolve().then(()=>require("./dialog-polyfill.esm-CPKZe7AL.cjs")).then(o=>o.default)).registerDialog(this.dialogRef.value),this.dialogRef.value.addEventListener("close",()=>{this.close(new Event("close"),!0)}))}handleKeyDown(t){t.key==="Escape"&&this.close(t)}handleBackdropClick(t){var e,o;console.log("Event target:",t.target,(e=this.dialogRef)==null?void 0:e.value),this.closeOnBackdropClick&&t.target===((o=this.dialogRef)==null?void 0:o.value)&&this.close(t)}isElementInViewport(t){const e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}render(){const t={"pkt-modal":!0,"pkt-modal--removePadding":this.removePadding??!1,"pkt-modal--noHeadingText":this.headingText===""||this.headingText===void 0,"pkt-modal--noShadow":this.closeButtonSkin==="yellow-filled","pkt-modal--transparentBackdrop":this.transparentBackdrop??!1,[`pkt-modal--${this.size}`]:this.size!==void 0,[`pkt-modal__${this.variant}`]:this.variant!==void 0,[`pkt-modal__drawer--${this.drawerPosition}`]:this.variant==="drawer"},e={"pkt-modal__headingText":!0,"pkt-txt-24":!0},o={"pkt-modal__content":!0,"pkt-txt-18-light":!0},s=this.closeButtonSkin==="blue",n={"pkt-modal__closeButton":!0,[`pkt-modal__closeButton--${this.closeButtonSkin}`]:!0},a={"pkt-btn":!0,[`pkt-btn--${s?"tertiary":"primary"}`]:!0,"pkt-btn--icon-only":!0,"pkt-btn--medium":!0};return i.x`
1
+ "use strict";const d=require("./class-map-DCyaICmy.cjs"),o=require("./element-BSypUpzA.cjs"),u=require("./state-B5KCNjEd.cjs"),k=require("./pkt-slot-controller-Da-RgXfS.cjs"),r=require("./ref-BvbyvXRH.cjs");require("./icon-BnKGwYjj.cjs");const m={hideCloseButton:{default:!1},closeOnBackdropClick:{default:!1},size:{default:"medium"}},h={props:m};var v=Object.defineProperty,f=Object.getOwnPropertyDescriptor,l=(c,t,e,i)=>{for(var s=i>1?void 0:i?f(t,e):t,n=c.length-1,a;n>=0;n--)(a=c[n])&&(s=(i?a(t,e,s):a(s))||s);return i&&s&&v(t,e,s),s};exports.PktModal=class extends o.PktElement{constructor(){super(),this.headingText="",this.removePadding=!1,this.hideCloseButton=h.props.hideCloseButton.default,this.closeOnBackdropClick=h.props.closeOnBackdropClick.default,this.closeButtonSkin="blue",this.size=h.props.size.default,this.variant="dialog",this.drawerPosition="right",this.transparentBackdrop=!1,this.defaultSlot=r.e(),this.dialogRef=r.e(),this._isOpen=!1,this.close=(t,e=!1)=>{var s;if(!this._isOpen)return;this._isOpen=!1,document.body.classList.remove("pkt-modal--open");const i=document.activeElement;i&&!this.isElementInViewport(i)&&i.scrollIntoView({behavior:"smooth",block:"nearest"}),this.dispatchEvent(new CustomEvent("close",{detail:{origin:t},bubbles:!0,composed:!0})),e||(s=this.dialogRef.value)==null||s.close(),this.requestUpdate()},this.showModal=(t=null)=>{var i;this._isOpen=!0,(i=this.dialogRef.value)==null||i.showModal();const e=document.querySelector(".pkt-modal");requestAnimationFrame(()=>{var s;this.dialogRef.value&&((s=this.dialogRef.value)==null||s.focus())}),e&&document.body.classList.add("pkt-modal--open"),this.dispatchEvent(new CustomEvent("showModal",{detail:{origin:t},bubbles:!0,composed:!0})),this.requestUpdate()},this.slotController=new k.PktSlotController(this,this.defaultSlot),this._isOpen=!1}async connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleKeyDown.bind(this)),document.addEventListener("click",this.handleBackdropClick.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("click",this.handleBackdropClick)}async firstUpdated(t){super.firstUpdated(t),this.dialogRef.value&&!window.HTMLDialogElement&&!this.dialogRef.value.showModal&&("document"in window&&"createElement"in document&&(await Promise.resolve().then(()=>require("./dialog-polyfill.esm-CPKZe7AL.cjs")).then(i=>i.default)).registerDialog(this.dialogRef.value),this.dialogRef.value.addEventListener("close",()=>{this.close(new Event("close"),!0)}))}handleKeyDown(t){t.key==="Escape"&&this.close(t)}handleBackdropClick(t){var e;this.closeOnBackdropClick&&t.target===((e=this.dialogRef)==null?void 0:e.value)&&this.close(t)}isElementInViewport(t){const e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}render(){const t={"pkt-modal":!0,"pkt-modal--removePadding":this.removePadding??!1,"pkt-modal--noHeadingText":this.headingText===""||this.headingText===void 0,"pkt-modal--noShadow":this.closeButtonSkin==="yellow-filled","pkt-modal--transparentBackdrop":this.transparentBackdrop??!1,[`pkt-modal--${this.size}`]:this.size!==void 0,[`pkt-modal__${this.variant}`]:this.variant!==void 0,[`pkt-modal__drawer--${this.drawerPosition}`]:this.variant==="drawer"},e={"pkt-modal__headingText":!0,"pkt-txt-24":!0},i={"pkt-modal__content":!0,"pkt-txt-18-light":!0},s=this.closeButtonSkin==="blue",n={"pkt-modal__closeButton":!0,[`pkt-modal__closeButton--${this.closeButtonSkin}`]:!0},a={"pkt-btn":!0,[`pkt-btn--${s?"tertiary":"primary"}`]:!0,"pkt-btn--icon-only":!0,"pkt-btn--medium":!0};return o.x`
2
2
  <dialog
3
3
  class=${d.e(t)}
4
4
  ${r.n(this.dialogRef)}
@@ -7,12 +7,12 @@
7
7
  @close=${p=>this.close(p,!0)}
8
8
  >
9
9
  <div class="pkt-modal__wrapper">
10
- ${this.headingText||!this.hideCloseButton?i.x`<div class="pkt-modal__header">
10
+ ${this.headingText||!this.hideCloseButton?o.x`<div class="pkt-modal__header">
11
11
  <div class="pkt-modal__header-background"></div>
12
- ${this.headingText?i.x`<h1 id="pkt-modal__headingText" class=${d.e(e)}>
12
+ ${this.headingText?o.x`<h1 id="pkt-modal__headingText" class=${d.e(e)}>
13
13
  ${this.headingText}
14
- </h1>`:i.x`<div class="pkt-modal__headingText"></div>`}
15
- ${this.hideCloseButton?i.x`<div class="pkt-modal__noCloseButton"></div>`:i.x`<div class="${d.e(n)}">
14
+ </h1>`:o.x`<div class="pkt-modal__headingText"></div>`}
15
+ ${this.hideCloseButton?o.x`<div class="pkt-modal__noCloseButton"></div>`:o.x`<div class="${d.e(n)}">
16
16
  <pkt-button
17
17
  @click=${p=>this.close(p)}
18
18
  class=${d.e(a)}
@@ -23,14 +23,14 @@
23
23
  Lukk
24
24
  </pkt-button>
25
25
  </div>`}
26
- </div>`:i.E}
26
+ </div>`:o.E}
27
27
  <div class="pkt-modal__container">
28
28
  <div
29
29
  id="pkt-modal__content"
30
- class=${d.e(o)}
30
+ class=${d.e(i)}
31
31
  ${r.n(this.defaultSlot)}
32
32
  ></div>
33
33
  </div>
34
34
  </div>
35
35
  </dialog>
36
- `}};l([i.n({type:String})],exports.PktModal.prototype,"headingText",2);l([i.n({type:Boolean})],exports.PktModal.prototype,"removePadding",2);l([i.n({type:Boolean})],exports.PktModal.prototype,"hideCloseButton",2);l([i.n({type:Boolean})],exports.PktModal.prototype,"closeOnBackdropClick",2);l([i.n({type:String})],exports.PktModal.prototype,"closeButtonSkin",2);l([i.n({type:String})],exports.PktModal.prototype,"size",2);l([i.n({type:String})],exports.PktModal.prototype,"variant",2);l([i.n({type:String})],exports.PktModal.prototype,"drawerPosition",2);l([i.n({type:Boolean})],exports.PktModal.prototype,"transparentBackdrop",2);l([u.r()],exports.PktModal.prototype,"_isOpen",2);exports.PktModal=l([i.t("pkt-modal")],exports.PktModal);
36
+ `}};l([o.n({type:String})],exports.PktModal.prototype,"headingText",2);l([o.n({type:Boolean})],exports.PktModal.prototype,"removePadding",2);l([o.n({type:Boolean})],exports.PktModal.prototype,"hideCloseButton",2);l([o.n({type:Boolean})],exports.PktModal.prototype,"closeOnBackdropClick",2);l([o.n({type:String})],exports.PktModal.prototype,"closeButtonSkin",2);l([o.n({type:String})],exports.PktModal.prototype,"size",2);l([o.n({type:String})],exports.PktModal.prototype,"variant",2);l([o.n({type:String})],exports.PktModal.prototype,"drawerPosition",2);l([o.n({type:Boolean})],exports.PktModal.prototype,"transparentBackdrop",2);l([u.r()],exports.PktModal.prototype,"_isOpen",2);exports.PktModal=l([o.t("pkt-modal")],exports.PktModal);
@@ -1,5 +1,5 @@
1
1
  import { e as p } from "./class-map-KyMqi0fa.js";
2
- import { P as k, E as f, x as r, n, a as v } from "./element-DjjF_tEh.js";
2
+ import { P as k, E as f, x as r, n as l, a as v } from "./element-DjjF_tEh.js";
3
3
  import { r as g } from "./state-BtbpSrdV.js";
4
4
  import { P as _ } from "./pkt-slot-controller-DtDaD9q_.js";
5
5
  import { e as u, n as m } from "./ref-iIffqQAI.js";
@@ -17,30 +17,30 @@ const y = {
17
17
  }, h = {
18
18
  props: y
19
19
  };
20
- var w = Object.defineProperty, b = Object.getOwnPropertyDescriptor, a = (t, e, o, i) => {
21
- for (var l = i > 1 ? void 0 : i ? b(e, o) : e, c = t.length - 1, d; c >= 0; c--)
22
- (d = t[c]) && (l = (i ? d(e, o, l) : d(l)) || l);
23
- return i && l && w(e, o, l), l;
20
+ var w = Object.defineProperty, b = Object.getOwnPropertyDescriptor, a = (e, t, o, i) => {
21
+ for (var n = i > 1 ? void 0 : i ? b(t, o) : t, c = e.length - 1, d; c >= 0; c--)
22
+ (d = e[c]) && (n = (i ? d(t, o, n) : d(n)) || n);
23
+ return i && n && w(t, o, n), n;
24
24
  };
25
25
  let s = class extends k {
26
26
  constructor() {
27
- super(), this.headingText = "", this.removePadding = !1, this.hideCloseButton = h.props.hideCloseButton.default, this.closeOnBackdropClick = h.props.closeOnBackdropClick.default, this.closeButtonSkin = "blue", this.size = h.props.size.default, this.variant = "dialog", this.drawerPosition = "right", this.transparentBackdrop = !1, this.defaultSlot = u(), this.dialogRef = u(), this._isOpen = !1, this.close = (t, e = !1) => {
27
+ super(), this.headingText = "", this.removePadding = !1, this.hideCloseButton = h.props.hideCloseButton.default, this.closeOnBackdropClick = h.props.closeOnBackdropClick.default, this.closeButtonSkin = "blue", this.size = h.props.size.default, this.variant = "dialog", this.drawerPosition = "right", this.transparentBackdrop = !1, this.defaultSlot = u(), this.dialogRef = u(), this._isOpen = !1, this.close = (e, t = !1) => {
28
28
  var i;
29
29
  if (!this._isOpen) return;
30
30
  this._isOpen = !1, document.body.classList.remove("pkt-modal--open");
31
31
  const o = document.activeElement;
32
32
  o && !this.isElementInViewport(o) && o.scrollIntoView({ behavior: "smooth", block: "nearest" }), this.dispatchEvent(
33
- new CustomEvent("close", { detail: { origin: t }, bubbles: !0, composed: !0 })
34
- ), e || (i = this.dialogRef.value) == null || i.close(), this.requestUpdate();
35
- }, this.showModal = (t = null) => {
33
+ new CustomEvent("close", { detail: { origin: e }, bubbles: !0, composed: !0 })
34
+ ), t || (i = this.dialogRef.value) == null || i.close(), this.requestUpdate();
35
+ }, this.showModal = (e = null) => {
36
36
  var o;
37
37
  this._isOpen = !0, (o = this.dialogRef.value) == null || o.showModal();
38
- const e = document.querySelector(".pkt-modal");
38
+ const t = document.querySelector(".pkt-modal");
39
39
  requestAnimationFrame(() => {
40
40
  var i;
41
41
  this.dialogRef.value && ((i = this.dialogRef.value) == null || i.focus());
42
- }), e && document.body.classList.add("pkt-modal--open"), this.dispatchEvent(
43
- new CustomEvent("showModal", { detail: { origin: t }, bubbles: !0, composed: !0 })
42
+ }), t && document.body.classList.add("pkt-modal--open"), this.dispatchEvent(
43
+ new CustomEvent("showModal", { detail: { origin: e }, bubbles: !0, composed: !0 })
44
44
  ), this.requestUpdate();
45
45
  }, this.slotController = new _(this, this.defaultSlot), this._isOpen = !1;
46
46
  }
@@ -50,25 +50,25 @@ let s = class extends k {
50
50
  disconnectedCallback() {
51
51
  super.disconnectedCallback(), document.removeEventListener("keydown", this.handleKeyDown), document.removeEventListener("click", this.handleBackdropClick);
52
52
  }
53
- async firstUpdated(t) {
54
- super.firstUpdated(t), this.dialogRef.value && !window.HTMLDialogElement && !this.dialogRef.value.showModal && ("document" in window && "createElement" in document && (await import("./dialog-polyfill.esm-CbjBMXAG.js").then((o) => o.default)).registerDialog(this.dialogRef.value), this.dialogRef.value.addEventListener("close", () => {
53
+ async firstUpdated(e) {
54
+ super.firstUpdated(e), this.dialogRef.value && !window.HTMLDialogElement && !this.dialogRef.value.showModal && ("document" in window && "createElement" in document && (await import("./dialog-polyfill.esm-CbjBMXAG.js").then((o) => o.default)).registerDialog(this.dialogRef.value), this.dialogRef.value.addEventListener("close", () => {
55
55
  this.close(new Event("close"), !0);
56
56
  }));
57
57
  }
58
58
  // P R I V A T E M E T H O D S
59
- handleKeyDown(t) {
60
- t.key === "Escape" && this.close(t);
59
+ handleKeyDown(e) {
60
+ e.key === "Escape" && this.close(e);
61
61
  }
62
- handleBackdropClick(t) {
63
- var e, o;
64
- console.log("Event target:", t.target, (e = this.dialogRef) == null ? void 0 : e.value), this.closeOnBackdropClick && t.target === ((o = this.dialogRef) == null ? void 0 : o.value) && this.close(t);
62
+ handleBackdropClick(e) {
63
+ var t;
64
+ this.closeOnBackdropClick && e.target === ((t = this.dialogRef) == null ? void 0 : t.value) && this.close(e);
65
65
  }
66
- isElementInViewport(t) {
67
- const e = t.getBoundingClientRect();
68
- return e.top >= 0 && e.left >= 0 && e.bottom <= (window.innerHeight || document.documentElement.clientHeight) && e.right <= (window.innerWidth || document.documentElement.clientWidth);
66
+ isElementInViewport(e) {
67
+ const t = e.getBoundingClientRect();
68
+ return t.top >= 0 && t.left >= 0 && t.bottom <= (window.innerHeight || document.documentElement.clientHeight) && t.right <= (window.innerWidth || document.documentElement.clientWidth);
69
69
  }
70
70
  render() {
71
- const t = {
71
+ const e = {
72
72
  "pkt-modal": !0,
73
73
  "pkt-modal--removePadding": this.removePadding ?? !1,
74
74
  "pkt-modal--noHeadingText": this.headingText === "" || this.headingText === void 0,
@@ -77,13 +77,13 @@ let s = class extends k {
77
77
  [`pkt-modal--${this.size}`]: this.size !== void 0,
78
78
  [`pkt-modal__${this.variant}`]: this.variant !== void 0,
79
79
  [`pkt-modal__drawer--${this.drawerPosition}`]: this.variant === "drawer"
80
- }, e = {
80
+ }, t = {
81
81
  "pkt-modal__headingText": !0,
82
82
  "pkt-txt-24": !0
83
83
  }, o = {
84
84
  "pkt-modal__content": !0,
85
85
  "pkt-txt-18-light": !0
86
- }, i = this.closeButtonSkin === "blue", l = {
86
+ }, i = this.closeButtonSkin === "blue", n = {
87
87
  "pkt-modal__closeButton": !0,
88
88
  [`pkt-modal__closeButton--${this.closeButtonSkin}`]: !0
89
89
  }, c = {
@@ -94,7 +94,7 @@ let s = class extends k {
94
94
  };
95
95
  return r`
96
96
  <dialog
97
- class=${p(t)}
97
+ class=${p(e)}
98
98
  ${m(this.dialogRef)}
99
99
  aria-labelledby="pkt-modal__headingText"
100
100
  aria-describedby="pkt-modal__content"
@@ -103,10 +103,10 @@ let s = class extends k {
103
103
  <div class="pkt-modal__wrapper">
104
104
  ${this.headingText || !this.hideCloseButton ? r`<div class="pkt-modal__header">
105
105
  <div class="pkt-modal__header-background"></div>
106
- ${this.headingText ? r`<h1 id="pkt-modal__headingText" class=${p(e)}>
106
+ ${this.headingText ? r`<h1 id="pkt-modal__headingText" class=${p(t)}>
107
107
  ${this.headingText}
108
108
  </h1>` : r`<div class="pkt-modal__headingText"></div>`}
109
- ${this.hideCloseButton ? r`<div class="pkt-modal__noCloseButton"></div>` : r`<div class="${p(l)}">
109
+ ${this.hideCloseButton ? r`<div class="pkt-modal__noCloseButton"></div>` : r`<div class="${p(n)}">
110
110
  <pkt-button
111
111
  @click=${(d) => this.close(d)}
112
112
  class=${p(c)}
@@ -131,31 +131,31 @@ let s = class extends k {
131
131
  }
132
132
  };
133
133
  a([
134
- n({ type: String })
134
+ l({ type: String })
135
135
  ], s.prototype, "headingText", 2);
136
136
  a([
137
- n({ type: Boolean })
137
+ l({ type: Boolean })
138
138
  ], s.prototype, "removePadding", 2);
139
139
  a([
140
- n({ type: Boolean })
140
+ l({ type: Boolean })
141
141
  ], s.prototype, "hideCloseButton", 2);
142
142
  a([
143
- n({ type: Boolean })
143
+ l({ type: Boolean })
144
144
  ], s.prototype, "closeOnBackdropClick", 2);
145
145
  a([
146
- n({ type: String })
146
+ l({ type: String })
147
147
  ], s.prototype, "closeButtonSkin", 2);
148
148
  a([
149
- n({ type: String })
149
+ l({ type: String })
150
150
  ], s.prototype, "size", 2);
151
151
  a([
152
- n({ type: String })
152
+ l({ type: String })
153
153
  ], s.prototype, "variant", 2);
154
154
  a([
155
- n({ type: String })
155
+ l({ type: String })
156
156
  ], s.prototype, "drawerPosition", 2);
157
157
  a([
158
- n({ type: Boolean })
158
+ l({ type: Boolean })
159
159
  ], s.prototype, "transparentBackdrop", 2);
160
160
  a([
161
161
  g()
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./checkbox-zqd3KVfz.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-7ct89AUo.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-Ds1FrhqK.js";
1
+ import { P as o } from "./checkbox-D5fSFvhs.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-yUrUarU_.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-dwkB9Yv_.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-B6x7Qukm.js";
1
+ import { P as o } from "./combobox-DewmPXyJ.js";
2
2
  const b = o;
3
3
  export {
4
4
  o as PktCombobox,
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./datepicker-CH5ZmFhf.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-BDnncwne.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-WpOJS948.js";
1
+ import { P as t } from "./datepicker-CISpFZSs.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-C60j8BsA.cjs"),k=require("./calendar-CYY42kN4.cjs"),m=require("./card-Di1MQneh.cjs"),g=require("./combobox-yUrUarU_.cjs"),h=require("./consent-1ZSUrWK9.cjs"),f=require("./checkbox-zqd3KVfz.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-CH5ZmFhf.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-nesPZCIx.cjs"),$=require("./linkcard-s9yoOq90.cjs"),L=require("./loader-ndMy12Pb.cjs"),_=require("./messagebox-B0kgftoP.cjs"),A=require("./modal-CTh_wH8S.cjs"),B=require("./progressbar-DiRfScnB.cjs"),p=require("./radiobutton-CI2xaqAB.cjs"),T=require("./tag-B9kFYxHg.cjs"),I=require("./textarea-DxbylapQ.cjs"),M=require("./textinput-B__c4c1z.cjs"),R=require("./select-BCL790jM.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-C60j8BsA.cjs"),k=require("./calendar-CYY42kN4.cjs"),m=require("./card-Di1MQneh.cjs"),g=require("./combobox-dwkB9Yv_.cjs"),h=require("./consent-1ZSUrWK9.cjs"),f=require("./checkbox-7ct89AUo.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-BDnncwne.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-nesPZCIx.cjs"),$=require("./linkcard-s9yoOq90.cjs"),L=require("./loader-ndMy12Pb.cjs"),_=require("./messagebox-B0kgftoP.cjs"),A=require("./modal-C8GbUY8p.cjs"),B=require("./progressbar-DiRfScnB.cjs"),p=require("./radiobutton-DGWTMdAZ.cjs"),T=require("./tag-B9kFYxHg.cjs"),I=require("./textarea-yUzqcBYY.cjs"),M=require("./textinput-8mT0npMY.cjs"),R=require("./select-Brv7vglu.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
@@ -5,14 +5,14 @@ import { P as T } from "./button-BCCtR9ff.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-CZG7XGlj.js";
8
- import { P as K } from "./combobox-B6x7Qukm.js";
8
+ import { P as K } from "./combobox-DewmPXyJ.js";
9
9
  import { P as U } from "./consent-c6eWVBWx.js";
10
- import { P as q } from "./checkbox-Ds1FrhqK.js";
10
+ import { P as q } from "./checkbox-D5fSFvhs.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-WpOJS948.js";
15
+ import { P as F } from "./datepicker-CISpFZSs.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";
@@ -21,13 +21,13 @@ import { P as ot } from "./link-DCYJhFKJ.js";
21
21
  import { P as at } from "./linkcard-Bt-Qa_SP.js";
22
22
  import { P as it } from "./loader-DhmtCyQA.js";
23
23
  import { P as lt } from "./messagebox-DZDP8XZt.js";
24
- import { P as mt } from "./modal-C8qYfLqF.js";
24
+ import { P as mt } from "./modal-nU8cELiR.js";
25
25
  import { P as ft } from "./progressbar-BKt_aj7f.js";
26
- import { P as ht, P as ct } from "./radiobutton-CYJawqxD.js";
26
+ import { P as ht, P as ct } from "./radiobutton-CET0zjgD.js";
27
27
  import { P as ut } from "./tag-Cu8afZy8.js";
28
- import { P as vt } from "./textarea-B8H6-8qY.js";
29
- import { P as bt } from "./textinput-CPYLokFV.js";
30
- import { P as $t } from "./select-D3LR5zgE.js";
28
+ import { P as vt } from "./textarea-l10XGym1.js";
29
+ import { P as bt } from "./textinput-B1n0gFaS.js";
30
+ import { P as $t } from "./select-C36Z4gui.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 e=require("./modal-CTh_wH8S.cjs"),t=e.PktModal;Object.defineProperty(exports,"PktModal",{enumerable:!0,get:()=>e.PktModal});exports.default=t;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./modal-C8GbUY8p.cjs"),t=e.PktModal;Object.defineProperty(exports,"PktModal",{enumerable:!0,get:()=>e.PktModal});exports.default=t;
package/dist/pkt-modal.js CHANGED
@@ -1,4 +1,4 @@
1
- import { P as a } from "./modal-C8qYfLqF.js";
1
+ import { P as a } from "./modal-nU8cELiR.js";
2
2
  const t = a;
3
3
  export {
4
4
  a as PktModal,
@@ -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.5",
3
+ "version": "12.39.7",
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.7",
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": "1c97e7a7a152408f9574d3e95d5a4497a04317f6"
62
+ "gitHead": "504099164121e630280de133dfc4accf97765a8f"
63
63
  }
@@ -79,7 +79,6 @@ export class PktModal extends PktElement implements IPktModal {
79
79
  }
80
80
 
81
81
  private handleBackdropClick(event: MouseEvent) {
82
- console.log('Event target:', event.target, this.dialogRef?.value)
83
82
  if (this.closeOnBackdropClick && event.target === this.dialogRef?.value) {
84
83
  this.close(event)
85
84
  }
@@ -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 +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
- };