@oslokommune/punkt-elements 16.17.3 → 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 (195) hide show
  1. package/CHANGELOG.md +34 -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-ePJuDtmm.js → alert-BkzC5mVu.js} +22 -22
  5. package/dist/{alert-BEEnTiCb.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-CiwXrQYD.js → backlink-BXAdgAte.js} +6 -6
  9. package/dist/{backlink-Ba03LlbB.cjs → backlink-C42-3OG3.cjs} +2 -2
  10. package/dist/{breadcrumbs-CD1zib3s.cjs → breadcrumbs-CkjeLh3U.cjs} +6 -6
  11. package/dist/{breadcrumbs-CpuVqWhF.js → breadcrumbs-Dkb9TxMp.js} +15 -15
  12. package/dist/{button-BIpd1xJh.js → button-CR-KWhTT.js} +21 -21
  13. package/dist/{button-D-TOBaJB.cjs → button-Dwv11n6R.cjs} +7 -7
  14. package/dist/{calendar-DkjXla0I.cjs → calendar-Buvxe4l_.cjs} +11 -11
  15. package/dist/{calendar-Ch1dgnBo.js → calendar-DAq6iJdx.js} +50 -50
  16. package/dist/{card-CEDbo1t7.js → card-5PydU247.js} +43 -43
  17. package/dist/{card-C3POnP3O.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-DjvRMKOD.js → combobox-D-DY7YcW.js} +42 -42
  23. package/dist/{combobox-DYttdLJ4.cjs → combobox-x4tBGP3F.cjs} +17 -17
  24. package/dist/components/heading/heading.d.ts +5 -8
  25. package/dist/components/icon/icon.d.ts +6 -1
  26. package/dist/components/icon/icon.test.d.ts +2 -0
  27. package/dist/{consent-B5dIDyLD.cjs → consent-BB3g_ByO.cjs} +3 -3
  28. package/dist/{consent-DSHrt9eS.js → consent-Y14WZ0JS.js} +8 -8
  29. package/dist/{datepicker-D3QQbd_H.cjs → datepicker-BFI-3stE.cjs} +20 -20
  30. package/dist/{datepicker-M_jcY3wp.js → datepicker-CRk7aiwH.js} +57 -57
  31. package/dist/{directive-helpers-Dkv2gKgs.js → directive-helpers-Cep_4cpj.js} +1 -1
  32. package/dist/{directive-helpers-D1QSxY17.cjs → directive-helpers-f36YZFOG.cjs} +1 -1
  33. package/dist/element-CXAtr6Gu.cjs +2 -0
  34. package/dist/{element-cZ85T_aa.js → element-CduG0XyF.js} +47 -23
  35. package/dist/{element-with-slot-4J2o3SeU.js → element-with-slot-BVj9MXzi.js} +5 -6
  36. package/dist/element-with-slot-Cmxb9h4H.cjs +1 -0
  37. package/dist/{fileupload-IXSGrqiH.js → fileupload-C8muj8qd.js} +149 -149
  38. package/dist/{fileupload-qc0fHcR-.cjs → fileupload-YtsrgQTY.cjs} +40 -40
  39. package/dist/{header-C1hDYMRX.cjs → header-CjBip0zj.cjs} +57 -57
  40. package/dist/{header-BGknkrEt.js → header-DONTGbD9.js} +130 -130
  41. package/dist/{header-menu-zhGYdnvz.js → header-menu-BU-ylGrJ.js} +45 -45
  42. package/dist/{header-menu-CPI1_5oZ.cjs → header-menu-CnW7nzmF.cjs} +24 -24
  43. package/dist/heading-3o4Dk0Wn.js +80 -0
  44. package/dist/heading-C40-NX0r.cjs +1 -0
  45. package/dist/{helptext-BdqoW19r.js → helptext-C2aQBBo_.js} +12 -12
  46. package/dist/{helptext-KWXjKljV.cjs → helptext-DNLg43eI.cjs} +4 -4
  47. package/dist/icon-Dw6I0HDV.cjs +1 -0
  48. package/dist/{icon-Co72KtgF.js → icon-LaKyBKON.js} +39 -19
  49. package/dist/if-defined-LTjAScFG.cjs +1 -0
  50. package/dist/{if-defined-Cjj8qN-Z.js → if-defined-VShASPdu.js} +1 -1
  51. package/dist/{input-element-D0egtEnr.cjs → input-element-BHQVt4Q9.cjs} +1 -1
  52. package/dist/{input-element-B1ciW1N2.js → input-element-BrmkXIXi.js} +30 -30
  53. package/dist/{input-wrapper-DVU68NcJ.js → input-wrapper-B6WowlWG.js} +33 -33
  54. package/dist/{input-wrapper-DOIWggEv.cjs → input-wrapper-Dhkt20WW.cjs} +17 -17
  55. package/dist/{link-DMKjKawh.cjs → link-B5ur0Rym.cjs} +4 -4
  56. package/dist/{link-F51Ho7CV.js → link-ClUNY__5.js} +13 -13
  57. package/dist/linkcard-BIcCW-qw.cjs +13 -0
  58. package/dist/{linkcard-E07qJZMP.js → linkcard-DNJm5FvA.js} +15 -15
  59. package/dist/{listbox-0NHJvNjz.js → listbox-DXMIBv3y.js} +35 -35
  60. package/dist/{listbox-CcThiNBY.cjs → listbox-DbEobJNx.cjs} +14 -14
  61. package/dist/{loader-q_eO6zaE.cjs → loader-Uap9qDsV.cjs} +5 -5
  62. package/dist/{loader-teN65oWo.js → loader-gKdQpOOQ.js} +12 -12
  63. package/dist/{messagebox-D1QeQqb8.cjs → messagebox-BqBxXK8c.cjs} +5 -5
  64. package/dist/{messagebox-Ct9lfe0Z.js → messagebox-XRFecqyS.js} +15 -15
  65. package/dist/{modal-Ca-6xVkg.js → modal-CWgeT-RP.js} +19 -19
  66. package/dist/{modal-B7-0F5q7.cjs → modal-CrYHKOmr.cjs} +8 -8
  67. package/dist/pkt-accordion.cjs +1 -1
  68. package/dist/pkt-accordion.js +1 -1
  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-breadcrumbs.cjs +1 -1
  74. package/dist/pkt-breadcrumbs.js +1 -1
  75. package/dist/pkt-button.cjs +1 -1
  76. package/dist/pkt-button.js +1 -1
  77. package/dist/pkt-calendar.cjs +1 -1
  78. package/dist/pkt-calendar.js +1 -1
  79. package/dist/pkt-card.cjs +1 -1
  80. package/dist/pkt-card.js +1 -1
  81. package/dist/pkt-checkbox.cjs +1 -1
  82. package/dist/pkt-checkbox.js +1 -1
  83. package/dist/pkt-combobox.cjs +1 -1
  84. package/dist/pkt-combobox.js +1 -1
  85. package/dist/pkt-consent.cjs +1 -1
  86. package/dist/pkt-consent.js +1 -1
  87. package/dist/pkt-datepicker.cjs +1 -1
  88. package/dist/pkt-datepicker.js +1 -1
  89. package/dist/pkt-fileupload.cjs +1 -1
  90. package/dist/pkt-fileupload.js +1 -1
  91. package/dist/pkt-header-menu.cjs +1 -1
  92. package/dist/pkt-header-menu.js +1 -1
  93. package/dist/pkt-header.cjs +1 -1
  94. package/dist/pkt-header.js +1 -1
  95. package/dist/pkt-heading.cjs +1 -1
  96. package/dist/pkt-heading.js +1 -1
  97. package/dist/pkt-helptext.cjs +1 -1
  98. package/dist/pkt-helptext.js +1 -1
  99. package/dist/pkt-icon.cjs +1 -1
  100. package/dist/pkt-icon.js +1 -1
  101. package/dist/pkt-index.cjs +1 -1
  102. package/dist/pkt-index.js +32 -32
  103. package/dist/pkt-input-wrapper.cjs +1 -1
  104. package/dist/pkt-input-wrapper.js +1 -1
  105. package/dist/pkt-link.cjs +1 -1
  106. package/dist/pkt-link.js +1 -1
  107. package/dist/pkt-linkcard.cjs +1 -1
  108. package/dist/pkt-linkcard.js +1 -1
  109. package/dist/pkt-listbox.cjs +1 -1
  110. package/dist/pkt-listbox.js +1 -1
  111. package/dist/pkt-loader.cjs +1 -1
  112. package/dist/pkt-loader.js +1 -1
  113. package/dist/pkt-messagebox.cjs +1 -1
  114. package/dist/pkt-messagebox.js +1 -1
  115. package/dist/pkt-modal.cjs +1 -1
  116. package/dist/pkt-modal.js +1 -1
  117. package/dist/{pkt-options-controller-CCB15L_G.js → pkt-options-controller-BTNtjEIS.js} +1 -1
  118. package/dist/{pkt-options-controller-CeAQ-D-i.cjs → pkt-options-controller-CBM8xHwR.cjs} +1 -1
  119. package/dist/pkt-progressbar.cjs +1 -1
  120. package/dist/pkt-progressbar.js +1 -1
  121. package/dist/pkt-radiobutton.cjs +1 -1
  122. package/dist/pkt-radiobutton.js +1 -1
  123. package/dist/pkt-searchinput.cjs +1 -1
  124. package/dist/pkt-searchinput.js +1 -1
  125. package/dist/pkt-select.cjs +1 -1
  126. package/dist/pkt-select.js +1 -1
  127. package/dist/pkt-tabs.cjs +1 -1
  128. package/dist/pkt-tabs.js +1 -1
  129. package/dist/pkt-tag.cjs +1 -1
  130. package/dist/pkt-tag.js +1 -1
  131. package/dist/pkt-textarea.cjs +1 -1
  132. package/dist/pkt-textarea.js +1 -1
  133. package/dist/pkt-textinput.cjs +1 -1
  134. package/dist/pkt-textinput.js +1 -1
  135. package/dist/pkt-timepicker.cjs +1 -1
  136. package/dist/pkt-timepicker.js +1 -1
  137. package/dist/{progressbar-o-M17HPA.js → progressbar-B0P_vmGD.js} +23 -24
  138. package/dist/progressbar-DADdvDl5.cjs +17 -0
  139. package/dist/{radiobutton-B1Xg6XzP.cjs → radiobutton-BfURufrZ.cjs} +8 -8
  140. package/dist/{radiobutton-BAn1V_mQ.js → radiobutton-C6zERHoy.js} +20 -20
  141. package/dist/{ref-RS8Uv6uC.js → ref-BgoHEsEt.js} +7 -8
  142. package/dist/ref-CBdWMlde.cjs +1 -0
  143. package/dist/{repeat-DV1O43YU.js → repeat-CKIii8Mi.js} +15 -16
  144. package/dist/repeat-CRRgmzVn.cjs +1 -0
  145. package/dist/{searchinput-BVIaoetB.cjs → searchinput-BrxfRzez.cjs} +13 -13
  146. package/dist/{searchinput-CIseS5tL.js → searchinput-fPvXHu2O.js} +31 -31
  147. package/dist/{select-6XCVj1lP.js → select-BIgFPp42.js} +13 -13
  148. package/dist/{select-DO0xGhQQ.cjs → select-DzZHv6Bz.cjs} +3 -3
  149. package/dist/shared-types/index.d.ts +1 -1
  150. package/dist/shared-types/skin.d.ts +4 -0
  151. package/dist/{tabs-ClI1XQDt.js → tabs-BJx6wwXD.js} +29 -29
  152. package/dist/{tabs-CN_RIMWg.cjs → tabs-DxQy8U-0.cjs} +7 -7
  153. package/dist/{tag-DWtajZk6.cjs → tag-CBFz0R9N.cjs} +5 -5
  154. package/dist/{tag-hl59gziI.js → tag-CzlnHhho.js} +19 -19
  155. package/dist/textarea-M_S9WK7s.cjs +46 -0
  156. package/dist/{textarea-DBSNSvrX.js → textarea-qHtkhelz.js} +24 -25
  157. package/dist/{textinput-BZZnFDk3.js → textinput-CZrBM-Fj.js} +26 -26
  158. package/dist/{textinput-Dsc-8-BB.cjs → textinput-C_6kvf87.cjs} +12 -12
  159. package/dist/{timepicker-DDQ7CfOy.js → timepicker-O0iCeJyW.js} +51 -51
  160. package/dist/{timepicker-C2Ua6vHY.cjs → timepicker-WiYLAncb.cjs} +20 -20
  161. package/package.json +2 -2
  162. package/src/components/card/card.ts +1 -1
  163. package/src/components/heading/heading.test.ts +79 -70
  164. package/src/components/heading/heading.ts +40 -78
  165. package/src/components/icon/icon.test.ts +101 -0
  166. package/src/components/icon/icon.ts +40 -1
  167. package/dist/async-directive-B9P1Qa0k.cjs +0 -1
  168. package/dist/class-map-CJ-msbHs.cjs +0 -1
  169. package/dist/directive-3THFsVew.js +0 -28
  170. package/dist/directive-CJ2giQBZ.cjs +0 -1
  171. package/dist/element-DjtxO-1r.cjs +0 -2
  172. package/dist/element-with-slot-CWoTGA1B.cjs +0 -1
  173. package/dist/heading-BxvE80bb.js +0 -73
  174. package/dist/heading-DRJTS27k.cjs +0 -1
  175. package/dist/icon-Dr8sfT2X.cjs +0 -1
  176. package/dist/if-defined-XKOD_t_V.cjs +0 -1
  177. package/dist/linkcard-CBmJbSoV.cjs +0 -13
  178. package/dist/progressbar-Ca7pRjmt.cjs +0 -17
  179. package/dist/ref-BaJ0mBT_.cjs +0 -1
  180. package/dist/repeat-DaDFvx86.cjs +0 -1
  181. package/dist/textarea-CV6z3LDf.cjs +0 -46
  182. /package/dist/{booleanish-CRaKZ75t.js → booleanish-BmcOU-43.js} +0 -0
  183. /package/dist/{booleanish-B5EFqFpJ.cjs → booleanish-jJLlnr6-.cjs} +0 -0
  184. /package/dist/{classutils-z8YsPlOf.cjs → classutils-CVTzKF0J.cjs} +0 -0
  185. /package/dist/{classutils-DEL164Ur.js → classutils-lVbGcvjN.js} +0 -0
  186. /package/dist/{converters-Bffq_YDm.cjs → converters-C_66kHUN.cjs} +0 -0
  187. /package/dist/{converters-jauYkvNh.js → converters-DSQXaDQ_.js} +0 -0
  188. /package/dist/{dialog-polyfill.esm-B7W3teD0.js → dialog-polyfill.esm-0dVT8G1o.js} +0 -0
  189. /package/dist/{dialog-polyfill.esm-BnAQvMQO.cjs → dialog-polyfill.esm-CYs2AHP1.cjs} +0 -0
  190. /package/dist/{focus-modality-controller-pzSZkDkH.js → focus-modality-controller-CaUqYdk0.js} +0 -0
  191. /package/dist/{focus-modality-controller-BSZAQk8y.cjs → focus-modality-controller-wI5SR8wH.cjs} +0 -0
  192. /package/dist/{input-wrapper-CQGoyLdZ.cjs → input-wrapper-CYCCx8MP.cjs} +0 -0
  193. /package/dist/{input-wrapper-DwSsP39J.js → input-wrapper-kw2y6Jp_.js} +0 -0
  194. /package/dist/{utils-BOOZ0ppt.js → utils-CUqCKGvp.js} +0 -0
  195. /package/dist/{utils-CM67Oudc.cjs → utils-CjAbIttF.cjs} +0 -0
