@gov-design-system-ce/components 4.0.6 → 4.0.7

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 (435) hide show
  1. package/dist/cjs/core.cjs.js +1 -1
  2. package/dist/cjs/gov-accordion-item.cjs.entry.js +1 -1
  3. package/dist/cjs/gov-accordion.cjs.entry.js +1 -1
  4. package/dist/cjs/gov-attachments_3.cjs.entry.js +1 -1
  5. package/dist/cjs/gov-backdrop.cjs.entry.js +1 -1
  6. package/dist/cjs/gov-breadcrumbs.cjs.entry.js +26 -3
  7. package/dist/cjs/gov-breadcrumbs.cjs.entry.js.map +1 -1
  8. package/dist/cjs/gov-button.cjs.entry.js +7 -4
  9. package/dist/cjs/gov-button.cjs.entry.js.map +1 -1
  10. package/dist/cjs/gov-card.cjs.entry.js +1 -1
  11. package/dist/cjs/gov-chip.cjs.entry.js +2 -2
  12. package/dist/cjs/gov-chip.cjs.entry.js.map +1 -1
  13. package/dist/cjs/gov-container.cjs.entry.js +1 -1
  14. package/dist/cjs/gov-control-group.cjs.entry.js +1 -1
  15. package/dist/cjs/gov-cookiebar.cjs.entry.js +1 -1
  16. package/dist/cjs/gov-dropdown.cjs.entry.js +1 -1
  17. package/dist/cjs/gov-empty.cjs.entry.js +1 -1
  18. package/dist/cjs/gov-error-code.cjs.entry.js +1 -1
  19. package/dist/cjs/gov-form-autocomplete.cjs.entry.js +1 -1
  20. package/dist/cjs/gov-form-checkbox.cjs.entry.js +1 -1
  21. package/dist/cjs/gov-form-control.cjs.entry.js +1 -1
  22. package/dist/cjs/gov-form-file.cjs.entry.js +16 -4
  23. package/dist/cjs/gov-form-file.cjs.entry.js.map +1 -1
  24. package/dist/cjs/gov-form-group.cjs.entry.js +1 -1
  25. package/dist/cjs/gov-form-input.cjs.entry.js +5 -1
  26. package/dist/cjs/gov-form-input.cjs.entry.js.map +1 -1
  27. package/dist/cjs/gov-form-multi-select.cjs.entry.js +1 -1
  28. package/dist/cjs/gov-form-radio.cjs.entry.js +1 -1
  29. package/dist/cjs/gov-form-search.cjs.entry.js +1 -1
  30. package/dist/cjs/gov-form-search.cjs.entry.js.map +1 -1
  31. package/dist/cjs/gov-form-select.cjs.entry.js +1 -1
  32. package/dist/cjs/gov-form-switch.cjs.entry.js +1 -1
  33. package/dist/cjs/gov-grid-item.cjs.entry.js +1 -1
  34. package/dist/cjs/gov-grid.cjs.entry.js +1 -1
  35. package/dist/cjs/gov-icon.cjs.entry.js +2 -2
  36. package/dist/cjs/gov-infobar.cjs.entry.js +3 -2
  37. package/dist/cjs/gov-infobar.cjs.entry.js.map +1 -1
  38. package/dist/cjs/gov-layout-column.cjs.entry.js +1 -1
  39. package/dist/cjs/gov-layout.cjs.entry.js +1 -1
  40. package/dist/cjs/gov-loading.cjs.entry.js +1 -1
  41. package/dist/cjs/gov-message.cjs.entry.js +1 -1
  42. package/dist/cjs/gov-modal.cjs.entry.js +5 -2
  43. package/dist/cjs/gov-modal.cjs.entry.js.map +1 -1
  44. package/dist/cjs/gov-pagination.cjs.entry.js +8 -4
  45. package/dist/cjs/gov-pagination.cjs.entry.js.map +1 -1
  46. package/dist/cjs/gov-prompt.cjs.entry.js +5 -2
  47. package/dist/cjs/gov-prompt.cjs.entry.js.map +1 -1
  48. package/dist/cjs/gov-side-nav-item.cjs.entry.js +1 -1
  49. package/dist/cjs/gov-side-nav.cjs.entry.js +1 -1
  50. package/dist/cjs/gov-skeleton.cjs.entry.js +1 -1
  51. package/dist/cjs/gov-spacer.cjs.entry.js +1 -1
  52. package/dist/cjs/gov-statsbar-item.cjs.entry.js +1 -1
  53. package/dist/cjs/gov-statsbar.cjs.entry.js +1 -1
  54. package/dist/cjs/gov-stepper-item.cjs.entry.js +1 -1
  55. package/dist/cjs/gov-stepper.cjs.entry.js +1 -1
  56. package/dist/cjs/gov-tabs-item.cjs.entry.js +1 -1
  57. package/dist/cjs/gov-tabs.cjs.entry.js +1 -1
  58. package/dist/cjs/gov-tag.cjs.entry.js +2 -2
  59. package/dist/cjs/gov-tag.cjs.entry.js.map +1 -1
  60. package/dist/cjs/gov-tile.cjs.entry.js +3 -3
  61. package/dist/cjs/gov-tile.cjs.entry.js.map +1 -1
  62. package/dist/cjs/gov-tiles.cjs.entry.js +1 -1
  63. package/dist/cjs/gov-toast.cjs.entry.js +1 -1
  64. package/dist/cjs/gov-tooltip-content.cjs.entry.js +2 -2
  65. package/dist/cjs/gov-tooltip-content.cjs.entry.js.map +1 -1
  66. package/dist/cjs/gov-tooltip.cjs.entry.js +8 -9
  67. package/dist/cjs/gov-tooltip.cjs.entry.js.map +1 -1
  68. package/dist/cjs/gov-wizard-item.cjs.entry.js +1 -1
  69. package/dist/cjs/gov-wizard.cjs.entry.js +1 -1
  70. package/dist/cjs/loader.cjs.js +1 -1
  71. package/dist/cjs/{template-4b951d1d.js → template-9534c584.js} +5 -1
  72. package/dist/cjs/template-9534c584.js.map +1 -0
  73. package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.css +58 -16
  74. package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.js +48 -1
  75. package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.js.map +1 -1
  76. package/dist/collection/components/gov-button/button/gov-button.css +1 -1
  77. package/dist/collection/components/gov-button/button/gov-button.js +13 -16
  78. package/dist/collection/components/gov-button/button/gov-button.js.map +1 -1
  79. package/dist/collection/components/gov-chip/gov-chip.css +2 -6
  80. package/dist/collection/components/gov-form/file/gov-form-file.js +51 -3
  81. package/dist/collection/components/gov-form/file/gov-form-file.js.map +1 -1
  82. package/dist/collection/components/gov-form/input/gov-form-input.js +18 -0
  83. package/dist/collection/components/gov-form/input/gov-form-input.js.map +1 -1
  84. package/dist/collection/components/gov-form/search/gov-form-search.css +1 -1
  85. package/dist/collection/components/gov-infobar/gov-infobar.js +25 -1
  86. package/dist/collection/components/gov-infobar/gov-infobar.js.map +1 -1
  87. package/dist/collection/components/gov-modal/gov-modal.js +6 -3
  88. package/dist/collection/components/gov-modal/gov-modal.js.map +1 -1
  89. package/dist/collection/components/gov-pagination/gov-pagination.js +80 -5
  90. package/dist/collection/components/gov-pagination/gov-pagination.js.map +1 -1
  91. package/dist/collection/components/gov-promp/gov-prompt.js +4 -1
  92. package/dist/collection/components/gov-promp/gov-prompt.js.map +1 -1
  93. package/dist/collection/components/gov-tag/gov-tag.css +5 -100
  94. package/dist/collection/components/gov-tile/gov-tile.css +3 -5
  95. package/dist/collection/components/gov-tile/gov-tile.js +1 -1
  96. package/dist/collection/components/gov-tile/gov-tile.js.map +1 -1
  97. package/dist/collection/components/gov-tooltip/gov-tooltip-content.css +2 -1
  98. package/dist/collection/components/gov-tooltip/gov-tooltip.js +7 -8
  99. package/dist/collection/components/gov-tooltip/gov-tooltip.js.map +1 -1
  100. package/dist/collection/helpers/Dom/template.js +3 -0
  101. package/dist/collection/helpers/Dom/template.js.map +1 -1
  102. package/dist/collection/pages/Breadcrumbs.js +3 -2
  103. package/dist/collection/pages/Breadcrumbs.js.map +1 -1
  104. package/dist/collection/pages/Button.js +101 -101
  105. package/dist/collection/pages/Button.js.map +1 -1
  106. package/dist/collection/pages/Chip.js +50 -50
  107. package/dist/collection/pages/Chip.js.map +1 -1
  108. package/dist/collection/pages/Forms.js +19 -10
  109. package/dist/collection/pages/Forms.js.map +1 -1
  110. package/dist/collection/pages/Tag.js +27 -27
  111. package/dist/collection/pages/Tag.js.map +1 -1
  112. package/dist/collection/pages/Tooltip.js +13 -16
  113. package/dist/collection/pages/Tooltip.js.map +1 -1
  114. package/dist/components/gov-accordion-item.js +1 -1
  115. package/dist/components/gov-accordion.js +1 -1
  116. package/dist/components/gov-attachments-item.js +1 -1
  117. package/dist/components/gov-attachments.js +1 -1
  118. package/dist/components/gov-backdrop.js +1 -1
  119. package/dist/components/gov-breadcrumbs.js +1 -1
  120. package/dist/components/gov-breadcrumbs.js.map +1 -1
  121. package/dist/components/gov-button.js +1 -1
  122. package/dist/components/gov-card.js +1 -1
  123. package/dist/components/gov-chip.js +1 -1
  124. package/dist/components/gov-container.js +1 -1
  125. package/dist/components/gov-control-group.js +1 -1
  126. package/dist/components/gov-cookiebar.js +1 -1
  127. package/dist/components/gov-dropdown.js +1 -1
  128. package/dist/components/gov-empty.js +1 -1
  129. package/dist/components/gov-error-code.js +1 -1
  130. package/dist/components/gov-form-autocomplete.js +1 -1
  131. package/dist/components/gov-form-checkbox.js +1 -1
  132. package/dist/components/gov-form-control.js +1 -1
  133. package/dist/components/gov-form-file.js +1 -1
  134. package/dist/components/gov-form-file.js.map +1 -1
  135. package/dist/components/gov-form-group.js +1 -1
  136. package/dist/components/gov-form-input.js +1 -1
  137. package/dist/components/gov-form-message.js +1 -1
  138. package/dist/components/gov-form-multi-select.js +1 -1
  139. package/dist/components/gov-form-radio.js +1 -1
  140. package/dist/components/gov-form-search.js +1 -1
  141. package/dist/components/gov-form-search.js.map +1 -1
  142. package/dist/components/gov-form-select.js +1 -1
  143. package/dist/components/gov-form-switch.js +1 -1
  144. package/dist/components/gov-grid-item.js +1 -1
  145. package/dist/components/gov-grid.js +1 -1
  146. package/dist/components/gov-icon.js +1 -1
  147. package/dist/components/gov-infobar.js +1 -1
  148. package/dist/components/gov-infobar.js.map +1 -1
  149. package/dist/components/gov-layout-column.js +1 -1
  150. package/dist/components/gov-layout.js +1 -1
  151. package/dist/components/gov-loading.js +1 -1
  152. package/dist/components/gov-message.js +1 -1
  153. package/dist/components/gov-modal.js +1 -1
  154. package/dist/components/gov-modal.js.map +1 -1
  155. package/dist/components/gov-pagination.js +1 -1
  156. package/dist/components/gov-pagination.js.map +1 -1
  157. package/dist/components/gov-prompt.js +1 -1
  158. package/dist/components/gov-prompt.js.map +1 -1
  159. package/dist/components/gov-side-nav-item.js +1 -1
  160. package/dist/components/gov-side-nav.js +1 -1
  161. package/dist/components/gov-side-nav.js.map +1 -1
  162. package/dist/components/gov-skeleton.js +1 -1
  163. package/dist/components/gov-skeleton.js.map +1 -1
  164. package/dist/components/gov-spacer.js +1 -1
  165. package/dist/components/gov-statsbar-item.js +1 -1
  166. package/dist/components/gov-statsbar.js +1 -1
  167. package/dist/components/gov-stepper-item.js +1 -1
  168. package/dist/components/gov-stepper.js +1 -1
  169. package/dist/components/gov-tabs-item.js +1 -1
  170. package/dist/components/gov-tabs.js +1 -1
  171. package/dist/components/gov-tag.js +1 -1
  172. package/dist/components/gov-tag.js.map +1 -1
  173. package/dist/components/gov-tile.js +1 -1
  174. package/dist/components/gov-tile.js.map +1 -1
  175. package/dist/components/gov-tiles.js +1 -1
  176. package/dist/components/gov-toast.js +1 -1
  177. package/dist/components/gov-tooltip-content.js +1 -1
  178. package/dist/components/gov-tooltip-content.js.map +1 -1
  179. package/dist/components/gov-tooltip.js +1 -1
  180. package/dist/components/gov-tooltip.js.map +1 -1
  181. package/dist/components/gov-wizard-item.js +1 -1
  182. package/dist/components/gov-wizard.js +1 -1
  183. package/dist/components/{p-b526e440.js → p-033f8bda.js} +2 -2
  184. package/dist/components/{p-43554d2d.js → p-2d5d24af.js} +2 -2
  185. package/dist/components/{p-ec6c2272.js → p-44762d17.js} +2 -2
  186. package/dist/components/{p-62074db5.js → p-5dbe0178.js} +2 -2
  187. package/dist/components/{p-d29431c0.js → p-76b229e3.js} +2 -2
  188. package/dist/components/p-76b229e3.js.map +1 -0
  189. package/dist/components/{p-6f391c4a.js → p-8b7b916a.js} +2 -2
  190. package/dist/components/{p-990d2990.js → p-976404a5.js} +2 -2
  191. package/dist/components/p-976404a5.js.map +1 -0
  192. package/dist/components/p-99860f34.js +2 -0
  193. package/dist/components/p-99860f34.js.map +1 -0
  194. package/dist/components/{p-9795ad94.js → p-b9ee51d6.js} +2 -2
  195. package/dist/{core/p-28e59384.js → components/p-c353678b.js} +2 -2
  196. package/dist/components/p-c353678b.js.map +1 -0
  197. package/dist/components/{p-570803ab.js → p-f8b7ea69.js} +2 -2
  198. package/dist/core/core.css +1 -1
  199. package/dist/core/core.esm.js +1 -1
  200. package/dist/core/core.esm.js.map +1 -1
  201. package/dist/core/{p-96d141a3.entry.js → p-0028fadc.entry.js} +2 -2
  202. package/dist/core/{p-2969eb69.entry.js → p-0ab12526.entry.js} +2 -2
  203. package/dist/core/{p-22abe742.entry.js → p-0c5c6dee.entry.js} +2 -2
  204. package/dist/core/{p-1116fec6.entry.js → p-127af1b4.entry.js} +2 -2
  205. package/dist/core/{p-fd4b0f54.entry.js → p-148501cc.entry.js} +2 -2
  206. package/dist/core/{p-fb51d693.entry.js → p-151f1b89.entry.js} +2 -2
  207. package/dist/core/{p-bb7f0a66.entry.js → p-1bc2f62c.entry.js} +2 -2
  208. package/dist/core/p-1cbd2c7c.entry.js +2 -0
  209. package/dist/core/p-1cbd2c7c.entry.js.map +1 -0
  210. package/dist/core/{p-6dc942b8.entry.js → p-2d1f3d62.entry.js} +2 -2
  211. package/dist/core/p-2d1f3d62.entry.js.map +1 -0
  212. package/dist/core/p-30673e46.entry.js +2 -0
  213. package/dist/core/p-30673e46.entry.js.map +1 -0
  214. package/dist/core/{p-de3429ab.entry.js → p-3975851f.entry.js} +2 -2
  215. package/dist/core/{p-141d9af4.entry.js → p-4988c0bb.entry.js} +2 -2
  216. package/dist/core/{p-83e998d8.entry.js → p-529ce9a4.entry.js} +2 -2
  217. package/dist/core/{p-2712444e.entry.js → p-531c350f.entry.js} +2 -2
  218. package/dist/core/p-531c350f.entry.js.map +1 -0
  219. package/dist/core/{p-fc2a1e14.entry.js → p-53e0ad52.entry.js} +2 -2
  220. package/dist/core/{p-81593c86.entry.js → p-54fa7af5.entry.js} +2 -2
  221. package/dist/core/{p-41c18f64.entry.js → p-555eaa93.entry.js} +2 -2
  222. package/dist/core/{p-e24236b0.entry.js → p-55cb727e.entry.js} +2 -2
  223. package/dist/{components/p-28e59384.js → core/p-5de606f8.js} +2 -2
  224. package/dist/core/p-5de606f8.js.map +1 -0
  225. package/dist/core/{p-3c12c766.entry.js → p-60d681a6.entry.js} +2 -2
  226. package/dist/core/{p-b4a59c79.entry.js → p-64c5748e.entry.js} +2 -2
  227. package/dist/core/p-64c5748e.entry.js.map +1 -0
  228. package/dist/core/p-67096d72.entry.js +2 -0
  229. package/dist/core/p-67096d72.entry.js.map +1 -0
  230. package/dist/core/{p-b49293dc.entry.js → p-6bf8e7bf.entry.js} +2 -2
  231. package/dist/core/{p-89b3e4d4.entry.js → p-72c5997f.entry.js} +2 -2
  232. package/dist/core/p-7f158b6f.entry.js +2 -0
  233. package/dist/core/p-7f158b6f.entry.js.map +1 -0
  234. package/dist/core/{p-9c6699d6.entry.js → p-835f1187.entry.js} +2 -2
  235. package/dist/core/p-835f1187.entry.js.map +1 -0
  236. package/dist/core/{p-01d928c5.entry.js → p-90c068ff.entry.js} +2 -2
  237. package/dist/core/{p-cf86a858.entry.js → p-927880d6.entry.js} +2 -2
  238. package/dist/core/{p-fc8a29e9.entry.js → p-9402e4cc.entry.js} +2 -2
  239. package/dist/core/{p-b4ab0d15.entry.js → p-9469ecc2.entry.js} +2 -2
  240. package/dist/core/{p-f29b0193.entry.js → p-984b36f7.entry.js} +2 -2
  241. package/dist/core/p-9c04470d.entry.js +2 -0
  242. package/dist/core/p-9c04470d.entry.js.map +1 -0
  243. package/dist/core/{p-ccf73a1a.entry.js → p-a35484ed.entry.js} +2 -2
  244. package/dist/core/p-a49391e5.entry.js +2 -0
  245. package/dist/core/p-a49391e5.entry.js.map +1 -0
  246. package/dist/core/{p-b127c8a8.entry.js → p-aaf2510a.entry.js} +2 -2
  247. package/dist/core/p-aaf2510a.entry.js.map +1 -0
  248. package/dist/core/{p-b7d23697.entry.js → p-ac856de6.entry.js} +2 -2
  249. package/dist/core/p-ac856de6.entry.js.map +1 -0
  250. package/dist/core/{p-b580666b.entry.js → p-adf276b0.entry.js} +2 -2
  251. package/dist/core/{p-e5c2f601.entry.js → p-b7e0b030.entry.js} +2 -2
  252. package/dist/core/{p-78942f76.entry.js → p-be8eec3f.entry.js} +2 -2
  253. package/dist/core/{p-f1227928.entry.js → p-c6a4ca41.entry.js} +2 -2
  254. package/dist/core/{p-67138ae9.entry.js → p-ce1486b8.entry.js} +2 -2
  255. package/dist/core/{p-ee4c58e3.entry.js → p-d2c370d6.entry.js} +2 -2
  256. package/dist/core/p-d513468a.entry.js +2 -0
  257. package/dist/core/p-d513468a.entry.js.map +1 -0
  258. package/dist/core/{p-ac5e5b2c.entry.js → p-dd4445ee.entry.js} +2 -2
  259. package/dist/core/{p-f76f0a67.entry.js → p-e3b14974.entry.js} +2 -2
  260. package/dist/core/{p-92af05f2.entry.js → p-e4f11ddf.entry.js} +2 -2
  261. package/dist/core/{p-6675a0f0.entry.js → p-eaedc9e3.entry.js} +2 -2
  262. package/dist/core/{p-b5e1ee46.entry.js → p-ed580ac7.entry.js} +2 -2
  263. package/dist/core/{p-3b42950e.entry.js → p-f1031bac.entry.js} +2 -2
  264. package/dist/core/{p-f636a1ca.entry.js → p-f2206bbb.entry.js} +2 -2
  265. package/dist/core/{p-497c90ea.entry.js → p-f4f969d0.entry.js} +2 -2
  266. package/dist/core/p-f4f969d0.entry.js.map +1 -0
  267. package/dist/core/{p-4a235ef5.entry.js → p-f59b858f.entry.js} +2 -2
  268. package/dist/core/{p-d69599bc.entry.js → p-f7065042.entry.js} +2 -2
  269. package/dist/core/{p-b1184db4.entry.js → p-f9dcaafb.entry.js} +2 -2
  270. package/dist/core/{p-7757e4a1.entry.js → p-fc710edb.entry.js} +2 -2
  271. package/dist/esm/core.js +1 -1
  272. package/dist/esm/gov-accordion-item.entry.js +1 -1
  273. package/dist/esm/gov-accordion.entry.js +1 -1
  274. package/dist/esm/gov-attachments_3.entry.js +1 -1
  275. package/dist/esm/gov-backdrop.entry.js +1 -1
  276. package/dist/esm/gov-breadcrumbs.entry.js +26 -3
  277. package/dist/esm/gov-breadcrumbs.entry.js.map +1 -1
  278. package/dist/esm/gov-button.entry.js +7 -4
  279. package/dist/esm/gov-button.entry.js.map +1 -1
  280. package/dist/esm/gov-card.entry.js +1 -1
  281. package/dist/esm/gov-chip.entry.js +2 -2
  282. package/dist/esm/gov-chip.entry.js.map +1 -1
  283. package/dist/esm/gov-container.entry.js +1 -1
  284. package/dist/esm/gov-control-group.entry.js +1 -1
  285. package/dist/esm/gov-cookiebar.entry.js +1 -1
  286. package/dist/esm/gov-dropdown.entry.js +1 -1
  287. package/dist/esm/gov-empty.entry.js +1 -1
  288. package/dist/esm/gov-error-code.entry.js +1 -1
  289. package/dist/esm/gov-form-autocomplete.entry.js +1 -1
  290. package/dist/esm/gov-form-checkbox.entry.js +1 -1
  291. package/dist/esm/gov-form-control.entry.js +1 -1
  292. package/dist/esm/gov-form-file.entry.js +16 -4
  293. package/dist/esm/gov-form-file.entry.js.map +1 -1
  294. package/dist/esm/gov-form-group.entry.js +1 -1
  295. package/dist/esm/gov-form-input.entry.js +5 -1
  296. package/dist/esm/gov-form-input.entry.js.map +1 -1
  297. package/dist/esm/gov-form-multi-select.entry.js +1 -1
  298. package/dist/esm/gov-form-radio.entry.js +1 -1
  299. package/dist/esm/gov-form-search.entry.js +1 -1
  300. package/dist/esm/gov-form-search.entry.js.map +1 -1
  301. package/dist/esm/gov-form-select.entry.js +1 -1
  302. package/dist/esm/gov-form-switch.entry.js +1 -1
  303. package/dist/esm/gov-grid-item.entry.js +1 -1
  304. package/dist/esm/gov-grid.entry.js +1 -1
  305. package/dist/esm/gov-icon.entry.js +2 -2
  306. package/dist/esm/gov-infobar.entry.js +3 -2
  307. package/dist/esm/gov-infobar.entry.js.map +1 -1
  308. package/dist/esm/gov-layout-column.entry.js +1 -1
  309. package/dist/esm/gov-layout.entry.js +1 -1
  310. package/dist/esm/gov-loading.entry.js +1 -1
  311. package/dist/esm/gov-message.entry.js +1 -1
  312. package/dist/esm/gov-modal.entry.js +5 -2
  313. package/dist/esm/gov-modal.entry.js.map +1 -1
  314. package/dist/esm/gov-pagination.entry.js +8 -4
  315. package/dist/esm/gov-pagination.entry.js.map +1 -1
  316. package/dist/esm/gov-prompt.entry.js +5 -2
  317. package/dist/esm/gov-prompt.entry.js.map +1 -1
  318. package/dist/esm/gov-side-nav-item.entry.js +1 -1
  319. package/dist/esm/gov-side-nav.entry.js +1 -1
  320. package/dist/esm/gov-skeleton.entry.js +1 -1
  321. package/dist/esm/gov-spacer.entry.js +1 -1
  322. package/dist/esm/gov-statsbar-item.entry.js +1 -1
  323. package/dist/esm/gov-statsbar.entry.js +1 -1
  324. package/dist/esm/gov-stepper-item.entry.js +1 -1
  325. package/dist/esm/gov-stepper.entry.js +1 -1
  326. package/dist/esm/gov-tabs-item.entry.js +1 -1
  327. package/dist/esm/gov-tabs.entry.js +1 -1
  328. package/dist/esm/gov-tag.entry.js +2 -2
  329. package/dist/esm/gov-tag.entry.js.map +1 -1
  330. package/dist/esm/gov-tile.entry.js +3 -3
  331. package/dist/esm/gov-tile.entry.js.map +1 -1
  332. package/dist/esm/gov-tiles.entry.js +1 -1
  333. package/dist/esm/gov-toast.entry.js +1 -1
  334. package/dist/esm/gov-tooltip-content.entry.js +2 -2
  335. package/dist/esm/gov-tooltip-content.entry.js.map +1 -1
  336. package/dist/esm/gov-tooltip.entry.js +8 -9
  337. package/dist/esm/gov-tooltip.entry.js.map +1 -1
  338. package/dist/esm/gov-wizard-item.entry.js +1 -1
  339. package/dist/esm/gov-wizard.entry.js +1 -1
  340. package/dist/esm/loader.js +1 -1
  341. package/dist/esm/{template-df429738.js → template-a0067bb6.js} +5 -2
  342. package/dist/esm/template-a0067bb6.js.map +1 -0
  343. package/dist/hydrate/index.js +94 -30
  344. package/dist/stencil.config.js +23 -1
  345. package/dist/stencil.config.js.map +1 -1
  346. package/dist/types/Users/iwory/iWork/asseco/mv/gov-design-system-ce/packages/core/.stencil/packages/core/stencil.config.d.ts +2 -0
  347. package/dist/types/components/gov-breadcrumbs/gov-breadcrumbs.d.ts +9 -0
  348. package/dist/types/components/gov-button/button/gov-button.d.ts +5 -4
  349. package/dist/types/components/gov-form/file/gov-form-file.d.ts +9 -0
  350. package/dist/types/components/gov-form/input/gov-form-input.d.ts +5 -0
  351. package/dist/types/components/gov-infobar/gov-infobar.d.ts +4 -0
  352. package/dist/types/components/gov-modal/gov-modal.d.ts +1 -0
  353. package/dist/types/components/gov-pagination/gov-pagination.d.ts +17 -1
  354. package/dist/types/components/gov-promp/gov-prompt.d.ts +1 -0
  355. package/dist/types/components/gov-tile/gov-tile.d.ts +3 -3
  356. package/dist/types/components.d.ts +72 -4
  357. package/dist/types/helpers/Dom/template.d.ts +1 -0
  358. package/package.json +2 -2
  359. package/dist/cjs/template-4b951d1d.js.map +0 -1
  360. package/dist/components/p-28e59384.js.map +0 -1
  361. package/dist/components/p-990d2990.js.map +0 -1
  362. package/dist/components/p-a3d5a7e3.js +0 -2
  363. package/dist/components/p-a3d5a7e3.js.map +0 -1
  364. package/dist/components/p-d29431c0.js.map +0 -1
  365. package/dist/core/p-044f4c35.entry.js +0 -2
  366. package/dist/core/p-044f4c35.entry.js.map +0 -1
  367. package/dist/core/p-09966eaa.entry.js +0 -2
  368. package/dist/core/p-09966eaa.entry.js.map +0 -1
  369. package/dist/core/p-2712444e.entry.js.map +0 -1
  370. package/dist/core/p-28e59384.js.map +0 -1
  371. package/dist/core/p-2f858bf5.entry.js +0 -2
  372. package/dist/core/p-2f858bf5.entry.js.map +0 -1
  373. package/dist/core/p-497c90ea.entry.js.map +0 -1
  374. package/dist/core/p-6dc942b8.entry.js.map +0 -1
  375. package/dist/core/p-73b7585b.entry.js +0 -2
  376. package/dist/core/p-73b7585b.entry.js.map +0 -1
  377. package/dist/core/p-9c6699d6.entry.js.map +0 -1
  378. package/dist/core/p-a63bb91e.entry.js +0 -2
  379. package/dist/core/p-a63bb91e.entry.js.map +0 -1
  380. package/dist/core/p-a6b6dc73.entry.js +0 -2
  381. package/dist/core/p-a6b6dc73.entry.js.map +0 -1
  382. package/dist/core/p-b127c8a8.entry.js.map +0 -1
  383. package/dist/core/p-b4a59c79.entry.js.map +0 -1
  384. package/dist/core/p-b7d23697.entry.js.map +0 -1
  385. package/dist/core/p-c574ecc8.entry.js +0 -2
  386. package/dist/core/p-c574ecc8.entry.js.map +0 -1
  387. package/dist/esm/template-df429738.js.map +0 -1
  388. package/dist/types/Users/leo/Projects/repos/asseco/design-system/gov-design-system-ce/packages/core/.stencil/packages/core/stencil.config.d.ts +0 -2
  389. /package/dist/components/{p-b526e440.js.map → p-033f8bda.js.map} +0 -0
  390. /package/dist/components/{p-43554d2d.js.map → p-2d5d24af.js.map} +0 -0
  391. /package/dist/components/{p-ec6c2272.js.map → p-44762d17.js.map} +0 -0
  392. /package/dist/components/{p-62074db5.js.map → p-5dbe0178.js.map} +0 -0
  393. /package/dist/components/{p-6f391c4a.js.map → p-8b7b916a.js.map} +0 -0
  394. /package/dist/components/{p-9795ad94.js.map → p-b9ee51d6.js.map} +0 -0
  395. /package/dist/components/{p-570803ab.js.map → p-f8b7ea69.js.map} +0 -0
  396. /package/dist/core/{p-96d141a3.entry.js.map → p-0028fadc.entry.js.map} +0 -0
  397. /package/dist/core/{p-2969eb69.entry.js.map → p-0ab12526.entry.js.map} +0 -0
  398. /package/dist/core/{p-22abe742.entry.js.map → p-0c5c6dee.entry.js.map} +0 -0
  399. /package/dist/core/{p-1116fec6.entry.js.map → p-127af1b4.entry.js.map} +0 -0
  400. /package/dist/core/{p-fd4b0f54.entry.js.map → p-148501cc.entry.js.map} +0 -0
  401. /package/dist/core/{p-fb51d693.entry.js.map → p-151f1b89.entry.js.map} +0 -0
  402. /package/dist/core/{p-bb7f0a66.entry.js.map → p-1bc2f62c.entry.js.map} +0 -0
  403. /package/dist/core/{p-de3429ab.entry.js.map → p-3975851f.entry.js.map} +0 -0
  404. /package/dist/core/{p-141d9af4.entry.js.map → p-4988c0bb.entry.js.map} +0 -0
  405. /package/dist/core/{p-83e998d8.entry.js.map → p-529ce9a4.entry.js.map} +0 -0
  406. /package/dist/core/{p-fc2a1e14.entry.js.map → p-53e0ad52.entry.js.map} +0 -0
  407. /package/dist/core/{p-81593c86.entry.js.map → p-54fa7af5.entry.js.map} +0 -0
  408. /package/dist/core/{p-41c18f64.entry.js.map → p-555eaa93.entry.js.map} +0 -0
  409. /package/dist/core/{p-e24236b0.entry.js.map → p-55cb727e.entry.js.map} +0 -0
  410. /package/dist/core/{p-3c12c766.entry.js.map → p-60d681a6.entry.js.map} +0 -0
  411. /package/dist/core/{p-b49293dc.entry.js.map → p-6bf8e7bf.entry.js.map} +0 -0
  412. /package/dist/core/{p-89b3e4d4.entry.js.map → p-72c5997f.entry.js.map} +0 -0
  413. /package/dist/core/{p-01d928c5.entry.js.map → p-90c068ff.entry.js.map} +0 -0
  414. /package/dist/core/{p-cf86a858.entry.js.map → p-927880d6.entry.js.map} +0 -0
  415. /package/dist/core/{p-fc8a29e9.entry.js.map → p-9402e4cc.entry.js.map} +0 -0
  416. /package/dist/core/{p-b4ab0d15.entry.js.map → p-9469ecc2.entry.js.map} +0 -0
  417. /package/dist/core/{p-f29b0193.entry.js.map → p-984b36f7.entry.js.map} +0 -0
  418. /package/dist/core/{p-ccf73a1a.entry.js.map → p-a35484ed.entry.js.map} +0 -0
  419. /package/dist/core/{p-b580666b.entry.js.map → p-adf276b0.entry.js.map} +0 -0
  420. /package/dist/core/{p-e5c2f601.entry.js.map → p-b7e0b030.entry.js.map} +0 -0
  421. /package/dist/core/{p-78942f76.entry.js.map → p-be8eec3f.entry.js.map} +0 -0
  422. /package/dist/core/{p-f1227928.entry.js.map → p-c6a4ca41.entry.js.map} +0 -0
  423. /package/dist/core/{p-67138ae9.entry.js.map → p-ce1486b8.entry.js.map} +0 -0
  424. /package/dist/core/{p-ee4c58e3.entry.js.map → p-d2c370d6.entry.js.map} +0 -0
  425. /package/dist/core/{p-ac5e5b2c.entry.js.map → p-dd4445ee.entry.js.map} +0 -0
  426. /package/dist/core/{p-f76f0a67.entry.js.map → p-e3b14974.entry.js.map} +0 -0
  427. /package/dist/core/{p-92af05f2.entry.js.map → p-e4f11ddf.entry.js.map} +0 -0
  428. /package/dist/core/{p-6675a0f0.entry.js.map → p-eaedc9e3.entry.js.map} +0 -0
  429. /package/dist/core/{p-b5e1ee46.entry.js.map → p-ed580ac7.entry.js.map} +0 -0
  430. /package/dist/core/{p-3b42950e.entry.js.map → p-f1031bac.entry.js.map} +0 -0
  431. /package/dist/core/{p-f636a1ca.entry.js.map → p-f2206bbb.entry.js.map} +0 -0
  432. /package/dist/core/{p-4a235ef5.entry.js.map → p-f59b858f.entry.js.map} +0 -0
  433. /package/dist/core/{p-d69599bc.entry.js.map → p-f7065042.entry.js.map} +0 -0
  434. /package/dist/core/{p-b1184db4.entry.js.map → p-f9dcaafb.entry.js.map} +0 -0
  435. /package/dist/core/{p-7757e4a1.entry.js.map → p-fc710edb.entry.js.map} +0 -0
