@gov-design-system-ce/components 0.0.6 → 0.0.8

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 (566) hide show
  1. package/dist/cjs/Fragment-52846f79.js +7 -0
  2. package/dist/cjs/Fragment-52846f79.js.map +1 -0
  3. package/dist/cjs/{constants-5f6bbc50.js → constants-245999e7.js} +3 -2
  4. package/dist/cjs/constants-245999e7.js.map +1 -0
  5. package/dist/cjs/{constants-dc2ba6bd.js → constants-61f8be34.js} +3 -3
  6. package/dist/cjs/constants-61f8be34.js.map +1 -0
  7. package/dist/cjs/core.cjs.js +1 -1
  8. package/dist/cjs/gov-accordion-item.cjs.entry.js +2 -2
  9. package/dist/cjs/gov-accordion-item.cjs.entry.js.map +1 -1
  10. package/dist/cjs/gov-accordion.cjs.entry.js +2 -1
  11. package/dist/cjs/gov-accordion.cjs.entry.js.map +1 -1
  12. package/dist/cjs/gov-alert.cjs.entry.js +1 -1
  13. package/dist/cjs/gov-alert.cjs.entry.js.map +1 -1
  14. package/dist/cjs/gov-app.cjs.entry.js +673 -165
  15. package/dist/cjs/gov-app.cjs.entry.js.map +1 -1
  16. package/dist/cjs/gov-attachments_3.cjs.entry.js +1 -1
  17. package/dist/cjs/gov-attachments_3.cjs.entry.js.map +1 -1
  18. package/dist/cjs/gov-backdrop.cjs.entry.js +4 -3
  19. package/dist/cjs/gov-backdrop.cjs.entry.js.map +1 -1
  20. package/dist/cjs/gov-badge.cjs.entry.js +17 -17
  21. package/dist/cjs/gov-badge.cjs.entry.js.map +1 -1
  22. package/dist/cjs/gov-breadcrumbs.cjs.entry.js +1 -1
  23. package/dist/cjs/gov-breadcrumbs.cjs.entry.js.map +1 -1
  24. package/dist/cjs/gov-button.cjs.entry.js +14 -3
  25. package/dist/cjs/gov-button.cjs.entry.js.map +1 -1
  26. package/dist/cjs/gov-card.cjs.entry.js +1 -1
  27. package/dist/cjs/gov-card.cjs.entry.js.map +1 -1
  28. package/dist/cjs/gov-form-autocomplete.cjs.entry.js +4 -0
  29. package/dist/cjs/gov-form-autocomplete.cjs.entry.js.map +1 -1
  30. package/dist/cjs/gov-form-checkbox.cjs.entry.js +23 -7
  31. package/dist/cjs/gov-form-checkbox.cjs.entry.js.map +1 -1
  32. package/dist/cjs/gov-form-file.cjs.entry.js +7 -1
  33. package/dist/cjs/gov-form-file.cjs.entry.js.map +1 -1
  34. package/dist/cjs/gov-form-input.cjs.entry.js +8 -2
  35. package/dist/cjs/gov-form-input.cjs.entry.js.map +1 -1
  36. package/dist/cjs/gov-form-multi-select.cjs.entry.js +11 -3
  37. package/dist/cjs/gov-form-multi-select.cjs.entry.js.map +1 -1
  38. package/dist/cjs/gov-form-password-power.cjs.entry.js +28 -0
  39. package/dist/cjs/gov-form-password-power.cjs.entry.js.map +1 -0
  40. package/dist/cjs/gov-form-radio.cjs.entry.js +17 -1
  41. package/dist/cjs/gov-form-radio.cjs.entry.js.map +1 -1
  42. package/dist/cjs/gov-form-search.cjs.entry.js +1 -1
  43. package/dist/cjs/gov-form-search.cjs.entry.js.map +1 -1
  44. package/dist/cjs/gov-form-select.cjs.entry.js +3 -3
  45. package/dist/cjs/gov-form-select.cjs.entry.js.map +1 -1
  46. package/dist/cjs/gov-form-switch.cjs.entry.js +23 -7
  47. package/dist/cjs/gov-form-switch.cjs.entry.js.map +1 -1
  48. package/dist/cjs/gov-icon.cjs.entry.js +1 -1
  49. package/dist/cjs/gov-modal.cjs.entry.js +19 -13
  50. package/dist/cjs/gov-modal.cjs.entry.js.map +1 -1
  51. package/dist/cjs/gov-pagination.cjs.entry.js +50 -16
  52. package/dist/cjs/gov-pagination.cjs.entry.js.map +1 -1
  53. package/dist/cjs/gov-prompt.cjs.entry.js +12 -6
  54. package/dist/cjs/gov-prompt.cjs.entry.js.map +1 -1
  55. package/dist/cjs/gov-side-nav-item.cjs.entry.js +1 -1
  56. package/dist/cjs/gov-side-nav-item.cjs.entry.js.map +1 -1
  57. package/dist/cjs/gov-spacer.cjs.entry.js +1 -1
  58. package/dist/cjs/gov-spacer.cjs.entry.js.map +1 -1
  59. package/dist/cjs/gov-statsbar-item.cjs.entry.js +1 -1
  60. package/dist/cjs/gov-statsbar.cjs.entry.js +2 -2
  61. package/dist/cjs/gov-statsbar.cjs.entry.js.map +1 -1
  62. package/dist/cjs/gov-tabs.cjs.entry.js +1 -1
  63. package/dist/cjs/gov-tabs.cjs.entry.js.map +1 -1
  64. package/dist/cjs/gov-tile.cjs.entry.js +3 -2
  65. package/dist/cjs/gov-tile.cjs.entry.js.map +1 -1
  66. package/dist/cjs/gov-tiles.cjs.entry.js +2 -1
  67. package/dist/cjs/gov-tiles.cjs.entry.js.map +1 -1
  68. package/dist/cjs/gov-toast.cjs.entry.js +1 -1
  69. package/dist/cjs/gov-toast.cjs.entry.js.map +1 -1
  70. package/dist/cjs/gov-wizzard-item.cjs.entry.js +1 -1
  71. package/dist/cjs/gov-wizzard-item.cjs.entry.js.map +1 -1
  72. package/dist/cjs/index-356717ae.js +4 -0
  73. package/dist/cjs/loader.cjs.js +1 -1
  74. package/dist/collection/collection-manifest.json +1 -0
  75. package/dist/collection/components/gov-accordion/gov-accordion-item.css +37 -5
  76. package/dist/collection/components/gov-accordion/gov-accordion-item.js +1 -1
  77. package/dist/collection/components/gov-accordion/gov-accordion-item.js.map +1 -1
  78. package/dist/collection/components/gov-accordion/gov-accordion.css +6 -0
  79. package/dist/collection/components/gov-accordion/gov-accordion.js +19 -0
  80. package/dist/collection/components/gov-accordion/gov-accordion.js.map +1 -1
  81. package/dist/collection/components/gov-alert/gov-alert.css +3 -0
  82. package/dist/collection/components/gov-alert/gov-alert.js +1 -1
  83. package/dist/collection/components/gov-alert/gov-alert.js.map +1 -1
  84. package/dist/collection/components/gov-app/gov-app.css +3 -0
  85. package/dist/collection/components/gov-attachments/gov-attachments-item.css +3 -0
  86. package/dist/collection/components/gov-attachments/gov-attachments-item.js +1 -1
  87. package/dist/collection/components/gov-attachments/gov-attachments-item.js.map +1 -1
  88. package/dist/collection/components/gov-attachments/gov-attachments.css +3 -0
  89. package/dist/collection/components/gov-backdrop/gov-backdrop.css +3 -0
  90. package/dist/collection/components/gov-backdrop/gov-backdrop.js +5 -4
  91. package/dist/collection/components/gov-backdrop/gov-backdrop.js.map +1 -1
  92. package/dist/collection/components/gov-badge/constants.js +4 -1
  93. package/dist/collection/components/gov-badge/constants.js.map +1 -1
  94. package/dist/collection/components/gov-badge/gov-badge.css +204 -96
  95. package/dist/collection/components/gov-badge/gov-badge.js +26 -47
  96. package/dist/collection/components/gov-badge/gov-badge.js.map +1 -1
  97. package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.css +3 -0
  98. package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.js +1 -1
  99. package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.js.map +1 -1
  100. package/dist/collection/components/gov-button/constants.js +2 -1
  101. package/dist/collection/components/gov-button/constants.js.map +1 -1
  102. package/dist/collection/components/gov-button/gov-button.css +210 -131
  103. package/dist/collection/components/gov-button/gov-button.js +18 -7
  104. package/dist/collection/components/gov-button/gov-button.js.map +1 -1
  105. package/dist/collection/components/gov-card/gov-card.css +3 -0
  106. package/dist/collection/components/gov-card/gov-card.js +1 -1
  107. package/dist/collection/components/gov-card/gov-card.js.map +1 -1
  108. package/dist/collection/components/gov-container/gov-container.css +3 -0
  109. package/dist/collection/components/gov-cookiebar/gov-cookiebar.css +3 -0
  110. package/dist/collection/components/gov-empty/gov-empty.css +3 -0
  111. package/dist/collection/components/gov-error-code/gov-error-code.css +3 -0
  112. package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.css +3 -0
  113. package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js +4 -0
  114. package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.js.map +1 -1
  115. package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.css +3 -0
  116. package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.js +53 -19
  117. package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.js.map +1 -1
  118. package/dist/collection/components/gov-form/control/gov-form-control.css +3 -0
  119. package/dist/collection/components/gov-form/file/gov-form-file.css +3 -0
  120. package/dist/collection/components/gov-form/file/gov-form-file.js +7 -1
  121. package/dist/collection/components/gov-form/file/gov-form-file.js.map +1 -1
  122. package/dist/collection/components/gov-form/group/gov-form-group.css +3 -0
  123. package/dist/collection/components/gov-form/input/gov-form-input.css +6 -3
  124. package/dist/collection/components/gov-form/input/gov-form-input.js +7 -1
  125. package/dist/collection/components/gov-form/input/gov-form-input.js.map +1 -1
  126. package/dist/collection/components/gov-form/label/gov-form-label.css +3 -0
  127. package/dist/collection/components/gov-form/message/gov-form-message.css +3 -0
  128. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.css +3 -3
  129. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js +10 -2
  130. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js.map +1 -1
  131. package/dist/collection/components/gov-form/password-power/constants.js +6 -0
  132. package/dist/collection/components/gov-form/password-power/constants.js.map +1 -0
  133. package/dist/collection/components/gov-form/password-power/gov-form-password-power.css +246 -0
  134. package/dist/collection/components/gov-form/password-power/gov-form-password-power.js +43 -0
  135. package/dist/collection/components/gov-form/password-power/gov-form-password-power.js.map +1 -0
  136. package/dist/collection/components/gov-form/radio/gov-form-radio.css +3 -0
  137. package/dist/collection/components/gov-form/radio/gov-form-radio.js +35 -1
  138. package/dist/collection/components/gov-form/radio/gov-form-radio.js.map +1 -1
  139. package/dist/collection/components/gov-form/search/gov-form-search.css +7 -0
  140. package/dist/collection/components/gov-form/select/gov-form-select.css +3 -3
  141. package/dist/collection/components/gov-form/select/gov-form-select.js +2 -2
  142. package/dist/collection/components/gov-form/select/gov-form-select.js.map +1 -1
  143. package/dist/collection/components/gov-form/switch/gov-form-switch.css +3 -0
  144. package/dist/collection/components/gov-form/switch/gov-form-switch.js +52 -18
  145. package/dist/collection/components/gov-form/switch/gov-form-switch.js.map +1 -1
  146. package/dist/collection/components/gov-grid/gov-grid-item.css +3 -0
  147. package/dist/collection/components/gov-grid/gov-grid.css +3 -0
  148. package/dist/collection/components/gov-icon/gov-icon.css +3 -0
  149. package/dist/collection/components/gov-icon/list.js +148 -5
  150. package/dist/collection/components/gov-icon/list.js.map +1 -1
  151. package/dist/collection/components/gov-layout/gov-layout-column.css +3 -0
  152. package/dist/collection/components/gov-layout/gov-layout.css +3 -0
  153. package/dist/collection/components/gov-loading/gov-loading.css +3 -0
  154. package/dist/collection/components/gov-message/gov-message.css +3 -0
  155. package/dist/collection/components/gov-modal/gov-modal.css +6 -3
  156. package/dist/collection/components/gov-modal/gov-modal.js +35 -22
  157. package/dist/collection/components/gov-modal/gov-modal.js.map +1 -1
  158. package/dist/collection/components/gov-nav/gov-nav-item.css +3 -0
  159. package/dist/collection/components/gov-nav/gov-nav.css +3 -0
  160. package/dist/collection/components/gov-pagination/gov-pagination.css +88 -39
  161. package/dist/collection/components/gov-pagination/gov-pagination.js +63 -29
  162. package/dist/collection/components/gov-pagination/gov-pagination.js.map +1 -1
  163. package/dist/collection/components/gov-promp/gov-prompt.css +6 -3
  164. package/dist/collection/components/gov-promp/gov-prompt.js +18 -5
  165. package/dist/collection/components/gov-promp/gov-prompt.js.map +1 -1
  166. package/dist/collection/components/gov-side-nav/gov-side-nav-item.css +3 -0
  167. package/dist/collection/components/gov-side-nav/gov-side-nav-item.js +1 -1
  168. package/dist/collection/components/gov-side-nav/gov-side-nav-item.js.map +1 -1
  169. package/dist/collection/components/gov-side-nav/gov-side-nav.css +3 -0
  170. package/dist/collection/components/gov-spacer/gov-spacer.css +3 -0
  171. package/dist/collection/components/gov-spacer/gov-spacer.js +3 -2
  172. package/dist/collection/components/gov-spacer/gov-spacer.js.map +1 -1
  173. package/dist/collection/components/gov-statsbar/constants.js +1 -1
  174. package/dist/collection/components/gov-statsbar/constants.js.map +1 -1
  175. package/dist/collection/components/gov-statsbar/gov-statsbar-item.css +3 -0
  176. package/dist/collection/components/gov-statsbar/gov-statsbar.css +3 -0
  177. package/dist/collection/components/gov-statsbar/gov-statsbar.js +2 -2
  178. package/dist/collection/components/gov-statsbar/gov-statsbar.js.map +1 -1
  179. package/dist/collection/components/gov-stepper/gov-stepper-item.css +3 -0
  180. package/dist/collection/components/gov-stepper/gov-stepper.css +3 -0
  181. package/dist/collection/components/gov-tabs/gov-tabs-item.css +3 -0
  182. package/dist/collection/components/gov-tabs/gov-tabs.css +3 -0
  183. package/dist/collection/components/gov-tabs/gov-tabs.js +1 -1
  184. package/dist/collection/components/gov-tabs/gov-tabs.js.map +1 -1
  185. package/dist/collection/components/gov-tile/constants.js +1 -0
  186. package/dist/collection/components/gov-tile/constants.js.map +1 -1
  187. package/dist/collection/components/gov-tile/gov-tile.css +11 -4
  188. package/dist/collection/components/gov-tile/gov-tile.js +3 -6
  189. package/dist/collection/components/gov-tile/gov-tile.js.map +1 -1
  190. package/dist/collection/components/gov-tiles/gov-tiles.css +6 -0
  191. package/dist/collection/components/gov-tiles/gov-tiles.js +19 -0
  192. package/dist/collection/components/gov-tiles/gov-tiles.js.map +1 -1
  193. package/dist/collection/components/gov-toast/gov-toast.css +3 -0
  194. package/dist/collection/components/gov-toast/gov-toast.js +1 -1
  195. package/dist/collection/components/gov-toast/gov-toast.js.map +1 -1
  196. package/dist/collection/components/gov-tooltip/gov-tooltip-content.css +3 -0
  197. package/dist/collection/components/gov-tooltip/gov-tooltip.css +3 -0
  198. package/dist/collection/components/gov-wizzard/gov-wizzard-item.css +3 -0
  199. package/dist/collection/components/gov-wizzard/gov-wizzard-item.js +1 -1
  200. package/dist/collection/components/gov-wizzard/gov-wizzard-item.js.map +1 -1
  201. package/dist/collection/components/gov-wizzard/gov-wizzard.css +3 -0
  202. package/dist/collection/pages/Accordion.js +97 -2
  203. package/dist/collection/pages/Accordion.js.map +1 -1
  204. package/dist/collection/pages/Badge.js +27 -0
  205. package/dist/collection/pages/Badge.js.map +1 -1
  206. package/dist/collection/pages/Button.js +440 -120
  207. package/dist/collection/pages/Button.js.map +1 -1
  208. package/dist/collection/pages/Error.js +1 -1
  209. package/dist/collection/pages/Error.js.map +1 -1
  210. package/dist/collection/pages/Forms.js +46 -29
  211. package/dist/collection/pages/Forms.js.map +1 -1
  212. package/dist/collection/pages/Pagination.js +12 -2
  213. package/dist/collection/pages/Pagination.js.map +1 -1
  214. package/dist/collection/pages/Stepper.js +6 -6
  215. package/dist/collection/pages/Stepper.js.map +1 -1
  216. package/dist/collection/pages/Tiles.js +39 -0
  217. package/dist/collection/pages/Tiles.js.map +1 -1
  218. package/dist/collection/pages/ToastMessage.js +1 -1
  219. package/dist/collection/pages/ToastMessage.js.map +1 -1
  220. package/dist/collection/pages/ToastMessageCountdown.js +1 -1
  221. package/dist/collection/pages/ToastMessageCountdown.js.map +1 -1
  222. package/dist/collection/pages/Wizzard.js +3 -3
  223. package/dist/collection/pages/Wizzard.js.map +1 -1
  224. package/dist/collection/utils/array.utils.js +2 -0
  225. package/dist/collection/utils/array.utils.js.map +1 -0
  226. package/dist/components/Fragment.js +5 -0
  227. package/dist/components/Fragment.js.map +1 -0
  228. package/dist/components/constants11.js +2 -2
  229. package/dist/components/constants11.js.map +1 -1
  230. package/dist/components/constants3.js +2 -1
  231. package/dist/components/constants3.js.map +1 -1
  232. package/dist/components/gov-accordion-item.js +2 -3
  233. package/dist/components/gov-accordion-item.js.map +1 -1
  234. package/dist/components/gov-accordion.js +3 -2
  235. package/dist/components/gov-accordion.js.map +1 -1
  236. package/dist/components/gov-alert.js +1 -2
  237. package/dist/components/gov-alert.js.map +1 -1
  238. package/dist/components/gov-app.js +673 -166
  239. package/dist/components/gov-app.js.map +1 -1
  240. package/dist/components/gov-attachments-item2.js +1 -2
  241. package/dist/components/gov-attachments-item2.js.map +1 -1
  242. package/dist/components/gov-attachments2.js +0 -1
  243. package/dist/components/gov-attachments2.js.map +1 -1
  244. package/dist/components/gov-backdrop2.js +5 -5
  245. package/dist/components/gov-backdrop2.js.map +1 -1
  246. package/dist/components/gov-badge2.js +16 -18
  247. package/dist/components/gov-badge2.js.map +1 -1
  248. package/dist/components/gov-breadcrumbs.js +1 -2
  249. package/dist/components/gov-breadcrumbs.js.map +1 -1
  250. package/dist/components/gov-button2.js +17 -7
  251. package/dist/components/gov-button2.js.map +1 -1
  252. package/dist/components/gov-card.js +1 -2
  253. package/dist/components/gov-card.js.map +1 -1
  254. package/dist/components/gov-container.js +0 -1
  255. package/dist/components/gov-container.js.map +1 -1
  256. package/dist/components/gov-cookiebar.js +0 -1
  257. package/dist/components/gov-cookiebar.js.map +1 -1
  258. package/dist/components/gov-empty.js +0 -1
  259. package/dist/components/gov-empty.js.map +1 -1
  260. package/dist/components/gov-error-code.js +0 -1
  261. package/dist/components/gov-error-code.js.map +1 -1
  262. package/dist/components/gov-form-autocomplete2.js +4 -1
  263. package/dist/components/gov-form-autocomplete2.js.map +1 -1
  264. package/dist/components/gov-form-checkbox.js +24 -8
  265. package/dist/components/gov-form-checkbox.js.map +1 -1
  266. package/dist/components/gov-form-control.js +0 -1
  267. package/dist/components/gov-form-control.js.map +1 -1
  268. package/dist/components/gov-form-file.js +7 -2
  269. package/dist/components/gov-form-file.js.map +1 -1
  270. package/dist/components/gov-form-group.js +0 -1
  271. package/dist/components/gov-form-group.js.map +1 -1
  272. package/dist/components/gov-form-input2.js +8 -3
  273. package/dist/components/gov-form-input2.js.map +1 -1
  274. package/dist/components/gov-form-label.js +0 -1
  275. package/dist/components/gov-form-label.js.map +1 -1
  276. package/dist/components/gov-form-message2.js +0 -1
  277. package/dist/components/gov-form-message2.js.map +1 -1
  278. package/dist/components/gov-form-multi-select.js +11 -4
  279. package/dist/components/gov-form-multi-select.js.map +1 -1
  280. package/dist/components/gov-form-password-power.d.ts +11 -0
  281. package/dist/components/gov-form-password-power.js +43 -0
  282. package/dist/components/gov-form-password-power.js.map +1 -0
  283. package/dist/components/gov-form-radio.js +18 -2
  284. package/dist/components/gov-form-radio.js.map +1 -1
  285. package/dist/components/gov-form-search.js +1 -2
  286. package/dist/components/gov-form-search.js.map +1 -1
  287. package/dist/components/gov-form-select2.js +3 -4
  288. package/dist/components/gov-form-select2.js.map +1 -1
  289. package/dist/components/gov-form-switch.js +24 -8
  290. package/dist/components/gov-form-switch.js.map +1 -1
  291. package/dist/components/gov-grid-item.js +0 -1
  292. package/dist/components/gov-grid-item.js.map +1 -1
  293. package/dist/components/gov-grid.js +0 -1
  294. package/dist/components/gov-grid.js.map +1 -1
  295. package/dist/components/gov-icon2.js +1 -2
  296. package/dist/components/gov-icon2.js.map +1 -1
  297. package/dist/components/gov-layout-column.js +0 -1
  298. package/dist/components/gov-layout-column.js.map +1 -1
  299. package/dist/components/gov-layout.js +0 -1
  300. package/dist/components/gov-layout.js.map +1 -1
  301. package/dist/components/gov-loading.js +0 -1
  302. package/dist/components/gov-loading.js.map +1 -1
  303. package/dist/components/gov-message.js +0 -1
  304. package/dist/components/gov-message.js.map +1 -1
  305. package/dist/components/gov-modal.js +20 -14
  306. package/dist/components/gov-modal.js.map +1 -1
  307. package/dist/components/gov-nav-item.js +0 -1
  308. package/dist/components/gov-nav-item.js.map +1 -1
  309. package/dist/components/gov-nav.js +0 -1
  310. package/dist/components/gov-nav.js.map +1 -1
  311. package/dist/components/gov-pagination.js +50 -17
  312. package/dist/components/gov-pagination.js.map +1 -1
  313. package/dist/components/gov-prompt.js +13 -7
  314. package/dist/components/gov-prompt.js.map +1 -1
  315. package/dist/components/gov-side-nav-item.js +1 -2
  316. package/dist/components/gov-side-nav-item.js.map +1 -1
  317. package/dist/components/gov-side-nav.js +0 -1
  318. package/dist/components/gov-side-nav.js.map +1 -1
  319. package/dist/components/gov-spacer.js +1 -2
  320. package/dist/components/gov-spacer.js.map +1 -1
  321. package/dist/components/gov-statsbar-item.js +0 -1
  322. package/dist/components/gov-statsbar-item.js.map +1 -1
  323. package/dist/components/gov-statsbar.js +2 -3
  324. package/dist/components/gov-statsbar.js.map +1 -1
  325. package/dist/components/gov-stepper-item.js +0 -1
  326. package/dist/components/gov-stepper-item.js.map +1 -1
  327. package/dist/components/gov-stepper.js +0 -1
  328. package/dist/components/gov-stepper.js.map +1 -1
  329. package/dist/components/gov-tabs-item.js +0 -1
  330. package/dist/components/gov-tabs-item.js.map +1 -1
  331. package/dist/components/gov-tabs.js +1 -2
  332. package/dist/components/gov-tabs.js.map +1 -1
  333. package/dist/components/gov-tile.js +3 -3
  334. package/dist/components/gov-tile.js.map +1 -1
  335. package/dist/components/gov-tiles.js +4 -3
  336. package/dist/components/gov-tiles.js.map +1 -1
  337. package/dist/components/gov-toast.js +1 -2
  338. package/dist/components/gov-toast.js.map +1 -1
  339. package/dist/components/gov-tooltip-content.js +0 -1
  340. package/dist/components/gov-tooltip-content.js.map +1 -1
  341. package/dist/components/gov-tooltip.js +0 -1
  342. package/dist/components/gov-tooltip.js.map +1 -1
  343. package/dist/components/gov-wizzard-item.js +1 -2
  344. package/dist/components/gov-wizzard-item.js.map +1 -1
  345. package/dist/components/gov-wizzard.js +0 -1
  346. package/dist/components/gov-wizzard.js.map +1 -1
  347. package/dist/components/index.d.ts +1 -0
  348. package/dist/components/index.js +1 -0
  349. package/dist/components/index.js.map +1 -1
  350. package/dist/core/core.css +1 -1
  351. package/dist/core/core.esm.js +1 -1
  352. package/dist/core/core.esm.js.map +1 -1
  353. package/dist/core/{p-e7dd2002.entry.js → p-00e1e600.entry.js} +2 -2
  354. package/dist/core/p-00e1e600.entry.js.map +1 -0
  355. package/dist/core/{p-ae3e2d60.entry.js → p-04fc18ab.entry.js} +2 -2
  356. package/dist/core/p-04fc18ab.entry.js.map +1 -0
  357. package/dist/core/p-0950ba85.entry.js +2 -0
  358. package/dist/core/p-0950ba85.entry.js.map +1 -0
  359. package/dist/core/{p-5fa41af9.js → p-1020a160.js} +1 -1
  360. package/dist/core/p-1020a160.js.map +1 -0
  361. package/dist/core/{p-9e6a41cc.entry.js → p-16608a87.entry.js} +2 -2
  362. package/dist/core/p-16608a87.entry.js.map +1 -0
  363. package/dist/core/{p-f5ee7634.entry.js → p-1bb5184f.entry.js} +2 -2
  364. package/dist/core/{p-f5ee7634.entry.js.map → p-1bb5184f.entry.js.map} +1 -1
  365. package/dist/core/p-1c06fb0b.entry.js +2 -0
  366. package/dist/core/p-1c06fb0b.entry.js.map +1 -0
  367. package/dist/core/p-1c1d0bbe.js +2 -0
  368. package/dist/core/p-1c1d0bbe.js.map +1 -0
  369. package/dist/core/{p-b48a3112.entry.js → p-4b375a4d.entry.js} +2 -2
  370. package/dist/core/{p-b48a3112.entry.js.map → p-4b375a4d.entry.js.map} +1 -1
  371. package/dist/core/p-5b4e3bdf.entry.js +2 -0
  372. package/dist/core/p-5b4e3bdf.entry.js.map +1 -0
  373. package/dist/core/p-613d8ed8.entry.js +2 -0
  374. package/dist/core/p-613d8ed8.entry.js.map +1 -0
  375. package/dist/core/{p-6d40721b.entry.js → p-63d2e8ec.entry.js} +2 -2
  376. package/dist/core/{p-6d40721b.entry.js.map → p-63d2e8ec.entry.js.map} +1 -1
  377. package/dist/core/{p-f5ffcb3d.entry.js → p-72b9e63a.entry.js} +2 -2
  378. package/dist/core/{p-5cecdaaf.entry.js → p-72f16a95.entry.js} +2 -2
  379. package/dist/core/p-7ac5f119.entry.js +2 -0
  380. package/dist/core/{p-63079b80.entry.js.map → p-7ac5f119.entry.js.map} +1 -1
  381. package/dist/core/{p-03d40bf4.entry.js → p-833ab414.entry.js} +2 -2
  382. package/dist/core/{p-03d40bf4.entry.js.map → p-833ab414.entry.js.map} +1 -1
  383. package/dist/core/{p-34360f92.entry.js → p-84fda9dd.entry.js} +2 -2
  384. package/dist/core/{p-34360f92.entry.js.map → p-84fda9dd.entry.js.map} +1 -1
  385. package/dist/core/p-851939ff.entry.js +2 -0
  386. package/dist/core/p-851939ff.entry.js.map +1 -0
  387. package/dist/core/p-8dacc8dc.entry.js +2 -0
  388. package/dist/core/p-8dacc8dc.entry.js.map +1 -0
  389. package/dist/core/p-8dbad4a2.entry.js +2 -0
  390. package/dist/core/p-8dbad4a2.entry.js.map +1 -0
  391. package/dist/core/p-902002e9.entry.js +2 -0
  392. package/dist/core/p-902002e9.entry.js.map +1 -0
  393. package/dist/core/p-95f21fbf.entry.js +2 -0
  394. package/dist/core/p-95f21fbf.entry.js.map +1 -0
  395. package/dist/core/p-99155ec0.entry.js +2 -0
  396. package/dist/core/p-99155ec0.entry.js.map +1 -0
  397. package/dist/core/{p-7591ecd4.entry.js → p-9ca0a11c.entry.js} +2 -2
  398. package/dist/core/{p-7591ecd4.entry.js.map → p-9ca0a11c.entry.js.map} +1 -1
  399. package/dist/core/p-9ceeba49.entry.js +2 -0
  400. package/dist/core/p-9ceeba49.entry.js.map +1 -0
  401. package/dist/core/{p-ec617f18.entry.js → p-9d30e79e.entry.js} +2 -2
  402. package/dist/core/{p-ec617f18.entry.js.map → p-9d30e79e.entry.js.map} +1 -1
  403. package/dist/core/{p-38fb2d42.entry.js → p-a36234bb.entry.js} +2 -2
  404. package/dist/core/p-a36234bb.entry.js.map +1 -0
  405. package/dist/core/p-ac33c5ef.entry.js +2 -0
  406. package/dist/core/p-ac33c5ef.entry.js.map +1 -0
  407. package/dist/core/p-b966062a.entry.js +2 -0
  408. package/dist/core/p-b966062a.entry.js.map +1 -0
  409. package/dist/core/{p-fc1581f9.entry.js → p-bd560ffc.entry.js} +2 -2
  410. package/dist/core/{p-fc1581f9.entry.js.map → p-bd560ffc.entry.js.map} +1 -1
  411. package/dist/core/{p-93facb4a.entry.js → p-c0430e75.entry.js} +2 -2
  412. package/dist/core/p-c0430e75.entry.js.map +1 -0
  413. package/dist/core/p-c9948e57.entry.js +2 -0
  414. package/dist/core/p-c9948e57.entry.js.map +1 -0
  415. package/dist/core/p-cd869237.js +2 -0
  416. package/dist/core/p-cd869237.js.map +1 -0
  417. package/dist/core/{p-9cc6ed83.entry.js → p-e57d250f.entry.js} +2 -2
  418. package/dist/core/p-e57d250f.entry.js.map +1 -0
  419. package/dist/core/p-ecdfb046.entry.js +2 -0
  420. package/dist/core/p-ecdfb046.entry.js.map +1 -0
  421. package/dist/core/p-fac1c202.entry.js +2 -0
  422. package/dist/core/p-fac1c202.entry.js.map +1 -0
  423. package/dist/custom-elements/index.d.ts +6 -0
  424. package/dist/custom-elements/index.js +1 -1
  425. package/dist/custom-elements/index.js.map +1 -1
  426. package/dist/esm/Fragment-8d8d54fb.js +5 -0
  427. package/dist/esm/Fragment-8d8d54fb.js.map +1 -0
  428. package/dist/esm/{constants-d550c816.js → constants-037c35bc.js} +3 -3
  429. package/dist/esm/constants-037c35bc.js.map +1 -0
  430. package/dist/esm/{constants-1a2146b2.js → constants-45f6db4c.js} +3 -2
  431. package/dist/esm/constants-45f6db4c.js.map +1 -0
  432. package/dist/esm/core.js +1 -1
  433. package/dist/esm/gov-accordion-item.entry.js +2 -2
  434. package/dist/esm/gov-accordion-item.entry.js.map +1 -1
  435. package/dist/esm/gov-accordion.entry.js +2 -1
  436. package/dist/esm/gov-accordion.entry.js.map +1 -1
  437. package/dist/esm/gov-alert.entry.js +1 -1
  438. package/dist/esm/gov-alert.entry.js.map +1 -1
  439. package/dist/esm/gov-app.entry.js +673 -165
  440. package/dist/esm/gov-app.entry.js.map +1 -1
  441. package/dist/esm/gov-attachments_3.entry.js +1 -1
  442. package/dist/esm/gov-attachments_3.entry.js.map +1 -1
  443. package/dist/esm/gov-backdrop.entry.js +5 -4
  444. package/dist/esm/gov-backdrop.entry.js.map +1 -1
  445. package/dist/esm/gov-badge.entry.js +17 -17
  446. package/dist/esm/gov-badge.entry.js.map +1 -1
  447. package/dist/esm/gov-breadcrumbs.entry.js +1 -1
  448. package/dist/esm/gov-breadcrumbs.entry.js.map +1 -1
  449. package/dist/esm/gov-button.entry.js +14 -3
  450. package/dist/esm/gov-button.entry.js.map +1 -1
  451. package/dist/esm/gov-card.entry.js +1 -1
  452. package/dist/esm/gov-card.entry.js.map +1 -1
  453. package/dist/esm/gov-form-autocomplete.entry.js +4 -0
  454. package/dist/esm/gov-form-autocomplete.entry.js.map +1 -1
  455. package/dist/esm/gov-form-checkbox.entry.js +23 -7
  456. package/dist/esm/gov-form-checkbox.entry.js.map +1 -1
  457. package/dist/esm/gov-form-file.entry.js +7 -1
  458. package/dist/esm/gov-form-file.entry.js.map +1 -1
  459. package/dist/esm/gov-form-input.entry.js +8 -2
  460. package/dist/esm/gov-form-input.entry.js.map +1 -1
  461. package/dist/esm/gov-form-multi-select.entry.js +11 -3
  462. package/dist/esm/gov-form-multi-select.entry.js.map +1 -1
  463. package/dist/esm/gov-form-password-power.entry.js +24 -0
  464. package/dist/esm/gov-form-password-power.entry.js.map +1 -0
  465. package/dist/esm/gov-form-radio.entry.js +17 -1
  466. package/dist/esm/gov-form-radio.entry.js.map +1 -1
  467. package/dist/esm/gov-form-search.entry.js +1 -1
  468. package/dist/esm/gov-form-search.entry.js.map +1 -1
  469. package/dist/esm/gov-form-select.entry.js +3 -3
  470. package/dist/esm/gov-form-select.entry.js.map +1 -1
  471. package/dist/esm/gov-form-switch.entry.js +23 -7
  472. package/dist/esm/gov-form-switch.entry.js.map +1 -1
  473. package/dist/esm/gov-icon.entry.js +1 -1
  474. package/dist/esm/gov-modal.entry.js +19 -13
  475. package/dist/esm/gov-modal.entry.js.map +1 -1
  476. package/dist/esm/gov-pagination.entry.js +50 -16
  477. package/dist/esm/gov-pagination.entry.js.map +1 -1
  478. package/dist/esm/gov-prompt.entry.js +12 -6
  479. package/dist/esm/gov-prompt.entry.js.map +1 -1
  480. package/dist/esm/gov-side-nav-item.entry.js +1 -1
  481. package/dist/esm/gov-side-nav-item.entry.js.map +1 -1
  482. package/dist/esm/gov-spacer.entry.js +1 -1
  483. package/dist/esm/gov-spacer.entry.js.map +1 -1
  484. package/dist/esm/gov-statsbar-item.entry.js +1 -1
  485. package/dist/esm/gov-statsbar.entry.js +2 -2
  486. package/dist/esm/gov-statsbar.entry.js.map +1 -1
  487. package/dist/esm/gov-tabs.entry.js +1 -1
  488. package/dist/esm/gov-tabs.entry.js.map +1 -1
  489. package/dist/esm/gov-tile.entry.js +3 -2
  490. package/dist/esm/gov-tile.entry.js.map +1 -1
  491. package/dist/esm/gov-tiles.entry.js +2 -1
  492. package/dist/esm/gov-tiles.entry.js.map +1 -1
  493. package/dist/esm/gov-toast.entry.js +1 -1
  494. package/dist/esm/gov-toast.entry.js.map +1 -1
  495. package/dist/esm/gov-wizzard-item.entry.js +1 -1
  496. package/dist/esm/gov-wizzard-item.entry.js.map +1 -1
  497. package/dist/esm/index-00e9a0d5.js +4 -0
  498. package/dist/esm/loader.js +1 -1
  499. package/dist/hydrate/index.js +946 -271
  500. package/dist/types/components/gov-accordion/gov-accordion.d.ts +4 -0
  501. package/dist/types/components/gov-badge/constants.d.ts +4 -2
  502. package/dist/types/components/gov-badge/gov-badge.d.ts +4 -9
  503. package/dist/types/components/gov-button/constants.d.ts +3 -2
  504. package/dist/types/components/gov-button/gov-button.d.ts +2 -0
  505. package/dist/types/components/gov-form/checkbox/gov-form-checkbox.d.ts +8 -3
  506. package/dist/types/components/gov-form/file/gov-form-file.d.ts +1 -0
  507. package/dist/types/components/gov-form/password-power/constants.d.ts +5 -0
  508. package/dist/types/components/gov-form/password-power/gov-form-password-power.d.ts +7 -0
  509. package/dist/types/components/gov-form/radio/gov-form-radio.d.ts +5 -0
  510. package/dist/types/components/gov-form/switch/gov-form-switch.d.ts +8 -3
  511. package/dist/types/components/gov-modal/gov-modal.d.ts +3 -1
  512. package/dist/types/components/gov-pagination/gov-pagination.d.ts +7 -3
  513. package/dist/types/components/gov-promp/gov-prompt.d.ts +3 -1
  514. package/dist/types/components/gov-statsbar/constants.d.ts +2 -2
  515. package/dist/types/components/gov-tile/constants.d.ts +1 -0
  516. package/dist/types/components/gov-tile/gov-tile.d.ts +1 -2
  517. package/dist/types/components/gov-tiles/gov-tiles.d.ts +4 -0
  518. package/dist/types/components.d.ts +65 -14
  519. package/dist/types/utils/array.utils.d.ts +1 -0
  520. package/package.json +1 -1
  521. package/dist/cjs/constants-5f6bbc50.js.map +0 -1
  522. package/dist/cjs/constants-dc2ba6bd.js.map +0 -1
  523. package/dist/core/p-00182e76.entry.js +0 -2
  524. package/dist/core/p-00182e76.entry.js.map +0 -1
  525. package/dist/core/p-0278fcb3.entry.js +0 -2
  526. package/dist/core/p-0278fcb3.entry.js.map +0 -1
  527. package/dist/core/p-08f14c8b.entry.js +0 -2
  528. package/dist/core/p-08f14c8b.entry.js.map +0 -1
  529. package/dist/core/p-0a152bb7.entry.js +0 -2
  530. package/dist/core/p-0a152bb7.entry.js.map +0 -1
  531. package/dist/core/p-14f8f2fb.js +0 -2
  532. package/dist/core/p-14f8f2fb.js.map +0 -1
  533. package/dist/core/p-2128abe1.entry.js +0 -2
  534. package/dist/core/p-2128abe1.entry.js.map +0 -1
  535. package/dist/core/p-22722ff3.entry.js +0 -2
  536. package/dist/core/p-22722ff3.entry.js.map +0 -1
  537. package/dist/core/p-2419f4cd.entry.js +0 -2
  538. package/dist/core/p-2419f4cd.entry.js.map +0 -1
  539. package/dist/core/p-38fb2d42.entry.js.map +0 -1
  540. package/dist/core/p-4681cb3a.entry.js +0 -2
  541. package/dist/core/p-4681cb3a.entry.js.map +0 -1
  542. package/dist/core/p-469273be.entry.js +0 -2
  543. package/dist/core/p-469273be.entry.js.map +0 -1
  544. package/dist/core/p-5547dbb0.entry.js +0 -2
  545. package/dist/core/p-5547dbb0.entry.js.map +0 -1
  546. package/dist/core/p-5fa41af9.js.map +0 -1
  547. package/dist/core/p-63079b80.entry.js +0 -2
  548. package/dist/core/p-8965f84a.entry.js +0 -2
  549. package/dist/core/p-8965f84a.entry.js.map +0 -1
  550. package/dist/core/p-93facb4a.entry.js.map +0 -1
  551. package/dist/core/p-9cc6ed83.entry.js.map +0 -1
  552. package/dist/core/p-9e6a41cc.entry.js.map +0 -1
  553. package/dist/core/p-ad0cc981.entry.js +0 -2
  554. package/dist/core/p-ad0cc981.entry.js.map +0 -1
  555. package/dist/core/p-ae3e2d60.entry.js.map +0 -1
  556. package/dist/core/p-e52a042f.entry.js +0 -2
  557. package/dist/core/p-e52a042f.entry.js.map +0 -1
  558. package/dist/core/p-e7dd2002.entry.js.map +0 -1
  559. package/dist/core/p-f2dc8ce3.entry.js +0 -2
  560. package/dist/core/p-f2dc8ce3.entry.js.map +0 -1
  561. package/dist/core/p-fc91591d.entry.js +0 -2
  562. package/dist/core/p-fc91591d.entry.js.map +0 -1
  563. package/dist/esm/constants-1a2146b2.js.map +0 -1
  564. package/dist/esm/constants-d550c816.js.map +0 -1
  565. /package/dist/core/{p-f5ffcb3d.entry.js.map → p-72b9e63a.entry.js.map} +0 -0
  566. /package/dist/core/{p-5cecdaaf.entry.js.map → p-72f16a95.entry.js.map} +0 -0