@@ -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-Dr8sfT2X.cjs`);const r=require(`./if-defined-XKOD_t_V.cjs`);window.pktAnimationPath=window.pktAnimationPath||`https://punkt-cdn.oslo.kommune.no/latest/animations/`;var i=class extends n.t{constructor(...e){super(...e),this.iconName=`user`,this.secondIconName=`user`,this.mode=`light`,this.size=`medium`,this.fullWidth=!1,this.fullWidthOnMobile=!1,this.skin=`primary`,this.variant=`label-only`,this.state=`normal`,this.type=`button`,this.form=void 0,this.isLoading=!1,this.disabled=!1,this.loadingAnimationPath=window.pktAnimationPath}connectedCallback(){super.connectedCallback(),this.addEventListener(`click`,e=>{(this.disabled||this.hasAttribute(`disabled`)||this.isLoading)&&(e.preventDefault(),e.stopImmediatePropagation())},!0),this.addEventListener(`keydown`,e=>{(this.disabled||this.hasAttribute(`disabled`)||this.isLoading)&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopImmediatePropagation())},!0)}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e===`disabled`&&n===`false`&&(this.disabled=!1),(e===`isloading`||e===`isLoading`)&&n===`false`&&(this.isLoading=!1)}firstUpdated(e){super.firstUpdated(e),this.disabled===`false`&&(this.disabled=!1),this.isLoading===`false`&&(this.isLoading=!1)}render(){let i=this.form??this.getAttribute(`form`)??void 0;return 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`);window.pktAnimationPath=window.pktAnimationPath||`https://punkt-cdn.oslo.kommune.no/latest/animations/`;var i=class extends n.t{constructor(...e){super(...e),this.iconName=`user`,this.secondIconName=`user`,this.mode=`light`,this.size=`medium`,this.fullWidth=!1,this.fullWidthOnMobile=!1,this.skin=`primary`,this.variant=`label-only`,this.state=`normal`,this.type=`button`,this.form=void 0,this.isLoading=!1,this.disabled=!1,this.loadingAnimationPath=window.pktAnimationPath}connectedCallback(){super.connectedCallback(),this.addEventListener(`click`,e=>{(this.disabled||this.hasAttribute(`disabled`)||this.isLoading)&&(e.preventDefault(),e.stopImmediatePropagation())},!0),this.addEventListener(`keydown`,e=>{(this.disabled||this.hasAttribute(`disabled`)||this.isLoading)&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopImmediatePropagation())},!0)}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e===`disabled`&&n===`false`&&(this.disabled=!1),(e===`isloading`||e===`isLoading`)&&n===`false`&&(this.isLoading=!1)}firstUpdated(e){super.firstUpdated(e),this.disabled===`false`&&(this.disabled=!1),this.isLoading===`false`&&(this.isLoading=!1)}render(){let i=this.form??this.getAttribute(`form`)??void 0;return e.p`
2
2
  <button
3
3
  class=${t.t({"pkt-btn":!0,[`pkt-btn--${this.size}`]:!!this.size,[`pkt-btn--${this.skin}`]:!!this.skin,[`pkt-btn--${this.variant}`]:!!this.variant,[`pkt-btn--${this.color}`]:!!this.color,[`pkt-btn--${this.state}`]:!!this.state,"pkt-btn--full":!!this.fullWidth,"pkt-btn--full-small":!!this.fullWidthOnMobile,"pkt-btn--disabled":!!this.disabled,"pkt-btn--isLoading":!!this.isLoading})}
4
4
  type=${this.type}
@@ -7,21 +7,21 @@ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./class-map-CJ-msbHs.cjs`),
7
7
  aria-disabled=${r.t(this.disabled||this.isLoading?`true`:void 0)}
8
8
  form=${r.t(i)}
9
9
  >
10
- ${this.isLoading?e.d`<pkt-icon
10
+ ${this.isLoading?e.p`<pkt-icon
11
11
  class="pkt-btn__icon pkt-btn__spinner"
12
12
  name="spinner-blue"
13
13
  path=${r.t(this.loadingAnimationPath)}
14
- ></pkt-icon>`:e.l}
15
- ${this.variant===`label-only`?e.l:e.d`<pkt-icon
14
+ ></pkt-icon>`:e.d}
15
+ ${this.variant===`label-only`?e.d:e.p`<pkt-icon
16
16
  class="pkt-btn__icon pkt-icon"
17
17
  name=${this.iconName}
18
18
  path=${r.t(this.iconPath)}
19
19
  ></pkt-icon>`}
20
20
  <span class="pkt-btn__text">${n.n(this)}</span>
21
- ${this.variant===`icons-right-and-left`?e.d`<pkt-icon
21
+ ${this.variant===`icons-right-and-left`?e.p`<pkt-icon
22
22
  class="pkt-btn__icon"
23
23
  name=${this.secondIconName}
24
24
  path=${r.t(this.secondIconPath)}
25
- ></pkt-icon>`:e.l}
25
+ ></pkt-icon>`:e.d}
26
26
  </button>
