@gov-design-system-ce/components 4.1.0-rc03 → 4.1.0-rc04

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 (467) hide show
  1. package/dist/cjs/core.cjs.js +2 -2
  2. package/dist/cjs/gov-accordion-item.cjs.entry.js +8 -5
  3. package/dist/cjs/gov-accordion-item.cjs.entry.js.map +1 -1
  4. package/dist/cjs/gov-accordion.cjs.entry.js +1 -1
  5. package/dist/cjs/gov-attachments_3.cjs.entry.js +4 -4
  6. package/dist/cjs/gov-backdrop.cjs.entry.js +3 -3
  7. package/dist/cjs/gov-breadcrumbs.cjs.entry.js +3 -3
  8. package/dist/cjs/gov-button.cjs.entry.js +3 -3
  9. package/dist/cjs/gov-card.cjs.entry.js +3 -3
  10. package/dist/cjs/gov-chip.cjs.entry.js +2 -2
  11. package/dist/cjs/gov-container.cjs.entry.js +1 -1
  12. package/dist/cjs/gov-control-group.cjs.entry.js +1 -1
  13. package/dist/cjs/gov-cookiebar.cjs.entry.js +1 -1
  14. package/dist/cjs/gov-dialog.cjs.entry.js +3 -3
  15. package/dist/cjs/gov-dropdown.cjs.entry.js +2 -2
  16. package/dist/cjs/gov-empty.cjs.entry.js +1 -1
  17. package/dist/cjs/gov-error-code.cjs.entry.js +1 -1
  18. package/dist/cjs/gov-flex.cjs.entry.js +31 -0
  19. package/dist/cjs/gov-flex.cjs.entry.js.map +1 -0
  20. package/dist/cjs/gov-form-autocomplete.cjs.entry.js +3 -3
  21. package/dist/cjs/gov-form-checkbox-group.cjs.entry.js +2 -2
  22. package/dist/cjs/gov-form-checkbox.cjs.entry.js +2 -2
  23. package/dist/cjs/gov-form-control.cjs.entry.js +3 -3
  24. package/dist/cjs/gov-form-file.cjs.entry.js +8 -3
  25. package/dist/cjs/gov-form-file.cjs.entry.js.map +1 -1
  26. package/dist/cjs/gov-form-group.cjs.entry.js +2 -2
  27. package/dist/cjs/gov-form-input_2.cjs.entry.js +6 -6
  28. package/dist/cjs/gov-form-label.cjs.entry.js +2 -2
  29. package/dist/cjs/gov-form-multi-select.cjs.entry.js +6 -21
  30. package/dist/cjs/gov-form-multi-select.cjs.entry.js.map +1 -1
  31. package/dist/cjs/gov-form-password-power.cjs.entry.js +1 -1
  32. package/dist/cjs/gov-form-radio-group.cjs.entry.js +2 -2
  33. package/dist/cjs/gov-form-radio.cjs.entry.js +2 -2
  34. package/dist/cjs/gov-form-search.cjs.entry.js +1 -1
  35. package/dist/cjs/gov-form-select.cjs.entry.js +2 -2
  36. package/dist/cjs/gov-form-switch.cjs.entry.js +2 -2
  37. package/dist/cjs/gov-grid-item.cjs.entry.js +1 -1
  38. package/dist/cjs/gov-grid.cjs.entry.js +1 -1
  39. package/dist/cjs/gov-icon.cjs.entry.js +2 -2
  40. package/dist/cjs/gov-infobar.cjs.entry.js +1 -1
  41. package/dist/cjs/gov-layout-column.cjs.entry.js +1 -1
  42. package/dist/cjs/gov-layout.cjs.entry.js +1 -1
  43. package/dist/cjs/gov-lifecycle.cjs.entry.js +47 -0
  44. package/dist/cjs/gov-lifecycle.cjs.entry.js.map +1 -0
  45. package/dist/cjs/gov-loading.cjs.entry.js +2 -2
  46. package/dist/cjs/gov-message.cjs.entry.js +2 -2
  47. package/dist/cjs/gov-pagination.cjs.entry.js +2 -2
  48. package/dist/cjs/gov-spacer.cjs.entry.js +2 -2
  49. package/dist/cjs/gov-stepper-item.cjs.entry.js +3 -3
  50. package/dist/cjs/gov-stepper.cjs.entry.js +2 -2
  51. package/dist/cjs/gov-tabs-item.cjs.entry.js +3 -3
  52. package/dist/cjs/gov-tabs.cjs.entry.js +2 -2
  53. package/dist/cjs/gov-tag.cjs.entry.js +2 -2
  54. package/dist/cjs/gov-tag.cjs.entry.js.map +1 -1
  55. package/dist/cjs/gov-theme-switch.cjs.entry.js +2 -2
  56. package/dist/cjs/gov-tile.cjs.entry.js +2 -2
  57. package/dist/cjs/gov-tiles.cjs.entry.js +2 -2
  58. package/dist/cjs/gov-toast.cjs.entry.js +5 -6
  59. package/dist/cjs/gov-toast.cjs.entry.js.map +1 -1
  60. package/dist/cjs/gov-tooltip-content.cjs.entry.js +2 -2
  61. package/dist/cjs/gov-tooltip.cjs.entry.js +4 -4
  62. package/dist/cjs/gov-wizard-item.cjs.entry.js +4 -4
  63. package/dist/cjs/gov-wizard.cjs.entry.js +4 -4
  64. package/dist/cjs/{index-1af4880c.js → index-7ff4447c.js} +18 -2
  65. package/dist/cjs/index-7ff4447c.js.map +1 -0
  66. package/dist/cjs/loader.cjs.js +2 -2
  67. package/dist/cjs/{string.utils-2335838f.js → string.utils-b84c81cf.js} +2 -1
  68. package/dist/cjs/string.utils-b84c81cf.js.map +1 -0
  69. package/dist/cjs/{wcag-31089f70.js → wcag-b8d80c7d.js} +2 -2
  70. package/dist/cjs/{wcag-31089f70.js.map → wcag-b8d80c7d.js.map} +1 -1
  71. package/dist/collection/collection-manifest.json +2 -0
  72. package/dist/collection/components/gov-accordion/gov-accordion-item.js +8 -5
  73. package/dist/collection/components/gov-accordion/gov-accordion-item.js.map +1 -1
  74. package/dist/collection/components/gov-flex/constants.js +4 -0
  75. package/dist/collection/components/gov-flex/constants.js.map +1 -0
  76. package/dist/collection/components/gov-flex/gov-flex.js +127 -0
  77. package/dist/collection/components/gov-flex/gov-flex.js.map +1 -0
  78. package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js +1 -1
  79. package/dist/collection/components/gov-form/control/gov-form-control.js +1 -1
  80. package/dist/collection/components/gov-form/file/gov-form-file.js +6 -1
  81. package/dist/collection/components/gov-form/file/gov-form-file.js.map +1 -1
  82. package/dist/collection/components/gov-form/group/gov-form-checkbox-group.js +1 -1
  83. package/dist/collection/components/gov-form/group/gov-form-group.js +1 -1
  84. package/dist/collection/components/gov-form/group/gov-form-radio-group.js +1 -1
  85. package/dist/collection/components/gov-form/input/gov-form-input.js +3 -3
  86. package/dist/collection/components/gov-form/label/gov-form-label.js +1 -1
  87. package/dist/collection/components/gov-form/message/gov-form-message.js +1 -1
  88. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js +3 -27
  89. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js.map +1 -1
  90. package/dist/collection/components/gov-lifecycle-tester/gov-lifecycle-tester.js +39 -0
  91. package/dist/collection/components/gov-lifecycle-tester/gov-lifecycle-tester.js.map +1 -0
  92. package/dist/collection/components/gov-loading/loading/gov-loading.js +1 -1
  93. package/dist/collection/components/gov-loading/skeleton/gov-skeleton.js +1 -1
  94. package/dist/collection/components/gov-message/gov-message.js +1 -1
  95. package/dist/collection/components/gov-spacer/gov-spacer.js +1 -1
  96. package/dist/collection/components/gov-stepper/gov-stepper-item.js +1 -1
  97. package/dist/collection/components/gov-stepper/gov-stepper.js +1 -1
  98. package/dist/collection/components/gov-tabs/gov-tabs-item.js +1 -1
  99. package/dist/collection/components/gov-tabs/gov-tabs.js +1 -1
  100. package/dist/collection/components/gov-tag/gov-tag.js +1 -1
  101. package/dist/collection/components/gov-tag/gov-tag.js.map +1 -1
  102. package/dist/collection/components/gov-theme-switch/gov-theme-switch.js +1 -1
  103. package/dist/collection/components/gov-tile/container/gov-tiles.js +1 -1
  104. package/dist/collection/components/gov-tile/gov-tile.js +1 -1
  105. package/dist/collection/components/gov-toast/gov-toast.js +3 -4
  106. package/dist/collection/components/gov-toast/gov-toast.js.map +1 -1
  107. package/dist/collection/components/gov-tooltip/gov-tooltip-content.js +1 -1
  108. package/dist/collection/components/gov-tooltip/gov-tooltip.js +2 -2
  109. package/dist/collection/components/gov-wizard/gov-wizard-item.js +2 -2
  110. package/dist/collection/components/gov-wizard/gov-wizard.js +1 -1
  111. package/dist/collection/pages/Forms.js +159 -159
  112. package/dist/collection/pages/Forms.js.map +1 -1
  113. package/dist/collection/pages/Grid.js +1 -1
  114. package/dist/collection/pages/Grid.js.map +1 -1
  115. package/dist/collection/pages/Spacer.js +1 -1
  116. package/dist/collection/pages/Spacer.js.map +1 -1
  117. package/dist/collection/pages/Tag.js +135 -160
  118. package/dist/collection/pages/Tag.js.map +1 -1
  119. package/dist/collection/pages/Wizard.js +1 -1
  120. package/dist/collection/pages/Wizard.js.map +1 -1
  121. package/dist/collection/utils/string.utils.js +1 -1
  122. package/dist/collection/utils/string.utils.js.map +1 -1
  123. package/dist/components/gov-accordion-item.js +1 -1
  124. package/dist/components/gov-accordion-item.js.map +1 -1
  125. package/dist/components/gov-accordion.js +1 -1
  126. package/dist/components/gov-attachments-item.js +1 -1
  127. package/dist/components/gov-attachments.js +1 -1
  128. package/dist/components/gov-backdrop.js +1 -1
  129. package/dist/components/gov-breadcrumbs.js +1 -1
  130. package/dist/components/gov-button.js +1 -1
  131. package/dist/components/gov-card.js +1 -1
  132. package/dist/components/gov-chip.js +1 -1
  133. package/dist/components/gov-container.js +1 -1
  134. package/dist/components/gov-control-group.js +1 -1
  135. package/dist/components/gov-cookiebar.js +1 -1
  136. package/dist/components/gov-dialog.js +1 -1
  137. package/dist/components/gov-dialog.js.map +1 -1
  138. package/dist/components/gov-dropdown.js +1 -1
  139. package/dist/components/gov-empty.js +1 -1
  140. package/dist/components/gov-error-code.js +1 -1
  141. package/dist/components/gov-flex.d.ts +11 -0
  142. package/dist/components/gov-flex.js +2 -0
  143. package/dist/components/gov-flex.js.map +1 -0
  144. package/dist/components/gov-form-autocomplete.js +1 -1
  145. package/dist/components/gov-form-checkbox-group.js +1 -1
  146. package/dist/components/gov-form-checkbox.js +1 -1
  147. package/dist/components/gov-form-control.js +1 -1
  148. package/dist/components/gov-form-file.js +1 -1
  149. package/dist/components/gov-form-file.js.map +1 -1
  150. package/dist/components/gov-form-group.js +1 -1
  151. package/dist/components/gov-form-input.js +1 -1
  152. package/dist/components/gov-form-label.js +1 -1
  153. package/dist/components/gov-form-message.js +1 -1
  154. package/dist/components/gov-form-multi-select.js +1 -1
  155. package/dist/components/gov-form-multi-select.js.map +1 -1
  156. package/dist/components/gov-form-password-power.js +1 -1
  157. package/dist/components/gov-form-radio-group.js +1 -1
  158. package/dist/components/gov-form-radio.js +1 -1
  159. package/dist/components/gov-form-radio.js.map +1 -1
  160. package/dist/components/gov-form-search.js +1 -1
  161. package/dist/components/gov-form-select.js +1 -1
  162. package/dist/components/gov-form-switch.js +1 -1
  163. package/dist/components/gov-grid-item.js +1 -1
  164. package/dist/components/gov-grid.js +1 -1
  165. package/dist/components/gov-icon.js +1 -1
  166. package/dist/components/gov-infobar.js +1 -1
  167. package/dist/components/gov-layout-column.js +1 -1
  168. package/dist/components/gov-layout.js +1 -1
  169. package/dist/components/gov-lifecycle.d.ts +11 -0
  170. package/dist/components/gov-lifecycle.js +2 -0
  171. package/dist/components/gov-lifecycle.js.map +1 -0
  172. package/dist/components/gov-loading.js +1 -1
  173. package/dist/components/gov-message.js +1 -1
  174. package/dist/components/gov-pagination.js +1 -1
  175. package/dist/components/gov-pagination.js.map +1 -1
  176. package/dist/components/gov-skeleton.js +1 -1
  177. package/dist/components/gov-spacer.js +1 -1
  178. package/dist/components/gov-stepper-item.js +1 -1
  179. package/dist/components/gov-stepper.js +1 -1
  180. package/dist/components/gov-tabs-item.js +1 -1
  181. package/dist/components/gov-tabs.js +1 -1
  182. package/dist/components/gov-tabs.js.map +1 -1
  183. package/dist/components/gov-tag.js +1 -1
  184. package/dist/components/gov-tag.js.map +1 -1
  185. package/dist/components/gov-theme-switch.js +1 -1
  186. package/dist/components/gov-tile.js +1 -1
  187. package/dist/components/gov-tiles.js +1 -1
  188. package/dist/components/gov-toast.js +1 -1
  189. package/dist/components/gov-toast.js.map +1 -1
  190. package/dist/components/gov-tooltip-content.js +1 -1
  191. package/dist/components/gov-tooltip.js +1 -1
  192. package/dist/components/gov-wizard-item.js +1 -1
  193. package/dist/components/gov-wizard.js +1 -1
  194. package/dist/components/index.js +1 -1
  195. package/dist/components/{p-4a92317f.js → p-02da2aee.js} +2 -2
  196. package/dist/components/p-1d3019f3.js +2 -0
  197. package/dist/components/{p-de8656dd.js → p-1f3bb41d.js} +2 -2
  198. package/dist/components/{p-a99d125a.js → p-23b7e680.js} +2 -2
  199. package/dist/components/{p-a14f8877.js → p-387052e1.js} +2 -2
  200. package/dist/components/{p-3dece5f7.js → p-3b807239.js} +2 -2
  201. package/dist/components/{p-ae3dada7.js → p-42200001.js} +3 -3
  202. package/dist/components/p-42200001.js.map +1 -0
  203. package/dist/components/{p-4ffeb83f.js → p-5cc316bc.js} +2 -2
  204. package/dist/components/{p-dd8d3279.js → p-6ea84137.js} +2 -2
  205. package/dist/components/{p-de3103e8.js → p-820b66c0.js} +2 -2
  206. package/dist/components/p-880743a5.js.map +1 -1
  207. package/dist/components/{p-1e82b99e.js → p-bd22e21d.js} +2 -2
  208. package/dist/components/{p-c0bb26c2.js → p-c211c3e1.js} +2 -2
  209. package/dist/components/{p-95d41a3b.js → p-cd6c2938.js} +2 -2
  210. package/dist/components/p-cd6c2938.js.map +1 -0
  211. package/dist/components/{p-9a93146e.js → p-dcee21ca.js} +2 -2
  212. package/dist/core/core.css +158 -29
  213. package/dist/core/core.esm.js +1 -1
  214. package/dist/core/core.esm.js.map +1 -1
  215. package/dist/core/p-0a24806a.entry.js +2 -0
  216. package/dist/core/{p-9d0f20ec.entry.js.map → p-0a24806a.entry.js.map} +1 -1
  217. package/dist/core/p-0d2c4d31.entry.js +2 -0
  218. package/dist/core/{p-3db35bee.entry.js → p-10f9bf55.entry.js} +2 -2
  219. package/dist/core/{p-0225a96a.entry.js → p-12680890.entry.js} +2 -2
  220. package/dist/core/p-1600c1fb.entry.js +2 -0
  221. package/dist/core/p-18025823.entry.js +2 -0
  222. package/dist/core/{p-c5375a8a.entry.js.map → p-18025823.entry.js.map} +1 -1
  223. package/dist/core/p-18dbe177.entry.js +2 -0
  224. package/dist/core/p-18dbe177.entry.js.map +1 -0
  225. package/dist/core/{p-987388fd.entry.js → p-1a550eee.entry.js} +2 -2
  226. package/dist/core/{p-9b41ac88.entry.js → p-1f1895c0.entry.js} +2 -2
  227. package/dist/core/p-1fdc2457.entry.js +2 -0
  228. package/dist/core/{p-111e1a63.entry.js.map → p-1fdc2457.entry.js.map} +1 -1
  229. package/dist/core/{p-4e98412a.entry.js → p-212759be.entry.js} +2 -2
  230. package/dist/core/p-215504c1.entry.js +2 -0
  231. package/dist/core/p-2c3ddc57.entry.js +2 -0
  232. package/dist/core/p-31e7d262.entry.js +2 -0
  233. package/dist/core/p-31e7d262.entry.js.map +1 -0
  234. package/dist/core/p-32bba4e7.entry.js +2 -0
  235. package/dist/core/{p-3e8b94c2.entry.js → p-378e0723.entry.js} +2 -2
  236. package/dist/core/{p-0ebc8365.entry.js → p-3844a27d.entry.js} +2 -2
  237. package/dist/core/{p-0d7b9167.entry.js → p-4cb4de7b.entry.js} +2 -2
  238. package/dist/core/p-56f9e026.entry.js +2 -0
  239. package/dist/core/{p-acff78c5.entry.js → p-57b0e670.entry.js} +2 -2
  240. package/dist/core/p-58dc3ec3.entry.js +2 -0
  241. package/dist/core/p-58dc3ec3.entry.js.map +1 -0
  242. package/dist/core/p-5ad3097c.entry.js +2 -0
  243. package/dist/core/{p-a42514f9.entry.js.map → p-5ad3097c.entry.js.map} +1 -1
  244. package/dist/core/p-668ca722.entry.js +2 -0
  245. package/dist/core/{p-74e20474.entry.js.map → p-668ca722.entry.js.map} +1 -1
  246. package/dist/core/{p-1bbc10c9.entry.js → p-67200095.entry.js} +2 -2
  247. package/dist/core/p-731fe7d8.entry.js +2 -0
  248. package/dist/core/{p-97927e2a.entry.js.map → p-731fe7d8.entry.js.map} +1 -1
  249. package/dist/core/{p-c6431085.entry.js → p-7591976a.entry.js} +2 -2
  250. package/dist/core/p-75ea368b.entry.js +2 -0
  251. package/dist/core/{p-a4886f2d.entry.js → p-7b48b1b8.entry.js} +2 -2
  252. package/dist/core/p-7de47344.entry.js +2 -0
  253. package/dist/core/p-7de47344.entry.js.map +1 -0
  254. package/dist/core/p-83aa4327.entry.js +2 -0
  255. package/dist/core/{p-ea6cb030.entry.js.map → p-83aa4327.entry.js.map} +1 -1
  256. package/dist/core/{p-28a7d3f7.js → p-842cb87f.js} +2 -2
  257. package/dist/core/{p-a1e95a5f.js → p-8506b611.js} +3 -3
  258. package/dist/core/p-8506b611.js.map +1 -0
  259. package/dist/core/p-880743a5.js.map +1 -1
  260. package/dist/core/{p-4898c95f.entry.js → p-89b69743.entry.js} +2 -2
  261. package/dist/core/p-8a796fbe.entry.js +2 -0
  262. package/dist/core/p-8f10919c.entry.js +2 -0
  263. package/dist/core/{p-033bbbaa.entry.js.map → p-8f10919c.entry.js.map} +1 -1
  264. package/dist/core/p-8fe36a5b.entry.js +2 -0
  265. package/dist/core/{p-5f776da7.entry.js.map → p-8fe36a5b.entry.js.map} +1 -1
  266. package/dist/core/p-915e53ac.entry.js +2 -0
  267. package/dist/core/p-92e13f9d.entry.js +2 -0
  268. package/dist/core/p-a274cdaa.entry.js +2 -0
  269. package/dist/core/p-a274cdaa.entry.js.map +1 -0
  270. package/dist/core/p-a9a095c2.entry.js +2 -0
  271. package/dist/core/p-a9a095c2.entry.js.map +1 -0
  272. package/dist/core/{p-899e504a.entry.js → p-ab68c0b7.entry.js} +2 -2
  273. package/dist/core/{p-1638b12b.entry.js → p-b50ffab3.entry.js} +2 -2
  274. package/dist/core/p-b70cc248.entry.js +2 -0
  275. package/dist/core/{p-964f1729.entry.js → p-b822b9ff.entry.js} +2 -2
  276. package/dist/core/p-c0a5a3f7.entry.js +2 -0
  277. package/dist/core/p-c5b5fd69.entry.js +2 -0
  278. package/dist/core/{p-bdf1864e.entry.js.map → p-c5b5fd69.entry.js.map} +1 -1
  279. package/dist/core/{p-95d41a3b.js → p-cd6c2938.js} +2 -2
  280. package/dist/core/p-cd6c2938.js.map +1 -0
  281. package/dist/core/{p-8321da17.entry.js → p-d1c4eb91.entry.js} +2 -2
  282. package/dist/core/{p-b215f99f.entry.js → p-d3963396.entry.js} +2 -2
  283. package/dist/core/p-d4fbc249.entry.js +2 -0
  284. package/dist/core/{p-21bdd725.entry.js → p-d949aac7.entry.js} +2 -2
  285. package/dist/core/{p-2ee0d589.entry.js → p-e6af4c58.entry.js} +2 -2
  286. package/dist/core/p-ede7af0a.entry.js +2 -0
  287. package/dist/core/p-ede7af0a.entry.js.map +1 -0
  288. package/dist/core/p-eebc9e71.entry.js +2 -0
  289. package/dist/core/{p-33ecbb38.entry.js → p-eebf7ad8.entry.js} +2 -2
  290. package/dist/core/{p-378e5294.entry.js → p-f1c8a96b.entry.js} +2 -2
  291. package/dist/core/{p-35e66bef.entry.js → p-f963bb2f.entry.js} +2 -2
  292. package/dist/core/{p-393a281e.entry.js → p-fb0df3a5.entry.js} +2 -2
  293. package/dist/esm/core.js +3 -3
  294. package/dist/esm/gov-accordion-item.entry.js +8 -5
  295. package/dist/esm/gov-accordion-item.entry.js.map +1 -1
  296. package/dist/esm/gov-accordion.entry.js +1 -1
  297. package/dist/esm/gov-attachments_3.entry.js +4 -4
  298. package/dist/esm/gov-backdrop.entry.js +3 -3
  299. package/dist/esm/gov-breadcrumbs.entry.js +3 -3
  300. package/dist/esm/gov-button.entry.js +3 -3
  301. package/dist/esm/gov-card.entry.js +3 -3
  302. package/dist/esm/gov-chip.entry.js +2 -2
  303. package/dist/esm/gov-container.entry.js +1 -1
  304. package/dist/esm/gov-control-group.entry.js +1 -1
  305. package/dist/esm/gov-cookiebar.entry.js +1 -1
  306. package/dist/esm/gov-dialog.entry.js +3 -3
  307. package/dist/esm/gov-dropdown.entry.js +2 -2
  308. package/dist/esm/gov-empty.entry.js +1 -1
  309. package/dist/esm/gov-error-code.entry.js +1 -1
  310. package/dist/esm/gov-flex.entry.js +27 -0
  311. package/dist/esm/gov-flex.entry.js.map +1 -0
  312. package/dist/esm/gov-form-autocomplete.entry.js +3 -3
  313. package/dist/esm/gov-form-checkbox-group.entry.js +2 -2
  314. package/dist/esm/gov-form-checkbox.entry.js +2 -2
  315. package/dist/esm/gov-form-control.entry.js +3 -3
  316. package/dist/esm/gov-form-file.entry.js +8 -3
  317. package/dist/esm/gov-form-file.entry.js.map +1 -1
  318. package/dist/esm/gov-form-group.entry.js +2 -2
  319. package/dist/esm/gov-form-input_2.entry.js +6 -6
  320. package/dist/esm/gov-form-label.entry.js +2 -2
  321. package/dist/esm/gov-form-multi-select.entry.js +6 -21
  322. package/dist/esm/gov-form-multi-select.entry.js.map +1 -1
  323. package/dist/esm/gov-form-password-power.entry.js +1 -1
  324. package/dist/esm/gov-form-radio-group.entry.js +2 -2
  325. package/dist/esm/gov-form-radio.entry.js +2 -2
  326. package/dist/esm/gov-form-search.entry.js +1 -1
  327. package/dist/esm/gov-form-select.entry.js +2 -2
  328. package/dist/esm/gov-form-switch.entry.js +2 -2
  329. package/dist/esm/gov-grid-item.entry.js +1 -1
  330. package/dist/esm/gov-grid.entry.js +1 -1
  331. package/dist/esm/gov-icon.entry.js +2 -2
  332. package/dist/esm/gov-infobar.entry.js +1 -1
  333. package/dist/esm/gov-layout-column.entry.js +1 -1
  334. package/dist/esm/gov-layout.entry.js +1 -1
  335. package/dist/esm/gov-lifecycle.entry.js +43 -0
  336. package/dist/esm/gov-lifecycle.entry.js.map +1 -0
  337. package/dist/esm/gov-loading.entry.js +2 -2
  338. package/dist/esm/gov-message.entry.js +2 -2
  339. package/dist/esm/gov-pagination.entry.js +2 -2
  340. package/dist/esm/gov-spacer.entry.js +2 -2
  341. package/dist/esm/gov-stepper-item.entry.js +3 -3
  342. package/dist/esm/gov-stepper.entry.js +2 -2
  343. package/dist/esm/gov-tabs-item.entry.js +3 -3
  344. package/dist/esm/gov-tabs.entry.js +2 -2
  345. package/dist/esm/gov-tag.entry.js +2 -2
  346. package/dist/esm/gov-tag.entry.js.map +1 -1
  347. package/dist/esm/gov-theme-switch.entry.js +2 -2
  348. package/dist/esm/gov-tile.entry.js +2 -2
  349. package/dist/esm/gov-tiles.entry.js +2 -2
  350. package/dist/esm/gov-toast.entry.js +5 -6
  351. package/dist/esm/gov-toast.entry.js.map +1 -1
  352. package/dist/esm/gov-tooltip-content.entry.js +2 -2
  353. package/dist/esm/gov-tooltip.entry.js +4 -4
  354. package/dist/esm/gov-wizard-item.entry.js +4 -4
  355. package/dist/esm/gov-wizard.entry.js +4 -4
  356. package/dist/esm/{index-d8b4eb6c.js → index-c263e031.js} +18 -2
  357. package/dist/esm/index-c263e031.js.map +1 -0
  358. package/dist/esm/loader.js +3 -3
  359. package/dist/esm/{string.utils-5ce3f551.js → string.utils-1da8f8fb.js} +2 -2
  360. package/dist/esm/string.utils-1da8f8fb.js.map +1 -0
  361. package/dist/esm/{wcag-fa5ce56c.js → wcag-d7c6c252.js} +2 -2
  362. package/dist/esm/{wcag-fa5ce56c.js.map → wcag-d7c6c252.js.map} +1 -1
  363. package/dist/hydrate/index.js +147 -65
  364. package/dist/hydrate/index.mjs +147 -65
  365. package/dist/types/components/gov-accordion/gov-accordion-item.d.ts +1 -0
  366. package/dist/types/components/gov-flex/constants.d.ts +3 -0
  367. package/dist/types/components/gov-flex/gov-flex.d.ts +33 -0
  368. package/dist/types/components/gov-form/file/gov-form-file.d.ts +1 -0
  369. package/dist/types/components/gov-form/multiselect/gov-form-multi-select.d.ts +0 -2
  370. package/dist/types/components/gov-lifecycle-tester/gov-lifecycle-tester.d.ts +14 -0
  371. package/dist/types/components.d.ts +74 -0
  372. package/dist/types/utils/string.utils.d.ts +1 -0
  373. package/package.json +2 -2
  374. package/dist/cjs/index-1af4880c.js.map +0 -1
  375. package/dist/cjs/string.utils-2335838f.js.map +0 -1
  376. package/dist/components/p-95d41a3b.js.map +0 -1
  377. package/dist/components/p-a5975d22.js +0 -2
  378. package/dist/components/p-ae3dada7.js.map +0 -1
  379. package/dist/core/p-023787b3.entry.js +0 -2
  380. package/dist/core/p-023787b3.entry.js.map +0 -1
  381. package/dist/core/p-033bbbaa.entry.js +0 -2
  382. package/dist/core/p-111e1a63.entry.js +0 -2
  383. package/dist/core/p-235869e6.entry.js +0 -2
  384. package/dist/core/p-39d8e408.entry.js +0 -2
  385. package/dist/core/p-3a519b02.entry.js +0 -2
  386. package/dist/core/p-3a519b02.entry.js.map +0 -1
  387. package/dist/core/p-3ddfbc05.entry.js +0 -2
  388. package/dist/core/p-3f5f36e4.entry.js +0 -2
  389. package/dist/core/p-59c4574a.entry.js +0 -2
  390. package/dist/core/p-5f776da7.entry.js +0 -2
  391. package/dist/core/p-74e20474.entry.js +0 -2
  392. package/dist/core/p-7cd2c877.entry.js +0 -2
  393. package/dist/core/p-7cd2c877.entry.js.map +0 -1
  394. package/dist/core/p-9100d24f.entry.js +0 -2
  395. package/dist/core/p-95d41a3b.js.map +0 -1
  396. package/dist/core/p-97927e2a.entry.js +0 -2
  397. package/dist/core/p-98091397.entry.js +0 -2
  398. package/dist/core/p-9d0c3dee.entry.js +0 -2
  399. package/dist/core/p-9d0f20ec.entry.js +0 -2
  400. package/dist/core/p-a1e95a5f.js.map +0 -1
  401. package/dist/core/p-a42514f9.entry.js +0 -2
  402. package/dist/core/p-bdf1864e.entry.js +0 -2
  403. package/dist/core/p-c5375a8a.entry.js +0 -2
  404. package/dist/core/p-ca093025.entry.js +0 -2
  405. package/dist/core/p-d56632e1.entry.js +0 -2
  406. package/dist/core/p-e49b1737.entry.js +0 -2
  407. package/dist/core/p-e49b1737.entry.js.map +0 -1
  408. package/dist/core/p-e5b95316.entry.js +0 -2
  409. package/dist/core/p-ea6cb030.entry.js +0 -2
  410. package/dist/core/p-eb2af67a.entry.js +0 -2
  411. package/dist/core/p-eb2af67a.entry.js.map +0 -1
  412. package/dist/core/p-f0781e29.entry.js +0 -2
  413. package/dist/core/p-f4e04e98.entry.js +0 -2
  414. package/dist/core/p-fe147dbf.entry.js +0 -2
  415. package/dist/esm/index-d8b4eb6c.js.map +0 -1
  416. package/dist/esm/string.utils-5ce3f551.js.map +0 -1
  417. /package/dist/components/{p-4a92317f.js.map → p-02da2aee.js.map} +0 -0
  418. /package/dist/components/{p-a5975d22.js.map → p-1d3019f3.js.map} +0 -0
  419. /package/dist/components/{p-de8656dd.js.map → p-1f3bb41d.js.map} +0 -0
  420. /package/dist/components/{p-a99d125a.js.map → p-23b7e680.js.map} +0 -0
  421. /package/dist/components/{p-a14f8877.js.map → p-387052e1.js.map} +0 -0
  422. /package/dist/components/{p-3dece5f7.js.map → p-3b807239.js.map} +0 -0
  423. /package/dist/components/{p-4ffeb83f.js.map → p-5cc316bc.js.map} +0 -0
  424. /package/dist/components/{p-dd8d3279.js.map → p-6ea84137.js.map} +0 -0
  425. /package/dist/components/{p-de3103e8.js.map → p-820b66c0.js.map} +0 -0
  426. /package/dist/components/{p-1e82b99e.js.map → p-bd22e21d.js.map} +0 -0
  427. /package/dist/components/{p-c0bb26c2.js.map → p-c211c3e1.js.map} +0 -0
  428. /package/dist/components/{p-9a93146e.js.map → p-dcee21ca.js.map} +0 -0
  429. /package/dist/core/{p-e5b95316.entry.js.map → p-0d2c4d31.entry.js.map} +0 -0
  430. /package/dist/core/{p-3db35bee.entry.js.map → p-10f9bf55.entry.js.map} +0 -0
  431. /package/dist/core/{p-0225a96a.entry.js.map → p-12680890.entry.js.map} +0 -0
  432. /package/dist/core/{p-fe147dbf.entry.js.map → p-1600c1fb.entry.js.map} +0 -0
  433. /package/dist/core/{p-987388fd.entry.js.map → p-1a550eee.entry.js.map} +0 -0
  434. /package/dist/core/{p-9b41ac88.entry.js.map → p-1f1895c0.entry.js.map} +0 -0
  435. /package/dist/core/{p-4e98412a.entry.js.map → p-212759be.entry.js.map} +0 -0
  436. /package/dist/core/{p-39d8e408.entry.js.map → p-215504c1.entry.js.map} +0 -0
  437. /package/dist/core/{p-3f5f36e4.entry.js.map → p-2c3ddc57.entry.js.map} +0 -0
  438. /package/dist/core/{p-235869e6.entry.js.map → p-32bba4e7.entry.js.map} +0 -0
  439. /package/dist/core/{p-3e8b94c2.entry.js.map → p-378e0723.entry.js.map} +0 -0
  440. /package/dist/core/{p-0ebc8365.entry.js.map → p-3844a27d.entry.js.map} +0 -0
  441. /package/dist/core/{p-0d7b9167.entry.js.map → p-4cb4de7b.entry.js.map} +0 -0
  442. /package/dist/core/{p-f4e04e98.entry.js.map → p-56f9e026.entry.js.map} +0 -0
  443. /package/dist/core/{p-acff78c5.entry.js.map → p-57b0e670.entry.js.map} +0 -0
  444. /package/dist/core/{p-1bbc10c9.entry.js.map → p-67200095.entry.js.map} +0 -0
  445. /package/dist/core/{p-c6431085.entry.js.map → p-7591976a.entry.js.map} +0 -0
  446. /package/dist/core/{p-9d0c3dee.entry.js.map → p-75ea368b.entry.js.map} +0 -0
  447. /package/dist/core/{p-a4886f2d.entry.js.map → p-7b48b1b8.entry.js.map} +0 -0
  448. /package/dist/core/{p-28a7d3f7.js.map → p-842cb87f.js.map} +0 -0
  449. /package/dist/core/{p-4898c95f.entry.js.map → p-89b69743.entry.js.map} +0 -0
  450. /package/dist/core/{p-d56632e1.entry.js.map → p-8a796fbe.entry.js.map} +0 -0
  451. /package/dist/core/{p-f0781e29.entry.js.map → p-915e53ac.entry.js.map} +0 -0
  452. /package/dist/core/{p-98091397.entry.js.map → p-92e13f9d.entry.js.map} +0 -0
  453. /package/dist/core/{p-899e504a.entry.js.map → p-ab68c0b7.entry.js.map} +0 -0
  454. /package/dist/core/{p-1638b12b.entry.js.map → p-b50ffab3.entry.js.map} +0 -0
  455. /package/dist/core/{p-3ddfbc05.entry.js.map → p-b70cc248.entry.js.map} +0 -0
  456. /package/dist/core/{p-964f1729.entry.js.map → p-b822b9ff.entry.js.map} +0 -0
  457. /package/dist/core/{p-9100d24f.entry.js.map → p-c0a5a3f7.entry.js.map} +0 -0
  458. /package/dist/core/{p-8321da17.entry.js.map → p-d1c4eb91.entry.js.map} +0 -0
  459. /package/dist/core/{p-b215f99f.entry.js.map → p-d3963396.entry.js.map} +0 -0
  460. /package/dist/core/{p-59c4574a.entry.js.map → p-d4fbc249.entry.js.map} +0 -0
  461. /package/dist/core/{p-21bdd725.entry.js.map → p-d949aac7.entry.js.map} +0 -0
  462. /package/dist/core/{p-2ee0d589.entry.js.map → p-e6af4c58.entry.js.map} +0 -0
  463. /package/dist/core/{p-ca093025.entry.js.map → p-eebc9e71.entry.js.map} +0 -0
  464. /package/dist/core/{p-33ecbb38.entry.js.map → p-eebf7ad8.entry.js.map} +0 -0
  465. /package/dist/core/{p-378e5294.entry.js.map → p-f1c8a96b.entry.js.map} +0 -0
  466. /package/dist/core/{p-35e66bef.entry.js.map → p-f963bb2f.entry.js.map} +0 -0
  467. /package/dist/core/{p-393a281e.entry.js.map → p-fb0df3a5.entry.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"file":"string.utils-b84c81cf.js","mappings":";;SAAgB,IAAI;IACnB,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;AAC5C,CAAC;SAEe,QAAQ,CAAC,MAAc;IACtC,OAAO,GAAG,MAAM,IAAI,IAAI,EAAE,GAAG,IAAI,EAAE,IAAI,IAAI,EAAE,IAAI,IAAI,EAAE,IAAI,IAAI,EAAE,IAAI,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,EAAE,EAAE,CAAA;AAChG,CAAC;SAEe,gBAAgB,CAAC,MAAW;IAC3C,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAA;IAC7C,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAA;AAC/D,CAAC;SAEe,iBAAiB,CAAC,MAAW;IAC5C,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAA;IAC7C,OAAO,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;AAC7B;;;;;;;","names":[],"sources":["../../../packages/core/src/utils/string.utils.ts"],"sourcesContent":["export function chr4(): string {\n\treturn Math.random().toString(16).slice(-4)\n}\n\nexport function createID(prefix: string): string {\n\treturn `${prefix}-${chr4()}${chr4()}-${chr4()}-${chr4()}-${chr4()}-${chr4()}${chr4()}${chr4()}`\n}\n\nexport function removeDiacritics(string: any): string | any {\n\tif (typeof string !== 'string') return string\n\treturn string.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '')\n}\n\nexport function splitByWhitespace(string: any): string | any {\n\tif (typeof string !== 'string') return string\n\treturn string.split(/(\\s+)/)\n}\n"],"version":3}
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const gov_log = require('./gov.log-1e8bab6e.js');
4
- const string_utils = require('./string.utils-2335838f.js');
4
+ const string_utils = require('./string.utils-b84c81cf.js');
5
5
  const win = require('./win-587f4614.js');
