@oslokommune/punkt-elements 12.34.2 → 12.34.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/accordion.d.ts +0 -46
  3. package/dist/{accordionitem-Cg-LZy7n.js → accordionitem-Db-3WiJS.js} +3 -3
  4. package/dist/{accordionitem-DDnUkCJP.cjs → accordionitem-cvsySqgK.cjs} +1 -1
  5. package/dist/{alert-BOvwM-m4.js → alert-B5lVS6Qs.js} +5 -5
  6. package/dist/{alert-B3HuK30R.cjs → alert-DWIElKEZ.cjs} +1 -1
  7. package/dist/alert.d.ts +0 -46
  8. package/dist/{backlink-1p-ADrG8.cjs → backlink-HHM21crL.cjs} +1 -1
  9. package/dist/{backlink-fjBQGFYt.js → backlink-hvyJmwrO.js} +2 -2
  10. package/dist/backlink.d.ts +0 -46
  11. package/dist/{button-Cl6psvlo.js → button-B6uRE7uT.js} +2 -2
  12. package/dist/{button-5tOMyPEx.cjs → button-BNdVIhUp.cjs} +1 -1
  13. package/dist/button.d.ts +0 -46
  14. package/dist/{calendar-Bi49Yxom.js → calendar-mTDcujoj.js} +4 -4
  15. package/dist/{calendar-BU7DqDLG.cjs → calendar-oX4HJomV.cjs} +1 -1
  16. package/dist/calendar.d.ts +0 -46
  17. package/dist/{card-Dphjc_iO.js → card-B5zTEmH1.js} +6 -6
  18. package/dist/{card-a_Cs18EQ.cjs → card-BDcr3PII.cjs} +1 -1
  19. package/dist/card.d.ts +0 -46
  20. package/dist/{checkbox-bsBqWqcn.cjs → checkbox-CqatE-eX.cjs} +1 -1
  21. package/dist/{checkbox-nAnAn0E5.js → checkbox-CyYfA2fu.js} +4 -4
  22. package/dist/checkbox.d.ts +0 -46
  23. package/dist/{class-map-BjTUtIEl.cjs → class-map-DCyaICmy.cjs} +1 -1
  24. package/dist/{class-map-D4QK1bDP.js → class-map-KyMqi0fa.js} +1 -1
  25. package/dist/{combobox-CKmkM6tY.js → combobox-CELUAZxF.js} +129 -125
  26. package/dist/combobox-D9NKnao2.cjs +115 -0
  27. package/dist/combobox.d.ts +0 -46
  28. package/dist/{datepicker-DarYkBIy.js → datepicker-B6qk_tTl.js} +11 -11
  29. package/dist/{datepicker-DW6AdQ9X.cjs → datepicker-CskZMUib.cjs} +1 -1
  30. package/dist/datepicker.d.ts +0 -46
  31. package/dist/{directive-helpers-CVAnO9Xf.js → directive-helpers-8uS_Izwn.js} +1 -1
  32. package/dist/{directive-helpers-CQimZ5PA.cjs → directive-helpers-CG7Oxal3.cjs} +1 -1
  33. package/dist/element-BSypUpzA.cjs +238 -0
  34. package/dist/{element-J964Wi0N.js → element-DjjF_tEh.js} +6679 -6673
  35. package/dist/{helptext-qBgH0lvl.js → helptext-BLHAJ1aC.js} +5 -5
  36. package/dist/{helptext-OW48aGy8.cjs → helptext-CCnYxYA9.cjs} +1 -1
  37. package/dist/helptext.d.ts +0 -46
  38. package/dist/{icon-kSv2VoAB.js → icon-Beoxup8E.js} +1 -1
  39. package/dist/{icon-Cc4gVHxd.cjs → icon-BnKGwYjj.cjs} +1 -1
  40. package/dist/icon.d.ts +0 -46
  41. package/dist/{if-defined-DEXc_i_J.js → if-defined-BErSJCeJ.js} +1 -1
  42. package/dist/{if-defined-ZR_9IQ1L.cjs → if-defined-a3sotaUr.cjs} +1 -1
  43. package/dist/index.d.ts +0 -46
  44. package/dist/{input-element-BoUU9kvo.js → input-element-Bic-t96S.js} +2 -2
  45. package/dist/{input-element-BYE0qiMh.cjs → input-element-C9ma8cdz.cjs} +1 -1
  46. package/dist/{input-wrapper-CZI_ibQL.js → input-wrapper-CeeNYbDA.js} +6 -6
  47. package/dist/{input-wrapper-DmVnotQ2.cjs → input-wrapper-Cn929YTV.cjs} +1 -1
  48. package/dist/input-wrapper.d.ts +0 -46
  49. package/dist/{link-D1Nr-VBI.js → link-BYI8VNGd.js} +4 -4
  50. package/dist/{link-3uccc2MM.cjs → link-CnibgS3c.cjs} +1 -1
  51. package/dist/link.d.ts +0 -46
  52. package/dist/{linkcard-CTNdTxvV.js → linkcard--zuuAt_v.js} +3 -3
  53. package/dist/{linkcard-P1I3dzQb.cjs → linkcard-DPGX1kb1.cjs} +1 -1
  54. package/dist/linkcard.d.ts +0 -46
  55. package/dist/{listbox-B4tiuVzB.js → listbox-C1oYnM-t.js} +5 -5
  56. package/dist/{listbox-BQu6MjAp.cjs → listbox-DqpGh7eq.cjs} +1 -1
  57. package/dist/listbox.d.ts +0 -46
  58. package/dist/{loader-CM7wLajY.cjs → loader-BN4q8pSl.cjs} +1 -1
  59. package/dist/{loader-C0zNKIJ0.js → loader-DgIiyYBl.js} +5 -5
  60. package/dist/loader.d.ts +0 -46
  61. package/dist/{messagebox-CD8fS0Ym.cjs → messagebox-BWJr42m9.cjs} +1 -1
  62. package/dist/{messagebox-DyLx08sr.js → messagebox-cme5VbUM.js} +5 -5
  63. package/dist/messagebox.d.ts +0 -46
  64. package/dist/{modal-Dnv6Y4Nv.js → modal-B-varrJT.js} +5 -5
  65. package/dist/{modal-DOCsiHGv.cjs → modal-cPcTJriW.cjs} +1 -1
  66. package/dist/modal.d.ts +0 -46
  67. package/dist/pkt-accordion.cjs +1 -1
  68. package/dist/pkt-accordion.js +2 -2
  69. package/dist/pkt-alert.cjs +1 -1
  70. package/dist/pkt-alert.js +1 -1
  71. package/dist/pkt-backlink.cjs +1 -1
  72. package/dist/pkt-backlink.js +1 -1
  73. package/dist/pkt-button.cjs +1 -1
  74. package/dist/pkt-button.js +1 -1
  75. package/dist/pkt-calendar.cjs +1 -1
  76. package/dist/pkt-calendar.js +1 -1
  77. package/dist/pkt-card.cjs +1 -1
  78. package/dist/pkt-card.js +1 -1
  79. package/dist/pkt-checkbox.cjs +1 -1
  80. package/dist/pkt-checkbox.js +1 -1
  81. package/dist/pkt-combobox.cjs +1 -1
  82. package/dist/pkt-combobox.js +1 -1
  83. package/dist/pkt-datepicker.cjs +1 -1
  84. package/dist/pkt-datepicker.js +1 -1
  85. package/dist/pkt-helptext.cjs +1 -1
  86. package/dist/pkt-helptext.js +1 -1
  87. package/dist/pkt-icon.cjs +1 -1
  88. package/dist/pkt-icon.js +1 -1
  89. package/dist/pkt-index.cjs +1 -1
  90. package/dist/pkt-index.js +27 -27
  91. package/dist/pkt-input-wrapper.cjs +1 -1
  92. package/dist/pkt-input-wrapper.js +1 -1
  93. package/dist/pkt-link.cjs +1 -1
  94. package/dist/pkt-link.js +1 -1
  95. package/dist/pkt-linkcard.cjs +1 -1
  96. package/dist/pkt-linkcard.js +1 -1
  97. package/dist/pkt-listbox.cjs +1 -1
  98. package/dist/pkt-listbox.js +1 -1
  99. package/dist/pkt-loader.cjs +1 -1
  100. package/dist/pkt-loader.js +1 -1
  101. package/dist/pkt-messagebox.cjs +1 -1
  102. package/dist/pkt-messagebox.js +1 -1
  103. package/dist/pkt-modal.cjs +1 -1
  104. package/dist/pkt-modal.js +1 -1
  105. package/dist/pkt-progressbar.cjs +1 -1
  106. package/dist/pkt-progressbar.js +2 -2
  107. package/dist/pkt-radiobutton.cjs +1 -1
  108. package/dist/pkt-radiobutton.js +1 -1
  109. package/dist/pkt-select.cjs +1 -1
  110. package/dist/pkt-select.js +1 -1
  111. package/dist/pkt-tag.cjs +1 -1
  112. package/dist/pkt-tag.js +1 -1
  113. package/dist/pkt-textarea.cjs +1 -1
  114. package/dist/pkt-textarea.js +1 -1
  115. package/dist/pkt-textinput.cjs +1 -1
  116. package/dist/pkt-textinput.js +1 -1
  117. package/dist/{progressbar-D3sqQ5g1.js → progressbar-BKt_aj7f.js} +5 -5
  118. package/dist/{progressbar-BmI-K95y.cjs → progressbar-DiRfScnB.cjs} +1 -1
  119. package/dist/progressbar.d.ts +0 -46
  120. package/dist/{radiobutton-CJYNTtFF.cjs → radiobutton-CIW0FvT8.cjs} +1 -1
  121. package/dist/{radiobutton-Bat-fmTh.js → radiobutton-DtHuz7qn.js} +5 -5
  122. package/dist/radiobutton.d.ts +0 -46
  123. package/dist/{ref-BbKbXwub.cjs → ref-BvbyvXRH.cjs} +2 -2
  124. package/dist/{ref-3rhflVgg.js → ref-iIffqQAI.js} +10 -10
  125. package/dist/{repeat-DK_E7chz.cjs → repeat-BnuruAat.cjs} +1 -1
  126. package/dist/{repeat-CTBD0h6a.js → repeat-D4kMediE.js} +2 -2
  127. package/dist/{select-Swc0c6lZ.cjs → select-BJziJVde.cjs} +1 -1
  128. package/dist/{select-CVWm9dL1.js → select-DbRLz-7l.js} +6 -6
  129. package/dist/select.d.ts +0 -46
  130. package/dist/{state-y7tCw3bg.cjs → state-B5KCNjEd.cjs} +1 -1
  131. package/dist/{state-fdb9lRrL.js → state-BtbpSrdV.js} +1 -1
  132. package/dist/{tag-Dizhf3tl.js → tag-CGnj4c1Z.js} +6 -6
  133. package/dist/{tag-Dg2-c_OZ.cjs → tag-CgkUxA5D.cjs} +1 -1
  134. package/dist/tag.d.ts +0 -46
  135. package/dist/{textarea-DkQfMu1d.js → textarea-CiA4IzMs.js} +9 -9
  136. package/dist/{textarea-go_AyeP-.cjs → textarea-qX4Inr1X.cjs} +1 -1
  137. package/dist/textarea.d.ts +0 -46
  138. package/dist/{textinput-FvLq5W70.cjs → textinput-BlsgLNwW.cjs} +1 -1
  139. package/dist/{textinput-CyJB8IDv.js → textinput-CrxjZNEq.js} +8 -8
  140. package/dist/textinput.d.ts +0 -46
  141. package/package.json +5 -5
  142. package/src/components/combobox/combobox.ts +17 -3
  143. package/dist/combobox-DqHwVglB.cjs +0 -115
  144. package/dist/element-BYpg5e6C.cjs +0 -238
