@oslokommune/punkt-elements 19.8.0 → 19.9.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 (224) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/accordion-CMCCpxtz.cjs +47 -0
  3. package/dist/{accordion-BJh6X1Ek.js → accordion-Cp2o6wTY.js} +10 -9
  4. package/dist/{alert-WME3geaX.js → alert-CAPiwi4F.js} +5 -5
  5. package/dist/{alert-CKqtC9AM.cjs → alert-QfloIr-o.cjs} +1 -1
  6. package/dist/{async-directive-BGoo_npW.cjs → async-directive-DpyKp6qv.cjs} +1 -1
  7. package/dist/{async-directive-DsdqP_X7.js → async-directive-yh8hG41Q.js} +2 -2
  8. package/dist/{backlink-BRqhwUr2.cjs → backlink-CsFeerTH.cjs} +1 -1
  9. package/dist/{backlink-BslFewn-.js → backlink-ogvv493Y.js} +3 -3
  10. package/dist/base-elements/input-element.d.ts +17 -0
  11. package/dist/base-elements/option-group-element.d.ts +61 -0
  12. package/dist/base-elements/polyfill-form-value.test.d.ts +0 -0
  13. package/dist/{breadcrumbs-Cr3GugPv.js → breadcrumbs-53QVnTFP.js} +2 -2
  14. package/dist/{breadcrumbs-DG4i5UCh.cjs → breadcrumbs-D03id_ha.cjs} +1 -1
  15. package/dist/{button-B78im4wB.js → button-CeRr7oIn.js} +5 -5
  16. package/dist/{button-BNVTj7nB.cjs → button-Dh97H-58.cjs} +1 -1
  17. package/dist/{calendar-TcxvS-1_.cjs → calendar-C5QwPrbk.cjs} +1 -1
  18. package/dist/{calendar-BLaRXUBl.js → calendar-D9w8M99G.js} +3 -3
  19. package/dist/{card-CaLEuumN.cjs → card--NuWdTbG.cjs} +1 -1
  20. package/dist/{card-CYKhPUNI.js → card-_PlgXmgZ.js} +6 -6
  21. package/dist/{checkbox-Tq8ESzwH.js → checkbox-G8k3vg85.js} +39 -35
  22. package/dist/checkbox-QIcdn09A.cjs +40 -0
  23. package/dist/checkbox-group-DoueGGi5.js +50 -0
  24. package/dist/checkbox-group-nLazAkcg.cjs +1 -0
  25. package/dist/checkbox-group.d.ts +1 -0
  26. package/dist/{class-map-C4hdfSfY.js → class-map-Bf-QzUpN.js} +1 -1
  27. package/dist/{class-map-Drv0_anQ.cjs → class-map-Bh6toDeV.cjs} +1 -1
  28. package/dist/{combobox-89Ohd1Oe.cjs → combobox-ClXhKwR9.cjs} +1 -1
  29. package/dist/{combobox-Cpb67TV0.js → combobox-Cz_rq7Mm.js} +13 -13
  30. package/dist/components/checkbox/checkbox.d.ts +1 -0
  31. package/dist/components/checkbox-group/checkbox-group-context.d.ts +5 -0
  32. package/dist/components/checkbox-group/checkbox-group.d.ts +15 -0
  33. package/dist/components/checkbox-group/checkbox-group.test.d.ts +0 -0
  34. package/dist/components/checkbox-group/index.d.ts +3 -0
  35. package/dist/components/index.d.ts +2 -0
  36. package/dist/components/radio-group/index.d.ts +3 -0
  37. package/dist/components/radio-group/radio-group-context.d.ts +7 -0
  38. package/dist/components/radio-group/radio-group.d.ts +14 -0
  39. package/dist/components/radio-group/radio-group.test.d.ts +0 -0
  40. package/dist/components/radiobutton/radiobutton.d.ts +1 -0
  41. package/dist/{consent-CleJMbVH.js → consent-CZMxUavj.js} +2 -2
  42. package/dist/{consent-Dl-R0iC3.cjs → consent-DimzcQxt.cjs} +1 -1
  43. package/dist/consume-Bp12si68.js +61 -0
  44. package/dist/consume-kEjgTrAp.cjs +1 -0
  45. package/dist/{datepicker-DBEKa1aJ.js → datepicker-C7ABsx7H.js} +12 -12
  46. package/dist/{datepicker-B9NCJX4o.cjs → datepicker-usIF9WY7.cjs} +2 -2
  47. package/dist/{directive-helpers-BRrz3Bcj.cjs → directive-helpers-Bv70GjQh.cjs} +1 -1
  48. package/dist/{directive-helpers-D96YEsht.js → directive-helpers-CwxFepWh.js} +1 -1
  49. package/dist/directives/slot-content.d.ts +4 -3
  50. package/dist/docs/components/checkbox-group.d.ts +13 -0
  51. package/dist/docs/components/radio-group.d.ts +13 -0
  52. package/dist/{element-BOmr9YLv.cjs → element-C6WTyJFE.cjs} +1 -1
  53. package/dist/{element-mwwC2Rra.js → element-DBugHPKM.js} +1 -0
  54. package/dist/{element-with-slot-DQv0cbbD.js → element-with-slot-DDLS-aLw.js} +6 -3
  55. package/dist/element-with-slot-DhiAuSjM.cjs +1 -0
  56. package/dist/{fileupload-2YAbjYuU.cjs → fileupload-2uTFjd81.cjs} +1 -1
  57. package/dist/{fileupload-DqWCXMPz.js → fileupload-BR9H6fET.js} +8 -8
  58. package/dist/{footer-DdLls3F-.js → footer-B3DMvo8-.js} +4 -4
  59. package/dist/{footer-vy9NqT65.cjs → footer-CyxRYvT-.cjs} +1 -1
  60. package/dist/{header-Dp0Lq7wS.js → header-BKeSkfB7.js} +11 -11
  61. package/dist/{header-9Y6Q6Cfq.cjs → header-Drj3lTrv.cjs} +1 -1
  62. package/dist/{header-menu-BfkCp8jw.cjs → header-menu-B_5hCNUl.cjs} +1 -1
  63. package/dist/{header-menu-ANj5nL2M.js → header-menu-buYE90FU.js} +4 -4
  64. package/dist/{heading-zoz-QZJ9.cjs → heading-DUYOvlxs.cjs} +1 -1
  65. package/dist/{heading-CUrZvkrM.js → heading-WBB5MO9i.js} +2 -2
  66. package/dist/{helptext-BCkwSz1m.cjs → helptext-C7cyihnu.cjs} +1 -1
  67. package/dist/{helptext-DCT_9dw1.js → helptext-DadLkcoO.js} +4 -4
  68. package/dist/{icon-JigbxxF7.js → icon-Bao96Zb8.js} +1 -1
  69. package/dist/{icon-Dnv6LtPC.cjs → icon-jPhyZD1z.cjs} +1 -1
  70. package/dist/if-defined-CiML3MTM.cjs +1 -0
  71. package/dist/{if-defined-Bebu3LXY.js → if-defined-O59_I-e-.js} +1 -1
  72. package/dist/{input-element-lLzfwdim.js → input-element-BBygBEei.js} +54 -17
  73. package/dist/input-element-C4SelHLD.cjs +1 -0
  74. package/dist/{input-wrapper-CTMf4kCK.cjs → input-wrapper-BT6B3Kco.cjs} +6 -2
  75. package/dist/{input-wrapper-C9K-_7g-.js → input-wrapper-DrSCuw6U.js} +12 -8
  76. package/dist/{link-LO_5_La8.cjs → link-CEP7w1et.cjs} +1 -1
  77. package/dist/{link-CmZwAw5u.js → link-CVnIn74-.js} +4 -4
  78. package/dist/{linkcard-UKsxADrP.cjs → linkcard-D8vitdrQ.cjs} +1 -1
  79. package/dist/{linkcard-CQluSyJJ.js → linkcard-IWiVvRKy.js} +4 -4
  80. package/dist/{listbox-Ct9jIV_5.js → listbox-BDesthOp.js} +4 -4
  81. package/dist/{listbox-g-vHHLkD.cjs → listbox-CvduK_YU.cjs} +1 -1
  82. package/dist/{loader-C_PH05aw.cjs → loader-B0hFoBtF.cjs} +1 -1
  83. package/dist/{loader-DzctJ9jW.js → loader-CAsUPHjl.js} +4 -4
  84. package/dist/{messagebox-D17GYxb9.js → messagebox-6_iNN5F3.js} +4 -4
  85. package/dist/{messagebox-X01V2l_N.cjs → messagebox-C19L2Duq.cjs} +1 -1
  86. package/dist/{modal-BymjMIJi.cjs → modal-CoEPzt4p.cjs} +1 -1
  87. package/dist/{modal-CELmA0-8.js → modal-D7MolBXb.js} +5 -5
  88. package/dist/option-group-element-BIuotbRu.js +135 -0
  89. package/dist/option-group-element-BYS7s-is.cjs +23 -0
  90. package/dist/pkt-accordion.cjs +1 -1
  91. package/dist/pkt-accordion.js +1 -1
  92. package/dist/pkt-alert.cjs +1 -1
  93. package/dist/pkt-alert.js +1 -1
  94. package/dist/pkt-backlink.cjs +1 -1
  95. package/dist/pkt-backlink.js +1 -1
  96. package/dist/pkt-breadcrumbs.cjs +1 -1
  97. package/dist/pkt-breadcrumbs.js +1 -1
  98. package/dist/pkt-button.cjs +1 -1
  99. package/dist/pkt-button.js +1 -1
  100. package/dist/pkt-calendar.cjs +1 -1
  101. package/dist/pkt-calendar.js +1 -1
  102. package/dist/pkt-card.cjs +1 -1
  103. package/dist/pkt-card.js +1 -1
  104. package/dist/pkt-checkbox-group.cjs +1 -0
  105. package/dist/pkt-checkbox-group.js +2 -0
  106. package/dist/pkt-checkbox.cjs +1 -1
  107. package/dist/pkt-checkbox.js +1 -1
  108. package/dist/pkt-combobox.cjs +1 -1
  109. package/dist/pkt-combobox.js +1 -1
  110. package/dist/pkt-consent.cjs +1 -1
  111. package/dist/pkt-consent.js +1 -1
  112. package/dist/pkt-datepicker.cjs +1 -1
  113. package/dist/pkt-datepicker.js +1 -1
  114. package/dist/pkt-fileupload.cjs +1 -1
  115. package/dist/pkt-fileupload.js +1 -1
  116. package/dist/pkt-footer.cjs +1 -1
  117. package/dist/pkt-footer.js +1 -1
  118. package/dist/pkt-header-menu.cjs +1 -1
  119. package/dist/pkt-header-menu.js +1 -1
  120. package/dist/pkt-header.cjs +1 -1
  121. package/dist/pkt-header.js +1 -1
  122. package/dist/pkt-heading.cjs +1 -1
  123. package/dist/pkt-heading.js +1 -1
  124. package/dist/pkt-helptext.cjs +1 -1
  125. package/dist/pkt-helptext.js +1 -1
  126. package/dist/pkt-icon.cjs +1 -1
  127. package/dist/pkt-icon.js +1 -1
  128. package/dist/pkt-index.cjs +1 -1
  129. package/dist/pkt-index.js +37 -35
  130. package/dist/pkt-input-wrapper.cjs +1 -1
  131. package/dist/pkt-input-wrapper.js +1 -1
  132. package/dist/pkt-link.cjs +1 -1
  133. package/dist/pkt-link.js +1 -1
  134. package/dist/pkt-linkcard.cjs +1 -1
  135. package/dist/pkt-linkcard.js +1 -1
  136. package/dist/pkt-listbox.cjs +1 -1
  137. package/dist/pkt-listbox.js +1 -1
  138. package/dist/pkt-loader.cjs +1 -1
  139. package/dist/pkt-loader.js +1 -1
  140. package/dist/pkt-messagebox.cjs +1 -1
  141. package/dist/pkt-messagebox.js +1 -1
  142. package/dist/pkt-modal.cjs +1 -1
  143. package/dist/pkt-modal.js +1 -1
  144. package/dist/{pkt-options-controller-CpEZcomb.cjs → pkt-options-controller-B3vVKnAG.cjs} +1 -1
  145. package/dist/{pkt-options-controller-D7l18Iw0.js → pkt-options-controller-ClFrUWZK.js} +1 -1
  146. package/dist/pkt-progressbar.cjs +1 -1
  147. package/dist/pkt-progressbar.js +1 -1
  148. package/dist/pkt-radio-group.cjs +1 -0
  149. package/dist/pkt-radio-group.js +2 -0
  150. package/dist/pkt-radiobutton.cjs +1 -1
  151. package/dist/pkt-radiobutton.js +1 -1
  152. package/dist/pkt-searchinput.cjs +1 -1
  153. package/dist/pkt-searchinput.js +1 -1
  154. package/dist/pkt-select.cjs +1 -1
  155. package/dist/pkt-select.js +1 -1
  156. package/dist/pkt-tabs.cjs +1 -1
  157. package/dist/pkt-tabs.js +1 -1
  158. package/dist/pkt-tag.cjs +1 -1
  159. package/dist/pkt-tag.js +1 -1
  160. package/dist/pkt-textarea.cjs +1 -1
  161. package/dist/pkt-textarea.js +1 -1
  162. package/dist/pkt-textinput.cjs +1 -1
  163. package/dist/pkt-textinput.js +1 -1
  164. package/dist/pkt-timepicker.cjs +1 -1
  165. package/dist/pkt-timepicker.js +1 -1
  166. package/dist/{progressbar-CIXNSwTy.cjs → progressbar-CnX4fFfR.cjs} +1 -1
  167. package/dist/{progressbar-DH5lIBpx.js → progressbar-DZHiq7B0.js} +5 -5
  168. package/dist/provide-Cz18sYug.cjs +1 -0
  169. package/dist/provide-_MnlMGnw.js +111 -0
  170. package/dist/radio-group-kOzlGn8T.cjs +1 -0
  171. package/dist/radio-group-lhymYEZX.js +52 -0
  172. package/dist/radio-group.d.ts +1 -0
  173. package/dist/radiobutton-BgHCcDJv.cjs +38 -0
  174. package/dist/{radiobutton-l_3oGDbb.js → radiobutton-CFd8TgV9.js} +39 -35
  175. package/dist/{ref-Emu5PNxk.cjs → ref-CB7e9nMY.cjs} +1 -1
  176. package/dist/{ref-CCSGk4MP.js → ref-y_5qv9vU.js} +2 -2
  177. package/dist/{repeat-CdxGS-_3.js → repeat-CV9S4zya.js} +2 -2
  178. package/dist/{repeat-Dh9YKoeV.cjs → repeat-CnnigVcj.cjs} +1 -1
  179. package/dist/{searchinput-Co8tcq-l.js → searchinput-Bkcr3Fby.js} +4 -4
  180. package/dist/{searchinput-CbClDE-d.cjs → searchinput-Mdc9Ihld.cjs} +1 -1
  181. package/dist/{select-Cz80KV3g.js → select-B6CN2Ymq.js} +7 -7
  182. package/dist/{select-CZk57p1_.cjs → select-BowvpCNa.cjs} +1 -1
  183. package/dist/shared-strings/nb.d.ts +1 -0
  184. package/dist/shared-types/index.d.ts +4 -2
  185. package/dist/shared-types/option-group.d.ts +50 -0
  186. package/dist/{tabs-B8blHQrL.js → tabs-DZvtVA0y.js} +9 -8
  187. package/dist/tabs-Dm8xcPRs.cjs +40 -0
  188. package/dist/{tag-Bns7Xj1O.js → tag-C33BPIOm.js} +5 -5
  189. package/dist/{tag-B5dUg7AD.cjs → tag-DyVZrqOQ.cjs} +1 -1
  190. package/dist/tests/component-registry.d.ts +4 -0
  191. package/dist/tests/option-contexts.d.ts +7 -0
  192. package/dist/{textarea-Dwjx-Crl.cjs → textarea-DoH3Il8v.cjs} +1 -1
  193. package/dist/{textarea-Dfvx1I60.js → textarea-hW0kV5gj.js} +9 -9
  194. package/dist/{textinput-7zTPlXVj.js → textinput-B6G4dVuL.js} +8 -8
  195. package/dist/{textinput-BeraGRzb.cjs → textinput-CQknclmV.cjs} +1 -1
  196. package/dist/{timepicker-C0dSH4Ij.js → timepicker-Cd2QI6ua.js} +8 -8
  197. package/dist/{timepicker-DarB9eA6.cjs → timepicker-DB3gor6g.cjs} +1 -1
  198. package/package.json +2 -2
  199. package/src/components/checkbox/checkbox.test.ts +99 -0
  200. package/src/components/checkbox/checkbox.ts +14 -5
  201. package/src/components/checkbox-group/checkbox-group-context.ts +8 -0
  202. package/src/components/checkbox-group/checkbox-group.test.ts +406 -0
  203. package/src/components/checkbox-group/checkbox-group.ts +69 -0
  204. package/src/components/checkbox-group/index.ts +4 -0
  205. package/src/components/combobox/combobox.ts +1 -1
  206. package/src/components/datepicker/datepicker.ts +1 -1
  207. package/src/components/index.ts +2 -0
  208. package/src/components/input-wrapper/input-wrapper.ts +5 -1
  209. package/src/components/input-wrapper/wrapper-parity.test.ts +27 -2
  210. package/src/components/radio-group/index.ts +4 -0
  211. package/src/components/radio-group/radio-group-context.ts +8 -0
  212. package/src/components/radio-group/radio-group.test.ts +530 -0
  213. package/src/components/radio-group/radio-group.ts +65 -0
  214. package/src/components/radiobutton/radiobutton.test.ts +95 -0
  215. package/src/components/radiobutton/radiobutton.ts +11 -5
  216. package/dist/accordion-5lSFQToJ.cjs +0 -47
  217. package/dist/checkbox-D69leWDh.cjs +0 -40
  218. package/dist/consume-BDnMAp2g.js +0 -167
  219. package/dist/consume-Le4HztPo.cjs +0 -1
  220. package/dist/element-with-slot-D7sTqOr3.cjs +0 -1
  221. package/dist/if-defined-2mkIDgOm.cjs +0 -1
  222. package/dist/input-element-CSfDGslx.cjs +0 -1
  223. package/dist/radiobutton-BPr22VmL.cjs +0 -38
  224. package/dist/tabs-CjX-GWvM.cjs +0 -40
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./select-Cz80KV3g.js";
1
+ import { n as e, t } from "./select-B6CN2Ymq.js";
2
2
  export { e as PktSelect, t as default };
