@oslokommune/punkt-elements 16.25.2 → 16.26.2

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 (257) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/{accordion-BjYsEbSM.js → accordion-CBdIk9gw.js} +5 -5
  3. package/dist/{accordion-DaeWPWod.cjs → accordion-FISAiAbX.cjs} +2 -2
  4. package/dist/{alert-C8OpU_Un.cjs → alert-B8dLsiTz.cjs} +2 -2
  5. package/dist/{alert-B5Y841vH.js → alert-HHTGY0sp.js} +6 -6
  6. package/dist/{async-directive-Cz6tcqge.js → async-directive-Cw_7VW_-.js} +3 -3
  7. package/dist/{async-directive-DO1QtVmf.cjs → async-directive-HLXOyE4A.cjs} +1 -1
  8. package/dist/{backlink-C42-3OG3.cjs → backlink-DDGlLzk9.cjs} +2 -2
  9. package/dist/{backlink-BXAdgAte.js → backlink-wMNLuQ0X.js} +3 -3
  10. package/dist/{booleanish-jJLlnr6-.cjs → booleanish-B9Kf0nES.cjs} +1 -1
  11. package/dist/{breadcrumbs-Dkb9TxMp.js → breadcrumbs-CVTLNNsL.js} +2 -2
  12. package/dist/{breadcrumbs-CkjeLh3U.cjs → breadcrumbs-D3tfWqvC.cjs} +2 -2
  13. package/dist/{button-Bqk9wjme.cjs → button-B5tQpKeG.cjs} +2 -2
  14. package/dist/{button-CAZEaEW9.js → button-C_YzTSuU.js} +5 -5
  15. package/dist/{calendar-CRIp36hn.js → calendar-CjlUA-Lb.js} +4 -4
  16. package/dist/{calendar-64LmbIdR.cjs → calendar-DIzGBdbh.cjs} +2 -2
  17. package/dist/{card-C__IlsUa.cjs → card-BSZs5lRF.cjs} +2 -2
  18. package/dist/{card-5PydU247.js → card-D3jVkwxJ.js} +7 -7
  19. package/dist/{checkbox-CC1X7fw4.js → checkbox-DB_ZAuJJ.js} +12 -12
  20. package/dist/{checkbox-DzMc0AJX.cjs → checkbox-HKXLLpXq.cjs} +9 -9
  21. package/dist/{class-map-DH9hlJny.js → class-map-CAQCRB1W.js} +2 -2
  22. package/dist/{class-map-B8Ja0q7n.cjs → class-map-CCZN5uS3.cjs} +1 -1
  23. package/dist/{classutils-CVTzKF0J.cjs → classutils-CbklAJDe.cjs} +1 -1
  24. package/dist/{combobox-DJITmrnM.cjs → combobox-DsqvSokZ.cjs} +2 -2
  25. package/dist/{combobox-BuBvoK-N.js → combobox-vaCanZCq.js} +27 -17
  26. package/dist/components/accordion/accordion.d.ts +1 -1
  27. package/dist/components/accordion/accordionitem.d.ts +1 -1
  28. package/dist/components/alert/alert.d.ts +1 -1
  29. package/dist/components/backlink/backlink.d.ts +1 -1
  30. package/dist/components/breadcrumbs/breadcrumbs.d.ts +1 -1
  31. package/dist/components/button/button.d.ts +1 -1
  32. package/dist/components/card/card.d.ts +9 -9
  33. package/dist/components/checkbox/checkbox.d.ts +1 -1
  34. package/dist/components/combobox/combobox.d.ts +1 -1
  35. package/dist/components/consent/consent.d.ts +1 -1
  36. package/dist/components/datepicker/date-tags.d.ts +1 -1
  37. package/dist/components/datepicker/datepicker-multiple.d.ts +1 -1
  38. package/dist/components/datepicker/datepicker-popup.d.ts +1 -1
  39. package/dist/components/datepicker/datepicker-range.d.ts +1 -1
  40. package/dist/components/datepicker/datepicker-single.d.ts +1 -1
  41. package/dist/components/datepicker/datepicker.d.ts +5 -5
  42. package/dist/components/fileupload/fileupload-renderers.d.ts +2 -2
  43. package/dist/components/fileupload/fileupload.d.ts +1 -1
  44. package/dist/components/header/header-user-menu.d.ts +1 -1
  45. package/dist/components/header/header.d.ts +1 -1
  46. package/dist/components/helptext/helptext.d.ts +1 -1
  47. package/dist/components/icon/icon.d.ts +1 -1
  48. package/dist/components/input-wrapper/input-wrapper.d.ts +1 -1
  49. package/dist/components/link/link.d.ts +1 -1
  50. package/dist/components/linkcard/linkcard.d.ts +1 -1
  51. package/dist/components/listbox/listbox.d.ts +1 -1
  52. package/dist/components/loader/loader.d.ts +1 -1
  53. package/dist/components/messagebox/messagebox.d.ts +1 -1
  54. package/dist/components/modal/modal.d.ts +1 -1
  55. package/dist/components/progressbar/progressbar.d.ts +1 -1
  56. package/dist/components/radiobutton/radiobutton.d.ts +1 -1
  57. package/dist/components/searchinput/searchinput.d.ts +1 -1
  58. package/dist/components/select/select.d.ts +1 -1
  59. package/dist/components/tabs/tabitem.d.ts +1 -1
  60. package/dist/components/tabs/tabs.d.ts +1 -1
  61. package/dist/components/tag/tag.d.ts +1 -1
  62. package/dist/components/textarea/textarea.d.ts +1 -1
  63. package/dist/components/textinput/textinput.d.ts +1 -1
  64. package/dist/components/timepicker/timepicker.d.ts +1 -1
  65. package/dist/{consent-CCesjQ_e.js → consent-D5sY6JK3.js} +3 -3
  66. package/dist/{consent-DkCihETp.cjs → consent-X3wvhteO.cjs} +2 -2
  67. package/dist/converters-9jHlXDyy.cjs +1 -0
  68. package/dist/{converters-BQnj7OJE.js → converters-BKGBRBpS.js} +191 -176
  69. package/dist/{datepicker-zOOhs9JK.js → datepicker-CKghFMu2.js} +13 -13
  70. package/dist/{datepicker-ChEi_INm.cjs → datepicker-DNEUkbB0.cjs} +2 -2
  71. package/dist/{dialog-polyfill.esm-CYs2AHP1.cjs → dialog-polyfill.esm-J-GKtwrS.cjs} +1 -1
  72. package/dist/{directive-helpers-f36YZFOG.cjs → directive-helpers-BshFvt7A.cjs} +1 -1
  73. package/dist/{directive-helpers-Cep_4cpj.js → directive-helpers-DIF5DwN4.js} +2 -2
  74. package/dist/directives/slot-content.d.ts +1 -1
  75. package/dist/docs/backlink.d.ts +1 -1
  76. package/dist/docs/components/accordion.d.ts +1 -1
  77. package/dist/docs/components/alert.d.ts +1 -1
  78. package/dist/docs/components/backlink.d.ts +1 -1
  79. package/dist/docs/components/breadcrumbs.d.ts +1 -1
  80. package/dist/docs/components/button.d.ts +1 -1
  81. package/dist/docs/components/calendar.d.ts +1 -1
  82. package/dist/docs/components/card.d.ts +1 -1
  83. package/dist/docs/components/checkbox.d.ts +1 -1
  84. package/dist/docs/components/combobox.d.ts +1 -1
  85. package/dist/docs/components/comboboxdemo.d.ts +1 -1
  86. package/dist/docs/components/consent.d.ts +1 -1
  87. package/dist/docs/components/datepicker.d.ts +1 -1
  88. package/dist/docs/components/datepickermultiple.d.ts +1 -1
  89. package/dist/docs/components/fileupload.d.ts +1 -1
  90. package/dist/docs/components/form.d.ts +1 -1
  91. package/dist/docs/components/header-full.d.ts +1 -1
  92. package/dist/docs/components/header-menu.d.ts +1 -1
  93. package/dist/docs/components/header.d.ts +1 -1
  94. package/dist/docs/components/heading.d.ts +1 -1
  95. package/dist/docs/components/icon.d.ts +1 -1
  96. package/dist/docs/components/input-wrapper.d.ts +1 -1
  97. package/dist/docs/components/link.d.ts +1 -1
  98. package/dist/docs/components/linkcard.d.ts +1 -1
  99. package/dist/docs/components/loader.d.ts +1 -1
  100. package/dist/docs/components/messagebox.d.ts +1 -1
  101. package/dist/docs/components/modal.d.ts +1 -1
  102. package/dist/docs/components/progressbar.d.ts +1 -1
  103. package/dist/docs/components/radiobutton.d.ts +1 -1
  104. package/dist/docs/components/searchinput.d.ts +1 -1
  105. package/dist/docs/components/select.d.ts +1 -1
  106. package/dist/docs/components/slots.d.ts +1 -1
  107. package/dist/docs/components/tabs.d.ts +1 -1
  108. package/dist/docs/components/tag.d.ts +1 -1
  109. package/dist/docs/components/textarea.d.ts +1 -1
  110. package/dist/docs/components/textinput.d.ts +1 -1
  111. package/dist/docs/components/timepicker.d.ts +1 -1
  112. package/dist/docs/header.d.ts +1 -1
  113. package/dist/docs/punkt-docs.d.ts +1 -1
  114. package/dist/{element-CduG0XyF.js → element-BoJrqauR.js} +6 -6
  115. package/dist/{element-CXAtr6Gu.cjs → element-DJzurxgt.cjs} +1 -1
  116. package/dist/{element-with-slot-Cmxb9h4H.cjs → element-with-slot-BY7Jc-q8.cjs} +1 -1
  117. package/dist/{element-with-slot-BVj9MXzi.js → element-with-slot-mXLg8gg8.js} +2 -2
  118. package/dist/{fileupload-CGaJlMG9.cjs → fileupload-BMHJaAKR.cjs} +2 -2
  119. package/dist/{fileupload-BBph8gH3.js → fileupload-DpvQ3e_T.js} +10 -10
  120. package/dist/{focus-modality-controller-wI5SR8wH.cjs → focus-modality-controller-C1ocyv2J.cjs} +1 -1
  121. package/dist/{header-C8dCoJpr.js → header-C7kSI9zP.js} +10 -10
  122. package/dist/{header-C6z1KhOR.cjs → header-VfLyhEYL.cjs} +2 -2
  123. package/dist/{header-menu-BU-ylGrJ.js → header-menu-C8b5vd3n.js} +5 -5
  124. package/dist/{header-menu-CnW7nzmF.cjs → header-menu-DMdP_c6X.cjs} +2 -2
  125. package/dist/{heading-3o4Dk0Wn.js → heading-CD0PhL8g.js} +2 -2
  126. package/dist/{heading-C40-NX0r.cjs → heading-DyJpBFT2.cjs} +1 -1
  127. package/dist/{helptext-C2aQBBo_.js → helptext-OfqH5npD.js} +6 -6
  128. package/dist/{helptext-DNLg43eI.cjs → helptext-eckq4JEX.cjs} +2 -2
  129. package/dist/{icon-Dw6I0HDV.cjs → icon-B8PVq2O6.cjs} +1 -1
  130. package/dist/{icon-LaKyBKON.js → icon-DGFEIlco.js} +2 -2
  131. package/dist/if-defined-D0bnetLJ.js +5 -0
  132. package/dist/if-defined-DrwbxQOj.cjs +1 -0
  133. package/dist/index.d.ts +2 -2
  134. package/dist/input-element-C_zP_x4a.js +656 -0
  135. package/dist/input-element-Df9FHnfn.cjs +1 -0
  136. package/dist/{input-wrapper-CvtU-Ksb.cjs → input-wrapper-BRjQB4zM.cjs} +21 -21
  137. package/dist/{input-wrapper-C93MmOIg.js → input-wrapper-DaA98B5l.js} +32 -32
  138. package/dist/{input-wrapper-CYCCx8MP.cjs → input-wrapper-LcZjpt0L.cjs} +1 -1
  139. package/dist/{link-DauiNRMq.js → link-FmkQvSQL.js} +4 -4
  140. package/dist/{link-EZ0-lS3W.cjs → link-Geze7498.cjs} +2 -2
  141. package/dist/{linkcard-BIcCW-qw.cjs → linkcard-6LCXRTR-.cjs} +2 -2
  142. package/dist/{linkcard-DNJm5FvA.js → linkcard-BKdT0zU_.js} +4 -4
  143. package/dist/{listbox-DbEobJNx.cjs → listbox-89wMuQVK.cjs} +2 -2
  144. package/dist/{listbox-DXMIBv3y.js → listbox-LdyWPu7W.js} +5 -5
  145. package/dist/{loader-B3ToraVk.js → loader-BA-i8CaQ.js} +4 -4
  146. package/dist/{loader-CLf_Phfg.cjs → loader-CgW4Vst3.cjs} +2 -2
  147. package/dist/{messagebox-BqBxXK8c.cjs → messagebox-VD5oEZ19.cjs} +2 -2
  148. package/dist/{messagebox-XRFecqyS.js → messagebox-fiaAyHLG.js} +5 -5
  149. package/dist/{modal-CWgeT-RP.js → modal-C6pScpdG.js} +6 -6
  150. package/dist/{modal-CrYHKOmr.cjs → modal-DKU7PnjJ.cjs} +2 -2
  151. package/dist/pkt-accordion.cjs +1 -1
  152. package/dist/pkt-accordion.js +1 -1
  153. package/dist/pkt-alert.cjs +1 -1
  154. package/dist/pkt-alert.js +1 -1
  155. package/dist/pkt-backlink.cjs +1 -1
  156. package/dist/pkt-backlink.js +1 -1
  157. package/dist/pkt-breadcrumbs.cjs +1 -1
  158. package/dist/pkt-breadcrumbs.js +1 -1
  159. package/dist/pkt-button.cjs +1 -1
  160. package/dist/pkt-button.js +1 -1
  161. package/dist/pkt-calendar.cjs +1 -1
  162. package/dist/pkt-calendar.js +1 -1
  163. package/dist/pkt-card.cjs +1 -1
  164. package/dist/pkt-card.js +1 -1
  165. package/dist/pkt-checkbox.cjs +1 -1
  166. package/dist/pkt-checkbox.js +1 -1
  167. package/dist/pkt-combobox.cjs +1 -1
  168. package/dist/pkt-combobox.js +1 -1
  169. package/dist/pkt-consent.cjs +1 -1
  170. package/dist/pkt-consent.js +1 -1
  171. package/dist/pkt-datepicker.cjs +1 -1
  172. package/dist/pkt-datepicker.js +1 -1
  173. package/dist/pkt-fileupload.cjs +1 -1
  174. package/dist/pkt-fileupload.js +1 -1
  175. package/dist/pkt-header-menu.cjs +1 -1
  176. package/dist/pkt-header-menu.js +1 -1
  177. package/dist/pkt-header.cjs +1 -1
  178. package/dist/pkt-header.js +1 -1
  179. package/dist/pkt-heading.cjs +1 -1
  180. package/dist/pkt-heading.js +1 -1
  181. package/dist/pkt-helptext.cjs +1 -1
  182. package/dist/pkt-helptext.js +1 -1
  183. package/dist/pkt-icon.cjs +1 -1
  184. package/dist/pkt-icon.js +1 -1
  185. package/dist/pkt-index.cjs +1 -1
  186. package/dist/pkt-index.js +32 -32
  187. package/dist/pkt-input-wrapper.cjs +1 -1
  188. package/dist/pkt-input-wrapper.js +1 -1
  189. package/dist/pkt-link.cjs +1 -1
  190. package/dist/pkt-link.js +1 -1
  191. package/dist/pkt-linkcard.cjs +1 -1
  192. package/dist/pkt-linkcard.js +1 -1
  193. package/dist/pkt-listbox.cjs +1 -1
  194. package/dist/pkt-listbox.js +1 -1
  195. package/dist/pkt-loader.cjs +1 -1
  196. package/dist/pkt-loader.js +1 -1
  197. package/dist/pkt-messagebox.cjs +1 -1
  198. package/dist/pkt-messagebox.js +1 -1
  199. package/dist/pkt-modal.cjs +1 -1
  200. package/dist/pkt-modal.js +1 -1
  201. package/dist/{pkt-options-controller-BTNtjEIS.js → pkt-options-controller-Cis62vGe.js} +1 -1
  202. package/dist/{pkt-options-controller-CBM8xHwR.cjs → pkt-options-controller-DHKHMyXM.cjs} +1 -1
  203. package/dist/pkt-progressbar.cjs +1 -1
  204. package/dist/pkt-progressbar.js +1 -1
  205. package/dist/pkt-radiobutton.cjs +1 -1
  206. package/dist/pkt-radiobutton.js +1 -1
  207. package/dist/pkt-searchinput.cjs +1 -1
  208. package/dist/pkt-searchinput.js +1 -1
  209. package/dist/pkt-select.cjs +1 -1
  210. package/dist/pkt-select.js +1 -1
  211. package/dist/pkt-tabs.cjs +1 -1
  212. package/dist/pkt-tabs.js +1 -1
  213. package/dist/pkt-tag.cjs +1 -1
  214. package/dist/pkt-tag.js +1 -1
  215. package/dist/pkt-textarea.cjs +1 -1
  216. package/dist/pkt-textarea.js +1 -1
  217. package/dist/pkt-textinput.cjs +1 -1
  218. package/dist/pkt-textinput.js +1 -1
  219. package/dist/pkt-timepicker.cjs +1 -1
  220. package/dist/pkt-timepicker.js +1 -1
  221. package/dist/progressbar-BN5y20CC.cjs +17 -0
  222. package/dist/{progressbar-B0P_vmGD.js → progressbar-mtjtbpCO.js} +7 -7
  223. package/dist/{radiobutton-C6zERHoy.js → radiobutton-CKhWm7CI.js} +8 -8
  224. package/dist/{radiobutton-BfURufrZ.cjs → radiobutton-DbezjeDT.cjs} +5 -5
  225. package/dist/ref-DO7TzO4O.cjs +1 -0
  226. package/dist/{ref-BgoHEsEt.js → ref-WGS0u7i2.js} +5 -5
  227. package/dist/{repeat-CKIii8Mi.js → repeat-BH0cL82q.js} +3 -3
  228. package/dist/{repeat-CRRgmzVn.cjs → repeat-DRnLAg0O.cjs} +1 -1
  229. package/dist/{searchinput-fPvXHu2O.js → searchinput-CyO5k4Q4.js} +7 -6
  230. package/dist/{searchinput-BrxfRzez.cjs → searchinput-DG6YetL1.cjs} +2 -2
  231. package/dist/{select-z3hBSk02.cjs → select-3689MFnH.cjs} +2 -2
  232. package/dist/{select-Dz3YiN7b.js → select-CrTmkOw0.js} +7 -7
  233. package/dist/{tabs-DxQy8U-0.cjs → tabs-CGo0ODPa.cjs} +2 -2
  234. package/dist/{tabs-BJx6wwXD.js → tabs-ChdR0D1C.js} +9 -9
  235. package/dist/{tag-CBFz0R9N.cjs → tag-C4fEuT-r.cjs} +2 -2
  236. package/dist/{tag-CzlnHhho.js → tag-DBNga0hg.js} +5 -5
  237. package/dist/{textarea-rHlURXh5.cjs → textarea-BWOuU6m6.cjs} +2 -2
  238. package/dist/{textarea-BxBfLk3N.js → textarea-tKZakgjC.js} +10 -10
  239. package/dist/{textinput-DSYABvB6.cjs → textinput-CqvE701N.cjs} +2 -2
  240. package/dist/{textinput-Bs8DwHwR.js → textinput-D-gsl53I.js} +8 -8
  241. package/dist/{timepicker-Cb9pxkJa.js → timepicker-D2KJmxrZ.js} +8 -8
  242. package/dist/{timepicker-DVisPbGX.cjs → timepicker-DTI6LY0j.cjs} +2 -2
  243. package/dist/{utils-CjAbIttF.cjs → utils-63cRpWut.cjs} +1 -1
  244. package/package.json +28 -27
  245. package/dist/converters-CkqZ02TI.cjs +0 -1
  246. package/dist/if-defined-LTjAScFG.cjs +0 -1
  247. package/dist/if-defined-VShASPdu.js +0 -5
  248. package/dist/input-element-BHQVt4Q9.cjs +0 -1
  249. package/dist/input-element-BrmkXIXi.js +0 -643
  250. package/dist/progressbar-DADdvDl5.cjs +0 -17
  251. package/dist/ref-CBdWMlde.cjs +0 -1
  252. /package/dist/{booleanish-BmcOU-43.js → booleanish-MfutDT_4.js} +0 -0
  253. /package/dist/{classutils-lVbGcvjN.js → classutils-DcYnSgfc.js} +0 -0
  254. /package/dist/{dialog-polyfill.esm-0dVT8G1o.js → dialog-polyfill.esm-ChZRzCVh.js} +0 -0
  255. /package/dist/{focus-modality-controller-CaUqYdk0.js → focus-modality-controller-Dc2S-KqR.js} +0 -0
  256. /package/dist/{input-wrapper-kw2y6Jp_.js → input-wrapper-DwwE0JcO.js} +0 -0
  257. /package/dist/{utils-CUqCKGvp.js → utils-BwF4QSrq.js} +0 -0
