@oslokommune/punkt-elements 16.18.0 → 16.19.0

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 (189) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/{accordion-CU2tJ5vn.js → accordion-BjYsEbSM.js} +19 -19
  3. package/dist/{accordion-DDZkjXFb.cjs → accordion-DaeWPWod.cjs} +5 -5
  4. package/dist/{alert-D_eXGOez.js → alert-BkzC5mVu.js} +22 -22
  5. package/dist/{alert-NyLr62jZ.cjs → alert-D_45dWPn.cjs} +6 -6
  6. package/dist/{async-directive-CaQiqjyV.js → async-directive-Cz6tcqge.js} +2 -2
  7. package/dist/async-directive-DO1QtVmf.cjs +1 -0
  8. package/dist/{backlink-CTu44BHn.js → backlink-BXAdgAte.js} +6 -6
  9. package/dist/{backlink-BsQ0Rmxj.cjs → backlink-C42-3OG3.cjs} +2 -2
  10. package/dist/{breadcrumbs-BNZ1L-0q.cjs → breadcrumbs-CkjeLh3U.cjs} +6 -6
  11. package/dist/{breadcrumbs-DPnoURvl.js → breadcrumbs-Dkb9TxMp.js} +15 -15
  12. package/dist/{button-ZYlrRRfu.js → button-CR-KWhTT.js} +21 -21
  13. package/dist/{button-DsGvcLIn.cjs → button-Dwv11n6R.cjs} +7 -7
  14. package/dist/{calendar-CDDVoUby.cjs → calendar-Buvxe4l_.cjs} +11 -11
  15. package/dist/{calendar-VOqO5um6.js → calendar-DAq6iJdx.js} +50 -50
  16. package/dist/{card-B4oDGIRP.js → card-5PydU247.js} +43 -43
  17. package/dist/{card-DZuZy0ay.cjs → card-C__IlsUa.cjs} +26 -26
  18. package/dist/{checkbox-CF5mSBR5.js → checkbox-CC1X7fw4.js} +23 -23
  19. package/dist/{checkbox-BerAYcfK.cjs → checkbox-DzMc0AJX.cjs} +10 -10
  20. package/dist/class-map-B8Ja0q7n.cjs +1 -0
  21. package/dist/{class-map-C8HuhNzZ.js → class-map-DH9hlJny.js} +7 -8
  22. package/dist/{combobox-BDYoPZmg.js → combobox-D-DY7YcW.js} +42 -42
  23. package/dist/{combobox-Ct9gCFa1.cjs → combobox-x4tBGP3F.cjs} +17 -17
  24. package/dist/components/heading/heading.d.ts +5 -8
  25. package/dist/{consent-BME_rQ2w.cjs → consent-BB3g_ByO.cjs} +3 -3
  26. package/dist/{consent-1IUuWZAh.js → consent-Y14WZ0JS.js} +8 -8
  27. package/dist/{datepicker-ByqXCpCd.cjs → datepicker-BFI-3stE.cjs} +20 -20
  28. package/dist/{datepicker-BGpoabCM.js → datepicker-CRk7aiwH.js} +57 -57
  29. package/dist/{directive-helpers-Dkv2gKgs.js → directive-helpers-Cep_4cpj.js} +1 -1
  30. package/dist/{directive-helpers-D1QSxY17.cjs → directive-helpers-f36YZFOG.cjs} +1 -1
  31. package/dist/element-CXAtr6Gu.cjs +2 -0
  32. package/dist/{element-cZ85T_aa.js → element-CduG0XyF.js} +47 -23
  33. package/dist/{element-with-slot-4J2o3SeU.js → element-with-slot-BVj9MXzi.js} +5 -6
  34. package/dist/element-with-slot-Cmxb9h4H.cjs +1 -0
  35. package/dist/{fileupload-B6W7qOQT.js → fileupload-C8muj8qd.js} +149 -149
  36. package/dist/{fileupload-a2OL3dzG.cjs → fileupload-YtsrgQTY.cjs} +40 -40
  37. package/dist/{header-BZFSan0_.cjs → header-CjBip0zj.cjs} +57 -57
  38. package/dist/{header-BgVpJMHQ.js → header-DONTGbD9.js} +130 -130
  39. package/dist/{header-menu-BXzVVOHq.js → header-menu-BU-ylGrJ.js} +45 -45
  40. package/dist/{header-menu-BLngov1D.cjs → header-menu-CnW7nzmF.cjs} +24 -24
  41. package/dist/heading-3o4Dk0Wn.js +80 -0
  42. package/dist/heading-C40-NX0r.cjs +1 -0
  43. package/dist/{helptext-BeU-enix.js → helptext-C2aQBBo_.js} +12 -12
  44. package/dist/{helptext-DWMFqMnV.cjs → helptext-DNLg43eI.cjs} +4 -4
  45. package/dist/icon-Dw6I0HDV.cjs +1 -0
  46. package/dist/{icon-CZQkrK6B.js → icon-LaKyBKON.js} +18 -19
  47. package/dist/if-defined-LTjAScFG.cjs +1 -0
  48. package/dist/{if-defined-Cjj8qN-Z.js → if-defined-VShASPdu.js} +1 -1
  49. package/dist/{input-element-D0egtEnr.cjs → input-element-BHQVt4Q9.cjs} +1 -1
  50. package/dist/{input-element-B1ciW1N2.js → input-element-BrmkXIXi.js} +30 -30
  51. package/dist/{input-wrapper-oYcbCFow.js → input-wrapper-B6WowlWG.js} +33 -33
  52. package/dist/{input-wrapper-Y98KV-sy.cjs → input-wrapper-Dhkt20WW.cjs} +17 -17
  53. package/dist/{link-BMMIjg50.cjs → link-B5ur0Rym.cjs} +4 -4
  54. package/dist/{link-CT0LB3S7.js → link-ClUNY__5.js} +13 -13
  55. package/dist/linkcard-BIcCW-qw.cjs +13 -0
  56. package/dist/{linkcard-Bz5zb69P.js → linkcard-DNJm5FvA.js} +15 -15
  57. package/dist/{listbox-0NHJvNjz.js → listbox-DXMIBv3y.js} +35 -35
  58. package/dist/{listbox-CcThiNBY.cjs → listbox-DbEobJNx.cjs} +14 -14
  59. package/dist/{loader-8T6M0FCQ.cjs → loader-Uap9qDsV.cjs} +5 -5
  60. package/dist/{loader-Cbrc4FFx.js → loader-gKdQpOOQ.js} +12 -12
  61. package/dist/{messagebox-C6LHT78_.cjs → messagebox-BqBxXK8c.cjs} +5 -5
  62. package/dist/{messagebox-TKKUVTo4.js → messagebox-XRFecqyS.js} +15 -15
  63. package/dist/{modal-BVHH8koz.js → modal-CWgeT-RP.js} +19 -19
  64. package/dist/{modal-CRzbtqL3.cjs → modal-CrYHKOmr.cjs} +8 -8
  65. package/dist/pkt-accordion.cjs +1 -1
  66. package/dist/pkt-accordion.js +1 -1
  67. package/dist/pkt-alert.cjs +1 -1
  68. package/dist/pkt-alert.js +1 -1
  69. package/dist/pkt-backlink.cjs +1 -1
  70. package/dist/pkt-backlink.js +1 -1
  71. package/dist/pkt-breadcrumbs.cjs +1 -1
  72. package/dist/pkt-breadcrumbs.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-consent.cjs +1 -1
  84. package/dist/pkt-consent.js +1 -1
  85. package/dist/pkt-datepicker.cjs +1 -1
  86. package/dist/pkt-datepicker.js +1 -1
  87. package/dist/pkt-fileupload.cjs +1 -1
  88. package/dist/pkt-fileupload.js +1 -1
  89. package/dist/pkt-header-menu.cjs +1 -1
  90. package/dist/pkt-header-menu.js +1 -1
  91. package/dist/pkt-header.cjs +1 -1
  92. package/dist/pkt-header.js +1 -1
  93. package/dist/pkt-heading.cjs +1 -1
  94. package/dist/pkt-heading.js +1 -1
  95. package/dist/pkt-helptext.cjs +1 -1
  96. package/dist/pkt-helptext.js +1 -1
  97. package/dist/pkt-icon.cjs +1 -1
  98. package/dist/pkt-icon.js +1 -1
  99. package/dist/pkt-index.cjs +1 -1
  100. package/dist/pkt-index.js +32 -32
  101. package/dist/pkt-input-wrapper.cjs +1 -1
  102. package/dist/pkt-input-wrapper.js +1 -1
  103. package/dist/pkt-link.cjs +1 -1
  104. package/dist/pkt-link.js +1 -1
  105. package/dist/pkt-linkcard.cjs +1 -1
  106. package/dist/pkt-linkcard.js +1 -1
  107. package/dist/pkt-listbox.cjs +1 -1
  108. package/dist/pkt-listbox.js +1 -1
  109. package/dist/pkt-loader.cjs +1 -1
  110. package/dist/pkt-loader.js +1 -1
  111. package/dist/pkt-messagebox.cjs +1 -1
  112. package/dist/pkt-messagebox.js +1 -1
  113. package/dist/pkt-modal.cjs +1 -1
  114. package/dist/pkt-modal.js +1 -1
  115. package/dist/{pkt-options-controller-CCB15L_G.js → pkt-options-controller-BTNtjEIS.js} +1 -1
  116. package/dist/{pkt-options-controller-CeAQ-D-i.cjs → pkt-options-controller-CBM8xHwR.cjs} +1 -1
  117. package/dist/pkt-progressbar.cjs +1 -1
  118. package/dist/pkt-progressbar.js +1 -1
  119. package/dist/pkt-radiobutton.cjs +1 -1
  120. package/dist/pkt-radiobutton.js +1 -1
  121. package/dist/pkt-searchinput.cjs +1 -1
  122. package/dist/pkt-searchinput.js +1 -1
  123. package/dist/pkt-select.cjs +1 -1
  124. package/dist/pkt-select.js +1 -1
  125. package/dist/pkt-tabs.cjs +1 -1
  126. package/dist/pkt-tabs.js +1 -1
  127. package/dist/pkt-tag.cjs +1 -1
  128. package/dist/pkt-tag.js +1 -1
  129. package/dist/pkt-textarea.cjs +1 -1
  130. package/dist/pkt-textarea.js +1 -1
  131. package/dist/pkt-textinput.cjs +1 -1
  132. package/dist/pkt-textinput.js +1 -1
  133. package/dist/pkt-timepicker.cjs +1 -1
  134. package/dist/pkt-timepicker.js +1 -1
  135. package/dist/{progressbar-C-5oESiB.js → progressbar-B0P_vmGD.js} +23 -24
  136. package/dist/progressbar-DADdvDl5.cjs +17 -0
  137. package/dist/{radiobutton-B1Xg6XzP.cjs → radiobutton-BfURufrZ.cjs} +8 -8
  138. package/dist/{radiobutton-BAn1V_mQ.js → radiobutton-C6zERHoy.js} +20 -20
  139. package/dist/{ref-RS8Uv6uC.js → ref-BgoHEsEt.js} +7 -8
  140. package/dist/ref-CBdWMlde.cjs +1 -0
  141. package/dist/{repeat-DV1O43YU.js → repeat-CKIii8Mi.js} +15 -16
  142. package/dist/repeat-CRRgmzVn.cjs +1 -0
  143. package/dist/{searchinput-DUgZb_zm.cjs → searchinput-BrxfRzez.cjs} +13 -13
  144. package/dist/{searchinput-C9FP89qD.js → searchinput-fPvXHu2O.js} +31 -31
  145. package/dist/{select-DkKIW7zD.js → select-BIgFPp42.js} +13 -13
  146. package/dist/{select-DAs8kzN4.cjs → select-DzZHv6Bz.cjs} +3 -3
  147. package/dist/{tabs-ClI1XQDt.js → tabs-BJx6wwXD.js} +29 -29
  148. package/dist/{tabs-CN_RIMWg.cjs → tabs-DxQy8U-0.cjs} +7 -7
  149. package/dist/{tag-vgKH9B4k.cjs → tag-CBFz0R9N.cjs} +5 -5
  150. package/dist/{tag-DSZ-czu-.js → tag-CzlnHhho.js} +19 -19
  151. package/dist/textarea-M_S9WK7s.cjs +46 -0
  152. package/dist/{textarea-BfjI6d7Q.js → textarea-qHtkhelz.js} +24 -25
  153. package/dist/{textinput-DhoupEyI.js → textinput-CZrBM-Fj.js} +26 -26
  154. package/dist/{textinput-BM66vo5e.cjs → textinput-C_6kvf87.cjs} +12 -12
  155. package/dist/{timepicker-CtRGbypF.js → timepicker-O0iCeJyW.js} +51 -51
  156. package/dist/{timepicker-C4oRmmRd.cjs → timepicker-WiYLAncb.cjs} +20 -20
  157. package/package.json +2 -2
  158. package/src/components/card/card.ts +1 -1
  159. package/src/components/heading/heading.test.ts +79 -70
  160. package/src/components/heading/heading.ts +40 -78
  161. package/dist/async-directive-B9P1Qa0k.cjs +0 -1
  162. package/dist/class-map-CJ-msbHs.cjs +0 -1
  163. package/dist/directive-3THFsVew.js +0 -28
  164. package/dist/directive-CJ2giQBZ.cjs +0 -1
  165. package/dist/element-DjtxO-1r.cjs +0 -2
  166. package/dist/element-with-slot-CWoTGA1B.cjs +0 -1
  167. package/dist/heading-BxvE80bb.js +0 -73
  168. package/dist/heading-DRJTS27k.cjs +0 -1
  169. package/dist/icon-PbaC9uUg.cjs +0 -1
  170. package/dist/if-defined-XKOD_t_V.cjs +0 -1
  171. package/dist/linkcard-CupEMkvj.cjs +0 -13
  172. package/dist/progressbar-C0g830Tk.cjs +0 -17
  173. package/dist/ref-BaJ0mBT_.cjs +0 -1
  174. package/dist/repeat-DaDFvx86.cjs +0 -1
  175. package/dist/textarea-C7YiheLo.cjs +0 -46
  176. /package/dist/{booleanish-CRaKZ75t.js → booleanish-BmcOU-43.js} +0 -0
  177. /package/dist/{booleanish-B5EFqFpJ.cjs → booleanish-jJLlnr6-.cjs} +0 -0
  178. /package/dist/{classutils-z8YsPlOf.cjs → classutils-CVTzKF0J.cjs} +0 -0
  179. /package/dist/{classutils-DEL164Ur.js → classutils-lVbGcvjN.js} +0 -0
  180. /package/dist/{converters-Bffq_YDm.cjs → converters-C_66kHUN.cjs} +0 -0
  181. /package/dist/{converters-jauYkvNh.js → converters-DSQXaDQ_.js} +0 -0
  182. /package/dist/{dialog-polyfill.esm-B7W3teD0.js → dialog-polyfill.esm-0dVT8G1o.js} +0 -0
  183. /package/dist/{dialog-polyfill.esm-BnAQvMQO.cjs → dialog-polyfill.esm-CYs2AHP1.cjs} +0 -0
  184. /package/dist/{focus-modality-controller-pzSZkDkH.js → focus-modality-controller-CaUqYdk0.js} +0 -0
  185. /package/dist/{focus-modality-controller-BSZAQk8y.cjs → focus-modality-controller-wI5SR8wH.cjs} +0 -0
  186. /package/dist/{input-wrapper-CQGoyLdZ.cjs → input-wrapper-CYCCx8MP.cjs} +0 -0
  187. /package/dist/{input-wrapper-DwSsP39J.js → input-wrapper-kw2y6Jp_.js} +0 -0
  188. /package/dist/{utils-BOOZ0ppt.js → utils-CUqCKGvp.js} +0 -0
  189. /package/dist/{utils-CM67Oudc.cjs → utils-CjAbIttF.cjs} +0 -0
