@gov-design-system-ce/components 4.6.4 → 4.6.5-b

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 (278) hide show
  1. package/dist/cjs/gov-flex_3.cjs.entry.js +1 -1
  2. package/dist/cjs/gov-form-file.cjs.entry.js +35 -11
  3. package/dist/cjs/gov-form-file.cjs.entry.js.map +1 -1
  4. package/dist/cjs/gov-form-file.entry.cjs.js.map +1 -1
  5. package/dist/collection/components/gov-form/file/gov-form-file.js +7 -2
  6. package/dist/collection/components/gov-form/file/gov-form-file.js.map +1 -1
  7. package/dist/collection/utils/file.utils.js +28 -9
  8. package/dist/collection/utils/file.utils.js.map +1 -1
  9. package/dist/components/gov-accordion-item.js +1 -1
  10. package/dist/components/gov-attachments-item.js +1 -1
  11. package/dist/components/gov-blockquote.js +1 -1
  12. package/dist/components/gov-breadcrumbs.js +1 -1
  13. package/dist/components/gov-breadcrumbs.js.map +1 -1
  14. package/dist/components/gov-button.js +1 -1
  15. package/dist/components/gov-card.js +1 -1
  16. package/dist/components/gov-chip.js +1 -1
  17. package/dist/components/gov-collapsible.js +1 -1
  18. package/dist/components/gov-dialog.js +1 -1
  19. package/dist/components/gov-form-autocomplete.js +1 -1
  20. package/dist/components/gov-form-checkbox.js +1 -1
  21. package/dist/components/gov-form-file.js +1 -1
  22. package/dist/components/gov-form-file.js.map +1 -1
  23. package/dist/components/gov-form-input.js +1 -1
  24. package/dist/components/gov-form-multi-select.js +1 -1
  25. package/dist/components/gov-form-range.js +1 -1
  26. package/dist/components/gov-form-select.js +1 -1
  27. package/dist/components/gov-form-switch.js +1 -1
  28. package/dist/components/gov-icon.js +1 -1
  29. package/dist/components/gov-infobar.js +1 -1
  30. package/dist/components/gov-link.js +1 -1
  31. package/dist/components/gov-loading.js +1 -1
  32. package/dist/components/gov-pagination.js +1 -1
  33. package/dist/components/gov-tabs.js +1 -1
  34. package/dist/components/gov-tag.js +1 -1
  35. package/dist/components/gov-theme-switch.js +1 -1
  36. package/dist/components/gov-tile.js +1 -1
  37. package/dist/components/gov-toast.js +1 -1
  38. package/dist/components/gov-tooltip-content.js +1 -1
  39. package/dist/components/gov-wizard-item.js +1 -1
  40. package/dist/components/{p-ibUK7mfI.js → p-BGK46VRO.js} +2 -2
  41. package/dist/components/{p-iTwUkISB.js → p-BICk4EuO.js} +2 -2
  42. package/dist/components/{p-DN5pb9xA.js → p-BNoNH6m-.js} +2 -2
  43. package/dist/components/{p-C_URF9Su.js → p-ClDhNt_H.js} +2 -2
  44. package/dist/components/p-DRXiDAHW.js +2 -0
  45. package/dist/components/{p-CXPP9vec.js.map → p-DRXiDAHW.js.map} +1 -1
  46. package/dist/components/{p-pJ_vPAO0.js → p-DjGO_trZ.js} +2 -2
  47. package/dist/components/{p-yIpIIG5A.js → p-DmK9qaKH.js} +2 -2
  48. package/dist/components/{p-DEthsMuE.js → p-isPjiQbr.js} +2 -2
  49. package/dist/core/core.esm.js +1 -1
  50. package/dist/core/core.esm.js.map +1 -1
  51. package/dist/core/{p-3314505d.entry.js → p-00ab0454.entry.js} +2 -2
  52. package/dist/core/{p-3314505d.entry.js.map → p-00ab0454.entry.js.map} +1 -1
  53. package/dist/core/{p-9d9e9401.entry.js → p-05bb35e1.entry.js} +2 -2
  54. package/dist/core/{p-9d9e9401.entry.js.map → p-05bb35e1.entry.js.map} +1 -1
  55. package/dist/core/{p-e30968b3.entry.js → p-06497d64.entry.js} +2 -2
  56. package/dist/core/{p-e30968b3.entry.js.map → p-06497d64.entry.js.map} +1 -1
  57. package/dist/core/p-0675617d.entry.js +2 -0
  58. package/dist/core/{p-fca7a0d6.entry.js.map → p-0675617d.entry.js.map} +1 -1
  59. package/dist/core/{p-4d36cd18.entry.js → p-2493a7f3.entry.js} +2 -2
  60. package/dist/core/{p-4d36cd18.entry.js.map → p-2493a7f3.entry.js.map} +1 -1
  61. package/dist/core/p-2e15a654.entry.js +2 -0
  62. package/dist/core/{p-bd2df430.entry.js.map → p-2e15a654.entry.js.map} +1 -1
  63. package/dist/core/{p-1626cc67.entry.js → p-30ad7514.entry.js} +2 -2
  64. package/dist/core/{p-1626cc67.entry.js.map → p-30ad7514.entry.js.map} +1 -1
  65. package/dist/core/{p-558e75a6.entry.js → p-378cf8de.entry.js} +2 -2
  66. package/dist/core/{p-558e75a6.entry.js.map → p-378cf8de.entry.js.map} +1 -1
  67. package/dist/core/{p-be9af807.entry.js → p-3a4799b3.entry.js} +2 -2
  68. package/dist/core/{p-be9af807.entry.js.map → p-3a4799b3.entry.js.map} +1 -1
  69. package/dist/core/{p-f7bdb44a.entry.js → p-3ebbe75a.entry.js} +2 -2
  70. package/dist/core/{p-f7bdb44a.entry.js.map → p-3ebbe75a.entry.js.map} +1 -1
  71. package/dist/core/p-41bef63a.entry.js +2 -0
  72. package/dist/core/{p-bec959c4.entry.js.map → p-41bef63a.entry.js.map} +1 -1
  73. package/dist/core/{p-4e2faea7.entry.js → p-4342c252.entry.js} +2 -2
  74. package/dist/core/{p-4e2faea7.entry.js.map → p-4342c252.entry.js.map} +1 -1
  75. package/dist/core/{p-c1b9f1ab.entry.js → p-473afd7d.entry.js} +2 -2
  76. package/dist/core/{p-c1b9f1ab.entry.js.map → p-473afd7d.entry.js.map} +1 -1
  77. package/dist/core/{p-5721cf9b.entry.js → p-48b74272.entry.js} +2 -2
  78. package/dist/core/{p-5721cf9b.entry.js.map → p-48b74272.entry.js.map} +1 -1
  79. package/dist/core/{p-04ec45ab.entry.js → p-49b67f59.entry.js} +2 -2
  80. package/dist/core/{p-04ec45ab.entry.js.map → p-49b67f59.entry.js.map} +1 -1
  81. package/dist/core/{p-6b44890d.entry.js → p-4bd3f101.entry.js} +2 -2
  82. package/dist/core/{p-6b44890d.entry.js.map → p-4bd3f101.entry.js.map} +1 -1
  83. package/dist/core/{p-157a1636.entry.js → p-4e534d68.entry.js} +2 -2
  84. package/dist/core/{p-157a1636.entry.js.map → p-4e534d68.entry.js.map} +1 -1
  85. package/dist/core/p-6638d034.entry.js +2 -0
  86. package/dist/core/{p-73bd93f9.entry.js.map → p-6638d034.entry.js.map} +1 -1
  87. package/dist/core/{p-46824842.entry.js → p-68a5d225.entry.js} +2 -2
  88. package/dist/core/{p-46824842.entry.js.map → p-68a5d225.entry.js.map} +1 -1
  89. package/dist/core/{p-8d47e346.entry.js → p-6ac9b0f2.entry.js} +2 -2
  90. package/dist/core/{p-8d47e346.entry.js.map → p-6ac9b0f2.entry.js.map} +1 -1
  91. package/dist/core/{p-0af96cc0.entry.js → p-6b0625ee.entry.js} +2 -2
  92. package/dist/core/{p-0af96cc0.entry.js.map → p-6b0625ee.entry.js.map} +1 -1
  93. package/dist/core/{p-f75ad657.entry.js → p-78202a44.entry.js} +2 -2
  94. package/dist/core/{p-f75ad657.entry.js.map → p-78202a44.entry.js.map} +1 -1
  95. package/dist/core/{p-eb766437.entry.js → p-80052953.entry.js} +2 -2
  96. package/dist/core/{p-eb766437.entry.js.map → p-80052953.entry.js.map} +1 -1
  97. package/dist/core/{p-d43959a0.entry.js → p-8ddb6dc6.entry.js} +2 -2
  98. package/dist/core/{p-d43959a0.entry.js.map → p-8ddb6dc6.entry.js.map} +1 -1
  99. package/dist/core/{p-d9c574f0.entry.js → p-90cc2ddb.entry.js} +2 -2
  100. package/dist/core/{p-d9c574f0.entry.js.map → p-90cc2ddb.entry.js.map} +1 -1
  101. package/dist/core/{p-f3887d6d.entry.js → p-91d5df66.entry.js} +2 -2
  102. package/dist/core/{p-f3887d6d.entry.js.map → p-91d5df66.entry.js.map} +1 -1
  103. package/dist/core/{p-187c0eda.entry.js → p-9321fb9d.entry.js} +2 -2
  104. package/dist/core/{p-187c0eda.entry.js.map → p-9321fb9d.entry.js.map} +1 -1
  105. package/dist/core/p-943a58b2.entry.js +2 -0
  106. package/dist/core/{p-33209782.entry.js.map → p-943a58b2.entry.js.map} +1 -1
  107. package/dist/core/p-B6CqPcY_.js.map +1 -1
  108. package/dist/core/p-B8TR1oqt.js +3 -0
  109. package/dist/core/p-B8TR1oqt.js.map +1 -0
  110. package/dist/core/p-BUmDydor.js.map +1 -1
  111. package/dist/core/p-BcQO4NH2.js.map +1 -1
  112. package/dist/core/p-BjcqOprh.js.map +1 -1
  113. package/dist/core/p-Bo1ROm5Q.js.map +1 -1
  114. package/dist/core/p-Bz_RzYFb.js.map +1 -1
  115. package/dist/core/p-C3R1T_pg.js.map +1 -1
  116. package/dist/core/p-C6JN9gdb.js.map +1 -1
  117. package/dist/core/p-CDIRBJsi.js.map +1 -1
  118. package/dist/core/p-CQvUntGY.js.map +1 -1
  119. package/dist/core/p-Ccwpa1ck.js.map +1 -1
  120. package/dist/core/p-CgDnDrq5.js.map +1 -1
  121. package/dist/core/p-Cjg0wpDG.js.map +1 -1
  122. package/dist/core/p-CoD1xawt.js.map +1 -1
  123. package/dist/core/p-Cx3bEC5v.js.map +1 -1
  124. package/dist/core/p-D4TGB274.js.map +1 -1
  125. package/dist/core/p-DBXGhafv.js.map +1 -1
  126. package/dist/core/p-DNztiAH0.js.map +1 -1
  127. package/dist/core/p-DQuL1Twl.js.map +1 -1
  128. package/dist/core/p-DYcNEwSZ.js.map +1 -1
  129. package/dist/core/p-EeKNA85D.js.map +1 -1
  130. package/dist/core/p-GYov8gU1.js.map +1 -1
  131. package/dist/core/p-NOJjz9dT.js.map +1 -1
  132. package/dist/core/p-Q99QrOoi.js.map +1 -1
  133. package/dist/core/p-U40vKHrs.js.map +1 -1
  134. package/dist/core/p-a4fa2ffc.entry.js +2 -0
  135. package/dist/core/{p-c4734357.entry.js.map → p-a4fa2ffc.entry.js.map} +1 -1
  136. package/dist/core/{p-511eed88.entry.js → p-a6f27583.entry.js} +2 -2
  137. package/dist/core/{p-511eed88.entry.js.map → p-a6f27583.entry.js.map} +1 -1
  138. package/dist/core/p-a7c322a7.entry.js +2 -0
  139. package/dist/core/{p-abb7780e.entry.js.map → p-a7c322a7.entry.js.map} +1 -1
  140. package/dist/core/{p-6d2ce4c7.entry.js → p-ab367b0c.entry.js} +2 -2
  141. package/dist/core/{p-6d2ce4c7.entry.js.map → p-ab367b0c.entry.js.map} +1 -1
  142. package/dist/core/{p-c6b55c0a.entry.js → p-ac81cdf6.entry.js} +2 -2
  143. package/dist/core/{p-c6b55c0a.entry.js.map → p-ac81cdf6.entry.js.map} +1 -1
  144. package/dist/core/{p-a2c61d50.entry.js → p-ad9227b3.entry.js} +2 -2
  145. package/dist/core/{p-a2c61d50.entry.js.map → p-ad9227b3.entry.js.map} +1 -1
  146. package/dist/core/{p-d9d29f50.entry.js → p-af2bd9d3.entry.js} +2 -2
  147. package/dist/core/{p-d9d29f50.entry.js.map → p-af2bd9d3.entry.js.map} +1 -1
  148. package/dist/core/{p-70b5555f.entry.js → p-b0d4d6bd.entry.js} +2 -2
  149. package/dist/core/{p-70b5555f.entry.js.map → p-b0d4d6bd.entry.js.map} +1 -1
  150. package/dist/core/p-b181f85f.entry.js +2 -0
  151. package/dist/core/{p-57ca8ac7.entry.js.map → p-b181f85f.entry.js.map} +1 -1
  152. package/dist/core/{p-5305e82e.entry.js → p-b2648255.entry.js} +2 -2
  153. package/dist/core/{p-5305e82e.entry.js.map → p-b2648255.entry.js.map} +1 -1
  154. package/dist/core/{p-65a09763.entry.js → p-b37bd421.entry.js} +2 -2
  155. package/dist/core/{p-65a09763.entry.js.map → p-b37bd421.entry.js.map} +1 -1
  156. package/dist/core/{p-91cbee1b.entry.js → p-b5e40f40.entry.js} +2 -2
  157. package/dist/core/{p-91cbee1b.entry.js.map → p-b5e40f40.entry.js.map} +1 -1
  158. package/dist/core/{p-19300834.entry.js → p-b77c283e.entry.js} +2 -2
  159. package/dist/core/{p-19300834.entry.js.map → p-b77c283e.entry.js.map} +1 -1
  160. package/dist/core/{p-7f513718.entry.js → p-bb5b9ccd.entry.js} +2 -2
  161. package/dist/core/{p-7f513718.entry.js.map → p-bb5b9ccd.entry.js.map} +1 -1
  162. package/dist/core/{p-4c02094d.entry.js → p-c9b2f97c.entry.js} +2 -2
  163. package/dist/core/{p-4c02094d.entry.js.map → p-c9b2f97c.entry.js.map} +1 -1
  164. package/dist/core/{p-eb3f6808.entry.js → p-caf817d4.entry.js} +2 -2
  165. package/dist/core/{p-eb3f6808.entry.js.map → p-caf817d4.entry.js.map} +1 -1
  166. package/dist/core/p-dc0bd1e5.entry.js +2 -0
  167. package/dist/core/{p-3e07bf07.entry.js.map → p-dc0bd1e5.entry.js.map} +1 -1
  168. package/dist/core/{p-db860031.entry.js → p-dd390459.entry.js} +2 -2
  169. package/dist/core/{p-db860031.entry.js.map → p-dd390459.entry.js.map} +1 -1
  170. package/dist/core/{p-10991f00.entry.js → p-de5dfd70.entry.js} +2 -2
  171. package/dist/core/{p-10991f00.entry.js.map → p-de5dfd70.entry.js.map} +1 -1
  172. package/dist/core/p-dfb76a14.entry.js +2 -0
  173. package/dist/core/p-dfb76a14.entry.js.map +1 -0
  174. package/dist/core/{p-cd163299.entry.js → p-e17def2b.entry.js} +2 -2
  175. package/dist/core/{p-cd163299.entry.js.map → p-e17def2b.entry.js.map} +1 -1
  176. package/dist/core/{p-e39e5dc7.entry.js → p-e1d58751.entry.js} +2 -2
  177. package/dist/core/{p-e39e5dc7.entry.js.map → p-e1d58751.entry.js.map} +1 -1
  178. package/dist/core/{p-3e07bf07.entry.js → p-e913cfc8.entry.js} +2 -2
  179. package/dist/core/{p-90ab65b4.entry.js.map → p-e913cfc8.entry.js.map} +1 -1
  180. package/dist/core/{p-da997fb3.entry.js → p-ea299832.entry.js} +2 -2
  181. package/dist/core/{p-da997fb3.entry.js.map → p-ea299832.entry.js.map} +1 -1
  182. package/dist/core/{p-852310d9.entry.js → p-eff8ffff.entry.js} +2 -2
  183. package/dist/core/{p-852310d9.entry.js.map → p-eff8ffff.entry.js.map} +1 -1
  184. package/dist/core/{p-4d902f20.entry.js → p-f2d24551.entry.js} +2 -2
  185. package/dist/core/{p-4d902f20.entry.js.map → p-f2d24551.entry.js.map} +1 -1
  186. package/dist/core/{p-5c872d64.entry.js → p-f515d912.entry.js} +2 -2
  187. package/dist/core/{p-bf573a56.entry.js → p-febff4d1.entry.js} +2 -2
  188. package/dist/core/{p-bf573a56.entry.js.map → p-febff4d1.entry.js.map} +1 -1
  189. package/dist/core/p-vN03FcXN.js.map +1 -1
  190. package/dist/esm/gov-flex_3.entry.js +1 -1
  191. package/dist/esm/gov-form-file.entry.js +35 -11
  192. package/dist/esm/gov-form-file.entry.js.map +1 -1
  193. package/dist/hydrate/index.js +36 -12
  194. package/dist/hydrate/index.mjs +36 -12
  195. package/dist/types/components.d.ts +592 -119
  196. package/dist/types/stencil-public-runtime.d.ts +170 -11
  197. package/package.json +32 -28
  198. package/readme.md +1 -2
  199. package/dist/components/p-CXPP9vec.js +0 -2
  200. package/dist/core/core.css +0 -14776
  201. package/dist/core/gov-accordion-item.entry.esm.js.map +0 -1
  202. package/dist/core/gov-accordion.entry.esm.js.map +0 -1
  203. package/dist/core/gov-attachments.gov-attachments-item.gov-form-message.entry.esm.js.map +0 -1
  204. package/dist/core/gov-backdrop.entry.esm.js.map +0 -1
  205. package/dist/core/gov-banner.entry.esm.js.map +0 -1
  206. package/dist/core/gov-blockquote.entry.esm.js.map +0 -1
  207. package/dist/core/gov-breadcrumbs.entry.esm.js.map +0 -1
  208. package/dist/core/gov-button.entry.esm.js.map +0 -1
  209. package/dist/core/gov-card.entry.esm.js.map +0 -1
  210. package/dist/core/gov-chip.entry.esm.js.map +0 -1
  211. package/dist/core/gov-collapsible.entry.esm.js.map +0 -1
  212. package/dist/core/gov-container.entry.esm.js.map +0 -1
  213. package/dist/core/gov-control-group.entry.esm.js.map +0 -1
  214. package/dist/core/gov-cookiebar.entry.esm.js.map +0 -1
  215. package/dist/core/gov-dialog.entry.esm.js.map +0 -1
  216. package/dist/core/gov-dropdown.entry.esm.js.map +0 -1
  217. package/dist/core/gov-empty.entry.esm.js.map +0 -1
  218. package/dist/core/gov-error-code.entry.esm.js.map +0 -1
  219. package/dist/core/gov-flex.gov-icon.gov-theme-switch.entry.esm.js.map +0 -1
  220. package/dist/core/gov-form-autocomplete.entry.esm.js.map +0 -1
  221. package/dist/core/gov-form-checkbox-group.entry.esm.js.map +0 -1
  222. package/dist/core/gov-form-checkbox.entry.esm.js.map +0 -1
  223. package/dist/core/gov-form-control.entry.esm.js.map +0 -1
  224. package/dist/core/gov-form-file.entry.esm.js.map +0 -1
  225. package/dist/core/gov-form-group.entry.esm.js.map +0 -1
  226. package/dist/core/gov-form-input.gov-skeleton.entry.esm.js.map +0 -1
  227. package/dist/core/gov-form-label.entry.esm.js.map +0 -1
  228. package/dist/core/gov-form-multi-select.entry.esm.js.map +0 -1
  229. package/dist/core/gov-form-password-power.entry.esm.js.map +0 -1
  230. package/dist/core/gov-form-radio-group.entry.esm.js.map +0 -1
  231. package/dist/core/gov-form-radio.entry.esm.js.map +0 -1
  232. package/dist/core/gov-form-range.entry.esm.js.map +0 -1
  233. package/dist/core/gov-form-search.entry.esm.js.map +0 -1
  234. package/dist/core/gov-form-select.entry.esm.js.map +0 -1
  235. package/dist/core/gov-form-switch.entry.esm.js.map +0 -1
  236. package/dist/core/gov-grid-item.entry.esm.js.map +0 -1
  237. package/dist/core/gov-grid.entry.esm.js.map +0 -1
  238. package/dist/core/gov-infobar.entry.esm.js.map +0 -1
  239. package/dist/core/gov-layout-column.entry.esm.js.map +0 -1
  240. package/dist/core/gov-layout.entry.esm.js.map +0 -1
  241. package/dist/core/gov-lifecycle.entry.esm.js.map +0 -1
  242. package/dist/core/gov-link.entry.esm.js.map +0 -1
  243. package/dist/core/gov-loading.entry.esm.js.map +0 -1
  244. package/dist/core/gov-message.entry.esm.js.map +0 -1
  245. package/dist/core/gov-pagination.entry.esm.js.map +0 -1
  246. package/dist/core/gov-spacer.entry.esm.js.map +0 -1
  247. package/dist/core/gov-stepper-item.entry.esm.js.map +0 -1
  248. package/dist/core/gov-stepper.entry.esm.js.map +0 -1
  249. package/dist/core/gov-tabs-item.entry.esm.js.map +0 -1
  250. package/dist/core/gov-tabs.entry.esm.js.map +0 -1
  251. package/dist/core/gov-tag.entry.esm.js.map +0 -1
  252. package/dist/core/gov-tile.entry.esm.js.map +0 -1
  253. package/dist/core/gov-toast.entry.esm.js.map +0 -1
  254. package/dist/core/gov-tooltip.gov-tooltip-content.entry.esm.js.map +0 -1
  255. package/dist/core/gov-wizard-item.entry.esm.js.map +0 -1
  256. package/dist/core/gov-wizard.entry.esm.js.map +0 -1
  257. package/dist/core/loader.esm.js.map +0 -1
  258. package/dist/core/p-33209782.entry.js +0 -2
  259. package/dist/core/p-57ca8ac7.entry.js +0 -2
  260. package/dist/core/p-73bd93f9.entry.js +0 -2
  261. package/dist/core/p-90ab65b4.entry.js +0 -2
  262. package/dist/core/p-ClISz4NF.js +0 -3
  263. package/dist/core/p-ClISz4NF.js.map +0 -1
  264. package/dist/core/p-abb7780e.entry.js +0 -2
  265. package/dist/core/p-afe254cb.entry.js +0 -2
  266. package/dist/core/p-afe254cb.entry.js.map +0 -1
  267. package/dist/core/p-bd2df430.entry.js +0 -2
  268. package/dist/core/p-bec959c4.entry.js +0 -2
  269. package/dist/core/p-c4734357.entry.js +0 -2
  270. package/dist/core/p-fca7a0d6.entry.js +0 -2
  271. /package/dist/components/{p-ibUK7mfI.js.map → p-BGK46VRO.js.map} +0 -0
  272. /package/dist/components/{p-iTwUkISB.js.map → p-BICk4EuO.js.map} +0 -0
  273. /package/dist/components/{p-DN5pb9xA.js.map → p-BNoNH6m-.js.map} +0 -0
  274. /package/dist/components/{p-C_URF9Su.js.map → p-ClDhNt_H.js.map} +0 -0
  275. /package/dist/components/{p-pJ_vPAO0.js.map → p-DjGO_trZ.js.map} +0 -0
  276. /package/dist/components/{p-yIpIIG5A.js.map → p-DmK9qaKH.js.map} +0 -0
  277. /package/dist/components/{p-DEthsMuE.js.map → p-isPjiQbr.js.map} +0 -0
  278. /package/dist/core/{p-5c872d64.entry.js.map → p-f515d912.entry.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{p as e,H as s,c as t,h as a,a as i}from"./index.js";import{v as c}from"./p-BKP-F1qP.js";import{b as o,a as n,A as d}from"./p-4i8qDRtu.js";import{g as f,b,c as r}from"./p-BHRF-5cf.js";import{i as m}from"./p-CXgom82_.js";import{t as h}from"./p-Cjg0wpDG.js";import{d as l}from"./p-CXPP9vec.js";const p=e(class e extends s{constructor(){super();this.__registerHost();this.govChange=t(this,"gov-change");this.inheritedAttributes={};this.disabled=false;this.open=false;this.h=f(this.host)}validateSize(e){c(n,e,o.root)}componentWillLoad(){this.validateSize(this.size);this.inheritedAttributes=m(this.host)}componentDidRender(){h((()=>this.getPropsFromParents()))}getPropsFromParents(){const e=this.h.getParent(d.root);if(e){this.size=e.getAttribute("size")}}render(){return a(i,{key:"1beb62527ea9274e6280ce0b64c9d52c12e4a993",class:this.h.classes([o.root,this.disabled&&o.disabled]),size:this.size,role:"listitem"},a("details",{key:"53ca7688e8f26e85cd76feb073a26d04c5505d2b",class:o.details,id:this.identifier,"aria-disabled":b(this.disabled),open:this.open},a("summary",Object.assign({key:"19fec49b0066b7a6162a6010e0ee20431c2a578b",onClick:e=>{e.stopPropagation();e.preventDefault();!this.disabled&&this.toggle().finally()},class:o.summary,tabIndex:this.disabled?-1:0,"aria-expanded":r(this.open)},this.inheritedAttributes),this.h.hasSlot("icon")&&a("span",{key:"19254947c22fa2b1a2fa4e26eacb22c0c89b40c9",class:o.icon},a("slot",{key:"262be1640f250fabf9918f4162c071bb68dc4fb3",name:"icon"})),a("span",{key:"ebb5ef762ef51921b68a8063fd09c979d7d0d32d",class:o.title},a("slot",{key:"75783345d2276f06e53c401761cb4e57d241e5e0",name:"label"}),a("slot",{key:"f2d9cdff693edbcae6293921fde7996d1b1251b6",name:"annotation"})),a("span",{key:"f7e28ea54455756c7d146c7b88be7001e80b07a8",class:o.right},a("slot",{key:"e76b31bf1c349a8a86d4b91ec1cfa650a75edf60",name:"suffix"}),a("span",{key:"87ea99c9862deb3ff9820fa383cec52956b4655a",class:o.arrow},a("slot",{key:"c8b64a90455a731f359e12550664ba5aa905abbc",name:"toggle-icon"},a("gov-icon",{key:"867406c5634d6446683529f5f647492b9b289a31",name:"chevron-down",type:"components"}))))),a("div",{key:"2adf7441dd470ae1b32a08fb374cd1d9e2d1f789",class:o.content},a("slot",{key:"8eb27d0b33689933b6e71850324c35c89d71c4c0"}))))}async toggle(){this.open=!this.open;this.govChange.emit({open:this.open,component:o.root,ref:this.host})}async currentState(){return this.open}get host(){return this}static get watchers(){return{size:["validateSize"]}}},[4,"gov-accordion-item",{identifier:[1],size:[1025],disabled:[4],open:[1028],openState:[32],toggle:[64],currentState:[64]},undefined,{size:["validateSize"]}]);function g(){if(typeof customElements==="undefined"){return}const e=["gov-accordion-item","gov-icon"];e.forEach((e=>{switch(e){case"gov-accordion-item":if(!customElements.get(e)){customElements.define(e,p)}break;case"gov-icon":if(!customElements.get(e)){l()}break}}))}g();const y=p;const u=g;export{y as GovAccordionItem,u as defineCustomElement};
1
+ import{p as e,H as s,c as t,h as a,a as i}from"./index.js";import{v as c}from"./p-BKP-F1qP.js";import{b as o,a as n,A as d}from"./p-4i8qDRtu.js";import{g as f,b,c as r}from"./p-BHRF-5cf.js";import{i as m}from"./p-CXgom82_.js";import{t as h}from"./p-Cjg0wpDG.js";import{d as l}from"./p-DRXiDAHW.js";const p=e(class e extends s{constructor(){super();this.__registerHost();this.govChange=t(this,"gov-change");this.inheritedAttributes={};this.disabled=false;this.open=false;this.h=f(this.host)}validateSize(e){c(n,e,o.root)}componentWillLoad(){this.validateSize(this.size);this.inheritedAttributes=m(this.host)}componentDidRender(){h((()=>this.getPropsFromParents()))}getPropsFromParents(){const e=this.h.getParent(d.root);if(e){this.size=e.getAttribute("size")}}render(){return a(i,{key:"1beb62527ea9274e6280ce0b64c9d52c12e4a993",class:this.h.classes([o.root,this.disabled&&o.disabled]),size:this.size,role:"listitem"},a("details",{key:"53ca7688e8f26e85cd76feb073a26d04c5505d2b",class:o.details,id:this.identifier,"aria-disabled":b(this.disabled),open:this.open},a("summary",Object.assign({key:"19fec49b0066b7a6162a6010e0ee20431c2a578b",onClick:e=>{e.stopPropagation();e.preventDefault();!this.disabled&&this.toggle().finally()},class:o.summary,tabIndex:this.disabled?-1:0,"aria-expanded":r(this.open)},this.inheritedAttributes),this.h.hasSlot("icon")&&a("span",{key:"19254947c22fa2b1a2fa4e26eacb22c0c89b40c9",class:o.icon},a("slot",{key:"262be1640f250fabf9918f4162c071bb68dc4fb3",name:"icon"})),a("span",{key:"ebb5ef762ef51921b68a8063fd09c979d7d0d32d",class:o.title},a("slot",{key:"75783345d2276f06e53c401761cb4e57d241e5e0",name:"label"}),a("slot",{key:"f2d9cdff693edbcae6293921fde7996d1b1251b6",name:"annotation"})),a("span",{key:"f7e28ea54455756c7d146c7b88be7001e80b07a8",class:o.right},a("slot",{key:"e76b31bf1c349a8a86d4b91ec1cfa650a75edf60",name:"suffix"}),a("span",{key:"87ea99c9862deb3ff9820fa383cec52956b4655a",class:o.arrow},a("slot",{key:"c8b64a90455a731f359e12550664ba5aa905abbc",name:"toggle-icon"},a("gov-icon",{key:"867406c5634d6446683529f5f647492b9b289a31",name:"chevron-down",type:"components"}))))),a("div",{key:"2adf7441dd470ae1b32a08fb374cd1d9e2d1f789",class:o.content},a("slot",{key:"8eb27d0b33689933b6e71850324c35c89d71c4c0"}))))}async toggle(){this.open=!this.open;this.govChange.emit({open:this.open,component:o.root,ref:this.host})}async currentState(){return this.open}get host(){return this}static get watchers(){return{size:["validateSize"]}}},[4,"gov-accordion-item",{identifier:[1],size:[1025],disabled:[4],open:[1028],openState:[32],toggle:[64],currentState:[64]},undefined,{size:["validateSize"]}]);function g(){if(typeof customElements==="undefined"){return}const e=["gov-accordion-item","gov-icon"];e.forEach((e=>{switch(e){case"gov-accordion-item":if(!customElements.get(e)){customElements.define(e,p)}break;case"gov-icon":if(!customElements.get(e)){l()}break}}))}g();const y=p;const u=g;export{y as GovAccordionItem,u as defineCustomElement};
2
2
  //# sourceMappingURL=gov-accordion-item.js.map
@@ -1,2 +1,2 @@
1
- import{G as o,d as s}from"./p-iTwUkISB.js";const t=o;const p=s;export{t as GovAttachmentsItem,p as defineCustomElement};
1
+ import{G as o,d as s}from"./p-BICk4EuO.js";const t=o;const p=s;export{t as GovAttachmentsItem,p as defineCustomElement};
2
2
  //# sourceMappingURL=gov-attachments-item.js.map
@@ -1,2 +1,2 @@
1
- import{p as e,H as t,h as o,a as c}from"./index.js";import{g as s}from"./p-BHRF-5cf.js";import{d as n}from"./p-CXPP9vec.js";var a;(function(e){e["PRIMARY"]="primary";e["SUBTLE"]="subtle";e["NEUTRAL"]="neutral"})(a||(a={}));const i={root:"gov-blockquote"};const f=e(class e extends t{constructor(){super();this.__registerHost();this.type=a.SUBTLE;this.h=s(this.host)}render(){return o(c,{key:"c12f0f01c2db5025112edd1ebc834a18ff754546",class:this.h.classes(i.root),type:this.type},o("gov-icon",{key:"f043fdebbbd95c4eb3909985243f5ef253eb0335",type:"components",name:"quote",size:"3xl"}),o("blockquote",{key:"57cdec66772ad7732a79dd9a55cad1d9e5058ed7",cite:this.cite},o("slot",{key:"71a0e5ca7f377e22f4c12c44c517f142d45e47a9"})),o("slot",{key:"b0c7f4796b12e1baec71c03d20cb2ff99ae51311",name:"image"}),o("slot",{key:"55e5588b7e9793743a6b8ef403d363ddde8300d8",name:"author"}))}get host(){return this}},[4,"gov-blockquote",{type:[513],cite:[1]}]);function r(){if(typeof customElements==="undefined"){return}const e=["gov-blockquote","gov-icon"];e.forEach((e=>{switch(e){case"gov-blockquote":if(!customElements.get(e)){customElements.define(e,f)}break;case"gov-icon":if(!customElements.get(e)){n()}break}}))}r();const d=f;const b=r;export{d as GovBlockquote,b as defineCustomElement};
1
+ import{p as e,H as t,h as o,a as c}from"./index.js";import{g as s}from"./p-BHRF-5cf.js";import{d as n}from"./p-DRXiDAHW.js";var a;(function(e){e["PRIMARY"]="primary";e["SUBTLE"]="subtle";e["NEUTRAL"]="neutral"})(a||(a={}));const i={root:"gov-blockquote"};const f=e(class e extends t{constructor(){super();this.__registerHost();this.type=a.SUBTLE;this.h=s(this.host)}render(){return o(c,{key:"c12f0f01c2db5025112edd1ebc834a18ff754546",class:this.h.classes(i.root),type:this.type},o("gov-icon",{key:"f043fdebbbd95c4eb3909985243f5ef253eb0335",type:"components",name:"quote",size:"3xl"}),o("blockquote",{key:"57cdec66772ad7732a79dd9a55cad1d9e5058ed7",cite:this.cite},o("slot",{key:"71a0e5ca7f377e22f4c12c44c517f142d45e47a9"})),o("slot",{key:"b0c7f4796b12e1baec71c03d20cb2ff99ae51311",name:"image"}),o("slot",{key:"55e5588b7e9793743a6b8ef403d363ddde8300d8",name:"author"}))}get host(){return this}},[4,"gov-blockquote",{type:[513],cite:[1]}]);function r(){if(typeof customElements==="undefined"){return}const e=["gov-blockquote","gov-icon"];e.forEach((e=>{switch(e){case"gov-blockquote":if(!customElements.get(e)){customElements.define(e,f)}break;case"gov-icon":if(!customElements.get(e)){n()}break}}))}r();const d=f;const b=r;export{d as GovBlockquote,b as defineCustomElement};
2
2
  //# sourceMappingURL=gov-blockquote.js.map
@@ -1,2 +1,2 @@
1
- import{p as s,H as e,c as t,h as i,a}from"./index.js";import{a as c}from"./p-Nvj7WFs_.js";import{c as o}from"./p-DrPpH_9c.js";import{g as l}from"./p-BHRF-5cf.js";import{t as r}from"./p-Cjg0wpDG.js";import{d as n}from"./p-C_URF9Su.js";import{d as h}from"./p-CXPP9vec.js";const b={root:"gov-breadcrumbs"};const d=s(class s extends e{constructor(){super();this.__registerHost();this.govChange=t(this,"gov-change");this.inited=false;this.collapsible=false;this.isExpanded=false;this.accessibleToggleLabel="Zobrazit či skrýt navigaci";this.expanded=false;this.toggleOption=false;this.h=l(this.host)}async componentDidRender(){this.scheduleContentVerification();if(o()){r((()=>this.validateAccessibility()))}}scheduleContentVerification(){if(this.inited)return;this.inited=true;r((()=>{this.calculateWidthOfItems();this.inited=false}))}calculateWidthOfItems(){const s=this.host.getBoundingClientRect().width;let e=0;this.host.querySelectorAll("li").forEach((s=>{e+=s.getBoundingClientRect().width}));this.toggleOption=e>s}render(){return i(a,{key:"f8d5534c547e913a6ea57caafb588e00244f5c13",class:this.h.classes(b.root),expanded:this.expanded},i("nav",{key:"932e17955c6bdfb53339597b088519e91a5249f6","aria-label":this.accessibleLabel,"aria-labelledby":this.accessibleLabelledBy},i("slot",{key:"618bee35e6a66fad8fb7cf35485d101ce0b62ad4"})),this.toggleOption?i("gov-button",{size:"xs",color:"primary",type:"base","aria-label":this.accessibleToggleLabel,"aria-pressed":this.expanded,"aria-expanded":this.expanded,"on-gov-click":()=>this.expanded=!this.expanded},i("gov-icon",{name:this.expanded?"chevron-up":"chevron-down",type:"components"})):null)}async validateAccessibility(){c(this.accessibleLabel,this.accessibleLabelledBy,b.root,this.host);c(this.accessibleToggleLabel,undefined,b.root,this.host)}get host(){return this}},[4,"gov-breadcrumbs",{collapsible:[4],isExpanded:[4,"is-expanded"],accessibleLabel:[1,"accessible-label"],accessibleLabelledBy:[1,"accessible-labelledby"],accessibleToggleLabel:[1,"accessible-toggle-label"],expanded:[32],toggleOption:[32],validateAccessibility:[64]}]);function f(){if(typeof customElements==="undefined"){return}const s=["gov-breadcrumbs","gov-button","gov-icon"];s.forEach((s=>{switch(s){case"gov-breadcrumbs":if(!customElements.get(s)){customElements.define(s,d)}break;case"gov-button":if(!customElements.get(s)){n()}break;case"gov-icon":if(!customElements.get(s)){h()}break}}))}f();const m=d;const p=f;export{m as GovBreadcrumbs,p as defineCustomElement};
1
+ import{p as s,H as e,c as t,h as i,a}from"./index.js";import{a as o}from"./p-Nvj7WFs_.js";import{c}from"./p-DrPpH_9c.js";import{g as l}from"./p-BHRF-5cf.js";import{t as r}from"./p-Cjg0wpDG.js";import{d as n}from"./p-ClDhNt_H.js";import{d as h}from"./p-DRXiDAHW.js";const b={root:"gov-breadcrumbs"};const d=s(class s extends e{constructor(){super();this.__registerHost();this.govChange=t(this,"gov-change");this.inited=false;this.collapsible=false;this.isExpanded=false;this.accessibleToggleLabel="Zobrazit či skrýt navigaci";this.expanded=false;this.toggleOption=false;this.h=l(this.host)}async componentDidRender(){this.scheduleContentVerification();if(c()){r((()=>this.validateAccessibility()))}}scheduleContentVerification(){if(this.inited)return;this.inited=true;r((()=>{this.calculateWidthOfItems();this.inited=false}))}calculateWidthOfItems(){const s=this.host.getBoundingClientRect().width;let e=0;this.host.querySelectorAll("li").forEach((s=>{e+=s.getBoundingClientRect().width}));this.toggleOption=e>s}render(){return i(a,{key:"f8d5534c547e913a6ea57caafb588e00244f5c13",class:this.h.classes(b.root),expanded:this.expanded},i("nav",{key:"932e17955c6bdfb53339597b088519e91a5249f6","aria-label":this.accessibleLabel,"aria-labelledby":this.accessibleLabelledBy},i("slot",{key:"618bee35e6a66fad8fb7cf35485d101ce0b62ad4"})),this.toggleOption?i("gov-button",{size:"xs",color:"primary",type:"base","aria-label":this.accessibleToggleLabel,"aria-pressed":this.expanded,"aria-expanded":this.expanded,"on-gov-click":()=>this.expanded=!this.expanded},i("gov-icon",{name:this.expanded?"chevron-up":"chevron-down",type:"components"})):null)}async validateAccessibility(){o(this.accessibleLabel,this.accessibleLabelledBy,b.root,this.host);o(this.accessibleToggleLabel,undefined,b.root,this.host)}get host(){return this}},[4,"gov-breadcrumbs",{collapsible:[4],isExpanded:[4,"is-expanded"],accessibleLabel:[1,"accessible-label"],accessibleLabelledBy:[1,"accessible-labelledby"],accessibleToggleLabel:[1,"accessible-toggle-label"],expanded:[32],toggleOption:[32],validateAccessibility:[64]}]);function f(){if(typeof customElements==="undefined"){return}const s=["gov-breadcrumbs","gov-button","gov-icon"];s.forEach((s=>{switch(s){case"gov-breadcrumbs":if(!customElements.get(s)){customElements.define(s,d)}break;case"gov-button":if(!customElements.get(s)){n()}break;case"gov-icon":if(!customElements.get(s)){h()}break}}))}f();const m=d;const p=f;export{m as GovBreadcrumbs,p as defineCustomElement};
2
2
  //# sourceMappingURL=gov-breadcrumbs.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BreadcrumbsClass","root","GovBreadcrumbs","__stencil_proxyCustomElement","HTMLElement","constructor","this","inited","collapsible","isExpanded","accessibleToggleLabel","expanded","toggleOption","h","govHost","host","componentDidRender","scheduleContentVerification","canValidateWcagOnRender","tick","validateAccessibility","calculateWidthOfItems","hostWidth","getBoundingClientRect","width","sumOfWidths","querySelectorAll","forEach","li","render","Host","key","class","classes","accessibleLabel","accessibleLabelledBy","size","color","type","name","validateAccessibleLabel","undefined"],"sources":["../../../packages/core/src/components/gov-breadcrumbs/constants.ts","../../../packages/core/src/components/gov-breadcrumbs/gov-breadcrumbs.tsx"],"sourcesContent":["export const BreadcrumbsClass = {\n\troot: 'gov-breadcrumbs',\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State} from '@stencil/core'\nimport {BreadcrumbsClass} from './constants'\nimport {validateAccessibleLabel} from '../../helpers/Validate/wcag'\nimport {canValidateWcagOnRender} from '../../helpers/Dom/win'\nimport {GovBreadcrumbsChangeEvent} from './gov-breadcrumbs.d'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {tick} from \"../../utils/stencil.utils\";\n\n@Component({\n\ttag: 'gov-breadcrumbs',\n})\nexport class GovBreadcrumbs {\n\tprivate inited = false;\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() readonly host: HTMLGovBreadcrumbsElement\n\t/**\n\t * Defines whether the components can be collapsible when element doesn't fit in one row.\n\t */\n\t@Prop() readonly collapsible: boolean = false\n\t/**\n\t * Defines whether the breadcrumbs are open or closed by button\n\t */\n\t@Prop({attribute: 'is-expanded'}) readonly isExpanded: boolean = false\n\t/**\n\t * Adds accessible label for the pagination that is only shown for screen readers.\n\t */\n\t@Prop({attribute: 'accessible-label'}) readonly accessibleLabel: string\n\t/**\n\t * Indicates the id of a component that labels the pagination.\n\t */\n\t@Prop({attribute: 'accessible-labelledby'}) readonly accessibleLabelledBy: string\n\t/**\n\t * Adds an accessible label to display the full breadcrumb navigation that only screen readers can see.\n\t */\n\t@Prop({attribute: 'accessible-toggle-label'}) readonly accessibleToggleLabel: string = 'Zobrazit či skrýt navigaci'\n\t/**\n\t * Called when the Breadcrumbs state changes\n\t */\n\t@Event({eventName: 'gov-change'}) govChange: EventEmitter<GovBreadcrumbsChangeEvent>\n\n\t@State() expanded = false;\n\t@State() toggleOption = false;\n\n\tasync componentDidRender() {\n\t\tthis.scheduleContentVerification()\n\t\tif (canValidateWcagOnRender()) {\n\t\t\ttick(() => this.validateAccessibility())\n\t\t}\n\t}\n\n\tprivate scheduleContentVerification() {\n\t\tif (this.inited) return;\n\t\tthis.inited = true;\n\t\ttick(() => {\n\t\t\tthis.calculateWidthOfItems();\n\t\t\tthis.inited = false;\n\t\t});\n\t}\n\n\tprivate calculateWidthOfItems() {\n\t\tconst hostWidth = this.host.getBoundingClientRect().width;\n\t\tlet sumOfWidths = 0;\n\t\tthis.host.querySelectorAll('li').forEach((li) => {\n\t\t\tsumOfWidths += li.getBoundingClientRect().width\n\t\t})\n\t\tthis.toggleOption = sumOfWidths > hostWidth;\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(BreadcrumbsClass.root)} expanded={this.expanded}>\n\t\t\t\t<nav aria-label={this.accessibleLabel} aria-labelledby={this.accessibleLabelledBy}>\n\t\t\t\t\t<slot/>\n\t\t\t\t</nav>\n\t\t\t\t{this.toggleOption ? (\n\t\t\t\t\t<gov-button\n\t\t\t\t\t\tsize={'xs'}\n\t\t\t\t\t\tcolor={'primary'}\n\t\t\t\t\t\ttype={'base'}\n\t\t\t\t\t\taria-label={this.accessibleToggleLabel}\n\t\t\t\t\t\taria-pressed={this.expanded}\n\t\t\t\t\t\taria-expanded={this.expanded}\n\t\t\t\t\t\ton-gov-click={() => this.expanded = !this.expanded}\n\t\t\t\t\t>\n\t\t\t\t\t\t<gov-icon name={this.expanded ? 'chevron-up' : 'chevron-down'} type=\"components\"></gov-icon>\n\t\t\t\t\t</gov-button>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateAccessibility(): Promise<void> {\n\t\tvalidateAccessibleLabel(this.accessibleLabel, this.accessibleLabelledBy, BreadcrumbsClass.root, this.host)\n\t\tvalidateAccessibleLabel(this.accessibleToggleLabel, undefined, BreadcrumbsClass.root, this.host)\n\t}\n}\n"],"mappings":"8QAAO,MAAMA,EAAmB,CAC/BC,KAAM,mB,MCWMC,EAAcC,EAAA,MAAAD,UAAAE,EAI1B,WAAAC,G,kEAHQC,KAAMC,OAAG,MAWAD,KAAWE,YAAY,MAIGF,KAAUG,WAAY,MAYVH,KAAqBI,sBAAW,6BAM9EJ,KAAQK,SAAG,MACXL,KAAYM,aAAG,MA9BvBN,KAAKO,EAAIC,EAAQR,KAAKS,KACtB,CA+BD,wBAAMC,GACLV,KAAKW,8BACL,GAAIC,IAA2B,CAC9BC,GAAK,IAAMb,KAAKc,yB,EAIV,2BAAAH,GACP,GAAIX,KAAKC,OAAQ,OACjBD,KAAKC,OAAS,KACdY,GAAK,KACJb,KAAKe,wBACLf,KAAKC,OAAS,KAAK,G,CAIb,qBAAAc,GACP,MAAMC,EAAYhB,KAAKS,KAAKQ,wBAAwBC,MACpD,IAAIC,EAAc,EAClBnB,KAAKS,KAAKW,iBAAiB,MAAMC,SAASC,IACzCH,GAAeG,EAAGL,wBAAwBC,KAAK,IAEhDlB,KAAKM,aAAea,EAAcH,C,CAGnC,MAAAO,GACC,OACChB,EAACiB,EAAI,CAAAC,IAAA,2CAACC,MAAO1B,KAAKO,EAAEoB,QAAQjC,EAAiBC,MAAOU,SAAUL,KAAKK,UAClEE,EAAA,OAAAkB,IAAA,wDAAiBzB,KAAK4B,gBAAkC,kBAAA5B,KAAK6B,sBAC5DtB,EAAA,QAAAkB,IAAA,8CAEAzB,KAAKM,aACLC,EAAA,cACCuB,KAAM,KACNC,MAAO,UACPC,KAAM,OACM,aAAAhC,KAAKI,sBAAqB,eACxBJ,KAAKK,SACJ,gBAAAL,KAAKK,SAAQ,eACd,IAAML,KAAKK,UAAYL,KAAKK,UAE1CE,EAAU,YAAA0B,KAAMjC,KAAKK,SAAW,aAAe,eAAgB2B,KAAK,gBAElE,K,CAUP,2BAAMlB,GACLoB,EAAwBlC,KAAK4B,gBAAiB5B,KAAK6B,qBAAsBnC,EAAiBC,KAAMK,KAAKS,MACrGyB,EAAwBlC,KAAKI,sBAAuB+B,UAAWzC,EAAiBC,KAAMK,KAAKS,K","ignoreList":[]}
1
+ {"version":3,"names":["BreadcrumbsClass","root","GovBreadcrumbs","__stencil_proxyCustomElement","HTMLElement","constructor","this","inited","collapsible","isExpanded","accessibleToggleLabel","expanded","toggleOption","h","govHost","host","componentDidRender","scheduleContentVerification","canValidateWcagOnRender","tick","validateAccessibility","calculateWidthOfItems","hostWidth","getBoundingClientRect","width","sumOfWidths","querySelectorAll","forEach","li","render","Host","key","class","classes","accessibleLabel","accessibleLabelledBy","size","color","type","name","validateAccessibleLabel","undefined"],"sources":["../../../packages/core/src/components/gov-breadcrumbs/constants.ts","../../../packages/core/src/components/gov-breadcrumbs/gov-breadcrumbs.tsx"],"sourcesContent":["export const BreadcrumbsClass = {\n\troot: 'gov-breadcrumbs',\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State} from '@stencil/core'\nimport {BreadcrumbsClass} from './constants'\nimport {validateAccessibleLabel} from '../../helpers/Validate/wcag'\nimport {canValidateWcagOnRender} from '../../helpers/Dom/win'\nimport {GovBreadcrumbsChangeEvent} from './gov-breadcrumbs.d'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {tick} from \"../../utils/stencil.utils\";\n\n@Component({\n\ttag: 'gov-breadcrumbs',\n})\nexport class GovBreadcrumbs {\n\tprivate inited = false;\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() readonly host: HTMLGovBreadcrumbsElement\n\t/**\n\t * Defines whether the components can be collapsible when element doesn't fit in one row.\n\t */\n\t@Prop() readonly collapsible: boolean = false\n\t/**\n\t * Defines whether the breadcrumbs are open or closed by button\n\t */\n\t@Prop({attribute: 'is-expanded'}) readonly isExpanded: boolean = false\n\t/**\n\t * Adds accessible label for the pagination that is only shown for screen readers.\n\t */\n\t@Prop({attribute: 'accessible-label'}) readonly accessibleLabel: string\n\t/**\n\t * Indicates the id of a component that labels the pagination.\n\t */\n\t@Prop({attribute: 'accessible-labelledby'}) readonly accessibleLabelledBy: string\n\t/**\n\t * Adds an accessible label to display the full breadcrumb navigation that only screen readers can see.\n\t */\n\t@Prop({attribute: 'accessible-toggle-label'}) readonly accessibleToggleLabel: string = 'Zobrazit či skrýt navigaci'\n\t/**\n\t * Called when the Breadcrumbs state changes\n\t */\n\t@Event({eventName: 'gov-change'}) govChange: EventEmitter<GovBreadcrumbsChangeEvent>\n\n\t@State() expanded = false;\n\t@State() toggleOption = false;\n\n\tasync componentDidRender() {\n\t\tthis.scheduleContentVerification()\n\t\tif (canValidateWcagOnRender()) {\n\t\t\ttick(() => this.validateAccessibility())\n\t\t}\n\t}\n\n\tprivate scheduleContentVerification() {\n\t\tif (this.inited) return;\n\t\tthis.inited = true;\n\t\ttick(() => {\n\t\t\tthis.calculateWidthOfItems();\n\t\t\tthis.inited = false;\n\t\t});\n\t}\n\n\tprivate calculateWidthOfItems() {\n\t\tconst hostWidth = this.host.getBoundingClientRect().width;\n\t\tlet sumOfWidths = 0;\n\t\tthis.host.querySelectorAll('li').forEach((li) => {\n\t\t\tsumOfWidths += li.getBoundingClientRect().width\n\t\t})\n\t\tthis.toggleOption = sumOfWidths > hostWidth;\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(BreadcrumbsClass.root)} expanded={this.expanded}>\n\t\t\t\t<nav aria-label={this.accessibleLabel} aria-labelledby={this.accessibleLabelledBy}>\n\t\t\t\t\t<slot/>\n\t\t\t\t</nav>\n\t\t\t\t{this.toggleOption ? (\n\t\t\t\t\t<gov-button\n\t\t\t\t\t\tsize={'xs'}\n\t\t\t\t\t\tcolor={'primary'}\n\t\t\t\t\t\ttype={'base'}\n\t\t\t\t\t\taria-label={this.accessibleToggleLabel}\n\t\t\t\t\t\taria-pressed={this.expanded}\n\t\t\t\t\t\taria-expanded={this.expanded}\n\t\t\t\t\t\ton-gov-click={() => this.expanded = !this.expanded}\n\t\t\t\t\t>\n\t\t\t\t\t\t<gov-icon name={this.expanded ? 'chevron-up' : 'chevron-down'} type=\"components\"></gov-icon>\n\t\t\t\t\t</gov-button>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateAccessibility(): Promise<void> {\n\t\tvalidateAccessibleLabel(this.accessibleLabel, this.accessibleLabelledBy, BreadcrumbsClass.root, this.host)\n\t\tvalidateAccessibleLabel(this.accessibleToggleLabel, undefined, BreadcrumbsClass.root, this.host)\n\t}\n}\n"],"mappings":"yQAAO,MAAMA,EAAmB,CAC/BC,KAAM,mB,MCWMC,EAAcC,EAAA,MAAAD,UAAAE,EAI1B,WAAAC,G,kEAHQC,KAAMC,OAAG,MAWAD,KAAWE,YAAY,MAIGF,KAAUG,WAAY,MAYVH,KAAqBI,sBAAW,6BAM9EJ,KAAQK,SAAG,MACXL,KAAYM,aAAG,MA9BvBN,KAAKO,EAAIC,EAAQR,KAAKS,KACtB,CA+BD,wBAAMC,GACLV,KAAKW,8BACL,GAAIC,IAA2B,CAC9BC,GAAK,IAAMb,KAAKc,yB,EAIV,2BAAAH,GACP,GAAIX,KAAKC,OAAQ,OACjBD,KAAKC,OAAS,KACdY,GAAK,KACJb,KAAKe,wBACLf,KAAKC,OAAS,KAAK,G,CAIb,qBAAAc,GACP,MAAMC,EAAYhB,KAAKS,KAAKQ,wBAAwBC,MACpD,IAAIC,EAAc,EAClBnB,KAAKS,KAAKW,iBAAiB,MAAMC,SAASC,IACzCH,GAAeG,EAAGL,wBAAwBC,KAAK,IAEhDlB,KAAKM,aAAea,EAAcH,C,CAGnC,MAAAO,GACC,OACChB,EAACiB,EAAI,CAAAC,IAAA,2CAACC,MAAO1B,KAAKO,EAAEoB,QAAQjC,EAAiBC,MAAOU,SAAUL,KAAKK,UAClEE,EAAA,OAAAkB,IAAA,wDAAiBzB,KAAK4B,gBAAkC,kBAAA5B,KAAK6B,sBAC5DtB,EAAA,QAAAkB,IAAA,8CAEAzB,KAAKM,aACLC,EAAA,cACCuB,KAAM,KACNC,MAAO,UACPC,KAAM,OACM,aAAAhC,KAAKI,sBAAqB,eACxBJ,KAAKK,SACJ,gBAAAL,KAAKK,SAAQ,eACd,IAAML,KAAKK,UAAYL,KAAKK,UAE1CE,EAAU,YAAA0B,KAAMjC,KAAKK,SAAW,aAAe,eAAgB2B,KAAK,gBAElE,K,CAUP,2BAAMlB,GACLoB,EAAwBlC,KAAK4B,gBAAiB5B,KAAK6B,qBAAsBnC,EAAiBC,KAAMK,KAAKS,MACrGyB,EAAwBlC,KAAKI,sBAAuB+B,UAAWzC,EAAiBC,KAAMK,KAAKS,K","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{G as o,d as s}from"./p-C_URF9Su.js";const t=o;const p=s;export{t as GovButton,p as defineCustomElement};
1
+ import{G as o,d as s}from"./p-ClDhNt_H.js";const t=o;const p=s;export{t as GovButton,p as defineCustomElement};
2
2
  //# sourceMappingURL=gov-button.js.map
@@ -1,2 +1,2 @@
1
- import{p as e,H as s,c as i,h as t,a}from"./index.js";import{g as c,c as o}from"./p-BHRF-5cf.js";import{c as d}from"./p-vN03FcXN.js";import{a as n}from"./p-Nvj7WFs_.js";import{c as r}from"./p-DrPpH_9c.js";import{d as l}from"./p-CQvUntGY.js";import{d as h}from"./p-CXPP9vec.js";var f;(function(e){e["HORIZONTAL"]="horizontal";e["VERTICAL"]="vertical"})(f||(f={}));const b={root:"gov-card",header:"gov-card__header",arrow:"gov-card__arrow",inner:"gov-card__inner",img:"gov-card__img",icon:"gov-card__icon",content:"gov-card__content",footer:"gov-card__footer"};var m;(function(e){e["A"]="a";e["DIV"]="div"})(m||(m={}));const v=e(class e extends s{constructor(){super();this.__registerHost();this.govToggle=i(this,"gov-toggle");this.hydrated=false;this.direction="vertical";this.collapsible=false;this.clickable=false;this.open=true;this.h=c(this.host);this.headlineId=d("GovCardHeadline");this.contentId=d("GovCardContent")}async componentDidRender(){if(r()){await l(500);await this.validateAccessibility()}}connectedCallback(){this.hydrated=true}render(){const e=this.href?m.A:m.DIV;return t(a,{key:"8e06f44b5b92bdbbdd47121d3e136485b83ce64e",class:this.h.classes(b.root),open:this.open,collapsible:o(this.collapsible),clickable:this.clickable,direction:this.direction,hydrated:this.hydrated},this.collapsible?t("button",{id:this.headlineId,class:b.header,"aria-label":this.accessibleTriggerLabel,"aria-labelledby":this.accessibleTriggerLabelledBy,"aria-expanded":o(this.open),"aria-controls":this.contentId,onClick:this.onClickHandler.bind(this)},t("slot",{name:"headline"}),t("gov-icon",{class:b.arrow,name:"chevron-down",type:"components"})):this.h.hasSlot("headline")?t("div",{class:b.header},t("slot",{name:"headline"})):null,t(e,{key:"e10c86ffa82d2e6227f0212295f4eed2ec68adac",href:this.href,target:this.target,id:this.contentId,"aria-hidden":this.collapsible?o(!this.open):undefined,hidden:this.collapsible?!this.open:undefined,"aria-labelledby":this.collapsible?this.headlineId:undefined,class:b.inner},this.h.hasSlot("img")&&t("div",{key:"f3c3a6f840fb6c8c6a4816e821bc3678fb696140",class:b.img},t("slot",{key:"d935568b7eeab4ce60cd699c301bf735a62e8862",name:"img"})),this.h.hasSlot("icon")&&t("div",{key:"a11162b8aa9820facd7e141cecd95327c1d299f4",class:b.icon},t("slot",{key:"e8dbb0a3e4f24eeed4254f8b91e9491029eb0221",name:"icon"})),t("div",{key:"76953be0ece73a123389d5d3e5f5accf5da9fd27",class:b.content},t("slot",{key:"a424223d3cd41e382cb97685c40a11ac43c8f836"})),this.h.hasSlot("footer")&&t("div",{key:"4ab1cfaa4d814f1bf693b44c4a56169caf8cea45",class:b.footer},t("slot",{key:"3427ccf260355c8b8b3b8d1dea54d8e82ec44da5",name:"footer"}))))}onClickHandler(e){e.stopPropagation();if(this.collapsible){this.open=!this.open;this.govToggle.emit({open:this.open,element:this.host})}}async validateAccessibility(){if(this.collapsible){n(this.accessibleTriggerLabel,this.accessibleTriggerLabelledBy,b.root,this.host)}}get host(){return this}},[4,"gov-card",{direction:[1],collapsible:[4],clickable:[4],open:[1540],href:[513],target:[1],accessibleTriggerLabel:[1,"accessible-label"],accessibleTriggerLabelledBy:[1,"accessible-labelledby"],validateAccessibility:[64]}]);function g(){if(typeof customElements==="undefined"){return}const e=["gov-card","gov-icon"];e.forEach((e=>{switch(e){case"gov-card":if(!customElements.get(e)){customElements.define(e,v)}break;case"gov-icon":if(!customElements.get(e)){h()}break}}))}g();const p=v;const y=g;export{p as GovCard,y as defineCustomElement};
1
+ import{p as e,H as i,c as s,h as t,a}from"./index.js";import{g as c,c as o}from"./p-BHRF-5cf.js";import{c as d}from"./p-vN03FcXN.js";import{a as n}from"./p-Nvj7WFs_.js";import{c as r}from"./p-DrPpH_9c.js";import{d as l}from"./p-CQvUntGY.js";import{d as h}from"./p-DRXiDAHW.js";var f;(function(e){e["HORIZONTAL"]="horizontal";e["VERTICAL"]="vertical"})(f||(f={}));const b={root:"gov-card",header:"gov-card__header",arrow:"gov-card__arrow",inner:"gov-card__inner",img:"gov-card__img",icon:"gov-card__icon",content:"gov-card__content",footer:"gov-card__footer"};var m;(function(e){e["A"]="a";e["DIV"]="div"})(m||(m={}));const v=e(class e extends i{constructor(){super();this.__registerHost();this.govToggle=s(this,"gov-toggle");this.hydrated=false;this.direction="vertical";this.collapsible=false;this.clickable=false;this.open=true;this.h=c(this.host);this.headlineId=d("GovCardHeadline");this.contentId=d("GovCardContent")}async componentDidRender(){if(r()){await l(500);await this.validateAccessibility()}}connectedCallback(){this.hydrated=true}render(){const e=this.href?m.A:m.DIV;return t(a,{key:"8e06f44b5b92bdbbdd47121d3e136485b83ce64e",class:this.h.classes(b.root),open:this.open,collapsible:o(this.collapsible),clickable:this.clickable,direction:this.direction,hydrated:this.hydrated},this.collapsible?t("button",{id:this.headlineId,class:b.header,"aria-label":this.accessibleTriggerLabel,"aria-labelledby":this.accessibleTriggerLabelledBy,"aria-expanded":o(this.open),"aria-controls":this.contentId,onClick:this.onClickHandler.bind(this)},t("slot",{name:"headline"}),t("gov-icon",{class:b.arrow,name:"chevron-down",type:"components"})):this.h.hasSlot("headline")?t("div",{class:b.header},t("slot",{name:"headline"})):null,t(e,{key:"e10c86ffa82d2e6227f0212295f4eed2ec68adac",href:this.href,target:this.target,id:this.contentId,"aria-hidden":this.collapsible?o(!this.open):undefined,hidden:this.collapsible?!this.open:undefined,"aria-labelledby":this.collapsible?this.headlineId:undefined,class:b.inner},this.h.hasSlot("img")&&t("div",{key:"f3c3a6f840fb6c8c6a4816e821bc3678fb696140",class:b.img},t("slot",{key:"d935568b7eeab4ce60cd699c301bf735a62e8862",name:"img"})),this.h.hasSlot("icon")&&t("div",{key:"a11162b8aa9820facd7e141cecd95327c1d299f4",class:b.icon},t("slot",{key:"e8dbb0a3e4f24eeed4254f8b91e9491029eb0221",name:"icon"})),t("div",{key:"76953be0ece73a123389d5d3e5f5accf5da9fd27",class:b.content},t("slot",{key:"a424223d3cd41e382cb97685c40a11ac43c8f836"})),this.h.hasSlot("footer")&&t("div",{key:"4ab1cfaa4d814f1bf693b44c4a56169caf8cea45",class:b.footer},t("slot",{key:"3427ccf260355c8b8b3b8d1dea54d8e82ec44da5",name:"footer"}))))}onClickHandler(e){e.stopPropagation();if(this.collapsible){this.open=!this.open;this.govToggle.emit({open:this.open,element:this.host})}}async validateAccessibility(){if(this.collapsible){n(this.accessibleTriggerLabel,this.accessibleTriggerLabelledBy,b.root,this.host)}}get host(){return this}},[4,"gov-card",{direction:[1],collapsible:[4],clickable:[4],open:[1540],href:[513],target:[1],accessibleTriggerLabel:[1,"accessible-label"],accessibleTriggerLabelledBy:[1,"accessible-labelledby"],validateAccessibility:[64]}]);function g(){if(typeof customElements==="undefined"){return}const e=["gov-card","gov-icon"];e.forEach((e=>{switch(e){case"gov-card":if(!customElements.get(e)){customElements.define(e,v)}break;case"gov-icon":if(!customElements.get(e)){h()}break}}))}g();const p=v;const y=g;export{p as GovCard,y as defineCustomElement};
2
2
  //# sourceMappingURL=gov-card.js.map
@@ -1,2 +1,2 @@
1
- import{G as o,d as s}from"./p-ibUK7mfI.js";const t=o;const m=s;export{t as GovChip,m as defineCustomElement};
1
+ import{G as o,d as s}from"./p-BGK46VRO.js";const t=o;const p=s;export{t as GovChip,p as defineCustomElement};
2
2
  //# sourceMappingURL=gov-chip.js.map
@@ -1,2 +1,2 @@
1
- import{p as t,H as s,h as i,a as e}from"./index.js";import{p as o}from"./p-CQvUntGY.js";import{S as a}from"./p-BcQO4NH2.js";import{g as n,c}from"./p-BHRF-5cf.js";import{v as d}from"./p-BKP-F1qP.js";import{A as l,a as r,i as h}from"./p-CXgom82_.js";import{c as f}from"./p-vN03FcXN.js";import{d as p}from"./p-C_URF9Su.js";import{d as b}from"./p-CXPP9vec.js";const m=o(a,["_XS","_S","_M","_L","_XL"]);var v;(function(t){t["DOWN"]="down";t["UP"]="up"})(v||(v={}));const u={root:"gov-collapsible",content:"gov-collapsible__content",disabled:"gov-collapsible--disabled"};const g=t(class t extends s{constructor(){super();this.__registerHost();this.hydrated=false;this.size="m";this.disabled=false;this.open=false;this.inheritedAttributes={};this.h=n(this.host);this.triggerId=f("GovCollapsibleControl");this.contentId=f("GovCollapsibleContent")}validateSize(t){d(m,t,u.root)}componentDidLoad(){this.attributeObserver=new l(this.host,((t,s)=>{this.onAriaAttributeChange(t,s)}));this.attributeObserver.startObserving(r)}componentWillLoad(){this.validateSize(this.size);this.inheritedAttributes=h(this.host)}onAriaAttributeChange(t,s){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:s})}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}connectedCallback(){this.hydrated=true}render(){return i(e,{key:"769978332f69d9faf2a4e8b305db730f30aff4ef",hydrated:this.hydrated,class:this.h.classes([u.root,this.disabled&&u.disabled]),size:this.size},i("gov-button",Object.assign({key:"8471245d9dd22f5599d234f86b7bf2127d8632ac",color:"primary",size:this.size,type:"link",disabled:this.disabled,"onGov-click":t=>{t.stopPropagation();t.preventDefault();this.open=!this.open}},this.inheritedAttributes,{identifier:this.triggerId,"aria-controls":this.contentId,"aria-expanded":c(this.open),"aria-haspopup":"true"}),this.label,i("gov-icon",{key:"01d4627f3817249e3653f8a2fdf0cc2d2d2ad36a",slot:"icon-end",name:this.open?"chevron-up":"chevron-down",type:"components"})),i("div",{key:"0d680443f3fa888d753aaf0090e9c4da177dbf7b",class:u.content,hidden:!this.open,id:this.contentId,"aria-labelledby":this.triggerId,"aria-hidden":c(!this.open)},i("slot",{key:"4b3c64ff8fb7f6d6039d9042328121207ccf7580"})))}get host(){return this}static get watchers(){return{size:["validateSize"]}}},[4,"gov-collapsible",{size:[1],identifier:[1],label:[1],disabled:[4],open:[1028],inheritedAttributes:[32]},undefined,{size:["validateSize"]}]);function j(){if(typeof customElements==="undefined"){return}const t=["gov-collapsible","gov-button","gov-icon"];t.forEach((t=>{switch(t){case"gov-collapsible":if(!customElements.get(t)){customElements.define(t,g)}break;case"gov-button":if(!customElements.get(t)){p()}break;case"gov-icon":if(!customElements.get(t)){b()}break}}))}j();const k=g;const y=j;export{k as GovCollapsible,y as defineCustomElement};
1
+ import{p as t,H as s,h as i,a as e}from"./index.js";import{p as o}from"./p-CQvUntGY.js";import{S as a}from"./p-BcQO4NH2.js";import{g as n,c}from"./p-BHRF-5cf.js";import{v as d}from"./p-BKP-F1qP.js";import{A as l,a as r,i as h}from"./p-CXgom82_.js";import{c as f}from"./p-vN03FcXN.js";import{d as p}from"./p-ClDhNt_H.js";import{d as b}from"./p-DRXiDAHW.js";const m=o(a,["_XS","_S","_M","_L","_XL"]);var v;(function(t){t["DOWN"]="down";t["UP"]="up"})(v||(v={}));const u={root:"gov-collapsible",content:"gov-collapsible__content",disabled:"gov-collapsible--disabled"};const g=t(class t extends s{constructor(){super();this.__registerHost();this.hydrated=false;this.size="m";this.disabled=false;this.open=false;this.inheritedAttributes={};this.h=n(this.host);this.triggerId=f("GovCollapsibleControl");this.contentId=f("GovCollapsibleContent")}validateSize(t){d(m,t,u.root)}componentDidLoad(){this.attributeObserver=new l(this.host,((t,s)=>{this.onAriaAttributeChange(t,s)}));this.attributeObserver.startObserving(r)}componentWillLoad(){this.validateSize(this.size);this.inheritedAttributes=h(this.host)}onAriaAttributeChange(t,s){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:s})}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}connectedCallback(){this.hydrated=true}render(){return i(e,{key:"769978332f69d9faf2a4e8b305db730f30aff4ef",hydrated:this.hydrated,class:this.h.classes([u.root,this.disabled&&u.disabled]),size:this.size},i("gov-button",Object.assign({key:"8471245d9dd22f5599d234f86b7bf2127d8632ac",color:"primary",size:this.size,type:"link",disabled:this.disabled,"onGov-click":t=>{t.stopPropagation();t.preventDefault();this.open=!this.open}},this.inheritedAttributes,{identifier:this.triggerId,"aria-controls":this.contentId,"aria-expanded":c(this.open),"aria-haspopup":"true"}),this.label,i("gov-icon",{key:"01d4627f3817249e3653f8a2fdf0cc2d2d2ad36a",slot:"icon-end",name:this.open?"chevron-up":"chevron-down",type:"components"})),i("div",{key:"0d680443f3fa888d753aaf0090e9c4da177dbf7b",class:u.content,hidden:!this.open,id:this.contentId,"aria-labelledby":this.triggerId,"aria-hidden":c(!this.open)},i("slot",{key:"4b3c64ff8fb7f6d6039d9042328121207ccf7580"})))}get host(){return this}static get watchers(){return{size:["validateSize"]}}},[4,"gov-collapsible",{size:[1],identifier:[1],label:[1],disabled:[4],open:[1028],inheritedAttributes:[32]},undefined,{size:["validateSize"]}]);function j(){if(typeof customElements==="undefined"){return}const t=["gov-collapsible","gov-button","gov-icon"];t.forEach((t=>{switch(t){case"gov-collapsible":if(!customElements.get(t)){customElements.define(t,g)}break;case"gov-button":if(!customElements.get(t)){p()}break;case"gov-icon":if(!customElements.get(t)){b()}break}}))}j();const k=g;const y=j;export{k as GovCollapsible,y as defineCustomElement};
2
2
  //# sourceMappingURL=gov-collapsible.js.map