6
6
  const helpers_types = require('./helpers.types-ff60c9bd.js');
7
7
 
@@ -53,4 +53,4 @@ exports.validateAccessibleLabel = validateAccessibleLabel;
53
53
  exports.validateWcagProp = validateWcagProp;
54
54
  exports.validateWcagRef = validateWcagRef;
55
55
 
56
- //# sourceMappingURL=wcag-31089f70.js.map
56
+ //# sourceMappingURL=wcag-b8d80c7d.js.map
@@ -1 +1 @@
1
- {"file":"wcag-31089f70.js","mappings":";;;;;;;MAKa,gBAAgB,GAAG,CAAC,KAAyB,EAAE,QAAgB,EAAE,SAAiB;IAC9F,IAAI,KAAK,KAAK,SAAS,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;QACtDA,qBAAa,CAAC,IAAI,SAAS,WAAW,QAAQ,qDAAqD,CAAC,CAAA;KACpG;AACF,EAAC;MAEY,eAAe,GAAG,CAAC,WAAmB,EAAE,IAAY,EAAE,SAAiB;IACnF,IAAI,OAAO,WAAW,KAAK,WAAW,IAAI,WAAW,KAAK,SAAS,EAAE;QACpE,OAAO,IAAI,CAAA;KACX;IACD,IAAI,MAAM,CAAC,WAAW,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;QACrCA,qBAAa,CAAC,IAAI,SAAS,iBAAiB,IAAI,mCAAmC,CAAC,CAAA;QACpF,OAAO,KAAK,CAAA;KACZ;IACD,IAAI,OAAO,GAAG,EAAE,CAAA;IAChB,MAAM,YAAY,GAAGC,8BAAiB,CAAC,WAAW,CAAC,CAAA;IACnD,IAAI,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;QAChC,OAAO,GAAG,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC;YACxC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAA;SAC1B,CAAC,CAAA;KACF;IAED,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW;QAClC,IAAIC,gBAAY,EAAE,CAAC,cAAc,CAAC,WAAW,CAAC,KAAK,IAAI,EAAE;;YAExD,OAAO,KAAK,CAAA;SACZ;aAAM;YACN,OAAO,IAAI,CAAA;SACX;KACD,CAAC,CAAC,MAAM,CAAA;AACV,EAAC;MAcY,uBAAuB,GAAG,CAAC,KAAyB,EAAE,UAA8B,EAAE,SAAiB,EAAE,KAAkB,SAAS;IAChJ,IAAIC,sBAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;QACxC,OAAO,IAAI,CAAA;KACX;IACD,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;QAC5D,MAAM,YAAY,GAAGD,gBAAY,EAAE,CAAC,cAAc,CAAC,UAAU,CAAC,CAAA;QAC9D,IAAI,YAAY,EAAE;YACjB,OAAO,IAAI,CAAA;SACX;KACD;IACDF,qBAAa,CAAC,IAAI,SAAS,wEAAwE,EAAE,EAAE,CAAC,CAAA;IACxG,OAAO,KAAK,CAAA;AACb;;;;;;","names":["govWarningLog","splitByWhitespace","documentNode","isString"],"sources":["../../../packages/core/src/helpers/Validate/wcag.ts"],"sourcesContent":["import {govWarningLog} from '../Log/gov.log'\nimport {splitByWhitespace} from '../../utils/string.utils'\nimport {documentNode} from '../Dom/win'\nimport {isString} from \"../../utils/helpers.types\";\n\nexport const validateWcagProp = (value: string | undefined, propName: string, component: string): void => {\n\tif (value === undefined || String(value).length === 0) {\n\t\tgovWarningLog(`[${component}]: The (${propName}) attribute is important for correct accessibility.`)\n\t}\n}\n\nexport const validateWcagRef = (referenceId: string, name: string, component: string): boolean => {\n\tif (typeof referenceId === 'undefined' || referenceId === undefined) {\n\t\treturn true\n\t}\n\tif (String(referenceId).length === 0) {\n\t\tgovWarningLog(`[${component}]: Attribute (${name}) is defined with an empty value.`)\n\t\treturn false\n\t}\n\tlet strings = []\n\tconst referenceIds = splitByWhitespace(referenceId)\n\tif (Array.isArray(referenceIds)) {\n\t\tstrings = referenceIds.filter(function (e) {\n\t\t\treturn e.trim().length > 0\n\t\t})\n\t}\n\n\treturn !!strings.filter(referenceId => {\n\t\tif (documentNode().getElementById(referenceId) === null) {\n\t\t\t//govWarningLog(`[${component}][${name}]: Reference to element with id (${referenceId}) does not exist.`)\n\t\t\treturn false\n\t\t} else {\n\t\t\treturn true\n\t\t}\n\t}).length\n}\n\nexport const validateWcagLabelFor = (inputId: string, labelledBy: string | undefined, component: string): boolean => {\n\tconst labelEl = documentNode().querySelector(`[for=${inputId}]`)\n\tif (labelEl === null) {\n\t\tconst labelledByEl = documentNode().getElementById(labelledBy)\n\t\tif (labelledByEl === null) {\n\t\t\tgovWarningLog(`[${component}]: The form element has no defined wcag-label or wcag-labelled-by attribute.`)\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nexport const validateAccessibleLabel = (label: string | undefined, labelledBy: string | undefined, component: string, el: HTMLElement = undefined): boolean => {\n\tif (isString(label) && label.length > 0) {\n\t\treturn true\n\t}\n\tif (typeof labelledBy === 'string' && labelledBy.length > 0) {\n\t\tconst labelledByEl = documentNode().getElementById(labelledBy)\n\t\tif (labelledByEl) {\n\t\t\treturn true\n\t\t}\n\t}\n\tgovWarningLog(`[${component}]: The element has no defined aria-label or aria-labelledby attribute.`, el)\n\treturn false\n}\n"],"version":3}
1
+ {"file":"wcag-b8d80c7d.js","mappings":";;;;;;;MAKa,gBAAgB,GAAG,CAAC,KAAyB,EAAE,QAAgB,EAAE,SAAiB;IAC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Q,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;QAC5D,MAAM,YAAY,GAAGD,gBAAY,EAAE,CAAC,cAAc,CAAC,UAAU,CAAC,CAAA;QAC9D,IAAI,YAAY,EAAE;YACjB,OAAO,IAAI,CAAA;SACX;KACD;IACDF,qBAAa,CAAC,IAAI,SAAS,wEAAwE,EAAE,EAAE,CAAC,CAAA;IACxG,OAAO,KAAK,CAAA;AACb;;;;;;","names":["govWarningLog","splitByWhitespace","documentNode","isString"],"sources":["../../../packages/core/src/helpers/Validate/wcag.ts"],"sourcesContent":["import {govWarningLog} from '../Log/gov.log'\nimport {splitByWhitespace} from '../../utils/string.utils'\nimport {documentNode} from '../Dom/win'\nimport {isString} from \"../../utils/helpers.types\";\n\nexport const validateWcagProp = (value: string | undefined, propName: string, component: string): void => {\n\tif (value === undefined || String(value).length === 0) {\n\t\tgovWarningLog(`[${component}]: The (${propName}) attribute is important for correct accessibility.`)\n\t}\n}\n\nexport const validateWcagRef = (referenceId: string, name: string, component: string): boolean => {\n\tif (typeof referenceId === 'undefined' || referenceId === undefined) {\n\t\treturn true\n\t}\n\tif (String(referenceId).length === 0) {\n\t\tgovWarningLog(`[${component}]: Attribute (${name}) is defined with an empty value.`)\n\t\treturn false\n\t}\n\tlet strings = []\n\tconst referenceIds = splitByWhitespace(referenceId)\n\tif (Array.isArray(referenceIds)) {\n\t\tstrings = referenceIds.filter(function (e) {\n\t\t\treturn e.trim().length > 0\n\t\t})\n\t}\n\n\treturn !!strings.filter(referenceId => {\n\t\tif (documentNode().getElementById(referenceId) === null) {\n\t\t\t//govWarningLog(`[${component}][${name}]: Reference to element with id (${referenceId}) does not exist.`)\n\t\t\treturn false\n\t\t} else {\n\t\t\treturn true\n\t\t}\n\t}).length\n}\n\nexport const validateWcagLabelFor = (inputId: string, labelledBy: string | undefined, component: string): boolean => {\n\tconst labelEl = documentNode().querySelector(`[for=${inputId}]`)\n\tif (labelEl === null) {\n\t\tconst labelledByEl = documentNode().getElementById(labelledBy)\n\t\tif (labelledByEl === null) {\n\t\t\tgovWarningLog(`[${component}]: The form element has no defined wcag-label or wcag-labelled-by attribute.`)\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nexport const validateAccessibleLabel = (label: string | undefined, labelledBy: string | undefined, component: string, el: HTMLElement = undefined): boolean => {\n\tif (isString(label) && label.length > 0) {\n\t\treturn true\n\t}\n\tif (typeof labelledBy === 'string' && labelledBy.length > 0) {\n\t\tconst labelledByEl = documentNode().getElementById(labelledBy)\n\t\tif (labelledByEl) {\n\t\t\treturn true\n\t\t}\n\t}\n\tgovWarningLog(`[${component}]: The element has no defined aria-label or aria-labelledby attribute.`, el)\n\treturn false\n}\n"],"version":3}
@@ -16,6 +16,7 @@
16
16
  "components/gov-dialog/gov-dialog.js",