package/dist/pkt-tabs.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./tabs-CjX-GWvM.cjs");exports.PktTabItem=e.n,exports.PktTabs=e.r,exports.default=e.t;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./tabs-Dm8xcPRs.cjs");exports.PktTabItem=e.n,exports.PktTabs=e.r,exports.default=e.t;
package/dist/pkt-tabs.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as e, r as t, t as n } from "./tabs-B8blHQrL.js";
1
+ import { n as e, r as t, t as n } from "./tabs-DZvtVA0y.js";
2
2
  export { e as PktTabItem, t as PktTabs, n as default };
package/dist/pkt-tag.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./tag-B5dUg7AD.cjs");exports.PktTag=e.n,exports.default=e.t;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./tag-DyVZrqOQ.cjs");exports.PktTag=e.n,exports.default=e.t;
package/dist/pkt-tag.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./tag-Bns7Xj1O.js";
1
+ import { n as e, t } from "./tag-C33BPIOm.js";
2
2
  export { e as PktTag, t as default };
@@ -1 +1 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./textarea-Dwjx-Crl.cjs");exports.PktTextarea=e.n,exports.default=e.t;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./textarea-DoH3Il8v.cjs");exports.PktTextarea=e.n,exports.default=e.t;
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./textarea-Dfvx1I60.js";
1
+ import { n as e, t } from "./textarea-hW0kV5gj.js";
2
2
  export { e as PktTextarea, t as default };