@@ -1,2 +1,2 @@
1
- import{p as e,H as s,c as t,h as i,a}from"./index.js";import{g as o,t as c,d as l}from"./p-BHRF-5cf.js";import{c as d}from"./p-DrPpH_9c.js";import{b}from"./p-Nvj7WFs_.js";import{c as n}from"./p-vN03FcXN.js";import{t as f}from"./p-Cjg0wpDG.js";import{d as h}from"./p-CnKqUwf9.js";import{d as r}from"./p-C_URF9Su.js";import{d as g}from"./p-CXPP9vec.js";const p={root:"gov-dialog",dialog:"gov-dialog__dialog",inner:"gov-dialog__inner",header:"gov-dialog__header",title:"gov-dialog__title",content:"gov-dialog__content",close:"gov-dialog__close",footer:"gov-dialog__footer",bodyFix:"body-fixed"};function m(e){if(!e)return[];return Array.from(e.querySelectorAll('a[href], button:not([disabled]), textarea, input:not([type="hidden"]), select, [tabindex]:not([tabindex="-1"])'))}const v=e(class e extends s{constructor(){super();this.__registerHost();this.govClose=t(this,"gov-close");this.hydrated=false;this.open=false;this.blockClose=false;this.blockBackdropClose=false;this.role="dialog";this.labelTag="h2";this.accessibleCloseLabel="Zavřít okno";this.h=o(this.host);this.labelId=n("GovDialogLabel");this.contentId=n("GovDialogContent")}watchOpen(e){var s;this.open=e;this.setFocus().finally();if(!e){(s=this.lastActiveElementRef)===null||s===void 0?void 0:s.focus()}else{this.focusTrap()}}showDialog(){this.open=true;document.body.classList.add(p.bodyFix)}hideDialog(){this.open=false;document.body.classList.remove(p.bodyFix)}async componentDidRender(){if(d()){f((()=>this.validateAccessibility()))}if(this.open){this.showDialog()}else{this.hideDialog()}}focusTrap(){var e;if(open&&this.dialogRef){this.lastActiveElementRef=document.activeElement;const e=m(this.dialogRef);if(e.length){e[0].focus()}const s=e=>{if(e.key==="Tab"&&this.dialogRef){const s=m(this.dialogRef);const t=s[0];const i=s[s.length-1];if(!e.shiftKey&&document.activeElement===i){e.preventDefault();t.focus()}if(e.shiftKey&&document.activeElement===t){e.preventDefault();i.focus()}}if(e.key==="Escape"){if(this.blockClose===false){this.hideDialog();this.govClose.emit()}}};document.addEventListener("keydown",s)}else{(e=this.lastActiveElementRef)===null||e===void 0?void 0:e.focus()}}connectedCallback(){this.hydrated=true}disconnectedCallback(){document.body.classList.remove(p.bodyFix)}render(){return i(a,{key:"1b4a7fbbf75675be26754a29aeadf8943af6e372",class:this.h.classes(p.root),open:this.open,hydrated:this.hydrated},i("dialog",{key:"75df8bc2428485b6bc5a2ed21f334ff897a26f19",ref:e=>this.dialogRef=e,class:p.dialog,hidden:!this.open,tabindex:l(this.open),open:this.open,"aria-modal":"true","aria-hidden":c(!this.open),"aria-labelledby":this.accessibleLabelledBy||this.labelId,"aria-describedby":this.accessibleDescribedBy||this.contentId,role:this.role},i("div",{key:"7a8c1ff8172fcb3e2e6ed342baf38018b7603b4c",class:p.inner},i("div",{key:"b84fec4ad89efe420beede090a20bfdff6f47457",class:p.header},this.h.hasSlot("icon")&&i("span",{key:"931cc48c446af90837a58bd83bfc30e9c54ad787"},i("slot",{key:"088523bcc3debf0144195c21faa89f9f5ab8dd31",name:"icon"})),this.h.hasSlot("title")&&i("span",{key:"d38ca38a8b269f5a4f18ea2c8b0d833ac1614f43",class:p.title,id:this.labelId},i("slot",{key:"7bdc841090ba66fb9dab50d3ae1af8308fd4dddb",name:"title"})),i("gov-button",{key:"89dddfec62b770915b1e841b65a3727a399ac454",ref:e=>this.closeCtaRef=e,disabled:this.blockClose,class:p.close,color:"primary","aria-label":this.accessibleCloseLabel,"aria-labelledby":this.accessibleCloseLabelledBy,type:"base",size:"m","on-gov-click":this.onCloseHandler.bind(this)},i("gov-icon",{key:"b4446a4fb10351aa2c263c1e09c7f821096e780f",slot:"icon-start",name:"x-lg",type:"components"}))),i("div",{key:"5c2a71245e7cd6e5ffebc317b79c16b299de1674",class:p.content,id:this.contentId},i("slot",{key:"d2bb335499547d7799316f2c9016569375eed7f4"})),this.h.hasSlot("footer")&&i("div",{key:"154d7917e898162f0fdaad2fa4007fccdec820c6",class:p.footer},i("slot",{key:"45272652b42b67f1f1bc88f256c20eba35fe1f69",name:"footer"})))),this.open?i("gov-backdrop",{disabled:this.blockBackdropClose,"aria-label":this.accessibleCloseLabel,"aria-labelled-by":this.accessibleCloseLabelledBy,"on-gov-click":this.onCloseHandler.bind(this)}):null)}onCloseHandler(e){e.stopPropagation();e.preventDefault();if(this.blockClose===false){this.hideDialog();this.govClose.emit(e)}}async setFocus(){if(this.open&&this.closeCtaRef){this.closeCtaRef.setFocus().catch()}}async validateAccessibility(){b(this.accessibleLabelledBy,"accessible-labelled-by",p.root);b(this.accessibleDescribedBy,"accessible-described-by",p.root)}get host(){return this}static get watchers(){return{open:["watchOpen"]}}},[4,"gov-dialog",{open:[1540],blockClose:[4,"block-close"],blockBackdropClose:[4,"block-backdrop-close"],role:[1],labelTag:[1,"label-tag"],accessibleLabelledBy:[1,"accessible-labelled-by"],accessibleDescribedBy:[1,"accessible-described-by"],accessibleCloseLabel:[1,"accessible-close-label"],accessibleCloseLabelledBy:[1,"accessible-close-labelled-by"],setFocus:[64],validateAccessibility:[64]},undefined,{open:["watchOpen"]}]);function y(){if(typeof customElements==="undefined"){return}const e=["gov-dialog","gov-backdrop","gov-button","gov-icon"];e.forEach((e=>{switch(e){case"gov-dialog":if(!customElements.get(e)){customElements.define(e,v)}break;case"gov-backdrop":if(!customElements.get(e)){h()}break;case"gov-button":if(!customElements.get(e)){r()}break;case"gov-icon":if(!customElements.get(e)){g()}break}}))}y();const u=v;const k=y;export{u as GovDialog,k as defineCustomElement};
1
+ import{p as e,H as s,c as t,h as i,a}from"./index.js";import{g as o,t as c,d as l}from"./p-BHRF-5cf.js";import{c as d}from"./p-DrPpH_9c.js";import{b}from"./p-Nvj7WFs_.js";import{c as n}from"./p-vN03FcXN.js";import{t as f}from"./p-Cjg0wpDG.js";import{d as h}from"./p-CnKqUwf9.js";import{d as r}from"./p-ClDhNt_H.js";import{d as g}from"./p-DRXiDAHW.js";const p={root:"gov-dialog",dialog:"gov-dialog__dialog",inner:"gov-dialog__inner",header:"gov-dialog__header",title:"gov-dialog__title",content:"gov-dialog__content",close:"gov-dialog__close",footer:"gov-dialog__footer",bodyFix:"body-fixed"};function m(e){if(!e)return[];return Array.from(e.querySelectorAll('a[href], button:not([disabled]), textarea, input:not([type="hidden"]), select, [tabindex]:not([tabindex="-1"])'))}const y=e(class e extends s{constructor(){super();this.__registerHost();this.govClose=t(this,"gov-close");this.hydrated=false;this.open=false;this.blockClose=false;this.blockBackdropClose=false;this.role="dialog";this.labelTag="h2";this.accessibleCloseLabel="Zavřít okno";this.h=o(this.host);this.labelId=n("GovDialogLabel");this.contentId=n("GovDialogContent")}watchOpen(e){var s;this.open=e;this.setFocus().finally();if(!e){(s=this.lastActiveElementRef)===null||s===void 0?void 0:s.focus()}else{this.focusTrap()}}showDialog(){this.open=true;document.body.classList.add(p.bodyFix)}hideDialog(){this.open=false;document.body.classList.remove(p.bodyFix)}async componentDidRender(){if(d()){f((()=>this.validateAccessibility()))}if(this.open){this.showDialog()}else{this.hideDialog()}}focusTrap(){var e;if(open&&this.dialogRef){this.lastActiveElementRef=document.activeElement;const e=m(this.dialogRef);if(e.length){e[0].focus()}const s=e=>{if(e.key==="Tab"&&this.dialogRef){const s=m(this.dialogRef);const t=s[0];const i=s[s.length-1];if(!e.shiftKey&&document.activeElement===i){e.preventDefault();t.focus()}if(e.shiftKey&&document.activeElement===t){e.preventDefault();i.focus()}}if(e.key==="Escape"){if(this.blockClose===false){this.hideDialog();this.govClose.emit()}}};document.addEventListener("keydown",s)}else{(e=this.lastActiveElementRef)===null||e===void 0?void 0:e.focus()}}connectedCallback(){this.hydrated=true}disconnectedCallback(){document.body.classList.remove(p.bodyFix)}render(){return i(a,{key:"1b4a7fbbf75675be26754a29aeadf8943af6e372",class:this.h.classes(p.root),open:this.open,hydrated:this.hydrated},i("dialog",{key:"75df8bc2428485b6bc5a2ed21f334ff897a26f19",ref:e=>this.dialogRef=e,class:p.dialog,hidden:!this.open,tabindex:l(this.open),open:this.open,"aria-modal":"true","aria-hidden":c(!this.open),"aria-labelledby":this.accessibleLabelledBy||this.labelId,"aria-describedby":this.accessibleDescribedBy||this.contentId,role:this.role},i("div",{key:"7a8c1ff8172fcb3e2e6ed342baf38018b7603b4c",class:p.inner},i("div",{key:"b84fec4ad89efe420beede090a20bfdff6f47457",class:p.header},this.h.hasSlot("icon")&&i("span",{key:"931cc48c446af90837a58bd83bfc30e9c54ad787"},i("slot",{key:"088523bcc3debf0144195c21faa89f9f5ab8dd31",name:"icon"})),this.h.hasSlot("title")&&i("span",{key:"d38ca38a8b269f5a4f18ea2c8b0d833ac1614f43",class:p.title,id:this.labelId},i("slot",{key:"7bdc841090ba66fb9dab50d3ae1af8308fd4dddb",name:"title"})),i("gov-button",{key:"89dddfec62b770915b1e841b65a3727a399ac454",ref:e=>this.closeCtaRef=e,disabled:this.blockClose,class:p.close,color:"primary","aria-label":this.accessibleCloseLabel,"aria-labelledby":this.accessibleCloseLabelledBy,type:"base",size:"m","on-gov-click":this.onCloseHandler.bind(this)},i("gov-icon",{key:"b4446a4fb10351aa2c263c1e09c7f821096e780f",slot:"icon-start",name:"x-lg",type:"components"}))),i("div",{key:"5c2a71245e7cd6e5ffebc317b79c16b299de1674",class:p.content,id:this.contentId},i("slot",{key:"d2bb335499547d7799316f2c9016569375eed7f4"})),this.h.hasSlot("footer")&&i("div",{key:"154d7917e898162f0fdaad2fa4007fccdec820c6",class:p.footer},i("slot",{key:"45272652b42b67f1f1bc88f256c20eba35fe1f69",name:"footer"})))),this.open?i("gov-backdrop",{disabled:this.blockBackdropClose,"aria-label":this.accessibleCloseLabel,"aria-labelled-by":this.accessibleCloseLabelledBy,"on-gov-click":this.onCloseHandler.bind(this)}):null)}onCloseHandler(e){e.stopPropagation();e.preventDefault();if(this.blockClose===false){this.hideDialog();this.govClose.emit(e)}}async setFocus(){if(this.open&&this.closeCtaRef){this.closeCtaRef.setFocus().catch()}}async validateAccessibility(){b(this.accessibleLabelledBy,"accessible-labelled-by",p.root);b(this.accessibleDescribedBy,"accessible-described-by",p.root)}get host(){return this}static get watchers(){return{open:["watchOpen"]}}},[4,"gov-dialog",{open:[1540],blockClose:[4,"block-close"],blockBackdropClose:[4,"block-backdrop-close"],role:[1],labelTag:[1,"label-tag"],accessibleLabelledBy:[1,"accessible-labelled-by"],accessibleDescribedBy:[1,"accessible-described-by"],accessibleCloseLabel:[1,"accessible-close-label"],accessibleCloseLabelledBy:[1,"accessible-close-labelled-by"],setFocus:[64],validateAccessibility:[64]},undefined,{open:["watchOpen"]}]);function v(){if(typeof customElements==="undefined"){return}const e=["gov-dialog","gov-backdrop","gov-button","gov-icon"];e.forEach((e=>{switch(e){case"gov-dialog":if(!customElements.get(e)){customElements.define(e,y)}break;case"gov-backdrop":if(!customElements.get(e)){h()}break;case"gov-button":if(!customElements.get(e)){r()}break;case"gov-icon":if(!customElements.get(e)){g()}break}}))}v();const u=y;const k=v;export{u as GovDialog,k as defineCustomElement};
2
2
  //# sourceMappingURL=gov-dialog.js.map