@@ -148,6 +148,9 @@
148
148
  /*
149
149
  - Variables - Form multiselect
150
150
  */
151
+ /*
152
+ - Variables - Form password power
153
+ */
151
154
  /*
152
155
  - Variables - Form checkbox & radio
153
156
  */
@@ -314,9 +317,6 @@
314
317
  [invalid="1"].gov-form-input *[slot=right-icon] {
315
318
  color: var(--gov-form-state-color-error, var(--gov-color-error));
316
319
  }
317
- [invalid=""].gov-form-input *[slot=right-icon]:not(.icon-validation):not(.icon-arrow), [invalid=true i].gov-form-input *[slot=right-icon]:not(.icon-validation):not(.icon-arrow), [invalid="1"].gov-form-input *[slot=right-icon]:not(.icon-validation):not(.icon-arrow) {
318
- display: none;
319
- }
320
320
  [success=""].gov-form-input *[slot=right-icon], [success=true i].gov-form-input *[slot=right-icon], [success="1"].gov-form-input *[slot=right-icon] {
321
321
  color: var(--gov-form-state-color-success, var(--gov-color-success));
322
322
  }
@@ -423,6 +423,9 @@
423
423
  padding-right: var(--gov-form-input-core-xl-icon-padding, 3rem);
424
424
  }
