@gov-design-system-ce/components 4.6.3 → 4.6.4

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 (218) 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 +32 -3
  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 +34 -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/components/gov-accordion-item.js +1 -1
  45. package/dist/components/gov-accordion.js +1 -1
  46. package/dist/components/gov-attachments-item.js +1 -1
  47. package/dist/components/gov-attachments.js +1 -1
  48. package/dist/components/gov-backdrop.js +1 -1
  49. package/dist/components/gov-banner.js +1 -1
  50. package/dist/components/gov-banner.js.map +1 -1
  51. package/dist/components/gov-blockquote.js +1 -1
  52. package/dist/components/gov-breadcrumbs.js +1 -1
  53. package/dist/components/gov-breadcrumbs.js.map +1 -1
  54. package/dist/components/gov-button.js +1 -1
  55. package/dist/components/gov-card.js +1 -1
  56. package/dist/components/gov-chip.js +1 -1
  57. package/dist/components/gov-collapsible.js +1 -1
  58. package/dist/components/gov-collapsible.js.map +1 -1
  59. package/dist/components/gov-container.js +1 -1
  60. package/dist/components/gov-control-group.js +1 -1
  61. package/dist/components/gov-cookiebar.js +1 -1
  62. package/dist/components/gov-dialog.js +1 -1
  63. package/dist/components/gov-dropdown.js +1 -1
  64. package/dist/components/gov-empty.js +1 -1
  65. package/dist/components/gov-error-code.js +1 -1
  66. package/dist/components/gov-flex.js +1 -1
  67. package/dist/components/gov-form-autocomplete.js +1 -1
  68. package/dist/components/gov-form-checkbox-group.js +1 -1
  69. package/dist/components/gov-form-checkbox.js +1 -1
  70. package/dist/components/gov-form-control.js +1 -1
  71. package/dist/components/gov-form-file.js +1 -1
  72. package/dist/components/gov-form-file.js.map +1 -1
  73. package/dist/components/gov-form-group.js +1 -1
  74. package/dist/components/gov-form-input.js +1 -1
  75. package/dist/components/gov-form-message.js +1 -1
  76. package/dist/components/gov-form-multi-select.js +1 -1
  77. package/dist/components/gov-form-multi-select.js.map +1 -1
  78. package/dist/components/gov-form-radio-group.js +1 -1
  79. package/dist/components/gov-form-radio.js +1 -1
  80. package/dist/components/gov-form-range.js +1 -1
  81. package/dist/components/gov-form-range.js.map +1 -1
  82. package/dist/components/gov-form-search.js +1 -1
  83. package/dist/components/gov-form-search.js.map +1 -1
  84. package/dist/components/gov-form-select.js +1 -1
  85. package/dist/components/gov-form-switch.js +1 -1
  86. package/dist/components/gov-grid-item.js +1 -1
  87. package/dist/components/gov-grid.js +1 -1
  88. package/dist/components/gov-icon.js +1 -1
  89. package/dist/components/gov-infobar.js +1 -1
  90. package/dist/components/gov-layout-column.js +1 -1
  91. package/dist/components/gov-layout.js +1 -1
  92. package/dist/components/gov-link.js +1 -1
  93. package/dist/components/gov-loading.js +1 -1
  94. package/dist/components/gov-message.js +1 -1
  95. package/dist/components/gov-pagination.js +1 -1
  96. package/dist/components/gov-skeleton.js +1 -1
  97. package/dist/components/gov-spacer.js +1 -1
  98. package/dist/components/gov-stepper-item.js +1 -1
  99. package/dist/components/gov-stepper.js +1 -1
  100. package/dist/components/gov-tabs-item.js +1 -1
  101. package/dist/components/gov-tabs.js +1 -1
  102. package/dist/components/gov-tag.js +1 -1
  103. package/dist/components/gov-theme-switch.js +1 -1
  104. package/dist/components/gov-tile.js +1 -1
  105. package/dist/components/gov-toast.js +1 -1
  106. package/dist/components/gov-tooltip-content.js +1 -1
  107. package/dist/components/gov-tooltip.js +1 -1
  108. package/dist/components/gov-wizard-item.js +1 -1
  109. package/dist/components/gov-wizard.js +1 -1
  110. package/dist/components/{p-DKo9A5gq.js → p-BHRF-5cf.js} +2 -2
  111. package/dist/components/{p-9imLQpxb.js → p-BSr8e18S.js} +2 -2
  112. package/dist/components/{p-BNnuBQvo.js → p-BxS4InzB.js} +2 -2
  113. package/dist/components/{p-CfaJM4SA.js → p-CMmyR4-k.js} +2 -2
  114. package/dist/components/{p-B0KFtEn3.js → p-CU0plGZP.js} +2 -2
  115. package/dist/components/{p-BrdXh0mI.js → p-CXPP9vec.js} +2 -2
  116. package/dist/components/{p-djqfSbq-.js → p-C_URF9Su.js} +2 -2
  117. package/dist/components/{p-yqJEurSE.js → p-CnKqUwf9.js} +2 -2
  118. package/dist/components/p-DEthsMuE.js +2 -0
  119. package/dist/components/p-DEthsMuE.js.map +1 -0
  120. package/dist/components/{p-Bv5L0j6n.js → p-DN5pb9xA.js} +2 -2
  121. package/dist/components/{p-DesycS6d.js → p-iTwUkISB.js} +2 -2
  122. package/dist/components/{p-BZTY3MxF.js → p-ibUK7mfI.js} +2 -2
  123. package/dist/components/p-keC6luw7.js +2 -0
  124. package/dist/components/p-keC6luw7.js.map +1 -0
  125. package/dist/components/p-pJ_vPAO0.js +2 -0
  126. package/dist/components/p-pJ_vPAO0.js.map +1 -0
  127. package/dist/components/p-yIpIIG5A.js +2 -0
  128. package/dist/components/p-yIpIIG5A.js.map +1 -0
  129. package/dist/core/core.css +47 -47
  130. package/dist/core/core.esm.js +1 -1
  131. package/dist/core/gov-banner.entry.esm.js.map +1 -1
  132. package/dist/core/gov-form-autocomplete.entry.esm.js.map +1 -1
  133. package/dist/core/gov-form-file.entry.esm.js.map +1 -1
  134. package/dist/core/gov-form-search.entry.esm.js.map +1 -1
  135. package/dist/core/gov-form-select.entry.esm.js.map +1 -1
  136. package/dist/core/gov-tooltip.gov-tooltip-content.entry.esm.js.map +1 -1
  137. package/dist/core/{p-4da8ac1d.entry.js → p-10991f00.entry.js} +2 -2
  138. package/dist/core/p-19300834.entry.js +2 -0
  139. package/dist/core/{p-bd389bfd.entry.js.map → p-19300834.entry.js.map} +1 -1
  140. package/dist/core/p-4e2faea7.entry.js +2 -0
  141. package/dist/core/p-4e2faea7.entry.js.map +1 -0
  142. package/dist/core/p-7f513718.entry.js +2 -0
  143. package/dist/core/p-7f513718.entry.js.map +1 -0
  144. package/dist/core/p-8d47e346.entry.js +2 -0
  145. package/dist/core/p-8d47e346.entry.js.map +1 -0
  146. package/dist/core/p-DQuL1Twl.js.map +1 -1
  147. package/dist/core/p-afe254cb.entry.js +2 -0
  148. package/dist/core/p-afe254cb.entry.js.map +1 -0
  149. package/dist/core/{p-469f14db.entry.js → p-bec959c4.entry.js} +2 -2
  150. package/dist/core/p-d9d29f50.entry.js +2 -0
  151. package/dist/core/p-d9d29f50.entry.js.map +1 -0
  152. package/dist/core/{p-4d365881.entry.js → p-f75ad657.entry.js} +2 -2
  153. package/dist/esm/app-globals-DQuL1Twl.js.map +1 -1
  154. package/dist/esm/core.js +1 -1
  155. package/dist/esm/gov-banner.entry.js +3 -3
  156. package/dist/esm/gov-banner.entry.js.map +1 -1
  157. package/dist/esm/gov-flex_3.entry.js +1 -1
  158. package/dist/esm/gov-form-autocomplete.entry.js +68 -24
  159. package/dist/esm/gov-form-autocomplete.entry.js.map +1 -1
  160. package/dist/esm/gov-form-file.entry.js +32 -3
  161. package/dist/esm/gov-form-file.entry.js.map +1 -1
  162. package/dist/esm/gov-form-search.entry.js +1 -1
  163. package/dist/esm/gov-form-search.entry.js.map +1 -1
  164. package/dist/esm/gov-form-select.entry.js +8 -15
  165. package/dist/esm/gov-form-select.entry.js.map +1 -1
  166. package/dist/esm/gov-tooltip.gov-tooltip-content.entry.js.map +1 -1
  167. package/dist/esm/gov-tooltip_2.entry.js +34 -9
  168. package/dist/esm/gov-tooltip_2.entry.js.map +1 -1
  169. package/dist/esm/gov-wizard-item.entry.js +2 -2
  170. package/dist/esm/gov-wizard.entry.js +1 -1
  171. package/dist/esm/index-ClISz4NF.js +4 -4
  172. package/dist/esm/loader.js +1 -1
  173. package/dist/hydrate/index.js +154 -60
  174. package/dist/hydrate/index.mjs +154 -60
  175. package/dist/types/Users/jf/dev/designSystem/gov-design-system/packages/core/.stencil/packages/core/stencil.config.d.ts +2 -0
  176. package/dist/types/components/gov-form/autocomplete/autocomplete.utils.d.ts +2 -0
  177. package/dist/types/components/gov-form/autocomplete/gov-form-autocomplete.d.ts +9 -0
  178. package/dist/types/components/gov-form/file/gov-form-file.d.ts +1 -0
  179. package/dist/types/components/gov-form/select/gov-form-select.d.ts +1 -1
  180. package/dist/types/components/gov-tooltip/gov-tooltip-content.d.ts +4 -0
  181. package/dist/types/components/gov-tooltip/gov-tooltip.d.ts +3 -0
  182. package/dist/types/components.d.ts +20 -2
  183. package/package.json +2 -2
  184. package/readme.md +9 -0
  185. package/dist/components/p-DFu5UVoP.js +0 -2
  186. package/dist/components/p-DFu5UVoP.js.map +0 -1
  187. package/dist/components/p-DMVQRz4f.js +0 -2
  188. package/dist/components/p-DMVQRz4f.js.map +0 -1
  189. package/dist/components/p-UDT3DloZ.js +0 -2
  190. package/dist/components/p-UDT3DloZ.js.map +0 -1
  191. package/dist/components/p-x3w8Mun_.js +0 -2
  192. package/dist/components/p-x3w8Mun_.js.map +0 -1
  193. package/dist/core/p-11fc3899.entry.js +0 -2
  194. package/dist/core/p-11fc3899.entry.js.map +0 -1
  195. package/dist/core/p-33b462c9.entry.js +0 -2
  196. package/dist/core/p-33b462c9.entry.js.map +0 -1
  197. package/dist/core/p-3e5ae012.entry.js +0 -2
  198. package/dist/core/p-3e5ae012.entry.js.map +0 -1
  199. package/dist/core/p-bd389bfd.entry.js +0 -2
  200. package/dist/core/p-c21bc8f9.entry.js +0 -2
  201. package/dist/core/p-c21bc8f9.entry.js.map +0 -1
  202. package/dist/core/p-def34832.entry.js +0 -2
  203. package/dist/core/p-def34832.entry.js.map +0 -1
  204. package/dist/types/work/packages/core/.stencil/packages/core/stencil.config.d.ts +0 -2
  205. /package/dist/components/{p-DKo9A5gq.js.map → p-BHRF-5cf.js.map} +0 -0
  206. /package/dist/components/{p-9imLQpxb.js.map → p-BSr8e18S.js.map} +0 -0
  207. /package/dist/components/{p-BNnuBQvo.js.map → p-BxS4InzB.js.map} +0 -0
  208. /package/dist/components/{p-CfaJM4SA.js.map → p-CMmyR4-k.js.map} +0 -0
  209. /package/dist/components/{p-B0KFtEn3.js.map → p-CU0plGZP.js.map} +0 -0
  210. /package/dist/components/{p-BrdXh0mI.js.map → p-CXPP9vec.js.map} +0 -0
  211. /package/dist/components/{p-djqfSbq-.js.map → p-C_URF9Su.js.map} +0 -0
  212. /package/dist/components/{p-yqJEurSE.js.map → p-CnKqUwf9.js.map} +0 -0
  213. /package/dist/components/{p-Bv5L0j6n.js.map → p-DN5pb9xA.js.map} +0 -0
  214. /package/dist/components/{p-DesycS6d.js.map → p-iTwUkISB.js.map} +0 -0
  215. /package/dist/components/{p-BZTY3MxF.js.map → p-ibUK7mfI.js.map} +0 -0
  216. /package/dist/core/{p-4da8ac1d.entry.js.map → p-10991f00.entry.js.map} +0 -0
  217. /package/dist/core/{p-469f14db.entry.js.map → p-bec959c4.entry.js.map} +0 -0
  218. /package/dist/core/{p-4d365881.entry.js.map → p-f75ad657.entry.js.map} +0 -0