@@ -1,2 +1,2 @@
1
- import{G as s,d as o}from"./p-DEthsMuE.js";const t=s;const p=o;export{t as GovFormAutocomplete,p as defineCustomElement};
1
+ import{G as s,d as o}from"./p-isPjiQbr.js";const r=s;const t=o;export{r as GovFormAutocomplete,t as defineCustomElement};
2
2
  //# sourceMappingURL=gov-form-autocomplete.js.map
@@ -1,2 +1,2 @@
1
- import{p as t,H as s,c as i,h as e,a as h}from"./index.js";import{c as o}from"./p-vN03FcXN.js";import{v as n}from"./p-BKP-F1qP.js";import{g as a,d as r,e as c}from"./p-BSr8e18S.js";import{g as l,t as d,b as m}from"./p-BHRF-5cf.js";import{F as u}from"./p-5itQzbON.js";import{i as p,A as v,a as f}from"./p-CXgom82_.js";import{d as b}from"./p-CXPP9vec.js";const g=t(class t extends s{constructor(){super();this.__registerHost();this.govFocus=i(this,"gov-focus");this.govBlur=i(this,"gov-blur");this.govChange=i(this,"gov-change");this.hydrated=false;this.checked=false;this.required=false;this.disabled=false;this.indeterminate=false;this.size="m";this.noLabel=false;this.inheritedAttributes={};this.checkboxId=o("GovCheckbox");this.h=l(this.host);this.f=a(this.h)}validateSize(t){n(c,t,r.root)}watchControlAttrs(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("disabled",d(this.disabled));this.f.passAttrToControl("invalid",d(this.invalid));this.f.passAttrToControl("type","checkbox")}componentWillLoad(){this.passControlAttrs();this.inheritedAttributes=p(this.host)}componentDidLoad(){this.attributeObserver=new v(this.host,((t,s)=>{this.onAriaAttributeChange(t,s)}));this.attributeObserver.startObserving(f)}async componentDidRender(){this.f.passAttrToLabel("identifier",this.identifier||this.checkboxId);this.f.passAttrToLabel("required",String(this.required));this.passControlAttrs()}connectedCallback(){this.hydrated=true}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}onAriaAttributeChange(t,s){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:s})}render(){const t=t=>{if(this.noLabel){return e("label",{class:r.label},t)}return t};return e(h,{class:r.root,hydrated:this.hydrated,checked:this.checked,size:this.size,invalid:m(this.invalid)},t(e(u,null,e("input",Object.assign({id:this.identifier||this.checkboxId,type:"checkbox",value:this.value,name:this.name,checked:this.checked,onClick:this.onClickHandler.bind(this),onChange:this.onChangeHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),required:this.required,disabled:this.disabled,indeterminate:this.indeterminate,ref:t=>this.inputRef=t},this.inheritedAttributes,{"aria-checked":d(this.checked),"aria-required":m(this.required),"aria-invalid":m(this.invalid),"aria-disabled":m(this.disabled)})),e("span",null,e("slot",{name:"label"}),e("gov-icon",{class:r.check,name:"check-lg",type:"components"}),e("gov-icon",{class:r.indeterminate,name:"dash-lg",type:"components"})))))}onFocusHandler(t){t.stopPropagation();this.govFocus.emit({component:r.root,value:this.value,checked:this.checked,originalEvent:t})}onBlurHandler(t){t.stopPropagation();this.govBlur.emit({component:r.root,value:this.value,checked:this.checked,originalEvent:t})}onClickHandler(t){t.stopPropagation()}onChangeHandler(t){this.checked=t.target.checked;t.stopPropagation();this.govChange.emit({component:r.root,value:this.value,checked:this.checked,originalEvent:t})}async getRef(){return this.inputRef}get host(){return this}static get watchers(){return{size:["validateSize","watchControlAttrs"],disabled:["watchControlAttrs"],invalid:["watchControlAttrs"]}}},[4,"gov-form-checkbox",{value:[1],checked:[1540],required:[4],disabled:[516],indeterminate:[516],name:[1],size:[513],identifier:[1],noLabel:[4,"no-label"],invalid:[4],inheritedAttributes:[32],getRef:[64]},undefined,{size:["validateSize","watchControlAttrs"],disabled:["watchControlAttrs"],invalid:["watchControlAttrs"]}]);function k(){if(typeof customElements==="undefined"){return}const t=["gov-form-checkbox","gov-icon"];t.forEach((t=>{switch(t){case"gov-form-checkbox":if(!customElements.get(t)){customElements.define(t,g)}break;case"gov-icon":if(!customElements.get(t)){b()}break}}))}k();const C=g;const A=k;export{C as GovFormCheckbox,A as defineCustomElement};
1
+ import{p as t,H as s,c as i,h as e,a as h}from"./index.js";import{c as o}from"./p-vN03FcXN.js";import{v as n}from"./p-BKP-F1qP.js";import{g as a,d as r,e as c}from"./p-BSr8e18S.js";import{g as l,t as d,b as m}from"./p-BHRF-5cf.js";import{F as u}from"./p-5itQzbON.js";import{i as p,A as v,a as f}from"./p-CXgom82_.js";import{d as b}from"./p-DRXiDAHW.js";const g=t(class t extends s{constructor(){super();this.__registerHost();this.govFocus=i(this,"gov-focus");this.govBlur=i(this,"gov-blur");this.govChange=i(this,"gov-change");this.hydrated=false;this.checked=false;this.required=false;this.disabled=false;this.indeterminate=false;this.size="m";this.noLabel=false;this.inheritedAttributes={};this.checkboxId=o("GovCheckbox");this.h=l(this.host);this.f=a(this.h)}validateSize(t){n(c,t,r.root)}watchControlAttrs(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("disabled",d(this.disabled));this.f.passAttrToControl("invalid",d(this.invalid));this.f.passAttrToControl("type","checkbox")}componentWillLoad(){this.passControlAttrs();this.inheritedAttributes=p(this.host)}componentDidLoad(){this.attributeObserver=new v(this.host,((t,s)=>{this.onAriaAttributeChange(t,s)}));this.attributeObserver.startObserving(f)}async componentDidRender(){this.f.passAttrToLabel("identifier",this.identifier||this.checkboxId);this.f.passAttrToLabel("required",String(this.required));this.passControlAttrs()}connectedCallback(){this.hydrated=true}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}onAriaAttributeChange(t,s){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:s})}render(){const t=t=>{if(this.noLabel){return e("label",{class:r.label},t)}return t};return e(h,{class:r.root,hydrated:this.hydrated,checked:this.checked,size:this.size,invalid:m(this.invalid)},t(e(u,null,e("input",Object.assign({id:this.identifier||this.checkboxId,type:"checkbox",value:this.value,name:this.name,checked:this.checked,onClick:this.onClickHandler.bind(this),onChange:this.onChangeHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),required:this.required,disabled:this.disabled,indeterminate:this.indeterminate,ref:t=>this.inputRef=t},this.inheritedAttributes,{"aria-checked":d(this.checked),"aria-required":m(this.required),"aria-invalid":m(this.invalid),"aria-disabled":m(this.disabled)})),e("span",null,e("slot",{name:"label"}),e("gov-icon",{class:r.check,name:"check-lg",type:"components"}),e("gov-icon",{class:r.indeterminate,name:"dash-lg",type:"components"})))))}onFocusHandler(t){t.stopPropagation();this.govFocus.emit({component:r.root,value:this.value,checked:this.checked,originalEvent:t})}onBlurHandler(t){t.stopPropagation();this.govBlur.emit({component:r.root,value:this.value,checked:this.checked,originalEvent:t})}onClickHandler(t){t.stopPropagation()}onChangeHandler(t){this.checked=t.target.checked;t.stopPropagation();this.govChange.emit({component:r.root,value:this.value,checked:this.checked,originalEvent:t})}async getRef(){return this.inputRef}get host(){return this}static get watchers(){return{size:["validateSize","watchControlAttrs"],disabled:["watchControlAttrs"],invalid:["watchControlAttrs"]}}},[4,"gov-form-checkbox",{value:[1],checked:[1540],required:[4],disabled:[516],indeterminate:[516],name:[1],size:[513],identifier:[1],noLabel:[4,"no-label"],invalid:[4],inheritedAttributes:[32],getRef:[64]},undefined,{size:["validateSize","watchControlAttrs"],disabled:["watchControlAttrs"],invalid:["watchControlAttrs"]}]);function k(){if(typeof customElements==="undefined"){return}const t=["gov-form-checkbox","gov-icon"];t.forEach((t=>{switch(t){case"gov-form-checkbox":if(!customElements.get(t)){customElements.define(t,g)}break;case"gov-icon":if(!customElements.get(t)){b()}break}}))}k();const C=g;const A=k;export{C as GovFormCheckbox,A as defineCustomElement};
2
2
  //# sourceMappingURL=gov-form-checkbox.js.map