@@ -1,10 +1,10 @@
1
- import { c as e, d as t, o as n, r, s as i } from "./element-cZ85T_aa.js";
2
- import { n as a } from "./element-with-slot-4J2o3SeU.js";
3
- import { t as o } from "./if-defined-Cjj8qN-Z.js";
4
- import { n as s, t as c } from "./ref-RS8Uv6uC.js";
5
- import { t as l } from "./input-element-B1ciW1N2.js";
6
- import { t as u } from "./pkt-options-controller-CCB15L_G.js";
7
- import "./input-wrapper-oYcbCFow.js";
1
+ import { a as e, n as t, o as n, p as r, s as i } from "./element-CduG0XyF.js";
2
+ import { n as a } from "./element-with-slot-BVj9MXzi.js";
3
+ import { t as o } from "./if-defined-VShASPdu.js";
4
+ import { n as s, t as c } from "./ref-BgoHEsEt.js";
5
+ import { t as l } from "./input-element-BrmkXIXi.js";
6
+ import { t as u } from "./pkt-options-controller-BTNtjEIS.js";
7
+ import "./input-wrapper-B6WowlWG.js";
8
8
  //#region src/base-elements/options-input-element.ts
9
9
  var d = class extends l {
10
10
  constructor(...e) {
@@ -36,10 +36,10 @@ var d = class extends l {
36
36
  super.willUpdate(e), this.parseOptions();
37
37
  }
38
38
  };
39
- r([i({
39
+ t([n({
40
40
  type: Array,
41
41
  attribute: "options"
42
- })], d.prototype, "_optionsProp", void 0), r([n()], d.prototype, "_options", void 0);
42
+ })], d.prototype, "_optionsProp", void 0), t([e()], d.prototype, "_options", void 0);
43
43
  //#endregion
44
44
  //#region src/components/select/select.ts
45
45
  var f = class extends d {
@@ -89,7 +89,7 @@ var f = class extends d {
89
89
  }
90
90
  render() {
91
91
  let e = `pkt-input ${this.fullwidth ? "pkt-input--fullwidth" : ""}`;
92
- return t`
92
+ return r`
93
93
  <pkt-input-wrapper
94
94
  ?counter=${this.counter}
95
95
  ?disabled=${this.disabled}
@@ -134,7 +134,7 @@ var f = class extends d {
134
134
  }}
135
135
  ${s(this.inputRef)}
136
136
  >
137
- ${this._options.length > 0 ? this._options.map((e) => t`<option
137
+ ${this._options.length > 0 ? this._options.map((e) => r`<option
138
138
  value=${e.value}
139
139
  ?selected=${this.value == e.value || e.selected}
140
140
  ?disabled=${e.disabled}
@@ -151,9 +151,9 @@ var f = class extends d {
151
151
  return e == null || isNaN(e) ? null : e;
152
152
  }
153
153
  };
154
- r([i({ type: String })], f.prototype, "value", void 0);
154
+ t([n({ type: String })], f.prototype, "value", void 0);
155
155
  try {
156
- e("pkt-select")(f);
156
+ i("pkt-select")(f);
157
157
  } catch {
158
158
  console.warn("Forsøker å definere <pkt-select>, men den er allerede definert");
159
159
  }
@@ -1,4 +1,4 @@
1
- const e=require(`./element-DjtxO-1r.cjs`),t=require(`./element-with-slot-CWoTGA1B.cjs`),n=require(`./if-defined-XKOD_t_V.cjs`),r=require(`./ref-BaJ0mBT_.cjs`),i=require(`./input-element-D0egtEnr.cjs`),a=require(`./pkt-options-controller-CeAQ-D-i.cjs`);require(`./input-wrapper-Y98KV-sy.cjs`);var o=class extends i.t{constructor(...e){super(...e),this._optionsProp=[],this._options=[]}get options(){return this._options.map(e=>({...e,selected:this.isOptionSelected(e)}))}set options(e){this._optionsProp=e,this.requestUpdate(`_optionsProp`,this._options)}isOptionSelected(e){return Array.isArray(this.value)?this.value.includes(e.value):e.value===this.value}findOptionByValue(e){return this._options.find(t=>t.value===e)}getSelectedOptions(){return this._options.filter(e=>this.isOptionSelected(e))}parseOptions(){let e=this._optionsProp.length>0,t=this.optionsController?.nodes?.length&&this.optionsController.nodes.length>0;e?this._options=this._optionsProp:t&&(this._options=this.optionsController.options)}willUpdate(e){super.willUpdate(e),this.parseOptions()}};e.r([e.s({type:Array,attribute:`options`})],o.prototype,`_optionsProp`,void 0),e.r([e.o()],o.prototype,`_options`,void 0);var s=class extends o{constructor(){super(),this.inputRef=r.t(),this.value=``,this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new a.t(this)}connectedCallback(){super.connectedCallback(),this.parseOptions(),this._options.forEach(e=>{e.selected&&!this.value&&(this.value=e.value)})}add(e,t){let n={value:e.value||e.text,label:e.text||e.value,selected:e.selected,disabled:e.disabled};if(t===void 0)this._options.push(n);else if(typeof t==`number`)this._options.splice(t,0,n);else{let e=t.value||t.text,r=this._options.findIndex(t=>t.value===e);r>=0?this._options.splice(r,0,n):this._options.push(n)}e.selected&&(this.value=e.value||e.text,this.selectedIndex=this._options.findIndex(e=>e.value===this.value)),this.requestUpdate()}remove(e){typeof e==`number`&&(this.selectedIndex===e&&(this.value=this._options[0]?.value||``),this._options.splice(e,1),this.requestUpdate())}item(e){return this.inputRef.value?.item(e)}namedItem(e){return this.inputRef.value?.namedItem(e)}showPicker(){this.inputRef.value&&`showPicker`in this.inputRef.value&&this.inputRef.value.showPicker()}attributeChangedCallback(e,t,n){e===`options`&&(this._options=n?JSON.parse(n):[]),e===`value`&&this.value!==t&&(this.selectedIndex=this.touched?this.returnNumberOrNull(this.inputRef.value?.selectedIndex):this._options.findIndex(e=>e.value===n),this.selectedOptions=this.inputRef.value?.selectedOptions,this.valueChanged(n,t)),super.attributeChangedCallback(e,t,n)}update(e){super.update(e),e.has(`_optionsProp`)&&this._optionsProp.length>0&&(this._options=this._optionsProp,this.requestUpdate(`_options`),!this.value&&this._options.length>0&&(this.value=this._options[0].value,this.selectedIndex=0)),e.has(`value`)&&this.value!==e.get(`value`)&&(this.selectedIndex=this.touched?this.returnNumberOrNull(this.inputRef.value?.selectedIndex):this._options.findIndex(e=>e.value===this.value),this.selectedOptions=this.inputRef.value?.selectedOptions,this.valueChanged(this.value,e.get(`value`))),e.has(`id`)&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(e){super.firstUpdated(e),this._optionsProp.length&&(this._options=this._optionsProp),!this.value&&this._options.length>0?(this.value=this._options[0].value,this.selectedIndex=0):this.selectedIndex=this._options.findIndex(e=>e.value===this.value),this.selectedOptions=this.inputRef.value?.selectedOptions}render(){let i=`pkt-input ${this.fullwidth?`pkt-input--fullwidth`:``}`;return e.d`
1
+ const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./element-with-slot-Cmxb9h4H.cjs`),n=require(`./if-defined-LTjAScFG.cjs`),r=require(`./ref-CBdWMlde.cjs`),i=require(`./input-element-BHQVt4Q9.cjs`),a=require(`./pkt-options-controller-CBM8xHwR.cjs`);require(`./input-wrapper-Dhkt20WW.cjs`);var o=class extends i.t{constructor(...e){super(...e),this._optionsProp=[],this._options=[]}get options(){return this._options.map(e=>({...e,selected:this.isOptionSelected(e)}))}set options(e){this._optionsProp=e,this.requestUpdate(`_optionsProp`,this._options)}isOptionSelected(e){return Array.isArray(this.value)?this.value.includes(e.value):e.value===this.value}findOptionByValue(e){return this._options.find(t=>t.value===e)}getSelectedOptions(){return this._options.filter(e=>this.isOptionSelected(e))}parseOptions(){let e=this._optionsProp.length>0,t=this.optionsController?.nodes?.length&&this.optionsController.nodes.length>0;e?this._options=this._optionsProp:t&&(this._options=this.optionsController.options)}willUpdate(e){super.willUpdate(e),this.parseOptions()}};e.n([e.o({type:Array,attribute:`options`})],o.prototype,`_optionsProp`,void 0),e.n([e.a()],o.prototype,`_options`,void 0);var s=class extends o{constructor(){super(),this.inputRef=r.t(),this.value=``,this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new a.t(this)}connectedCallback(){super.connectedCallback(),this.parseOptions(),this._options.forEach(e=>{e.selected&&!this.value&&(this.value=e.value)})}add(e,t){let n={value:e.value||e.text,label:e.text||e.value,selected:e.selected,disabled:e.disabled};if(t===void 0)this._options.push(n);else if(typeof t==`number`)this._options.splice(t,0,n);else{let e=t.value||t.text,r=this._options.findIndex(t=>t.value===e);r>=0?this._options.splice(r,0,n):this._options.push(n)}e.selected&&(this.value=e.value||e.text,this.selectedIndex=this._options.findIndex(e=>e.value===this.value)),this.requestUpdate()}remove(e){typeof e==`number`&&(this.selectedIndex===e&&(this.value=this._options[0]?.value||``),this._options.splice(e,1),this.requestUpdate())}item(e){return this.inputRef.value?.item(e)}namedItem(e){return this.inputRef.value?.namedItem(e)}showPicker(){this.inputRef.value&&`showPicker`in this.inputRef.value&&this.inputRef.value.showPicker()}attributeChangedCallback(e,t,n){e===`options`&&(this._options=n?JSON.parse(n):[]),e===`value`&&this.value!==t&&(this.selectedIndex=this.touched?this.returnNumberOrNull(this.inputRef.value?.selectedIndex):this._options.findIndex(e=>e.value===n),this.selectedOptions=this.inputRef.value?.selectedOptions,this.valueChanged(n,t)),super.attributeChangedCallback(e,t,n)}update(e){super.update(e),e.has(`_optionsProp`)&&this._optionsProp.length>0&&(this._options=this._optionsProp,this.requestUpdate(`_options`),!this.value&&this._options.length>0&&(this.value=this._options[0].value,this.selectedIndex=0)),e.has(`value`)&&this.value!==e.get(`value`)&&(this.selectedIndex=this.touched?this.returnNumberOrNull(this.inputRef.value?.selectedIndex):this._options.findIndex(e=>e.value===this.value),this.selectedOptions=this.inputRef.value?.selectedOptions,this.valueChanged(this.value,e.get(`value`))),e.has(`id`)&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(e){super.firstUpdated(e),this._optionsProp.length&&(this._options=this._optionsProp),!this.value&&this._options.length>0?(this.value=this._options[0].value,this.selectedIndex=0):this.selectedIndex=this._options.findIndex(e=>e.value===this.value),this.selectedOptions=this.inputRef.value?.selectedOptions}render(){let i=`pkt-input ${this.fullwidth?`pkt-input--fullwidth`:``}`;return e.p`
2
2
  <pkt-input-wrapper
3
3
  ?counter=${this.counter}
4
4
  ?disabled=${this.disabled}
@@ -35,7 +35,7 @@ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./element-with-slot-CWoTGA1
35
35
  @blur=${e=>{this.onBlur(),e.stopImmediatePropagation()}}
36
36
  ${r.n(this.inputRef)}
37
37
  >
38
- ${this._options.length>0?this._options.map(t=>e.d`<option
38
+ ${this._options.length>0?this._options.map(t=>e.p`<option
39
39
  value=${t.value}
40
40
  ?selected=${this.value==t.value||t.selected}
41
41
  ?disabled=${t.disabled}
@@ -46,4 +46,4 @@ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./element-with-slot-CWoTGA1
46
46
  </select>
47
47
  <div class="pkt-contents" slot="helptext">${t.n(this,`helptext`)}</div>
48
48
  </pkt-input-wrapper>
49
- `}returnNumberOrNull(e){return e==null||isNaN(e)?null:e}};e.r([e.s({type:String})],s.prototype,`value`,void 0);try{e.c(`pkt-select`)(s)}catch{console.warn(`Forsøker å definere <pkt-select>, men den er allerede definert`)}var c=s;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return c}});
49
+ `}returnNumberOrNull(e){return e==null||isNaN(e)?null:e}};e.n([e.o({type:String})],s.prototype,`value`,void 0);try{e.s(`pkt-select`)(s)}catch{console.warn(`Forsøker å definere <pkt-select>, men den er allerede definert`)}var c=s;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return c}});
@@ -1,7 +1,7 @@
1
- import { c as e, d as t, o as n, r, s as i } from "./element-cZ85T_aa.js";
2
- import { n as a, t as o } from "./element-with-slot-4J2o3SeU.js";
3
- import { t as s } from "./if-defined-Cjj8qN-Z.js";
4
- import { n as c, t as l } from "./ref-RS8Uv6uC.js";
1
+ import { a as e, n as t, o as n, p as r, s as i } from "./element-CduG0XyF.js";
2
+ import { n as a, t as o } from "./element-with-slot-BVj9MXzi.js";
3
+ import { t as s } from "./if-defined-VShASPdu.js";
4
+ import { n as c, t as l } from "./ref-BgoHEsEt.js";
5
5
  //#region ../../node_modules/@lit/context/lib/context-request-event.js
6
6
  var u = class extends Event {
7
7
  constructor(e, t, n, r) {
@@ -241,32 +241,32 @@ var v = d(Symbol("pkt-tabs-context")), y = class extends o {
241
241
  }
242
242
  render() {
243
243
  let e = this.useArrowNav ? "tablist" : "navigation";
244
- return t`
244
+ return r`
245
245
  <div class=${this.separatorIconName || this.separatorIconPath ? "pkt-tabs pkt-tabs--with-separator" : "pkt-tabs"}>
246
246
  <div class="pkt-tabs__list" role=${e}>${a(this)}</div>
247
247
  </div>
248
248
  `;
249
249
  }
250
250
  };
251
- r([i({
251
+ t([n({
252
252
  type: Boolean,
253
253
  reflect: !0,
254
254
  attribute: "arrow-nav"
255
- })], y.prototype, "arrowNav", void 0), r([i({
255
+ })], y.prototype, "arrowNav", void 0), t([n({
256
256
  type: Boolean,
257
257
  reflect: !0,
258
258
  attribute: "disable-arrow-nav"
259
- })], y.prototype, "disableArrowNav", void 0), r([i({
259
+ })], y.prototype, "disableArrowNav", void 0), t([n({
260
260
  type: String,
261
261
  reflect: !0,
262
262
  attribute: "separator-icon-name"
263
- })], y.prototype, "separatorIconName", void 0), r([i({
263
+ })], y.prototype, "separatorIconName", void 0), t([n({
264
264
  type: String,
265
265
  reflect: !0,
266
266
  attribute: "separator-icon-path"
267
- })], y.prototype, "separatorIconPath", void 0), r([n()], y.prototype, "tabRefs", void 0), r([n()], y.prototype, "disabledMap", void 0), r([n()], y.prototype, "tabCount", void 0), r([g({ context: v }), n()], y.prototype, "context", void 0);
267
+ })], y.prototype, "separatorIconPath", void 0), t([e()], y.prototype, "tabRefs", void 0), t([e()], y.prototype, "disabledMap", void 0), t([e()], y.prototype, "tabCount", void 0), t([g({ context: v }), e()], y.prototype, "context", void 0);
268
268
  try {
269
- e("pkt-tabs")(y);
269
+ i("pkt-tabs")(y);
270
270
  } catch {
271
271
  console.warn("Forsøker å definere <pkt-tabs>, men den er allerede definert");
272
272
  }
@@ -299,16 +299,16 @@ var b = class extends o {
299
299
  this.context && this.context.handleKeyUp(e, this.index);
300
300
  }
301
301
  render() {
302
- let e = this.context?.useArrowNav ?? !0, n = this.active && !this.disabled, r = [n ? "active" : "", this.disabled ? "pkt-tabs__item--disabled" : ""].filter(Boolean).join(" "), i = e ? "tab" : void 0, o = e ? n : void 0, l = this.disabled ? -1 : n || !e ? void 0 : -1, u = `pkt-icon--small ${this.icon === "check" ? "pkt-tabs__status-icon" : ""}`, d = t`
303
- ${this.icon ? t`<pkt-icon name=${this.icon} class=${u}></pkt-icon>` : ""}
302
+ let e = this.context?.useArrowNav ?? !0, t = this.active && !this.disabled, n = [t ? "active" : "", this.disabled ? "pkt-tabs__item--disabled" : ""].filter(Boolean).join(" "), i = e ? "tab" : void 0, o = e ? t : void 0, l = this.disabled ? -1 : t || !e ? void 0 : -1, u = `pkt-icon--small ${this.icon === "check" ? "pkt-tabs__status-icon" : ""}`, d = r`
303
+ ${this.icon ? r`<pkt-icon name=${this.icon} class=${u}></pkt-icon>` : ""}
304
304
  <span>${a(this)}</span>
305
- ${this.tag ? t`<pkt-tag skin=${this.tagSkin} size="small">${this.tag}</pkt-tag>` : ""}
305
+ ${this.tag ? r`<pkt-tag skin=${this.tagSkin} size="small">${this.tag}</pkt-tag>` : ""}
306
306
  `;
307
- return this.href ? t`
307
+ return this.href ? r`
308
308
  <a
309
309
  ${c(this.elementRef)}
310
310
  href=${s(this.disabled ? void 0 : this.href)}
311
- class="pkt-tabs__link ${r}"
311
+ class="pkt-tabs__link ${n}"
312
312
  role=${s(i)}
313
313
  aria-selected=${s(o)}
314
314
  aria-disabled=${s(this.disabled ? "true" : void 0)}
@@ -319,11 +319,11 @@ var b = class extends o {
319
319
  >
320
320
  ${d}
321
321
  </a>
322
- ` : t`
322
+ ` : r`
323
323
  <button
324
324
  ${c(this.elementRef)}
325
325
  type="button"
326
- class="pkt-tabs__button pkt-link-button ${r}"
326
+ class="pkt-tabs__button pkt-link-button ${n}"
327
327
  ?disabled=${this.disabled}
328
328
  aria-disabled=${s(this.disabled ? "true" : void 0)}
329
329
  role=${s(i)}
@@ -338,37 +338,37 @@ var b = class extends o {
338
338
  `;
339
339
  }
340
340
  };
341
- r([i({
341
+ t([n({
342
342
  type: Boolean,
343
343
  reflect: !0
344
- })], b.prototype, "active", void 0), r([i({
344
+ })], b.prototype, "active", void 0), t([n({
345
345
  type: Boolean,
346
346
  reflect: !0
347
- })], b.prototype, "disabled", void 0), r([i({
347
+ })], b.prototype, "disabled", void 0), t([n({
348
348
  type: String,
349
349
  reflect: !0
350
- })], b.prototype, "href", void 0), r([i({
350
+ })], b.prototype, "href", void 0), t([n({
351
351
  type: String,
352
352
  reflect: !0
353
- })], b.prototype, "icon", void 0), r([i({
353
+ })], b.prototype, "icon", void 0), t([n({
354
354
  type: String,
355
355
  reflect: !0
356
- })], b.prototype, "controls", void 0), r([i({
356
+ })], b.prototype, "controls", void 0), t([n({
357
357
  type: String,
358
358
  reflect: !0
359
- })], b.prototype, "tag", void 0), r([i({
359
+ })], b.prototype, "tag", void 0), t([n({
360
360
  type: String,
361
361
  reflect: !0,
362
362
  attribute: "tag-skin"
363
- })], b.prototype, "tagSkin", void 0), r([i({
363
+ })], b.prototype, "tagSkin", void 0), t([n({
364
364
  type: Number,
365
365
  reflect: !0
366
- })], b.prototype, "index", void 0), r([_({
366
+ })], b.prototype, "index", void 0), t([_({
367
367
  context: v,
368
368
  subscribe: !0
369
- }), i({ attribute: !1 })], b.prototype, "context", void 0);
369
+ }), n({ attribute: !1 })], b.prototype, "context", void 0);
370
370
  try {
371
- e("pkt-tab-item")(b);
371
+ i("pkt-tab-item")(b);
372
372
  } catch {
373
373
  console.warn("Forsøker å definere <pkt-tab-item>, men den er allerede definert");
374
374
  }
@@ -1,12 +1,12 @@
1
- const e=require(`./element-DjtxO-1r.cjs`),t=require(`./element-with-slot-CWoTGA1B.cjs`),n=require(`./if-defined-XKOD_t_V.cjs`),r=require(`./ref-BaJ0mBT_.cjs`);var i=class extends Event{constructor(e,t,n,r){super(`context-request`,{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t,this.callback=n,this.subscribe=r??!1}};function a(e){return e}var o=class{constructor(e,t,n,r){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(e,t)=>{this.unsubscribe&&(this.unsubscribe!==t&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=e,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(e,t)),this.unsubscribe=t},this.host=e,t.context!==void 0){let e=t;this.context=e.context,this.callback=e.callback,this.subscribe=e.subscribe??!1}else this.context=t,this.callback=n,this.subscribe=r??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&=(this.unsubscribe(),void 0)}dispatchRequest(){this.host.dispatchEvent(new i(this.context,this.host,this.t,this.subscribe))}},s=class{get value(){return this.o}set value(e){this.setValue(e)}setValue(e,t=!1){let n=t||!Object.is(e,this.o);this.o=e,n&&this.updateObservers()}constructor(e){this.subscriptions=new Map,this.updateObservers=()=>{for(let[e,{disposer:t}]of this.subscriptions)e(this.o,t)},e!==void 0&&(this.value=e)}addCallback(e,t,n){if(!n)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:()=>{this.subscriptions.delete(e)},consumerHost:t});let{disposer:r}=this.subscriptions.get(e);e(this.value,r)}clearCallbacks(){this.subscriptions.clear()}},c=class extends Event{constructor(e,t){super(`context-provider`,{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t}},l=class extends s{constructor(e,t,n){super(t.context===void 0?n:t.initialValue),this.onContextRequest=e=>{if(e.context!==this.context)return;let t=e.contextTarget??e.composedPath()[0];t!==this.host&&(e.stopPropagation(),this.addCallback(e.callback,t,e.subscribe))},this.onProviderRequest=e=>{if(e.context!==this.context||(e.contextTarget??e.composedPath()[0])===this.host)return;let t=new Set;for(let[e,{consumerHost:n}]of this.subscriptions)t.has(e)||(t.add(e),n.dispatchEvent(new i(this.context,n,e,!0)));e.stopPropagation()},this.host=e,t.context===void 0?this.context=t:this.context=t.context,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener(`context-request`,this.onContextRequest),this.host.addEventListener(`context-provider`,this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new c(this.context,this.host))}};function u({context:e}){return(t,n)=>{let r=new WeakMap;if(typeof n==`object`)return{get(){return t.get.call(this)},set(e){return r.get(this).setValue(e),t.set.call(this,e)},init(t){return r.set(this,new l(this,{context:e,initialValue:t})),t}};{t.constructor.addInitializer((t=>{r.set(t,new l(t,{context:e}))}));let i=Object.getOwnPropertyDescriptor(t,n),a;if(i===void 0){let e=new WeakMap;a={get(){return e.get(this)},set(t){r.get(this).setValue(t),e.set(this,t)},configurable:!0,enumerable:!0}}else{let e=i.set;a={...i,set(t){r.get(this).setValue(t),e?.call(this,t)}}}Object.defineProperty(t,n,a);return}}}function d({context:e,subscribe:t}){return(n,r)=>{typeof r==`object`?r.addInitializer((function(){new o(this,{context:e,callback:e=>{n.set.call(this,e)},subscribe:t})})):n.constructor.addInitializer((n=>{new o(n,{context:e,callback:e=>{n[r]=e},subscribe:t})}))}}var f=a(Symbol(`pkt-tabs-context`)),p=class extends t.t{constructor(...e){super(...e),this.arrowNav=!0,this.disableArrowNav=!1,this.separatorIconName=``,this.separatorIconPath=``,this.tabRefs=[],this.disabledMap={},this.tabCount=0,this.context={useArrowNav:this.useArrowNav,registerTab:this.registerTab.bind(this),handleClick:this.handleClick.bind(this),handleKeyUp:this.handleKeyUp.bind(this)}}get useArrowNav(){return this.arrowNav&&!this.disableArrowNav}updated(e){(e.has(`arrowNav`)||e.has(`disableArrowNav`))&&(this.context={...this.context,useArrowNav:this.useArrowNav}),this.updateComplete.then(()=>this.syncSeparators())}syncSeparators(){let e=this.querySelector(`.pkt-tabs__list`);if(!e||(e.querySelectorAll(`.pkt-tabs__separator`).forEach(e=>e.remove()),!(this.separatorIconName||this.separatorIconPath)))return;let t=Array.from(e.children).filter(e=>!e.classList.contains(`pkt-tabs__separator`));for(let e=0;e<t.length-1;e++){let n=document.createElement(`span`);if(n.className=`pkt-tabs__separator`,n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`role`,`presentation`),this.separatorIconPath){let e=document.createElement(`img`);e.setAttribute(`src`,this.separatorIconPath),e.setAttribute(`alt`,``),e.setAttribute(`aria-hidden`,`true`),n.appendChild(e)}else if(this.separatorIconName){let e=document.createElement(`pkt-icon`);e.setAttribute(`name`,this.separatorIconName),e.classList.add(`pkt-tabs__separator-icon`),n.appendChild(e)}t[e].after(n)}}registerTab(e,t,n=!1){this.tabRefs[t]=e,this.disabledMap[t]=n,this.tabCount=Math.max(this.tabCount,t+1)}isTabDisabled(e){return!!this.disabledMap[e]}findEnabledIndex(e,t){let n=e+t;for(;n>=0&&n<this.tabCount;){if(!this.isTabDisabled(n))return n;n+=t}return null}handleClick(e){this.isTabDisabled(e)||this.dispatchEvent(new CustomEvent(`tab-selected`,{detail:{index:e},bubbles:!0,composed:!0}))}handleKeyUp(e,t){if(this.useArrowNav){if(e.key===`ArrowLeft`){e.preventDefault();let n=this.findEnabledIndex(t,-1);n!==null&&this.tabRefs[n]?.focus()}if(e.key===`ArrowRight`){e.preventDefault();let n=this.findEnabledIndex(t,1);n!==null&&this.tabRefs[n]?.focus()}(e.key===`Enter`||e.key===` `||e.key===`Spacebar`||e.key===`ArrowDown`)&&(e.preventDefault(),this.handleClick(t))}}render(){let n=this.useArrowNav?`tablist`:`navigation`;return e.d`
1
+ const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./element-with-slot-Cmxb9h4H.cjs`),n=require(`./if-defined-LTjAScFG.cjs`),r=require(`./ref-CBdWMlde.cjs`);var i=class extends Event{constructor(e,t,n,r){super(`context-request`,{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t,this.callback=n,this.subscribe=r??!1}};function a(e){return e}var o=class{constructor(e,t,n,r){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(e,t)=>{this.unsubscribe&&(this.unsubscribe!==t&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=e,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(e,t)),this.unsubscribe=t},this.host=e,t.context!==void 0){let e=t;this.context=e.context,this.callback=e.callback,this.subscribe=e.subscribe??!1}else this.context=t,this.callback=n,this.subscribe=r??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&=(this.unsubscribe(),void 0)}dispatchRequest(){this.host.dispatchEvent(new i(this.context,this.host,this.t,this.subscribe))}},s=class{get value(){return this.o}set value(e){this.setValue(e)}setValue(e,t=!1){let n=t||!Object.is(e,this.o);this.o=e,n&&this.updateObservers()}constructor(e){this.subscriptions=new Map,this.updateObservers=()=>{for(let[e,{disposer:t}]of this.subscriptions)e(this.o,t)},e!==void 0&&(this.value=e)}addCallback(e,t,n){if(!n)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:()=>{this.subscriptions.delete(e)},consumerHost:t});let{disposer:r}=this.subscriptions.get(e);e(this.value,r)}clearCallbacks(){this.subscriptions.clear()}},c=class extends Event{constructor(e,t){super(`context-provider`,{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t}},l=class extends s{constructor(e,t,n){super(t.context===void 0?n:t.initialValue),this.onContextRequest=e=>{if(e.context!==this.context)return;let t=e.contextTarget??e.composedPath()[0];t!==this.host&&(e.stopPropagation(),this.addCallback(e.callback,t,e.subscribe))},this.onProviderRequest=e=>{if(e.context!==this.context||(e.contextTarget??e.composedPath()[0])===this.host)return;let t=new Set;for(let[e,{consumerHost:n}]of this.subscriptions)t.has(e)||(t.add(e),n.dispatchEvent(new i(this.context,n,e,!0)));e.stopPropagation()},this.host=e,t.context===void 0?this.context=t:this.context=t.context,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener(`context-request`,this.onContextRequest),this.host.addEventListener(`context-provider`,this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new c(this.context,this.host))}};function u({context:e}){return(t,n)=>{let r=new WeakMap;if(typeof n==`object`)return{get(){return t.get.call(this)},set(e){return r.get(this).setValue(e),t.set.call(this,e)},init(t){return r.set(this,new l(this,{context:e,initialValue:t})),t}};{t.constructor.addInitializer((t=>{r.set(t,new l(t,{context:e}))}));let i=Object.getOwnPropertyDescriptor(t,n),a;if(i===void 0){let e=new WeakMap;a={get(){return e.get(this)},set(t){r.get(this).setValue(t),e.set(this,t)},configurable:!0,enumerable:!0}}else{let e=i.set;a={...i,set(t){r.get(this).setValue(t),e?.call(this,t)}}}Object.defineProperty(t,n,a);return}}}function d({context:e,subscribe:t}){return(n,r)=>{typeof r==`object`?r.addInitializer((function(){new o(this,{context:e,callback:e=>{n.set.call(this,e)},subscribe:t})})):n.constructor.addInitializer((n=>{new o(n,{context:e,callback:e=>{n[r]=e},subscribe:t})}))}}var f=a(Symbol(`pkt-tabs-context`)),p=class extends t.t{constructor(...e){super(...e),this.arrowNav=!0,this.disableArrowNav=!1,this.separatorIconName=``,this.separatorIconPath=``,this.tabRefs=[],this.disabledMap={},this.tabCount=0,this.context={useArrowNav:this.useArrowNav,registerTab:this.registerTab.bind(this),handleClick:this.handleClick.bind(this),handleKeyUp:this.handleKeyUp.bind(this)}}get useArrowNav(){return this.arrowNav&&!this.disableArrowNav}updated(e){(e.has(`arrowNav`)||e.has(`disableArrowNav`))&&(this.context={...this.context,useArrowNav:this.useArrowNav}),this.updateComplete.then(()=>this.syncSeparators())}syncSeparators(){let e=this.querySelector(`.pkt-tabs__list`);if(!e||(e.querySelectorAll(`.pkt-tabs__separator`).forEach(e=>e.remove()),!(this.separatorIconName||this.separatorIconPath)))return;let t=Array.from(e.children).filter(e=>!e.classList.contains(`pkt-tabs__separator`));for(let e=0;e<t.length-1;e++){let n=document.createElement(`span`);if(n.className=`pkt-tabs__separator`,n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`role`,`presentation`),this.separatorIconPath){let e=document.createElement(`img`);e.setAttribute(`src`,this.separatorIconPath),e.setAttribute(`alt`,``),e.setAttribute(`aria-hidden`,`true`),n.appendChild(e)}else if(this.separatorIconName){let e=document.createElement(`pkt-icon`);e.setAttribute(`name`,this.separatorIconName),e.classList.add(`pkt-tabs__separator-icon`),n.appendChild(e)}t[e].after(n)}}registerTab(e,t,n=!1){this.tabRefs[t]=e,this.disabledMap[t]=n,this.tabCount=Math.max(this.tabCount,t+1)}isTabDisabled(e){return!!this.disabledMap[e]}findEnabledIndex(e,t){let n=e+t;for(;n>=0&&n<this.tabCount;){if(!this.isTabDisabled(n))return n;n+=t}return null}handleClick(e){this.isTabDisabled(e)||this.dispatchEvent(new CustomEvent(`tab-selected`,{detail:{index:e},bubbles:!0,composed:!0}))}handleKeyUp(e,t){if(this.useArrowNav){if(e.key===`ArrowLeft`){e.preventDefault();let n=this.findEnabledIndex(t,-1);n!==null&&this.tabRefs[n]?.focus()}if(e.key===`ArrowRight`){e.preventDefault();let n=this.findEnabledIndex(t,1);n!==null&&this.tabRefs[n]?.focus()}(e.key===`Enter`||e.key===` `||e.key===`Spacebar`||e.key===`ArrowDown`)&&(e.preventDefault(),this.handleClick(t))}}render(){let n=this.useArrowNav?`tablist`:`navigation`;return e.p`
2
2
  <div class=${this.separatorIconName||this.separatorIconPath?`pkt-tabs pkt-tabs--with-separator`:`pkt-tabs`}>
3
3
  <div class="pkt-tabs__list" role=${n}>${t.n(this)}</div>
4
4
  </div>
5
- `}};e.r([e.s({type:Boolean,reflect:!0,attribute:`arrow-nav`})],p.prototype,`arrowNav`,void 0),e.r([e.s({type:Boolean,reflect:!0,attribute:`disable-arrow-nav`})],p.prototype,`disableArrowNav`,void 0),e.r([e.s({type:String,reflect:!0,attribute:`separator-icon-name`})],p.prototype,`separatorIconName`,void 0),e.r([e.s({type:String,reflect:!0,attribute:`separator-icon-path`})],p.prototype,`separatorIconPath`,void 0),e.r([e.o()],p.prototype,`tabRefs`,void 0),e.r([e.o()],p.prototype,`disabledMap`,void 0),e.r([e.o()],p.prototype,`tabCount`,void 0),e.r([u({context:f}),e.o()],p.prototype,`context`,void 0);try{e.c(`pkt-tabs`)(p)}catch{console.warn(`Forsøker å definere <pkt-tabs>, men den er allerede definert`)}var m=class extends t.t{constructor(){super(),this.active=!1,this.disabled=!1,this.href=``,this.icon=``,this.controls=``,this.tag=``,this.tagSkin=`blue`,this.index=0,this.elementRef=r.t()}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index,this.disabled)})}updated(){this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index,this.disabled)}handleClick(e){if(this.disabled){e.preventDefault(),e.stopPropagation();return}this.context&&this.context.handleClick(this.index)}handleKeyDown(e){if(this.disabled&&(e.key===`Enter`||e.key===` `||e.key===`Spacebar`)){e.preventDefault(),e.stopPropagation();return}this.context&&this.context.handleKeyUp(e,this.index)}render(){let i=this.context?.useArrowNav??!0,a=this.active&&!this.disabled,o=[a?`active`:``,this.disabled?`pkt-tabs__item--disabled`:``].filter(Boolean).join(` `),s=i?`tab`:void 0,c=i?a:void 0,l=this.disabled?-1:a||!i?void 0:-1,u=`pkt-icon--small ${this.icon===`check`?`pkt-tabs__status-icon`:``}`,d=e.d`
6
- ${this.icon?e.d`<pkt-icon name=${this.icon} class=${u}></pkt-icon>`:``}
5
+ `}};e.n([e.o({type:Boolean,reflect:!0,attribute:`arrow-nav`})],p.prototype,`arrowNav`,void 0),e.n([e.o({type:Boolean,reflect:!0,attribute:`disable-arrow-nav`})],p.prototype,`disableArrowNav`,void 0),e.n([e.o({type:String,reflect:!0,attribute:`separator-icon-name`})],p.prototype,`separatorIconName`,void 0),e.n([e.o({type:String,reflect:!0,attribute:`separator-icon-path`})],p.prototype,`separatorIconPath`,void 0),e.n([e.a()],p.prototype,`tabRefs`,void 0),e.n([e.a()],p.prototype,`disabledMap`,void 0),e.n([e.a()],p.prototype,`tabCount`,void 0),e.n([u({context:f}),e.a()],p.prototype,`context`,void 0);try{e.s(`pkt-tabs`)(p)}catch{console.warn(`Forsøker å definere <pkt-tabs>, men den er allerede definert`)}var m=class extends t.t{constructor(){super(),this.active=!1,this.disabled=!1,this.href=``,this.icon=``,this.controls=``,this.tag=``,this.tagSkin=`blue`,this.index=0,this.elementRef=r.t()}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index,this.disabled)})}updated(){this.elementRef.value&&this.context&&this.context.registerTab(this.elementRef.value,this.index,this.disabled)}handleClick(e){if(this.disabled){e.preventDefault(),e.stopPropagation();return}this.context&&this.context.handleClick(this.index)}handleKeyDown(e){if(this.disabled&&(e.key===`Enter`||e.key===` `||e.key===`Spacebar`)){e.preventDefault(),e.stopPropagation();return}this.context&&this.context.handleKeyUp(e,this.index)}render(){let i=this.context?.useArrowNav??!0,a=this.active&&!this.disabled,o=[a?`active`:``,this.disabled?`pkt-tabs__item--disabled`:``].filter(Boolean).join(` `),s=i?`tab`:void 0,c=i?a:void 0,l=this.disabled?-1:a||!i?void 0:-1,u=`pkt-icon--small ${this.icon===`check`?`pkt-tabs__status-icon`:``}`,d=e.p`
6
+ ${this.icon?e.p`<pkt-icon name=${this.icon} class=${u}></pkt-icon>`:``}
7
7
  <span>${t.n(this)}</span>
8
- ${this.tag?e.d`<pkt-tag skin=${this.tagSkin} size="small">${this.tag}</pkt-tag>`:``}
9
- `;return this.href?e.d`
8
+ ${this.tag?e.p`<pkt-tag skin=${this.tagSkin} size="small">${this.tag}</pkt-tag>`:``}
9
+ `;return this.href?e.p`
10
10
  <a
11
11
  ${r.n(this.elementRef)}
12
12
  href=${n.t(this.disabled?void 0:this.href)}
@@ -21,7 +21,7 @@ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./element-with-slot-CWoTGA1
21
21
  >
22
22
  ${d}
23
23
  </a>
24
- `:e.d`
24
+ `:e.p`
25
25
  <button
26
26
  ${r.n(this.elementRef)}
27
27
  type="button"
@@ -37,4 +37,4 @@ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./element-with-slot-CWoTGA1
37
37
  >
38
38
  ${d}
39
39
  </button>
40
- `}};e.r([e.s({type:Boolean,reflect:!0})],m.prototype,`active`,void 0),e.r([e.s({type:Boolean,reflect:!0})],m.prototype,`disabled`,void 0),e.r([e.s({type:String,reflect:!0})],m.prototype,`href`,void 0),e.r([e.s({type:String,reflect:!0})],m.prototype,`icon`,void 0),e.r([e.s({type:String,reflect:!0})],m.prototype,`controls`,void 0),e.r([e.s({type:String,reflect:!0})],m.prototype,`tag`,void 0),e.r([e.s({type:String,reflect:!0,attribute:`tag-skin`})],m.prototype,`tagSkin`,void 0),e.r([e.s({type:Number,reflect:!0})],m.prototype,`index`,void 0),e.r([d({context:f,subscribe:!0}),e.s({attribute:!1})],m.prototype,`context`,void 0);try{e.c(`pkt-tab-item`)(m)}catch{console.warn(`Forsøker å definere <pkt-tab-item>, men den er allerede definert`)}var h=p;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return h}});
40
+ `}};e.n([e.o({type:Boolean,reflect:!0})],m.prototype,`active`,void 0),e.n([e.o({type:Boolean,reflect:!0})],m.prototype,`disabled`,void 0),e.n([e.o({type:String,reflect:!0})],m.prototype,`href`,void 0),e.n([e.o({type:String,reflect:!0})],m.prototype,`icon`,void 0),e.n([e.o({type:String,reflect:!0})],m.prototype,`controls`,void 0),e.n([e.o({type:String,reflect:!0})],m.prototype,`tag`,void 0),e.n([e.o({type:String,reflect:!0,attribute:`tag-skin`})],m.prototype,`tagSkin`,void 0),e.n([e.o({type:Number,reflect:!0})],m.prototype,`index`,void 0),e.n([d({context:f,subscribe:!0}),e.o({attribute:!1})],m.prototype,`context`,void 0);try{e.s(`pkt-tab-item`)(m)}catch{console.warn(`Forsøker å definere <pkt-tab-item>, men den er allerede definert`)}var h=p;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return h}});
@@ -1,4 +1,4 @@
1
- const e=require(`./element-DjtxO-1r.cjs`),t=require(`./class-map-CJ-msbHs.cjs`),n=require(`./element-with-slot-CWoTGA1B.cjs`);require(`./icon-PbaC9uUg.cjs`);const r=require(`./if-defined-XKOD_t_V.cjs`);var i={name:`pkt-tag`,react:`PktTag`,"css-class":`pkt-tag`,isElement:!0,"dark-mode":!0,props:{size:{name:`Størrelse`,description:`Størrelsen på taggen`,required:!1,default:`medium`,type:[`small`,`medium`,`large`],category:`ui`},iconName:{name:`Ikon`,description:`Navnet på ikonet som skal vises i taggen`,type:`icon`,required:!1,category:`ui`},skin:{name:`Utseende`,description:`Utseendet til taggen`,required:!1,default:`blue`,type:[`blue`,`blue-light`,`blue-dark`,`green`,`red`,`beige`,`yellow`,`gray`],category:`ui`},closeTag:{name:`Lukk tag`,description:`Skal taggen ha en lukkeknapp?`,type:`boolean`,required:!1,default:!1,category:`ui`},textStyle:{name:`Tekststil`,description:`Stilen på teksten i taggen`,required:!1,default:`normal-text`,type:[`thin-text`,`normal-text`],category:`ui`},type:{name:`Type, dersom lukkeknapp`,description:`Type tag, brukes for å spesifisere om det er en knapp, submit eller reset`,required:!1,default:`button`,type:[`button`,`submit`,`reset`],category:`tech`},ariaLabel:{name:`aria-label`,description:`aria-label for taggen, brukes for tilgjengelighet`,type:`string`,required:!1,category:`accessibility`}},slots:{default:{description:`Teksten til tag`}}},a=class extends n.t{constructor(){super(),this.closeTag=i.props.closeTag.default,this.size=i.props.size.default,this.skin=i.props.skin.default,this.textStyle=null,this.iconName=void 0,this.type=i.props.type.default,this.ariaLabel=null,this.buttonTabindex=void 0,this._isClosed=!1,this._ariaDescription=null,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent(`close`,{detail:{origin:e},bubbles:!1,composed:!0})),this.dispatchEvent(new CustomEvent(`on-close`,{detail:{origin:e},bubbles:!1,composed:!0}))},this._isClosed=!1}firstUpdated(e){if(super.firstUpdated(e),this.closeTag&&!this.ariaLabel){let e=this.querySelector(`button span, .pkt-tag > span`)?.textContent?.trim();e&&(this._ariaDescription=`Klikk for å fjerne ${e}`)}}render(){let i={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},a={"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?e.d`
1
+ const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./class-map-B8Ja0q7n.cjs`),n=require(`./element-with-slot-Cmxb9h4H.cjs`);require(`./icon-Dw6I0HDV.cjs`);const r=require(`./if-defined-LTjAScFG.cjs`);var i={name:`pkt-tag`,react:`PktTag`,"css-class":`pkt-tag`,isElement:!0,"dark-mode":!0,props:{size:{name:`Størrelse`,description:`Størrelsen på taggen`,required:!1,default:`medium`,type:[`small`,`medium`,`large`],category:`ui`},iconName:{name:`Ikon`,description:`Navnet på ikonet som skal vises i taggen`,type:`icon`,required:!1,category:`ui`},skin:{name:`Utseende`,description:`Utseendet til taggen`,required:!1,default:`blue`,type:[`blue`,`blue-light`,`blue-dark`,`green`,`red`,`beige`,`yellow`,`gray`],category:`ui`},closeTag:{name:`Lukk tag`,description:`Skal taggen ha en lukkeknapp?`,type:`boolean`,required:!1,default:!1,category:`ui`},textStyle:{name:`Tekststil`,description:`Stilen på teksten i taggen`,required:!1,default:`normal-text`,type:[`thin-text`,`normal-text`],category:`ui`},type:{name:`Type, dersom lukkeknapp`,description:`Type tag, brukes for å spesifisere om det er en knapp, submit eller reset`,required:!1,default:`button`,type:[`button`,`submit`,`reset`],category:`tech`},ariaLabel:{name:`aria-label`,description:`aria-label for taggen, brukes for tilgjengelighet`,type:`string`,required:!1,category:`accessibility`}},slots:{default:{description:`Teksten til tag`}}},a=class extends n.t{constructor(){super(),this.closeTag=i.props.closeTag.default,this.size=i.props.size.default,this.skin=i.props.skin.default,this.textStyle=null,this.iconName=void 0,this.type=i.props.type.default,this.ariaLabel=null,this.buttonTabindex=void 0,this._isClosed=!1,this._ariaDescription=null,this.close=e=>{this._isClosed=!0,this.dispatchEvent(new CustomEvent(`close`,{detail:{origin:e},bubbles:!1,composed:!0})),this.dispatchEvent(new CustomEvent(`on-close`,{detail:{origin:e},bubbles:!1,composed:!0}))},this._isClosed=!1}firstUpdated(e){if(super.firstUpdated(e),this.closeTag&&!this.ariaLabel){let e=this.querySelector(`button span, .pkt-tag > span`)?.textContent?.trim();e&&(this._ariaDescription=`Klikk for å fjerne ${e}`)}}render(){let i={"pkt-tag":!0,[`pkt-tag--${this.size}`]:!!this.size,[`pkt-tag--${this.skin}`]:!!this.skin,[`pkt-tag--${this.textStyle}`]:!!this.textStyle},a={"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?e.p`
2
2
  <button