425
425
 
426
+ .gov-form-input[invalid=""] *[slot=right-icon]:not(.icon-validation):not(.icon-arrow), .gov-form-input[invalid=true i] *[slot=right-icon]:not(.icon-validation):not(.icon-arrow), .gov-form-input[invalid="1"] *[slot=right-icon]:not(.icon-validation):not(.icon-arrow) {
427
+ display: none;
428
+ }
426
429
  .gov-form-input[type=reset] input {
427
430
  border-width: 0;
428
431
  }
@@ -65,23 +65,29 @@ export class GovFormInput {
65
65
  }
66
66
  render() {
67
67
  const Tag = this.multiline ? Tags.TEXTAREA : Tags.INPUT;
68
- return (h(Host, { class: FormInputClass.root, size: this.size, variant: this.variant, type: this.type }, this.h.hasSlot('prefix') && h("slot", { name: "prefix" }), h("span", { class: "element" }, this.h.hasSlot('left-icon') && h("slot", { name: "left-icon" }), this.h.hasSlot('right-icon') && !(this.success || this.invalid) && h("slot", { name: "right-icon" }), this.success && !this.multiline && h("gov-icon", { slot: "right-icon", class: "icon-validation", name: "check" }), this.invalid && !this.multiline && h("gov-icon", { slot: "right-icon", class: "icon-validation", name: "exclamation" }), h(Tag, { type: this.inputType, disabled: this.disabled, id: this.identifier || this.inputId, name: this.name, onFocus: this.onFocusHandler.bind(this), onInput: this.onInputHandler.bind(this), onBlur: this.onBlurHandler.bind(this), onKeyUp: this.onKeyUpHandler.bind(this), ref: el => (this.inputRef = el), placeholder: this.placeholder, value: this.value, readonly: toBoolAttrIfDefined(this.readonly), autocomplete: toOnOffAttrIfDefined(this.autocomplete), autocorrect: toOnOffAttrIfDefined(this.autocorrect), minlength: this.minlength, maxlength: this.maxlength, required: this.required, rows: this.rows, cols: this.cols, role: this.role, "aria-required": toBoolAttrIfDefined(this.required), "aria-invalid": toBoolAttrIfDefined(this.invalid), "aria-disabled": toBoolAttrIfDefined(this.disabled), "aria-describedby": this.wcagDescribedBy, "aria-labelledby": this.wcagLabelledBy, "aria-owns": this.wcagOwns, "aria-expanded": toBoolAttrIfDefined(this.wcagExpanded), "aria-autocomplete": this.wcagAutocomplete })), this.h.hasSlot('sufix') && h("slot", { name: "sufix" })));
68
+ return (h(Host, { class: FormInputClass.root, size: this.size, variant: this.variant, type: this.type }, this.h.hasSlot('prefix') && h("slot", { name: "prefix" }), h("span", { class: "element" }, this.h.hasSlot('left-icon') && h("slot", { name: "left-icon" }), this.h.hasSlot('right-icon') && !(this.success || this.invalid) && h("slot", { name: "right-icon" }), this.success && !this.multiline && h("gov-icon", { slot: "right-icon", class: "icon-validation", name: "check-lg" }), this.invalid && !this.multiline && h("gov-icon", { slot: "right-icon", class: "icon-validation", name: "exclamation-lg" }), h(Tag, { type: this.inputType, disabled: this.disabled, id: this.identifier || this.inputId, name: this.name, onFocus: this.onFocusHandler.bind(this), onInput: this.onInputHandler.bind(this), onBlur: this.onBlurHandler.bind(this), onKeyUp: this.onKeyUpHandler.bind(this), ref: el => (this.inputRef = el), placeholder: this.placeholder, value: this.value, readonly: toBoolAttrIfDefined(this.readonly), autocomplete: toOnOffAttrIfDefined(this.autocomplete), autocorrect: toOnOffAttrIfDefined(this.autocorrect), minlength: this.minlength, maxlength: this.maxlength, required: this.required, rows: this.rows, cols: this.cols, role: this.role, "aria-required": toBoolAttrIfDefined(this.required), "aria-invalid": toBoolAttrIfDefined(this.invalid), "aria-disabled": toBoolAttrIfDefined(this.disabled), "aria-describedby": this.wcagDescribedBy, "aria-labelledby": this.wcagLabelledBy, "aria-owns": this.wcagOwns, "aria-expanded": toBoolAttrIfDefined(this.wcagExpanded), "aria-autocomplete": this.wcagAutocomplete })), this.h.hasSlot('sufix') && h("slot", { name: "sufix" })));
69
69
  }