@@ -1,2 +1,2 @@
1
- import{p as t,H as s,c as e,h as i,a as o}from"./index.js";import{c as a}from"./p-vN03FcXN.js";import{g as n,t as r,b as h}from"./p-BHRF-5cf.js";import{g as l}from"./p-BSr8e18S.js";import{A as c,a as f,i as m}from"./p-CXgom82_.js";import{d}from"./p-CMmyR4-k.js";import{d as p}from"./p-iTwUkISB.js";import{d as u}from"./p-C_URF9Su.js";import{d as g}from"./p-CU0plGZP.js";import{d as v}from"./p-CXPP9vec.js";import{d as b}from"./p-keC6luw7.js";import{d as y}from"./p-pJ_vPAO0.js";const k={root:"gov-form-file",area:"gov-form-file__area",input:"gov-form-file__input",inputFocus:"gov-form-file__input-focus",attachments:"gov-form-file__attachments"};function A(t){const s=["bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let e=0,i=parseInt(t,10)||0;while(i>=1024&&++e){i=i/1024}return i.toFixed(i<10&&e>0?1:0)+" "+s[e]}function E(t,s){if(typeof s==="string"&&s.length){return s.replace(/\s/g,"").split(",").filter((s=>new RegExp(s.replace("*",".*")).test(t.type))).length>0}else{return true}}function C(t,s){const e=Math.round(t.size);return e<=s}const F=t(class t extends s{constructor(){super();this.__registerHost();this.govFocus=e(this,"gov-focus");this.govBlur=e(this,"gov-blur");this.govFiles=e(this,"gov-files");this.govAddFile=e(this,"gov-add-file");this.govRemoveFile=e(this,"gov-remove-file");this.eventsRegistered=false;this.expanded=false;this.required=false;this.disabled=false;this.resetAfterPick=false;this.ignoreFileDuplicationCheck=false;this.displayAttachments=true;this.multiple=false;this.maxFileSize=-1;this.errorSize="Soubor je větší než povolená velikost {FILE_SIZE}";this.errorAccept="Soubor tohoto typu není povolen";this.accessibleAttachmentsLabel="Přílohy";this.files=[];this.inheritedAttributes={};this.fileId=a("GovInputFile");this.h=n(this.host);this.f=l(this.h)}watchControlAttrs(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("invalid",r(this.invalid));this.f.passAttrToControl("disabled",r(this.disabled));this.f.passAttrToControl("type","File")}registerListeners(){if(this.eventsRegistered){return}this.eventsRegistered=true;function t(){this.areaRef.classList.add("highlight")}function s(){this.areaRef.classList.remove("highlight")}this.inputRef.addEventListener("change",(t=>{t.preventDefault();t.stopPropagation();const s=t.target.files;if(this.resetAfterPick){if(s.length){this.validateFiles(s)}}else{this.validateFiles(s)}}),false);if(this.expanded){const e=["dragover","dragleave"];const i=["dragenter","dragover","mouseenter"];const o=["dragleave","mouseleave"];e.map((t=>this.inputRef.addEventListener(t,this.preventDefaults.bind(this),false)));i.map((s=>this.inputRef.addEventListener(s,t.bind(this),false)));o.forEach((t=>this.inputRef.addEventListener(t,s.bind(this),false)))}}preventDefaults(t){t.preventDefault();t.stopPropagation()}handleDrop(t){const s=t.dataTransfer;this.validateFiles(s.files)}validateFiles(t){let s=[];if(!this.multiple&&this.displayAttachments){this.files=[]}Array.from(t).forEach((t=>{const e=this.files.find((s=>s.file.name===t.name&&s.file.size===t.size))||null;if(e===null||this.ignoreFileDuplicationCheck){const e=typeof this.maxFileSize==="number"&&this.maxFileSize>0?C(t,this.maxFileSize):true;const i=E(t,this.accept);const o={id:a("GovFormFile"),file:t,acceptValid:i,sizeValid:e};if(this.displayAttachments){this.files=[...this.files,o]}else{s=[...s,o]}this.govAddFile.emit({component:k.root,file:o})}}));if(this.displayAttachments){this.syncNativeInputFiles()}this.govFiles.emit({component:k.root,files:s.length?s:this.files});if(this.resetAfterPick){this.reset().finally()}}syncNativeInputFiles(){if(!this.inputRef||typeof DataTransfer==="undefined"){return}try{const t=new DataTransfer;this.files.filter((t=>t.acceptValid===true&&t.sizeValid===true)).forEach((s=>t.items.add(s.file)));this.inputRef.files=t.files}catch(t){if(typeof process!=="undefined"&&process.env&&"production"!=="production");}}componentDidLoad(){this.attributeObserver=new c(this.host,((t,s)=>{this.onAriaAttributeChange(t,s)}));this.attributeObserver.startObserving(f)}componentWillLoad(){this.f.passAttrToLabel("required",String(this.required));this.passControlAttrs();this.inheritedAttributes=m(this.host)}async componentDidRender(){this.registerListeners()}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}onAriaAttributeChange(t,s){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:s})}render(){return i(o,{key:"6709aba5a796ccb9cf712dd5f962d5f903050d26",class:this.h.classes([k.root]),invalid:h(this.invalid),expanded:h(this.expanded)},i("div",{key:"668f6959ca55220ed2543dbbeddeb98f1b6c19ba",class:k.area,ref:t=>this.areaRef=t},i("slot",{key:"5f12f12d074163b525e2200e23f61e6d0fb34c74"}),i("input",Object.assign({key:"7cf43884dad3c28be956b9897862ff5a1fa22e75",class:k.input,ref:t=>this.inputRef=t,id:this.identifier||this.fileId,type:"file",name:this.name,accept:this.accept,multiple:this.multiple,onChange:this.onChangeHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),required:this.required,disabled:this.disabled},this.inheritedAttributes,{"aria-required":h(this.required),"aria-invalid":h(this.invalid),"aria-disabled":h(this.disabled)})),i("div",{key:"ec717f584bcd4d74416821736fb4bdcea517bc83",class:k.inputFocus})),this.h.hasSlot("attachments")?i("div",{class:k.attachments},i("slot",{name:"attachments"})):null,this.files.length&&this.displayAttachments?i("div",{class:k.attachments},i("gov-attachments",{label:this.accessibleAttachmentsLabel,"accessible-label":this.accessibleAttachmentsLabel},this.files.map((t=>i("gov-attachments-item",{"accessible-remove-labelledby":t.id,"on-gov-remove":()=>this.onRemoveFileHandler(t)},t.file.name,i("span",{slot:"name"},t.file.name),t.acceptValid===false?i("gov-form-message",{slot:"message",color:"error"},i("gov-icon",{slot:"icon",name:"exclamation-triangle-fill",type:"components"}),t.acceptValid===false?this.errorAccept:null):null,t.sizeValid===false?i("gov-form-message",{slot:"message",color:"error"},i("gov-icon",{slot:"icon",name:"exclamation-triangle-fill",type:"components"}),this.errorSize.replace("{FILE_SIZE}",A(this.maxFileSize))):null,i("span",{slot:"info"},"(",A(t.file.size),")")))))):null)}onRemoveFileHandler(t){const s=this.files.findIndex((s=>s.id===t.id));if(s!==-1){const t=this.files;const e=this.files[s];t.splice(s,1);this.files=[...t];this.syncNativeInputFiles();this.govRemoveFile.emit({component:k.root,file:e});this.govFiles.emit({component:k.root,files:t})}}onFocusHandler(t){t.stopPropagation();this.govFocus.emit({component:k.root,originalEvent:t})}onBlurHandler(t){t.stopPropagation();this.govBlur.emit({component:k.root,originalEvent:t})}onChangeHandler(t){t.stopPropagation()}async getRef(){return this.inputRef}async getAreaRef(){return this.areaRef}async reset(){this.files=[];if(this.inputRef){this.inputRef.value="";this.syncNativeInputFiles()}}get host(){return this}static get watchers(){return{disabled:["watchControlAttrs"],invalid:["watchControlAttrs"]}}},[4,"gov-form-file",{expanded:[4],required:[4],disabled:[516],resetAfterPick:[4,"reset-after-pick"],ignoreFileDuplicationCheck:[4,"ignore-file-duplication-check"],displayAttachments:[4,"display-attachments"],name:[1],accept:[1],multiple:[4],maxFileSize:[2,"max-file-size"],identifier:[1],invalid:[4],errorSize:[1,"error-size"],errorAccept:[1,"error-accept"],accessibleAttachmentsLabel:[1,"accessible-attachments-label"],files:[32],inheritedAttributes:[32],getRef:[64],getAreaRef:[64],reset:[64]},undefined,{disabled:["watchControlAttrs"],invalid:["watchControlAttrs"]}]);function j(){if(typeof customElements==="undefined"){return}const t=["gov-form-file","gov-attachments","gov-attachments-item","gov-button","gov-form-message","gov-icon","gov-tooltip","gov-tooltip-content"];t.forEach((t=>{switch(t){case"gov-form-file":if(!customElements.get(t)){customElements.define(t,F)}break;case"gov-attachments":if(!customElements.get(t)){d()}break;case"gov-attachments-item":if(!customElements.get(t)){p()}break;case"gov-button":if(!customElements.get(t)){u()}break;case"gov-form-message":if(!customElements.get(t)){g()}break;case"gov-icon":if(!customElements.get(t)){v()}break;case"gov-tooltip":if(!customElements.get(t)){b()}break;case"gov-tooltip-content":if(!customElements.get(t)){y()}break}}))}j();const w=F;const B=j;export{w as GovFormFile,B as defineCustomElement};
1
+ import{p as t,H as s,c as e,h as i,a as o}from"./index.js";import{c as n}from"./p-vN03FcXN.js";import{g as a,t as r,b as h}from"./p-BHRF-5cf.js";import{g as l}from"./p-BSr8e18S.js";import{A as c,a as f,i as m}from"./p-CXgom82_.js";import{d as u}from"./p-CMmyR4-k.js";import{d}from"./p-BICk4EuO.js";import{d as p}from"./p-ClDhNt_H.js";import{d as g}from"./p-CU0plGZP.js";import{d as v}from"./p-DRXiDAHW.js";import{d as b}from"./p-keC6luw7.js";import{d as y}from"./p-DjGO_trZ.js";const k={root:"gov-form-file",area:"gov-form-file__area",input:"gov-form-file__input",inputFocus:"gov-form-file__input-focus",attachments:"gov-form-file__attachments"};function A(t){const s=["bytes","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let e=0,i=parseInt(t,10)||0;while(i>=1024&&++e){i=i/1024}return i.toFixed(i<10&&e>0?1:0)+" "+s[e]}function E(t,s){if(typeof s!=="string"||s.trim().length===0){return true}const e=t.name.toLowerCase();const i=(t.type||"").toLowerCase();return s.split(",").map((t=>t.trim().toLowerCase())).filter((t=>t.length>0)).some((t=>{if(t.startsWith(".")){return e.endsWith(t)}if(t==="*"||t==="*/*"){return true}if(t.endsWith("/*")){const s=t.slice(0,t.indexOf("/")+1);return i.startsWith(s)}return i===t}))}function j(t,s){const e=Math.round(t.size);return e<=s}const C=t(class t extends s{constructor(){super();this.__registerHost();this.govFocus=e(this,"gov-focus");this.govBlur=e(this,"gov-blur");this.govFiles=e(this,"gov-files");this.govAddFile=e(this,"gov-add-file");this.govRemoveFile=e(this,"gov-remove-file");this.eventsRegistered=false;this.expanded=false;this.required=false;this.disabled=false;this.resetAfterPick=false;this.ignoreFileDuplicationCheck=false;this.displayAttachments=true;this.multiple=false;this.maxFileSize=-1;this.errorSize="Soubor je větší než povolená velikost {FILE_SIZE}";this.errorAccept="Soubor tohoto typu není povolen";this.accessibleAttachmentsLabel="Přílohy";this.files=[];this.inheritedAttributes={};this.fileId=n("GovInputFile");this.h=a(this.host);this.f=l(this.h)}watchControlAttrs(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("invalid",r(this.invalid));this.f.passAttrToControl("disabled",r(this.disabled));this.f.passAttrToControl("type","File")}registerListeners(){if(this.eventsRegistered){return}this.eventsRegistered=true;function t(){this.areaRef.classList.add("highlight")}function s(){this.areaRef.classList.remove("highlight")}this.inputRef.addEventListener("change",(t=>{t.preventDefault();t.stopPropagation();const s=t.target.files;if(this.resetAfterPick){if(s.length){this.validateFiles(s)}}else{this.validateFiles(s)}}),false);if(this.expanded){const e=["dragover","dragleave"];const i=["dragenter","dragover","mouseenter"];const o=["dragleave","mouseleave"];e.map((t=>this.inputRef.addEventListener(t,this.preventDefaults.bind(this),false)));i.map((s=>this.inputRef.addEventListener(s,t.bind(this),false)));o.forEach((t=>this.inputRef.addEventListener(t,s.bind(this),false)))}}preventDefaults(t){t.preventDefault();t.stopPropagation()}handleDrop(t){const s=t.dataTransfer;this.validateFiles(s.files)}validateFiles(t){let s=[];const e=this.multiple?Array.from(t):Array.from(t).slice(-1);if(!this.multiple&&this.displayAttachments){this.files=[]}e.forEach((t=>{const e=this.files.find((s=>s.file.name===t.name&&s.file.size===t.size))||null;if(e===null||this.ignoreFileDuplicationCheck){const e=typeof this.maxFileSize==="number"&&this.maxFileSize>0?j(t,this.maxFileSize):true;const i=E(t,this.accept);const o={id:n("GovFormFile"),file:t,acceptValid:i,sizeValid:e};if(this.displayAttachments){this.files=[...this.files,o]}else{s=[...s,o]}this.govAddFile.emit({component:k.root,file:o})}}));if(this.displayAttachments){this.syncNativeInputFiles()}this.govFiles.emit({component:k.root,files:s.length?s:this.files});if(this.resetAfterPick){this.reset().finally()}}syncNativeInputFiles(){if(!this.inputRef||typeof DataTransfer==="undefined"){return}try{const t=new DataTransfer;this.files.filter((t=>t.acceptValid===true&&t.sizeValid===true)).forEach((s=>t.items.add(s.file)));this.inputRef.files=t.files}catch(t){if(typeof process!=="undefined"&&process.env&&"production"!=="production");}}componentDidLoad(){this.attributeObserver=new c(this.host,((t,s)=>{this.onAriaAttributeChange(t,s)}));this.attributeObserver.startObserving(f)}componentWillLoad(){this.f.passAttrToLabel("required",String(this.required));this.passControlAttrs();this.inheritedAttributes=m(this.host)}async componentDidRender(){this.registerListeners()}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}onAriaAttributeChange(t,s){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:s})}render(){return i(o,{key:"2d89af24db1447bba2c7987946b5c63bff65a58a",class:this.h.classes([k.root]),invalid:h(this.invalid),expanded:h(this.expanded)},i("div",{key:"7a37869f8ef203b0f1d6b07cfee8e4f325fe9ecc",class:k.area,ref:t=>this.areaRef=t},i("slot",{key:"10344be7bedf53a4754c8e79bb069c57291b7663"}),i("input",Object.assign({key:"52dc1692d0eaa6310c0166faceb5906627aac73c",class:k.input,ref:t=>this.inputRef=t,id:this.identifier||this.fileId,type:"file",name:this.name,accept:this.accept,multiple:this.multiple,onChange:this.onChangeHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),required:this.required,disabled:this.disabled},this.inheritedAttributes,{"aria-required":h(this.required),"aria-invalid":h(this.invalid),"aria-disabled":h(this.disabled)})),i("div",{key:"1193c6ef7a57894baab2f14619827c2f51441d08",class:k.inputFocus})),this.h.hasSlot("attachments")?i("div",{class:k.attachments},i("slot",{name:"attachments"})):null,this.files.length&&this.displayAttachments?i("div",{class:k.attachments},i("gov-attachments",{label:this.accessibleAttachmentsLabel,"accessible-label":this.accessibleAttachmentsLabel},this.files.map((t=>i("gov-attachments-item",{"accessible-remove-labelledby":t.id,"on-gov-remove":()=>this.onRemoveFileHandler(t)},t.file.name,i("span",{slot:"name"},t.file.name),t.acceptValid===false?i("gov-form-message",{slot:"message",color:"error"},i("gov-icon",{slot:"icon",name:"exclamation-triangle-fill",type:"components"}),t.acceptValid===false?this.errorAccept:null):null,t.sizeValid===false?i("gov-form-message",{slot:"message",color:"error"},i("gov-icon",{slot:"icon",name:"exclamation-triangle-fill",type:"components"}),this.errorSize.replace("{FILE_SIZE}",A(this.maxFileSize))):null,i("span",{slot:"info"},"(",A(t.file.size),")")))))):null)}onRemoveFileHandler(t){const s=this.files.findIndex((s=>s.id===t.id));if(s!==-1){const t=this.files;const e=this.files[s];t.splice(s,1);this.files=[...t];this.syncNativeInputFiles();this.govRemoveFile.emit({component:k.root,file:e});this.govFiles.emit({component:k.root,files:t})}}onFocusHandler(t){t.stopPropagation();this.govFocus.emit({component:k.root,originalEvent:t})}onBlurHandler(t){t.stopPropagation();this.govBlur.emit({component:k.root,originalEvent:t})}onChangeHandler(t){t.stopPropagation()}async getRef(){return this.inputRef}async getAreaRef(){return this.areaRef}async reset(){this.files=[];if(this.inputRef){this.inputRef.value="";this.syncNativeInputFiles()}}get host(){return this}static get watchers(){return{disabled:["watchControlAttrs"],invalid:["watchControlAttrs"]}}},[4,"gov-form-file",{expanded:[4],required:[4],disabled:[516],resetAfterPick:[4,"reset-after-pick"],ignoreFileDuplicationCheck:[4,"ignore-file-duplication-check"],displayAttachments:[4,"display-attachments"],name:[1],accept:[1],multiple:[4],maxFileSize:[2,"max-file-size"],identifier:[1],invalid:[4],errorSize:[1,"error-size"],errorAccept:[1,"error-accept"],accessibleAttachmentsLabel:[1,"accessible-attachments-label"],files:[32],inheritedAttributes:[32],getRef:[64],getAreaRef:[64],reset:[64]},undefined,{disabled:["watchControlAttrs"],invalid:["watchControlAttrs"]}]);function F(){if(typeof customElements==="undefined"){return}const t=["gov-form-file","gov-attachments","gov-attachments-item","gov-button","gov-form-message","gov-icon","gov-tooltip","gov-tooltip-content"];t.forEach((t=>{switch(t){case"gov-form-file":if(!customElements.get(t)){customElements.define(t,C)}break;case"gov-attachments":if(!customElements.get(t)){u()}break;case"gov-attachments-item":if(!customElements.get(t)){d()}break;case"gov-button":if(!customElements.get(t)){p()}break;case"gov-form-message":if(!customElements.get(t)){g()}break;case"gov-icon":if(!customElements.get(t)){v()}break;case"gov-tooltip":if(!customElements.get(t)){b()}break;case"gov-tooltip-content":if(!customElements.get(t)){y()}break}}))}F();const B=C;const _=F;export{B as GovFormFile,_ as defineCustomElement};
2
2
  //# sourceMappingURL=gov-form-file.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["FormFileClass","root","area","input","inputFocus","attachments","formatBytes","bytes","units","l","n","parseInt","toFixed","fileAcceptValidation","file","accept","length","replace","split","filter","RegExp","test","type","fileSizeValidation","maxSize","fileSize","Math","round","size","GovFormFile","__stencil_proxyCustomElement","HTMLElement","constructor","this","eventsRegistered","expanded","required","disabled","resetAfterPick","ignoreFileDuplicationCheck","displayAttachments","multiple","maxFileSize","errorSize","errorAccept","accessibleAttachmentsLabel","files","inheritedAttributes","fileId","createID","h","govHost","host","f","govForm","watchControlAttrs","passControlAttrs","passAttrToControl","toBoolAttr","invalid","registerListeners","highlight","areaRef","classList","add","unhighlight","remove","inputRef","addEventListener","e","preventDefault","stopPropagation","target","validateFiles","events","inEvents","outEvents","map","eventName","preventDefaults","bind","forEach","handleDrop","dataTransfer","filesBuffer","Array","from","isFile","find","item","name","isSizeValid","isAcceptValid","newFile","id","acceptValid","sizeValid","govAddFile","emit","component","syncNativeInputFiles","govFiles","reset","finally","DataTransfer","dt","items","process","env","componentDidLoad","attributeObserver","AttributeObserver","attributeName","newValue","onAriaAttributeChange","startObserving","ariaAttributes","componentWillLoad","passAttrToLabel","String","inheritAriaAttributes","componentDidRender","disconnectedCallback","_a","stopObserving","removeAttribute","Object","assign","render","Host","key","class","classes","toBoolAttrIfDefined","ref","el","identifier","onChange","onChangeHandler","onFocus","onFocusHandler","onBlur","onBlurHandler","hasSlot","label","onRemoveFileHandler","slot","color","index","findIndex","removeFile","splice","govRemoveFile","govFocus","originalEvent","govBlur","getRef","getAreaRef","value"],"sources":["../../../packages/core/src/components/gov-form/file/constants.ts","../../../packages/core/src/utils/file.utils.ts","../../../packages/core/src/components/gov-form/file/gov-form-file.tsx"],"sourcesContent":["export const FormFileClass = {\n\troot: 'gov-form-file',\n\tarea: 'gov-form-file__area',\n\tinput: 'gov-form-file__input',\n\tinputFocus: 'gov-form-file__input-focus',\n\tattachments: 'gov-form-file__attachments',\n}\n","export function formatBytes(bytes: any): string {\n\tconst units = ['bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']\n\tlet l = 0,\n\t\tn = parseInt(bytes, 10) || 0\n\n\twhile (n >= 1024 && ++l) {\n\t\tn = n / 1024\n\t}\n\n\treturn n.toFixed(n < 10 && l > 0 ? 1 : 0) + ' ' + units[l]\n}\n\nexport function fileAcceptValidation(file: File, accept: string): boolean {\n\tif (typeof accept === 'string' && accept.length) {\n\t\treturn (\n\t\t\taccept\n\t\t\t\t.replace(/\\s/g, '')\n\t\t\t\t.split(',')\n\t\t\t\t.filter(accept => {\n\t\t\t\t\treturn new RegExp(accept.replace('*', '.*')).test(file.type)\n\t\t\t\t}).length > 0\n\t\t)\n\t} else {\n\t\treturn true\n\t}\n}\n\nexport function fileSizeValidation(file: File, maxSize: number): boolean {\n\tconst fileSize = Math.round(file.size)\n\treturn fileSize <= maxSize\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {createID} from \"../../../utils/string.utils\"\nimport {FormFileClass} from \"./constants\"\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from \"../../../helpers/Dom/template\"\nimport {fileAcceptValidation, fileSizeValidation, formatBytes} from \"../../../utils/file.utils\"\nimport {GovForm} from \"../../../helpers/Dom/form.types\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {govForm} from \"../../../helpers/Dom/form\"\nimport {GovFormFileEvent, GovFormFileItem} from \"./gov-form-file.types\"\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\n\n@Component({\n\ttag: \"gov-form-file\",\n})\nexport class GovFormFile {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\n\tprivate areaRef?: HTMLDivElement\n\tprivate inputRef?: HTMLInputElement\n\tprivate readonly fileId: string\n\tprivate attributeObserver: AttributeObserver\n\tprivate eventsRegistered = false\n\n\tconstructor() {\n\t\tthis.fileId = createID(\"GovInputFile\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormFileElement\n\t/**\n\t * Expands the file input to fill 100% of the container width.\n\t */\n\t@Prop() readonly expanded: boolean = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the File component disabled.\n\t * This prevents users from being able to interact with the File, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * After selecting the files, the main input element will be reset.\n\t * The propagation of the event with the selected files will not be affected.\n\t */\n\t@Prop({attribute: \"reset-after-pick\"}) readonly resetAfterPick: boolean = false\n\t/**\n\t * Selected files will not be checked for duplicates based on name and size.\n\t */\n\t@Prop({attribute: \"ignore-file-duplication-check\"}) readonly ignoreFileDuplicationCheck: boolean = false\n\t/**\n\t * Show list of attachments\n\t */\n\t@Prop({attribute: \"display-attachments\"}) readonly displayAttachments: boolean = true\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept\n\t */\n\t@Prop() readonly accept: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/multiple\n\t */\n\t@Prop() readonly multiple: boolean = false\n\t/**\n\t * Maximum embedded file size\n\t */\n\t@Prop({attribute: \"max-file-size\"}) readonly maxFileSize: number = -1\n\t/**\n\t * Custom File identifier.\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Error message when the maximum file size is exceeded\n\t */\n\t@Prop({attribute: \"error-size\"}) readonly errorSize: string = \"Soubor je větší než povolená velikost {FILE_SIZE}\"\n\t/**\n\t * Insert unsupported file error message\n\t */\n\t@Prop({attribute: \"error-accept\"}) readonly errorAccept: string = \"Soubor tohoto typu není povolen\"\n\t/**\n\t * Adds accessible label for the list of attachments.\n\t */\n\t@Prop({attribute: \"accessible-attachments-label\"}) readonly accessibleAttachmentsLabel: string = \"Přílohy\"\n\t/**\n\t * Emitted when the File has focus.\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Emitted when the File loses focus.\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when the list of inserted files is changed\n\t */\n\t@Event({eventName: \"gov-files\"}) govFiles: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when a new file is added\n\t */\n\t@Event({eventName: \"gov-add-file\"}) govAddFile: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when a file is removed from the list\n\t */\n\t@Event({eventName: \"gov-remove-file\"}) govRemoveFile: EventEmitter<GovFormFileEvent>\n\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\twatchControlAttrs(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\t@State() files: GovFormFileItem[] = []\n\t@State() inheritedAttributes: Attributes = {}\n\n\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"type\", \"File\")\n\t}\n\n\n\tprivate registerListeners() {\n\t\tif (this.eventsRegistered) {\n\t\t\treturn\n\t\t}\n\t\tthis.eventsRegistered = true\n\n\t\tfunction highlight() {\n\t\t\tthis.areaRef.classList.add(\"highlight\")\n\t\t}\n\n\t\tfunction unhighlight() {\n\t\t\tthis.areaRef.classList.remove(\"highlight\")\n\t\t}\n\n\t\tthis.inputRef.addEventListener(\n\t\t\t\"change\",\n\t\t\te => {\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopPropagation()\n\t\t\t\tconst files = (e.target as HTMLInputElement).files\n\t\t\t\tif (this.resetAfterPick) {\n\t\t\t\t\tif (files.length) {\n\t\t\t\t\t\tthis.validateFiles(files)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.validateFiles(files)\n\t\t\t\t}\n\t\t\t},\n\t\t\tfalse,\n\t\t)\n\n\t\tif (this.expanded) {\n\t\t\tconst events = [\"dragover\", \"dragleave\"]\n\t\t\tconst inEvents = [\"dragenter\", \"dragover\", \"mouseenter\"]\n\t\t\tconst outEvents = [\"dragleave\", \"mouseleave\"]\n\n\t\t\tevents.map(eventName => this.inputRef.addEventListener(eventName, this.preventDefaults.bind(this), false))\n\t\t\tinEvents.map(eventName => this.inputRef.addEventListener(eventName, highlight.bind(this), false))\n\t\t\toutEvents.forEach(eventName => this.inputRef.addEventListener(eventName, unhighlight.bind(this), false))\n\t\t}\n\t}\n\n\tpreventDefaults(e) {\n\t\te.preventDefault()\n\t\te.stopPropagation()\n\t}\n\n\thandleDrop(e: DragEvent) {\n\t\tconst dataTransfer = e.dataTransfer\n\t\tthis.validateFiles(dataTransfer.files)\n\t}\n\n\tprivate validateFiles(files: FileList) {\n\t\tlet filesBuffer: GovFormFileItem[] = []\n\t\tif (!this.multiple && this.displayAttachments) {\n\t\t\tthis.files = []\n\t\t}\n\t\tArray.from(files).forEach(file => {\n\t\t\tconst isFile = this.files.find(item => item.file.name === file.name && item.file.size === file.size) || null\n\t\t\tif (isFile === null || this.ignoreFileDuplicationCheck) {\n\t\t\t\tconst isSizeValid = typeof this.maxFileSize === \"number\" && this.maxFileSize > 0 ? fileSizeValidation(file, this.maxFileSize) : true\n\t\t\t\tconst isAcceptValid = fileAcceptValidation(file, this.accept)\n\t\t\t\tconst newFile = {\n\t\t\t\t\tid: createID(\"GovFormFile\"),\n\t\t\t\t\tfile,\n\t\t\t\t\tacceptValid: isAcceptValid,\n\t\t\t\t\tsizeValid: isSizeValid,\n\t\t\t\t}\n\t\t\t\tif (this.displayAttachments) {\n\t\t\t\t\tthis.files = [...this.files, newFile]\n\t\t\t\t} else {\n\t\t\t\t\tfilesBuffer = [...filesBuffer, newFile]\n\t\t\t\t}\n\t\t\t\tthis.govAddFile.emit({\n\t\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\t\tfile: newFile,\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\n\t\tif (this.displayAttachments) {\n\t\t\tthis.syncNativeInputFiles()\n\t\t}\n\n\t\tthis.govFiles.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\tfiles: filesBuffer.length ? filesBuffer : this.files,\n\t\t})\n\n\t\tif (this.resetAfterPick) {\n\t\t\tthis.reset().finally()\n\t\t}\n\t}\n\n\t// Keep native <input type=\"file\"> in sync with the visible attachments list so\n\t// that a native form submit / FormData carries exactly the files shown in the UI.\n\t// Invalid items (wrong type or oversize) are intentionally excluded.\n\tprivate syncNativeInputFiles() {\n\t\tif (!this.inputRef || typeof DataTransfer === \"undefined\") {\n\t\t\treturn\n\t\t}\n\t\ttry {\n\t\t\tconst dt = new DataTransfer()\n\t\t\tthis.files\n\t\t\t\t.filter(item => item.acceptValid === true && item.sizeValid === true)\n\t\t\t\t.forEach(item => dt.items.add(item.file))\n\t\t\tthis.inputRef.files = dt.files\n\t\t} catch (e) {\n\t\t\t// Safari < 14.1 / older browsers may reject assigning to .files; nothing safe to fall back to.\n\t\t\tif (typeof process !== \"undefined\" && process.env && process.env.NODE_ENV !== \"production\") {\n\t\t\t\tconsole.warn(\"[gov-form-file] Could not sync native input.files:\", e)\n\t\t\t}\n\t\t}\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\tthis.passControlAttrs()\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.registerListeners()\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes([FormFileClass.root])}\n\t\t\t\t invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t expanded={toBoolAttrIfDefined(this.expanded)}>\n\t\t\t\t<div class={FormFileClass.area} ref={el => (this.areaRef = el as HTMLDivElement)}>\n\t\t\t\t\t<slot/>\n\t\t\t\t\t<input\n\t\t\t\t\t\tclass={FormFileClass.input}\n\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\tid={this.identifier || this.fileId}\n\t\t\t\t\t\ttype=\"file\"\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\taccept={this.accept}\n\t\t\t\t\t\tmultiple={this.multiple}\n\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t/>\n\t\t\t\t\t<div class={FormFileClass.inputFocus}/>\n\t\t\t\t</div>\n\n\t\t\t\t{this.h.hasSlot(\"attachments\") ? (\n\t\t\t\t\t<div class={FormFileClass.attachments}>\n\t\t\t\t\t\t<slot name={\"attachments\"}/>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\n\t\t\t\t{this.files.length && this.displayAttachments ? (\n\t\t\t\t\t<div class={FormFileClass.attachments}>\n\t\t\t\t\t\t<gov-attachments label={this.accessibleAttachmentsLabel}\n\t\t\t\t\t\t\t\t\t\t accessible-label={this.accessibleAttachmentsLabel}>\n\t\t\t\t\t\t\t{this.files.map(item => (\n\t\t\t\t\t\t\t\t<gov-attachments-item accessible-remove-labelledby={item.id}\n\t\t\t\t\t\t\t\t\t\t\t\t\t on-gov-remove={() => this.onRemoveFileHandler(item)}>\n\t\t\t\t\t\t\t\t\t{item.file.name}\n\t\t\t\t\t\t\t\t\t<span slot=\"name\">{item.file.name}</span>\n\t\t\t\t\t\t\t\t\t{item.acceptValid === false ? (\n\t\t\t\t\t\t\t\t\t\t<gov-form-message slot=\"message\" color=\"error\">\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon\" name=\"exclamation-triangle-fill\" type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t\t\t\t\t{item.acceptValid === false ? this.errorAccept : null}\n\t\t\t\t\t\t\t\t\t\t</gov-form-message>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t{item.sizeValid === false ? (\n\t\t\t\t\t\t\t\t\t\t<gov-form-message slot=\"message\" color=\"error\">\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon\" name=\"exclamation-triangle-fill\" type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t\t\t\t\t{this.errorSize.replace(\"{FILE_SIZE}\", formatBytes(this.maxFileSize))}\n\t\t\t\t\t\t\t\t\t\t</gov-form-message>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t<span slot=\"info\">({formatBytes(item.file.size)})</span>\n\t\t\t\t\t\t\t\t</gov-attachments-item>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</gov-attachments>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onRemoveFileHandler(file: GovFormFileItem) {\n\t\tconst index = this.files.findIndex(item => item.id === file.id)\n\t\tif (index !== -1) {\n\t\t\tconst files = this.files\n\t\t\tconst removeFile = this.files[index]\n\t\t\tfiles.splice(index, 1)\n\t\t\tthis.files = [...files]\n\t\t\tthis.syncNativeInputFiles()\n\t\t\tthis.govRemoveFile.emit({\n\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\tfile: removeFile,\n\t\t\t})\n\t\t\tthis.govFiles.emit({\n\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\tfiles,\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\te.stopPropagation()\n\t}\n\n\t/**\n\t * Returns the reference of the native element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n\n\t/**\n\t * Returns the reference of the native area element\n\t */\n\t@Method()\n\tasync getAreaRef(): Promise<HTMLDivElement> {\n\t\treturn this.areaRef\n\t}\n\n\t/**\n\t * Remove all files from component state\n\t */\n\t@Method()\n\tasync reset(): Promise<void> {\n\t\tthis.files = []\n\t\tif (this.inputRef) {\n\t\t\tthis.inputRef.value = ''\n\t\t\tthis.syncNativeInputFiles()\n\t\t}\n\t}\n}\n"],"mappings":"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","ignoreList":[]}
1
+ {"version":3,"names":["FormFileClass","root","area","input","inputFocus","attachments","formatBytes","bytes","units","l","n","parseInt","toFixed","fileAcceptValidation","file","accept","trim","length","fileName","name","toLowerCase","fileType","type","split","map","token","filter","some","startsWith","endsWith","group","slice","indexOf","fileSizeValidation","maxSize","fileSize","Math","round","size","GovFormFile","__stencil_proxyCustomElement","HTMLElement","constructor","this","eventsRegistered","expanded","required","disabled","resetAfterPick","ignoreFileDuplicationCheck","displayAttachments","multiple","maxFileSize","errorSize","errorAccept","accessibleAttachmentsLabel","files","inheritedAttributes","fileId","createID","h","govHost","host","f","govForm","watchControlAttrs","passControlAttrs","passAttrToControl","toBoolAttr","invalid","registerListeners","highlight","areaRef","classList","add","unhighlight","remove","inputRef","addEventListener","e","preventDefault","stopPropagation","target","validateFiles","events","inEvents","outEvents","eventName","preventDefaults","bind","forEach","handleDrop","dataTransfer","filesBuffer","incoming","Array","from","isFile","find","item","isSizeValid","isAcceptValid","newFile","id","acceptValid","sizeValid","govAddFile","emit","component","syncNativeInputFiles","govFiles","reset","finally","DataTransfer","dt","items","process","env","componentDidLoad","attributeObserver","AttributeObserver","attributeName","newValue","onAriaAttributeChange","startObserving","ariaAttributes","componentWillLoad","passAttrToLabel","String","inheritAriaAttributes","componentDidRender","disconnectedCallback","_a","stopObserving","removeAttribute","Object","assign","render","Host","key","class","classes","toBoolAttrIfDefined","ref","el","identifier","onChange","onChangeHandler","onFocus","onFocusHandler","onBlur","onBlurHandler","hasSlot","label","onRemoveFileHandler","slot","color","replace","index","findIndex","removeFile","splice","govRemoveFile","govFocus","originalEvent","govBlur","getRef","getAreaRef","value"],"sources":["../../../packages/core/src/components/gov-form/file/constants.ts","../../../packages/core/src/utils/file.utils.ts","../../../packages/core/src/components/gov-form/file/gov-form-file.tsx"],"sourcesContent":["export const FormFileClass = {\n\troot: 'gov-form-file',\n\tarea: 'gov-form-file__area',\n\tinput: 'gov-form-file__input',\n\tinputFocus: 'gov-form-file__input-focus',\n\tattachments: 'gov-form-file__attachments',\n}\n","export function formatBytes(bytes: any): string {\n\tconst units = ['bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']\n\tlet l = 0,\n\t\tn = parseInt(bytes, 10) || 0\n\n\twhile (n >= 1024 && ++l) {\n\t\tn = n / 1024\n\t}\n\n\treturn n.toFixed(n < 10 && l > 0 ? 1 : 0) + ' ' + units[l]\n}\n\n// Validates a file against an `accept` attribute value, following the HTML spec\n// (https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept):\n// - \".ext\" → matched against the file NAME suffix (case-insensitive)\n// - \"type/*\" → matched against the file MIME group\n// - \"type/sub\" → exact MIME match\n// Matching the name (not only file.type) is essential: browsers often report an\n// empty or non-standard MIME for extensions like .jsonld, which the previous\n// MIME-only RegExp check always rejected.\nexport function fileAcceptValidation(file: File, accept: string): boolean {\n\tif (typeof accept !== 'string' || accept.trim().length === 0) {\n\t\treturn true\n\t}\n\tconst fileName = file.name.toLowerCase()\n\tconst fileType = (file.type || '').toLowerCase()\n\treturn accept\n\t\t.split(',')\n\t\t.map(token => token.trim().toLowerCase())\n\t\t.filter(token => token.length > 0)\n\t\t.some(token => {\n\t\t\tif (token.startsWith('.')) {\n\t\t\t\treturn fileName.endsWith(token)\n\t\t\t}\n\t\t\tif (token === '*' || token === '*/*') {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif (token.endsWith('/*')) {\n\t\t\t\tconst group = token.slice(0, token.indexOf('/') + 1)\n\t\t\t\treturn fileType.startsWith(group)\n\t\t\t}\n\t\t\treturn fileType === token\n\t\t})\n}\n\nexport function fileSizeValidation(file: File, maxSize: number): boolean {\n\tconst fileSize = Math.round(file.size)\n\treturn fileSize <= maxSize\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {createID} from \"../../../utils/string.utils\"\nimport {FormFileClass} from \"./constants\"\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from \"../../../helpers/Dom/template\"\nimport {fileAcceptValidation, fileSizeValidation, formatBytes} from \"../../../utils/file.utils\"\nimport {GovForm} from \"../../../helpers/Dom/form.types\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {govForm} from \"../../../helpers/Dom/form\"\nimport {GovFormFileEvent, GovFormFileItem} from \"./gov-form-file.types\"\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\n\n@Component({\n\ttag: \"gov-form-file\",\n})\nexport class GovFormFile {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\n\tprivate areaRef?: HTMLDivElement\n\tprivate inputRef?: HTMLInputElement\n\tprivate readonly fileId: string\n\tprivate attributeObserver: AttributeObserver\n\tprivate eventsRegistered = false\n\n\tconstructor() {\n\t\tthis.fileId = createID(\"GovInputFile\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormFileElement\n\t/**\n\t * Expands the file input to fill 100% of the container width.\n\t */\n\t@Prop() readonly expanded: boolean = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the File component disabled.\n\t * This prevents users from being able to interact with the File, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * After selecting the files, the main input element will be reset.\n\t * The propagation of the event with the selected files will not be affected.\n\t */\n\t@Prop({attribute: \"reset-after-pick\"}) readonly resetAfterPick: boolean = false\n\t/**\n\t * Selected files will not be checked for duplicates based on name and size.\n\t */\n\t@Prop({attribute: \"ignore-file-duplication-check\"}) readonly ignoreFileDuplicationCheck: boolean = false\n\t/**\n\t * Show list of attachments\n\t */\n\t@Prop({attribute: \"display-attachments\"}) readonly displayAttachments: boolean = true\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept\n\t */\n\t@Prop() readonly accept: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/multiple\n\t */\n\t@Prop() readonly multiple: boolean = false\n\t/**\n\t * Maximum embedded file size\n\t */\n\t@Prop({attribute: \"max-file-size\"}) readonly maxFileSize: number = -1\n\t/**\n\t * Custom File identifier.\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Error message when the maximum file size is exceeded\n\t */\n\t@Prop({attribute: \"error-size\"}) readonly errorSize: string = \"Soubor je větší než povolená velikost {FILE_SIZE}\"\n\t/**\n\t * Insert unsupported file error message\n\t */\n\t@Prop({attribute: \"error-accept\"}) readonly errorAccept: string = \"Soubor tohoto typu není povolen\"\n\t/**\n\t * Adds accessible label for the list of attachments.\n\t */\n\t@Prop({attribute: \"accessible-attachments-label\"}) readonly accessibleAttachmentsLabel: string = \"Přílohy\"\n\t/**\n\t * Emitted when the File has focus.\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Emitted when the File loses focus.\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when the list of inserted files is changed\n\t */\n\t@Event({eventName: \"gov-files\"}) govFiles: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when a new file is added\n\t */\n\t@Event({eventName: \"gov-add-file\"}) govAddFile: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when a file is removed from the list\n\t */\n\t@Event({eventName: \"gov-remove-file\"}) govRemoveFile: EventEmitter<GovFormFileEvent>\n\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\twatchControlAttrs(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\t@State() files: GovFormFileItem[] = []\n\t@State() inheritedAttributes: Attributes = {}\n\n\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"type\", \"File\")\n\t}\n\n\n\tprivate registerListeners() {\n\t\tif (this.eventsRegistered) {\n\t\t\treturn\n\t\t}\n\t\tthis.eventsRegistered = true\n\n\t\tfunction highlight() {\n\t\t\tthis.areaRef.classList.add(\"highlight\")\n\t\t}\n\n\t\tfunction unhighlight() {\n\t\t\tthis.areaRef.classList.remove(\"highlight\")\n\t\t}\n\n\t\tthis.inputRef.addEventListener(\n\t\t\t\"change\",\n\t\t\te => {\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopPropagation()\n\t\t\t\tconst files = (e.target as HTMLInputElement).files\n\t\t\t\tif (this.resetAfterPick) {\n\t\t\t\t\tif (files.length) {\n\t\t\t\t\t\tthis.validateFiles(files)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.validateFiles(files)\n\t\t\t\t}\n\t\t\t},\n\t\t\tfalse,\n\t\t)\n\n\t\tif (this.expanded) {\n\t\t\tconst events = [\"dragover\", \"dragleave\"]\n\t\t\tconst inEvents = [\"dragenter\", \"dragover\", \"mouseenter\"]\n\t\t\tconst outEvents = [\"dragleave\", \"mouseleave\"]\n\n\t\t\tevents.map(eventName => this.inputRef.addEventListener(eventName, this.preventDefaults.bind(this), false))\n\t\t\tinEvents.map(eventName => this.inputRef.addEventListener(eventName, highlight.bind(this), false))\n\t\t\toutEvents.forEach(eventName => this.inputRef.addEventListener(eventName, unhighlight.bind(this), false))\n\t\t}\n\t}\n\n\tpreventDefaults(e) {\n\t\te.preventDefault()\n\t\te.stopPropagation()\n\t}\n\n\thandleDrop(e: DragEvent) {\n\t\tconst dataTransfer = e.dataTransfer\n\t\tthis.validateFiles(dataTransfer.files)\n\t}\n\n\tprivate validateFiles(files: FileList) {\n\t\tlet filesBuffer: GovFormFileItem[] = []\n\t\t// Without `multiple`, only a single file is allowed. An incoming batch\n\t\t// (drag-drop, framework wrapper, programmatic assignment) can still carry\n\t\t// several files, so cap it to the last one — consistent with the\n\t\t// \"second pick replaces the first\" semantics. (Bug #30570313)\n\t\tconst incoming = this.multiple ? Array.from(files) : Array.from(files).slice(-1)\n\t\tif (!this.multiple && this.displayAttachments) {\n\t\t\tthis.files = []\n\t\t}\n\t\tincoming.forEach(file => {\n\t\t\tconst isFile = this.files.find(item => item.file.name === file.name && item.file.size === file.size) || null\n\t\t\tif (isFile === null || this.ignoreFileDuplicationCheck) {\n\t\t\t\tconst isSizeValid = typeof this.maxFileSize === \"number\" && this.maxFileSize > 0 ? fileSizeValidation(file, this.maxFileSize) : true\n\t\t\t\tconst isAcceptValid = fileAcceptValidation(file, this.accept)\n\t\t\t\tconst newFile = {\n\t\t\t\t\tid: createID(\"GovFormFile\"),\n\t\t\t\t\tfile,\n\t\t\t\t\tacceptValid: isAcceptValid,\n\t\t\t\t\tsizeValid: isSizeValid,\n\t\t\t\t}\n\t\t\t\tif (this.displayAttachments) {\n\t\t\t\t\tthis.files = [...this.files, newFile]\n\t\t\t\t} else {\n\t\t\t\t\tfilesBuffer = [...filesBuffer, newFile]\n\t\t\t\t}\n\t\t\t\tthis.govAddFile.emit({\n\t\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\t\tfile: newFile,\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\n\t\tif (this.displayAttachments) {\n\t\t\tthis.syncNativeInputFiles()\n\t\t}\n\n\t\tthis.govFiles.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\tfiles: filesBuffer.length ? filesBuffer : this.files,\n\t\t})\n\n\t\tif (this.resetAfterPick) {\n\t\t\tthis.reset().finally()\n\t\t}\n\t}\n\n\t// Keep native <input type=\"file\"> in sync with the visible attachments list so\n\t// that a native form submit / FormData carries exactly the files shown in the UI.\n\t// Invalid items (wrong type or oversize) are intentionally excluded.\n\tprivate syncNativeInputFiles() {\n\t\tif (!this.inputRef || typeof DataTransfer === \"undefined\") {\n\t\t\treturn\n\t\t}\n\t\ttry {\n\t\t\tconst dt = new DataTransfer()\n\t\t\tthis.files\n\t\t\t\t.filter(item => item.acceptValid === true && item.sizeValid === true)\n\t\t\t\t.forEach(item => dt.items.add(item.file))\n\t\t\tthis.inputRef.files = dt.files\n\t\t} catch (e) {\n\t\t\t// Safari < 14.1 / older browsers may reject assigning to .files; nothing safe to fall back to.\n\t\t\tif (typeof process !== \"undefined\" && process.env && process.env.NODE_ENV !== \"production\") {\n\t\t\t\tconsole.warn(\"[gov-form-file] Could not sync native input.files:\", e)\n\t\t\t}\n\t\t}\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\tthis.passControlAttrs()\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.registerListeners()\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes([FormFileClass.root])}\n\t\t\t\t invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t expanded={toBoolAttrIfDefined(this.expanded)}>\n\t\t\t\t<div class={FormFileClass.area} ref={el => (this.areaRef = el as HTMLDivElement)}>\n\t\t\t\t\t<slot/>\n\t\t\t\t\t<input\n\t\t\t\t\t\tclass={FormFileClass.input}\n\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\tid={this.identifier || this.fileId}\n\t\t\t\t\t\ttype=\"file\"\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\taccept={this.accept}\n\t\t\t\t\t\tmultiple={this.multiple}\n\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t/>\n\t\t\t\t\t<div class={FormFileClass.inputFocus}/>\n\t\t\t\t</div>\n\n\t\t\t\t{this.h.hasSlot(\"attachments\") ? (\n\t\t\t\t\t<div class={FormFileClass.attachments}>\n\t\t\t\t\t\t<slot name={\"attachments\"}/>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\n\t\t\t\t{this.files.length && this.displayAttachments ? (\n\t\t\t\t\t<div class={FormFileClass.attachments}>\n\t\t\t\t\t\t<gov-attachments label={this.accessibleAttachmentsLabel}\n\t\t\t\t\t\t\t\t\t\t accessible-label={this.accessibleAttachmentsLabel}>\n\t\t\t\t\t\t\t{this.files.map(item => (\n\t\t\t\t\t\t\t\t<gov-attachments-item accessible-remove-labelledby={item.id}\n\t\t\t\t\t\t\t\t\t\t\t\t\t on-gov-remove={() => this.onRemoveFileHandler(item)}>\n\t\t\t\t\t\t\t\t\t{item.file.name}\n\t\t\t\t\t\t\t\t\t<span slot=\"name\">{item.file.name}</span>\n\t\t\t\t\t\t\t\t\t{item.acceptValid === false ? (\n\t\t\t\t\t\t\t\t\t\t<gov-form-message slot=\"message\" color=\"error\">\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon\" name=\"exclamation-triangle-fill\" type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t\t\t\t\t{item.acceptValid === false ? this.errorAccept : null}\n\t\t\t\t\t\t\t\t\t\t</gov-form-message>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t{item.sizeValid === false ? (\n\t\t\t\t\t\t\t\t\t\t<gov-form-message slot=\"message\" color=\"error\">\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon\" name=\"exclamation-triangle-fill\" type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t\t\t\t\t{this.errorSize.replace(\"{FILE_SIZE}\", formatBytes(this.maxFileSize))}\n\t\t\t\t\t\t\t\t\t\t</gov-form-message>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t<span slot=\"info\">({formatBytes(item.file.size)})</span>\n\t\t\t\t\t\t\t\t</gov-attachments-item>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</gov-attachments>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onRemoveFileHandler(file: GovFormFileItem) {\n\t\tconst index = this.files.findIndex(item => item.id === file.id)\n\t\tif (index !== -1) {\n\t\t\tconst files = this.files\n\t\t\tconst removeFile = this.files[index]\n\t\t\tfiles.splice(index, 1)\n\t\t\tthis.files = [...files]\n\t\t\tthis.syncNativeInputFiles()\n\t\t\tthis.govRemoveFile.emit({\n\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\tfile: removeFile,\n\t\t\t})\n\t\t\tthis.govFiles.emit({\n\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\tfiles,\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\te.stopPropagation()\n\t}\n\n\t/**\n\t * Returns the reference of the native element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n\n\t/**\n\t * Returns the reference of the native area element\n\t */\n\t@Method()\n\tasync getAreaRef(): Promise<HTMLDivElement> {\n\t\treturn this.areaRef\n\t}\n\n\t/**\n\t * Remove all files from component state\n\t */\n\t@Method()\n\tasync reset(): Promise<void> {\n\t\tthis.files = []\n\t\tif (this.inputRef) {\n\t\t\tthis.inputRef.value = ''\n\t\t\tthis.syncNativeInputFiles()\n\t\t}\n\t}\n}\n"],"mappings":"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","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{G as o,d as s}from"./p-DN5pb9xA.js";const p=o;const t=s;export{p as GovFormInput,t as defineCustomElement};
1
+ import{G as o,d as s}from"./p-BNoNH6m-.js";const t=o;const m=s;export{t as GovFormInput,m as defineCustomElement};
2
2
  //# sourceMappingURL=gov-form-input.js.map
@@ -1,2 +1,2 @@
1
- import{p as t,H as e,c as s,h as i,a as o}from"./index.js";import{g as a,h as n,i as l}from"./p-BSr8e18S.js";import{g as h,t as r,b as c}from"./p-BHRF-5cf.js";import{v as u}from"./p-BKP-F1qP.js";import{c as d,r as f}from"./p-vN03FcXN.js";import{p as m}from"./p-B0hcuYXk.js";import{t as v}from"./p-Cjg0wpDG.js";import{A as p,a as g}from"./p-CXgom82_.js";import{d as b}from"./p-C_URF9Su.js";import{d as y}from"./p-DEthsMuE.js";import{d as k}from"./p-DN5pb9xA.js";import{d as j}from"./p-CXPP9vec.js";import{d as S}from"./p-BxS4InzB.js";const w=t(class t extends e{constructor(){super();this.__registerHost();this.govFocus=s(this,"gov-focus");this.govBlur=s(this,"gov-blur");this.govChange=s(this,"gov-change");this.govSelect=s(this,"gov-select");this.govRemove=s(this,"gov-remove");this.size="m";this.hideSelectedList=false;this.required=false;this.disabled=false;this.messageEmpty="Nebyly nalezeny žádné výsledky";this.messageLoading="Načítám...";this.selectedOptionsState=[];this.optionsState=[];this.inheritedAttributes={};this.selectId=d("GovSelect");this.listId=d("GovMultiList");this.h=h(this.host);this.f=a(this.h)}validateSize(t){u(l,t,n.root)}watchOptions(t){this.optionsState=m(t)}watchValue(t){this.selectedOptionsState=m(t)}componentDidLoad(){this.attributeObserver=new p(this.host,((t,e)=>{this.onAriaAttributeChange(t,e)}));this.attributeObserver.startObserving(g);this.initAutocomplete()}componentWillLoad(){this.validateSize(this.size);this.optionsState=m(this.options);this.selectedOptionsState=m(this.value)}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}onAriaAttributeChange(t,e){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:e})}getAvailableOptions(t=false){if(Array.isArray(this.optionsState)&&this.optionsState.length){if(t){return this.optionsState}return this.optionsState.filter((t=>{const e=this.selectedValueIndex(t.value);return e!==-1||(t===null||t===void 0?void 0:t.disabled)?false:true})).map((t=>{var e;return{name:(e=t.label)!==null&&e!==void 0?e:t.value,value:t.value}}))}return Array.from(this.selectRef.querySelectorAll("option")).filter((e=>{if(t){return true}const s=this.selectedValueIndex(e.value);return!(e.disabled||e.selected||s>-1)})).map((t=>({name:t.textContent,value:t.value})))}initAutocomplete(){var t,e,s,i,o;(t=this.autocompleteRef)===null||t===void 0?void 0:t.addEventListener("gov-select",this.onSelectHandler.bind(this));(e=this.autocompleteRef)===null||e===void 0?void 0:e.addEventListener("gov-input",this.onInputHandler.bind(this));(s=this.autocompleteRef)===null||s===void 0?void 0:s.addEventListener("gov-focus",this.onFocusHandler.bind(this));(i=this.autocompleteRef)===null||i===void 0?void 0:i.addEventListener("gov-blur",this.onBlurHandler.bind(this));(o=this.autocompleteRef)===null||o===void 0?void 0:o.setSearchCallback((t=>new Promise((e=>{const s=this.getAvailableOptions();if(String(t).length===0){return e(s)}e(s.filter((({label:e,value:s})=>{if(!e)e=s;return f(e).toLowerCase().indexOf(f(t).toLowerCase())>-1})))})))).finally()}selectedValueIndex(t){return this.selectedOptionsState.findIndex((e=>e===t))}getOptionElement(t){return this.selectRef.querySelector('option[value="'+t+'"]')}getOption(t){var e;return(e=this.getAvailableOptions(true).find((e=>e.value===t)))!==null&&e!==void 0?e:null}selectOption(t,e=true){const s=this.selectedValueIndex(t);if(s===-1){this.selectedOptionsState=[...this.selectedOptionsState,t];this.value=this.selectedOptionsState;if(e){this.govChange.emit({component:n.root,value:this.selectedOptionsState});this.govSelect.emit({component:n.root,value:this.selectedOptionsState})}const s=this.getOptionElement(t);if(s){s.selected=true}}}removeOption(t,e=true){const s=this.selectedValueIndex(t);if(s!==-1){this.selectedOptionsState.splice(s,1);this.selectedOptionsState=[...this.selectedOptionsState];this.value=this.selectedOptionsState;if(e){this.govChange.emit({component:n.root,value:this.selectedOptionsState});this.govRemove.emit({component:n.root,value:this.selectedOptionsState})}const i=this.getOptionElement(t);if(i){i.selected=false}}}async componentDidRender(){this.f.passAttrToLabel("required",String(this.required));v((()=>{this.selectRef.querySelectorAll("option").forEach((t=>{if(t.selected){this.selectOption(t.value,false)}}))}))}render(){return i(o,{key:"00de4cfbb82c004cae37353e271f8535fe46775e",class:n.root,size:this.size},i("div",{key:"7e35ab7e890edf08ae084fc65812755645e32771",class:n.wrap},this.h.hasSlot("prefix")&&i("slot",{key:"9b95a1b803f3eba9470b0dffd2cacd16462b1dfe",name:"prefix"}),i("gov-form-autocomplete",{key:"a5e6f7740ff1ea946e2efcbb122ee3c350f3d79c",value:this.valueState,disabled:this.disabled,identifier:this.identifier||this.selectId,required:false,invalid:this.invalid,success:this.success,size:this.size,placeholder:this.placeholder,"message-empty":this.messageEmpty,"message-loading":this.messageLoading,ref:t=>this.autocompleteRef=t,minlength:0,"aria-owns":this.listId},this.success&&i("gov-icon",{key:"56520f21509ed79d828848f713af383fafe8e47a",slot:"validation-icon",class:"validation-icon",name:"check-lg",type:"components"}),this.invalid&&i("gov-icon",{key:"1f8f2e059a5c8c30ae0644435f591f7cb70e0930",slot:"validation-icon",class:"validation-icon",name:"exclamation-lg",type:"components"}),i("gov-icon",{key:"e6996c534d4c8bda09f365336160dfe552f8a4a0",slot:"icon-end",class:"arrow-icon",name:"chevron-down",type:"components"})),i("select",Object.assign({key:"69a0ec03bc00ee1b7e85f1655a7033f587ea553f",hidden:true,class:"hidden-select-list","aria-hidden":r(true),multiple:true,required:this.required,name:this.name,disabled:this.disabled,ref:t=>this.selectRef=t},this.inheritedAttributes,{"aria-disabled":c(this.disabled),"aria-required":c(this.required),"aria-invalid":c(this.invalid)}),i("slot",{key:"95ccf066ef3585b5c3dc58441e74d70152c0fffb"}),Array.isArray(this.optionsState)&&this.optionsState.map((t=>{var e;const s=this.selectedValueIndex(t.value);return i("option",{value:t.value,selected:s>-1,disabled:t===null||t===void 0?void 0:t.disabled},(e=t.label)!==null&&e!==void 0?e:t.value)}))),this.h.hasSlot("sufix")&&i("slot",{key:"e07e4cd61da18737a4373fd4badc72c9ae3dab30",name:"sufix"})),this.hideSelectedList===false?i("ul",{role:"listbox",id:this.listId,class:n.list},Array.isArray(this.selectedOptionsState)&&this.selectedOptionsState.map((t=>{var e;const s=this.getOption(t);if(!s)return null;return i("li",{class:n.item,role:"option"},(e=s.label)!==null&&e!==void 0?e:s.value,i("gov-button",{"aria-label":`Odebrat vybranou položku ${s.label}`,color:"primary",type:"base",size:this.size,"on-gov-click":()=>this.onTagRemove(t)},i("gov-icon",{name:"x-lg",type:"components"})))}))):null)}onFocusHandler(t){t.stopPropagation();this.focused=true;this.govFocus.emit({component:n.root,originalEvent:t,value:this.selectedOptionsState})}onBlurHandler(t){t.stopPropagation();t.stopPropagation();this.focused=false;this.govBlur.emit({component:n.root,originalEvent:t,value:this.selectedOptionsState})}onInputHandler(t){this.valueState=t.detail.value;t.stopPropagation()}onSelectHandler(t){t.stopPropagation();const e=t.detail.selected;this.selectOption(e.value);this.valueState="";this.autocompleteRef.clearValue().finally();this.autocompleteRef.focus()}onTagRemove(t){this.removeOption(t)}async setFocus(t){return this.selectRef.focus(t)}async setValue(t){this.valueState=t}async getRef(){return this.selectRef}get host(){return this}static get watchers(){return{size:["validateSize"],options:["watchOptions"],value:["watchValue"]}}},[4,"gov-form-multi-select",{value:[1537],options:[1537],identifier:[1],placeholder:[1],size:[1],name:[1],hideSelectedList:[4,"hide-selected-list"],required:[4],disabled:[516],invalid:[516],success:[4],messageEmpty:[1,"message-empty"],messageLoading:[1,"message-loading"],focused:[32],valueState:[32],selectedOptionsState:[32],optionsState:[32],inheritedAttributes:[32],setFocus:[64],setValue:[64],getRef:[64]},undefined,{size:["validateSize"],options:["watchOptions"],value:["watchValue"]}]);function E(){if(typeof customElements==="undefined"){return}const t=["gov-form-multi-select","gov-button","gov-form-autocomplete","gov-form-input","gov-icon","gov-skeleton"];t.forEach((t=>{switch(t){case"gov-form-multi-select":if(!customElements.get(t)){customElements.define(t,w)}break;case"gov-button":if(!customElements.get(t)){b()}break;case"gov-form-autocomplete":if(!customElements.get(t)){y()}break;case"gov-form-input":if(!customElements.get(t)){k()}break;case"gov-icon":if(!customElements.get(t)){j()}break;case"gov-skeleton":if(!customElements.get(t)){S()}break}}))}E();const x=w;const O=E;export{x as GovFormMultiSelect,O as defineCustomElement};
1
+ import{p as t,H as e,c as s,h as i,a as o}from"./index.js";import{g as a,h as n,i as l}from"./p-BSr8e18S.js";import{g as r,t as h,b as c}from"./p-BHRF-5cf.js";import{v as u}from"./p-BKP-F1qP.js";import{c as d,r as f}from"./p-vN03FcXN.js";import{p as m}from"./p-B0hcuYXk.js";import{t as v}from"./p-Cjg0wpDG.js";import{A as p,a as g}from"./p-CXgom82_.js";import{d as b}from"./p-ClDhNt_H.js";import{d as y}from"./p-isPjiQbr.js";import{d as k}from"./p-BNoNH6m-.js";import{d as j}from"./p-DRXiDAHW.js";import{d as w}from"./p-BxS4InzB.js";const S=t(class t extends e{constructor(){super();this.__registerHost();this.govFocus=s(this,"gov-focus");this.govBlur=s(this,"gov-blur");this.govChange=s(this,"gov-change");this.govSelect=s(this,"gov-select");this.govRemove=s(this,"gov-remove");this.size="m";this.hideSelectedList=false;this.required=false;this.disabled=false;this.messageEmpty="Nebyly nalezeny žádné výsledky";this.messageLoading="Načítám...";this.selectedOptionsState=[];this.optionsState=[];this.inheritedAttributes={};this.selectId=d("GovSelect");this.listId=d("GovMultiList");this.h=r(this.host);this.f=a(this.h)}validateSize(t){u(l,t,n.root)}watchOptions(t){this.optionsState=m(t)}watchValue(t){this.selectedOptionsState=m(t)}componentDidLoad(){this.attributeObserver=new p(this.host,((t,e)=>{this.onAriaAttributeChange(t,e)}));this.attributeObserver.startObserving(g);this.initAutocomplete()}componentWillLoad(){this.validateSize(this.size);this.optionsState=m(this.options);this.selectedOptionsState=m(this.value)}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}onAriaAttributeChange(t,e){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:e})}getAvailableOptions(t=false){if(Array.isArray(this.optionsState)&&this.optionsState.length){if(t){return this.optionsState}return this.optionsState.filter((t=>{const e=this.selectedValueIndex(t.value);return e!==-1||(t===null||t===void 0?void 0:t.disabled)?false:true})).map((t=>{var e;return{name:(e=t.label)!==null&&e!==void 0?e:t.value,value:t.value}}))}return Array.from(this.selectRef.querySelectorAll("option")).filter((e=>{if(t){return true}const s=this.selectedValueIndex(e.value);return!(e.disabled||e.selected||s>-1)})).map((t=>({name:t.textContent,value:t.value})))}initAutocomplete(){var t,e,s,i,o;(t=this.autocompleteRef)===null||t===void 0?void 0:t.addEventListener("gov-select",this.onSelectHandler.bind(this));(e=this.autocompleteRef)===null||e===void 0?void 0:e.addEventListener("gov-input",this.onInputHandler.bind(this));(s=this.autocompleteRef)===null||s===void 0?void 0:s.addEventListener("gov-focus",this.onFocusHandler.bind(this));(i=this.autocompleteRef)===null||i===void 0?void 0:i.addEventListener("gov-blur",this.onBlurHandler.bind(this));(o=this.autocompleteRef)===null||o===void 0?void 0:o.setSearchCallback((t=>new Promise((e=>{const s=this.getAvailableOptions();if(String(t).length===0){return e(s)}e(s.filter((({label:e,value:s})=>{if(!e)e=s;return f(e).toLowerCase().indexOf(f(t).toLowerCase())>-1})))})))).finally()}selectedValueIndex(t){return this.selectedOptionsState.findIndex((e=>e===t))}getOptionElement(t){return this.selectRef.querySelector('option[value="'+t+'"]')}getOption(t){var e;return(e=this.getAvailableOptions(true).find((e=>e.value===t)))!==null&&e!==void 0?e:null}selectOption(t,e=true){const s=this.selectedValueIndex(t);if(s===-1){this.selectedOptionsState=[...this.selectedOptionsState,t];this.value=this.selectedOptionsState;if(e){this.govChange.emit({component:n.root,value:this.selectedOptionsState});this.govSelect.emit({component:n.root,value:this.selectedOptionsState})}const s=this.getOptionElement(t);if(s){s.selected=true}}}removeOption(t,e=true){const s=this.selectedValueIndex(t);if(s!==-1){this.selectedOptionsState.splice(s,1);this.selectedOptionsState=[...this.selectedOptionsState];this.value=this.selectedOptionsState;if(e){this.govChange.emit({component:n.root,value:this.selectedOptionsState});this.govRemove.emit({component:n.root,value:this.selectedOptionsState})}const i=this.getOptionElement(t);if(i){i.selected=false}}}async componentDidRender(){this.f.passAttrToLabel("required",String(this.required));v((()=>{this.selectRef.querySelectorAll("option").forEach((t=>{if(t.selected){this.selectOption(t.value,false)}}))}))}render(){return i(o,{key:"00de4cfbb82c004cae37353e271f8535fe46775e",class:n.root,size:this.size},i("div",{key:"7e35ab7e890edf08ae084fc65812755645e32771",class:n.wrap},this.h.hasSlot("prefix")&&i("slot",{key:"9b95a1b803f3eba9470b0dffd2cacd16462b1dfe",name:"prefix"}),i("gov-form-autocomplete",{key:"a5e6f7740ff1ea946e2efcbb122ee3c350f3d79c",value:this.valueState,disabled:this.disabled,identifier:this.identifier||this.selectId,required:false,invalid:this.invalid,success:this.success,size:this.size,placeholder:this.placeholder,"message-empty":this.messageEmpty,"message-loading":this.messageLoading,ref:t=>this.autocompleteRef=t,minlength:0,"aria-owns":this.listId},this.success&&i("gov-icon",{key:"56520f21509ed79d828848f713af383fafe8e47a",slot:"validation-icon",class:"validation-icon",name:"check-lg",type:"components"}),this.invalid&&i("gov-icon",{key:"1f8f2e059a5c8c30ae0644435f591f7cb70e0930",slot:"validation-icon",class:"validation-icon",name:"exclamation-lg",type:"components"}),i("gov-icon",{key:"e6996c534d4c8bda09f365336160dfe552f8a4a0",slot:"icon-end",class:"arrow-icon",name:"chevron-down",type:"components"})),i("select",Object.assign({key:"69a0ec03bc00ee1b7e85f1655a7033f587ea553f",hidden:true,class:"hidden-select-list","aria-hidden":h(true),multiple:true,required:this.required,name:this.name,disabled:this.disabled,ref:t=>this.selectRef=t},this.inheritedAttributes,{"aria-disabled":c(this.disabled),"aria-required":c(this.required),"aria-invalid":c(this.invalid)}),i("slot",{key:"95ccf066ef3585b5c3dc58441e74d70152c0fffb"}),Array.isArray(this.optionsState)&&this.optionsState.map((t=>{var e;const s=this.selectedValueIndex(t.value);return i("option",{value:t.value,selected:s>-1,disabled:t===null||t===void 0?void 0:t.disabled},(e=t.label)!==null&&e!==void 0?e:t.value)}))),this.h.hasSlot("sufix")&&i("slot",{key:"e07e4cd61da18737a4373fd4badc72c9ae3dab30",name:"sufix"})),this.hideSelectedList===false?i("ul",{role:"listbox",id:this.listId,class:n.list},Array.isArray(this.selectedOptionsState)&&this.selectedOptionsState.map((t=>{var e;const s=this.getOption(t);if(!s)return null;return i("li",{class:n.item,role:"option"},(e=s.label)!==null&&e!==void 0?e:s.value,i("gov-button",{"aria-label":`Odebrat vybranou položku ${s.label}`,color:"primary",type:"base",size:this.size,"on-gov-click":()=>this.onTagRemove(t)},i("gov-icon",{name:"x-lg",type:"components"})))}))):null)}onFocusHandler(t){t.stopPropagation();this.focused=true;this.govFocus.emit({component:n.root,originalEvent:t,value:this.selectedOptionsState})}onBlurHandler(t){t.stopPropagation();t.stopPropagation();this.focused=false;this.govBlur.emit({component:n.root,originalEvent:t,value:this.selectedOptionsState})}onInputHandler(t){this.valueState=t.detail.value;t.stopPropagation()}onSelectHandler(t){t.stopPropagation();const e=t.detail.selected;this.selectOption(e.value);this.valueState="";this.autocompleteRef.clearValue().finally();this.autocompleteRef.focus()}onTagRemove(t){this.removeOption(t)}async setFocus(t){return this.selectRef.focus(t)}async setValue(t){this.valueState=t}async getRef(){return this.selectRef}get host(){return this}static get watchers(){return{size:["validateSize"],options:["watchOptions"],value:["watchValue"]}}},[4,"gov-form-multi-select",{value:[1537],options:[1537],identifier:[1],placeholder:[1],size:[1],name:[1],hideSelectedList:[4,"hide-selected-list"],required:[4],disabled:[516],invalid:[516],success:[4],messageEmpty:[1,"message-empty"],messageLoading:[1,"message-loading"],focused:[32],valueState:[32],selectedOptionsState:[32],optionsState:[32],inheritedAttributes:[32],setFocus:[64],setValue:[64],getRef:[64]},undefined,{size:["validateSize"],options:["watchOptions"],value:["watchValue"]}]);function O(){if(typeof customElements==="undefined"){return}const t=["gov-form-multi-select","gov-button","gov-form-autocomplete","gov-form-input","gov-icon","gov-skeleton"];t.forEach((t=>{switch(t){case"gov-form-multi-select":if(!customElements.get(t)){customElements.define(t,S)}break;case"gov-button":if(!customElements.get(t)){b()}break;case"gov-form-autocomplete":if(!customElements.get(t)){y()}break;case"gov-form-input":if(!customElements.get(t)){k()}break;case"gov-icon":if(!customElements.get(t)){j()}break;case"gov-skeleton":if(!customElements.get(t)){w()}break}}))}O();const x=S;const E=O;export{x as GovFormMultiSelect,E as defineCustomElement};
2
2
  //# sourceMappingURL=gov-form-multi-select.js.map