package/dist/esm/core.js CHANGED
@@ -38,7 +38,7 @@ var patchCloneNodeFix = (HTMLElementPrototype) => {
38
38
 
39
39
  patchBrowser().then(async (options) => {
40
40
  await globalScripts();
41
- return bootstrapLazy(JSON.parse("[[\"gov-form-file\",[[4,\"gov-form-file\",{\"expanded\":[4],\"required\":[4],\"disabled\":[516],\"resetAfterPick\":[4,\"reset-after-pick\"],\"ignoreFileDuplicationCheck\":[4,\"ignore-file-duplication-check\"],\"displayAttachments\":[4,\"display-attachments\"],\"name\":[1],\"accept\":[1],\"multiple\":[4],\"maxFileSize\":[2,\"max-file-size\"],\"identifier\":[1],\"invalid\":[4],\"errorSize\":[1,\"error-size\"],\"errorAccept\":[1,\"error-accept\"],\"accessibleAttachmentsLabel\":[1,\"accessible-attachments-label\"],\"files\":[32],\"inheritedAttributes\":[32],\"getRef\":[64],\"getAreaRef\":[64],\"reset\":[64]},null,{\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"]}]]],[\"gov-form-multi-select\",[[4,\"gov-form-multi-select\",{\"value\":[1537],\"options\":[1537],\"identifier\":[1],\"placeholder\":[1],\"size\":[1],\"name\":[1],\"hideSelectedList\":[4,\"hide-selected-list\"],\"required\":[4],\"disabled\":[516],\"invalid\":[516],\"success\":[4],\"messageEmpty\":[1,\"message-empty\"],\"messageLoading\":[1,\"message-loading\"],\"focused\":[32],\"valueState\":[32],\"selectedOptionsState\":[32],\"optionsState\":[32],\"inheritedAttributes\":[32],\"setFocus\":[64],\"setValue\":[64],\"getRef\":[64]},null,{\"size\":[\"validateSize\"],\"options\":[\"watchOptions\"],\"value\":[\"watchValue\"]}]]],[\"gov-dialog\",[[4,\"gov-dialog\",{\"open\":[1540],\"blockClose\":[4,\"block-close\"],\"blockBackdropClose\":[4,\"block-backdrop-close\"],\"role\":[1],\"labelTag\":[1,\"label-tag\"],\"accessibleLabelledBy\":[1,\"accessible-labelled-by\"],\"accessibleDescribedBy\":[1,\"accessible-described-by\"],\"accessibleCloseLabel\":[1,\"accessible-close-label\"],\"accessibleCloseLabelledBy\":[1,\"accessible-close-labelled-by\"],\"setFocus\":[64],\"validateAccessibility\":[64]},null,{\"open\":[\"watchOpen\"]}]]],[\"gov-form-range\",[[4,\"gov-form-range\",{\"size\":[1],\"value\":[1537],\"identifier\":[1],\"name\":[1],\"min\":[8],\"max\":[8],\"step\":[8],\"tooltip\":[4],\"input\":[4],\"listIdentifier\":[1,\"list-identifier\"],\"required\":[516],\"success\":[516],\"invalid\":[516],\"disabled\":[516],\"inheritedAttributes\":[32],\"setFocus\":[64],\"setValue\":[64],\"clearValue\":[64],\"getRef\":[64]},null,{\"size\":[\"validateSize\",\"watchControlAttrs\"],\"value\":[\"watchValue\"],\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"],\"success\":[\"watchControlAttrs\"]}]]],[\"gov-pagination\",[[0,\"gov-pagination\",{\"type\":[1],\"current\":[2],\"total\":[2],\"selectIdentifier\":[1,\"select-identifier\"],\"size\":[1],\"color\":[1],\"pageSize\":[2,\"page-size\"],\"maxPages\":[2,\"max-pages\"],\"link\":[1],\"accessibleSelectLabel\":[1,\"accessible-select-label\"],\"accessiblePageLabel\":[1,\"accessible-page-label\"],\"labelPrev\":[1,\"label-prev\"],\"labelStart\":[1,\"label-start\"],\"labelNext\":[1,\"label-next\"],\"labelEnd\":[1,\"label-end\"],\"pagination\":[32],\"inheritedAttributes\":[32]},null,{\"type\":[\"validateType\"],\"size\":[\"validateSize\"],\"color\":[\"validateColor\"],\"current\":[\"recalculate\"],\"total\":[\"recalculate\"],\"pageSize\":[\"recalculate\"],\"maxPages\":[\"recalculate\"]}]]],[\"gov-breadcrumbs\",[[4,\"gov-breadcrumbs\",{\"collapsible\":[4],\"isExpanded\":[4,\"is-expanded\"],\"accessibleLabel\":[1,\"accessible-label\"],\"accessibleLabelledBy\":[1,\"accessible-labelledby\"],\"accessibleToggleLabel\":[1,\"accessible-toggle-label\"],\"expanded\":[32],\"toggleOption\":[32],\"validateAccessibility\":[64]}]]],[\"gov-collapsible\",[[4,\"gov-collapsible\",{\"size\":[1],\"identifier\":[1],\"label\":[1],\"disabled\":[4],\"open\":[1028],\"inheritedAttributes\":[32]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-infobar\",[[4,\"gov-infobar\",{\"color\":[1],\"type\":[1],\"role\":[1],\"accessibleCloseLabel\":[1,\"accessible-close-label\"],\"accessibleToggleLabel\":[1,\"accessible-toggle-label\"],\"closable\":[4],\"toggleContent\":[32],\"inheritedAttributes\":[32]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-loading\",[[4,\"gov-loading\",{\"size\":[1]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-tabs\",[[4,\"gov-tabs\",{\"type\":[1],\"size\":[1],\"color\":[1],\"orientation\":[1],\"direction\":[513],\"controllers\":[32],\"focusIndex\":[32],\"inheritedAttributes\":[32],\"refresh\":[64],\"currentTab\":[64],\"setActiveTab\":[64],\"rerender\":[64]},null,{\"type\":[\"validateType\"],\"color\":[\"validateColor\"],\"size\":[\"validateSize\"]}]]],[\"gov-toast\",[[4,\"gov-toast\",{\"color\":[1],\"gravity\":[1],\"position\":[1],\"type\":[1],\"time\":[2],\"closeLabel\":[1,\"close-label\"],\"accessibleCloseLabel\":[1,\"accessible-close-label\"],\"inheritedAttributes\":[32],\"destroy\":[64]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-accordion-item\",[[4,\"gov-accordion-item\",{\"identifier\":[1],\"size\":[1025],\"disabled\":[4],\"open\":[1028],\"openState\":[32],\"toggle\":[64],\"currentState\":[64]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-blockquote\",[[4,\"gov-blockquote\",{\"type\":[513],\"cite\":[1]}]]],[\"gov-card\",[[4,\"gov-card\",{\"direction\":[1],\"collapsible\":[4],\"clickable\":[4],\"open\":[1540],\"href\":[513],\"target\":[1],\"accessibleTriggerLabel\":[1,\"accessible-label\"],\"accessibleTriggerLabelledBy\":[1,\"accessible-labelledby\"],\"validateAccessibility\":[64]}]]],[\"gov-form-checkbox\",[[4,\"gov-form-checkbox\",{\"value\":[1],\"checked\":[1540],\"required\":[4],\"disabled\":[516],\"indeterminate\":[516],\"name\":[1],\"size\":[513],\"identifier\":[1],\"noLabel\":[4,\"no-label\"],\"invalid\":[4],\"inheritedAttributes\":[32],\"getRef\":[64]},null,{\"size\":[\"validateSize\",\"watchControlAttrs\"],\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"]}]]],[\"gov-form-switch\",[[4,\"gov-form-switch\",{\"value\":[1],\"noLabel\":[4,\"no-label\"],\"checked\":[1540],\"required\":[4],\"disabled\":[516],\"name\":[1],\"size\":[513],\"identifier\":[1],\"invalid\":[4],\"inheritedAttributes\":[32],\"getRef\":[64]},null,{\"size\":[\"validateSize\",\"watchDisabled\"],\"disabled\":[\"watchDisabled\"],\"invalid\":[\"watchDisabled\"]}]]],[\"gov-link\",[[4,\"gov-link\",{\"size\":[1],\"external\":[4],\"truncate\":[4],\"href\":[1],\"target\":[1],\"inheritedAttributes\":[32]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-tag\",[[4,\"gov-tag\",{\"iconStart\":[1,\"icon-start\"],\"iconEnd\":[1,\"icon-end\"],\"size\":[513],\"color\":[513],\"type\":[513],\"expanded\":[516]},null,{\"color\":[\"validateColor\"],\"size\":[\"validateSize\"]}]]],[\"gov-tile\",[[4,\"gov-tile\",{\"size\":[513],\"orientation\":[1],\"noBorder\":[4,\"no-border\"],\"href\":[513],\"target\":[1],\"getTriggerRef\":[64]}]]],[\"gov-wizard-item\",[[4,\"gov-wizard-item\",{\"color\":[1],\"size\":[1],\"identifier\":[1],\"collapsible\":[4],\"disabled\":[4],\"isExpanded\":[1028,\"is-expanded\"],\"open\":[64],\"close\":[64],\"toggle\":[64],\"currentState\":[64]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-accordion\",[[4,\"gov-accordion\",{\"size\":[1],\"noBorder\":[4,\"no-border\"]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-banner\",[[4,\"gov-banner\",{\"size\":[513],\"background\":[1],\"foreground\":[1],\"textColor\":[1,\"text-color\"]},null,{\"size\":[\"validateSize\"],\"background\":[\"validateBackground\"],\"foreground\":[\"validateForeground\"],\"text-color\":[\"validateTextColor\"]}]]],[\"gov-container\",[[4,\"gov-container\"]]],[\"gov-control-group\",[[4,\"gov-control-group\",{\"color\":[1],\"noBorder\":[4,\"no-border\"],\"noInnerBorder\":[4,\"no-inner-border\"],\"fitContent\":[4,\"fit-content\"]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-cookiebar\",[[4,\"gov-cookiebar\"]]],[\"gov-dropdown\",[[4,\"gov-dropdown\",{\"identifier\":[1],\"open\":[1028],\"position\":[1],\"getState\":[64],\"toggle\":[64]},null,{\"open\":[\"watchOpen\"]}]]],[\"gov-empty\",[[4,\"gov-empty\",{\"size\":[1],\"direction\":[1],\"align\":[1]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-error-code\",[[4,\"gov-error-code\"]]],[\"gov-form-checkbox-group\",[[4,\"gov-form-checkbox-group\",{\"gap\":[1],\"orientation\":[1],\"value\":[1025]},null,{\"gap\":[\"validateGap\"],\"orientation\":[\"validateOrientation\"]}]]],[\"gov-form-control\",[[4,\"gov-form-control\",{\"identifier\":[1],\"invalid\":[516],\"disabled\":[516],\"success\":[516],\"fieldset\":[4],\"size\":[1]}]]],[\"gov-form-group\",[[4,\"gov-form-group\",{\"gap\":[1],\"orientation\":[1]},null,{\"gap\":[\"validateGap\"],\"orientation\":[\"validateOrientation\"]}]]],[\"gov-form-label\",[[4,\"gov-form-label\",{\"identifier\":[1],\"size\":[1],\"required\":[4],\"legend\":[4]}]]],[\"gov-form-password-power\",[[4,\"gov-form-password-power\",{\"power\":[514]}]]],[\"gov-form-radio\",[[4,\"gov-form-radio\",{\"value\":[1],\"noLabel\":[4,\"no-label\"],\"checked\":[1540],\"required\":[4],\"disabled\":[516],\"name\":[1],\"size\":[1],\"identifier\":[1],\"invalid\":[4],\"inheritedAttributes\":[32],\"getRef\":[64]},null,{\"size\":[\"validateSize\",\"watchControlAttrs\"],\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"]}]]],[\"gov-form-radio-group\",[[4,\"gov-form-radio-group\",{\"gap\":[1],\"orientation\":[1],\"value\":[1025]},null,{\"gap\":[\"validateGap\"],\"orientation\":[\"validateOrientation\"]}]]],[\"gov-form-search\",[[4,\"gov-form-search\",{\"size\":[1],\"color\":[513]}]]],[\"gov-grid\",[[4,\"gov-grid\",{\"alignItems\":[513,\"align-items\"],\"justifyItems\":[513,\"justify-items\"],\"gap\":[513]}]]],[\"gov-grid-item\",[[4,\"gov-grid-item\",{\"column\":[1,\"col-span\"],\"columnSm\":[1,\"col-span-sm\"],\"columnMd\":[1,\"col-span-md\"],\"columnLg\":[1,\"col-span-lg\"],\"columnXl\":[1,\"col-span-xl\"],\"row\":[1,\"row-span\"],\"rowSm\":[1,\"row-span-sm\"],\"rowMd\":[1,\"row-span-md\"],\"rowLg\":[1,\"row-span-lg\"],\"rowXl\":[1,\"row-span-xl\"]}]]],[\"gov-layout\",[[4,\"gov-layout\",{\"type\":[1],\"variant\":[1],\"inverse\":[4]}]]],[\"gov-layout-column\",[[4,\"gov-layout-column\"]]],[\"gov-lifecycle\",[[0,\"gov-lifecycle\"]]],[\"gov-message\",[[4,\"gov-message\",{\"color\":[1],\"type\":[1]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-spacer\",[[0,\"gov-spacer\",{\"size\":[1],\"breakpoint\":[1]},null,{\"size\":[\"validateSize\"],\"breakpoint\":[\"validateBreakpoint\"]}]]],[\"gov-stepper\",[[4,\"gov-stepper\",{\"size\":[1]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-stepper-item\",[[4,\"gov-stepper-item\",{\"color\":[1],\"size\":[1],\"identifier\":[1]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-tabs-item\",[[4,\"gov-tabs-item\",{\"identifier\":[1],\"triggerIdentifier\":[1,\"trigger-identifier\"],\"label\":[513],\"disabled\":[516],\"iconStart\":[513,\"icon-start\"],\"iconEnd\":[513,\"icon-end\"],\"default\":[4],\"isActive\":[32],\"getIdentifier\":[64],\"getTriggerIdentifier\":[64],\"getDisableState\":[64],\"setActiveStatus\":[64]},null,{\"label\":[\"rerenderParent\"],\"disabled\":[\"rerenderParent\"]}]]],[\"gov-wizard\",[[4,\"gov-wizard\",{\"size\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"validateWcag\":[64]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-flex_3\",[[0,\"gov-theme-switch\",{\"size\":[1],\"displayLabel\":[4,\"display-label\"],\"ariaLabelLight\":[1,\"aria-label-light\"],\"ariaLabelDark\":[1,\"aria-label-dark\"],\"labelLight\":[1,\"label-light\"],\"labelDark\":[1,\"label-dark\"],\"theme\":[32]},null,{\"size\":[\"validateSize\"],\"theme\":[\"watchTheme\"]}],[4,\"gov-flex\",{\"direction\":[513],\"justifyContent\":[513,\"justify-content\"],\"alignItems\":[513,\"align-items\"],\"wrap\":[513],\"alignContent\":[513,\"align-content\"],\"alignSelf\":[513,\"align-self\"],\"gap\":[513],\"responsive\":[513]}],[0,\"gov-icon\",{\"size\":[513],\"color\":[513],\"name\":[513],\"type\":[513],\"visible\":[32],\"error\":[32]},null,{\"size\":[\"validateSize\"],\"color\":[\"validateColor\"],\"name\":[\"loadIconPathData\"]}]]],[\"gov-form-autocomplete\",[[4,\"gov-form-autocomplete\",{\"value\":[1537],\"options\":[1537],\"identifier\":[1],\"success\":[4],\"size\":[1],\"nameKey\":[1,\"name-key\"],\"name\":[1],\"required\":[4],\"disabled\":[516],\"placeholder\":[1],\"readonly\":[4],\"invalid\":[4],\"minlength\":[2],\"maxlength\":[2],\"throttleTime\":[2,\"throttle-time\"],\"messageEmpty\":[1,\"message-empty\"],\"focused\":[32],\"processing\":[32],\"arrowCounter\":[32],\"list\":[32],\"inheritedAttributes\":[32],\"setFocus\":[64],\"setBlur\":[64],\"setOptions\":[64],\"clearValue\":[64],\"setProcessing\":[64],\"setSearchCallback\":[64],\"setTemplateResolver\":[64]},null,{\"size\":[\"validateSize\"],\"options\":[\"watchOptions\"]}]]],[\"gov-chip\",[[4,\"gov-chip\",{\"disabled\":[516],\"href\":[1],\"target\":[1],\"iconStart\":[1,\"icon-start\"],\"iconEnd\":[1,\"icon-end\"],\"size\":[1],\"tag\":[1],\"color\":[1],\"type\":[513],\"focusable\":[4],\"identifier\":[1],\"inheritedAttributes\":[32],\"geRef\":[64],\"setFocus\":[64]},null,{\"color\":[\"validateColor\"],\"size\":[\"validateSize\"]}]]],[\"gov-form-select\",[[4,\"gov-form-select\",{\"value\":[1537],\"options\":[1537],\"identifier\":[1],\"size\":[1],\"name\":[1],\"required\":[4],\"success\":[516],\"disabled\":[516],\"invalid\":[4],\"focused\":[32],\"optionsState\":[32],\"inheritedAttributes\":[32],\"setFocus\":[64],\"getRef\":[64]},null,{\"size\":[\"validateSize\",\"watchControlAttrs\"],\"options\":[\"watchOptions\"],\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"],\"success\":[\"watchControlAttrs\"],\"value\":[\"watchValue\"]}]]],[\"gov-backdrop\",[[0,\"gov-backdrop\",{\"inverse\":[4],\"disabled\":[1540],\"accessibleLabel\":[1,\"accessible-label\"],\"accessibleLabelledBy\":[1,\"accessible-labelledby\"],\"validateAccessibility\":[64]}]]],[\"gov-button\",[[4,\"gov-button\",{\"color\":[513],\"size\":[513],\"type\":[513],\"expanded\":[516],\"expandedMobile\":[516,\"expanded-mobile\"],\"name\":[1],\"disabled\":[516],\"nativeType\":[1,\"native-type\"],\"href\":[1],\"target\":[1],\"download\":[4],\"tab\":[2],\"hreflang\":[1],\"referrerpolicy\":[1],\"rel\":[1],\"loading\":[1],\"focusable\":[4],\"identifier\":[1],\"inheritedAttributes\":[32],\"setFocus\":[64],\"getRef\":[64],\"validateAccessibility\":[64]},null,{\"color\":[\"validateColor\"],\"type\":[\"validateType\"],\"size\":[\"validateSize\"],\"nativeType\":[\"validateNativeType\"]}]]],[\"gov-tooltip_2\",[[4,\"gov-tooltip-content\",{\"color\":[1],\"size\":[1],\"persist\":[4],\"isVisible\":[1028,\"is-visible\"],\"parentId\":[1,\"parent-id\"]},null,{\"isVisible\":[\"visibleContent\"]}],[4,\"gov-tooltip\",{\"color\":[1],\"size\":[1],\"position\":[1025],\"message\":[1],\"identifier\":[1],\"icon\":[516],\"persist\":[32],\"show\":[64],\"hide\":[64]},null,{\"color\":[\"validateColor\"],\"size\":[\"validateSize\"],\"position\":[\"validatePosition\"],\"message\":[\"rerenderMessage\"]}]]],[\"gov-attachments_3\",[[4,\"gov-attachments-item\",{\"accessibleRemoveLabel\":[1,\"accessible-remove-label\"],\"accessibleRemoveLabelledBy\":[1,\"accessible-remove-labelledby\"],\"validateAccessibility\":[64]}],[4,\"gov-attachments\",{\"label\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"validateWcag\":[64]}],[4,\"gov-form-message\",{\"color\":[1],\"size\":[1],\"identifier\":[64]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-form-input_2\",[[0,\"gov-skeleton\",{\"size\":[513],\"color\":[1],\"shape\":[1],\"width\":[513],\"height\":[513],\"animation\":[1],\"inheritedAttributes\":[32]},null,{\"size\":[\"validateSize\"],\"shape\":[\"validateShape\"],\"animation\":[\"validateAnimation\"]}],[4,\"gov-form-input\",{\"value\":[1537],\"identifier\":[1],\"success\":[516],\"size\":[1],\"name\":[1],\"multiline\":[4],\"rows\":[2],\"cols\":[2],\"required\":[516],\"disabled\":[516],\"placeholder\":[1],\"readonly\":[4],\"minlength\":[2],\"maxlength\":[2],\"min\":[8],\"max\":[8],\"autocomplete\":[4],\"autocorrect\":[4],\"spellcheck\":[4],\"inputLang\":[1,\"input-lang\"],\"type\":[1],\"inputType\":[1,\"input-type\"],\"role\":[1],\"invalid\":[516],\"accessibleShowPasswordLabel\":[1,\"accessible-show-password-label\"],\"accessibleHidePasswordLabel\":[1,\"accessible-hide-password-label\"],\"focused\":[32],\"showPassword\":[32],\"inheritedAttributes\":[32],\"setFocus\":[64],\"setValue\":[64],\"clearValue\":[64],\"getRef\":[64]},null,{\"size\":[\"validateSize\",\"watchControlAttrs\"],\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"],\"success\":[\"watchControlAttrs\"]}]]]]"), options);
41
+ return bootstrapLazy(JSON.parse("[[\"gov-form-file\",[[4,\"gov-form-file\",{\"expanded\":[4],\"required\":[4],\"disabled\":[516],\"resetAfterPick\":[4,\"reset-after-pick\"],\"ignoreFileDuplicationCheck\":[4,\"ignore-file-duplication-check\"],\"displayAttachments\":[4,\"display-attachments\"],\"name\":[1],\"accept\":[1],\"multiple\":[4],\"maxFileSize\":[2,\"max-file-size\"],\"identifier\":[1],\"invalid\":[4],\"errorSize\":[1,\"error-size\"],\"errorAccept\":[1,\"error-accept\"],\"accessibleAttachmentsLabel\":[1,\"accessible-attachments-label\"],\"files\":[32],\"inheritedAttributes\":[32],\"getRef\":[64],\"getAreaRef\":[64],\"reset\":[64]},null,{\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"]}]]],[\"gov-form-multi-select\",[[4,\"gov-form-multi-select\",{\"value\":[1537],\"options\":[1537],\"identifier\":[1],\"placeholder\":[1],\"size\":[1],\"name\":[1],\"hideSelectedList\":[4,\"hide-selected-list\"],\"required\":[4],\"disabled\":[516],\"invalid\":[516],\"success\":[4],\"messageEmpty\":[1,\"message-empty\"],\"messageLoading\":[1,\"message-loading\"],\"focused\":[32],\"valueState\":[32],\"selectedOptionsState\":[32],\"optionsState\":[32],\"inheritedAttributes\":[32],\"setFocus\":[64],\"setValue\":[64],\"getRef\":[64]},null,{\"size\":[\"validateSize\"],\"options\":[\"watchOptions\"],\"value\":[\"watchValue\"]}]]],[\"gov-dialog\",[[4,\"gov-dialog\",{\"open\":[1540],\"blockClose\":[4,\"block-close\"],\"blockBackdropClose\":[4,\"block-backdrop-close\"],\"role\":[1],\"labelTag\":[1,\"label-tag\"],\"accessibleLabelledBy\":[1,\"accessible-labelled-by\"],\"accessibleDescribedBy\":[1,\"accessible-described-by\"],\"accessibleCloseLabel\":[1,\"accessible-close-label\"],\"accessibleCloseLabelledBy\":[1,\"accessible-close-labelled-by\"],\"setFocus\":[64],\"validateAccessibility\":[64]},null,{\"open\":[\"watchOpen\"]}]]],[\"gov-form-range\",[[4,\"gov-form-range\",{\"size\":[1],\"value\":[1537],\"identifier\":[1],\"name\":[1],\"min\":[8],\"max\":[8],\"step\":[8],\"tooltip\":[4],\"input\":[4],\"listIdentifier\":[1,\"list-identifier\"],\"required\":[516],\"success\":[516],\"invalid\":[516],\"disabled\":[516],\"inheritedAttributes\":[32],\"setFocus\":[64],\"setValue\":[64],\"clearValue\":[64],\"getRef\":[64]},null,{\"size\":[\"validateSize\",\"watchControlAttrs\"],\"value\":[\"watchValue\"],\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"],\"success\":[\"watchControlAttrs\"]}]]],[\"gov-pagination\",[[0,\"gov-pagination\",{\"type\":[1],\"current\":[2],\"total\":[2],\"selectIdentifier\":[1,\"select-identifier\"],\"size\":[1],\"color\":[1],\"pageSize\":[2,\"page-size\"],\"maxPages\":[2,\"max-pages\"],\"link\":[1],\"accessibleSelectLabel\":[1,\"accessible-select-label\"],\"accessiblePageLabel\":[1,\"accessible-page-label\"],\"labelPrev\":[1,\"label-prev\"],\"labelStart\":[1,\"label-start\"],\"labelNext\":[1,\"label-next\"],\"labelEnd\":[1,\"label-end\"],\"pagination\":[32],\"inheritedAttributes\":[32]},null,{\"type\":[\"validateType\"],\"size\":[\"validateSize\"],\"color\":[\"validateColor\"],\"current\":[\"recalculate\"],\"total\":[\"recalculate\"],\"pageSize\":[\"recalculate\"],\"maxPages\":[\"recalculate\"]}]]],[\"gov-breadcrumbs\",[[4,\"gov-breadcrumbs\",{\"collapsible\":[4],\"isExpanded\":[4,\"is-expanded\"],\"accessibleLabel\":[1,\"accessible-label\"],\"accessibleLabelledBy\":[1,\"accessible-labelledby\"],\"accessibleToggleLabel\":[1,\"accessible-toggle-label\"],\"expanded\":[32],\"toggleOption\":[32],\"validateAccessibility\":[64]}]]],[\"gov-collapsible\",[[4,\"gov-collapsible\",{\"size\":[1],\"identifier\":[1],\"label\":[1],\"disabled\":[4],\"open\":[1028],\"inheritedAttributes\":[32]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-infobar\",[[4,\"gov-infobar\",{\"color\":[1],\"type\":[1],\"role\":[1],\"accessibleCloseLabel\":[1,\"accessible-close-label\"],\"accessibleToggleLabel\":[1,\"accessible-toggle-label\"],\"closable\":[4],\"toggleContent\":[32],\"inheritedAttributes\":[32]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-loading\",[[4,\"gov-loading\",{\"size\":[1]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-tabs\",[[4,\"gov-tabs\",{\"type\":[1],\"size\":[1],\"color\":[1],\"orientation\":[1],\"direction\":[513],\"controllers\":[32],\"focusIndex\":[32],\"inheritedAttributes\":[32],\"refresh\":[64],\"currentTab\":[64],\"setActiveTab\":[64],\"rerender\":[64]},null,{\"type\":[\"validateType\"],\"color\":[\"validateColor\"],\"size\":[\"validateSize\"]}]]],[\"gov-toast\",[[4,\"gov-toast\",{\"color\":[1],\"gravity\":[1],\"position\":[1],\"type\":[1],\"time\":[2],\"closeLabel\":[1,\"close-label\"],\"accessibleCloseLabel\":[1,\"accessible-close-label\"],\"inheritedAttributes\":[32],\"destroy\":[64]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-accordion-item\",[[4,\"gov-accordion-item\",{\"identifier\":[1],\"size\":[1025],\"disabled\":[4],\"open\":[1028],\"openState\":[32],\"toggle\":[64],\"currentState\":[64]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-blockquote\",[[4,\"gov-blockquote\",{\"type\":[513],\"cite\":[1]}]]],[\"gov-card\",[[4,\"gov-card\",{\"direction\":[1],\"collapsible\":[4],\"clickable\":[4],\"open\":[1540],\"href\":[513],\"target\":[1],\"accessibleTriggerLabel\":[1,\"accessible-label\"],\"accessibleTriggerLabelledBy\":[1,\"accessible-labelledby\"],\"validateAccessibility\":[64]}]]],[\"gov-form-checkbox\",[[4,\"gov-form-checkbox\",{\"value\":[1],\"checked\":[1540],\"required\":[4],\"disabled\":[516],\"indeterminate\":[516],\"name\":[1],\"size\":[513],\"identifier\":[1],\"noLabel\":[4,\"no-label\"],\"invalid\":[4],\"inheritedAttributes\":[32],\"getRef\":[64]},null,{\"size\":[\"validateSize\",\"watchControlAttrs\"],\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"]}]]],[\"gov-form-switch\",[[4,\"gov-form-switch\",{\"value\":[1],\"noLabel\":[4,\"no-label\"],\"checked\":[1540],\"required\":[4],\"disabled\":[516],\"name\":[1],\"size\":[513],\"identifier\":[1],\"invalid\":[4],\"inheritedAttributes\":[32],\"getRef\":[64]},null,{\"size\":[\"validateSize\",\"watchDisabled\"],\"disabled\":[\"watchDisabled\"],\"invalid\":[\"watchDisabled\"]}]]],[\"gov-link\",[[4,\"gov-link\",{\"size\":[1],\"external\":[4],\"truncate\":[4],\"href\":[1],\"target\":[1],\"inheritedAttributes\":[32]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-tag\",[[4,\"gov-tag\",{\"iconStart\":[1,\"icon-start\"],\"iconEnd\":[1,\"icon-end\"],\"size\":[513],\"color\":[513],\"type\":[513],\"expanded\":[516]},null,{\"color\":[\"validateColor\"],\"size\":[\"validateSize\"]}]]],[\"gov-tile\",[[4,\"gov-tile\",{\"size\":[513],\"orientation\":[1],\"noBorder\":[4,\"no-border\"],\"href\":[513],\"target\":[1],\"getTriggerRef\":[64]}]]],[\"gov-wizard-item\",[[4,\"gov-wizard-item\",{\"color\":[1],\"size\":[1],\"identifier\":[1],\"collapsible\":[4],\"disabled\":[4],\"isExpanded\":[1028,\"is-expanded\"],\"open\":[64],\"close\":[64],\"toggle\":[64],\"currentState\":[64]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-accordion\",[[4,\"gov-accordion\",{\"size\":[1],\"noBorder\":[4,\"no-border\"]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-banner\",[[4,\"gov-banner\",{\"size\":[513],\"background\":[1],\"foreground\":[1],\"textColor\":[1,\"text-color\"]},null,{\"size\":[\"validateSize\"],\"background\":[\"validateBackground\"],\"foreground\":[\"validateForeground\"],\"text-color\":[\"validateTextColor\"]}]]],[\"gov-container\",[[4,\"gov-container\"]]],[\"gov-control-group\",[[4,\"gov-control-group\",{\"color\":[1],\"noBorder\":[4,\"no-border\"],\"noInnerBorder\":[4,\"no-inner-border\"],\"fitContent\":[4,\"fit-content\"]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-cookiebar\",[[4,\"gov-cookiebar\"]]],[\"gov-dropdown\",[[4,\"gov-dropdown\",{\"identifier\":[1],\"open\":[1028],\"position\":[1],\"getState\":[64],\"toggle\":[64]},null,{\"open\":[\"watchOpen\"]}]]],[\"gov-empty\",[[4,\"gov-empty\",{\"size\":[1],\"direction\":[1],\"align\":[1]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-error-code\",[[4,\"gov-error-code\"]]],[\"gov-form-checkbox-group\",[[4,\"gov-form-checkbox-group\",{\"gap\":[1],\"orientation\":[1],\"value\":[1025]},null,{\"gap\":[\"validateGap\"],\"orientation\":[\"validateOrientation\"]}]]],[\"gov-form-control\",[[4,\"gov-form-control\",{\"identifier\":[1],\"invalid\":[516],\"disabled\":[516],\"success\":[516],\"fieldset\":[4],\"size\":[1]}]]],[\"gov-form-group\",[[4,\"gov-form-group\",{\"gap\":[1],\"orientation\":[1]},null,{\"gap\":[\"validateGap\"],\"orientation\":[\"validateOrientation\"]}]]],[\"gov-form-label\",[[4,\"gov-form-label\",{\"identifier\":[1],\"size\":[1],\"required\":[4],\"legend\":[4]}]]],[\"gov-form-password-power\",[[4,\"gov-form-password-power\",{\"power\":[514]}]]],[\"gov-form-radio\",[[4,\"gov-form-radio\",{\"value\":[1],\"noLabel\":[4,\"no-label\"],\"checked\":[1540],\"required\":[4],\"disabled\":[516],\"name\":[1],\"size\":[1],\"identifier\":[1],\"invalid\":[4],\"inheritedAttributes\":[32],\"getRef\":[64]},null,{\"size\":[\"validateSize\",\"watchControlAttrs\"],\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"]}]]],[\"gov-form-radio-group\",[[4,\"gov-form-radio-group\",{\"gap\":[1],\"orientation\":[1],\"value\":[1025]},null,{\"gap\":[\"validateGap\"],\"orientation\":[\"validateOrientation\"]}]]],[\"gov-form-search\",[[4,\"gov-form-search\",{\"size\":[513],\"color\":[513]}]]],[\"gov-grid\",[[4,\"gov-grid\",{\"alignItems\":[513,\"align-items\"],\"justifyItems\":[513,\"justify-items\"],\"gap\":[513]}]]],[\"gov-grid-item\",[[4,\"gov-grid-item\",{\"column\":[1,\"col-span\"],\"columnSm\":[1,\"col-span-sm\"],\"columnMd\":[1,\"col-span-md\"],\"columnLg\":[1,\"col-span-lg\"],\"columnXl\":[1,\"col-span-xl\"],\"row\":[1,\"row-span\"],\"rowSm\":[1,\"row-span-sm\"],\"rowMd\":[1,\"row-span-md\"],\"rowLg\":[1,\"row-span-lg\"],\"rowXl\":[1,\"row-span-xl\"]}]]],[\"gov-layout\",[[4,\"gov-layout\",{\"type\":[1],\"variant\":[1],\"inverse\":[4]}]]],[\"gov-layout-column\",[[4,\"gov-layout-column\"]]],[\"gov-lifecycle\",[[0,\"gov-lifecycle\"]]],[\"gov-message\",[[4,\"gov-message\",{\"color\":[1],\"type\":[1]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-spacer\",[[0,\"gov-spacer\",{\"size\":[1],\"breakpoint\":[1]},null,{\"size\":[\"validateSize\"],\"breakpoint\":[\"validateBreakpoint\"]}]]],[\"gov-stepper\",[[4,\"gov-stepper\",{\"size\":[1]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-stepper-item\",[[4,\"gov-stepper-item\",{\"color\":[1],\"size\":[1],\"identifier\":[1]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-tabs-item\",[[4,\"gov-tabs-item\",{\"identifier\":[1],\"triggerIdentifier\":[1,\"trigger-identifier\"],\"label\":[513],\"disabled\":[516],\"iconStart\":[513,\"icon-start\"],\"iconEnd\":[513,\"icon-end\"],\"default\":[4],\"isActive\":[32],\"getIdentifier\":[64],\"getTriggerIdentifier\":[64],\"getDisableState\":[64],\"setActiveStatus\":[64]},null,{\"label\":[\"rerenderParent\"],\"disabled\":[\"rerenderParent\"]}]]],[\"gov-wizard\",[[4,\"gov-wizard\",{\"size\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"wcagLabelledBy\":[1,\"wcag-labelled-by\"],\"validateWcag\":[64]},null,{\"size\":[\"validateSize\"]}]]],[\"gov-flex_3\",[[0,\"gov-theme-switch\",{\"size\":[1],\"displayLabel\":[4,\"display-label\"],\"ariaLabelLight\":[1,\"aria-label-light\"],\"ariaLabelDark\":[1,\"aria-label-dark\"],\"labelLight\":[1,\"label-light\"],\"labelDark\":[1,\"label-dark\"],\"theme\":[32]},null,{\"size\":[\"validateSize\"],\"theme\":[\"watchTheme\"]}],[4,\"gov-flex\",{\"direction\":[513],\"justifyContent\":[513,\"justify-content\"],\"alignItems\":[513,\"align-items\"],\"wrap\":[513],\"alignContent\":[513,\"align-content\"],\"alignSelf\":[513,\"align-self\"],\"gap\":[513],\"responsive\":[513]}],[0,\"gov-icon\",{\"size\":[513],\"color\":[513],\"name\":[513],\"type\":[513],\"visible\":[32],\"error\":[32]},null,{\"size\":[\"validateSize\"],\"color\":[\"validateColor\"],\"name\":[\"loadIconPathData\"]}]]],[\"gov-form-autocomplete\",[[4,\"gov-form-autocomplete\",{\"value\":[1537],\"options\":[1537],\"identifier\":[1],\"success\":[4],\"size\":[1],\"nameKey\":[1,\"name-key\"],\"name\":[1],\"required\":[4],\"disabled\":[516],\"placeholder\":[1],\"readonly\":[4],\"invalid\":[4],\"minlength\":[2],\"maxlength\":[2],\"maxOptions\":[2,\"max-options\"],\"throttleTime\":[2,\"throttle-time\"],\"messageEmpty\":[1,\"message-empty\"],\"focused\":[32],\"processing\":[32],\"arrowCounter\":[32],\"list\":[32],\"inheritedAttributes\":[32],\"setFocus\":[64],\"setBlur\":[64],\"setOptions\":[64],\"clearValue\":[64],\"setProcessing\":[64],\"setSearchCallback\":[64],\"setTemplateResolver\":[64]},null,{\"size\":[\"validateSize\"],\"options\":[\"watchOptions\"],\"throttleTime\":[\"watchThrottleTime\"]}]]],[\"gov-chip\",[[4,\"gov-chip\",{\"disabled\":[516],\"href\":[1],\"target\":[1],\"iconStart\":[1,\"icon-start\"],\"iconEnd\":[1,\"icon-end\"],\"size\":[1],\"tag\":[1],\"color\":[1],\"type\":[513],\"focusable\":[4],\"identifier\":[1],\"inheritedAttributes\":[32],\"geRef\":[64],\"setFocus\":[64]},null,{\"color\":[\"validateColor\"],\"size\":[\"validateSize\"]}]]],[\"gov-form-select\",[[4,\"gov-form-select\",{\"value\":[1537],\"options\":[1537],\"identifier\":[1],\"size\":[1],\"name\":[1],\"required\":[4],\"success\":[516],\"disabled\":[516],\"invalid\":[4],\"focused\":[32],\"optionsState\":[32],\"inheritedAttributes\":[32],\"setFocus\":[64],\"getRef\":[64]},null,{\"size\":[\"validateSize\",\"watchControlAttrs\"],\"options\":[\"watchOptions\"],\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"],\"success\":[\"watchControlAttrs\"],\"value\":[\"watchValue\"]}]]],[\"gov-backdrop\",[[0,\"gov-backdrop\",{\"inverse\":[4],\"disabled\":[1540],\"accessibleLabel\":[1,\"accessible-label\"],\"accessibleLabelledBy\":[1,\"accessible-labelledby\"],\"validateAccessibility\":[64]}]]],[\"gov-button\",[[4,\"gov-button\",{\"color\":[513],\"size\":[513],\"type\":[513],\"expanded\":[516],\"expandedMobile\":[516,\"expanded-mobile\"],\"name\":[1],\"disabled\":[516],\"nativeType\":[1,\"native-type\"],\"href\":[1],\"target\":[1],\"download\":[4],\"tab\":[2],\"hreflang\":[1],\"referrerpolicy\":[1],\"rel\":[1],\"loading\":[1],\"focusable\":[4],\"identifier\":[1],\"inheritedAttributes\":[32],\"setFocus\":[64],\"getRef\":[64],\"validateAccessibility\":[64]},null,{\"color\":[\"validateColor\"],\"type\":[\"validateType\"],\"size\":[\"validateSize\"],\"nativeType\":[\"validateNativeType\"]}]]],[\"gov-tooltip_2\",[[4,\"gov-tooltip-content\",{\"color\":[1],\"size\":[1],\"persist\":[4],\"isVisible\":[1028,\"is-visible\"],\"parentId\":[1,\"parent-id\"],\"message\":[1025]},null,{\"isVisible\":[\"visibleContent\"]}],[4,\"gov-tooltip\",{\"color\":[1],\"size\":[1],\"position\":[1025],\"message\":[1],\"identifier\":[1],\"icon\":[516],\"persist\":[32],\"show\":[64],\"hide\":[64]},null,{\"color\":[\"validateColor\"],\"size\":[\"validateSize\"],\"position\":[\"validatePosition\"],\"message\":[\"rerenderMessage\"]}]]],[\"gov-attachments_3\",[[4,\"gov-attachments-item\",{\"accessibleRemoveLabel\":[1,\"accessible-remove-label\"],\"accessibleRemoveLabelledBy\":[1,\"accessible-remove-labelledby\"],\"validateAccessibility\":[64]}],[4,\"gov-attachments\",{\"label\":[1],\"wcagLabel\":[1,\"wcag-label\"],\"validateWcag\":[64]}],[4,\"gov-form-message\",{\"color\":[1],\"size\":[1],\"identifier\":[64]},null,{\"color\":[\"validateColor\"]}]]],[\"gov-form-input_2\",[[0,\"gov-skeleton\",{\"size\":[513],\"color\":[1],\"shape\":[1],\"width\":[513],\"height\":[513],\"animation\":[1],\"inheritedAttributes\":[32]},null,{\"size\":[\"validateSize\"],\"shape\":[\"validateShape\"],\"animation\":[\"validateAnimation\"]}],[4,\"gov-form-input\",{\"value\":[1537],\"identifier\":[1],\"success\":[516],\"size\":[1],\"name\":[1],\"multiline\":[4],\"rows\":[2],\"cols\":[2],\"required\":[516],\"disabled\":[516],\"placeholder\":[1],\"readonly\":[4],\"minlength\":[2],\"maxlength\":[2],\"min\":[8],\"max\":[8],\"autocomplete\":[4],\"autocorrect\":[4],\"spellcheck\":[4],\"inputLang\":[1,\"input-lang\"],\"type\":[1],\"inputType\":[1,\"input-type\"],\"role\":[1],\"invalid\":[516],\"accessibleShowPasswordLabel\":[1,\"accessible-show-password-label\"],\"accessibleHidePasswordLabel\":[1,\"accessible-hide-password-label\"],\"focused\":[32],\"showPassword\":[32],\"inheritedAttributes\":[32],\"setFocus\":[64],\"setValue\":[64],\"clearValue\":[64],\"getRef\":[64]},null,{\"size\":[\"validateSize\",\"watchControlAttrs\"],\"disabled\":[\"watchControlAttrs\"],\"invalid\":[\"watchControlAttrs\"],\"success\":[\"watchControlAttrs\"]}]]]]"), options);
42
42
  });