70
70
  onFocusHandler(e) {
71
+ e.stopPropagation();
72
+ e.preventDefault();
71
73
  this.focused = true;
72
74
  this.govFocus.emit(e);
73
75
  }
74
76
  onBlurHandler(e) {
77
+ e.stopPropagation();
78
+ e.preventDefault();
75
79
  this.focused = false;
76
80
  this.govBlur.emit(e);
77
81
  }
78
82
  onKeyUpHandler(e) {
79
83
  e.stopPropagation();
84
+ e.preventDefault();
80
85
  this.govKeyUp.emit(e);
81
86
  }
82
87
  onInputHandler(e) {
83
88
  this.value = e.target.value;
84
89
  e.stopPropagation();
90
+ e.preventDefault();
85
91
  this.govInput.emit(e);
86
92
  }
87
93
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"gov-form-input.js","sour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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, Host, h, Prop, Watch, Event, EventEmitter, State, Method } from '@stencil/core'\nimport { GovHost } from '../../../helpers/Dom/template.types'\nimport { FormInputSizes, FormInputSizesType, InputType, Type } from './constants'\nimport { createID } from '../../../utils/string.utils'\nimport { govHost, toBoolAttrIfDefined, toOnOffAttrIfDefined } from '../../../helpers/Dom/template'\nimport { FormInputClass, FormInputVariants, FormInputVariantType } from './constants'\nimport { validateProp } from '../../../helpers/Validate/props'\nimport { canValidateWcagOnRender } from '../../../helpers/Dom/win'\nimport { delay } from '../../../utils/utils'\nimport { validateWcagLabelFor, validateWcagRef } from '../../../helpers/Validate/wcag'\nimport { GovForm } from '../../../helpers/Dom/form.types'\nimport { govForm } from '../../../helpers/Dom/form'\n\nenum Tags {\n\tINPUT = 'input',\n\tTEXTAREA = 'textarea',\n}\n\n@Component({\n\ttag: 'gov-form-input',\n\tstyleUrl: 'gov-form-input.scss',\n})\nexport class GovFormInput {\n\tprivate f: GovForm\n\tprivate h: GovHost\n\tprivate inputRef?: HTMLInputElement\n\tprivate readonly inputId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.inputId = createID('GovInput')\n\t\tthis.f = govForm(govHost(this.host))\n\t}\n\n\t@Element() host: HTMLGovFormInputElement\n\t/**\n\t * Value of input\n\t */\n\t@Prop({ reflect: true, mutable: true }) value: string\n\t/**\n\t * Custom input identifier.\n\t */\n\t@Prop({ attribute: 'identifier' }) readonly identifier: string\n\t/**\n\t * Style variation of the form input.\n\t */\n\t@Prop() readonly variant?: FormInputVariantType\n\t/**\n\t * Indicates the entered value of child form element does conform to the format expected by the application.\n\t */\n\t@Prop() readonly success: boolean\n\t/**\n\t * Input’s size.\n\t */\n\t@Prop() readonly size?: FormInputSizesType = 'm'\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Generates a texarea for the possibility of multiple lines\n\t */\n\t@Prop() readonly multiline: boolean\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-rows\n\t */\n\t@Prop() readonly rows: number\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-cols\n\t */\n\t@Prop() readonly cols: number\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the input component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean\n\t/**\n\t * Text that appears in the form control when it has no value set\n\t */\n\t@Prop() readonly placeholder: string\n\t/**\n\t * The value is not editable\n\t */\n\t@Prop() readonly readonly: boolean\n\t/**\n\t * Minimum length (number of characters) of value\n\t */\n\t@Prop() readonly minlength: number\n\t/**\n\t * Maximum length (number of characters) of value\n\t */\n\t@Prop() readonly maxlength: number\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-autocomplete\n\t */\n\t@Prop() readonly autocomplete: boolean\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-autocorrect\n\t */\n\t@Prop() readonly autocorrect: boolean\n\t/**\n\t * Defineds the visual style of input\n\t */\n\t@Prop() readonly type?: Type\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types\n\t */\n\t@Prop() readonly inputType: InputType = 'text'\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/input_role\n\t */\n\t@Prop() readonly role: string\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: 'wcag-described-by' }) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({ attribute: 'wcag-labelled-by' }) readonly wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: 'wcag-owns' }) readonly wcagOwns: string\n\t/**\n\t * Indicates whether inputting text could trigger display of one or more predictions of the user's intended value.\n\t */\n\t@Prop({ attribute: 'wcag-autocomplete' }) readonly wcagAutocomplete: string\n\t/**\n\t * Attribute is set on an element to indicate if a control is expanded or collapsed\n\t */\n\t@Prop({ attribute: 'wcag-expanded' }) readonly wcagExpanded: boolean\n\t/**\n\t * Emitted when the input has focus.\n\t */\n\t@Event({ eventName: 'gov-focus' }) govFocus: EventEmitter<FocusEvent>\n\t/**\n\t * Emitted when the input loses focus.\n\t */\n\t@Event({ eventName: 'gov-blur' }) govBlur: EventEmitter<FocusEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: 'gov-input' }) govInput: EventEmitter<InputEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: 'gov-keyup' }) govKeyUp: EventEmitter<KeyboardEvent>\n\t@State() focused: boolean\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormInputVariants, newValue, FormInputClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormInputSizes, newValue, FormInputClass.root)\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\n\t\tthis.f.passAttrToControl('type', this.multiline ? Tags.TEXTAREA : Tags.INPUT)\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\tconst Tag = this.multiline ? Tags.TEXTAREA : Tags.INPUT\n\n\t\treturn (\n\t\t\t<Host class={FormInputClass.root} size={this.size} variant={this.variant} type={this.type}>\n\t\t\t\t{this.h.hasSlot('prefix') && <slot name=\"prefix\"></slot>}\n\t\t\t\t<span class=\"element\">\n\t\t\t\t\t{this.h.hasSlot('left-icon') && <slot name=\"left-icon\" />}\n\n\t\t\t\t\t{this.h.hasSlot('right-icon') && !(this.success || this.invalid) && <slot name=\"right-icon\" />}\n\n\t\t\t\t\t{this.success && !this.multiline && <gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"check\"></gov-icon>}\n\t\t\t\t\t{this.invalid && !this.multiline && <gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"exclamation\"></gov-icon>}\n\t\t\t\t\t<Tag\n\t\t\t\t\t\ttype={this.inputType}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\tid={this.identifier || this.inputId}\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonInput={this.onInputHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\tonKeyUp={this.onKeyUpHandler.bind(this)}\n\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\treadonly={toBoolAttrIfDefined(this.readonly)}\n\t\t\t\t\t\tautocomplete={toOnOffAttrIfDefined(this.autocomplete)}\n\t\t\t\t\t\tautocorrect={toOnOffAttrIfDefined(this.autocorrect)}\n\t\t\t\t\t\tminlength={this.minlength}\n\t\t\t\t\t\tmaxlength={this.maxlength}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\trows={this.rows}\n\t\t\t\t\t\tcols={this.cols}\n\t\t\t\t\t\trole={this.role}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\taria-owns={this.wcagOwns}\n\t\t\t\t\t\taria-expanded={toBoolAttrIfDefined(this.wcagExpanded)}\n\t\t\t\t\t\taria-autocomplete={this.wcagAutocomplete}\n\t\t\t\t\t/>\n\t\t\t\t</span>\n\t\t\t\t{this.h.hasSlot('sufix') && <slot name=\"sufix\"></slot>}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\tthis.focused = true\n\t\tthis.govFocus.emit(e)\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\tthis.focused = false\n\t\tthis.govBlur.emit(e)\n\t}\n\n\tprivate onKeyUpHandler(e: KeyboardEvent) {\n\t\te.stopPropagation()\n\t\tthis.govKeyUp.emit(e)\n\t}\n\n\tprivate onInputHandler(e: InputEvent) {\n\t\tthis.value = (e.target as HTMLInputElement).value\n\t\te.stopPropagation()\n\t\tthis.govInput.emit(e)\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.inputRef.focus(options)\n\t}\n\n\t/**\n\t * Sets the ordered value of the element\n\t */\n\t@Method()\n\tasync setValue(value: string): Promise<void> {\n\t\tthis.value = value\n\t}\n\n\t/**\n\t * Clears input value\n\t */\n\t@Method()\n\tasync clearValue(): Promise<void> {\n\t\tthis.value = ''\n\t\tthis.inputRef.value = ''\n\t}\n\n\t/**\n\t * Returns an instance of the native html input element\n\t */\n\t@Method()\n\tasync getInstance(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, 'wcag-described-by', FormInputClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, 'wcag-labelled-by', FormInputClass.root)\n\t\tvalidateWcagRef(this.wcagOwns, 'wcag-owns', FormInputClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.inputId, this.wcagLabelledBy, FormInputClass.root)\n\t}\n}\n"]}
1
+ {"version":3,"file":"gov-form-input.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/input/gov-form-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAgB,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAE5G,OAAO,EAAE,cAAc,EAAiC,IAAI,EAAE,MAAM,aAAa,CAAA;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACtD,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAA;AAClG,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAwB,MAAM,aAAa,CAAA;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,s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;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, Host, h, Prop, Watch, Event, EventEmitter, State, Method } from '@stencil/core'\nimport { GovHost } from '../../../helpers/Dom/template.types'\nimport { FormInputSizes, FormInputSizesType, InputType, Type } from './constants'\nimport { createID } from '../../../utils/string.utils'\nimport { govHost, toBoolAttrIfDefined, toOnOffAttrIfDefined } from '../../../helpers/Dom/template'\nimport { FormInputClass, FormInputVariants, FormInputVariantType } from './constants'\nimport { validateProp } from '../../../helpers/Validate/props'\nimport { canValidateWcagOnRender } from '../../../helpers/Dom/win'\nimport { delay } from '../../../utils/utils'\nimport { validateWcagLabelFor, validateWcagRef } from '../../../helpers/Validate/wcag'\nimport { GovForm } from '../../../helpers/Dom/form.types'\nimport { govForm } from '../../../helpers/Dom/form'\n\nenum Tags {\n\tINPUT = 'input',\n\tTEXTAREA = 'textarea',\n}\n\n@Component({\n\ttag: 'gov-form-input',\n\tstyleUrl: 'gov-form-input.scss',\n})\nexport class GovFormInput {\n\tprivate f: GovForm\n\tprivate h: GovHost\n\tprivate inputRef?: HTMLInputElement\n\tprivate readonly inputId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.inputId = createID('GovInput')\n\t\tthis.f = govForm(govHost(this.host))\n\t}\n\n\t@Element() host: HTMLGovFormInputElement\n\t/**\n\t * Value of input\n\t */\n\t@Prop({ reflect: true, mutable: true }) value: string\n\t/**\n\t * Custom input identifier.\n\t */\n\t@Prop({ attribute: 'identifier' }) readonly identifier: string\n\t/**\n\t * Style variation of the form input.\n\t */\n\t@Prop() readonly variant?: FormInputVariantType\n\t/**\n\t * Indicates the entered value of child form element does conform to the format expected by the application.\n\t */\n\t@Prop() readonly success: boolean\n\t/**\n\t * Input’s size.\n\t */\n\t@Prop() readonly size?: FormInputSizesType = 'm'\n\t/**\n\t * Name of the input.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Generates a texarea for the possibility of multiple lines\n\t */\n\t@Prop() readonly multiline: boolean\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-rows\n\t */\n\t@Prop() readonly rows: number\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-cols\n\t */\n\t@Prop() readonly cols: number\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the input component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean\n\t/**\n\t * Text that appears in the form control when it has no value set\n\t */\n\t@Prop() readonly placeholder: string\n\t/**\n\t * The value is not editable\n\t */\n\t@Prop() readonly readonly: boolean\n\t/**\n\t * Minimum length (number of characters) of value\n\t */\n\t@Prop() readonly minlength: number\n\t/**\n\t * Maximum length (number of characters) of value\n\t */\n\t@Prop() readonly maxlength: number\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-autocomplete\n\t */\n\t@Prop() readonly autocomplete: boolean\n\t/**\n\t * Same as original parameter https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-autocorrect\n\t */\n\t@Prop() readonly autocorrect: boolean\n\t/**\n\t * Defineds the visual style of input\n\t */\n\t@Prop() readonly type?: Type\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types\n\t */\n\t@Prop() readonly inputType: InputType = 'text'\n\t/**\n\t * Same as original parameter\n\t * @link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/input_role\n\t */\n\t@Prop() readonly role: string\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: 'wcag-described-by' }) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({ attribute: 'wcag-labelled-by' }) readonly wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: 'wcag-owns' }) readonly wcagOwns: string\n\t/**\n\t * Indicates whether inputting text could trigger display of one or more predictions of the user's intended value.\n\t */\n\t@Prop({ attribute: 'wcag-autocomplete' }) readonly wcagAutocomplete: string\n\t/**\n\t * Attribute is set on an element to indicate if a control is expanded or collapsed\n\t */\n\t@Prop({ attribute: 'wcag-expanded' }) readonly wcagExpanded: boolean\n\t/**\n\t * Emitted when the input has focus.\n\t */\n\t@Event({ eventName: 'gov-focus' }) govFocus: EventEmitter<FocusEvent>\n\t/**\n\t * Emitted when the input loses focus.\n\t */\n\t@Event({ eventName: 'gov-blur' }) govBlur: EventEmitter<FocusEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: 'gov-input' }) govInput: EventEmitter<InputEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: 'gov-keyup' }) govKeyUp: EventEmitter<KeyboardEvent>\n\t@State() focused: boolean\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormInputVariants, newValue, FormInputClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormInputSizes, newValue, FormInputClass.root)\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\n\t\tthis.f.passAttrToControl('type', this.multiline ? Tags.TEXTAREA : Tags.INPUT)\n\t}\n\n\tasync componentDidRender() {\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\tconst Tag = this.multiline ? Tags.TEXTAREA : Tags.INPUT\n\n\t\treturn (\n\t\t\t<Host class={FormInputClass.root} size={this.size} variant={this.variant} type={this.type}>\n\t\t\t\t{this.h.hasSlot('prefix') && <slot name=\"prefix\"></slot>}\n\t\t\t\t<span class=\"element\">\n\t\t\t\t\t{this.h.hasSlot('left-icon') && <slot name=\"left-icon\" />}\n\n\t\t\t\t\t{this.h.hasSlot('right-icon') && !(this.success || this.invalid) && <slot name=\"right-icon\" />}\n\n\t\t\t\t\t{this.success && !this.multiline && <gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"check-lg\"></gov-icon>}\n\t\t\t\t\t{this.invalid && !this.multiline && <gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"exclamation-lg\"></gov-icon>}\n\t\t\t\t\t<Tag\n\t\t\t\t\t\ttype={this.inputType}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\tid={this.identifier || this.inputId}\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonInput={this.onInputHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\tonKeyUp={this.onKeyUpHandler.bind(this)}\n\t\t\t\t\t\tref={el => (this.inputRef = el as HTMLInputElement)}\n\t\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\treadonly={toBoolAttrIfDefined(this.readonly)}\n\t\t\t\t\t\tautocomplete={toOnOffAttrIfDefined(this.autocomplete)}\n\t\t\t\t\t\tautocorrect={toOnOffAttrIfDefined(this.autocorrect)}\n\t\t\t\t\t\tminlength={this.minlength}\n\t\t\t\t\t\tmaxlength={this.maxlength}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\trows={this.rows}\n\t\t\t\t\t\tcols={this.cols}\n\t\t\t\t\t\trole={this.role}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\taria-owns={this.wcagOwns}\n\t\t\t\t\t\taria-expanded={toBoolAttrIfDefined(this.wcagExpanded)}\n\t\t\t\t\t\taria-autocomplete={this.wcagAutocomplete}\n\t\t\t\t\t/>\n\t\t\t\t</span>\n\t\t\t\t{this.h.hasSlot('sufix') && <slot name=\"sufix\"></slot>}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\te.preventDefault()\n\t\tthis.focused = true\n\t\tthis.govFocus.emit(e)\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\te.preventDefault()\n\t\tthis.focused = false\n\t\tthis.govBlur.emit(e)\n\t}\n\n\tprivate onKeyUpHandler(e: KeyboardEvent) {\n\t\te.stopPropagation()\n\t\te.preventDefault()\n\t\tthis.govKeyUp.emit(e)\n\t}\n\n\tprivate onInputHandler(e: InputEvent) {\n\t\tthis.value = (e.target as HTMLInputElement).value\n\t\te.stopPropagation()\n\t\te.preventDefault()\n\t\tthis.govInput.emit(e)\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.inputRef.focus(options)\n\t}\n\n\t/**\n\t * Sets the ordered value of the element\n\t */\n\t@Method()\n\tasync setValue(value: string): Promise<void> {\n\t\tthis.value = value\n\t}\n\n\t/**\n\t * Clears input value\n\t */\n\t@Method()\n\tasync clearValue(): Promise<void> {\n\t\tthis.value = ''\n\t\tthis.inputRef.value = ''\n\t}\n\n\t/**\n\t * Returns an instance of the native html input element\n\t */\n\t@Method()\n\tasync getInstance(): Promise<HTMLInputElement> {\n\t\treturn this.inputRef\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, 'wcag-described-by', FormInputClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, 'wcag-labelled-by', FormInputClass.root)\n\t\tvalidateWcagRef(this.wcagOwns, 'wcag-owns', FormInputClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.inputId, this.wcagLabelledBy, FormInputClass.root)\n\t}\n}\n"]}
@@ -148,6 +148,9 @@
148
148
  /*
149
149
  - Variables - Form multiselect
150
150
  */