@@ -1,2 +1,2 @@
1
- import{p as t,H as s,c as i,h as e,a as o}from"./index.js";import{p as a}from"./p-CQvUntGY.js";import{S as n}from"./p-BcQO4NH2.js";import{g as r,t as h,b as c}from"./p-BHRF-5cf.js";import{v as l}from"./p-BKP-F1qP.js";import{A as u,a as d,i as f}from"./p-CXgom82_.js";import{g as m}from"./p-BSr8e18S.js";import{t as p}from"./p-Cjg0wpDG.js";import{b as v}from"./p-B3tdsiZv.js";import{c as b}from"./p-vN03FcXN.js";import{d as g}from"./p-C_URF9Su.js";import{d as j}from"./p-DN5pb9xA.js";import{d as w}from"./p-CXPP9vec.js";const C=a(n,["_S","_M","_L"]);const A={root:"gov-form-range",fill:"gov-form-range--fill",input:"gov-form-range--input"};const y=t(class t extends s{constructor(){super();this.__registerHost();this.govFocus=i(this,"gov-focus");this.govBlur=i(this,"gov-blur");this.govInput=i(this,"gov-input");this.size="m";this.tooltip=false;this.input=false;this.required=false;this.disabled=false;this.inheritedAttributes={};this.h=r(this.host);this.f=m(this.h);this.inputId=b("GovInput")}validateSize(t){l(C,t,A.root)}watchValue(){this.controlOutputPosition()}watchControlAttrs(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("success",h(this.success));this.f.passAttrToControl("disabled",h(this.disabled));this.f.passAttrToControl("invalid",h(this.invalid))}get getThumbWidth(){const t=window.getComputedStyle(this.inputRef);return parseFloat(t.getPropertyValue("--thumb-size"))||1}controlOutputPosition(){const t=+this.value;const s=+this.inputRef.min;const i=+this.inputRef.max;const e=this.getThumbWidth*16;const o=this.inputRef.offsetWidth;const a=(t-s)/(i-s)*100;let n=a/100*(o-e)+e/2;if(this.outputRef){this.outputRef.textContent=this.value;const t=this.outputRef.offsetWidth/2;this.outputRef.style.left=`${n-t}px`}if(this.fillRef){this.fillRef.style.width=`${n}px`}}componentDidLoad(){this.attributeObserver=new u(this.host,((t,s)=>{this.onAriaAttributeChange(t,s)}));this.attributeObserver.startObserving(d)}componentWillLoad(){this.validateSize(this.size);this.inheritedAttributes=f(this.host)}componentDidRender(){this.passControlAttrs();this.f.passAttrToLabel("required",String(this.required));p(this.controlOutputPosition.bind(this))}onAriaAttributeChange(t,s){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:s})}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}render(){return e(o,{key:"28444cac3f85772d0efb301cb43219c184f8f2fe",class:A.root,size:this.size},this.h.hasSlot("prefix")&&e("slot",{key:"3ec11551a934f90dd8ee821b11e626a07b865ed0",name:"prefix"}),e("span",{key:"63ac5b2b977124208fe55f237d378cbb7d20e72f",class:"element"},e("input",Object.assign({key:"802a3145c61e9074733e80ae5a66094ae0b9657d",type:"range",ref:t=>this.inputRef=t,onInput:this.onInputHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),id:this.identifier||this.inputId,name:this.name,min:this.min,max:this.max,step:this.step,list:this.listIdentifier,value:this.value,required:this.required,disabled:this.disabled},this.inheritedAttributes,{"aria-required":c(this.required),"aria-invalid":c(this.invalid),"aria-disabled":c(this.disabled)})),e("div",{key:"3aa0f6ab956c1d3f58d256b137dc4bde129d2eba",class:A.fill,ref:t=>this.fillRef=t}),this.tooltip?e("output",{htmlFor:this.name,ref:t=>this.outputRef=t},this.value):null,e("slot",{key:"b71ca566187911623048a030870330d0b42ae1fd",name:"datalist"})),this.h.hasSlot("sufix")&&e("slot",{key:"18e53573e7b90cba853deead846b30325727e3d1",name:"sufix"}),this.input?e("gov-form-input",Object.assign({"on-gov-input":this.onCustomInputHandler.bind(this),class:A.input,size:this.size,value:this.value,disabled:this.disabled},this.inheritedAttributes)):null)}onCustomInputHandler(t){const s=t.target.value;if(this.step&&v(+this.step)){const i=+s;const e=+this.min;const o=+this.max;const a=+this.step;if(isNaN(i)){return false}if(i<e||i>o){return false}const n=i-e;if(n%a!==0){return false}this.value=s;this.govInput.emit({component:A.root,value:this.value,originalEvent:t})}}onInputHandler(t){this.value=t.target.value;t.stopPropagation();this.govInput.emit({component:A.root,value:this.value,originalEvent:t})}onFocusHandler(t){t.stopPropagation();this.govFocus.emit({component:A.root,value:this.value,originalEvent:t})}onBlurHandler(t){t.stopPropagation();this.govBlur.emit({component:A.root,value:this.value,originalEvent:t})}async setFocus(t){return this.inputRef.focus(t)}async setValue(t){this.value=t}async clearValue(){this.value="";this.inputRef.value=""}async getRef(){return this.inputRef}get host(){return this}static get watchers(){return{size:["validateSize","watchControlAttrs"],value:["watchValue"],disabled:["watchControlAttrs"],invalid:["watchControlAttrs"],success:["watchControlAttrs"]}}},[4,"gov-form-range",{size:[1],value:[1537],identifier:[1],name:[1],min:[8],max:[8],step:[8],tooltip:[4],input:[4],listIdentifier:[1,"list-identifier"],required:[516],success:[516],invalid:[516],disabled:[516],inheritedAttributes:[32],setFocus:[64],setValue:[64],clearValue:[64],getRef:[64]},undefined,{size:["validateSize","watchControlAttrs"],value:["watchValue"],disabled:["watchControlAttrs"],invalid:["watchControlAttrs"],success:["watchControlAttrs"]}]);function k(){if(typeof customElements==="undefined"){return}const t=["gov-form-range","gov-button","gov-form-input","gov-icon"];t.forEach((t=>{switch(t){case"gov-form-range":if(!customElements.get(t)){customElements.define(t,y)}break;case"gov-button":if(!customElements.get(t)){g()}break;case"gov-form-input":if(!customElements.get(t)){j()}break;case"gov-icon":if(!customElements.get(t)){w()}break}}))}k();const x=y;const z=k;export{x as GovFormRange,z as defineCustomElement};
1
+ import{p as t,H as s,c as i,h as e,a as o}from"./index.js";import{p as a}from"./p-CQvUntGY.js";import{S as n}from"./p-BcQO4NH2.js";import{g as h,t as r,b as c}from"./p-BHRF-5cf.js";import{v as l}from"./p-BKP-F1qP.js";import{A as u,a as d,i as f}from"./p-CXgom82_.js";import{g as m}from"./p-BSr8e18S.js";import{t as p}from"./p-Cjg0wpDG.js";import{b as v}from"./p-B3tdsiZv.js";import{c as b}from"./p-vN03FcXN.js";import{d as g}from"./p-ClDhNt_H.js";import{d as j}from"./p-BNoNH6m-.js";import{d as w}from"./p-DRXiDAHW.js";const C=a(n,["_S","_M","_L"]);const A={root:"gov-form-range",fill:"gov-form-range--fill",input:"gov-form-range--input"};const y=t(class t extends s{constructor(){super();this.__registerHost();this.govFocus=i(this,"gov-focus");this.govBlur=i(this,"gov-blur");this.govInput=i(this,"gov-input");this.size="m";this.tooltip=false;this.input=false;this.required=false;this.disabled=false;this.inheritedAttributes={};this.h=h(this.host);this.f=m(this.h);this.inputId=b("GovInput")}validateSize(t){l(C,t,A.root)}watchValue(){this.controlOutputPosition()}watchControlAttrs(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("success",r(this.success));this.f.passAttrToControl("disabled",r(this.disabled));this.f.passAttrToControl("invalid",r(this.invalid))}get getThumbWidth(){const t=window.getComputedStyle(this.inputRef);return parseFloat(t.getPropertyValue("--thumb-size"))||1}controlOutputPosition(){const t=+this.value;const s=+this.inputRef.min;const i=+this.inputRef.max;const e=this.getThumbWidth*16;const o=this.inputRef.offsetWidth;const a=(t-s)/(i-s)*100;let n=a/100*(o-e)+e/2;if(this.outputRef){this.outputRef.textContent=this.value;const t=this.outputRef.offsetWidth/2;this.outputRef.style.left=`${n-t}px`}if(this.fillRef){this.fillRef.style.width=`${n}px`}}componentDidLoad(){this.attributeObserver=new u(this.host,((t,s)=>{this.onAriaAttributeChange(t,s)}));this.attributeObserver.startObserving(d)}componentWillLoad(){this.validateSize(this.size);this.inheritedAttributes=f(this.host)}componentDidRender(){this.passControlAttrs();this.f.passAttrToLabel("required",String(this.required));p(this.controlOutputPosition.bind(this))}onAriaAttributeChange(t,s){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:s})}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}render(){return e(o,{key:"28444cac3f85772d0efb301cb43219c184f8f2fe",class:A.root,size:this.size},this.h.hasSlot("prefix")&&e("slot",{key:"3ec11551a934f90dd8ee821b11e626a07b865ed0",name:"prefix"}),e("span",{key:"63ac5b2b977124208fe55f237d378cbb7d20e72f",class:"element"},e("input",Object.assign({key:"802a3145c61e9074733e80ae5a66094ae0b9657d",type:"range",ref:t=>this.inputRef=t,onInput:this.onInputHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),id:this.identifier||this.inputId,name:this.name,min:this.min,max:this.max,step:this.step,list:this.listIdentifier,value:this.value,required:this.required,disabled:this.disabled},this.inheritedAttributes,{"aria-required":c(this.required),"aria-invalid":c(this.invalid),"aria-disabled":c(this.disabled)})),e("div",{key:"3aa0f6ab956c1d3f58d256b137dc4bde129d2eba",class:A.fill,ref:t=>this.fillRef=t}),this.tooltip?e("output",{htmlFor:this.name,ref:t=>this.outputRef=t},this.value):null,e("slot",{key:"b71ca566187911623048a030870330d0b42ae1fd",name:"datalist"})),this.h.hasSlot("sufix")&&e("slot",{key:"18e53573e7b90cba853deead846b30325727e3d1",name:"sufix"}),this.input?e("gov-form-input",Object.assign({"on-gov-input":this.onCustomInputHandler.bind(this),class:A.input,size:this.size,value:this.value,disabled:this.disabled},this.inheritedAttributes)):null)}onCustomInputHandler(t){const s=t.target.value;if(this.step&&v(+this.step)){const i=+s;const e=+this.min;const o=+this.max;const a=+this.step;if(isNaN(i)){return false}if(i<e||i>o){return false}const n=i-e;if(n%a!==0){return false}this.value=s;this.govInput.emit({component:A.root,value:this.value,originalEvent:t})}}onInputHandler(t){this.value=t.target.value;t.stopPropagation();this.govInput.emit({component:A.root,value:this.value,originalEvent:t})}onFocusHandler(t){t.stopPropagation();this.govFocus.emit({component:A.root,value:this.value,originalEvent:t})}onBlurHandler(t){t.stopPropagation();this.govBlur.emit({component:A.root,value:this.value,originalEvent:t})}async setFocus(t){return this.inputRef.focus(t)}async setValue(t){this.value=t}async clearValue(){this.value="";this.inputRef.value=""}async getRef(){return this.inputRef}get host(){return this}static get watchers(){return{size:["validateSize","watchControlAttrs"],value:["watchValue"],disabled:["watchControlAttrs"],invalid:["watchControlAttrs"],success:["watchControlAttrs"]}}},[4,"gov-form-range",{size:[1],value:[1537],identifier:[1],name:[1],min:[8],max:[8],step:[8],tooltip:[4],input:[4],listIdentifier:[1,"list-identifier"],required:[516],success:[516],invalid:[516],disabled:[516],inheritedAttributes:[32],setFocus:[64],setValue:[64],clearValue:[64],getRef:[64]},undefined,{size:["validateSize","watchControlAttrs"],value:["watchValue"],disabled:["watchControlAttrs"],invalid:["watchControlAttrs"],success:["watchControlAttrs"]}]);function k(){if(typeof customElements==="undefined"){return}const t=["gov-form-range","gov-button","gov-form-input","gov-icon"];t.forEach((t=>{switch(t){case"gov-form-range":if(!customElements.get(t)){customElements.define(t,y)}break;case"gov-button":if(!customElements.get(t)){g()}break;case"gov-form-input":if(!customElements.get(t)){j()}break;case"gov-icon":if(!customElements.get(t)){w()}break}}))}k();const x=y;const z=k;export{x as GovFormRange,z as defineCustomElement};
2
2
  //# sourceMappingURL=gov-form-range.js.map