27
- `}};e.r([e.s({type:String})],i.prototype,`iconName`,void 0),e.r([e.s({type:String})],i.prototype,`secondIconName`,void 0),e.r([e.s({type:String})],i.prototype,`iconPath`,void 0),e.r([e.s({type:String})],i.prototype,`secondIconPath`,void 0),e.r([e.s({type:String})],i.prototype,`mode`,void 0),e.r([e.s({type:String})],i.prototype,`size`,void 0),e.r([e.s({type:Boolean,attribute:`full-width`})],i.prototype,`fullWidth`,void 0),e.r([e.s({type:Boolean,attribute:`full-width-on-mobile`})],i.prototype,`fullWidthOnMobile`,void 0),e.r([e.s({type:String})],i.prototype,`color`,void 0),e.r([e.s({type:String})],i.prototype,`skin`,void 0),e.r([e.s({type:String})],i.prototype,`variant`,void 0),e.r([e.s({type:String,reflect:!0})],i.prototype,`state`,void 0),e.r([e.s({type:String,reflect:!0})],i.prototype,`type`,void 0),e.r([e.s({type:String})],i.prototype,`form`,void 0),e.r([e.s({type:Boolean,reflect:!0})],i.prototype,`isLoading`,void 0),e.r([e.s({type:Boolean,reflect:!0})],i.prototype,`disabled`,void 0),e.r([e.s({type:String})],i.prototype,`loadingAnimationPath`,void 0);try{e.c(`pkt-button`)(i)}catch{console.warn(`Forsøker å definere <pkt-button>, men den er allerede definert`)}var a=i;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return a}});
27
+ `}};e.n([e.o({type:String})],i.prototype,`iconName`,void 0),e.n([e.o({type:String})],i.prototype,`secondIconName`,void 0),e.n([e.o({type:String})],i.prototype,`iconPath`,void 0),e.n([e.o({type:String})],i.prototype,`secondIconPath`,void 0),e.n([e.o({type:String})],i.prototype,`mode`,void 0),e.n([e.o({type:String})],i.prototype,`size`,void 0),e.n([e.o({type:Boolean,attribute:`full-width`})],i.prototype,`fullWidth`,void 0),e.n([e.o({type:Boolean,attribute:`full-width-on-mobile`})],i.prototype,`fullWidthOnMobile`,void 0),e.n([e.o({type:String})],i.prototype,`color`,void 0),e.n([e.o({type:String})],i.prototype,`skin`,void 0),e.n([e.o({type:String})],i.prototype,`variant`,void 0),e.n([e.o({type:String,reflect:!0})],i.prototype,`state`,void 0),e.n([e.o({type:String,reflect:!0})],i.prototype,`type`,void 0),e.n([e.o({type:String})],i.prototype,`form`,void 0),e.n([e.o({type:Boolean,reflect:!0})],i.prototype,`isLoading`,void 0),e.n([e.o({type:Boolean,reflect:!0})],i.prototype,`disabled`,void 0),e.n([e.o({type:String})],i.prototype,`loadingAnimationPath`,void 0);try{e.s(`pkt-button`)(i)}catch{console.warn(`Forsøker å definere <pkt-button>, men den er allerede definert`)}var a=i;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return a}});
@@ -1,4 +1,4 @@
1
- const e=require(`./element-DjtxO-1r.cjs`),t=require(`./class-map-CJ-msbHs.cjs`);require(`./icon-Dr8sfT2X.cjs`);const n=require(`./converters-Bffq_YDm.cjs`);function r(e,t,r){let i=n.y(e,r?.in);return isNaN(t)?n.b(r?.in||e,NaN):(t&&i.setDate(i.getDate()+t),i)}function i(e,t){let[r,i]=n.v(e,t.start,t.end);return{start:r,end:i}}function a(e,t){let{start:r,end:a}=i(t?.in,e),o=+r>+a,s=o?+r:+a,c=o?a:r;c.setHours(0,0,0,0);let l=t?.step??1;if(!l)return[];l<0&&(l=-l,o=!o);let u=[];for(;+c<=s;)u.push(n.b(r,c)),c.setDate(c.getDate()+l),c.setHours(0,0,0,0);return o?u.reverse():u}function o(e,t){let r=n.y(e,t?.in).getDay();return r===0?7:r}var s={name:`pkt-calendar`,react:`PktCalendar`,"css-class":`pkt-calendar`,isElement:!0,isPureReact:!0,props:{id:{type:`string`,name:`ID`,description:`Unik identifikasjon for kalenderen`},currentmonth:{type:`date`,name:`Gjeldende måned`,converter:`stringToDate`,description:`Måneden som vises i kalenderen`},selected:{type:`array`,name:`Valgte datoer`,converter:`csvToArray`,reflect:!0,items:{type:`date`},description:`Liste over valgte datoer`},excludeweekdays:{type:`array`,name:`Utelat ukedager`,converter:`csvToArray`,items:{type:`string`},description:`Liste over ukedager (1-7) som skal ekskluderes`},excludedates:{type:`array`,name:`Utelat datoer`,converter:`stringsToDate`,items:{type:`date`},description:`Liste over spesifikke datoer som skal ekskluderes`},earliest:{type:`date`,name:`Tidligst tillatte dato`,converter:`stringToDate`,default:null,description:`Tidligste dato som kan velges`},latest:{type:`date`,name:`Senest tillatte dato`,converter:`stringToDate`,default:null,description:`Seneste dato som kan velges`},weeknumbers:{type:`boolean`,name:`Vis ukenummer`,reflect:!0,default:!1,description:`Vis ukenummer i kalenderen`},withcontrols:{type:`boolean`,name:`Med velgere for måned/år`,reflect:!0,default:!1,description:`Vis navigasjonskontroller for måned og år`},multiple:{type:`boolean`,name:`Flervalg`,reflect:!0,default:!1,description:`Tillat valg av flere datoer`},maxMultiple:{attribute:`max-multiple`,type:`number`,name:`Maks antall i flervalg`,default:4,description:`Maksimalt antall datoer som kan velges`},today:{type:`string`,name:`Dagens dato (overstyring)`,description:`ISO-datostreng som overstyrer dagens dato. Nyttig for snapshot-tester.`},range:{type:`boolean`,name:`Datotidsrom (fra og til)`,reflect:!0,default:!1,description:`Tillat valg av datotidsrom`},dayStrings:{attribute:`day-strings`,type:`array`,name:`Korte dagsnavn`,items:{type:`string`},description:`Korte dagsnavn for kalenderoverskriften`},dayStringsLong:{attribute:`day-strings-long`,type:`array`,name:`Fulle dagsnavn`,items:{type:`string`},description:`Fulle dagsnavn for tilgjengelighetsetiketter`},monthStrings:{attribute:`month-strings`,type:`array`,name:`Månedsnavn`,items:{type:`string`},description:`Månedsnavn for kalendernavigasjonen`},weekString:{attribute:`week-string`,type:`string`,name:`Ukenummer-etikett`,description:`Etikett for ukenummerkolonnen`},prevMonthString:{attribute:`prev-month-string`,type:`string`,name:`Forrige måned-etikett`,description:`Tilgjengelighetsetikett for forrige måned-knappen`},nextMonthString:{attribute:`next-month-string`,type:`string`,name:`Neste måned-etikett`,description:`Tilgjengelighetsetikett for neste måned-knappen`}},events:{"date-selected":{description:`Returnerer en liste med valgte datoer i ISO-format`},close:{description:`Utløses når kalenderen ber om å lukkes (Escape-tast eller fokus forlater)`}}};function c(e,t){let r=(t.excludedates??[]).map(e=>typeof e==`string`?e:n.a(e));return!n.l(e,t.earliest,t.latest,r,t.excludeweekdays??[])}function l(e,t,n,r){return!!(c(e,n)||!t&&r.multiple&&r.maxMultiple>0&&r.selectedCount>=r.maxMultiple)}function u(e,t,r){let i=n.p(e,t,0);return!(r&&n.d(r)>i)}function d(e,t,r){let i=n.p(t===11?e+1:e,t===11?0:t+1,1);return!(r&&n.d(r)<i)}function f(e,t){let r=n.p(e,t,1),i=n.p(e,t+1,0),a=(r.getDay()+6)%7,o=i.getDate();return{firstDayOfMonth:r,lastDayOfMonth:i,startingDay:a,numDays:o,numRows:Math.ceil((o+a)/7),numDaysPrevMonth:n.p(e,t,0).getDate(),initialWeek:n._(r)}}function p(e,t,n,r){let{startingDay:i,numDays:a}=r;return e===0&&t<i?`prev-month`:n>a?`next-month`:`current-month`}function m(e,t,n,r){let{startingDay:i,numDaysPrevMonth:a,numDays:o}=r;return e===`prev-month`?a-(i-t-1):e===`next-month`?n-o:n}function h(e){return typeof e==`string`&&(e=e.split(`,`)),e.length===1&&e[0]===``?[]:e.map(e=>n.m(e))}function g(e,t){let r=a({start:e,end:t}),i={};if(Array.isArray(r)&&r.length)for(let a=0;a<r.length;a++){let o=r[a],s=o>e&&o<t;i[n.a(o)]=s}return i}function _(e,t,n,r){if(t.length!==1)return!0;let i=a({start:t[0],end:e});if(!Array.isArray(i)||!i.length)return!0;for(let a=0;a<i.length;a++){for(let r of n??[])if(r>t[0]&&r<e)return!1;if((r??[]).includes(o(i[a]).toString()))return!1}return!0}function v(e,t){let r=n.a(e);return t.includes(r)?t:[...t,r]}function y(e,t){let r=n.a(e),i=t.indexOf(r);if(i===-1)return t;if(t.length===1)return[];let a=[...t];return a.splice(i,1),a}function b(e,t,r){let i=n.a(e);return t.includes(i)?y(e,t):r>0&&t.length>=r?t:v(e,t)}function x(e,t,r){let i=n.a(e),a=h(t);return t.includes(i)?t.indexOf(i)===0?[]:y(e,t):t.length>1||t.length===1&&(!_(e,a,r.excludedates,r.excludeweekdays)||a[0]>e)?[i]:v(e,t)}var S={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7};function C(e){let t=e.nodeName;return t===`INPUT`||t===`SELECT`||t===`BUTTON`&&!e.dataset?.date}function w(e,t,i){let a=r(e,t);if(!a)return null;let o=i(`button[data-date="${n.a(a)}"]`);for(;o instanceof HTMLButtonElement&&o.dataset.disabled;)if(a=r(a,t),o=i(`button[data-date="${n.a(a)}"]`),!o)return null;return a}function T(e){return S[e]??null}var E=class extends e.t{constructor(...e){super(...e),this.selected=[],this.multiple=s.props.multiple.default,this.maxMultiple=s.props.maxMultiple.default,this.range=s.props.range.default,this.earliest=s.props.earliest.default,this.latest=s.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.weeknumbers=s.props.weeknumbers.default,this.withcontrols=s.props.withcontrols.default,this.currentmonth=null,this.today=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.inRange={},this.rangeHovered=null,this.year=0,this.month=0,this.week=0,this.currentmonthtouched=!1,this.focusedDate=null,this.selectableDates=[],this.tabIndexSet=0}get todayDate(){return this.today?n.m(this.today):n.g()}firstUpdated(e){this.addEventListener(`keydown`,this.handleKeydown)}disconnectedCallback(){this.removeEventListener(`keydown`,this.handleKeydown),super.disconnectedCallback()}updated(e){super.updated(e),e.has(`selected`)&&this.convertSelected()}convertSelected(){typeof this.selected==`string`&&(this.selected=this.selected.split(`,`)),this.selected.length===1&&this.selected[0]===``&&(this.selected=[]),this._selected=h(this.selected),this.range&&this.selected.length===2&&(this.inRange=g(this._selected[0],this._selected[1])),this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==``){let e=n.m(this.selected[this.selected.length-1]);this.currentmonth=isNaN(e.getTime())?n.f(this.todayDate):e}else this.currentmonth===null&&(this.currentmonth=n.f(this.todayDate));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=n.f(this.todayDate)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(e){let t=T(e.key);t!==null&&this.handleArrowKey(e,t)}handleArrowKey(e,t){let r=e.target;if(C(r))return;if(e.preventDefault(),!this.focusedDate){this.focusOnCurrentDate();return}let i=w(this.focusedDate?n.d(this.focusedDate):n.p(this.year,this.month,1),t,this.querySelector.bind(this));if(i){let e=this.querySelector(`button[data-date="${n.a(i)}"]`);e instanceof HTMLButtonElement&&!e.dataset.disabled&&(this.focusedDate=n.a(i),e.focus())}}render(){return e.d`
1
+ const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./class-map-B8Ja0q7n.cjs`);require(`./icon-Dw6I0HDV.cjs`);const n=require(`./converters-C_66kHUN.cjs`);function r(e,t,r){let i=n.y(e,r?.in);return isNaN(t)?n.b(r?.in||e,NaN):(t&&i.setDate(i.getDate()+t),i)}function i(e,t){let[r,i]=n.v(e,t.start,t.end);return{start:r,end:i}}function a(e,t){let{start:r,end:a}=i(t?.in,e),o=+r>+a,s=o?+r:+a,c=o?a:r;c.setHours(0,0,0,0);let l=t?.step??1;if(!l)return[];l<0&&(l=-l,o=!o);let u=[];for(;+c<=s;)u.push(n.b(r,c)),c.setDate(c.getDate()+l),c.setHours(0,0,0,0);return o?u.reverse():u}function o(e,t){let r=n.y(e,t?.in).getDay();return r===0?7:r}var s={name:`pkt-calendar`,react:`PktCalendar`,"css-class":`pkt-calendar`,isElement:!0,isPureReact:!0,props:{id:{type:`string`,name:`ID`,description:`Unik identifikasjon for kalenderen`},currentmonth:{type:`date`,name:`Gjeldende måned`,converter:`stringToDate`,description:`Måneden som vises i kalenderen`},selected:{type:`array`,name:`Valgte datoer`,converter:`csvToArray`,reflect:!0,items:{type:`date`},description:`Liste over valgte datoer`},excludeweekdays:{type:`array`,name:`Utelat ukedager`,converter:`csvToArray`,items:{type:`string`},description:`Liste over ukedager (1-7) som skal ekskluderes`},excludedates:{type:`array`,name:`Utelat datoer`,converter:`stringsToDate`,items:{type:`date`},description:`Liste over spesifikke datoer som skal ekskluderes`},earliest:{type:`date`,name:`Tidligst tillatte dato`,converter:`stringToDate`,default:null,description:`Tidligste dato som kan velges`},latest:{type:`date`,name:`Senest tillatte dato`,converter:`stringToDate`,default:null,description:`Seneste dato som kan velges`},weeknumbers:{type:`boolean`,name:`Vis ukenummer`,reflect:!0,default:!1,description:`Vis ukenummer i kalenderen`},withcontrols:{type:`boolean`,name:`Med velgere for måned/år`,reflect:!0,default:!1,description:`Vis navigasjonskontroller for måned og år`},multiple:{type:`boolean`,name:`Flervalg`,reflect:!0,default:!1,description:`Tillat valg av flere datoer`},maxMultiple:{attribute:`max-multiple`,type:`number`,name:`Maks antall i flervalg`,default:4,description:`Maksimalt antall datoer som kan velges`},today:{type:`string`,name:`Dagens dato (overstyring)`,description:`ISO-datostreng som overstyrer dagens dato. Nyttig for snapshot-tester.`},range:{type:`boolean`,name:`Datotidsrom (fra og til)`,reflect:!0,default:!1,description:`Tillat valg av datotidsrom`},dayStrings:{attribute:`day-strings`,type:`array`,name:`Korte dagsnavn`,items:{type:`string`},description:`Korte dagsnavn for kalenderoverskriften`},dayStringsLong:{attribute:`day-strings-long`,type:`array`,name:`Fulle dagsnavn`,items:{type:`string`},description:`Fulle dagsnavn for tilgjengelighetsetiketter`},monthStrings:{attribute:`month-strings`,type:`array`,name:`Månedsnavn`,items:{type:`string`},description:`Månedsnavn for kalendernavigasjonen`},weekString:{attribute:`week-string`,type:`string`,name:`Ukenummer-etikett`,description:`Etikett for ukenummerkolonnen`},prevMonthString:{attribute:`prev-month-string`,type:`string`,name:`Forrige måned-etikett`,description:`Tilgjengelighetsetikett for forrige måned-knappen`},nextMonthString:{attribute:`next-month-string`,type:`string`,name:`Neste måned-etikett`,description:`Tilgjengelighetsetikett for neste måned-knappen`}},events:{"date-selected":{description:`Returnerer en liste med valgte datoer i ISO-format`},close:{description:`Utløses når kalenderen ber om å lukkes (Escape-tast eller fokus forlater)`}}};function c(e,t){let r=(t.excludedates??[]).map(e=>typeof e==`string`?e:n.a(e));return!n.l(e,t.earliest,t.latest,r,t.excludeweekdays??[])}function l(e,t,n,r){return!!(c(e,n)||!t&&r.multiple&&r.maxMultiple>0&&r.selectedCount>=r.maxMultiple)}function u(e,t,r){let i=n.p(e,t,0);return!(r&&n.d(r)>i)}function d(e,t,r){let i=n.p(t===11?e+1:e,t===11?0:t+1,1);return!(r&&n.d(r)<i)}function f(e,t){let r=n.p(e,t,1),i=n.p(e,t+1,0),a=(r.getDay()+6)%7,o=i.getDate();return{firstDayOfMonth:r,lastDayOfMonth:i,startingDay:a,numDays:o,numRows:Math.ceil((o+a)/7),numDaysPrevMonth:n.p(e,t,0).getDate(),initialWeek:n._(r)}}function p(e,t,n,r){let{startingDay:i,numDays:a}=r;return e===0&&t<i?`prev-month`:n>a?`next-month`:`current-month`}function m(e,t,n,r){let{startingDay:i,numDaysPrevMonth:a,numDays:o}=r;return e===`prev-month`?a-(i-t-1):e===`next-month`?n-o:n}function h(e){return typeof e==`string`&&(e=e.split(`,`)),e.length===1&&e[0]===``?[]:e.map(e=>n.m(e))}function g(e,t){let r=a({start:e,end:t}),i={};if(Array.isArray(r)&&r.length)for(let a=0;a<r.length;a++){let o=r[a],s=o>e&&o<t;i[n.a(o)]=s}return i}function _(e,t,n,r){if(t.length!==1)return!0;let i=a({start:t[0],end:e});if(!Array.isArray(i)||!i.length)return!0;for(let a=0;a<i.length;a++){for(let r of n??[])if(r>t[0]&&r<e)return!1;if((r??[]).includes(o(i[a]).toString()))return!1}return!0}function v(e,t){let r=n.a(e);return t.includes(r)?t:[...t,r]}function y(e,t){let r=n.a(e),i=t.indexOf(r);if(i===-1)return t;if(t.length===1)return[];let a=[...t];return a.splice(i,1),a}function b(e,t,r){let i=n.a(e);return t.includes(i)?y(e,t):r>0&&t.length>=r?t:v(e,t)}function x(e,t,r){let i=n.a(e),a=h(t);return t.includes(i)?t.indexOf(i)===0?[]:y(e,t):t.length>1||t.length===1&&(!_(e,a,r.excludedates,r.excludeweekdays)||a[0]>e)?[i]:v(e,t)}var S={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7};function C(e){let t=e.nodeName;return t===`INPUT`||t===`SELECT`||t===`BUTTON`&&!e.dataset?.date}function w(e,t,i){let a=r(e,t);if(!a)return null;let o=i(`button[data-date="${n.a(a)}"]`);for(;o instanceof HTMLButtonElement&&o.dataset.disabled;)if(a=r(a,t),o=i(`button[data-date="${n.a(a)}"]`),!o)return null;return a}function T(e){return S[e]??null}var E=class extends e.t{constructor(...e){super(...e),this.selected=[],this.multiple=s.props.multiple.default,this.maxMultiple=s.props.maxMultiple.default,this.range=s.props.range.default,this.earliest=s.props.earliest.default,this.latest=s.props.latest.default,this.excludedates=[],this.excludeweekdays=[],this.weeknumbers=s.props.weeknumbers.default,this.withcontrols=s.props.withcontrols.default,this.currentmonth=null,this.today=null,this.dayStrings=this.strings.dates.daysShort,this.dayStringsLong=this.strings.dates.days,this.monthStrings=this.strings.dates.months,this.weekString=this.strings.dates.week,this.prevMonthString=this.strings.dates.prevMonth,this.nextMonthString=this.strings.dates.nextMonth,this._selected=[],this.inRange={},this.rangeHovered=null,this.year=0,this.month=0,this.week=0,this.currentmonthtouched=!1,this.focusedDate=null,this.selectableDates=[],this.tabIndexSet=0}get todayDate(){return this.today?n.m(this.today):n.g()}firstUpdated(e){this.addEventListener(`keydown`,this.handleKeydown)}disconnectedCallback(){this.removeEventListener(`keydown`,this.handleKeydown),super.disconnectedCallback()}updated(e){super.updated(e),e.has(`selected`)&&this.convertSelected()}convertSelected(){typeof this.selected==`string`&&(this.selected=this.selected.split(`,`)),this.selected.length===1&&this.selected[0]===``&&(this.selected=[]),this._selected=h(this.selected),this.range&&this.selected.length===2&&(this.inRange=g(this._selected[0],this._selected[1])),this.setCurrentMonth()}setCurrentMonth(){if(this.currentmonth===null&&!this.currentmonthtouched&&(this.currentmonthtouched=!0),this.selected.length&&this.selected[0]!==``){let e=n.m(this.selected[this.selected.length-1]);this.currentmonth=isNaN(e.getTime())?n.f(this.todayDate):e}else this.currentmonth===null&&(this.currentmonth=n.f(this.todayDate));(!this.currentmonth||isNaN(this.currentmonth.getTime()))&&(this.currentmonth=n.f(this.todayDate)),this.year=this.currentmonth.getFullYear(),this.month=this.currentmonth.getMonth()}handleKeydown(e){let t=T(e.key);t!==null&&this.handleArrowKey(e,t)}handleArrowKey(e,t){let r=e.target;if(C(r))return;if(e.preventDefault(),!this.focusedDate){this.focusOnCurrentDate();return}let i=w(this.focusedDate?n.d(this.focusedDate):n.p(this.year,this.month,1),t,this.querySelector.bind(this));if(i){let e=this.querySelector(`button[data-date="${n.a(i)}"]`);e instanceof HTMLButtonElement&&!e.dataset.disabled&&(this.focusedDate=n.a(i),e.focus())}}render(){return e.p`
2
2
  <div
3
3
  class="pkt-calendar ${this.weeknumbers?`pkt-cal-weeknumbers`:``}"
4
4
  @focusout=${this.closeEvent}
@@ -22,25 +22,25 @@ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./class-map-CJ-msbHs.cjs`);
22
22
  </tbody>
23
23
  </table>
24
24
  </div>
25
- `}renderMonthNavButton(t){let n=t===`prev`,r=n?this.isPrevMonthAllowed():this.isNextMonthAllowed(),i=n?this.prevMonthString:this.nextMonthString,a=n?`chevron-thin-left`:`chevron-thin-right`,o=n?`pkt-calendar__prev-month`:`pkt-calendar__next-month`,s=n?()=>this.prevMonth():()=>this.nextMonth();return e.d`<div>
25
+ `}renderMonthNavButton(t){let n=t===`prev`,r=n?this.isPrevMonthAllowed():this.isNextMonthAllowed(),i=n?this.prevMonthString:this.nextMonthString,a=n?`chevron-thin-left`:`chevron-thin-right`,o=n?`pkt-calendar__prev-month`:`pkt-calendar__next-month`,s=n?()=>this.prevMonth():()=>this.nextMonth();return e.p`<div>
26
26
  <button
27
27
  type="button"
28
28
  aria-label="${i}"
29
29
  @click=${()=>r&&s()}
30
30
  @keydown=${e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r&&s())}}