151
+ /*
152
+ - Variables - Form password power
153
+ */
151
154
  /*
152
155
  - Variables - Form checkbox & radio
153
156
  */
@@ -148,6 +148,9 @@
148
148
  /*
149
149
  - Variables - Form multiselect
150
150
  */
151
+ /*
152
+ - Variables - Form password power
153
+ */
151
154
  /*
152
155
  - Variables - Form checkbox & radio
153
156
  */
@@ -162,6 +162,9 @@
162
162
  /*
163
163
  - Variables - Form multiselect
164
164
  */
165
+ /*
166
+ - Variables - Form password power
167
+ */
165
168
  /*
166
169
  - Variables - Form checkbox & radio
167
170
  */
@@ -331,9 +334,6 @@
331
334
  [invalid="1"].gov-form-multi-select *[slot=right-icon] {
332
335
  color: var(--gov-form-state-color-error, var(--gov-color-error));
333
336
  }
334
- [invalid=""].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow), [invalid=true i].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow), [invalid="1"].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow) {
335
- display: none;
336
- }
337
337
  [success=""].gov-form-multi-select *[slot=right-icon], [success=true i].gov-form-multi-select *[slot=right-icon], [success="1"].gov-form-multi-select *[slot=right-icon] {
338
338
  color: var(--gov-form-state-color-success, var(--gov-color-success));
339
339
  }
