@oslokommune/punkt-elements 17.1.3 → 18.0.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 (249) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/{accordion-BeLvLPrB.js → accordion-1_pdxTgJ.js} +27 -27
  3. package/dist/{accordion-B3GBlvUC.cjs → accordion-DobbH-Sv.cjs} +5 -5
  4. package/dist/{alert-Cs4Rmq_J.cjs → alert-COeHz6o2.cjs} +6 -6
  5. package/dist/{alert-DKK_Tb9J.js → alert-xspFetQ8.js} +26 -26
  6. package/dist/{async-directive-Da7TJpnq.cjs → async-directive-B5pcIMfO.cjs} +1 -1
  7. package/dist/{async-directive-BPf6K-V2.js → async-directive-D2Sht790.js} +5 -5
  8. package/dist/{backlink-D1y26pj3.js → backlink-C0jZFnZ2.js} +8 -8
  9. package/dist/{backlink-CMmrKTe4.cjs → backlink-ZMhqHaVs.cjs} +3 -3
  10. package/dist/base-elements/element.d.ts +13 -1
  11. package/dist/base-elements/input-element.d.ts +4 -2
  12. package/dist/{breadcrumbs-B6JGhJgC.cjs → breadcrumbs-BS64xd1s.cjs} +7 -7
  13. package/dist/{breadcrumbs-CcTQ3Grm.js → breadcrumbs-BvMownZN.js} +16 -16
  14. package/dist/{button-2-OSPJkj.js → button-C44vNLFC.js} +28 -28
  15. package/dist/{button-CE97NQIk.cjs → button-CR4CXtnj.cjs} +7 -7
  16. package/dist/{calendar-kn4SrtJy.cjs → calendar-DQ4byeom.cjs} +28 -27
  17. package/dist/{calendar-pOW3R5Pw.js → calendar-DgjCKMMV.js} +82 -68
  18. package/dist/{card-zQ0eKRMV.js → card-DhHqC265.js} +44 -44
  19. package/dist/{card-CETDFkxR.cjs → card-Dpqi6HVt.cjs} +26 -26
  20. package/dist/{checkbox-CH7NpINF.js → checkbox-BQ1K57AB.js} +23 -23
  21. package/dist/{checkbox-CQNr_sEg.cjs → checkbox-CXQxbiaX.cjs} +11 -11
  22. package/dist/{class-map-BeimMvPv.cjs → class-map-CzCE5pqG.cjs} +1 -1
  23. package/dist/{class-map-CnWCnBSX.js → class-map-F1DJHyb7.js} +3 -3
  24. package/dist/{combobox-Bvg0UO9w.cjs → combobox-BV4oDiII.cjs} +19 -18
  25. package/dist/{combobox-CRdYYlxu.js → combobox-DPck39I2.js} +55 -54
  26. package/dist/components/calendar/calendar.d.ts +21 -6
  27. package/dist/components/checkbox/checkbox.d.ts +4 -2
  28. package/dist/components/combobox/combobox-base.d.ts +2 -1
  29. package/dist/components/consent/strings.d.ts +1 -85
  30. package/dist/components/datepicker/datepicker-base.d.ts +0 -3
  31. package/dist/components/datepicker/datepicker-multiple.d.ts +0 -2
  32. package/dist/components/datepicker/datepicker-range.d.ts +0 -2
  33. package/dist/components/datepicker/datepicker-single.d.ts +0 -2
  34. package/dist/components/datepicker/datepicker-utils.d.ts +2 -1
  35. package/dist/components/fileupload/fileupload-base.d.ts +3 -2
  36. package/dist/components/header/header-service.d.ts +3 -1
  37. package/dist/components/header/header.d.ts +2 -1
  38. package/dist/components/helptext/helptext.d.ts +2 -1
  39. package/dist/components/index.d.ts +2 -0
  40. package/dist/components/input-wrapper/input-wrapper.d.ts +4 -2
  41. package/dist/components/radiobutton/radiobutton.d.ts +4 -2
  42. package/dist/components/searchinput/searchinput.d.ts +2 -1
  43. package/dist/{consent-DZEkhgJ1.js → consent-BneInZov.js} +10 -10
  44. package/dist/{consent-CyY3RyoC.cjs → consent-_N9foluG.cjs} +5 -5
  45. package/dist/controllers/strings-controller.d.ts +27 -0
  46. package/dist/{datepicker-VTqSDQk5.cjs → datepicker-9NX5qt2z.cjs} +38 -37
  47. package/dist/{datepicker-ButIas85.js → datepicker-nSSSr1U7.js} +104 -104
  48. package/dist/{directive-helpers-CI8YZqku.js → directive-helpers-BARw3nEZ.js} +1 -1
  49. package/dist/{directive-helpers-BlAV5EQD.cjs → directive-helpers-D6AAMFKs.cjs} +1 -1
  50. package/dist/docs/components/fileupload.d.ts +1 -0
  51. package/dist/element-B8OGznK0.cjs +2 -0
  52. package/dist/{element-ChsFgr_B.js → element-BKSPVgs2.js} +240 -100
  53. package/dist/{element-with-slot-Bj7nm7fO.cjs → element-with-slot-DTxILHVv.cjs} +1 -1
  54. package/dist/{element-with-slot-BvG9ctC-.js → element-with-slot-YUAUFRqw.js} +4 -4
  55. package/dist/fileupload-D05VSbEP.cjs +402 -0
  56. package/dist/{fileupload-D5IQ9HDe.js → fileupload-E0LGGNgj.js} +370 -380
  57. package/dist/{footer-DbYQUYNR.cjs → footer-DBApIdGh.cjs} +32 -32
  58. package/dist/{footer-DrR64HiK.js → footer-DYilVBMC.js} +91 -91
  59. package/dist/format-B8meU8Tm.cjs +1 -0
  60. package/dist/format-BTeSVkED.js +18 -0
  61. package/dist/{header-ClgIac6n.cjs → header-B7tbX-Ok.cjs} +84 -84
  62. package/dist/{header-menu-BAsUNKSx.cjs → header-menu-1FFWhvNc.cjs} +24 -24
  63. package/dist/{header-menu-hVPXsb8g.js → header-menu-D522-VTV.js} +75 -75
  64. package/dist/{header-KvJ1mGwA.js → header-v3GWAzOK.js} +267 -264
  65. package/dist/{heading-CFmiSuCQ.cjs → heading-CvytvcL7.cjs} +1 -1
  66. package/dist/{heading-g-_IUB5T.js → heading-rx_oSCqe.js} +16 -16
  67. package/dist/helptext-DYFdcylX.cjs +27 -0
  68. package/dist/{helptext-DZng1D5i.js → helptext-LShGPm-b.js} +18 -19
  69. package/dist/{icon-9iwd2F2l.cjs → icon-BmMC09mi.cjs} +1 -1
  70. package/dist/{icon-D-LA22xD.js → icon-HYU1f54x.js} +17 -17
  71. package/dist/{if-defined-CGzIlZ9-.js → if-defined-BF8XcDi5.js} +1 -1
  72. package/dist/if-defined-CVYApOgK.cjs +1 -0
  73. package/dist/{input-element-DBMNBplu.js → input-element-D07DmR34.js} +121 -120
  74. package/dist/input-element-DumGj_oJ.cjs +1 -0
  75. package/dist/input-wrapper-Cci_wTvD.js +308 -0
  76. package/dist/input-wrapper-DDfapoRX.cjs +58 -0
  77. package/dist/{link-DK7gvmnj.cjs → link-11g2ZNin.cjs} +4 -4
  78. package/dist/{link-D-Eqm5KH.js → link-CQK0SH4H.js} +13 -13
  79. package/dist/{linkcard-zqbg7Oqm.js → linkcard-B4GlmjJ6.js} +16 -16
  80. package/dist/linkcard-DNYsVlV6.cjs +13 -0
  81. package/dist/{listbox-Dc4rGdPi.cjs → listbox-BlFRhyI7.cjs} +15 -15
  82. package/dist/{listbox-va_E8afs.js → listbox-wd_OofyF.js} +100 -99
  83. package/dist/{loader-D_RDICnw.js → loader-0C3qVk16.js} +14 -14
  84. package/dist/{loader-CMUkVJmE.cjs → loader-B9u2qUlR.cjs} +5 -5
  85. package/dist/{messagebox-Cv8LaSxv.cjs → messagebox-BD5tGmT-.cjs} +5 -5
  86. package/dist/{messagebox-Cw-OWDya.js → messagebox-C-y1ICmr.js} +15 -15
  87. package/dist/{modal-BtInv031.cjs → modal-BzPGQYCs.cjs} +8 -8
  88. package/dist/{modal-D0t_X2dX.js → modal-Cghs3w-d.js} +20 -20
  89. package/dist/pkt-accordion.cjs +1 -1
  90. package/dist/pkt-accordion.js +1 -1
  91. package/dist/pkt-alert.cjs +1 -1
  92. package/dist/pkt-alert.js +1 -1
  93. package/dist/pkt-backlink.cjs +1 -1
  94. package/dist/pkt-backlink.js +1 -1
  95. package/dist/pkt-breadcrumbs.cjs +1 -1
  96. package/dist/pkt-breadcrumbs.js +1 -1
  97. package/dist/pkt-button.cjs +1 -1
  98. package/dist/pkt-button.js +1 -1
  99. package/dist/pkt-calendar.cjs +1 -1
  100. package/dist/pkt-calendar.js +1 -1
  101. package/dist/pkt-card.cjs +1 -1
  102. package/dist/pkt-card.js +1 -1
  103. package/dist/pkt-checkbox.cjs +1 -1
  104. package/dist/pkt-checkbox.js +1 -1
  105. package/dist/pkt-combobox.cjs +1 -1
  106. package/dist/pkt-combobox.js +1 -1
  107. package/dist/pkt-consent.cjs +1 -1
  108. package/dist/pkt-consent.js +1 -1
  109. package/dist/pkt-datepicker.cjs +1 -1
  110. package/dist/pkt-datepicker.js +1 -1
  111. package/dist/pkt-fileupload.cjs +1 -1
  112. package/dist/pkt-fileupload.js +1 -1
  113. package/dist/pkt-footer.cjs +1 -1
  114. package/dist/pkt-footer.js +1 -1
  115. package/dist/pkt-header-menu.cjs +1 -1
  116. package/dist/pkt-header-menu.js +1 -1
  117. package/dist/pkt-header.cjs +1 -1
  118. package/dist/pkt-header.js +1 -1
  119. package/dist/pkt-heading.cjs +1 -1
  120. package/dist/pkt-heading.js +1 -1
  121. package/dist/pkt-helptext.cjs +1 -1
  122. package/dist/pkt-helptext.js +1 -1
  123. package/dist/pkt-icon.cjs +1 -1
  124. package/dist/pkt-icon.js +1 -1
  125. package/dist/pkt-index.cjs +1 -1
  126. package/dist/pkt-index.js +35 -34
  127. package/dist/pkt-input-wrapper.cjs +1 -1
  128. package/dist/pkt-input-wrapper.js +1 -1
  129. package/dist/pkt-link.cjs +1 -1
  130. package/dist/pkt-link.js +1 -1
  131. package/dist/pkt-linkcard.cjs +1 -1
  132. package/dist/pkt-linkcard.js +1 -1
  133. package/dist/pkt-listbox.cjs +1 -1
  134. package/dist/pkt-listbox.js +1 -1
  135. package/dist/pkt-loader.cjs +1 -1
  136. package/dist/pkt-loader.js +1 -1
  137. package/dist/pkt-messagebox.cjs +1 -1
  138. package/dist/pkt-messagebox.js +1 -1
  139. package/dist/pkt-modal.cjs +1 -1
  140. package/dist/pkt-modal.js +1 -1
  141. package/dist/{pkt-options-controller-C5EBX2T0.cjs → pkt-options-controller-CEEAqXaB.cjs} +1 -1
  142. package/dist/{pkt-options-controller-B77vH3PE.js → pkt-options-controller-PtjhmTGk.js} +1 -1
  143. package/dist/pkt-progressbar.cjs +1 -1
  144. package/dist/pkt-progressbar.js +1 -1
  145. package/dist/pkt-radiobutton.cjs +1 -1
  146. package/dist/pkt-radiobutton.js +1 -1
  147. package/dist/pkt-searchinput.cjs +1 -1
  148. package/dist/pkt-searchinput.js +1 -1
  149. package/dist/pkt-select.cjs +1 -1
  150. package/dist/pkt-select.js +1 -1
  151. package/dist/pkt-tabs.cjs +1 -1
  152. package/dist/pkt-tabs.js +1 -1
  153. package/dist/pkt-tag.cjs +1 -1
  154. package/dist/pkt-tag.js +1 -1
  155. package/dist/pkt-textarea.cjs +1 -1
  156. package/dist/pkt-textarea.js +1 -1
  157. package/dist/pkt-textinput.cjs +1 -1
  158. package/dist/pkt-textinput.js +1 -1
  159. package/dist/pkt-timepicker.cjs +1 -1
  160. package/dist/pkt-timepicker.js +1 -1
  161. package/dist/{progressbar-CbcfLerF.js → progressbar-BexQQw1o.js} +21 -21
  162. package/dist/{progressbar-D5MmnQId.cjs → progressbar-X9mSvpjw.cjs} +5 -5
  163. package/dist/{radiobutton-BUnf3EPi.js → radiobutton-CkhTasn4.js} +24 -24
  164. package/dist/{radiobutton-DpsO1F-8.cjs → radiobutton-ln29Ad3U.cjs} +8 -8
  165. package/dist/{ref-CQoEIIp0.cjs → ref-CHbJYtKE.cjs} +1 -1
  166. package/dist/{ref-CWD6PjVd.js → ref-Chc_DZAb.js} +2 -2
  167. package/dist/{repeat-sY6B7fAT.cjs → repeat-CHDs__rN.cjs} +1 -1
  168. package/dist/{repeat-C02g7d5S.js → repeat-P9SMlKd5.js} +4 -4
  169. package/dist/searchinput-CPgMEAZZ.cjs +60 -0
  170. package/dist/{searchinput-DwnjsvJ1.js → searchinput-Da7dKHBH.js} +43 -43
  171. package/dist/{select-BOJi6H6T.cjs → select-DCuvdAuK.cjs} +4 -3
  172. package/dist/{select-DMre80qs.js → select-jabMSjft.js} +21 -20
  173. package/dist/shared-strings/consent.d.ts +71 -0
  174. package/dist/shared-strings/format.d.ts +21 -0
  175. package/dist/shared-strings/index.d.ts +14 -0
  176. package/dist/shared-strings/nb.d.ts +118 -0
  177. package/dist/shared-strings/resolve.d.ts +12 -0
  178. package/dist/shared-strings/store.d.ts +27 -0
  179. package/dist/shared-strings/types.d.ts +29 -0
  180. package/dist/shared-types/fileupload.d.ts +0 -27
  181. package/dist/shared-types/index.d.ts +1 -2
  182. package/dist/shared-utils/combobox/index.d.ts +1 -0
  183. package/dist/shared-utils/combobox/input-utils.d.ts +2 -1
  184. package/dist/shared-utils/combobox/messages.d.ts +7 -0
  185. package/dist/shared-utils/combobox/option-utils.d.ts +2 -1
  186. package/dist/shared-utils/combobox/selection-manager.d.ts +3 -2
  187. package/dist/{tabs-Cf9ai0FD.cjs → tabs-DV5CQNDL.cjs} +7 -7
  188. package/dist/{tabs-TvxgbrCF.js → tabs-D_hoi1zu.js} +32 -32
  189. package/dist/tag-BxYulmZn.cjs +27 -0
  190. package/dist/{tag-Ds6n1LIs.js → tag-DK5SgKry.js} +33 -32
  191. package/dist/tests/strings-override.test.d.ts +0 -0
  192. package/dist/{textarea-vfzIcXhX.js → textarea-BR7Riace.js} +30 -29
  193. package/dist/{textarea-BydiLM9Z.cjs → textarea-ffBD_VHq.cjs} +3 -2
  194. package/dist/{textinput-CMP2jPP_.js → textinput-CRNrsRNV.js} +28 -27
  195. package/dist/{textinput-DGdicNSx.cjs → textinput-CtHFzAux.cjs} +13 -12
  196. package/dist/timepicker-AfgJipo6.cjs +196 -0
  197. package/dist/{timepicker-ClwgYywH.js → timepicker-ixs_E5RY.js} +67 -64
  198. package/package.json +3 -3
  199. package/src/components/backlink/backlink.ts +1 -1
  200. package/src/components/breadcrumbs/breadcrumbs.ts +1 -1
  201. package/src/components/calendar/calendar.ts +56 -26
  202. package/src/components/checkbox/checkbox.test.ts +0 -2
  203. package/src/components/checkbox/checkbox.ts +8 -4
  204. package/src/components/combobox/combobox-base.ts +2 -1
  205. package/src/components/combobox/combobox-value.ts +10 -9
  206. package/src/components/combobox/combobox.selection.test.ts +5 -1
  207. package/src/components/combobox/combobox.ts +4 -1
  208. package/src/components/consent/strings.ts +1 -125
  209. package/src/components/datepicker/date-tags.ts +4 -1
  210. package/src/components/datepicker/datepicker-base.ts +2 -6
  211. package/src/components/datepicker/datepicker-multiple.ts +0 -3
  212. package/src/components/datepicker/datepicker-range.ts +4 -7
  213. package/src/components/datepicker/datepicker-single.ts +0 -3
  214. package/src/components/datepicker/datepicker-utils.test.ts +5 -5
  215. package/src/components/datepicker/datepicker-utils.ts +6 -11
  216. package/src/components/datepicker/datepicker.ts +8 -1
  217. package/src/components/fileupload/fileupload-base.ts +25 -16
  218. package/src/components/fileupload/fileupload-renderers.ts +2 -1
  219. package/src/components/fileupload/fileupload.test.ts +16 -0
  220. package/src/components/fileupload/fileupload.ts +19 -15
  221. package/src/components/header/header-global.ts +3 -3
  222. package/src/components/header/header-service.ts +13 -8
  223. package/src/components/header/header.ts +2 -1
  224. package/src/components/helptext/helptext.test.ts +1 -1
  225. package/src/components/helptext/helptext.ts +3 -3
  226. package/src/components/index.ts +9 -0
  227. package/src/components/input-wrapper/input-wrapper.ts +18 -10
  228. package/src/components/listbox/listbox.ts +3 -3
  229. package/src/components/radiobutton/radiobutton.ts +8 -4
  230. package/src/components/searchinput/searchinput.ts +5 -3
  231. package/src/components/select/select.ts +1 -0
  232. package/src/components/tag/tag.ts +2 -1
  233. package/src/components/textarea/textarea.ts +1 -0
  234. package/src/components/textinput/textinput.ts +1 -0
  235. package/src/components/timepicker/timepicker.ts +23 -21
  236. package/dist/element-BA8v6S7z.cjs +0 -2
  237. package/dist/fileupload-BeWiTAoW.cjs +0 -401
  238. package/dist/helptext-CTtKJcML.cjs +0 -27
  239. package/dist/if-defined-B89_ZeCj.cjs +0 -1
  240. package/dist/input-element-DYmQw-fH.cjs +0 -1
  241. package/dist/input-wrapper-BmxNvznr.js +0 -128
  242. package/dist/input-wrapper-D-fPaTbY.js +0 -176
  243. package/dist/input-wrapper-D5PR0rJn.cjs +0 -1
  244. package/dist/input-wrapper-Q-B-aBeb.cjs +0 -54
  245. package/dist/linkcard-B29cmZqh.cjs +0 -13
  246. package/dist/searchinput-Bh975rjX.cjs +0 -60
  247. package/dist/tag-CzojNU7z.cjs +0 -27
  248. package/dist/timepicker-DYrnLHqN.cjs +0 -195
  249. package/dist/translations/no.json.d.ts +0 -94