31
31
  class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only ${o} ${r?``:`pkt-invisible`}"
32
- .data-disabled=${r?e.l:`disabled`}
32
+ .data-disabled=${r?e.d:`disabled`}
33
33
  ?aria-disabled=${!r}
34
34
  tabindex=${r?`0`:`-1`}
35
35
  >
36
36
  <pkt-icon class="pkt-btn__icon" name="${a}"></pkt-icon>
37
37
  <span class="pkt-btn__text">${i}</span>
38
38
  </button>
39
- </div>`}renderDayNames(){let t=[];this.weeknumbers&&t.push(e.d`<th><div class="pkt-calendar__week-number">${this.weekString}</div></th>`);for(let n=0;n<this.dayStrings.length;n++)t.push(e.d`<th>
39
+ </div>`}renderDayNames(){let t=[];this.weeknumbers&&t.push(e.p`<th><div class="pkt-calendar__week-number">${this.weekString}</div></th>`);for(let n=0;n<this.dayStrings.length;n++)t.push(e.p`<th>
40
40
  <div class="pkt-calendar__day-name" aria-label="${this.dayStringsLong[n]}">
41
41
  ${this.dayStrings[n]}
42
42
  </div>
43
- </th>`);return e.d`<tr class="pkt-cal-week-row">${t}</tr>`}renderMonthNav(){return this.withcontrols?e.d`<div class="pkt-cal-month-picker">
43
+ </th>`);return e.p`<tr class="pkt-cal-week-row">${t}</tr>`}renderMonthNav(){return this.withcontrols?e.p`<div class="pkt-cal-month-picker">
44
44
  <label for="${this.id}-monthnav" class="pkt-hide">${this.strings.dates.month}</label>