@@ -1,2 +1,2 @@
1
- import{G as o,d as s}from"./p-yIpIIG5A.js";const p=o;const t=s;export{p as GovFormSelect,t as defineCustomElement};
1
+ import{G as o,d as s}from"./p-DmK9qaKH.js";const t=o;const a=s;export{t as GovFormSelect,a as defineCustomElement};
2
2
  //# sourceMappingURL=gov-form-select.js.map
@@ -1,2 +1,2 @@
1
- import{p as s,H as i,c as t,h as e,a as h}from"./index.js";import{c as a}from"./p-vN03FcXN.js";import{v as n}from"./p-BKP-F1qP.js";import{g as o,n as c,o as r}from"./p-BSr8e18S.js";import{g as l,t as d,b as m}from"./p-BHRF-5cf.js";import{F as u}from"./p-5itQzbON.js";import{A as p,a as v,i as b}from"./p-CXgom82_.js";import{d as f}from"./p-CXPP9vec.js";const g=s(class s extends i{constructor(){super();this.__registerHost();this.govFocus=t(this,"gov-focus");this.govBlur=t(this,"gov-blur");this.govChange=t(this,"gov-change");this.hydrated=false;this.noLabel=false;this.checked=false;this.required=false;this.disabled=false;this.size="m";this.inheritedAttributes={};this.checkboxId=a("GovCheckbox");this.h=l(this.host);this.f=o(this.h)}validateSize(s){n(r,s,c.root)}watchDisabled(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("invalid",d(this.invalid));this.f.passAttrToControl("disabled",d(this.disabled));this.f.passAttrToControl("type","switch")}componentDidLoad(){this.attributeObserver=new p(this.host,((s,i)=>{this.onAriaAttributeChange(s,i)}));this.attributeObserver.startObserving(v)}componentWillLoad(){this.passControlAttrs();this.inheritedAttributes=b(this.host)}disconnectedCallback(){var s;(s=this.attributeObserver)===null||s===void 0?void 0:s.stopObserving()}async componentDidRender(){this.f.passAttrToLabel("identifier",this.identifier||this.checkboxId);this.f.passAttrToLabel("required",String(this.required));this.passControlAttrs()}connectedCallback(){this.hydrated=true}onAriaAttributeChange(s,i){this.host.removeAttribute(s);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[s]:i})}render(){const s=s=>{if(this.noLabel){return e("label",{class:c.label},s)}return s};const i=!this.host.querySelector('[slot="label"]');const t=`${this.h.classes(c.root)}${i?` ${c.noLabel}`:""}`;return e(h,{class:t,hydrated:this.hydrated,checked:this.checked,size:this.size,invalid:m(this.invalid)},s(e(u,null,e("input",Object.assign({class:c.input,id:this.identifier||this.checkboxId,type:"checkbox",value:this.value,name:this.name,disabled:this.disabled,checked:this.checked,onClick:this.onClickHandler.bind(this),onChange:this.onChangeHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),ref:s=>this.inputRef=s,required:this.required},this.inheritedAttributes,{"aria-checked":this.checked,"aria-required":m(this.required),"aria-invalid":m(this.invalid),"aria-disabled":m(this.disabled)})),e("span",null,e("span",{class:c.indicator},this.checked&&e("gov-icon",{name:"check-lg",type:"components"})),e("slot",{name:"label"})))))}onClickHandler(s){s.stopPropagation()}onFocusHandler(s){s.stopPropagation();this.govFocus.emit({component:c.root,checked:this.checked,value:this.value,originalEvent:s})}onBlurHandler(s){s.stopPropagation();this.govBlur.emit({component:c.root,checked:this.checked,value:this.value,originalEvent:s})}onChangeHandler(s){this.checked=s.target.checked;s.stopPropagation();this.govChange.emit({component:c.root,checked:this.checked,value:this.value,originalEvent:s})}async getRef(){return this.inputRef}get host(){return this}static get watchers(){return{size:["validateSize","watchDisabled"],disabled:["watchDisabled"],invalid:["watchDisabled"]}}},[4,"gov-form-switch",{value:[1],noLabel:[4,"no-label"],checked:[1540],required:[4],disabled:[516],name:[1],size:[513],identifier:[1],invalid:[4],inheritedAttributes:[32],getRef:[64]},undefined,{size:["validateSize","watchDisabled"],disabled:["watchDisabled"],invalid:["watchDisabled"]}]);function k(){if(typeof customElements==="undefined"){return}const s=["gov-form-switch","gov-icon"];s.forEach((s=>{switch(s){case"gov-form-switch":if(!customElements.get(s)){customElements.define(s,g)}break;case"gov-icon":if(!customElements.get(s)){f()}break}}))}k();const w=g;const j=k;export{w as GovFormSwitch,j as defineCustomElement};
1
+ import{p as i,H as s,c as t,h as e,a as h}from"./index.js";import{c as a}from"./p-vN03FcXN.js";import{v as n}from"./p-BKP-F1qP.js";import{g as o,n as c,o as r}from"./p-BSr8e18S.js";import{g as l,t as d,b as m}from"./p-BHRF-5cf.js";import{F as u}from"./p-5itQzbON.js";import{A as p,a as b,i as v}from"./p-CXgom82_.js";import{d as f}from"./p-DRXiDAHW.js";const g=i(class i extends s{constructor(){super();this.__registerHost();this.govFocus=t(this,"gov-focus");this.govBlur=t(this,"gov-blur");this.govChange=t(this,"gov-change");this.hydrated=false;this.noLabel=false;this.checked=false;this.required=false;this.disabled=false;this.size="m";this.inheritedAttributes={};this.checkboxId=a("GovCheckbox");this.h=l(this.host);this.f=o(this.h)}validateSize(i){n(r,i,c.root)}watchDisabled(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("invalid",d(this.invalid));this.f.passAttrToControl("disabled",d(this.disabled));this.f.passAttrToControl("type","switch")}componentDidLoad(){this.attributeObserver=new p(this.host,((i,s)=>{this.onAriaAttributeChange(i,s)}));this.attributeObserver.startObserving(b)}componentWillLoad(){this.passControlAttrs();this.inheritedAttributes=v(this.host)}disconnectedCallback(){var i;(i=this.attributeObserver)===null||i===void 0?void 0:i.stopObserving()}async componentDidRender(){this.f.passAttrToLabel("identifier",this.identifier||this.checkboxId);this.f.passAttrToLabel("required",String(this.required));this.passControlAttrs()}connectedCallback(){this.hydrated=true}onAriaAttributeChange(i,s){this.host.removeAttribute(i);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[i]:s})}render(){const i=i=>{if(this.noLabel){return e("label",{class:c.label},i)}return i};const s=!this.host.querySelector('[slot="label"]');const t=`${this.h.classes(c.root)}${s?` ${c.noLabel}`:""}`;return e(h,{class:t,hydrated:this.hydrated,checked:this.checked,size:this.size,invalid:m(this.invalid)},i(e(u,null,e("input",Object.assign({class:c.input,id:this.identifier||this.checkboxId,type:"checkbox",value:this.value,name:this.name,disabled:this.disabled,checked:this.checked,onClick:this.onClickHandler.bind(this),onChange:this.onChangeHandler.bind(this),onFocus:this.onFocusHandler.bind(this),onBlur:this.onBlurHandler.bind(this),ref:i=>this.inputRef=i,required:this.required},this.inheritedAttributes,{"aria-checked":this.checked,"aria-required":m(this.required),"aria-invalid":m(this.invalid),"aria-disabled":m(this.disabled)})),e("span",null,e("span",{class:c.indicator},this.checked&&e("gov-icon",{name:"check-lg",type:"components"})),e("slot",{name:"label"})))))}onClickHandler(i){i.stopPropagation()}onFocusHandler(i){i.stopPropagation();this.govFocus.emit({component:c.root,checked:this.checked,value:this.value,originalEvent:i})}onBlurHandler(i){i.stopPropagation();this.govBlur.emit({component:c.root,checked:this.checked,value:this.value,originalEvent:i})}onChangeHandler(i){this.checked=i.target.checked;i.stopPropagation();this.govChange.emit({component:c.root,checked:this.checked,value:this.value,originalEvent:i})}async getRef(){return this.inputRef}get host(){return this}static get watchers(){return{size:["validateSize","watchDisabled"],disabled:["watchDisabled"],invalid:["watchDisabled"]}}},[4,"gov-form-switch",{value:[1],noLabel:[4,"no-label"],checked:[1540],required:[4],disabled:[516],name:[1],size:[513],identifier:[1],invalid:[4],inheritedAttributes:[32],getRef:[64]},undefined,{size:["validateSize","watchDisabled"],disabled:["watchDisabled"],invalid:["watchDisabled"]}]);function k(){if(typeof customElements==="undefined"){return}const i=["gov-form-switch","gov-icon"];i.forEach((i=>{switch(i){case"gov-form-switch":if(!customElements.get(i)){customElements.define(i,g)}break;case"gov-icon":if(!customElements.get(i)){f()}break}}))}k();const w=g;const j=k;export{w as GovFormSwitch,j as defineCustomElement};
2
2
  //# sourceMappingURL=gov-form-switch.js.map