3
3
  class=${t.t(a)}
4
4
  type=${this.type}
@@ -7,7 +7,7 @@ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./class-map-CJ-msbHs.cjs`),
7
7
  aria-label=${r.t(this.ariaLabel||void 0)}
8
8
  aria-description=${r.t(this._ariaDescription||void 0)}
9
9
  >
10
- ${this.iconName&&e.d`<pkt-icon
10
+ ${this.iconName&&e.p`<pkt-icon
11
11
  class="pkt-tag__icon"
12
12
  name=${this.iconName}
13
13
  aria-hidden="true"
@@ -15,13 +15,13 @@ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./class-map-CJ-msbHs.cjs`),
15
15
  <span>${n.n(this)}</span>
16
16
  <pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
17
17
  </button>
18
- `:e.d`
18
+ `:e.p`
19
19
  <span class=${t.t(i)}>
20
- ${this.iconName&&e.d`<pkt-icon
20
+ ${this.iconName&&e.p`<pkt-icon
21
21
  class="pkt-tag__icon"
22
22
  name=${this.iconName}
23
23
  aria-hidden="true"
24
24
  ></pkt-icon>`}
25
25
  <span>${n.n(this)}</span>
26
26
  </span>
27
- `}};e.r([e.s({type:Boolean,reflect:!0})],a.prototype,`closeTag`,void 0),e.r([e.s({type:String,reflect:!0})],a.prototype,`size`,void 0),e.r([e.s({type:String,reflect:!0})],a.prototype,`skin`,void 0),e.r([e.s({type:String,reflect:!0})],a.prototype,`textStyle`,void 0),e.r([e.s({type:String,reflect:!0})],a.prototype,`iconName`,void 0),e.r([e.s({type:String})],a.prototype,`type`,void 0),e.r([e.s({type:String})],a.prototype,`ariaLabel`,void 0),e.r([e.s({type:Number,attribute:`button-tabindex`})],a.prototype,`buttonTabindex`,void 0),e.r([e.o()],a.prototype,`_isClosed`,void 0),e.r([e.o()],a.prototype,`_ariaDescription`,void 0);try{e.c(`pkt-tag`)(a)}catch{console.warn(`Forsøker å definere <pkt-tag>, men den er allerede definert`)}var o=a;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return o}});
27
+ `}};e.n([e.o({type:Boolean,reflect:!0})],a.prototype,`closeTag`,void 0),e.n([e.o({type:String,reflect:!0})],a.prototype,`size`,void 0),e.n([e.o({type:String,reflect:!0})],a.prototype,`skin`,void 0),e.n([e.o({type:String,reflect:!0})],a.prototype,`textStyle`,void 0),e.n([e.o({type:String,reflect:!0})],a.prototype,`iconName`,void 0),e.n([e.o({type:String})],a.prototype,`type`,void 0),e.n([e.o({type:String})],a.prototype,`ariaLabel`,void 0),e.n([e.o({type:Number,attribute:`button-tabindex`})],a.prototype,`buttonTabindex`,void 0),e.n([e.a()],a.prototype,`_isClosed`,void 0),e.n([e.a()],a.prototype,`_ariaDescription`,void 0);try{e.s(`pkt-tag`)(a)}catch{console.warn(`Forsøker å definere <pkt-tag>, men den er allerede definert`)}var o=a;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return o}});
@@ -1,8 +1,8 @@
1
- import { c as e, d as t, o as n, r, s as i } from "./element-cZ85T_aa.js";
2
- import { t as a } from "./class-map-C8HuhNzZ.js";
3
- import { n as o, t as s } from "./element-with-slot-4J2o3SeU.js";
4
- import "./icon-CZQkrK6B.js";
5
- import { t as c } from "./if-defined-Cjj8qN-Z.js";
1
+ import { a as e, n as t, o as n, p as r, s as i } from "./element-CduG0XyF.js";
2
+ import { t as a } from "./class-map-DH9hlJny.js";
3
+ import { n as o, t as s } from "./element-with-slot-BVj9MXzi.js";
4
+ import "./icon-LaKyBKON.js";
5
+ import { t as c } from "./if-defined-VShASPdu.js";
6
6
  var l = {
7
7
  name: "pkt-tag",
8
8
  react: "PktTag",
@@ -109,7 +109,7 @@ var l = {
109
109
  [`pkt-tag--${this.size}`]: !!this.size,
110
110
  [`pkt-tag--${this.skin}`]: !!this.skin,
111
111
  [`pkt-tag--${this.textStyle}`]: !!this.textStyle
112
- }, n = {
112
+ }, t = {
113
113
  "pkt-tag": !0,
114
114
  "pkt-btn": !0,
115
115
  "pkt-btn--tertiary": !0,
@@ -119,16 +119,16 @@ var l = {
119
119
  "pkt-btn--icons-right-and-left": this.closeTag && !!this.iconName,
120
120
  "pkt-hide": this._isClosed
121
121
  };
122
- return this.closeTag ? t`
122
+ return this.closeTag ? r`
123
123
  <button
124
- class=${a(n)}
124
+ class=${a(t)}
125
125
  type=${this.type}
126
126
  tabindex=${c(this.buttonTabindex)}
127
127
  @click=${this.close}
128
128
  aria-label=${c(this.ariaLabel || void 0)}
129
129
  aria-description=${c(this._ariaDescription || void 0)}
130
130
  >
131
- ${this.iconName && t`<pkt-icon
131
+ ${this.iconName && r`<pkt-icon
132
132
  class="pkt-tag__icon"
133
133
  name=${this.iconName}
134
134
  aria-hidden="true"
@@ -136,9 +136,9 @@ var l = {
136
136
  <span>${o(this)}</span>
137
137
  <pkt-icon class="pkt-tag__close-btn" name="close"></pkt-icon>
138
138
  </button>
139
- ` : t`
139
+ ` : r`
140
140
  <span class=${a(e)}>
141
- ${this.iconName && t`<pkt-icon
141
+ ${this.iconName && r`<pkt-icon
142
142
  class="pkt-tag__icon"
143
143
  name=${this.iconName}
144
144
  aria-hidden="true"
@@ -148,27 +148,27 @@ var l = {
148
148
  `;
149
149
  }
150
150
  };