45
45
  <select
46
46
  aria-label="${this.strings.dates.month}"
@@ -48,7 +48,7 @@ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./class-map-CJ-msbHs.cjs`);
48
48
  id="${this.id}-monthnav"
49
49
  @change=${e=>{e.stopImmediatePropagation();let t=e.target;this.changeMonth(this.year,parseInt(t.value))}}
50
50
  >
51
- ${this.monthStrings.map((t,n)=>e.d`<option value=${n} ?selected=${this.month===n}>${t}</option>`)}
51
+ ${this.monthStrings.map((t,n)=>e.p`<option value=${n} ?selected=${this.month===n}>${t}</option>`)}
52
52
  </select>
53
53
  <label for="${this.id}-yearnav" class="pkt-hide">${this.strings.dates.year}</label>
54
54
  <input
@@ -61,9 +61,9 @@ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./class-map-CJ-msbHs.cjs`);
61
61
  @change=${e=>{e.stopImmediatePropagation();let t=e.target;this.changeMonth(parseInt(t.value),this.month)}}
62
62
  .value=${this.year}
63
63
  />
64
- </div>`:e.d`<div class="pkt-txt-16-medium pkt-calendar__month-title" aria-live="polite">
64
+ </div>`:e.p`<div class="pkt-txt-16-medium pkt-calendar__month-title" aria-live="polite">
65
65
  ${this.monthStrings[this.month]} ${this.year}
66
- </div>`}getDayViewData(e,t){let r=n.p(this.year,this.month,e),i=n.a(r),a=i===n.a(t),o=this.selected.includes(i),s=this.isDayDisabled(r,o),c=this.calculateTabIndex(i,s,e);return{currentDate:r,currentDateISO:i,isToday:a,isSelected:o,isDisabled:s,ariaLabel:n.o(r),tabindex:c}}getDateConstraints(){return{earliest:this.earliest,latest:this.latest,excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}}isDayDisabled(e,t){return l(e,t,this.getDateConstraints(),{multiple:this.multiple,maxMultiple:this.maxMultiple,selectedCount:this.selected.length})}calculateTabIndex(e,t,n){return this.focusedDate?this.focusedDate===e&&!t?`0`:`-1`:!t&&this.tabIndexSet===0?(this.tabIndexSet=n,`0`):this.tabIndexSet===n?`0`:`-1`}getDayCellClasses(e){let{currentDateISO:t,isToday:r,isSelected:i}=e,a=this.range&&(this.selected.length===2||this.rangeHovered!==null)&&t===this.selected[0],o=this.range&&this.selected.length===2&&t===this.selected[1];return{"pkt-cal-today":r,"pkt-cal-selected":i,"pkt-cal-in-range":this.inRange[t],"pkt-cal-excluded":this.isExcluded(e.currentDate),"pkt-cal-in-range-first":a,"pkt-cal-in-range-last":o,"pkt-cal-range-hover":this.rangeHovered!==null&&t===n.a(this.rangeHovered)}}getDayButtonClasses(e){let{currentDateISO:t,isToday:r,isSelected:i,isDisabled:a}=e,o=this.range&&(this.selected.length===2||this.rangeHovered!==null)&&t===this.selected[0],s=this.range&&this.selected.length===2&&t===this.selected[1];return{"pkt-calendar__date":!0,"pkt-calendar__date--today":r,"pkt-calendar__date--selected":i,"pkt-calendar__date--disabled":a,"pkt-calendar__date--in-range":this.inRange[t],"pkt-calendar__date--in-range-hover":this.rangeHovered!==null&&t===n.a(this.rangeHovered),"pkt-calendar__date--range-start":o,"pkt-calendar__date--range-end":s}}handleDayFocus(e,t){this.range&&!this.isExcluded(e)&&this.handleRangeHover(e),this.focusedDate=t}renderDayView(n,r){let i=this.getDayViewData(n,r),{currentDate:a,currentDateISO:o,isSelected:s,isDisabled:c,ariaLabel:l,tabindex:u}=i;this.selectableDates.push({currentDateISO:o,isDisabled:c,tabindex:u});let d=this.getDayCellClasses(i),f=this.getDayButtonClasses(i);return e.d`<td class=${t.t(d)}>
66
+ </div>`}getDayViewData(e,t){let r=n.p(this.year,this.month,e),i=n.a(r),a=i===n.a(t),o=this.selected.includes(i),s=this.isDayDisabled(r,o),c=this.calculateTabIndex(i,s,e);return{currentDate:r,currentDateISO:i,isToday:a,isSelected:o,isDisabled:s,ariaLabel:n.o(r),tabindex:c}}getDateConstraints(){return{earliest:this.earliest,latest:this.latest,excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}}isDayDisabled(e,t){return l(e,t,this.getDateConstraints(),{multiple:this.multiple,maxMultiple:this.maxMultiple,selectedCount:this.selected.length})}calculateTabIndex(e,t,n){return this.focusedDate?this.focusedDate===e&&!t?`0`:`-1`:!t&&this.tabIndexSet===0?(this.tabIndexSet=n,`0`):this.tabIndexSet===n?`0`:`-1`}getDayCellClasses(e){let{currentDateISO:t,isToday:r,isSelected:i}=e,a=this.range&&(this.selected.length===2||this.rangeHovered!==null)&&t===this.selected[0],o=this.range&&this.selected.length===2&&t===this.selected[1];return{"pkt-cal-today":r,"pkt-cal-selected":i,"pkt-cal-in-range":this.inRange[t],"pkt-cal-excluded":this.isExcluded(e.currentDate),"pkt-cal-in-range-first":a,"pkt-cal-in-range-last":o,"pkt-cal-range-hover":this.rangeHovered!==null&&t===n.a(this.rangeHovered)}}getDayButtonClasses(e){let{currentDateISO:t,isToday:r,isSelected:i,isDisabled:a}=e,o=this.range&&(this.selected.length===2||this.rangeHovered!==null)&&t===this.selected[0],s=this.range&&this.selected.length===2&&t===this.selected[1];return{"pkt-calendar__date":!0,"pkt-calendar__date--today":r,"pkt-calendar__date--selected":i,"pkt-calendar__date--disabled":a,"pkt-calendar__date--in-range":this.inRange[t],"pkt-calendar__date--in-range-hover":this.rangeHovered!==null&&t===n.a(this.rangeHovered),"pkt-calendar__date--range-start":o,"pkt-calendar__date--range-end":s}}handleDayFocus(e,t){this.range&&!this.isExcluded(e)&&this.handleRangeHover(e),this.focusedDate=t}renderDayView(n,r){let i=this.getDayViewData(n,r),{currentDate:a,currentDateISO:o,isSelected:s,isDisabled:c,ariaLabel:l,tabindex:u}=i;this.selectableDates.push({currentDateISO:o,isDisabled:c,tabindex:u});let d=this.getDayCellClasses(i),f=this.getDayButtonClasses(i);return e.p`<td class=${t.t(d)}>
67
67
  <button
68
68
  type="button"
69
69
  aria-pressed=${s?`true`:`false`}
@@ -73,18 +73,18 @@ const e=require(`./element-DjtxO-1r.cjs`),t=require(`./class-map-CJ-msbHs.cjs`);
73
73
  @focus=${()=>this.handleDayFocus(a,o)}
74
74
  aria-label="${l}"
75
75
  tabindex=${u}
76
- data-disabled=${c?`disabled`:e.l}
76
+ data-disabled=${c?`disabled`:e.d}
77
77
  data-date=${o}
78
78
  @keydown=${e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.handleDateSelect(a))}}
79
79
  @click=${e=>{c||(e.preventDefault(),this.handleDateSelect(a))}}
80
80
  >
81
81
  <span class="pkt-btn__text pkt-txt-14-light">${n}</span>
82
82
  </button>
83
- </td>`}renderEmptyDayCell(t){return e.d`<td class="pkt-cal-other">
83
+ </td>`}renderEmptyDayCell(t){return e.p`<td class="pkt-cal-other">
84
84
  <div
85
85
  class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
86
86
  data-disabled="disabled"
87
87
  >
88
88
  <span class="pkt-btn__text pkt-txt-14-light">${t}</span>
89
89
  </div>