43
43
  //# sourceMappingURL=core.js.map
44
44
 
@@ -43,7 +43,7 @@ const GovBanner = class {
43
43
  /**
44
44
  * Banner’s foreground
45
45
  */
46
- this.foreground = BannerForeground.LOGO;
46
+ this.foreground = BannerForeground.IMAGE;
47
47
  /**
48
48
  * XL Banner’s text color
49
49
  */
@@ -69,10 +69,10 @@ const GovBanner = class {
69
69
  this.validateTextColor(this.textColor);
70
70
  }
71
71
  render() {
72
- return (h(Host, Object.assign({ key: '3e20f606dab5e32411afc2dbf2bc94add284bed4', class: this.h.classes(BannerClass.root), role: "region", size: this.size }, (this.size !== "xl" ? {
72
+ return (h(Host, Object.assign({ key: '142c906194083f6c186d1f1d9033c4f2c9be9bff', class: this.h.classes(BannerClass.root), role: "region", size: this.size }, (this.size !== "xl" ? {
73
73
  background: this.background,
74
74
  foreground: this.foreground
75
- } : { 'text-color': this.textColor })), h("div", { key: '334c429dac2fcde8b9bbaa223ec5111ba2ea062f' }, h("div", { key: '900e59f605db3ddb9a0999ee6d802aa73d0f4cb3', class: BannerClass.content }, h("slot", { key: 'b5bbcc66a5d7154e22c73c78001c1e2609c034cc', name: "headline" }), h("slot", { key: '3bc1675de3e41360eebd57fcc0880ede40053c3f' })), this.h.hasSlot('button') && (h("slot", { key: '9b85a1240ae9a28c8297085f88674006a729cc72', name: "button" }))), h("slot", { key: 'e2b1423f67a81d8188d68b1fbfdad1a88b3893cd', name: "image" })));
75
+ } : { 'text-color': this.textColor })), h("div", { key: '0b52a8859b6cdcd92d0f5e97b460a3e0a899bd44' }, h("div", { key: 'a36ed5ad57c878d70770ccfeccd172749a555b22', class: BannerClass.content }, h("slot", { key: '57f52bfb0189450e77c00f4d9904712e555a3125', name: "headline" }), h("slot", { key: '91629f1bf0605ae28d694d044d19bbef9ebb69da' })), this.h.hasSlot('button') && (h("slot", { key: '458a59c73e9bdf02d6cdb1e8c5caea0dcfec526a', name: "button" }))), h("slot", { key: 'f1d60077313455ed78c78b56c7741b4b593cf7cc', name: "image" })));
76
76
  }
77
77
  get host() { return getElement(this); }
78
78
  static get watchers() { return {
@@ -1 +1 @@
1
- {"version":3,"file":"gov-banner.entry.js","sources":["../../../packages/core/src/components/gov-banner/constants.ts","../../../packages/core/src/components/gov-banner/gov-banner.tsx"],"sourcesContent":["import {ValueOf} from \"../../types/interfaces\";\nimport {pick} from \"../../utils/utils\";\nimport {Sizes} from \"../../core/constants/sizes\";\n\nexport const BannerSizes = pick(Sizes, ['_S', '_M', '_L', '_XL'])\nexport type BannerSizesType = `${ValueOf<typeof BannerSizes>}`\n\nexport enum BannerBackground {\n\tSIMPLE = 'simple',\n\tWAVES = 'waves',\n\tSTRIPES = 'stripes',\n\tLINES = 'lines',\n}\nexport type BannerBackgroundsType = `${ValueOf<typeof BannerBackground>}`\n\nexport enum BannerForeground {\n\tIMAGE = 'image',\n\tLOGO = 'logo',\n\tICON = 'icon',\n}\nexport type BannerForegroundsType = `${ValueOf<typeof BannerForeground>}`\n\nexport enum BannerTextColor {\n\tLIGHT = 'light',\n\tDARK = 'dark',\n}\nexport type BannerTextColorsType = `${ValueOf<typeof BannerTextColor>}`\n\nexport const BannerClass = {\n\troot: 'gov-banner',\n\tcontent: 'gov-banner__content',\n}\n","import {Component, Element, h, Host, Prop, Watch} from '@stencil/core'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {\n BannerBackground,\n BannerBackgroundsType,\n BannerClass,\n BannerForeground,\n BannerForegroundsType,\n BannerSizes,\n BannerSizesType,\n BannerTextColor,\n BannerTextColorsType\n} from \"./constants\";\nimport {validateProp} from \"../../helpers/Validate/props\";\n\n@Component({\n tag: 'gov-banner',\n})\nexport class GovBanner {\n private h: GovHost\n\n constructor() {\n this.h = govHost(this.host)\n }\n\n @Element() host: HTMLGovBannerElement\n /**\n * Banner’s size.\n */\n @Prop({reflect: true}) readonly size: BannerSizesType = BannerSizes._M\n /**\n * Banner’s background\n */\n @Prop() readonly background: BannerBackgroundsType = BannerBackground.SIMPLE\n /**\n * Banner’s foreground\n */\n @Prop() readonly foreground: BannerForegroundsType = BannerForeground.LOGO\n /**\n * XL Banner’s text color\n */\n @Prop({attribute: 'text-color'}) readonly textColor: BannerTextColorsType = BannerTextColor.LIGHT\n\n @Watch('size')\n validateSize(newValue: string): void {\n validateProp(BannerSizes, newValue, BannerClass.root)\n }\n\n @Watch('background')\n validateBackground(newValue: string): void {\n validateProp(BannerBackground, newValue, BannerClass.root)\n }\n\n @Watch('foreground')\n validateForeground(newValue: string): void {\n validateProp(BannerForeground, newValue, BannerClass.root)\n }\n\n @Watch('text-color')\n validateTextColor(newValue: string): void {\n validateProp(BannerTextColor, newValue, BannerClass.root)\n }\n\n componentWillLoad(): void {\n this.validateSize(this.size)\n this.validateBackground(this.background)\n this.validateForeground(this.foreground)\n this.validateTextColor(this.textColor)\n }\n\n render() {\n return (\n <Host class={this.h.classes(BannerClass.root)}\n role=\"region\"\n size={this.size}\n {...(this.size !== \"xl\" ? {\n background: this.background,\n foreground: this.foreground\n } : {'text-color': this.textColor})}>\n <div>\n <div class={BannerClass.content}>\n <slot name=\"headline\"/>\n <slot/>\n </div>\n {this.h.hasSlot('button') && (\n <slot name=\"button\"/>\n )}\n </div>\n <slot name=\"image\"/>\n </Host>\n )\n }\n}\n"],"names":[],"mappings":";;;;;;;AAIO,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,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AA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACI,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAE,WAAW,CAAC,OAAO,EAAA,EAC3B,CAAM,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,UAAU,EAAE,CAAA,EACvB,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAO,CACL,EACL,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,KACrB,6DAAM,IAAI,EAAC,QAAQ,EAAA,CAAE,CACxB,CACC,EACN,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,OAAO,EAAE,CAAA,CACjB;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"gov-banner.entry.js","sources":["../../../packages/core/src/components/gov-banner/constants.ts","../../../packages/core/src/components/gov-banner/gov-banner.tsx"],"sourcesContent":["import {ValueOf} from \"../../types/interfaces\";\nimport {pick} from \"../../utils/utils\";\nimport {Sizes} from \"../../core/constants/sizes\";\n\nexport const BannerSizes = pick(Sizes, ['_S', '_M', '_L', '_XL'])\nexport type BannerSizesType = `${ValueOf<typeof BannerSizes>}`\n\nexport enum BannerBackground {\n\tSIMPLE = 'simple',\n\tWAVES = 'waves',\n\tSTRIPES = 'stripes',\n\tLINES = 'lines',\n}\nexport type BannerBackgroundsType = `${ValueOf<typeof BannerBackground>}`\n\nexport enum BannerForeground {\n\tIMAGE = 'image',\n\tLOGO = 'logo',\n\tICON = 'icon',\n}\nexport type BannerForegroundsType = `${ValueOf<typeof BannerForeground>}`\n\nexport enum BannerTextColor {\n\tLIGHT = 'light',\n\tDARK = 'dark',\n}\nexport type BannerTextColorsType = `${ValueOf<typeof BannerTextColor>}`\n\nexport const BannerClass = {\n\troot: 'gov-banner',\n\tcontent: 'gov-banner__content',\n}\n","import {Component, Element, h, Host, Prop, Watch} from '@stencil/core'\nimport {govHost} from '../../helpers/Dom/template'\nimport {GovHost} from '../../helpers/Dom/template.types'\nimport {\n BannerBackground,\n BannerBackgroundsType,\n BannerClass,\n BannerForeground,\n BannerForegroundsType,\n BannerSizes,\n BannerSizesType,\n BannerTextColor,\n BannerTextColorsType\n} from \"./constants\";\nimport {validateProp} from \"../../helpers/Validate/props\";\n\n@Component({\n tag: 'gov-banner',\n})\nexport class GovBanner {\n private h: GovHost\n\n constructor() {\n this.h = govHost(this.host)\n }\n\n @Element() host: HTMLGovBannerElement\n /**\n * Banner’s size.\n */\n @Prop({reflect: true}) readonly size: BannerSizesType = BannerSizes._M\n /**\n * Banner’s background\n */\n @Prop() readonly background: BannerBackgroundsType = BannerBackground.SIMPLE\n /**\n * Banner’s foreground\n */\n @Prop() readonly foreground: BannerForegroundsType = BannerForeground.IMAGE\n /**\n * XL Banner’s text color\n */\n @Prop({attribute: 'text-color'}) readonly textColor: BannerTextColorsType = BannerTextColor.LIGHT\n\n @Watch('size')\n validateSize(newValue: string): void {\n validateProp(BannerSizes, newValue, BannerClass.root)\n }\n\n @Watch('background')\n validateBackground(newValue: string): void {\n validateProp(BannerBackground, newValue, BannerClass.root)\n }\n\n @Watch('foreground')\n validateForeground(newValue: string): void {\n validateProp(BannerForeground, newValue, BannerClass.root)\n }\n\n @Watch('text-color')\n validateTextColor(newValue: string): void {\n validateProp(BannerTextColor, newValue, BannerClass.root)\n }\n\n componentWillLoad(): void {\n this.validateSize(this.size)\n this.validateBackground(this.background)\n this.validateForeground(this.foreground)\n this.validateTextColor(this.textColor)\n }\n\n render() {\n return (\n <Host class={this.h.classes(BannerClass.root)}\n role=\"region\"\n size={this.size}\n {...(this.size !== \"xl\" ? {\n background: this.background,\n foreground: this.foreground\n } : {'text-color': this.textColor})}>\n <div>\n <div class={BannerClass.content}>\n <slot name=\"headline\"/>\n <slot/>\n </div>\n {this.h.hasSlot('button') && (\n <slot name=\"button\"/>\n )}\n </div>\n <sl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AG;YACtB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,UAAU,EAAE,IAAI,CAAC;SACpB,GAAG,EAAC,YAAY,EAAE,IAAI,CAAC,SAAS,EAAC,EAAC,EACrC,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACI,CAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAE,WAAW,CAAC,OAAO,EAAA,EAC3B,CAAM,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,IAAI,EAAC,UAAU,EAAE,CAAA,EACvB,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAO,CACL,EACL,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,KACrB,6DAAM,IAAI,EAAC,QAAQ,EAAA,CAAE,CACxB,CACC,EACN,CAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,OAAO,EAAE,CAAA,CACjB;;;;;;;;;;;;;"}
@@ -51,7 +51,7 @@ var Types;
51
51
  const IconClass = {
52
52
  root: 'gov-icon'};
53
53
 
54
- const version = "4.6.3";
54
+ const version = "4.6.4";
55
55
 
56
56
  const dsVersion = () => {
57
57
  return version;
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-ClISz4NF.js';
2
2
  import { a as toBoolAttr, b as booleanString } from './template-CoD1xawt.js';
3
3
  import { v as validateProp } from './props-CJZgTDla.js';
4
- import { c as createID } from './string.utils-vN03FcXN.js';
4
+ import { r as removeDiacritics, c as createID } from './string.utils-vN03FcXN.js';
5
5
  import { d as delay, t as throttle, h as has } from './utils-CQvUntGY.js';
6
6
  import { F as FormAutocompleteClass, a as FormAutocompleteSizes } from './constants-aqe7GX2n.js';
7
7
  import { p as propsValueToArray } from './array.utils-CJ0U_ONv.js';
@@ -11,6 +11,19 @@ import './gov.log-BtqD9K8d.js';
11
11
  import './sizes-BcQO4NH2.js';
12
12
  import './helpers.types-DNztiAH0.js';
13
13
 
14
+ const normalize = (value) => typeof value === 'string' ? removeDiacritics(value).toLowerCase() : '';
15
+ const filterAutocompleteOptions = (options, query, nameKey, maxOptions) => {
16
+ const source = Array.isArray(options) ? options : [];
17
+ const normalizedQuery = normalize(query);
18
+ const matches = normalizedQuery.length === 0
19
+ ? source
20
+ : source.filter(item => {
21
+ const text = item === null || item === void 0 ? void 0 : item[nameKey];
22
+ return typeof text === 'string' && normalize(text).includes(normalizedQuery);
23
+ });
24
+ return Number.isInteger(maxOptions) && maxOptions > 0 ? matches.slice(0, maxOptions) : matches;
25
+ };
26
+
14
27
  const GovFormAutocomplete = class {
15
28
  constructor(hostRef) {
16
29
  registerInstance(this, hostRef);
@@ -18,6 +31,7 @@ const GovFormAutocomplete = class {
18
31
  this.govBlur = createEvent(this, "gov-blur");
19
32
  this.govInput = createEvent(this, "gov-input");
20
33
  this.govSelect = createEvent(this, "gov-select");
34
+ this.fullOptions = [];
21
35
  this.templateResolver = item => item[this.nameKey];
22
36
  /**
23
37
  * Value of input
@@ -45,6 +59,11 @@ const GovFormAutocomplete = class {
45
59
  * Minimum length (number of characters) of value
46
60
  */
47
61
  this.minlength = 3;
62
+ /**
63
+ * Maximum number of items shown from a static `options` list (0 = unlimited).
64
+ * Applies only when no async search callback is set.
65
+ */
66
+ this.maxOptions = 10;
48
67
  /**
49
68
  * Input throttle in milliseconds
50
69
  */
@@ -57,13 +76,33 @@ const GovFormAutocomplete = class {
57
76
  this.arrowCounter = -1;
58
77
  this.list = [];
59
78
  this.inheritedAttributes = {};
79
+ this.emitAndSearch = (e) => {
80
+ this.govInput.emit({
81
+ originalEvent: e,
82
+ component: FormAutocompleteClass.root,
83
+ value: this.value,
84
+ selected: null,
85
+ });
86
+ this.doSearch();
87
+ };
88
+ this.onInputHandler = (e) => {
89
+ e.stopPropagation();
90
+ this.value = e.detail.value;
91
+ this.debouncedSearch(e);
92
+ };
60
93
  this.listBoxId = createID('GovListBox');
61
94
  }
62
95
  validateSize(newValue) {
63
96
  validateProp(FormAutocompleteSizes, newValue, FormAutocompleteClass.root);
64
97
  }
65
98
  watchOptions(newValue) {
66
- this.setOptions(propsValueToArray(newValue)).catch();
99
+ this.fullOptions = propsValueToArray(newValue);
100
+ if (this.searchCallback) {
101
+ this.setOptions(this.fullOptions).catch();
102
+ }
103
+ else {
104
+ this.list = filterAutocompleteOptions(this.fullOptions, this.value, this.nameKey, this.maxOptions);
105
+ }
67
106
  }
68
107
  onArrowUp() {
69
108
  if (this.arrowCounter > 0) {
@@ -87,13 +126,13 @@ const GovFormAutocomplete = class {
87
126
  }
88
127
  }
89
128
  doSearch() {
90
- if (Number.isInteger(this.minlength) && this.isValueAccepted === false && this.minlength) {
91
- this.list = [];
92
- this.arrowCounter = -1;
93
- this.processing = false;
94
- return;
95
- }
96
129
  if (this.searchCallback) {
130
+ if (Number.isInteger(this.minlength) && this.isValueAccepted === false && this.minlength) {
131
+ this.list = [];
132
+ this.arrowCounter = -1;
133
+ this.processing = false;
134
+ return;
135
+ }
97
136
  this.processing = true;
98
137
  this.searchCallback(this.value)
99
138
  .then(response => (this.list = response))
@@ -102,11 +141,13 @@ const GovFormAutocomplete = class {
102
141
  this.arrowCounter = -1;
103
142
  this.processing = false;
104
143
  });
144
+ return;
105
145
  }
146
+ this.list = filterAutocompleteOptions(this.fullOptions, this.value, this.nameKey, this.maxOptions);
147
+ this.arrowCounter = -1;
106
148
  }
107
149
  clearList() {
108
- const areOptions = propsValueToArray(this.options);
109
- if (areOptions.length === 0) {
150
+ if (this.fullOptions.length === 0) {
110
151
  this.list = [];
111
152
  }
112
153
  }
@@ -127,6 +168,14 @@ const GovFormAutocomplete = class {
127
168
  componentWillLoad() {
128
169
  this.validateSize(this.size);
129
170
  this.inheritedAttributes = inheritAriaAttributes(this.host);
171
+ this.debouncedSearch = throttle(this.emitAndSearch, this.throttleTime);
172
+ this.fullOptions = propsValueToArray(this.options);
173
+ if (!this.searchCallback) {
174
+ this.list = filterAutocompleteOptions(this.fullOptions, this.value, this.nameKey, this.maxOptions);
175
+ }
176
+ }
177
+ watchThrottleTime() {
178
+ this.debouncedSearch = throttle(this.emitAndSearch, this.throttleTime);
130
179
  }
131
180
  disconnectedCallback() {
132
181
  var _a;
@@ -137,7 +186,7 @@ const GovFormAutocomplete = class {
137
186
  this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { [attributeName]: newValue });
138
187
  }
139
188
  render() {
140
- return (h(Host, { key: '531610863e3752a4e07f0b6c3b946c475a6420c6', class: FormAutocompleteClass.root, size: this.size }, h("gov-form-input", Object.assign({ key: '82f74fc8139c85cddb4e206c5d82286107135fff', placeholder: this.placeholder, name: this.name, disabled: this.disabled, readonly: this.readonly, autocomplete: false, size: this.size, required: this.required, invalid: this.invalid, success: this.success, role: 'searchbox', value: this.value, minlength: this.minlength, maxlength: this.maxlength, "on-gov-input": throttle(this.onInputHandler.bind(this), this.throttleTime), "on-gov-keyup": this.onKeyUpHandler.bind(this), "on-gov-keydown": this.onKeyDownHandler.bind(this), "on-gov-focus": this.onFocusHandler.bind(this), "on-gov-blur": this.onBlurHandler.bind(this) }, this.inheritedAttributes, { "aria-autocomplete": 'list', "aria-owns": [this.listBoxId, this.inheritedAttributes['aria-owns']].join(' '), "aria-expanded": booleanString(this.list.length && this.focused ? true : false), ref: el => (this.inputRef = el) }), h("slot", { key: 'd27f897ff5c405adc14640a7e8508319df7b5ff9', name: "validation-icon" }), h("slot", { key: 'da5ec2879f9c6ba7c57a68cc2515539016a6ec43', name: "icon-end" })), h("ul", { key: 'cbb3514f12fe3c506d7bcf2c3aa86b78303ac398', class: FormAutocompleteClass.list, role: 'listbox', "aria-hidden": toBoolAttr(!this.focused), hidden: !this.focused, id: this.listBoxId, ref: el => (this.listRef = el) }, this.focused && this.list.length === 0 && this.processing === false && this.isValueAccepted && this.messageEmpty ? (h("li", { class: FormAutocompleteClass.empty }, this.messageEmpty)) : null, this.focused && this.processing === true && this.isValueAccepted ? (h("li", { class: FormAutocompleteClass.loading }, h("gov-skeleton", { size: "m" }))) : null, this.focused ? this.list.map((item, index) => {
189
+ return (h(Host, { key: '0cdbf770359115b24432e9d533b4e17ab2c65e18', class: FormAutocompleteClass.root, size: this.size }, h("gov-form-input", Object.assign({ key: '5724ed153e3f2384725badbafdb0c19e67b69538', placeholder: this.placeholder, name: this.name, disabled: this.disabled, readonly: this.readonly, autocomplete: false, size: this.size, required: this.required, invalid: this.invalid, success: this.success, role: 'searchbox', value: this.value, minlength: this.minlength, maxlength: this.maxlength, "on-gov-input": this.onInputHandler, "on-gov-keyup": this.onKeyUpHandler.bind(this), "on-gov-keydown": this.onKeyDownHandler.bind(this), "on-gov-focus": this.onFocusHandler.bind(this), "on-gov-blur": this.onBlurHandler.bind(this) }, this.inheritedAttributes, { "aria-autocomplete": 'list', "aria-owns": [this.listBoxId, this.inheritedAttributes['aria-owns']].join(' '), "aria-expanded": booleanString(this.list.length && this.focused ? true : false), ref: el => (this.inputRef = el) }), h("slot", { key: 'ab6f37982f3d13adc2473a744b5697ac8bc651f5', name: "validation-icon" }), h("slot", { key: '1961a029eceee169b5be12fa4ba8c2e9072bb9de', name: "icon-end" })), h("ul", { key: '61b9b6929be4816e93e1b5fb778c3861b4f8631b', class: FormAutocompleteClass.list, role: 'listbox', "aria-hidden": toBoolAttr(!this.focused), hidden: !this.focused, id: this.listBoxId, ref: el => (this.listRef = el) }, this.focused && this.list.length === 0 && this.processing === false && (this.isValueAccepted || (!this.searchCallback && this.fullOptions.length > 0)) && this.messageEmpty ? (h("li", { class: FormAutocompleteClass.empty }, this.messageEmpty)) : null, this.focused && this.processing === true && this.isValueAccepted ? (h("li", { class: FormAutocompleteClass.loading }, h("gov-skeleton", { size: "m" }))) : null, this.focused ? this.list.map((item, index) => {
141
190
  const isSelected = this.arrowCounter === index;
142
191
  return (h("li", { class: FormAutocompleteClass.item, innerHTML: this.templateResolver(item, isSelected), role: 'option', "aria-posinset": index, tabindex: isSelected ? 0 : -1, "aria-setsize": this.list.length, onTouchStart: (e) => this.onSelectHandler(e, index), onMouseDown: (e) => this.onSelectHandler(e, index), "aria-selected": toBoolAttr(isSelected) }, h("slot", { name: "list-item-left" }), h("slot", { name: "list-item-right" })));
143
192
  }) : null)));
@@ -145,7 +194,12 @@ const GovFormAutocomplete = class {
145
194
  onFocusHandler(e) {
146
195
  this.focused = true;
147
196
  this.arrowCounter = -1;
148
- if (this.isValueAccepted && this.searchCallback) {
197
+ if (this.searchCallback) {
198
+ if (this.isValueAccepted) {
199
+ this.doSearch();
200
+ }
201
+ }
202
+ else {
149
203
  this.doSearch();
150
204
  }
151
205
  e.stopPropagation();
@@ -168,17 +222,6 @@ const GovFormAutocomplete = class {
168
222
  selected: null,
169
223
  });
170
224
  }
171
- onInputHandler(e) {
172
- this.value = e.target.value;
173
- e.stopPropagation();
174
- this.govInput.emit({
175
- originalEvent: e,
176
- component: FormAutocompleteClass.root,
177
- value: this.value,
178
- selected: null,
179
- });
180
- this.doSearch();
181
- }
182
225
  onSelectHandler(e, index = -1) {
183
226
  let selected = null;
184
227
  if (index > -1) {
@@ -272,7 +315,8 @@ const GovFormAutocomplete = class {
272
315
  get host() { return getElement(this); }
273
316
  static get watchers() { return {
274
317
  "size": ["validateSize"],
275
- "options": ["watchOptions"]
318
+ "options": ["watchOptions"],
319
+ "throttleTime": ["watchThrottleTime"]
276
320
  }; }
277
321
  };
278
322
 
@@ -1 +1 @@
1
- {"version":3,"file":"gov-form-autocomplete.entry.js","sources":["../../../packages/core/src/components/gov-form/autocomplete/gov-form-autocomplete.tsx"],"sourcesContent":["import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from '@stencil/core'\nimport {booleanString, toBoolAttr} from '../../../helpers/Dom/template'\nimport {validateProp} from '../../../helpers/Validate/props'\nimport {Nullable} from '../../../types/interfaces'\nimport {createID} from '../../../utils/string.utils'\nimport {delay, has, throttle} from '../../../utils/utils'\nimport {FormInputEvent} from '../input/gov-form-input.types'\nimport {FormAutocompleteClass, FormAutocompleteSizes, SizesType,} from './constants'\nimport {FormAutocompleteEvent, GovFormAutocompleteItem} from './gov-form-autocomplete.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-autocomplete',\n})\nexport class GovFormAutocomplete {\n\tprivate inputRef?: HTMLGovFormInputElement\n\tprivate listRef?: HTMLUListElement\n\tprivate readonly listBoxId: string\n\tprivate searchCallback: (value: string) => Promise<GovFormAutocompleteItem[]>\n\tprivate templateResolver: (item: GovFormAutocompleteItem, selected: boolean) => string = item => item[this.nameKey]\n\tprivate attributeObserver: AttributeObserver\n\n\tconstructor() {\n\t\tthis.listBoxId = createID('GovListBox')\n\t}\n\n\t@Element() host: HTMLGovFormInputElement\n\t/**\n\t * Value of input\n\t */\n\t@Prop({reflect: true, mutable: true}) value = ''\n\t/**\n\t * Options of autocomplete\n\t */\n\t@Prop({reflect: true, mutable: true}) options?: string | GovFormAutocompleteItem[]\n\t/**\n\t * Custom input identifier.\n\t */\n\t@Prop({attribute: 'identifier'}) readonly identifier: string\n\t/**\n\t * Indicates the entered value of child form element does conform to the format expected by the application.\n\t */\n\t@Prop() readonly success: boolean\n\t/**\n\t * Input’s size.\n\t */\n\t@Prop() readonly size?: SizesType = 'm'\n\t/**\n\t * Main key name in the object\n\t */\n\t@Prop({attribute: 'name-key'}) readonly nameKey: string = 'name'\n\t/**\n\t * Name of the input.\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 * Makes the input component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * Text that appears in the form control when it has no value set\n\t */\n\t@Prop() readonly placeholder: string\n\t/**\n\t * The value is not editable\n\t */\n\t@Prop() readonly readonly: boolean\n\t/**\n\t * 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 * Minimum length (number of characters) of value\n\t */\n\t@Prop() readonly minlength: number = 3\n\t/**\n\t * Maximum length (number of characters) of value\n\t */\n\t@Prop() readonly maxlength: number\n\t/**\n\t * Input throttle in milliseconds\n\t */\n\t@Prop() readonly throttleTime: number = 200\n\t/**\n\t * Custom message for when there is a blank sheet\n\t */\n\t@Prop({attribute: 'message-empty'}) readonly messageEmpty: string = 'Nebyly nalezeny žádné výsledky'\n\t/**\n\t * Emitted when the input has focus.\n\t */\n\t@Event({eventName: 'gov-focus'}) govFocus: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input loses focus.\n\t */\n\t@Event({eventName: 'gov-blur'}) govBlur: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({eventName: 'gov-input'}) govInput: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({eventName: 'gov-select'}) govSelect: EventEmitter<FormAutocompleteEvent>\n\n\t@State() focused: boolean\n\t@State() processing = false\n\t@State() arrowCounter = -1\n\t@State() list: GovFormAutocompleteItem[] = []\n\t@State() inheritedAttributes: Attributes = {}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormAutocompleteSizes, newValue, FormAutocompleteClass.root)\n\t}\n\n\t@Watch('options')\n\twatchOptions(newValue: string | GovFormAutocompleteItem[]): void {\n\t\tthis.setOptions(propsValueToArray(newValue)).catch()\n\t}\n\n\tprivate onArrowUp() {\n\t\tif (this.arrowCounter > 0) {\n\t\t\tthis.arrowCounter = this.arrowCounter - 1\n\t\t\tthis.moveToView().finally()\n\t\t}\n\t}\n\n\tprivate onArrowDown() {\n\t\tif (this.arrowCounter < this.list.length - 1) {\n\t\t\tthis.arrowCounter = this.arrowCounter + 1\n\t\t\tthis.moveToView().finally()\n\t\t}\n\t}\n\n\tprivate async moveToView() {\n\t\tawait delay(200)\n\t\tconst heightOfList = this.listRef.offsetHeight\n\t\tconst selected = this.listRef.querySelector('li[aria-selected=\"true\"]') as HTMLUListElement\n\t\tif (selected && heightOfList) {\n\t\t\tconst offsetTop = selected.offsetTop\n\t\t\tthis.listRef.scrollTo({top: offsetTop, behavior: 'smooth'})\n\t\t}\n\t}\n\n\tprivate doSearch() {\n\t\tif (Number.isInteger(this.minlength) && this.isValueAccepted === false && this.minlength) {\n\t\t\tthis.list = []\n\t\t\tthis.arrowCounter = -1\n\t\t\tthis.processing = false\n\t\t\treturn\n\t\t}\n\t\tif (this.searchCallback) {\n\t\t\tthis.processing = true\n\t\t\tthis.searchCallback(this.value)\n\t\t\t\t.then(response => (this.list = response))\n\t\t\t\t.catch(() => (this.list = []))\n\t\t\t\t.finally(() => {\n\t\t\t\t\tthis.arrowCounter = -1\n\t\t\t\t\tthis.processing = false\n\t\t\t\t})\n\t\t}\n\t}\n\n\tprivate clearList() {\n\t\tconst areOptions = propsValueToArray<GovFormAutocompleteItem[]>(this.options)\n\t\tif (areOptions.length === 0) {\n\t\t\tthis.list = []\n\t\t}\n\t}\n\n\tget isValueAccepted() {\n\t\tif (typeof this.value === 'string') {\n\t\t\treturn this.value.length >= this.minlength\n\t\t} else {\n\t\t\treturn false\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.validateSize(this.size)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\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={FormAutocompleteClass.root} size={this.size}>\n\t\t\t\t<gov-form-input\n\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\tname={this.name}\n\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\treadonly={this.readonly}\n\t\t\t\t\tautocomplete={false}\n\t\t\t\t\tsize={this.size}\n\t\t\t\t\trequired={this.required}\n\t\t\t\t\tinvalid={this.invalid}\n\t\t\t\t\tsuccess={this.success}\n\t\t\t\t\trole={'searchbox'}\n\t\t\t\t\tvalue={this.value}\n\t\t\t\t\tminlength={this.minlength}\n\t\t\t\t\tmaxlength={this.maxlength}\n\t\t\t\t\ton-gov-input={throttle(this.onInputHandler.bind(this), this.throttleTime)}\n\t\t\t\t\ton-gov-keyup={this.onKeyUpHandler.bind(this)}\n\t\t\t\t\ton-gov-keydown={this.onKeyDownHandler.bind(this)}\n\t\t\t\t\ton-gov-focus={this.onFocusHandler.bind(this)}\n\t\t\t\t\ton-gov-blur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\taria-autocomplete={'list'}\n\t\t\t\t\taria-owns={[this.listBoxId, this.inheritedAttributes['aria-owns']].join(' ')}\n\t\t\t\t\taria-expanded={booleanString(this.list.length && this.focused ? true : false)}\n\t\t\t\t\tref={el => (this.inputRef = el as HTMLGovFormInputElement)}\n\t\t\t\t>\n\t\t\t\t\t<slot name=\"validation-icon\" />\n\t\t\t\t\t<slot name=\"icon-end\" />\n\t\t\t\t</gov-form-input>\n\t\t\t\t<ul class={FormAutocompleteClass.list}\n\t\t\t\t\trole={'listbox'}\n\t\t\t\t\taria-hidden={toBoolAttr(!this.focused)}\n\t\t\t\t\thidden={!this.focused}\n\t\t\t\t\tid={this.listBoxId}\n\t\t\t\t\tref={el => (this.listRef = el as HTMLUListElement)}>\n\t\t\t\t\t{this.focused && this.list.length === 0 && this.processing === false && this.isValueAccepted && this.messageEmpty ? (\n\t\t\t\t\t\t<li class={FormAutocompleteClass.empty}>{this.messageEmpty}</li>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{this.focused && this.processing === true && this.isValueAccepted ? (\n\t\t\t\t\t\t<li class={FormAutocompleteClass.loading}>\n\t\t\t\t\t\t\t<gov-skeleton size=\"m\"></gov-skeleton>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{this.focused ? this.list.map((item, index) => {\n\t\t\t\t\t\tconst isSelected = this.arrowCounter === index\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t\tclass={FormAutocompleteClass.item}\n\t\t\t\t\t\t\t\tinnerHTML={this.templateResolver(item, isSelected)}\n\t\t\t\t\t\t\t\trole={'option'}\n\t\t\t\t\t\t\t\taria-posinset={index}\n\t\t\t\t\t\t\t\ttabindex={isSelected ? 0 : -1}\n\t\t\t\t\t\t\t\taria-setsize={this.list.length}\n\t\t\t\t\t\t\t\tonTouchStart={(e: TouchEvent) => this.onSelectHandler(e, index)}\n\t\t\t\t\t\t\t\tonMouseDown={(e: PointerEvent) => this.onSelectHandler(e, index)}\n\t\t\t\t\t\t\t\taria-selected={toBoolAttr(isSelected)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<slot name=\"list-item-left\"/>\n\t\t\t\t\t\t\t\t<slot name=\"list-item-right\"/>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)\n\t\t\t\t\t}) : null}\n\t\t\t\t</ul>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\tthis.focused = true\n\t\tthis.arrowCounter = -1\n\t\tif (this.isValueAccepted && this.searchCallback) {\n\t\t\tthis.doSearch()\n\t\t}\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\tthis.focused = false\n\t\tthis.clearList();\n\t\tthis.arrowCounter = -1\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t}\n\n\tprivate onInputHandler(e: InputEvent) {\n\t\tthis.value = (e.target as HTMLGovFormInputElement).value\n\t\te.stopPropagation()\n\t\tthis.govInput.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t\tthis.doSearch()\n\t}\n\n\tprivate onSelectHandler(e: PointerEvent | CustomEvent | TouchEvent, index = -1) {\n\t\tlet selected: Nullable<GovFormAutocompleteItem> = null\n\t\tif (index > -1) {\n\t\t\tselected = this.list[index]\n\t\t} else if (has(this.arrowCounter, this.list)) {\n\t\t\tselected = this.list[this.arrowCounter]\n\t\t}\n\t\tif (selected) {\n\t\t\tthis.govSelect.emit({\n\t\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\t\tvalue: this.value,\n\t\t\t\tselected: selected,\n\t\t\t\toriginalEvent: e,\n\t\t\t})\n\t\t\tthis.clearList();\n\t\t\tif (has(this.nameKey, selected) && typeof selected[this.nameKey] === 'string') {\n\t\t\t\tthis.value = selected[this.nameKey]\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate onKeyUpHandler(e: CustomEvent) {\n\t\tconst event = (e.detail as FormInputEvent).originalEvent as KeyboardEvent\n\t\te.stopPropagation()\n\t\tevent.stopPropagation()\n\t\tif (event.keyCode === 38) this.onArrowUp()\n\t\telse if (event.keyCode === 40) this.onArrowDown()\n\t\telse if (event.keyCode === 13) {\n\t\t\te.preventDefault()\n\t\t\tevent.preventDefault()\n\t\t\tthis.onSelectHandler(e)\n\t\t}\n\t}\n\n\tprivate onKeyDownHandler(e: CustomEvent) {\n\t\tconst event = (e.detail as FormInputEvent).originalEvent as KeyboardEvent\n\t\te.stopPropagation()\n\t\tevent.stopPropagation()\n\t\tif (event.keyCode === 13) {\n\t\t\te.preventDefault()\n\t\t\tevent.preventDefault()\n\t\t}\n\t}\n\n\t/**\n\t * Focus main input element\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.inputRef.focus(options)\n\t}\n\n\t/**\n\t * Blur main input element\n\t */\n\t@Method()\n\tasync setBlur(): Promise<void> {\n\t\treturn this.inputRef.blur()\n\t}\n\n\t/**\n\t * Set options for list\n\t */\n\t@Method()\n\tasync setOptions(options: GovFormAutocompleteItem[]): Promise<void> {\n\t\tthis.list = Array.isArray(options) ? options : []\n\t\tthis.arrowCounter = -1\n\t}\n\n\t/**\n\t * Clears whisperer value\n\t */\n\t@Method()\n\tasync clearValue(): Promise<void> {\n\t\tthis.value = ''\n\t\tthis.inputRef.value = ''\n\n\t\tawait this.inputRef.clearValue()\n\t}\n\n\t/**\n\t * Clears whisperer value\n\t */\n\t@Method()\n\tasync setProcessing(status: boolean): Promise<void> {\n\t\tthis.processing = status\n\t}\n\n\t/**\n\t * Set a custom asynchronous function for the whisperer\n\t */\n\t@Method()\n\tasync setSearchCallback(callback: (value: string) => Promise<any>) {\n\t\tthis.searchCallback = callback\n\t}\n\n\t/**\n\t * Setting a custom whisper result template\n\t * @param callback\n\t */\n\t@Method()\n\tasync setTemplateResolver(callback: (item: GovFormAutocompleteItem) => string) {\n\t\tthis.templateResolver = callback\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;MAiBa,mB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;AAIxB;;AAEG;IAEH,MAAM,QAAQ,CAAC,OAAsB,EAAA;QACpC,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC;;AAGpC;;AAEG;AAEH,IAAA,MAAM,OAAO,GAAA;AACZ,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;;AAG5B;;AAEG;IAEH,MAAM,UAAU,CAAC,OAAkC,EAAA;AAClD,QAAA,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,GAAG,EAAE;AACjD,QAAA,IAAI,CAAC,YAAY,GAAG,EAAE;;AAGvB;;AAEG;AAEH,IAAA,MAAM,UAAU,GAAA;AACf,QAAA,IAAI,CAAC,KAAK,GAAG,EAAE;AACf,QAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,EAAE;AAExB,QAAA,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;;AAGjC;;AAEG;IAEH,MAAM,aAAa,CAAC,MAAe,EAAA;AAClC,QAAA,IAAI,CAAC,UAAU,GAAG,MAAM;;AAGzB;;AAEG;IAEH,MAAM,iBAAiB,CAAC,QAAyC,EAAA;AAChE,QAAA,IAAI,CAAC,cAAc,GAAG,QAAQ;;AAG/B;;;AAGG;IAEH,MAAM,mBAAmB,CAAC,QAAmD,EAAA;AAC5E,QAAA,IAAI,CAAC,gBAAgB,GAAG,QAAQ;;;;;;;;;;;"}
1
+ {"version":3,"file":"gov-form-autocomplete.entry.js","sources":["../../../packages/core/src/components/gov-form/autocomplete/autocomplete.utils.ts","../../../packages/core/src/components/gov-form/autocomplete/gov-form-autocomplete.tsx"],"sourcesContent":["import { removeDiacritics } from '../../../utils/string.utils'\nimport { GovFormAutocompleteItem } from './gov-form-autocomplete.types'\n\nconst normalize = (value: unknown): string =>\n\ttypeof value === 'string' ? removeDiacritics(value).toLowerCase() : ''\n\nexport const filterAutocompleteOptions = (\n\toptions: GovFormAutocompleteItem[],\n\tquery: string,\n\tnameKey: string,\n\tmaxOptions: number,\n): GovFormAutocompleteItem[] => {\n\tconst source = Array.isArray(options) ? options : []\n\tconst normalizedQuery = normalize(query)\n\tconst matches =\n\t\tnormalizedQuery.length === 0\n\t\t\t? source\n\t\t\t: source.filter(item => {\n\t\t\t\t\tconst text = item?.[nameKey]\n\t\t\t\t\treturn typeof text === 'string' && normalize(text).includes(normalizedQuery)\n\t\t\t\t})\n\treturn Number.isInteger(maxOptions) && maxOptions > 0 ? matches.slice(0, maxOptions) : matches\n}\n","import {Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch} from '@stencil/core'\nimport {booleanString, toBoolAttr} from '../../../helpers/Dom/template'\nimport {validateProp} from '../../../helpers/Validate/props'\nimport {Nullable} from '../../../types/interfaces'\nimport {createID} from '../../../utils/string.utils'\nimport {delay, has, throttle} from '../../../utils/utils'\nimport {FormInputEvent} from '../input/gov-form-input.types'\nimport {FormAutocompleteClass, FormAutocompleteSizes, SizesType,} from './constants'\nimport {FormAutocompleteEvent, GovFormAutocompleteItem} from './gov-form-autocomplete.types'\nimport {propsValueToArray} from \"../../../utils/array.utils\";\nimport { filterAutocompleteOptions } from './autocomplete.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-autocomplete',\n})\nexport class GovFormAutocomplete {\n\tprivate inputRef?: HTMLGovFormInputElement\n\tprivate listRef?: HTMLUListElement\n\tprivate readonly listBoxId: string\n\tprivate searchCallback: (value: string) => Promise<GovFormAutocompleteItem[]>\n\tprivate fullOptions: GovFormAutocompleteItem[] = []\n\tprivate templateResolver: (item: GovFormAutocompleteItem, selected: boolean) => string = item => item[this.nameKey]\n\tprivate attributeObserver: AttributeObserver\n\tprivate debouncedSearch: (e: CustomEvent<FormInputEvent>) => void\n\n\tconstructor() {\n\t\tthis.listBoxId = createID('GovListBox')\n\t}\n\n\t@Element() host: HTMLGovFormInputElement\n\t/**\n\t * Value of input\n\t */\n\t@Prop({reflect: true, mutable: true}) value = ''\n\t/**\n\t * Options of autocomplete\n\t */\n\t@Prop({reflect: true, mutable: true}) options?: string | GovFormAutocompleteItem[]\n\t/**\n\t * Custom input identifier.\n\t */\n\t@Prop({attribute: 'identifier'}) readonly identifier: string\n\t/**\n\t * Indicates the entered value of child form element does conform to the format expected by the application.\n\t */\n\t@Prop() readonly success: boolean\n\t/**\n\t * Input’s size.\n\t */\n\t@Prop() readonly size?: SizesType = 'm'\n\t/**\n\t * Main key name in the object\n\t */\n\t@Prop({attribute: 'name-key'}) readonly nameKey: string = 'name'\n\t/**\n\t * Name of the input.\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 * Makes the input component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop({reflect: true}) readonly disabled: boolean = false\n\t/**\n\t * Text that appears in the form control when it has no value set\n\t */\n\t@Prop() readonly placeholder: string\n\t/**\n\t * The value is not editable\n\t */\n\t@Prop() readonly readonly: boolean\n\t/**\n\t * 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 * Minimum length (number of characters) of value\n\t */\n\t@Prop() readonly minlength: number = 3\n\t/**\n\t * Maximum length (number of characters) of value\n\t */\n\t@Prop() readonly maxlength: number\n\t/**\n\t * Maximum number of items shown from a static `options` list (0 = unlimited).\n\t * Applies only when no async search callback is set.\n\t */\n\t@Prop({attribute: 'max-options'}) readonly maxOptions: number = 10\n\t/**\n\t * Input throttle in milliseconds\n\t */\n\t@Prop() readonly throttleTime: number = 200\n\t/**\n\t * Custom message for when there is a blank sheet\n\t */\n\t@Prop({attribute: 'message-empty'}) readonly messageEmpty: string = 'Nebyly nalezeny žádné výsledky'\n\t/**\n\t * Emitted when the input has focus.\n\t */\n\t@Event({eventName: 'gov-focus'}) govFocus: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input loses focus.\n\t */\n\t@Event({eventName: 'gov-blur'}) govBlur: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({eventName: 'gov-input'}) govInput: EventEmitter<FormAutocompleteEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({eventName: 'gov-select'}) govSelect: EventEmitter<FormAutocompleteEvent>\n\n\t@State() focused: boolean\n\t@State() processing = false\n\t@State() arrowCounter = -1\n\t@State() list: GovFormAutocompleteItem[] = []\n\t@State() inheritedAttributes: Attributes = {}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormAutocompleteSizes, newValue, FormAutocompleteClass.root)\n\t}\n\n\t@Watch('options')\n\twatchOptions(newValue: string | GovFormAutocompleteItem[]): void {\n\t\tthis.fullOptions = propsValueToArray<GovFormAutocompleteItem[]>(newValue)\n\t\tif (this.searchCallback) {\n\t\t\tthis.setOptions(this.fullOptions).catch()\n\t\t} else {\n\t\t\tthis.list = filterAutocompleteOptions(this.fullOptions, this.value, this.nameKey, this.maxOptions)\n\t\t}\n\t}\n\n\tprivate onArrowUp() {\n\t\tif (this.arrowCounter > 0) {\n\t\t\tthis.arrowCounter = this.arrowCounter - 1\n\t\t\tthis.moveToView().finally()\n\t\t}\n\t}\n\n\tprivate onArrowDown() {\n\t\tif (this.arrowCounter < this.list.length - 1) {\n\t\t\tthis.arrowCounter = this.arrowCounter + 1\n\t\t\tthis.moveToView().finally()\n\t\t}\n\t}\n\n\tprivate async moveToView() {\n\t\tawait delay(200)\n\t\tconst heightOfList = this.listRef.offsetHeight\n\t\tconst selected = this.listRef.querySelector('li[aria-selected=\"true\"]') as HTMLUListElement\n\t\tif (selected && heightOfList) {\n\t\t\tconst offsetTop = selected.offsetTop\n\t\t\tthis.listRef.scrollTo({top: offsetTop, behavior: 'smooth'})\n\t\t}\n\t}\n\n\tprivate doSearch() {\n\t\tif (this.searchCallback) {\n\t\t\tif (Number.isInteger(this.minlength) && this.isValueAccepted === false && this.minlength) {\n\t\t\t\tthis.list = []\n\t\t\t\tthis.arrowCounter = -1\n\t\t\t\tthis.processing = false\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.processing = true\n\t\t\tthis.searchCallback(this.value)\n\t\t\t\t.then(response => (this.list = response))\n\t\t\t\t.catch(() => (this.list = []))\n\t\t\t\t.finally(() => {\n\t\t\t\t\tthis.arrowCounter = -1\n\t\t\t\t\tthis.processing = false\n\t\t\t\t})\n\t\t\treturn\n\t\t}\n\t\tthis.list = filterAutocompleteOptions(this.fullOptions, this.value, this.nameKey, this.maxOptions)\n\t\tthis.arrowCounter = -1\n\t}\n\n\tprivate clearList() {\n\t\tif (this.fullOptions.length === 0) {\n\t\t\tthis.list = []\n\t\t}\n\t}\n\n\tget isValueAccepted() {\n\t\tif (typeof this.value === 'string') {\n\t\t\treturn this.value.length >= this.minlength\n\t\t} else {\n\t\t\treturn false\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.validateSize(this.size)\n\t\tthis.inheritedAttributes = inheritAriaAttributes(this.host);\n\t\tthis.debouncedSearch = throttle(this.emitAndSearch, this.throttleTime)\n\t\tthis.fullOptions = propsValueToArray<GovFormAutocompleteItem[]>(this.options)\n\t\tif (!this.searchCallback) {\n\t\t\tthis.list = filterAutocompleteOptions(this.fullOptions, this.value, this.nameKey, this.maxOptions)\n\t\t}\n\t}\n\n\t@Watch('throttleTime')\n\twatchThrottleTime() {\n\t\tthis.debouncedSearch = throttle(this.emitAndSearch, this.throttleTime)\n\t}\n\n\tprivate emitAndSearch = (e: CustomEvent<FormInputEvent>) => {\n\t\tthis.govInput.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t\tthis.doSearch()\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={FormAutocompleteClass.root} size={this.size}>\n\t\t\t\t<gov-form-input\n\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\tname={this.name}\n\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\treadonly={this.readonly}\n\t\t\t\t\tautocomplete={false}\n\t\t\t\t\tsize={this.size}\n\t\t\t\t\trequired={this.required}\n\t\t\t\t\tinvalid={this.invalid}\n\t\t\t\t\tsuccess={this.success}\n\t\t\t\t\trole={'searchbox'}\n\t\t\t\t\tvalue={this.value}\n\t\t\t\t\tminlength={this.minlength}\n\t\t\t\t\tmaxlength={this.maxlength}\n\t\t\t\t\ton-gov-input={this.onInputHandler}\n\t\t\t\t\ton-gov-keyup={this.onKeyUpHandler.bind(this)}\n\t\t\t\t\ton-gov-keydown={this.onKeyDownHandler.bind(this)}\n\t\t\t\t\ton-gov-focus={this.onFocusHandler.bind(this)}\n\t\t\t\t\ton-gov-blur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t{...this.inheritedAttributes}\n\t\t\t\t\taria-autocomplete={'list'}\n\t\t\t\t\taria-owns={[this.listBoxId, this.inheritedAttributes['aria-owns']].join(' ')}\n\t\t\t\t\taria-expanded={booleanString(this.list.length && this.focused ? true : false)}\n\t\t\t\t\tref={el => (this.inputRef = el as HTMLGovFormInputElement)}\n\t\t\t\t>\n\t\t\t\t\t<slot name=\"validation-icon\" />\n\t\t\t\t\t<slot name=\"icon-end\" />\n\t\t\t\t</gov-form-input>\n\t\t\t\t<ul class={FormAutocompleteClass.list}\n\t\t\t\t\trole={'listbox'}\n\t\t\t\t\taria-hidden={toBoolAttr(!this.focused)}\n\t\t\t\t\thidden={!this.focused}\n\t\t\t\t\tid={this.listBoxId}\n\t\t\t\t\tref={el => (this.listRef = el as HTMLUListElement)}>\n\t\t\t\t\t{this.focused && this.list.length === 0 && this.processing === false && (this.isValueAccepted || (!this.searchCallback && this.fullOptions.length > 0)) && this.messageEmpty ? (\n\t\t\t\t\t\t<li class={FormAutocompleteClass.empty}>{this.messageEmpty}</li>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{this.focused && this.processing === true && this.isValueAccepted ? (\n\t\t\t\t\t\t<li class={FormAutocompleteClass.loading}>\n\t\t\t\t\t\t\t<gov-skeleton size=\"m\"></gov-skeleton>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{this.focused ? this.list.map((item, index) => {\n\t\t\t\t\t\tconst isSelected = this.arrowCounter === index\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t\tclass={FormAutocompleteClass.item}\n\t\t\t\t\t\t\t\tinnerHTML={this.templateResolver(item, isSelected)}\n\t\t\t\t\t\t\t\trole={'option'}\n\t\t\t\t\t\t\t\taria-posinset={index}\n\t\t\t\t\t\t\t\ttabindex={isSelected ? 0 : -1}\n\t\t\t\t\t\t\t\taria-setsize={this.list.length}\n\t\t\t\t\t\t\t\tonTouchStart={(e: TouchEvent) => this.onSelectHandler(e, index)}\n\t\t\t\t\t\t\t\tonMouseDown={(e: PointerEvent) => this.onSelectHandler(e, index)}\n\t\t\t\t\t\t\t\taria-selected={toBoolAttr(isSelected)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<slot name=\"list-item-left\"/>\n\t\t\t\t\t\t\t\t<slot name=\"list-item-right\"/>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)\n\t\t\t\t\t}) : null}\n\t\t\t\t</ul>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\tthis.focused = true\n\t\tthis.arrowCounter = -1\n\t\tif (this.searchCallback) {\n\t\t\tif (this.isValueAccepted) {\n\t\t\t\tthis.doSearch()\n\t\t\t}\n\t\t} else {\n\t\t\tthis.doSearch()\n\t\t}\n\t\te.stopPropagation()\n\t\tthis.govFocus.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\tthis.focused = false\n\t\tthis.clearList();\n\t\tthis.arrowCounter = -1\n\t\te.stopPropagation()\n\t\tthis.govBlur.emit({\n\t\t\toriginalEvent: e,\n\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\tvalue: this.value,\n\t\t\tselected: null,\n\t\t})\n\t}\n\n\tprivate onInputHandler = (e: CustomEvent<FormInputEvent>) => {\n\t\te.stopPropagation()\n\t\tthis.value = e.detail.value\n\t\tthis.debouncedSearch(e)\n\t}\n\n\tprivate onSelectHandler(e: PointerEvent | CustomEvent | TouchEvent, index = -1) {\n\t\tlet selected: Nullable<GovFormAutocompleteItem> = null\n\t\tif (index > -1) {\n\t\t\tselected = this.list[index]\n\t\t} else if (has(this.arrowCounter, this.list)) {\n\t\t\tselected = this.list[this.arrowCounter]\n\t\t}\n\t\tif (selected) {\n\t\t\tthis.govSelect.emit({\n\t\t\t\tcomponent: FormAutocompleteClass.root,\n\t\t\t\tvalue: this.value,\n\t\t\t\tselected: selected,\n\t\t\t\toriginalEvent: e,\n\t\t\t})\n\t\t\tthis.clearList();\n\t\t\tif (has(this.nameKey, selected) && typeof selected[this.nameKey] === 'string') {\n\t\t\t\tthis.value = selected[this.nameKey]\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate onKeyUpHandler(e: CustomEvent) {\n\t\tconst event = (e.detail as FormInputEvent).originalEvent as KeyboardEvent\n\t\te.stopPropagation()\n\t\tevent.stopPropagation()\n\t\tif (event.keyCode === 38) this.onArrowUp()\n\t\telse if (event.keyCode === 40) this.onArrowDown()\n\t\telse if (event.keyCode === 13) {\n\t\t\te.preventDefault()\n\t\t\tevent.preventDefault()\n\t\t\tthis.onSelectHandler(e)\n\t\t}\n\t}\n\n\tprivate onKeyDownHandler(e: CustomEvent) {\n\t\tconst event = (e.detail as FormInputEvent).originalEvent as KeyboardEvent\n\t\te.stopPropagation()\n\t\tevent.stopPropagation()\n\t\tif (event.keyCode === 13) {\n\t\t\te.preventDefault()\n\t\t\tevent.preventDefault()\n\t\t}\n\t}\n\n\t/**\n\t * Focus main input element\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.inputRef.focus(options)\n\t}\n\n\t/**\n\t * Blur main input element\n\t */\n\t@Method()\n\tasync setBlur(): Promise<void> {\n\t\treturn this.inputRef.blur()\n\t}\n\n\t/**\n\t * Set options for list\n\t */\n\t@Method()\n\tasync setOptions(options: GovFormAutocompleteItem[]): Promise<void> {\n\t\tthis.list = Array.isArray(options) ? options : []\n\t\tthis.arrowCounter = -1\n\t}\n\n\t/**\n\t * Clears whisperer value\n\t */\n\t@Method()\n\tasync clearValue(): Promise<void> {\n\t\tthis.value = ''\n\t\tthis.inputRef.value = ''\n\n\t\tawait this.inputRef.clearValue()\n\t}\n\n\t/**\n\t * Clears whisperer value\n\t */\n\t@Method()\n\tasync setProcessing(status: boolean): Promise<void> {\n\t\tthis.processing = status\n\t}\n\n\t/**\n\t * Set a custom asynchronous function for the whisperer\n\t */\n\t@Method()\n\tasync setSearchCallback(callback: (value: string) => Promise<any>) {\n\t\tthis.searchCallback = callback\n\t}\n\n\t/**\n\t * Setting a custom whisper result template\n\t * @param callback\n\t */\n\t@Method()\n\tasync setTemplateResolver(callback: (item: GovFormAutocompleteItem) => string) {\n\t\tthis.templateResolver = callback\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAGA,MAAM,SAAS,GAAG,CAAC,KAAc,KAChC,OAAO,KAAK,KAAK,QAAQ,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,GAAG,EAAE;AAEhE,MAAM,yBAAyB,GAAG,CACxC,OAAkC,EAClC,KAAa,EACb,OAAe,EACf,UAAkB,KACY;AAC9B,IAAA,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,GAAG,EAAE;AACpD,IAAA,MAAM,eAAe,GAAG,SAAS,CAAC,KAAK,CAAC;AACxC,IAAA,MAAM,OAAO,GACZ,eAAe,CAAC,MAAM,KAAK;AAC1B,UAAE;AACF,UAAE,MAAM,CAAC,MAAM,CAAC,IAAI,IAAG;YACrB,MAAM,IAAI,GAAG,IAAI,KAAJ,IAAA,IAAA,IAAI,uBAAJ,IAAI,CAAG,OAAO,CAAC;AAC5B,YAAA,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC;AAC7E,SAAC,CAAC;IACL,OAAO,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,GAAG,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,GAAG,OAAO;AAC/F,CAAC;;MCJY,mBAAmB,GAAA,MAAA;AAU/B,IAAA,WAAA,CAAA,OAAA,EAAA;;;;;;AALQ,QAAA,IAAW,CAAA,WAAA,GAA8B,EAAE;AAC3C,QAAA,IAAgB,CAAA,gBAAA,GAAiE,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;AASnH;;AAEG;AACmC,QAAA,IAAK,CAAA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OAAkC,EAAA;AAClD,QAAA,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,GAAG,EAAE;AACjD,QAAA,IAAI,CAAC,YAAY,GAAG,EAAE;;AAGvB;;AAEG;AAEH,IAAA,MAAM,UAAU,GAAA;AACf,QAAA,IAAI,CAAC,KAAK,GAAG,EAAE;AACf,QAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,EAAE;AAExB,QAAA,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;;AAGjC;;AAEG;IAEH,MAAM,aAAa,CAAC,MAAe,EAAA;AAClC,QAAA,IAAI,CAAC,UAAU,GAAG,MAAM;;AAGzB;;AAEG;IAEH,MAAM,iBAAiB,CAAC,QAAyC,EAAA;AAChE,QAAA,IAAI,CAAC,cAAc,GAAG,QAAQ;;AAG/B;;;AAGG;IAEH,MAAM,mBAAmB,CAAC,QAAmD,EAAA;AAC5E,QAAA,IAAI,CAAC,gBAAgB,GAAG,QAAQ;;;;;;;;;;;;"}
@@ -159,7 +159,10 @@ const GovFormFile = class {
159
159
  }
160
160
  validateFiles(files) {
161
161
  let filesBuffer = [];
162
- Array.from(files).map(file => {
162
+ if (!this.multiple && this.displayAttachments) {
163
+ this.files = [];
164
+ }
165
+ Array.from(files).forEach(file => {
163
166
  const isFile = this.files.find(item => item.file.name === file.name && item.file.size === file.size) || null;
164
167
  if (isFile === null || this.ignoreFileDuplicationCheck) {
165
168
  const isSizeValid = typeof this.maxFileSize === "number" && this.maxFileSize > 0 ? fileSizeValidation(file, this.maxFileSize) : true;
@@ -182,6 +185,9 @@ const GovFormFile = class {
182
185
  });
183
186
  }
184
187
  });
188
+ if (this.displayAttachments) {
189
+ this.syncNativeInputFiles();
190
+ }
185
191
  this.govFiles.emit({
186
192
  component: FormFileClass.root,
187
193
  files: filesBuffer.length ? filesBuffer : this.files,
@@ -190,6 +196,25 @@ const GovFormFile = class {
190
196
  this.reset().finally();
191
197
  }
192
198
  }
199
+ // Keep native <input type="file"> in sync with the visible attachments list so
200
+ // that a native form submit / FormData carries exactly the files shown in the UI.
201
+ // Invalid items (wrong type or oversize) are intentionally excluded.
202
+ syncNativeInputFiles() {
203
+ if (!this.inputRef || typeof DataTransfer === "undefined") {
204
+ return;
205
+ }
206
+ try {
207
+ const dt = new DataTransfer();
208
+ this.files
209
+ .filter(item => item.acceptValid === true && item.sizeValid === true)
210
+ .forEach(item => dt.items.add(item.file));
211
+ this.inputRef.files = dt.files;
212
+ }
213
+ catch (e) {
214
+ // Safari < 14.1 / older browsers may reject assigning to .files; nothing safe to fall back to.
215
+ if (typeof process !== "undefined" && process.env && "production" !== "production") ;
216
+ }
217
+ }
193
218
  componentDidLoad() {
194
219
  this.attributeObserver = new AttributeObserver(this.host, (attributeName, newValue) => {
195
220
  this.onAriaAttributeChange(attributeName, newValue);
@@ -213,7 +238,7 @@ const GovFormFile = class {
213
238
  this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { [attributeName]: newValue });
214
239
  }
215
240
  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));
241
+ return (h(Host, { key: '6709aba5a796ccb9cf712dd5f962d5f903050d26', class: this.h.classes([FormFileClass.root]), invalid: toBoolAttrIfDefined(this.invalid), expanded: toBoolAttrIfDefined(this.expanded) }, h("div", { key: '668f6959ca55220ed2543dbbeddeb98f1b6c19ba', class: FormFileClass.area, ref: el => (this.areaRef = el) }, h("slot", { key: '5f12f12d074163b525e2200e23f61e6d0fb34c74' }), h("input", Object.assign({ key: '7cf43884dad3c28be956b9897862ff5a1fa22e75', 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: 'ec717f584bcd4d74416821736fb4bdcea517bc83', 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
242
  }
218
243
  onRemoveFileHandler(file) {
219
244
  const index = this.files.findIndex(item => item.id === file.id);
@@ -222,6 +247,7 @@ const GovFormFile = class {
222
247
  const removeFile = this.files[index];
223
248
  files.splice(index, 1);
224
249
  this.files = [...files];
250
+ this.syncNativeInputFiles();
225
251
  this.govRemoveFile.emit({
226
252
  component: FormFileClass.root,
227
253
  file: removeFile,
@@ -266,7 +292,10 @@ const GovFormFile = class {
266
292
  */
267
293
  async reset() {
268
294
  this.files = [];
269
- this.inputRef.value = '';
295
+ if (this.inputRef) {
296
+ this.inputRef.value = '';
297
+ this.syncNativeInputFiles();
298
+ }
270
299
  }
271
300
  get host() { return getElement(this); }
272
301
  static get watchers() { return {