151
- r([i({
151
+ t([n({
152
152
  type: Boolean,
153
153
  reflect: !0
154
- })], u.prototype, "closeTag", void 0), r([i({
154
+ })], u.prototype, "closeTag", void 0), t([n({
155
155
  type: String,
156
156
  reflect: !0
157
- })], u.prototype, "size", void 0), r([i({
157
+ })], u.prototype, "size", void 0), t([n({
158
158
  type: String,
159
159
  reflect: !0
160
- })], u.prototype, "skin", void 0), r([i({
160
+ })], u.prototype, "skin", void 0), t([n({
161
161
  type: String,
162
162
  reflect: !0
163
- })], u.prototype, "textStyle", void 0), r([i({
163
+ })], u.prototype, "textStyle", void 0), t([n({
164
164
  type: String,
165
165
  reflect: !0
166
- })], u.prototype, "iconName", void 0), r([i({ type: String })], u.prototype, "type", void 0), r([i({ type: String })], u.prototype, "ariaLabel", void 0), r([i({
166
+ })], u.prototype, "iconName", void 0), t([n({ type: String })], u.prototype, "type", void 0), t([n({ type: String })], u.prototype, "ariaLabel", void 0), t([n({
167
167
  type: Number,
168
168
  attribute: "button-tabindex"
169
- })], u.prototype, "buttonTabindex", void 0), r([n()], u.prototype, "_isClosed", void 0), r([n()], u.prototype, "_ariaDescription", void 0);
169
+ })], u.prototype, "buttonTabindex", void 0), t([e()], u.prototype, "_isClosed", void 0), t([e()], u.prototype, "_ariaDescription", void 0);
170
170
  try {
171
- e("pkt-tag")(u);
171
+ i("pkt-tag")(u);
172
172
  } catch {
173
173
  console.warn("Forsøker å definere <pkt-tag>, men den er allerede definert");
174
174
  }