90
- </td>`}renderWeekRow(t){return e.d`<tr class="pkt-cal-week-row" role="row">${t}</tr>`}renderCalendarBody(){let t=this.todayDate,n=f(this.year,this.month);this.selectableDates=[],this.tabIndexSet=0;let r=1;this.week=n.initialWeek;let i=[];for(let a=0;a<n.numRows;a++){let o=[];this.weeknumbers&&o.push(e.d`<td class="pkt-cal-week">${this.week}</td>`),this.week++;for(let e=0;e<7;e++){let i=p(a,e,r,n);if(i===`current-month`)o.push(this.renderDayView(r,t)),r++;else{let t=m(i,e,r,n);o.push(this.renderEmptyDayCell(t)),i===`next-month`&&r++}}i.push(this.renderWeekRow(o))}return i}isExcluded(e){return c(e,this.getDateConstraints())}isPrevMonthAllowed(){return u(this.year,this.month,this.earliest)}prevMonth(){let e=this.month===0?11:this.month-1,t=this.month===0?this.year-1:this.year;this.changeMonth(t,e)}isNextMonthAllowed(){return d(this.year,this.month,this.latest)}nextMonth(){let e=this.month===11?0:this.month+1,t=this.month===11?this.year+1:this.year;this.changeMonth(t,e)}changeMonth(e,t){this.year=typeof e==`string`?parseInt(e):e,this.month=typeof t==`string`?parseInt(t):t,this.currentmonth=n.f(new Date(this.year,this.month,1)),this.tabIndexSet=0,this.focusedDate=null,this.selectableDates=[]}emptySelected(){this.selected=[],this._selected=[],this.inRange={}}normalizeSelected(){return typeof this.selected==`string`?this.selected.split(`,`):this.selected}addToSelected(e){this.selected=v(e,this.normalizeSelected()),this._selected=h(this.selected),this.range&&this.selected.length===2&&(this.convertSelected(),this.close())}removeFromSelected(e){this.selected=y(e,this.normalizeSelected()),this._selected=h(this.selected)}toggleSelected(e){this.selected=b(e,this.normalizeSelected(),this.maxMultiple),this._selected=h(this.selected)}isRangeAllowed(e){return _(e,this._selected,this.excludedates,this.excludeweekdays)}handleRangeSelect(e){return this.selected=x(e,this.normalizeSelected(),{excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}),this._selected=h(this.selected),this.selected.length===2?(this.convertSelected(),this.close()):this.selected.length===1&&(this.inRange={}),Promise.resolve()}handleRangeHover(e){if(!this.range||this._selected.length!==1||!this.isRangeAllowed(e)||this._selected[0]>=e){this.rangeHovered=null;return}this.rangeHovered=e,this.inRange=g(this._selected[0],e)}handleDateSelect(e){return e?(this.range?this.handleRangeSelect(e):this.multiple?this.toggleSelected(e):(this.selected.includes(n.a(e))?this.emptySelected():(this.emptySelected(),this.addToSelected(e)),this.close()),this.dispatchEvent(new CustomEvent(`date-selected`,{detail:this.selected,bubbles:!0,composed:!0})),Promise.resolve()):Promise.resolve()}focusOnCurrentDate(){let e=n.a(n.f(this.todayDate)),t=this.querySelector(`button[data-date="${e}"]`);if(t instanceof HTMLButtonElement){this.focusedDate=e,t.focus();return}let r=this.selectableDates.find(e=>!e.isDisabled);if(r){let e=this.querySelector(`button[data-date="${r.currentDateISO}"]`);e instanceof HTMLButtonElement&&(this.focusedDate=r.currentDateISO,e.focus())}}closeEvent(e){!this.contains(e.relatedTarget)&&!e.target.classList.contains(`pkt-invisible`)&&this.close()}close(){this.dispatchEvent(new CustomEvent(`close`,{detail:!0,bubbles:!0,composed:!0}))}};e.r([e.s({converter:n.t.csvToArray})],E.prototype,`selected`,void 0),e.r([e.s({type:Boolean})],E.prototype,`multiple`,void 0),e.r([e.s({type:Number,attribute:`max-multiple`})],E.prototype,`maxMultiple`,void 0),e.r([e.s({type:Boolean})],E.prototype,`range`,void 0),e.r([e.s({type:String})],E.prototype,`earliest`,void 0),e.r([e.s({type:String})],E.prototype,`latest`,void 0),e.r([e.s({converter:n.t.stringsToDate})],E.prototype,`excludedates`,void 0),e.r([e.s({converter:n.t.csvToArray})],E.prototype,`excludeweekdays`,void 0),e.r([e.s({type:Boolean})],E.prototype,`weeknumbers`,void 0),e.r([e.s({type:Boolean})],E.prototype,`withcontrols`,void 0),e.r([e.s({converter:n.t.stringToDate})],E.prototype,`currentmonth`,void 0),e.r([e.s({type:String})],E.prototype,`today`,void 0),e.r([e.s({type:Array,attribute:`day-strings`})],E.prototype,`dayStrings`,void 0),e.r([e.s({type:Array,attribute:`day-strings-long`})],E.prototype,`dayStringsLong`,void 0),e.r([e.s({type:Array,attribute:`month-strings`})],E.prototype,`monthStrings`,void 0),e.r([e.s({type:String,attribute:`week-string`})],E.prototype,`weekString`,void 0),e.r([e.s({type:String,attribute:`prev-month-string`})],E.prototype,`prevMonthString`,void 0),e.r([e.s({type:String,attribute:`next-month-string`})],E.prototype,`nextMonthString`,void 0),e.r([e.s({type:Array})],E.prototype,`_selected`,void 0),e.r([e.o()],E.prototype,`inRange`,void 0),e.r([e.s({type:Date})],E.prototype,`rangeHovered`,void 0),e.r([e.s({type:Number})],E.prototype,`year`,void 0),e.r([e.s({type:Number})],E.prototype,`month`,void 0),e.r([e.s({type:Number})],E.prototype,`week`,void 0),e.r([e.o()],E.prototype,`currentmonthtouched`,void 0),e.r([e.o()],E.prototype,`focusedDate`,void 0);try{e.c(`pkt-calendar`)(E)}catch{console.warn(`Forsøker å definere <pkt-calendar>, men den er allerede definert`)}var D=E;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return D}});
90
+ </td>`}renderWeekRow(t){return e.p`<tr class="pkt-cal-week-row" role="row">${t}</tr>`}renderCalendarBody(){let t=this.todayDate,n=f(this.year,this.month);this.selectableDates=[],this.tabIndexSet=0;let r=1;this.week=n.initialWeek;let i=[];for(let a=0;a<n.numRows;a++){let o=[];this.weeknumbers&&o.push(e.p`<td class="pkt-cal-week">${this.week}</td>`),this.week++;for(let e=0;e<7;e++){let i=p(a,e,r,n);if(i===`current-month`)o.push(this.renderDayView(r,t)),r++;else{let t=m(i,e,r,n);o.push(this.renderEmptyDayCell(t)),i===`next-month`&&r++}}i.push(this.renderWeekRow(o))}return i}isExcluded(e){return c(e,this.getDateConstraints())}isPrevMonthAllowed(){return u(this.year,this.month,this.earliest)}prevMonth(){let e=this.month===0?11:this.month-1,t=this.month===0?this.year-1:this.year;this.changeMonth(t,e)}isNextMonthAllowed(){return d(this.year,this.month,this.latest)}nextMonth(){let e=this.month===11?0:this.month+1,t=this.month===11?this.year+1:this.year;this.changeMonth(t,e)}changeMonth(e,t){this.year=typeof e==`string`?parseInt(e):e,this.month=typeof t==`string`?parseInt(t):t,this.currentmonth=n.f(new Date(this.year,this.month,1)),this.tabIndexSet=0,this.focusedDate=null,this.selectableDates=[]}emptySelected(){this.selected=[],this._selected=[],this.inRange={}}normalizeSelected(){return typeof this.selected==`string`?this.selected.split(`,`):this.selected}addToSelected(e){this.selected=v(e,this.normalizeSelected()),this._selected=h(this.selected),this.range&&this.selected.length===2&&(this.convertSelected(),this.close())}removeFromSelected(e){this.selected=y(e,this.normalizeSelected()),this._selected=h(this.selected)}toggleSelected(e){this.selected=b(e,this.normalizeSelected(),this.maxMultiple),this._selected=h(this.selected)}isRangeAllowed(e){return _(e,this._selected,this.excludedates,this.excludeweekdays)}handleRangeSelect(e){return this.selected=x(e,this.normalizeSelected(),{excludedates:this.excludedates,excludeweekdays:this.excludeweekdays}),this._selected=h(this.selected),this.selected.length===2?(this.convertSelected(),this.close()):this.selected.length===1&&(this.inRange={}),Promise.resolve()}handleRangeHover(e){if(!this.range||this._selected.length!==1||!this.isRangeAllowed(e)||this._selected[0]>=e){this.rangeHovered=null;return}this.rangeHovered=e,this.inRange=g(this._selected[0],e)}handleDateSelect(e){return e?(this.range?this.handleRangeSelect(e):this.multiple?this.toggleSelected(e):(this.selected.includes(n.a(e))?this.emptySelected():(this.emptySelected(),this.addToSelected(e)),this.close()),this.dispatchEvent(new CustomEvent(`date-selected`,{detail:this.selected,bubbles:!0,composed:!0})),Promise.resolve()):Promise.resolve()}focusOnCurrentDate(){let e=n.a(n.f(this.todayDate)),t=this.querySelector(`button[data-date="${e}"]`);if(t instanceof HTMLButtonElement){this.focusedDate=e,t.focus();return}let r=this.selectableDates.find(e=>!e.isDisabled);if(r){let e=this.querySelector(`button[data-date="${r.currentDateISO}"]`);e instanceof HTMLButtonElement&&(this.focusedDate=r.currentDateISO,e.focus())}}closeEvent(e){!this.contains(e.relatedTarget)&&!e.target.classList.contains(`pkt-invisible`)&&this.close()}close(){this.dispatchEvent(new CustomEvent(`close`,{detail:!0,bubbles:!0,composed:!0}))}};e.n([e.o({converter:n.t.csvToArray})],E.prototype,`selected`,void 0),e.n([e.o({type:Boolean})],E.prototype,`multiple`,void 0),e.n([e.o({type:Number,attribute:`max-multiple`})],E.prototype,`maxMultiple`,void 0),e.n([e.o({type:Boolean})],E.prototype,`range`,void 0),e.n([e.o({type:String})],E.prototype,`earliest`,void 0),e.n([e.o({type:String})],E.prototype,`latest`,void 0),e.n([e.o({converter:n.t.stringsToDate})],E.prototype,`excludedates`,void 0),e.n([e.o({converter:n.t.csvToArray})],E.prototype,`excludeweekdays`,void 0),e.n([e.o({type:Boolean})],E.prototype,`weeknumbers`,void 0),e.n([e.o({type:Boolean})],E.prototype,`withcontrols`,void 0),e.n([e.o({converter:n.t.stringToDate})],E.prototype,`currentmonth`,void 0),e.n([e.o({type:String})],E.prototype,`today`,void 0),e.n([e.o({type:Array,attribute:`day-strings`})],E.prototype,`dayStrings`,void 0),e.n([e.o({type:Array,attribute:`day-strings-long`})],E.prototype,`dayStringsLong`,void 0),e.n([e.o({type:Array,attribute:`month-strings`})],E.prototype,`monthStrings`,void 0),e.n([e.o({type:String,attribute:`week-string`})],E.prototype,`weekString`,void 0),e.n([e.o({type:String,attribute:`prev-month-string`})],E.prototype,`prevMonthString`,void 0),e.n([e.o({type:String,attribute:`next-month-string`})],E.prototype,`nextMonthString`,void 0),e.n([e.o({type:Array})],E.prototype,`_selected`,void 0),e.n([e.a()],E.prototype,`inRange`,void 0),e.n([e.o({type:Date})],E.prototype,`rangeHovered`,void 0),e.n([e.o({type:Number})],E.prototype,`year`,void 0),e.n([e.o({type:Number})],E.prototype,`month`,void 0),e.n([e.o({type:Number})],E.prototype,`week`,void 0),e.n([e.a()],E.prototype,`currentmonthtouched`,void 0),e.n([e.a()],E.prototype,`focusedDate`,void 0);try{e.s(`pkt-calendar`)(E)}catch{console.warn(`Forsøker å definere <pkt-calendar>, men den er allerede definert`)}var D=E;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return D}});
@@ -1,7 +1,7 @@
1
- import { c as e, d as t, l as n, o as r, r as i, s as a, t as o } from "./element-cZ85T_aa.js";
2
- import { t as s } from "./class-map-C8HuhNzZ.js";
3
- import "./icon-Co72KtgF.js";
4
- import { _ as c, a as l, b as u, d, f, g as p, l as m, m as h, o as g, p as _, t as v, v as y, y as b } from "./converters-jauYkvNh.js";
1
+ import { a as e, d as t, n, o as r, p as i, s as a, t as o } from "./element-CduG0XyF.js";
2
+ import { t as s } from "./class-map-DH9hlJny.js";
3
+ import "./icon-LaKyBKON.js";
4
+ import { _ as c, a as l, b as u, d, f, g as p, l as m, m as h, o as g, p as _, t as v, v as y, y as b } from "./converters-DSQXaDQ_.js";
5
5
  //#region ../../node_modules/date-fns/addDays.js
