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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (406) hide show
  1. package/dist/cjs/app-globals-V2Kpy_OQ.js.map +1 -1
  2. package/dist/cjs/core.cjs.js +1 -1
  3. package/dist/cjs/gov-banner.cjs.entry.js +3 -3
  4. package/dist/cjs/gov-banner.cjs.entry.js.map +1 -1
  5. package/dist/cjs/gov-banner.entry.cjs.js.map +1 -1
  6. package/dist/cjs/gov-flex_3.cjs.entry.js +1 -1
  7. package/dist/cjs/gov-form-autocomplete.cjs.entry.js +67 -23
  8. package/dist/cjs/gov-form-autocomplete.cjs.entry.js.map +1 -1
  9. package/dist/cjs/gov-form-autocomplete.entry.cjs.js.map +1 -1
  10. package/dist/cjs/gov-form-file.cjs.entry.js +65 -12
  11. package/dist/cjs/gov-form-file.cjs.entry.js.map +1 -1
  12. package/dist/cjs/gov-form-file.entry.cjs.js.map +1 -1
  13. package/dist/cjs/gov-form-search.cjs.entry.js +1 -1
  14. package/dist/cjs/gov-form-search.cjs.entry.js.map +1 -1
  15. package/dist/cjs/gov-form-search.entry.cjs.js.map +1 -1
  16. package/dist/cjs/gov-form-select.cjs.entry.js +8 -15
  17. package/dist/cjs/gov-form-select.cjs.entry.js.map +1 -1
  18. package/dist/cjs/gov-form-select.entry.cjs.js.map +1 -1
  19. package/dist/cjs/gov-tooltip.gov-tooltip-content.entry.cjs.js.map +1 -1
  20. package/dist/cjs/gov-tooltip_2.cjs.entry.js +34 -9
  21. package/dist/cjs/gov-tooltip_2.cjs.entry.js.map +1 -1
  22. package/dist/cjs/gov-wizard-item.cjs.entry.js +2 -2
  23. package/dist/cjs/gov-wizard.cjs.entry.js +1 -1
  24. package/dist/cjs/index-BEF5cZxd.js +4 -4
  25. package/dist/cjs/loader.cjs.js +1 -1
  26. package/dist/collection/components/gov-banner/gov-banner.js +4 -4
  27. package/dist/collection/components/gov-banner/gov-banner.js.map +1 -1
  28. package/dist/collection/components/gov-form/autocomplete/autocomplete.utils.js +14 -0
  29. package/dist/collection/components/gov-form/autocomplete/autocomplete.utils.js.map +1 -0
  30. package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js +76 -22
  31. package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js.map +1 -1
  32. package/dist/collection/components/gov-form/file/gov-form-file.js +39 -3
  33. package/dist/collection/components/gov-form/file/gov-form-file.js.map +1 -1
  34. package/dist/collection/components/gov-form/search/gov-form-search.js +2 -2
  35. package/dist/collection/components/gov-form/search/gov-form-search.js.map +1 -1
  36. package/dist/collection/components/gov-form/select/gov-form-select.js +8 -15
  37. package/dist/collection/components/gov-form/select/gov-form-select.js.map +1 -1
  38. package/dist/collection/components/gov-tooltip/gov-tooltip-content.js +22 -1
  39. package/dist/collection/components/gov-tooltip/gov-tooltip-content.js.map +1 -1
  40. package/dist/collection/components/gov-tooltip/gov-tooltip.js +31 -8
  41. package/dist/collection/components/gov-tooltip/gov-tooltip.js.map +1 -1
  42. package/dist/collection/components/gov-wizard/gov-wizard-item.js +2 -2
  43. package/dist/collection/components/gov-wizard/gov-wizard.js +1 -1
  44. package/dist/collection/utils/file.utils.js +28 -9
  45. package/dist/collection/utils/file.utils.js.map +1 -1
  46. package/dist/components/gov-accordion-item.js +1 -1
  47. package/dist/components/gov-accordion.js +1 -1
  48. package/dist/components/gov-attachments-item.js +1 -1
  49. package/dist/components/gov-attachments.js +1 -1
  50. package/dist/components/gov-backdrop.js +1 -1
  51. package/dist/components/gov-banner.js +1 -1
  52. package/dist/components/gov-banner.js.map +1 -1
  53. package/dist/components/gov-blockquote.js +1 -1
  54. package/dist/components/gov-breadcrumbs.js +1 -1
  55. package/dist/components/gov-button.js +1 -1
  56. package/dist/components/gov-card.js +1 -1
  57. package/dist/components/gov-chip.js +1 -1
  58. package/dist/components/gov-collapsible.js +1 -1
  59. package/dist/components/gov-collapsible.js.map +1 -1
  60. package/dist/components/gov-container.js +1 -1
  61. package/dist/components/gov-control-group.js +1 -1
  62. package/dist/components/gov-cookiebar.js +1 -1
  63. package/dist/components/gov-dialog.js +1 -1
  64. package/dist/components/gov-dropdown.js +1 -1
  65. package/dist/components/gov-empty.js +1 -1
  66. package/dist/components/gov-error-code.js +1 -1
  67. package/dist/components/gov-flex.js +1 -1
  68. package/dist/components/gov-form-autocomplete.js +1 -1
  69. package/dist/components/gov-form-checkbox-group.js +1 -1
  70. package/dist/components/gov-form-checkbox.js +1 -1
  71. package/dist/components/gov-form-control.js +1 -1
  72. package/dist/components/gov-form-file.js +1 -1
  73. package/dist/components/gov-form-file.js.map +1 -1
  74. package/dist/components/gov-form-group.js +1 -1
  75. package/dist/components/gov-form-input.js +1 -1
  76. package/dist/components/gov-form-message.js +1 -1
  77. package/dist/components/gov-form-multi-select.js +1 -1
  78. package/dist/components/gov-form-multi-select.js.map +1 -1
  79. package/dist/components/gov-form-radio-group.js +1 -1
  80. package/dist/components/gov-form-radio.js +1 -1
  81. package/dist/components/gov-form-range.js +1 -1
  82. package/dist/components/gov-form-range.js.map +1 -1
  83. package/dist/components/gov-form-search.js +1 -1
  84. package/dist/components/gov-form-search.js.map +1 -1
  85. package/dist/components/gov-form-select.js +1 -1
  86. package/dist/components/gov-form-switch.js +1 -1
  87. package/dist/components/gov-grid-item.js +1 -1
  88. package/dist/components/gov-grid.js +1 -1
  89. package/dist/components/gov-icon.js +1 -1
  90. package/dist/components/gov-infobar.js +1 -1
  91. package/dist/components/gov-layout-column.js +1 -1
  92. package/dist/components/gov-layout.js +1 -1
  93. package/dist/components/gov-link.js +1 -1
  94. package/dist/components/gov-loading.js +1 -1
  95. package/dist/components/gov-message.js +1 -1
  96. package/dist/components/gov-pagination.js +1 -1
  97. package/dist/components/gov-skeleton.js +1 -1
  98. package/dist/components/gov-spacer.js +1 -1
  99. package/dist/components/gov-stepper-item.js +1 -1
  100. package/dist/components/gov-stepper.js +1 -1
  101. package/dist/components/gov-tabs-item.js +1 -1
  102. package/dist/components/gov-tabs.js +1 -1
  103. package/dist/components/gov-tag.js +1 -1
  104. package/dist/components/gov-theme-switch.js +1 -1
  105. package/dist/components/gov-tile.js +1 -1
  106. package/dist/components/gov-toast.js +1 -1
  107. package/dist/components/gov-tooltip-content.js +1 -1
  108. package/dist/components/gov-tooltip.js +1 -1
  109. package/dist/components/gov-wizard-item.js +1 -1
  110. package/dist/components/gov-wizard.js +1 -1
  111. package/dist/components/{p-BZTY3MxF.js → p-BGK46VRO.js} +2 -2
  112. package/dist/components/{p-DKo9A5gq.js → p-BHRF-5cf.js} +2 -2
  113. package/dist/components/{p-DesycS6d.js → p-BICk4EuO.js} +2 -2
  114. package/dist/components/{p-Bv5L0j6n.js → p-BNoNH6m-.js} +2 -2
  115. package/dist/components/{p-9imLQpxb.js → p-BSr8e18S.js} +2 -2
  116. package/dist/components/{p-BNnuBQvo.js → p-BxS4InzB.js} +2 -2
  117. package/dist/components/{p-CfaJM4SA.js → p-CMmyR4-k.js} +2 -2
  118. package/dist/components/{p-B0KFtEn3.js → p-CU0plGZP.js} +2 -2
  119. package/dist/components/{p-djqfSbq-.js → p-ClDhNt_H.js} +2 -2
  120. package/dist/components/{p-yqJEurSE.js → p-CnKqUwf9.js} +2 -2
  121. package/dist/components/p-DRXiDAHW.js +2 -0
  122. package/dist/components/{p-BrdXh0mI.js.map → p-DRXiDAHW.js.map} +1 -1
  123. package/dist/components/p-DjGO_trZ.js +2 -0
  124. package/dist/components/p-DjGO_trZ.js.map +1 -0
  125. package/dist/components/p-DmK9qaKH.js +2 -0
  126. package/dist/components/p-DmK9qaKH.js.map +1 -0
  127. package/dist/components/p-isPjiQbr.js +2 -0
  128. package/dist/components/p-isPjiQbr.js.map +1 -0
  129. package/dist/components/p-keC6luw7.js +2 -0
  130. package/dist/components/p-keC6luw7.js.map +1 -0
  131. package/dist/core/core.esm.js +1 -1
  132. package/dist/core/core.esm.js.map +1 -1
  133. package/dist/core/{p-3314505d.entry.js → p-00ab0454.entry.js} +2 -2
  134. package/dist/core/{p-3314505d.entry.js.map → p-00ab0454.entry.js.map} +1 -1
  135. package/dist/core/{p-9d9e9401.entry.js → p-05bb35e1.entry.js} +2 -2
  136. package/dist/core/{p-9d9e9401.entry.js.map → p-05bb35e1.entry.js.map} +1 -1
  137. package/dist/core/{p-e30968b3.entry.js → p-06497d64.entry.js} +2 -2
  138. package/dist/core/{p-e30968b3.entry.js.map → p-06497d64.entry.js.map} +1 -1
  139. package/dist/core/p-0675617d.entry.js +2 -0
  140. package/dist/core/{p-fca7a0d6.entry.js.map → p-0675617d.entry.js.map} +1 -1
  141. package/dist/core/{p-4d36cd18.entry.js → p-2493a7f3.entry.js} +2 -2
  142. package/dist/core/{p-4d36cd18.entry.js.map → p-2493a7f3.entry.js.map} +1 -1
  143. package/dist/core/p-2e15a654.entry.js +2 -0
  144. package/dist/core/{p-bd2df430.entry.js.map → p-2e15a654.entry.js.map} +1 -1
  145. package/dist/core/{p-1626cc67.entry.js → p-30ad7514.entry.js} +2 -2
  146. package/dist/core/{p-1626cc67.entry.js.map → p-30ad7514.entry.js.map} +1 -1
  147. package/dist/core/{p-558e75a6.entry.js → p-378cf8de.entry.js} +2 -2
  148. package/dist/core/{p-558e75a6.entry.js.map → p-378cf8de.entry.js.map} +1 -1
  149. package/dist/core/{p-be9af807.entry.js → p-3a4799b3.entry.js} +2 -2
  150. package/dist/core/{p-be9af807.entry.js.map → p-3a4799b3.entry.js.map} +1 -1
  151. package/dist/core/{p-f7bdb44a.entry.js → p-3ebbe75a.entry.js} +2 -2
  152. package/dist/core/{p-f7bdb44a.entry.js.map → p-3ebbe75a.entry.js.map} +1 -1
  153. package/dist/core/p-41bef63a.entry.js +2 -0
  154. package/dist/core/{p-469f14db.entry.js.map → p-41bef63a.entry.js.map} +1 -1
  155. package/dist/core/p-4342c252.entry.js +2 -0
  156. package/dist/core/p-4342c252.entry.js.map +1 -0
  157. package/dist/core/{p-c1b9f1ab.entry.js → p-473afd7d.entry.js} +2 -2
  158. package/dist/core/{p-c1b9f1ab.entry.js.map → p-473afd7d.entry.js.map} +1 -1
  159. package/dist/core/{p-5721cf9b.entry.js → p-48b74272.entry.js} +2 -2
  160. package/dist/core/{p-5721cf9b.entry.js.map → p-48b74272.entry.js.map} +1 -1
  161. package/dist/core/{p-04ec45ab.entry.js → p-49b67f59.entry.js} +2 -2
  162. package/dist/core/{p-04ec45ab.entry.js.map → p-49b67f59.entry.js.map} +1 -1
  163. package/dist/core/{p-6b44890d.entry.js → p-4bd3f101.entry.js} +2 -2
  164. package/dist/core/{p-6b44890d.entry.js.map → p-4bd3f101.entry.js.map} +1 -1
  165. package/dist/core/{p-157a1636.entry.js → p-4e534d68.entry.js} +2 -2
  166. package/dist/core/{p-157a1636.entry.js.map → p-4e534d68.entry.js.map} +1 -1
  167. package/dist/core/p-6638d034.entry.js +2 -0
  168. package/dist/core/{p-73bd93f9.entry.js.map → p-6638d034.entry.js.map} +1 -1
  169. package/dist/core/{p-46824842.entry.js → p-68a5d225.entry.js} +2 -2
  170. package/dist/core/{p-46824842.entry.js.map → p-68a5d225.entry.js.map} +1 -1
  171. package/dist/core/p-6ac9b0f2.entry.js +2 -0
  172. package/dist/core/p-6ac9b0f2.entry.js.map +1 -0
  173. package/dist/core/{p-0af96cc0.entry.js → p-6b0625ee.entry.js} +2 -2
  174. package/dist/core/{p-0af96cc0.entry.js.map → p-6b0625ee.entry.js.map} +1 -1
  175. package/dist/core/{p-4d365881.entry.js → p-78202a44.entry.js} +2 -2
  176. package/dist/core/{p-4d365881.entry.js.map → p-78202a44.entry.js.map} +1 -1
  177. package/dist/core/{p-eb766437.entry.js → p-80052953.entry.js} +2 -2
  178. package/dist/core/{p-eb766437.entry.js.map → p-80052953.entry.js.map} +1 -1
  179. package/dist/core/{p-d43959a0.entry.js → p-8ddb6dc6.entry.js} +2 -2
  180. package/dist/core/{p-d43959a0.entry.js.map → p-8ddb6dc6.entry.js.map} +1 -1
  181. package/dist/core/{p-d9c574f0.entry.js → p-90cc2ddb.entry.js} +2 -2
  182. package/dist/core/{p-d9c574f0.entry.js.map → p-90cc2ddb.entry.js.map} +1 -1
  183. package/dist/core/{p-f3887d6d.entry.js → p-91d5df66.entry.js} +2 -2
  184. package/dist/core/{p-f3887d6d.entry.js.map → p-91d5df66.entry.js.map} +1 -1
  185. package/dist/core/{p-187c0eda.entry.js → p-9321fb9d.entry.js} +2 -2
  186. package/dist/core/{p-187c0eda.entry.js.map → p-9321fb9d.entry.js.map} +1 -1
  187. package/dist/core/p-943a58b2.entry.js +2 -0
  188. package/dist/core/{p-33209782.entry.js.map → p-943a58b2.entry.js.map} +1 -1
  189. package/dist/core/p-B6CqPcY_.js.map +1 -1
  190. package/dist/core/p-B8TR1oqt.js +3 -0
  191. package/dist/core/p-B8TR1oqt.js.map +1 -0
  192. package/dist/core/p-BUmDydor.js.map +1 -1
  193. package/dist/core/p-BcQO4NH2.js.map +1 -1
  194. package/dist/core/p-BjcqOprh.js.map +1 -1
  195. package/dist/core/p-Bo1ROm5Q.js.map +1 -1
  196. package/dist/core/p-Bz_RzYFb.js.map +1 -1
  197. package/dist/core/p-C3R1T_pg.js.map +1 -1
  198. package/dist/core/p-C6JN9gdb.js.map +1 -1
  199. package/dist/core/p-CDIRBJsi.js.map +1 -1
  200. package/dist/core/p-CQvUntGY.js.map +1 -1
  201. package/dist/core/p-Ccwpa1ck.js.map +1 -1
  202. package/dist/core/p-CgDnDrq5.js.map +1 -1
  203. package/dist/core/p-Cjg0wpDG.js.map +1 -1
  204. package/dist/core/p-CoD1xawt.js.map +1 -1
  205. package/dist/core/p-Cx3bEC5v.js.map +1 -1
  206. package/dist/core/p-D4TGB274.js.map +1 -1
  207. package/dist/core/p-DBXGhafv.js.map +1 -1
  208. package/dist/core/p-DNztiAH0.js.map +1 -1
  209. package/dist/core/p-DQuL1Twl.js.map +1 -1
  210. package/dist/core/p-DYcNEwSZ.js.map +1 -1
  211. package/dist/core/p-EeKNA85D.js.map +1 -1
  212. package/dist/core/p-GYov8gU1.js.map +1 -1
  213. package/dist/core/p-NOJjz9dT.js.map +1 -1
  214. package/dist/core/p-Q99QrOoi.js.map +1 -1
  215. package/dist/core/p-U40vKHrs.js.map +1 -1
  216. package/dist/core/p-a4fa2ffc.entry.js +2 -0
  217. package/dist/core/{p-c4734357.entry.js.map → p-a4fa2ffc.entry.js.map} +1 -1
  218. package/dist/core/{p-511eed88.entry.js → p-a6f27583.entry.js} +2 -2
  219. package/dist/core/{p-511eed88.entry.js.map → p-a6f27583.entry.js.map} +1 -1
  220. package/dist/core/p-a7c322a7.entry.js +2 -0
  221. package/dist/core/{p-abb7780e.entry.js.map → p-a7c322a7.entry.js.map} +1 -1
  222. package/dist/core/{p-6d2ce4c7.entry.js → p-ab367b0c.entry.js} +2 -2
  223. package/dist/core/{p-6d2ce4c7.entry.js.map → p-ab367b0c.entry.js.map} +1 -1
  224. package/dist/core/{p-c6b55c0a.entry.js → p-ac81cdf6.entry.js} +2 -2
  225. package/dist/core/{p-c6b55c0a.entry.js.map → p-ac81cdf6.entry.js.map} +1 -1
  226. package/dist/core/{p-a2c61d50.entry.js → p-ad9227b3.entry.js} +2 -2
  227. package/dist/core/{p-a2c61d50.entry.js.map → p-ad9227b3.entry.js.map} +1 -1
  228. package/dist/core/p-af2bd9d3.entry.js +2 -0
  229. package/dist/core/p-af2bd9d3.entry.js.map +1 -0
  230. package/dist/core/{p-70b5555f.entry.js → p-b0d4d6bd.entry.js} +2 -2
  231. package/dist/core/{p-70b5555f.entry.js.map → p-b0d4d6bd.entry.js.map} +1 -1
  232. package/dist/core/p-b181f85f.entry.js +2 -0
  233. package/dist/core/{p-57ca8ac7.entry.js.map → p-b181f85f.entry.js.map} +1 -1
  234. package/dist/core/{p-5305e82e.entry.js → p-b2648255.entry.js} +2 -2
  235. package/dist/core/{p-5305e82e.entry.js.map → p-b2648255.entry.js.map} +1 -1
  236. package/dist/core/{p-65a09763.entry.js → p-b37bd421.entry.js} +2 -2
  237. package/dist/core/{p-65a09763.entry.js.map → p-b37bd421.entry.js.map} +1 -1
  238. package/dist/core/{p-91cbee1b.entry.js → p-b5e40f40.entry.js} +2 -2
  239. package/dist/core/{p-91cbee1b.entry.js.map → p-b5e40f40.entry.js.map} +1 -1
  240. package/dist/core/p-b77c283e.entry.js +2 -0
  241. package/dist/core/{p-bd389bfd.entry.js.map → p-b77c283e.entry.js.map} +1 -1
  242. package/dist/core/p-bb5b9ccd.entry.js +2 -0
  243. package/dist/core/p-bb5b9ccd.entry.js.map +1 -0
  244. package/dist/core/{p-4c02094d.entry.js → p-c9b2f97c.entry.js} +2 -2
  245. package/dist/core/{p-4c02094d.entry.js.map → p-c9b2f97c.entry.js.map} +1 -1
  246. package/dist/core/{p-eb3f6808.entry.js → p-caf817d4.entry.js} +2 -2
  247. package/dist/core/{p-eb3f6808.entry.js.map → p-caf817d4.entry.js.map} +1 -1
  248. package/dist/core/p-dc0bd1e5.entry.js +2 -0
  249. package/dist/core/{p-3e07bf07.entry.js.map → p-dc0bd1e5.entry.js.map} +1 -1
  250. package/dist/core/{p-db860031.entry.js → p-dd390459.entry.js} +2 -2
  251. package/dist/core/{p-db860031.entry.js.map → p-dd390459.entry.js.map} +1 -1
  252. package/dist/core/p-de5dfd70.entry.js +2 -0
  253. package/dist/core/{p-4da8ac1d.entry.js.map → p-de5dfd70.entry.js.map} +1 -1
  254. package/dist/core/p-dfb76a14.entry.js +2 -0
  255. package/dist/core/p-dfb76a14.entry.js.map +1 -0
  256. package/dist/core/{p-cd163299.entry.js → p-e17def2b.entry.js} +2 -2
  257. package/dist/core/{p-cd163299.entry.js.map → p-e17def2b.entry.js.map} +1 -1
  258. package/dist/core/{p-e39e5dc7.entry.js → p-e1d58751.entry.js} +2 -2
  259. package/dist/core/{p-e39e5dc7.entry.js.map → p-e1d58751.entry.js.map} +1 -1
  260. package/dist/core/{p-3e07bf07.entry.js → p-e913cfc8.entry.js} +2 -2
  261. package/dist/core/{p-90ab65b4.entry.js.map → p-e913cfc8.entry.js.map} +1 -1
  262. package/dist/core/{p-da997fb3.entry.js → p-ea299832.entry.js} +2 -2
  263. package/dist/core/{p-da997fb3.entry.js.map → p-ea299832.entry.js.map} +1 -1
  264. package/dist/core/{p-852310d9.entry.js → p-eff8ffff.entry.js} +2 -2
  265. package/dist/core/{p-852310d9.entry.js.map → p-eff8ffff.entry.js.map} +1 -1
  266. package/dist/core/{p-4d902f20.entry.js → p-f2d24551.entry.js} +2 -2
  267. package/dist/core/{p-4d902f20.entry.js.map → p-f2d24551.entry.js.map} +1 -1
  268. package/dist/core/{p-5c872d64.entry.js → p-f515d912.entry.js} +2 -2
  269. package/dist/core/{p-bf573a56.entry.js → p-febff4d1.entry.js} +2 -2
  270. package/dist/core/{p-bf573a56.entry.js.map → p-febff4d1.entry.js.map} +1 -1
  271. package/dist/core/p-vN03FcXN.js.map +1 -1
  272. package/dist/esm/app-globals-DQuL1Twl.js.map +1 -1
  273. package/dist/esm/core.js +1 -1
  274. package/dist/esm/gov-banner.entry.js +3 -3
  275. package/dist/esm/gov-banner.entry.js.map +1 -1
  276. package/dist/esm/gov-flex_3.entry.js +1 -1
  277. package/dist/esm/gov-form-autocomplete.entry.js +68 -24
  278. package/dist/esm/gov-form-autocomplete.entry.js.map +1 -1
  279. package/dist/esm/gov-form-file.entry.js +65 -12
  280. package/dist/esm/gov-form-file.entry.js.map +1 -1
  281. package/dist/esm/gov-form-search.entry.js +1 -1
  282. package/dist/esm/gov-form-search.entry.js.map +1 -1
  283. package/dist/esm/gov-form-select.entry.js +8 -15
  284. package/dist/esm/gov-form-select.entry.js.map +1 -1
  285. package/dist/esm/gov-tooltip.gov-tooltip-content.entry.js.map +1 -1
  286. package/dist/esm/gov-tooltip_2.entry.js +34 -9
  287. package/dist/esm/gov-tooltip_2.entry.js.map +1 -1
  288. package/dist/esm/gov-wizard-item.entry.js +2 -2
  289. package/dist/esm/gov-wizard.entry.js +1 -1
  290. package/dist/esm/index-ClISz4NF.js +4 -4
  291. package/dist/esm/loader.js +1 -1
  292. package/dist/hydrate/index.js +187 -69
  293. package/dist/hydrate/index.mjs +187 -69
  294. package/dist/types/Users/jf/dev/designSystem/gov-design-system/packages/core/.stencil/packages/core/stencil.config.d.ts +2 -0
  295. package/dist/types/components/gov-form/autocomplete/autocomplete.utils.d.ts +2 -0
  296. package/dist/types/components/gov-form/autocomplete/gov-form-autocomplete.d.ts +9 -0
  297. package/dist/types/components/gov-form/file/gov-form-file.d.ts +1 -0
  298. package/dist/types/components/gov-form/select/gov-form-select.d.ts +1 -1
  299. package/dist/types/components/gov-tooltip/gov-tooltip-content.d.ts +4 -0
  300. package/dist/types/components/gov-tooltip/gov-tooltip.d.ts +3 -0
  301. package/dist/types/components.d.ts +612 -121
  302. package/dist/types/stencil-public-runtime.d.ts +170 -11
  303. package/package.json +32 -28
  304. package/readme.md +8 -0
  305. package/dist/components/p-BrdXh0mI.js +0 -2
  306. package/dist/components/p-DFu5UVoP.js +0 -2
  307. package/dist/components/p-DFu5UVoP.js.map +0 -1
  308. package/dist/components/p-DMVQRz4f.js +0 -2
  309. package/dist/components/p-DMVQRz4f.js.map +0 -1
  310. package/dist/components/p-UDT3DloZ.js +0 -2
  311. package/dist/components/p-UDT3DloZ.js.map +0 -1
  312. package/dist/components/p-x3w8Mun_.js +0 -2
  313. package/dist/components/p-x3w8Mun_.js.map +0 -1
  314. package/dist/core/core.css +0 -14776
  315. package/dist/core/gov-accordion-item.entry.esm.js.map +0 -1
  316. package/dist/core/gov-accordion.entry.esm.js.map +0 -1
  317. package/dist/core/gov-attachments.gov-attachments-item.gov-form-message.entry.esm.js.map +0 -1
  318. package/dist/core/gov-backdrop.entry.esm.js.map +0 -1
  319. package/dist/core/gov-banner.entry.esm.js.map +0 -1
  320. package/dist/core/gov-blockquote.entry.esm.js.map +0 -1
  321. package/dist/core/gov-breadcrumbs.entry.esm.js.map +0 -1
  322. package/dist/core/gov-button.entry.esm.js.map +0 -1
  323. package/dist/core/gov-card.entry.esm.js.map +0 -1
  324. package/dist/core/gov-chip.entry.esm.js.map +0 -1
  325. package/dist/core/gov-collapsible.entry.esm.js.map +0 -1
  326. package/dist/core/gov-container.entry.esm.js.map +0 -1
  327. package/dist/core/gov-control-group.entry.esm.js.map +0 -1
  328. package/dist/core/gov-cookiebar.entry.esm.js.map +0 -1
  329. package/dist/core/gov-dialog.entry.esm.js.map +0 -1
  330. package/dist/core/gov-dropdown.entry.esm.js.map +0 -1
  331. package/dist/core/gov-empty.entry.esm.js.map +0 -1
  332. package/dist/core/gov-error-code.entry.esm.js.map +0 -1
  333. package/dist/core/gov-flex.gov-icon.gov-theme-switch.entry.esm.js.map +0 -1
  334. package/dist/core/gov-form-autocomplete.entry.esm.js.map +0 -1
  335. package/dist/core/gov-form-checkbox-group.entry.esm.js.map +0 -1
  336. package/dist/core/gov-form-checkbox.entry.esm.js.map +0 -1
  337. package/dist/core/gov-form-control.entry.esm.js.map +0 -1
  338. package/dist/core/gov-form-file.entry.esm.js.map +0 -1
  339. package/dist/core/gov-form-group.entry.esm.js.map +0 -1
  340. package/dist/core/gov-form-input.gov-skeleton.entry.esm.js.map +0 -1
  341. package/dist/core/gov-form-label.entry.esm.js.map +0 -1
  342. package/dist/core/gov-form-multi-select.entry.esm.js.map +0 -1
  343. package/dist/core/gov-form-password-power.entry.esm.js.map +0 -1
  344. package/dist/core/gov-form-radio-group.entry.esm.js.map +0 -1
  345. package/dist/core/gov-form-radio.entry.esm.js.map +0 -1
  346. package/dist/core/gov-form-range.entry.esm.js.map +0 -1
  347. package/dist/core/gov-form-search.entry.esm.js.map +0 -1
  348. package/dist/core/gov-form-select.entry.esm.js.map +0 -1
  349. package/dist/core/gov-form-switch.entry.esm.js.map +0 -1
  350. package/dist/core/gov-grid-item.entry.esm.js.map +0 -1
  351. package/dist/core/gov-grid.entry.esm.js.map +0 -1
  352. package/dist/core/gov-infobar.entry.esm.js.map +0 -1
  353. package/dist/core/gov-layout-column.entry.esm.js.map +0 -1
  354. package/dist/core/gov-layout.entry.esm.js.map +0 -1
  355. package/dist/core/gov-lifecycle.entry.esm.js.map +0 -1
  356. package/dist/core/gov-link.entry.esm.js.map +0 -1
  357. package/dist/core/gov-loading.entry.esm.js.map +0 -1
  358. package/dist/core/gov-message.entry.esm.js.map +0 -1
  359. package/dist/core/gov-pagination.entry.esm.js.map +0 -1
  360. package/dist/core/gov-spacer.entry.esm.js.map +0 -1
  361. package/dist/core/gov-stepper-item.entry.esm.js.map +0 -1
  362. package/dist/core/gov-stepper.entry.esm.js.map +0 -1
  363. package/dist/core/gov-tabs-item.entry.esm.js.map +0 -1
  364. package/dist/core/gov-tabs.entry.esm.js.map +0 -1
  365. package/dist/core/gov-tag.entry.esm.js.map +0 -1
  366. package/dist/core/gov-tile.entry.esm.js.map +0 -1
  367. package/dist/core/gov-toast.entry.esm.js.map +0 -1
  368. package/dist/core/gov-tooltip.gov-tooltip-content.entry.esm.js.map +0 -1
  369. package/dist/core/gov-wizard-item.entry.esm.js.map +0 -1
  370. package/dist/core/gov-wizard.entry.esm.js.map +0 -1
  371. package/dist/core/loader.esm.js.map +0 -1
  372. package/dist/core/p-11fc3899.entry.js +0 -2
  373. package/dist/core/p-11fc3899.entry.js.map +0 -1
  374. package/dist/core/p-33209782.entry.js +0 -2
  375. package/dist/core/p-33b462c9.entry.js +0 -2
  376. package/dist/core/p-33b462c9.entry.js.map +0 -1
  377. package/dist/core/p-3e5ae012.entry.js +0 -2
  378. package/dist/core/p-3e5ae012.entry.js.map +0 -1
  379. package/dist/core/p-469f14db.entry.js +0 -2
  380. package/dist/core/p-4da8ac1d.entry.js +0 -2
  381. package/dist/core/p-57ca8ac7.entry.js +0 -2
  382. package/dist/core/p-73bd93f9.entry.js +0 -2
  383. package/dist/core/p-90ab65b4.entry.js +0 -2
  384. package/dist/core/p-ClISz4NF.js +0 -3
  385. package/dist/core/p-ClISz4NF.js.map +0 -1
  386. package/dist/core/p-abb7780e.entry.js +0 -2
  387. package/dist/core/p-bd2df430.entry.js +0 -2
  388. package/dist/core/p-bd389bfd.entry.js +0 -2
  389. package/dist/core/p-c21bc8f9.entry.js +0 -2
  390. package/dist/core/p-c21bc8f9.entry.js.map +0 -1
  391. package/dist/core/p-c4734357.entry.js +0 -2
  392. package/dist/core/p-def34832.entry.js +0 -2
  393. package/dist/core/p-def34832.entry.js.map +0 -1
  394. package/dist/core/p-fca7a0d6.entry.js +0 -2
  395. package/dist/types/work/packages/core/.stencil/packages/core/stencil.config.d.ts +0 -2
  396. /package/dist/components/{p-BZTY3MxF.js.map → p-BGK46VRO.js.map} +0 -0
  397. /package/dist/components/{p-DKo9A5gq.js.map → p-BHRF-5cf.js.map} +0 -0
  398. /package/dist/components/{p-DesycS6d.js.map → p-BICk4EuO.js.map} +0 -0
  399. /package/dist/components/{p-Bv5L0j6n.js.map → p-BNoNH6m-.js.map} +0 -0
  400. /package/dist/components/{p-9imLQpxb.js.map → p-BSr8e18S.js.map} +0 -0
  401. /package/dist/components/{p-BNnuBQvo.js.map → p-BxS4InzB.js.map} +0 -0
  402. /package/dist/components/{p-CfaJM4SA.js.map → p-CMmyR4-k.js.map} +0 -0
  403. /package/dist/components/{p-B0KFtEn3.js.map → p-CU0plGZP.js.map} +0 -0
  404. /package/dist/components/{p-djqfSbq-.js.map → p-ClDhNt_H.js.map} +0 -0
  405. /package/dist/components/{p-yqJEurSE.js.map → p-CnKqUwf9.js.map} +0 -0
  406. /package/dist/core/{p-5c872d64.entry.js.map → p-f515d912.entry.js.map} +0 -0