@@ -0,0 +1,46 @@
1
+ const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./class-map-B8Ja0q7n.cjs`),n=require(`./directive-helpers-f36YZFOG.cjs`),r=require(`./element-with-slot-Cmxb9h4H.cjs`);require(`./icon-Dw6I0HDV.cjs`);const i=require(`./if-defined-LTjAScFG.cjs`),a=require(`./ref-CBdWMlde.cjs`),o=require(`./input-element-BHQVt4Q9.cjs`);require(`./input-wrapper-Dhkt20WW.cjs`);var s=e.c(class extends e.l{constructor(t){if(super(t),t.type!==e.u.PROPERTY&&t.type!==e.u.ATTRIBUTE&&t.type!==e.u.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!n.i(t))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(t,[r]){if(r===e.f||r===e.d)return r;let i=t.element,a=t.name;if(t.type===e.u.PROPERTY){if(r===i[a])return e.f}else if(t.type===e.u.BOOLEAN_ATTRIBUTE){if(!!r===i.hasAttribute(a))return e.f}else if(t.type===e.u.ATTRIBUTE&&i.getAttribute(a)===r+``)return e.f;return n.r(t),r}}),c=class extends o.t{constructor(...e){super(...e),this.inputRef=a.t(),this.value=``,this.autocomplete=`off`,this.rows=null,this.counterCurrent=0}attributeChangedCallback(e,t,n){e===`value`&&this.value!==t&&(this.counterCurrent=n?n.length:0,this.valueChanged(n,t)),super.attributeChangedCallback(e,t,n)}updated(e){super.updated(e),e.has(`value`)&&(this.counterCurrent=this.value?.length||0,this.valueChanged(this.value,e.get(`value`))),e.has(`id`)&&!this.name&&this.id&&(this.name=this.id)}render(){let n=t.t({"pkt-input":!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":this.counter&&this.counterMaxLength&&this.value.length&&this.value.length>this.counterMaxLength}),o=this.ariaLabelledby||`${this.id}-input-label`;return e.p`<pkt-input-wrapper
2
+ label=${this.label}
3
+ ?counter=${this.counter}
4
+ ?disabled=${this.disabled}
5
+ ?hasError=${this.hasError}
6
+ ?inline=${this.inline}
7
+ ?optionalTag=${this.optionalTag}
8
+ ?required=${this.required}
9
+ ?requiredTag=${this.requiredTag}
10
+ useWrapper=${this.useWrapper}
11
+ .ariaDescribedBy=${this.ariaDescribedBy}
12
+ .counterCurrent=${this.counterCurrent}
13
+ .counterMaxLength=${this.counterMaxLength}
14
+ .errorMessage=${this.errorMessage}
15
+ .forId="${this.id+`-input`}"
16
+ .helptext=${this.helptext}
17
+ .helptextDropdown=${this.helptextDropdown}
18
+ .helptextDropdownButton=${this.helptextDropdownButton}
19
+ .optionalText=${this.optionalText}
20
+ .requiredText=${this.requiredText}
21
+ .tagText=${this.tagText}
22
+ class="pkt-textarea"
23
+ >
24
+ <div class="pkt-contents" slot="helptext">${r.n(this,`helptext`)}</div>
25
+ <textarea
26
+ ${a.n(this.inputRef)}
27
+ class=${n}
28
+ id=${this.id+`-input`}
29
+ name=${(this.name||this.id)+`-input`}
30
+ placeholder=${i.t(this.placeholder)}
31
+ .value=${s(this.value)}
32
+ minlength=${i.t(this.minlength)}
33
+ maxlength=${i.t(this.maxlength)}
34
+ ?readonly=${this.readonly}
35
+ autocomplete=${this.autocomplete}
36
+ aria-labelledby=${o}
37
+ aria-invalid=${this.hasError}
38
+ aria-errormessage=${`${this.id}-error`}
39
+ rows=${this.rows}
40
+ ?disabled=${this.disabled}
41
+ @input=${e=>{this.value=e.target.value,this.onInput(),e.stopImmediatePropagation()}}
42
+ @change=${e=>{e.stopImmediatePropagation()}}
43
+ @focus=${e=>{this.onFocus(),e.stopImmediatePropagation()}}
44
+ @blur=${e=>{this.value=e.target.value,this.onBlur(),e.stopImmediatePropagation()}}
45
+ ></textarea>
46
+ </pkt-input-wrapper>`}};e.n([e.o({type:String,reflect:!0})],c.prototype,`value`,void 0),e.n([e.o({type:String})],c.prototype,`autocomplete`,void 0),e.n([e.o({type:Number})],c.prototype,`rows`,void 0),e.n([e.a()],c.prototype,`counterCurrent`,void 0);try{e.s(`pkt-textarea`)(c)}catch{console.warn(`Forsøker å definere <pkt-textarea>, men den er allerede definert`)}var l=c;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return l}});
@@ -1,30 +1,29 @@
1
- import { c as e, d as t, l as n, o as r, r as i, s as a, u as o } from "./element-cZ85T_aa.js";
2
- import { n as s, r as c, t as l } from "./directive-3THFsVew.js";
3
- import { t as u } from "./class-map-C8HuhNzZ.js";
4
- import { i as d, r as f } from "./directive-helpers-Dkv2gKgs.js";
5
- import { n as p } from "./element-with-slot-4J2o3SeU.js";
6
- import "./icon-CZQkrK6B.js";
7
- import { t as m } from "./if-defined-Cjj8qN-Z.js";
8
- import { n as h, t as g } from "./ref-RS8Uv6uC.js";
9
- import { t as _ } from "./input-element-B1ciW1N2.js";
10
- import "./input-wrapper-oYcbCFow.js";
1
+ import { a as e, c as t, d as n, f as r, l as i, n as a, o, p as s, s as c, u as l } from "./element-CduG0XyF.js";
2
+ import { t as u } from "./class-map-DH9hlJny.js";
3
+ import { i as d, r as f } from "./directive-helpers-Cep_4cpj.js";
4
+ import { n as p } from "./element-with-slot-BVj9MXzi.js";
5
+ import "./icon-LaKyBKON.js";
6
+ import { t as m } from "./if-defined-VShASPdu.js";
7
+ import { n as h, t as g } from "./ref-BgoHEsEt.js";
8
+ import { t as _ } from "./input-element-BrmkXIXi.js";
9
+ import "./input-wrapper-B6WowlWG.js";
11
10
  //#region ../../node_modules/lit-html/directives/live.js
12
- var v = l(class extends s {
11
+ var v = t(class extends i {
13
12
  constructor(e) {
14
- if (super(e), e.type !== c.PROPERTY && e.type !== c.ATTRIBUTE && e.type !== c.BOOLEAN_ATTRIBUTE) throw Error("The `live` directive is not allowed on child or event bindings");
13
+ if (super(e), e.type !== l.PROPERTY && e.type !== l.ATTRIBUTE && e.type !== l.BOOLEAN_ATTRIBUTE) throw Error("The `live` directive is not allowed on child or event bindings");
15
14
  if (!d(e)) throw Error("`live` bindings can only contain a single expression");
16
15
  }
17
16
  render(e) {
18
17
  return e;
19
18
  }
20
19
  update(e, [t]) {
21
- if (t === o || t === n) return t;
22
- let r = e.element, i = e.name;
23
- if (e.type === c.PROPERTY) {
24
- if (t === r[i]) return o;
25
- } else if (e.type === c.BOOLEAN_ATTRIBUTE) {
26
- if (!!t === r.hasAttribute(i)) return o;
27
- } else if (e.type === c.ATTRIBUTE && r.getAttribute(i) === t + "") return o;
20
+ if (t === r || t === n) return t;
21
+ let i = e.element, a = e.name;
22
+ if (e.type === l.PROPERTY) {
23
+ if (t === i[a]) return r;
24
+ } else if (e.type === l.BOOLEAN_ATTRIBUTE) {
25
+ if (!!t === i.hasAttribute(a)) return r;
26
+ } else if (e.type === l.ATTRIBUTE && i.getAttribute(a) === t + "") return r;
28
27
  return f(e), t;
29
28
  }
30
29
  }), y = class extends _ {
@@ -42,8 +41,8 @@ var v = l(class extends s {
42
41
  "pkt-input": !0,
43
42
  "pkt-input--fullwidth": this.fullwidth,
44
43
  "pkt-input--counter-error": this.counter && this.counterMaxLength && this.value.length && this.value.length > this.counterMaxLength
45
- }), n = this.ariaLabelledby || `${this.id}-input-label`;
46
- return t`<pkt-input-wrapper
44
+ }), t = this.ariaLabelledby || `${this.id}-input-label`;
45
+ return s`<pkt-input-wrapper
47
46
  label=${this.label}
48
47
  ?counter=${this.counter}
49
48
  ?disabled=${this.disabled}
@@ -78,7 +77,7 @@ var v = l(class extends s {
78
77
  maxlength=${m(this.maxlength)}
79
78
  ?readonly=${this.readonly}
80
79
  autocomplete=${this.autocomplete}
81
- aria-labelledby=${n}
80
+ aria-labelledby=${t}
82
81
  aria-invalid=${this.hasError}
83
82
  aria-errormessage=${`${this.id}-error`}
84
83
  rows=${this.rows}
@@ -99,12 +98,12 @@ var v = l(class extends s {
99
98
  </pkt-input-wrapper>`;
100
99
  }
101
100
  };
102
- i([a({
101
+ a([o({
103
102
  type: String,
104
103
  reflect: !0
105
- })], y.prototype, "value", void 0), i([a({ type: String })], y.prototype, "autocomplete", void 0), i([a({ type: Number })], y.prototype, "rows", void 0), i([r()], y.prototype, "counterCurrent", void 0);
104
+ })], y.prototype, "value", void 0), a([o({ type: String })], y.prototype, "autocomplete", void 0), a([o({ type: Number })], y.prototype, "rows", void 0), a([e()], y.prototype, "counterCurrent", void 0);
106
105
  try {
107
- e("pkt-textarea")(y);
106
+ c("pkt-textarea")(y);
108
107
  } catch {
109
108
  console.warn("Forsøker å definere <pkt-textarea>, men den er allerede definert");
110
109
  }