@@ -1,11 +1,12 @@
1
- import { a as e, d as t, n, o as r, p as i, r as a, s as o } from "./element-ChsFgr_B.js";
2
- import { t as s } from "./class-map-CnWCnBSX.js";
3
- import { n as c } from "./element-with-slot-BvG9ctC-.js";
4
- import "./icon-D-LA22xD.js";
5
- import { t as l } from "./if-defined-CGzIlZ9-.js";
6
- import { n as u, t as d } from "./ref-CWD6PjVd.js";
7
- import { t as f } from "./input-element-DBMNBplu.js";
8
- import "./input-wrapper-BmxNvznr.js";
1
+ import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-BKSPVgs2.js";
2
+ import { t as o } from "./class-map-F1DJHyb7.js";
3
+ import { t as s } from "./format-BTeSVkED.js";
4
+ import { n as c } from "./element-with-slot-YUAUFRqw.js";
5
+ import "./icon-HYU1f54x.js";
6
+ import { t as l } from "./if-defined-BF8XcDi5.js";
7
+ import { n as u, t as d } from "./ref-Chc_DZAb.js";
8
+ import { t as f } from "./input-element-D07DmR34.js";
9
+ import "./input-wrapper-Cci_wTvD.js";
9
10
  //#region ../../shared-utils/timepicker/time-utils.ts