@@ -1 +1 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./textinput-BeraGRzb.cjs");exports.PktTextinput=e.n,exports.default=e.t;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./textinput-CQknclmV.cjs");exports.PktTextinput=e.n,exports.default=e.t;
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./textinput-7zTPlXVj.js";
1
+ import { n as e, t } from "./textinput-B6G4dVuL.js";
2
2
  export { e as PktTextinput, t as default };
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./timepicker-DarB9eA6.cjs");exports.PktTimepicker=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./timepicker-DB3gor6g.cjs");exports.PktTimepicker=e.t;
@@ -1,2 +1,2 @@
1
- import { t as e } from "./timepicker-C0dSH4Ij.js";
1
+ import { t as e } from "./timepicker-Cd2QI6ua.js";
2
2
  export { e as PktTimepicker };
@@ -1,4 +1,4 @@
1
- const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs");require("./icon-Dnv6LtPC.cjs");const n=require("./if-defined-2mkIDgOm.cjs"),r=require("./ref-Emu5PNxk.cjs"),i=require("./utils-63cRpWut.cjs");var a=`important`,o=` !`+a,s=e.f(class extends e.p{constructor(t){if(super(t),t.type!==e.m.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(o);e.includes(`-`)||n?r.setProperty(e,n?t.slice(0,-11):t,n?a:``):r[e]=t}}return e.g}}),c=class extends e.t{constructor(){super(),this.ariaLabel=null,this.ariaLabelledby=null,this.ariaValueText=null,this.ariaLive=`polite`,this.id=i.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.resolvedRole=`progressbar`,this.labelRef=r.t(),this.progressBarRef=r.t()}willUpdate(e){super.willUpdate(e),this.id&&(this.progressbarId=this.id);let t=this.getAttribute(`role`);t?(this.resolvedRole=t,this.removeAttribute(`role`)):this.role&&(this.resolvedRole=this.role)}updated(e){super.updated(e),e.has(`valueCurrent`)&&this.labelRef.value&&(this.labelWidth=this.labelRef.value.getBoundingClientRect().width||0)}render(){let i=this.statusType!==`none`,a=this.valueMax-this.valueMin,o=this.valueCurrent/a*100,c=this.statusType===`fraction`?Math.round(o):Math.round((this.valueCurrent-this.valueMin)/(this.valueMax-this.valueMin)*100),l=`${this.valueCurrent} av ${a}`,u=this.statusType===`fraction`&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||``,d=this.ariaLabel?void 0:this.ariaLabelledby||`${this.progressbarId}-title`,f=t.t({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),p=t.t({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition===`center`}),m=t.t({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement===`center`}),h=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._`<div
1
+ const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs");require("./icon-jPhyZD1z.cjs");const n=require("./if-defined-CiML3MTM.cjs"),r=require("./ref-CB7e9nMY.cjs"),i=require("./utils-63cRpWut.cjs");var a=`important`,o=` !`+a,s=e.f(class extends e.p{constructor(t){if(super(t),t.type!==e.m.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(o);e.includes(`-`)||n?r.setProperty(e,n?t.slice(0,-11):t,n?a:``):r[e]=t}}return e.g}}),c=class extends e.t{constructor(){super(),this.ariaLabel=null,this.ariaLabelledby=null,this.ariaValueText=null,this.ariaLive=`polite`,this.id=i.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.resolvedRole=`progressbar`,this.labelRef=r.t(),this.progressBarRef=r.t()}willUpdate(e){super.willUpdate(e),this.id&&(this.progressbarId=this.id);let t=this.getAttribute(`role`);t?(this.resolvedRole=t,this.removeAttribute(`role`)):this.role&&(this.resolvedRole=this.role)}updated(e){super.updated(e),e.has(`valueCurrent`)&&this.labelRef.value&&(this.labelWidth=this.labelRef.value.getBoundingClientRect().width||0)}render(){let i=this.statusType!==`none`,a=this.valueMax-this.valueMin,o=this.valueCurrent/a*100,c=this.statusType===`fraction`?Math.round(o):Math.round((this.valueCurrent-this.valueMin)/(this.valueMax-this.valueMin)*100),l=`${this.valueCurrent} av ${a}`,u=this.statusType===`fraction`&&!this.ariaValueText?`${this.valueCurrent} av ${this.valueMax-this.valueMin}`:this.ariaValueText||``,d=this.ariaLabel?void 0:this.ariaLabelledby||`${this.progressbarId}-title`,f=t.t({"pkt-progressbar__bar":!0,[`pkt-progressbar__bar--${this.skin}`]:!!this.skin}),p=t.t({"pkt-progressbar__title":!0,"pkt-progressbar__title-center":this.titlePosition===`center`}),m=t.t({"pkt-progressbar__status":!0,"pkt-progressbar__status--center":this.statusPlacement===`center`}),h=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._`<div
2
2
  ${r.n(this.progressBarRef)}
3
3
  role=${this.resolvedRole}
4
4
  aria-live=${n.t(this.ariaLive||void 0)}
@@ -1,8 +1,8 @@
1
- import { _ as e, d as t, f as n, g as r, h as i, l as a, m as o, n as s, p as c, t as l, u } from "./element-mwwC2Rra.js";
2
- import { t as d } from "./class-map-C4hdfSfY.js";
3
- import "./icon-JigbxxF7.js";
4
- import { t as f } from "./if-defined-Bebu3LXY.js";
5
- import { n as p, t as m } from "./ref-CCSGk4MP.js";
1
+ import { _ as e, d as t, f as n, g as r, h as i, l as a, m as o, n as s, p as c, t as l, u } from "./element-DBugHPKM.js";
2
+ import { t as d } from "./class-map-Bf-QzUpN.js";
3
+ import "./icon-Bao96Zb8.js";
4
+ import { t as f } from "./if-defined-O59_I-e-.js";
5
+ import { n as p, t as m } from "./ref-y_5qv9vU.js";
6
6
  import { n as h } from "./utils-BwF4QSrq.js";
7
7
  //#region ../../node_modules/lit-html/directives/style-map.js