6
6
  function x(e, t, n) {
7
7
  let r = b(e, n?.in);
@@ -326,7 +326,7 @@ var W = class extends o {
326
326
  }
327
327
  }
328
328
  render() {
329
- return t`
329
+ return i`
330
330
  <div
331
331
  class="pkt-calendar ${this.weeknumbers ? "pkt-cal-weeknumbers" : ""}"
332
332
  @focusout=${this.closeEvent}
@@ -355,19 +355,19 @@ var W = class extends o {
355
355
  `;
356
356
  }
357
357
  renderMonthNavButton(e) {
358
- let r = e === "prev", i = r ? this.isPrevMonthAllowed() : this.isNextMonthAllowed(), a = r ? this.prevMonthString : this.nextMonthString, o = r ? "chevron-thin-left" : "chevron-thin-right", s = r ? "pkt-calendar__prev-month" : "pkt-calendar__next-month", c = r ? () => this.prevMonth() : () => this.nextMonth();
359
- return t`<div>
358
+ let n = e === "prev", r = n ? this.isPrevMonthAllowed() : this.isNextMonthAllowed(), a = n ? this.prevMonthString : this.nextMonthString, o = n ? "chevron-thin-left" : "chevron-thin-right", s = n ? "pkt-calendar__prev-month" : "pkt-calendar__next-month", c = n ? () => this.prevMonth() : () => this.nextMonth();
359
+ return i`<div>
360
360
  <button
361
361
  type="button"
362
362
  aria-label="${a}"
363
- @click=${() => i && c()}
363
+ @click=${() => r && c()}
364
364
  @keydown=${(e) => {
365
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), i && c());
365
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), r && c());
366
366
  }}
367
- class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only ${s} ${i ? "" : "pkt-invisible"}"
368
- .data-disabled=${i ? n : "disabled"}
369
- ?aria-disabled=${!i}
370
- tabindex=${i ? "0" : "-1"}
367
+ class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--icon-only ${s} ${r ? "" : "pkt-invisible"}"
368
+ .data-disabled=${r ? t : "disabled"}
369
+ ?aria-disabled=${!r}
370
+ tabindex=${r ? "0" : "-1"}
371
371
  >
372
372
  <pkt-icon class="pkt-btn__icon" name="${o}"></pkt-icon>
373
373
  <span class="pkt-btn__text">${a}</span>
@@ -376,16 +376,16 @@ var W = class extends o {
376
376
  }
377
377
  renderDayNames() {
378
378
  let e = [];
379
- this.weeknumbers && e.push(t`<th><div class="pkt-calendar__week-number">${this.weekString}</div></th>`);
380
- for (let n = 0; n < this.dayStrings.length; n++) e.push(t`<th>
381
- <div class="pkt-calendar__day-name" aria-label="${this.dayStringsLong[n]}">
382
- ${this.dayStrings[n]}
379
+ this.weeknumbers && e.push(i`<th><div class="pkt-calendar__week-number">${this.weekString}</div></th>`);
380
+ for (let t = 0; t < this.dayStrings.length; t++) e.push(i`<th>
381
+ <div class="pkt-calendar__day-name" aria-label="${this.dayStringsLong[t]}">
382
+ ${this.dayStrings[t]}
383
383
  </div>
384
384
  </th>`);
385
- return t`<tr class="pkt-cal-week-row">${e}</tr>`;
385
+ return i`<tr class="pkt-cal-week-row">${e}</tr>`;
386
386
  }
387
387
  renderMonthNav() {
388
- return this.withcontrols ? t`<div class="pkt-cal-month-picker">
388
+ return this.withcontrols ? i`<div class="pkt-cal-month-picker">
389
389
  <label for="${this.id}-monthnav" class="pkt-hide">${this.strings.dates.month}</label>
390
390
  <select
391
391
  aria-label="${this.strings.dates.month}"
@@ -397,7 +397,7 @@ var W = class extends o {
397
397
  this.changeMonth(this.year, parseInt(t.value));
398
398
  }}
399
399
  >
400
- ${this.monthStrings.map((e, n) => t`<option value=${n} ?selected=${this.month === n}>${e}</option>`)}
400
+ ${this.monthStrings.map((e, t) => i`<option value=${t} ?selected=${this.month === t}>${e}</option>`)}
401
401
  </select>
402
402
  <label for="${this.id}-yearnav" class="pkt-hide">${this.strings.dates.year}</label>
403
403
  <input
@@ -414,7 +414,7 @@ var W = class extends o {
414
414
  }}
415
415
  .value=${this.year}
416
416
  />
417
- </div>` : t`<div class="pkt-txt-16-medium pkt-calendar__month-title" aria-live="polite">
417
+ </div>` : i`<div class="pkt-txt-16-medium pkt-calendar__month-title" aria-live="polite">
418
418
  ${this.monthStrings[this.month]} ${this.year}
419
419
  </div>`;
420
420
  }
@@ -476,15 +476,15 @@ var W = class extends o {
476
476
  handleDayFocus(e, t) {
477
477
  this.range && !this.isExcluded(e) && this.handleRangeHover(e), this.focusedDate = t;
478
478
  }
479
- renderDayView(e, r) {
480
- let i = this.getDayViewData(e, r), { currentDate: a, currentDateISO: o, isSelected: c, isDisabled: l, ariaLabel: u, tabindex: d } = i;
479
+ renderDayView(e, n) {
480
+ let r = this.getDayViewData(e, n), { currentDate: a, currentDateISO: o, isSelected: c, isDisabled: l, ariaLabel: u, tabindex: d } = r;
481
481
  this.selectableDates.push({
482
482
  currentDateISO: o,
483
483
  isDisabled: l,
484
484
  tabindex: d
485
485
  });
486
- let f = this.getDayCellClasses(i), p = this.getDayButtonClasses(i);
487
- return t`<td class=${s(f)}>
486
+ let f = this.getDayCellClasses(r), p = this.getDayButtonClasses(r);
487
+ return i`<td class=${s(f)}>
488
488
  <button
489
489
  type="button"
490
490
  aria-pressed=${c ? "true" : "false"}
@@ -494,7 +494,7 @@ var W = class extends o {
494
494
  @focus=${() => this.handleDayFocus(a, o)}
495
495
  aria-label="${u}"
496
496
  tabindex=${d}
497
- data-disabled=${l ? "disabled" : n}
497
+ data-disabled=${l ? "disabled" : t}
498
498
  data-date=${o}
499
499
  @keydown=${(e) => {
500
500
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.handleDateSelect(a));
@@ -508,7 +508,7 @@ var W = class extends o {
508
508
  </td>`;
509
509
  }