@@ -108,23 +108,31 @@ export class GovFormMultiSelect {
108
108
  }
109
109
  }
110
110
  render() {
111
- return (h(Host, { class: FormMultiSelectClass.root, size: this.size, variant: this.variant }, h("div", { class: FormMultiSelectClass.wrap }, h("div", { class: "element" }, h("gov-form-autocomplete", { value: this.value, disabled: this.disabled, identifier: this.identifier || this.selectId, required: false, size: this.size, variant: this.variant, invalid: this.invalid, placeholder: this.placeholder, ref: el => (this.autocompleteRef = el), minlength: 0, wcagDescribedBy: this.wcagDescribedBy, wcagLabelledBy: this.wcagLabelledBy, wcagOwns: this.listId }), h("gov-icon", { slot: "right-icon", class: "icon-arrow", name: "arrow-down" }), h("select", { hidden: true, "aria-hidden": true, multiple: true, required: this.required, name: this.name, disabled: this.disabled, ref: el => (this.selectRef = el), "aria-disabled": toBoolAttrIfDefined(this.disabled), "aria-required": toBoolAttrIfDefined(this.required), "aria-invalid": toBoolAttrIfDefined(this.invalid), "aria-describedby": this.wcagDescribedBy, "aria-labelledby": this.wcagLabelledBy, "aria-owns": this.wcagOwns }, h("slot", null)))), h("ul", { role: "listbox", id: this.listId, class: FormMultiSelectClass.list }, this.selectedOptions.map(option => {
112
- return (h("li", { class: FormMultiSelectClass.item, role: "option" }, option.name, h("gov-button", { wcagLabel: 'Odebrat vybranou položku ' + option.name, variant: "primary", type: "base", size: "s", "on-gov-click": () => this.onTagRemove(option) }, h("gov-icon", { name: "cross" }))));
111
+ return (h(Host, { class: FormMultiSelectClass.root, size: this.size, variant: this.variant }, h("div", { class: FormMultiSelectClass.wrap }, h("div", { class: "element" }, h("gov-form-autocomplete", { value: this.value, disabled: this.disabled, identifier: this.identifier || this.selectId, required: false, size: this.size, variant: this.variant, invalid: this.invalid, placeholder: this.placeholder, ref: el => (this.autocompleteRef = el), minlength: 0, wcagDescribedBy: this.wcagDescribedBy, wcagLabelledBy: this.wcagLabelledBy, wcagOwns: this.listId }), h("gov-icon", { slot: "right-icon", class: "icon-arrow", name: "chevron-down" }), h("select", { hidden: true, "aria-hidden": true, multiple: true, required: this.required, name: this.name, disabled: this.disabled, ref: el => (this.selectRef = el), "aria-disabled": toBoolAttrIfDefined(this.disabled), "aria-required": toBoolAttrIfDefined(this.required), "aria-invalid": toBoolAttrIfDefined(this.invalid), "aria-describedby": this.wcagDescribedBy, "aria-labelledby": this.wcagLabelledBy, "aria-owns": this.wcagOwns }, h("slot", null)))), h("ul", { role: "listbox", id: this.listId, class: FormMultiSelectClass.list }, this.selectedOptions.map(option => {
112
+ return (h("li", { class: FormMultiSelectClass.item, role: "option" }, option.name, h("gov-button", { wcagLabel: 'Odebrat vybranou položku ' + option.name, variant: "primary", type: "base", size: "s", "on-gov-click": () => this.onTagRemove(option) }, h("gov-icon", { name: "x-lg" }))));
113
113
  }))));
114
114
  }
115
115
  onFocusHandler(e) {
116
+ e.stopPropagation();
117
+ e.preventDefault();
116
118
  this.focused = true;
117
119
  this.govFocus.emit(e);
118
120
  }
119
121
  onBlurHandler(e) {
122
+ e.stopPropagation();
123
+ e.stopPropagation();
124
+ e.preventDefault();
120
125
  this.focused = false;
121
126
  this.govBlur.emit(e);
122
127
  }
123
128
  onInputHandler(e) {
124
129
  this.value = e.target.value;
125
130
  e.stopPropagation();
131
+ e.preventDefault();
126
132
  }
127
133
  onSelectHandler(e) {
134
+ e.stopPropagation();
135
+ e.preventDefault();
128
136
  const value = e.detail;
129
137
  this.selectOption(value);
130
138
  this.value = '';
@@ -1 +1 @@
1
- {"version":3,"file":"gov-form-multi-select.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/multiselect/gov-form-multi-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAgB,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC5G,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,EAA4B,uBAAuB,EAA8B,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AACvJ,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAA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e,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,oBAAoB,CAAC,IAAI,CAAC,CAAA;IACtE,oBAAoB,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAE,oBAAoB,CAAC,IAAI,CAAC,CAAA;EACvG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, h, State, Prop, Event, EventEmitter, Watch, Host, Method } from '@stencil/core'\nimport { toBoolAttrIfDefined } from '../../../helpers/Dom/template'\nimport { FormMultiselectSizesType, FormMultiselectVariants, FormMultiselectVariantType, FormMultiSelectClass, FormMultiselectSizes } from './constants'\nimport { validateProp } from '../../../helpers/Validate/props'\nimport { validateWcagLabelFor, validateWcagRef } from '../../../helpers/Validate/wcag'\nimport { canValidateWcagOnRender } from '../../../helpers/Dom/win'\nimport { createID, removeDiacritics } from '../../../utils/string.utils'\nimport { delay } from '../../../utils/utils'\nimport { Nullable } from '../../../types/interfaces'\nimport { GovFormMultiSelectItem } from './interfaces'\n\n@Component({\n\ttag: 'gov-form-multi-select',\n\tstyleUrl: 'gov-form-multi-select.scss',\n})\nexport class GovFormMultiSelect {\n\tprivate selectRef?: HTMLSelectElement\n\tprivate autocompleteRef?: HTMLGovFormAutocompleteElement\n\n\tprivate readonly selectId: string\n\tprivate readonly listId: string\n\n\tconstructor() {\n\t\tthis.selectId = createID('GovSelect')\n\t\tthis.listId = createID('GovMultiList')\n\t}\n\n\t@Element() host: HTMLGovFormSelectElement\n\t/**\n\t * Custom select identifier.\n\t */\n\t@Prop({ attribute: 'identifier' }) readonly identifier: string\n\t/**\n\t * Custom select placeholder.\n\t */\n\t@Prop({ attribute: 'placeholder' }) readonly placeholder: string\n\t/**\n\t * Style variation of the form select.\n\t */\n\t@Prop() readonly variant?: FormMultiselectVariantType\n\t/**\n\t * Select’s size.\n\t */\n\t@Prop() readonly size?: FormMultiselectSizesType = 'm'\n\t/**\n\t * Name of the select.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the select component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: 'wcag-described-by' }) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({ attribute: 'wcag-labelled-by' }) readonly wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: 'wcag-owns' }) readonly wcagOwns: string\n\t/**\n\t * Emitted when the select has focus.\n\t */\n\t@Event({ eventName: 'gov-focus' }) govFocus: EventEmitter<FocusEvent>\n\t/**\n\t * Emitted when the select loses focus.\n\t */\n\t@Event({ eventName: 'gov-blur' }) govBlur: EventEmitter<FocusEvent>\n\t/**\n\t * Emitted when the select change value.\n\t */\n\t@Event({ eventName: 'gov-change' }) govChange: EventEmitter<GovFormMultiSelectItem[]>\n\t@State() focused: boolean\n\t@State() value: string\n\t@State() selectedOptions: GovFormMultiSelectItem[] = []\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormMultiselectVariants, newValue, FormMultiSelectClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormMultiselectSizes, newValue, FormMultiSelectClass.root)\n\t}\n\n\t@Watch('selectedOptions')\n\temitChange(newValue: GovFormMultiSelectItem[]) {\n\t\tthis.govChange.emit(newValue)\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t}\n\n\tprivate getAvailableOptions(): GovFormMultiSelectItem[] {\n\t\treturn Array.from(this.selectRef.querySelectorAll('option'))\n\t\t\t.filter((option: HTMLOptionElement) => !(option.disabled || option.selected))\n\t\t\t.map((option: HTMLOptionElement) => ({ name: option.textContent, value: option.value }))\n\t}\n\n\tprivate initAutocomplete() {\n\t\tthis.autocompleteRef.addEventListener('gov-select', this.onSelectHandler.bind(this))\n\t\tthis.autocompleteRef.addEventListener('gov-input', this.onInputHandler.bind(this))\n\t\tthis.autocompleteRef.addEventListener('gov-focus', this.onFocusHandler.bind(this))\n\t\tthis.autocompleteRef.addEventListener('gov-blur', this.onBlurHandler.bind(this))\n\t\tthis.autocompleteRef\n\t\t\t.setSearchCallback(value => {\n\t\t\t\treturn new Promise(resolve => {\n\t\t\t\t\tconst data = this.getAvailableOptions()\n\t\t\t\t\tif (String(value).length === 0) {\n\t\t\t\t\t\treturn resolve(data)\n\t\t\t\t\t}\n\t\t\t\t\tresolve(\n\t\t\t\t\t\tdata.filter(({ name }) => {\n\t\t\t\t\t\t\tif (!name) return false\n\t\t\t\t\t\t\treturn removeDiacritics(name).toLowerCase().indexOf(removeDiacritics(value).toLowerCase()) > -1\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t})\n\t\t\t.then()\n\t}\n\n\tprivate getOptionIndex(value: GovFormMultiSelectItem): number {\n\t\treturn this.selectedOptions.findIndex(option => option.value === value.value && option.name === value.name)\n\t}\n\n\tprivate getOptionElement(value: GovFormMultiSelectItem): Nullable<HTMLOptionElement> {\n\t\treturn this.selectRef.querySelector('option[value=\"' + value.value + '\"]') as HTMLOptionElement\n\t}\n\n\tprivate selectOption(newOption: GovFormMultiSelectItem) {\n\t\tconst index = this.getOptionIndex(newOption)\n\t\tif (index === -1) {\n\t\t\tthis.selectedOptions = [...this.selectedOptions, newOption]\n\t\t\tconst option = this.getOptionElement(newOption)\n\t\t\tif (option) {\n\t\t\t\toption.selected = true\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate removeOption(removeOption: GovFormMultiSelectItem) {\n\t\tconst index = this.getOptionIndex(removeOption)\n\t\tif (index !== -1) {\n\t\t\tthis.selectedOptions.splice(index, 1)\n\t\t\tthis.selectedOptions = [...this.selectedOptions]\n\t\t\tconst option = this.getOptionElement(removeOption)\n\t\t\tif (option) {\n\t\t\t\toption.selected = false\n\t\t\t}\n\t\t}\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.initAutocomplete()\n\t\tawait delay(0)\n\t\tthis.selectRef.querySelectorAll('option').forEach((option: HTMLOptionElement) => {\n\t\t\tif (option.selected) {\n\t\t\t\tthis.selectOption({\n\t\t\t\t\tname: option.textContent,\n\t\t\t\t\tvalue: option.value,\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormMultiSelectClass.root} size={this.size} variant={this.variant}>\n\t\t\t\t<div class={FormMultiSelectClass.wrap}>\n\t\t\t\t\t<div class=\"element\">\n\t\t\t\t\t\t<gov-form-autocomplete\n\t\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tidentifier={this.identifier || this.selectId}\n\t\t\t\t\t\t\trequired={false}\n\t\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\t\tinvalid={this.invalid}\n\t\t\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\t\t\tref={el => (this.autocompleteRef = el as HTMLGovFormAutocompleteElement)}\n\t\t\t\t\t\t\tminlength={0}\n\t\t\t\t\t\t\twcagDescribedBy={this.wcagDescribedBy}\n\t\t\t\t\t\t\twcagLabelledBy={this.wcagLabelledBy}\n\t\t\t\t\t\t\twcagOwns={this.listId}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<gov-icon slot=\"right-icon\" class=\"icon-arrow\" name=\"arrow-down\"></gov-icon>\n\t\t\t\t\t\t<select\n\t\t\t\t\t\t\thidden\n\t\t\t\t\t\t\taria-hidden={true}\n\t\t\t\t\t\t\tmultiple\n\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tref={el => (this.selectRef = el as HTMLSelectElement)}\n\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\t\taria-owns={this.wcagOwns}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<ul role=\"listbox\" id={this.listId} class={FormMultiSelectClass.list}>\n\t\t\t\t\t{this.selectedOptions.map(option => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li class={FormMultiSelectClass.item} role=\"option\">\n\t\t\t\t\t\t\t\t{option.name}\n\t\t\t\t\t\t\t\t<gov-button\n\t\t\t\t\t\t\t\t\twcagLabel={'Odebrat vybranou položku ' + option.name}\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\t\t\t\tsize=\"s\"\n\t\t\t\t\t\t\t\t\ton-gov-click={() => this.onTagRemove(option)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<gov-icon name=\"cross\"></gov-icon>\n\t\t\t\t\t\t\t\t</gov-button>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)\n\t\t\t\t\t})}\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.govFocus.emit(e)\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\tthis.focused = false\n\t\tthis.govBlur.emit(e)\n\t}\n\n\tprivate onInputHandler(e: Event) {\n\t\tthis.value = (e.target as HTMLSelectElement).value\n\t\te.stopPropagation()\n\t}\n\n\tprivate onSelectHandler(e: CustomEvent) {\n\t\tconst value = e.detail as GovFormMultiSelectItem\n\t\tthis.selectOption(value)\n\t\tthis.value = ''\n\t\tthis.autocompleteRef.clearValue()\n\t\tthis.autocompleteRef.focus()\n\t}\n\n\tprivate onTagRemove(removeOption: GovFormMultiSelectItem) {\n\t\tthis.removeOption(removeOption)\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.selectRef.focus(options)\n\t}\n\n\t/**\n\t * Sets the ordered value of the element\n\t */\n\t@Method()\n\tasync setValue(value: string): Promise<void> {\n\t\tthis.value = value\n\t}\n\n\t/**\n\t * Returns an instance of the native html select element\n\t */\n\t@Method()\n\tasync getInstance(): Promise<HTMLSelectElement> {\n\t\treturn this.selectRef\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, 'wcag-described-by', FormMultiSelectClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, 'wcag-labelled-by', FormMultiSelectClass.root)\n\t\tvalidateWcagRef(this.wcagOwns, 'wcag-owns', FormMultiSelectClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.selectId, this.wcagLabelledBy, FormMultiSelectClass.root)\n\t}\n}\n"]}
1
+ {"version":3,"file":"gov-form-multi-select.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/multiselect/gov-form-multi-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAgB,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC5G,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,EAA4B,uBAAuB,EAA8B,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AACvJ,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AACtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAClE,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACxE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAQ5C,MAAM,OAAO,kBAAkB;EAO9B;;;;gBAqBmD,GAAG;;oBASjB,KAAK;;;;;;;;2BAoCW,EAAE;IAjEtD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAA;IACrC,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAA;GACtC;EAk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B,CAAC,IAAI,CAAC,CAAA;EACvG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, h, State, Prop, Event, EventEmitter, Watch, Host, Method } from '@stencil/core'\nimport { toBoolAttrIfDefined } from '../../../helpers/Dom/template'\nimport { FormMultiselectSizesType, FormMultiselectVariants, FormMultiselectVariantType, FormMultiSelectClass, FormMultiselectSizes } from './constants'\nimport { validateProp } from '../../../helpers/Validate/props'\nimport { validateWcagLabelFor, validateWcagRef } from '../../../helpers/Validate/wcag'\nimport { canValidateWcagOnRender } from '../../../helpers/Dom/win'\nimport { createID, removeDiacritics } from '../../../utils/string.utils'\nimport { delay } from '../../../utils/utils'\nimport { Nullable } from '../../../types/interfaces'\nimport { GovFormMultiSelectItem } from './interfaces'\n\n@Component({\n\ttag: 'gov-form-multi-select',\n\tstyleUrl: 'gov-form-multi-select.scss',\n})\nexport class GovFormMultiSelect {\n\tprivate selectRef?: HTMLSelectElement\n\tprivate autocompleteRef?: HTMLGovFormAutocompleteElement\n\n\tprivate readonly selectId: string\n\tprivate readonly listId: string\n\n\tconstructor() {\n\t\tthis.selectId = createID('GovSelect')\n\t\tthis.listId = createID('GovMultiList')\n\t}\n\n\t@Element() host: HTMLGovFormSelectElement\n\t/**\n\t * Custom select identifier.\n\t */\n\t@Prop({ attribute: 'identifier' }) readonly identifier: string\n\t/**\n\t * Custom select placeholder.\n\t */\n\t@Prop({ attribute: 'placeholder' }) readonly placeholder: string\n\t/**\n\t * Style variation of the form select.\n\t */\n\t@Prop() readonly variant?: FormMultiselectVariantType\n\t/**\n\t * Select’s size.\n\t */\n\t@Prop() readonly size?: FormMultiselectSizesType = 'm'\n\t/**\n\t * Name of the select.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the select component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: 'wcag-described-by' }) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({ attribute: 'wcag-labelled-by' }) readonly wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: 'wcag-owns' }) readonly wcagOwns: string\n\t/**\n\t * Emitted when the select has focus.\n\t */\n\t@Event({ eventName: 'gov-focus' }) govFocus: EventEmitter<FocusEvent>\n\t/**\n\t * Emitted when the select loses focus.\n\t */\n\t@Event({ eventName: 'gov-blur' }) govBlur: EventEmitter<FocusEvent>\n\t/**\n\t * Emitted when the select change value.\n\t */\n\t@Event({ eventName: 'gov-change' }) govChange: EventEmitter<GovFormMultiSelectItem[]>\n\t@State() focused: boolean\n\t@State() value: string\n\t@State() selectedOptions: GovFormMultiSelectItem[] = []\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormMultiselectVariants, newValue, FormMultiSelectClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormMultiselectSizes, newValue, FormMultiSelectClass.root)\n\t}\n\n\t@Watch('selectedOptions')\n\temitChange(newValue: GovFormMultiSelectItem[]) {\n\t\tthis.govChange.emit(newValue)\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t}\n\n\tprivate getAvailableOptions(): GovFormMultiSelectItem[] {\n\t\treturn Array.from(this.selectRef.querySelectorAll('option'))\n\t\t\t.filter((option: HTMLOptionElement) => !(option.disabled || option.selected))\n\t\t\t.map((option: HTMLOptionElement) => ({ name: option.textContent, value: option.value }))\n\t}\n\n\tprivate initAutocomplete() {\n\t\tthis.autocompleteRef.addEventListener('gov-select', this.onSelectHandler.bind(this))\n\t\tthis.autocompleteRef.addEventListener('gov-input', this.onInputHandler.bind(this))\n\t\tthis.autocompleteRef.addEventListener('gov-focus', this.onFocusHandler.bind(this))\n\t\tthis.autocompleteRef.addEventListener('gov-blur', this.onBlurHandler.bind(this))\n\t\tthis.autocompleteRef\n\t\t\t.setSearchCallback(value => {\n\t\t\t\treturn new Promise(resolve => {\n\t\t\t\t\tconst data = this.getAvailableOptions()\n\t\t\t\t\tif (String(value).length === 0) {\n\t\t\t\t\t\treturn resolve(data)\n\t\t\t\t\t}\n\t\t\t\t\tresolve(\n\t\t\t\t\t\tdata.filter(({ name }) => {\n\t\t\t\t\t\t\tif (!name) return false\n\t\t\t\t\t\t\treturn removeDiacritics(name).toLowerCase().indexOf(removeDiacritics(value).toLowerCase()) > -1\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t})\n\t\t\t.then()\n\t}\n\n\tprivate getOptionIndex(value: GovFormMultiSelectItem): number {\n\t\treturn this.selectedOptions.findIndex(option => option.value === value.value && option.name === value.name)\n\t}\n\n\tprivate getOptionElement(value: GovFormMultiSelectItem): Nullable<HTMLOptionElement> {\n\t\treturn this.selectRef.querySelector('option[value=\"' + value.value + '\"]') as HTMLOptionElement\n\t}\n\n\tprivate selectOption(newOption: GovFormMultiSelectItem) {\n\t\tconst index = this.getOptionIndex(newOption)\n\t\tif (index === -1) {\n\t\t\tthis.selectedOptions = [...this.selectedOptions, newOption]\n\t\t\tconst option = this.getOptionElement(newOption)\n\t\t\tif (option) {\n\t\t\t\toption.selected = true\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate removeOption(removeOption: GovFormMultiSelectItem) {\n\t\tconst index = this.getOptionIndex(removeOption)\n\t\tif (index !== -1) {\n\t\t\tthis.selectedOptions.splice(index, 1)\n\t\t\tthis.selectedOptions = [...this.selectedOptions]\n\t\t\tconst option = this.getOptionElement(removeOption)\n\t\t\tif (option) {\n\t\t\t\toption.selected = false\n\t\t\t}\n\t\t}\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.initAutocomplete()\n\t\tawait delay(0)\n\t\tthis.selectRef.querySelectorAll('option').forEach((option: HTMLOptionElement) => {\n\t\t\tif (option.selected) {\n\t\t\t\tthis.selectOption({\n\t\t\t\t\tname: option.textContent,\n\t\t\t\t\tvalue: option.value,\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormMultiSelectClass.root} size={this.size} variant={this.variant}>\n\t\t\t\t<div class={FormMultiSelectClass.wrap}>\n\t\t\t\t\t<div class=\"element\">\n\t\t\t\t\t\t<gov-form-autocomplete\n\t\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tidentifier={this.identifier || this.selectId}\n\t\t\t\t\t\t\trequired={false}\n\t\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\t\tinvalid={this.invalid}\n\t\t\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\t\t\tref={el => (this.autocompleteRef = el as HTMLGovFormAutocompleteElement)}\n\t\t\t\t\t\t\tminlength={0}\n\t\t\t\t\t\t\twcagDescribedBy={this.wcagDescribedBy}\n\t\t\t\t\t\t\twcagLabelledBy={this.wcagLabelledBy}\n\t\t\t\t\t\t\twcagOwns={this.listId}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<gov-icon slot=\"right-icon\" class=\"icon-arrow\" name=\"chevron-down\"></gov-icon>\n\t\t\t\t\t\t<select\n\t\t\t\t\t\t\thidden\n\t\t\t\t\t\t\taria-hidden={true}\n\t\t\t\t\t\t\tmultiple\n\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tref={el => (this.selectRef = el as HTMLSelectElement)}\n\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\t\taria-owns={this.wcagOwns}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<ul role=\"listbox\" id={this.listId} class={FormMultiSelectClass.list}>\n\t\t\t\t\t{this.selectedOptions.map(option => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li class={FormMultiSelectClass.item} role=\"option\">\n\t\t\t\t\t\t\t\t{option.name}\n\t\t\t\t\t\t\t\t<gov-button\n\t\t\t\t\t\t\t\t\twcagLabel={'Odebrat vybranou položku ' + option.name}\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\t\t\t\tsize=\"s\"\n\t\t\t\t\t\t\t\t\ton-gov-click={() => this.onTagRemove(option)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<gov-icon name=\"x-lg\"></gov-icon>\n\t\t\t\t\t\t\t\t</gov-button>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)\n\t\t\t\t\t})}\n\t\t\t\t</ul>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\te.preventDefault()\n\t\tthis.focused = true\n\t\tthis.govFocus.emit(e)\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {e.stopPropagation()\n\t\te.stopPropagation()\n\t\te.preventDefault()\n\t\tthis.focused = false\n\t\tthis.govBlur.emit(e)\n\t}\n\n\tprivate onInputHandler(e: Event) {\n\t\tthis.value = (e.target as HTMLSelectElement).value\n\t\te.stopPropagation()\n\t\te.preventDefault()\n\t}\n\n\tprivate onSelectHandler(e: CustomEvent) {\n\t\te.stopPropagation()\n\t\te.preventDefault()\n\t\tconst value = e.detail as GovFormMultiSelectItem\n\t\tthis.selectOption(value)\n\t\tthis.value = ''\n\t\tthis.autocompleteRef.clearValue()\n\t\tthis.autocompleteRef.focus()\n\t}\n\n\tprivate onTagRemove(removeOption: GovFormMultiSelectItem) {\n\t\tthis.removeOption(removeOption)\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.selectRef.focus(options)\n\t}\n\n\t/**\n\t * Sets the ordered value of the element\n\t */\n\t@Method()\n\tasync setValue(value: string): Promise<void> {\n\t\tthis.value = value\n\t}\n\n\t/**\n\t * Returns an instance of the native html select element\n\t */\n\t@Method()\n\tasync getInstance(): Promise<HTMLSelectElement> {\n\t\treturn this.selectRef\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, 'wcag-described-by', FormMultiSelectClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, 'wcag-labelled-by', FormMultiSelectClass.root)\n\t\tvalidateWcagRef(this.wcagOwns, 'wcag-owns', FormMultiSelectClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.selectId, this.wcagLabelledBy, FormMultiSelectClass.root)\n\t}\n}\n"]}
@@ -0,0 +1,6 @@
1
+ export const FormPasswordPowerClass = {
2
+ root: 'gov-form-password-power',
3
+ bar: 'gov-form-password-power__bar',
4
+ text: 'gov-form-password-power__text',
5
+ };
6
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/password-power/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG;EACrC,IAAI,EAAE,yBAAyB;EAC5B,GAAG,EAAE,8BAA8B;EACnC,IAAI,EAAE,+BAA+B;CACxC,CAAA","sourcesContent":["export const FormPasswordPowerClass = {\n\troot: 'gov-form-password-power',\n bar: 'gov-form-password-power__bar',\n text: 'gov-form-password-power__text',\n}\n"]}
@@ -0,0 +1,246 @@
1
+ /* stylelint-disable */
2
+ /* stylelint-enable */
3
+ /* stylelint-disable */
4
+ /* stylelint-enable */
5
+ /* stylelint-disable */
6
+ /* stylelint-enable */
7
+ /* stylelint-disable */
8
+ /* stylelint-enable */
9
+ /* [Core] - Buttons
10
+ ------------------------------------------------------------------ */
11
+ /*
12
+ * Gets color from theme-colors or from palette-colors
13
+ */
14
+ /*
15
+ * Converts hex value to rgb colors value
16
+ */
17
+ /* stylelint-disable order/order */
18
+ /* stylelint-enable order/order */
19
+ /*
20
+ * Generates list of utility classes for margin, padding
21
+ *
22
+ * Make sure $list of definitions is sorted so that last item is defined last
23
+ * So largest views are mentioned last.
24
+ */
25
+ /*
26
+ - Variables - Sizes
27
+ */
28
+ /* "Constants" for general usage */
29
+ /*
30
+ - Variables - Layout
31
+ */
32
+ /**
33
+ * Utilities - Offset
34
+ */
35
+ /* stylelint-disable order/order */
36
+ /* stylelint-enable order/order */
37
+ /* stylelint-disable order/order */
38
+ /* stylelint-enable order/order */
39
+ /* stylelint-disable order/order */
40
+ /* stylelint-enable order/order */
41
+ /**
42
+ * Generates CSS3 var with default value
43
+ */
44
+ /*
45
+ - Variables - General
46
+ */
47
+ /*
48
+ - Variables - Typography
49
+ */
50
+ /*
51
+ - Variables - Variants
52
+ */
53
+ /*
54
+ - Variables - Container
55
+ */
56
+ /*
57
+ - Variables - Sizes
58
+ */
59
+ /* "Constants" for general usage */
60
+ /*
61
+ - Variables - Accordion
62
+ */
63
+ /*
64
+ - Variables - Attachments
65
+ */
66
+ /*
67
+ - Variables - Alert
68
+ */
69
+ /*
70
+ - Variables - Backdrop
71
+ */
72
+ /*
73
+ - Variables - Buttons (&& Badges)
74
+ */
75
+ /*
76
+ - Variables - Breadcrumbs
77
+ */
78
+ /*
79
+ - Variables - Classes
80
+ */
81
+ /*
82
+ - Variables - Colors
83
+ */
84
+ /*
85
+ - Variables - Cookiebar
86
+ */
87
+ /*
88
+ - Variables - Card
89
+ */
90
+ /*
91
+ - Variables - Message
92
+ */
93
+ /*
94
+ - Variables - Empty
95
+ */
96
+ /*
97
+ - Variables - Error code
98
+ */
99
+ /*
100
+ - Variables - Grid
101
+ */
102
+ /*
103
+ - Variables - Tiles
104
+ */
105
+ /*
106
+ - Variables - Modal & Prompt
107
+ */
108
+ /**
109
+ * Utilities - Offset
110
+ */
111
+ /*
112
+ - Variables - shadows
113
+ */
114
+ /* "Constants" for general usage */
115
+ /*
116
+ - Variables - Statsbar
117
+ */
118
+ /*
119
+ - Variables - Tabs
120
+ */
121
+ /*
122
+ - Variables - Tooltip
123
+ */
124
+ /*
125
+ - Variables - Loading
126
+ */
127
+ /*
128
+ - Variables - Forms
129
+ */
130
+ /*
131
+ - Variables - Form Autocomplete
132
+ */
133
+ /*
134
+ - Variables - Form Message
135
+ */
136
+ /*
137
+ - Variables - Form label
138
+ */
139
+ /*
140
+ - Variables - Form switch
141
+ */
142
+ /*
143
+ - Variables - Form select
144
+ */
145
+ /*
146
+ - Variables - Form input
147
+ */
148
+ /*
149
+ - Variables - Form multiselect
150
+ */
151
+ /*
152
+ - Variables - Form password power
153
+ */
154
+ /*
155
+ - Variables - Form checkbox & radio
156
+ */
157
+ /*
158
+ - Variables - Form group
159
+ */
160
+ /*
161
+ - Variables - Form file
162
+ */
163
+ /*
164
+ - Variables - Toast Message
165
+ */
166
+ /*
167
+ - Variables - Wizzard
168
+ */
169
+ /*
170
+ - Variables - Stepper
171
+ */
172
+ /*
173
+ - Variables - Side nav
174
+ */
175
+ /*
176
+ - Variables - Grid & Tile
177
+ */
178
+ /*
179
+ - Variables - Pagination
180
+ */
181
+ /*
182
+ - Variables - Nav
183
+ */
184
+ /*
185
+ - Variables - Layout
186
+ */
187
+ .gov-spin-animation,
188
+ .gov-pseudo-spin-animation::before {
189
+ animation: spin 4s linear infinite;
190
+ }
191
+
192
+ @keyframes spin {
193
+ 100% {
194
+ transform: rotate(360deg);
195
+ }
196
+ }
197
+ @keyframes countdown {
198
+ to {
199
+ transform: scaleX(0);
200
+ }
201
+ }
202
+ .gov-form-password-power {
203
+ display: flex;
204
+ align-items: center;
205
+ gap: 1.5rem;
206
+ height: 1.5rem;
207
+ }
208
+ .gov-form-password-power__bar {
209
+ display: flex;
210
+ gap: 0.25rem;
211
+ width: 100%;
212
+ }
213
+ .gov-form-password-power__bar span {
214
+ display: inline-block;
215
+ width: 100%;
216
+ height: var(--gov-form-password-power-height, 0.25rem);
217
+ border-radius: var(--gov-form-password-power-radius, 0.125rem);
218
+ background-color: var(--gov-form-password-power-color, var(--gov-color-secondary-600));
219
+ }
220
+ .gov-form-password-power__text {
221
+ font-weight: var(--gov-text-s-font-weight);
222
+ font-size: var(--gov-text-s-font-size);
223
+ line-height: var(--gov-text-s-line-height);
224
+ letter-spacing: var(--gov-text-s-letter-spacing);
225
+ text-align: right;
226
+ flex-basis: 3.5rem;
227
+ }
228
+ .gov-form-password-power[power="1"] {
229
+ color: var(--gov-form-password-power-color-weak, var(--gov-color-error));
230
+ }
231
+ .gov-form-password-power[power="1"] .gov-form-password-power__bar span:nth-child(1) {
232
+ background-color: var(--gov-form-password-power-color-weak, var(--gov-color-error));
233
+ }
234
+ .gov-form-password-power[power="2"] {
235
+ color: var(--gov-form-password-power-color-medium, var(--gov-color-warning-500));
236
+ }
237
+ .gov-form-password-power[power="2"] .gov-form-password-power__bar span:nth-child(1),
238
+ .gov-form-password-power[power="2"] .gov-form-password-power__bar span:nth-child(2) {
239
+ background-color: var(--gov-form-password-power-color-medium, var(--gov-color-warning-500));
240
+ }
241
+ .gov-form-password-power[power="3"] {
242
+ color: var(--gov-form-password-power-color-strong, var(--gov-color-success));
243
+ }
244
+ .gov-form-password-power[power="3"] .gov-form-password-power__bar span {
245
+ background-color: var(--gov-form-password-power-color-strong, var(--gov-color-success));
246
+ }
@@ -0,0 +1,43 @@
1
+ import { h, Host } from '@stencil/core';
2
+ import { FormPasswordPowerClass } from './constants';
3
+ export class GovFormPasswordPower {
4
+ constructor() {
5
+ this.power = undefined;
6
+ }
7
+ render() {
8
+ return (h(Host, { class: FormPasswordPowerClass.root }, h("span", { class: FormPasswordPowerClass.bar }, h("span", null), h("span", null), h("span", null)), h("span", { class: FormPasswordPowerClass.text }, h("slot", null))));
9
+ }
10
+ static get is() { return "gov-form-password-power"; }
11
+ static get originalStyleUrls() {
12
+ return {
13
+ "$": ["gov-form-password-power.scss"]
14
+ };
15
+ }
16
+ static get styleUrls() {
17
+ return {
18
+ "$": ["gov-form-password-power.css"]
19
+ };
20
+ }
21
+ static get properties() {
22
+ return {
23
+ "power": {
24
+ "type": "number",
25
+ "mutable": false,
26
+ "complexType": {
27
+ "original": "number",
28
+ "resolved": "number",
29
+ "references": {}
30
+ },
31
+ "required": false,
32
+ "optional": false,
33
+ "docs": {
34
+ "tags": [],
35
+ "text": "Password power: 0 - none, 1 - weak, 2 - medium, 3 - strong"
36
+ },
37
+ "attribute": "power",
38
+ "reflect": false
39
+ }
40
+ };
41
+ }
42
+ }
43
+ //# sourceMappingURL=gov-form-password-power.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gov-form-password-power.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/password-power/gov-form-password-power.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAMpD,MAAM,OAAO,oBAAoB;;;;EAMhC,MAAM;IACL,OAAO,CACN,EAAC,IAAI,IAAC,KAAK,EAAE,sBAAsB,CAAC,IAAI;MAC3B,YAAM,KAAK,EAAE,sBAAsB,CAAC,GAAG;QACnC,eAAa;QACb,eAAa;QACb,eAAa,CACV;MACP,YAAM,KAAK,EAAE,sBAAsB,CAAC,IAAI;QACpC,eAAQ,CACL,CACb,CACP,CAAA;EACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, h, Host, Prop } from '@stencil/core'\nimport { FormPasswordPowerClass } from './constants'\n\n@Component({\n\ttag: 'gov-form-password-power',\n\tstyleUrl: 'gov-form-password-power.scss',\n})\nexport class GovFormPasswordPower {\n /**\n\t * Password power: 0 - none, 1 - weak, 2 - medium, 3 - strong\n\t */\n\t@Prop() readonly power: number\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormPasswordPowerClass.root}>\n <span class={FormPasswordPowerClass.bar}>\n <span></span>\n <span></span>\n <span></span>\n </span>\n <span class={FormPasswordPowerClass.text}>\n <slot />\n </span>\n\t\t\t</Host>\n\t\t)\n\t}\n}"]}
@@ -148,6 +148,9 @@
148
148
  /*
149
149
  - Variables - Form multiselect
150
150
  */
151
+ /*
152
+ - Variables - Form password power
153
+ */
151
154
  /*
152
155
  - Variables - Form checkbox & radio
153
156
  */