@@ -1,2 +1,2 @@
1
- import{G as o,d as s}from"./p-CXPP9vec.js";const t=o;const c=s;export{t as GovIcon,c as defineCustomElement};
1
+ import{G as o,d as s}from"./p-DRXiDAHW.js";const t=o;const p=s;export{t as GovIcon,p as defineCustomElement};
2
2
  //# sourceMappingURL=gov-icon.js.map
@@ -1,2 +1,2 @@
1
- import{p as t,H as e,c as s,h as o,a as i}from"./index.js";import{g as a,t as n}from"./p-BHRF-5cf.js";import{F as c}from"./p-5itQzbON.js";import{v as l}from"./p-BKP-F1qP.js";import{C as r}from"./p-U40vKHrs.js";import{p as h}from"./p-CQvUntGY.js";import{A as d,a as b,i as f}from"./p-CXgom82_.js";import{d as m}from"./p-C_URF9Su.js";import{d as v}from"./p-CXPP9vec.js";const p=h(r,["PRIMARY","SECONDARY","NEUTRAL","ERROR","SUCCESS","WARNING"]);var u;(function(t){t["BOLD"]="bold";t["SUBTLE"]="subtle"})(u||(u={}));const g={root:"gov-infobar",section:"gov-infobar__section",content:"gov-infobar__content",headline:"gov-infobar__headline",close:"gov-infobar__close"};const C=t(class t extends e{constructor(){super();this.__registerHost();this.govClose=s(this,"gov-close");this.hydrated=false;this.color="primary";this.type="bold";this.role=undefined;this.accessibleCloseLabel="Zavřít informační lištu";this.accessibleToggleLabel="Zobrazit více informací";this.closable=false;this.toggleContent=false;this.inheritedAttributes={};this.h=a(this.host)}validateColor(t){l(p,t,g.root)}componentDidLoad(){this.attributeObserver=new d(this.host,((t,e)=>{this.onAriaAttributeChange(t,e)}));this.attributeObserver.startObserving(b)}componentWillLoad(){this.validateColor(this.color);this.inheritedAttributes=f(this.host)}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}onAriaAttributeChange(t,e){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:e})}connectedCallback(){this.hydrated=true}render(){const t=o("gov-button",{key:"c52201d2fd9a489e8eb152e8f7b3080cc9d347f0",size:"s","aria-label":this.accessibleCloseLabel,type:"base",color:this.isBold?this.color:"neutral","on-gov-click":this.onCloseHandler.bind(this),class:g.close},o("gov-icon",{key:"c5d79b9980d755afae94643836d58ab2dd5b4e4f",name:"x-lg",type:"components"}));return o(i,{key:"f7c79cc67ee83527ff3c56d8e96f325b5366154f",class:this.h.classes(g.root),color:this.color,type:this.type,hydrated:this.hydrated},o("section",Object.assign({key:"dceb21332d31d55cb2f63d078efc5284439978ae",class:g.section},this.inheritedAttributes,{role:this.role}),this.h.hasSlot("icon")&&o("span",{key:"5dcf6a77672669228e8b94b7c39141624706254b"},o("slot",{key:"b158350430cf7249f9f7ea59fbf675879a195c39",name:"icon"})),o("div",{key:"17894bba1c6538d205a64e055aa6ee82825176a0",class:g.content},this.h.hasSlot("headline")?o(c,null,o("div",{class:g.headline},o("slot",{name:"headline"}),o("gov-button",{size:"s",type:"base",color:this.isBold?this.color:"neutral","aria-label":this.accessibleToggleLabel,"on-gov-click":()=>this.toggleContent=!this.toggleContent},o("gov-icon",{name:this.toggleContent?"chevron-up":"chevron-down",type:"components"}))),o("div",{hidden:!this.toggleContent,"aria-hidden":n(this.toggleContent)},o("slot",null))):o("slot",null)),this.closable&&t))}onCloseHandler(t){this.govClose.emit({component:g.root,ref:this.host,originalEvent:t})}get isBold(){return this.type==="bold"}get host(){return this}static get watchers(){return{color:["validateColor"]}}},[4,"gov-infobar",{color:[1],type:[1],role:[1],accessibleCloseLabel:[1,"accessible-close-label"],accessibleToggleLabel:[1,"accessible-toggle-label"],closable:[4],toggleContent:[32],inheritedAttributes:[32]},undefined,{color:["validateColor"]}]);function y(){if(typeof customElements==="undefined"){return}const t=["gov-infobar","gov-button","gov-icon"];t.forEach((t=>{switch(t){case"gov-infobar":if(!customElements.get(t)){customElements.define(t,C)}break;case"gov-button":if(!customElements.get(t)){m()}break;case"gov-icon":if(!customElements.get(t)){v()}break}}))}y();const k=C;const j=y;export{k as GovInfobar,j as defineCustomElement};
1
+ import{p as t,H as s,c as e,h as o,a as i}from"./index.js";import{g as a,t as n}from"./p-BHRF-5cf.js";import{F as c}from"./p-5itQzbON.js";import{v as l}from"./p-BKP-F1qP.js";import{C as r}from"./p-U40vKHrs.js";import{p as h}from"./p-CQvUntGY.js";import{A as d,a as b,i as f}from"./p-CXgom82_.js";import{d as m}from"./p-ClDhNt_H.js";import{d as v}from"./p-DRXiDAHW.js";const p=h(r,["PRIMARY","SECONDARY","NEUTRAL","ERROR","SUCCESS","WARNING"]);var g;(function(t){t["BOLD"]="bold";t["SUBTLE"]="subtle"})(g||(g={}));const u={root:"gov-infobar",section:"gov-infobar__section",content:"gov-infobar__content",headline:"gov-infobar__headline",close:"gov-infobar__close"};const y=t(class t extends s{constructor(){super();this.__registerHost();this.govClose=e(this,"gov-close");this.hydrated=false;this.color="primary";this.type="bold";this.role=undefined;this.accessibleCloseLabel="Zavřít informační lištu";this.accessibleToggleLabel="Zobrazit více informací";this.closable=false;this.toggleContent=false;this.inheritedAttributes={};this.h=a(this.host)}validateColor(t){l(p,t,u.root)}componentDidLoad(){this.attributeObserver=new d(this.host,((t,s)=>{this.onAriaAttributeChange(t,s)}));this.attributeObserver.startObserving(b)}componentWillLoad(){this.validateColor(this.color);this.inheritedAttributes=f(this.host)}disconnectedCallback(){var t;(t=this.attributeObserver)===null||t===void 0?void 0:t.stopObserving()}onAriaAttributeChange(t,s){this.host.removeAttribute(t);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[t]:s})}connectedCallback(){this.hydrated=true}render(){const t=o("gov-button",{key:"c52201d2fd9a489e8eb152e8f7b3080cc9d347f0",size:"s","aria-label":this.accessibleCloseLabel,type:"base",color:this.isBold?this.color:"neutral","on-gov-click":this.onCloseHandler.bind(this),class:u.close},o("gov-icon",{key:"c5d79b9980d755afae94643836d58ab2dd5b4e4f",name:"x-lg",type:"components"}));return o(i,{key:"f7c79cc67ee83527ff3c56d8e96f325b5366154f",class:this.h.classes(u.root),color:this.color,type:this.type,hydrated:this.hydrated},o("section",Object.assign({key:"dceb21332d31d55cb2f63d078efc5284439978ae",class:u.section},this.inheritedAttributes,{role:this.role}),this.h.hasSlot("icon")&&o("span",{key:"5dcf6a77672669228e8b94b7c39141624706254b"},o("slot",{key:"b158350430cf7249f9f7ea59fbf675879a195c39",name:"icon"})),o("div",{key:"17894bba1c6538d205a64e055aa6ee82825176a0",class:u.content},this.h.hasSlot("headline")?o(c,null,o("div",{class:u.headline},o("slot",{name:"headline"}),o("gov-button",{size:"s",type:"base",color:this.isBold?this.color:"neutral","aria-label":this.accessibleToggleLabel,"on-gov-click":()=>this.toggleContent=!this.toggleContent},o("gov-icon",{name:this.toggleContent?"chevron-up":"chevron-down",type:"components"}))),o("div",{hidden:!this.toggleContent,"aria-hidden":n(this.toggleContent)},o("slot",null))):o("slot",null)),this.closable&&t))}onCloseHandler(t){this.govClose.emit({component:u.root,ref:this.host,originalEvent:t})}get isBold(){return this.type==="bold"}get host(){return this}static get watchers(){return{color:["validateColor"]}}},[4,"gov-infobar",{color:[1],type:[1],role:[1],accessibleCloseLabel:[1,"accessible-close-label"],accessibleToggleLabel:[1,"accessible-toggle-label"],closable:[4],toggleContent:[32],inheritedAttributes:[32]},undefined,{color:["validateColor"]}]);function C(){if(typeof customElements==="undefined"){return}const t=["gov-infobar","gov-button","gov-icon"];t.forEach((t=>{switch(t){case"gov-infobar":if(!customElements.get(t)){customElements.define(t,y)}break;case"gov-button":if(!customElements.get(t)){m()}break;case"gov-icon":if(!customElements.get(t)){v()}break}}))}C();const k=y;const j=C;export{k as GovInfobar,j as defineCustomElement};
2
2
  //# sourceMappingURL=gov-infobar.js.map