@@ -27,18 +27,37 @@ function formatBytes(bytes) {
27
27
  }
28
28
  return n.toFixed(n < 10 && l > 0 ? 1 : 0) + ' ' + units[l];
29
29
  }
30
+ // Validates a file against an `accept` attribute value, following the HTML spec
31
+ // (https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept):
32
+ // - ".ext" → matched against the file NAME suffix (case-insensitive)
33
+ // - "type/*" → matched against the file MIME group
34
+ // - "type/sub" → exact MIME match
35
+ // Matching the name (not only file.type) is essential: browsers often report an
36
+ // empty or non-standard MIME for extensions like .jsonld, which the previous
37
+ // MIME-only RegExp check always rejected.
30
38
  function fileAcceptValidation(file, accept) {
31
- if (typeof accept === 'string' && accept.length) {
32
- return (accept
33
- .replace(/\s/g, '')
34
- .split(',')
35
- .filter(accept => {
36
- return new RegExp(accept.replace('*', '.*')).test(file.type);
37
- }).length > 0);
38
- }
39
- else {
39
+ if (typeof accept !== 'string' || accept.trim().length === 0) {
40
40
  return true;
41
41
  }
42
+ const fileName = file.name.toLowerCase();
43
+ const fileType = (file.type || '').toLowerCase();
44
+ return accept
45
+ .split(',')
46
+ .map(token => token.trim().toLowerCase())
47
+ .filter(token => token.length > 0)
48
+ .some(token => {
49
+ if (token.startsWith('.')) {
50
+ return fileName.endsWith(token);
51
+ }
52
+ if (token === '*' || token === '*/*') {
53
+ return true;
54
+ }
55
+ if (token.endsWith('/*')) {
56
+ const group = token.slice(0, token.indexOf('/') + 1);
57
+ return fileType.startsWith(group);
58
+ }
59
+ return fileType === token;
60
+ });
42
61
  }
43
62
  function fileSizeValidation(file, maxSize) {
44
63
  const fileSize = Math.round(file.size);
@@ -159,7 +178,15 @@ const GovFormFile = class {
159
178
  }
160
179
  validateFiles(files) {
161
180
  let filesBuffer = [];
162
- Array.from(files).map(file => {
181
+ // Without `multiple`, only a single file is allowed. An incoming batch
182
+ // (drag-drop, framework wrapper, programmatic assignment) can still carry
183
+ // several files, so cap it to the last one — consistent with the
184
+ // "second pick replaces the first" semantics. (Bug #30570313)
185
+ const incoming = this.multiple ? Array.from(files) : Array.from(files).slice(-1);
186
+ if (!this.multiple && this.displayAttachments) {
187
+ this.files = [];
188
+ }
189
+ incoming.forEach(file => {
163
190
  const isFile = this.files.find(item => item.file.name === file.name && item.file.size === file.size) || null;
164
191
  if (isFile === null || this.ignoreFileDuplicationCheck) {
165
192
  const isSizeValid = typeof this.maxFileSize === "number" && this.maxFileSize > 0 ? fileSizeValidation(file, this.maxFileSize) : true;
@@ -182,6 +209,9 @@ const GovFormFile = class {
182
209
  });
183
210
  }
184
211
  });
212
+ if (this.displayAttachments) {
213
+ this.syncNativeInputFiles();
214
+ }
185
215
  this.govFiles.emit({
186
216
  component: FormFileClass.root,
187
217
  files: filesBuffer.length ? filesBuffer : this.files,
@@ -190,6 +220,25 @@ const GovFormFile = class {
190
220
  this.reset().finally();
191
221
  }
192
222
  }
223
+ // Keep native <input type="file"> in sync with the visible attachments list so
224
+ // that a native form submit / FormData carries exactly the files shown in the UI.
225
+ // Invalid items (wrong type or oversize) are intentionally excluded.
226
+ syncNativeInputFiles() {
227
+ if (!this.inputRef || typeof DataTransfer === "undefined") {
228
+ return;
229
+ }
230
+ try {
231
+ const dt = new DataTransfer();
232
+ this.files
233
+ .filter(item => item.acceptValid === true && item.sizeValid === true)
234
+ .forEach(item => dt.items.add(item.file));
235
+ this.inputRef.files = dt.files;
236
+ }
237
+ catch (e) {
238
+ // Safari < 14.1 / older browsers may reject assigning to .files; nothing safe to fall back to.
239
+ if (typeof process !== "undefined" && process.env && "production" !== "production") ;
240
+ }
241
+ }
193
242
  componentDidLoad() {
194
243
  this.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {
195
244
  this.onAriaAttributeChange(attributeName, newValue);
@@ -213,7 +262,7 @@ const GovFormFile = class {
213
262
  this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { [attributeName]: newValue });
214
263
  }
215
264
  render() {
216
- return (h(Host, { key: '0f005cd699699df5d67c1ae5a1ce69bcbe14df08', class: this.h.classes([FormFileClass.root]), invalid: toBoolAttrIfDefined(this.invalid), expanded: toBoolAttrIfDefined(this.expanded) }, h("div", { key: '85de8e3bbbed08f63a93b874799b2e76311320dd', class: FormFileClass.area, ref: el => (this.areaRef = el) }, h("slot", { key: 'd67d074f20d899d81c37118eeb872eace16be983' }), h("input", Object.assign({ key: 'b0be06c28155cd0bfd13aa6926f05718fe58ca2d', 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) })), h("div", { key: 'bf27e1a3806a4334ec9476171c64a5dfe96a1040', class: FormFileClass.inputFocus })), 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) }, item.file.name, h("span", { slot: "name" }, item.file.name), item.acceptValid === false ? (h("gov-form-message", { slot: "message", color: "error" }, h("gov-icon", { slot: "icon", name: "exclamation-triangle-fill", type: "components" }), 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", type: "components" }), this.errorSize.replace("{FILE_SIZE}", formatBytes(this.maxFileSize)))) : null, h("span", { slot: "info" }, "(", formatBytes(item.file.size), ")"))))))) : null));
265
+ return (h(Host, { key: '2d89af24db1447bba2c7987946b5c63bff65a58a', class: this.h.classes([FormFileClass.root]), invalid: toBoolAttrIfDefined(this.invalid), expanded: toBoolAttrIfDefined(this.expanded) }, h("div", { key: '7a37869f8ef203b0f1d6b07cfee8e4f325fe9ecc', class: FormFileClass.area, ref: el => (this.areaRef = el) }, h("slot", { key: '10344be7bedf53a4754c8e79bb069c57291b7663' }), h("input", Object.assign({ key: '52dc1692d0eaa6310c0166faceb5906627aac73c', 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) })), h("div", { key: '1193c6ef7a57894baab2f14619827c2f51441d08', class: FormFileClass.inputFocus })), 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) }, item.file.name, h("span", { slot: "name" }, item.file.name), item.acceptValid === false ? (h("gov-form-message", { slot: "message", color: "error" }, h("gov-icon", { slot: "icon", name: "exclamation-triangle-fill", type: "components" }), 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", type: "components" }), this.errorSize.replace("{FILE_SIZE}", formatBytes(this.maxFileSize)))) : null, h("span", { slot: "info" }, "(", formatBytes(item.file.size), ")"))))))) : null));
217
266
  }
218
267
  onRemoveFileHandler(file) {
219
268
  const index = this.files.findIndex(item => item.id === file.id);
@@ -222,6 +271,7 @@ const GovFormFile = class {
222
271
  const removeFile = this.files[index];
223
272
  files.splice(index, 1);
224
273
  this.files = [...files];
274
+ this.syncNativeInputFiles();
225
275
  this.govRemoveFile.emit({
226
276
  component: FormFileClass.root,
227
277
  file: removeFile,
@@ -266,7 +316,10 @@ const GovFormFile = class {
266
316
  */
267
317
  async reset() {
268
318
  this.files = [];
269
- this.inputRef.value = '';
319
+ if (this.inputRef) {
320
+ this.inputRef.value = '';
321
+ this.syncNativeInputFiles();
322
+ }
270
323
  }
271
324
  get host() { return getElement(this); }
272
325
  static get watchers() { return {
@@ -1 +1 @@
1
- {"version":3,"file":"gov-form-file.entry.js","sources":["../../../packages/core/src/components/gov-form/file/constants.ts","../../../packages/core/src/utils/file.utils.ts","../../../packages/core/src/components/gov-form/file/gov-form-file.tsx"],"sourcesContent":["export const FormFileClass = {\n\troot: 'gov-form-file',\n\tarea: 'gov-form-file__area',\n\tinput: 'gov-form-file__input',\n\tinputFocus: 'gov-form-file__input-focus',\n\tattachments: 'gov-form-file__attachments',\n}\n","export function formatBytes(bytes: any): string {\n\tconst units = ['bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']\n\tlet l = 0,\n\t\tn = parseInt(bytes, 10) || 0\n\n\twhile (n >= 1024 && ++l) {\n\t\tn = n / 1024\n\t}\n\n\treturn n.toFixed(n < 10 && l > 0 ? 1 : 0) + ' ' + units[l]\n}\n\nexport function fileAcceptValidation(file: File, accept: string): boolean {\n\tif (typeof accept === 'string' && accept.length) {\n\t\treturn (\n\t\t\taccept\n\t\t\t\t.replace(/\\s/g, '')\n\t\t\t\t.split(',')\n\t\t\t\t.filter(accept => {\n\t\t\t\t\treturn new RegExp(accept.replace('*', '.*')).test(file.type)\n\t\t\t\t}).length > 0\n\t\t)\n\t} else {\n\t\treturn true\n\t}\n}\n\nexport function fileSizeValidation(file: File, maxSize: number): boolean {\n\tconst fileSize = Math.round(file.size)\n\treturn fileSize <= maxSize\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {createID} from \"../../../utils/string.utils\"\nimport {FormFileClass} from \"./constants\"\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from \"../../../helpers/Dom/template\"\nimport {fileAcceptValidation, fileSizeValidation, formatBytes} from \"../../../utils/file.utils\"\nimport {GovForm} from \"../../../helpers/Dom/form.types\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {govForm} from \"../../../helpers/Dom/form\"\nimport {GovFormFileEvent, GovFormFileItem} from \"./gov-form-file.types\"\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\n\n@Component({\n\ttag: \"gov-form-file\",\n})\nexport class GovFormFile {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\n\tprivate areaRef?: HTMLDivElement\n\tprivate inputRef?: HTMLInputElement\n\tprivate readonly fileId: string\n\tprivate attributeObserver: AttributeObserver\n\tprivate eventsRegistered = false\n\n\tconstructor() {\n\t\tthis.fileId = createID(\"GovInputFile\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormFileElement\n\t/**\n\t * Expands the file input to fill 100% of the container width.\n\t */\n\t@Prop() readonly expanded: boolean = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the File component disabled.\n\t * This prevents users from being able to interact with the File, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * After selecting the files, the main input element will be reset.\n\t * The propagation of the event with the selected files will not be affected.\n\t */\n\t@Prop({attribute: \"reset-after-pick\"}) readonly resetAfterPick: boolean = false\n\t/**\n\t * Selected files will not be checked for duplicates based on name and size.\n\t */\n\t@Prop({attribute: \"ignore-file-duplication-check\"}) readonly ignoreFileDuplicationCheck: boolean = false\n\t/**\n\t * Show list of attachments\n\t */\n\t@Prop({attribute: \"display-attachments\"}) readonly displayAttachments: boolean = true\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept\n\t */\n\t@Prop() readonly accept: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/multiple\n\t */\n\t@Prop() readonly multiple: boolean = false\n\t/**\n\t * Maximum embedded file size\n\t */\n\t@Prop({attribute: \"max-file-size\"}) readonly maxFileSize: number = -1\n\t/**\n\t * Custom File identifier.\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Error message when the maximum file size is exceeded\n\t */\n\t@Prop({attribute: \"error-size\"}) readonly errorSize: string = \"Soubor je větší než povolená velikost {FILE_SIZE}\"\n\t/**\n\t * Insert unsupported file error message\n\t */\n\t@Prop({attribute: \"error-accept\"}) readonly errorAccept: string = \"Soubor tohoto typu není povolen\"\n\t/**\n\t * Adds accessible label for the list of attachments.\n\t */\n\t@Prop({attribute: \"accessible-attachments-label\"}) readonly accessibleAttachmentsLabel: string = \"Přílohy\"\n\t/**\n\t * Emitted when the File has focus.\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Emitted when the File loses focus.\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when the list of inserted files is changed\n\t */\n\t@Event({eventName: \"gov-files\"}) govFiles: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when a new file is added\n\t */\n\t@Event({eventName: \"gov-add-file\"}) govAddFile: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when a file is removed from the list\n\t */\n\t@Event({eventName: \"gov-remove-file\"}) govRemoveFile: EventEmitter<GovFormFileEvent>\n\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\twatchControlAttrs(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\t@State() files: GovFormFileItem[] = []\n\t@State() inheritedAttributes: Attributes = {}\n\n\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"type\", \"File\")\n\t}\n\n\n\tprivate registerListeners() {\n\t\tif (this.eventsRegistered) {\n\t\t\treturn\n\t\t}\n\t\tthis.eventsRegistered = true\n\n\t\tfunction highlight() {\n\t\t\tthis.areaRef.classList.add(\"highlight\")\n\t\t}\n\n\t\tfunction unhighlight() {\n\t\t\tthis.areaRef.classList.remove(\"highlight\")\n\t\t}\n\n\t\tthis.inputRef.addEventListener(\n\t\t\t\"change\",\n\t\t\te => {\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopPropagation()\n\t\t\t\tconst files = (e.target as HTMLInputElement).files\n\t\t\t\tif (this.resetAfterPick) {\n\t\t\t\t\tif (files.length) {\n\t\t\t\t\t\tthis.validateFiles(files)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.validateFiles(files)\n\t\t\t\t}\n\t\t\t},\n\t\t\tfalse,\n\t\t)\n\n\t\tif (this.expanded) {\n\t\t\tconst events = [\"dragover\", \"dragleave\"]\n\t\t\tconst inEvents = [\"dragenter\", \"dragover\", \"mouseenter\"]\n\t\t\tconst outEvents = [\"dragleave\", \"mouseleave\"]\n\n\t\t\tevents.map(eventName => this.inputRef.addEventListener(eventName, this.preventDefaults.bind(this), false))\n\t\t\tinEvents.map(eventName => this.inputRef.addEventListener(eventName, highlight.bind(this), false))\n\t\t\toutEvents.forEach(eventName => this.inputRef.addEventListener(eventName, unhighlight.bind(this), false))\n\t\t}\n\t}\n\n\tpreventDefaults(e) {\n\t\te.preventDefault()\n\t\te.stopPropagation()\n\t}\n\n\thandleDrop(e: DragEvent) {\n\t\tconst dataTransfer = e.dataTransfer\n\t\tthis.validateFiles(dataTransfer.files)\n\t}\n\n\tprivate validateFiles(files: FileList) {\n\t\tlet filesBuffer: GovFormFileItem[] = []\n\t\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\t<div class={FormFileClass.inputFocus}/>\n\t\t\t\t</div>\n\n\t\t\t\t{this.h.hasSlot(\"attachments\") ? (\n\t\t\t\t\t<div class={FormFileClass.attachments}>\n\t\t\t\t\t\t<slot name={\"attachments\"}/>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\n\t\t\t\t{this.files.length && this.displayAttachments ? (\n\t\t\t\t\t<div class={FormFileClass.attachments}>\n\t\t\t\t\t\t<gov-attachments label={this.accessibleAttachmentsLabel}\n\t\t\t\t\t\t\t\t\t\t accessible-label={this.accessibleAttachmentsLabel}>\n\t\t\t\t\t\t\t{this.files.map(item => (\n\t\t\t\t\t\t\t\t<gov-attachments-item accessible-remove-labelledby={item.id}\n\t\t\t\t\t\t\t\t\t\t\t\t\t on-gov-remove={() => this.onRemoveFileHandler(item)}>\n\t\t\t\t\t\t\t\t\t{item.file.name}\n\t\t\t\t\t\t\t\t\t<span slot=\"name\">{item.file.name}</span>\n\t\t\t\t\t\t\t\t\t{item.acceptValid === false ? (\n\t\t\t\t\t\t\t\t\t\t<gov-form-message slot=\"message\" color=\"error\">\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon\" name=\"exclamation-triangle-fill\" type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t\t\t\t\t{item.acceptValid === false ? this.errorAccept : null}\n\t\t\t\t\t\t\t\t\t\t</gov-form-message>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t{item.sizeValid === false ? (\n\t\t\t\t\t\t\t\t\t\t<gov-form-message slot=\"message\" color=\"error\">\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon\" name=\"exclamation-triangle-fill\" type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t\t\t\t\t{this.errorSize.replace(\"{FILE_SIZE}\", formatBytes(this.maxFileSize))}\n\t\t\t\t\t\t\t\t\t\t</gov-form-message>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t<span slot=\"info\">({formatBytes(item.file.size)})</span>\n\t\t\t\t\t\t\t\t</gov-attachments-item>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</gov-attachments>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onRemoveFileHandler(file: GovFormFileItem) {\n\t\tconst index = this.files.findIndex(item => item.id === file.id)\n\t\tif (index !== -1) {\n\t\t\tconst files = this.files\n\t\t\tconst removeFile = this.files[index]\n\t\t\tfiles.splice(index, 1)\n\t\t\tthis.files = [...files]\n\t\t\tthis.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"],"names":[],"mappings":";;;;;;;;;;;;;AAAO,MAAM,aAAa,GAAG;AAC5B,IAAA,IAAI,EAAE,eAAe;AACrB,IAAA,IAAI,EAAE,qBAAqB;AAC3B,IAAA,KAAK,EAAE,sBAAsB;AAC7B,IAAA,UAAU,EAAE,4BAA4B;AACxC,IAAA,WAAW,EAAE,4BAA4B;CACzC;;ACNK,SAAU,WAAW,CAAC,KAAU,EAAA;IACrC,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,C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CAAC,QAAQ,CAAC,KAAK,GAAG,EAAE;;;;;;;;;;;"}
1
+ {"version":3,"file":"gov-form-file.entry.js","sources":["../../../packages/core/src/components/gov-form/file/constants.ts","../../../packages/core/src/utils/file.utils.ts","../../../packages/core/src/components/gov-form/file/gov-form-file.tsx"],"sourcesContent":["export const FormFileClass = {\n\troot: 'gov-form-file',\n\tarea: 'gov-form-file__area',\n\tinput: 'gov-form-file__input',\n\tinputFocus: 'gov-form-file__input-focus',\n\tattachments: 'gov-form-file__attachments',\n}\n","export function formatBytes(bytes: any): string {\n\tconst units = ['bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']\n\tlet l = 0,\n\t\tn = parseInt(bytes, 10) || 0\n\n\twhile (n >= 1024 && ++l) {\n\t\tn = n / 1024\n\t}\n\n\treturn n.toFixed(n < 10 && l > 0 ? 1 : 0) + ' ' + units[l]\n}\n\n// Validates a file against an `accept` attribute value, following the HTML spec\n// (https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept):\n// - \".ext\" → matched against the file NAME suffix (case-insensitive)\n// - \"type/*\" → matched against the file MIME group\n// - \"type/sub\" → exact MIME match\n// Matching the name (not only file.type) is essential: browsers often report an\n// empty or non-standard MIME for extensions like .jsonld, which the previous\n// MIME-only RegExp check always rejected.\nexport function fileAcceptValidation(file: File, accept: string): boolean {\n\tif (typeof accept !== 'string' || accept.trim().length === 0) {\n\t\treturn true\n\t}\n\tconst fileName = file.name.toLowerCase()\n\tconst fileType = (file.type || '').toLowerCase()\n\treturn accept\n\t\t.split(',')\n\t\t.map(token => token.trim().toLowerCase())\n\t\t.filter(token => token.length > 0)\n\t\t.some(token => {\n\t\t\tif (token.startsWith('.')) {\n\t\t\t\treturn fileName.endsWith(token)\n\t\t\t}\n\t\t\tif (token === '*' || token === '*/*') {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif (token.endsWith('/*')) {\n\t\t\t\tconst group = token.slice(0, token.indexOf('/') + 1)\n\t\t\t\treturn fileType.startsWith(group)\n\t\t\t}\n\t\t\treturn fileType === token\n\t\t})\n}\n\nexport function fileSizeValidation(file: File, maxSize: number): boolean {\n\tconst fileSize = Math.round(file.size)\n\treturn fileSize <= maxSize\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {createID} from \"../../../utils/string.utils\"\nimport {FormFileClass} from \"./constants\"\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from \"../../../helpers/Dom/template\"\nimport {fileAcceptValidation, fileSizeValidation, formatBytes} from \"../../../utils/file.utils\"\nimport {GovForm} from \"../../../helpers/Dom/form.types\"\nimport {GovHost} from \"../../../helpers/Dom/template.types\"\nimport {govForm} from \"../../../helpers/Dom/form\"\nimport {GovFormFileEvent, GovFormFileItem} from \"./gov-form-file.types\"\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\n\n@Component({\n\ttag: \"gov-form-file\",\n})\nexport class GovFormFile {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\n\tprivate areaRef?: HTMLDivElement\n\tprivate inputRef?: HTMLInputElement\n\tprivate readonly fileId: string\n\tprivate attributeObserver: AttributeObserver\n\tprivate eventsRegistered = false\n\n\tconstructor() {\n\t\tthis.fileId = createID(\"GovInputFile\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormFileElement\n\t/**\n\t * Expands the file input to fill 100% of the container width.\n\t */\n\t@Prop() readonly expanded: boolean = false\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the File component disabled.\n\t * This prevents users from being able to interact with the File, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * After selecting the files, the main input element will be reset.\n\t * The propagation of the event with the selected files will not be affected.\n\t */\n\t@Prop({attribute: \"reset-after-pick\"}) readonly resetAfterPick: boolean = false\n\t/**\n\t * Selected files will not be checked for duplicates based on name and size.\n\t */\n\t@Prop({attribute: \"ignore-file-duplication-check\"}) readonly ignoreFileDuplicationCheck: boolean = false\n\t/**\n\t * Show list of attachments\n\t */\n\t@Prop({attribute: \"display-attachments\"}) readonly displayAttachments: boolean = true\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept\n\t */\n\t@Prop() readonly accept: string\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/multiple\n\t */\n\t@Prop() readonly multiple: boolean = false\n\t/**\n\t * Maximum embedded file size\n\t */\n\t@Prop({attribute: \"max-file-size\"}) readonly maxFileSize: number = -1\n\t/**\n\t * Custom File identifier.\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Error message when the maximum file size is exceeded\n\t */\n\t@Prop({attribute: \"error-size\"}) readonly errorSize: string = \"Soubor je větší než povolená velikost {FILE_SIZE}\"\n\t/**\n\t * Insert unsupported file error message\n\t */\n\t@Prop({attribute: \"error-accept\"}) readonly errorAccept: string = \"Soubor tohoto typu není povolen\"\n\t/**\n\t * Adds accessible label for the list of attachments.\n\t */\n\t@Prop({attribute: \"accessible-attachments-label\"}) readonly accessibleAttachmentsLabel: string = \"Přílohy\"\n\t/**\n\t * Emitted when the File has focus.\n\t */\n\t@Event({eventName: \"gov-focus\"}) govFocus: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Emitted when the File loses focus.\n\t */\n\t@Event({eventName: \"gov-blur\"}) govBlur: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when the list of inserted files is changed\n\t */\n\t@Event({eventName: \"gov-files\"}) govFiles: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when a new file is added\n\t */\n\t@Event({eventName: \"gov-add-file\"}) govAddFile: EventEmitter<GovFormFileEvent>\n\t/**\n\t * Called when a file is removed from the list\n\t */\n\t@Event({eventName: \"gov-remove-file\"}) govRemoveFile: EventEmitter<GovFormFileEvent>\n\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\twatchControlAttrs(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\t@State() files: GovFormFileItem[] = []\n\t@State() inheritedAttributes: Attributes = {}\n\n\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"type\", \"File\")\n\t}\n\n\n\tprivate registerListeners() {\n\t\tif (this.eventsRegistered) {\n\t\t\treturn\n\t\t}\n\t\tthis.eventsRegistered = true\n\n\t\tfunction highlight() {\n\t\t\tthis.areaRef.classList.add(\"highlight\")\n\t\t}\n\n\t\tfunction unhighlight() {\n\t\t\tthis.areaRef.classList.remove(\"highlight\")\n\t\t}\n\n\t\tthis.inputRef.addEventListener(\n\t\t\t\"change\",\n\t\t\te => {\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopPropagation()\n\t\t\t\tconst files = (e.target as HTMLInputElement).files\n\t\t\t\tif (this.resetAfterPick) {\n\t\t\t\t\tif (files.length) {\n\t\t\t\t\t\tthis.validateFiles(files)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.validateFiles(files)\n\t\t\t\t}\n\t\t\t},\n\t\t\tfalse,\n\t\t)\n\n\t\tif (this.expanded) {\n\t\t\tconst events = [\"dragover\", \"dragleave\"]\n\t\t\tconst inEvents = [\"dragenter\", \"dragover\", \"mouseenter\"]\n\t\t\tconst outEvents = [\"dragleave\", \"mouseleave\"]\n\n\t\t\tevents.map(eventName => this.inputRef.addEventListener(eventName, this.preventDefaults.bind(this), false))\n\t\t\tinEvents.map(eventName => this.inputRef.addEventListener(eventName, highlight.bind(this), false))\n\t\t\toutEvents.forEach(eventName => this.inputRef.addEventListener(eventName, unhighlight.bind(this), false))\n\t\t}\n\t}\n\n\tpreventDefaults(e) {\n\t\te.preventDefault()\n\t\te.stopPropagation()\n\t}\n\n\thandleDrop(e: DragEvent) {\n\t\tconst dataTransfer = e.dataTransfer\n\t\tthis.validateFiles(dataTransfer.files)\n\t}\n\n\tprivate validateFiles(files: FileList) {\n\t\tlet filesBuffer: GovFormFileItem[] = []\n\t\t// Without `multiple`, only a single file is allowed. An incoming batch\n\t\t// (drag-drop, framework wrapper, programmatic assignment) can still carry\n\t\t// several files, so cap it to the last one — consistent with the\n\t\t// \"second pick replaces the first\" semantics. (Bug #30570313)\n\t\tconst incoming = this.multiple ? Array.from(files) : Array.from(files).slice(-1)\n\t\tif (!this.multiple && this.displayAttachments) {\n\t\t\tthis.files = []\n\t\t}\n\t\tincoming.forEach(file => {\n\t\t\tconst isFile = this.files.find(item => item.file.name === file.name && item.file.size === file.size) || null\n\t\t\tif (isFile === null || this.ignoreFileDuplicationCheck) {\n\t\t\t\tconst isSizeValid = typeof this.maxFileSize === \"number\" && this.maxFileSize > 0 ? fileSizeValidation(file, this.maxFileSize) : true\n\t\t\t\tconst isAcceptValid = fileAcceptValidation(file, this.accept)\n\t\t\t\tconst newFile = {\n\t\t\t\t\tid: createID(\"GovFormFile\"),\n\t\t\t\t\tfile,\n\t\t\t\t\tacceptValid: isAcceptValid,\n\t\t\t\t\tsizeValid: isSizeValid,\n\t\t\t\t}\n\t\t\t\tif (this.displayAttachments) {\n\t\t\t\t\tthis.files = [...this.files, newFile]\n\t\t\t\t} else {\n\t\t\t\t\tfilesBuffer = [...filesBuffer, newFile]\n\t\t\t\t}\n\t\t\t\tthis.govAddFile.emit({\n\t\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\t\tfile: newFile,\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\n\t\tif (this.displayAttachments) {\n\t\t\tthis.syncNativeInputFiles()\n\t\t}\n\n\t\tthis.govFiles.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\tfiles: filesBuffer.length ? filesBuffer : this.files,\n\t\t})\n\n\t\tif (this.resetAfterPick) {\n\t\t\tthis.reset().finally()\n\t\t}\n\t}\n\n\t// Keep native <input type=\"file\"> in sync with the visible attachments list so\n\t// that a native form submit / FormData carries exactly the files shown in the UI.\n\t// Invalid items (wrong type or oversize) are intentionally excluded.\n\tprivate syncNativeInputFiles() {\n\t\tif (!this.inputRef || typeof DataTransfer === \"undefined\") {\n\t\t\treturn\n\t\t}\n\t\ttry {\n\t\t\tconst dt = new DataTransfer()\n\t\t\tthis.files\n\t\t\t\t.filter(item => item.acceptValid === true && item.sizeValid === true)\n\t\t\t\t.forEach(item => dt.items.add(item.file))\n\t\t\tthis.inputRef.files = dt.files\n\t\t} catch (e) {\n\t\t\t// Safari < 14.1 / older browsers may reject assigning to .files; nothing safe to fall back to.\n\t\t\tif (typeof process !== \"undefined\" && process.env && process.env.NODE_ENV !== \"production\") {\n\t\t\t\tconsole.warn(\"[gov-form-file] Could not sync native input.files:\", e)\n\t\t\t}\n\t\t}\n\t}\n\n\tcomponentDidLoad() {\n\t\tthis.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {\n\t\t\tthis.onAriaAttributeChange(attributeName, newValue);\n\t\t});\n\n\t\tthis.attributeObserver.startObserving(ariaAttributes);\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\n\t\tthis.passControlAttrs()\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.registerListeners()\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tonAriaAttributeChange(attributeName: string, newValue: string) {\n\t\tthis.host.removeAttribute(attributeName)\n\t\tthis.inheritedAttributes = {...this.inheritedAttributes, [attributeName]: newValue};\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={this.h.classes([FormFileClass.root])}\n\t\t\t\t invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t expanded={toBoolAttrIfDefined(this.expanded)}>\n\t\t\t\t<div class={FormFileClass.area} ref={el => (this.areaRef = el as HTMLDivElement)}>\n\t\t\t\t\t<slot/>\n\t\t\t\t\t<input\n\t\t\t\t\t\tclass={FormFileClass.input}\n\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\tid={this.identifier || this.fileId}\n\t\t\t\t\t\ttype=\"file\"\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\taccept={this.accept}\n\t\t\t\t\t\tmultiple={this.multiple}\n\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t/>\n\t\t\t\t\t<div class={FormFileClass.inputFocus}/>\n\t\t\t\t</div>\n\n\t\t\t\t{this.h.hasSlot(\"attachments\") ? (\n\t\t\t\t\t<div class={FormFileClass.attachments}>\n\t\t\t\t\t\t<slot name={\"attachments\"}/>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\n\t\t\t\t{this.files.length && this.displayAttachments ? (\n\t\t\t\t\t<div class={FormFileClass.attachments}>\n\t\t\t\t\t\t<gov-attachments label={this.accessibleAttachmentsLabel}\n\t\t\t\t\t\t\t\t\t\t accessible-label={this.accessibleAttachmentsLabel}>\n\t\t\t\t\t\t\t{this.files.map(item => (\n\t\t\t\t\t\t\t\t<gov-attachments-item accessible-remove-labelledby={item.id}\n\t\t\t\t\t\t\t\t\t\t\t\t\t on-gov-remove={() => this.onRemoveFileHandler(item)}>\n\t\t\t\t\t\t\t\t\t{item.file.name}\n\t\t\t\t\t\t\t\t\t<span slot=\"name\">{item.file.name}</span>\n\t\t\t\t\t\t\t\t\t{item.acceptValid === false ? (\n\t\t\t\t\t\t\t\t\t\t<gov-form-message slot=\"message\" color=\"error\">\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon\" name=\"exclamation-triangle-fill\" type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t\t\t\t\t{item.acceptValid === false ? this.errorAccept : null}\n\t\t\t\t\t\t\t\t\t\t</gov-form-message>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t{item.sizeValid === false ? (\n\t\t\t\t\t\t\t\t\t\t<gov-form-message slot=\"message\" color=\"error\">\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"icon\" name=\"exclamation-triangle-fill\" type=\"components\"></gov-icon>\n\t\t\t\t\t\t\t\t\t\t\t{this.errorSize.replace(\"{FILE_SIZE}\", formatBytes(this.maxFileSize))}\n\t\t\t\t\t\t\t\t\t\t</gov-form-message>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t<span slot=\"info\">({formatBytes(item.file.size)})</span>\n\t\t\t\t\t\t\t\t</gov-attachments-item>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</gov-attachments>\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onRemoveFileHandler(file: GovFormFileItem) {\n\t\tconst index = this.files.findIndex(item => item.id === file.id)\n\t\tif (index !== -1) {\n\t\t\tconst files = this.files\n\t\t\tconst removeFile = this.files[index]\n\t\t\tfiles.splice(index, 1)\n\t\t\tthis.files = [...files]\n\t\t\tthis.syncNativeInputFiles()\n\t\t\tthis.govRemoveFile.emit({\n\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\tfile: removeFile,\n\t\t\t})\n\t\t\tthis.govFiles.emit({\n\t\t\t\tcomponent: FormFileClass.root,\n\t\t\t\tfiles,\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormFileClass.root,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\te.stopPropagation()\n\t}\n\n\t/**\n\t * Returns the reference of the native element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n\n\t/**\n\t * Returns the reference of the native area element\n\t */\n\t@Method()\n\tasync getAreaRef(): Promise<HTMLDivElement> {\n\t\treturn this.areaRef\n\t}\n\n\t/**\n\t * Remove all files from component state\n\t */\n\t@Method()\n\tasync reset(): Promise<void> {\n\t\tthis.files = []\n\t\tif (this.inputRef) {\n\t\t\tthis.inputRef.value = ''\n\t\t\tthis.syncNativeInputFiles()\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAO,MAAM,aAAa,GAAG;AAC5B,IAAA,IAAI,EAAE,eAAe;AACrB,IAAA,IAAI,EAAE,qBAAqB;AAC3B,IAAA,KAAK,EAAE,sBAAsB;AAC7B,IAAA,UAAU,EAAE,4BAA4B;AACxC,IAAA,WAAW,EAAE,4BAA4B;CACzC;;ACN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ChB,SAAA,CAAC;;AAGK,IAAA,aAAa,CAAC,CAAa,EAAA;QAClC,CAAC,CAAC,eAAe,EAAE;AACnB,QAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;YACjB,SAAS,EAAE,aAAa,CAAC,IAAI;AAC7B,YAAA,aAAa,EAAE,CAAC;AAChB,SAAA,CAAC;;AAGK,IAAA,eAAe,CAAC,CAAQ,EAAA;QAC/B,CAAC,CAAC,eAAe,EAAE;;AAGpB;;AAEG;AAEH,IAAA,MAAM,MAAM,GAAA;QACX,OAAO,IAAI,CAAC,QAAQ;;AAGrB;;AAEG;AAEH,IAAA,MAAM,UAAU,GAAA;QACf,OAAO,IAAI,CAAC,OAAO;;AAGpB;;AAEG;AAEH,IAAA,MAAM,KAAK,GAAA;AACV,QAAA,IAAI,CAAC,KAAK,GAAG,EAAE;AACf,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;AAClB,YAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,EAAE;YACxB,IAAI,CAAC,oBAAoB,EAAE;;;;;;;;;;;;"}
@@ -22,7 +22,7 @@ const GovFormSearch = class {
22
22
  this.color = 'neutral';
23
23
  }
24
24
  render() {
25
- return (h(Host, { key: '8694237120321b5cea6dbe4c4152edfde30228a1', class: FormSearchClass.root, color: this.color, size: this.size }, h("slot", { key: '4c382e33221ff8b874a7f8544d94261298c3cf28', name: "input" }), h("slot", { key: '3b56d19118f2b75964a9ed62ae2210e7705ba4a5', name: "button-erase" }), h("slot", { key: 'c829a3df01bc53fab6b3022aac353ebe06b088db', name: "button" })));
25
+ return (h(Host, { key: 'c901368f70213c3be37b44b472002ce0872209d0', class: FormSearchClass.root, color: this.color, size: this.size }, h("slot", { key: '4ca581f75ccd75f785f94c1f93500c914b129cc8', name: "input" }), h("slot", { key: '10a34b30a9496b0d9a82b0baaf10b66ac5a2679f', name: "button-erase" }), h("slot", { key: '2888491da6babe4e7586abdda1863850ed67f8a9', name: "button" })));
26
26
  }
27
27
  get host() { return getElement(this); }
28
28
  };
@@ -1 +1 @@
1
- {"version":3,"file":"gov-form-search.entry.js","sources":["../../../packages/core/src/components/gov-form/search/constants.ts","../../../packages/core/src/components/gov-form/search/gov-form-search.tsx"],"sourcesContent":["import { Colors } from '../../../core/constants/colors'\nimport { ValueOf } from '../../../types/interfaces'\nimport { pick } from '../../../utils/utils'\nimport {Sizes} from \"../../../core/constants/sizes\";\n\nexport const FormSearchSizes = pick(Sizes, ['_S', '_M', '_L'])\nexport type FormSearchSizesType = `${ValueOf<typeof FormSearchSizes>}`\n\nexport const FormSearchColors = pick(Colors, ['PRIMARY', 'NEUTRAL'])\nexport type FormSearchColorType = `${ValueOf<typeof FormSearchColors>}`\n\nexport const FormSearchClass = {\n\troot: 'gov-form-search',\n}\n","import {Component, Element, h, Host, Prop} from '@stencil/core'\nimport {FormSearchClass, FormSearchSizesType, FormSearchColorType} from './constants'\n\n@Component({\n\ttag: 'gov-form-search',\n})\nexport class GovFormSearch {\n\t@Element() host: HTMLGovFormSearchElement\n\t/**\n\t * Search’s size.\n\t */\n\t@Prop() readonly size?: FormSearchSizesType = \"m\"\n\t/**\n\t * Style variation of the form input.\n\t */\n\t@Prop({reflect: true}) readonly color: FormSearchColorType = 'neutral'\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormSearchClass.root} color={this.color} size={this.size}>\n\t\t\t\t<slot name=\"input\"/>\n\t\t\t\t<slot name=\"button-erase\"/>\n\t\t\t\t<slot name=\"button\"/>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"names":[],"mappings":";;;;;AAK+B,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;AAG7B,IAAI,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC;AAG5D,MAAM,eAAe,GAAG;AAC9B,IAAA,IAAI,EAAE,iBAAiB;CACvB;;MCPY,aAAa,GAAA,MAAA;AAH1B,IAAA,WAAA,CAAA,OAAA,EAAA;;AAKC;;AAEG;AACc,QAAA,IAAI,CAAA,IAAA,GAAyB,GAAG;AACjD;;AAEG;AAC6B,QAAA,IAAK,CAAA,KAAA,GAAwB,SAAS;AAWtE;IATA,MAAM,GAAA;AACL,QAAA,QACC,EAAC,IAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAC,KAAK,EAAE,eAAe,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAA,EACpE,CAAM,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,OAAO,EAAE,CAAA,EACpB,CAAM,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,cAAc,EAAE,CAAA,EAC3B,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,QAAQ,EAAE,CAAA,CACf;;;;;;;"}
1
+ {"version":3,"file":"gov-form-search.entry.js","sources":["../../../packages/core/src/components/gov-form/search/constants.ts","../../../packages/core/src/components/gov-form/search/gov-form-search.tsx"],"sourcesContent":["import { Colors } from '../../../core/constants/colors'\nimport { ValueOf } from '../../../types/interfaces'\nimport { pick } from '../../../utils/utils'\nimport {Sizes} from \"../../../core/constants/sizes\";\n\nexport const FormSearchSizes = pick(Sizes, ['_S', '_M', '_L'])\nexport type FormSearchSizesType = `${ValueOf<typeof FormSearchSizes>}`\n\nexport const FormSearchColors = pick(Colors, ['PRIMARY', 'NEUTRAL'])\nexport type FormSearchColorType = `${ValueOf<typeof FormSearchColors>}`\n\nexport const FormSearchClass = {\n\troot: 'gov-form-search',\n}\n","import {Component, Element, h, Host, Prop} from '@stencil/core'\nimport {FormSearchClass, FormSearchSizesType, FormSearchColorType} from './constants'\n\n@Component({\n\ttag: 'gov-form-search',\n})\nexport class GovFormSearch {\n\t@Element() host: HTMLGovFormSearchElement\n\t/**\n\t * Search’s size.\n\t */\n\t@Prop({reflect: true}) readonly size?: FormSearchSizesType = \"m\"\n\t/**\n\t * Style variation of the form input.\n\t */\n\t@Prop({reflect: true}) readonly color: FormSearchColorType = 'neutral'\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormSearchClass.root} color={this.color} size={this.size}>\n\t\t\t\t<slot name=\"input\"/>\n\t\t\t\t<slot name=\"button-erase\"/>\n\t\t\t\t<slot name=\"button\"/>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"names":[],"mappings":";;;;;AAK+B,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;AAG7B,IAAI,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC;AAG5D,MAAM,eAAe,GAAG;AAC9B,IAAA,IAAI,EAAE,iBAAiB;CACvB;;MCPY,aAAa,GAAA,MAAA;AAH1B,IAAA,WAAA,CAAA,OAAA,EAAA;;AAKC;;AAEG;AAC6B,QAAA,IAAI,CAAA,IAAA,GAAyB,GAAG;AAChE;;AAEG;AAC6B,QAAA,IAAK,CAAA,KAAA,GAAwB,SAAS;AAWtE;IATA,MAAM,GAAA;AACL,QAAA,QACC,EAAC,IAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAC,KAAK,EAAE,eAAe,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAA,EACpE,CAAM,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,OAAO,EAAE,CAAA,EACpB,CAAM,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,cAAc,EAAE,CAAA,EAC3B,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,QAAQ,EAAE,CAAA,CACf;;;;;;;"}
@@ -4,7 +4,6 @@ import { g as govHost, a as toBoolAttr, t as toBoolAttrIfDefined } from './templ
4
4
  import { v as validateProp } from './props-CJZgTDla.js';
5
5
  import { c as createID } from './string.utils-vN03FcXN.js';
6
6
  import { p as propsValueToArray } from './array.utils-CJ0U_ONv.js';
7
- import { t as tick } from './stencil.utils-Cjg0wpDG.js';
8
7
  import { A as AttributeObserver, a as ariaAttributes } from './attribute-Bz_RzYFb.js';
9
8
  import { i as inheritAriaAttributes } from './accessibility-wqNV8djF.js';
10
9
  import './sizes-BcQO4NH2.js';
@@ -52,7 +51,7 @@ const GovFormSelect = class {
52
51
  this.passControlAttrs();
53
52
  }
54
53
  watchValue() {
55
- this.markSelectedValue();
54
+ this.syncSelectValue();
56
55
  }
57
56
  passControlAttrs() {
58
57
  this.f.passAttrToControl('size', this.size);
@@ -66,6 +65,7 @@ const GovFormSelect = class {
66
65
  this.onAriaAttributeChange(attributeName, newValue);
67
66
  });
68
67
  this.attributeObserver.startObserving(ariaAttributes);
68
+ this.syncSelectValue();
69
69
  }
70
70
  disconnectedCallback() {
71
71
  var _a;
@@ -73,34 +73,27 @@ const GovFormSelect = class {
73
73
  }
74
74
  componentWillLoad() {
75
75
  this.validateSize(this.size);
76
- this.markSelectedValue();
77
76
  this.optionsState = propsValueToArray(this.options);
78
77
  this.inheritedAttributes = inheritAriaAttributes(this.host);
79
78
  }
80
79
  async componentDidRender() {
81
80
  this.passControlAttrs();
82
81
  this.f.passAttrToLabel('required', String(this.required));
83
- tick(() => this.markSelectedValue());
84
82
  }
85
83
  onAriaAttributeChange(attributeName, newValue) {
86
84
  this.host.removeAttribute(attributeName);
87
85
  this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { [attributeName]: newValue });
88
86
  }
89
- markSelectedValue() {
90
- this.host.querySelectorAll('option').forEach((option) => {
91
- if (option.value === this.value) {
92
- option.setAttribute('selected', 'selected');
93
- }
94
- else {
95
- option.removeAttribute('selected');
96
- }
97
- });
87
+ syncSelectValue() {
88
+ if (this.selectRef && this.value !== undefined && this.selectRef.value !== this.value) {
89
+ this.selectRef.value = this.value;
90
+ }
98
91
  }
99
92
  render() {
100
- return (h(Host, { key: '92b4679d9a9fb77628934ed90e00b1eafc593a3e', class: FormSelectClass.root, size: this.size }, this.h.hasSlot('prefix') && h("slot", { key: 'b51835a8b6254898a064a41c75f95cc746d46d57', name: "prefix" }), h("span", { key: '2324839a4c3821a46fcdace4755961a96216dadc', class: "element" }, h("select", Object.assign({ key: 'df1fe5989b6d427c0f48d673f951a4b1f5f8b728', id: this.identifier || this.selectId, onFocus: this.onFocusHandler.bind(this), onChange: this.onChangeHandler.bind(this), onBlur: this.onBlurHandler.bind(this), required: this.required, name: this.name, disabled: this.disabled, ref: el => (this.selectRef = el) }, this.inheritedAttributes, { "aria-disabled": toBoolAttrIfDefined(this.disabled), "aria-required": toBoolAttrIfDefined(this.required), "aria-invalid": toBoolAttrIfDefined(this.invalid) }), h("slot", { key: 'bc12463c981b174aa49a791f360d6001230c3fc4' }), Array.isArray(this.optionsState) && this.optionsState.map((option) => {
93
+ return (h(Host, { key: 'd29638f5868731a2324971d197dcd636364a4f6c', class: FormSelectClass.root, size: this.size }, this.h.hasSlot('prefix') && h("slot", { key: '41cc14ee33022a4cf6d10c3d86c8915551221e94', name: "prefix" }), h("span", { key: 'f9c167589fa81f0a060a13d9a31d16ab642d5ad2', class: "element" }, h("select", Object.assign({ key: '2dd5c948ccc7b65674e7d7f730cb2c9567287668', id: this.identifier || this.selectId, onFocus: this.onFocusHandler.bind(this), onChange: this.onChangeHandler.bind(this), onBlur: this.onBlurHandler.bind(this), required: this.required, name: this.name, disabled: this.disabled, ref: el => (this.selectRef = el) }, this.inheritedAttributes, { "aria-disabled": toBoolAttrIfDefined(this.disabled), "aria-required": toBoolAttrIfDefined(this.required), "aria-invalid": toBoolAttrIfDefined(this.invalid) }), h("slot", { key: 'f6f0b21c9e43e1216446bce09c57a757a40d7b7b' }), Array.isArray(this.optionsState) && this.optionsState.map((option) => {
101
94
  var _a;
102
95
  return (h("option", { value: option.value, selected: option.value === this.value, disabled: option === null || option === void 0 ? void 0 : option.disabled }, (_a = option.label) !== null && _a !== void 0 ? _a : option.value));
103
- })), this.success && h("gov-icon", { key: 'def96c72b9bd804797472954d591e16d25860036', class: "validation-icon", name: "check-lg", type: "components" }), this.invalid && h("gov-icon", { key: 'e20c8d4bac094529ff51d8412ae2105401edcf98', class: "validation-icon", name: "exclamation-lg", type: "components" }), h("gov-icon", { key: 'e004aae985d9de1202fb50c06f5baa4d12c19fd2', class: "arrow-icon", name: "chevron-down", type: "components" })), this.h.hasSlot('sufix') && h("slot", { key: '72b7791037616836108a7420d13b21bf44fdeb85', name: "sufix" })));
96
+ })), this.success && h("gov-icon", { key: 'd94a0191bc7d02d55450dfad627457101226ad22', class: "validation-icon", name: "check-lg", type: "components" }), this.invalid && h("gov-icon", { key: '84ecf7197313c8a145efa54730d22068679df3f5', class: "validation-icon", name: "exclamation-lg", type: "components" }), h("gov-icon", { key: '1a219d4d230466ac15e316eee16d4a55db1889fe', class: "arrow-icon", name: "chevron-down", type: "components" })), this.h.hasSlot('sufix') && h("slot", { key: 'c7f4816548e3494de94f7ff0dd33f6c904acc14b', name: "sufix" })));
104
97
  }
105
98
  onFocusHandler(e) {
106
99
  this.focused = true;
@@ -1 +1 @@
1
- {"version":3,"file":"gov-form-select.entry.js","sources":["../../../packages/core/src/components/gov-form/select/gov-form-select.tsx"],"sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from '@stencil/core'\nimport {govForm} from '../../../helpers/Dom/form'\nimport {GovForm} from '../../../helpers/Dom/form.types'\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from '../../../helpers/Dom/template'\nimport {GovHost} from '../../../helpers/Dom/template.types'\nimport {validateProp} from '../../../helpers/Validate/props'\nimport {createID} from '../../../utils/string.utils'\nimport {FormSelectClass, FormSelectSizes, FormSelectSizesType,} from './constants'\nimport {FormSelectEvent, FormSelectOption} from './gov-form-select.types'\nimport {propsValueToArray} from \"../../../utils/array.utils\";\nimport {tick} from \"../../../utils/stencil.utils\";\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\n\n@Component({\n\ttag: 'gov-form-select',\n})\nexport class GovFormSelect {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\tprivate selectRef?: HTMLSelectElement\n\tprivate attributeObserver: AttributeObserver\n\n\tprivate readonly selectId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t\tthis.selectId = createID('GovSelect')\n\t}\n\n\t@Element() host: HTMLGovFormSelectElement\n\t/**\n\t * Value of select\n\t */\n\t@Prop({reflect: true, mutable: true}) value: string\n\t/**\n\t * Options of select\n\t */\n\t@Prop({reflect: true, mutable: true}) options?: string | FormSelectOption[]\n\t/**\n\t * Custom select identifier.\n\t */\n\t@Prop({attribute: 'identifier'}) readonly identifier: string\n\t/**\n\t * Select’s size.\n\t */\n\t@Prop() readonly size?: FormSelectSizesType = 'm'\n\t/**\n\t * Name of the select.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Indicates the entered value of child form element does conform to the format expected by the application.\n\t */\n\t@Prop({reflect: true}) readonly success: boolean\n\t/**\n\t * Makes the select component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Emitted when the select has focus.\n\t */\n\t@Event({eventName: 'gov-focus'}) govFocus: EventEmitter<FormSelectEvent>\n\t/**\n\t * Emitted when the select loses focus.\n\t */\n\t@Event({eventName: 'gov-blur'}) govBlur: EventEmitter<FormSelectEvent>\n\t/**\n\t * Emitted when the select change value.\n\t */\n\t@Event({eventName: 'gov-change'}) govChange: EventEmitter<FormSelectEvent>\n\t@State() focused: boolean\n\t@State() optionsState: FormSelectOption[] = []\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormSelectSizes, newValue, FormSelectClass.root)\n\t}\n\n\t@Watch('options')\n\twatchOptions(newValue: string | FormSelectOption[]): void {\n\t\tthis.optionsState = propsValueToArray(newValue)\n\t}\n\n\t@Watch('disabled')\n\t@Watch('invalid')\n\t@Watch('success')\n\t@Watch('size')\n\twatchControlAttrs(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\t@Watch('value')\n\twatchValue(): void {\n\t\tthis.markSelectedValue()\n\t}\n\n\t@State() inheritedAttributes: Attributes = {}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl('size', this.size)\n\t\tthis.f.passAttrToControl('invalid', toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl('success', toBoolAttr(this.success))\n\t\tthis.f.passAttrToControl('disabled', toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl('type', 'select')\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\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateSize(this.size)\n\n\t\tthis.markSelectedValue()\n\n\t\tthis.optionsState = propsValueToArray(this.options)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.passControlAttrs()\n\t\tthis.f.passAttrToLabel('required', String(this.required))\n\t\ttick(() => this.markSelectedValue())\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\tprivate markSelectedValue() {\n\t\tthis.host.querySelectorAll('option').forEach((option: HTMLOptionElement) => {\n\t\t\tif (option.value === this.value) {\n\t\t\t\toption.setAttribute('selected', 'selected')\n\t\t\t} else {\n\t\t\t\toption.removeAttribute('selected')\n\t\t\t}\n\t\t})\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormSelectClass.root} size={this.size}>\n\t\t\t\t{this.h.hasSlot('prefix') && <slot name=\"prefix\"></slot>}\n\t\t\t\t<span class=\"element\">\n\t\t\t\t\t<select\n\t\t\t\t\t\tid={this.identifier || this.selectId}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\tref={el => (this.selectRef = el as HTMLSelectElement)}\n\t\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t{Array.isArray(this.optionsState) && this.optionsState.map((option) => {\n\t\t\t\t\t\t\treturn (<option value={option.value} selected={option.value === this.value}\n\t\t\t\t\t\t\t\t\t\t\tdisabled={option?.disabled}>{option.label ?? option.value}</option>)\n\t\t\t\t\t\t})}\n\t\t\t\t\t</select>\n\t\t\t\t\t{this.success && <gov-icon class=\"validation-icon\" name=\"check-lg\" type=\"components\"></gov-icon>}\n\t\t\t\t\t{this.invalid && <gov-icon class=\"validation-icon\" name=\"exclamation-lg\" type=\"components\"></gov-icon>}\n\t\t\t\t\t<gov-icon class=\"arrow-icon\" name=\"chevron-down\" type=\"components\"></gov-icon>\n\t\t\t\t</span>\n\t\t\t\t{this.h.hasSlot('sufix') && <slot name=\"sufix\"></slot>}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\tthis.focused = true\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\tthis.focused = false\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.value = (e.target as HTMLSelectElement).value\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.selectRef.focus(options)\n\t}\n\n\t/**\n\t * Returns an instance of the native html select element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLSelectElement> {\n\t\treturn this.selectRef\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;MAkBa,aAAa,GAAA,MAAA;AAQzB,IAAA,WAAA,CAAA,OAAA,EAAA;;;;;AAmBA;;AAEG;AACc,QAAA,IAAI,CAAA,IAAA,GAAyB,GAAG;AAKjD;;;AAGG;AACc,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAK1C;;;AAGG;AAC6B,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAkBhD,QAAA,IAAY,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AC,CAAa,EAAA;AACnC,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI;AACnB,QAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;YAClB,SAAS,EAAE,eAAe,CAAC,IAAI;AAC/B,YAAA,aAAa,EAAE,CAAC;YAChB,KAAK,EAAE,IAAI,CAAC,KAAK;AACjB,SAAA,CAAC;;AAGK,IAAA,aAAa,CAAC,CAAa,EAAA;AAClC,QAAA,IAAI,CAAC,OAAO,GAAG,KAAK;AACpB,QAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;YACjB,SAAS,EAAE,eAAe,CAAC,IAAI;AAC/B,YAAA,aAAa,EAAE,CAAC;YAChB,KAAK,EAAE,IAAI,CAAC,KAAK;AACjB,SAAA,CAAC;;AAGK,IAAA,eAAe,CAAC,CAAQ,EAAA;QAC/B,IAAI,CAAC,KAAK,GAAI,CAAC,CAAC,MAA4B,CAAC,KAAK;QAClD,CAAC,CAAC,eAAe,EAAE;AACnB,QAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;YACnB,SAAS,EAAE,eAAe,CAAC,IAAI;AAC/B,YAAA,aAAa,EAAE,CAAC;YAChB,KAAK,EAAE,IAAI,CAAC,KAAK;AACjB,SAAA,CAAC;;AAGH;;AAEG;IAEH,MAAM,QAAQ,CAAC,OAAsB,EAAA;QACpC,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC;;AAGrC;;AAEG;AAEH,IAAA,MAAM,MAAM,GAAA;QACX,OAAO,IAAI,CAAC,SAAS;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"gov-form-select.entry.js","sources":["../../../packages/core/src/components/gov-form/select/gov-form-select.tsx"],"sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from '@stencil/core'\nimport {govForm} from '../../../helpers/Dom/form'\nimport {GovForm} from '../../../helpers/Dom/form.types'\nimport {govHost, toBoolAttr, toBoolAttrIfDefined} from '../../../helpers/Dom/template'\nimport {GovHost} from '../../../helpers/Dom/template.types'\nimport {validateProp} from '../../../helpers/Validate/props'\nimport {createID} from '../../../utils/string.utils'\nimport {FormSelectClass, FormSelectSizes, FormSelectSizesType,} from './constants'\nimport {FormSelectEvent, FormSelectOption} from './gov-form-select.types'\nimport {propsValueToArray} from \"../../../utils/array.utils\";\nimport {AttributeObserver, Attributes} from \"../../../helpers/Dom/attribute\";\nimport {ariaAttributes} from \"../../../helpers/Accessibility/attributes\";\nimport {inheritAriaAttributes} from \"../../../helpers/Accessibility/accessibility\";\n\n@Component({\n\ttag: 'gov-form-select',\n})\nexport class GovFormSelect {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\tprivate selectRef?: HTMLSelectElement\n\tprivate attributeObserver: AttributeObserver\n\n\tprivate readonly selectId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t\tthis.selectId = createID('GovSelect')\n\t}\n\n\t@Element() host: HTMLGovFormSelectElement\n\t/**\n\t * Value of select\n\t */\n\t@Prop({reflect: true, mutable: true}) value: string\n\t/**\n\t * Options of select\n\t */\n\t@Prop({reflect: true, mutable: true}) options?: string | FormSelectOption[]\n\t/**\n\t * Custom select identifier.\n\t */\n\t@Prop({attribute: 'identifier'}) readonly identifier: string\n\t/**\n\t * Select’s size.\n\t */\n\t@Prop() readonly size?: FormSelectSizesType = 'm'\n\t/**\n\t * Name of the select.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Indicates the entered value of child form element does conform to the format expected by the application.\n\t */\n\t@Prop({reflect: true}) readonly success: boolean\n\t/**\n\t * Makes the select component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Emitted when the select has focus.\n\t */\n\t@Event({eventName: 'gov-focus'}) govFocus: EventEmitter<FormSelectEvent>\n\t/**\n\t * Emitted when the select loses focus.\n\t */\n\t@Event({eventName: 'gov-blur'}) govBlur: EventEmitter<FormSelectEvent>\n\t/**\n\t * Emitted when the select change value.\n\t */\n\t@Event({eventName: 'gov-change'}) govChange: EventEmitter<FormSelectEvent>\n\t@State() focused: boolean\n\t@State() optionsState: FormSelectOption[] = []\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormSelectSizes, newValue, FormSelectClass.root)\n\t}\n\n\t@Watch('options')\n\twatchOptions(newValue: string | FormSelectOption[]): void {\n\t\tthis.optionsState = propsValueToArray(newValue)\n\t}\n\n\t@Watch('disabled')\n\t@Watch('invalid')\n\t@Watch('success')\n\t@Watch('size')\n\twatchControlAttrs(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\t@Watch('value')\n\twatchValue(): void {\n\t\tthis.syncSelectValue()\n\t}\n\n\t@State() inheritedAttributes: Attributes = {}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl('size', this.size)\n\t\tthis.f.passAttrToControl('invalid', toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl('success', toBoolAttr(this.success))\n\t\tthis.f.passAttrToControl('disabled', toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl('type', 'select')\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\n\t\tthis.syncSelectValue()\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.attributeObserver?.stopObserving();\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateSize(this.size)\n\t\tthis.optionsState = propsValueToArray(this.options)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.passControlAttrs()\n\t\tthis.f.passAttrToLabel('required', String(this.required))\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\tprivate syncSelectValue() {\n\t\tif (this.selectRef && this.value !== undefined && this.selectRef.value !== this.value) {\n\t\t\tthis.selectRef.value = this.value\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormSelectClass.root} size={this.size}>\n\t\t\t\t{this.h.hasSlot('prefix') && <slot name=\"prefix\"></slot>}\n\t\t\t\t<span class=\"element\">\n\t\t\t\t\t<select\n\t\t\t\t\t\tid={this.identifier || this.selectId}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\tref={el => (this.selectRef = el as HTMLSelectElement)}\n\t\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t{Array.isArray(this.optionsState) && this.optionsState.map((option) => {\n\t\t\t\t\t\t\treturn (<option value={option.value} selected={option.value === this.value}\n\t\t\t\t\t\t\t\t\t\t\tdisabled={option?.disabled}>{option.label ?? option.value}</option>)\n\t\t\t\t\t\t})}\n\t\t\t\t\t</select>\n\t\t\t\t\t{this.success && <gov-icon class=\"validation-icon\" name=\"check-lg\" type=\"components\"></gov-icon>}\n\t\t\t\t\t{this.invalid && <gov-icon class=\"validation-icon\" name=\"exclamation-lg\" type=\"components\"></gov-icon>}\n\t\t\t\t\t<gov-icon class=\"arrow-icon\" name=\"chevron-down\" type=\"components\"></gov-icon>\n\t\t\t\t</span>\n\t\t\t\t{this.h.hasSlot('sufix') && <slot name=\"sufix\"></slot>}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\tthis.focused = true\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\tthis.focused = false\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\tprivate onChangeHandler(e: Event) {\n\t\tthis.value = (e.target as HTMLSelectElement).value\n\t\te.stopPropagation()\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.value,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.selectRef.focus(options)\n\t}\n\n\t/**\n\t * Returns an instance of the native html select element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLSelectElement> {\n\t\treturn this.selectRef\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;MAiBa,aAAa,GAAA,MAAA;AAQzB,IAAA,WAAA,CAAA,OAAA,EAAA;;;;;AAmBA;;AAEG;AACc,QAAA,IAAI,CAAA,IAAA,GAAyB,GAAG;AAKjD;;;AAGG;AACc,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAK1C;;;AAGG;AAC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B,SAAS,EAAE,eAAe,CAAC,IAAI;AAC/B,YAAA,aAAa,EAAE,CAAC;YAChB,KAAK,EAAE,IAAI,CAAC,KAAK;AACjB,SAAA,CAAC;;AAGK,IAAA,aAAa,CAAC,CAAa,EAAA;AAClC,QAAA,IAAI,CAAC,OAAO,GAAG,KAAK;AACpB,QAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;YACjB,SAAS,EAAE,eAAe,CAAC,IAAI;AAC/B,YAAA,aAAa,EAAE,CAAC;YAChB,KAAK,EAAE,IAAI,CAAC,KAAK;AACjB,SAAA,CAAC;;AAGK,IAAA,eAAe,CAAC,CAAQ,EAAA;QAC/B,IAAI,CAAC,KAAK,GAAI,CAAC,CAAC,MAA4B,CAAC,KAAK;QAClD,CAAC,CAAC,eAAe,EAAE;AACnB,QAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;YACnB,SAAS,EAAE,eAAe,CAAC,IAAI;AAC/B,YAAA,aAAa,EAAE,CAAC;YAChB,KAAK,EAAE,IAAI,CAAC,KAAK;AACjB,SAAA,CAAC;;AAGH;;AAEG;IAEH,MAAM,QAAQ,CAAC,OAAsB,EAAA;QACpC,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC;;AAGrC;;AAEG;AAEH,IAAA,MAAM,MAAM,GAAA;QACX,OAAO,IAAI,CAAC,SAAS;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"gov-tooltip.gov-tooltip-content.entry.js","sources":["../../../packages/core/src/components/gov-tooltip/constants.tsx","../../../packages/core/src/components/gov-tooltip/gov-tooltip.tsx","../../../packages/core/src/components/gov-tooltip/gov-tooltip-content.tsx"],"sourcesContent":["import { Colors } from '../../core/constants/colors'\nimport { Sizes } from '../../core/constants/sizes'\nimport { ValueOf } from '../../types/interfaces'\nimport { pick } from '../../utils/utils'\n\nexport const TooltipColors = pick(Colors, ['PRIMARY', 'NEUTRAL'])\nexport type TooltipColorType = `${ValueOf<typeof TooltipColors>}`\n\nexport const TooltipSize = pick(Sizes, ['_S', '_M', '_L'])\nexport type TooltipSizeType = `${ValueOf<typeof TooltipSize>}`\n\nexport enum TooltipPosition {\n\tTOP = 'top',\n\tRIGHT = 'right',\n\tBOTTOM = 'bottom',\n\tLEFT = 'left',\n}\nexport type TooltipPositionType = `${ValueOf<typeof TooltipPosition>}`\n\nexport const TooltipClass = {\n\troot: 'gov-tooltip',\n}\n\nexport const TooltipContentClass = {\n\troot: 'gov-tooltip-content',\n}\n","import {Component, Element, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../helpers/Validate/props\"\nimport {\n\tTooltipClass,\n\tTooltipContentClass,\n\tTooltipPosition,\n\tTooltipPositionType,\n\tTooltipSize,\n\tTooltipSizeType,\n\tTooltipColors,\n\tTooltipColorType,\n} from \"./constants\"\nimport {createID} from \"../../utils/string.utils\"\nimport {govHost} from \"../../helpers/Dom/template\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {documentNode} from \"../../helpers/Dom/win\";\nimport {Nullable} from \"../../utils/helpers.types\";\nimport {tick} from \"../../utils/stencil.utils\";\n\n@Component({\n\ttag: \"gov-tooltip\",\n})\nexport class GovTooltip {\n\tprivate h: GovHost\n\tprivate readonly tooltipContentId = undefined\n\tprivate readonly tooltipId = undefined\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.tooltipId = createID(\"GovTooltip\")\n\t\tthis.tooltipContentId = createID(\"GovContentTooltip\")\n\t}\n\n\t@Element() host: HTMLGovTooltipElement\n\t/**\n\t * Style variation of the tooltip\n\t */\n\t@Prop() readonly color?: TooltipColorType = TooltipColors.PRIMARY\n\t/**\n\t * Tooltip’s size.\n\t */\n\t@Prop() readonly size?: TooltipSizeType = TooltipSize._M\n\t/**\n\t * Tooltip display position\n\t */\n\t@Prop({mutable: true}) position: TooltipPositionType = \"right\"\n\t/**\n\t * Information contained in the tooltip\n\t */\n\t@Prop() readonly message: string = undefined\n\t/**\n\t * Custom tooltip identifier.\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Trigger is just an icon\n\t */\n\t@Prop({reflect: true}) readonly icon: boolean = undefined\n\n\t@State() persist = false\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(TooltipColors, newValue, TooltipClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(TooltipSize, newValue, TooltipClass.root)\n\t}\n\n\t@Watch(\"position\")\n\tvalidatePosition(newValue: string): void {\n\t\tvalidateProp(TooltipPosition, newValue, TooltipClass.root)\n\t}\n\n\t@Watch(\"message\")\n\trerenderMessage(): void {\n\t\tthis.createContentWrapper();\n\t}\n\n\tconnectedCallback() {\n\t\tthis.createContentWrapper()\n\t\tthis.registerListeners()\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateColor(this.color)\n\t\tthis.validateSize(this.size)\n\t\tthis.validatePosition(this.position)\n\t}\n\n\tcomponentDidUpdate() {\n\t\tthis.createContentWrapper()\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.removeContent()\n\t}\n\n\tprivate createContentWrapper() {\n\t\tif (this.tooltipContent) {\n\t\t\tif (this.message) {\n\t\t\t\tthis.tooltipContent.innerHTML = this.message\n\t\t\t} else if (this.insideContent) {\n\t\t\t\tthis.tooltipContent.innerHTML = this.insideContent.innerHTML\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tlet content: HTMLGovTooltipContentElement;\n\t\tif (this.insideContent) {\n\t\t\tcontent = this.insideContent\n\t\t} else {\n\t\t\tcontent = documentNode().createElement(TooltipContentClass.root) as HTMLGovTooltipContentElement\n\t\t\tcontent.innerHTML = this.message\n\t\t}\n\n\t\tcontent.setAttribute(\"id\", this.identifier ?? this.tooltipContentId)\n\t\tcontent.setAttribute(\"parent-id\", this.tooltipId)\n\t\tcontent.setAttribute(\"color\", this.color)\n\t\tcontent.setAttribute(\"size\", this.size)\n\t\tdocumentNode().body.appendChild(content)\n\t}\n\n\tprivate get tooltipContent(): Nullable<HTMLGovTooltipContentElement> {\n\t\treturn documentNode().body.querySelector(`#${this.identifier ?? this.tooltipContentId}`);\n\t}\n\n\tprivate get insideContent(): Nullable<HTMLGovTooltipContentElement> {\n\t\treturn this.host.querySelector(TooltipContentClass.root)\n\t}\n\n\tprivate registerListeners() {\n\t\tthis.host.addEventListener(\"click\", e => {\n\t\t\te.preventDefault()\n\t\t\tthis.persist = true\n\t\t\tif (this.tooltipContent) {\n\t\t\t\tthis.tooltipContent.setAttribute(\"persist\", \"true\")\n\t\t\t}\n\t\t\tthis.showTooltip()\n\t\t})\n\t\tthis.host.addEventListener(\"mouseenter\", e => {\n\t\t\te.preventDefault()\n\t\t\tthis.showTooltip()\n\t\t})\n\t\tthis.host.addEventListener(\"mouseleave\", e => {\n\t\t\te.preventDefault()\n\t\t\tif (this.persist === false) {\n\t\t\t\tthis.hideTooltip()\n\t\t\t}\n\t\t})\n\t}\n\n\tprivate verifyPositionSpace() {\n\t\tconst offset = 12\n\t\tconst windowWidth = window.innerWidth - (window.innerWidth - document.documentElement.clientWidth);\n\t\tconst trigger = this.host.getBoundingClientRect()\n\t\tconst trgWidth = this.host.offsetWidth\n\t\tconst trgHeight = this.host.offsetHeight\n\t\tconst contentWidth = this.tooltipContent.offsetWidth\n\t\tconst contentHeight = this.tooltipContent.offsetHeight\n\t\tconst triggerPos = {\n\t\t\tleft: trigger.left + document.documentElement.scrollLeft,\n\t\t\ttop: trigger.top + document.documentElement.scrollTop,\n\t\t}\n\n\t\tconst isRightSpace = ((triggerPos.left + offset + trigger.width) + contentWidth) <= windowWidth;\n\t\tconst isLeftSpace = triggerPos.left > contentWidth;\n\n\t\t// LEFT/RIGHT\n\t\tif (this.position === TooltipPosition.LEFT || this.position === TooltipPosition.RIGHT) {\n\t\t\tthis.tooltipContent.style.top = (triggerPos.top - ((contentHeight - trgHeight) / 2)) + \"px\";\n\t\t\tif (isRightSpace === false && isLeftSpace === false) {\n\t\t\t\tthis.position = TooltipPosition.TOP\n\t\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.TOP)\n\t\t\t}\n\t\t\tif (isLeftSpace && isRightSpace === false && this.position === TooltipPosition.RIGHT) {\n\t\t\t\tthis.position = TooltipPosition.LEFT\n\t\t\t}\n\t\t\tif (isRightSpace && isLeftSpace === false && this.position === TooltipPosition.LEFT) {\n\t\t\t\tthis.position = TooltipPosition.RIGHT\n\t\t\t}\n\t\t}\n\t\tif (this.position === TooltipPosition.RIGHT) {\n\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.RIGHT)\n\t\t\tthis.tooltipContent.style.left = (triggerPos.left + offset + trigger.width) + \"px\"\n\t\t}\n\t\tif (this.position === TooltipPosition.LEFT) {\n\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.LEFT)\n\t\t\tthis.tooltipContent.style.left = (triggerPos.left - (contentWidth + offset)) + \"px\"\n\t\t}\n\n\t\t// LEFT/RIGHT FOR TOP/BOTTOM\n\t\tif (this.position === TooltipPosition.TOP || this.position === TooltipPosition.BOTTOM) {\n\t\t\tif (contentWidth > trgWidth) {\n\t\t\t\tlet leftPosition = (triggerPos.left - ((contentWidth - trgWidth) / 2));\n\t\t\t\tconst isNotLeftSpace = leftPosition < 0;\n\t\t\t\tconst isNotRightSpace = (leftPosition + contentWidth) > windowWidth;\n\t\t\t\tif (isNotLeftSpace && isNotRightSpace) {\n\t\t\t\t\tthis.tooltipContent.style.width = \"auto\";\n\t\t\t\t\tthis.tooltipContent.style.left = offset + \"px\";\n\t\t\t\t\tthis.tooltipContent.style.right = offset + \"px\";\n\t\t\t\t} else {\n\t\t\t\t\tif (isNotLeftSpace) {\n\t\t\t\t\t\tleftPosition = offset\n\t\t\t\t\t}\n\t\t\t\t\tif (isNotRightSpace) {\n\t\t\t\t\t\tleftPosition = leftPosition - ((windowWidth - (leftPosition + contentWidth + offset)) * -1)\n\t\t\t\t\t}\n\t\t\t\t\tthis.tooltipContent.style.left = leftPosition + \"px\"\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst leftPosition = (triggerPos.left + ((trgWidth - contentWidth) / 2))\n\n\t\t\t\tthis.tooltipContent.style.left = leftPosition + \"px\"\n\t\t\t}\n\t\t}\n\t\tif (this.position === TooltipPosition.TOP) {\n\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.TOP)\n\t\t\tthis.tooltipContent.style.top = (triggerPos.top - (contentHeight + offset)) + \"px\"\n\t\t}\n\t\tif (this.position === TooltipPosition.BOTTOM) {\n\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.BOTTOM)\n\t\t\tthis.tooltipContent.style.top = (triggerPos.top + (trgHeight + offset)) + \"px\"\n\t\t}\n\n\t\tthis.tooltipContent.style.opacity = '1'\n\n\t}\n\n\tprivate showTooltip() {\n\t\tif (this.tooltipContent) {\n\t\t\tthis.tooltipContent.style.opacity = '0'\n\t\t\tthis.tooltipContent.hidden = false\n\t\t\tthis.tooltipContent.setAttribute(\"is-visible\", \"true\")\n\t\t\ttick(() => {\n\t\t\t\tthis.verifyPositionSpace()\n\t\t\t})\n\t\t}\n\t}\n\n\tprivate hideTooltip() {\n\t\tif (this.tooltipContent) {\n\t\t\tthis.tooltipContent.setAttribute(\"is-visible\", \"false\")\n\t\t\tthis.tooltipContent.setAttribute(\"persist\", \"false\")\n\t\t\tthis.tooltipContent.removeAttribute('style')\n\t\t}\n\t}\n\n\tprivate removeContent() {\n\t\tconst contentEl = document.getElementById(this.tooltipContentId)\n\t\tif (contentEl) {\n\t\t\tcontentEl.remove()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tid={this.tooltipId}\n\t\t\t\tclass={this.h.classes(TooltipClass.root)}\n\t\t\t\tposition={this.position}>\n\t\t\t\t<span role={'button'}\n\t\t\t\t\t\t\ttabindex={0}\n\t\t\t\t\t\t\tonKeyPress={() => this.showTooltip()}\n\t\t\t\t\t\t\tonBlur={() => {\n\t\t\t\t\t\t\t\tif (this.persist === false) {\n\t\t\t\t\t\t\t\t\tthis.hideTooltip()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\taria-describedby={this.identifier ?? this.tooltipContentId}><slot/></span>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Showing the modal\n\t */\n\t@Method()\n\tasync show(): Promise<void> {\n\t\tthis.showTooltip()\n\t}\n\n\t/**\n\t * Hiding the modal\n\t */\n\t@Method()\n\tasync hide(): Promise<void> {\n\t\tthis.persist = false\n\t\tthis.hideTooltip()\n\t}\n}\n","import { Component, Element, h, Host, Prop, Watch } from \"@stencil/core\"\nimport { TooltipContentClass, TooltipSize, TooltipSizeType, TooltipColors, TooltipColorType } from \"./constants\"\nimport { toBoolAttr } from \"../../helpers/Dom/template\"\n\n@Component({\n\ttag: \"gov-tooltip-content\",\n})\nexport class GovTooltipContent {\n\tprivate timeout\n\n\t@Element() host: HTMLGovTooltipContentElement\n\t/**\n\t * Style variation of the tooltip\n\t */\n\t@Prop() readonly color?: TooltipColorType = TooltipColors.PRIMARY\n\t/**\n\t * Tooltip’s size.\n\t */\n\t@Prop() readonly size?: TooltipSizeType = TooltipSize._M\n\t/**\n\t * Tooltip is still visible.\n\t */\n\t@Prop() persist?: boolean = false\n\t/**\n\t * Indicates display of tooltip content\n\t */\n\t@Prop({ attribute: \"is-visible\", mutable: true }) isVisible = false\n\t/**\n\t * Indicates display of tooltip content\n\t */\n\t@Prop({ attribute: \"parent-id\" }) parentId: string = null\n\n\t@Watch(\"isVisible\")\n\tvisibleContent(newValue: boolean): void {\n\t\tclearTimeout(this.timeout)\n\t\tif (newValue === false) {\n\t\t\tthis.timeout = setTimeout(() => {\n\t\t\t\tthis.host.style.visibility = \"hidden\"\n\t\t\t}, 250)\n\t\t} else {\n\t\t\tthis.host.style.visibility = \"visible\"\n\t\t}\n\t}\n\n\thideContent() {\n\t\tthis.isVisible = false\n\t\tthis.persist = false\n\t\tconst parentEl = document.getElementById(this.parentId) as HTMLGovTooltipElement\n\t\tif (parentEl) {\n\t\t\tparentEl.hide().catch()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={TooltipContentClass.root}\n\t\t\t\trole={\"tooltip\"}\n\t\t\t\thidden={!this.isVisible}\n\t\t\t\taria-hidden={!toBoolAttr(this.isVisible)}\n\t\t\t\tis-visible={this.isVisible}>\n\t\t\t\t<slot></slot>\n\t\t\t\t{this.persist ? (\n\t\t\t\t\t<gov-button\n\t\t\t\t\t\ton-gov-click={this.hideContent.bind(this)}\n\t\t\t\t\t\tcolor={this.color}\n\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\ttype={\"base\"}>\n\t\t\t\t\t\t<gov-icon slot={\"icon-start\"} name={\"x-lg\"} type={\"components\"}></gov-icon>\n\t\t\t\t\t</gov-button>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;AAKO,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AAG1D,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAG1D,IAAY,eAKX;AALD,CAAA,UAAY,eAAe,EAAA;AAC1B,IAAA,eAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACX,IAAA,eAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,eAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,eAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACd,CAAC,EALW,eAAe,KAAf,eAAe,GAK1B,EAAA,CAAA,CAAA;AAGM,MAAM,YAAY,GAAG;AAC3B,IAAA,IAAI,EAAE,aAAa;CACnB;AAEM,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M,QAAQ,GAAG,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAA0B;QAChF,IAAI,QAAQ,EAAE;AACb,YAAA,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE;;;IAIzB,MAAM,GAAA;QACL,QACC,CAAA,CAAC,IAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EACJ,KAAK,EAAE,mBAAmB,CAAC,IAAI,EAC/B,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,CAAC,IAAI,CAAC,SAAS,EAAA,aAAA,EACV,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,EAC5B,YAAA,EAAA,IAAI,CAAC,SAAS,EAAA,EAC1B,CAAa,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,EACZ,IAAI,CAAC,OAAO,IACZ,CACe,CAAA,YAAA,EAAA,EAAA,cAAA,EAAA,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EACzC,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,IAAI,EAAE,MAAM,EAAA,EACZ,CAAU,CAAA,UAAA,EAAA,EAAA,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAa,CAAA,CAC/D,IACV,IAAI,CACF;;;;;;;;;;"}
1
+ {"version":3,"file":"gov-tooltip.gov-tooltip-content.entry.js","sources":["../../../packages/core/src/components/gov-tooltip/constants.tsx","../../../packages/core/src/components/gov-tooltip/gov-tooltip.tsx","../../../packages/core/src/components/gov-tooltip/gov-tooltip-content.tsx"],"sourcesContent":["import { Colors } from '../../core/constants/colors'\nimport { Sizes } from '../../core/constants/sizes'\nimport { ValueOf } from '../../types/interfaces'\nimport { pick } from '../../utils/utils'\n\nexport const TooltipColors = pick(Colors, ['PRIMARY', 'NEUTRAL'])\nexport type TooltipColorType = `${ValueOf<typeof TooltipColors>}`\n\nexport const TooltipSize = pick(Sizes, ['_S', '_M', '_L'])\nexport type TooltipSizeType = `${ValueOf<typeof TooltipSize>}`\n\nexport enum TooltipPosition {\n\tTOP = 'top',\n\tRIGHT = 'right',\n\tBOTTOM = 'bottom',\n\tLEFT = 'left',\n}\nexport type TooltipPositionType = `${ValueOf<typeof TooltipPosition>}`\n\nexport const TooltipClass = {\n\troot: 'gov-tooltip',\n}\n\nexport const TooltipContentClass = {\n\troot: 'gov-tooltip-content',\n}\n","import {Component, Element, h, Host, Method, Prop, State, Watch} from \"@stencil/core\"\nimport {validateProp} from \"../../helpers/Validate/props\"\nimport {\n\tTooltipClass,\n\tTooltipContentClass,\n\tTooltipPosition,\n\tTooltipPositionType,\n\tTooltipSize,\n\tTooltipSizeType,\n\tTooltipColors,\n\tTooltipColorType,\n} from \"./constants\"\nimport {createID} from \"../../utils/string.utils\"\nimport {govHost} from \"../../helpers/Dom/template\"\nimport {GovHost} from \"../../helpers/Dom/template.types\"\nimport {documentNode} from \"../../helpers/Dom/win\";\nimport {Nullable} from \"../../utils/helpers.types\";\nimport {tick} from \"../../utils/stencil.utils\";\n\n@Component({\n\ttag: \"gov-tooltip\",\n})\nexport class GovTooltip {\n\tprivate h: GovHost\n\tprivate readonly tooltipContentId = undefined\n\tprivate readonly tooltipId = undefined\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.tooltipId = createID(\"GovTooltip\")\n\t\tthis.tooltipContentId = createID(\"GovContentTooltip\")\n\t}\n\n\t@Element() host: HTMLGovTooltipElement\n\t/**\n\t * Style variation of the tooltip\n\t */\n\t@Prop() readonly color?: TooltipColorType = TooltipColors.PRIMARY\n\t/**\n\t * Tooltip’s size.\n\t */\n\t@Prop() readonly size?: TooltipSizeType = TooltipSize._M\n\t/**\n\t * Tooltip display position\n\t */\n\t@Prop({mutable: true}) position: TooltipPositionType = \"right\"\n\t/**\n\t * Information contained in the tooltip\n\t */\n\t@Prop() readonly message: string = undefined\n\t/**\n\t * Custom tooltip identifier.\n\t */\n\t@Prop({attribute: \"identifier\"}) readonly identifier: string\n\t/**\n\t * Trigger is just an icon\n\t */\n\t@Prop({reflect: true}) readonly icon: boolean = undefined\n\n\t@State() persist = false\n\n\t@Watch(\"color\")\n\tvalidateColor(newValue: string): void {\n\t\tvalidateProp(TooltipColors, newValue, TooltipClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(TooltipSize, newValue, TooltipClass.root)\n\t}\n\n\t@Watch(\"position\")\n\tvalidatePosition(newValue: string): void {\n\t\tvalidateProp(TooltipPosition, newValue, TooltipClass.root)\n\t}\n\n\t@Watch(\"message\")\n\trerenderMessage(): void {\n\t\tthis.createContentWrapper();\n\t}\n\n\tconnectedCallback() {\n\t\tthis.createContentWrapper()\n\t\tthis.registerListeners()\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateColor(this.color)\n\t\tthis.validateSize(this.size)\n\t\tthis.validatePosition(this.position)\n\t}\n\n\tcomponentDidUpdate() {\n\t\tthis.createContentWrapper()\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.resizeObserver?.disconnect()\n\t\tthis.resizeObserver = undefined\n\t\twindow.removeEventListener(\"resize\", this.reposition)\n\t\tthis.repositionListenersAttached = false\n\t\tthis.removeContent()\n\t}\n\n\tprivate createContentWrapper() {\n\t\tif (this.tooltipContent) {\n\t\t\tif (this.message != null) {\n\t\t\t\tthis.tooltipContent.setAttribute(\"message\", this.message)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tlet content: HTMLGovTooltipContentElement;\n\t\tif (this.insideContent) {\n\t\t\tcontent = this.insideContent\n\t\t} else {\n\t\t\tcontent = documentNode().createElement(TooltipContentClass.root) as HTMLGovTooltipContentElement\n\t\t\tif (this.message != null) {\n\t\t\t\tcontent.setAttribute(\"message\", this.message)\n\t\t\t}\n\t\t}\n\n\t\tcontent.setAttribute(\"id\", this.identifier ?? this.tooltipContentId)\n\t\tcontent.setAttribute(\"parent-id\", this.tooltipId)\n\t\tcontent.setAttribute(\"color\", this.color)\n\t\tcontent.setAttribute(\"size\", this.size)\n\t\tdocumentNode().body.appendChild(content)\n\t}\n\n\tprivate get tooltipContent(): Nullable<HTMLGovTooltipContentElement> {\n\t\treturn documentNode().body.querySelector(`#${this.identifier ?? this.tooltipContentId}`);\n\t}\n\n\tprivate get insideContent(): Nullable<HTMLGovTooltipContentElement> {\n\t\treturn this.host.querySelector(TooltipContentClass.root)\n\t}\n\n\tprivate registerListeners() {\n\t\tthis.host.addEventListener(\"click\", e => {\n\t\t\te.preventDefault()\n\t\t\tthis.persist = true\n\t\t\tif (this.tooltipContent) {\n\t\t\t\tthis.tooltipContent.setAttribute(\"persist\", \"true\")\n\t\t\t}\n\t\t\tthis.showTooltip()\n\t\t})\n\t\tthis.host.addEventListener(\"mouseenter\", e => {\n\t\t\te.preventDefault()\n\t\t\tthis.showTooltip()\n\t\t})\n\t\tthis.host.addEventListener(\"mouseleave\", e => {\n\t\t\te.preventDefault()\n\t\t\tif (this.persist === false) {\n\t\t\t\tthis.hideTooltip()\n\t\t\t}\n\t\t})\n\t}\n\n\tprivate verifyPositionSpace() {\n\t\tconst offset = 12\n\t\tconst windowWidth = window.innerWidth - (window.innerWidth - document.documentElement.clientWidth);\n\t\tconst trigger = this.host.getBoundingClientRect()\n\t\tconst trgWidth = this.host.offsetWidth\n\t\tconst trgHeight = this.host.offsetHeight\n\t\tconst contentWidth = this.tooltipContent.offsetWidth\n\t\tconst contentHeight = this.tooltipContent.offsetHeight\n\t\tconst triggerPos = {\n\t\t\tleft: trigger.left + document.documentElement.scrollLeft,\n\t\t\ttop: trigger.top + document.documentElement.scrollTop,\n\t\t}\n\n\t\tconst isRightSpace = ((triggerPos.left + offset + trigger.width) + contentWidth) <= windowWidth;\n\t\tconst isLeftSpace = triggerPos.left > contentWidth;\n\n\t\t// LEFT/RIGHT\n\t\tif (this.position === TooltipPosition.LEFT || this.position === TooltipPosition.RIGHT) {\n\t\t\tthis.tooltipContent.style.top = (triggerPos.top - ((contentHeight - trgHeight) / 2)) + \"px\";\n\t\t\tif (isRightSpace === false && isLeftSpace === false) {\n\t\t\t\tthis.position = TooltipPosition.TOP\n\t\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.TOP)\n\t\t\t}\n\t\t\tif (isLeftSpace && isRightSpace === false && this.position === TooltipPosition.RIGHT) {\n\t\t\t\tthis.position = TooltipPosition.LEFT\n\t\t\t}\n\t\t\tif (isRightSpace && isLeftSpace === false && this.position === TooltipPosition.LEFT) {\n\t\t\t\tthis.position = TooltipPosition.RIGHT\n\t\t\t}\n\t\t}\n\t\tif (this.position === TooltipPosition.RIGHT) {\n\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.RIGHT)\n\t\t\tthis.tooltipContent.style.left = (triggerPos.left + offset + trigger.width) + \"px\"\n\t\t}\n\t\tif (this.position === TooltipPosition.LEFT) {\n\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.LEFT)\n\t\t\tthis.tooltipContent.style.left = (triggerPos.left - (contentWidth + offset)) + \"px\"\n\t\t}\n\n\t\t// LEFT/RIGHT FOR TOP/BOTTOM\n\t\tif (this.position === TooltipPosition.TOP || this.position === TooltipPosition.BOTTOM) {\n\t\t\tif (contentWidth > trgWidth) {\n\t\t\t\tlet leftPosition = (triggerPos.left - ((contentWidth - trgWidth) / 2));\n\t\t\t\tconst isNotLeftSpace = leftPosition < 0;\n\t\t\t\tconst isNotRightSpace = (leftPosition + contentWidth) > windowWidth;\n\t\t\t\tif (isNotLeftSpace && isNotRightSpace) {\n\t\t\t\t\tthis.tooltipContent.style.width = \"auto\";\n\t\t\t\t\tthis.tooltipContent.style.left = offset + \"px\";\n\t\t\t\t\tthis.tooltipContent.style.right = offset + \"px\";\n\t\t\t\t} else {\n\t\t\t\t\tif (isNotLeftSpace) {\n\t\t\t\t\t\tleftPosition = offset\n\t\t\t\t\t}\n\t\t\t\t\tif (isNotRightSpace) {\n\t\t\t\t\t\tleftPosition = leftPosition - ((windowWidth - (leftPosition + contentWidth + offset)) * -1)\n\t\t\t\t\t}\n\t\t\t\t\tthis.tooltipContent.style.left = leftPosition + \"px\"\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst leftPosition = (triggerPos.left + ((trgWidth - contentWidth) / 2))\n\n\t\t\t\tthis.tooltipContent.style.left = leftPosition + \"px\"\n\t\t\t}\n\t\t}\n\t\tif (this.position === TooltipPosition.TOP) {\n\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.TOP)\n\t\t\tthis.tooltipContent.style.top = (triggerPos.top - (contentHeight + offset)) + \"px\"\n\t\t}\n\t\tif (this.position === TooltipPosition.BOTTOM) {\n\t\t\tthis.tooltipContent.setAttribute(\"position\", TooltipPosition.BOTTOM)\n\t\t\tthis.tooltipContent.style.top = (triggerPos.top + (trgHeight + offset)) + \"px\"\n\t\t}\n\n\t\tthis.tooltipContent.style.opacity = '1'\n\n\t}\n\n\tprivate resizeObserver?: ResizeObserver\n\tprivate repositionListenersAttached = false\n\tprivate readonly reposition = () => {\n\t\tif (this.tooltipContent) {\n\t\t\tthis.verifyPositionSpace()\n\t\t}\n\t}\n\n\tprivate showTooltip() {\n\t\tif (this.tooltipContent) {\n\t\t\tthis.tooltipContent.style.opacity = '0'\n\t\t\tthis.tooltipContent.hidden = false\n\t\t\tthis.tooltipContent.setAttribute(\"is-visible\", \"true\")\n\t\t\ttick(() => {\n\t\t\t\tthis.verifyPositionSpace()\n\t\t\t})\n\t\t\tif (!this.repositionListenersAttached) {\n\t\t\t\tthis.repositionListenersAttached = true\n\t\t\t\tif (typeof ResizeObserver !== \"undefined\") {\n\t\t\t\t\tthis.resizeObserver = new ResizeObserver(this.reposition)\n\t\t\t\t\tthis.resizeObserver.observe(this.tooltipContent)\n\t\t\t\t}\n\t\t\t\twindow.addEventListener(\"resize\", this.reposition)\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate hideTooltip() {\n\t\tif (this.tooltipContent) {\n\t\t\tthis.tooltipContent.setAttribute(\"is-visible\", \"false\")\n\t\t\tthis.tooltipContent.setAttribute(\"persist\", \"false\")\n\t\t\tthis.tooltipContent.removeAttribute('style')\n\t\t}\n\t\tthis.resizeObserver?.disconnect()\n\t\tthis.resizeObserver = undefined\n\t\twindow.removeEventListener(\"resize\", this.reposition)\n\t\tthis.repositionListenersAttached = false\n\t}\n\n\tprivate removeContent() {\n\t\tconst contentEl = document.getElementById(this.tooltipContentId)\n\t\tif (contentEl) {\n\t\t\tcontentEl.remove()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tid={this.tooltipId}\n\t\t\t\tclass={this.h.classes(TooltipClass.root)}\n\t\t\t\tposition={this.position}>\n\t\t\t\t<span role={'button'}\n\t\t\t\t\t\t\ttabindex={0}\n\t\t\t\t\t\t\tonKeyPress={() => this.showTooltip()}\n\t\t\t\t\t\t\tonBlur={() => {\n\t\t\t\t\t\t\t\tif (this.persist === false) {\n\t\t\t\t\t\t\t\t\tthis.hideTooltip()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\taria-describedby={this.identifier ?? this.tooltipContentId}><slot/></span>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\t/**\n\t * Showing the modal\n\t */\n\t@Method()\n\tasync show(): Promise<void> {\n\t\tthis.showTooltip()\n\t}\n\n\t/**\n\t * Hiding the modal\n\t */\n\t@Method()\n\tasync hide(): Promise<void> {\n\t\tthis.persist = false\n\t\tthis.hideTooltip()\n\t}\n}\n","import { Component, Element, h, Host, Prop, Watch } from \"@stencil/core\"\nimport { TooltipContentClass, TooltipSize, TooltipSizeType, TooltipColors, TooltipColorType } from \"./constants\"\nimport { toBoolAttr } from \"../../helpers/Dom/template\"\n\n@Component({\n\ttag: \"gov-tooltip-content\",\n})\nexport class GovTooltipContent {\n\tprivate timeout\n\n\t@Element() host: HTMLGovTooltipContentElement\n\t/**\n\t * Style variation of the tooltip\n\t */\n\t@Prop() readonly color?: TooltipColorType = TooltipColors.PRIMARY\n\t/**\n\t * Tooltip’s size.\n\t */\n\t@Prop() readonly size?: TooltipSizeType = TooltipSize._M\n\t/**\n\t * Tooltip is still visible.\n\t */\n\t@Prop() persist?: boolean = false\n\t/**\n\t * Indicates display of tooltip content\n\t */\n\t@Prop({ attribute: \"is-visible\", mutable: true }) isVisible = false\n\t/**\n\t * Indicates display of tooltip content\n\t */\n\t@Prop({ attribute: \"parent-id\" }) parentId: string = null\n\t/**\n\t * Tooltip text. When set, renders the HTML message; otherwise the default `<slot/>` is used.\n\t */\n\t@Prop({ attribute: \"message\", mutable: true }) message?: string\n\n\t@Watch(\"isVisible\")\n\tvisibleContent(newValue: boolean): void {\n\t\tclearTimeout(this.timeout)\n\t\tif (newValue === false) {\n\t\t\tthis.timeout = setTimeout(() => {\n\t\t\t\tthis.host.style.visibility = \"hidden\"\n\t\t\t}, 250)\n\t\t} else {\n\t\t\tthis.host.style.visibility = \"visible\"\n\t\t}\n\t}\n\n\thideContent() {\n\t\tthis.isVisible = false\n\t\tthis.persist = false\n\t\tconst parentEl = document.getElementById(this.parentId) as HTMLGovTooltipElement\n\t\tif (parentEl) {\n\t\t\tparentEl.hide().catch()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={TooltipContentClass.root}\n\t\t\t\trole={\"tooltip\"}\n\t\t\t\thidden={!this.isVisible}\n\t\t\t\taria-hidden={!toBoolAttr(this.isVisible)}\n\t\t\t\tis-visible={this.isVisible}>\n\t\t\t\t{this.message\n\t\t\t\t\t? <span class=\"gov-tooltip-content__message\" innerHTML={this.message}></span>\n\t\t\t\t\t: <slot></slot>}\n\t\t\t\t{this.persist ? (\n\t\t\t\t\t<gov-button\n\t\t\t\t\t\ton-gov-click={this.hideContent.bind(this)}\n\t\t\t\t\t\tcolor={this.color}\n\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\ttype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