@@ -1,47 +1 @@
1
1
  export { }
2
-
3
-
4
- declare global {
5
- interface HTMLElementTagNameMap {
6
- 'pkt-icon': PktIcon;
7
- }
8
- }
9
-
10
-
11
- declare global {
12
- interface HTMLElementTagNameMap {
13
- 'pkt-combobox': PktCombobox & HTMLSelectElement;
14
- }
15
- }
16
-
17
-
18
- declare global {
19
- interface HTMLElementTagNameMap {
20
- 'pkt-listbox': PktListbox;
21
- }
22
- }
23
-
24
-
25
- /**
26
- * Pkt Select is a wrapper for the native select element using the pkt-input-wrapper component.
27
- *
28
- * The component will prioritize options passed as a prop over options passed as children if both are provided.
29
- * This is to allow for dynamic options that might change in the case of both children/slot and props are provided.
30
- *
31
- * @slot (default) - Options to be rendered as children
32
- * @prop {TSelectOption[]} options - Options to be rendered as children
33
- *
34
- *
35
- */
36
- declare global {
37
- interface HTMLElementTagNameMap {
38
- 'pkt-select': PktSelect & HTMLSelectElement;
39
- }
40
- }
41
-
42
-
43
- declare global {
44
- interface Window {
45
- pktTz: string;
46
- }
47
- }
@@ -1,4 +1,4 @@
1
- "use strict";const t=require("./element-BYpg5e6C.cjs"),a=require("./state-y7tCw3bg.cjs"),p=require("./input-element-BYE0qiMh.cjs"),d=require("./ref-BbKbXwub.cjs"),o=require("./class-map-BjTUtIEl.cjs");var k=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=(u,e,c,s)=>{for(var h=s>1?void 0:s?r(e,c):e,n=u.length-1,l;n>=0;n--)(l=u[n])&&(h=(s?l(e,c,h):l(h))||h);return s&&h&&k(e,c,h),h};exports.PktRadioButton=class extends p.PktInputElement{constructor(){super(...arguments),this.inputRef=d.e(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.checked=null,this.type="radio",this._checked=!1}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,c,s){e==="defaultChecked"&&(this._checked=this.defaultChecked),e==="checked"&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(e,c,s)}updated(e){e.has("checked")&&this.checked!==null&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0,(e.get("checked")===""||e.get("checked")==="true"||e.get("checked")===!0)!==this._checked&&this.toggleChecked()),super.updated(e)}render(){const e=o.e({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),c=o.e({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError});return t.x`
1
+ "use strict";const t=require("./element-BSypUpzA.cjs"),a=require("./state-B5KCNjEd.cjs"),p=require("./input-element-C9ma8cdz.cjs"),d=require("./ref-BvbyvXRH.cjs"),o=require("./class-map-DCyaICmy.cjs");var k=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=(u,e,c,s)=>{for(var h=s>1?void 0:s?r(e,c):e,n=u.length-1,l;n>=0;n--)(l=u[n])&&(h=(s?l(e,c,h):l(h))||h);return s&&h&&k(e,c,h),h};exports.PktRadioButton=class extends p.PktInputElement{constructor(){super(...arguments),this.inputRef=d.e(),this.value="",this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.checked=null,this.type="radio",this._checked=!1}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,c,s){e==="defaultChecked"&&(this._checked=this.defaultChecked),e==="checked"&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0),super.attributeChangedCallback(e,c,s)}updated(e){e.has("checked")&&this.checked!==null&&(this._checked=this.checked===""||this.checked==="true"||this.checked===!0,(e.get("checked")===""||e.get("checked")==="true"||e.get("checked")===!0)!==this._checked&&this.toggleChecked()),super.updated(e)}render(){const e=o.e({"pkt-input-check__input":!0,"pkt-input-check__input--tile":this.hasTile,"pkt-input-check__input--tile-disabled":this.disabled&&this.hasTile}),c=o.e({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError});return t.x`
2
2
  <div class="pkt-input-check">
3
3
  <div class=${e}>
4
4
  <input
@@ -1,8 +1,8 @@
1
- import { E as n, x as r, n as s, a as o } from "./element-J964Wi0N.js";
2
- import { r as k } from "./state-fdb9lRrL.js";
3
- import { P as f } from "./input-element-BoUU9kvo.js";
4
- import { e as _, n as b } from "./ref-3rhflVgg.js";
5
- import { e as a } from "./class-map-D4QK1bDP.js";
1
+ import { E as n, x as r, n as s, a as o } from "./element-DjjF_tEh.js";
2
+ import { r as k } from "./state-BtbpSrdV.js";
3
+ import { P as f } from "./input-element-Bic-t96S.js";
4
+ import { e as _, n as b } from "./ref-iIffqQAI.js";
5
+ import { e as a } from "./class-map-KyMqi0fa.js";
6
6
  var C = Object.defineProperty, v = Object.getOwnPropertyDescriptor, i = (e, t, l, p) => {
7
7
  for (var h = p > 1 ? void 0 : p ? v(t, l) : t, u = e.length - 1, d; u >= 0; u--)
8
8
  (d = e[u]) && (h = (p ? d(t, l, h) : d(h)) || h);
@@ -1,47 +1 @@
1
1
  export { }
2
-
3
-
4
- declare global {
5
- interface HTMLElementTagNameMap {
6
- 'pkt-icon': PktIcon;
7
- }
8
- }
9
-
10
-
11
- declare global {
12
- interface HTMLElementTagNameMap {
13
- 'pkt-combobox': PktCombobox & HTMLSelectElement;
14
- }
15
- }
16
-
17
-
18
- declare global {
19
- interface HTMLElementTagNameMap {
20
- 'pkt-listbox': PktListbox;
21
- }
22
- }
23
-
24
-
25
- /**
26
- * Pkt Select is a wrapper for the native select element using the pkt-input-wrapper component.
27
- *
28
- * The component will prioritize options passed as a prop over options passed as children if both are provided.
29
- * This is to allow for dynamic options that might change in the case of both children/slot and props are provided.
30
- *
31
- * @slot (default) - Options to be rendered as children
32
- * @prop {TSelectOption[]} options - Options to be rendered as children
33
- *
34
- *
35
- */
36
- declare global {
37
- interface HTMLElementTagNameMap {
38
- 'pkt-select': PktSelect & HTMLSelectElement;
39
- }
40
- }
41
-
42
-
43
- declare global {
44
- interface Window {
45
- pktTz: string;
46
- }
47
- }
@@ -1,4 +1,4 @@
1
- "use strict";const d=require("./element-BYpg5e6C.cjs"),a=require("./directive-helpers-CQimZ5PA.cjs"),l=require("./directive-C7oCP5Bh.cjs");/**
1
+ "use strict";const d=require("./element-BSypUpzA.cjs"),a=require("./directive-helpers-CG7Oxal3.cjs"),l=require("./directive-C7oCP5Bh.cjs");/**
2
2
  * @license
3
3
  * Copyright 2017 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
@@ -6,4 +6,4 @@
6
6
  * @license
7
7
  * Copyright 2020 Google LLC
8
8
  * SPDX-License-Identifier: BSD-3-Clause
9
- */const v=()=>new Y;class Y{}const r=new WeakMap,p=l.e(class extends A{render(t){return d.E}update(t,[e]){var i;const s=e!==this.Y;return s&&this.Y!==void 0&&this.rt(void 0),(s||this.lt!==this.ct)&&(this.Y=e,this.ht=(i=t.options)==null?void 0:i.host,this.rt(this.ct=t.element)),d.E}rt(t){if(this.isConnected||(t=void 0),typeof this.Y=="function"){const e=this.ht??globalThis;let s=r.get(e);s===void 0&&(s=new WeakMap,r.set(e,s)),s.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),s.set(this.Y,t),t!==void 0&&this.Y.call(this.ht,t)}else this.Y.value=t}get lt(){var t,e;return typeof this.Y=="function"?(t=r.get(this.ht??globalThis))==null?void 0:t.get(this.Y):(e=this.Y)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});exports.e=v;exports.n=p;
9
+ */const v=()=>new G;class G{}const r=new WeakMap,p=l.e(class extends A{render(t){return d.E}update(t,[e]){var i;const s=e!==this.G;return s&&this.G!==void 0&&this.rt(void 0),(s||this.lt!==this.ct)&&(this.G=e,this.ht=(i=t.options)==null?void 0:i.host,this.rt(this.ct=t.element)),d.E}rt(t){if(this.isConnected||(t=void 0),typeof this.G=="function"){const e=this.ht??globalThis;let s=r.get(e);s===void 0&&(s=new WeakMap,r.set(e,s)),s.get(this.G)!==void 0&&this.G.call(this.ht,void 0),s.set(this.G,t),t!==void 0&&this.G.call(this.ht,t)}else this.G.value=t}get lt(){var t,e;return typeof this.G=="function"?(t=r.get(this.ht??globalThis))==null?void 0:t.get(this.G):(e=this.G)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});exports.e=v;exports.n=p;
@@ -1,5 +1,5 @@
1
- import { E as l } from "./element-J964Wi0N.js";
2
- import { f as $ } from "./directive-helpers-CVAnO9Xf.js";
1
+ import { E as l } from "./element-DjjF_tEh.js";
2
+ import { f as $ } from "./directive-helpers-8uS_Izwn.js";
3
3
  import { i as f, t as a, e as _ } from "./directive-oAbCiebi.js";
4
4
  /**
5
5
  * @license
@@ -66,8 +66,8 @@ class p extends f {
66
66
  * Copyright 2020 Google LLC
67
67
  * SPDX-License-Identifier: BSD-3-Clause
68
68
  */
69
- const N = () => new Y();
70
- class Y {
69
+ const N = () => new G();
70
+ class G {
71
71
  }
72
72
  const c = /* @__PURE__ */ new WeakMap(), M = _(class extends p {
73
73
  render(t) {
@@ -75,19 +75,19 @@ const c = /* @__PURE__ */ new WeakMap(), M = _(class extends p {
75
75
  }
76
76
  update(t, [s]) {
77
77
  var i;
78
- const e = s !== this.Y;
79
- return e && this.Y !== void 0 && this.rt(void 0), (e || this.lt !== this.ct) && (this.Y = s, this.ht = (i = t.options) == null ? void 0 : i.host, this.rt(this.ct = t.element)), l;
78
+ const e = s !== this.G;
79
+ return e && this.G !== void 0 && this.rt(void 0), (e || this.lt !== this.ct) && (this.G = s, this.ht = (i = t.options) == null ? void 0 : i.host, this.rt(this.ct = t.element)), l;
80
80
  }
81
81
  rt(t) {
82
- if (this.isConnected || (t = void 0), typeof this.Y == "function") {
82
+ if (this.isConnected || (t = void 0), typeof this.G == "function") {
83
83
  const s = this.ht ?? globalThis;
84
84
  let e = c.get(s);
85
- e === void 0 && (e = /* @__PURE__ */ new WeakMap(), c.set(s, e)), e.get(this.Y) !== void 0 && this.Y.call(this.ht, void 0), e.set(this.Y, t), t !== void 0 && this.Y.call(this.ht, t);
86
- } else this.Y.value = t;
85
+ e === void 0 && (e = /* @__PURE__ */ new WeakMap(), c.set(s, e)), e.get(this.G) !== void 0 && this.G.call(this.ht, void 0), e.set(this.G, t), t !== void 0 && this.G.call(this.ht, t);
86
+ } else this.G.value = t;
87
87
  }
88
88
  get lt() {
89
89
  var t, s;
90
- return typeof this.Y == "function" ? (t = c.get(this.ht ?? globalThis)) == null ? void 0 : t.get(this.Y) : (s = this.Y) == null ? void 0 : s.value;
90
+ return typeof this.G == "function" ? (t = c.get(this.ht ?? globalThis)) == null ? void 0 : t.get(this.G) : (s = this.G) == null ? void 0 : s.value;
91
91
  }
92
92
  disconnected() {
93
93
  this.lt === this.ct && this.rt(void 0);
@@ -1,4 +1,4 @@
1
- "use strict";const m=require("./element-BYpg5e6C.cjs"),x=require("./directive-C7oCP5Bh.cjs"),s=require("./directive-helpers-CQimZ5PA.cjs");/**
1
+ "use strict";const m=require("./element-BSypUpzA.cjs"),x=require("./directive-C7oCP5Bh.cjs"),s=require("./directive-helpers-CG7Oxal3.cjs");/**
2
2
  * @license
3
3
  * Copyright 2017 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
@@ -1,6 +1,6 @@
1
- import { T as $ } from "./element-J964Wi0N.js";
1
+ import { T as $ } from "./element-DjjF_tEh.js";
2
2
  import { e as A, i as M, t as b } from "./directive-oAbCiebi.js";
3
- import { p as j, v as h, r as v, M as x, m as C } from "./directive-helpers-CVAnO9Xf.js";
3
+ import { p as j, v as h, r as v, M as x, m as C } from "./directive-helpers-8uS_Izwn.js";
4
4
  /**
5
5
  * @license
6
6
  * Copyright 2017 Google LLC
@@ -1,4 +1,4 @@
1
- "use strict";const r=require("./element-BYpg5e6C.cjs"),u=require("./state-y7tCw3bg.cjs"),l=require("./ref-BbKbXwub.cjs"),o=require("./if-defined-ZR_9IQ1L.cjs"),d=require("./input-element-BYE0qiMh.cjs"),c=require("./pkt-options-controller-TJ1apYGF.cjs"),$=require("./pkt-slot-controller-plQxXRvV.cjs");require("./input-wrapper-DmVnotQ2.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-C9ma8cdz.cjs"),c=require("./pkt-options-controller-TJ1apYGF.cjs"),$=require("./pkt-slot-controller-plQxXRvV.cjs");require("./input-wrapper-Cn929YTV.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}
@@ -1,11 +1,11 @@
1
- import { x as h, n as c, a as $ } from "./element-J964Wi0N.js";
2
- import { r as b } from "./state-fdb9lRrL.js";
3
- import { e as u, n as d } from "./ref-3rhflVgg.js";
4
- import { o as s } from "./if-defined-DEXc_i_J.js";
5
- import { P as v } from "./input-element-BoUU9kvo.js";
1
+ import { x as h, n as c, a as $ } from "./element-DjjF_tEh.js";
2
+ import { r as b } from "./state-BtbpSrdV.js";
3
+ import { e as u, n as d } from "./ref-iIffqQAI.js";
4
+ import { o as s } from "./if-defined-BErSJCeJ.js";
5
+ import { P as v } from "./input-element-Bic-t96S.js";
6
6
  import { P as f } from "./pkt-options-controller-CFmzX4xL.js";
7
7
  import { P as m } from "./pkt-slot-controller-DFrc5O93.js";
8
- import "./input-wrapper-CZI_ibQL.js";
8
+ import "./input-wrapper-CeeNYbDA.js";
9
9
  var g = Object.defineProperty, C = Object.getOwnPropertyDescriptor, a = (e, t, i, o) => {
10
10
  for (var r = o > 1 ? void 0 : o ? C(t, i) : t, n = e.length - 1, p; n >= 0; n--)
11
11
  (p = e[n]) && (r = (o ? p(t, i, r) : p(r)) || r);
package/dist/select.d.ts CHANGED
@@ -1,47 +1 @@
1
1
  export { }
2
-
3
-
4
- declare global {
5
- interface HTMLElementTagNameMap {
6
- 'pkt-icon': PktIcon;
7
- }
8
- }
9
-
10
-
11
- declare global {
12
- interface HTMLElementTagNameMap {
13
- 'pkt-combobox': PktCombobox & HTMLSelectElement;
14
- }
15
- }
16
-
17
-
18
- declare global {
19
- interface HTMLElementTagNameMap {
20
- 'pkt-listbox': PktListbox;
21
- }
22
- }
23
-
24
-
25
- /**
26
- * Pkt Select is a wrapper for the native select element using the pkt-input-wrapper component.
27
- *
28
- * The component will prioritize options passed as a prop over options passed as children if both are provided.
29
- * This is to allow for dynamic options that might change in the case of both children/slot and props are provided.
30
- *
31
- * @slot (default) - Options to be rendered as children
32
- * @prop {TSelectOption[]} options - Options to be rendered as children
33
- *
34
- *
35
- */
36
- declare global {
37
- interface HTMLElementTagNameMap {
38
- 'pkt-select': PktSelect & HTMLSelectElement;
39
- }
40
- }
41
-
42
-
43
- declare global {
44
- interface Window {
45
- pktTz: string;
46
- }
47
- }
@@ -1,4 +1,4 @@
1
- "use strict";const e=require("./element-BYpg5e6C.cjs");/**
1
+ "use strict";const e=require("./element-BSypUpzA.cjs");/**
2
2
  * @license
3
3
  * Copyright 2017 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
@@ -1,4 +1,4 @@
1
- import { n as r } from "./element-J964Wi0N.js";
1
+ import { n as r } from "./element-DjjF_tEh.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2017 Google LLC
@@ -1,10 +1,10 @@
1
- import { e as u } from "./class-map-D4QK1bDP.js";
2
- import { P as m, x as l, n as r, a as g } from "./element-J964Wi0N.js";
3
- import { r as k } from "./state-fdb9lRrL.js";
1
+ import { e as u } from "./class-map-KyMqi0fa.js";
2
+ import { P as m, x as l, n as r, a as g } from "./element-DjjF_tEh.js";
3
+ import { r as k } from "./state-BtbpSrdV.js";
4
4
  import { P as y } from "./pkt-slot-controller-DFrc5O93.js";
5
- import { e as b, n as f } from "./ref-3rhflVgg.js";
6
- import "./icon-kSv2VoAB.js";
7
- import { o as d } from "./if-defined-DEXc_i_J.js";
5
+ import { e as b, n as f } from "./ref-iIffqQAI.js";
6
+ import "./icon-Beoxup8E.js";
7
+ import { o as d } from "./if-defined-BErSJCeJ.js";
8
8
  const _ = {
9
9
  closeTag: {
10
10
  default: !1
@@ -1,4 +1,4 @@
1
- "use strict";const u=require("./class-map-BjTUtIEl.cjs"),t=require("./element-BYpg5e6C.cjs"),k=require("./state-y7tCw3bg.cjs"),g=require("./pkt-slot-controller-plQxXRvV.cjs"),c=require("./ref-BbKbXwub.cjs");require("./icon-Cc4gVHxd.cjs");const h=require("./if-defined-ZR_9IQ1L.cjs"),f={closeTag:{default:!1},size:{default:"medium"},skin:{default:"blue"},type:{default:"button"}},r={props:f};var d=Object.defineProperty,y=Object.getOwnPropertyDescriptor,i=(n,e,o,a)=>{for(var s=a>1?void 0:a?y(e,o):e,l=n.length-1,p;l>=0;l--)(p=n[l])&&(s=(a?p(e,o,s):p(s))||s);return a&&s&&d(e,o,s),s};exports.PktTag=class extends t.PktElement{constructor(){super(),this.defaultSlot=c.e(),this.closeTag=r.props.closeTag.default,this.size=r.props.size.default,this.skin=r.props.skin.default,this.textStyle=null,this.iconName=void 0,this.type=r.props.type.default,this.ariaLabel=null,this._isClosed=!1,this._ariaDescription=null,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:e},bubbles:!0,composed:!0}))},this.slotController=new g.PktSlotController(this,this.defaultSlot),this._isClosed=!1}firstUpdated(e){var o,a;if(super.firstUpdated(e),this.closeTag&&!this.ariaLabel){const s=(a=(o=this.defaultSlot.value)==null?void 0:o.textContent)==null?void 0:a.trim();s&&(this._ariaDescription=`Klikk for å fjerne ${s}`)}}render(){const e={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},o={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${this.textStyle}`]:!!this.textStyle,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,"pkt-btn--icons-right-and-left":this.closeTag&&!!this.iconName,"pkt-hide":this._isClosed};return this.closeTag?t.x`
1
+ "use strict";const u=require("./class-map-DCyaICmy.cjs"),t=require("./element-BSypUpzA.cjs"),k=require("./state-B5KCNjEd.cjs"),g=require("./pkt-slot-controller-plQxXRvV.cjs"),c=require("./ref-BvbyvXRH.cjs");require("./icon-BnKGwYjj.cjs");const h=require("./if-defined-a3sotaUr.cjs"),f={closeTag:{default:!1},size:{default:"medium"},skin:{default:"blue"},type:{default:"button"}},r={props:f};var d=Object.defineProperty,y=Object.getOwnPropertyDescriptor,i=(n,e,o,a)=>{for(var s=a>1?void 0:a?y(e,o):e,l=n.length-1,p;l>=0;l--)(p=n[l])&&(s=(a?p(e,o,s):p(s))||s);return a&&s&&d(e,o,s),s};exports.PktTag=class extends t.PktElement{constructor(){super(),this.defaultSlot=c.e(),this.closeTag=r.props.closeTag.default,this.size=r.props.size.default,this.skin=r.props.skin.default,this.textStyle=null,this.iconName=void 0,this.type=r.props.type.default,this.ariaLabel=null,this._isClosed=!1,this._ariaDescription=null,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent("close",{detail:{origin:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("on-close",{detail:{origin:e},bubbles:!0,composed:!0}))},this.slotController=new g.PktSlotController(this,this.defaultSlot),this._isClosed=!1}firstUpdated(e){var o,a;if(super.firstUpdated(e),this.closeTag&&!this.ariaLabel){const s=(a=(o=this.defaultSlot.value)==null?void 0:o.textContent)==null?void 0:a.trim();s&&(this._ariaDescription=`Klikk for å fjerne ${s}`)}}render(){const e={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},o={"pkt-tag":!0,"pkt-btn":!0,"pkt-btn--tertiary":!0,[`pkt-tag--${this.textStyle}`]:!!this.textStyle,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,"pkt-btn--icons-right-and-left":this.closeTag&&!!this.iconName,"pkt-hide":this._isClosed};return this.closeTag?t.x`
2
2
  <button
3
3
  class=${u.e(o)}
4
4
  type=${this.type}
package/dist/tag.d.ts CHANGED
@@ -1,47 +1 @@
1
1
  export { }
2
-
3
-
4
- declare global {
5
- interface HTMLElementTagNameMap {
6
- 'pkt-icon': PktIcon;
7
- }
8
- }
9
-
10
-
11
- declare global {
12
- interface HTMLElementTagNameMap {
13
- 'pkt-combobox': PktCombobox & HTMLSelectElement;
14
- }
15
- }
16
-
17
-
18
- declare global {
19
- interface HTMLElementTagNameMap {
20
- 'pkt-listbox': PktListbox;
21
- }
22
- }
23
-
24
-
25
- /**
26
- * Pkt Select is a wrapper for the native select element using the pkt-input-wrapper component.
27
- *
28
- * The component will prioritize options passed as a prop over options passed as children if both are provided.
29
- * This is to allow for dynamic options that might change in the case of both children/slot and props are provided.
30
- *
31
- * @slot (default) - Options to be rendered as children
32
- * @prop {TSelectOption[]} options - Options to be rendered as children
33
- *
34
- *
35
- */
36
- declare global {
37
- interface HTMLElementTagNameMap {
38
- 'pkt-select': PktSelect & HTMLSelectElement;
39
- }
40
- }
41
-
42
-
43
- declare global {
44
- interface Window {
45
- pktTz: string;
46
- }
47
- }
@@ -1,14 +1,14 @@
1
- import { T as l, E as $, x as f, n as d, a as g } from "./element-J964Wi0N.js";
2
- import { o as u } from "./if-defined-DEXc_i_J.js";
3
- import { r as x } from "./state-fdb9lRrL.js";
4
- import { e as m, n as c } from "./ref-3rhflVgg.js";
5
- import { e as v } from "./class-map-D4QK1bDP.js";
1
+ import { T as l, E as $, x as f, n as d, a as g } from "./element-DjjF_tEh.js";
2
+ import { o as u } from "./if-defined-BErSJCeJ.js";
3
+ import { r as x } from "./state-BtbpSrdV.js";
4
+ import { e as m, n as c } from "./ref-iIffqQAI.js";
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
- import { f as y, m as w } from "./directive-helpers-CVAnO9Xf.js";
8
- import { P as C } from "./input-element-BoUU9kvo.js";
7
+ import { f as y, m as w } from "./directive-helpers-8uS_Izwn.js";
8
+ import { P as C } from "./input-element-Bic-t96S.js";
9
9
  import { P as E } from "./pkt-slot-controller-DFrc5O93.js";
10
- import "./input-wrapper-CZI_ibQL.js";
11
- import "./icon-kSv2VoAB.js";
10
+ import "./input-wrapper-CeeNYbDA.js";
11
+ import "./icon-Beoxup8E.js";
12
12
  /**
13
13
  * @license
14
14
  * Copyright 2020 Google LLC
@@ -1,4 +1,4 @@
1
- "use strict";const s=require("./element-BYpg5e6C.cjs"),p=require("./if-defined-ZR_9IQ1L.cjs"),c=require("./state-y7tCw3bg.cjs"),l=require("./ref-BbKbXwub.cjs"),$=require("./class-map-BjTUtIEl.cjs"),a=require("./directive-C7oCP5Bh.cjs"),d=require("./directive-helpers-CQimZ5PA.cjs"),x=require("./input-element-BYE0qiMh.cjs"),T=require("./pkt-slot-controller-plQxXRvV.cjs");require("./input-wrapper-DmVnotQ2.cjs");require("./icon-Cc4gVHxd.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-C9ma8cdz.cjs"),T=require("./pkt-slot-controller-plQxXRvV.cjs");require("./input-wrapper-Cn929YTV.cjs");require("./icon-BnKGwYjj.cjs");/**
2
2
  * @license
3
3
  * Copyright 2020 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
@@ -1,47 +1 @@
1
1
  export { }
2
-
3
-
4
- declare global {
5
- interface HTMLElementTagNameMap {
6
- 'pkt-icon': PktIcon;
7
- }
8
- }
9
-
10
-
11
- declare global {
12
- interface HTMLElementTagNameMap {
13
- 'pkt-combobox': PktCombobox & HTMLSelectElement;
14
- }
15
- }
16
-
17
-
18
- declare global {
19
- interface HTMLElementTagNameMap {
20
- 'pkt-listbox': PktListbox;
21
- }
22
- }
23
-
24
-
25
- /**
26
- * Pkt Select is a wrapper for the native select element using the pkt-input-wrapper component.
27
- *
28
- * The component will prioritize options passed as a prop over options passed as children if both are provided.
29
- * This is to allow for dynamic options that might change in the case of both children/slot and props are provided.
30
- *
31
- * @slot (default) - Options to be rendered as children
32
- * @prop {TSelectOption[]} options - Options to be rendered as children
33
- *
34
- *
35
- */
36
- declare global {
37
- interface HTMLElementTagNameMap {
38
- 'pkt-select': PktSelect & HTMLSelectElement;
39
- }
40
- }
41
-
42
-
43
- declare global {
44
- interface Window {
45
- pktTz: string;
46
- }
47
- }
@@ -1,4 +1,4 @@
1
- "use strict";const t=require("./element-BYpg5e6C.cjs"),u=require("./if-defined-ZR_9IQ1L.cjs"),l=require("./state-y7tCw3bg.cjs"),p=require("./ref-BbKbXwub.cjs"),c=require("./class-map-BjTUtIEl.cjs"),d=require("./input-element-BYE0qiMh.cjs"),x=require("./pkt-slot-controller-plQxXRvV.cjs");require("./input-wrapper-DmVnotQ2.cjs");require("./icon-Cc4gVHxd.cjs");var $=Object.defineProperty,g=Object.getOwnPropertyDescriptor,r=(o,i,s,n)=>{for(var e=n>1?void 0:n?g(i,s):i,a=o.length-1,h;a>=0;a--)(h=o[a])&&(e=(n?h(i,s,e):h(e))||e);return n&&e&&$(i,s,e),e};exports.PktTextinput=class extends d.PktInputElement{constructor(){super(),this.inputRef=p.e(),this.helptextSlot=p.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"),p=require("./ref-BvbyvXRH.cjs"),c=require("./class-map-DCyaICmy.cjs"),d=require("./input-element-C9ma8cdz.cjs"),x=require("./pkt-slot-controller-plQxXRvV.cjs");require("./input-wrapper-Cn929YTV.cjs");require("./icon-BnKGwYjj.cjs");var $=Object.defineProperty,g=Object.getOwnPropertyDescriptor,r=(o,i,s,n)=>{for(var e=n>1?void 0:n?g(i,s):i,a=o.length-1,h;a>=0;a--)(h=o[a])&&(e=(n?h(i,s,e):h(e))||e);return n&&e&&$(i,s,e),e};exports.PktTextinput=class extends d.PktInputElement{constructor(){super(),this.inputRef=p.e(),this.helptextSlot=p.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}
@@ -1,12 +1,12 @@
1
- import { E as p, x as h, n as o, a as $ } from "./element-J964Wi0N.js";
2
- import { o as c } from "./if-defined-DEXc_i_J.js";
3
- import { r as f } from "./state-fdb9lRrL.js";
4
- import { e as d, n as m } from "./ref-3rhflVgg.js";
5
- import { e as g } from "./class-map-D4QK1bDP.js";
6
- import { P as x } from "./input-element-BoUU9kvo.js";
1
+ import { E as p, x as h, n as o, a as $ } from "./element-DjjF_tEh.js";
2
+ import { o as c } from "./if-defined-BErSJCeJ.js";
3
+ import { r as f } from "./state-BtbpSrdV.js";
4
+ import { e as d, n as m } from "./ref-iIffqQAI.js";
5
+ import { e as g } from "./class-map-KyMqi0fa.js";
6
+ import { P as x } from "./input-element-Bic-t96S.js";
7
7
  import { P as y } from "./pkt-slot-controller-DFrc5O93.js";
8
- import "./input-wrapper-CZI_ibQL.js";
9
- import "./icon-kSv2VoAB.js";
8
+ import "./input-wrapper-CeeNYbDA.js";
9
+ import "./icon-Beoxup8E.js";
10
10
  var v = Object.defineProperty, b = Object.getOwnPropertyDescriptor, n = (e, i, r, t) => {
11
11
  for (var a = t > 1 ? void 0 : t ? b(i, r) : i, l = e.length - 1, u; l >= 0; l--)
12
12
  (u = e[l]) && (a = (t ? u(i, r, a) : u(a)) || a);
@@ -1,47 +1 @@
1
1
  export { }
2
-
3
-
4
- declare global {
5
- interface HTMLElementTagNameMap {
6
- 'pkt-icon': PktIcon;
7
- }
8
- }
9
-
10
-
11
- declare global {
12
- interface HTMLElementTagNameMap {
13
- 'pkt-combobox': PktCombobox & HTMLSelectElement;
14
- }
15
- }
16
-
17
-
18
- declare global {
19
- interface HTMLElementTagNameMap {
20
- 'pkt-listbox': PktListbox;
21
- }
22
- }
23
-
24
-
25
- /**
26
- * Pkt Select is a wrapper for the native select element using the pkt-input-wrapper component.
27
- *
28
- * The component will prioritize options passed as a prop over options passed as children if both are provided.
29
- * This is to allow for dynamic options that might change in the case of both children/slot and props are provided.
30
- *
31
- * @slot (default) - Options to be rendered as children
32
- * @prop {TSelectOption[]} options - Options to be rendered as children
33
- *
34
- *
35
- */
36
- declare global {
37
- interface HTMLElementTagNameMap {
38
- 'pkt-select': PktSelect & HTMLSelectElement;
39
- }
40
- }
41
-
42
-
43
- declare global {
44
- interface Window {
45
- pktTz: string;
46
- }
47
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-elements",
3
- "version": "12.34.2",
3
+ "version": "12.34.4",
4
4
  "description": "Komponentbiblioteket til Punkt, et designsystem laget av Oslo Origo",
5
5
  "homepage": "https://punkt.oslo.kommune.no",
6
6
  "author": "Team Designsystem, Oslo Origo",
@@ -24,13 +24,13 @@
24
24
  "@date-fns/tz": "^1.2.0",
25
25
  "@lit-labs/router": "^0.1.3",
26
26
  "date-fns": "^4.1.0",
27
- "lit": "^3.1.2",
27
+ "lit": "^3.3.0",
28
28
  "react-dom": ">=18.2.22",
29
29
  "urlpattern-polyfill": "^10.0.0"
30
30
  },
31
31
  "devDependencies": {
32
- "@oslokommune/punkt-assets": "^12.30.1",
33
- "@oslokommune/punkt-css": "^12.34.2",
32
+ "@oslokommune/punkt-assets": "^12.34.4",
33
+ "@oslokommune/punkt-css": "^12.34.4",
34
34
  "sass": "^1.78.0",
35
35
  "typescript": "^5.6.2",
36
36
  "vite": "^5.4.18",
@@ -57,5 +57,5 @@
57
57
  "url": "https://github.com/oslokommune/punkt/issues"
58
58
  },
59
59
  "license": "MIT",
60
- "gitHead": "780c78ea4619450ddd43ba97183c2eb239a53524"
60
+ "gitHead": "437c77a182d85a710e0d5adbf492ea7585a0d472"
61
61
  }
@@ -159,8 +159,16 @@ export class PktCombobox extends PktInputElement implements IPktCombobox {
159
159
  if (changedProperties.has('options') && this.options.length) {
160
160
  this._options = this.options
161
161
  this._options.forEach((option) => {
162
+ if (option.value && !option.label) {
163
+ option.label = option.value
164
+ }
165
+ if (option.selected && !this._value.includes(option.value)) {
166
+ const oldValue = [...this._value]
167
+ this._value = [...this._value, option.value]
168
+ this.valueChanged(this._value, oldValue)
169
+ }
162
170
  option.fulltext = option.value + option.label + (option.prefix || '')
163
- option.selected = this._value.includes(option.value)
171
+ option.selected = option.selected || this._value.includes(option.value)
164
172
  })
165
173
  }
166
174
  if (changedProperties.has('_search')) {
@@ -184,6 +192,12 @@ export class PktCombobox extends PktInputElement implements IPktCombobox {
184
192
  if (name === 'options') {
185
193
  this._options = this.options
186
194
  this._options.forEach((option) => {
195
+ if (option.value && !option.label) {
196
+ option.label = option.value
197
+ }
198
+ if (option.selected && !this._value.includes(option.value)) {
199
+ this._value = [...this._value, option.value]
200
+ }
187
201
  option.fulltext = option.value + option.label + (option.prefix || '')
188
202
  })
189
203
  this._search = ''
@@ -340,8 +354,8 @@ export class PktCombobox extends PktInputElement implements IPktCombobox {
340
354
  // Multiple vises som tags
341
355
  const multipleValuesContent = repeat(
342
356
  this._value,
343
- (value) => value,
344
- (value) => {
357
+ (value: string) => value,
358
+ (value: string) => {
345
359
  const option = this.findValueInOptions(value)
346
360
  const tagSkinColor = this.options.find((o) => o.value === value)?.tagSkinColor
347
361
  return html`