17
17
  "components/gov-empty/gov-empty.js",
18
18
  "components/gov-error-code/gov-error-code.js",
19
+ "components/gov-flex/gov-flex.js",
19
20
  "components/gov-form/autocomplete/gov-form-autocomplete.js",
20
21
  "components/gov-form/checkbox/gov-form-checkbox.js",
21
22
  "components/gov-form/control/gov-form-control.js",
@@ -38,6 +39,7 @@
38
39
  "components/gov-infobar/gov-infobar.js",
39
40
  "components/gov-layout/gov-layout-column.js",
40
41
  "components/gov-layout/gov-layout.js",
42
+ "components/gov-lifecycle-tester/gov-lifecycle-tester.js",
41
43
  "components/gov-loading/loading/gov-loading.js",
42
44
  "components/gov-loading/skeleton/gov-skeleton.js",
43
45
  "components/gov-message/gov-message.js",
@@ -3,6 +3,7 @@ import { validateProp } from "../../helpers/Validate/props";
3
3
  import { AccordionClass, AccordionItemClass, AccordionSizes, } from "./constants";
4
4
  import { booleanString, govHost, toBoolAttrIfDefined } from "../../helpers/Dom/template";
5
5
  import { inheritAriaAttributes } from "../../helpers/Accessibility/accessibility";