@@ -1,2 +1,2 @@
1
- import{p as e,H as t,h as s,a as i}from"./index.js";import{p as a}from"./p-CQvUntGY.js";import{S as o}from"./p-BcQO4NH2.js";import{g as c}from"./p-BHRF-5cf.js";import{v as n}from"./p-BKP-F1qP.js";import{i as r}from"./p-CXgom82_.js";import{d as f}from"./p-CXPP9vec.js";const h=a(o,["_S","_M","_L"]);const l={root:"gov-link",external:"gov-link--external"};const m=e(class e extends t{constructor(){super();this.__registerHost();this.size="m";this.external=false;this.truncate=false;this.inheritedAttributes={};this.h=c(this.host)}validateSize(e){n(h,e,l.root)}componentWillLoad(){this.validateSize(this.size);this.inheritedAttributes=r(this.host)}onAriaAttributeChange(e,t){this.host.removeAttribute(e);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[e]:t})}render(){return s(i,{key:"8ad1e46b293cf74570f818c0a2eebae906b59d79",class:this.h.classes(l.root),size:this.size,href:this.href,external:this.external,truncate:this.truncate},s("a",Object.assign({key:"7b2e9ca795c11167426e80a5a938ccb2153abecc",class:"element",href:this.href,target:this.external?"_blank":this.target,rel:this.external?"noreferrer":null},this.inheritedAttributes),s("slot",{key:"30f58ac9206aa7a1afa9147c8e43077d9b1cb3a8",name:"icon-start"}),s("span",{key:"f839d620a705139a1d155784ea71d954701e89ea"},s("slot",{key:"516ca9f11e1bc62638f3989a8efc0798b9a4ad2e"})),s("slot",{key:"36351fdc5c94f027f731a51608f26552a587c5d0",name:"icon-end"}),this.external&&s("gov-icon",{key:"e2433f478e1f14db8ccddf9d45c4fb0118eeb3a0",name:"box-arrow-up-right",type:"components",size:this.size,class:l.external})))}get host(){return this}static get watchers(){return{size:["validateSize"]}}},[4,"gov-link",{size:[1],external:[4],truncate:[4],href:[1],target:[1],inheritedAttributes:[32]},undefined,{size:["validateSize"]}]);function d(){if(typeof customElements==="undefined"){return}const e=["gov-link","gov-icon"];e.forEach((e=>{switch(e){case"gov-link":if(!customElements.get(e)){customElements.define(e,m)}break;case"gov-icon":if(!customElements.get(e)){f()}break}}))}d();const p=m;const b=d;export{p as GovLink,b as defineCustomElement};
1
+ import{p as e,H as t,h as s,a as i}from"./index.js";import{p as a}from"./p-CQvUntGY.js";import{S as o}from"./p-BcQO4NH2.js";import{g as n}from"./p-BHRF-5cf.js";import{v as c}from"./p-BKP-F1qP.js";import{i as r}from"./p-CXgom82_.js";import{d as f}from"./p-DRXiDAHW.js";const h=a(o,["_S","_M","_L"]);const l={root:"gov-link",external:"gov-link--external"};const m=e(class e extends t{constructor(){super();this.__registerHost();this.size="m";this.external=false;this.truncate=false;this.inheritedAttributes={};this.h=n(this.host)}validateSize(e){c(h,e,l.root)}componentWillLoad(){this.validateSize(this.size);this.inheritedAttributes=r(this.host)}onAriaAttributeChange(e,t){this.host.removeAttribute(e);this.inheritedAttributes=Object.assign(Object.assign({},this.inheritedAttributes),{[e]:t})}render(){return s(i,{key:"8ad1e46b293cf74570f818c0a2eebae906b59d79",class:this.h.classes(l.root),size:this.size,href:this.href,external:this.external,truncate:this.truncate},s("a",Object.assign({key:"7b2e9ca795c11167426e80a5a938ccb2153abecc",class:"element",href:this.href,target:this.external?"_blank":this.target,rel:this.external?"noreferrer":null},this.inheritedAttributes),s("slot",{key:"30f58ac9206aa7a1afa9147c8e43077d9b1cb3a8",name:"icon-start"}),s("span",{key:"f839d620a705139a1d155784ea71d954701e89ea"},s("slot",{key:"516ca9f11e1bc62638f3989a8efc0798b9a4ad2e"})),s("slot",{key:"36351fdc5c94f027f731a51608f26552a587c5d0",name:"icon-end"}),this.external&&s("gov-icon",{key:"e2433f478e1f14db8ccddf9d45c4fb0118eeb3a0",name:"box-arrow-up-right",type:"components",size:this.size,class:l.external})))}get host(){return this}static get watchers(){return{size:["validateSize"]}}},[4,"gov-link",{size:[1],external:[4],truncate:[4],href:[1],target:[1],inheritedAttributes:[32]},undefined,{size:["validateSize"]}]);function d(){if(typeof customElements==="undefined"){return}const e=["gov-link","gov-icon"];e.forEach((e=>{switch(e){case"gov-link":if(!customElements.get(e)){customElements.define(e,m)}break;case"gov-icon":if(!customElements.get(e)){f()}break}}))}d();const p=m;const b=d;export{p as GovLink,b as defineCustomElement};
2
2
  //# sourceMappingURL=gov-link.js.map