8
8
  var g = "important", _ = " !" + g, v = n(class extends c {
@@ -0,0 +1 @@
1
+ const e=require("./consume-kEjgTrAp.cjs");var t=class{get value(){return this.o}set value(e){this.setValue(e)}setValue(e,t=!1){let n=t||!Object.is(e,this.o);this.o=e,n&&this.updateObservers()}constructor(e){this.subscriptions=new Map,this.updateObservers=()=>{for(let[e,{disposer:t}]of this.subscriptions)e(this.o,t)},e!==void 0&&(this.value=e)}addCallback(e,t,n){if(!n)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:()=>{this.subscriptions.delete(e)},consumerHost:t});let{disposer:r}=this.subscriptions.get(e);e(this.value,r)}clearCallbacks(){this.subscriptions.clear()}},n=class extends Event{constructor(e,t){super(`context-provider`,{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t}},r=class extends t{constructor(t,n,r){super(n.context===void 0?r:n.initialValue),this.onContextRequest=e=>{if(e.context!==this.context)return;let t=e.contextTarget??e.composedPath()[0];t!==this.host&&(e.stopPropagation(),this.addCallback(e.callback,t,e.subscribe))},this.onProviderRequest=t=>{if(t.context!==this.context||(t.contextTarget??t.composedPath()[0])===this.host)return;let n=new Set;for(let[t,{consumerHost:r}]of this.subscriptions)n.has(t)||(n.add(t),r.dispatchEvent(new e.r(this.context,r,t,!0)));t.stopPropagation()},this.host=t,this.context=n.context===void 0?n:n.context,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener(`context-request`,this.onContextRequest),this.host.addEventListener(`context-provider`,this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new n(this.context,this.host))}};function i({context:e}){return(t,n)=>{let i=new WeakMap;if(typeof n==`object`)return{get(){return t.get.call(this)},set(e){return i.get(this).setValue(e),t.set.call(this,e)},init(t){return i.set(this,new r(this,{context:e,initialValue:t})),t}};{t.constructor.addInitializer((t=>{i.set(t,new r(t,{context:e}))}));let a=Object.getOwnPropertyDescriptor(t,n),o;if(a===void 0){let e=new WeakMap;o={get(){return e.get(this)},set(t){i.get(this).setValue(t),e.set(this,t)},configurable:!0,enumerable:!0}}else{let e=a.set;o={...a,set(t){i.get(this).setValue(t),e?.call(this,t)}}}Object.defineProperty(t,n,o);return}}}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
@@ -0,0 +1,111 @@
1
+ import { r as e } from "./consume-Bp12si68.js";
2
+ //#region ../../node_modules/@lit/context/lib/value-notifier.js
3
+ var t = class {
4
+ get value() {
5
+ return this.o;
6
+ }
7
+ set value(e) {
8
+ this.setValue(e);
9
+ }
10
+ setValue(e, t = !1) {
11
+ let n = t || !Object.is(e, this.o);
12
+ this.o = e, n && this.updateObservers();
13
+ }
14
+ constructor(e) {
15
+ this.subscriptions = /* @__PURE__ */ new Map(), this.updateObservers = () => {
16
+ for (let [e, { disposer: t }] of this.subscriptions) e(this.o, t);
17
+ }, e !== void 0 && (this.value = e);
18
+ }
19
+ addCallback(e, t, n) {
20
+ if (!n) return void e(this.value);
21
+ this.subscriptions.has(e) || this.subscriptions.set(e, {
22
+ disposer: () => {
23
+ this.subscriptions.delete(e);
24
+ },
25
+ consumerHost: t
26
+ });
27
+ let { disposer: r } = this.subscriptions.get(e);
28
+ e(this.value, r);
29
+ }
30
+ clearCallbacks() {
31
+ this.subscriptions.clear();
32
+ }
33
+ }, n = class extends Event {
34
+ constructor(e, t) {
35
+ super("context-provider", {
36
+ bubbles: !0,
37
+ composed: !0
38
+ }), this.context = e, this.contextTarget = t;
39
+ }
40
+ }, r = class extends t {
41
+ constructor(t, n, r) {
42
+ super(n.context === void 0 ? r : n.initialValue), this.onContextRequest = (e) => {
43
+ if (e.context !== this.context) return;
44
+ let t = e.contextTarget ?? e.composedPath()[0];
45
+ t !== this.host && (e.stopPropagation(), this.addCallback(e.callback, t, e.subscribe));
46
+ }, this.onProviderRequest = (t) => {
47
+ if (t.context !== this.context || (t.contextTarget ?? t.composedPath()[0]) === this.host) return;
48
+ let n = /* @__PURE__ */ new Set();
49
+ for (let [t, { consumerHost: r }] of this.subscriptions) n.has(t) || (n.add(t), r.dispatchEvent(new e(this.context, r, t, !0)));
50
+ t.stopPropagation();
51
+ }, this.host = t, this.context = n.context === void 0 ? n : n.context, this.attachListeners(), this.host.addController?.(this);
52
+ }
53
+ attachListeners() {
54
+ this.host.addEventListener("context-request", this.onContextRequest), this.host.addEventListener("context-provider", this.onProviderRequest);
55
+ }
56
+ hostConnected() {
57
+ this.host.dispatchEvent(new n(this.context, this.host));
58
+ }
59
+ };
60
+ //#endregion
61
+ //#region ../../node_modules/@lit/context/lib/decorators/provide.js
62
+ function i({ context: e }) {
63
+ return (t, n) => {
64
+ let i = /* @__PURE__ */ new WeakMap();
65
+ if (typeof n == "object") return {
66
+ get() {
67
+ return t.get.call(this);
68
+ },
69
+ set(e) {
70
+ return i.get(this).setValue(e), t.set.call(this, e);
71
+ },
72
+ init(t) {
73
+ return i.set(this, new r(this, {
74
+ context: e,
75
+ initialValue: t
76
+ })), t;
77
+ }
78
+ };
79
+ {
80
+ t.constructor.addInitializer(((t) => {
81
+ i.set(t, new r(t, { context: e }));
82
+ }));
83
+ let a = Object.getOwnPropertyDescriptor(t, n), o;
84
+ if (a === void 0) {
85
+ let e = /* @__PURE__ */ new WeakMap();
86
+ o = {
87
+ get() {
88
+ return e.get(this);
89
+ },
90
+ set(t) {
91
+ i.get(this).setValue(t), e.set(this, t);
92
+ },
93
+ configurable: !0,
94
+ enumerable: !0
95
+ };
96
+ } else {
97
+ let e = a.set;
98
+ o = {
99
+ ...a,
100
+ set(t) {
101
+ i.get(this).setValue(t), e?.call(this, t);
102
+ }
103
+ };
104
+ }
105
+ Object.defineProperty(t, n, o);
106
+ return;
107
+ }
108
+ };
109
+ }
110
+ //#endregion
111
+ export { i as t };
@@ -0,0 +1 @@
1
+ const e=require("./element-C6WTyJFE.cjs"),t=require("./option-group-element-BYS7s-is.cjs"),n=require("./provide-Cz18sYug.cjs"),r=require("./radiobutton-BgHCcDJv.cjs");var i=class extends t.t{constructor(...e){super(...e),this.optionSelector=`pkt-radiobutton`,this.groupContext={name:``,hasTile:!1,hasError:!1,required:!1},this.storedValue=null}get value(){let e=this.options().find(t.n);return e?t.i(e):``}set value(e){let t=this.value;this.storedValue=e??``,this.applyStoredValue(this.options()),this.requestUpdate(`value`,t)}get hasStoredValue(){return this.storedValue!==null}storeCurrentValue(){this.storedValue=this.value}applyStoredValue(e){e.forEach(e=>{let n=this.storedValue!==``&&t.i(e)===this.storedValue;t.n(e)!==n&&(e.checked=n)})}createGroupContext(){return{...super.createGroupContext(),required:this.required}}};e.n([n.t({context:r.r}),e.l()],i.prototype,`groupContext`,void 0),e.n([e.u({type:String})],i.prototype,`value`,null);try{e.d(`pkt-radio-group`)(i)}catch{console.warn(`Forsøker å definere <pkt-radio-group>, men den er allerede definert`)}var a=i;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
@@ -0,0 +1,52 @@
1
+ import { d as e, l as t, n, u as r } from "./element-DBugHPKM.js";
2
+ import { i, n as a, t as o } from "./option-group-element-BIuotbRu.js";
3
+ import { t as s } from "./provide-_MnlMGnw.js";
4
+ import { r as c } from "./radiobutton-CFd8TgV9.js";
5
+ //#region src/components/radio-group/radio-group.ts
6
+ var l = class extends o {
7
+ constructor(...e) {
8
+ super(...e), this.optionSelector = "pkt-radiobutton", this.groupContext = {
9
+ name: "",
10
+ hasTile: !1,
11
+ hasError: !1,
12
+ required: !1
13
+ }, this.storedValue = null;
14
+ }
15
+ get value() {
16
+ let e = this.options().find(a);
17
+ return e ? i(e) : "";
18
+ }
19
+ set value(e) {
20
+ let t = this.value;
21
+ this.storedValue = e ?? "", this.applyStoredValue(this.options()), this.requestUpdate("value", t);
22
+ }
23
+ get hasStoredValue() {
24
+ return this.storedValue !== null;
25
+ }
26
+ storeCurrentValue() {
27
+ this.storedValue = this.value;
28
+ }
29
+ applyStoredValue(e) {
30
+ e.forEach((e) => {
31
+ let t = this.storedValue !== "" && i(e) === this.storedValue;
32
+ a(e) !== t && (e.checked = t);
33
+ });
34
+ }
35
+ createGroupContext() {
36
+ return {
37
+ ...super.createGroupContext(),
38
+ required: this.required
39
+ };
40
+ }
41
+ };
42
+ n([s({ context: c }), t()], l.prototype, "groupContext", void 0), n([r({ type: String })], l.prototype, "value", null);
43
+ try {
44
+ e("pkt-radio-group")(l);
45
+ } catch {
46
+ console.warn("Forsøker å definere <pkt-radio-group>, men den er allerede definert");
47
+ }
48
+ //#endregion
49
+ //#region src/components/radio-group/index.ts
50
+ var u = l;
51
+ //#endregion
52
+ export { l as n, u as t };
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1,38 @@
1
+ const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./consume-kEjgTrAp.cjs"),r=require("./ref-CB7e9nMY.cjs"),i=require("./input-element-C4SelHLD.cjs");var a=n.n(Symbol(`pkt-radio-group-context`)),o=class extends i.t{constructor(...e){super(...e),this.inputRef=r.t(),this.value=``,this.checkHelptext=null,this.defaultChecked=!1,this.hasTile=!1,this.checked=null,this.type=`radio`,this.inputSize=void 0,this.tagText=null,this.optionalTag=!1,this.requiredTag=!1,this._checked=!1}connectedCallback(){super.connectedCallback()}attributeChangedCallback(e,t,n){e===`checked`&&(this._checked=this.checked===``||this.checked===`true`||this.checked===!0),super.attributeChangedCallback(e,t,n)}render(){let n=this.hasTile||!!this.groupContext?.hasTile,i=t.t({"pkt-input-check__input":!0,"pkt-input-check__input--tile":n,"pkt-input-check__input--tile-disabled":this.isDisabled&&n}),a=t.t({"pkt-input-check__input-checkbox":!0,"pkt-input-check__input-checkbox--error":this.hasError||!!this.groupContext?.hasError}),o=t.t({"pkt-input-check__input-label":!0,"pkt-input-check__input-label--disabled":this.isDisabled,"pkt-sr-only":this.hideLabel}),s=`pkt-tag pkt-tag--small pkt-tag--thin-text`,c=this.pktStrings.get(`forms`),l=()=>e._`
2
+ ${this.tagText?e._`<span class=${s+` pkt-tag--gray`}>${this.tagText}</span>`:e.h}
3
+ ${this.optionalTag?e._`<span class=${s+` pkt-tag--blue-light`}
4
+ >${this.optionalText??c.optional}</span
5
+ >`:e.h}
6
+ ${this.requiredTag?e._`<span class=${s+` pkt-tag--beige`}
7
+ >${this.requiredText??c.required}</span
8
+ >`:e.h}
9
+ `,u=this.id+`-check-label`,d=this.id+`-check-helptext`;return e._`
10
+ <div class="pkt-input-check${this.inputSize?` pkt-input-check--${this.inputSize}`:``}">
11
+ <div class=${i}>
12
+ <input
13
+ id=${this.id+`-internal`}
14
+ class=${a}
15
+ type="radio"
16
+ ?disabled=${this.isDisabled}
17
+ form=""
18
+ name=${this.internalName}
19
+ ${r.n(this.inputRef)}
20
+ @change=${this.toggleChecked}
21
+ @input=${this.handleInput}
22
+ @blur=${this.onBlur}
23
+ @focus=${this.onFocus}
24
+ ?checked=${this.checked}
25
+ aria-labelledby=${this.label?u:e.h}
26
+ aria-describedby=${this.checkHelptext?d:e.h}
27
+ />
28
+ ${e._`
29
+ <label class=${o} for=${this.id+`-internal`}>
30
+ <span id=${u}>${this.label} ${l()}</span>
31
+ ${this.checkHelptext?e._`<div id=${d} class="pkt-input-check__input-helptext">
32
+ ${this.checkHelptext}
33
+ </div>`:e.h}
34
+ </label>
35
+ `}
36
+ </div>
37
+ </div>
38
+ `}handleInput(e){e.stopImmediatePropagation()}toggleChecked(e=null){e&&e.preventDefault(),e&&e.stopImmediatePropagation(),this.touched=!0,this.inputRef.value&&(this._checked=this.inputRef.value.matches(`:checked`),this.valueChecked(this._checked))}};e.n([e.u({type:String,reflect:!0})],o.prototype,`value`,void 0),e.n([e.u({type:String})],o.prototype,`checkHelptext`,void 0),e.n([e.u({type:Boolean})],o.prototype,`defaultChecked`,void 0),e.n([e.u({type:Boolean})],o.prototype,`hasTile`,void 0),e.n([e.u({type:Boolean,reflect:!0})],o.prototype,`checked`,void 0),e.n([e.u({type:String,reflect:!0})],o.prototype,`type`,void 0),e.n([e.u({type:String,attribute:`input-size`})],o.prototype,`inputSize`,void 0),e.n([e.u({type:String})],o.prototype,`tagText`,void 0),e.n([e.u({type:Boolean})],o.prototype,`optionalTag`,void 0),e.n([e.u({type:String})],o.prototype,`optionalText`,void 0),e.n([e.u({type:Boolean})],o.prototype,`requiredTag`,void 0),e.n([e.u({type:String})],o.prototype,`requiredText`,void 0),e.n([e.l()],o.prototype,`_checked`,void 0),e.n([n.t({context:a,subscribe:!0}),e.l()],o.prototype,`groupContext`,void 0);try{e.d(`pkt-radiobutton`)(o)}catch{console.warn(`Forsøker å definere <pkt-radiobutton>, men den er allerede definert`)}var s=o;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}});
@@ -1,11 +1,12 @@
1
- import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-mwwC2Rra.js";
2
- import { t as o } from "./class-map-C4hdfSfY.js";
3
- import { n as s, t as c } from "./ref-CCSGk4MP.js";
4
- import { t as l } from "./input-element-lLzfwdim.js";
5
- //#region src/components/radiobutton/radiobutton.ts
6
- var u = class extends l {
1
+ import { _ as e, d as t, h as n, l as r, n as i, u as a } from "./element-DBugHPKM.js";
2
+ import { t as o } from "./class-map-Bf-QzUpN.js";
3
+ import { n as s, t as c } from "./consume-Bp12si68.js";
4
+ import { n as l, t as u } from "./ref-y_5qv9vU.js";
5
+ import { t as d } from "./input-element-BBygBEei.js";
6
+ //#region src/components/radio-group/radio-group-context.ts
7
+ var f = s(Symbol("pkt-radio-group-context")), p = class extends d {
7
8
  constructor(...e) {
8
- super(...e), this.inputRef = c(), this.value = "", this.checkHelptext = null, this.defaultChecked = !1, this.hasTile = !1, this.checked = null, this.type = "radio", this.inputSize = void 0, this.tagText = null, this.optionalTag = !1, this.requiredTag = !1, this._checked = !1;
9
+ super(...e), this.inputRef = u(), this.value = "", this.checkHelptext = null, this.defaultChecked = !1, this.hasTile = !1, this.checked = null, this.type = "radio", this.inputSize = void 0, this.tagText = null, this.optionalTag = !1, this.requiredTag = !1, this._checked = !1;
9
10
  }
10
11
  connectedCallback() {
11
12
  super.connectedCallback();
@@ -14,49 +15,49 @@ var u = class extends l {
14
15
  e === "checked" && (this._checked = this.checked === "" || this.checked === "true" || this.checked === !0), super.attributeChangedCallback(e, t, n);
15
16
  }
16
17
  render() {
17
- let t = o({
18
+ let t = this.hasTile || !!this.groupContext?.hasTile, r = o({
18
19
  "pkt-input-check__input": !0,
19
- "pkt-input-check__input--tile": this.hasTile,
20
- "pkt-input-check__input--tile-disabled": this.isDisabled && this.hasTile
21
- }), r = o({
22
- "pkt-input-check__input-checkbox": !0,
23
- "pkt-input-check__input-checkbox--error": this.hasError
20
+ "pkt-input-check__input--tile": t,
21
+ "pkt-input-check__input--tile-disabled": this.isDisabled && t
24
22
  }), i = o({
23
+ "pkt-input-check__input-checkbox": !0,
24
+ "pkt-input-check__input-checkbox--error": this.hasError || !!this.groupContext?.hasError
25
+ }), a = o({
25
26
  "pkt-input-check__input-label": !0,
26
27
  "pkt-input-check__input-label--disabled": this.isDisabled,
27
28
  "pkt-sr-only": this.hideLabel
28
- }), a = "pkt-tag pkt-tag--small pkt-tag--thin-text", c = this.pktStrings.get("forms"), l = () => e`
29
- ${this.tagText ? e`<span class=${a + " pkt-tag--gray"}>${this.tagText}</span>` : n}
30
- ${this.optionalTag ? e`<span class=${a + " pkt-tag--blue-light"}
29
+ }), s = "pkt-tag pkt-tag--small pkt-tag--thin-text", c = this.pktStrings.get("forms"), u = () => e`
30
+ ${this.tagText ? e`<span class=${s + " pkt-tag--gray"}>${this.tagText}</span>` : n}
31
+ ${this.optionalTag ? e`<span class=${s + " pkt-tag--blue-light"}
31
32
  >${this.optionalText ?? c.optional}</span
32
33
  >` : n}
33
- ${this.requiredTag ? e`<span class=${a + " pkt-tag--beige"}
34
+ ${this.requiredTag ? e`<span class=${s + " pkt-tag--beige"}
34
35
  >${this.requiredText ?? c.required}</span
35
36
  >` : n}
36
- `, u = this.id + "-check-label", d = this.id + "-check-helptext";
37
+ `, d = this.id + "-check-label", f = this.id + "-check-helptext";
37
38
  return e`
38
39
  <div class="pkt-input-check${this.inputSize ? ` pkt-input-check--${this.inputSize}` : ""}">
39
- <div class=${t}>
40
+ <div class=${r}>
40
41
  <input
41
42
  id=${this.id + "-internal"}
42
- class=${r}
43
+ class=${i}
43
44
  type="radio"
44
45
  ?disabled=${this.isDisabled}
45
46
  form=""
46
- name=${this.name + "-internal"}
47
- ${s(this.inputRef)}
47
+ name=${this.internalName}
48
+ ${l(this.inputRef)}
48
49
  @change=${this.toggleChecked}
49
50
  @input=${this.handleInput}
50
51
  @blur=${this.onBlur}
51
52
  @focus=${this.onFocus}
52
53
  ?checked=${this.checked}
53
- aria-labelledby=${this.label ? u : n}
54
- aria-describedby=${this.checkHelptext ? d : n}
54
+ aria-labelledby=${this.label ? d : n}
55
+ aria-describedby=${this.checkHelptext ? f : n}
55
56
  />
56
57
  ${e`
57
- <label class=${i} for=${this.id + "-internal"}>
58
- <span id=${u}>${this.label} ${l()}</span>
59
- ${this.checkHelptext ? e`<div id=${d} class="pkt-input-check__input-helptext">
58
+ <label class=${a} for=${this.id + "-internal"}>
59
+ <span id=${d}>${this.label} ${u()}</span>
60
+ ${this.checkHelptext ? e`<div id=${f} class="pkt-input-check__input-helptext">
60
61
  ${this.checkHelptext}
61
62
  </div>` : n}
62
63
  </label>
@@ -66,7 +67,7 @@ var u = class extends l {
66
67
  `;
67
68
  }
68
69
  handleInput(e) {
69
- e.stopImmediatePropagation(), this.onInput();
70
+ e.stopImmediatePropagation();
70
71
  }
71
72
  toggleChecked(e = null) {
72
73
  e && e.preventDefault(), e && e.stopImmediatePropagation(), this.touched = !0, this.inputRef.value && (this._checked = this.inputRef.value.matches(":checked"), this.valueChecked(this._checked));
@@ -75,23 +76,26 @@ var u = class extends l {
75
76
  i([a({
76
77
  type: String,
77
78
  reflect: !0
78
- })], u.prototype, "value", void 0), i([a({ type: String })], u.prototype, "checkHelptext", void 0), i([a({ type: Boolean })], u.prototype, "defaultChecked", void 0), i([a({ type: Boolean })], u.prototype, "hasTile", void 0), i([a({
79
+ })], p.prototype, "value", void 0), i([a({ type: String })], p.prototype, "checkHelptext", void 0), i([a({ type: Boolean })], p.prototype, "defaultChecked", void 0), i([a({ type: Boolean })], p.prototype, "hasTile", void 0), i([a({
79
80
  type: Boolean,
80
81
  reflect: !0
81
- })], u.prototype, "checked", void 0), i([a({
82
+ })], p.prototype, "checked", void 0), i([a({
82
83
  type: String,
83
84
  reflect: !0
84
- })], u.prototype, "type", void 0), i([a({
85
+ })], p.prototype, "type", void 0), i([a({
85
86
  type: String,
86
87
  attribute: "input-size"
87
- })], u.prototype, "inputSize", void 0), i([a({ type: String })], u.prototype, "tagText", void 0), i([a({ type: Boolean })], u.prototype, "optionalTag", void 0), i([a({ type: String })], u.prototype, "optionalText", void 0), i([a({ type: Boolean })], u.prototype, "requiredTag", void 0), i([a({ type: String })], u.prototype, "requiredText", void 0), i([r()], u.prototype, "_checked", void 0);
88
+ })], p.prototype, "inputSize", void 0), i([a({ type: String })], p.prototype, "tagText", void 0), i([a({ type: Boolean })], p.prototype, "optionalTag", void 0), i([a({ type: String })], p.prototype, "optionalText", void 0), i([a({ type: Boolean })], p.prototype, "requiredTag", void 0), i([a({ type: String })], p.prototype, "requiredText", void 0), i([r()], p.prototype, "_checked", void 0), i([c({
89
+ context: f,
90
+ subscribe: !0
91
+ }), r()], p.prototype, "groupContext", void 0);
88
92
  try {
89
- t("pkt-radiobutton")(u);
93
+ t("pkt-radiobutton")(p);
90
94
  } catch {
91
95
  console.warn("Forsøker å definere <pkt-radiobutton>, men den er allerede definert");
92
96
  }
93
97
  //#endregion
94
98
  //#region src/components/radiobutton/index.ts
95
- var d = u;
99
+ var m = p;
96
100
  //#endregion
97
- export { u as n, d as t };
101
+ export { p as n, f as r, m as t };
@@ -1 +1 @@
1
- const e=require("./element-BOmr9YLv.cjs"),t=require("./async-directive-BGoo_npW.cjs");var n=()=>new r,r=class{},i=new WeakMap,a=e.f(class extends t.t{render(t){return e.h}update(t,[n]){let r=n!==this.G;return r&&this.rt(void 0),(r||this.lt!==this.ct)&&(this.G=n,this.ht=t.options?.host,this.rt(this.ct=t.element)),e.h}rt(e){if(this.G!==void 0){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}});
1
+ const e=require("./element-C6WTyJFE.cjs"),t=require("./async-directive-DpyKp6qv.cjs");var n=()=>new r,r=class{},i=new WeakMap,a=e.f(class extends t.t{render(t){return e.h}update(t,[n]){let r=n!==this.G;return r&&this.rt(void 0),(r||this.lt!==this.ct)&&(this.G=n,this.ht=t.options?.host,this.rt(this.ct=t.element)),e.h}rt(e){if(this.G!==void 0){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}});
@@ -1,5 +1,5 @@
1
- import { f as e, h as t } from "./element-mwwC2Rra.js";
2
- import { t as n } from "./async-directive-DsdqP_X7.js";
1
+ import { f as e, h as t } from "./element-DBugHPKM.js";
2
+ import { t as n } from "./async-directive-yh8hG41Q.js";
3
3
  //#region ../../node_modules/lit-html/directives/ref.js
4
4
  var r = () => new i(), i = class {}, a = /* @__PURE__ */ new WeakMap(), o = e(class extends n {
5
5
  render(e) {
@@ -1,5 +1,5 @@
1
- import { f as e, g as t, m as n, p as r } from "./element-mwwC2Rra.js";
2
- import { a as i, n as a, o, r as s, t as c } from "./directive-helpers-D96YEsht.js";
1
+ import { f as e, g as t, m as n, p as r } from "./element-DBugHPKM.js";
2
+ import { a as i, n as a, o, r as s, t as c } from "./directive-helpers-CwxFepWh.js";
3
3
  //#region ../../node_modules/lit-html/directives/repeat.js
4
4
  var l = (e, t, n) => {
5
5
  let r = /* @__PURE__ */ new Map();
@@ -1 +1 @@
1
- const e=require("./element-BOmr9YLv.cjs"),t=require("./directive-helpers-BRrz3Bcj.cjs");var n=(e,t,n)=>{let r=new Map;for(let i=t;i<=n;i++)r.set(e[i],i);return r},r=e.f(class extends e.p{constructor(t){if(super(t),t.type!==e.m.CHILD)throw Error(`repeat() can only be used in text expressions`)}dt(e,t,n){let r;n===void 0?n=t:t!==void 0&&(r=t);let i=[],a=[],o=0;for(let t of e)i[o]=r?r(t,o):o,a[o]=n(t,o),o++;return{values:a,keys:i}}render(e,t,n){return this.dt(e,t,n).values}update(r,[i,a,o]){let s=t.t(r),{values:c,keys:l}=this.dt(i,a,o);if(!Array.isArray(s))return this.ut=l,c;let u=this.ut??=[],d=[],f,p,m=0,h=s.length-1,g=0,_=c.length-1;for(;m<=h&&g<=_;)if(s[m]===null)m++;else if(s[h]===null)h--;else if(u[m]===l[g])d[g]=t.a(s[m],c[g]),m++,g++;else if(u[h]===l[_])d[_]=t.a(s[h],c[_]),h--,_--;else if(u[m]===l[_])d[_]=t.a(s[m],c[_]),t.o(r,d[_+1],s[m]),m++,_--;else if(u[h]===l[g])d[g]=t.a(s[h],c[g]),t.o(r,s[m],s[h]),h--,g++;else if(f===void 0&&(f=n(l,g,_),p=n(u,m,h)),f.has(u[m])){if(f.has(u[h])){let e=p.get(l[g]),n=e===void 0?null:s[e];if(n===null){let e=t.o(r,s[m]);t.a(e,c[g]),d[g]=e}else d[g]=t.a(n,c[g]),t.o(r,s[m],n),s[e]=null;g++}else t.n(s[h]),h--}else t.n(s[m]),m++;for(;g<=_;){let e=t.o(r,d[_+1]);t.a(e,c[g]),d[g++]=e}for(;m<=h;){let e=s[m++];e!==null&&t.n(e)}return this.ut=l,t.r(r,d),e.g}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
1
+ const e=require("./element-C6WTyJFE.cjs"),t=require("./directive-helpers-Bv70GjQh.cjs");var n=(e,t,n)=>{let r=new Map;for(let i=t;i<=n;i++)r.set(e[i],i);return r},r=e.f(class extends e.p{constructor(t){if(super(t),t.type!==e.m.CHILD)throw Error(`repeat() can only be used in text expressions`)}dt(e,t,n){let r;n===void 0?n=t:t!==void 0&&(r=t);let i=[],a=[],o=0;for(let t of e)i[o]=r?r(t,o):o,a[o]=n(t,o),o++;return{values:a,keys:i}}render(e,t,n){return this.dt(e,t,n).values}update(r,[i,a,o]){let s=t.t(r),{values:c,keys:l}=this.dt(i,a,o);if(!Array.isArray(s))return this.ut=l,c;let u=this.ut??=[],d=[],f,p,m=0,h=s.length-1,g=0,_=c.length-1;for(;m<=h&&g<=_;)if(s[m]===null)m++;else if(s[h]===null)h--;else if(u[m]===l[g])d[g]=t.a(s[m],c[g]),m++,g++;else if(u[h]===l[_])d[_]=t.a(s[h],c[_]),h--,_--;else if(u[m]===l[_])d[_]=t.a(s[m],c[_]),t.o(r,d[_+1],s[m]),m++,_--;else if(u[h]===l[g])d[g]=t.a(s[h],c[g]),t.o(r,s[m],s[h]),h--,g++;else if(f===void 0&&(f=n(l,g,_),p=n(u,m,h)),f.has(u[m])){if(f.has(u[h])){let e=p.get(l[g]),n=e===void 0?null:s[e];if(n===null){let e=t.o(r,s[m]);t.a(e,c[g]),d[g]=e}else d[g]=t.a(n,c[g]),t.o(r,s[m],n),s[e]=null;g++}else t.n(s[h]),h--}else t.n(s[m]),m++;for(;g<=_;){let e=t.o(r,d[_+1]);t.a(e,c[g]),d[g++]=e}for(;m<=h;){let e=s[m++];e!==null&&t.n(e)}return this.ut=l,t.r(r,d),e.g}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
@@ -1,7 +1,7 @@
1
- import { _ as e, d as t, h as n, l as r, n as i, t as a, u as o } from "./element-mwwC2Rra.js";
2
- import { t as s } from "./class-map-C4hdfSfY.js";
3
- import "./icon-JigbxxF7.js";
4
- import { t as c } from "./if-defined-Bebu3LXY.js";
1
+ import { _ as e, d as t, h as n, l as r, n as i, t as a, u as o } from "./element-DBugHPKM.js";
2
+ import { t as s } from "./class-map-Bf-QzUpN.js";
3
+ import "./icon-Bao96Zb8.js";
4
+ import { t as c } from "./if-defined-O59_I-e-.js";
5
5
  import { n as l } from "./utils-BwF4QSrq.js";
6
6
  import { t as u } from "./focus-modality-controller-Dc2S-KqR.js";
7
7
  //#region src/components/searchinput/searchinput.ts
@@ -1,4 +1,4 @@
1
- const e=require("./element-BOmr9YLv.cjs"),t=require("./class-map-Drv0_anQ.cjs");require("./icon-Dnv6LtPC.cjs");const n=require("./if-defined-2mkIDgOm.cjs"),r=require("./utils-63cRpWut.cjs"),i=require("./focus-modality-controller-C1ocyv2J.cjs");var a=class extends e.t{constructor(...e){super(...e),this.appearance=`local`,this.inputSize=`medium`,this.disabled=!1,this.fullwidth=!1,this.id=r.n(),this.value=``,this.focusModality=new i.t(this,`.pkt-searchinput`)}willUpdate(e){super.willUpdate(e);let t=this.getAttribute(`aria-label`);t&&(this.inputAriaLabel=t,this.removeAttribute(`aria-label`))}get suggestionsId(){return`${this.id}-suggestions`}dispatchSearch(){this.dispatchEvent(new CustomEvent(`pkt-search`,{detail:{value:this.value},bubbles:!0,composed:!0}))}onInput(e){let t=e.target;this.value=t.value}onInputKeydown(e){e.key===`Enter`&&(this.action||e.preventDefault(),this.dispatchSearch())}onSearchClick(e){this.action||e.preventDefault(),this.dispatchSearch()}onSuggestionClick(e,t,n){let r=new CustomEvent(`pkt-suggestion-click`,{detail:{index:n,suggestion:t},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(r)||e.preventDefault()}renderSuggestion(t,n){let r=e._`
1
+ const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs");require("./icon-jPhyZD1z.cjs");const n=require("./if-defined-CiML3MTM.cjs"),r=require("./utils-63cRpWut.cjs"),i=require("./focus-modality-controller-C1ocyv2J.cjs");var a=class extends e.t{constructor(...e){super(...e),this.appearance=`local`,this.inputSize=`medium`,this.disabled=!1,this.fullwidth=!1,this.id=r.n(),this.value=``,this.focusModality=new i.t(this,`.pkt-searchinput`)}willUpdate(e){super.willUpdate(e);let t=this.getAttribute(`aria-label`);t&&(this.inputAriaLabel=t,this.removeAttribute(`aria-label`))}get suggestionsId(){return`${this.id}-suggestions`}dispatchSearch(){this.dispatchEvent(new CustomEvent(`pkt-search`,{detail:{value:this.value},bubbles:!0,composed:!0}))}onInput(e){let t=e.target;this.value=t.value}onInputKeydown(e){e.key===`Enter`&&(this.action||e.preventDefault(),this.dispatchSearch())}onSearchClick(e){this.action||e.preventDefault(),this.dispatchSearch()}onSuggestionClick(e,t,n){let r=new CustomEvent(`pkt-suggestion-click`,{detail:{index:n,suggestion:t},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(r)||e.preventDefault()}renderSuggestion(t,n){let r=e._`
2
2
  ${t.title?e._`<h3 class="pkt-searchinput__suggestion-title">${t.title}</h3>`:e.h}
3
3
  ${t.text?e._`<p class="pkt-searchinput__suggestion-text">${t.text}</p>`:e.h}
4
4
  `;return t.href?e._`<a
@@ -1,10 +1,10 @@
1
- import { _ as e, d as t, l as n, n as r, u as i } from "./element-mwwC2Rra.js";
2
- import { n as a } from "./element-with-slot-DQv0cbbD.js";
3
- import { t as o } from "./if-defined-Bebu3LXY.js";
4
- import { n as s, t as c } from "./ref-CCSGk4MP.js";
5
- import { t as l } from "./input-element-lLzfwdim.js";
6
- import { t as u } from "./pkt-options-controller-D7l18Iw0.js";
7
- import { r as d } from "./input-wrapper-C9K-_7g-.js";
1
+ import { _ as e, d as t, l as n, n as r, u as i } from "./element-DBugHPKM.js";
2
+ import { n as a } from "./element-with-slot-DDLS-aLw.js";
3
+ import { t as o } from "./if-defined-O59_I-e-.js";
4
+ import { n as s, t as c } from "./ref-y_5qv9vU.js";
5
+ import { t as l } from "./input-element-BBygBEei.js";
6
+ import { t as u } from "./pkt-options-controller-ClFrUWZK.js";
7
+ import { r as d } from "./input-wrapper-DrSCuw6U.js";
8
8
  //#region src/base-elements/options-input-element.ts
9
9
  var f = class extends l {
10
10
  constructor(...e) {
@@ -1,4 +1,4 @@
1
- const e=require("./element-BOmr9YLv.cjs"),t=require("./element-with-slot-D7sTqOr3.cjs"),n=require("./if-defined-2mkIDgOm.cjs"),r=require("./ref-Emu5PNxk.cjs"),i=require("./input-element-CSfDGslx.cjs"),a=require("./pkt-options-controller-CpEZcomb.cjs"),o=require("./input-wrapper-CTMf4kCK.cjs");var s=class extends i.t{constructor(...e){super(...e),this._optionsProp=[],this._options=[]}get options(){return this._options.map(e=>({...e,selected:this.isOptionSelected(e)}))}set options(e){this._optionsProp=e,this.requestUpdate(`_optionsProp`,this._options)}isOptionSelected(e){return Array.isArray(this.value)?this.value.includes(e.value):e.value===this.value}findOptionByValue(e){return this._options.find(t=>t.value===e)}getSelectedOptions(){return this._options.filter(e=>this.isOptionSelected(e))}parseOptions(){let e=this._optionsProp.length>0,t=this.optionsController?.nodes?.length&&this.optionsController.nodes.length>0;e?this._options=this._optionsProp:t&&(this._options=this.optionsController.options)}willUpdate(e){super.willUpdate(e),this.parseOptions()}};e.n([e.u({type:Array,attribute:`options`})],s.prototype,`_optionsProp`,void 0),e.n([e.l()],s.prototype,`_options`,void 0);var c=class extends s{constructor(){super(),this.inputRef=r.t(),this.value=``,this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new a.t(this)}connectedCallback(){super.connectedCallback(),this.parseOptions(),this._options.forEach(e=>{e.selected&&!this.value&&(this.value=e.value)})}add(e,t){let n={value:e.value||e.text,label:e.text||e.value,selected:e.selected,disabled:e.disabled};if(t===void 0)this._options.push(n);else if(typeof t==`number`)this._options.splice(t,0,n);else{let e=t.value||t.text,r=this._options.findIndex(t=>t.value===e);r>=0?this._options.splice(r,0,n):this._options.push(n)}e.selected&&(this.value=e.value||e.text,this.selectedIndex=this._options.findIndex(e=>e.value===this.value)),this.requestUpdate()}remove(e){typeof e==`number`&&(this.selectedIndex===e&&(this.value=this._options[0]?.value||``),this._options.splice(e,1),this.requestUpdate())}item(e){return this.inputRef.value?.item(e)}namedItem(e){return this.inputRef.value?.namedItem(e)}showPicker(){this.inputRef.value&&`showPicker`in this.inputRef.value&&this.inputRef.value.showPicker()}attributeChangedCallback(e,t,n){e===`options`&&(this._options=n?JSON.parse(n):[]),e===`value`&&this.value!==t&&(this.selectedIndex=this.touched?this.returnNumberOrNull(this.inputRef.value?.selectedIndex):this._options.findIndex(e=>e.value===n),this.selectedOptions=this.inputRef.value?.selectedOptions,this.valueChanged(n,t)),super.attributeChangedCallback(e,t,n)}update(e){super.update(e),e.has(`_optionsProp`)&&this._optionsProp.length>0&&(this._options=this._optionsProp,this.requestUpdate(`_options`),!this.value&&this._options.length>0&&(this.value=this._options[0].value,this.selectedIndex=0)),e.has(`value`)&&this.value!==e.get(`value`)&&(this.selectedIndex=this.touched?this.returnNumberOrNull(this.inputRef.value?.selectedIndex):this._options.findIndex(e=>e.value===this.value),this.selectedOptions=this.inputRef.value?.selectedOptions,this.valueChanged(this.value,e.get(`value`))),e.has(`id`)&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(e){super.firstUpdated(e),this.classList.add(`pkt-select`),this._optionsProp.length&&(this._options=this._optionsProp),!this.value&&this._options.length>0?(this.value=this._options[0].value,this.selectedIndex=0):this.selectedIndex=this._options.findIndex(e=>e.value===this.value),this.selectedOptions=this.inputRef.value?.selectedOptions}render(){let i=`pkt-input pkt-input--${this.inputSize} ${this.fullwidth?`pkt-input--fullwidth`:``}`;return e._`
1
+ const e=require("./element-C6WTyJFE.cjs"),t=require("./element-with-slot-DhiAuSjM.cjs"),n=require("./if-defined-CiML3MTM.cjs"),r=require("./ref-CB7e9nMY.cjs"),i=require("./input-element-C4SelHLD.cjs"),a=require("./pkt-options-controller-B3vVKnAG.cjs"),o=require("./input-wrapper-BT6B3Kco.cjs");var s=class extends i.t{constructor(...e){super(...e),this._optionsProp=[],this._options=[]}get options(){return this._options.map(e=>({...e,selected:this.isOptionSelected(e)}))}set options(e){this._optionsProp=e,this.requestUpdate(`_optionsProp`,this._options)}isOptionSelected(e){return Array.isArray(this.value)?this.value.includes(e.value):e.value===this.value}findOptionByValue(e){return this._options.find(t=>t.value===e)}getSelectedOptions(){return this._options.filter(e=>this.isOptionSelected(e))}parseOptions(){let e=this._optionsProp.length>0,t=this.optionsController?.nodes?.length&&this.optionsController.nodes.length>0;e?this._options=this._optionsProp:t&&(this._options=this.optionsController.options)}willUpdate(e){super.willUpdate(e),this.parseOptions()}};e.n([e.u({type:Array,attribute:`options`})],s.prototype,`_optionsProp`,void 0),e.n([e.l()],s.prototype,`_options`,void 0);var c=class extends s{constructor(){super(),this.inputRef=r.t(),this.value=``,this.selectedIndex=-1,this.selectedOptions=void 0,this.optionsController=new a.t(this)}connectedCallback(){super.connectedCallback(),this.parseOptions(),this._options.forEach(e=>{e.selected&&!this.value&&(this.value=e.value)})}add(e,t){let n={value:e.value||e.text,label:e.text||e.value,selected:e.selected,disabled:e.disabled};if(t===void 0)this._options.push(n);else if(typeof t==`number`)this._options.splice(t,0,n);else{let e=t.value||t.text,r=this._options.findIndex(t=>t.value===e);r>=0?this._options.splice(r,0,n):this._options.push(n)}e.selected&&(this.value=e.value||e.text,this.selectedIndex=this._options.findIndex(e=>e.value===this.value)),this.requestUpdate()}remove(e){typeof e==`number`&&(this.selectedIndex===e&&(this.value=this._options[0]?.value||``),this._options.splice(e,1),this.requestUpdate())}item(e){return this.inputRef.value?.item(e)}namedItem(e){return this.inputRef.value?.namedItem(e)}showPicker(){this.inputRef.value&&`showPicker`in this.inputRef.value&&this.inputRef.value.showPicker()}attributeChangedCallback(e,t,n){e===`options`&&(this._options=n?JSON.parse(n):[]),e===`value`&&this.value!==t&&(this.selectedIndex=this.touched?this.returnNumberOrNull(this.inputRef.value?.selectedIndex):this._options.findIndex(e=>e.value===n),this.selectedOptions=this.inputRef.value?.selectedOptions,this.valueChanged(n,t)),super.attributeChangedCallback(e,t,n)}update(e){super.update(e),e.has(`_optionsProp`)&&this._optionsProp.length>0&&(this._options=this._optionsProp,this.requestUpdate(`_options`),!this.value&&this._options.length>0&&(this.value=this._options[0].value,this.selectedIndex=0)),e.has(`value`)&&this.value!==e.get(`value`)&&(this.selectedIndex=this.touched?this.returnNumberOrNull(this.inputRef.value?.selectedIndex):this._options.findIndex(e=>e.value===this.value),this.selectedOptions=this.inputRef.value?.selectedOptions,this.valueChanged(this.value,e.get(`value`))),e.has(`id`)&&!this.name&&this.id&&(this.name=this.id)}firstUpdated(e){super.firstUpdated(e),this.classList.add(`pkt-select`),this._optionsProp.length&&(this._options=this._optionsProp),!this.value&&this._options.length>0?(this.value=this._options[0].value,this.selectedIndex=0):this.selectedIndex=this._options.findIndex(e=>e.value===this.value),this.selectedOptions=this.inputRef.value?.selectedOptions}render(){let i=`pkt-input pkt-input--${this.inputSize} ${this.fullwidth?`pkt-input--fullwidth`:``}`;return e._`
2
2
  <pkt-input-wrapper
3
3
  ${t.n(this,[`helptext`])}
4
4
  .strings=${this.strings}
@@ -14,6 +14,7 @@ export declare const nb: {
14
14
  /** Valideringsmeldinger. Nøkkelnavnene følger `ValidityState` der det finnes et tilsvarende flagg. */
15
15
  validation: {
16
16
  valueMissing: string;
17
+ checkboxGroupValueMissing: string;
17
18
  typeMismatch: string;
18
19
  patternMismatch: string;
19
20
  tooShort: string;
@@ -9,10 +9,12 @@ export { HEADER_MENU_LOCALES, DEFAULT_HEADER_FOOTER_URL, DEFAULT_HEADER_LOGO_LIN
9
9
  export type { THeaderMenuLocale, IHeaderMenuLink, IHeaderMenuIconLink, IHeaderMenuButton, IHeaderMenuServices, IHeaderMenuSection, IMegaMenu, IHeaderFooter, IHeaderFooterLocaleData, THeaderFooterApi, IPktHeaderMenu, IPktHeaderGlobal, } from './header-footer';
10
10
  export type { IPktFooterLink, IPktFooterColumn, IPktFooterSocialLink, IPktFooterBase, IPktFooterProps, IPktFooterSimpleProps, IFooterSimpleSpecProps, IFooterSpecProps, } from './footer';
11
11
  export { DEFAULT_FOOTER_PERSONVERN_URL, DEFAULT_FOOTER_TILGJENGELIGHET_URL } from './footer';
12
- export { CARD_SKINS, CARD_PADDINGS, CARD_IMAGE_SHAPES, CARD_IMAGE_ASPECTS, CARD_TAG_POSITIONS, CARD_TAG_SKIN_OPTIONS, CARD_DEFAULTS } from './card';
12
+ export { CARD_SKINS, CARD_PADDINGS, CARD_IMAGE_SHAPES, CARD_IMAGE_ASPECTS, CARD_TAG_POSITIONS, CARD_TAG_SKIN_OPTIONS, CARD_DEFAULTS, } from './card';
13
13
  export type { TCardSkin, TCardPadding, TCardImageShape, TCardImageAspect, TCardTagPosition, ICardTag, ICardImage, IPktCardBase, ICardSpecProps, } from './card';
14
14
  export { CHECKBOX_LABEL_POSITIONS, CHECKBOX_DEFAULTS } from './checkbox';
15
15
  export type { TCheckboxLabelPosition, IPktCheckboxBase, ICheckboxSpecProps } from './checkbox';
16
+ export { OPTION_GROUP_DEFAULTS } from './option-group';
17
+ export type { IPktOptionGroupBase, IPktRadioGroupBase, IPktCheckboxGroupBase, IRadioGroupSpecProps, ICheckboxGroupSpecProps, } from './option-group';
16
18
  export { CONSENT_TRIGGER_TYPES, CONSENT_TRIGGER_TYPE_OPTIONS, CONSENT_DEFAULTS } from './consent';
17
19
  export type { TPktConsentTriggerType, IConsentItem, IConsentValue, ICookieConsentEvent, TConsentDetailsMap, TCookieEventHandler, ICookieEvents, ICookieBannerApi, IPktConsentBase, IConsentSpecProps, } from './consent';
18
20
  export { ICON_DEFAULT_PATH, ICON_SIZE_CLASSES, ICON_DEFAULTS } from './icon';
@@ -48,5 +50,5 @@ export { COMBOBOX_TAG_SKINS, COMBOBOX_DISPLAY_VALUES, COMBOBOX_TAG_PLACEMENTS, C
48
50
  export type { IPktComboboxOption, TPktComboboxTagSkin, TPktComboboxDisplayValue, TPktComboboxTagPlacement, IPktComboboxBase, IComboboxSpecProps, } from './combobox';
49
51
  export type { IPktSelectOption, TSelectOption } from './select';
50
52
  export type { TPktSearchInputAppearance, TPktSearchInputMethod, IPktSearchInputSuggestion, IPktSearchInput, } from './searchinput';
51
- export { UPLOAD_STRATEGIES, FILE_UPLOAD_ITEM_RENDERERS, PREVIEW_UPLOAD_STATUS, } from './fileupload';
53
+ export { UPLOAD_STRATEGIES, FILE_UPLOAD_ITEM_RENDERERS, PREVIEW_UPLOAD_STATUS } from './fileupload';
52
54
  export type { TUploadStrategy as TFileUploadStrategy, TFileUploadItemRenderer, TPreviewUploadStatus, TFilesChangedReason, TFileValidator, TTransferProgress, IFileItem, IFileTransfer, IFileValidateDetail, ITransferCancelledDetail, IFilesChangedDetail, IFileUploadSpecProps, IPktFileUploadBase, } from './fileupload';