10
11
  var p = (e) => /^\d{2}:\d{2}$/.test(e) && parseInt(e.slice(0, 2), 10) <= 23 && parseInt(e.slice(3), 10) <= 59, m = (e) => {
11
12
  let [t, n] = e.split(":").map(Number);
@@ -153,25 +154,26 @@ var p = (e) => /^\d{2}:\d{2}$/.test(e) && parseInt(e.slice(0, 2), 10) <= 23 && p
153
154
  manageValidity(e) {
154
155
  let t = this.hoursInputRef.value;
155
156
  if (!t) return;
157
+ let n = this.pktStrings.get("validation");
156
158
  if (this.required && !this.value) {
157
- this.internals.setValidity({ valueMissing: !0 }, a.forms.messages.required, t), this._setAriaInvalid(!0);
159
+ this.internals.setValidity({ valueMissing: !0 }, n.valueMissing, t), this._setAriaInvalid(!0);
158
160
  return;
159
161
  }
160
162
  if (!this.value) {
161
163
  this.internals.setValidity({}), this._setAriaInvalid(!1);
162
164
  return;
163
165
  }
164
- let n = m(this.value), r = h(this.step);
165
- if (this.min && n < m(String(this.min))) {
166
- this.internals.setValidity({ rangeUnderflow: !0 }, a.forms.messages.rangeUnderflowMin.replace("{min}", String(this.min)), t), this._setAriaInvalid(!0);
166
+ let r = m(this.value), i = h(this.step);
167
+ if (this.min && r < m(String(this.min))) {
168
+ this.internals.setValidity({ rangeUnderflow: !0 }, s(n.rangeUnderflowMin, { min: String(this.min) }), t), this._setAriaInvalid(!0);
167
169
  return;
168
170
  }
169
- if (this.max && n > m(String(this.max))) {
170
- this.internals.setValidity({ rangeOverflow: !0 }, a.forms.messages.rangeOverflowMax.replace("{max}", String(this.max)), t), this._setAriaInvalid(!0);
171
+ if (this.max && r > m(String(this.max))) {
172
+ this.internals.setValidity({ rangeOverflow: !0 }, s(n.rangeOverflowMax, { max: String(this.max) }), t), this._setAriaInvalid(!0);
171
173
  return;
172
174
  }
173
- if (this.step && n % r !== 0) {
174
- let e = r === 60 ? a.forms.messages.timeStepMismatchHour : r === 30 ? a.forms.messages.timeStepMismatchHalfHour : a.forms.messages.timeStepMismatch.replace("{step}", `${r}, ${r * 2}, ${r * 3}`);
175
+ if (this.step && r % i !== 0) {
176
+ let e = i === 60 ? n.timeStepMismatchHour : i === 30 ? n.timeStepMismatchHalfHour : s(n.timeStepMismatch, { step: `${i}, ${i * 2}, ${i * 3}` });
175
177
  this.internals.setValidity({ stepMismatch: !0 }, e, t), this._setAriaInvalid(!0);
176
178
  return;
177
179
  }
@@ -262,40 +264,40 @@ var p = (e) => /^\d{2}:\d{2}$/.test(e) && parseInt(e.slice(0, 2), 10) <= 23 && p
262
264
  let t = v(this._hours, this._minutes, e, this._minuteStep);
263
265
  this._hours = t.hours, this._minutes = t.minutes, this._syncValueFromDisplay();
264
266
  }
265
- _renderOption(e, t) {
266
- let n = String(e).padStart(2, "0"), r = e === (t === "hour" ? this._hours === "" ? NaN : parseInt(this._hours, 10) : this._minutes === "" ? NaN : parseInt(this._minutes, 10));
267
- return i`
267
+ _renderOption(t, n) {
268
+ let r = String(t).padStart(2, "0"), i = t === (n === "hour" ? this._hours === "" ? NaN : parseInt(this._hours, 10) : this._minutes === "" ? NaN : parseInt(this._minutes, 10));
269
+ return e`
268
270
  <button
269
- class=${s({
271
+ class=${o({
270
272
  "pkt-btn": !0,
271
273
  "pkt-btn--tertiary": !0,
272
274
  "pkt-btn--small": !0,
273
275
  "pkt-btn--label-only": !0,
274
276
  "pkt-timepicker-popup__option": !0,
275
- "pkt-timepicker-popup__option--selected": r
277
+ "pkt-timepicker-popup__option--selected": i
276
278
  })}
277
279
  type="button"
278
280
  role="option"
279
- aria-selected=${r ? "true" : "false"}
280
- tabindex=${r ? "0" : "-1"}
281
- data-type=${t}
282
- data-value=${e}
283
- @click=${(n) => {
284
- n.stopImmediatePropagation(), this._handleOptionClick(e, t);
281
+ aria-selected=${i ? "true" : "false"}
282
+ tabindex=${i ? "0" : "-1"}
283
+ data-type=${n}
284
+ data-value=${t}
285
+ @click=${(e) => {
286
+ e.stopImmediatePropagation(), this._handleOptionClick(t, n);
285
287
  }}
286
288
  >
287
- <span class="pkt-btn__text pkt-txt-14-light">${n}</span>
289
+ <span class="pkt-btn__text pkt-txt-14-light">${r}</span>
288
290
  </button>
289
291
  `;
290
292
  }
291
293
  _renderPopup() {
292
- return i`
294
+ return e`
293
295
  <div
294
296
  class="pkt-timepicker-popup"
295
297
  id=${this.id + "-popup"}
296
298
  ?hidden=${!this._isOpen}
297
299
  role="group"
298
- aria-label=${this.strings.timepicker?.selectTime ?? "Velg tidspunkt"}
300
+ aria-label=${this.pktStrings.get("timepicker").selectTime}
299
301
  @keydown=${this._handlePopupKeydown}
300
302
  @focusout=${(e) => {
301
303
  this.querySelector(".pkt-timepicker-popup")?.contains(e.relatedTarget) || this._closePopup();
@@ -304,7 +306,7 @@ var p = (e) => /^\d{2}:\d{2}$/.test(e) && parseInt(e.slice(0, 2), 10) <= 23 && p
304
306
  <div
305
307
  class="pkt-timepicker-popup__col"
306
308
  role="listbox"
307
- aria-label=${this.strings.timepicker?.hours ?? "Timer"}
309
+ aria-label=${this.pktStrings.get("timepicker").hours}
308
310
  aria-orientation="vertical"
309
311
  >
310
312
  ${this._hourOptions.map((e) => this._renderOption(e, "hour"))}
@@ -312,7 +314,7 @@ var p = (e) => /^\d{2}:\d{2}$/.test(e) && parseInt(e.slice(0, 2), 10) <= 23 && p
312
314
  <div
313
315
  class="pkt-timepicker-popup__col"
314
316
  role="listbox"
315
- aria-label=${this.strings.timepicker?.minutes ?? "Minutter"}
317
+ aria-label=${this.pktStrings.get("timepicker").minutes}
316
318
  aria-orientation="vertical"
317
319
  >
318
320
  ${this._minuteOptions.map((e) => this._renderOption(e, "minute"))}
@@ -321,28 +323,28 @@ var p = (e) => /^\d{2}:\d{2}$/.test(e) && parseInt(e.slice(0, 2), 10) <= 23 && p
321
323
  `;
322
324
  }
323
325
  _renderContainer() {
324
- let e = this.strings.timepicker?.hours ?? "Timer", n = this.strings.timepicker?.minutes ?? "Minutter", r = this.label ? `${e}, ${this.label}` : e, a = this.label ? `${n}, ${this.label}` : n;
325
- return i`
326
+ let t = this.pktStrings.get("timepicker").hours, r = this.pktStrings.get("timepicker").minutes, i = this.label ? `${t}, ${this.label}` : t, a = this.label ? `${r}, ${this.label}` : r;
327
+ return e`
326
328
  <div
327
329
  class="pkt-input__container pkt-input__container--${this.inputSize}"
328
330
  @click=${(e) => {
329
331
  e.target.closest("button, input") || this.hoursInputRef.value?.focus();
330
332
  }}
331
333
  >
332
- ${this.stepArrows ? i`
334
+ ${this.stepArrows ? e`
333
335
  <button
334
336
  class="pkt-input-icon pkt-btn pkt-btn--icon-only pkt-btn--tertiary pkt-btn--${this.inputSize} pkt-timepicker__button pkt-timepicker__button--prev"
335
337
  type="button"
336
- aria-label=${this.strings.timepicker?.prevTime ?? "Forrige tidspunkt"}
338
+ aria-label=${this.pktStrings.get("timepicker").prevTime}
337
339
  ?disabled=${this.disabled}
338
340
  @click=${() => this._stepTime(-1)}
339
341
  >
340
342
  <pkt-icon name="chevron-thin-left"></pkt-icon>
341
343
  <span class="pkt-btn__text"
342
- >${this.strings.timepicker?.prevTime ?? "Forrige tidspunkt"}</span
344
+ >${this.pktStrings.get("timepicker").prevTime}</span
343
345
  >
344
346
  </button>
345
- ` : t}
347
+ ` : n}
346
348
  <input
347
349
  ${u(this.hoursInputRef)}
348
350
  type="text"
@@ -355,14 +357,14 @@ var p = (e) => /^\d{2}:\d{2}$/.test(e) && parseInt(e.slice(0, 2), 10) <= 23 && p
355
357
  data-max="23"
356
358
  .value=${this._hours}
357
359
  placeholder="––"
358
- aria-label=${r}
360
+ aria-label=${i}
359
361
  role="spinbutton"
360
- aria-invalid=${this.hasError ? "true" : t}
361
- aria-errormessage=${this.hasError ? `${this.id}-hours-error` : t}
362
+ aria-invalid=${this.hasError ? "true" : n}
363
+ aria-errormessage=${this.hasError ? `${this.id}-hours-error` : n}
362
364
  aria-valuemin="0"
363
365
  aria-valuemax="23"
364
- aria-valuenow=${this._hours === "" ? t : this._hours}
365
- aria-valuetext=${this._hours === "" ? t : `${this._hours} ${e.toLowerCase()}`}
366
+ aria-valuenow=${this._hours === "" ? n : this._hours}
367
+ aria-valuetext=${this._hours === "" ? n : `${this._hours} ${t.toLowerCase()}`}
366
368
  autocomplete="off"
367
369
  ?disabled=${this.disabled}
368
370
  @keydown=${this._handleHoursKeydown}
@@ -386,12 +388,12 @@ var p = (e) => /^\d{2}:\d{2}$/.test(e) && parseInt(e.slice(0, 2), 10) <= 23 && p
386
388
  placeholder="––"
387
389
  aria-label=${a}
388
390
  role="spinbutton"
389
- aria-invalid=${this.hasError ? "true" : t}
390
- aria-errormessage=${this.hasError ? `${this.id}-hours-error` : t}
391
+ aria-invalid=${this.hasError ? "true" : n}
392
+ aria-errormessage=${this.hasError ? `${this.id}-hours-error` : n}
391
393
  aria-valuemin="0"
392
394
  aria-valuemax="59"
393
- aria-valuenow=${this._minutes === "" ? t : this._minutes}
394
- aria-valuetext=${this._minutes === "" ? t : `${this._minutes} ${n.toLowerCase()}`}
395
+ aria-valuenow=${this._minutes === "" ? n : this._minutes}
396
+ aria-valuetext=${this._minutes === "" ? n : `${this._minutes} ${r.toLowerCase()}`}
395
397
  autocomplete="off"
396
398
  ?disabled=${this.disabled}
397
399
  @keydown=${this._handleMinutesKeydown}
@@ -400,17 +402,17 @@ var p = (e) => /^\d{2}:\d{2}$/.test(e) && parseInt(e.slice(0, 2), 10) <= 23 && p
400
402
  e.target.select(), e.stopImmediatePropagation();
401
403
  }}
402
404
  />
403
- ${this.hidePicker && !this.stepArrows ? i`<pkt-icon
405
+ ${this.hidePicker && !this.stepArrows ? e`<pkt-icon
404
406
  class="pkt-input-icon pkt-timepicker__icon"
405
407
  name="clock"
406
408
  aria-hidden="true"
407
- ></pkt-icon>` : t}
408
- ${!this.hidePicker && !this.stepArrows ? i`
409
+ ></pkt-icon>` : n}
410
+ ${!this.hidePicker && !this.stepArrows ? e`
409
411
  <button
410
412
  ${u(this.buttonRef)}
411
413
  class="pkt-input-icon pkt-btn pkt-btn--icon-only pkt-btn--tertiary pkt-btn--${this.inputSize} pkt-timepicker__button"
412
414
  type="button"
413
- aria-label=${this.strings.timepicker?.openPicker ?? "Åpne tidspunkt-velger"}
415
+ aria-label=${this.pktStrings.get("timepicker").openPicker}
414
416
  aria-haspopup="listbox"
415
417
  aria-expanded=${this._isOpen ? "true" : "false"}
416
418
  aria-controls=${this.id + "-popup"}
@@ -419,24 +421,24 @@ var p = (e) => /^\d{2}:\d{2}$/.test(e) && parseInt(e.slice(0, 2), 10) <= 23 && p
419
421
  >
420
422
  <pkt-icon name="clock"></pkt-icon>
421
423
  <span class="pkt-btn__text"
422
- >${this.strings.timepicker?.openPicker ?? "Åpne tidspunkt-velger"}</span
424
+ >${this.pktStrings.get("timepicker").openPicker}</span
423
425
  >
424
426
  </button>
425
- ` : t}
426
- ${this.stepArrows ? i`
427
+ ` : n}
428
+ ${this.stepArrows ? e`
427
429
  <button
428
430
  class="pkt-input-icon pkt-btn pkt-btn--icon-only pkt-btn--tertiary pkt-btn--${this.inputSize} pkt-timepicker__button pkt-timepicker__button--next"
429
431
  type="button"
430
- aria-label=${this.strings.timepicker?.nextTime ?? "Neste tidspunkt"}
432
+ aria-label=${this.pktStrings.get("timepicker").nextTime}
431
433
  ?disabled=${this.disabled}
432
434
  @click=${() => this._stepTime(1)}
433
435
  >
434
436
  <pkt-icon name="chevron-thin-right"></pkt-icon>
435
437
  <span class="pkt-btn__text"
436
- >${this.strings.timepicker?.nextTime ?? "Neste tidspunkt"}</span
438
+ >${this.pktStrings.get("timepicker").nextTime}</span
437
439
  >
438
440
  </button>
439
- ` : t}
441
+ ` : n}
440
442
  <input
441
443
  ${u(this.hiddenInputRef)}
442
444
  type="time"
@@ -455,8 +457,9 @@ var p = (e) => /^\d{2}:\d{2}$/.test(e) && parseInt(e.slice(0, 2), 10) <= 23 && p
455
457
  `;
456
458
  }
457
459
  render() {
458
- return i`
460
+ return e`
459
461
  <pkt-input-wrapper
462
+ .strings=${this.strings}
460
463
  label="${this.label}"
461
464
  ?disabled=${this.disabled}
462
465
  ?fullwidth=${this.fullwidth}
@@ -479,7 +482,7 @@ var p = (e) => /^\d{2}:\d{2}$/.test(e) && parseInt(e.slice(0, 2), 10) <= 23 && p
479
482
  .size=${this.inputSize}
480
483
  >
481
484
  <div class="pkt-contents" slot="helptext">${c(this, "helptext")}</div>
482
- ${!this.hidePicker && !this.stepArrows ? i`
485
+ ${!this.hidePicker && !this.stepArrows ? e`
483
486
  <div class="pkt-timepicker__anchor">
484
487
  ${this._renderContainer()} ${this._renderPopup()}
485
488
  </div>
@@ -488,20 +491,20 @@ var p = (e) => /^\d{2}:\d{2}$/.test(e) && parseInt(e.slice(0, 2), 10) <= 23 && p
488
491
  `;
489
492
  }
490
493
  };
491
- n([r({
494
+ i([a({
492
495
  type: String,
493
496
  reflect: !0
494
- })], y.prototype, "value", void 0), n([r({
497
+ })], y.prototype, "value", void 0), i([a({
495
498
  type: Boolean,
496
499
  reflect: !0,
497
500
  attribute: "hide-picker"
498
- })], y.prototype, "hidePicker", void 0), n([r({
501
+ })], y.prototype, "hidePicker", void 0), i([a({
499
502
  type: Boolean,
500
503
  reflect: !0,
501
504
  attribute: "step-arrows"
502
- })], y.prototype, "stepArrows", void 0), n([e()], y.prototype, "_hours", void 0), n([e()], y.prototype, "_minutes", void 0), n([e()], y.prototype, "_isOpen", void 0);
505
+ })], y.prototype, "stepArrows", void 0), i([r()], y.prototype, "_hours", void 0), i([r()], y.prototype, "_minutes", void 0), i([r()], y.prototype, "_isOpen", void 0);
503
506
  try {
504
- o("pkt-timepicker")(y);
507
+ t("pkt-timepicker")(y);
505
508
  } catch {
506
509
  console.warn("Forsøker å definere <pkt-timepicker>, men den er allerede definert");
507
510
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oslokommune/punkt-elements",
3
- "version": "17.1.3",
3
+ "version": "18.0.0",
4
4
  "description": "Komponentbiblioteket til Punkt, et designsystem laget av Oslo Origo",
5
5
  "homepage": "https://punkt.oslo.kommune.no",
6
6
  "author": "Team Designsystem, Oslo Origo",
@@ -41,7 +41,7 @@
41
41
  "@babel/plugin-transform-private-property-in-object": "^7.27.1",
42
42
  "@babel/preset-env": "^7.28.3",
43
43
  "@babel/preset-typescript": "^7.28.3",
44
- "@oslokommune/punkt-assets": "^17.1.2",
44
+ "@oslokommune/punkt-assets": "^18.0.0",
45
45
  "@testing-library/dom": "^10.4.1",
46
46
  "@testing-library/jest-dom": "^6.9.1",
47
47
  "@types/jest-axe": "^3.5.9",
@@ -83,5 +83,5 @@
83
83
  "engines": {
84
84
  "node": "^22.19.0 || ^24.0.0 || ^26.0.0"
85
85
  },
86
- "gitHead": "f378c0e71d923d9526bc9eea3a399e0d9e00b206"
86
+ "gitHead": "057d0045ccd1af4d0f6591f0e2b0e5ab6fda3843"
87
87
  }
@@ -36,7 +36,7 @@ export class PktBackLink extends PktElement<IPktBackLink> implements IPktBackLin
36
36
  render() {
37
37
  return html`<nav
38
38
  class="pkt-back-link"
39
- aria-label=${this.ariaLabel || 'Gå tilbake til forrige side'}
39
+ aria-label=${this.ariaLabel || this.pktStrings.get('backlink').label}
40
40
  >
41
41
  <a href=${ifDefined(this.href || '/')} class="pkt-link pkt-link--icon-left"
42
42
  ><pkt-icon
@@ -39,7 +39,7 @@ export class PktBreadcrumbs extends PktElement implements IPktBreadcrumbs {
39
39
  const backLink = this.breadcrumbs[this.breadcrumbs.length - 2]
40
40
 
41
41
  return html`
42
- <nav class="pkt-breadcrumbs" aria-label="brødsmulemeny">
42
+ <nav class="pkt-breadcrumbs" aria-label=${this.pktStrings.get('breadcrumbs').ariaLabel}>
43
43
  <ol class="pkt-breadcrumbs__list pkt-breadcrumbs--desktop">
44
44
  ${this.breadcrumbs.map((item, index) =>
45
45
  index === this.breadcrumbs.length - 1
@@ -95,12 +95,32 @@ export class PktCalendar extends PktElement {
95
95
  today: string | null = null
96
96
 
97
97
  // Localization strings
98
- @property({ type: Array, attribute: 'day-strings' }) dayStrings: string[] = this.strings.dates.daysShort
99
- @property({ type: Array, attribute: 'day-strings-long' }) dayStringsLong: string[] = this.strings.dates.days
100
- @property({ type: Array, attribute: 'month-strings' }) monthStrings: string[] = this.strings.dates.months
101
- @property({ type: String, attribute: 'week-string' }) weekString: string = this.strings.dates.week
102
- @property({ type: String, attribute: 'prev-month-string' }) prevMonthString: string = this.strings.dates.prevMonth
103
- @property({ type: String, attribute: 'next-month-string' }) nextMonthString: string = this.strings.dates.nextMonth
98
+ /** @deprecated Bruk `strings={{ dates: { daysShort: [...] } }}` eller `setPktStrings()`. */
99
+ @property({ type: Array, attribute: 'day-strings' }) dayStrings?: string[]
100
+ /** @deprecated Bruk `strings={{ dates: { days: [...] } }}` eller `setPktStrings()`. */
101
+ @property({ type: Array, attribute: 'day-strings-long' }) dayStringsLong?: string[]
102
+ /** @deprecated Bruk `strings={{ dates: { months: [...] } }}` eller `setPktStrings()`. */
103
+ @property({ type: Array, attribute: 'month-strings' }) monthStrings?: string[]
104
+ /** @deprecated Bruk `strings={{ dates: { week: '...' } }}` eller `setPktStrings()`. */
105
+ @property({ type: String, attribute: 'week-string' }) weekString?: string
106
+ /** @deprecated Bruk `strings={{ calendar: { prevMonth: '...' } }}` eller `setPktStrings()`. */
107
+ @property({ type: String, attribute: 'prev-month-string' }) prevMonthString?: string
108
+ /** @deprecated Bruk `strings={{ calendar: { nextMonth: '...' } }}` eller `setPktStrings()`. */
109
+ @property({ type: String, attribute: 'next-month-string' }) nextMonthString?: string
110
+
111
+ /** Datonavn og navigasjonstekster, med de utfasede enkeltpropene lagt oppå. */
112
+ protected get calendarStrings() {
113
+ const dates = this.pktStrings.get('dates')
114
+ const calendar = this.pktStrings.get('calendar')
115
+ return {
116
+ daysShort: this.dayStrings ?? dates.daysShort,
117
+ days: this.dayStringsLong ?? dates.days,
118
+ months: this.monthStrings ?? dates.months,
119
+ week: this.weekString ?? dates.week,
120
+ prevMonth: this.prevMonthString ?? calendar.prevMonth,
121
+ nextMonth: this.nextMonthString ?? calendar.nextMonth,
122
+ }
123
+ }
104
124
 
105
125
  // Internal state - selection tracking
106
126
  @property({ type: Array }) private _selected: Date[] = []
@@ -230,8 +250,7 @@ export class PktCalendar extends PktElement {
230
250
  }}
231
251
  >
232
252
  <nav class="pkt-cal-month-nav">
233
- ${this.renderMonthNavButton('prev')}
234
- ${this.renderMonthNav()}
253
+ ${this.renderMonthNavButton('prev')} ${this.renderMonthNav()}
235
254
  ${this.renderMonthNavButton('next')}
236
255
  </nav>
237
256
  <table
@@ -253,7 +272,8 @@ export class PktCalendar extends PktElement {
253
272
  private renderMonthNavButton(direction: 'prev' | 'next'): TemplateResult {
254
273
  const isPrev = direction === 'prev'
255
274
  const isAllowed = isPrev ? this.isPrevMonthAllowed() : this.isNextMonthAllowed()
256
- const label = isPrev ? this.prevMonthString : this.nextMonthString
275
+ const { prevMonth, nextMonth } = this.calendarStrings
276
+ const label = isPrev ? prevMonth : nextMonth
257
277
  const iconName = isPrev ? 'chevron-thin-left' : 'chevron-thin-right'
258
278
  const className = isPrev ? 'pkt-calendar__prev-month' : 'pkt-calendar__next-month'
259
279
  const onClick = isPrev ? () => this.prevMonth() : () => this.nextMonth()
@@ -284,28 +304,32 @@ export class PktCalendar extends PktElement {
284
304
  const days: TemplateResult[] = []
285
305
 
286
306
  if (this.weeknumbers) {
287
- days.push(html`<th><div class="pkt-calendar__week-number">${this.weekString}</div></th>`)
307
+ days.push(
308
+ html`<th><div class="pkt-calendar__week-number">${this.calendarStrings.week}</div></th>`,
309
+ )
288
310
  }
289
311
 
290
- for (let i = 0; i < this.dayStrings.length; i++) {
312
+ const { days: dayNames, daysShort } = this.calendarStrings
313
+ for (let i = 0; i < daysShort.length; i++) {
291
314
  days.push(
292
315
  html`<th>
293
- <div class="pkt-calendar__day-name" aria-label="${this.dayStringsLong[i]}">
294
- ${this.dayStrings[i]}
295
- </div>
316
+ <div class="pkt-calendar__day-name" aria-label="${dayNames[i]}">${daysShort[i]}</div>
296
317
  </th>`,
297
318
  )
298
319
  }
299
320
 
300
- return html`<tr class="pkt-cal-week-row">${days}</tr>`
321
+ return html`<tr class="pkt-cal-week-row">
322
+ ${days}
323
+ </tr>`
301
324
  }
302
325
 
303
326
  private renderMonthNav(): TemplateResult {
327
+ const dates = this.pktStrings.get('dates')
304
328
  if (this.withcontrols) {
305
329
  return html`<div class="pkt-cal-month-picker">
306
- <label for="${this.id}-monthnav" class="pkt-hide">${this.strings.dates.month}</label>
330
+ <label for="${this.id}-monthnav" class="pkt-hide">${dates.month}</label>
307
331
  <select
308
- aria-label="${this.strings.dates.month}"
332
+ aria-label="${dates.month}"
309
333
  class="pkt-input pkt-input-compact"
310
334
  id="${this.id}-monthnav"
311
335
  @change=${(e: Event) => {
@@ -314,14 +338,14 @@ export class PktCalendar extends PktElement {
314
338
  this.changeMonth(this.year, parseInt(target.value))
315
339
  }}
316
340
  >
317
- ${this.monthStrings.map(
341
+ ${this.calendarStrings.months.map(
318
342
  (month, index) =>
319
343
  html`<option value=${index} ?selected=${this.month === index}>${month}</option>`,
320
344
  )}
321
345
  </select>
322
- <label for="${this.id}-yearnav" class="pkt-hide">${this.strings.dates.year}</label>
346
+ <label for="${this.id}-yearnav" class="pkt-hide">${dates.year}</label>
323
347
  <input
324
- aria-label="${this.strings.dates.year}"
348
+ aria-label="${dates.year}"
325
349
  class="pkt-input pkt-cal-input-year pkt-input-compact"
326
350
  id="${this.id}-yearnav"
327
351
  type="number"
@@ -338,7 +362,7 @@ export class PktCalendar extends PktElement {
338
362
  }
339
363
 
340
364
  return html`<div class="pkt-txt-16-medium pkt-calendar__month-title" aria-live="polite">
341
- ${this.monthStrings[this.month]} ${this.year}
365
+ ${this.calendarStrings.months[this.month]} ${this.year}
342
366
  </div>`
343
367
  }
344
368
 
@@ -393,10 +417,12 @@ export class PktCalendar extends PktElement {
393
417
 
394
418
  private getDayCellClasses(data: TDayViewData) {
395
419
  const { currentDateISO, isToday, isSelected } = data
396
- const isRangeStart = this.range &&
420
+ const isRangeStart =
421
+ this.range &&
397
422
  (this.selected.length === 2 || this.rangeHovered !== null) &&
398
423
  currentDateISO === this.selected[0]
399
- const isRangeEnd = this.range && this.selected.length === 2 && currentDateISO === this.selected[1]
424
+ const isRangeEnd =
425
+ this.range && this.selected.length === 2 && currentDateISO === this.selected[1]
400
426
 
401
427
  return {
402
428
  'pkt-cal-today': isToday,
@@ -412,10 +438,12 @@ export class PktCalendar extends PktElement {
412
438
 
413
439
  private getDayButtonClasses(data: TDayViewData) {
414
440
  const { currentDateISO, isToday, isSelected, isDisabled } = data
415
- const isRangeStart = this.range &&
441
+ const isRangeStart =
442
+ this.range &&
416
443
  (this.selected.length === 2 || this.rangeHovered !== null) &&
417
444
  currentDateISO === this.selected[0]
418
- const isRangeEnd = this.range && this.selected.length === 2 && currentDateISO === this.selected[1]
445
+ const isRangeEnd =
446
+ this.range && this.selected.length === 2 && currentDateISO === this.selected[1]
419
447
 
420
448
  return {
421
449
  'pkt-calendar__date': true,
@@ -489,7 +517,9 @@ export class PktCalendar extends PktElement {
489
517
  }
490
518
 
491
519
  private renderWeekRow(cells: TemplateResult[]): TemplateResult {
492
- return html`<tr class="pkt-cal-week-row" role="row">${cells}</tr>`
520
+ return html`<tr class="pkt-cal-week-row" role="row">
521
+ ${cells}
522
+ </tr>`
493
523
  }
494
524
 
495
525
  private renderCalendarBody() {
@@ -406,7 +406,6 @@ describe('PktCheckbox', () => {
406
406
  await checkbox.updateComplete
407
407
 
408
408
  expect(checkbox.optionalTag).toBe(true)
409
- expect(checkbox.optionalText).toBe('Valgfritt')
410
409
 
411
410
  const optionalTag = checkbox.querySelector('.pkt-tag--blue-light')
412
411
  expect(optionalTag).toBeInTheDocument()
@@ -423,7 +422,6 @@ describe('PktCheckbox', () => {
423
422
  await checkbox.updateComplete
424
423
 
425
424
  expect(checkbox.requiredTag).toBe(true)
426
- expect(checkbox.requiredText).toBe('Må fylles ut')
427
425
 
428
426
  const requiredTag = checkbox.querySelector('.pkt-tag--beige')
429
427
  expect(requiredTag).toBeInTheDocument()
@@ -36,9 +36,11 @@ export class PktCheckbox extends PktInputElement<Props> {
36
36
  @property({ type: String, reflect: true }) type: string = 'checkbox'
37
37
  @property({ type: String }) tagText: string | null = null
38
38
  @property({ type: Boolean }) optionalTag: boolean = false
39
- @property({ type: String }) optionalText: string = 'Valgfritt'
39
+ /** @deprecated Bruk `strings={{ forms: { optional: '…' } }}` eller `setPktStrings()`. */
40
+ @property({ type: String }) optionalText?: string
40
41
  @property({ type: Boolean }) requiredTag: boolean = false
41
- @property({ type: String }) requiredText: string = 'Må fylles ut'
42
+ /** @deprecated Bruk `strings={{ forms: { required: '…' } }}` eller `setPktStrings()`. */
43
+ @property({ type: String }) requiredText?: string
42
44
 
43
45
  connectedCallback() {
44
46
  super.connectedCallback()
@@ -108,16 +110,18 @@ export class PktCheckbox extends PktInputElement<Props> {
108
110
 
109
111
  const tagClasses = 'pkt-tag pkt-tag--small pkt-tag--thin-text'
110
112
 
113
+ const formStrings = this.pktStrings.get('forms')
114
+
111
115
  const tags = () => {
112
116
  return html`
113
117
  ${this.tagText
114
118
  ? html`<span class=${tagClasses + ' pkt-tag--gray'}>${this.tagText}</span>`
115
119
  : nothing}
116
120
  ${this.optionalTag
117
- ? html`<span class=${tagClasses + ' pkt-tag--blue-light'}>${this.optionalText}</span>`
121
+ ? html`<span class=${tagClasses + ' pkt-tag--blue-light'}>${this.optionalText ?? formStrings.optional}</span>`
118
122
  : nothing}
119
123
  ${this.requiredTag
120
- ? html`<span class=${tagClasses + ' pkt-tag--beige'}>${this.requiredText}</span>`
124
+ ? html`<span class=${tagClasses + ' pkt-tag--beige'}>${this.requiredText ?? formStrings.required}</span>`
121
125
  : nothing}
122
126
  `
123
127
  }
@@ -7,6 +7,7 @@ import specs from 'componentSpecs/combobox.json'
7
7
 
8
8
  import type { IPktComboboxOption, TPktComboboxTagPlacement } from './combobox-types'
9
9
  import PktListbox from '../listbox'
10
+ import type { TComboboxMessageKey } from 'shared-utils/combobox'
10
11
 
11
12
  /**
12
13
  * Base class for PktCombobox.
@@ -42,7 +43,7 @@ export class ComboboxBase extends PktInputElement {
42
43
  @state() override _options: IPktComboboxOption[] = []
43
44
  @state() protected _value: string[] = []
44
45
  @state() protected _isOptionsOpen = false
45
- @state() protected _userInfoMessage: string = ''
46
+ @state() protected _userInfoMessage: TComboboxMessageKey = ''
46
47
  @state() protected _addValueText: string | null = null
47
48
  @state() protected _maxIsReached: boolean = false
48
49
  @state() protected _search: string = ''