510
510
  renderEmptyDayCell(e) {
511
- return t`<td class="pkt-cal-other">
511
+ return i`<td class="pkt-cal-other">
512
512
  <div
513
513
  class="pkt-btn pkt-btn--tertiary pkt-btn--small pkt-btn--label-only"
514
514
  data-disabled="disabled"
@@ -518,28 +518,28 @@ var W = class extends o {
518
518
  </td>`;
519
519
  }
520
520
  renderWeekRow(e) {
521
- return t`<tr class="pkt-cal-week-row" role="row">${e}</tr>`;
521
+ return i`<tr class="pkt-cal-week-row" role="row">${e}</tr>`;
522
522
  }
523
523
  renderCalendarBody() {
524
- let e = this.todayDate, n = A(this.year, this.month);
524
+ let e = this.todayDate, t = A(this.year, this.month);
525
525
  this.selectableDates = [], this.tabIndexSet = 0;
526
- let r = 1;
527
- this.week = n.initialWeek;
528
- let i = [];
529
- for (let a = 0; a < n.numRows; a++) {
526
+ let n = 1;
527
+ this.week = t.initialWeek;
528
+ let r = [];
529
+ for (let a = 0; a < t.numRows; a++) {
530
530
  let o = [];
531
- this.weeknumbers && o.push(t`<td class="pkt-cal-week">${this.week}</td>`), this.week++;
532
- for (let t = 0; t < 7; t++) {
533
- let i = j(a, t, r, n);
534
- if (i === "current-month") o.push(this.renderDayView(r, e)), r++;
531
+ this.weeknumbers && o.push(i`<td class="pkt-cal-week">${this.week}</td>`), this.week++;
532
+ for (let r = 0; r < 7; r++) {
533
+ let i = j(a, r, n, t);
534
+ if (i === "current-month") o.push(this.renderDayView(n, e)), n++;
535
535
  else {
536
- let e = M(i, t, r, n);
537
- o.push(this.renderEmptyDayCell(e)), i === "next-month" && r++;
536
+ let e = M(i, r, n, t);
537
+ o.push(this.renderEmptyDayCell(e)), i === "next-month" && n++;
538
538
  }
539
539
  }
540
- i.push(this.renderWeekRow(o));
540
+ r.push(this.renderWeekRow(o));
541
541
  }
542
- return i;
542
+ return r;
543
543
  }
544
544
  isExcluded(e) {
545
545
  return E(e, this.getDateConstraints());
@@ -622,30 +622,30 @@ var W = class extends o {
622
622
  }));
623
623
  }
624
624
  };
625
- i([a({ converter: v.csvToArray })], W.prototype, "selected", void 0), i([a({ type: Boolean })], W.prototype, "multiple", void 0), i([a({
625
+ n([r({ converter: v.csvToArray })], W.prototype, "selected", void 0), n([r({ type: Boolean })], W.prototype, "multiple", void 0), n([r({
626
626
  type: Number,
627
627
  attribute: "max-multiple"
628
- })], W.prototype, "maxMultiple", void 0), i([a({ type: Boolean })], W.prototype, "range", void 0), i([a({ type: String })], W.prototype, "earliest", void 0), i([a({ type: String })], W.prototype, "latest", void 0), i([a({ converter: v.stringsToDate })], W.prototype, "excludedates", void 0), i([a({ converter: v.csvToArray })], W.prototype, "excludeweekdays", void 0), i([a({ type: Boolean })], W.prototype, "weeknumbers", void 0), i([a({ type: Boolean })], W.prototype, "withcontrols", void 0), i([a({ converter: v.stringToDate })], W.prototype, "currentmonth", void 0), i([a({ type: String })], W.prototype, "today", void 0), i([a({
628
+ })], W.prototype, "maxMultiple", void 0), n([r({ type: Boolean })], W.prototype, "range", void 0), n([r({ type: String })], W.prototype, "earliest", void 0), n([r({ type: String })], W.prototype, "latest", void 0), n([r({ converter: v.stringsToDate })], W.prototype, "excludedates", void 0), n([r({ converter: v.csvToArray })], W.prototype, "excludeweekdays", void 0), n([r({ type: Boolean })], W.prototype, "weeknumbers", void 0), n([r({ type: Boolean })], W.prototype, "withcontrols", void 0), n([r({ converter: v.stringToDate })], W.prototype, "currentmonth", void 0), n([r({ type: String })], W.prototype, "today", void 0), n([r({
629
629
  type: Array,
630
630
  attribute: "day-strings"
631
- })], W.prototype, "dayStrings", void 0), i([a({
631
+ })], W.prototype, "dayStrings", void 0), n([r({
632
632
  type: Array,
633
633
  attribute: "day-strings-long"
634
- })], W.prototype, "dayStringsLong", void 0), i([a({
634
+ })], W.prototype, "dayStringsLong", void 0), n([r({
635
635
  type: Array,
636
636
  attribute: "month-strings"
637
- })], W.prototype, "monthStrings", void 0), i([a({
637
+ })], W.prototype, "monthStrings", void 0), n([r({
638
638
  type: String,
639
639
  attribute: "week-string"
640
- })], W.prototype, "weekString", void 0), i([a({
640
+ })], W.prototype, "weekString", void 0), n([r({
641
641
  type: String,
642
642
  attribute: "prev-month-string"
643
- })], W.prototype, "prevMonthString", void 0), i([a({
643
+ })], W.prototype, "prevMonthString", void 0), n([r({
644
644
  type: String,
645
645
  attribute: "next-month-string"
646
- })], W.prototype, "nextMonthString", void 0), i([a({ type: Array })], W.prototype, "_selected", void 0), i([r()], W.prototype, "inRange", void 0), i([a({ type: Date })], W.prototype, "rangeHovered", void 0), i([a({ type: Number })], W.prototype, "year", void 0), i([a({ type: Number })], W.prototype, "month", void 0), i([a({ type: Number })], W.prototype, "week", void 0), i([r()], W.prototype, "currentmonthtouched", void 0), i([r()], W.prototype, "focusedDate", void 0);
646
+ })], W.prototype, "nextMonthString", void 0), n([r({ type: Array })], W.prototype, "_selected", void 0), n([e()], W.prototype, "inRange", void 0), n([r({ type: Date })], W.prototype, "rangeHovered", void 0), n([r({ type: Number })], W.prototype, "year", void 0), n([r({ type: Number })], W.prototype, "month", void 0), n([r({ type: Number })], W.prototype, "week", void 0), n([e()], W.prototype, "currentmonthtouched", void 0), n([e()], W.prototype, "focusedDate", void 0);
647
647
  try {
648
- e("pkt-calendar")(W);
648
+ a("pkt-calendar")(W);
649
649
  } catch {
650
650
  console.warn("Forsøker å definere <pkt-calendar>, men den er allerede definert");
651
651
  }
@@ -1,10 +1,10 @@
1
- import { c as e, d as t, l 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-Co72KtgF.js";
5
- import { t as c } from "./if-defined-Cjj8qN-Z.js";
6
- import "./tag-hl59gziI.js";
7
- import "./heading-BxvE80bb.js";
1
+ import { d 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
+ import "./tag-CzlnHhho.js";
7
+ import "./heading-3o4Dk0Wn.js";
8
8
  var l = {
9
9
  name: "pkt-card",
10
10
  react: "PktCard",
@@ -186,24 +186,24 @@ var l = {
186
186
  super.connectedCallback();
187
187
  }
188
188
  render() {
189
- let e = {
189
+ let t = {
190
190
  "pkt-card": !0,
191
191
  [`pkt-card--${this.skin}`]: this.skin,
192
192
  [`pkt-card--${this.layout}`]: this.layout,
193
193
  [`pkt-card--padding-${this.padding}`]: this.padding,
194
194
  "pkt-card--border-on-hover": this.borderOnHover
195
- }, r = this.ariaLabel?.trim() || (this.heading ? `${this.heading} lenkekort` : "lenkekort"), i = this.ariaLabel?.trim() || (this.heading ? this.heading : "kort");
196
- return t`
195
+ }, n = this.ariaLabel?.trim() || (this.heading ? `${this.heading} lenkekort` : "lenkekort"), i = this.ariaLabel?.trim() || (this.heading ? this.heading : "kort");
196
+ return r`
197
197
  <article
198
- class=${a(e)}
199
- aria-label=${c(this.clickCardLink ? r : i)}
198
+ class=${a(t)}
199
+ aria-label=${c(this.clickCardLink ? n : i)}
200
200
  >
201
201
  ${this.renderImage()}
202
202
  <div class="pkt-card__wrapper">
203
- ${this.tagPosition === "top" ? this.renderTags() : n}
203
+ ${this.tagPosition === "top" ? this.renderTags() : e}
204
204
  ${this.renderHeader()}
205
205
  ${this.renderSlot()}
206
- ${this.tagPosition === "bottom" ? this.renderTags() : n}
206
+ ${this.tagPosition === "bottom" ? this.renderTags() : e}
207
207
  ${this.renderMetadata()}
208
208
  </div>
209
209
  </article>
@@ -214,8 +214,8 @@ var l = {
214
214
  "pkt-card__image": !0,
215
215
  [`pkt-card__image-${this.imageShape}`]: this.imageShape
216
216
  };
217
- return t`
218
- ${this.image.src && t`
217
+ return r`
218
+ ${this.image.src && r`
219
219
  <div class=${a(e)}>
220
220
  <img src=${this.image.src} alt=${this.image.alt || ""} />
221
221
  </div>
@@ -223,8 +223,8 @@ var l = {
223
223
  `;
224
224
  }
225
225
  renderHeading() {
226
- return t`
227
- ${this.heading && !this.clickCardLink ? t`
226
+ return r`
227
+ ${this.heading && !this.clickCardLink ? r`
228
228
  <pkt-heading
229
229
  class="pkt-card__heading"
230
230
  .level=${this.headinglevel || 3}
@@ -234,12 +234,12 @@ var l = {
234
234
  >
235
235
  ${this.heading}
236
236
  </pkt-heading>
237
- ` : n}
237
+ ` : e}
238
238
  `;
239
239
  }
240
240
  renderLinkHeading() {
241
- return t`
242
- ${this.clickCardLink ? t`
241
+ return r`
242
+ ${this.clickCardLink ? r`
243
243
  <pkt-heading
244
244
  class="pkt-card__link-heading pkt-card__heading"
245
245
  .level=${this.headinglevel || 3}
@@ -254,38 +254,38 @@ var l = {
254
254
  >${this.heading}</a
255
255
  >
256
256
  </pkt-heading>
257
- ` : n}
257
+ ` : e}
258
258
  `;
259
259
  }
260
260
  renderSubheading() {
261
- return t`
262
- ${this.subheading ? t` <p class="pkt-card__subheading ">${this.subheading}</p> ` : n}
261
+ return r`
262
+ ${this.subheading ? r` <p class="pkt-card__subheading ">${this.subheading}</p> ` : e}
263
263
  `;
264
264
  }
265
265
  renderHeader() {
266
- return t`
267
- ${this.heading || this.subheading ? t`
266
+ return r`
267
+ ${this.heading || this.subheading ? r`
268
268
  <header class="pkt-card__header">
269
269
  ${this.renderHeading()}
270
270
  ${this.renderLinkHeading()}
271
271
  ${this.renderSubheading()}
272
272
  </header>
273
- ` : n}
273
+ ` : e}
274
274
  `;
275
275
  }
276
276
  renderTags() {
277
- let e = {
277
+ let t = {
278
278
  "pkt-card__tags": !0,
279
279
  [`pkt-card__tags-${this.tagPosition}`]: this.tagPosition
280
280
  };
281
- return t`
282
- ${this.tags.length > 0 ? t`
281
+ return r`
282
+ ${this.tags.length > 0 ? r`
283
283
  <div
284
- class=${a(e)}
284
+ class=${a(t)}
285
285
  role="list"
286
286
  aria-label=${this.tags.length > 1 ? "merkelapper" : "merkelapp"}
287
287
  >
288
- ${this.tags.map((e) => t`
288
+ ${this.tags.map((e) => r`
289
289
  <pkt-tag
290
290
  role="listitem"
291
291
  textStyle="normal-text"
@@ -297,27 +297,27 @@ var l = {
297
297
  </pkt-tag>
298
298
  `)}
299
299
  </div>
300
- ` : n}
300
+ ` : e}
301
301
  `;
302
302
  }
303
303
  renderSlot() {
304
- return t`<section class="pkt-card__content">${o(this)}</section>`;
304
+ return r`<section class="pkt-card__content">${o(this)}</section>`;
305
305
  }
306
306
  renderMetadata() {
307
- return t`
308
- ${this.metaLead || this.metaTrail ? t`
307
+ return r`
308
+ ${this.metaLead || this.metaTrail ? r`
309
309
  <footer class="pkt-card__metadata">
310
- ${this.metaLead ? t`<span class="pkt-card__metadata-lead">${this.metaLead}</span>` : n}
311
- ${this.metaTrail ? t`<span class="pkt-card__metadata-trail">${this.metaTrail}</span>` : n}
310
+ ${this.metaLead ? r`<span class="pkt-card__metadata-lead">${this.metaLead}</span>` : e}
311
+ ${this.metaTrail ? r`<span class="pkt-card__metadata-trail">${this.metaTrail}</span>` : e}
312
312
  </footer>
313
- ` : n}
313
+ ` : e}
314
314
  `;
315
315
  }
316
316
  };
317
- r([i({ type: String })], u.prototype, "ariaLabel", void 0), r([i({ type: String })], u.prototype, "metaLead", void 0), r([i({ type: Boolean })], u.prototype, "borderOnHover", void 0), r([i({
317
+ t([n({ type: String })], u.prototype, "ariaLabel", void 0), t([n({ type: String })], u.prototype, "metaLead", void 0), t([n({ type: Boolean })], u.prototype, "borderOnHover", void 0), t([n({
318
318
  type: String,
319
319
  reflect: !0
320
- })], u.prototype, "clickCardLink", void 0), r([i({ type: String })], u.prototype, "metaTrail", void 0), r([i({ type: String })], u.prototype, "layout", void 0), r([i({ type: String })], u.prototype, "heading", void 0), r([i({ type: Number })], u.prototype, "headinglevel", void 0), r([i({ type: Object })], u.prototype, "image", void 0), r([i({ type: String })], u.prototype, "imageShape", void 0), r([i({ type: Boolean })], u.prototype, "openLinkInNewTab", void 0), r([i({ type: String })], u.prototype, "padding", void 0), r([i({
320
+ })], u.prototype, "clickCardLink", void 0), t([n({ type: String })], u.prototype, "metaTrail", void 0), t([n({ type: String })], u.prototype, "layout", void 0), t([n({ type: String })], u.prototype, "heading", void 0), t([n({ type: Number })], u.prototype, "headinglevel", void 0), t([n({ type: Object })], u.prototype, "image", void 0), t([n({ type: String })], u.prototype, "imageShape", void 0), t([n({ type: Boolean })], u.prototype, "openLinkInNewTab", void 0), t([n({ type: String })], u.prototype, "padding", void 0), t([n({
321
321
  type: String,
322
322
  converter: {
323
323
  fromAttribute: (e) => {
@@ -326,9 +326,9 @@ r([i({ type: String })], u.prototype, "ariaLabel", void 0), r([i({ type: String
326
326
  },
327
327
  toAttribute: (e) => e
328
328
  }
329
- })], u.prototype, "skin", void 0), r([i({ type: String })], u.prototype, "subheading", void 0), r([i({ type: String })], u.prototype, "tagPosition", void 0), r([i({ type: Array })], u.prototype, "tags", void 0);
329
+ })], u.prototype, "skin", void 0), t([n({ type: String })], u.prototype, "subheading", void 0), t([n({ type: String })], u.prototype, "tagPosition", void 0), t([n({ type: Array })], u.prototype, "tags", void 0);
330
330
  try {
331
- e("pkt-card")(u);
331
+ i("pkt-card")(u);
332
332
  } catch {
333
333
  console.warn("Forsøker å definere <pkt-card>, men den er allerede definert");
334
334
  }