@@ -1,643 +0,0 @@
1
- import { n as e, o as t, r as n } from "./element-CduG0XyF.js";
2
- import { t as r } from "./element-with-slot-BVj9MXzi.js";
3
- import { n as i } from "./utils-CUqCKGvp.js";
4
- import { t as a } from "./booleanish-BmcOU-43.js";
5
- import { t as o } from "./input-wrapper-kw2y6Jp_.js";
6
- //#region ../../node_modules/element-internals-polyfill/dist/index.js
7
- (function(e) {
8
- let t = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap(), r = /* @__PURE__ */ new WeakMap(), i = /* @__PURE__ */ new WeakMap(), a = /* @__PURE__ */ new WeakMap(), o = /* @__PURE__ */ new WeakMap(), s = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakMap(), d = /* @__PURE__ */ new WeakMap(), f = /* @__PURE__ */ new WeakMap(), p = /* @__PURE__ */ new WeakMap(), m = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), g = {
9
- ariaAtomic: "aria-atomic",
10
- ariaAutoComplete: "aria-autocomplete",
11
- ariaBusy: "aria-busy",
12
- ariaChecked: "aria-checked",
13
- ariaColCount: "aria-colcount",
14
- ariaColIndex: "aria-colindex",
15
- ariaColIndexText: "aria-colindextext",
16
- ariaColSpan: "aria-colspan",
17
- ariaCurrent: "aria-current",
18
- ariaDescription: "aria-description",
19
- ariaDisabled: "aria-disabled",
20
- ariaExpanded: "aria-expanded",
21
- ariaHasPopup: "aria-haspopup",
22
- ariaHidden: "aria-hidden",
23
- ariaInvalid: "aria-invalid",
24
- ariaKeyShortcuts: "aria-keyshortcuts",
25
- ariaLabel: "aria-label",
26
- ariaLevel: "aria-level",
27
- ariaLive: "aria-live",
28
- ariaModal: "aria-modal",
29
- ariaMultiLine: "aria-multiline",
30
- ariaMultiSelectable: "aria-multiselectable",
31
- ariaOrientation: "aria-orientation",
32
- ariaPlaceholder: "aria-placeholder",
33
- ariaPosInSet: "aria-posinset",
34
- ariaPressed: "aria-pressed",
35
- ariaReadOnly: "aria-readonly",
36
- ariaRelevant: "aria-relevant",
37
- ariaRequired: "aria-required",
38
- ariaRoleDescription: "aria-roledescription",
39
- ariaRowCount: "aria-rowcount",
40
- ariaRowIndex: "aria-rowindex",
41
- ariaRowIndexText: "aria-rowindextext",
42
- ariaRowSpan: "aria-rowspan",
43
- ariaSelected: "aria-selected",
44
- ariaSetSize: "aria-setsize",
45
- ariaSort: "aria-sort",
46
- ariaValueMax: "aria-valuemax",
47
- ariaValueMin: "aria-valuemin",
48
- ariaValueNow: "aria-valuenow",
49
- ariaValueText: "aria-valuetext",
50
- role: "role"
51
- }, _ = (e, t) => {
52
- for (let n in g) {
53
- t[n] = null;
54
- let r = null, i = g[n];
55
- Object.defineProperty(t, n, {
56
- get() {
57
- return r;
58
- },
59
- set(n) {
60
- r = n, e.isConnected ? T(e, i, n) : u.set(e, t);
61
- }
62
- });
63
- }
64
- };
65
- function v(e) {
66
- let t = i.get(e), { form: n } = t;
67
- P(e, n, t), A(e, t.labels);
68
- }
69
- let y = (e, t = !1) => {
70
- let n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode(e) {
71
- return i.has(e) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
72
- } }), r = n.nextNode(), a = !t || e.disabled;
73
- for (; r;) r.formDisabledCallback && a && E(r, e.disabled), r = n.nextNode();
74
- }, b = {
75
- attributes: !0,
76
- attributeFilter: ["disabled", "name"]
77
- }, x = z() ? new MutationObserver((e) => {
78
- for (let t of e) {
79
- let e = t.target;
80
- if (t.attributeName === "disabled" && (e.constructor.formAssociated ? E(e, e.hasAttribute("disabled")) : e.localName === "fieldset" && y(e)), t.attributeName === "name" && e.constructor.formAssociated) {
81
- let t = i.get(e), n = l.get(e);
82
- t.setFormValue(n);
83
- }
84
- }
85
- }) : {};
86
- function S(e) {
87
- e.forEach((e) => {
88
- let { addedNodes: t, removedNodes: n } = e, a = Array.from(t), o = Array.from(n);
89
- a.forEach((e) => {
90
- var t;
91
- if (i.has(e) && e.constructor.formAssociated && v(e), u.has(e)) {
92
- let t = u.get(e);
93
- Object.keys(g).filter((e) => t[e] !== null).forEach((n) => {
94
- T(e, g[n], t[n]);
95
- }), u.delete(e);
96
- }
97
- if (h.has(e)) {
98
- let t = h.get(e);
99
- T(e, "internals-valid", t.validity.valid.toString()), T(e, "internals-invalid", (!t.validity.valid).toString()), T(e, "aria-invalid", (!t.validity.valid).toString()), h.delete(e);
100
- }
101
- if (e.localName === "form") {
102
- let t = c.get(e), n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode(e) {
103
- return i.has(e) && e.constructor.formAssociated && !(t && t.has(e)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
104
- } }), r = n.nextNode();
105
- for (; r;) v(r), r = n.nextNode();
106
- }
107
- e.localName === "fieldset" && ((t = x.observe) == null || t.call(x, e, b), y(e, !0));
108
- }), o.forEach((e) => {
109
- let t = i.get(e);
110
- t && r.get(t) && D(t), s.has(e) && s.get(e).disconnect();
111
- });
112
- });
113
- }
114
- function C(e) {
115
- e.forEach((e) => {
116
- let { removedNodes: t } = e;
117
- t.forEach((t) => {
118
- let n = p.get(e.target);
119
- i.has(t) && R(t), n.disconnect();
120
- });
121
- });
122
- }
123
- let ee = (e) => {
124
- var t;
125
- let n = new MutationObserver(C);
126
- (window == null ? void 0 : window.ShadyDOM)?.inUse && e.mode && e.host && (e = e.host), (t = n.observe) == null || t.call(n, e, { childList: !0 }), p.set(e, n);
127
- };
128
- z() && new MutationObserver(S);
129
- let w = {
130
- childList: !0,
131
- subtree: !0
132
- }, T = (e, t, n) => {
133
- e.getAttribute(t) !== n && e.setAttribute(t, n);
134
- }, E = (e, t) => {
135
- e.toggleAttribute("internals-disabled", t), t ? T(e, "aria-disabled", "true") : e.removeAttribute("aria-disabled"), e.formDisabledCallback && e.formDisabledCallback.apply(e, [t]);
136
- }, D = (e) => {
137
- r.get(e).forEach((e) => {
138
- e.remove();
139
- }), r.set(e, []);
140
- }, O = (e, t) => {
141
- let n = document.createElement("input");
142
- return n.type = "hidden", n.name = e.getAttribute("name"), e.after(n), r.get(t).push(n), n;
143
- }, k = (e, t) => {
144
- var n;
145
- r.set(t, []), (n = x.observe) == null || n.call(x, e, b);
146
- }, A = (e, t) => {
147
- if (t.length) {
148
- Array.from(t).forEach((t) => t.addEventListener("click", e.click.bind(e)));
149
- let n = t[0].id;
150
- t[0].id || (n = `${t[0].htmlFor}_Label`, t[0].id = n), T(e, "aria-labelledby", n);
151
- }
152
- }, j = (e) => {
153
- let t = Array.from(e.elements).filter((e) => !e.tagName.includes("-") && e.validity).map((e) => e.validity.valid), n = c.get(e) || [], r = Array.from(n).filter((e) => e.isConnected).map((e) => i.get(e).validity.valid), a = [...t, ...r].includes(!1);
154
- e.toggleAttribute("internals-invalid", a), e.toggleAttribute("internals-valid", !a);
155
- }, M = (e) => {
156
- j(F(e.target));
157
- }, N = (e) => {
158
- j(F(e.target));
159
- }, te = (e) => {
160
- let t = [
161
- "button[type=submit]",
162
- "input[type=submit]",
163
- "button:not([type])"
164
- ].map((e) => `${e}:not([disabled])`).map((t) => `${t}:not([form])${e.id ? `,${t}[form='${e.id}']` : ""}`).join(",");
165
- e.addEventListener("click", (n) => {
166
- if (n.target.closest(t)) {
167
- let t = c.get(e);
168
- if (e.noValidate) return;
169
- t.size && Array.from(t).reverse().map((e) => i.get(e).reportValidity()).includes(!1) && n.preventDefault();
170
- }
171
- });
172
- }, ne = (e) => {
173
- let t = c.get(e.target);
174
- t && t.size && t.forEach((e) => {
175
- e.constructor.formAssociated && e.formResetCallback && e.formResetCallback.apply(e);
176
- });
177
- }, P = (e, t, n) => {
178
- if (t) {
179
- let r = c.get(t);
180
- if (r) r.add(e);
181
- else {
182
- let n = /* @__PURE__ */ new Set();
183
- n.add(e), c.set(t, n), te(t), t.addEventListener("reset", ne), t.addEventListener("input", M), t.addEventListener("change", N);
184
- }
185
- o.set(t, {
186
- ref: e,
187
- internals: n
188
- }), e.constructor.formAssociated && e.formAssociatedCallback && setTimeout(() => {
189
- e.formAssociatedCallback.apply(e, [t]);
190
- }, 0), j(t);
191
- }
192
- }, F = (e) => {
193
- let t = e.parentNode;
194
- return t && t.tagName !== "FORM" && (t = F(t)), t;
195
- }, I = (e, t, n = DOMException) => {
196
- if (!e.constructor.formAssociated) throw new n(t);
197
- }, L = (e, t, n) => {
198
- let r = c.get(e);
199
- return r && r.size && r.forEach((e) => {
200
- i.get(e)[n]() || (t = !1);
201
- }), t;
202
- }, R = (e) => {
203
- if (e.constructor.formAssociated) {
204
- let t = i.get(e), { labels: n, form: r } = t;
205
- A(e, n), P(e, r, t);
206
- }
207
- };
208
- function z() {
209
- return typeof MutationObserver < "u";
210
- }
211
- class B {
212
- constructor() {
213
- this.badInput = !1, this.customError = !1, this.patternMismatch = !1, this.rangeOverflow = !1, this.rangeUnderflow = !1, this.stepMismatch = !1, this.tooLong = !1, this.tooShort = !1, this.typeMismatch = !1, this.valid = !0, this.valueMissing = !1, Object.seal(this);
214
- }
215
- }
216
- let re = (e) => (e.badInput = !1, e.customError = !1, e.patternMismatch = !1, e.rangeOverflow = !1, e.rangeUnderflow = !1, e.stepMismatch = !1, e.tooLong = !1, e.tooShort = !1, e.typeMismatch = !1, e.valid = !0, e.valueMissing = !1, e), ie = (e, t, n) => (e.valid = V(t), Object.keys(t).forEach((n) => e[n] = t[n]), n && j(n), e), V = (e) => {
217
- let t = !0;
218
- for (let n in e) n !== "valid" && e[n] !== !1 && (t = !1);
219
- return t;
220
- }, H = /* @__PURE__ */ new WeakMap();
221
- function U(e, t) {
222
- e.toggleAttribute(t, !0), e.part && e.part.add(t);
223
- }
224
- class W extends Set {
225
- static get isPolyfilled() {
226
- return !0;
227
- }
228
- constructor(e) {
229
- if (super(), !e || !e.tagName || e.tagName.indexOf("-") === -1) throw TypeError("Illegal constructor");
230
- H.set(this, e);
231
- }
232
- add(e) {
233
- if (!/^--/.test(e) || typeof e != "string") throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${e} must start with '--'.`);
234
- let t = super.add(e), n = H.get(this), r = `state${e}`;
235
- return n.isConnected ? U(n, r) : setTimeout(() => {
236
- U(n, r);
237
- }), t;
238
- }
239
- clear() {
240
- for (let [e] of this.entries()) this.delete(e);
241
- super.clear();
242
- }
243
- delete(e) {
244
- let t = super.delete(e), n = H.get(this);
245
- return n.isConnected ? (n.toggleAttribute(`state${e}`, !1), n.part && n.part.remove(`state${e}`)) : setTimeout(() => {
246
- n.toggleAttribute(`state${e}`, !1), n.part && n.part.remove(`state${e}`);
247
- }), t;
248
- }
249
- }
250
- function G(e, t, n, r) {
251
- if (n === "a" && !r) throw TypeError("Private accessor was defined without a getter");
252
- if (typeof t == "function" ? e !== t || !r : !t.has(e)) throw TypeError("Cannot read private member from an object whose class did not declare it");
253
- return n === "m" ? r : n === "a" ? r.call(e) : r ? r.value : t.get(e);
254
- }
255
- function K(e, t, n, r, i) {
256
- if (r === "m") throw TypeError("Private method is not writable");
257
- if (r === "a" && !i) throw TypeError("Private accessor was defined without a setter");
258
- if (typeof t == "function" ? e !== t || !i : !t.has(e)) throw TypeError("Cannot write private member to an object whose class did not declare it");
259
- return r === "a" ? i.call(e, n) : i ? i.value = n : t.set(e, n), n;
260
- }
261
- var q;
262
- class J {
263
- constructor(e) {
264
- q.set(this, void 0), K(this, q, e, "f");
265
- for (let t = 0; t < e.length; t++) {
266
- let n = e[t];
267
- this[t] = n, n.hasAttribute("name") && (this[n.getAttribute("name")] = n);
268
- }
269
- Object.freeze(this);
270
- }
271
- get length() {
272
- return G(this, q, "f").length;
273
- }
274
- [(q = /* @__PURE__ */ new WeakMap(), Symbol.iterator)]() {
275
- return G(this, q, "f")[Symbol.iterator]();
276
- }
277
- item(e) {
278
- return this[e] == null ? null : this[e];
279
- }
280
- namedItem(e) {
281
- return this[e] == null ? null : this[e];
282
- }
283
- }
284
- function ae() {
285
- let e = HTMLFormElement.prototype.checkValidity;
286
- HTMLFormElement.prototype.checkValidity = n;
287
- let t = HTMLFormElement.prototype.reportValidity;
288
- HTMLFormElement.prototype.reportValidity = r;
289
- function n(...t) {
290
- let n = e.apply(this, t);
291
- return L(this, n, "checkValidity");
292
- }
293
- function r(...e) {
294
- let n = t.apply(this, e);
295
- return L(this, n, "reportValidity");
296
- }
297
- let { get: i } = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, "elements");
298
- Object.defineProperty(HTMLFormElement.prototype, "elements", { get(...e) {
299
- let t = i.call(this, ...e), n = Array.from(c.get(this) || []);
300
- return n.length === 0 ? t : new J(Array.from(t).concat(n).sort((e, t) => e.compareDocumentPosition ? e.compareDocumentPosition(t) & 2 ? 1 : -1 : 0));
301
- } });
302
- }
303
- class Y {
304
- static get isPolyfilled() {
305
- return !0;
306
- }
307
- constructor(e) {
308
- if (!e || !e.tagName || e.tagName.indexOf("-") === -1) throw TypeError("Illegal constructor");
309
- let r = e.getRootNode(), a = new B();
310
- this.states = new W(e), t.set(this, e), n.set(this, a), i.set(e, this), _(e, this), k(e, this), Object.seal(this), r instanceof DocumentFragment && ee(r);
311
- }
312
- checkValidity() {
313
- let e = t.get(this);
314
- if (I(e, "Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate) return !0;
315
- let r = n.get(this);
316
- if (!r.valid) {
317
- let t = new Event("invalid", {
318
- bubbles: !1,
319
- cancelable: !0,
320
- composed: !1
321
- });
322
- e.dispatchEvent(t);
323
- }
324
- return r.valid;
325
- }
326
- get form() {
327
- let e = t.get(this);
328
- I(e, "Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");
329
- let n;
330
- return e.constructor.formAssociated === !0 && (n = F(e)), n;
331
- }
332
- get labels() {
333
- let e = t.get(this);
334
- I(e, "Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");
335
- let n = e.getAttribute("id"), r = e.getRootNode();
336
- return r && n ? r.querySelectorAll(`[for="${n}"]`) : [];
337
- }
338
- reportValidity() {
339
- let e = t.get(this);
340
- if (I(e, "Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !this.willValidate) return !0;
341
- let n = this.checkValidity(), r = f.get(this);
342
- if (r && !e.constructor.formAssociated) throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");
343
- return !n && r && (e.focus(), r.focus()), n;
344
- }
345
- setFormValue(e) {
346
- let n = t.get(this);
347
- if (I(n, "Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."), D(this), e != null && !(e instanceof FormData)) {
348
- if (n.getAttribute("name")) {
349
- let t = O(n, this);
350
- t.value = e;
351
- }
352
- } else e != null && e instanceof FormData && Array.from(e).reverse().forEach(([e, t]) => {
353
- if (typeof t == "string") {
354
- let r = O(n, this);
355
- r.name = e, r.value = t;
356
- }
357
- });
358
- l.set(n, e);
359
- }
360
- setValidity(e, r, i) {
361
- let o = t.get(this);
362
- if (I(o, "Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."), !e) throw TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");
363
- f.set(this, i);
364
- let s = n.get(this), c = {};
365
- for (let t in e) c[t] = e[t];
366
- Object.keys(c).length === 0 && re(s);
367
- let l = Object.assign(Object.assign({}, s), c);
368
- delete l.valid;
369
- let { valid: u } = ie(s, l, this.form);
370
- if (!u && !r) throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");
371
- a.set(this, u ? "" : r), o.isConnected ? (o.toggleAttribute("internals-invalid", !u), o.toggleAttribute("internals-valid", u), T(o, "aria-invalid", `${!u}`)) : h.set(o, this);
372
- }
373
- get shadowRoot() {
374
- let e = t.get(this);
375
- return d.get(e) || null;
376
- }
377
- get validationMessage() {
378
- return I(t.get(this), "Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."), a.get(this);
379
- }
380
- get validity() {
381
- return I(t.get(this), "Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."), n.get(this);
382
- }
383
- get willValidate() {
384
- let e = t.get(this);
385
- return I(e, "Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."), !(e.disabled || e.hasAttribute("disabled") || e.hasAttribute("readonly"));
386
- }
387
- }
388
- function oe() {
389
- if (typeof window > "u" || !window.ElementInternals || !HTMLElement.prototype.attachInternals) return !1;
390
- class e extends HTMLElement {
391
- constructor() {
392
- super(), this.internals = this.attachInternals();
393
- }
394
- }
395
- let t = `element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g, "")}`;
396
- customElements.define(t, e);
397
- let n = new e();
398
- return [
399
- "shadowRoot",
400
- "form",
401
- "willValidate",
402
- "validity",
403
- "validationMessage",
404
- "labels",
405
- "setFormValue",
406
- "setValidity",
407
- "checkValidity",
408
- "reportValidity"
409
- ].every((e) => e in n.internals);
410
- }
411
- let X = !1, Z = !1;
412
- function Q(e) {
413
- Z || (Z = !0, window.CustomStateSet = W, e && (HTMLElement.prototype.attachInternals = function(...t) {
414
- let n = e.call(this, t);
415
- return n.states = new W(this), n;
416
- }));
417
- }
418
- function $(e = !0) {
419
- if (!X) {
420
- if (X = !0, typeof window < "u" && (window.ElementInternals = Y), typeof CustomElementRegistry < "u") {
421
- let e = CustomElementRegistry.prototype.define;
422
- CustomElementRegistry.prototype.define = function(t, n, r) {
423
- if (n.formAssociated) {
424
- let e = n.prototype.connectedCallback;
425
- n.prototype.connectedCallback = function() {
426
- m.has(this) || (m.set(this, !0), this.hasAttribute("disabled") && E(this, !0)), e?.apply(this), R(this);
427
- };
428
- }
429
- e.call(this, t, n, r);
430
- };
431
- }
432
- if (typeof HTMLElement < "u" && (HTMLElement.prototype.attachInternals = function() {
433
- if (!this.tagName) return {};
434
- if (this.tagName.indexOf("-") === -1) throw Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.");
435
- if (i.has(this)) throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");
436
- return new Y(this);
437
- }), typeof Element < "u") {
438
- function e(...e) {
439
- let n = t.apply(this, e);
440
- if (d.set(this, n), z()) {
441
- let e = new MutationObserver(S);
442
- window.ShadyDOM ? e.observe(this, w) : e.observe(n, w), s.set(this, e);
443
- }
444
- return n;
445
- }
446
- let t = Element.prototype.attachShadow;
447
- Element.prototype.attachShadow = e;
448
- }
449
- z() && typeof document < "u" && new MutationObserver(S).observe(document.documentElement, w), typeof HTMLFormElement < "u" && ae(), (e || typeof window < "u" && !window.CustomStateSet) && Q();
450
- }
451
- }
452
- return customElements.polyfillWrapFlushCallback || (oe() ? typeof window < "u" && !window.CustomStateSet && Q(HTMLElement.prototype.attachInternals) : $(!1)), e.forceCustomStateSetPolyfill = Q, e.forceElementInternalsPolyfill = $, Object.defineProperty(e, "__esModule", { value: !0 }), e;
453
- })({});
454
- //#endregion
455
- //#region src/base-elements/input-element.ts
456
- var s = "on", c = "--checked", l = ",", u = class extends r {
457
- static get formAssociated() {
458
- return !0;
459
- }
460
- constructor() {
461
- super(), this.defaultValue = null, this.disabled = !1, this.readonly = !1, this.required = !1, this.max = null, this.maxlength = null, this.min = null, this.minlength = null, this.step = null, this.ariaDescribedBy = null, this.ariaLabelledby = null, this.name = "", this.pattern = null, this.placeholder = null, this.id = i(), this.counter = !1, this.hasError = !1, this.inline = !1, this.hasFieldset = !1, this.optionalTag = !1, this.requiredTag = !1, this.skipForwardTestid = !1, this.useWrapper = !0, this.fullwidth = !1, this.counterMaxLength = 0, this.errorMessage = "", this.helptext = "", this.helptextDropdown = "", this.helptextDropdownButton = o.props.helptextDropdownButton.default, this.label = null, this.optionalText = n.forms.labels.optional, this.requiredText = n.forms.labels.required, this.tagText = null, this.dataTestid = "", this.touched = !1, this.internals = this.attachInternals();
462
- }
463
- manageValidity(e) {
464
- if (!e) {
465
- console.warn("manageValidity called without valid input element");
466
- return;
467
- }
468
- this.required && !this.value ? this.internals.setValidity({ valueMissing: !0 }, n.forms.messages.required, e) : e.validity?.typeMismatch || e.validity?.badInput ? this.internals.setValidity({ typeMismatch: !0 }, n.forms.messages.invalid, e) : e.validity?.patternMismatch ? this.internals.setValidity({ patternMismatch: !0 }, n.forms.messages.invalidPattern, e) : e.validity?.tooShort || this.minlength && this.minlength > 0 && this.value.length < this.minlength ? this.internals.setValidity({ tooShort: !0 }, n.forms.messages.tooShort, e) : e.validity?.tooLong || this.maxlength && this.maxlength > 0 && this.value.length > this.maxlength ? this.internals.setValidity({ tooLong: !0 }, n.forms.messages.tooLong, e) : e.validity?.rangeUnderflow ? this.internals.setValidity({ rangeUnderflow: !0 }, this.min ? n.forms.messages.rangeUnderflowMin.replace("{min}", this.min?.toString()) : n.forms.messages.rangeUnderflow, e) : e.validity?.stepMismatch ? this.internals.setValidity({ stepMismatch: !0 }, n.forms.messages.invalid, e) : e.validity?.rangeOverflow ? this.internals.setValidity({ rangeOverflow: !0 }, this.max ? n.forms.messages.rangeOverflowMax.replace("{max}", this.max?.toString()) : n.forms.messages.rangeOverflow, e) : e.validity?.customError ? this.internals.setValidity({ customError: !0 }, e.validationMessage, e) : this.internals.setValidity({});
469
- }
470
- setFormValue(e) {
471
- if (this.internals) if (Array.isArray(e)) {
472
- let t = new FormData();
473
- e.forEach((e) => {
474
- t.append(this.name, e);
475
- }), this.internals.setFormValue(t);
476
- } else this.internals.setFormValue(e);
477
- }
478
- coordinateRadioGroup() {
479
- if (!this.form || !this.name || this.type !== "radio") return;
480
- let e = `pkt-radiobutton[name="${this.name}"], input[type=radio][name="${this.name}"]`;
481
- this.form.querySelectorAll(e).forEach((e) => {
482
- if (e !== this && e.getAttribute("name") === this.name && e.getAttribute("value") !== this.value) {
483
- let t = e;
484
- t.checked && (t.checked = !1, t.internals && (t.internals.setFormValue(null), t.internals.states?.delete(c)));
485
- }
486
- });
487
- }
488
- valueChecked(e) {
489
- if (!this.touched) return;
490
- let t = this.internals.form || this.closest("form"), n = t ? new FormData(t) : null;
491
- if (this.type === "radio" && this.coordinateRadioGroup(), typeof e == "string" ? (this.checked = e === "true", this.internals.ariaChecked = String(e === "true")) : typeof e == "boolean" && (this.checked = e, this.internals.ariaChecked = String(e)), this.checked) {
492
- let e = (typeof this.value == "string" ? this.value : "") || s;
493
- this.internals.setFormValue(e), n && n.append(this.name, e), this.internals.states.add(c);
494
- } else this.internals.setFormValue(null), n && n.delete(this.name), this.internals.states.delete(c);
495
- this.dispatchChangeEvents(this.checked), this.internals.reportValidity();
496
- }
497
- valueChanged(e, t) {
498
- (t !== this.value || t !== this._value) && (typeof e == "string" ? ((this.multiple || this.range) && e.includes(l) && (e = e.split(l)), this.value = e, this._value = Array.isArray(e) ? e : [e]) : Array.isArray(e) ? (this.value = this.multiple || this.range ? e : e[0], this._value = e) : (this.value = "", this._value = []), (!this.value || this.value.length === 0) && t && t.length !== 0 ? this.clearInputValue() : this.value && this.value.toString() !== t?.toString() && this.onChange(this.value));
499
- }
500
- dispatchChangeEvents(e) {
501
- this.dispatchEvent(new Event("change", {
502
- bubbles: !0,
503
- composed: !0
504
- })), this.dispatchEvent(new CustomEvent("value-change", {
505
- detail: e,
506
- bubbles: !0,
507
- composed: !0
508
- }));
509
- }
510
- clearInputValue() {
511
- let e = this.multiple || this.range ? [] : "";
512
- this.value = e, this.setFormValue(e), this.dispatchChangeEvents(e);
513
- }
514
- onFocus() {
515
- this.dispatchEvent(new FocusEvent("focus", {
516
- bubbles: !0,
517
- composed: !0
518
- }));
519
- }
520
- onBlur() {
521
- this.dispatchEvent(new FocusEvent("blur", {
522
- bubbles: !0,
523
- composed: !0
524
- }));
525
- }
526
- onInput() {
527
- this.dispatchEvent(new InputEvent("input", {
528
- bubbles: !0,
529
- composed: !0
530
- }));
531
- }
532
- normalizeValue(e) {
533
- return (this.range || this.multiple) && typeof e == "string" && e.includes(l) ? e.split(l) : !this.multiple && !this.range && Array.isArray(e) ? e[0] || "" : e;
534
- }
535
- validate() {
536
- this.inputRef?.value && this.manageValidity(this.inputRef.value), this.inputRefTo?.value && this.manageValidity(this.inputRefTo.value);
537
- }
538
- onChange(e) {
539
- if (!this.touched) {
540
- this.touched = !0, e && this.setFormValue(e), this.validate();
541
- return;
542
- }
543
- if (typeof e != "string" && !Array.isArray(e)) return;
544
- let t = this.normalizeValue(e);
545
- this.setFormValue(t), this.validate(), this.dispatchChangeEvents(t);
546
- }
547
- formResetCallback() {
548
- if (this.touched = !1, this._options && this._options.length && this._options.forEach((e) => {
549
- "selected" in e && (e.selected = !1);
550
- }), this.checked !== void 0) this.checked = !1, this.internals.ariaChecked = "false", this.internals.setFormValue(""), this.inputRef?.value && "checked" in this.inputRef.value && (this.inputRef.value.checked = !1), this.valueChecked(this.checked);
551
- else {
552
- this.internals.setFormValue("");
553
- let e = this.defaultValue || (this.multiple || this.range ? [] : "");
554
- this.value = e, this._value = Array.isArray(e) ? e : [e], this.valueChanged(this.value, null);
555
- }
556
- this.internals.ariaInvalid = "false";
557
- }
558
- updated(e) {
559
- super.updated(e), e.has("dataTestid") && this.dataTestid && this.inputRef.value && (this.skipForwardTestid ? this.hasAttribute("data-testid") || this.setAttribute("data-testid", this.dataTestid) : (this.inputRef.value.dataset.testid = this.dataTestid, this.removeAttribute("data-testid")));
560
- }
561
- firstUpdated(e) {
562
- if (super.firstUpdated(e), this.form ||= this.internals.form || this.closest("form"), this.value && this.defaultValue === null && (this.defaultValue = this.value), this.defaultValue !== null && !this.value && this.valueChanged(this.defaultValue, null), this.defaultChecked && (this.internals.ariaChecked = "true", this.checked = !0), this.required && (this.internals.ariaRequired = "true"), this.disabled && (this.internals.ariaDisabled = "true"), this.id && !this.name && (this.name = this.id), this.checked !== void 0) {
563
- let e = this.checked === "" || this.checked === "true" || this.checked === !0;
564
- this.internals.ariaChecked = String(e);
565
- let t = e ? (typeof this.value == "string" ? this.value : "") || s : null;
566
- this.internals.setFormValue(t);
567
- } else this.setFormValue(this.value);
568
- this.inputRef && this.inputRef.value && (this.inputRef.value.setAttribute("form", ""), this.manageValidity(this.inputRef.value)), this.inputRefTo && this.inputRefTo.value && (this.inputRefTo.value.setAttribute("form", ""), this.manageValidity(this.inputRefTo.value));
569
- }
570
- };
571
- e([t({
572
- type: Boolean,
573
- reflect: !0
574
- })], u.prototype, "checked", void 0), e([t({ type: Boolean })], u.prototype, "defaultChecked", void 0), e([t({ type: Boolean })], u.prototype, "multiple", void 0), e([t({ type: Boolean })], u.prototype, "range", void 0), e([t({
575
- type: String,
576
- reflect: !0
577
- })], u.prototype, "type", void 0), e([t()], u.prototype, "defaultValue", void 0), e([t({
578
- type: Boolean,
579
- reflect: !0
580
- })], u.prototype, "disabled", void 0), e([t({
581
- type: Boolean,
582
- reflect: !0
583
- })], u.prototype, "readonly", void 0), e([t({
584
- type: Boolean,
585
- reflect: !0
586
- })], u.prototype, "required", void 0), e([t({
587
- reflect: !0,
588
- converter: {
589
- fromAttribute: (e) => e,
590
- toAttribute: (e) => e?.toString() ?? null
591
- }
592
- })], u.prototype, "max", void 0), e([t({
593
- type: Number,
594
- reflect: !0
595
- })], u.prototype, "maxlength", void 0), e([t({
596
- reflect: !0,
597
- converter: {
598
- fromAttribute: (e) => e,
599
- toAttribute: (e) => e?.toString() ?? null
600
- }
601
- })], u.prototype, "min", void 0), e([t({
602
- type: Number,
603
- reflect: !0
604
- })], u.prototype, "minlength", void 0), e([t({
605
- type: Number,
606
- reflect: !0
607
- })], u.prototype, "step", void 0), e([t({ type: String })], u.prototype, "ariaDescribedBy", void 0), e([t({ type: String })], u.prototype, "ariaLabelledby", void 0), e([t({
608
- type: String,
609
- reflect: !0
610
- })], u.prototype, "name", void 0), e([t({
611
- type: String,
612
- reflect: !0
613
- })], u.prototype, "pattern", void 0), e([t({
614
- type: String,
615
- reflect: !0
616
- })], u.prototype, "placeholder", void 0), e([t({
617
- type: String,
618
- reflect: !0
619
- })], u.prototype, "id", void 0), e([t({ type: Boolean })], u.prototype, "counter", void 0), e([t({ type: Boolean })], u.prototype, "hasError", void 0), e([t({ type: Boolean })], u.prototype, "inline", void 0), e([t({ type: Boolean })], u.prototype, "hasFieldset", void 0), e([t({ type: Boolean })], u.prototype, "optionalTag", void 0), e([t({ type: Boolean })], u.prototype, "requiredTag", void 0), e([t({ type: Boolean })], u.prototype, "skipForwardTestid", void 0), e([t({
620
- type: Boolean,
621
- reflect: !0,
622
- converter: a
623
- })], u.prototype, "useWrapper", void 0), e([t({
624
- type: Boolean,
625
- reflect: !0
626
- })], u.prototype, "fullwidth", void 0), e([t({ type: Number })], u.prototype, "counterMaxLength", void 0), e([t({ type: String })], u.prototype, "errorMessage", void 0), e([t({ type: String })], u.prototype, "helptext", void 0), e([t({ type: String })], u.prototype, "helptextDropdown", void 0), e([t({
627
- type: String,
628
- reflect: !1
629
- })], u.prototype, "helptextDropdownButton", void 0), e([t({ type: String })], u.prototype, "label", void 0), e([t({
630
- type: String,
631
- reflect: !1
632
- })], u.prototype, "optionalText", void 0), e([t({
633
- type: String,
634
- reflect: !1
635
- })], u.prototype, "requiredText", void 0), e([t({
636
- type: String,
637
- reflect: !1
638
- })], u.prototype, "tagText", void 0), e([t({
639
- type: String,
640
- attribute: "data-testid"
641
- })], u.prototype, "dataTestid", void 0);
642
- //#endregion
643
- export { u as t };
@@ -1,17 +0,0 @@
1
- const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./class-map-B8Ja0q7n.cjs`);require(`./icon-Dw6I0HDV.cjs`);const n=require(`./ref-CBdWMlde.cjs`),r=require(`./utils-CjAbIttF.cjs`);var i=`important`,a=` !`+i,o=e.c(class extends e.l{constructor(t){if(super(t),t.type!==e.u.ATTRIBUTE||t.name!==`style`||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce((t,n)=>{let r=e[n];return r==null?t:t+`${n=n.includes(`-`)?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,`-$&`).toLowerCase()}:${r};`},``)}update(t,[n]){let{style:r}=t.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(n)),this.render(n);for(let e of this.ft)n[e]??(this.ft.delete(e),e.includes(`-`)?r.removeProperty(e):r[e]=null);for(let e in n){let t=n[e];if(t!=null){this.ft.add(e);let n=typeof t==`string`&&t.endsWith(a);e.includes(`-`)||n?r.setProperty(e,n?t.slice(0,-11):t,n?i:``):r[e]=t}}return e.f}}),s=class extends e.t{constructor(){super(),this.ariaLabel=null,this.ariaLabelledby=null,this.ariaValueText=null,this.ariaLive=`polite`,this.id=r.n(),this.role=`progressbar`,this.skin=`dark-blue`,this.statusPlacement=`following`,this.statusType=`none`,this.title=``,this.titlePosition=`left`,this.valueCurrent=0,this.valueMax=100,this.valueMin=0,this.labelWidth=0,this.progressbarId=this.id,this.computedAriaLabelledby=null,this.computedAriaValueText=``,this.labelRef=n.t(),this.progressBarRef=n.t()}firstUpdated(e){super.firstUpdated(e),this.setComputedValues(),this.syncAttributes()}updated(e){super.updated(e),e.has(`valueCurrent`)&&this.labelRef.value&&(this.labelWidth=this.labelRef.value.getBoundingClientRect().width||0),e.has(`id`)&&this.id&&(this.progressBarId=this.id),(e.has(`statusType`)||e.has(`id`)||e.has(`ariaLabelledby`))&&(this.progressbarId=this.id||r.n(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`),(e.has(`ariaValueText`)||e.has(`valueCurrent`)||e.has(`valueMax`))&&(this.computedAriaValueText=this.statusType===`fraction`&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||``),this.syncAttributes()}render(){let r=this.statusType!==`none`,i=this.valueMax-this.valueMin,a=this.valueCurrent/i*100,s=this.statusType===`fraction`?Math.round(a):Math.round((this.valueCurrent-this.valueMin)/(this.valueMax-this.valueMin)*100),c=`${this.valueCurrent} av ${i}`,l=t.t({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),u=t.t({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition===`center`}),d=t.t({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement===`center`}),f=t.t({"pkt-progressbar__status-placement--following":this.statusPlacement===`following`,"pkt-progressbar__status-placement--center":this.statusPlacement===`center`,"pkt-progressbar__status-placement--left":this.statusPlacement===`left`});return e.p` <div
2
- class="pkt-progressbar__container"
3
- .ref=${this.progressBarRef}
4
- style=${o({"--pkt-progress-label-width":`${this.labelWidth}px`,"--pkt-progress-width":`${s}%`})}
5
- >
6
- ${this.title?e.p`<p id=${`${this.progressBarId}-title`} class=${u}>${this.title}</p>`:e.d}
7
-
8
- <div class="pkt-progressbar__bar-wrapper">
9
- <div class=${l}></div>
10
- </div>
11
-
12
- ${r?e.p`<div class=${d}>
13
- <span class=${f} ${n.n(this.labelRef)}>
14
- ${this.statusType===`percentage`?`${s}%`:c}
15
- </span>
16
- </div>`:e.d}
17
- </div>`}setComputedValues(){this.progressbarId=this.id||r.n(),this.computedAriaLabelledby=this.ariaLabelledby||`${this.progressbarId}-title`,this.computedAriaValueText=this.statusType===`fraction`&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||``}syncAttributes(){this._handleAttribute(`aria-live`,this.ariaLive),this._handleAttribute(`aria-valuenow`,this.valueCurrent),this._handleAttribute(`aria-valuemin`,this.valueMin),this._handleAttribute(`aria-valuemax`,this.valueMax),this._handleAttribute(`aria-valuetext`,this.computedAriaValueText),this._handleAttribute(`aria-label`,this.ariaLabel),this._handleAttribute(`role`,this.role),this._handleAttribute(`aria-atomic`,`true`),this._handleAttribute(`id`,this.progressbarId),this.ariaLabel||this._handleAttribute(`aria-labelledby`,this.computedAriaLabelledby)}_handleAttribute(e,t){t==null||t===``?this.removeAttribute(e):this.setAttribute(e,String(t))}};e.n([e.o({type:String})],s.prototype,`ariaLabel`,void 0),e.n([e.o({type:String,reflect:!0})],s.prototype,`ariaLabelledby`,void 0),e.n([e.o({type:String,reflect:!0})],s.prototype,`ariaValueText`,void 0),e.n([e.o({type:String})],s.prototype,`ariaLive`,void 0),e.n([e.o({type:String,reflect:!0})],s.prototype,`id`,void 0),e.n([e.o({type:String})],s.prototype,`role`,void 0),e.n([e.o({type:String})],s.prototype,`skin`,void 0),e.n([e.o({type:String})],s.prototype,`statusPlacement`,void 0),e.n([e.o({type:String})],s.prototype,`statusType`,void 0),e.n([e.o({type:String,reflect:!0})],s.prototype,`title`,void 0),e.n([e.o({type:String})],s.prototype,`titlePosition`,void 0),e.n([e.o({type:Number,reflect:!0})],s.prototype,`valueCurrent`,void 0),e.n([e.o({type:Number})],s.prototype,`valueMax`,void 0),e.n([e.o({type:Number})],s.prototype,`valueMin`,void 0),e.n([e.a()],s.prototype,`labelWidth`,void 0),e.n([e.a()],s.prototype,`progressbarId`,void 0),e.n([e.a()],s.prototype,`computedAriaLabelledby`,void 0),e.n([e.a()],s.prototype,`computedAriaValueText`,void 0);try{e.s(`pkt-progressbar`)(s)}catch{console.warn(`Forsøker å definere <pkt-progressbar>, men den er allerede definert`)}var c=s;Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return c}});
@@ -1 +0,0 @@
1
- const e=require(`./element-CXAtr6Gu.cjs`),t=require(`./async-directive-DO1QtVmf.cjs`);var n=()=>new r,r=class{},i=new WeakMap,a=e.c(class extends t.t{render(t){return e.d}update(t,[n]){let r=n!==this.G;return r&&this.G!==void 0&&this.rt(void 0),(r||this.lt!==this.ct)&&(this.G=n,this.ht=t.options?.host,this.rt(this.ct=t.element)),e.d}rt(e){if(this.isConnected||(e=void 0),typeof this.G==`function`){let t=this.ht??globalThis,n=i.get(t);n===void 0&&(n=new WeakMap,i.set(t,n)),n.get(this.G)!==void 0&&this.G.call(this.ht,void 0),n.set(this.G,e),e!==void 0&&this.G.call(this.ht,e)}else this.G.value=e}get lt(){return typeof this.G==`function`?i.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});