6
+ import { tick } from "../../utils/stencil.utils";
6
7
  export class GovAccordionItem {
7
8
  constructor() {
8
9
  this.inheritedAttributes = {};
@@ -17,10 +18,12 @@ export class GovAccordionItem {
17
18
  validateProp(AccordionSizes, newValue, AccordionItemClass.root);
18
19
  }
19
20
  componentWillLoad() {
20
- this.getPropsFromParents();
21
21
  this.validateSize(this.size);
22
22
  this.inheritedAttributes = inheritAriaAttributes(this.host);
23
23
  }
24
+ componentDidRender() {
25
+ tick(() => this.getPropsFromParents());
26
+ }
24
27
  getPropsFromParents() {
25
28
  const accordion = this.h.getParent(AccordionClass.root);
26
29
  if (accordion) {
@@ -28,13 +31,13 @@ export class GovAccordionItem {
28
31
  }
29
32
  }
30
33
  render() {
31
- return (h(Host, { key: 'cd78429326c306d9ab9fdc15954cd7029aa3ee35', class: this.h.classes([AccordionItemClass.root,
32
- this.disabled && AccordionItemClass.disabled]), size: this.size, role: "listitem" }, h("details", { key: '5372c71057418b93711f7d2c6065a6cc669105ff', class: AccordionItemClass.details, id: this.identifier, "aria-disabled": toBoolAttrIfDefined(this.disabled), open: this.open }, h("summary", Object.assign({ key: 'a2e06472048b79b206dc4421e43f0afd877b9be6', onClick: (e) => {
34
+ return (h(Host, { key: '1beb62527ea9274e6280ce0b64c9d52c12e4a993', class: this.h.classes([AccordionItemClass.root,
35
+ this.disabled && AccordionItemClass.disabled]), size: this.size, role: "listitem" }, h("details", { key: '53ca7688e8f26e85cd76feb073a26d04c5505d2b', class: AccordionItemClass.details, id: this.identifier, "aria-disabled": toBoolAttrIfDefined(this.disabled), open: this.open }, h("summary", Object.assign({ key: '19fec49b0066b7a6162a6010e0ee20431c2a578b', onClick: (e) => {
33
36
  e.stopPropagation();
34
37
  e.preventDefault();
35
38
  !this.disabled && this.toggle().finally();
36
39
  }, class: AccordionItemClass.summary, tabIndex: this.disabled ? -1 : 0, "aria-expanded": booleanString(this.open) }, this.inheritedAttributes), this.h.hasSlot('icon') &&
37
- h("span", { key: 'a2e6529d090c59ef45c8f7dbfd452165eebdf6e5', class: AccordionItemClass.icon }, h("slot", { key: 'ec572df22db3551aeb1baa31077d2bb368db88ca', name: "icon" })), h("span", { key: '44451f5e8df2550217af485162015a0810b2735e', class: AccordionItemClass.title }, h("slot", { key: '7f1c09f9537fe337a95e67b6f0c90c9c00ca00c1', name: "label" }), h("slot", { key: '84d426afff5847ffe57a96c12c163219a8720872', name: "annotation" })), h("span", { key: 'c4e37d6e8726486a043dd1def487d14e9678585b', class: AccordionItemClass.right }, h("slot", { key: 'b29e5714737ce05b8d194ce693dc4729e6b0e8a0', name: "suffix" }), h("span", { key: '1bd99c3f807ebc20ba4545d1c09325ce5b940d1a', class: AccordionItemClass.arrow }, h("slot", { key: 'ec2f902bccb6f21701238b822d72e7b2819c20c3', name: "toggle-icon" }, h("gov-icon", { key: 'ab143aace36d062bfb6e78c2f3544a0efb52cb49', name: "chevron-down" }))))), h("div", { key: '253f1a692a13698306d2f2f1b050252b7a798886', class: AccordionItemClass.content }, h("slot", { key: 'f51877b9d3f58f29bced6949b170529ddbf45864' })))));
40
+ h("span", { key: '19254947c22fa2b1a2fa4e26eacb22c0c89b40c9', class: AccordionItemClass.icon }, h("slot", { key: '262be1640f250fabf9918f4162c071bb68dc4fb3', name: "icon" })), h("span", { key: 'ebb5ef762ef51921b68a8063fd09c979d7d0d32d', class: AccordionItemClass.title }, h("slot", { key: '75783345d2276f06e53c401761cb4e57d241e5e0', name: "label" }), h("slot", { key: 'f2d9cdff693edbcae6293921fde7996d1b1251b6', name: "annotation" })), h("span", { key: 'f7e28ea54455756c7d146c7b88be7001e80b07a8', class: AccordionItemClass.right }, h("slot", { key: 'e76b31bf1c349a8a86d4b91ec1cfa650a75edf60', name: "suffix" }), h("span", { key: '87ea99c9862deb3ff9820fa383cec52956b4655a', class: AccordionItemClass.arrow }, h("slot", { key: 'c8b64a90455a731f359e12550664ba5aa905abbc', name: "toggle-icon" }, h("gov-icon", { key: '5e1024ed8c001dcdef87e5615d787091b1a3e9c6', name: "chevron-down" }))))), h("div", { key: '49651d2a78afe9318464aead657a0e544e2e2d4e', class: AccordionItemClass.content }, h("slot", { key: '4f3d3af2d6f3c357663d0a3c1e1433b55d7814bc' })))));
38
41
  }
39
42
  /**
40
43
  * Accordion switch
@@ -75,7 +78,7 @@ export class GovAccordionItem {
75
78
  },
76
79
  "size": {
77
80
  "type": "string",
78
- "mutable": false,
81
+ "mutable": true,
79
82
  "complexType": {
80
83
  "original": "AccordionSizeType",
81
84
  "resolved": "\"l\" | \"m\" | \"s\" | \"xl\" | \"xs\"",
@@ -1 +1 @@
1
- {"version":3,"file":"gov-accordion-item.js","sourceRoot":"","sources":["../../../../../../src/components/gov-accordion/gov-accordion-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,eAAe,CAAA;AAC1G,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAA;AACzD,OAAO,EAAC,cAAc,EAAE,kBAAkB,EAAE,cAAc,GAAqB,MAAM,aAAa,CAAA;AAClG,OAAO,EAAC,aAAa,EAAE,OAAO,EAAE,mBAAmB,EAAC,MAAM,4BAA4B,CAAA;AAGtF,OAAO,EAAC,qBAAqB,EAAC,MAAM,2CAA2C,CAAC;AAMhF,MAAM,OAAO,gBAAgB;IAI5B;QAFQ,wBAAmB,GAAe,EAAE,CAAC;;;;wBAoBR,KAAK;oBAIO,KAAK;QArBrD,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;KAC3B;IA2BD,YAAY,CAAC,QAAgB;QAC5B,YAAY,CAAC,cAAc,EAAE,QAAQ,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAA;IAChE,CAAC;IAED,iBAAiB;QAChB,IAAI,CAAC,mBAAmB,EAAE,CAAA;QAC1B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC5B,IAAI,CAAC,mBAAmB,GAAG,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,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;oBAGR,6DAAM,KAAK,EAAE,kBAAkB,CAAC,KAAK;wBACpC,6DAAM,IAAI,EAAC,OAAO,GAAE;wBACpB,6DAAM,IAAI,EAAC,YAAY,GAAE,CACnB;oBAEP,6DAAM,KAAK,EAAE,kBAAkB,CAAC,KAAK;wBACpC,6DAAM,IAAI,EAAC,QAAQ,GAAE;wBACrB,6DAAM,KAAK,EAAE,kBAAkB,CAAC,KAAK;4BACpC,6DAAM,IAAI,EAAC,aAAa;gCACvB,iEAAU,IAAI,EAAC,cAAc,GAAY,CACnC,CACD,CACD,CACE;gBACV,4DAAK,KAAK,EAAE,kBAAkB,CAAC,OAAO;oBACrC,8DAAO,CACF,CACG,CACJ,CACP,CAAA;IACF,CAAC;IAED;;OAEG;IAEH,KAAK,CAAC,MAAM;QACX,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAA;QACtB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;YACnB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,SAAS,EAAE,kBAAkB,CAAC,IAAI;YAClC,GAAG,EAAE,IAAI,CAAC,IAAI;SACd,CAAC,CAAA;IACH,CAAC;IAED;;OAEG;IAEH,KAAK,CAAC,YAAY;QACjB,OAAO,IAAI,CAAC,IAAI,CAAA;IACjB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../helpers/Validate/props\"\nimport {AccordionClass, AccordionItemClass, AccordionSizes, AccordionSizeType,} from \"./constants\"\nimport {booleanString, govHost, toBoolAttrIfDefined} from \"../../helpers/Dom/template\"\nimport {AccordionItemEvent} from \"./gov-accordion.types\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {inheritAriaAttributes} from \"../../helpers/Accessibility/accessibility\";\nimport {Attributes} from \"../../helpers/Dom/attribute\";\n\n@Component({\n\ttag: \"gov-accordion-item\",\n})\nexport class GovAccordionItem {\n\tprivate h: GovHost\n\tprivate inheritedAttributes: Attributes = {};\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() readonly host: HTMLGovAccordionItemElement\n\t@State() openState: boolean\n\n\t/**\n\t * Custom accordion item identifier.\n\t */\n\t@Prop() readonly identifier: string\n\t/**\n\t * Accordion’s size.\n\t */\n\t@Prop() size?: AccordionSizeType\n\t/**\n\t * Makes the button component disabled.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Defines whether the accordion is open or closed by button\n\t */\n\t@Prop({attribute: \"open\", mutable: true}) open = false\n\t/**\n\t * Called when the accordion state changes\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<AccordionItemEvent>\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(AccordionSizes, newValue, AccordionItemClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.getPropsFromParents()\n\t\tthis.validateSize(this.size)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tprivate getPropsFromParents() {\n\t\tconst accordion = this.h.getParent(AccordionClass.root)\n\t\tif (accordion) {\n\t\t\tthis.size = accordion.getAttribute(\"size\") as AccordionSizeType\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes([AccordionItemClass.root,\n\t\t\t\tthis.disabled && AccordionItemClass.disabled])}\n\t\t\t\t size={this.size}\n\t\t\t\t role=\"listitem\">\n\t\t\t\t<details\n\t\t\t\t\tclass={AccordionItemClass.details}\n\t\t\t\t\tid={this.identifier}\n\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\topen={this.open}\n\t\t\t\t>\n\t\t\t\t\t<summary\n\t\t\t\t\t\tonClick={(e: Event) => {\n\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t!this.disabled && this.toggle().finally()\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tclass={AccordionItemClass.summary}\n\t\t\t\t\t\ttabIndex={this.disabled ? -1 : 0}\n\t\t\t\t\t\taria-expanded={booleanString(this.open)}\n\t\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\t>\n\t\t\t\t\t\t{this.h.hasSlot('icon') &&\n\t\t\t\t\t\t\t<span class={AccordionItemClass.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\n\t\t\t\t\t\t<span class={AccordionItemClass.title}>\n\t\t\t\t\t\t\t<slot name=\"label\"/>\n\t\t\t\t\t\t\t<slot name=\"annotation\"/>\n\t\t\t\t\t\t</span>\n\n\t\t\t\t\t\t<span class={AccordionItemClass.right}>\n\t\t\t\t\t\t\t<slot name=\"suffix\"/>\n\t\t\t\t\t\t\t<span class={AccordionItemClass.arrow}>\n\t\t\t\t\t\t\t\t<slot name=\"toggle-icon\">\n\t\t\t\t\t\t\t\t\t<gov-icon name=\"chevron-down\"></gov-icon>\n\t\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</summary>\n\t\t\t\t\t<div class={AccordionItemClass.content}>\n\t\t\t\t\t\t<slot/>\n\t\t\t\t\t</div>\n\t\t\t\t</details>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Accordion switch\n\t */\n\t@Method()\n\tasync toggle(): Promise<void> {\n\t\tthis.open = !this.open\n\t\tthis.govChange.emit({\n\t\t\topen: this.open,\n\t\t\tcomponent: AccordionItemClass.root,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync currentState(): Promise<boolean> {\n\t\treturn this.open\n\t}\n}\n"]}
1
+ {"version":3,"file":"gov-accordion-item.js","sourceRoot":"","sources":["../../../../../../src/components/gov-accordion/gov-accordion-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,eAAe,CAAA;AAC1G,OAAO,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAA;AACzD,OAAO,EAAC,cAAc,EAAE,kBAAkB,EAAE,cAAc,GAAqB,MAAM,aAAa,CAAA;AAClG,OAAO,EAAC,aAAa,EAAE,OAAO,EAAE,mBAAmB,EAAC,MAAM,4BAA4B,CAAA;AAGtF,OAAO,EAAC,qBAAqB,EAAC,MAAM,2CAA2C,CAAC;AAEhF,OAAO,EAAC,IAAI,EAAC,MAAM,2BAA2B,CAAC;AAK/C,MAAM,OAAO,gBAAgB;IAI5B;QAFQ,wBAAmB,GAAe,EAAE,CAAC;;;;wBAoBR,KAAK;oBAIO,KAAK;QArBrD,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;KAC3B;IA2BD,YAAY,CAAC,QAAgB;QAC5B,YAAY,CAAC,cAAc,EAAE,QAAQ,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAA;IAChE,CAAC;IAED,iBAAiB;QAChB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC5B,IAAI,CAAC,mBAAmB,GAAG,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7D,CAAC;IAED,kBAAkB;QACjB,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAA;IACvC,CAAC;IAEO,mBAAmB;QAC1B,MAAM,SAAS,GAAG,IAA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IAAI,EAAC,OAAO,GAAE;wBACpB,6DAAM,IAAI,EAAC,YAAY,GAAE,CACnB;oBAEP,6DAAM,KAAK,EAAE,kBAAkB,CAAC,KAAK;wBACpC,6DAAM,IAAI,EAAC,QAAQ,GAAE;wBACrB,6DAAM,KAAK,EAAE,kBAAkB,CAAC,KAAK;4BACpC,6DAAM,IAAI,EAAC,aAAa;gCACvB,iEAAU,IAAI,EAAC,cAAc,GAAY,CACnC,CACD,CACD,CACE;gBACV,4DAAK,KAAK,EAAE,kBAAkB,CAAC,OAAO;oBACrC,8DAAO,CACF,CACG,CACJ,CACP,CAAA;IACF,CAAC;IAED;;OAEG;IAEH,KAAK,CAAC,MAAM;QACX,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAA;QACtB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;YACnB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,SAAS,EAAE,kBAAkB,CAAC,IAAI;YAClC,GAAG,EAAE,IAAI,CAAC,IAAI;SACd,CAAC,CAAA;IACH,CAAC;IAED;;OAEG;IAEH,KAAK,CAAC,YAAY;QACjB,OAAO,IAAI,CAAC,IAAI,CAAA;IACjB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../helpers/Validate/props\"\nimport {AccordionClass, AccordionItemClass, AccordionSizes, AccordionSizeType,} from \"./constants\"\nimport {booleanString, govHost, toBoolAttrIfDefined} from \"../../helpers/Dom/template\"\nimport {AccordionItemEvent} from \"./gov-accordion.types\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {inheritAriaAttributes} from \"../../helpers/Accessibility/accessibility\";\nimport {Attributes} from \"../../helpers/Dom/attribute\";\nimport {tick} from \"../../utils/stencil.utils\";\n\n@Component({\n\ttag: \"gov-accordion-item\",\n})\nexport class GovAccordionItem {\n\tprivate h: GovHost\n\tprivate inheritedAttributes: Attributes = {};\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() readonly host: HTMLGovAccordionItemElement\n\t@State() openState: boolean\n\n\t/**\n\t * Custom accordion item identifier.\n\t */\n\t@Prop() readonly identifier: string\n\t/**\n\t * Accordion’s size.\n\t */\n\t@Prop({ mutable: true }) size?: AccordionSizeType\n\t/**\n\t * Makes the button component disabled.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * Defines whether the accordion is open or closed by button\n\t */\n\t@Prop({attribute: \"open\", mutable: true}) open = false\n\t/**\n\t * Called when the accordion state changes\n\t */\n\t@Event({eventName: \"gov-change\"}) govChange: EventEmitter<AccordionItemEvent>\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(AccordionSizes, newValue, AccordionItemClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateSize(this.size)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tcomponentDidRender(): void {\n\t\ttick(() => this.getPropsFromParents())\n\t}\n\n\tprivate getPropsFromParents() {\n\t\tconst accordion = this.h.getParent(AccordionClass.root)\n\t\tif (accordion) {\n\t\t\tthis.size = accordion.getAttribute(\"size\") as AccordionSizeType\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes([AccordionItemClass.root,\n\t\t\t\tthis.disabled && AccordionItemClass.disabled])}\n\t\t\t\t size={this.size}\n\t\t\t\t role=\"listitem\">\n\t\t\t\t<details\n\t\t\t\t\tclass={AccordionItemClass.details}\n\t\t\t\t\tid={this.identifier}\n\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\topen={this.open}\n\t\t\t\t>\n\t\t\t\t\t<summary\n\t\t\t\t\t\tonClick={(e: Event) => {\n\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t!this.disabled && this.toggle().finally()\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tclass={AccordionItemClass.summary}\n\t\t\t\t\t\ttabIndex={this.disabled ? -1 : 0}\n\t\t\t\t\t\taria-expanded={booleanString(this.open)}\n\t\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\t>\n\t\t\t\t\t\t{this.h.hasSlot('icon') &&\n\t\t\t\t\t\t\t<span class={AccordionItemClass.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\n\t\t\t\t\t\t<span class={AccordionItemClass.title}>\n\t\t\t\t\t\t\t<slot name=\"label\"/>\n\t\t\t\t\t\t\t<slot name=\"annotation\"/>\n\t\t\t\t\t\t</span>\n\n\t\t\t\t\t\t<span class={AccordionItemClass.right}>\n\t\t\t\t\t\t\t<slot name=\"suffix\"/>\n\t\t\t\t\t\t\t<span class={AccordionItemClass.arrow}>\n\t\t\t\t\t\t\t\t<slot name=\"toggle-icon\">\n\t\t\t\t\t\t\t\t\t<gov-icon name=\"chevron-down\"></gov-icon>\n\t\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</summary>\n\t\t\t\t\t<div class={AccordionItemClass.content}>\n\t\t\t\t\t\t<slot/>\n\t\t\t\t\t</div>\n\t\t\t\t</details>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Accordion switch\n\t */\n\t@Method()\n\tasync toggle(): Promise<void> {\n\t\tthis.open = !this.open\n\t\tthis.govChange.emit({\n\t\t\topen: this.open,\n\t\t\tcomponent: AccordionItemClass.root,\n\t\t\tref: this.host,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync currentState(): Promise<boolean> {\n\t\treturn this.open\n\t}\n}\n"]}
@@ -0,0 +1,4 @@
1
+ export const FlexClass = {
2
+ root: 'gov-flex',
3
+ };
4
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../src/components/gov-flex/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG;IACxB,IAAI,EAAE,UAAU;CAChB,CAAA","sourcesContent":["export const FlexClass = {\n\troot: 'gov-flex',\n}\n\n"]}
@@ -0,0 +1,127 @@
1
+ import { h, Host } from "@stencil/core";
2
+ import { FlexClass } from "./constants";
3
+ import { govHost } from "../../helpers/Dom/template";
4
+ export class GovFlex {
5
+ constructor() {
6
+ this.direction = 'row';
7
+ this.justifyContent = undefined;
8
+ this.alignItems = undefined;
9
+ this.wrap = undefined;
10
+ this.alignContent = undefined;
11
+ this.alignSelf = undefined;
12
+ this.h = govHost(this.host);
13
+ }
14
+ render() {
15
+ return (h(Host, { key: '77d5eb1db594698f6fde4bf497209912de71173f', class: this.h.classes(FlexClass.root) }, h("slot", { key: '6c01ff6ec88c53dbf9e83d492f660c96e9e7fc2a' })));
16
+ }
17
+ static get is() { return "gov-flex"; }
18
+ static get properties() {
19
+ return {
20
+ "direction": {
21
+ "type": "string",
22
+ "mutable": false,
23
+ "complexType": {
24
+ "original": "'row' | 'row-reverse' | 'column' | 'column-reverse'",
25
+ "resolved": "\"column\" | \"column-reverse\" | \"row\" | \"row-reverse\"",
26
+ "references": {}
27
+ },
28
+ "required": false,
29
+ "optional": false,
30
+ "docs": {
31
+ "tags": [],
32
+ "text": "Controls the flex direction of the container. Can be 'row', 'row-reverse', 'column', or 'column-reverse'."
33
+ },
34
+ "attribute": "direction",
35
+ "reflect": false,
36
+ "defaultValue": "'row'"
37
+ },
38
+ "justifyContent": {
39
+ "type": "string",
40
+ "mutable": false,
41
+ "complexType": {
42
+ "original": "'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly'",
43
+ "resolved": "\"center\" | \"flex-end\" | \"flex-start\" | \"space-around\" | \"space-between\" | \"space-evenly\"",
44
+ "references": {}
45
+ },
46
+ "required": false,
47
+ "optional": true,
48
+ "docs": {
49
+ "tags": [],
50
+ "text": "Defines how the browser distributes space between and around content items along the main axis.\nAllowed values: 'flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly'."
51
+ },
52
+ "attribute": "justify-content",
53
+ "reflect": true
54
+ },
55
+ "alignItems": {
56
+ "type": "string",
57
+ "mutable": false,
58
+ "complexType": {
59
+ "original": "'stretch' | 'flex-start' | 'flex-end' | 'center' | 'baseline'",
60
+ "resolved": "\"baseline\" | \"center\" | \"flex-end\" | \"flex-start\" | \"stretch\"",
61
+ "references": {}
62
+ },
63
+ "required": false,
64
+ "optional": true,
65
+ "docs": {
66
+ "tags": [],
67
+ "text": "Aligns flex items along the cross axis. Can be 'stretch', 'flex-start', 'flex-end', 'center', or 'baseline'."
68
+ },
69
+ "attribute": "align-items",
70
+ "reflect": true
71
+ },
72
+ "wrap": {
73
+ "type": "string",
74
+ "mutable": false,
75
+ "complexType": {
76
+ "original": "'nowrap' | 'wrap' | 'wrap-reverse'",
77
+ "resolved": "\"nowrap\" | \"wrap\" | \"wrap-reverse\"",
78
+ "references": {}
79
+ },
80
+ "required": false,
81
+ "optional": true,
82
+ "docs": {
83
+ "tags": [],
84
+ "text": "Controls whether the flex container is a single-line or multi-line flex container. Can be 'nowrap', 'wrap', or 'wrap-reverse'."
85
+ },
86
+ "attribute": "wrap",
87
+ "reflect": true
88
+ },
89
+ "alignContent": {
90
+ "type": "string",
91
+ "mutable": false,
92
+ "complexType": {
93
+ "original": "'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'stretch'",
94
+ "resolved": "\"center\" | \"flex-end\" | \"flex-start\" | \"space-around\" | \"space-between\" | \"stretch\"",
95
+ "references": {}
96
+ },
97
+ "required": false,
98
+ "optional": true,
99
+ "docs": {
100
+ "tags": [],
101
+ "text": "Aligns the flex container's lines within when there is extra space in the cross-axis.\nAllowed values: 'flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'stretch'."
102
+ },
103
+ "attribute": "align-content",
104
+ "reflect": true
105
+ },
106
+ "alignSelf": {
107
+ "type": "string",
108
+ "mutable": false,
109
+ "complexType": {
110
+ "original": "'auto' | 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch'",
111
+ "resolved": "\"auto\" | \"baseline\" | \"center\" | \"flex-end\" | \"flex-start\" | \"stretch\"",
112
+ "references": {}
113
+ },
114
+ "required": false,
115
+ "optional": true,
116
+ "docs": {
117
+ "tags": [],
118
+ "text": "Sets the alignment of the flex container\u2019s children along the flex container\u2019s cross axis, overriding the `align-items` property for individual flex items.\nAllowed values: 'auto', 'flex-start', 'flex-end', 'center', 'baseline', 'stretch'."
119
+ },
120
+ "attribute": "align-self",
121
+ "reflect": true
122
+ }
123
+ };
124
+ }
125
+ static get elementRef() { return "host"; }
126
+ }
127
+ //# sourceMappingURL=gov-flex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gov-flex.js","sourceRoot":"","sources":["../../../../../../src/components/gov-flex/gov-flex.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAC,MAAM,eAAe,CAAA;AAC/D,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAA;AACrC,OAAO,EAAC,OAAO,EAAC,MAAM,4BAA4B,CAAA;AAMlD,MAAM,OAAO,OAAO;IAGnB;yBASyE,KAAK;;;;;;QAR7E,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;KAC3B;IAgDD,MAAM;QACL,OAAO,CACN,EAAC,IAAI,qDAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;YAC1C,8DAAa,CACP,CACP,CAAA;IACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {Component, Element, h, Host, Prop} from '@stencil/core'\nimport {FlexClass} from './constants'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-flex',\n})\nexport class GovFlex {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovGridElement\n\n\t/**\n\t * Controls the flex direction of the container. Can be 'row', 'row-reverse', 'column', or 'column-reverse'.\n\t */\n\t@Prop() direction: 'row' | 'row-reverse' | 'column' | 'column-reverse' = 'row';\n\n\t/**\n\t * Defines how the browser distributes space between and around content items along the main axis.\n\t * Allowed values: 'flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly'.\n\t */\n\t@Prop({\n\t\tattribute: 'justify-content',\n\t\treflect: true\n\t}) justifyContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';\n\n\t/**\n\t * Aligns flex items along the cross axis. Can be 'stretch', 'flex-start', 'flex-end', 'center', or 'baseline'.\n\t */\n\t@Prop({\n\t\tattribute: 'align-items', reflect: true\n\t}) alignItems?: 'stretch' | 'flex-start' | 'flex-end' | 'center' | 'baseline';\n\n\t/**\n\t * Controls whether the flex container is a single-line or multi-line flex container. Can be 'nowrap', 'wrap', or 'wrap-reverse'.\n\t */\n\t@Prop({reflect: true}) wrap?: 'nowrap' | 'wrap' | 'wrap-reverse';\n\n\t/**\n\t * Aligns the flex container's lines within when there is extra space in the cross-axis.\n\t * Allowed values: 'flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'stretch'.\n\t */\n\t@Prop({\n\t\tattribute: 'align-content',\n\t\treflect: true\n\t}) alignContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'stretch';\n\n\t/**\n\t * Sets the alignment of the flex container’s children along the flex container’s cross axis, overriding the `align-items` property for individual flex items.\n\t * Allowed values: 'auto', 'flex-start', 'flex-end', 'center', 'baseline', 'stretch'.\n\t */\n\t@Prop({\n\t\tattribute: 'align-self',\n\t\treflect: true\n\t}) alignSelf?: 'auto' | 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch';\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes(FlexClass.root)}>\n\t\t\t\t<slot></slot>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"]}
@@ -112,7 +112,7 @@ export class GovFormAutocomplete {
112
112
  this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { [attributeName]: newValue });
113
113
  }
114
114
  render() {
115
- return (h(Host, { key: '7a1445c057c48c73274a21cb55f4de4556ec4948', class: FormAutocompleteClass.root, size: this.size }, h("gov-form-input", Object.assign({ key: '09729a9e3a45f021180797254f7c757d77c4a087', placeholder: this.placeholder, name: this.name, disabled: this.disabled, readonly: this.readonly, autocomplete: false, size: this.size, required: this.required, invalid: this.invalid, success: this.success, role: 'searchbox', value: this.value, minlength: this.minlength, maxlength: this.maxlength, "on-gov-input": throttle(this.onInputHandler.bind(this), this.throttleTime), "on-gov-keyup": this.onKeyUpHandler.bind(this), "on-gov-keydown": this.onKeyDownHandler.bind(this), "on-gov-focus": this.onFocusHandler.bind(this), "on-gov-blur": this.onBlurHandler.bind(this) }, this.inheritedAttributes, { "aria-autocomplete": 'list', "aria-owns": [this.listBoxId, this.inheritedAttributes['aria-owns']].join(' '), "aria-expanded": booleanString(this.list.length && this.focused ? true : false), ref: el => (this.inputRef = el) }), h("slot", { key: 'fb75b138fe88646cacdb24fb9f5ee40ea5300509', name: "right-icon" })), h("ul", { key: '289a100a63718cd59ecd28ed8ed395de56b0475e', class: FormAutocompleteClass.list, role: 'listbox', "aria-hidden": toBoolAttr(!this.focused), hidden: !this.focused, id: this.listBoxId, ref: el => (this.listRef = el) }, this.focused && this.list.length === 0 && this.processing === false && this.isValueAccepted && this.messageEmpty ? (h("li", { class: FormAutocompleteClass.empty }, this.messageEmpty)) : null, this.focused && this.processing === true && this.isValueAccepted ? (h("li", { class: FormAutocompleteClass.loading }, h("gov-skeleton", { size: "m" }))) : null, this.focused ? this.list.map((item, index) => {
115
+ return (h(Host, { key: '4c1ca728a4fcbb5a3b39d219a166896fb6e41c5c', class: FormAutocompleteClass.root, size: this.size }, h("gov-form-input", Object.assign({ key: '34c6ec7581edd63d5aab4f8aba0a3e1e074ca0d9', placeholder: this.placeholder, name: this.name, disabled: this.disabled, readonly: this.readonly, autocomplete: false, size: this.size, required: this.required, invalid: this.invalid, success: this.success, role: 'searchbox', value: this.value, minlength: this.minlength, maxlength: this.maxlength, "on-gov-input": throttle(this.onInputHandler.bind(this), this.throttleTime), "on-gov-keyup": this.onKeyUpHandler.bind(this), "on-gov-keydown": this.onKeyDownHandler.bind(this), "on-gov-focus": this.onFocusHandler.bind(this), "on-gov-blur": this.onBlurHandler.bind(this) }, this.inheritedAttributes, { "aria-autocomplete": 'list', "aria-owns": [this.listBoxId, this.inheritedAttributes['aria-owns']].join(' '), "aria-expanded": booleanString(this.list.length && this.focused ? true : false), ref: el => (this.inputRef = el) }), h("slot", { key: '6fa5e8463b84faa2053047c1544c2097359f268e', name: "right-icon" })), h("ul", { key: '1ed5e02694c8af1981a320ed7e91c81784032dae', class: FormAutocompleteClass.list, role: 'listbox', "aria-hidden": toBoolAttr(!this.focused), hidden: !this.focused, id: this.listBoxId, ref: el => (this.listRef = el) }, this.focused && this.list.length === 0 && this.processing === false && this.isValueAccepted && this.messageEmpty ? (h("li", { class: FormAutocompleteClass.empty }, this.messageEmpty)) : null, this.focused && this.processing === true && this.isValueAccepted ? (h("li", { class: FormAutocompleteClass.loading }, h("gov-skeleton", { size: "m" }))) : null, this.focused ? this.list.map((item, index) => {
116
116
  const isSelected = this.arrowCounter === index;
117
117
  return (h("li", { class: FormAutocompleteClass.item, innerHTML: this.templateResolver(item, isSelected), role: 'option', "aria-posinset": index, tabindex: isSelected ? 0 : -1, "aria-setsize": this.list.length, onTouchStart: (e) => this.onSelectHandler(e, index), onMouseDown: (e) => this.onSelectHandler(e, index), "aria-selected": toBoolAttr(isSelected) }, h("slot", { name: "list-item-left" }), h("slot", { name: "list-item-right" })));
118
118
  }) : null)));
@@ -47,7 +47,7 @@ export class GovFormControl {
47
47
  }
48
48
  render() {
49
49
  const Tag = this.fieldset ? "fieldset" : "div";
50
- return (h(Host, { key: '2037f2c033d26035fc576af50163d72ddf33c8b6', size: this.size, class: this.h.classes(FormControlClass.root) }, h(Tag, { key: '8f913f3d0cecc153db7e217770c3e13ff3ff10a9', class: FormControlClass.holder }, this.h.hasSlot("top") && h("slot", { key: '70ca0a5f95e40d3c88f34ba1521b40a561ae510a', name: "top" }), h("slot", { key: '9043f4197b78a1678fda7643879c61cbb3d09302' }), this.h.hasSlot("bottom") && (h("div", { key: 'a67a85b8edec4a262e3e8291e7b939d8a8f8c10d', class: FormControlClass.bottom }, h("slot", { key: '94958915a9be8406e6f81ce2603e0b8bf3c3d0dd', name: "bottom" }))))));
50
+ return (h(Host, { key: '81635a0efe09a262be2b2359355dac108e542726', size: this.size, class: this.h.classes(FormControlClass.root) }, h(Tag, { key: '5251c4b5fba8f699c9a017e310932b85c8fb3abf', class: FormControlClass.holder }, this.h.hasSlot("top") && h("slot", { key: '8f6695209e018ad74a8b7e32945cc51ead47dc2d', name: "top" }), h("slot", { key: '380304f4a8c70e9db2f1f062761ece479a0b6ca8' }), this.h.hasSlot("bottom") && (h("div", { key: '3f37cb4c4165cdf80e8e3fc081d8503c1f975230', class: FormControlClass.bottom }, h("slot", { key: 'b6be21c67739f3f50d15bf3ca69aa1e71ca96e4c', name: "bottom" }))))));
51
51
  }
52
52
  static get is() { return "gov-form-control"; }
53
53
  static get properties() {
@@ -9,6 +9,7 @@ import { AttributeObserver } from "../../../helpers/Dom/attribute";
9
9
  import { ariaAttributes } from "../../../helpers/Accessibility/attributes";
10
10
  export class GovFormFile {
11
11
  constructor() {
12
+ this.eventsRegistered = false;
12
13
  this.expanded = false;
13
14
  this.required = false;
14
15
  this.disabled = false;
@@ -41,6 +42,10 @@ export class GovFormFile {
41
42
  this.f.passAttrToControl("type", "File");
42
43
  }
43
44
  registerListeners() {
45
+ if (this.eventsRegistered) {
46
+ return;
47
+ }
48
+ this.eventsRegistered = true;
44
49
  function highlight() {
45
50
  this.areaRef.classList.add("highlight");
46
51
  }
@@ -133,7 +138,7 @@ export class GovFormFile {
133
138
  this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { [attributeName]: newValue });
134
139
  }
135
140
  render() {
136
- return (h(Host, { key: '2df963d49d08bbb6f0ca9041537476932f4d6f60', class: this.h.classes([FormFileClass.root]), invalid: toBoolAttrIfDefined(this.invalid), expanded: toBoolAttrIfDefined(this.expanded) }, h("div", { key: 'a717c9e31dd719ed2c30c5ea169045df4867bddb', class: FormFileClass.area, ref: el => (this.areaRef = el) }, h("slot", { key: '9abd5561667dac90bd8554403250685b1ed54b65' }), h("input", Object.assign({ key: '2494399376b69a75eb136cad01568de49b8819a8', class: FormFileClass.input, ref: el => (this.inputRef = el), id: this.identifier || this.fileId, type: "file", name: this.name, accept: this.accept, multiple: this.multiple, onChange: this.onChangeHandler.bind(this), onFocus: this.onFocusHandler.bind(this), onBlur: this.onBlurHandler.bind(this), required: this.required, disabled: this.disabled }, this.inheritedAttributes, { "aria-required": toBoolAttrIfDefined(this.required), "aria-invalid": toBoolAttrIfDefined(this.invalid), "aria-disabled": toBoolAttrIfDefined(this.disabled) }))), this.h.hasSlot("attachments") ? (h("div", { class: FormFileClass.attachments }, h("slot", { name: "attachments" }))) : null, this.files.length && this.displayAttachments ? (h("div", { class: FormFileClass.attachments }, h("gov-attachments", { label: this.accessibleAttachmentsLabel, "accessible-label": this.accessibleAttachmentsLabel }, this.files.map(item => (h("gov-attachments-item", { "accessible-remove-labelledby": item.id, "on-gov-remove": () => this.onRemoveFileHandler(item) }, h("span", { class: "sr-only", id: item.id }, this.accessibleRemoveLabel.replace("{FILE_NAME}", item.file.name)), item.file.name, item.acceptValid === false ? (h("gov-form-message", { slot: "message", color: "error" }, h("gov-icon", { slot: "icon", name: "exclamation-triangle-fill" }), item.acceptValid === false ? this.errorAccept : null)) : null, item.sizeValid === false ? (h("gov-form-message", { slot: "message", color: "error" }, h("gov-icon", { slot: "icon", name: "exclamation-triangle-fill" }), this.errorSize.replace("{FILE_SIZE}", formatBytes(this.maxFileSize)))) : null, h("span", { slot: "info" }, "(", formatBytes(item.file.size), ")"))))))) : null));
141
+ return (h(Host, { key: '1f69ad55f386a3e0429a0616020c04dbaadc8025', class: this.h.classes([FormFileClass.root]), invalid: toBoolAttrIfDefined(this.invalid), expanded: toBoolAttrIfDefined(this.expanded) }, h("div", { key: '0927e067de4a7fa12fe73b9eb3ac48af1a930092', class: FormFileClass.area, ref: el => (this.areaRef = el) }, h("slot", { key: '810a669af48af7306884a3a32b81aaf3a8498c41' }), h("input", Object.assign({ key: 'c7c5e6f71ee55c154348503693d83f022f73c346', class: FormFileClass.input, ref: el => (this.inputRef = el), id: this.identifier || this.fileId, type: "file", name: this.name, accept: this.accept, multiple: this.multiple, onChange: this.onChangeHandler.bind(this), onFocus: this.onFocusHandler.bind(this), onBlur: this.onBlurHandler.bind(this), required: this.required, disabled: this.disabled }, this.inheritedAttributes, { "aria-required": toBoolAttrIfDefined(this.required), "aria-invalid": toBoolAttrIfDefined(this.invalid), "aria-disabled": toBoolAttrIfDefined(this.disabled) }))), this.h.hasSlot("attachments") ? (h("div", { class: FormFileClass.attachments }, h("slot", { name: "attachments" }))) : null, this.files.length && this.displayAttachments ? (h("div", { class: FormFileClass.attachments }, h("gov-attachments", { label: this.accessibleAttachmentsLabel, "accessible-label": this.accessibleAttachmentsLabel }, this.files.map(item => (h("gov-attachments-item", { "accessible-remove-labelledby": item.id, "on-gov-remove": () => this.onRemoveFileHandler(item) }, h("span", { class: "sr-only", id: item.id }, this.accessibleRemoveLabel.replace("{FILE_NAME}", item.file.name)), item.file.name, item.acceptValid === false ? (h("gov-form-message", { slot: "message", color: "error" }, h("gov-icon", { slot: "icon", name: "exclamation-triangle-fill" }), item.acceptValid === false ? this.errorAccept : null)) : null, item.sizeValid === false ? (h("gov-form-message", { slot: "message", color: "error" }, h("gov-icon", { slot: "icon", name: "exclamation-triangle-fill" }), this.errorSize.replace("{FILE_SIZE}", formatBytes(this.maxFileSize)))) : null, h("span", { slot: "info" }, "(", formatBytes(item.file.size), ")"))))))) : null));
137
142
  }
138
143
  onRemoveFileHandler(file) {
139
144
  const index = this.files.findIndex(item => item.id === file.id);
@@ -1 +1 @@
1
- {"version":3,"file":"gov-form-file.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/file/gov-form-file.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,eAAe,CAAA;AAC1G,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAA;AACpD,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAA;AACzC,OAAO,EAAC,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAC,MAAM,+BAA+B,CAAA;AACtF,OAAO,EAAC,oBAAoB,EAAE,kBAAkB,EAAE,WAAW,EAAC,MAAM,2BAA2B,CAAA;AAG/F,OAAO,EAAC,OAAO,EAAC,MAAM,2BAA2B,CAAA;AAEjD,OAAO,EAAC,qBAAqB,EAAC,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAC,iBAAiB,EAAa,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAC,cAAc,EAAC,MAAM,2CAA2C,CAAC;AAKzE,M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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {createID} from \"../../../utils/string.utils\"\nimport {FormFileClass} from \"./constants\"\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from \"../../../helpers/Dom/template\"\nimport {fileAcceptValidation, fileSizeValidation, formatBytes} from \"../../../utils/file.utils\"\nimport {GovForm} from \"../../../helpers/Dom/form.types\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {govForm} from \"../../../helpers/Dom/form\"\nimport {GovFormFileEvent, GovFormFileItem} from \"./gov-form-file.types\"\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\n\n@Component({\n\ttag: \"gov-form-file\",\n})\nexport class GovFormFile {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\n\tprivate areaRef?: HTMLDivElement\n\tprivate inputRef?: HTMLInputElement\n\tprivate readonly fileId: string\n\tprivate attributeObserver: AttributeObserver\n\n\tconstructor() {\n\t\tthis.fileId = createID(\"GovInputFile\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormFileElement\n\t/**\n\t * Expands the file input to fill 100% of the container width.\n\t */\n\t@Prop() readonly expanded: boolean = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the File component disabled.\n\t * This prevents users from being able to interact with the File, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * After selecting the files, the main input element will be reset.\n\t * The propagation of the event with the selected files will not be affected.\n\t */\n\t@Prop({attribute: \"reset-after-pick\"}) readonly resetAfterPick: boolean = false\n\t/**\n\t * Selected files will not be checked for duplicates based on name and size.\n\t */\n\t@Prop({attribute: \"ignore-file-duplication-check\"}) readonly ignoreFileDuplicationCheck: boolean = false\n\t/**\n\t * Show list of attachments\n\t */\n\t@Prop({attribute: \"display-attachments\"}) readonly displayAttachments: boolean = true\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept\n\t */\n\t@Prop() readonly accept: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/multiple\n\t */\n\t@Prop() readonly multiple: boolean = false\n\t/**\n\t * Maximum embedded file size\n\t */\n\t@Prop({attribute: \"max-file-size\"}) readonly maxFileSize: number = -1\n\t/**\n\t * Custom File identifier.\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Error message when the maximum file size is exceeded\n\t */\n\t@Prop({attribute: \"error-size\"}) readonly errorSize: string = \"Soubor je větší než povolená velikost {FILE_SIZE}\"\n\t/**\n\t * Insert unsupported file error message\n\t */\n\t@Prop({attribute: \"error-accept\"}) readonly errorAccept: string = \"Soubor tohoto typu není povolen\"\n\t/**\n\t * Description of the list of attachments\n\t */\n\t@Prop({attribute: \"attachments-label\"}) readonly attachmentsLabel: string = \"Přílohy\"\n\t/**\n\t * Adds accessible label for the remove button that is only shown for screen readers.\n\t */\n\t@Prop({attribute: \"accessible-remove-label\"}) readonly accessibleRemoveLabel: string = \"Odebrat soubor {FILE_NAME}\"\n\t/**\n\t * Adds accessible label for the list of attachments.\n\t */\n\t@Prop({attribute: \"accessible-attachments-label\"}) readonly accessibleAttachmentsLabel: string = \"Přílohy\"\n\t/**\n\t * Emitted when the File has focus.\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Emitted when the File loses focus.\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when the list of inserted files is changed\n\t */\n\t@Event({eventName: \"gov-files\"}) govFiles: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when a new file is added\n\t */\n\t@Event({eventName: \"gov-add-file\"}) govAddFile: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when a file is removed from the list\n\t */\n\t@Event({eventName: \"gov-remove-file\"}) govRemoveFile: EventEmitter<GovFormFileEvent>\n\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\twatchControlAttrs(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\t@State() files: GovFormFileItem[] = []\n\t@State() inheritedAttributes: Attributes = {}\n\n\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"type\", \"File\")\n\t}\n\n\n\tprivate registerListeners() {\n\t\tfunction highlight() {\n\t\t\tthis.areaRef.classList.add(\"highlight\")\n\t\t}\n\n\t\tfunction unhighlight() {\n\t\t\tthis.areaRef.classList.remove(\"highlight\")\n\t\t}\n\n\t\tthis.inputRef.addEventListener(\n\t\t\t\"change\",\n\t\t\te => {\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopPropagation()\n\t\t\t\tconst files = (e.target as HTMLInputElement).files\n\t\t\t\tif (this.resetAfterPick) {\n\t\t\t\t\tif (files.length) {\n\t\t\t\t\t\tthis.validateFiles(files)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.validateFiles(files)\n\t\t\t\t}\n\t\t\t},\n\t\t\tfalse,\n\t\t)\n\n\t\tif (this.expanded) {\n\t\t\tconst events = [\"dragover\", \"dragleave\"]\n\t\t\tconst inEvents = [\"dragenter\", \"dragover\", \"mouseenter\"]\n\t\t\tconst outEvents = [\"dragleave\", \"drop\", \"mouseleave\"]\n\n\t\t\tevents.map(eventName => this.inputRef.addEventListener(eventName, this.preventDefaults.bind(this), false))\n\t\t\tinEvents.map(eventName => this.inputRef.addEventListener(eventName, highlight.bind(this), false))\n\t\t\toutEvents.forEach(eventName => this.inputRef.addEventListener(eventName, unhighlight.bind(this), false))\n\n\t\t\tthis.areaRef.addEventListener(\"drop\", this.handleDrop.bind(this), false)\n\t\t}\n\t}\n\n\tpreventDefaults(e) {\n\t\te.preventDefault()\n\t\te.stopPropagation()\n\t}\n\n\thandleDrop(e: DragEvent) {\n\t\tconst dataTransfer = e.dataTransfer\n\t\tthis.validateFiles(dataTransfer.files)\n\t}\n\n\tprivate validateFiles(files: FileList) {\n\t\tlet filesBuffer: GovFormFileItem[] = []\n\t\tArray.from(files).map(file => {\n\t\t\tconst isFile = this.files.find(item => item.file.name === file.name && item.file.size === file.size) || null\n\t\t\tif (isFile === null || this.ignoreFileDuplicationCheck) {\n\t\t\t\tconst isSizeValid = typeof this.maxFileSize === \"number\" && this.maxFileSize > 0 ? fileSizeValidation(file, this.maxFileSize) : true\n\t\t\t\tconst isAcceptValid = fileAcceptValidation(file, this.accept)\n\t\t\t\tconst newFile = {\n\t\t\t\t\tid: createID(\"GovFormFile\"),\n\t\t\t\t\tfile,\n\t\t\t\t\tacceptValid: isAcceptValid,\n\t\t\t\t\tsizeValid: isSizeValid,\n\t\t\t\t}\n\t\t\t\tif (this.displayAttachments) {\n\t\t\t\t\tthis.files = [...this.files, newFile]\n\t\t\t\t} else {\n\t\t\t\t\tfilesBuffer = [...filesBuffer, newFile]\n\t\t\t\t}\n\t\t\t\tthis.govAddFile.emit({\n\t\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\t\tfile: newFile,\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\n\t\tthis.govFiles.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\tfiles: filesBuffer.length ? filesBuffer : this.files,\n\t\t})\n\n\t\tif (this.resetAfterPick) {\n\t\t\tthis.reset().finally()\n\t\t}\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\tthis.passControlAttrs()\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.registerListeners()\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver.stopObserving();\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes([FormFileClass.root])}\n\t\t\t\t invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t expanded={toBoolAttrIfDefined(this.expanded)}>\n\t\t\t\t<div class={FormFileClass.area} ref={el => (this.areaRef = el as HTMLDivElement)}>\n\t\t\t\t\t<slot/>\n\t\t\t\t\t<input\n\t\t\t\t\t\tclass={FormFileClass.input}\n\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\tid={this.identifier || this.fileId}\n\t\t\t\t\t\ttype=\"file\"\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\taccept={this.accept}\n\t\t\t\t\t\tmultiple={this.multiple}\n\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\n\t\t\t\t{this.h.hasSlot(\"attachments\") ? (\n\t\t\t\t\t<div class={FormFileClass.attachments}>\n\t\t\t\t\t\t<slot name={\"attachments\"}/>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\n\t\t\t\t{this.files.length && this.displayAttachments ? (\n\t\t\t\t\t<div class={FormFileClass.attachments}>\n\t\t\t\t\t\t<gov-attachments label={this.accessibleAttachmentsLabel}\n\t\t\t\t\t\t\t\t\t\t accessible-label={this.accessibleAttachmentsLabel}>\n\t\t\t\t\t\t\t{this.files.map(item => (\n\t\t\t\t\t\t\t\t<gov-attachments-item accessible-remove-labelledby={item.id}\n\t\t\t\t\t\t\t\t\t\t\t\t\t on-gov-remove={() => this.onRemoveFileHandler(item)}>\n\t\t\t\t\t\t\t\t\t<span class={\"sr-only\"} id={item.id}>\n\t\t\t\t\t\t\t\t\t\t{this.accessibleRemoveLabel.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\" color=\"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\" color=\"error\">\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon\" name=\"exclamation-triangle-fill\"></gov-icon>\n\t\t\t\t\t\t\t\t\t\t\t{this.errorSize.replace(\"{FILE_SIZE}\", formatBytes(this.maxFileSize))}\n\t\t\t\t\t\t\t\t\t\t</gov-form-message>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t<span slot=\"info\">({formatBytes(item.file.size)})</span>\n\t\t\t\t\t\t\t\t</gov-attachments-item>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</gov-attachments>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onRemoveFileHandler(file: GovFormFileItem) {\n\t\tconst index = this.files.findIndex(item => item.id === file.id)\n\t\tif (index !== -1) {\n\t\t\tconst files = this.files\n\t\t\tconst removeFile = this.files[index]\n\t\t\tfiles.splice(index, 1)\n\t\t\tthis.files = [...files]\n\t\t\tthis.govRemoveFile.emit({\n\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\tfile: removeFile,\n\t\t\t})\n\t\t\tthis.govFiles.emit({\n\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\tfiles,\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\te.stopPropagation()\n\t}\n\n\t/**\n\t * Returns the reference of the native element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n\n\t/**\n\t * Returns the reference of the native area element\n\t */\n\t@Method()\n\tasync getAreaRef(): Promise<HTMLDivElement> {\n\t\treturn this.areaRef\n\t}\n\n\t/**\n\t * Remove all files from component state\n\t */\n\t@Method()\n\tasync reset(): Promise<void> {\n\t\tthis.files = []\n\t\tthis.inputRef.value = '';\n\t}\n}\n"]}
1
+ {"version":3,"file":"gov-form-file.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/file/gov-form-file.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,eAAe,CAAA;AAC1G,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAA;AACpD,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAA;AACzC,OAAO,EAAC,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAC,MAAM,+BAA+B,CAAA;AACtF,OAAO,EAAC,oBAAoB,EAAE,kBAAkB,EAAE,WAAW,EAAC,MAAM,2BAA2B,CAAA;AAG/F,OAAO,EAAC,OAAO,EAAC,MAAM,2BAA2B,CAAA;AAEjD,OAAO,EAAC,qBAAqB,EAAC,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAC,iBAAiB,EAAa,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAC,cAAc,EAAC,MAAM,2CAA2C,CAAC;AAKzE,MAAM,OAAO,WAAW;IAUvB;QAFQ,qBAAgB,GAAG,KAAK,CAAA;wBAaK,KAAK;wBAKL,KAAK;wBAKL,KAAK;8BAKgC,KAAK;0CAIoB,KAAK;kCAIvB,IAAI;;;wBAchD,KAAK;2BAIyB,CAAC,CAAC;;;yBAYP,mDAAmD;2BAI/C,iCAAiC;gCAIvB,SAAS;qCAIE,4BAA4B;0C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;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {createID} from \"../../../utils/string.utils\"\nimport {FormFileClass} from \"./constants\"\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from \"../../../helpers/Dom/template\"\nimport {fileAcceptValidation, fileSizeValidation, formatBytes} from \"../../../utils/file.utils\"\nimport {GovForm} from \"../../../helpers/Dom/form.types\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {govForm} from \"../../../helpers/Dom/form\"\nimport {GovFormFileEvent, GovFormFileItem} from \"./gov-form-file.types\"\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\n\n@Component({\n\ttag: \"gov-form-file\",\n})\nexport class GovFormFile {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\n\tprivate areaRef?: HTMLDivElement\n\tprivate inputRef?: HTMLInputElement\n\tprivate readonly fileId: string\n\tprivate attributeObserver: AttributeObserver\n\tprivate eventsRegistered = false\n\n\tconstructor() {\n\t\tthis.fileId = createID(\"GovInputFile\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormFileElement\n\t/**\n\t * Expands the file input to fill 100% of the container width.\n\t */\n\t@Prop() readonly expanded: boolean = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the File component disabled.\n\t * This prevents users from being able to interact with the File, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean = false\n\t/**\n\t * After selecting the files, the main input element will be reset.\n\t * The propagation of the event with the selected files will not be affected.\n\t */\n\t@Prop({attribute: \"reset-after-pick\"}) readonly resetAfterPick: boolean = false\n\t/**\n\t * Selected files will not be checked for duplicates based on name and size.\n\t */\n\t@Prop({attribute: \"ignore-file-duplication-check\"}) readonly ignoreFileDuplicationCheck: boolean = false\n\t/**\n\t * Show list of attachments\n\t */\n\t@Prop({attribute: \"display-attachments\"}) readonly displayAttachments: boolean = true\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept\n\t */\n\t@Prop() readonly accept: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/multiple\n\t */\n\t@Prop() readonly multiple: boolean = false\n\t/**\n\t * Maximum embedded file size\n\t */\n\t@Prop({attribute: \"max-file-size\"}) readonly maxFileSize: number = -1\n\t/**\n\t * Custom File identifier.\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Error message when the maximum file size is exceeded\n\t */\n\t@Prop({attribute: \"error-size\"}) readonly errorSize: string = \"Soubor je větší než povolená velikost {FILE_SIZE}\"\n\t/**\n\t * Insert unsupported file error message\n\t */\n\t@Prop({attribute: \"error-accept\"}) readonly errorAccept: string = \"Soubor tohoto typu není povolen\"\n\t/**\n\t * Description of the list of attachments\n\t */\n\t@Prop({attribute: \"attachments-label\"}) readonly attachmentsLabel: string = \"Přílohy\"\n\t/**\n\t * Adds accessible label for the remove button that is only shown for screen readers.\n\t */\n\t@Prop({attribute: \"accessible-remove-label\"}) readonly accessibleRemoveLabel: string = \"Odebrat soubor {FILE_NAME}\"\n\t/**\n\t * Adds accessible label for the list of attachments.\n\t */\n\t@Prop({attribute: \"accessible-attachments-label\"}) readonly accessibleAttachmentsLabel: string = \"Přílohy\"\n\t/**\n\t * Emitted when the File has focus.\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Emitted when the File loses focus.\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when the list of inserted files is changed\n\t */\n\t@Event({eventName: \"gov-files\"}) govFiles: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when a new file is added\n\t */\n\t@Event({eventName: \"gov-add-file\"}) govAddFile: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when a file is removed from the list\n\t */\n\t@Event({eventName: \"gov-remove-file\"}) govRemoveFile: EventEmitter<GovFormFileEvent>\n\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\twatchControlAttrs(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\t@State() files: GovFormFileItem[] = []\n\t@State() inheritedAttributes: Attributes = {}\n\n\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"type\", \"File\")\n\t}\n\n\n\tprivate registerListeners() {\n\t\tif (this.eventsRegistered) {\n\t\t\treturn\n\t\t}\n\t\tthis.eventsRegistered = true\n\n\t\tfunction highlight() {\n\t\t\tthis.areaRef.classList.add(\"highlight\")\n\t\t}\n\n\t\tfunction unhighlight() {\n\t\t\tthis.areaRef.classList.remove(\"highlight\")\n\t\t}\n\n\t\tthis.inputRef.addEventListener(\n\t\t\t\"change\",\n\t\t\te => {\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopPropagation()\n\t\t\t\tconst files = (e.target as HTMLInputElement).files\n\t\t\t\tif (this.resetAfterPick) {\n\t\t\t\t\tif (files.length) {\n\t\t\t\t\t\tthis.validateFiles(files)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.validateFiles(files)\n\t\t\t\t}\n\t\t\t},\n\t\t\tfalse,\n\t\t)\n\n\t\tif (this.expanded) {\n\t\t\tconst events = [\"dragover\", \"dragleave\"]\n\t\t\tconst inEvents = [\"dragenter\", \"dragover\", \"mouseenter\"]\n\t\t\tconst outEvents = [\"dragleave\", \"drop\", \"mouseleave\"]\n\n\t\t\tevents.map(eventName => this.inputRef.addEventListener(eventName, this.preventDefaults.bind(this), false))\n\t\t\tinEvents.map(eventName => this.inputRef.addEventListener(eventName, highlight.bind(this), false))\n\t\t\toutEvents.forEach(eventName => this.inputRef.addEventListener(eventName, unhighlight.bind(this), false))\n\n\t\t\tthis.areaRef.addEventListener(\"drop\", this.handleDrop.bind(this), false)\n\t\t}\n\t}\n\n\tpreventDefaults(e) {\n\t\te.preventDefault()\n\t\te.stopPropagation()\n\t}\n\n\thandleDrop(e: DragEvent) {\n\t\tconst dataTransfer = e.dataTransfer\n\t\tthis.validateFiles(dataTransfer.files)\n\t}\n\n\tprivate validateFiles(files: FileList) {\n\t\tlet filesBuffer: GovFormFileItem[] = []\n\t\tArray.from(files).map(file => {\n\t\t\tconst isFile = this.files.find(item => item.file.name === file.name && item.file.size === file.size) || null\n\t\t\tif (isFile === null || this.ignoreFileDuplicationCheck) {\n\t\t\t\tconst isSizeValid = typeof this.maxFileSize === \"number\" && this.maxFileSize > 0 ? fileSizeValidation(file, this.maxFileSize) : true\n\t\t\t\tconst isAcceptValid = fileAcceptValidation(file, this.accept)\n\t\t\t\tconst newFile = {\n\t\t\t\t\tid: createID(\"GovFormFile\"),\n\t\t\t\t\tfile,\n\t\t\t\t\tacceptValid: isAcceptValid,\n\t\t\t\t\tsizeValid: isSizeValid,\n\t\t\t\t}\n\t\t\t\tif (this.displayAttachments) {\n\t\t\t\t\tthis.files = [...this.files, newFile]\n\t\t\t\t} else {\n\t\t\t\t\tfilesBuffer = [...filesBuffer, newFile]\n\t\t\t\t}\n\t\t\t\tthis.govAddFile.emit({\n\t\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\t\tfile: newFile,\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\n\t\tthis.govFiles.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\tfiles: filesBuffer.length ? filesBuffer : this.files,\n\t\t})\n\n\t\tif (this.resetAfterPick) {\n\t\t\tthis.reset().finally()\n\t\t}\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\tthis.passControlAttrs()\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.registerListeners()\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver.stopObserving();\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes([FormFileClass.root])}\n\t\t\t\t invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t expanded={toBoolAttrIfDefined(this.expanded)}>\n\t\t\t\t<div class={FormFileClass.area} ref={el => (this.areaRef = el as HTMLDivElement)}>\n\t\t\t\t\t<slot/>\n\t\t\t\t\t<input\n\t\t\t\t\t\tclass={FormFileClass.input}\n\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\tid={this.identifier || this.fileId}\n\t\t\t\t\t\ttype=\"file\"\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\taccept={this.accept}\n\t\t\t\t\t\tmultiple={this.multiple}\n\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\n\t\t\t\t{this.h.hasSlot(\"attachments\") ? (\n\t\t\t\t\t<div class={FormFileClass.attachments}>\n\t\t\t\t\t\t<slot name={\"attachments\"}/>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\n\t\t\t\t{this.files.length && this.displayAttachments ? (\n\t\t\t\t\t<div class={FormFileClass.attachments}>\n\t\t\t\t\t\t<gov-attachments label={this.accessibleAttachmentsLabel}\n\t\t\t\t\t\t\t\t\t\t accessible-label={this.accessibleAttachmentsLabel}>\n\t\t\t\t\t\t\t{this.files.map(item => (\n\t\t\t\t\t\t\t\t<gov-attachments-item accessible-remove-labelledby={item.id}\n\t\t\t\t\t\t\t\t\t\t\t\t\t on-gov-remove={() => this.onRemoveFileHandler(item)}>\n\t\t\t\t\t\t\t\t\t<span class={\"sr-only\"} id={item.id}>\n\t\t\t\t\t\t\t\t\t\t{this.accessibleRemoveLabel.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\" color=\"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\" color=\"error\">\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon\" name=\"exclamation-triangle-fill\"></gov-icon>\n\t\t\t\t\t\t\t\t\t\t\t{this.errorSize.replace(\"{FILE_SIZE}\", formatBytes(this.maxFileSize))}\n\t\t\t\t\t\t\t\t\t\t</gov-form-message>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t<span slot=\"info\">({formatBytes(item.file.size)})</span>\n\t\t\t\t\t\t\t\t</gov-attachments-item>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</gov-attachments>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onRemoveFileHandler(file: GovFormFileItem) {\n\t\tconst index = this.files.findIndex(item => item.id === file.id)\n\t\tif (index !== -1) {\n\t\t\tconst files = this.files\n\t\t\tconst removeFile = this.files[index]\n\t\t\tfiles.splice(index, 1)\n\t\t\tthis.files = [...files]\n\t\t\tthis.govRemoveFile.emit({\n\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\tfile: removeFile,\n\t\t\t})\n\t\t\tthis.govFiles.emit({\n\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\tfiles,\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\te.stopPropagation()\n\t}\n\n\t/**\n\t * Returns the reference of the native element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n\n\t/**\n\t * Returns the reference of the native area element\n\t */\n\t@Method()\n\tasync getAreaRef(): Promise<HTMLDivElement> {\n\t\treturn this.areaRef\n\t}\n\n\t/**\n\t * Remove all files from component state\n\t */\n\t@Method()\n\tasync reset(): Promise<void> {\n\t\tthis.files = []\n\t\tthis.inputRef.value = '';\n\t}\n}\n"]}
@@ -56,7 +56,7 @@ export class GovFormCheckboxGroup {
56
56
  });
57
57
  }
58
58
  render() {
59
- return (h(Host, { key: 'bd69f3bc458ab723d5de635bf593aa842eaa5dff', gap: this.gap, class: this.h.classes(FormGroupClass.root), value: this.value }, h("slot", { key: 'adaf1968dc50ebaed444552f498af1bd584ddea6' })));
59
+ return (h(Host, { key: '4db534d7f8775aaac6fecb7550037d0830763543', gap: this.gap, class: this.h.classes(FormGroupClass.root), value: this.value }, h("slot", { key: '836498262409058cdbb62066e482897ba0f0ec1c' })));
60
60
  }
61
61
  static get is() { return "gov-form-checkbox-group"; }
62
62
  static get originalStyleUrls() {
@@ -23,7 +23,7 @@ export class GovFormGroup {
23
23
  this.validateOrientation(this.orientation);
24
24
  }
25
25
  render() {
26
- return (h(Host, { key: 'ffaed68014e833458faab71b22f44cea5b0e62b0', gap: this.gap, class: this.h.classes(FormGroupClass.root) }, h("slot", { key: '445fb49f6d1d4982fbf37d44fc6b66b030d5de6a' })));
26
+ return (h(Host, { key: '6fd3c85b2114ff4eb9176cb12dd4ea60db5d205c', gap: this.gap, class: this.h.classes(FormGroupClass.root) }, h("slot", { key: 'f55fd159742c7b988fed38a8e425ec850443c0da' })));
27
27
  }
28
28
  static get is() { return "gov-form-group"; }
29
29
  static get properties() {
@@ -45,7 +45,7 @@ export class GovFormRadioGroup {
45
45
  });
46
46
  }
47
47
  render() {
48
- return (h(Host, { key: 'ef725ee01f3630ad410b5e4d20db8af95e7f4e21', gap: this.gap, class: this.h.classes(FormGroupClass.root), value: this.value }, h("slot", { key: '19237dcfaba358b88200027086ecad5e3917a6fb' })));
48
+ return (h(Host, { key: '73fa5685f9e9d6d7a55c8aa98a52134b6854cc38', gap: this.gap, class: this.h.classes(FormGroupClass.root), value: this.value }, h("slot", { key: '61f973d47a8c215aebff11a16c9a17fdb86210cf' })));
49
49
  }
50
50
  static get is() { return "gov-form-radio-group"; }
51
51
  static get originalStyleUrls() {
@@ -84,9 +84,9 @@ export class GovFormInput {
84
84
  }
85
85
  render() {
86
86
  const Tag = this.multiline ? Tags.TEXTAREA : Tags.INPUT;
87
- return (h(Host, { key: '8845cf9f05528f9f0d6406c57951a946bf0948e8', class: FormInputClass.root, size: this.size, type: this.type }, this.h.hasSlot("prefix") && h("slot", { key: '653ffd0d75243222bccdba1f16b9a35141cde25d', name: "prefix" }), h("span", { key: 'fee0c7cf371089fb4cb982c0cd4c4e255fab709c', class: "element" }, this.h.hasSlot("left-icon") && h("slot", { key: '4213ffac868698f292dde44c586a6575d66089a8', name: "left-icon" }), this.h.hasSlot("right-icon") && this.inputType !== 'password' && h("slot", { key: 'f75114749a810b0998c3a7b35edbda66b4de29f8', name: "right-icon" }), this.success && !this.multiline &&
88
- h("gov-icon", { key: '6cd13a7efd2df0c09a5a60960038f2f1dc392e35', slot: "validation-icon", class: "icon-validation", name: "check-lg" }), this.invalid && !this.multiline &&
89
- h("gov-icon", { key: 'b37db5aac85ded3bc53a185898d46235b675dd95', slot: "validation-icon", class: "icon-validation", name: "exclamation-lg" }), h(Tag, Object.assign({ key: '3ef5352821ef36d25146b43cec9b3f826088d0f1', type: this.inputType === 'password' && this.showPassword ? 'text' : this.inputType, disabled: this.disabled, id: this.identifier || this.inputId, name: this.name, onFocus: this.onFocusHandler.bind(this), onInput: this.onInputHandler.bind(this), onBlur: this.onBlurHandler.bind(this), onKeyUp: this.onKeyUpHandler.bind(this), onKeyDown: this.onKeyDownHandler.bind(this), ref: el => (this.inputRef = el), placeholder: this.placeholder, spellcheck: toBoolAttrIfDefined(this.spellcheck), lang: this.inputLang, readonly: toBoolAttrIfDefined(this.readonly), autocomplete: toOnOffAttrIfDefined(this.autocomplete), autocorrect: toOnOffAttrIfDefined(this.autocorrect), minlength: this.minlength, maxlength: this.maxlength, min: this.min, max: this.max, required: this.required, rows: this.rows, cols: this.cols, role: this.role, value: this.value }, this.inheritedAttributes, { "aria-required": toBoolAttrIfDefined(this.required), "aria-invalid": toBoolAttrIfDefined(this.invalid), "aria-disabled": toBoolAttrIfDefined(this.disabled) })), this.inputType === 'password' ? (h("gov-button", { color: 'primary', type: 'base', size: this.size, "aria-label": this.showPassword ? this.accessibleHidePasswordLabel : this.accessibleShowPasswordLabel, "on-gov-click": () => this.showPassword = !this.showPassword }, h("gov-icon", { slot: "left-icon", name: "eye", type: "basic" }))) : null), this.h.hasSlot("sufix") && h("slot", { key: '140b086664605e4b6ba88252a07681d7a89dbb95', name: "sufix" })));
87
+ return (h(Host, { key: '940cdf78dbeff2e66654d5b79ebe6c88cca4d767', class: FormInputClass.root, size: this.size, type: this.type }, this.h.hasSlot("prefix") && h("slot", { key: '68158bacaf2d4a63c9c5b87ab734b1aed58bc5c7', name: "prefix" }), h("span", { key: '9677512f5d6c3410443d2a9f958bdfda78ee590c', class: "element" }, this.h.hasSlot("left-icon") && h("slot", { key: 'ff9434b0680ba90e27578db2f2ffecdfd6e1a511', name: "left-icon" }), this.h.hasSlot("right-icon") && this.inputType !== 'password' && h("slot", { key: '92a3d61e8f92c0218e93a8e97ad15d0c532c9cd2', name: "right-icon" }), this.success && !this.multiline &&
88
+ h("gov-icon", { key: '822e179c3c97491ad64d95d54dc366e66f557ff1', slot: "validation-icon", class: "icon-validation", name: "check-lg" }), this.invalid && !this.multiline &&
89
+ h("gov-icon", { key: '7583571aef50ff442c529a882a9518b41e4d11b9', slot: "validation-icon", class: "icon-validation", name: "exclamation-lg" }), h(Tag, Object.assign({ key: 'bf1826c520a0f3032b51e8d069cdf3fe953c700e', type: this.inputType === 'password' && this.showPassword ? 'text' : this.inputType, disabled: this.disabled, id: this.identifier || this.inputId, name: this.name, onFocus: this.onFocusHandler.bind(this), onInput: this.onInputHandler.bind(this), onBlur: this.onBlurHandler.bind(this), onKeyUp: this.onKeyUpHandler.bind(this), onKeyDown: this.onKeyDownHandler.bind(this), ref: el => (this.inputRef = el), placeholder: this.placeholder, spellcheck: toBoolAttrIfDefined(this.spellcheck), lang: this.inputLang, readonly: toBoolAttrIfDefined(this.readonly), autocomplete: toOnOffAttrIfDefined(this.autocomplete), autocorrect: toOnOffAttrIfDefined(this.autocorrect), minlength: this.minlength, maxlength: this.maxlength, min: this.min, max: this.max, required: this.required, rows: this.rows, cols: this.cols, role: this.role, value: this.value }, this.inheritedAttributes, { "aria-required": toBoolAttrIfDefined(this.required), "aria-invalid": toBoolAttrIfDefined(this.invalid), "aria-disabled": toBoolAttrIfDefined(this.disabled) })), this.inputType === 'password' ? (h("gov-button", { color: 'primary', type: 'base', size: this.size, "aria-label": this.showPassword ? this.accessibleHidePasswordLabel : this.accessibleShowPasswordLabel, "on-gov-click": () => this.showPassword = !this.showPassword }, h("gov-icon", { slot: "left-icon", name: "eye", type: "basic" }))) : null), this.h.hasSlot("sufix") && h("slot", { key: '33b38abd971a46a31177035da5f8b42df16c09c2', name: "sufix" })));
90
90
  }
91
91
  onFocusHandler(e) {
92
92
  e.stopPropagation();
@@ -9,7 +9,7 @@ export class GovFormLabel {
9
9
  }
10
10
  render() {
11
11
  const Tag = this.legend ? 'legend' : 'label';
12
- return (h(Host, { key: '682f49b6cf73faa43772639cb7af8081f1309325', class: FormLabelClass.root, size: this.size }, h(Tag, { key: '568cec8ecbd6608debbb9ccaae2ae2de09f38fb1', class: FormLabelClass.label, htmlFor: this.identifier, onClick: () => this.govClick.emit() }, h("slot", { key: 'a976e327c5d0f3ff0aa1e81ba34a708ef0bc6773' }), this.required ? h("span", { class: "gov-color--error-500" }, "\u00A0*") : null)));
12
+ return (h(Host, { key: 'ac9d7c5fec0d4f4f84ee47eec6e0582db69c97b7', class: FormLabelClass.root, size: this.size }, h(Tag, { key: '65875d3fdf94ec2ec6d668f2c710754924e88a05', class: FormLabelClass.label, htmlFor: this.identifier, onClick: () => this.govClick.emit() }, h("slot", { key: 'f9c9b17037b93b01e2510fbf0bae1764660f20cc' }), this.required ? h("span", { class: "gov-color--error-500" }, "\u00A0*") : null)));
13
13
  }
14
14
  static get is() { return "gov-form-label"; }
15
15
  static get properties() {
@@ -17,7 +17,7 @@ export class GovFormMessage {
17
17
  this.validateColor(this.color);
18
18
  }
19
19
  render() {
20
- return (h(Host, { key: '09135220d0b8614009924a806e57d20637f286e7', class: this.h.classes(FormMessageClass.root), color: this.color, size: this.size }, this.h.hasSlot('icon') && (h("slot", { key: '9c456f49339b85a7939fcb87343d4eea8a66a1ef', name: "icon" })), h("span", { key: 'a9071b74d822ca3494a07c02dfab658169f1e3ff', id: this.messageId, class: FormMessageClass.content }, h("slot", { key: '63856a5af98a48e332ae8d0ba16ce3ccf933da54' }))));
20
+ return (h(Host, { key: '4fcfd955e1c76eb390db59b2894cd3b08ac47c1c', class: this.h.classes(FormMessageClass.root), color: this.color, size: this.size }, this.h.hasSlot('icon') && (h("slot", { key: '549c4073e26a05492212b546c92789bdf9f25575', name: "icon" })), h("span", { key: '9758bf8ce3f0c48ddca72b57eadc1f4e38da5d93', id: this.messageId, class: FormMessageClass.content }, h("slot", { key: '6e3be2fbc214c31be072fd09c81bbf5bf7c24564' }))));
21
21
  }
22
22
  /**
23
23
  * Returns unique identifier of message