@gov-design-system-ce/components 4.0.8-rc21 → 4.0.8-rc23

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 (468) hide show
  1. package/dist/cjs/core.cjs.js +2 -2
  2. package/dist/cjs/gov-accordion-item.cjs.entry.js +2 -2
  3. package/dist/cjs/gov-accordion.cjs.entry.js +3 -3
  4. package/dist/cjs/gov-attachments_3.cjs.entry.js +3 -3
  5. package/dist/cjs/gov-backdrop.cjs.entry.js +3 -3
  6. package/dist/cjs/gov-breadcrumbs.cjs.entry.js +3 -3
  7. package/dist/cjs/gov-button.cjs.entry.js +3 -3
  8. package/dist/cjs/gov-card.cjs.entry.js +3 -3
  9. package/dist/cjs/gov-chip.cjs.entry.js +2 -2
  10. package/dist/cjs/gov-container.cjs.entry.js +1 -1
  11. package/dist/cjs/gov-control-group.cjs.entry.js +1 -1
  12. package/dist/cjs/gov-cookiebar.cjs.entry.js +1 -1
  13. package/dist/cjs/gov-dropdown.cjs.entry.js +2 -2
  14. package/dist/cjs/gov-empty.cjs.entry.js +1 -1
  15. package/dist/cjs/gov-error-code.cjs.entry.js +1 -1
  16. package/dist/cjs/gov-form-autocomplete.cjs.entry.js +2 -2
  17. package/dist/cjs/gov-form-checkbox-group.cjs.entry.js +1 -1
  18. package/dist/cjs/gov-form-checkbox.cjs.entry.js +4 -6
  19. package/dist/cjs/gov-form-checkbox.cjs.entry.js.map +1 -1
  20. package/dist/cjs/gov-form-control.cjs.entry.js +2 -2
  21. package/dist/cjs/gov-form-file.cjs.entry.js +6 -8
  22. package/dist/cjs/gov-form-file.cjs.entry.js.map +1 -1
  23. package/dist/cjs/gov-form-group.cjs.entry.js +1 -1
  24. package/dist/cjs/gov-form-input.cjs.entry.js +9 -10
  25. package/dist/cjs/gov-form-input.cjs.entry.js.map +1 -1
  26. package/dist/cjs/gov-form-label.cjs.entry.js +1 -1
  27. package/dist/cjs/gov-form-multi-select.cjs.entry.js +6 -6
  28. package/dist/cjs/gov-form-multi-select.cjs.entry.js.map +1 -1
  29. package/dist/cjs/gov-form-password-power.cjs.entry.js +1 -1
  30. package/dist/cjs/gov-form-radio-group.cjs.entry.js +1 -1
  31. package/dist/cjs/gov-form-radio.cjs.entry.js +4 -6
  32. package/dist/cjs/gov-form-radio.cjs.entry.js.map +1 -1
  33. package/dist/cjs/gov-form-search.cjs.entry.js +1 -1
  34. package/dist/cjs/gov-form-select.cjs.entry.js +8 -8
  35. package/dist/cjs/gov-form-select.cjs.entry.js.map +1 -1
  36. package/dist/cjs/gov-form-switch.cjs.entry.js +5 -7
  37. package/dist/cjs/gov-form-switch.cjs.entry.js.map +1 -1
  38. package/dist/cjs/gov-grid-item.cjs.entry.js +1 -1
  39. package/dist/cjs/gov-grid.cjs.entry.js +1 -1
  40. package/dist/cjs/gov-icon.cjs.entry.js +2 -2
  41. package/dist/cjs/gov-infobar.cjs.entry.js +3 -3
  42. package/dist/cjs/gov-layout-column.cjs.entry.js +1 -1
  43. package/dist/cjs/gov-layout.cjs.entry.js +1 -1
  44. package/dist/cjs/gov-lifecycle.cjs.entry.js +47 -0
  45. package/dist/cjs/gov-lifecycle.cjs.entry.js.map +1 -0
  46. package/dist/cjs/gov-loading.cjs.entry.js +2 -2
  47. package/dist/cjs/gov-message.cjs.entry.js +2 -2
  48. package/dist/cjs/gov-modal.cjs.entry.js +4 -4
  49. package/dist/cjs/gov-nav-item.cjs.entry.js +2 -2
  50. package/dist/cjs/gov-nav.cjs.entry.js +4 -4
  51. package/dist/cjs/gov-pagination.cjs.entry.js +3 -3
  52. package/dist/cjs/gov-prompt.cjs.entry.js +4 -4
  53. package/dist/cjs/gov-side-nav-item.cjs.entry.js +2 -2
  54. package/dist/cjs/gov-side-nav.cjs.entry.js +4 -4
  55. package/dist/cjs/gov-skeleton.cjs.entry.js +4 -4
  56. package/dist/cjs/gov-spacer.cjs.entry.js +2 -2
  57. package/dist/cjs/gov-statsbar-item.cjs.entry.js +2 -2
  58. package/dist/cjs/gov-statsbar.cjs.entry.js +2 -2
  59. package/dist/cjs/gov-stepper-item.cjs.entry.js +3 -3
  60. package/dist/cjs/gov-stepper.cjs.entry.js +2 -2
  61. package/dist/cjs/gov-tabs-item.cjs.entry.js +3 -3
  62. package/dist/cjs/gov-tabs.cjs.entry.js +4 -4
  63. package/dist/cjs/gov-tag.cjs.entry.js +2 -2
  64. package/dist/cjs/gov-tile.cjs.entry.js +2 -2
  65. package/dist/cjs/gov-tiles.cjs.entry.js +2 -2
  66. package/dist/cjs/gov-toast.cjs.entry.js +3 -3
  67. package/dist/cjs/gov-tooltip-content.cjs.entry.js +2 -2
  68. package/dist/cjs/gov-tooltip.cjs.entry.js +4 -4
  69. package/dist/cjs/gov-wizard-item.cjs.entry.js +5 -5
  70. package/dist/cjs/gov-wizard.cjs.entry.js +4 -4
  71. package/dist/cjs/{index-cfb57f19.js → index-f53beed1.js} +11 -2
  72. package/dist/cjs/index-f53beed1.js.map +1 -0
  73. package/dist/cjs/loader.cjs.js +2 -2
  74. package/dist/cjs/{string.utils-2335838f.js → string.utils-b84c81cf.js} +2 -1
  75. package/dist/cjs/string.utils-b84c81cf.js.map +1 -0
  76. package/dist/cjs/{wcag-53ebeed1.js → wcag-0dfd29b6.js} +2 -2
  77. package/dist/cjs/{wcag-53ebeed1.js.map → wcag-0dfd29b6.js.map} +1 -1
  78. package/dist/collection/collection-manifest.json +1 -0
  79. package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.js +1 -3
  80. package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.js.map +1 -1
  81. package/dist/collection/components/gov-form/file/gov-form-file.js +3 -5
  82. package/dist/collection/components/gov-form/file/gov-form-file.js.map +1 -1
  83. package/dist/collection/components/gov-form/input/gov-form-input.js +6 -7
  84. package/dist/collection/components/gov-form/input/gov-form-input.js.map +1 -1
  85. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js +3 -3
  86. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js.map +1 -1
  87. package/dist/collection/components/gov-form/radio/gov-form-radio.js +1 -3
  88. package/dist/collection/components/gov-form/radio/gov-form-radio.js.map +1 -1
  89. package/dist/collection/components/gov-form/select/gov-form-select.js +5 -5
  90. package/dist/collection/components/gov-form/select/gov-form-select.js.map +1 -1
  91. package/dist/collection/components/gov-form/switch/gov-form-switch.js +2 -4
  92. package/dist/collection/components/gov-form/switch/gov-form-switch.js.map +1 -1
  93. package/dist/collection/components/gov-lifecycle-tester/gov-lifecycle-tester.js +39 -0
  94. package/dist/collection/components/gov-lifecycle-tester/gov-lifecycle-tester.js.map +1 -0
  95. package/dist/collection/components/gov-loading/loading/gov-loading.js +1 -1
  96. package/dist/collection/components/gov-loading/skeleton/gov-skeleton.js +1 -1
  97. package/dist/collection/components/gov-message/gov-message.js +1 -1
  98. package/dist/collection/components/gov-modal/gov-modal.js +1 -1
  99. package/dist/collection/components/gov-nav/gov-nav-item.js +1 -1
  100. package/dist/collection/components/gov-nav/gov-nav.js +1 -1
  101. package/dist/collection/components/gov-promp/gov-prompt.js +1 -1
  102. package/dist/collection/components/gov-side-nav/gov-side-nav-item.js +1 -1
  103. package/dist/collection/components/gov-side-nav/gov-side-nav.js +1 -1
  104. package/dist/collection/components/gov-spacer/gov-spacer.js +1 -1
  105. package/dist/collection/components/gov-statsbar/gov-statsbar-item.js +1 -1
  106. package/dist/collection/components/gov-statsbar/gov-statsbar.js +1 -1
  107. package/dist/collection/components/gov-stepper/gov-stepper-item.js +1 -1
  108. package/dist/collection/components/gov-stepper/gov-stepper.js +1 -1
  109. package/dist/collection/components/gov-tabs/gov-tabs-item.js +1 -1
  110. package/dist/collection/components/gov-tabs/gov-tabs.js +1 -1
  111. package/dist/collection/components/gov-tag/gov-tag.js +1 -1
  112. package/dist/collection/components/gov-tile/container/gov-tiles.js +1 -1
  113. package/dist/collection/components/gov-tile/gov-tile.js +1 -1
  114. package/dist/collection/components/gov-toast/gov-toast.js +1 -1
  115. package/dist/collection/components/gov-tooltip/gov-tooltip-content.js +1 -1
  116. package/dist/collection/components/gov-tooltip/gov-tooltip.js +2 -2
  117. package/dist/collection/components/gov-wizard/gov-wizard-item.js +3 -3
  118. package/dist/collection/components/gov-wizard/gov-wizard.js +1 -1
  119. package/dist/collection/utils/string.utils.js +1 -1
  120. package/dist/collection/utils/string.utils.js.map +1 -1
  121. package/dist/components/gov-accordion-item.js +1 -1
  122. package/dist/components/gov-accordion.js +1 -1
  123. package/dist/components/gov-attachments-item.js +1 -1
  124. package/dist/components/gov-attachments.js +1 -1
  125. package/dist/components/gov-backdrop.js +1 -1
  126. package/dist/components/gov-breadcrumbs.js +1 -1
  127. package/dist/components/gov-button.js +1 -1
  128. package/dist/components/gov-card.js +1 -1
  129. package/dist/components/gov-chip.js +1 -1
  130. package/dist/components/gov-container.js +1 -1
  131. package/dist/components/gov-control-group.js +1 -1
  132. package/dist/components/gov-cookiebar.js +1 -1
  133. package/dist/components/gov-dropdown.js +1 -1
  134. package/dist/components/gov-empty.js +1 -1
  135. package/dist/components/gov-error-code.js +1 -1
  136. package/dist/components/gov-form-autocomplete.js +1 -1
  137. package/dist/components/gov-form-checkbox-group.js +1 -1
  138. package/dist/components/gov-form-checkbox.js +1 -1
  139. package/dist/components/gov-form-checkbox.js.map +1 -1
  140. package/dist/components/gov-form-control.js +1 -1
  141. package/dist/components/gov-form-file.js +1 -1
  142. package/dist/components/gov-form-file.js.map +1 -1
  143. package/dist/components/gov-form-group.js +1 -1
  144. package/dist/components/gov-form-input.js +1 -1
  145. package/dist/components/gov-form-label.js +1 -1
  146. package/dist/components/gov-form-message.js +1 -1
  147. package/dist/components/gov-form-multi-select.js +1 -1
  148. package/dist/components/gov-form-multi-select.js.map +1 -1
  149. package/dist/components/gov-form-password-power.js +1 -1
  150. package/dist/components/gov-form-radio-group.js +1 -1
  151. package/dist/components/gov-form-radio.js +1 -1
  152. package/dist/components/gov-form-radio.js.map +1 -1
  153. package/dist/components/gov-form-search.js +1 -1
  154. package/dist/components/gov-form-select.js +1 -1
  155. package/dist/components/gov-form-switch.js +1 -1
  156. package/dist/components/gov-form-switch.js.map +1 -1
  157. package/dist/components/gov-grid-item.js +1 -1
  158. package/dist/components/gov-grid.js +1 -1
  159. package/dist/components/gov-icon.js +1 -1
  160. package/dist/components/gov-infobar.js +1 -1
  161. package/dist/components/gov-layout-column.js +1 -1
  162. package/dist/components/gov-layout.js +1 -1
  163. package/dist/components/gov-lifecycle.d.ts +11 -0
  164. package/dist/components/gov-lifecycle.js +2 -0
  165. package/dist/components/gov-lifecycle.js.map +1 -0
  166. package/dist/components/gov-loading.js +1 -1
  167. package/dist/components/gov-message.js +1 -1
  168. package/dist/components/gov-modal.js +1 -1
  169. package/dist/components/gov-nav-item.js +1 -1
  170. package/dist/components/gov-nav-item.js.map +1 -1
  171. package/dist/components/gov-nav.js +1 -1
  172. package/dist/components/gov-pagination.js +1 -1
  173. package/dist/components/gov-prompt.js +1 -1
  174. package/dist/components/gov-side-nav-item.js +1 -1
  175. package/dist/components/gov-side-nav.js +1 -1
  176. package/dist/components/gov-skeleton.js +1 -1
  177. package/dist/components/gov-skeleton.js.map +1 -1
  178. package/dist/components/gov-spacer.js +1 -1
  179. package/dist/components/gov-statsbar-item.js +1 -1
  180. package/dist/components/gov-statsbar.js +1 -1
  181. package/dist/components/gov-stepper-item.js +1 -1
  182. package/dist/components/gov-stepper.js +1 -1
  183. package/dist/components/gov-tabs-item.js +1 -1
  184. package/dist/components/gov-tabs.js +1 -1
  185. package/dist/components/gov-tag.js +1 -1
  186. package/dist/components/gov-tile.js +1 -1
  187. package/dist/components/gov-tiles.js +1 -1
  188. package/dist/components/gov-toast.js +1 -1
  189. package/dist/components/gov-tooltip-content.js +1 -1
  190. package/dist/components/gov-tooltip.js +1 -1
  191. package/dist/components/gov-tooltip.js.map +1 -1
  192. package/dist/components/gov-wizard-item.js +1 -1
  193. package/dist/components/gov-wizard.js +1 -1
  194. package/dist/components/index.js +1 -1
  195. package/dist/components/{p-bcc76ddd.js → p-11418445.js} +2 -2
  196. package/dist/components/{p-4489a1da.js → p-145d1fa3.js} +2 -2
  197. package/dist/components/{p-2dce8f2c.js → p-2594e525.js} +2 -2
  198. package/dist/components/{p-708dca47.js → p-2f537b87.js} +2 -2
  199. package/dist/components/{p-708dca47.js.map → p-2f537b87.js.map} +1 -1
  200. package/dist/components/{p-d6759ac3.js → p-5262b9ce.js} +3 -3
  201. package/dist/components/p-5262b9ce.js.map +1 -0
  202. package/dist/components/p-71cec4ef.js +2 -0
  203. package/dist/components/{p-f0eb08d6.js → p-74915621.js} +2 -2
  204. package/dist/components/{p-92c6c6aa.js → p-77cdc056.js} +2 -2
  205. package/dist/components/{p-c2e5e893.js → p-8cf6d23c.js} +2 -2
  206. package/dist/components/p-8cf6d23c.js.map +1 -0
  207. package/dist/components/{p-8977b759.js → p-9d5a8ed9.js} +2 -2
  208. package/dist/components/{p-aa4122bd.js → p-b6dd95ba.js} +2 -2
  209. package/dist/components/{p-95d41a3b.js → p-cd6c2938.js} +2 -2
  210. package/dist/components/p-cd6c2938.js.map +1 -0
  211. package/dist/components/{p-8df7c635.js → p-d0fe3cd8.js} +2 -2
  212. package/dist/core/core.esm.js +1 -1
  213. package/dist/core/core.esm.js.map +1 -1
  214. package/dist/core/{p-6c745c3e.entry.js → p-06e9e93b.entry.js} +2 -2
  215. package/dist/core/{p-5d33cb6e.entry.js → p-092b0437.entry.js} +2 -2
  216. package/dist/core/{p-290773da.entry.js → p-1011ca26.entry.js} +2 -2
  217. package/dist/core/{p-212e297e.entry.js → p-107a6a5c.entry.js} +2 -2
  218. package/dist/core/{p-389edb54.entry.js → p-114a4d0b.entry.js} +2 -2
  219. package/dist/core/{p-3483a6e8.entry.js → p-13520b30.entry.js} +2 -2
  220. package/dist/core/{p-4dbaff99.entry.js → p-13ced376.entry.js} +2 -2
  221. package/dist/core/{p-753e4861.entry.js → p-1b3143a8.entry.js} +2 -3
  222. package/dist/core/p-1b3143a8.entry.js.map +1 -0
  223. package/dist/core/{p-ab2f6b4d.entry.js → p-1bdc04bb.entry.js} +2 -2
  224. package/dist/core/{p-92f752e1.entry.js → p-208c99c8.entry.js} +2 -3
  225. package/dist/core/p-208c99c8.entry.js.map +1 -0
  226. package/dist/core/p-20ae3168.entry.js +2 -0
  227. package/dist/core/p-20ae3168.entry.js.map +1 -0
  228. package/dist/core/{p-8ab827a1.entry.js → p-2186fcd5.entry.js} +2 -2
  229. package/dist/core/p-240659bb.js +3 -0
  230. package/dist/core/p-240659bb.js.map +1 -0
  231. package/dist/core/{p-0790a27c.entry.js → p-2c3697cf.entry.js} +2 -2
  232. package/dist/core/{p-2e07619e.entry.js → p-2e881577.entry.js} +2 -2
  233. package/dist/core/p-2e881577.entry.js.map +1 -0
  234. package/dist/core/{p-02745628.entry.js → p-3309aed9.entry.js} +2 -2
  235. package/dist/core/{p-34cf509a.entry.js → p-348165e2.entry.js} +2 -2
  236. package/dist/core/{p-2cdb5670.entry.js → p-34d7c203.entry.js} +2 -3
  237. package/dist/core/p-34d7c203.entry.js.map +1 -0
  238. package/dist/core/{p-2db35d0f.entry.js → p-3832de64.entry.js} +2 -2
  239. package/dist/core/{p-3c0058a4.entry.js → p-3b8fb675.entry.js} +2 -2
  240. package/dist/core/p-3b8fb675.entry.js.map +1 -0
  241. package/dist/core/{p-761c33c7.entry.js → p-3ccab2ba.entry.js} +2 -2
  242. package/dist/core/{p-396ae350.entry.js → p-3e041d63.entry.js} +2 -2
  243. package/dist/core/p-3e041d63.entry.js.map +1 -0
  244. package/dist/core/{p-04e48d5d.entry.js → p-4694b4b6.entry.js} +2 -2
  245. package/dist/core/{p-a50b306f.entry.js → p-4700508c.entry.js} +2 -2
  246. package/dist/core/p-489f5c82.entry.js +2 -0
  247. package/dist/core/{p-2e647c00.entry.js.map → p-489f5c82.entry.js.map} +1 -1
  248. package/dist/core/{p-33b1f5d8.entry.js → p-4ed064db.entry.js} +2 -2
  249. package/dist/core/{p-aa91f33f.entry.js → p-4f77a766.entry.js} +2 -2
  250. package/dist/core/p-4f77a766.entry.js.map +1 -0
  251. package/dist/core/{p-cc3c6319.entry.js → p-551c9f44.entry.js} +2 -2
  252. package/dist/core/{p-650ac6c6.entry.js → p-55abc7bc.entry.js} +2 -2
  253. package/dist/core/p-55cd3fee.entry.js +2 -0
  254. package/dist/core/{p-ab9d9655.entry.js.map → p-55cd3fee.entry.js.map} +1 -1
  255. package/dist/core/{p-5facceb9.entry.js → p-5c3a0b02.entry.js} +2 -2
  256. package/dist/core/{p-5e7e7cb1.entry.js → p-64353313.entry.js} +2 -2
  257. package/dist/core/{p-aba11ab4.entry.js → p-6789b9d0.entry.js} +2 -2
  258. package/dist/core/{p-f11f707f.entry.js → p-6a82c6a1.entry.js} +2 -2
  259. package/dist/core/{p-afd40857.entry.js → p-6c33492a.entry.js} +2 -2
  260. package/dist/core/{p-afd40857.entry.js.map → p-6c33492a.entry.js.map} +1 -1
  261. package/dist/core/{p-3f62cf30.entry.js → p-6d894ec7.entry.js} +2 -2
  262. package/dist/core/{p-6977b168.entry.js → p-6dfde487.entry.js} +2 -2
  263. package/dist/core/{p-d2fc217d.entry.js → p-74233183.entry.js} +2 -2
  264. package/dist/core/{p-eb403270.entry.js → p-77892071.entry.js} +2 -2
  265. package/dist/core/{p-1046221c.entry.js → p-7a896683.entry.js} +2 -2
  266. package/dist/core/{p-185a46b9.entry.js → p-7ba4ae8d.entry.js} +2 -2
  267. package/dist/core/{p-7695610a.entry.js → p-7d011c4b.entry.js} +2 -2
  268. package/dist/core/p-7e43f440.entry.js +2 -0
  269. package/dist/core/p-7e43f440.entry.js.map +1 -0
  270. package/dist/core/{p-b58ed9ce.entry.js → p-802909c5.entry.js} +2 -2
  271. package/dist/core/{p-dbde347f.entry.js → p-810f0d0c.entry.js} +2 -2
  272. package/dist/core/{p-718d0198.entry.js → p-828e8bce.entry.js} +2 -2
  273. package/dist/core/{p-6be9b50d.entry.js → p-87b7b469.entry.js} +2 -3
  274. package/dist/core/p-87b7b469.entry.js.map +1 -0
  275. package/dist/core/{p-cce125de.entry.js → p-8fb45e7c.entry.js} +2 -2
  276. package/dist/core/{p-7c2fa6df.entry.js → p-a3cff495.entry.js} +2 -2
  277. package/dist/core/p-ab9aff3c.js +2 -0
  278. package/dist/core/{p-f9fee460.entry.js → p-ae4321ea.entry.js} +2 -2
  279. package/dist/core/{p-1b212799.entry.js → p-b2b254b6.entry.js} +2 -2
  280. package/dist/core/p-bcdf6cfc.entry.js +2 -0
  281. package/dist/core/{p-3e3a1607.entry.js.map → p-bcdf6cfc.entry.js.map} +1 -1
  282. package/dist/core/p-cc83b8cb.entry.js +2 -0
  283. package/dist/core/p-cc83b8cb.entry.js.map +1 -0
  284. package/dist/core/{p-95d41a3b.js → p-cd6c2938.js} +2 -2
  285. package/dist/core/p-cd6c2938.js.map +1 -0
  286. package/dist/core/{p-fc3d4a73.entry.js → p-cdaeb7d8.entry.js} +2 -3
  287. package/dist/core/p-cdaeb7d8.entry.js.map +1 -0
  288. package/dist/core/{p-7d1dd58a.entry.js → p-d4b50bcd.entry.js} +2 -2
  289. package/dist/core/{p-74627eb2.entry.js → p-d4f2d6f9.entry.js} +2 -2
  290. package/dist/core/p-d4f2d6f9.entry.js.map +1 -0
  291. package/dist/core/{p-2fb0e1cf.entry.js → p-e9bcadf1.entry.js} +2 -2
  292. package/dist/core/{p-13a80dc5.entry.js → p-f16f9116.entry.js} +2 -2
  293. package/dist/core/{p-f54fe20e.entry.js → p-f2edcca7.entry.js} +2 -2
  294. package/dist/core/p-f6a98765.entry.js +2 -0
  295. package/dist/core/{p-31a7316b.entry.js.map → p-f6a98765.entry.js.map} +1 -1
  296. package/dist/core/{p-5462e282.entry.js → p-f9de3c09.entry.js} +2 -2
  297. package/dist/core/{p-5f3721be.entry.js → p-fe8bd4cf.entry.js} +2 -2
  298. package/dist/core/p-fe8bd4cf.entry.js.map +1 -0
  299. package/dist/esm/core.js +3 -3
  300. package/dist/esm/gov-accordion-item.entry.js +2 -2
  301. package/dist/esm/gov-accordion.entry.js +3 -3
  302. package/dist/esm/gov-attachments_3.entry.js +3 -3
  303. package/dist/esm/gov-backdrop.entry.js +3 -3
  304. package/dist/esm/gov-breadcrumbs.entry.js +3 -3
  305. package/dist/esm/gov-button.entry.js +3 -3
  306. package/dist/esm/gov-card.entry.js +3 -3
  307. package/dist/esm/gov-chip.entry.js +2 -2
  308. package/dist/esm/gov-container.entry.js +1 -1
  309. package/dist/esm/gov-control-group.entry.js +1 -1
  310. package/dist/esm/gov-cookiebar.entry.js +1 -1
  311. package/dist/esm/gov-dropdown.entry.js +2 -2
  312. package/dist/esm/gov-empty.entry.js +1 -1
  313. package/dist/esm/gov-error-code.entry.js +1 -1
  314. package/dist/esm/gov-form-autocomplete.entry.js +2 -2
  315. package/dist/esm/gov-form-checkbox-group.entry.js +1 -1
  316. package/dist/esm/gov-form-checkbox.entry.js +4 -6
  317. package/dist/esm/gov-form-checkbox.entry.js.map +1 -1
  318. package/dist/esm/gov-form-control.entry.js +2 -2
  319. package/dist/esm/gov-form-file.entry.js +6 -8
  320. package/dist/esm/gov-form-file.entry.js.map +1 -1
  321. package/dist/esm/gov-form-group.entry.js +1 -1
  322. package/dist/esm/gov-form-input.entry.js +9 -10
  323. package/dist/esm/gov-form-input.entry.js.map +1 -1
  324. package/dist/esm/gov-form-label.entry.js +1 -1
  325. package/dist/esm/gov-form-multi-select.entry.js +6 -6
  326. package/dist/esm/gov-form-multi-select.entry.js.map +1 -1
  327. package/dist/esm/gov-form-password-power.entry.js +1 -1
  328. package/dist/esm/gov-form-radio-group.entry.js +1 -1
  329. package/dist/esm/gov-form-radio.entry.js +4 -6
  330. package/dist/esm/gov-form-radio.entry.js.map +1 -1
  331. package/dist/esm/gov-form-search.entry.js +1 -1
  332. package/dist/esm/gov-form-select.entry.js +8 -8
  333. package/dist/esm/gov-form-select.entry.js.map +1 -1
  334. package/dist/esm/gov-form-switch.entry.js +5 -7
  335. package/dist/esm/gov-form-switch.entry.js.map +1 -1
  336. package/dist/esm/gov-grid-item.entry.js +1 -1
  337. package/dist/esm/gov-grid.entry.js +1 -1
  338. package/dist/esm/gov-icon.entry.js +2 -2
  339. package/dist/esm/gov-infobar.entry.js +3 -3
  340. package/dist/esm/gov-layout-column.entry.js +1 -1
  341. package/dist/esm/gov-layout.entry.js +1 -1
  342. package/dist/esm/gov-lifecycle.entry.js +43 -0
  343. package/dist/esm/gov-lifecycle.entry.js.map +1 -0
  344. package/dist/esm/gov-loading.entry.js +2 -2
  345. package/dist/esm/gov-message.entry.js +2 -2
  346. package/dist/esm/gov-modal.entry.js +4 -4
  347. package/dist/esm/gov-nav-item.entry.js +2 -2
  348. package/dist/esm/gov-nav.entry.js +4 -4
  349. package/dist/esm/gov-pagination.entry.js +3 -3
  350. package/dist/esm/gov-prompt.entry.js +4 -4
  351. package/dist/esm/gov-side-nav-item.entry.js +2 -2
  352. package/dist/esm/gov-side-nav.entry.js +4 -4
  353. package/dist/esm/gov-skeleton.entry.js +4 -4
  354. package/dist/esm/gov-spacer.entry.js +2 -2
  355. package/dist/esm/gov-statsbar-item.entry.js +2 -2
  356. package/dist/esm/gov-statsbar.entry.js +2 -2
  357. package/dist/esm/gov-stepper-item.entry.js +3 -3
  358. package/dist/esm/gov-stepper.entry.js +2 -2
  359. package/dist/esm/gov-tabs-item.entry.js +3 -3
  360. package/dist/esm/gov-tabs.entry.js +4 -4
  361. package/dist/esm/gov-tag.entry.js +2 -2
  362. package/dist/esm/gov-tile.entry.js +2 -2
  363. package/dist/esm/gov-tiles.entry.js +2 -2
  364. package/dist/esm/gov-toast.entry.js +3 -3
  365. package/dist/esm/gov-tooltip-content.entry.js +2 -2
  366. package/dist/esm/gov-tooltip.entry.js +4 -4
  367. package/dist/esm/gov-wizard-item.entry.js +5 -5
  368. package/dist/esm/gov-wizard.entry.js +4 -4
  369. package/dist/esm/{index-b44c6c92.js → index-c5251f2b.js} +11 -2
  370. package/dist/esm/index-c5251f2b.js.map +1 -0
  371. package/dist/esm/loader.js +3 -3
  372. package/dist/esm/{string.utils-5ce3f551.js → string.utils-1da8f8fb.js} +2 -2
  373. package/dist/esm/string.utils-1da8f8fb.js.map +1 -0
  374. package/dist/esm/{wcag-6ad92279.js → wcag-169f758a.js} +2 -2
  375. package/dist/esm/{wcag-6ad92279.js.map → wcag-169f758a.js.map} +1 -1
  376. package/dist/hydrate/index.js +100 -58
  377. package/dist/hydrate/index.mjs +100 -58
  378. package/dist/types/components/gov-form/checkbox/gov-form-checkbox.d.ts +0 -1
  379. package/dist/types/components/gov-form/file/gov-form-file.d.ts +0 -1
  380. package/dist/types/components/gov-form/radio/gov-form-radio.d.ts +0 -1
  381. package/dist/types/components/gov-form/switch/gov-form-switch.d.ts +0 -1
  382. package/dist/types/components/gov-lifecycle-tester/gov-lifecycle-tester.d.ts +14 -0
  383. package/dist/types/components.d.ts +13 -0
  384. package/dist/types/utils/string.utils.d.ts +1 -0
  385. package/package.json +1 -1
  386. package/dist/cjs/index-cfb57f19.js.map +0 -1
  387. package/dist/cjs/string.utils-2335838f.js.map +0 -1
  388. package/dist/components/p-6b0471a8.js +0 -2
  389. package/dist/components/p-95d41a3b.js.map +0 -1
  390. package/dist/components/p-c2e5e893.js.map +0 -1
  391. package/dist/components/p-d6759ac3.js.map +0 -1
  392. package/dist/core/p-0a5b0f7d.js +0 -3
  393. package/dist/core/p-0a5b0f7d.js.map +0 -1
  394. package/dist/core/p-2cdb5670.entry.js.map +0 -1
  395. package/dist/core/p-2e07619e.entry.js.map +0 -1
  396. package/dist/core/p-2e647c00.entry.js +0 -2
  397. package/dist/core/p-31a7316b.entry.js +0 -2
  398. package/dist/core/p-396ae350.entry.js.map +0 -1
  399. package/dist/core/p-3c0058a4.entry.js.map +0 -1
  400. package/dist/core/p-3e3a1607.entry.js +0 -2
  401. package/dist/core/p-5f3721be.entry.js.map +0 -1
  402. package/dist/core/p-6be9b50d.entry.js.map +0 -1
  403. package/dist/core/p-74627eb2.entry.js.map +0 -1
  404. package/dist/core/p-753e4861.entry.js.map +0 -1
  405. package/dist/core/p-92b7481f.js +0 -2
  406. package/dist/core/p-92f752e1.entry.js.map +0 -1
  407. package/dist/core/p-95d41a3b.js.map +0 -1
  408. package/dist/core/p-aa91f33f.entry.js.map +0 -1
  409. package/dist/core/p-ab9d9655.entry.js +0 -2
  410. package/dist/core/p-e21b402c.entry.js +0 -3
  411. package/dist/core/p-e21b402c.entry.js.map +0 -1
  412. package/dist/core/p-f9e6f776.entry.js +0 -3
  413. package/dist/core/p-f9e6f776.entry.js.map +0 -1
  414. package/dist/core/p-fc3d4a73.entry.js.map +0 -1
  415. package/dist/esm/index-b44c6c92.js.map +0 -1
  416. package/dist/esm/string.utils-5ce3f551.js.map +0 -1
  417. /package/dist/components/{p-bcc76ddd.js.map → p-11418445.js.map} +0 -0
  418. /package/dist/components/{p-4489a1da.js.map → p-145d1fa3.js.map} +0 -0
  419. /package/dist/components/{p-2dce8f2c.js.map → p-2594e525.js.map} +0 -0
  420. /package/dist/components/{p-6b0471a8.js.map → p-71cec4ef.js.map} +0 -0
  421. /package/dist/components/{p-f0eb08d6.js.map → p-74915621.js.map} +0 -0
  422. /package/dist/components/{p-92c6c6aa.js.map → p-77cdc056.js.map} +0 -0
  423. /package/dist/components/{p-8977b759.js.map → p-9d5a8ed9.js.map} +0 -0
  424. /package/dist/components/{p-aa4122bd.js.map → p-b6dd95ba.js.map} +0 -0
  425. /package/dist/components/{p-8df7c635.js.map → p-d0fe3cd8.js.map} +0 -0
  426. /package/dist/core/{p-6c745c3e.entry.js.map → p-06e9e93b.entry.js.map} +0 -0
  427. /package/dist/core/{p-5d33cb6e.entry.js.map → p-092b0437.entry.js.map} +0 -0
  428. /package/dist/core/{p-290773da.entry.js.map → p-1011ca26.entry.js.map} +0 -0
  429. /package/dist/core/{p-212e297e.entry.js.map → p-107a6a5c.entry.js.map} +0 -0
  430. /package/dist/core/{p-389edb54.entry.js.map → p-114a4d0b.entry.js.map} +0 -0
  431. /package/dist/core/{p-3483a6e8.entry.js.map → p-13520b30.entry.js.map} +0 -0
  432. /package/dist/core/{p-4dbaff99.entry.js.map → p-13ced376.entry.js.map} +0 -0
  433. /package/dist/core/{p-ab2f6b4d.entry.js.map → p-1bdc04bb.entry.js.map} +0 -0
  434. /package/dist/core/{p-8ab827a1.entry.js.map → p-2186fcd5.entry.js.map} +0 -0
  435. /package/dist/core/{p-0790a27c.entry.js.map → p-2c3697cf.entry.js.map} +0 -0
  436. /package/dist/core/{p-02745628.entry.js.map → p-3309aed9.entry.js.map} +0 -0
  437. /package/dist/core/{p-34cf509a.entry.js.map → p-348165e2.entry.js.map} +0 -0
  438. /package/dist/core/{p-2db35d0f.entry.js.map → p-3832de64.entry.js.map} +0 -0
  439. /package/dist/core/{p-761c33c7.entry.js.map → p-3ccab2ba.entry.js.map} +0 -0
  440. /package/dist/core/{p-04e48d5d.entry.js.map → p-4694b4b6.entry.js.map} +0 -0
  441. /package/dist/core/{p-a50b306f.entry.js.map → p-4700508c.entry.js.map} +0 -0
  442. /package/dist/core/{p-33b1f5d8.entry.js.map → p-4ed064db.entry.js.map} +0 -0
  443. /package/dist/core/{p-cc3c6319.entry.js.map → p-551c9f44.entry.js.map} +0 -0
  444. /package/dist/core/{p-650ac6c6.entry.js.map → p-55abc7bc.entry.js.map} +0 -0
  445. /package/dist/core/{p-5facceb9.entry.js.map → p-5c3a0b02.entry.js.map} +0 -0
  446. /package/dist/core/{p-5e7e7cb1.entry.js.map → p-64353313.entry.js.map} +0 -0
  447. /package/dist/core/{p-aba11ab4.entry.js.map → p-6789b9d0.entry.js.map} +0 -0
  448. /package/dist/core/{p-f11f707f.entry.js.map → p-6a82c6a1.entry.js.map} +0 -0
  449. /package/dist/core/{p-3f62cf30.entry.js.map → p-6d894ec7.entry.js.map} +0 -0
  450. /package/dist/core/{p-6977b168.entry.js.map → p-6dfde487.entry.js.map} +0 -0
  451. /package/dist/core/{p-d2fc217d.entry.js.map → p-74233183.entry.js.map} +0 -0
  452. /package/dist/core/{p-eb403270.entry.js.map → p-77892071.entry.js.map} +0 -0
  453. /package/dist/core/{p-1046221c.entry.js.map → p-7a896683.entry.js.map} +0 -0
  454. /package/dist/core/{p-185a46b9.entry.js.map → p-7ba4ae8d.entry.js.map} +0 -0
  455. /package/dist/core/{p-7695610a.entry.js.map → p-7d011c4b.entry.js.map} +0 -0
  456. /package/dist/core/{p-b58ed9ce.entry.js.map → p-802909c5.entry.js.map} +0 -0
  457. /package/dist/core/{p-dbde347f.entry.js.map → p-810f0d0c.entry.js.map} +0 -0
  458. /package/dist/core/{p-718d0198.entry.js.map → p-828e8bce.entry.js.map} +0 -0
  459. /package/dist/core/{p-cce125de.entry.js.map → p-8fb45e7c.entry.js.map} +0 -0
  460. /package/dist/core/{p-7c2fa6df.entry.js.map → p-a3cff495.entry.js.map} +0 -0
  461. /package/dist/core/{p-92b7481f.js.map → p-ab9aff3c.js.map} +0 -0
  462. /package/dist/core/{p-f9fee460.entry.js.map → p-ae4321ea.entry.js.map} +0 -0
  463. /package/dist/core/{p-1b212799.entry.js.map → p-b2b254b6.entry.js.map} +0 -0
  464. /package/dist/core/{p-7d1dd58a.entry.js.map → p-d4b50bcd.entry.js.map} +0 -0
  465. /package/dist/core/{p-2fb0e1cf.entry.js.map → p-e9bcadf1.entry.js.map} +0 -0
  466. /package/dist/core/{p-13a80dc5.entry.js.map → p-f16f9116.entry.js.map} +0 -0
  467. /package/dist/core/{p-f54fe20e.entry.js.map → p-f2edcca7.entry.js.map} +0 -0
  468. /package/dist/core/{p-5462e282.entry.js.map → p-f9de3c09.entry.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"names":["govFormMultiSelectCss","GovFormMultiSelectStyle0","GovFormMultiSelect","constructor","hostRef","this","selectId","createID","listId","h","govHost","host","f","govForm","validateVariant","newValue","validateProp","FormMultiselectVariants","FormMultiSelectClass","root","validateSize","FormMultiselectSizes","watchOptions","optionsState","propsValueToArray","watchValue","selectedOptionsState","watchControlAttrs","passControlAttrs","passAttrToControl","size","toBoolAttr","invalid","disabled","success","componentWillLoad","variant","passAttrToLabel","String","required","options","value","getAvailableOptions","ignoreFilter","Array","isArray","length","filter","option","selectedIndex","selectedValueIndex","map","_a","label","from","selectRef","querySelectorAll","selected","textContent","initAutocomplete","autocompleteRef","addEventListener","onSelectHandler","bind","_b","onInputHandler","_c","onFocusHandler","_d","onBlurHandler","_e","setSearchCallback","searchString","Promise","resolve","data","removeDiacritics","toLowerCase","indexOf","finally","findIndex","getOptionElement","querySelector","getOption","find","selectOption","newOption","notify","index","govChange","emit","component","govSelect","removeOption","splice","govRemove","componentDidLoad","componentDidRender","tick","forEach","canValidateWcagOnRender","delay","validateWcag","render","Host","key","class","wrap","hasSlot","name","valueState","identifier","placeholder","messageEmpty","messageLoading","ref","el","minlength","wcagDescribedBy","wcagLabelledBy","wcagOwns","slot","hidden","multiple","toBoolAttrIfDefined","hideSelectedList","role","id","list","item","wcagLabel","type","onTagRemove","e","stopPropagation","focused","govFocus","originalEvent","govBlur","detail","clearValue","focus","setFocus","setValue","getRef","validateWcagRef","validateWcagLabelFor"],"sources":["../../../packages/core/src/components/gov-form/multiselect/gov-form-multi-select.scss?tag=gov-form-multi-select","../../../packages/core/src/components/gov-form/multiselect/gov-form-multi-select.tsx"],"sourcesContent":["/*\n * Multiselect\n */\n\n@import \"../select/gov-form-select-core.scss\";\n$class: \".gov-form-multi-select\";\n\n#{$class} {\n\t@extend %form-select-core;\n\tflex-wrap: wrap;\n\t&__wrap {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: rem-calc(8);\n\t\twidth: 100%;\n\t}\n\t&__list {\n\t\t@extend %reset-ul;\n\t\t@include typography($font-size-xs);\n\t\tdisplay: flex;\n\t\tgap: rem-calc(8);\n\t\tflex-wrap: wrap;\n\t}\n\t&__list > &__item {\n\t\t@extend %reset-ul-li;\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t\tflex: 0 0 auto;\n\t\talign-items: center;\n\t\tpadding: rem-calc(0 0 0 8);\n\t\tbackground: $form-multiselect-bg;\n\t\ttransition: $t linear background-color;\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from '@stencil/core'\nimport {govForm} from '../../../helpers/Dom/form'\nimport {GovForm} from '../../../helpers/Dom/form.types'\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from '../../../helpers/Dom/template'\nimport {GovHost} from '../../../helpers/Dom/template.types'\nimport {canValidateWcagOnRender} from '../../../helpers/Dom/win'\nimport {validateProp} from '../../../helpers/Validate/props'\nimport {validateWcagLabelFor, validateWcagRef} from '../../../helpers/Validate/wcag'\nimport {Nullable} from '../../../types/interfaces'\nimport {createID, removeDiacritics} from '../../../utils/string.utils'\nimport {delay} from '../../../utils/utils'\nimport {FormAutocompleteEvent} from '../autocomplete/gov-form-autocomplete.types'\nimport {\n\tFormMultiSelectClass,\n\tFormMultiselectSizes,\n\tFormMultiselectSizesType,\n\tFormMultiselectVariants,\n\tFormMultiselectVariantType\n} from './constants'\nimport {\n\tFormMultiselectEvent,\n\tGovFormMultiSelectItem,\n\tGovFormMultiSelectSelectedItem\n} from './gov-form-multi-select.types'\nimport {propsValueToArray} from \"../../../utils/array.utils\";\nimport {tick} from \"../../../utils/stencil.utils\";\n\n@Component({\n\ttag: 'gov-form-multi-select',\n\tstyleUrl: 'gov-form-multi-select.scss',\n})\nexport class GovFormMultiSelect {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\n\tprivate selectRef?: HTMLSelectElement\n\tprivate autocompleteRef?: HTMLGovFormAutocompleteElement\n\n\tprivate readonly selectId: string\n\tprivate readonly listId: string\n\n\tconstructor() {\n\t\tthis.selectId = createID('GovSelect')\n\t\tthis.listId = createID('GovMultiList')\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormSelectElement\n\t/**\n\t * Value of multi-select\n\t */\n\t@Prop({reflect: true, mutable: true}) value: string | GovFormMultiSelectSelectedItem[]\n\t/**\n\t * Options of multi-select\n\t */\n\t@Prop({reflect: true, mutable: true}) options?: string | GovFormMultiSelectItem[]\n\t/**\n\t * Custom select identifier.\n\t */\n\t@Prop({attribute: 'identifier'}) readonly identifier: string\n\t/**\n\t * Custom select placeholder.\n\t */\n\t@Prop({attribute: 'placeholder'}) readonly placeholder: string\n\t/**\n\t * Style variation of the form select.\n\t */\n\t@Prop() readonly variant?: FormMultiselectVariantType\n\t/**\n\t * Select’s size.\n\t */\n\t@Prop() readonly size?: FormMultiselectSizesType = 'm'\n\t/**\n\t * Name of the select.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Option to hide the list of selected items\n\t */\n\t@Prop({attribute: 'hide-selected-list'}) readonly hideSelectedList: 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 select component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\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 * Indicates the entered value of child form element does conform to the format expected by the application.\n\t */\n\t@Prop() readonly success: boolean\n\t/**\n\t * Custom message for when there is a blank sheet\n\t */\n\t@Prop({attribute: 'message-empty'}) readonly messageEmpty: string = 'Nebyly nalezeny žádné výsledky'\n\t/**\n\t * Custom message for when data is loaded\n\t */\n\t@Prop({attribute: 'message-loading'}) readonly messageLoading: string = 'Načítám...'\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({attribute: 'wcag-described-by'}) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({attribute: 'wcag-labelled-by'}) readonly wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({attribute: 'wcag-owns'}) readonly wcagOwns: string\n\t/**\n\t * Emitted when the select has focus.\n\t */\n\t@Event({eventName: 'gov-focus'}) govFocus: EventEmitter<FormMultiselectEvent>\n\t/**\n\t * Emitted when the select loses focus.\n\t */\n\t@Event({eventName: 'gov-blur'}) govBlur: EventEmitter<FormMultiselectEvent>\n\t/**\n\t * Emitted when the select change value.\n\t */\n\t@Event({eventName: 'gov-change'}) govChange: EventEmitter<FormMultiselectEvent>\n\t/**\n\t * Emitted when an item is selected\n\t */\n\t@Event({eventName: 'gov-select'}) govSelect: EventEmitter<FormMultiselectEvent>\n\t/**\n\t * Emitted when an item is removed\n\t */\n\t@Event({eventName: 'gov-remove'}) govRemove: EventEmitter<FormMultiselectEvent>\n\n\t@State() focused: boolean\n\t@State() valueState: string\n\t@State() selectedOptionsState: GovFormMultiSelectSelectedItem[] = []\n\t@State() optionsState: GovFormMultiSelectItem[] = []\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormMultiselectVariants, newValue, FormMultiSelectClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormMultiselectSizes, newValue, FormMultiSelectClass.root)\n\t}\n\n\t@Watch('options')\n\twatchOptions(newValue: string | GovFormMultiSelectItem[]): void {\n\t\tthis.optionsState = propsValueToArray(newValue)\n\t}\n\n\t@Watch('value')\n\twatchValue(newValue: string | GovFormMultiSelectItem[]): void {\n\t\tthis.selectedOptionsState = propsValueToArray(newValue)\n\t}\n\n\t@Watch('disabled')\n\t@Watch('invalid')\n\t@Watch('success')\n\t@Watch('size')\n\twatchControlAttrs(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl('size', this.size)\n\t\tthis.f.passAttrToControl('invalid', toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl('disabled', toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl('success', toBoolAttr(this.success))\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t\tthis.passControlAttrs()\n\t\tthis.f.passAttrToLabel('required', String(this.required))\n\t\tthis.optionsState = propsValueToArray(this.options)\n\t\tthis.selectedOptionsState = propsValueToArray(this.value)\n\t}\n\n\tprivate getAvailableOptions(ignoreFilter = false): GovFormMultiSelectItem[] {\n\t\tif (Array.isArray(this.optionsState) && this.optionsState.length) {\n\t\t\tif (ignoreFilter) {\n\t\t\t\treturn this.optionsState;\n\t\t\t}\n\t\t\treturn this.optionsState.filter((option) => {\n\t\t\t\tconst selectedIndex = this.selectedValueIndex(option.value)\n\t\t\t\treturn (selectedIndex !== -1 || option?.disabled) ? false : true\n\t\t\t}).map((option) => ({label: option.label ?? option.value, value: option.value}))\n\t\t}\n\t\treturn Array.from(this.selectRef.querySelectorAll('option'))\n\t\t\t.filter((option: HTMLOptionElement) => {\n\t\t\t\tif (ignoreFilter) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\tconst selectedIndex = this.selectedValueIndex(option.value)\n\t\t\t\treturn !(option.disabled || option.selected || selectedIndex > -1)\n\t\t\t})\n\t\t\t.map((option: HTMLOptionElement) => ({label: option.textContent, value: option.value}))\n\t}\n\n\tprivate initAutocomplete() {\n\t\tthis.autocompleteRef?.addEventListener('gov-select', this.onSelectHandler.bind(this))\n\t\tthis.autocompleteRef?.addEventListener('gov-input', this.onInputHandler.bind(this))\n\t\tthis.autocompleteRef?.addEventListener('gov-focus', this.onFocusHandler.bind(this))\n\t\tthis.autocompleteRef?.addEventListener('gov-blur', this.onBlurHandler.bind(this))\n\t\tthis.autocompleteRef\n\t\t\t?.setSearchCallback(searchString => {\n\t\t\t\treturn new Promise(resolve => {\n\t\t\t\t\tconst data = this.getAvailableOptions()\n\t\t\t\t\tif (String(searchString).length === 0) {\n\t\t\t\t\t\treturn resolve(data)\n\t\t\t\t\t}\n\t\t\t\t\tresolve(\n\t\t\t\t\t\tdata.filter(({label, value}) => {\n\t\t\t\t\t\t\tif (!label) label = value;\n\t\t\t\t\t\t\treturn removeDiacritics(label).toLowerCase().indexOf(removeDiacritics(searchString).toLowerCase()) > -1\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t})\n\t\t\t.finally()\n\t}\n\n\tprivate selectedValueIndex(value: GovFormMultiSelectSelectedItem) {\n\t\treturn this.selectedOptionsState.findIndex((selected) => selected === value)\n\t}\n\n\tprivate getOptionElement(value: GovFormMultiSelectSelectedItem): Nullable<HTMLOptionElement> {\n\t\treturn this.selectRef.querySelector('option[value=\"' + value + '\"]') as HTMLOptionElement\n\t}\n\n\tprivate getOption(value: GovFormMultiSelectSelectedItem): GovFormMultiSelectItem | null {\n\t\treturn this.getAvailableOptions(true).find((option) => option.value === value) ?? null;\n\t}\n\n\tprivate selectOption(newOption: GovFormMultiSelectSelectedItem, notify = true) {\n\t\tconst index = this.selectedValueIndex(newOption)\n\t\tif (index === -1) {\n\t\t\tthis.selectedOptionsState = [...this.selectedOptionsState, newOption]\n\t\t\tthis.value = this.selectedOptionsState;\n\t\t\tif (notify) {\n\t\t\t\tthis.govChange.emit({\n\t\t\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\t\t\tvalue: this.selectedOptionsState,\n\t\t\t\t})\n\t\t\t\tthis.govSelect.emit({\n\t\t\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\t\t\tvalue: this.selectedOptionsState,\n\t\t\t\t})\n\t\t\t}\n\t\t\tconst option = this.getOptionElement(newOption)\n\t\t\tif (option) {\n\t\t\t\toption.selected = true\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate removeOption(removeOption: GovFormMultiSelectSelectedItem, notify = true) {\n\t\tconst index = this.selectedValueIndex(removeOption)\n\t\tif (index !== -1) {\n\t\t\tthis.selectedOptionsState.splice(index, 1)\n\t\t\tthis.selectedOptionsState = [...this.selectedOptionsState]\n\t\t\tthis.value = this.selectedOptionsState;\n\t\t\tif (notify) {\n\t\t\t\tthis.govChange.emit({\n\t\t\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\t\t\tvalue: this.selectedOptionsState,\n\t\t\t\t})\n\t\t\t\tthis.govRemove.emit({\n\t\t\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\t\t\tvalue: this.selectedOptionsState,\n\t\t\t\t})\n\t\t\t}\n\t\t\tconst option = this.getOptionElement(removeOption)\n\t\t\tif (option) {\n\t\t\t\toption.selected = false\n\t\t\t}\n\t\t}\n\t}\n\n\tasync componentDidLoad() {\n\t\tthis.initAutocomplete()\n\t}\n\n\tasync componentDidRender() {\n\t\ttick(() => {\n\t\t\tthis.selectRef.querySelectorAll('option').forEach((option: HTMLOptionElement) => {\n\t\t\t\tif (option.selected) {\n\t\t\t\t\tthis.selectOption(option.value, false)\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormMultiSelectClass.root} size={this.size} variant={this.variant}>\n\t\t\t\t<div class={FormMultiSelectClass.wrap}>\n\t\t\t\t\t{this.h.hasSlot('prefix') && <slot name=\"prefix\"></slot>}\n\t\t\t\t\t<div class=\"element\">\n\t\t\t\t\t\t<gov-form-autocomplete\n\t\t\t\t\t\t\tvalue={this.valueState}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tidentifier={this.identifier || this.selectId}\n\t\t\t\t\t\t\trequired={false}\n\t\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\t\t\tmessage-empty={this.messageEmpty}\n\t\t\t\t\t\t\tmessage-loading={this.messageLoading}\n\t\t\t\t\t\t\tref={el => (this.autocompleteRef = el as HTMLGovFormAutocompleteElement)}\n\t\t\t\t\t\t\tminlength={0}\n\t\t\t\t\t\t\tname-key={'label'}\n\t\t\t\t\t\t\twcagDescribedBy={this.wcagDescribedBy}\n\t\t\t\t\t\t\twcagLabelledBy={this.wcagLabelledBy}\n\t\t\t\t\t\t\twcagOwns={this.listId}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<gov-icon slot=\"right-icon\" class=\"icon-arrow\" name=\"chevron-down\"></gov-icon>\n\t\t\t\t\t\t{this.h.hasSlot('right-icon') && !(this.success || this.invalid) && <slot name=\"right-icon\"/>}\n\t\t\t\t\t\t{this.success && <gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"check-lg\"></gov-icon>}\n\t\t\t\t\t\t{this.invalid && <gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"exclamation-lg\"></gov-icon>}\n\t\t\t\t\t\t<select\n\t\t\t\t\t\t\thidden\n\t\t\t\t\t\t\tclass={'hidden-select-list'}\n\t\t\t\t\t\t\taria-hidden={toBoolAttr(true)}\n\t\t\t\t\t\t\tmultiple\n\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tref={el => (this.selectRef = el as HTMLSelectElement)}\n\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\t\taria-owns={this.wcagOwns}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</div>\n\t\t\t\t\t{this.h.hasSlot('sufix') && <slot name=\"sufix\"></slot>}\n\t\t\t\t</div>\n\t\t\t\t{this.hideSelectedList === false ? (\n\t\t\t\t\t<ul role=\"listbox\" id={this.listId} class={FormMultiSelectClass.list}>\n\t\t\t\t\t\t{Array.isArray(this.selectedOptionsState) && this.selectedOptionsState.map(selected => {\n\t\t\t\t\t\t\tconst option = this.getOption(selected);\n\t\t\t\t\t\t\tif (!option) return null\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<li class={FormMultiSelectClass.item} role=\"option\">\n\t\t\t\t\t\t\t\t\t{option.label ?? option.value}\n\t\t\t\t\t\t\t\t\t<gov-button\n\t\t\t\t\t\t\t\t\t\twcagLabel={'Odebrat vybranou položku ' + option.label ?? option.value}\n\t\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\t\t\t\t\tsize=\"s\"\n\t\t\t\t\t\t\t\t\t\ton-gov-click={() => this.onTagRemove(selected)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<gov-icon name=\"x-lg\"></gov-icon>\n\t\t\t\t\t\t\t\t\t</gov-button>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t})}\n\t\t\t\t\t</ul>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.focused = true\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.selectedOptionsState,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\te.stopPropagation()\n\t\tthis.focused = false\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.selectedOptionsState,\n\t\t})\n\t}\n\n\tprivate onInputHandler(e: CustomEvent<FormAutocompleteEvent>) {\n\t\tthis.valueState = e.detail.value\n\t\te.stopPropagation()\n\t}\n\n\tprivate onSelectHandler(e: CustomEvent<FormAutocompleteEvent>) {\n\t\te.stopPropagation()\n\t\tconst value = e.detail.selected\n\t\tthis.selectOption(value.value)\n\t\tthis.valueState = ''\n\t\tthis.autocompleteRef.clearValue().finally()\n\t\tthis.autocompleteRef.focus()\n\t}\n\n\tprivate onTagRemove(removeOption: GovFormMultiSelectSelectedItem) {\n\t\tthis.removeOption(removeOption)\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.selectRef.focus(options)\n\t}\n\n\t/**\n\t * Sets the ordered value of the element\n\t */\n\t@Method()\n\tasync setValue(value: string): Promise<void> {\n\t\tthis.valueState = value\n\t}\n\n\t/**\n\t * Returns an instance of the native html select element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLSelectElement> {\n\t\treturn this.selectRef\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, 'wcag-described-by', FormMultiSelectClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, 'wcag-labelled-by', FormMultiSelectClass.root)\n\t\tvalidateWcagRef(this.wcagOwns, 'wcag-owns', FormMultiSelectClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.selectId, this.wcagLabelledBy, FormMultiSelectClass.root)\n\t}\n}\n"],"mappings":"6lBAAA,MAAMA,EAAwB,o4pBAC9B,MAAAC,EAAeD,E,MC8BFE,EAAkB,MAU9B,WAAAC,CAAAC,G,oUAgCmD,I,0CAQ2B,M,cAKzC,M,cAKA,M,gEAY+B,iC,oBAII,a,gKAoCN,G,kBAChB,GAtGjDC,KAAKC,SAAWC,EAAS,aACzBF,KAAKG,OAASD,EAAS,gBAEvBF,KAAKI,EAAIC,EAAQL,KAAKM,MACtBN,KAAKO,EAAIC,EAAQR,KAAKI,E,CAqGvB,eAAAK,CAAgBC,GACfC,EAAaC,EAAyBF,EAAUG,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uC,CAAeoE,GACtBhI,KAAKyG,WAAauB,EAAEM,OAAOlG,MAC3B4F,EAAEC,iB,CAGK,eAAAxE,CAAgBuE,GACvBA,EAAEC,kBACF,MAAM7F,EAAQ4F,EAAEM,OAAOlF,SACvBpD,KAAKgF,aAAa5C,EAAMA,OACxBpC,KAAKyG,WAAa,GAClBzG,KAAKuD,gBAAgBgF,aAAa7D,UAClC1E,KAAKuD,gBAAgBiF,O,CAGd,WAAAT,CAAYvC,GACnBxF,KAAKwF,aAAaA,E,CAOnB,cAAMiD,CAAStG,GACd,OAAOnC,KAAKkD,UAAUsF,MAAMrG,E,CAO7B,cAAMuG,CAAStG,GACdpC,KAAKyG,WAAarE,C,CAOnB,YAAMuG,GACL,OAAO3I,KAAKkD,S,CAOb,kBAAM+C,GACL2C,EAAgB5I,KAAKiH,gBAAiB,oBAAqBpG,EAAqBC,MAChF8H,EAAgB5I,KAAKkH,eAAgB,mBAAoBrG,EAAqBC,MAC9E8H,EAAgB5I,KAAKmH,SAAU,YAAatG,EAAqBC,MACjE+H,EAAqB7I,KAAK0G,YAAc1G,KAAKC,SAAUD,KAAKkH,eAAgBrG,EAAqBC,K","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import{r as a,c as e,h as o,a as r,g as i}from"./p-0a5b0f7d.js";import{g as d,b as t}from"./p-4191acf2.js";import{c}from"./p-95d41a3b.js";import{a as s}from"./p-e296ca83.js";import{v as n}from"./p-92b7481f.js";import{c as l}from"./p-e618f1cb.js";import{d as g}from"./p-e0e2e9c1.js";const v={root:"gov-card",header:"gov-card__header",title:"gov-card__title",inner:"gov-card__inner",img:"gov-card__img",main:"gov-card__main",content:"gov-card__content",icon:"gov-card__icon",btns:"gov-card__btns",footer:"gov-card__footer",arrow:"gov-card__arrow"};const h='.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-card{position:relative;display:flex;width:100%;flex-direction:column;border:var(--gov-card-border-width, 0.0625rem solid var(--gov-color-secondary-500));border-radius:var(--gov-border-radius, 0.1875rem);background:var(--gov-card-bg, var(--gov-color-neutral-white));overflow:hidden}.gov-card__header{gap:1.75rem;width:100%;padding:1.5rem;border-bottom:var(--gov-card-border-width, 0.0625rem solid var(--gov-color-secondary-500));border-radius:0;text-align:left;text-transform:none;transition:background-color 150ms ease-in-out}.gov-card__arrow{flex:0 0 auto;width:1rem;height:1rem;color:var(--gov-card-arrow-color, var(--gov-color-primary))}.gov-card__title{margin:0;padding:0;font-family:var(--gov-font-family, "Roboto", sans-serif);font-weight:400;box-sizing:border-box;font-weight:var(--gov-text-xl-font-weight);font-size:var(--gov-text-xl-font-size);line-height:var(--gov-text-xl-line-height);letter-spacing:var(--gov-text-xl-letter-spacing);color:var(--gov-card-title-color, var(--gov-color-secondary-800));font-weight:700}.gov-card__img{width:100%;margin:0;line-height:1}.gov-card__img img{width:100%;height:auto}.gov-card__inner{display:flex;flex:1 1 auto;flex-direction:column}.gov-card__inner[aria-hidden=""],.gov-card__inner[aria-hidden=true i],.gov-card__inner[aria-hidden="1"]{display:none}.gov-card__main{display:flex;gap:16px 24px;flex:1 1 auto;flex-direction:column;padding:1.5rem}.gov-card__icon{flex:0 0 auto;width:2.5rem;height:2.5rem;color:var(--gov-card-icon-color, var(--gov-color-primary))}.gov-card__btns{display:flex;gap:1rem;flex:0 0 auto;flex-wrap:wrap}.gov-card__content>*:last-child{margin-bottom:0}.gov-card__footer{padding:1rem 1.5rem;background:var(--gov-card-footer-bg, var(--gov-color-primary-100))}.gov-card__footer>*:last-child{margin-bottom:0}.gov-card__footer p{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing)}.gov-card[is-expanded=""],.gov-card[is-expanded=true i],.gov-card[is-expanded="1"]{height:100%}.gov-card[collapsible=""] .gov-card__header,.gov-card[collapsible=true i] .gov-card__header,.gov-card[collapsible="1"] .gov-card__header{display:inline-flex;vertical-align:middle;justify-content:center;align-items:center;border:0;background-color:transparent;text-align:center;text-decoration:none;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;justify-content:space-between;text-align:left}.gov-card[collapsible=""] .gov-card__header:focus,.gov-card[collapsible=true i] .gov-card__header:focus,.gov-card[collapsible="1"] .gov-card__header:focus{outline:none}.gov-card[collapsible=""] .gov-card__header:focus,.gov-card[collapsible=true i] .gov-card__header:focus,.gov-card[collapsible="1"] .gov-card__header:focus{outline:none}.gov-card[collapsible=""] .gov-card__header:focus-visible,.gov-card[collapsible=true i] .gov-card__header:focus-visible,.gov-card[collapsible="1"] .gov-card__header:focus-visible{border-radius:var(--gov-border-radius, 0.1875rem);outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base);outline-offset:-0.125rem}@media not all and (pointer: coarse){.gov-card[collapsible=""] .gov-card__header:hover,.gov-card[collapsible=true i] .gov-card__header:hover,.gov-card[collapsible="1"] .gov-card__header:hover{background:var(--gov-card-header-hover-bg, var(--gov-color-primary-100))}}.gov-card[collapsible=""][is-expanded=""] .gov-card__header,.gov-card[collapsible=""][is-expanded=true i] .gov-card__header,.gov-card[collapsible=""][is-expanded="1"] .gov-card__header,.gov-card[collapsible=true i][is-expanded=""] .gov-card__header,.gov-card[collapsible=true i][is-expanded=true i] .gov-card__header,.gov-card[collapsible=true i][is-expanded="1"] .gov-card__header,.gov-card[collapsible="1"][is-expanded=""] .gov-card__header,.gov-card[collapsible="1"][is-expanded=true i] .gov-card__header,.gov-card[collapsible="1"][is-expanded="1"] .gov-card__header{border-bottom:var(--gov-card-border-width, 0.0625rem solid var(--gov-color-secondary-500))}.gov-card[collapsible=""][is-expanded=""] .gov-card__arrow,.gov-card[collapsible=""][is-expanded=true i] .gov-card__arrow,.gov-card[collapsible=""][is-expanded="1"] .gov-card__arrow,.gov-card[collapsible=true i][is-expanded=""] .gov-card__arrow,.gov-card[collapsible=true i][is-expanded=true i] .gov-card__arrow,.gov-card[collapsible=true i][is-expanded="1"] .gov-card__arrow,.gov-card[collapsible="1"][is-expanded=""] .gov-card__arrow,.gov-card[collapsible="1"][is-expanded=true i] .gov-card__arrow,.gov-card[collapsible="1"][is-expanded="1"] .gov-card__arrow{transform:scale(-1)}@media (min-width: 30em){.gov-card[promotion=""] .gov-card__main,.gov-card[promotion=true i] .gov-card__main,.gov-card[promotion="1"] .gov-card__main{flex-direction:row;padding:2rem}.gov-card[promotion=""] .gov-card__icon,.gov-card[promotion=true i] .gov-card__icon,.gov-card[promotion="1"] .gov-card__icon{width:3rem;height:3rem}.gov-card[promotion=""] .gov-card__btns,.gov-card[promotion=true i] .gov-card__btns,.gov-card[promotion="1"] .gov-card__btns{flex-direction:column}}';const p=h;const _=class{constructor(o){a(this,o);this.govToggle=e(this,"gov-toggle",7);this.promotion=false;this.label=undefined;this.collapsible=false;this.expanded=false;this.headlineTag="h3";this.wcagTriggerLabel=undefined;this.wcagTriggerLabelledBy=undefined;this.isExpanded=undefined;this.h=d(this.host);this.headlineId=c("GovCardHeadline");this.contentId=c("GovCardContent")}validateHeadlineTag(a){const e=["h1","h2","h3","h4","h5","h6","span"];if(a){if(!e.includes(a)){s(`[${v.root}]: Tag ${a} is not allowed.`)}}}componentWillLoad(){this.isExpanded=this.label?this.expanded:true;this.validateHeadlineTag(this.headlineTag)}async componentDidRender(){if(l()){await g(500);await this.validateWcag()}}emmitChange(){this.govToggle.emit({open:this.isExpanded,element:this.host})}render(){const a=this.headlineTag;return o(r,{key:"51a576a901ee8da650cdf1fd9ef144aa772c46f6",class:this.h.classes(v.root),"is-expanded":this.isExpanded,collapsible:t(this.collapsible),promotion:this.promotion},this.label&&this.collapsible?o("button",{id:this.headlineId,class:v.header,"aria-label":this.wcagTriggerLabel,"aria-labelledby":this.wcagTriggerLabelledBy,"aria-expanded":t(this.isExpanded),"aria-controls":this.contentId,onClick:this.onClickHandler.bind(this)},o(a,{class:v.title},this.label),o("gov-icon",{class:v.arrow,name:"chevron-down"})):null,this.label&&!this.collapsible?o("div",{class:v.header},o(a,{class:v.title},this.label)):null,o("div",{key:"c5ea010badc430bcb8b288476187ffa390a00aba",class:v.inner,id:this.contentId,"aria-hidden":this.collapsible?t(!this.isExpanded):undefined,hidden:this.collapsible?!this.isExpanded:undefined,"aria-labelledby":this.collapsible?this.headlineId:undefined},this.h.hasSlot("img")&&o("p",{key:"5886f9d7e45b4e391f90cafb9e3b265093e2739f",class:v.img},o("slot",{key:"acfff41523785afe6429277bc64cf1c8d698f047",name:"img"})),o("div",{key:"71296fbd2b1333459e1d1b34e18d3ce4f1fce8d0",class:v.main},this.h.hasSlot("icon")&&this.promotion&&o("div",{key:"b87b2006997178b6aac4c66c8612a449fc7c90e9",class:v.icon},o("slot",{key:"ab0c18d9063987c83355bb6e1494fd13a6da72d2",name:"icon"})),o("div",{key:"61a9762eca1c88158c768d4920ba167657d5290e",class:v.content},o("slot",{key:"de8b07370786fa353a488cf92f2c5195b327521c"})),this.h.hasSlot("btn")&&this.promotion&&o("div",{key:"65d6b6b5f87b54803fc335282f3a2223f12c9a23",class:v.btns},o("slot",{key:"2942bd6cc79958a5e610c234e5f79b52a59fa83d",name:"btn"}))),this.h.hasSlot("footer")&&o("div",{key:"6a31971efcd942e7acb0775de77bf104c580f2c3",class:v.footer},o("slot",{key:"652b298be04e1e55a338309e5644229755cb9f7b",name:"footer"}))))}onClickHandler(a){a.stopPropagation();if(this.collapsible){this.isExpanded=!this.isExpanded;this.emmitChange()}}async open(){if(this.collapsible){this.isExpanded=true;this.emmitChange()}}async close(){if(this.collapsible){this.isExpanded=false;this.emmitChange()}}async validateWcag(){if(this.collapsible){n(this.wcagTriggerLabel,this.wcagTriggerLabelledBy,v.root)}}get host(){return i(this)}static get watchers(){return{headlineTag:["validateHeadlineTag"]}}};_.style=p;export{_ as gov_card};
2
- //# sourceMappingURL=p-3e3a1607.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["FormFileClass","root","area","label","input","list","item","attachments","formatBytes","bytes","units","l","n","parseInt","toFixed","fileAcceptValidation","file","accept","length","replace","split","filter","RegExp","test","type","fileSizeValidation","maxSize","fileSize","Math","round","size","govFormFileCss","GovFormFileStyle0","GovFormFile","constructor","hostRef","this","fileId","createID","h","govHost","host","f","govForm","watchControlAttrs","passControlAttrs","passAttrToControl","toBoolAttr","invalid","disabled","registerListeners","highlight","areaRef","classList","add","unhighlight","remove","inputRef","addEventListener","e","preventDefault","stopPropagation","files","target","resetAfterPick","validateFiles","expanded","events","inEvents","outEvents","map","eventName","preventDefaults","bind","forEach","handleDrop","dataTransfer","filesBuffer","Array","from","isFile","find","name","ignoreFileDuplicationCheck","isSizeValid","maxFileSize","isAcceptValid","newFile","id","acceptValid","sizeValid","displayAttachments","govAddFile","emit","component","govFiles","reset","finally","componentWillLoad","passAttrToLabel","String","required","componentDidRender","canValidateWcagOnRender","delay","validateWcag","render","Host","key","class","classes","toBoolAttrIfDefined","ref","el","identifier","multiple","onChange","onChangeHandler","onFocus","onFocusHandler","onBlur","onBlurHandler","wcagDescribedBy","wcagLabelledBy","hasSlot","wcagAttachmentsLabel","onRemoveFileHandler","wcagRemoveLabel","slot","variant","errorAccept","errorSize","index","findIndex","removeFile","splice","govRemoveFile","govFocus","originalEvent","govBlur","getRef","getAreaRef","value","validateWcagRef","validateWcagLabelFor"],"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.scss?tag=gov-form-file","../../../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\tlabel: 'gov-form-file__label',\n\tinput: 'gov-form-file__input',\n\tlist: 'gov-form-file__list',\n\titem: 'gov-form-file__item',\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","/*\n * File\n */\n\n$class: \".gov-form-file\";\n\n#{$class} {\n\t@include base();\n\t&__label .gov-form-label__label {\n\t\t@include reset-last-margin();\n\t}\n\t&__input {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tleft: 0;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\topacity: 0.0001;\n\t\tcursor: pointer;\n\t}\n\t&__attachments {\n\t\tmargin-top: rem-calc(16 0 0);\n\t}\n\t&__item {\n\t\tdisplay: flex;\n\t\tgap: rem-calc(16);\n\t\talign-items: center;\n\t}\n\n\t// STATES\n\t@include parameter(\"disabled\") {\n\t\t#{$class} {\n\t\t\t&__label .gov-form-label__label {\n\t\t\t\tpointer-events: none;\n\t\t\t\t* {\n\t\t\t\t\tcolor: $form-file-disabled-color;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@include parameter(\"expanded\") {\n\t\t#{$class} {\n\t\t\t&__area {\n\t\t\t\tposition: relative;\n\t\t\t\twidth: 100%;\n\t\t\t\tpadding: rem-calc(32) rem-calc(22) rem-calc(22);\n\t\t\t\tborder: $form-file-border;\n\t\t\t\ttext-align: center;\n\t\t\t\ttransition: background-color $t ease-in-out;\n\t\t\t\twill-change: background-color;\n\t\t\t\t&.highlight {\n\t\t\t\t\tbackground-color: color(\"primary.200\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t&__label .gov-form-label__label {\n\t\t\t\twidth: 100%;\n\t\t\t\tpadding: rem-calc(22);\n\t\t\t\tborder: $form-file-border;\n\t\t\t\ttext-align: center;\n\t\t\t}\n\t\t\t&__attachments {\n\t\t\t\tmargin: rem-calc(24 0 0);\n\t\t\t}\n\t\t}\n\n\t\t// STATES\n\t\t@include parameter(\"invalid\") {\n\t\t\t#{$class} {\n\t\t\t\t&__label .gov-form-label__label {\n\t\t\t\t\tborder-color: $form-state-color-error;\n\t\t\t\t}\n\t\t\t\t&__area {\n\t\t\t\t\tborder-color: $form-state-color-error;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t@include parameter(\"disabled\") {\n\t\t\t#{$class} {\n\t\t\t\t&__area {\n\t\t\t\t\tpointer-events: none;\n\t\t\t\t\tcolor: $form-file-disabled-color;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// MQ\n\t@include mq($from: sm) {\n\t\t@include parameter(\"expanded\") {\n\t\t\t#{$class} {\n\t\t\t\t&__label .gov-form-label__label {\n\t\t\t\t\tpadding: rem-calc(32);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\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 {validateWcagLabelFor, validateWcagRef} from \"../../../helpers/Validate/wcag\"\nimport {canValidateWcagOnRender} from \"../../../helpers/Dom/win\"\nimport {fileAcceptValidation, fileSizeValidation, formatBytes} from \"../../../utils/file.utils\"\nimport {delay} from \"../../../utils/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\"\n\n@Component({\n\ttag: \"gov-form-file\",\n\tstyleUrl: \"gov-form-file.scss\",\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\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() 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 = true\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 * Description of the list of attachments\n\t */\n\t@Prop({attribute: \"attachments-label\"}) readonly attachmentsLabel: string = \"Přílohy\"\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({attribute: \"wcag-described-by\"}) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({attribute: \"wcag-labelled-by\"}) readonly wcagLabelledBy: string\n\t/**\n\t * Adds accessible label for the remove button that is only shown for screen readers.\n\t */\n\t@Prop({attribute: \"wcag-remove-label\"}) readonly wcagRemoveLabel: string = \"Odebrat soubor {FILE_NAME}\"\n\t/**\n\t * Adds accessible label for the list of attachments.\n\t */\n\t@Prop({attribute: \"wcag-attachments-label\"}) readonly wcagAttachmentsLabel: 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\t@State() files: GovFormFileItem[] = []\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\twatchControlAttrs(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t}\n\n\n\tprivate registerListeners() {\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\", \"drop\", \"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\n\t\t\tthis.areaRef.addEventListener(\"drop\", this.handleDrop.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\tArray.from(files).map(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\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\tcomponentWillLoad() {\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\tthis.f.passAttrToControl(\"type\", \"File\")\n\t\tthis.passControlAttrs()\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\n\t\tthis.registerListeners()\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes([FormFileClass.root])} invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\texpanded={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\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t/>\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.wcagAttachmentsLabel} wcag-label={this.wcagAttachmentsLabel}>\n\t\t\t\t\t\t\t{this.files.map(item => (\n\t\t\t\t\t\t\t\t<gov-attachments-item wcag-remove-labelled-by={item.id}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ton-gov-remove={() => this.onRemoveFileHandler(item)}>\n\t\t\t\t\t\t\t\t\t<span class={\"sr-only\"} id={item.id}>\n\t\t\t\t\t\t\t\t\t\t{this.wcagRemoveLabel.replace(\"{FILE_NAME}\", item.file.name)}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t{item.file.name}\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\" variant=\"error\">\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon\" name=\"exclamation-triangle-fill\"></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\" variant=\"error\">\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon\" name=\"exclamation-triangle-fill\"></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.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\tthis.inputRef.value = '';\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, \"wcag-described-by\", FormFileClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, \"wcag-labelled-by\", FormFileClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.fileId, this.wcagLabelledBy, FormFileClass.root)\n\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AAA,QAAMyF,KAAK,QAAM,IAAGxH,EAAYF,EAAKU,KAAKc,MAAK,UAKhD,K,CAKC,mBAAAgG,CAAoB9G,GAC3B,MAAMoH,EAAQhG,KAAK0B,MAAMuE,WAAU/H,GAAQA,EAAKkF,KAAOxE,EAAKwE,KAC5D,GAAI4C,KAAW,EAAG,CACjB,MAAMtE,EAAQ1B,KAAK0B,MACnB,MAAMwE,EAAalG,KAAK0B,MAAMsE,GAC9BtE,EAAMyE,OAAOH,EAAO,GACpBhG,KAAK0B,MAAQ,IAAIA,GACjB1B,KAAKoG,cAAc3C,KAAK,CACvBC,UAAW9F,EAAcC,KACzBe,KAAMsH,IAEPlG,KAAK2D,SAASF,KAAK,CAClBC,UAAW9F,EAAcC,KACzB6D,S,EAKK,cAAAyD,CAAe5D,GACtBA,EAAEE,kBACFzB,KAAKqG,SAAS5C,KAAK,CAClBC,UAAW9F,EAAcC,KACzByI,cAAe/E,G,CAIT,aAAA8D,CAAc9D,GACrBA,EAAEE,kBACFzB,KAAKuG,QAAQ9C,KAAK,CACjBC,UAAW9F,EAAcC,KACzByI,cAAe/E,G,CAIT,eAAA0D,CAAgB1D,GACvBA,EAAEE,iB,CAOH,YAAM+E,GACL,OAAOxG,KAAKqB,Q,CAOb,gBAAMoF,GACL,OAAOzG,KAAKgB,O,CAOb,WAAM4C,GACL5D,KAAK0B,MAAQ,GACb1B,KAAKqB,SAASqF,MAAQ,E,CAOvB,kBAAMrC,GACLsC,EAAgB3G,KAAKsF,gBAAiB,oBAAqB1H,EAAcC,MACzE8I,EAAgB3G,KAAKuF,eAAgB,mBAAoB3H,EAAcC,MACvE+I,EAAqB5G,KAAK8E,YAAc9E,KAAKC,OAAQD,KAAKuF,eAAgB3H,EAAcC,K","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["PaginationSizes","pick","Sizes","PaginationVariants","Variants","PaginationTypes","PaginationClass","root","list","item","itemArrow","itemMore","itemSelect","inner","arrow","paginate","totalItems","currentPage","pageSize","maxPages","totalPages","Math","ceil","startPage","endPage","maxPagesBeforeCurrentPage","floor","maxPagesAfterCurrentPage","startIndex","endIndex","min","pages","Array","from","keys","map","i","govPaginationCss","GovPaginationStyle0","GovPagination","constructor","hostRef","this","h","govHost","host","pageSelectId","createID","selectId","validateType","newValue","validateProp","validateSize","validateVariant","recalculate","recalculatePagination","current","componentWillLoad","size","variant","componentDidRender","canValidateWcagOnRender","delay","validateWcag","pagination","total","isActivePageClass","originalClass","page","prepareLinkUrl","link","String","replace","undefined","resetSelectValue","spreadSelectRef","getRef","then","el","value","render","pageResolver","content","description","isDisabled","ariaCurrent","toBoolAttrIfDefined","href","type","disabled","e","onClickHandler","accessiblePageLabel","class","Host","classes","wcagLabel","wcagLabelledBy","prepareClasses","name","labelStart","labelPrev","id","hidden","accessibleSelectLabel","identifier","selectIdentifier","onSelectHandler","bind","createArrayRange","selected","Fragment","ref","labelNext","labelEnd","stopPropagation","govPage","emit","component","detail","parseInt","isNaN","window","location","validateWcagProp","validateWcagLabel"],"sources":["../../../packages/core/src/components/gov-pagination/constants.ts","../../../packages/core/src/components/gov-pagination/pagination.ts","../../../packages/core/src/components/gov-pagination/gov-pagination.scss?tag=gov-pagination","../../../packages/core/src/components/gov-pagination/gov-pagination.tsx"],"sourcesContent":["import { Sizes } from '../../core/constants/sizes'\nimport { Variants } from '../../core/constants/variants'\nimport { pick } from '../../utils/utils'\nimport { ValueOf } from '../../types/interfaces'\n\nexport const PaginationSizes = pick(Sizes, ['_S', '_M'])\nexport type PaginationSizeType = `${ValueOf<typeof PaginationSizes>}`\n\nexport const PaginationVariants = pick(Variants, ['PRIMARY', 'SECONDARY'])\nexport type PaginationVariantType = `${ValueOf<typeof PaginationVariants>}`\n\nexport enum PaginationTypes {\n\tBUTTON = 'button',\n\tSELECT = 'select',\n}\nexport type PaginationType = `${ValueOf<typeof PaginationTypes>}`\n\nexport const PaginationClass = {\n\troot: 'gov-pagination',\n\tlist: 'gov-pagination__list',\n\titem: 'gov-pagination__item',\n\titemArrow: 'gov-pagination__item--arrow',\n\titemMore: 'gov-pagination__item--more',\n\titemSelect: 'gov-pagination__item--select',\n\tinner: 'gov-pagination__inner',\n\tarrow: 'gov-pagination__arrow',\n}\n","export interface Pagination {\n\ttotalItems: number\n\tcurrentPage: number\n\tpageSize: number\n\ttotalPages: number\n\tstartPage: number\n\tendPage: number\n\tstartIndex: number\n\tendIndex: number\n\tpages: number[]\n}\n\nexport function paginate(totalItems: number, currentPage = 1, pageSize = 10, maxPages = 10): Pagination {\n\t// calculate total pages\n\tconst totalPages = Math.ceil(totalItems / pageSize)\n\n\t// ensure current page isn't out of range\n\tif (currentPage < 1) {\n\t\tcurrentPage = 1\n\t} else if (currentPage > totalPages) {\n\t\tcurrentPage = totalPages\n\t}\n\n\tlet startPage: number, endPage: number\n\tif (totalPages <= maxPages) {\n\t\t// total pages less than max so show all pages\n\t\tstartPage = 1\n\t\tendPage = totalPages\n\t} else {\n\t\t// total pages more than max so calculate start and end pages\n\t\tconst maxPagesBeforeCurrentPage = Math.floor(maxPages / 2)\n\t\tconst maxPagesAfterCurrentPage = Math.ceil(maxPages / 2) - 1\n\t\tif (currentPage <= maxPagesBeforeCurrentPage) {\n\t\t\t// current page near the start\n\t\t\tstartPage = 1\n\t\t\tendPage = maxPages\n\t\t} else if (currentPage + maxPagesAfterCurrentPage >= totalPages) {\n\t\t\t// current page near the end\n\t\t\tstartPage = totalPages - maxPages + 1\n\t\t\tendPage = totalPages\n\t\t} else {\n\t\t\t// current page somewhere in the middle\n\t\t\tstartPage = currentPage - maxPagesBeforeCurrentPage\n\t\t\tendPage = currentPage + maxPagesAfterCurrentPage\n\t\t}\n\t}\n\n\t// calculate start and end item indexes\n\tconst startIndex = (currentPage - 1) * pageSize\n\tconst endIndex = Math.min(startIndex + pageSize - 1, totalItems - 1)\n\n\t// create an array of pages to ng-repeat in the pager control\n\tconst pages = Array.from(Array(endPage + 1 - startPage).keys()).map(i => startPage + i)\n\n\t// return object with all pager properties required by the view\n\treturn {\n\t\ttotalItems: totalItems,\n\t\tcurrentPage: currentPage,\n\t\tpageSize: pageSize,\n\t\ttotalPages: totalPages,\n\t\tstartPage: startPage,\n\t\tendPage: endPage,\n\t\tstartIndex: startIndex,\n\t\tendIndex: endIndex,\n\t\tpages: pages,\n\t}\n}\n","/*\n * Pagination\n */\n\n$class: \".gov-pagination\";\n\n#{$class} {\n\t@include base();\n\t&__list {\n\t\t@extend %reset-ul;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tflex-wrap: wrap;\n\t\tfont-weight: bold;\n\t\ttext-align: center;\n\t}\n\t&__list &__item {\n\t\t@extend %reset-ul-li;\n\t\tdisplay: flex;\n\t\tjustify-content: center;\n\t\talign-items: center;\n\t\tmargin: 0;\n\t\tpadding: rem-calc(2);\n\t\tborder-radius: $border-radius;\n\t\toverflow: hidden;\n\t\t&--arrow {\n\t\t\tdisplay: flex;\n\t\t}\n\t\t&--select {\n\t\t\tz-index: 1;\n\t\t\tdisplay: flex;\n\t\t\toverflow: visible;\n\t\t\tpadding: rem-calc(0 16);\n\t\t}\n\t}\n\t&__arrow {\n\t\tmargin: 0;\n\t}\n\t&__item--more {\n\t\t.gov-form-select {\n\t\t\tselect {\n\t\t\t\tborder: none !important;\n\t\t\t\tpadding-right: rem-calc(12) !important;\n\t\t\t}\n\t\t\t.gov-icon {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t}\n\t}\n\t&__inner {\n\t\tdisplay: flex;\n\t\tjustify-content: center;\n\t\talign-items: center;\n\t\talign-self: stretch;\n\t\twidth: 100%;\n\t\ttext-decoration: none;\n\t\t// Use hover styles from gov-button to active page button\n\t\t&[wcag-current=\"true\"] {\n\t\t\t@each $variant, $types in $button-variants {\n\t\t\t\t@each $type, $definitions in $types {\n\t\t\t\t\t&[type=\"#{$type}\"][variant=\"#{$variant}\"] {\n\t\t\t\t\t\t.element {\n\t\t\t\t\t\t\tbackground-color: deep-map-get($button-variants, $variant, $type, \"hover-bg\");\n\t\t\t\t\t\t\tcolor: deep-map-get($button-variants, $variant, $type, \"hover-color\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@each $size, $definitions in $pagination-sizes {\n\t\t&[size=\"#{$size}\"] {\n\t\t\t#{$class} {\n\t\t\t\t&__inner {\n\t\t\t\t\t@include typography(get(\"font\", $definitions));\n\t\t\t\t\tfont-weight: inherit;\n\t\t\t\t\t.element {\n\t\t\t\t\t\tmin-width: get(\"button-size\", $definitions);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import Fragment from \"../../helpers/Fragment\"\nimport {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../helpers/Validate/props\"\nimport {\n\tPaginationClass,\n\tPaginationSizes,\n\tPaginationSizeType,\n\tPaginationType,\n\tPaginationTypes,\n\tPaginationVariants,\n\tPaginationVariantType,\n} from \"./constants\"\nimport {govHost, prepareClasses, toBoolAttrIfDefined} from \"../../helpers/Dom/template\"\nimport {paginate, Pagination} from \"./pagination\"\nimport {validateWcagLabel, validateWcagProp} from \"../../helpers/Validate/wcag\"\nimport {canValidateWcagOnRender} from \"../../helpers/Dom/win\"\nimport {delay} from \"../../utils/utils\"\nimport {createID} from \"../../utils/string.utils\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {createArrayRange} from \"../../utils/array.utils\"\nimport {FormSelectEvent} from \"../gov-form/select/gov-form-select.types\"\nimport {PaginationEvent} from \"./gov-pagination.types\"\n\n@Component({\n\ttag: \"gov-pagination\",\n\tstyleUrl: \"gov-pagination.scss\",\n})\nexport class GovPagination {\n\tprivate h: GovHost\n\tprivate readonly pageSelectId: string\n\tprivate readonly selectId: string\n\n\tprivate spreadSelectRef?: HTMLGovFormSelectElement\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.pageSelectId = createID(\"GovPageSelect\")\n\t\tthis.selectId = createID(\"GovSelect\")\n\t}\n\n\t@Element() readonly host: HTMLGovPaginationElement\n\t/**\n\t * Pagination type\n\t */\n\t@Prop() readonly type: PaginationType = \"button\"\n\t/**\n\t * Currently displayed page\n\t */\n\t@Prop() readonly current: number = 1\n\t/**\n\t * Total count of entries\n\t */\n\t@Prop() readonly total: number = 0\n\t/**\n\t * Set on active page\n\t */\n\t@Prop() readonly inverse: boolean\n\t/**\n\t * Custom select identifier.\n\t */\n\t@Prop({attribute: 'select-identifier'}) readonly selectIdentifier: string\n\t/**\n\t * Pagination's size\n\t */\n\t@Prop() readonly size?: PaginationSizeType = \"m\"\n\t/**\n\t * Style variation of the pagination.\n\t */\n\t@Prop() readonly variant?: PaginationVariantType = \"primary\"\n\t/**\n\t * Maximum number of entries per page\n\t */\n\t@Prop({attribute: \"page-size\"}) readonly pageSize: number = 10\n\t/**\n\t * Maximum pages displayed for selection\n\t */\n\t@Prop({attribute: \"max-pages\"}) readonly maxPages: number = 5\n\t/**\n\t * Setting a link to redirect to a given page.\n\t * The {PAGE} wildcard can be used in the link to replace the page number.\n\t * Note that in the case of paging through a link, it is always necessary to send to the component the current page where the user is.\n\t */\n\t@Prop() readonly link: string\n\t/**\n\t * Adds accessible label for the pagination that is only shown for screen readers.\n\t */\n\t@Prop({attribute: \"wcag-label\"}) readonly wcagLabel: string\n\t/**\n\t * Indicates the id of a component that labels the pagination.\n\t */\n\t@Prop({attribute: \"wcag-labelled-by\"}) readonly wcagLabelledBy: string\n\t/**\n\t * Adds accessible label for the page select\n\t */\n\t@Prop({attribute: \"wcag-select-label\"}) readonly accessibleSelectLabel: string = \"Vybrat stranu\"\n\t/**\n\t * Adds accessible label for the page item\n\t */\n\t@Prop({attribute: \"wcag-page-label\"}) readonly accessiblePageLabel: string = \"Strana\"\n\t/**\n\t * Description of the possibility to go back one page\n\t */\n\t@Prop({attribute: \"label-prev\"}) readonly labelPrev = 'Přejít o stranu zpět'\n\t/**\n\t * Description of the option to go to the top of paging\n\t */\n\t@Prop({attribute: \"label-start\"}) readonly labelStart = 'Přejít na začátek'\n\t/**\n\t * Description of the option to go to the end of paging\n\t */\n\t@Prop({attribute: \"label-next\"}) readonly labelNext = 'Přejít na další stranu'\n\t/**\n\t * Description of the option to move one page forward\n\t */\n\t@Prop({attribute: \"label-end\"}) readonly labelEnd = 'Přejít na konec'\n\t/**\n\t * Event called when changing the page with the current setting of the whole paging\n\t */\n\t@Event({eventName: \"gov-page\"}) govPage: EventEmitter<PaginationEvent>\n\n\t@State() pagination: Pagination\n\n\t@Watch(\"type\")\n\tvalidateType(newValue: string): void {\n\t\tvalidateProp(PaginationTypes, newValue, PaginationClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(PaginationSizes, newValue, PaginationClass.root)\n\t}\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(PaginationVariants, newValue, PaginationClass.root)\n\t}\n\n\t@Watch(\"current\")\n\t@Watch(\"total\")\n\t@Watch(\"pageSize\")\n\t@Watch(\"maxPages\")\n\trecalculate(): void {\n\t\tthis.recalculatePagination(this.current)\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.recalculatePagination(this.current)\n\t\tthis.validateSize(this.size)\n\t\tthis.validateVariant(this.variant)\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\tprivate recalculatePagination(currentPage: number) {\n\t\tthis.pagination = paginate(this.total, currentPage, this.pageSize, this.maxPages)\n\t}\n\n\tprivate isActivePageClass(originalClass: string, page: number) {\n\t\tif (this.pagination.currentPage === page) {\n\t\t\treturn originalClass + \" is-active\"\n\t\t} else {\n\t\t\treturn originalClass\n\t\t}\n\t}\n\n\tprivate prepareLinkUrl(page: number) {\n\t\tif (this.link) {\n\t\t\treturn String(this.link).replace(\"{PAGE}\", String(page))\n\t\t}\n\t\treturn undefined\n\t}\n\n\tprivate resetSelectValue() {\n\t\tif (this.spreadSelectRef) {\n\t\t\tthis.spreadSelectRef.getRef()\n\t\t\t\t.then((el: HTMLSelectElement) => {\n\t\t\t\t\tel.value = '...'\n\t\t\t\t})\n\t\t}\n\t}\n\n\trender() {\n\t\tconst pageResolver = (page: number, content: any, description: string) => {\n\t\t\tconst isDisabled = page === -1\n\t\t\tconst ariaCurrent = toBoolAttrIfDefined(this.pagination.currentPage === page ? true : undefined)\n\t\t\treturn (\n\t\t\t\t<gov-button\n\t\t\t\t\thref={this.prepareLinkUrl(page)}\n\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\tsize={this.size}\n\t\t\t\t\ttype=\"base\"\n\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\ton-gov-click={(e) => this.onClickHandler(e, page)}\n\t\t\t\t\twcag-label={description ? description : page > -1 ? this.accessiblePageLabel + \" \" + page : undefined}\n\t\t\t\t\twcag-current={ariaCurrent}\n\t\t\t\t\tclass={PaginationClass.inner}>\n\t\t\t\t\t{content}\n\t\t\t\t</gov-button>\n\t\t\t)\n\t\t}\n\t\treturn (\n\t\t\t<Host class={this.h.classes(PaginationClass.root)} type={this.type} variant={this.variant} size={this.size}>\n\t\t\t\t<nav aria-label={this.wcagLabel} aria-labelledby={this.wcagLabelledBy}>\n\t\t\t\t\t<ul class={PaginationClass.list}>\n\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemArrow])}>\n\t\t\t\t\t\t\t{pageResolver(\n\t\t\t\t\t\t\t\tthis.pagination.currentPage > 1 ? 1 : -1,\n\t\t\t\t\t\t\t\t<gov-icon class={PaginationClass.arrow} name=\"chevron-double-left\"></gov-icon>,\n\t\t\t\t\t\t\t\tthis.labelStart\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</li>\n\n\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemArrow])}>\n\t\t\t\t\t\t\t{pageResolver(\n\t\t\t\t\t\t\t\tthis.pagination.startPage < this.pagination.currentPage ? this.pagination.currentPage - 1 : -1,\n\t\t\t\t\t\t\t\t<gov-icon class={PaginationClass.arrow} name=\"chevron-left\"></gov-icon>,\n\t\t\t\t\t\t\t\tthis.labelPrev\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</li>\n\n\t\t\t\t\t\t{this.type == \"select\" ? (\n\t\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemSelect])}>\n\t\t\t\t\t\t\t\t<span class={PaginationClass.inner}>\n\t\t\t\t\t\t\t\t\t<span id={this.pageSelectId} hidden>\n\t\t\t\t\t\t\t\t\t\t{this.accessibleSelectLabel}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<gov-form-select\n\t\t\t\t\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\t\t\t\t\tidentifier={this.selectIdentifier || this.selectId}\n\t\t\t\t\t\t\t\t\t\twcag-labelled-by={this.pageSelectId}\n\t\t\t\t\t\t\t\t\t\ton-gov-change={this.onSelectHandler.bind(this)}>\n\t\t\t\t\t\t\t\t\t\t{createArrayRange(1, this.pagination.totalPages).map(page => (\n\t\t\t\t\t\t\t\t\t\t\t<option value={page} selected={this.pagination.currentPage === page}>\n\t\t\t\t\t\t\t\t\t\t\t\t{page}\n\t\t\t\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t</gov-form-select>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t{this.pagination.pages.map(page => (\n\t\t\t\t\t\t\t\t\t<li class={this.isActivePageClass(PaginationClass.item, page)}>{pageResolver(page, page, '')}</li>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t{this.pagination.totalPages ? (\n\t\t\t\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemMore])}>\n\t\t\t\t\t\t\t\t\t<span class={PaginationClass.inner}>\n\t\t\t\t\t\t\t\t\t\t<span id={this.pageSelectId} hidden>\n\t\t\t\t\t\t\t\t\t\t\t{this.accessibleSelectLabel}\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t<gov-form-select\n\t\t\t\t\t\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\t\t\t\t\t\tidentifier={this.selectIdentifier || this.selectId}\n\t\t\t\t\t\t\t\t\t\t\twcag-labelled-by={this.pageSelectId}\n\t\t\t\t\t\t\t\t\t\t\tref={el => (this.spreadSelectRef = el as HTMLGovFormSelectElement)}\n\t\t\t\t\t\t\t\t\t\t\ton-gov-change={this.onSelectHandler.bind(this)}>\n\t\t\t\t\t\t\t\t\t\t\t<option selected hidden>...</option>\n\t\t\t\t\t\t\t\t\t\t\t{createArrayRange(1, this.pagination.totalPages).map(page => (\n\t\t\t\t\t\t\t\t\t\t\t\t<option value={page} selected={false}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{page}\n\t\t\t\t\t\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t\t</gov-form-select>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemArrow])}>\n\t\t\t\t\t\t\t{pageResolver(\n\t\t\t\t\t\t\t\tthis.pagination.totalPages > this.pagination.currentPage ? this.pagination.currentPage + 1 : -1,\n\t\t\t\t\t\t\t\t<gov-icon class={PaginationClass.arrow} name=\"chevron-right\"></gov-icon>,\n\t\t\t\t\t\t\t\tthis.labelNext\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</li>\n\n\t\t\t\t\t\t<li class={prepareClasses([PaginationClass.item, PaginationClass.itemArrow])}>\n\t\t\t\t\t\t\t{pageResolver(\n\t\t\t\t\t\t\t\tthis.pagination.totalPages > this.pagination.currentPage ? this.pagination.totalPages : -1,\n\t\t\t\t\t\t\t\t<gov-icon class={PaginationClass.arrow} name=\"chevron-double-right\"></gov-icon>,\n\t\t\t\t\t\t\t\tthis.labelEnd\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</nav>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: CustomEvent, page: number): void {\n\t\te.stopPropagation()\n\t\tthis.recalculatePagination(page)\n\t\tthis.govPage.emit({\n\t\t\tcomponent: PaginationClass.root,\n\t\t\tpagination: this.pagination\n\t\t})\n\t}\n\n\tprivate onSelectHandler(e: CustomEvent<FormSelectEvent>): void {\n\t\te.stopPropagation()\n\t\tconst value = e.detail.value\n\t\tconst page = parseInt(value)\n\t\tthis.resetSelectValue()\n\t\tif (isNaN(page) === false) {\n\t\t\tthis.recalculatePagination(page)\n\t\t\tif (this.link) {\n\t\t\t\twindow.location.href = this.prepareLinkUrl(page)\n\t\t\t} else {\n\t\t\t\tthis.govPage.emit({\n\t\t\t\t\tcomponent: PaginationClass.root,\n\t\t\t\t\tpagination: this.pagination\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagProp(this.accessiblePageLabel, \"wcag-page-label\", PaginationClass.root)\n\t\tvalidateWcagLabel(this.wcagLabel, this.wcagLabelledBy, PaginationClass.root)\n\t}\n}\n"],"mappings":"ofAKO,MAAMA,EAAkBC,EAAKC,EAAO,CAAC,KAAM,OAG3C,MA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AC7CzD,KAAKuE,YAIPtE,EAAA,MAAIkD,MAAOK,EAAe,CAAC5F,EAAgBG,KAAMH,EAAgBI,aAC/DuE,EACAvC,KAAKsB,WAAW5C,WAAasB,KAAKsB,WAAW/C,YAAcyB,KAAKsB,WAAW5C,YAAc,EACzFuB,EAAA,YAAUkD,MAAOvF,EAAgBQ,MAAOqF,KAAK,yBAC7CzD,KAAKwE,a,CASJ,cAAAvB,CAAeD,EAAgBtB,GACtCsB,EAAEyB,kBACFzE,KAAKa,sBAAsBa,GAC3B1B,KAAK0E,QAAQC,KAAK,CACjBC,UAAWhH,EAAgBC,KAC3ByD,WAAYtB,KAAKsB,Y,CAIX,eAAA2C,CAAgBjB,GACvBA,EAAEyB,kBACF,MAAMpC,EAAQW,EAAE6B,OAAOxC,MACvB,MAAMX,EAAOoD,SAASzC,GACtBrC,KAAKgC,mBACL,GAAI+C,MAAMrD,KAAU,MAAO,CAC1B1B,KAAKa,sBAAsBa,GAC3B,GAAI1B,KAAK4B,KAAM,CACdoD,OAAOC,SAASpC,KAAO7C,KAAK2B,eAAeD,E,KACrC,CACN1B,KAAK0E,QAAQC,KAAK,CACjBC,UAAWhH,EAAgBC,KAC3ByD,WAAYtB,KAAKsB,Y,GAUrB,kBAAMD,GACL6D,EAAiBlF,KAAKkD,cAAe,kBAAmBtF,EAAgBC,MACxEsH,EAAkBnF,KAAKsD,UAAWtD,KAAKuD,eAAgB3F,EAAgBC,K","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["govFormSelectCss","GovFormSelectStyle0","GovFormSelect","constructor","hostRef","this","h","govHost","host","f","govForm","selectId","createID","validateVariant","newValue","validateProp","FormSelectVariants","FormSelectClass","root","validateSize","FormSelectSizes","watchOptions","optionsState","propsValueToArray","watchControlAttrs","passControlAttrs","watchValue","markSelectedValue","passAttrToControl","size","toBoolAttr","invalid","success","disabled","componentWillLoad","variant","passAttrToLabel","String","required","options","componentDidRender","canValidateWcagOnRender","delay","validateWcag","tick","querySelectorAll","forEach","option","value","setAttribute","removeAttribute","render","Host","key","class","hasSlot","name","slot","id","identifier","onFocus","onFocusHandler","bind","onChange","onChangeHandler","onBlur","onBlurHandler","ref","el","selectRef","toBoolAttrIfDefined","wcagActiveDescendant","wcagControls","wcagDescribedBy","wcagLabelledBy","wcagOwns","Array","isArray","map","selected","_a","label","e","focused","govFocus","emit","component","originalEvent","govBlur","target","stopPropagation","govChange","setFocus","focus","getRef","validateWcagRef","validateWcagLabelFor"],"sources":["../../../packages/core/src/components/gov-form/select/gov-form-select.scss?tag=gov-form-select","../../../packages/core/src/components/gov-form/select/gov-form-select.tsx"],"sourcesContent":["/*\n * Select\n */\n\n@import \"../select/gov-form-select-core.scss\";\n\n$class: \".gov-form-select\";\n\n#{$class} {\n\t@extend %form-select-core;\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from '@stencil/core'\nimport {govForm} from '../../../helpers/Dom/form'\nimport {GovForm} from '../../../helpers/Dom/form.types'\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from '../../../helpers/Dom/template'\nimport {GovHost} from '../../../helpers/Dom/template.types'\nimport {canValidateWcagOnRender} from '../../../helpers/Dom/win'\nimport {validateProp} from '../../../helpers/Validate/props'\nimport {validateWcagLabelFor, validateWcagRef} from '../../../helpers/Validate/wcag'\nimport {createID} from '../../../utils/string.utils'\nimport {delay} from '../../../utils/utils'\nimport {\n\tFormSelectClass,\n\tFormSelectSizes,\n\tFormSelectSizesType,\n\tFormSelectVariants,\n\tFormSelectVariantType\n} from './constants'\nimport {FormSelectEvent, FormSelectOption} from './gov-form-select.types'\nimport {propsValueToArray} from \"../../../utils/array.utils\";\nimport {tick} from \"../../../utils/stencil.utils\";\n\n@Component({\n\ttag: 'gov-form-select',\n\tstyleUrl: 'gov-form-select.scss',\n})\nexport class GovFormSelect {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\tprivate selectRef?: HTMLSelectElement\n\n\tprivate readonly selectId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t\tthis.selectId = createID('GovSelect')\n\t}\n\n\t@Element() host: HTMLGovFormSelectElement\n\t/**\n\t * Value of select\n\t */\n\t@Prop({reflect: true, mutable: true}) value: string\n\t/**\n\t * Options of select\n\t */\n\t@Prop({reflect: true, mutable: true}) options?: string | FormSelectOption[]\n\t/**\n\t * Custom select identifier.\n\t */\n\t@Prop({attribute: 'identifier'}) readonly identifier: string\n\t/**\n\t * Style variation of the form select.\n\t */\n\t@Prop() readonly variant?: FormSelectVariantType = 'secondary'\n\t/**\n\t * Select’s size.\n\t */\n\t@Prop() readonly size?: FormSelectSizesType = 'm'\n\t/**\n\t * Name of the select.\n\t */\n\t@Prop() readonly name: string\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 * Indicates the entered value of child form element does conform to the format expected by the application.\n\t */\n\t@Prop() readonly success: boolean\n\t/**\n\t * Makes the select component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\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 * Indicates the id of a related component’s visually focused element.\n\t */\n\t@Prop({attribute: 'wcag-active-descendant'}) readonly wcagActiveDescendant: string\n\t/**\n\t * Use this prop to add an aria-controls attribute. Use the attribute to indicate the id of a component controlled by this component.\n\t */\n\t@Prop({attribute: 'wcag-controls'}) readonly wcagControls: string\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({attribute: 'wcag-described-by'}) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({attribute: 'wcag-labelled-by'}) readonly wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({attribute: 'wcag-owns'}) readonly wcagOwns: string\n\t/**\n\t * Emitted when the select has focus.\n\t */\n\t@Event({eventName: 'gov-focus'}) govFocus: EventEmitter<FormSelectEvent>\n\t/**\n\t * Emitted when the select loses focus.\n\t */\n\t@Event({eventName: 'gov-blur'}) govBlur: EventEmitter<FormSelectEvent>\n\t/**\n\t * Emitted when the select change value.\n\t */\n\t@Event({eventName: 'gov-change'}) govChange: EventEmitter<FormSelectEvent>\n\t@State() focused: boolean\n\t@State() optionsState: FormSelectOption[] = []\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormSelectVariants, newValue, FormSelectClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormSelectSizes, newValue, FormSelectClass.root)\n\t}\n\n\t@Watch('options')\n\twatchOptions(newValue: string | FormSelectOption[]): void {\n\t\tthis.optionsState = propsValueToArray(newValue)\n\t}\n\n\t@Watch('disabled')\n\t@Watch('invalid')\n\t@Watch('success')\n\t@Watch('size')\n\twatchControlAttrs(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\t@Watch('value')\n\twatchValue(): void {\n\t\tthis.markSelectedValue()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl('size', this.size)\n\t\tthis.f.passAttrToControl('invalid', toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl('success', toBoolAttr(this.success))\n\t\tthis.f.passAttrToControl('disabled', toBoolAttr(this.disabled))\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\n\t\tthis.markSelectedValue()\n\t\tthis.passControlAttrs()\n\t\tthis.f.passAttrToLabel('required', String(this.required))\n\t\tthis.f.passAttrToControl('type', 'select')\n\t\tthis.optionsState = propsValueToArray(this.options)\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t\ttick(() => this.markSelectedValue())\n\t}\n\n\tprivate markSelectedValue() {\n\t\tthis.host.querySelectorAll('option').forEach((option: HTMLOptionElement) => {\n\t\t\tif (option.value === this.value) {\n\t\t\t\toption.setAttribute('selected', 'selected')\n\t\t\t} else {\n\t\t\t\toption.removeAttribute('selected')\n\t\t\t}\n\t\t})\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormSelectClass.root} size={this.size} variant={this.variant}>\n\t\t\t\t{this.h.hasSlot('prefix') && <slot name=\"prefix\"></slot>}\n\t\t\t\t<span class=\"element\">\n\t\t\t\t\t<gov-icon slot=\"right-icon\" name=\"chevron-down\" class=\"icon-arrow\"></gov-icon>\n\t\t\t\t\t{this.h.hasSlot('right-icon') && !(this.success || this.invalid) && <slot name=\"right-icon\"/>}\n\t\t\t\t\t{this.success && <gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"check-lg\"></gov-icon>}\n\t\t\t\t\t{this.invalid && <gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"exclamation-lg\"></gov-icon>}\n\t\t\t\t\t<select\n\t\t\t\t\t\tid={this.identifier || this.selectId}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonChange={this.onChangeHandler.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\tname={this.name}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\tref={el => (this.selectRef = el as HTMLSelectElement)}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\taria-activedescendant={this.wcagActiveDescendant}\n\t\t\t\t\t\taria-controls={this.wcagControls}\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-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\taria-owns={this.wcagOwns}\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t{Array.isArray(this.optionsState) && this.optionsState.map((option) => {\n\t\t\t\t\t\t\treturn (<option value={option.value} selected={option.value === this.value}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisabled={option?.disabled}>{option.label ?? option.value}</option>)\n\t\t\t\t\t\t})}\n\t\t\t\t\t</select>\n\t\t\t\t</span>\n\t\t\t\t{this.h.hasSlot('sufix') && <slot name=\"sufix\"></slot>}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\tthis.focused = true\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\tthis.focused = false\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.value = (e.target as HTMLSelectElement).value\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.selectRef.focus(options)\n\t}\n\n\t/**\n\t * Returns an instance of the native html select element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLSelectElement> {\n\t\treturn this.selectRef\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagActiveDescendant, 'wcag-active-descendant', FormSelectClass.root)\n\t\tvalidateWcagRef(this.wcagControls, 'wcag-controls', FormSelectClass.root)\n\t\tvalidateWcagRef(this.wcagDescribedBy, 'wcag-described-by', FormSelectClass.root)\n\t\tvalidateWcagRef(this.wcagOwns, 'wcag-owns', FormSelectClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.selectId, this.wcagLabelledBy, FormSelectClass.root)\n\t}\n}\n"],"mappings":"slBAAA,MAAMA,EAAmB,kxlBACzB,MAAAC,EAAeD,E,MCwBFE,EAAa,MAOzB,WAAAC,CAAAC,G,yMAsBmD,Y,UAIL,I,kCAST,M,qCASA,M,qNAsCO,GAjF3CC,KAAKC,EAAIC,EAAQF,KAAKG,MACtBH,KAAKI,EAAIC,EAAQL,KAAKC,GACtBD,KAAKM,SAAWC,EAAS,Y,CAkF1B,eAAAC,CAAgBC,GACfC,EAAaC,EAAoBF,EAAUG,EAAgBC,K,CAI5D,YAAAC,CAAaL,GACZC,EAAaK,EAAiBN,EAAUG,EAAgBC,K,CAIzD,YAAAG,CAAaP,GACZT,KAAKiB,aAAeC,EAAkBT,E,CAOvC,iBAAAU,GACCnB,KAAKoB,kB,CAIN,UAAAC,GACCrB,KAAKsB,mB,CAGE,gBAAAF,GACPpB,KAAKI,EAAEmB,kBAAkB,OAAQvB,KAAKwB,MACtCxB,KAAKI,EAAEmB,kBAAkB,UAAWE,EAAWzB,KAAK0B,UACpD1B,KAAKI,EAAEmB,kBAAkB,UAAWE,EAAWzB,KAAK2B,UACpD3B,KAAKI,EAAEmB,kBAAkB,WAAYE,EAAWzB,KAAK4B,U,CAGtD,iBAAAC,GACC7B,KAAKQ,gBAAgBR,KAAK8B,SAC1B9B,KAAKc,aAAad,KAAKwB,MAEvBxB,KAAKsB,oBACLtB,KAAKoB,mBACLpB,KAAKI,EAAE2B,gBAAgB,WAAYC,OAAOhC,KAAKiC,WAC/CjC,KAAKI,EAAEmB,kBAAkB,OAAQ,UACjCvB,KAAKiB,aAA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Ac,gBAAiBvD,EAAgBC,MACpE6E,EAAgB1F,KAAKoE,gBAAiB,oBAAqBxD,EAAgBC,MAC3E6E,EAAgB1F,KAAKsE,SAAU,YAAa1D,EAAgBC,MAC5D8E,EAAqB3F,KAAKsD,YAActD,KAAKM,SAAUN,KAAKqE,eAAgBzD,EAAgBC,K","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["govTabsCss","GovTabsStyle0","GovTabs","constructor","hostRef","this","triggerRefs","h","govHost","host","formSelectId","createID","validateType","newValue","validateProp","TabTypes","TabsClass","root","validateVariant","TabVariants","componentWillLoad","prepareControllers","componentDidRender","canValidateWcagOnRender","delay","validateWcag","skipDefault","controllers","promises","querySelectorAll","TabsItemClass","forEach","tab","controlItem","Promise","all","getIdentifier","getTriggerIdentifier","getDisableState","then","identifier","triggerIdentifier","disabled","isDefault","getAttribute","label","contentIdentifier","element","active","default","push","defaultTabIndex","findIndex","controller","focusIndex","hasOwnProperty","isWrongCombination","firstGoodTab","reRender","setActiveByIdentifier","temp","map","item","control","setActiveStatus","catch","render","Host","key","class","classes","variant","type","role","wcagLabel","wcagLabelledBy","onKeyDown","onKeydownHandler","bind","tabs","toBoolAttr","compactControls","list","btn","id","onClick","onSelectHandler","tabindex","ref","el","tag","focusable","inverse","hidden","accessibleSelectLabel","onChangeHandler","value","selected","getCurrentTab","find","index","t","govChange","emit","e","triggerId","target","stopPropagation","keyCode","goToPrevNext","includes","length","current","trigger","nodeName","toLowerCase","setFocus","focus","refresh","currentTab","setActiveTab","rerender","validateWcagProp","validateWcagLabel"],"sources":["../../../packages/core/src/components/gov-tabs/gov-tabs.scss?tag=gov-tabs","../../../packages/core/src/components/gov-tabs/gov-tabs.tsx"],"sourcesContent":["/*\n * Tabs\n */\n\n$class: \".gov-tabs\";\n\n#{$class} {\n\t@include base();\n\t&__list {\n\t\t@extend %reset-ul;\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tmargin: rem-calc(0 0 20);\n\t}\n\t&__list > &__item {\n\t\t@extend %reset-ul-li;\n\t\tdisplay: flex;\n\t\tmargin: 0;\n\t}\n\t&__btn {\n\t\t@include typography($font-size-s);\n\t\t@include button-core();\n\t\t@include focus-outline();\n\t\tmargin: 0;\n\t\tpadding: rem-calc(12 0 10);\n\t\tborder-bottom: rem-calc(2) solid transparent;\n\t\tfont-weight: 700;\n\t\ttext-align: center;\n\t\ttransition: $t linear color, $t linear border-color;\n\t\t&[disabled] {\n\t\t\tcursor: not-allowed;\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@each $type, $definitions in $tabs-types {\n\t\t&[type=\"#{$type}\"] {\n\t\t\t#{$class} {\n\t\t\t\t&__list {\n\t\t\t\t\tgap: get(\"item-spacing\", $definitions);\n\t\t\t\t\t@if deep-map-check($definitions, \"border\") {\n\t\t\t\t\t\tborder-bottom: $tabs-list-border;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t@each $variant, $definitions in $tabs-variants {\n\t\t&[variant=\"#{$variant}\"][type=\"text\"] {\n\t\t\t#{$class} {\n\t\t\t\t&__btn:not([disabled]) {\n\t\t\t\t\tcolor: get(\"color\", $definitions);\n\t\t\t\t\t@include hover() {\n\t\t\t\t\t\tcolor: get(\"color-hover\", $definitions);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// STATES\n\t\t\t\t&__btn[aria-selected=\"true\"] {\n\t\t\t\t\tborder-bottom-color: get(\"color-active\", $definitions);\n\t\t\t\t\tcolor: get(\"color-active\", $definitions);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t&[orientation=\"vertical\"] {\n\t\t#{$class}__btn {\n\t\t\ttext-align: left;\n\t\t}\n\t}\n\n\t// MQ\n\t@include mq($from: xl) {\n\t\t&[orientation=\"vertical\"] {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: row;\n\n\t\t\t#{$class}__list {\n\t\t\t\tflex-wrap: nowrap;\n\t\t\t\tflex-direction: column;\n\t\t\t\twidth: max-content;\n\t\t\t\tmax-width: 30vw;\n\t\t\t\tmargin-right: rem-calc(20);\n\t\t\t\tpadding: rem-calc(0 8);\n\t\t\t\tborder-bottom: none;\n\t\t\t\tborder-right: $tabs-list-border;\n\t\t\t}\n\n\t\t\t#{$class}__item {\n\t\t\t\tjustify-content: flex-end;\n\t\t\t}\n\n\t\t\t#{$class}__btn {\n\t\t\t\tpadding: rem-calc(8 12);\n\t\t\t\ttext-align: right;\n\t\t\t}\n\t\t}\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\n\nimport {govHost, toBoolAttr} from \"../../helpers/Dom/template\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {canValidateWcagOnRender} from \"../../helpers/Dom/win\"\nimport {validateProp} from \"../../helpers/Validate/props\"\nimport {validateWcagLabel, validateWcagProp} from \"../../helpers/Validate/wcag\"\nimport {Nullable} from \"../../types/interfaces\"\nimport {createID} from \"../../utils/string.utils\"\nimport {delay} from \"../../utils/utils\"\nimport {TabOrientationType, TabsClass, TabsItemClass, TabType, TabTypes, TabVariants, VariantType} from \"./constants\"\nimport {GovTabControllerItem} from \"./gov-tabs.types\"\nimport {hasOwnProperty} from \"../../utils/helpers.types\";\n\n@Component({\n\ttag: \"gov-tabs\",\n\tstyleUrl: \"gov-tabs.scss\",\n})\nexport class GovTabs {\n\tprivate h: GovHost\n\tprivate triggerRefs: Record<string, HTMLButtonElement | HTMLGovChipElement> = {}\n\n\tprivate readonly formSelectId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.formSelectId = createID(\"GovFormSelect\")\n\t}\n\n\t@Element() host: HTMLGovTabsElement\n\t@State() controllers: GovTabControllerItem[] = []\n\t@State() focusIndex = 0\n\t@State() compactControls = false\n\t/**\n\t * Tabs type\n\t */\n\t@Prop() readonly type: TabType = \"text\"\n\t/**\n\t * Style variation of the tab chips.\n\t */\n\t@Prop() readonly variant?: VariantType = \"primary\"\n\t/**\n\t * Tabs orientation\n\t */\n\t@Prop() readonly orientation: TabOrientationType = \"horizontal\"\n\t/**\n\t * Adds accessible label for the tabs that is only shown for screen readers.\n\t */\n\t@Prop({attribute: \"wcag-label\"}) readonly wcagLabel: string\n\t/**\n\t * Adds accessible label for the tabs select\n\t */\n\t@Prop({attribute: \"wcag-select-label\"}) readonly accessibleSelectLabel: string\n\t/**\n\t * Indicates the id of a component that labels the tabs.\n\t */\n\t@Prop({attribute: \"wcag-labelled-by\"}) readonly wcagLabelledBy: string\n\t/**\n\t * Emitted when the tab is changed.\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<HTMLGovTabsItemElement>\n\n\t@Watch(\"type\")\n\tvalidateType(newValue: string): void {\n\t\tvalidateProp(TabTypes, newValue, TabsClass.root)\n\t}\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(TabVariants, newValue, TabsClass.root)\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.prepareControllers()\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\tprivate prepareControllers(skipDefault = false): void {\n\t\tthis.controllers = []\n\t\tconst promises: Promise<GovTabControllerItem>[] = []\n\t\tthis.host.querySelectorAll(TabsItemClass.root).forEach((tab: HTMLGovTabsItemElement) => {\n\t\t\tconst controlItem = Promise.all([\n\t\t\t\ttab.getIdentifier(),\n\t\t\t\ttab.getTriggerIdentifier(),\n\t\t\t\ttab.getDisableState()\n\t\t\t]).then(([identifier, triggerIdentifier, disabled]) => {\n\t\t\t\tconst isDefault = typeof tab.getAttribute(\"default\") === \"string\"\n\t\t\t\treturn {\n\t\t\t\t\tlabel: tab.getAttribute(\"label\"),\n\t\t\t\t\tcontentIdentifier: identifier,\n\t\t\t\t\tdisabled: disabled,\n\t\t\t\t\ttriggerIdentifier: triggerIdentifier,\n\t\t\t\t\telement: tab,\n\t\t\t\t\tactive: false,\n\t\t\t\t\tdefault: isDefault,\n\t\t\t\t}\n\t\t\t})\n\t\t\tpromises.push(controlItem)\n\t\t});\n\t\tPromise.all(promises).then(controllers => {\n\t\t\tif (skipDefault === false) {\n\t\t\t\tlet defaultTabIndex = controllers.findIndex(controller => controller.default)\n\t\t\t\tif (defaultTabIndex === -1) defaultTabIndex = 0\n\t\t\t\tthis.focusIndex = defaultTabIndex\n\t\t\t\tcontrollers[defaultTabIndex].active = true\n\t\t\t} else if (this.focusIndex > -1 && hasOwnProperty(controllers, this.focusIndex)) {\n\t\t\t\tcontrollers[this.focusIndex].active = true\n\t\t\t}\n\t\t\tconst isWrongCombination = controllers.findIndex((controller) => controller.active && controller.disabled)\n\t\t\tif (isWrongCombination > -1) {\n\t\t\t\tcontrollers[isWrongCombination].active = false;\n\t\t\t\tconst firstGoodTab = controllers.findIndex((controller) => !controller.disabled)\n\t\t\t\tif (firstGoodTab > -1) {\n\t\t\t\t\tcontrollers[firstGoodTab].active = true\n\t\t\t\t\tthis.focusIndex = firstGoodTab;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.controllers = [...controllers]\n\t\t\tthis.reRender()\n\t\t})\n\t}\n\n\tprivate setActiveByIdentifier(identifier: string) {\n\t\tconst temp = []\n\t\tthis.controllers.map(item => {\n\t\t\titem.active = identifier === item.triggerIdentifier || identifier === item.contentIdentifier\n\t\t\ttemp.push(item)\n\t\t})\n\t\tthis.controllers = [...temp]\n\t}\n\n\tprivate reRender() {\n\t\tthis.controllers.map(control => {\n\t\t\tcontrol.element.setActiveStatus(control.active).catch()\n\t\t})\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={this.h.classes(TabsClass.root)}\n\t\t\t\tvariant={this.variant}\n\t\t\t\ttype={this.type}\n\t\t\t\trole=\"tablist\"\n\t\t\t\taria-label={this.wcagLabel}\n\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\tonKeyDown={this.onKeydownHandler.bind(this)}\n\t\t\t>\n\t\t\t\t<div class={TabsClass.tabs} aria-hidden={toBoolAttr(this.compactControls)}>\n\t\t\t\t\t<ul class={TabsClass.list}>\n\t\t\t\t\t\t{this.controllers.map(control => (\n\t\t\t\t\t\t\t<li class={TabsClass.item}>\n\t\t\t\t\t\t\t\t{this.type == \"text\" ? (\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\tclass={TabsClass.btn}\n\t\t\t\t\t\t\t\t\t\tid={control.triggerIdentifier}\n\t\t\t\t\t\t\t\t\t\trole=\"tab\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => this.onSelectHandler(control)}\n\t\t\t\t\t\t\t\t\t\tdisabled={control.disabled}\n\t\t\t\t\t\t\t\t\t\taria-disabled={toBoolAttr(control.disabled)}\n\t\t\t\t\t\t\t\t\t\taria-selected={toBoolAttr(control.active)}\n\t\t\t\t\t\t\t\t\t\taria-controls={control.contentIdentifier}\n\t\t\t\t\t\t\t\t\t\ttabindex={control.active && !control.disabled ? 0 : -1}\n\t\t\t\t\t\t\t\t\t\tref={el => (this.triggerRefs[control.triggerIdentifier] = el as HTMLButtonElement)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{control.label}\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<gov-chip\n\t\t\t\t\t\t\t\t\t\trole=\"tab\"\n\t\t\t\t\t\t\t\t\t\ttag={'button'}\n\t\t\t\t\t\t\t\t\t\tidentifier={control.triggerIdentifier}\n\t\t\t\t\t\t\t\t\t\twcag-selected={control.active}\n\t\t\t\t\t\t\t\t\t\twcag-controls={control.contentIdentifier}\n\t\t\t\t\t\t\t\t\t\tfocusable={control.active}\n\t\t\t\t\t\t\t\t\t\tdisabled={control.disabled}\n\t\t\t\t\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\t\t\t\t\tinverse={!control.active}\n\t\t\t\t\t\t\t\t\t\tref={el => (this.triggerRefs[control.triggerIdentifier] = el as HTMLGovChipElement)}\n\t\t\t\t\t\t\t\t\t\ton-gov-click={() => this.onSelectHandler(control)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{control.label}\n\t\t\t\t\t\t\t\t\t</gov-chip>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\n\t\t\t\t<span id={this.formSelectId} hidden>\n\t\t\t\t\t{this.accessibleSelectLabel}\n\t\t\t\t</span>\n\t\t\t\t{this.compactControls ? (\n\t\t\t\t\t<gov-form-select wcag-labelled-by={this.formSelectId} onGov-change={this.onChangeHandler.bind(this)}>\n\t\t\t\t\t\t{this.controllers.map(control => (\n\t\t\t\t\t\t\t<option value={control.triggerIdentifier} selected={control.active}>\n\t\t\t\t\t\t\t\t{control.label}\n\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</gov-form-select>\n\t\t\t\t) : null}\n\n\t\t\t\t<slot></slot>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate getCurrentTab(): GovTabControllerItem | null {\n\t\treturn this.controllers.find(control => control.active) || null\n\t}\n\n\tprivate onSelectHandler(control: GovTabControllerItem) {\n\t\tconst index = this.controllers.findIndex(t => t.triggerIdentifier === control.triggerIdentifier);\n\t\tthis.focusIndex = index\n\t\tthis.setActiveByIdentifier(control.triggerIdentifier)\n\t\tthis.reRender()\n\t\tthis.govChange.emit(this.getCurrentTab().element)\n\t}\n\n\tprivate onChangeHandler(e: CustomEvent) {\n\t\tconst triggerId = (e.target as HTMLSelectElement).value\n\t\te.stopPropagation()\n\t\tthis.setActiveByIdentifier(triggerId)\n\t\tthis.reRender()\n\t\tthis.govChange.emit(this.getCurrentTab().element)\n\t}\n\n\tprivate onKeydownHandler(e: KeyboardEvent) {\n\t\tconst keyCode = e.keyCode\n\n\t\te.stopPropagation()\n\t\tthis.goToPrevNext(keyCode)\n\t}\n\n\tprivate goToPrevNext(keyCode: number) {\n\t\tif ([37, 38, 39, 40].includes(keyCode)) {\n\t\t\tif (false === (this.focusIndex >= 0 && this.focusIndex <= this.controllers.length - 1)) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.controllers[this.focusIndex].active = false\n\n\t\t\tif (keyCode === 39 || keyCode === 40) {\n\t\t\t\tthis.focusIndex++\n\t\t\t\tif (this.focusIndex >= this.controllers.length) {\n\t\t\t\t\tthis.focusIndex = 0\n\t\t\t\t}\n\t\t\t\tif (this.controllers[this.focusIndex].disabled) {\n\t\t\t\t\tthis.goToPrevNext(40)\n\t\t\t\t}\n\t\t\t} else if (keyCode === 37 || keyCode === 38) {\n\t\t\t\tthis.focusIndex--\n\t\t\t\tif (this.focusIndex < 0) {\n\t\t\t\t\tthis.focusIndex = this.controllers.length - 1\n\t\t\t\t}\n\t\t\t\tif (this.controllers[this.focusIndex].disabled) {\n\t\t\t\t\tthis.goToPrevNext(38)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.focusIndex >= 0 && this.focusIndex <= this.controllers.length - 1) {\n\t\t\t\tconst current = this.controllers[this.focusIndex]\n\t\t\t\tcurrent.active = true\n\t\t\t\tconst trigger = this.triggerRefs[current.triggerIdentifier]\n\t\t\t\tif (trigger.nodeName.toLowerCase() === 'gov-chip') {\n\t\t\t\t\t(this.triggerRefs[current.triggerIdentifier] as HTMLGovChipElement).setFocus()\n\t\t\t\t} else {\n\t\t\t\t\tthis.triggerRefs[current.triggerIdentifier].focus()\n\t\t\t\t}\n\n\t\t\t\tthis.controllers = [...this.controllers]\n\t\t\t\tthis.reRender()\n\t\t\t\tthis.govChange.emit(this.getCurrentTab().element)\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Regenerate tabs controllers\n\t */\n\t@Method()\n\tasync refresh(): Promise<void> {\n\t\tthis.prepareControllers()\n\t}\n\n\t/**\n\t * Returns the currently selected tabs-item\n\t */\n\t@Method()\n\tasync currentTab(): Promise<Nullable<HTMLGovTabsItemElement>> {\n\t\treturn this.getCurrentTab().element || null\n\t}\n\n\t/**\n\t * Regenerate tabs controllers\n\t */\n\t@Method()\n\tasync setActiveTab(identifier: string): Promise<void> {\n\t\tthis.setActiveByIdentifier(identifier)\n\t\tthis.reRender()\n\t}\n\n\t/**\n\t * Regenerate tabs controllers\n\t */\n\t@Method()\n\tasync rerender(): Promise<void> {\n\t\tthis.prepareControllers(true);\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagProp(this.accessibleSelectLabel, \"wcag-select-label\", TabsClass.root)\n\t\tvalidateWcagLabel(this.wcagLabel, this.wcagLabelledBy, TabsClass.root)\n\t}\n}\n"],"mappings":"8aAAA,MAAMA,EAAa,wgKACnB,MAAAC,EAAeD,E,MCiBFE,EAAO,MAMnB,WAAAC,CAAAC,G,gDAJQC,KAAAC,YAAsE,G,iBAU/B,G,gBACzB,E,qBACK,M,UAIM,O,aAIQ,U,iBAIU,a,sFAnBlDD,KAAKE,EAAIC,EAAQH,KAAKI,MACtBJ,KAAKK,aAAeC,EAAS,gB,CAqC9B,YAAAC,CAAaC,GACZC,EAAaC,EAAUF,EAAUG,EAAUC,K,CAI5C,eAAAC,CAAgBL,GACfC,EAAaK,EAAaN,EAAUG,EAAUC,K,CAG/C,iBAAAG,GACCf,KAAKgB,oB,CAGN,wBAAMC,GACL,GAAIC,IAA2B,OACxBC,EAAM,WACNnB,KAAKoB,c,EAIL,kBAAAJ,CAAmBK,EAAc,OACxCrB,KAAKsB,YAAc,GACnB,MAAMC,EAA4C,GAClDvB,KAAKI,KAAKoB,iBAAiBC,EAAcb,MAAMc,SAASC,IACvD,MAAMC,EAAcC,QAAQC,IAAI,CAC/BH,EAAII,gBACJJ,EAAIK,uBACJL,EAAIM,oBACFC,MAAK,EAAEC,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,GAAID,IAAY,IAAMA,IAAY,GAAI,CAC5CvG,KAAKiD,aACL,GAAIjD,KAAKiD,WAAa,EAAG,CACxBjD,KAAKiD,WAAajD,KAAKsB,YAAYoF,OAAS,C,CAE7C,GAAI1G,KAAKsB,YAAYtB,KAAKiD,YAAYZ,SAAU,CAC/CrC,KAAKwG,aAAa,G,EAIpB,GAAIxG,KAAKiD,YAAc,GAAKjD,KAAKiD,YAAcjD,KAAKsB,YAAYoF,OAAS,EAAG,CAC3E,MAAMC,EAAU3G,KAAKsB,YAAYtB,KAAKiD,YACtC0D,EAAQhE,OAAS,KACjB,MAAMiE,EAAU5G,KAAKC,YAAY0G,EAAQvE,mBACzC,GAAIwE,EAAQC,SAASC,gBAAkB,WAAY,CACjD9G,KAAKC,YAAY0G,EAAQvE,mBAA0C2E,U,KAC9D,CACN/G,KAAKC,YAAY0G,EAAQvE,mBAAmB4E,O,CAG7ChH,KAAKsB,YAAc,IAAItB,KAAKsB,aAC5BtB,KAAKqD,WACLrD,KAAKiG,UAAUC,KAAKlG,KAAK6F,gBAAgBnD,Q,GAS5C,aAAMuE,GACLjH,KAAKgB,oB,CAON,gBAAMkG,GACL,OAAOlH,KAAK6F,gBAAgBnD,SAAW,I,CAOxC,kBAAMyE,CAAahF,GAClBnC,KAAKsD,sBAAsBnB,GAC3BnC,KAAKqD,U,CAON,cAAM+D,GACLpH,KAAKgB,mBAAmB,K,CAOzB,kBAAMI,GACLiG,EAAiBrH,KAAKyF,gBAAiB,oBAAqB9E,EAAUC,MACtE0G,EAAkBtH,KAAKqE,UAAWrE,KAAKsE,eAAgB3D,EAAUC,K","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import{g as e}from"./p-e296ca83.js";import{s as t}from"./p-95d41a3b.js";import{d as r}from"./p-e618f1cb.js";const n=(t,r,n)=>{if(t===undefined||String(t).length===0){e(`[${n}]: The (${r}) attribute is important for correct accessibility.`)}};const i=(n,i,a)=>{if(typeof n==="undefined"||n===undefined){return true}if(String(n).length===0){e(`[${a}]: Attribute (${i}) is defined with an empty value.`);return false}let s=[];const f=t(n);if(Array.isArray(f)){s=f.filter((function(e){return e.trim().length>0}))}return!!s.filter((e=>{if(r().getElementById(e)===null){return false}else{return true}})).length};const a=(t,n,i)=>{const a=r().querySelector(`[for=${t}]`);if(a===null){const t=r().getElementById(n);if(t===null){e(`[${i}]: The form element has no defined wcag-label or wcag-labelled-by attribute.`);return false}}return true};const s=(t,n,i)=>{if(typeof t==="string"&&t.length>0){return true}if(typeof n==="string"&&n.length>0){const e=r().getElementById(n);if(e){return true}}e(`[${i}]: The element has no defined wcag-label or wcag-labelled-by attribute.`);return false};export{i as a,a as b,n as c,s as v};
2
- //# sourceMappingURL=p-92b7481f.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["BreadcrumbsClass","root","govBreadcrumbsCss","GovBreadcrumbsStyle0","GovBreadcrumbs","constructor","hostRef","this","inited","h","govHost","host","componentDidRender","scheduleContentVerification","canValidateWcagOnRender","delay","validateWcag","requestAnimationFrame","calculateWidthOfItems","hostWidth","getBoundingClientRect","width","sumOfWidths","querySelectorAll","forEach","li","toggleOption","render","Host","key","class","classes","collapsed","wcagLabel","wcagLabelledBy","size","variant","type","accessibleToggleLabel","wcagPressed","wcagExpanded","name","validateWcagLabel","undefined"],"sources":["../../../packages/core/src/components/gov-breadcrumbs/constants.ts","../../../packages/core/src/components/gov-breadcrumbs/gov-breadcrumbs.scss?tag=gov-breadcrumbs","../../../packages/core/src/components/gov-breadcrumbs/gov-breadcrumbs.tsx"],"sourcesContent":["export const BreadcrumbsClass = {\n\troot: 'gov-breadcrumbs',\n}\n","/*\n * Pagination\n */\n\n$class: \".gov-breadcrumbs\";\n\n#{$class} {\n\t@include base(flex);\n\tjustify-content: space-between;\n\talign-items: flex-start;\n\tgap: $breadcrumbs-gap;\n\n\tnav {\n\t\toverflow: hidden;\n\t\twidth: 100%;\n\t}\n\tul {\n\t\t@extend %reset-ul;\n\t\t@include base(flex);\n\t\tflex-direction: column;\n\t\tgap: 8px;\n\t\tmargin-bottom: 0;\n\t}\n\tli {\n\t\t@extend %reset-ul-li;\n\t\tdisplay: flex;\n\t\tjustify-content: flex-start;\n\t\talign-items: flex-start;\n\t\tmargin-bottom: 0 !important;\n\t\t.gov-icon {\n\t\t\tflex: 0 0 auto;\n\t\t\twidth: $breadcrumbs-icon-size;\n\t\t\theight: $breadcrumbs-icon-size;\n\t\t\tmargin: calc((24px - $breadcrumbs-icon-size) / 2) $breadcrumbs-gap 0;\n\t\t\tcolor: $breadcrumbs-arrow-color;\n\t\t}\n\t\t> a:first-child,\n\t\t> button:first-child {\n\t\t\tmargin-left: calc($breadcrumbs-icon-size + (2 * $breadcrumbs-gap));\n\t\t}\n\t}\n\ta {\n\t\t@include typography-component($font-size-m);\n\t\tcolor: $breadcrumbs-link-color;\n\t}\n\tbutton {\n\t\t@include typography-component($font-size-m);\n\t\tcolor: $breadcrumbs-link-color;\n\t\tpadding: 0;\n\t\tborder: none;\n\t\tbackground: none;\n\t\ttext-decoration: underline;\n\t}\n\n\t@include parameter(\"collapsed\") {\n\t\talign-items: center;\n\t\tul {\n\t\t\toverflow-x: hidden;\n\t\t\tflex-direction: row;\n\t\t}\n\t\tli {\n\t\t\talign-items: center;\n\t\t\twhite-space: nowrap;\n\t\t\t.gov-icon {\n\t\t\t\tmargin-top: 0;\n\t\t\t}\n\t\t}\n\t\tli > a:first-child,\n\t\tli > button:first-child {\n\t\t\tmargin-left: 0;\n\t\t}\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State} from '@stencil/core'\nimport {BreadcrumbsClass} from './constants'\nimport {validateWcagLabel} from '../../helpers/Validate/wcag'\nimport {canValidateWcagOnRender} from '../../helpers/Dom/win'\nimport {delay} from '../../utils/utils'\nimport {GovBreadcrumbsChangeEvent} from './gov-breadcrumbs.d'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-breadcrumbs',\n\tstyleUrl: 'gov-breadcrumbs.scss',\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: 'wcag-label'}) readonly wcagLabel: string\n\t/**\n\t * Indicates the id of a component that labels the pagination.\n\t */\n\t@Prop({attribute: 'wcag-labeled-by'}) readonly wcagLabelledBy: 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: 'wcag-toggle-label'}) readonly accessibleToggleLabel: string = 'Zobrazit či skrýt navigaci'\n\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() collapsed = true;\n\t@State() toggleOption = false;\n\n\tasync componentDidRender() {\n\t\tthis.scheduleContentVerification()\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\tprivate scheduleContentVerification() {\n\t\tif (this.inited) return;\n\t\tthis.inited = true;\n\t\trequestAnimationFrame(() => {\n\t\t\tthis.calculateWidthOfItems();\n\t\t\tthis.inited = false;\n\t\t});\n\t}\n\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)} collapsed={this.collapsed}>\n\t\t\t\t<nav aria-label={this.wcagLabel} aria-labelledby={this.wcagLabelledBy}>\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\tvariant={'primary'}\n\t\t\t\t\t\ttype={'base'}\n\t\t\t\t\t\twcagLabel={this.accessibleToggleLabel}\n\t\t\t\t\t\twcagPressed={!this.collapsed}\n\t\t\t\t\t\twcagExpanded={!this.collapsed}\n\t\t\t\t\t\ton-gov-click={() => this.collapsed = !this.collapsed}\n\t\t\t\t\t>\n\t\t\t\t\t\t<gov-icon name={this.collapsed ? 'chevron-down' : 'chevron-up'}></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 validateWcag(): Promise<void> {\n\t\tvalidateWcagLabel(this.wcagLabel, this.wcagLabelledBy, BreadcrumbsClass.root)\n\t\tvalidateWcagLabel(this.accessibleToggleLabel, undefined, BreadcrumbsClass.root)\n\t}\n}\n"],"mappings":"2PAAO,MAAMA,EAAmB,CAC/BC,KAAM,mBCDP,MAAMC,EAAoB,4+FAC1B,MAAAC,EAAeD,E,MCYFE,EAAc,MAI1B,WAAAC,CAAAC,G,gDAHQC,KAAAC,OAAS,M,iBAWuB,M,gBAIyB,M,4EAYU,6B,eAOtD,K,kBACG,MA/BvBD,KAAKE,EAAIC,EAAQH,KAAKI,K,CAiCvB,wBAAMC,GACLL,KAAKM,8BACL,GAAIC,IAA2B,OACxBC,EAAM,WACNR,KAAKS,c,EAIL,2BAAAH,GACP,GAAIN,KAAKC,OAAQ,OACjBD,KAAKC,OAAS,KACdS,uBAAsB,KACrBV,KAAKW,wBACLX,KAAKC,OAAS,KAAK,G,CAKb,qBAAAU,GACP,MAAMC,EAAYZ,KAAKI,KAAKS,wBAAwBC,MACpD,IAAIC,EAAc,EAClBf,KAAKI,KAAKY,iBAAiB,MAAMC,SAASC,IACzCH,GAAeG,EAAGL,wBAAwBC,KAAK,IAEhDd,KAAKmB,aAAeJ,EAAcH,C,CAGnC,MAAAQ,GACC,OACClB,EAACmB,EAAI,CAAAC,IAAA,2CAACC,MAAOvB,KAAKE,EAAEsB,QAAQ/B,EAAiBC,MAAO+B,UAAWzB,KAAKyB,WACnEvB,EAAA,OAAAoB,IAAA,wDAAiBtB,KAAK0B,UAAS,kBAAmB1B,KAAK2B,gBACtDzB,EAAA,QAAAoB,IAAA,8CAEAtB,KAAKmB,aACLjB,EAAA,cACC0B,KAAM,KACNC,QAAS,UACTC,KAAM,OACNJ,UAAW1B,KAAK+B,gBAChBC,aAAchC,KAAKyB,UACnBQ,cAAejC,KAAKyB,UAAS,eACf,IAAMzB,KAAKyB,WAAazB,KAAKyB,WAE3CvB,EAAA,YAAUgC,KAAMlC,KAAKyB,UAAY,eAAiB,gBAEhD,K,CAUP,kBAAMhB,GACL0B,EAAkBnC,KAAK0B,UAAW1B,KAAK2B,eAAgBlC,EAAiBC,MACxEyC,EAAkBnC,KAAK+B,gBAAiBK,UAAW3C,EAAiBC,K","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["chr4","Math","random","toString","slice","createID","prefix","removeDiacritics","string","normalize","replace","splitByWhitespace","split"],"sources":["../../../packages/core/src/utils/string.utils.ts"],"sourcesContent":["function chr4(): string {\n\treturn Math.random().toString(16).slice(-4)\n}\n\nexport function createID(prefix: string): string {\n\treturn `${prefix}-${chr4()}${chr4()}-${chr4()}-${chr4()}-${chr4()}-${chr4()}${chr4()}${chr4()}`\n}\n\nexport function removeDiacritics(string: any): string | any {\n\tif (typeof string !== 'string') return string\n\treturn string.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '')\n}\n\nexport function splitByWhitespace(string: any): string | any {\n\tif (typeof string !== 'string') return string\n\treturn string.split(/(\\s+)/)\n}\n"],"mappings":"AAAA,SAASA,IACR,OAAOC,KAAKC,SAASC,SAAS,IAAIC,OAAO,EAC1C,C,SAEgBC,EAASC,GACxB,MAAO,GAAGA,KAAUN,MAASA,OAAUA,OAAUA,OAAUA,OAAUA,MAASA,MAASA,KACxF,C,SAEgBO,EAAiBC,GAChC,UAAWA,IAAW,SAAU,OAAOA,EACvC,OAAOA,EAAOC,UAAU,OAAOC,QAAQ,mBAAoB,GAC5D,C,SAEgBC,EAAkBH,GACjC,UAAWA,IAAW,SAAU,OAAOA,EACvC,OAAOA,EAAOI,MAAM,QACrB,Q","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["govFormCheckboxCss","GovFormCheckboxStyle0","GovFormCheckbox","constructor","hostRef","this","hydrated","checkboxId","createID","h","govHost","host","f","govForm","validateSize","newValue","validateProp","FormCheckboxSizes","FormCheckboxClass","root","watchControlAttrs","passControlAttrs","passAttrToControl","size","toBoolAttr","disabled","invalid","componentWillLoad","componentDidRender","passAttrToLabel","identifier","String","required","canValidateWcagOnRender","delay","validateWcag","connectedCallback","render","wrapCheckbox","children","noLabel","class","label","Host","checked","toBoolAttrIfDefined","Fragment","id","type","value","name","onClick","onClickHandler","bind","onChange","onChangeHandler","onFocus","onFocusHandler","onBlur","onBlurHandler","ref","el","inputRef","wcagDescribedBy","wcagLabelledBy","check","e","stopPropagation","govFocus","emit","component","originalEvent","govBlur","target","govChange","getRef","validateWcagRef","validateWcagLabelFor"],"sources":["../../../packages/core/src/components/gov-form/checkbox/gov-form-checkbox.scss?tag=gov-form-checkbox","../../../packages/core/src/components/gov-form/checkbox/gov-form-checkbox.tsx"],"sourcesContent":["/*\n * Checkbox\n */\n\n@import \"../checkbox/gov-form-checkbox-core.scss\";\n\n$class: \".gov-form-checkbox\";\n\n#{$class} {\n @extend %form-checkbox-core;\n\n input + span {\n &::before {\n border-radius: $border-radius;\n }\n }\n\n &__check {\n position: absolute;\n color: $form-checkbox-check-color;\n opacity: 0;\n transition: $t linear opacity;\n }\n\n &__label {\n position: relative;\n }\n\n // STATES\n input:checked + span::before {\n background: $form-checkbox-indicator-bg;\n }\n\n input:checked + span &__check {\n opacity: 1;\n }\n\n @include parameter(\"invalid\") {\n input:checked + span::before {\n background: $form-state-color-error;\n }\n }\n @include parameter(\"disabled\") {\n input:checked + span::before {\n border-color: $form-state-bg-disabled;\n background-color: $form-state-bg-disabled;\n }\n }\n\n // VARIANTS\n @each $size, $definitions in $form-checkbox-core-sizes {\n &[size=\"#{$size}\"] {\n #{$class} {\n &__check {\n top: calc((get(\"indicator-size\", $definitions) - get(\"check-size\", $definitions)) / 2);\n left: calc((get(\"indicator-size\", $definitions) - get(\"check-size\", $definitions)) / 2);\n width: get(\"check-size\", $definitions);\n height: get(\"check-size\", $definitions);\n }\n }\n }\n }\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch} from \"@stencil/core\"\nimport {createID} from \"../../../utils/string.utils\"\nimport {validateProp} from \"../../../helpers/Validate/props\"\nimport {FormCheckboxClass, FormCheckboxSizes, FormCheckboxSizesType} from \"./constants\"\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from \"../../../helpers/Dom/template\"\nimport {validateWcagLabelFor, validateWcagRef} from \"../../../helpers/Validate/wcag\"\nimport {canValidateWcagOnRender} from \"../../../helpers/Dom/win\"\nimport {delay} from \"../../../utils/utils\"\nimport {GovForm} from \"../../../helpers/Dom/form.types\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {govForm} from \"../../../helpers/Dom/form\"\nimport Fragment from \"../../../helpers/Fragment\"\nimport {FormCheckboxEvent} from \"./gov-form-checkbox.types\"\n\n@Component({\n\ttag: \"gov-form-checkbox\",\n\tstyleUrl: \"gov-form-checkbox.scss\",\n})\nexport class GovFormCheckbox {\n\tprivate readonly h: GovHost\n\tprivate f: GovForm\n\tprivate inputRef?: HTMLInputElement\n\n\tprivate readonly checkboxId: string\n\tprivate hydrated = false\n\n\tconstructor() {\n\t\tthis.checkboxId = createID(\"GovCheckbox\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormCheckboxElement\n\t/**\n\t * Value of checkbox\n\t */\n\t@Prop() readonly value: string\n\t/**\n\t * Checkbox button state\n\t */\n\t@Prop({reflect: true, mutable: true}) checked = 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 checkbox component disabled.\n\t * This prevents users from being able to interact with the checkbox, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Name of the checkbox.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Checkboxes size.\n\t */\n\t@Prop() readonly size?: FormCheckboxSizesType = \"m\"\n\t/**\n\t * Custom checkbox identifier.\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * When you can't use the form label.\n\t */\n\t@Prop({attribute: \"no-label\"}) readonly noLabel: boolean = false\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 * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({attribute: \"wcag-described-by\"}) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({attribute: \"wcag-labelled-by\"}) readonly wcagLabelledBy: string\n\t/**\n\t * Emitted when the checkbox has focus.\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<FormCheckboxEvent>\n\t/**\n\t * Emitted when the checkbox loses focus.\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<FormCheckboxEvent>\n\t/**\n\t * Emitted when the checkbox change value.\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<FormCheckboxEvent>\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormCheckboxSizes, newValue, FormCheckboxClass.root)\n\t}\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\t@Watch(\"size\")\n\twatchControlAttrs(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"size\", this.size)\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.f.passAttrToControl(\"type\", \"checkbox\")\n\t\tthis.passControlAttrs()\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.f.passAttrToLabel(\"identifier\", this.identifier || this.checkboxId)\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\tconnectedCallback() {\n\t\tthis.hydrated = true\n\t}\n\n\trender() {\n\t\tconst wrapCheckbox = (children) => {\n\t\t\tif (this.noLabel) {\n\t\t\t\treturn (\n\t\t\t\t\t<label class={FormCheckboxClass.label}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</label>\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn children\n\t\t}\n\n\t\treturn (\n\t\t\t<Host class={FormCheckboxClass.root} hydrated={this.hydrated} checked={this.checked} size={this.size}\n\t\t\t\t\t\tinvalid={toBoolAttrIfDefined(this.invalid)}>\n\t\t\t\t{wrapCheckbox(\n\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tid={this.identifier || this.checkboxId}\n\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\tchecked={this.checked}\n\t\t\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\t\taria-checked={toBoolAttr(this.checked)}\n\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t<slot name=\"label\"/>\n\t\t\t\t\t\t\t<gov-icon class={FormCheckboxClass.check} name=\"check-lg\"></gov-icon>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</Fragment>,\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormCheckboxClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\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: FormCheckboxClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onClickHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.checked = (e.target as HTMLInputElement).checked\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormCheckboxClass.root,\n\t\t\tvalue: this.value,\n\t\t\tchecked: this.checked,\n\t\t\toriginalEvent: e,\n\t\t})\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 * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, \"wcag-described-by\", FormCheckboxClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, \"wcag-labelled-by\", FormCheckboxClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.checkboxId, this.wcagLabelledBy, FormCheckboxClass.root)\n\t}\n}\n"],"mappings":"ygBAAA,MAAMA,EAAqB,49PAC3B,MAAAC,EAAeD,E,MCiBFE,EAAe,MAQ3B,WAAAC,CAAAC,G,sHAFQC,KAAAC,SAAW,M,kCAiB6B,M,cAKX,M,cAKA,M,8BAQW,I,uCAQW,M,oFAxC1DD,KAAKE,WAAaC,EAAS,eAE3BH,KAAKI,EAAIC,EAAQL,KAAKM,MACtBN,KAAKO,EAAIC,EAAQR,KAAKI,E,CAgEvB,YAAAK,CAAaC,GACZC,EAAaC,EAAmBF,EAAUG,EAAkBC,K,CAM7D,iBAAAC,GACCf,KAAKgB,kB,CAGE,gBAAAA,GACPhB,KAAKO,EAAEU,kBAAkB,OAAQjB,KAAKkB,MACtClB,KAAKO,EAAEU,kBAAkB,WAAYE,EAAWnB,KAAKoB,WACrDpB,KAAKO,EAAEU,kBAAkB,UAAWE,EAAWnB,KAAKqB,S,CAGrD,iBAAAC,GACCtB,KAAKO,EAAEU,kBAAkB,OAAQ,YACjCjB,KAAKgB,kB,CAGN,wBAAMO,GACLvB,KAAKO,EAAEiB,gBA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C,KAAK,CAClBC,UAAWpD,EAAkBC,KAC7B8B,MAAO5C,KAAK4C,MACZL,QAASvC,KAAKuC,QACd2B,cAAeL,G,CAIT,aAAAP,CAAcO,GACrBA,EAAEC,kBACF9D,KAAKmE,QAAQH,KAAK,CACjBC,UAAWpD,EAAkBC,KAC7B8B,MAAO5C,KAAK4C,MACZL,QAASvC,KAAKuC,QACd2B,cAAeL,G,CAIT,cAAAd,CAAec,GACtBA,EAAEC,iB,CAGK,eAAAZ,CAAgBW,GACvB7D,KAAKuC,QAAWsB,EAAEO,OAA4B7B,QAC9CsB,EAAEC,kBACF9D,KAAKqE,UAAUL,KAAK,CACnBC,UAAWpD,EAAkBC,KAC7B8B,MAAO5C,KAAK4C,MACZL,QAASvC,KAAKuC,QACd2B,cAAeL,G,CAQjB,YAAMS,GACL,OAAOtE,KAAKyD,Q,CAOb,kBAAM3B,GACLyC,EAAgBvE,KAAK0D,gBAAiB,oBAAqB7C,EAAkBC,MAC7EyD,EAAgBvE,KAAK2D,eAAgB,mBAAoB9C,EAAkBC,MAC3E0D,EAAqBxE,KAAKyB,YAAczB,KAAKE,WAAYF,KAAK2D,eAAgB9C,EAAkBC,K","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import{r as a,h as e,a as t,g as s}from"./p-0a5b0f7d.js";import{N as i}from"./p-3983d290.js";import{v as o}from"./p-92b7481f.js";import{c as n}from"./p-e618f1cb.js";import{d as r}from"./p-e0e2e9c1.js";import"./p-e296ca83.js";import"./p-95d41a3b.js";const c=".gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-nav{position:relative;display:block;width:100%;font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);background:var(--gov-nav-bg, var(--gov-color-primary));font-weight:bold;letter-spacing:0.0125em;text-transform:uppercase}@media (min-width: 48em){.gov-nav{text-align:center}.gov-nav__nav{display:flex;justify-content:space-between}}";const p=c;const f=class{constructor(e){a(this,e);this.wcagLabel=undefined;this.wcagLabelledBy=undefined}async componentDidRender(){if(n()){await r(500);await this.validateWcag()}}render(){return e(t,{key:"576cf7d5e744e9577a6c203a08de72a3741b88ad",class:i.root},e("nav",{key:"6b82c1a4a1fb21a78325878d9a23871962d14f1c",class:i.nav,role:"list","arial-label":this.wcagLabel,"arial-labelledby":this.wcagLabelledBy},e("slot",{key:"c8c30f1be87334ba420fe0aa7ccbea43f7ca3b7f"})))}async validateWcag(){o(this.wcagLabel,this.wcagLabelledBy,i.root)}get host(){return s(this)}};f.style=p;export{f as gov_nav};
2
- //# sourceMappingURL=p-ab9d9655.entry.js.map
@@ -1,3 +0,0 @@
1
- import{r as o,c as a,h as e,a as t,g as i}from"./p-0a5b0f7d.js";import{g as d,a as r}from"./p-4191acf2.js";import{c as s}from"./p-e618f1cb.js";import{a as l}from"./p-e296ca83.js";import{a as n}from"./p-92b7481f.js";import{c as m}from"./p-95d41a3b.js";import{d as c}from"./p-e0e2e9c1.js";import{M as g}from"./p-0134b442.js";const h='.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-modal{display:none}.gov-modal__dialog{z-index:101;position:fixed;top:50%;left:50%;display:flex;justify-content:center;align-items:center;width:100%;max-width:var(--gov-modal-max-width, 52.5rem);height:100%;padding:0.5rem;border:none;background:transparent;transform:translate(-50%, -50%);pointer-events:none}.gov-modal__inner{position:relative;display:flex;flex-direction:column;width:100%;max-height:100%;border-radius:var(--gov-border-radius, 0.1875rem);background:var(--gov-modal-bg, var(--gov-color-neutral-white));overflow:hidden;pointer-events:auto;box-shadow:0 0 1.5rem rgba(var(--gov-color-secondary-800-rgb), 0.24)}.gov-modal__header{display:flex;gap:1rem;align-items:flex-start;padding:1.5rem 1rem;border-bottom:var(--gov-modal-border-color, 0.0625rem solid var(--gov-color-secondary-500))}.gov-modal__icon{flex:0 0 auto;padding-top:calc((var(--gov-text-3xl-font-size) * 1.5 - 1.5rem) / 2)}.gov-modal__icon>*{width:1.5rem;height:1.5rem}.gov-modal__title{font-weight:var(--gov-text-3xl-font-weight);font-size:var(--gov-text-3xl-font-size);line-height:var(--gov-text-3xl-line-height);letter-spacing:var(--gov-text-3xl-letter-spacing);margin:0}.gov-modal__close{flex:0 0 auto;margin-left:auto}.gov-modal__content{height:100%;padding:1.5rem 1rem;color:var(--gov-modal-text-color, var(--gov-color-secondary-700));overflow:auto}.gov-modal__content>*:last-child{margin-bottom:0}.gov-modal__footer,.gov-modal__actions{padding:1.5rem 1rem;border-top:var(--gov-modal-border-color, 0.0625rem solid var(--gov-color-secondary-500))}.gov-modal__actions{display:flex;gap:0.5rem 1rem;flex-wrap:wrap;justify-content:flex-end}.gov-modal__dialog:focus .gov-modal__inner{outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base)}.gov-modal[open=""],.gov-modal[open=true i],.gov-modal[open="1"]{display:block}@media (min-width: 30em){.gov-modal__dialog{max-width:calc(var(--gov-modal-max-width, 52.5rem) + 3rem);padding:1.5rem}.gov-modal__dialog:focus{outline-offset:-1.5rem}.gov-modal__inner{box-shadow:0 0 2rem rgba(var(--gov-color-secondary-800-rgb), 0.32)}.gov-modal--prompt .gov-modal__dialog{max-width:calc(var(--gov-modal-prompt-max-width, 33.125rem) + 3rem)}}@media (min-width: 48em){.gov-modal__header{gap:1.25rem;padding:2rem 2.5rem 2rem 3rem}.gov-modal__content{padding:2rem 3rem}.gov-modal__footer{padding:1rem 3rem}.gov-modal--prompt .gov-modal__header,.gov-modal--prompt .gov-modal__content,.gov-modal--prompt .gov-modal__footer,.gov-modal--prompt .gov-modal__actions{padding:1.5rem}}';const v=h;const p=class{constructor(e){o(this,e);this.govClose=a(this,"gov-close",7);this.open=false;this.label=undefined;this.role="dialog";this.labelTag="h2";this.wcagLabelledBy=undefined;this.wcagDescribedBy=undefined;this.accessibleCloseLabel="Zavřít okno";this.wcagCloseLabelledBy=undefined;this.h=d(this.host);this.labelId=m("GovPromptLabel");this.contentId=m("GovPromptContent")}validateLabelTag(o){const a=["h1","h2","h3","h4","h5","h6"];if(o){if(!a.includes(o)){l(`[${g.root}]: Tag ${o} is not allowed.`)}}}watchOpen(o){this.open=o;if(o&&this.closeCtaRef){this.closeCtaRef.setFocus().catch()}}showModal(){this.open=true;document.body.classList.add(g.bodyFix)}hideModal(){this.open=false;document.body.classList.remove(g.bodyFix)}async componentWillRender(){if(this.open){this.showModal()}else{this.hideModal()}}async componentDidRender(){if(s()){await c(500);await this.validateWcag()}}render(){const o=this.labelTag;return e(t,{key:"eafb47c3de00f2944cf648244a0cc4d57579c7ff",class:this.h.classes(g.rootPrompt),open:this.open},e("dialog",{key:"4e93478ea3a360bb6249725b4299f1db89626e72",class:g.dialog,hidden:!this.open,tabindex:"-1",open:this.open,"aria-modal":"true","aria-hidden":r(!this.open),"aria-labelledby":this.wcagLabelledBy||this.labelId,"aria-describedby":this.wcagDescribedBy||this.contentId,role:this.role},e("div",{key:"0e4dc70872d6bab33e36e192ec921a05e278e844",class:g.inner},e("div",{key:"3be8a8bed33a9640dcba8e8374512efadb4c4a63",class:g.header},this.h.hasSlot("icon")&&e("div",{key:"76931e2ab2a270ce04a71c7d8d32ead065da6eca",class:g.icon},e("slot",{key:"3a49590e4c2b67742aa7202e440408a307975ad3",name:"icon"})),this.label&&e(o,{key:"8e3cd8b4940f6222e15efb63317e151efa2e6b5f",class:g.title,id:this.labelId},this.label),e("gov-button",{key:"23de5a7c3bb39f3896c134665aa564d584160914",class:g.close,variant:"primary",wcagLabel:this.accessibleCloseLabel,wcagLabelledBy:this.wcagCloseLabelledBy,type:"base",ref:o=>this.closeCtaRef=o,"on-gov-click":this.onCloseHandler.bind(this)},e("gov-icon",{key:"4769f23e5e772c92ed07ba8244d2da674acb8d33",name:"x-lg"}))),e("div",{key:"1b181dd790d066b2aa943c91ef2e0f47f8a0e5df",class:g.content,id:this.contentId},e("slot",{key:"04cf9527b390b134ee7900ff3283b84cb5b6cdcb"})),e("div",{key:"350de95cfb9e765da4ebdc8f0f179bcc040baf28",class:g.actions},e("slot",{key:"206f016467e43154a75c02c2708a65a589d09710",name:"actions"})))),this.open?e("gov-backdrop",{"wcag-label":this.accessibleCloseLabel,"wcag-labelled-by":this.wcagCloseLabelledBy,"on-gov-click":this.onCloseHandler.bind(this)}):null)}onCloseHandler(o){o.stopPropagation();this.hideModal();this.govClose.emit(o)}async show(){this.showModal()}async hide(){this.hideModal()}async validateWcag(){n(this.wcagLabelledBy,"wcag-labelled-by",g.root);n(this.wcagDescribedBy,"wcag-described-by",g.root)}get host(){return i(this)}static get watchers(){return{labelTag:["validateLabelTag"],open:["watchOpen"]}}};p.style=v;export{p as gov_prompt};
2
-
3
- //# sourceMappingURL=p-e21b402c.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["govPromptCss","GovPromptStyle0","GovPrompt","constructor","hostRef","this","h","govHost","host","labelId","createID","contentId","validateLabelTag","newValue","validTags","includes","govErrorLog","ModalClass","root","watchOpen","open","closeCtaRef","setFocus","catch","showModal","document","body","classList","add","bodyFix","hideModal","remove","componentWillRender","componentDidRender","canValidateWcagOnRender","delay","validateWcag","render","LabelTag","labelTag","Host","key","class","classes","rootPrompt","dialog","hidden","tabindex","toBoolAttr","wcagLabelledBy","wcagDescribedBy","role","inner","header","hasSlot","icon","name","label","title","id","close","variant","wcagLabel","accessibleCloseLabel","wcagCloseLabelledBy","type","ref","el","onCloseHandler","bind","content","actions","e","stopPropagation","govClose","emit","show","hide","validateWcagRef"],"sources":["../../../packages/core/src/components/gov-promp/gov-prompt.scss?tag=gov-prompt","../../../packages/core/src/components/gov-promp/gov-prompt.tsx"],"sourcesContent":["/*\n * Prompt\n */\n\n// $class: \".gov-prompt\";\n@import \"../gov-modal/gov-modal.scss\";\n\n// #{$class} {\n// \t//\n// }\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch} from '@stencil/core'\nimport {govHost, toBoolAttr} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {canValidateWcagOnRender} from '../../helpers/Dom/win'\nimport {govErrorLog} from '../../helpers/Log/gov.log'\nimport {validateWcagRef} from '../../helpers/Validate/wcag'\nimport {Nullable} from '../../types/interfaces'\nimport {createID} from '../../utils/string.utils'\nimport {delay} from '../../utils/utils'\nimport {ModalClass} from '../gov-modal/constants'\n\n@Component({\n\ttag: 'gov-prompt',\n\tstyleUrl: 'gov-prompt.scss',\n})\nexport class GovPrompt {\n\tprivate h: GovHost\n\tprivate readonly labelId: string\n\tprivate readonly contentId: string\n\tprivate closeCtaRef?: HTMLGovButtonElement\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.labelId = createID('GovPromptLabel')\n\t\tthis.contentId = createID('GovPromptContent')\n\t}\n\n\t@Element() host: HTMLGovPromptElement\n\t/**\n\t * Attribute for modal window display\n\t */\n\t@Prop({mutable: true}) open = false\n\t/**\n\t * Title of modal window\n\t */\n\t@Prop() label: string\n\t/**\n\t * Role of modal\n\t */\n\t@Prop({attribute: 'role'}) role: Nullable<string> = 'dialog'\n\t/**\n\t * Used to change the HTML tag in the modal label for correct semantic structure\n\t */\n\t@Prop({attribute: 'label-tag'}) readonly labelTag: string = 'h2'\n\t/**\n\t * String of id's that indicate alternative labels elements\n\t */\n\t@Prop({attribute: 'wcag-labelled-by'}) wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the modal.\n\t */\n\t@Prop({attribute: 'wcag-described-by'}) wcagDescribedBy: string\n\t/**\n\t * Adds accessible label for the modal close button that is only shown for screen readers.\n\t */\n\t@Prop({attribute: 'wcag-close-label'}) readonly accessibleCloseLabel: string = 'Zavřít okno'\n\t/**\n\t * A string of identifiers that indicate alternative label elements for closing the modal window\n\t */\n\t@Prop({attribute: 'wcag-close-labelled-by'}) wcagCloseLabelledBy: string\n\t/**\n\t * Emitted when modal window closes.\n\t */\n\t@Event({eventName: 'gov-close'}) govClose: EventEmitter<PointerEvent>\n\n\t@Watch('labelTag')\n\tvalidateLabelTag(newValue: string): void {\n\t\tconst validTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']\n\t\tif (newValue) {\n\t\t\tif (!validTags.includes(newValue)) {\n\t\t\t\tgovErrorLog(`[${ModalClass.root}]: Tag ${newValue} is not allowed.`)\n\t\t\t}\n\t\t}\n\t}\n\n\t@Watch('open')\n\twatchOpen(newValue: boolean): void {\n\t\tthis.open = newValue\n\t\tif (newValue && this.closeCtaRef) {\n\t\t\tthis.closeCtaRef.setFocus().catch()\n\t\t}\n\t}\n\n\tprivate showModal() {\n\t\tthis.open = true\n\t\tdocument.body.classList.add(ModalClass.bodyFix)\n\t}\n\n\tprivate hideModal() {\n\t\tthis.open = false\n\t\tdocument.body.classList.remove(ModalClass.bodyFix)\n\t}\n\n\tasync componentWillRender() {\n\t\tif (this.open) {\n\t\t\tthis.showModal()\n\t\t} else {\n\t\t\tthis.hideModal()\n\t\t}\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\tconst LabelTag = this.labelTag\n\t\treturn (\n\t\t\t<Host class={this.h.classes(ModalClass.rootPrompt)} open={this.open}>\n\t\t\t\t<dialog\n\t\t\t\t\tclass={ModalClass.dialog}\n\t\t\t\t\thidden={!this.open}\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\topen={this.open}\n\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\taria-hidden={toBoolAttr(!this.open)}\n\t\t\t\t\taria-labelledby={this.wcagLabelledBy || this.labelId}\n\t\t\t\t\taria-describedby={this.wcagDescribedBy || this.contentId}\n\t\t\t\t\trole={this.role}\n\t\t\t\t>\n\t\t\t\t\t<div class={ModalClass.inner}>\n\t\t\t\t\t\t<div class={ModalClass.header}>\n\t\t\t\t\t\t\t{this.h.hasSlot('icon') && (\n\t\t\t\t\t\t\t\t<div class={ModalClass.icon}>\n\t\t\t\t\t\t\t\t\t<slot name=\"icon\"/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{this.label && (\n\t\t\t\t\t\t\t\t<LabelTag class={ModalClass.title} id={this.labelId}>\n\t\t\t\t\t\t\t\t\t{this.label}\n\t\t\t\t\t\t\t\t</LabelTag>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<gov-button\n\t\t\t\t\t\t\t\tclass={ModalClass.close}\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\twcagLabel={this.accessibleCloseLabel}\n\t\t\t\t\t\t\t\twcagLabelledBy={this.wcagCloseLabelledBy}\n\t\t\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\t\t\tref={el => (this.closeCtaRef = el)}\n\t\t\t\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<gov-icon name=\"x-lg\"/>\n\t\t\t\t\t\t\t</gov-button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class={ModalClass.content} id={this.contentId}>\n\t\t\t\t\t\t\t<slot/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class={ModalClass.actions}>\n\t\t\t\t\t\t\t<slot name=\"actions\"/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</dialog>\n\n\t\t\t\t{this.open ? (\n\t\t\t\t\t<gov-backdrop wcag-label={this.accessibleCloseLabel} wcag-labelled-by={this.wcagCloseLabelledBy}\n\t\t\t\t\t\t\t\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}/>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onCloseHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t\tthis.hideModal()\n\t\tthis.govClose.emit(e)\n\t}\n\n\t/**\n\t * Showing the modal\n\t */\n\t@Method()\n\tasync show(): Promise<void> {\n\t\tthis.showModal()\n\t}\n\n\t/**\n\t * Hiding the modal\n\t */\n\t@Method()\n\tasync hide(): Promise<void> {\n\t\tthis.hideModal()\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagLabelledBy, 'wcag-labelled-by', ModalClass.root)\n\t\tvalidateWcagRef(this.wcagDescribedBy, 'wcag-described-by', ModalClass.root)\n\t}\n}\n"],"mappings":"mUAAA,MAAMA,EAAe,wyFACrB,MAAAC,EAAeD,E,MCcFE,EAAS,MAMrB,WAAAC,CAAAC,G,wDAU8B,M,+BAQsB,S,cAIQ,K,iFAYa,c,mCAjCxEC,KAAKC,EAAIC,EAAQF,KAAKG,MACtBH,KAAKI,QAAUC,EAAS,kBACxBL,KAAKM,UAAYD,EAAS,mB,CA0C3B,gBAAAE,CAAiBC,GAChB,MAAMC,EAAY,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,MACjD,GAAID,EAAU,CACb,IAAKC,EAAUC,SAASF,GAAW,CAClCG,EAAY,IAAIC,EAAWC,cAAcL,oB,GAM5C,SAAAM,CAAUN,GACTR,KAAKe,KAAOP,EACZ,GAAIA,GAAYR,KAAKgB,YAAa,CACjChB,KAAKgB,YAAYC,WAAWC,O,EAItB,SAAAC,GACPnB,KAAKe,KAAO,KACZK,SAASC,KAAKC,UAAUC,IAAIX,EAAWY,Q,CAGhC,SAAAC,GACPzB,KAAKe,KA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AmC,IAAA,2CAAKC,MAAOzB,EAAWqD,QAASX,GAAItD,KAAKM,WACxCL,EAAA,QAAAmC,IAAA,8CAEDnC,EAAA,OAAAmC,IAAA,2CAAKC,MAAOzB,EAAWsD,SACtBjE,EAAA,QAAAmC,IAAA,2CAAMe,KAAK,eAKbnD,KAAKe,KACLd,EAAA,6BAA0BD,KAAK0D,eAAc,mBAAoB1D,KAAK2D,oBAAmB,eACpE3D,KAAK+D,eAAeC,KAAKhE,QAC3C,K,CAKC,cAAA+D,CAAeI,GACtBA,EAAEC,kBACFpE,KAAKyB,YACLzB,KAAKqE,SAASC,KAAKH,E,CAOpB,UAAMI,GACLvE,KAAKmB,W,CAON,UAAMqD,GACLxE,KAAKyB,W,CAON,kBAAMM,GACL0C,EAAgBzE,KAAK4C,eAAgB,mBAAoBhC,EAAWC,MACpE4D,EAAgBzE,KAAK6C,gBAAiB,oBAAqBjC,EAAWC,K","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import{r as o,c as a,h as e,a as t,g as i}from"./p-0a5b0f7d.js";import{g as s,c as d,a as r}from"./p-4191acf2.js";import{c as l}from"./p-e618f1cb.js";import{a as n}from"./p-e296ca83.js";import{a as c}from"./p-92b7481f.js";import{c as m}from"./p-95d41a3b.js";import{d as g}from"./p-e0e2e9c1.js";import{M as h}from"./p-0134b442.js";const v='.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-modal{display:none}.gov-modal__dialog{z-index:101;position:fixed;top:50%;left:50%;display:flex;justify-content:center;align-items:center;width:100%;max-width:var(--gov-modal-max-width, 52.5rem);height:100%;padding:0.5rem;border:none;background:transparent;transform:translate(-50%, -50%);pointer-events:none}.gov-modal__inner{position:relative;display:flex;flex-direction:column;width:100%;max-height:100%;border-radius:var(--gov-border-radius, 0.1875rem);background:var(--gov-modal-bg, var(--gov-color-neutral-white));overflow:hidden;pointer-events:auto;box-shadow:0 0 1.5rem rgba(var(--gov-color-secondary-800-rgb), 0.24)}.gov-modal__header{display:flex;gap:1rem;align-items:flex-start;padding:1.5rem 1rem;border-bottom:var(--gov-modal-border-color, 0.0625rem solid var(--gov-color-secondary-500))}.gov-modal__icon{flex:0 0 auto;padding-top:calc((var(--gov-text-3xl-font-size) * 1.5 - 1.5rem) / 2)}.gov-modal__icon>*{width:1.5rem;height:1.5rem}.gov-modal__title{font-weight:var(--gov-text-3xl-font-weight);font-size:var(--gov-text-3xl-font-size);line-height:var(--gov-text-3xl-line-height);letter-spacing:var(--gov-text-3xl-letter-spacing);margin:0}.gov-modal__close{flex:0 0 auto;margin-left:auto}.gov-modal__content{height:100%;padding:1.5rem 1rem;color:var(--gov-modal-text-color, var(--gov-color-secondary-700));overflow:auto}.gov-modal__content>*:last-child{margin-bottom:0}.gov-modal__footer,.gov-modal__actions{padding:1.5rem 1rem;border-top:var(--gov-modal-border-color, 0.0625rem solid var(--gov-color-secondary-500))}.gov-modal__actions{display:flex;gap:0.5rem 1rem;flex-wrap:wrap;justify-content:flex-end}.gov-modal__dialog:focus .gov-modal__inner{outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base)}.gov-modal[open=""],.gov-modal[open=true i],.gov-modal[open="1"]{display:block}@media (min-width: 30em){.gov-modal__dialog{max-width:calc(var(--gov-modal-max-width, 52.5rem) + 3rem);padding:1.5rem}.gov-modal__dialog:focus{outline-offset:-1.5rem}.gov-modal__inner{box-shadow:0 0 2rem rgba(var(--gov-color-secondary-800-rgb), 0.32)}.gov-modal--prompt .gov-modal__dialog{max-width:calc(var(--gov-modal-prompt-max-width, 33.125rem) + 3rem)}}@media (min-width: 48em){.gov-modal__header{gap:1.25rem;padding:2rem 2.5rem 2rem 3rem}.gov-modal__content{padding:2rem 3rem}.gov-modal__footer{padding:1rem 3rem}.gov-modal--prompt .gov-modal__header,.gov-modal--prompt .gov-modal__content,.gov-modal--prompt .gov-modal__footer,.gov-modal--prompt .gov-modal__actions{padding:1.5rem}}';const f=v;const p=class{constructor(e){o(this,e);this.govClose=a(this,"gov-close",7);this.open=false;this.blockClose=false;this.blockBackdropClose=false;this.blockButtonClose=false;this.label=undefined;this.role="dialog";this.labelTag="h2";this.wcagLabelledBy=undefined;this.wcagDescribedBy=undefined;this.accessibleCloseLabel="Zavřít okno";this.wcagCloseLabelledBy=undefined;this.h=s(this.host);this.labelId=m("GovModalLabel");this.contentId=m("GovModalContent")}validateLabelTag(o){const a=["h1","h2","h3","h4","h5","h6"];if(o){if(!a.includes(o)){n(`[${h.root}]: Tag ${o} is not allowed.`)}}}watchOpen(o){this.open=o;if(o&&this.closeCtaRef){this.closeCtaRef.setFocus().catch()}}showModal(){this.open=true;document.body.classList.add(h.bodyFix)}hideModal(){this.open=false;document.body.classList.remove(h.bodyFix)}async componentWillRender(){if(this.open){this.showModal()}else{this.hideModal()}}async componentDidRender(){if(l()){await g(500);await this.validateWcag()}}render(){const o=this.labelTag;return e(t,{key:"e1525cfa3cdd7b0efeb2385b25a04ea8dbd49bc7",class:this.h.classes(h.root),open:this.open},e("dialog",{key:"a1116333c938d11049de61a9531109f346297734",class:h.dialog,hidden:!this.open,tabindex:d(this.open),open:this.open,"aria-modal":"true","aria-hidden":r(!this.open),"aria-labelledby":this.wcagLabelledBy||this.labelId,"aria-describedby":this.wcagDescribedBy||this.contentId,role:this.role},e("div",{key:"952ca6b5e7d1f4dcc59e09c1495f9aa9a96e56fb",class:h.inner},e("div",{key:"b00890579ccd683cd171a6200e972e0f02b5b4d3",class:h.header},this.h.hasSlot("icon")&&e("div",{key:"7bcf03a0f1c475b0c3553854c885b3d0900894db",class:h.icon},e("slot",{key:"527c8a9e77dbb2568510b6765634db0234039f8f",name:"icon"})),this.label&&e(o,{key:"c96b0339fcc61ba3f834d35926f6ef13419a901a",class:h.title,id:this.labelId},this.label),!(this.blockButtonClose||this.blockClose)?e("gov-button",{ref:o=>this.closeCtaRef=o,disabled:this.blockClose,class:h.close,variant:"primary",wcagLabel:this.accessibleCloseLabel,wcagLabelledBy:this.wcagCloseLabelledBy,type:"base","on-gov-click":this.onCloseHandler.bind(this)},e("gov-icon",{name:"x-lg"})):null),e("div",{key:"47e940a5bf64b87ec065f6c0977546603ca9bb11",class:h.content,id:this.contentId},e("slot",{key:"bc97ebe004ffb446c71a4bc0c8086af5d63cf3ec"})),this.h.hasSlot("footer")&&e("div",{key:"c48e97d8c9f597cc544d5e567cb0d679186b868e",class:h.footer},e("slot",{key:"7c9165dca0a9e20eef86e1937704c0f4154fcfb8",name:"footer"})))),this.open?e("gov-backdrop",{"wcag-label":this.accessibleCloseLabel,"wcag-labelled-by":this.wcagCloseLabelledBy,"on-gov-click":o=>!this.blockBackdropClose&&this.onCloseHandler(o)}):null)}onCloseHandler(o){o.stopPropagation();if(this.blockClose===false){this.hideModal();this.govClose.emit(o)}}async show(){this.showModal()}async hide(){this.hideModal()}async validateWcag(){c(this.wcagLabelledBy,"wcag-labelled-by",h.root);c(this.wcagDescribedBy,"wcag-described-by",h.root)}get host(){return i(this)}static get watchers(){return{labelTag:["validateLabelTag"],open:["watchOpen"]}}};p.style=f;export{p as gov_modal};
2
-
3
- //# sourceMappingURL=p-f9e6f776.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["govModalCss","GovModalStyle0","GovModal","constructor","hostRef","this","h","govHost","host","labelId","createID","contentId","validateLabelTag","newValue","validTags","includes","govErrorLog","ModalClass","root","watchOpen","open","closeCtaRef","setFocus","catch","showModal","document","body","classList","add","bodyFix","hideModal","remove","componentWillRender","componentDidRender","canValidateWcagOnRender","delay","validateWcag","render","LabelTag","labelTag","Host","key","class","classes","dialog","hidden","tabindex","boolToFocusValue","toBoolAttr","wcagLabelledBy","wcagDescribedBy","role","inner","header","hasSlot","icon","name","label","title","id","blockButtonClose","blockClose","ref","el","disabled","close","variant","wcagLabel","accessibleCloseLabel","wcagCloseLabelledBy","type","onCloseHandler","bind","content","footer","e","blockBackdropClose","stopPropagation","govClose","emit","show","hide","validateWcagRef"],"sources":["../../../packages/core/src/components/gov-modal/gov-modal.scss?tag=gov-modal","../../../packages/core/src/components/gov-modal/gov-modal.tsx"],"sourcesContent":["/*\n * Modal\n */\n\n$class: \".gov-modal\";\n\n#{$class} {\n\tdisplay: none;\n\n\t&__dialog {\n\t\t@include z-index(\"modal\", 1);\n\t\tposition: fixed;\n\t\ttop: 50%;\n\t\tleft: 50%;\n\t\tdisplay: flex;\n\t\tjustify-content: center;\n\t\talign-items: center;\n\t\twidth: 100%;\n\t\tmax-width: $modal-max-width;\n\t\theight: 100%;\n\t\tpadding: rem-calc(8);\n\t\tborder: none;\n\t\tbackground: transparent;\n\t\ttransform: translate(-50%, -50%);\n\t\tpointer-events: none;\n\t}\n\n\t&__inner {\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\twidth: 100%;\n\t\tmax-height: 100%;\n\t\tborder-radius: $border-radius;\n\t\tbackground: $modal-bg;\n\t\toverflow: hidden;\n\t\tpointer-events: auto;\n\t\tbox-shadow: get($shadow-l, $shadows);\n\t}\n\n\t&__header {\n\t\tdisplay: flex;\n\t\tgap: rem-calc(16);\n\t\talign-items: flex-start;\n\t\tpadding: rem-calc(24 16);\n\t\tborder-bottom: $modal-border;\n\t}\n\n\t&__icon {\n\t\tflex: 0 0 auto;\n\t\tpadding-top: calc(((var(--gov-text-#{$font-size-3xl}-font-size) * 1.5) - rem-calc(24)) / 2);\n\n\t\t& > * {\n\t\t\twidth: rem-calc(24);\n\t\t\theight: rem-calc(24);\n\t\t}\n\t}\n\n\t&__title {\n\t\t@include typography($font-size-3xl);\n\t\tmargin: 0;\n\t}\n\n\t&__close {\n\t\tflex: 0 0 auto;\n\t\tmargin-left: auto;\n\t}\n\n\t&__content {\n\t\t@include reset-last-margin();\n\t\theight: 100%;\n\t\tpadding: rem-calc(24 16);\n\t\tcolor: $modal-text-color;\n\t\toverflow: auto;\n\t}\n\n\t&__footer,\n\t&__actions {\n\t\tpadding: rem-calc(24 16);\n\t\tborder-top: $modal-border;\n\t}\n\n\t&__actions {\n\t\tdisplay: flex;\n\t\tgap: rem-calc(8 16);\n\t\tflex-wrap: wrap;\n\t\tjustify-content: flex-end;\n\t}\n\n\t// STATES\n\t&__dialog:focus &__inner {\n\t\toutline: $outline;\n\t}\n\n\t@include parameter(\"open\") {\n\t\tdisplay: block;\n\t}\n\n\t// MQ\n\t@include mq($from: sm) {\n\t\t&__dialog {\n\t\t\tmax-width: calc($modal-max-width + 2 * rem-calc(24));\n\t\t\tpadding: rem-calc(24);\n\n\t\t\t&:focus {\n\t\t\t\toutline-offset: rem-calc(-24);\n\t\t\t}\n\t\t}\n\t\t&__inner {\n\t\t\tbox-shadow: get($shadow-xl, $shadows);\n\t\t}\n\n\t\t// VARIANTS\n\t\t&--prompt &__dialog {\n\t\t\tmax-width: calc($modal-prompt-max-width + 2 * rem-calc(24));\n\t\t}\n\t}\n\t@include mq($from: md) {\n\t\t&__header {\n\t\t\tgap: rem-calc(20);\n\t\t\tpadding: rem-calc(32 40 32 48);\n\t\t}\n\t\t&__content {\n\t\t\tpadding: rem-calc(32 48);\n\t\t}\n\t\t&__footer {\n\t\t\tpadding: rem-calc(16 48);\n\t\t}\n\n\t\t// VARIANTS\n\t\t&--prompt {\n\t\t\t#{$class} {\n\t\t\t\t&__header,\n\t\t\t\t&__content,\n\t\t\t\t&__footer,\n\t\t\t\t&__actions {\n\t\t\t\t\tpadding: rem-calc(24);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, Watch} from '@stencil/core'\nimport {boolToFocusValue, govHost, toBoolAttr} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {canValidateWcagOnRender} from '../../helpers/Dom/win'\nimport {govErrorLog} from '../../helpers/Log/gov.log'\nimport {validateWcagRef} from '../../helpers/Validate/wcag'\nimport {Nullable} from '../../types/interfaces'\nimport {createID} from '../../utils/string.utils'\nimport {delay} from '../../utils/utils'\nimport {ModalClass} from './constants'\n\n@Component({\n\ttag: 'gov-modal',\n\tstyleUrl: 'gov-modal.scss',\n})\nexport class GovModal {\n\tprivate h: GovHost\n\tprivate readonly labelId: string\n\tprivate readonly contentId: string\n\tprivate closeCtaRef?: HTMLGovButtonElement\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.labelId = createID('GovModalLabel')\n\t\tthis.contentId = createID('GovModalContent')\n\t}\n\n\t@Element() host: HTMLGovModalElement\n\n\t/**\n\t * Attribute for modal window display\n\t */\n\t@Prop({mutable: true}) open = false\n\t/**\n\t * Attribute allowing blocking the modal closing\n\t */\n\t@Prop() blockClose = false\n\t/**\n\t * Attribute allowing blocking the modal backdrop closing\n\t */\n\t@Prop() blockBackdropClose = false\n\t/**\n\t * Attribute allowing blocking the modal button closing\n\t */\n\t@Prop() blockButtonClose = false\n\t/**\n\t * Title of modal window\n\t */\n\t@Prop() label: string\n\t/**\n\t * Role of modal\n\t */\n\t@Prop({attribute: 'role'}) role: Nullable<string> = 'dialog'\n\t/**\n\t * Used to change the HTML tag in the modal label for correct semantic structure\n\t */\n\t@Prop({attribute: 'label-tag'}) readonly labelTag: string = 'h2'\n\t/**\n\t * String of id's that indicate alternative labels elements\n\t */\n\t@Prop({attribute: 'wcag-labelled-by'}) wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the modal.\n\t */\n\t@Prop({attribute: 'wcag-described-by'}) wcagDescribedBy: string\n\t/**\n\t * Adds accessible label for the modal close button that is only shown for screen readers.\n\t */\n\t@Prop({attribute: 'wcag-close-label'}) readonly accessibleCloseLabel: string = 'Zavřít okno'\n\t/**\n\t * A string of identifiers that indicate alternative label elements for closing the modal window\n\t */\n\t@Prop({attribute: 'wcag-close-labelled-by'}) wcagCloseLabelledBy: string\n\t/**\n\t * Emitted when modal window closes.\n\t */\n\t@Event({eventName: 'gov-close'}) govClose: EventEmitter<PointerEvent>\n\n\t@Watch('labelTag')\n\tvalidateLabelTag(newValue: string): void {\n\t\tconst validTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']\n\t\tif (newValue) {\n\t\t\tif (!validTags.includes(newValue)) {\n\t\t\t\tgovErrorLog(`[${ModalClass.root}]: Tag ${newValue} is not allowed.`)\n\t\t\t}\n\t\t}\n\t}\n\n\t@Watch('open')\n\twatchOpen(newValue: boolean): void {\n\t\tthis.open = newValue\n\t\tif (newValue && this.closeCtaRef) {\n\t\t\tthis.closeCtaRef.setFocus().catch()\n\t\t}\n\t}\n\n\tprivate showModal() {\n\t\tthis.open = true\n\t\tdocument.body.classList.add(ModalClass.bodyFix)\n\t}\n\n\tprivate hideModal() {\n\t\tthis.open = false\n\t\tdocument.body.classList.remove(ModalClass.bodyFix)\n\t}\n\n\tasync componentWillRender() {\n\t\tif (this.open) {\n\t\t\tthis.showModal()\n\t\t} else {\n\t\t\tthis.hideModal()\n\t\t}\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\tconst LabelTag = this.labelTag\n\t\treturn (\n\t\t\t<Host class={this.h.classes(ModalClass.root)} open={this.open}>\n\t\t\t\t<dialog\n\t\t\t\t\tclass={ModalClass.dialog}\n\t\t\t\t\thidden={!this.open}\n\t\t\t\t\ttabindex={boolToFocusValue(this.open)}\n\t\t\t\t\topen={this.open}\n\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\taria-hidden={toBoolAttr(!this.open)}\n\t\t\t\t\taria-labelledby={this.wcagLabelledBy || this.labelId}\n\t\t\t\t\taria-describedby={this.wcagDescribedBy || this.contentId}\n\t\t\t\t\trole={this.role}\n\t\t\t\t>\n\t\t\t\t\t<div class={ModalClass.inner}>\n\t\t\t\t\t\t<div class={ModalClass.header}>\n\t\t\t\t\t\t\t{this.h.hasSlot('icon') && (\n\t\t\t\t\t\t\t\t<div class={ModalClass.icon}>\n\t\t\t\t\t\t\t\t\t<slot name=\"icon\"/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{this.label && (\n\t\t\t\t\t\t\t\t<LabelTag class={ModalClass.title} id={this.labelId}>\n\t\t\t\t\t\t\t\t\t{this.label}\n\t\t\t\t\t\t\t\t</LabelTag>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{!(this.blockButtonClose || this.blockClose) ? (\n\t\t\t\t\t\t\t\t<gov-button\n\t\t\t\t\t\t\t\t\tref={el => (this.closeCtaRef = el)}\n\t\t\t\t\t\t\t\t\tdisabled={this.blockClose}\n\t\t\t\t\t\t\t\t\tclass={ModalClass.close}\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\twcagLabel={this.accessibleCloseLabel}\n\t\t\t\t\t\t\t\t\twcagLabelledBy={this.wcagCloseLabelledBy}\n\t\t\t\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<gov-icon name=\"x-lg\"/>\n\t\t\t\t\t\t\t\t</gov-button>\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class={ModalClass.content} id={this.contentId}>\n\t\t\t\t\t\t\t<slot/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{this.h.hasSlot('footer') && (\n\t\t\t\t\t\t\t<div class={ModalClass.footer}>\n\t\t\t\t\t\t\t\t<slot name=\"footer\"/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</dialog>\n\n\t\t\t\t{this.open ? (\n\t\t\t\t\t<gov-backdrop wcag-label={this.accessibleCloseLabel}\n\t\t\t\t\t\t\t\t\t\t\t\twcag-labelled-by={this.wcagCloseLabelledBy}\n\t\t\t\t\t\t\t\t\t\t\t\ton-gov-click={(e) => !this.blockBackdropClose && this.onCloseHandler(e)}/>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onCloseHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t\tif (this.blockClose === false) {\n\t\t\tthis.hideModal()\n\t\t\tthis.govClose.emit(e)\n\t\t}\n\t}\n\n\t/**\n\t * Showing the modal\n\t */\n\t@Method()\n\tasync show(): Promise<void> {\n\t\tthis.showModal()\n\t}\n\n\t/**\n\t * Hiding the modal\n\t */\n\t@Method()\n\tasync hide(): Promise<void> {\n\t\tthis.hideModal()\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagLabelledBy, 'wcag-labelled-by', ModalClass.root)\n\t\tvalidateWcagRef(this.wcagDescribedBy, 'wcag-described-by', ModalClass.root)\n\t}\n}\n"],"mappings":"0UAAA,MAAMA,EAAc,wyFACpB,MAAAC,EAAeD,E,MCcFE,EAAQ,MAMpB,WAAAC,CAAAC,G,wDAW8B,M,gBAIT,M,wBAIQ,M,sBAIF,M,+BAQyB,S,cAIQ,K,iFAYa,c,mCA9CxEC,KAAKC,EAAIC,EAAQF,KAAKG,MACtBH,KAAKI,QAAUC,EAAS,iBACxBL,KAAKM,UAAYD,EAAS,kB,CAuD3B,gBAAAE,CAAiBC,GAChB,MAAMC,EAAY,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,MACjD,GAAID,EAAU,CACb,IAAKC,EAAUC,SAASF,GAAW,CAClCG,EAAY,IAAIC,EAAWC,cAAcL,oB,GAM5C,SAAAM,CAAUN,GACTR,KAAKe,KAAOP,EACZ,GAAIA,GAAYR,KAAKgB,YAAa,CACjChB,KAAKgB,YAAYC,WAAWC,O,EAItB,SAA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RC,UAAW9D,KAAK+D,eAChBnB,eAAgB5C,KAAKgE,oBACrBC,KAAK,OAAM,eACGjE,KAAKkE,eAAeC,KAAKnE,OAEvCC,EAAA,YAAUkD,KAAK,UAEb,MAELlD,EAAA,OAAAmC,IAAA,2CAAKC,MAAOzB,EAAWwD,QAASd,GAAItD,KAAKM,WACxCL,EAAA,QAAAmC,IAAA,8CAEApC,KAAKC,EAAEgD,QAAQ,WACfhD,EAAA,OAAAmC,IAAA,2CAAKC,MAAOzB,EAAWyD,QACtBpE,EAAA,QAAAmC,IAAA,2CAAMe,KAAK,cAMdnD,KAAKe,KACLd,EAAA,6BAA0BD,KAAK+D,eAAc,mBACpB/D,KAAKgE,oBAAmB,eAC3BM,IAAOtE,KAAKuE,oBAAsBvE,KAAKkE,eAAeI,KACzE,K,CAKC,cAAAJ,CAAeI,GACtBA,EAAEE,kBACF,GAAIxE,KAAKwD,aAAe,MAAO,CAC9BxD,KAAKyB,YACLzB,KAAKyE,SAASC,KAAKJ,E,EAQrB,UAAMK,GACL3E,KAAKmB,W,CAON,UAAMyD,GACL5E,KAAKyB,W,CAON,kBAAMM,GACL8C,EAAgB7E,KAAK4C,eAAgB,mBAAoBhC,EAAWC,MACpEgE,EAAgB7E,KAAK6C,gBAAiB,oBAAqBjC,EAAWC,K","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["InfobarVariants","pick","Variants","InfobarClass","root","section","icon","content","closable","headline","close","govInfobarCss","GovInfobarStyle0","GovInfobar","constructor","hostRef","undefined","this","h","govHost","host","validateVariant","newValue","validateProp","componentWillLoad","variant","componentDidRender","canValidateWcagOnRender","delay","validateWcag","render","inverse","closeButton","key","class","size","wcagLabel","accessibleCloseLabel","type","onCloseHandler","bind","name","Host","classes","role","hasSlot","Fragment","accessibleToggleLabel","toggleContent","hidden","toBoolAttr","e","govClose","emit","component","ref","originalEvent","validateWcagProp"],"sources":["../../../packages/core/src/components/gov-infobar/constants.ts","../../../packages/core/src/components/gov-infobar/gov-infobar.scss?tag=gov-infobar","../../../packages/core/src/components/gov-infobar/gov-infobar.tsx"],"sourcesContent":["import { Variants } from '../../core/constants/variants'\nimport { pick } from '../../utils/utils'\nimport { ValueOf } from '../../types/interfaces'\n\nexport const InfobarVariants = pick(Variants, ['PRIMARY', 'SECONDARY', 'WARNING', 'ERROR', 'SUCCESS'])\nexport type VariantType = `${ValueOf<typeof InfobarVariants>}`\n\nexport const InfobarClass = {\n\troot: 'gov-infobar',\n\tsection: 'gov-infobar__section',\n\ticon: 'gov-infobar__icon',\n\tcontent: 'gov-infobar__content',\n\tclosable: 'gov-infobar__content--closable',\n\theadline: 'gov-infobar__headline',\n\tclose: 'gov-infobar__close',\n}\n","/*\n * Infobar\n */\n\n$class: \".gov-infobar\";\n\n#{$class} {\n\t@include base();\n\n\t&__section {\n\t\tdisplay: flex;\n\t\tgap: rem-calc(16);\n\t\tpadding: rem-calc(16);\n\t}\n\n\t&__icon {\n\t\tflex: 0 0 auto;\n\n\t\t& > * {\n\t\t\twidth: rem-calc(20);\n\t\t\theight: rem-calc(20);\n\t\t}\n\t}\n\n\t&__headline {\n\t\tdisplay: flex;\n\t\tgap: rem-calc(16);\n\n\t\t+ div {\n\t\t\tmargin-top: rem-calc(8);\n\t\t}\n\n\t\tp {\n\t\t\tmargin-bottom: 0;\n\t\t}\n\n\t\tgov-button {\n\t\t\tmargin-top: rem-calc(-4);\n\t\t}\n\t}\n\n\t&__content {\n\t\t@include reset-last-margin();\n\t\twidth: 100%;\n\n\t\t&--closable {\n\t\t\tpadding-right: rem-calc(56);\n\t\t}\n\n\t\tp {\n\t\t\t@include typography($font-size-m);\n\t\t}\n\n\t\ta {\n\t\t\tcolor: inherit;\n\t\t\t@include hover() {\n\t\t\t\tcolor: inherit;\n\t\t\t}\n\t\t\t.gov-icon {\n\t\t\t\tcolor: inherit;\n\t\t\t}\n\t\t}\n\t}\n\n\t&__close {\n\t\tposition: absolute;\n\t\ttop: rem-calc(14);\n\t\tright: rem-calc(16);\n\t}\n\n\t// VARIANTS\n\t@each $variant, $definitions in $infobar-variants {\n\t\t&[variant=\"#{$variant}\"] {\n\t\t\tbackground-color: get(\"bg-color\", $definitions);\n\n\t\t\t#{$class} {\n\t\t\t\t&__icon {\n\t\t\t\t\tcolor: get(\"icon-color\", $definitions);\n\t\t\t\t}\n\n\t\t\t\t&__content {\n\t\t\t\t\tcolor: get(\"text-color\", $definitions);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t@if deep-map-check($definitions, \"border\") {\n\t\t\t\tborder-bottom: $infobar-border;\n\t\t\t}\n\n\t\t\t// STATES\n\t\t\t@include parameter(\"inverse\") {\n\t\t\t\tborder-bottom: $infobar-border;\n\t\t\t\tbackground-color: $infobar-inverse-bg;\n\t\t\t\t#{$class} {\n\t\t\t\t\t&__icon {\n\t\t\t\t\t\tcolor: get(\"bg-color\", $definitions);\n\t\t\t\t\t}\n\n\t\t\t\t\t&__content {\n\t\t\t\t\t\tcolor: $infobar-inverse-color;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from '@stencil/core'\nimport {govHost, toBoolAttr} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {canValidateWcagOnRender} from '../../helpers/Dom/win'\nimport Fragment from '../../helpers/Fragment'\nimport {validateProp} from '../../helpers/Validate/props'\nimport {validateWcagProp} from '../../helpers/Validate/wcag'\nimport {delay} from '../../utils/utils'\nimport {ButtonEvent} from '../gov-button/button/gov-button.types'\nimport {InfobarClass, InfobarVariants, VariantType} from './constants'\nimport {InfobarEvent} from './gov-infobar.types'\n\n@Component({\n\ttag: 'gov-infobar',\n\tstyleUrl: 'gov-infobar.scss',\n})\nexport class GovInfobar {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovInfobarElement\n\n\t/**\n\t * Style variation of the button.\n\t */\n\t@Prop() readonly headline: string\n\t/**\n\t * Style variation of the button.\n\t */\n\t@Prop() readonly variant: VariantType = 'primary'\n\t/**\n\t * Style variation of the button.\n\t */\n\t@Prop() readonly role: HTMLElement['role'] = undefined\n\t/**\n\t * Determine if component should have inverse colors to be used on dark background\n\t */\n\t@Prop() readonly inverse: boolean = false\n\t/**\n\t * Aria label for the closing button. It is mandatory if the infobar is closable\n\t */\n\t@Prop({attribute: 'wcag-close-label'}) readonly accessibleCloseLabel: string = 'Zavřít informační lištu'\n\t/**\n\t * Aria label for the toggle button. It is mandatory if the infobar has headline\n\t */\n\t@Prop({attribute: 'wcag-toggle-label'}) readonly accessibleToggleLabel: string = 'Zobrazit více informací'\n\t/**\n\t * Called when the close button is clicked\n\t */\n\t@Event({eventName: 'gov-close'}) govClose: EventEmitter<InfobarEvent>\n\t/**\n\t * Displays the option to close the infobar\n\t */\n\t@Prop() readonly closable?: boolean = false\n\n\t@State() toggleContent = false\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(InfobarVariants, newValue, InfobarClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateVariant(this.variant)\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\tlet inverse = !this.inverse\n\t\tlet variant = this.inverse ? 'secondary' : this.variant\n\n\t\tif (this.variant == 'warning') {\n\t\t\tinverse = false\n\t\t\tvariant = 'secondary'\n\t\t}\n\n\t\tconst closeButton = (\n\t\t\t<div class={InfobarClass.close}>\n\t\t\t\t<gov-button size=\"s\" wcagLabel={this.accessibleCloseLabel} type=\"base\" variant={variant} inverse={inverse}\n\t\t\t\t\t\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}>\n\t\t\t\t\t<gov-icon name=\"x-lg\"></gov-icon>\n\t\t\t\t</gov-button>\n\t\t\t</div>\n\t\t)\n\n\t\treturn (\n\t\t\t<Host class={this.h.classes(InfobarClass.root)} variant={this.variant}>\n\t\t\t\t<section class={InfobarClass.section} role={this.role}>\n\t\t\t\t\t{this.h.hasSlot('icon') && (\n\t\t\t\t\t\t<div class={InfobarClass.icon}>\n\t\t\t\t\t\t\t<slot name=\"icon\"/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t\t<div class={InfobarClass.content + (this.closable ? ' ' + InfobarClass.closable : '')}>\n\t\t\t\t\t\t{this.headline ? (\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t<div class={InfobarClass.headline}>\n\t\t\t\t\t\t\t\t\t<p>{this.headline}</p>\n\t\t\t\t\t\t\t\t\t<gov-button\n\t\t\t\t\t\t\t\t\t\tsize=\"s\"\n\t\t\t\t\t\t\t\t\t\twcagLabel={this.accessibleToggleLabel}\n\t\t\t\t\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\t\t\t\t\tvariant={variant}\n\t\t\t\t\t\t\t\t\t\tinverse={inverse}\n\t\t\t\t\t\t\t\t\t\ton-gov-click={() => (this.toggleContent = !this.toggleContent)}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<gov-icon name={this.toggleContent ? 'chevron-up' : 'chevron-down'}></gov-icon>\n\t\t\t\t\t\t\t\t\t</gov-button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div hidden={!this.toggleContent} aria-hidden={toBoolAttr(this.toggleContent)}>\n\t\t\t\t\t\t\t\t\t<slot/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<slot/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</section>\n\t\t\t\t{this.closable && closeButton}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tonCloseHandler(e: CustomEvent<ButtonEvent>) {\n\t\tthis.govClose.emit({\n\t\t\tcomponent: InfobarClass.root,\n\t\t\tref: this.host,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tif (this.closable) {\n\t\t\tvalidateWcagProp(this.accessibleCloseLabel, 'wcag-close-label', InfobarClass.root)\n\t\t}\n\t\tif (this.headline) {\n\t\t\tvalidateWcagProp(this.accessibleToggleLabel, 'wcag-toggle-label', InfobarClass.root)\n\t\t}\n\t}\n}\n"],"mappings":"0XAIO,MAAMA,EAAkBC,EAAKC,EAAU,CAAC,UAAW,YAAa,UAAW,QAAS,YAGpF,MAAMC,EAAe,CAC3BC,KAAM,cACNC,QAAS,uBACTC,KAAM,oBACNC,QAAS,uBACTC,SAAU,iCACVC,SAAU,wBACVC,MAAO,sBCdR,MAAMC,EAAgB,uiOACtB,MAAAC,EAAeD,E,MCeFE,EAAU,MAGtB,WAAAC,CAAAC,G,mFAawC,U,UAIKC,U,aAIT,M,oBAIqC,0B,qBAIE,0B,cAQrC,M,mBAEb,MAtCxBC,KAAKC,EAAIC,EAAQF,KAAKG,K,CAyCvB,eAAAC,CAAgBC,GACfC,EAAavB,EAAiBsB,EAAUnB,EAAaC,K,CAGtD,iBAAAoB,GACCP,KAAKI,gBAAgBJ,KAAKQ,Q,CAG3B,wBAAMC,GACL,GAAIC,IAA2B,OACxBC,EAAM,WACNX,KAAKY,c,EAIb,MAAAC,GACC,IAAIC,GAAWd,KAAKc,QACpB,IAAIN,EAAUR,KAAKc,QAAU,YAAcd,KAAKQ,QAEhD,GAAIR,KAAKQ,SAAW,UAAW,CAC9BM,EAAU,MACVN,EAAU,W,CAGX,MAAMO,EACLd,EAAA,OAAAe,IAAA,2CAAKC,MAAO/B,EAAaO,OACxBQ,EAAA,cAAAe,IAAA,2CAAYE,KAAK,IAAIC,UAAWnB,KAAKoB,eAAgBC,KAAK,OAAOb,QAASA,EAASM,QAASA,EA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