@@ -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","createArrayRange","to","Number","isInteger","slice","govPaginationCss","GovPagination","constructor","hostRef","this","h","govHost","host","pageSelectId","createID","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","isDisabled","ariaCurrent","toBoolAttrIfDefined","href","type","disabled","e","onClickHandler","wcagPageLabel","class","Host","classes","wcagLabel","wcagLabelledBy","prepareClasses","name","id","hidden","wcagSelectLabel","onSelectHandler","bind","selected","Fragment","ref","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/utils/array.utils.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","export const createArrayRange = (from: number, to: number): number[] => {\n\tif (Number.isInteger(from) && Number.isInteger(to)) {\n\t\treturn [...Array(to + 1).keys()].slice(from)\n\t}\n\treturn []\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\tPaginationSizeType,\n\tPaginationSizes,\n\tPaginationVariantType,\n\tPaginationType,\n\tPaginationTypes,\n\tPaginationVariants,\n} from \"./constants\"\nimport { govHost, prepareClasses } from \"../../helpers/Dom/template\"\nimport { paginate, Pagination } from \"./pagination\"\nimport { toBoolAttrIfDefined } from \"../../helpers/Dom/template\"\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\n\tprivate spreadSelectRef?: HTMLGovFormSelectElement\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.pageSelectId = createID(\"GovPageSelect\")\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 * 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 wcagSelectLabel: string = \"Vybrat stranu\"\n\t/**\n\t * Adds accessible label for the page item\n\t */\n\t@Prop({ attribute: \"wcag-page-label\" }) readonly wcagPageLabel: string = \"Strana\"\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) => {\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={page > -1 ? this.wcagPageLabel + \" \" + 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)}\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)}\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.wcagSelectLabel}\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=\"m\"\n\t\t\t\t\t\t\t\t\t\tvariant={this.variant}\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.wcagSelectLabel}\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=\"m\"\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\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)}\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)}\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.wcagPageLabel, \"wcag-page-label\", PaginationClass.root)\n\t\tvalidateWcagLabel(this.wcagLabel, this.wcagLabelledBy, PaginationClass.root)\n\t}\n}\n"],"mappings":"wbAKO,MAAMA,EAAkBC,EAAKC,EAAO,CAAC,KAAM,OAG3C,MAAMC,EAAqBF,EAAKG,EAAU,CAAC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Ac6B,KAAKqB,WAAW/C,YAAc,EACzF2B,EAAA,YAAUgD,MAAOzF,EAAgBQ,MAAOuF,KAAK,6B,CAS5C,cAAAR,CAAeD,EAAgBrB,GACtCqB,EAAEkB,kBACFhE,KAAKY,sBAAsBa,GAC3BzB,KAAKiE,QAAQC,KAAK,CACjBC,UAAW3G,EAAgBC,KAC3B4D,WAAYrB,KAAKqB,Y,CAIX,eAAAsC,CAAgBb,GACvBA,EAAEkB,kBACF,MAAM5B,EAAQU,EAAEsB,OAAOhC,MACvB,MAAMX,EAAO4C,SAASjC,GACtBpC,KAAK+B,mBACL,GAAIuC,MAAM7C,KAAU,MAAO,CAC1BzB,KAAKY,sBAAsBa,GAC3B,GAAIzB,KAAK2B,KAAM,CACd4C,OAAOC,SAAS7B,KAAO3C,KAAK0B,eAAeD,E,KACrC,CACNzB,KAAKiE,QAAQC,KAAK,CACjBC,UAAW3G,EAAgBC,KAC3B4D,WAAYrB,KAAKqB,Y,GAUrB,kBAAMD,GACLqD,EAAiBzE,KAAKgD,cAAe,kBAAmBxF,EAAgBC,MACxEiH,EAAkB1E,KAAKoD,UAAWpD,KAAKqD,eAAgB7F,EAAgBC,K"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["prepareClasses","classes","Array","isArray","filter","classname","join","trim","slottedChildren","host","slotted","querySelector","assignedNodes","node","nodeName","booleanString","value","govHost","hostElement","name","this","toLowerCase","hasSlot","getSlot","isSlotEmpty","slot","childNodes","length","getParent","element","closest","passChildAttr","selector","forEach","querySelectorAll","child","setAttribute","removeChildAttr","removeAttribute","shadowRoot","clearClasses","classList","toString","toBoolAttr","indexOf","toOnOffAttr","toBoolAttrIfDefined","undefined","toOnOffAttrIfDefined"],"sources":["../../../packages/core/src/helpers/Dom/template.ts"],"sourcesContent":["import {HTMLStencilElement} from '@stencil/core/internal'\nimport {GovHost} from './template.types'\nimport {Nullable} from '../../types/interfaces'\n\nexport const prepareClasses = (classes: string[]): string => {\n\tif (Array.isArray(classes) === false) return\n\treturn classes\n\t\t.filter(classname => !!classname)\n\t\t.join(' ')\n\t\t.trim()\n}\n\nexport const slottedChildren = (host: HTMLStencilElement): Node[] => {\n\tconst slotted = host.querySelector('slot') as HTMLSlotElement\n\tif (slotted) {\n\t\treturn slotted.assignedNodes().filter(node => {\n\t\t\treturn node.nodeName !== '#text'\n\t\t})\n\t}\n\treturn []\n}\n\nexport const booleanString = (value: boolean): string => {\n\treturn value ? 'true' : 'false'\n}\n\nexport const govHost = (host: HTMLStencilElement): GovHost => {\n\treturn {\n\t\tget hostElement(): HTMLStencilElement {\n\t\t\treturn host\n\t\t},\n\t\tget name(): string {\n\t\t\treturn this.hostElement.nodeName.toLowerCase()\n\t\t},\n\t\thasSlot(name: string): boolean {\n\t\t\treturn !!this.getSlot(name)\n\t\t},\n\t\tisSlotEmpty(name: string): boolean {\n\t\t\tconst slot = this.getSlot(name)\n\t\t\tif (slot) {\n\t\t\t\treturn slot.childNodes.length === 0\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\t\tgetSlot(name: string): HTMLElement {\n\t\t\treturn this.hostElement.querySelector('[slot=\"' + name + '\"]')\n\t\t},\n\t\tgetParent(element): Nullable<HTMLElement> {\n\t\t\treturn this.hostElement.closest(element)\n\t\t},\n\t\tpassChildAttr(selector: string | string[], name: string, value: any): void {\n\t\t\tif (Array.isArray(selector)) {\n\t\t\t\tselector.forEach(selector => {\n\t\t\t\t\tthis.hostElement.querySelectorAll(selector).forEach(child => child.setAttribute(name, value))\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tthis.hostElement.querySelectorAll(selector).forEach(child => child.setAttribute(name, value))\n\t\t\t}\n\t\t},\n\t\tremoveChildAttr(selector: string | string[], name: string): void {\n\t\t\tif (Array.isArray(selector)) {\n\t\t\t\tselector.forEach(selector => {\n\t\t\t\t\tthis.hostElement.querySelectorAll(selector).forEach(child => child.removeAttribute(name))\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tthis.hostElement.querySelectorAll(selector).forEach(child => child.removeAttribute(name))\n\t\t\t}\n\t\t},\n\t\tget slottedChildren(): Node[] {\n\t\t\tconst slotted = this.hostElement.shadowRoot.querySelector('slot') as HTMLSlotElement\n\t\t\tif (slotted) {\n\t\t\t\treturn slotted.assignedNodes().filter(node => {\n\t\t\t\t\treturn node.nodeName !== '#text'\n\t\t\t\t})\n\t\t\t}\n\t\t\treturn []\n\t\t},\n\t\tclasses(classes: string | string[]): string {\n\t\t\tconst clearClasses = Array.isArray(classes) ? classes.join(' ') : classes\n\t\t\tif (this.hostElement) {\n\t\t\t\treturn this.hostElement.classList.toString() + ' ' + clearClasses\n\t\t\t}\n\t\t\treturn clearClasses\n\t\t},\n\t}\n}\n\nexport const toBoolAttr = (value: boolean | string | number): string => {\n\tif (typeof value === 'string') {\n\t\treturn ['true', 'True', 'TRUE', '1'].indexOf(value) !== -1 ? 'true' : 'false'\n\t} else if (typeof value === 'number') {\n\t\treturn value > 0 ? 'true' : 'false'\n\t} else if (typeof value === 'boolean') {\n\t\treturn value ? 'true' : 'false'\n\t} else {\n\t\treturn value ? 'true' : 'false'\n\t}\n}\n\nexport const toOnOffAttr = (value: boolean | string | number): string => {\n\tif (typeof value === 'string') {\n\t\treturn ['true', 'True', 'TRUE', '1', 'On', 'on', 'ON'].indexOf(value) !== -1 ? 'on' : 'off'\n\t} else if (typeof value === 'number') {\n\t\treturn value > 0 ? 'on' : 'off'\n\t} else if (typeof value === 'boolean') {\n\t\treturn value ? 'on' : 'off'\n\t} else {\n\t\treturn value ? 'on' : 'off'\n\t}\n}\n\nexport const toBoolAttrIfDefined = (value: boolean | string | number | undefined | null): undefined | string => {\n\treturn typeof value === 'undefined' ? undefined : toBoolAttr(value)\n}\n\nexport const toOnOffAttrIfDefined = (value: boolean | string | number | undefined | null): undefined | string => {\n\treturn typeof value === 'undefined' ? undefined : toOnOffAttr(value)\n}\n"],"mappings":"MAIaA,EAAkBC,IAC9B,GAAIC,MAAMC,QAAQF,KAAa,MAAO,OACtC,OAAOA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,EAAS,CACZ,OAAOA,EAAQE,gBAAgBR,QAAOS,GAC9BA,EAAKC,WAAa,S,CAG3B,MAAO,E,EAER,OAAAb,CAAQA,GACP,MAAMuC,EAAetC,MAAMC,QAAQF,GAAWA,EAAQK,KAAK,KAAOL,EAClE,GAAImB,KAAKF,YAAa,CACrB,OAAOE,KAAKF,YAAYuB,UAAUC,WAAa,IAAMF,C,CAEtD,OAAOA,C,UAKGG,EAAc3B,IAC1B,UAAWA,IAAU,SAAU,CAC9B,MAAO,CAAC,OAAQ,OAAQ,OAAQ,KAAK4B,QAAQ5B,MAAY,EAAI,OAAS,O,MAChE,UAAWA,IAAU,SAAU,CACrC,OAAOA,EAAQ,EAAI,OAAS,O,MACtB,UAAWA,IAAU,UAAW,CACtC,OAAOA,EAAQ,OAAS,O,KAClB,CACN,OAAOA,EAAQ,OAAS,O,GAInB,MAAM6B,EAAe7B,IAC3B,UAAWA,IAAU,SAAU,CAC9B,MAAO,CAAC,OAAQ,OAAQ,OAAQ,IAAK,KAAM,KAAM,MAAM4B,QAAQ5B,MAAY,EAAI,KAAO,K,MAChF,UAAWA,IAAU,SAAU,CACrC,OAAOA,EAAQ,EAAI,KAAO,K,MACpB,UAAWA,IAAU,UAAW,CACtC,OAAOA,EAAQ,KAAO,K,KAChB,CACN,OAAOA,EAAQ,KAAO,K,SAIX8B,EAAuB9B,UACrBA,IAAU,YAAc+B,UAAYJ,EAAW3B,G,MAGjDgC,EAAwBhC,UACtBA,IAAU,YAAc+B,UAAYF,EAAY7B,U"}
@@ -1,2 +0,0 @@
1
- import{r as t,h as o,a as i,g as e}from"./p-5bc604a3.js";import{g as r}from"./p-28e59384.js";const n={root:"gov-tile",icon:"gov-tile__icon",arrow:"gov-tile__arrow",title:"gov-tile__title",link:"gov-tile__link",content:"gov-tile__content",heading:"gov-tile__heading"};const l='.gov-tile__title::before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:1}.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-tile{position:relative;display:block;width:100%;padding:0.75rem;transition:background-color 150ms}.gov-tile__icon{display:block;margin:0rem 0rem 1.5rem;color:var(--gov-tile-main-color, var(--gov-color-primary))}.gov-tile__icon .gov-icon{width:2.5rem;height:2.5rem}.gov-tile__title{display:flex;gap:0.5rem;justify-content:space-between;align-items:flex-start;color:var(--gov-tile-main-color, var(--gov-color-primary));text-decoration:none;margin-bottom:0.5rem}.gov-tile__title [slot=title]{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);margin:0}.gov-tile__arrow{flex:0 0 auto;width:1.25rem;height:1.25rem;position:relative;top:0.3125rem;color:inherit}.gov-tile__content{color:var(--gov-tile-text-color, var(--gov-color-secondary-700))}.gov-tile__content>*:last-child{margin-bottom:0}.gov-tile__content a{position:relative;z-index:1}.gov-tile__link{display:block;text-decoration:none}@media not all and (pointer: coarse){.gov-tile[href]:hover{background:var(--gov-tile-hover-bg, var(--gov-color-primary-200))}.gov-tile[href]:hover .gov-tile__title{color:var(--gov-tile-main-color, var(--gov-color-primary))}}@media (min-width: 48em){.gov-tile{padding:1.5rem}.gov-tile__icon{margin:0rem 0rem 1.5rem}.gov-tile__icon .gov-icon{width:3rem;height:3rem}}';const a=class{constructor(o){t(this,o);this.href=undefined;this.target=undefined;this.h=r(this.host)}render(){return o(i,{class:this.h.classes(n.root)},this.href?o("a",{href:this.href,target:this.target,class:n.link,ref:t=>this.triggerRef=t},this.h.hasSlot("icon")&&o("span",{class:n.icon},o("slot",{name:"icon"})),this.h.hasSlot("title")&&o("span",{class:n.title},o("slot",{name:"title"}),o("gov-icon",{class:n.arrow,name:"chevron-right"})),o("div",{class:n.content},o("slot",null))):o("span",null,this.h.hasSlot("icon")&&o("span",{class:n.icon},o("slot",{name:"icon"})),this.h.hasSlot("title")&&o("span",{class:n.title},o("slot",{name:"title"})),o("div",{class:n.content},o("slot",null))))}async getTriggerRef(){return this.triggerRef}get host(){return e(this)}};a.style=l;export{a as gov_tile};
2
- //# sourceMappingURL=p-2f858bf5.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["TileClass","root","icon","arrow","title","link","content","heading","govTileCss","GovTile","constructor","hostRef","this","h","govHost","host","render","Host","class","classes","href","target","ref","el","triggerRef","hasSlot","name","getTriggerRef"],"sources":["../../../packages/core/src/components/gov-tile/constants.ts","../../../packages/core/src/components/gov-tile/gov-tile.scss?tag=gov-tile","../../../packages/core/src/components/gov-tile/gov-tile.tsx"],"sourcesContent":["export const TileClass = {\n\troot: 'gov-tile',\n\ticon: 'gov-tile__icon',\n\tarrow: 'gov-tile__arrow',\n\ttitle: 'gov-tile__title',\n\tlink: 'gov-tile__link',\n\tcontent: 'gov-tile__content',\n\theading: 'gov-tile__heading',\n}\n","/*\n * Tile\n */\n\n$class: \".gov-tile\";\n\n#{$class} {\n\t@include base();\n\tpadding: rem-calc(12);\n\ttransition: background-color $t;\n\t&__icon {\n\t\tdisplay: block;\n\t\tmargin: rem-calc(0 0 24);\n\t\tcolor: $tile-main-color;\n\t\t.gov-icon {\n\t\t\twidth: rem-calc(40);\n\t\t\theight: rem-calc(40);\n\t\t}\n\t}\n\t&__title {\n\t\t@extend %link-mask;\n\t\tdisplay: flex;\n\t\tgap: rem-calc(8);\n\t\tjustify-content: space-between;\n\t\talign-items: flex-start;\n\t\tcolor: $tile-main-color;\n\t\ttext-decoration: none;\n\t\tmargin-bottom: rem-calc(8);\n\t\t& [slot=\"title\"] {\n\t\t\t@include typography($font-size-xl);\n\t\t\tmargin: 0;\n\t\t}\n\t}\n\t&__arrow {\n\t\tflex: 0 0 auto;\n\t\twidth: rem-calc(20);\n\t\theight: rem-calc(20);\n\t\tposition: relative;\n\t\ttop: rem-calc(5);\n\t\tcolor: inherit;\n\t}\n\t&__content {\n\t\t@include reset-last-margin();\n\t\tcolor: $tile-text-color;\n\t\ta {\n\t\t\tposition: relative;\n\t\t\tz-index: 1;\n\t\t}\n\t}\n\t&__link {\n\t\tdisplay: block;\n\t\ttext-decoration: none;\n\t}\n\n\t// HOVERS\n\t&[href] {\n\t\t@include hover() {\n\t\t\tbackground: $tile-hover-bg;\n\t\t\t#{$class} {\n\t\t\t\t&__title {\n\t\t\t\t\tcolor: $tile-main-color;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// MQ\n\t@include mq($from: md) {\n\t\tpadding: rem-calc(24);\n\t\t&__icon {\n\t\t\tmargin: rem-calc(0 0 24);\n\t\t\t.gov-icon {\n\t\t\t\twidth: rem-calc(48);\n\t\t\t\theight: rem-calc(48);\n\t\t\t}\n\t\t}\n\t}\n}\n","import { Component, Element, h, Host, Method, Prop } from \"@stencil/core\"\nimport { TileClass } from \"./constants\"\nimport { govHost } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { ButtonTargetType } from \"../gov-button/button/constants\"\n\n@Component({\n\ttag: \"gov-tile\",\n\tstyleUrl: \"gov-tile.scss\",\n})\nexport class GovTile {\n\tprivate triggerRef?: HTMLLinkElement | HTMLSpanElement\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovTileElement\n\t/**\n\t * Link on whole tile\n\t */\n\t@Prop({reflect: true}) readonly href: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target\n\t */\n\t@Prop() readonly target?: ButtonTargetType\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(TileClass.root)}>\n\t\t\t\t{this.href ? (\n\t\t\t\t\t<a\n\t\t\t\t\t\thref={this.href}\n\t\t\t\t\t\ttarget={this.target}\n\t\t\t\t\t\tclass={TileClass.link}\n\t\t\t\t\t\tref={el => (this.triggerRef = el as HTMLLinkElement | HTMLSpanElement)}>\n\t\t\t\t\t\t{this.h.hasSlot(\"icon\") && (\n\t\t\t\t\t\t\t<span class={TileClass.icon}>\n\t\t\t\t\t\t\t\t<slot name=\"icon\" />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{this.h.hasSlot(\"title\") && (\n\t\t\t\t\t\t\t<span class={TileClass.title}>\n\t\t\t\t\t\t\t\t<slot name=\"title\" />\n\t\t\t\t\t\t\t\t<gov-icon class={TileClass.arrow} name=\"chevron-right\"></gov-icon>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<div class={TileClass.content}>\n\t\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</a>\n\t\t\t\t) : (\n\t\t\t\t\t<span>\n\t\t\t\t\t\t{this.h.hasSlot(\"icon\") && (\n\t\t\t\t\t\t\t<span class={TileClass.icon}>\n\t\t\t\t\t\t\t\t<slot name=\"icon\" />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{this.h.hasSlot(\"title\") && (\n\t\t\t\t\t\t\t<span class={TileClass.title}>\n\t\t\t\t\t\t\t\t<slot name=\"title\" />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<div class={TileClass.content}>\n\t\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Returns a clickable element instance\n\t */\n\t@Method()\n\tasync getTriggerRef() {\n\t\treturn this.triggerRef\n\t}\n}\n"],"mappings":"6FAAO,MAAMA,EAAY,CACxBC,KAAM,WACNC,KAAM,iBACNC,MAAO,kBACPC,MAAO,kBACPC,KAAM,iBACNC,QAAS,oBACTC,QAAS,qBCPV,MAAMC,EAAa,0xD,MCUNC,EAAO,MAInB,WAAAC,CAAAC,G,oDACCC,KAAKC,EAAIC,EAAQF,KAAKG,K,CAcvB,MAAAC,GACC,OACCH,EAACI,EAAI,CAACC,MAAON,KAAKC,EAAEM,QAAQnB,EAAUC,OACpCW,KAAKQ,KACLP,EAAA,KACCO,KAAMR,KAAKQ,KACXC,OAAQT,KAAKS,OACbH,MAAOlB,EAAUK,KACjBiB,IAAKC,GAAOX,KAAKY,WAAaD,GAC7BX,KAAKC,EAAEY,QAAQ,SACfZ,EAAA,QAAMK,MAAOlB,EAAUE,MACtBW,EAAA,QAAMa,KAAK,UAGZd,KAAKC,EAAEY,QAAQ,UACfZ,EAAA,QAAMK,MAAOlB,EAAUI,OACtBS,EAAA,QAAMa,KAAK,UACXb,EAAA,YAAUK,MAAOlB,EAAUG,MAAOuB,KAAK,mBAGzCb,EAAA,OAAKK,MAAOlB,EAAUM,SACrBO,EAAA,eAIFA,EAAA,YACED,KAAKC,EAAEY,QAAQ,SACfZ,EAAA,QAAMK,MAAOlB,EAAUE,MACtBW,EAAA,QAAMa,KAAK,UAGZd,KAAKC,EAAEY,QAAQ,UACfZ,EAAA,QAAMK,MAAOlB,EAAUI,OACtBS,EAAA,QAAMa,KAAK,WAGbb,EAAA,OAAKK,MAAOlB,EAAUM,SACrBO,EAAA,e,CAYN,mBAAMc,GACL,OAAOf,KAAKY,U"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["InfobarVariants","pick","Variants","InfobarClass","root","section","icon","content","closable","headline","close","govInfobarCss","GovInfobar","constructor","hostRef","this","h","govHost","host","validateVariant","newValue","validateProp","componentWillLoad","variant","componentDidRender","canValidateWcagOnRender","delay","validateWcag","render","inverse","closeButton","class","size","wcagLabel","wcagCloseLabel","type","onCloseHandler","bind","name","Host","classes","role","hasSlot","Fragment","wcagToggleLabel","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 * 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 wcagCloseLabel: 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 wcagToggleLabel: 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.wcagCloseLabel} type=\"base\" variant={variant} inverse={inverse} on-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=\"infobar\">\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.wcagToggleLabel}\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.wcagCloseLabel, 'wcag-close-label', InfobarClass.root)\n\t\t}\n\t\tif (this.headline) {\n\t\t\tvalidateWcagProp(this.wcagToggleLabel, '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,uiO,MCgBTC,EAAU,MAGtB,WAAAC,CAAAC,G,mFAawC,U,aAIJ,M,oBAIuC,0B,qBAIE,0B,cAQvC,M,mBAEb,MAlCxBC,KAAKC,EAAIC,EAAQF,KAAKG,K,CAqCvB,eAAAC,CAAgBC,GACfC,EAAarB,EAAiBoB,EAAUjB,EAAaC,K,CAGtD,iBAAAkB,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,OAAKe,MAAO5B,EAAaO,OACxBM,EAAA,cAAYgB,KAAK,IAAIC,UAAWlB,KAAKmB,eAAgBC,KAAK,OAAOZ,QAASA,EAASM,QAASA,EAAO,eAAgBd,KAAKqB,eAAeC,KAAKtB,OAC3IC,EAAA,YAAUsB,KAAK,WAKlB,OACCtB,EAACuB,EAAI,CAACR,MAAOhB,KAAKC,EAAEwB,QAAQrC,EAAaC,MAAOmB,QAASR,KAAKQ,SAC7DP,EAAA,WAASe,MAAO5B,EAAaE,QAASoC,KAAK,WACzC1B,KAAKC,EAAE0B,QAAQ,SACf1B,EAAA,OAAKe,MAAO5B,EAAaG,MACxBU,EAAA,QAAMsB,KAAK,UAGbtB,EAAA,OAAKe,MAAO5B,EAAaI,SAAWQ,KAAKP,SAAW,IAAML,EAAaK,SAAW,KAChFO,KAAKN,SACLO,EAAC2B,EAAQ,KACR3B,EAAA,OAAKe,MAAO5B,EAAaM,UACxBO,EAAA,SAAID,KAAKN,UACTO,EAAA,cACCgB,KAAK,IACLC,UAAWlB,KAAK6B,gBAChBT,KAAK,OACLZ,QAASA,EACTM,QAASA,EAAO,eACF,IAAOd,KAAK8B,eAAiB9B,KAAK8B,eAEhD7B,EAAA,YAAUsB,KAAMvB,KAAK8B,cAAgB,aAAe,mBAGtD7B,EAAA,OAAK8B,QAAS/B,KAAK8B,cAAa,cAAeE,EAAWhC,KAAK8B,gBAC9D7B,EAAA,eAIFA,EAAA,eAIFD,KAAKP,UAAYsB,E,CAKrB,cAAAM,CAAeY,GACdjC,KAAKkC,SAASC,KAAK,CAClBC,UAAWhD,EAAaC,KACxBgD,IAAKrC,KAAKG,KACVmC,cAAeL,G,CAQjB,kBAAMrB,GACL,GAAIZ,KAAKP,SAAU,CAClB8C,EAAiBvC,KAAKmB,eAAgB,mBAAoB/B,EAAaC,K,CAExE,GAAIW,KAAKN,SAAU,CAClB6C,EAAiBvC,KAAK6B,gBAAiB,oBAAqBzC,EAAaC,K"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["NativeType","ChipClass","root","inner","hasRight","hasLeft","govChipCss","GovChip","constructor","hostRef","ButtonSizes","_M","ButtonVariants","PRIMARY","this","h","govHost","host","chipId","createID","validateVariant","newValue","validateProp","validateSize","componentWillLoad","variant","size","render","Tag","href","A","tag","nativeType","BUTTON","undefined","iconLeft","prepareIconFormat","iconRight","Host","class","classes","hasSlot","disabled","type","inverse","hoverable","target","wcagLabel","ref","el","triggerRef","onClick","onClickHandler","bind","wcagControls","toBoolAttr","wcagSelected","tabindex","focusable","id","identifier","name","e","stopPropagation","govClick","emit","getTriggerRef","getTriggerIdentifier","setFocus","focus"],"sources":["../../../packages/core/src/components/gov-chip/constants.ts","../../../packages/core/src/components/gov-chip/gov-chip.scss?tag=gov-chip","../../../packages/core/src/components/gov-chip/gov-chip.tsx"],"sourcesContent":["import { ValueOf } from '../../types/interfaces'\n\nexport enum NativeType {\n\tA = 'a',\n\tSPAN = 'span',\n\tBUTTON = 'button',\n}\n\nexport type NativeTypesType = `${ValueOf<typeof NativeType>}`\n\nexport const ChipClass = {\n\troot: 'gov-chip',\n\tinner: 'gov-chip__inner',\n\thasRight: 'gov-chip--has-right',\n\thasLeft: 'gov-chip--has-left',\n}\n","/*\n * Chip\n */\n\n// Shared definitions - button & chip\n@import \"../gov-button/button/gov-button-core\";\n\n.gov-chip {\n\t@extend %button-core;\n\tdisplay: inline-flex;\n\ta .gov-icon {\n\t\tmargin: 0;\n\t}\n\t.element {\n\t\tpadding: rem-calc(4 10);\n\t\tfont-family: $font-family-primary;\n\t\tfont-weight: 400;\n\t\tletter-spacing: initial;\n\t}\n\t.gov-button {\n\t\t.element {\n\t\t\tborder: none;\n\t\t}\n\t}\n\t&--has-right > .element {\n\t\tpadding-top: 0 !important;\n\t\tpadding-right: 0 !important;\n\t\tpadding-bottom: 0 !important;\n\t}\n\n\t&--has-left > .element {\n\t\tpadding-top: 0 !important;\n\t\tpadding-bottom: 0 !important;\n\t\tpadding-left: 0 !important;\n\t}\n\n\t// VARIANTS\n\t@each $size, $definitions in $button-sizes {\n\t\t$radius: calc(#{get(\"min-height\", $definitions)} * 0.5);\n\t\t&[size=\"#{$size}\"] {\n\t\t\t.element {\n\t\t\t\tborder-radius: $radius;\n\t\t\t}\n\n\t\t\t// HOVERS\n\t\t\t&[hoverable] .element {\n\t\t\t\t@include focus-outline($radius, $outline-offset);\n\t\t\t}\n\t\t}\n\t}\n\t@each $variant, $types in $chip-inverse-variants {\n\t\t&[variant=\"#{$variant}\"] {\n\t\t\t@include parameter(\"inverse\") {\n\t\t\t\t.element,\n\t\t\t\t.element .element {\n\t\t\t\t\tborder-width: rem-calc(1);\n\t\t\t\t\tborder-color: deep-map-get($chip-inverse-variants, $variant, \"border-color\");\n\t\t\t\t\tbackground-color: deep-map-get($chip-inverse-variants, $variant, \"bg\");\n\t\t\t\t\tcolor: deep-map-get($chip-inverse-variants, $variant, \"color\");\n\t\t\t\t\t@include hover() {\n\t\t\t\t\t\tborder-color: deep-map-get($chip-inverse-variants, $variant, \"border-color-hover\");\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, Watch } from \"@stencil/core\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { validateProp } from \"../../helpers/Validate/props\"\nimport { govHost, toBoolAttr } from \"../../helpers/Dom/template\"\nimport { ChipClass, NativeType, NativeTypesType } from \"./constants\"\nimport { ButtonSizes, ButtonSizesType, ButtonVariants, ButtonVariantType } from \"../gov-button/button/constants\"\nimport { createID } from \"../../utils/string.utils\"\nimport {prepareIconFormat} from \"../gov-icon/helpers\";\n\n@Component({\n\ttag: \"gov-chip\",\n\tstyleUrl: \"gov-chip.scss\",\n})\nexport class GovChip {\n\tprivate triggerRef?: HTMLButtonElement | HTMLLinkElement | HTMLSpanElement\n\tprivate h: GovHost\n\tprivate readonly chipId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.chipId = createID('GovChip')\n\t}\n\n\t@Element() host: HTMLGovChipElement\n\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 * Makes the chip component disabled.\n\t * This prevents users from being able to interact with the button, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href\n\t */\n\t@Prop() readonly href: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target\n\t */\n\t@Prop() readonly target: string\n\t/**\n\t * Definition of the button icon on the left. The icon must be defined in the form \"type/name\".\n\t */\n\t@Prop({attribute: \"icon-left\"}) readonly iconLeft?: string\n\t/**\n\t * Definition of the button icon on the left. The icon must be defined in the form \"type/name\".\n\t */\n\t@Prop({attribute: \"icon-right\"}) readonly iconRight?: string\n\t/**\n\t * Chip’s size.\n\t */\n\t@Prop() readonly size: ButtonSizesType = ButtonSizes._M\n\t/**\n\t * Used to change the HTML tag in the chip\n\t */\n\t@Prop() readonly tag: NativeTypesType = \"span\"\n\t/**\n\t * Style variation of the chip.\n\t */\n\t@Prop() readonly variant: ButtonVariantType = ButtonVariants.PRIMARY\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/focusable\n\t */\n\t@Prop() readonly focusable: boolean = true\n\t/**\n\t * Custom chip identifier. Otherwise, it will be generated\n\t */\n\t@Prop() readonly identifier: string\n\t/**\n\t * Adds accessible label for the button that is only shown for screen readers.\n\t * Typically, this label text replaces the visible text on the button for users who use assistive technology.\n\t */\n\t@Prop({ attribute: \"wcag-label\" }) readonly wcagLabel: string\n\t/**\n\t * Use this property to add an aria-controls attribute to the button. Use the attribute to point to the unique id of the content that the button manages\n\t */\n\t@Prop({ attribute: \"wcag-controls\" }) readonly wcagControls: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected\n\t */\n\t@Prop({ attribute: \"wcag-selected\" }) readonly wcagSelected: boolean\n\t/**\n\t * Emitted when the button click.\n\t */\n\t@Event({ eventName: \"gov-click\" }) govClick: EventEmitter<PointerEvent>\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(ButtonVariants, newValue, ChipClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(ButtonSizes, newValue, ChipClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t}\n\n\trender() {\n\t\tconst Tag = this.href ? NativeType.A : this.tag\n\t\tconst nativeType = Tag == NativeType.BUTTON ? NativeType.BUTTON : undefined\n\n\t\tconst iconLeft = prepareIconFormat(this.iconLeft)\n\t\tconst iconRight = prepareIconFormat(this.iconRight)\n\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={this.h.classes([\n\t\t\t\t\tChipClass.root,\n\t\t\t\t\tthis.h.hasSlot(\"right\") ? ChipClass.hasRight : undefined,\n\t\t\t\t\tthis.h.hasSlot(\"left\") ? ChipClass.hasLeft : undefined,\n\t\t\t\t])}\n\t\t\t\tdisabled={this.disabled}\n\t\t\t\thref={this.href}\n\t\t\t\tvariant={this.variant}\n\t\t\t\ttype={this.inverse ? undefined : \"solid\"}\n\t\t\t\tsize={this.size}\n\t\t\t\tinverse={this.inverse}\n\t\t\t\thoverable={Tag == NativeType.A || Tag == NativeType.BUTTON}\n\t\t\t>\n\t\t\t\t<Tag\n\t\t\t\t\tclass=\"element\"\n\t\t\t\t\thref={this.href}\n\t\t\t\t\ttarget={this.target}\n\t\t\t\t\taria-label={this.wcagLabel}\n\t\t\t\t\tref={el => (this.triggerRef = el as HTMLLinkElement | HTMLButtonElement | HTMLSpanElement)}\n\t\t\t\t\tonClick={this.onClickHandler.bind(this)}\n\t\t\t\t\taria-controls={this.wcagControls}\n\t\t\t\t\taria-selected={toBoolAttr(this.wcagSelected)}\n\t\t\t\t\ttabindex={this.focusable ? \"0\" : \"-1\"}\n\t\t\t\t\tid={this.identifier || this.chipId}\n\t\t\t\t\ttype={nativeType}>\n\t\t\t\t\t{this.h.hasSlot(\"left\") && <slot name=\"left\"></slot>}\n\t\t\t\t\t{this.h.hasSlot(\"left-icon\") && <slot name=\"left-icon\"></slot>}\n\t\t\t\t\t{iconLeft && \t<gov-icon type={iconLeft.type} name={iconLeft.name}></gov-icon>}\n\t\t\t\t\t<slot />\n\t\t\t\t\t{this.h.hasSlot(\"right-icon\") && <slot name=\"right-icon\"></slot>}\n\t\t\t\t\t{this.h.hasSlot(\"right\") && <slot name=\"right\"></slot>}\n\t\t\t\t\t{iconRight && \t<gov-icon type={iconRight.type} name={iconRight.name}></gov-icon>}\n\t\t\t\t</Tag>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onClickHandler(e: PointerEvent): void {\n\t\te.stopPropagation()\n\t\tif (this.disabled === false && this.tag === NativeType.BUTTON) {\n\t\t\tthis.govClick.emit(e)\n\t\t}\n\t}\n\n\t/**\n\t * Returns a clickable element instance\n\t */\n\t@Method()\n\tasync getTriggerRef() {\n\t\treturn this.triggerRef\n\t}\n\n\t/**\n\t * Returns a unique tab trigger identifier\n\t */\n\t@Method()\n\tasync getTriggerIdentifier(): Promise<string> {\n\t\treturn this.identifier || this.chipId\n\t}\n\n\t/**\n\t * Focus button element\n\t */\n\t@Method()\n\tasync setFocus(): Promise<void> {\n\t\tthis.triggerRef.focus()\n\t}\n}\n"],"mappings":"qXAEA,IAAYA,GAAZ,SAAYA,GACXA,EAAA,SACAA,EAAA,eACAA,EAAA,kBACA,EAJD,CAAYA,MAAU,KAQf,MAAMC,EAAY,CACxBC,KAAM,WACNC,MAAO,kBACPC,SAAU,sBACVC,QAAS,sBCdV,MAAMC,EAAa,ww4E,MCaNC,EAAO,MAKnB,WAAAC,CAAAC,G,2DAUoC,M,cAKC,M,qGAsBIC,EAAYC,G,SAIb,O,aAIMC,EAAeC,Q,eAKvB,K,2GAjDrCC,KAAKC,EAAIC,EAAQF,KAAKG,MACtBH,KAAKI,OAASC,EAAS,U,CAyExB,eAAAC,CAAgBC,GACfC,EAAaV,EAAgBS,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EAAA,YAAU4B,KAAMR,EAASQ,KAAMkB,KAAM1B,EAAS0B,OAC5D9C,EAAA,aACCD,KAAKC,EAAE0B,QAAQ,eAAiB1B,EAAA,QAAM8C,KAAK,eAC3C/C,KAAKC,EAAE0B,QAAQ,UAAY1B,EAAA,QAAM8C,KAAK,UACtCxB,GAActB,EAAA,YAAU4B,KAAMN,EAAUM,KAAMkB,KAAMxB,EAAUwB,Q,CAM3D,cAAAT,CAAeU,GACtBA,EAAEC,kBACF,GAAIjD,KAAK4B,WAAa,OAAS5B,KAAKiB,MAAQ/B,EAAWiC,OAAQ,CAC9DnB,KAAKkD,SAASC,KAAKH,E,EAQrB,mBAAMI,GACL,OAAOpD,KAAKoC,U,CAOb,0BAAMiB,GACL,OAAOrD,KAAK8C,YAAc9C,KAAKI,M,CAOhC,cAAMkD,GACLtD,KAAKoC,WAAWmB,O"}
@@ -1,2 +0,0 @@
1
- import{r as i,h as t,a as s,g as o}from"./p-5bc604a3.js";import{v as h}from"./p-dcb5fb35.js";import{T as e,a as n,b as a,c as r,d as p}from"./p-9a4c910d.js";import{c}from"./p-24636c53.js";import{g as l}from"./p-28e59384.js";import"./p-7f2c9830.js";import"./p-003e6cca.js";import"./p-03990da5.js";import"./p-ff7365ae.js";import"./p-55500e5a.js";const f='.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-tooltip{display:inline-block;border-bottom:1px dashed currentcolor;color:var(--gov-color-primary);cursor:help}.gov-tooltip[icon=""],.gov-tooltip[icon=true i],.gov-tooltip[icon="1"]{border-bottom:0}';const d=class{constructor(t){i(this,t);this.tooltipContentId=undefined;this.tooltipId=undefined;this.variant=e.PRIMARY;this.size=n._M;this.position="right";this.message=undefined;this.identifier=undefined;this.icon=undefined;this.persist=false;this.h=l(this.host);this.tooltipId=c("GovTooltip");this.tooltipContentId=c("GovContentTooltip")}validateVariant(i){h(e,i,p.root)}validateSize(i){h(n,i,p.root)}validatePosition(i){h(r,i,p.root)}componentWillLoad(){this.validateVariant(this.variant);this.validateSize(this.size);this.validatePosition(this.position);this.createContentWrapper();this.registerListeners()}disconnectedCallback(){this.removeContent()}createContentWrapper(){var i;const t=this.host.querySelector(a.root);if(t){this.content=t}else{this.content=document.createElement(a.root);this.content.innerHTML=this.message;this.host.appendChild(this.content)}const s=this.host.getBoundingClientRect();this.content.style.left=s.left+"px";this.content.style.top=s.top+"px";this.content.style.visibility="hidden";this.content.setAttribute("id",(i=this.identifier)!==null&&i!==void 0?i:this.tooltipContentId);this.content.setAttribute("parent-id",this.tooltipId);this.content.setAttribute("variant",this.variant);this.content.setAttribute("size",this.size);document.body.appendChild(this.content)}registerListeners(){this.host.addEventListener("click",(i=>{i.preventDefault();this.persist=true;if(this.content){this.content.setAttribute("persist","true")}this.showTooltip()}));this.host.addEventListener("focus",(i=>{i.preventDefault();this.showTooltip()}));this.host.addEventListener("blur",(i=>{i.preventDefault();if(this.persist===false){this.hideTooltip()}}));this.host.addEventListener("mouseenter",(i=>{i.preventDefault();this.showTooltip()}));this.host.addEventListener("mouseleave",(i=>{i.preventDefault();if(this.persist===false){this.hideTooltip()}}))}verifyPositionSpace(){const i=12;const t=window.innerWidth;const s=this.host.getBoundingClientRect();const o=this.host.offsetWidth;const h=this.host.offsetHeight;const e=this.content.offsetWidth;const n=this.content.offsetHeight;const a={left:s.left+document.documentElement.scrollLeft,top:s.top+document.documentElement.scrollTop};const p=a.left+i+s.width+e<=t;const c=a.left>e;if(this.position===r.LEFT||this.position===r.RIGHT){this.content.style.top=a.top-(n-h)/2+"px";if(p===false&&c===false){this.position=r.TOP;this.content.setAttribute("position",r.TOP)}if(c&&p===false&&this.position===r.RIGHT){this.position=r.LEFT}if(p&&c===false&&this.position===r.LEFT){this.position=r.RIGHT}}if(this.position===r.RIGHT){this.content.setAttribute("position",r.RIGHT);this.content.style.left=a.left+i+s.width+"px"}if(this.position===r.LEFT){this.content.setAttribute("position",r.LEFT);this.content.style.left=a.left-(e+i)+"px"}if(this.position===r.TOP||this.position===r.BOTTOM){if(e>o){let s=a.left-(e-o)/2;const h=s<0;const n=s+e>t;if(h&&n){this.content.style.width="auto";this.content.style.left=i+"px";this.content.style.right=i+"px"}else{if(h){s=i}if(n){s=s-(t-(s+e+i))*-1}this.content.style.left=s+"px"}}else{const i=a.left+(o-e)/2;this.content.style.left=i+"px"}}if(this.position===r.TOP){this.content.setAttribute("position",r.TOP);this.content.style.top=a.top-(n+i)+"px"}if(this.position===r.BOTTOM){this.content.setAttribute("position",r.BOTTOM);this.content.style.top=a.top+(h+i)+"px"}this.content.setAttribute("is-visible","true");this.content.style.opacity="1"}showTooltip(){if(this.content){this.content.style.opacity="0";this.content.hidden=false;this.verifyPositionSpace()}}hideTooltip(){if(this.content){this.content.setAttribute("is-visible","false");this.content.setAttribute("persist","false")}}removeContent(){const i=document.getElementById(this.tooltipContentId);if(i){i.remove()}}render(){var i;return t(s,{id:this.tooltipId,class:this.h.classes(p.root),position:this.position,tabindex:0,"aria-describedby":(i=this.identifier)!==null&&i!==void 0?i:this.tooltipContentId},t("slot",null))}async show(){this.showTooltip()}async hide(){this.persist=false;this.hideTooltip()}get host(){return o(this)}static get watchers(){return{variant:["validateVariant"],size:["validateSize"],position:["validatePosition"]}}};d.style=f;export{d as gov_tooltip};
2
- //# sourceMappingURL=p-73b7585b.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["govTooltipCss","GovTooltip","constructor","hostRef","this","tooltipContentId","undefined","tooltipId","TooltipVariant","PRIMARY","TooltipSize","_M","h","govHost","host","createID","validateVariant","newValue","validateProp","TooltipClass","root","validateSize","validatePosition","TooltipPosition","componentWillLoad","variant","size","position","createContentWrapper","registerListeners","disconnectedCallback","removeContent","hasContentInside","querySelector","TooltipContentClass","content","document","createElement","innerHTML","message","appendChild","trigger","getBoundingClientRect","style","left","top","visibility","setAttribute","_a","identifier","body","addEventListener","e","preventDefault","persist","showTooltip","hideTooltip","verifyPositionSpace","offset","windowWidth","window","innerWidth","trgWidth","offsetWidth","trgHeight","offsetHeight","contentWidth","contentHeight","triggerPos","documentElement","scrollLeft","scrollTop","isRightSpace","width","isLeftSpace","LEFT","RIGHT","TOP","BOTTOM","leftPosition","isNotLeftSpace","isNotRightSpace","right","opacity","hidden","contentEl","getElementById","remove","render","Host","id","class","classes","tabindex","show","hide"],"sources":["../../../packages/core/src/components/gov-tooltip/gov-tooltip.scss?tag=gov-tooltip","../../../packages/core/src/components/gov-tooltip/gov-tooltip.tsx"],"sourcesContent":["/*\n * Tooltip\n */\n\n$class: \".gov-tooltip\";\n\n#{$class} {\n\tdisplay: inline-block;\n\tborder-bottom: 1px dashed currentcolor;\n\tcolor: color(\"primary\");\n\tcursor: help;\n\n\t@include parameter(\"icon\") {\n\t\tborder-bottom: 0;\n\t}\n}\n","import {Component, Element, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../helpers/Validate/props\"\nimport {\n\tTooltipClass,\n\tTooltipContentClass,\n\tTooltipPosition,\n\tTooltipPositionType,\n\tTooltipSize,\n\tTooltipSizeType,\n\tTooltipVariant,\n\tTooltipVariantType,\n} from \"./constants\"\nimport {createID} from \"../../utils/string.utils\"\nimport {govHost} from \"../../helpers/Dom/template\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\n\n@Component({\n\ttag: \"gov-tooltip\",\n\tstyleUrl: \"gov-tooltip.scss\",\n})\nexport class GovTooltip {\n\tprivate h: GovHost\n\tprivate content: HTMLGovTooltipContentElement\n\tprivate readonly tooltipContentId = undefined\n\tprivate readonly tooltipId = undefined\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.tooltipId = createID(\"GovTooltip\")\n\t\tthis.tooltipContentId = createID(\"GovContentTooltip\")\n\t}\n\n\t@Element() host: HTMLGovTooltipElement\n\t/**\n\t * Style variation of the tooltip\n\t */\n\t@Prop() readonly variant?: TooltipVariantType = TooltipVariant.PRIMARY\n\t/**\n\t * Tooltip’s size.\n\t */\n\t@Prop() readonly size?: TooltipSizeType = TooltipSize._M\n\t/**\n\t * Tooltip display position\n\t */\n\t@Prop({mutable: true}) position: TooltipPositionType = \"right\"\n\t/**\n\t * Information contained in the tooltip\n\t */\n\t@Prop() readonly message: string = undefined\n\t/**\n\t * Custom tooltip identifier.\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Trigger is just an icon\n\t */\n\t@Prop({reflect: true}) readonly icon: boolean = undefined\n\n\t@State() persist = false\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(TooltipVariant, newValue, TooltipClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(TooltipSize, newValue, TooltipClass.root)\n\t}\n\n\t@Watch(\"position\")\n\tvalidatePosition(newValue: string): void {\n\t\tvalidateProp(TooltipPosition, newValue, TooltipClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t\tthis.validatePosition(this.position)\n\n\t\tthis.createContentWrapper()\n\t\tthis.registerListeners()\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.removeContent()\n\t}\n\n\tprivate createContentWrapper() {\n\t\tconst hasContentInside = this.host.querySelector(TooltipContentClass.root) as HTMLGovTooltipContentElement\n\t\tif (hasContentInside) {\n\t\t\tthis.content = hasContentInside\n\t\t} else {\n\t\t\tthis.content = document.createElement(TooltipContentClass.root) as HTMLGovTooltipContentElement\n\t\t\tthis.content.innerHTML = this.message\n\t\t\tthis.host.appendChild(this.content)\n\t\t}\n\n\t\tconst trigger = this.host.getBoundingClientRect()\n\t\tthis.content.style.left = trigger.left + 'px'\n\t\tthis.content.style.top = trigger.top + 'px'\n\t\tthis.content.style.visibility = 'hidden'\n\n\t\tthis.content.setAttribute(\"id\", this.identifier ?? this.tooltipContentId)\n\t\tthis.content.setAttribute(\"parent-id\", this.tooltipId)\n\t\tthis.content.setAttribute(\"variant\", this.variant)\n\t\tthis.content.setAttribute(\"size\", this.size)\n\t\tdocument.body.appendChild(this.content)\n\t}\n\n\tprivate registerListeners() {\n\t\tthis.host.addEventListener(\"click\", e => {\n\t\t\te.preventDefault()\n\t\t\tthis.persist = true\n\t\t\tif (this.content) {\n\t\t\t\tthis.content.setAttribute(\"persist\", \"true\")\n\t\t\t}\n\t\t\tthis.showTooltip()\n\t\t})\n\t\tthis.host.addEventListener(\"focus\", e => {\n\t\t\te.preventDefault()\n\t\t\tthis.showTooltip()\n\t\t})\n\t\tthis.host.addEventListener(\"blur\", e => {\n\t\t\te.preventDefault()\n\t\t\tif (this.persist === false) {\n\t\t\t\tthis.hideTooltip()\n\t\t\t}\n\t\t})\n\t\tthis.host.addEventListener(\"mouseenter\", e => {\n\t\t\te.preventDefault()\n\t\t\tthis.showTooltip()\n\t\t})\n\t\tthis.host.addEventListener(\"mouseleave\", e => {\n\t\t\te.preventDefault()\n\t\t\tif (this.persist === false) {\n\t\t\t\tthis.hideTooltip()\n\t\t\t}\n\t\t})\n\t}\n\n\tprivate verifyPositionSpace() {\n\t\tconst offset = 12\n\t\tconst windowWidth = window.innerWidth\n\t\tconst trigger = this.host.getBoundingClientRect()\n\t\tconst trgWidth = this.host.offsetWidth\n\t\tconst trgHeight = this.host.offsetHeight\n\t\tconst contentWidth = this.content.offsetWidth\n\t\tconst contentHeight = this.content.offsetHeight\n\t\tconst triggerPos = {\n\t\t\tleft: trigger.left + document.documentElement.scrollLeft,\n\t\t\ttop: trigger.top + document.documentElement.scrollTop,\n\t\t}\n\n\t\tconst isRightSpace = ((triggerPos.left + offset + trigger.width) + contentWidth) <= windowWidth;\n\t\tconst isLeftSpace = triggerPos.left > contentWidth;\n\n\t\t// LEFT/RIGHT\n\t\tif (this.position === TooltipPosition.LEFT || this.position === TooltipPosition.RIGHT) {\n\t\t\tthis.content.style.top = (triggerPos.top - ((contentHeight - trgHeight) / 2)) + \"px\";\n\t\t\tif (isRightSpace === false && isLeftSpace === false) {\n\t\t\t\tthis.position = TooltipPosition.TOP\n\t\t\t\tthis.content.setAttribute(\"position\", TooltipPosition.TOP)\n\t\t\t}\n\t\t\tif (isLeftSpace && isRightSpace === false && this.position === TooltipPosition.RIGHT) {\n\t\t\t\tthis.position = TooltipPosition.LEFT\n\t\t\t}\n\t\t\tif (isRightSpace && isLeftSpace === false && this.position === TooltipPosition.LEFT) {\n\t\t\t\tthis.position = TooltipPosition.RIGHT\n\t\t\t}\n\t\t}\n\t\tif (this.position === TooltipPosition.RIGHT) {\n\t\t\tthis.content.setAttribute(\"position\", TooltipPosition.RIGHT)\n\t\t\tthis.content.style.left = (triggerPos.left + offset + trigger.width) + \"px\"\n\t\t}\n\t\tif (this.position === TooltipPosition.LEFT) {\n\t\t\tthis.content.setAttribute(\"position\", TooltipPosition.LEFT)\n\t\t\tthis.content.style.left = (triggerPos.left - (contentWidth + offset)) + \"px\"\n\t\t}\n\n\t\t// LEFT/RIGHT FOR TOP/BOTTOM\n\t\tif (this.position === TooltipPosition.TOP || this.position === TooltipPosition.BOTTOM) {\n\t\t\tif (contentWidth > trgWidth) {\n\t\t\t\tlet leftPosition = (triggerPos.left - ((contentWidth - trgWidth) / 2));\n\t\t\t\tconst isNotLeftSpace = leftPosition < 0;\n\t\t\t\tconst isNotRightSpace = (leftPosition + contentWidth) > windowWidth;\n\t\t\t\tif (isNotLeftSpace && isNotRightSpace) {\n\t\t\t\t\tthis.content.style.width = \"auto\";\n\t\t\t\t\tthis.content.style.left = offset + \"px\";\n\t\t\t\t\tthis.content.style.right = offset + \"px\";\n\t\t\t\t} else {\n\t\t\t\t\tif (isNotLeftSpace) {\n\t\t\t\t\t\tleftPosition = offset\n\t\t\t\t\t}\n\t\t\t\t\tif (isNotRightSpace) {\n\t\t\t\t\t\tleftPosition = leftPosition - ((windowWidth - (leftPosition + contentWidth + offset)) * -1)\n\t\t\t\t\t}\n\t\t\t\t\tthis.content.style.left = leftPosition + \"px\"\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst leftPosition = (triggerPos.left + ((trgWidth - contentWidth) / 2))\n\n\t\t\t\tthis.content.style.left = leftPosition + \"px\"\n\t\t\t}\n\t\t}\n\t\tif (this.position === TooltipPosition.TOP) {\n\t\t\tthis.content.setAttribute(\"position\", TooltipPosition.TOP)\n\t\t\tthis.content.style.top = (triggerPos.top - (contentHeight + offset)) + \"px\"\n\t\t}\n\t\tif (this.position === TooltipPosition.BOTTOM) {\n\t\t\tthis.content.setAttribute(\"position\", TooltipPosition.BOTTOM)\n\t\t\tthis.content.style.top = (triggerPos.top + (trgHeight + offset)) + \"px\"\n\t\t}\n\n\t\tthis.content.setAttribute(\"is-visible\", \"true\")\n\t\tthis.content.style.opacity = '1'\n\n\t}\n\n\tprivate showTooltip() {\n\t\tif (this.content) {\n\t\t\tthis.content.style.opacity = '0'\n\t\t\tthis.content.hidden = false\n\t\t\tthis.verifyPositionSpace()\n\t\t}\n\t}\n\n\tprivate hideTooltip() {\n\t\tif (this.content) {\n\t\t\tthis.content.setAttribute(\"is-visible\", \"false\")\n\t\t\tthis.content.setAttribute(\"persist\", \"false\")\n\t\t}\n\t}\n\n\tprivate removeContent() {\n\t\tconst contentEl = document.getElementById(this.tooltipContentId)\n\t\tif (contentEl) {\n\t\t\tcontentEl.remove()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tid={this.tooltipId}\n\t\t\t\tclass={this.h.classes(TooltipClass.root)}\n\t\t\t\tposition={this.position}\n\t\t\t\ttabindex={0}\n\t\t\t\taria-describedby={this.identifier ?? this.tooltipContentId}>\n\t\t\t\t<slot/>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Showing the modal\n\t */\n\t@Method()\n\tasync show(): Promise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,UACToF,MAAOvF,KAAKQ,EAAEgF,QAAQzE,EAAaC,MACnCO,SAAUvB,KAAKuB,SACfkE,SAAU,EAAC,oBACO7C,EAAA5C,KAAK6C,cAAU,MAAAD,SAAA,EAAAA,EAAI5C,KAAKC,kBAC1CO,EAAA,a,CASH,UAAMkF,GACL1F,KAAKmD,a,CAON,UAAMwC,GACL3F,KAAKkD,QAAU,MACflD,KAAKoD,a"}
@@ -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","GovFormFile","constructor","hostRef","this","fileId","createID","h","govHost","host","f","govForm","watchDisabled","passControlAttrs","passAttrToControl","toBoolAttr","invalid","registerListeners","highlight","areaRef","classList","add","unhighlight","remove","inputRef","addEventListener","e","preventDefault","stopPropagation","files","target","validateFiles","expanded","events","inEvents","outEvents","map","eventName","preventDefaults","bind","forEach","handleDrop","dataTransfer","filesBuffer","Array","from","isFile","find","name","isSizeValid","maxFileSize","isAcceptValid","newFile","id","acceptValid","sizeValid","displayAttachments","govAddFile","emit","component","govFiles","componentWillLoad","passAttrToLabel","String","required","componentDidRender","canValidateWcagOnRender","delay","validateWcag","render","Host","class","classes","toBoolAttrIfDefined","ref","el","identifier","multiple","onChange","onChangeHandler","onFocus","onFocusHandler","onBlur","onBlurHandler","disabled","wcagDescribedBy","wcagLabelledBy","hasSlot","wcagAttachmentsLabel","onRemoveFileHandler","wcagRemoveLabel","slot","variant","errorAccept","errorSize","index","findIndex","removeFile","splice","govRemoveFile","govFocus","originalEvent","govBlur","getRef","getAreaRef","reset","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 * 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\twatchDisabled(): 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(\"type\", \"File\")\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\tthis.validateFiles(files)\n\t\t\t},\n\t\t\tfalse,\n\t\t)\n\t\t//this.inputRef.addEventListener('focus')\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) {\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\t}\n\n\tcomponentWillLoad() {\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\tthis.watchDisabled()\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)} expanded={toBoolAttrIfDefined(this.expanded)}>\n\t\t\t\t<div class={FormFileClass.area} ref={el => (this.areaRef = el as HTMLDivElement)}>\n\t\t\t\t\t<slot />\n\t\t\t\t\t<input\n\t\t\t\t\t\tclass={FormFileClass.input}\n\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\tid={this.identifier || this.fileId}\n\t\t\t\t\t\ttype=\"file\"\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\taccept={this.accept}\n\t\t\t\t\t\tmultiple={this.multiple}\n\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\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} on-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}\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\t}\n}\n"],"mappings":"wbAAO,MAAMA,EAAgB,CAC5BC,KAAM,gBACNC,KAAM,sBACNC,MAAO,uBACPC,MAAO,uBACPC,KAAM,sBACNC,KAAM,sBACNC,YAAa,8B,SCPEC,EAAYC,GAC3B,MAAMC,EAAQ,CAAC,QAAS,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,OACzE,IAAIC,EAAI,EACPC,EAAIC,SAASJ,EAAO,KAAO,EAE5B,MAAOG,GAAK,QAAUD,EAAG,CACxBC,EAAIA,EAAI,I,CAGT,OAAOA,EAAEE,QAAQ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,cAAe3E,G,CAIT,eAAAqD,CAAgBrD,GACvBA,EAAEE,iB,CAOH,YAAM2E,GACL,OAAOnG,KAAKoB,Q,CAOb,gBAAMgF,GACL,OAAOpG,KAAKe,O,CAOb,WAAMsF,GACLrG,KAAKyB,MAAQ,E,CAOd,kBAAMuC,GACLsC,EAAgBtG,KAAKiF,gBAAiB,oBAAqBpH,EAAcC,MACzEwI,EAAgBtG,KAAKkF,eAAgB,mBAAoBrH,EAAcC,MACvEyI,EAAqBvG,KAAKwE,YAAcxE,KAAKC,OAAQD,KAAKkF,eAAgBrH,EAAcC,K"}
@@ -1,2 +0,0 @@
1
- import{r as o,c as a,h as e,a as t,g as i}from"./p-5bc604a3.js";import{g as r,a as s}from"./p-28e59384.js";import{c as d}from"./p-003e6cca.js";import{a as l}from"./p-7f2c9830.js";import{a as n}from"./p-7724b535.js";import{c as m}from"./p-24636c53.js";import{d as g}from"./p-03990da5.js";import{M as c}from"./p-be4aab0e.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=class{constructor(e){o(this,e);this.govClose=a(this,"gov-close",7);this.open=false;this.blockClose=false;this.label=undefined;this.role="dialog";this.labelTag="h2";this.wcagLabelledBy=undefined;this.wcagDescribedBy=undefined;this.wcagCloseLabel="Zavřít okno";this.wcagCloseLabelledBy=undefined;this.h=r(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)){l(`[${c.root}]: Tag ${o} is not allowed.`)}}}watchOpen(o){this.open=o}showModal(){this.open=true;document.body.classList.add(c.bodyFix)}hideModal(){this.open=false;document.body.classList.remove(c.bodyFix)}async componentWillRender(){if(this.open){this.showModal()}else{this.hideModal()}}async componentDidRender(){if(d()){await g(500);await this.validateWcag()}}render(){const o=this.labelTag;return e(t,{class:this.h.classes(c.root),open:this.open},e("dialog",{class:c.dialog,hidden:!this.open,tabindex:"-1",open:this.open,"aria-modal":"true","aria-hidden":s(!this.open),"aria-labelledby":this.wcagLabelledBy||this.labelId,"aria-describedby":this.wcagDescribedBy||this.contentId,role:this.role},e("div",{class:c.inner},e("div",{class:c.header},this.h.hasSlot("icon")&&e("div",{class:c.icon},e("slot",{name:"icon"})),this.label&&e(o,{class:c.title,id:this.labelId},this.label),e("gov-button",{disabled:this.blockClose,class:c.close,variant:"primary",wcagLabel:this.wcagCloseLabel,wcagLabelledBy:this.wcagCloseLabelledBy,type:"base","on-gov-click":this.onCloseHandler.bind(this)},e("gov-icon",{name:"x-lg"}))),e("div",{class:c.content,id:this.contentId},e("slot",null)),this.h.hasSlot("footer")&&e("div",{class:c.footer},e("slot",{name:"footer"})))),this.open?e("gov-backdrop",{"wcag-label":this.wcagCloseLabel,"wcag-labelled-by":this.wcagCloseLabelledBy,"on-gov-click":this.onCloseHandler.bind(this)}):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(){n(this.wcagLabelledBy,"wcag-labelled-by",c.root);n(this.wcagDescribedBy,"wcag-described-by",c.root)}get host(){return i(this)}static get watchers(){return{labelTag:["validateLabelTag"],open:["watchOpen"]}}};v.style=h;export{v as gov_modal};
2
- //# sourceMappingURL=p-a63bb91e.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["govModalCss","GovModal","constructor","hostRef","this","h","govHost","host","labelId","createID","contentId","validateLabelTag","newValue","validTags","includes","govErrorLog","ModalClass","root","watchOpen","open","showModal","document","body","classList","add","bodyFix","hideModal","remove","componentWillRender","componentDidRender","canValidateWcagOnRender","delay","validateWcag","render","LabelTag","labelTag","Host","class","classes","dialog","hidden","tabindex","toBoolAttr","wcagLabelledBy","wcagDescribedBy","role","inner","header","hasSlot","icon","name","label","title","id","disabled","blockClose","close","variant","wcagLabel","wcagCloseLabel","wcagCloseLabelledBy","type","onCloseHandler","bind","content","footer","e","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, Host, Method, Prop, Watch, h } 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 './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\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 * 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 wcagCloseLabel: 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}\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=\"-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\tdisabled={this.blockClose}\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.wcagCloseLabel}\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\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{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.wcagCloseLabel} wcag-labelled-by={this.wcagCloseLabelledBy} on-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\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":"mUAAA,MAAMA,EAAc,wyF,MCePC,EAAQ,MAKpB,WAAAC,CAAAC,G,wDAWgC,M,gBAIX,M,+BAQiC,S,cAIQ,K,iFAYa,c,mCAtC1EC,KAAKC,EAAIC,EAAQF,KAAKG,MACtBH,KAAKI,QAAUC,EAAS,iBACxBL,KAAKM,UAAYD,EAAS,kB,CA+C3B,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,C,CAGL,SAAAQ,GACPhB,KAAKe,KAAO,KACZE,SAASC,KAAKC,UAAUC,IAAIR,EAAWS,Q,CAGhC,SAAAC,GACPtB,KAAKe,KAAO,MACZE,SAASC,KAAKC,UAAUI,OAAOX,EAAWS,Q,CAG3C,yBAAMG,GACL,GAAIxB,KAAKe,KAAM,CACdf,KA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K0D,eAAeC,KAAK3D,QAC/H,K,CAKC,cAAA0D,CAAeI,GACtBA,EAAEC,kBACF,GAAI/D,KAAKmD,aAAe,MAAO,CAC9BnD,KAAKsB,YACLtB,KAAKgE,SAASC,KAAKH,E,EAQrB,UAAMI,GACLlE,KAAKgB,W,CAON,UAAMmD,GACLnE,KAAKsB,W,CAON,kBAAMM,GACLwC,EAAgBpE,KAAKuC,eAAgB,mBAAoB3B,EAAWC,MACpEuD,EAAgBpE,KAAKwC,gBAAiB,oBAAqB5B,EAAWC,K"}
@@ -1,2 +0,0 @@
1
- import{r as o,c as r,h as e,a,g as t}from"./p-5bc604a3.js";import{v as i}from"./p-7724b535.js";import{c as s}from"./p-003e6cca.js";import{d as n}from"./p-03990da5.js";import{g as c}from"./p-28e59384.js";import"./p-7f2c9830.js";import"./p-24636c53.js";const m={root:"gov-breadcrumbs"};const d=".gov-breadcrumbs ul{margin:0;padding:0}.gov-breadcrumbs li{margin:0;padding:0;background:none}.gov-breadcrumbs li::before{display:none}.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-breadcrumbs ul{position:relative;display:flex;width:100%;padding-bottom:0.3125rem;overflow-x:auto}.gov-breadcrumbs li{display:flex;justify-content:flex-start;align-items:center;white-space:nowrap}.gov-breadcrumbs button{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);padding:0;border:none;background:none;color:var(--gov-breadcrumbs-link-color, var(--gov-color-primary));text-decoration:underline}.gov-breadcrumbs button:hover{text-decoration:none}.gov-breadcrumbs .gov-icon{width:0.625rem;height:0.625rem;margin:0rem 1rem;color:var(--gov-breadcrumbs-arrow-color, var(--gov-color-secondary-600))}";const g=class{constructor(e){o(this,e);this.govChange=r(this,"gov-change",7);this.collapsible=false;this.isExpanded=false;this.wcagLabel=undefined;this.wcagLabelledBy=undefined;this.h=c(this.host)}async componentDidRender(){if(s()){await n(500);await this.validateWcag()}}render(){return e(a,{class:this.h.classes(m.root)},e("nav",{"aria-label":this.wcagLabel,"aria-labelledby":this.wcagLabelledBy},e("slot",null)))}async validateWcag(){i(this.wcagLabel,this.wcagLabelledBy,m.root)}get host(){return t(this)}};g.style=d;export{g as gov_breadcrumbs};
2
- //# sourceMappingURL=p-a6b6dc73.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["BreadcrumbsClass","root","govBreadcrumbsCss","GovBreadcrumbs","constructor","hostRef","this","h","govHost","host","componentDidRender","canValidateWcagOnRender","delay","validateWcag","render","Host","class","classes","wcagLabel","wcagLabelledBy","validateWcagLabel"],"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\tul {\n\t\t@extend %reset-ul;\n\t\t@include base(flex);\n\t\tpadding-bottom: rem-calc(5);\n\t\toverflow-x: auto;\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: center;\n\t\twhite-space: nowrap;\n\t}\n\tbutton {\n\t\t@include typography($font-size-m);\n\t\tpadding: 0;\n\t\tborder: none;\n\t\tbackground: none;\n\t\tcolor: $breadcrumbs-link-color;\n\t\ttext-decoration: underline;\n\t\t&:hover {\n\t\t\ttext-decoration: none;\n\t\t}\n\t}\n\t& .gov-icon {\n\t\twidth: rem-calc(10);\n\t\theight: rem-calc(10);\n\t\tmargin: rem-calc(0 16px);\n\t\tcolor: $breadcrumbs-arrow-color;\n\t}\n}\n","import { Component, Element, h, Host, Method, Prop, Event, EventEmitter } 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 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\n\t/**\n\t * Called when the Breadcrumbs state changes\n\t */\n\t@Event({ eventName: 'gov-change' }) govChange: EventEmitter<GovBreadcrumbsChangeEvent>\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\treturn (\n\t\t\t<Host class={this.h.classes(BreadcrumbsClass.root)}>\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</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}\n}\n"],"mappings":"2PAAO,MAAMA,EAAmB,CAC/BC,KAAM,mBCDP,MAAMC,EAAoB,orC,MCabC,EAAc,MAG1B,WAAAC,CAAAC,G,iEAQwC,M,gBAI2B,M,uDAXlEC,KAAKC,EAAIC,EAAQF,KAAKG,K,CA0BvB,wBAAMC,GACL,GAAIC,IAA2B,OACxBC,EAAM,WACNN,KAAKO,c,EAIb,MAAAC,GACC,OACCP,EAACQ,EAAI,CAACC,MAAOV,KAAKC,EAAEU,QAAQjB,EAAiBC,OAC5CM,EAAA,oBAAiBD,KAAKY,UAAS,kBAAmBZ,KAAKa,gBACtDZ,EAAA,c,CAWJ,kBAAMM,GACLO,EAAkBd,KAAKY,UAAWZ,KAAKa,eAAgBnB,EAAiBC,K"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["TagClass","root","govTagCss","GovTag","constructor","hostRef","ButtonSizes","_S","ButtonVariants","PRIMARY","this","h","govHost","host","validateVariant","newValue","validateProp","validateSize","componentWillLoad","variant","size","render","iconLeft","prepareIconFormat","iconRight","Host","class","classes","type","inverse","undefined","hasSlot","name"],"sources":["../../../packages/core/src/components/gov-tag/constants.ts","../../../packages/core/src/components/gov-tag/gov-tag.scss?tag=gov-tag","../../../packages/core/src/components/gov-tag/gov-tag.tsx"],"sourcesContent":["export const TagClass = {\n\troot: 'gov-tag',\n}\n","/*\n * Tag\n */\n\n// Shared definitions - button & chip & tag\n@import \"../gov-button/button/gov-button-core\";\n\n.gov-tag {\n\t@extend %button-core;\n\tdisplay: inline-flex;\n\ta .gov-icon {\n\t\tmargin: 0;\n\t}\n\t.element {\n\t\tpadding: rem-calc(4 8);\n\t\tfont-family: $font-family-primary;\n\t\tfont-weight: 400;\n\t\tletter-spacing: initial;\n\t}\n\t.gov-button {\n\t\t.element {\n\t\t\tborder: none;\n\t\t}\n\t}\n\n\t// VARIANTS\n\t@each $size, $definitions in $button-sizes {\n\t\t&[size=\"#{$size}\"] {\n\t\t\t.element {\n\t\t\t\tborder-radius: $tag-radius;\n\t\t\t\tcolumn-gap: $tag-gap;\n\t\t\t}\n\n\t\t\t// HOVERS\n\t\t\t&[hoverable] .element {\n\t\t\t\t@include focus-outline($tag-radius, $outline-offset);\n\t\t\t}\n\t\t}\n\t}\n\t@each $variant, $types in $tag-variants {\n\t\t@each $type, $definitions in $types {\n\t\t\t&[type=\"#{$type}\"][variant=\"#{$variant}\"] {\n\t\t\t\t.element {\n\t\t\t\t\tbackground-color: deep-map-get($tag-variants, $variant, $type, \"bg\");\n\t\t\t\t\tcolor: deep-map-get($tag-variants, $variant, $type, \"color\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t@each $variant, $types in $chip-inverse-variants {\n\t\t&[variant=\"#{$variant}\"] {\n\t\t\t@include parameter(\"inverse\") {\n\t\t\t\t.element,\n\t\t\t\t.element .element {\n\t\t\t\t\tborder-width: rem-calc(1);\n\t\t\t\t\tborder-color: deep-map-get($chip-inverse-variants, $variant, \"border-color\");\n\t\t\t\t\tbackground-color: deep-map-get($chip-inverse-variants, $variant, \"bg\");\n\t\t\t\t\tcolor: deep-map-get($chip-inverse-variants, $variant, \"color\");\n\t\t\t\t\t@include hover() {\n\t\t\t\t\t\tborder-color: deep-map-get($chip-inverse-variants, $variant, \"border-color-hover\");\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, h, Host, Prop, Watch} from '@stencil/core'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {validateProp} from '../../helpers/Validate/props'\nimport {ButtonSizes, ButtonSizesType, ButtonVariants, ButtonVariantType} from '../gov-button/button/constants'\nimport {TagClass} from './constants'\nimport {prepareIconFormat} from \"../gov-icon/helpers\";\n\n@Component({\n\ttag: 'gov-tag',\n\tstyleUrl: 'gov-tag.scss',\n})\nexport class GovTag {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovTagElement\n\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 * Definition of the button icon on the left. The icon must be defined in the form \"type/name\".\n\t */\n\t@Prop({attribute: \"icon-left\"}) readonly iconLeft?: string\n\t/**\n\t * Definition of the button icon on the left. The icon must be defined in the form \"type/name\".\n\t */\n\t@Prop({attribute: \"icon-right\"}) readonly iconRight?: string\n\t/**\n\t * Tag’s size.\n\t */\n\t@Prop({reflect: true}) readonly size: ButtonSizesType = ButtonSizes._S\n\t/**\n\t * Style variation of the tag.\n\t */\n\t@Prop({reflect: true}) readonly variant: ButtonVariantType = ButtonVariants.PRIMARY\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(ButtonVariants, newValue, TagClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(ButtonSizes, newValue, TagClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t}\n\n\trender() {\n\t\tconst iconLeft = prepareIconFormat(this.iconLeft)\n\t\tconst iconRight = prepareIconFormat(this.iconRight)\n\t\treturn (\n\t\t\t<Host class={this.h.classes(TagClass.root)}\n\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\ttype={this.inverse ? undefined : 'solid'}\n\t\t\t\t\t\tsize={this.size} inverse={this.inverse}>\n\t\t\t\t<span class=\"element\">\n\t\t\t\t\t{this.h.hasSlot('left-icon') && <slot name=\"left-icon\"></slot>}\n\t\t\t\t\t{iconLeft && \t<gov-icon type={iconLeft.type} name={iconLeft.name}></gov-icon>}\n\t\t\t\t\t<slot/>\n\t\t\t\t\t{iconRight && \t<gov-icon type={iconRight.type} name={iconRight.name}></gov-icon>}\n\t\t\t\t\t{this.h.hasSlot('right-icon') && <slot name=\"right-icon\"></slot>}\n\t\t\t\t</span>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"wUAAO,MAAMA,EAAW,CACvBC,KAAM,WCDP,MAAMC,EAAY,813E,MCYLC,EAAM,MAGlB,WAAAC,CAAAC,G,uBASoC,M,2DAYoBC,EAAYC,G,aAIPC,EAAeC,QAxB3EC,KAAKC,EAAIC,EAAQF,KAAKG,K,CA2BvB,eAAAC,CAAgBC,GACfC,EAAaR,EAAgBO,EAAUf,EAASC,K,CAIjD,YAAAgB,CAAaF,GACZC,EAAaV,EAAaS,EAAUf,EAASC,K,CAG9C,iBAAAiB,GACCR,KAAKI,gBAAgBJ,KAAKS,SAC1BT,KAAKO,aAAaP,KAAKU,K,CAGxB,MAAAC,GACC,MAAMC,EAAWC,EAAkBb,KAAKY,UACxC,MAAME,EAAYD,EAAkBb,KAAKc,WACzC,OACCb,EAACc,EAAI,CAACC,MAAOhB,KAAKC,EAAEgB,QAAQ3B,EAASC,MAClCkB,QAAST,KAAKS,QACdS,KAAMlB,KAAKmB,QAAUC,UAAY,QACjCV,KAAMV,KAAKU,KAAMS,QAASnB,KAAKmB,SACjClB,EAAA,QAAMe,MAAM,WACVhB,KAAKC,EAAEoB,QAAQ,cAAgBpB,EAAA,QAAMqB,KAAK,cAC1CV,GAAaX,EAAA,YAAUiB,KAAMN,EAASM,KAAMI,KAAMV,EAASU,OAC5DrB,EAAA,aACCa,GAAcb,EAAA,YAAUiB,KAAMJ,EAAUI,KAAMI,KAAMR,EAAUQ,OAC9DtB,KAAKC,EAAEoB,QAAQ,eAAiBpB,EAAA,QAAMqB,KAAK,gB"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["govPromptCss","GovPrompt","constructor","hostRef","this","h","govHost","host","labelId","createID","contentId","validateLabelTag","newValue","validTags","includes","govErrorLog","ModalClass","root","watchOpen","open","showModal","document","body","classList","add","bodyFix","hideModal","remove","componentWillRender","componentDidRender","canValidateWcagOnRender","delay","validateWcag","render","LabelTag","labelTag","Host","class","classes","rootPrompt","dialog","hidden","tabindex","toBoolAttr","wcagLabelledBy","wcagDescribedBy","role","inner","header","hasSlot","icon","name","label","title","id","close","variant","wcagLabel","wcagCloseLabel","wcagCloseLabelledBy","type","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\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 wcagCloseLabel: 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}\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.wcagCloseLabel}\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\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.wcagCloseLabel} wcag-labelled-by={this.wcagCloseLabelledBy} on-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,wyF,MCeRC,EAAS,MAKrB,WAAAC,CAAAC,G,wDAUgC,M,+BAQsB,S,cAIQ,K,iFAYa,c,mCAjC1EC,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,C,CAGL,SAAAQ,GACPhB,KAAKe,KAAO,KACZE,SAASC,KAAKC,UAAUC,IAAIR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Kb/C,KAAKe,KACLd,EAAA,6BAA0BD,KAAKsD,eAAc,mBAAoBtD,KAAKuD,oBAAmB,eAAgBvD,KAAKyD,eAAeC,KAAK1D,QAC/H,K,CAKC,cAAAyD,CAAeI,GACtBA,EAAEC,kBACF9D,KAAKsB,YACLtB,KAAK+D,SAASC,KAAKH,E,CAOpB,UAAMI,GACLjE,KAAKgB,W,CAON,UAAMkD,GACLlE,KAAKsB,W,CAON,kBAAMM,GACLuC,EAAgBnE,KAAKwC,eAAgB,mBAAoB5B,EAAWC,MACpEsD,EAAgBnE,KAAKyC,gBAAiB,oBAAqB7B,EAAWC,K"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["govFormInputCss","Tags","GovFormInput","constructor","hostRef","this","h","govHost","host","inputId","createID","f","govForm","validateVariant","newValue","validateProp","FormInputVariants","FormInputClass","root","validateSize","FormInputSizes","watchDisabled","passControlAttrs","passAttrToControl","size","toBoolAttr","invalid","multiline","TEXTAREA","INPUT","componentWillLoad","variant","passAttrToLabel","String","required","componentDidRender","canValidateWcagOnRender","delay","validateWcag","render","Tag","Host","class","type","hasSlot","name","success","slot","inputType","disabled","id","identifier","onFocus","onFocusHandler","bind","onInput","onInputHandler","onBlur","onBlurHandler","onKeyUp","onKeyUpHandler","onKeyDown","onKeyDownHandler","ref","el","inputRef","placeholder","value","readonly","toBoolAttrIfDefined","autocomplete","toOnOffAttrIfDefined","autocorrect","minlength","maxlength","min","max","rows","cols","role","wcagDescribedBy","wcagLabelledBy","wcagOwns","wcagExpanded","wcagAutocomplete","e","stopPropagation","focused","govFocus","emit","component","originalEvent","govBlur","govKeyUp","govKeyDown","target","govInput","setFocus","options","focus","setValue","clearValue","getRef","validateWcagRef","validateWcagLabelFor"],"sources":["../../../packages/core/src/components/gov-form/input/gov-form-input.scss?tag=gov-form-input","../../../packages/core/src/components/gov-form/input/gov-form-input.tsx"],"sourcesContent":["/*\n * Input\n */\n\n@import \"../input/gov-form-input-core.scss\";\n$class: \".gov-form-input\";\n\n#{$class} {\n\t@extend %form-input-core;\n\n\t// VARIANTS\n\t&[type=\"reset\"] {\n\t\tinput {\n\t\t\tborder-width: 0;\n\t\t\t&:focus {\n\t\t\t\toutline: none;\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 { govForm } from \"../../../helpers/Dom/form\"\nimport { GovForm } from \"../../../helpers/Dom/form.types\"\nimport { govHost, toBoolAttr, toBoolAttrIfDefined, toOnOffAttrIfDefined } 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\tFormInputClass,\n\tFormInputSizes,\n\tFormInputSizesType,\n\tFormInputVariants,\n\tFormInputVariantType,\n\tInputType,\n\tType,\n} from \"./constants\"\nimport { FormInputEvent } from \"./gov-form-input.types\"\nimport { Nullable } from \"../../../types/interfaces\"\n\nenum Tags {\n\tINPUT = \"input\",\n\tTEXTAREA = \"textarea\",\n}\n\n@Component({\n\ttag: \"gov-form-input\",\n\tstyleUrl: \"gov-form-input.scss\",\n})\nexport class GovFormInput {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\tprivate inputRef?: HTMLInputElement\n\tprivate readonly inputId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.inputId = createID(\"GovInput\")\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormInputElement\n\t/**\n\t * Value of input\n\t */\n\t@Prop({ reflect: true, mutable: true }) value: string\n\t/**\n\t * Custom input identifier.\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * Style variation of the form input.\n\t */\n\t@Prop() readonly variant?: FormInputVariantType = \"secondary\"\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 * Input’s size.\n\t */\n\t@Prop() readonly size?: FormInputSizesType = \"m\"\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Generates a texarea for the possibility of multiple lines\n\t */\n\t@Prop() readonly multiline: boolean\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-rows\n\t */\n\t@Prop() readonly rows: number\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-cols\n\t */\n\t@Prop() readonly cols: number\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 input 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 * Text that appears in the form control when it has no value set\n\t */\n\t@Prop() readonly placeholder: string\n\t/**\n\t * The value is not editable\n\t */\n\t@Prop() readonly readonly: boolean\n\t/**\n\t * Minimum length (number of characters) of value\n\t */\n\t@Prop() readonly minlength: number\n\t/**\n\t * Maximum length (number of characters) of value\n\t */\n\t@Prop() readonly maxlength: number\n\t/**\n\t * Minimum value that is acceptable and valid for the input containing the attribute\n\t */\n\t@Prop() readonly min?: string | number\n\t/**\n\t * Maximum value that is acceptable and valid for the input containing the attribute\n\t */\n\t@Prop() readonly max?: string | number\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-autocomplete\n\t */\n\t@Prop() readonly autocomplete: boolean\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-autocorrect\n\t */\n\t@Prop() readonly autocorrect: boolean\n\t/**\n\t * Defineds the visual style of input\n\t */\n\t@Prop() readonly type?: Type\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types\n\t */\n\t@Prop({ attribute: \"input-type\" }) readonly inputType: InputType = \"text\"\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/input_role\n\t */\n\t@Prop() readonly role: Nullable<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 * 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 * Indicates whether inputting text could trigger display of one or more predictions of the user's intended value.\n\t */\n\t@Prop({ attribute: \"wcag-autocomplete\" }) readonly wcagAutocomplete: string\n\t/**\n\t * Attribute is set on an element to indicate if a control is expanded or collapsed\n\t */\n\t@Prop({ attribute: \"wcag-expanded\" }) readonly wcagExpanded: boolean\n\t/**\n\t * Emitted when the input has focus.\n\t */\n\t@Event({ eventName: \"gov-focus\" }) govFocus: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input loses focus.\n\t */\n\t@Event({ eventName: \"gov-blur\" }) govBlur: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: \"gov-input\" }) govInput: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: \"gov-keyup\" }) govKeyUp: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: \"gov-keydown\" }) govKeyDown: EventEmitter<FormInputEvent>\n\t@State() focused: boolean\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormInputVariants, newValue, FormInputClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormInputSizes, newValue, FormInputClass.root)\n\t}\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\t@Watch(\"type\")\n\t@Watch(\"size\")\n\twatchDisabled(): 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(\"type\", this.multiline ? Tags.TEXTAREA : Tags.INPUT)\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t\tthis.passControlAttrs()\n\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\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 Tag = this.multiline ? Tags.TEXTAREA : Tags.INPUT\n\n\t\treturn (\n\t\t\t<Host class={FormInputClass.root} size={this.size} variant={this.variant} type={this.type}>\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{this.h.hasSlot(\"left-icon\") && <slot name=\"left-icon\" />}\n\n\t\t\t\t\t{this.h.hasSlot(\"right-icon\") && !(this.success || this.invalid) && <slot name=\"right-icon\" />}\n\n\t\t\t\t\t{this.success && !this.multiline &&\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"check-lg\"></gov-icon>}\n\t\t\t\t\t{this.invalid && !this.multiline &&\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"exclamation-lg\"></gov-icon>}\n\t\t\t\t\t<Tag\n\t\t\t\t\t\ttype={this.inputType}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\tid={this.identifier || this.inputId}\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonInput={this.onInputHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\tonKeyUp={this.onKeyUpHandler.bind(this)}\n\t\t\t\t\t\tonKeyDown={this.onKeyDownHandler.bind(this)}\n\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\treadonly={toBoolAttrIfDefined(this.readonly)}\n\t\t\t\t\t\tautocomplete={toOnOffAttrIfDefined(this.autocomplete)}\n\t\t\t\t\t\tautocorrect={toOnOffAttrIfDefined(this.autocorrect)}\n\t\t\t\t\t\tminlength={this.minlength}\n\t\t\t\t\t\tmaxlength={this.maxlength}\n\t\t\t\t\t\tmin={this.min}\n\t\t\t\t\t\tmax={this.max}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\trows={this.rows}\n\t\t\t\t\t\tcols={this.cols}\n\t\t\t\t\t\trole={this.role}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\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\taria-expanded={toBoolAttrIfDefined(this.wcagExpanded)}\n\t\t\t\t\t\taria-autocomplete={this.wcagAutocomplete}\n\t\t\t\t\t/>\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\te.stopPropagation()\n\t\tthis.focused = true\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.focused = false\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onKeyUpHandler(e: KeyboardEvent) {\n\t\te.stopPropagation()\n\t\tthis.govKeyUp.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onKeyDownHandler(e: KeyboardEvent) {\n\t\te.stopPropagation()\n\t\tthis.govKeyDown.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onInputHandler(e: InputEvent) {\n\t\tthis.value = (e.target as HTMLInputElement).value\n\t\te.stopPropagation()\n\t\tthis.govInput.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\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.inputRef.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.value = value\n\t}\n\n\t/**\n\t * Clears input value\n\t */\n\t@Method()\n\tasync clearValue(): Promise<void> {\n\t\tthis.value = \"\"\n\t\tthis.inputRef.value = \"\"\n\t}\n\n\t/**\n\t * Returns an instance of the native html input 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\", FormInputClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, \"wcag-labelled-by\", FormInputClass.root)\n\t\tvalidateWcagRef(this.wcagOwns, \"wcag-owns\", FormInputClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.inputId, this.wcagLabelledBy, FormInputClass.root)\n\t}\n}\n"],"mappings":"6fAAA,MAAMA,EAAkB,28YCsBxB,IAAKC,GAAL,SAAKA,GACJA,EAAA,iBACAA,EAAA,sBACA,EAHD,CAAKA,MAAI,K,MASIC,EAAY,MAMxB,WAAAC,CAAAC,G,4PAkBkD,Y,iCAQL,I,mGAqBR,M,cAKA,M,qOAyC8B,O,mNA5FlEC,KAAKC,EAAIC,EAAQF,KAAKG,MACtBH,KAAKI,QAAUC,EAAS,YACxBL,KAAKM,EAAIC,EAAQP,KAAKC,E,CA+IvB,eAAAO,CAAgBC,GACfC,EAAaC,EAAmBF,EAAUG,EAAeC,K,CAI1D,YAAAC,CAAaL,GACZC,EAAaK,EAAgBN,EAAUG,EAAeC,K,CAOvD,aAAAG,GACChB,KAAKiB,kB,CAGE,gBAAAA,GACPjB,KAAKM,EAAEY,kBAAkB,OAAQlB,KAAKmB,MACtCnB,KAAKM,EAAEY,kBAAkB,UAAWE,EAAWpB,KAAKqB,UACpDrB,KAAKM,EAAEY,kBAAkB,OAAQlB,KAAKsB,UAAY1B,EAAK2B,SAAW3B,EAAK4B,M,CAGxE,iBAAAC,GACCzB,KAAKQ,gBAAgBR,KAAK0B,SAC1B1B,KAAKc,aAAad,KAAKmB,MACvBnB,KAAKiB,mBAELjB,KAA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AAO9D,KAAK8D,MACZwB,cAAeN,G,CAQjB,cAAMY,CAASC,GACd,OAAO7F,KAAK4D,SAASkC,MAAMD,E,CAO5B,cAAME,CAASjC,GACd9D,KAAK8D,MAAQA,C,CAOd,gBAAMkC,GACLhG,KAAK8D,MAAQ,GACb9D,KAAK4D,SAASE,MAAQ,E,CAOvB,YAAMmC,GACL,OAAOjG,KAAK4D,Q,CAOb,kBAAM3B,GACLiE,EAAgBlG,KAAK2E,gBAAiB,oBAAqB/D,EAAeC,MAC1EqF,EAAgBlG,KAAK4E,eAAgB,mBAAoBhE,EAAeC,MACxEqF,EAAgBlG,KAAK6E,SAAU,YAAajE,EAAeC,MAC3DsF,EAAqBnG,KAAK8C,YAAc9C,KAAKI,QAASJ,KAAK4E,eAAgBhE,EAAeC,K"}
@@ -1,2 +0,0 @@
1
- import{r as o,h as r,a,g as e}from"./p-5bc604a3.js";import{V as s}from"./p-ff7365ae.js";import{p as t}from"./p-03990da5.js";t(s,["PRIMARY","SECONDARY"]);const i={root:"gov-form-search",input:"gov-form-search__input",button:"gov-form-search__button"};const n=".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-form-search{position:relative;display:flex;width:100%;gap:0.5rem;align-items:center;border-radius:var(--gov-border-radius, 0.1875rem);background-color:var(--gov-form-bg-color, var(--gov-color-neutral-white))}.gov-form-search:focus{outline:none}.gov-form-search: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}.gov-form-search:focus-within{border-radius:var(--gov-border-radius, 0.1875rem);outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base);outline-offset:0}.gov-form-search__input{flex:1 1 auto}.gov-form-search__input input{height:auto;border-width:0 !important}.gov-form-search__input input:focus-visible{outline:none !important}.gov-form-search__button{flex:0 0 auto;margin:0.1875rem 0.1875rem 0.1875rem 0}.gov-form-search[variant=primary]{border:var(--gov-form-input-border-primary, 0.0625rem solid var(--gov-color-primary-600))}.gov-form-search[variant=secondary]{border:var(--gov-form-input-border-secondary, 0.0625rem solid var(--gov-color-secondary-700))}";const c=class{constructor(r){o(this,r);this.variant="secondary"}render(){return r(a,{class:i.root},r("span",{class:i.input},r("slot",{name:"input"})),r("span",{class:i.button},r("slot",{name:"button"})))}get host(){return e(this)}};c.style=n;export{c as gov_form_search};
2
- //# sourceMappingURL=p-c574ecc8.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["pick","Variants","FormSearchClass","root","input","button","govFormSearchCss","GovFormSearch","render","h","Host","class","name"],"sources":["../../../packages/core/src/components/gov-form/search/constants.ts","../../../packages/core/src/components/gov-form/search/gov-form-search.scss?tag=gov-form-search","../../../packages/core/src/components/gov-form/search/gov-form-search.tsx"],"sourcesContent":["import { Variants } from '../../../core/constants/variants'\nimport { ValueOf } from '../../../types/interfaces'\nimport { pick } from '../../../utils/utils'\n\nexport const FormSearchs = pick(Variants, ['PRIMARY', 'SECONDARY'])\nexport type FormSearchVariantType = `${ValueOf<typeof FormSearchs>}`\n\nexport const FormSearchClass = {\n\troot: 'gov-form-search',\n\tinput: 'gov-form-search__input',\n\tbutton: 'gov-form-search__button',\n}\n","/*\n * Search\n */\n\n$class: \".gov-form-search\";\n\n#{$class} {\n\t@include base(flex);\n\t@include focus-outline($border-radius, 0, true);\n\tgap: rem-calc(8);\n\talign-items: center;\n\tborder-radius: $border-radius;\n\tbackground-color: $form-bg-color;\n\t&__input {\n\t\tflex: 1 1 auto;\n\t\tinput {\n\t\t\theight: auto;\n\t\t\tborder-width: 0 !important;\n\t\t\t&:focus-visible {\n\t\t\t\toutline: none !important;\n\t\t\t}\n\t\t}\n\t}\n\t&__button {\n\t\tflex: 0 0 auto;\n\t\tmargin: rem-calc(3) rem-calc(3) rem-calc(3) 0;\n\t}\n\n\t@each $variant, $definitions in $form-input-core-variants {\n\t\t&[variant=\"#{$variant}\"] {\n\t\t\tborder: get(\"border\", $definitions);\n\t\t}\n\t}\n}\n","import { Component, Element, h, Host, Prop } from '@stencil/core'\nimport { FormSearchClass, FormSearchVariantType } from './constants'\n@Component({\n\ttag: 'gov-form-search',\n\tstyleUrl: 'gov-form-search.scss',\n})\nexport class GovFormSearch {\n\t@Element() host: HTMLGovFormSearchElement\n\t/**\n\t * Style variation of the form input.\n\t */\n\t@Prop({reflect: true}) readonly variant: FormSearchVariantType = 'secondary'\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormSearchClass.root}>\n\t\t\t\t<span class={FormSearchClass.input}>\n\t\t\t\t\t<slot name=\"input\" />\n\t\t\t\t</span>\n\t\t\t\t<span class={FormSearchClass.button}>\n\t\t\t\t\t<slot name=\"button\" />\n\t\t\t\t</span>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"mappings":"4HAI2BA,EAAKC,EAAU,CAAC,UAAW,cAG/C,MAAMC,EAAkB,CAC9BC,KAAM,kBACNC,MAAO,yBACPC,OAAQ,2BCVT,MAAMC,EAAmB,y6C,MCMZC,EAAa,M,sCAKwC,W,CAEjE,MAAAC,GACC,OACCC,EAACC,EAAI,CAACC,MAAOT,EAAgBC,MAC5BM,EAAA,QAAME,MAAOT,EAAgBE,OAC5BK,EAAA,QAAMG,KAAK,WAEZH,EAAA,QAAME,MAAOT,EAAgBG,QAC5BI,EAAA,QAAMG,KAAK,Y"}
@@ -1 +0,0 @@
1
- {"file":"template-df429738.js","mappings":"MAIa,cAAc,GAAG,CAAC,OAAiB;EAC/C,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,KAAK;IAAE,OAAM;EAC5C,OAAO,OAAO;KACZ,MAAM,CAAC,SAAS,IAAI,CAAC,CAAC,SAAS,CAAC;KAChC,IAAI,CAAC,GA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K,CAAA;GAC3B;AACF,CAAC,CAAA;MAEY,mBAAmB,GAAG,CAAC,KAAmD;EACtF,OAAO,OAAO,KAAK,KAAK,WAAW,GAAG,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;AACpE,EAAC;MAEY,oBAAoB,GAAG,CAAC,KAAmD;EACvF,OAAO,OAAO,KAAK,KAAK,WAAW,GAAG,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC,CAAA;AACrE;;;;","names":[],"sources":["../../../packages/core/src/helpers/Dom/template.ts"],"sourcesContent":["import {HTMLStencilElement} from '@stencil/core/internal'\nimport {GovHost} from './template.types'\nimport {Nullable} from '../../types/interfaces'\n\nexport const prepareClasses = (classes: string[]): string => {\n\tif (Array.isArray(classes) === false) return\n\treturn classes\n\t\t.filter(classname => !!classname)\n\t\t.join(' ')\n\t\t.trim()\n}\n\nexport const slottedChildren = (host: HTMLStencilElement): Node[] => {\n\tconst slotted = host.querySelector('slot') as HTMLSlotElement\n\tif (slotted) {\n\t\treturn slotted.assignedNodes().filter(node => {\n\t\t\treturn node.nodeName !== '#text'\n\t\t})\n\t}\n\treturn []\n}\n\nexport const booleanString = (value: boolean): string => {\n\treturn value ? 'true' : 'false'\n}\n\nexport const govHost = (host: HTMLStencilElement): GovHost => {\n\treturn {\n\t\tget hostElement(): HTMLStencilElement {\n\t\t\treturn host\n\t\t},\n\t\tget name(): string {\n\t\t\treturn this.hostElement.nodeName.toLowerCase()\n\t\t},\n\t\thasSlot(name: string): boolean {\n\t\t\treturn !!this.getSlot(name)\n\t\t},\n\t\tisSlotEmpty(name: string): boolean {\n\t\t\tconst slot = this.getSlot(name)\n\t\t\tif (slot) {\n\t\t\t\treturn slot.childNodes.length === 0\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\t\tgetSlot(name: string): HTMLElement {\n\t\t\treturn this.hostElement.querySelector('[slot=\"' + name + '\"]')\n\t\t},\n\t\tgetParent(element): Nullable<HTMLElement> {\n\t\t\treturn this.hostElement.closest(element)\n\t\t},\n\t\tpassChildAttr(selector: string | string[], name: string, value: any): void {\n\t\t\tif (Array.isArray(selector)) {\n\t\t\t\tselector.forEach(selector => {\n\t\t\t\t\tthis.hostElement.querySelectorAll(selector).forEach(child => child.setAttribute(name, value))\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tthis.hostElement.querySelectorAll(selector).forEach(child => child.setAttribute(name, value))\n\t\t\t}\n\t\t},\n\t\tremoveChildAttr(selector: string | string[], name: string): void {\n\t\t\tif (Array.isArray(selector)) {\n\t\t\t\tselector.forEach(selector => {\n\t\t\t\t\tthis.hostElement.querySelectorAll(selector).forEach(child => child.removeAttribute(name))\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tthis.hostElement.querySelectorAll(selector).forEach(child => child.removeAttribute(name))\n\t\t\t}\n\t\t},\n\t\tget slottedChildren(): Node[] {\n\t\t\tconst slotted = this.hostElement.shadowRoot.querySelector('slot') as HTMLSlotElement\n\t\t\tif (slotted) {\n\t\t\t\treturn slotted.assignedNodes().filter(node => {\n\t\t\t\t\treturn node.nodeName !== '#text'\n\t\t\t\t})\n\t\t\t}\n\t\t\treturn []\n\t\t},\n\t\tclasses(classes: string | string[]): string {\n\t\t\tconst clearClasses = Array.isArray(classes) ? classes.join(' ') : classes\n\t\t\tif (this.hostElement) {\n\t\t\t\treturn this.hostElement.classList.toString() + ' ' + clearClasses\n\t\t\t}\n\t\t\treturn clearClasses\n\t\t},\n\t}\n}\n\nexport const toBoolAttr = (value: boolean | string | number): string => {\n\tif (typeof value === 'string') {\n\t\treturn ['true', 'True', 'TRUE', '1'].indexOf(value) !== -1 ? 'true' : 'false'\n\t} else if (typeof value === 'number') {\n\t\treturn value > 0 ? 'true' : 'false'\n\t} else if (typeof value === 'boolean') {\n\t\treturn value ? 'true' : 'false'\n\t} else {\n\t\treturn value ? 'true' : 'false'\n\t}\n}\n\nexport const toOnOffAttr = (value: boolean | string | number): string => {\n\tif (typeof value === 'string') {\n\t\treturn ['true', 'True', 'TRUE', '1', 'On', 'on', 'ON'].indexOf(value) !== -1 ? 'on' : 'off'\n\t} else if (typeof value === 'number') {\n\t\treturn value > 0 ? 'on' : 'off'\n\t} else if (typeof value === 'boolean') {\n\t\treturn value ? 'on' : 'off'\n\t} else {\n\t\treturn value ? 'on' : 'off'\n\t}\n}\n\nexport const toBoolAttrIfDefined = (value: boolean | string | number | undefined | null): undefined | string => {\n\treturn typeof value === 'undefined' ? undefined : toBoolAttr(value)\n}\n\nexport const toOnOffAttrIfDefined = (value: boolean | string | number | undefined | null): undefined | string => {\n\treturn typeof value === 'undefined' ? undefined : toOnOffAttr(value)\n}\n"],"version":3}
@@ -1,2 +0,0 @@
1
- import { Config } from "../../../../../../../../../../../../stencil-public-runtime";
2
- export declare const config: Config;