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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (450) hide show
  1. package/dist/cjs/{constants-5f6bbc50.js → constants-245999e7.js} +3 -2
  2. package/dist/cjs/constants-245999e7.js.map +1 -0
  3. package/dist/cjs/{constants-dc2ba6bd.js → constants-61f8be34.js} +3 -3
  4. package/dist/cjs/constants-61f8be34.js.map +1 -0
  5. package/dist/cjs/core.cjs.js +1 -1
  6. package/dist/cjs/gov-accordion-item.cjs.entry.js +2 -2
  7. package/dist/cjs/gov-accordion-item.cjs.entry.js.map +1 -1
  8. package/dist/cjs/gov-accordion.cjs.entry.js +2 -1
  9. package/dist/cjs/gov-accordion.cjs.entry.js.map +1 -1
  10. package/dist/cjs/gov-alert.cjs.entry.js +1 -1
  11. package/dist/cjs/gov-alert.cjs.entry.js.map +1 -1
  12. package/dist/cjs/gov-app.cjs.entry.js +658 -159
  13. package/dist/cjs/gov-app.cjs.entry.js.map +1 -1
  14. package/dist/cjs/gov-attachments_3.cjs.entry.js +1 -1
  15. package/dist/cjs/gov-attachments_3.cjs.entry.js.map +1 -1
  16. package/dist/cjs/gov-backdrop.cjs.entry.js +4 -3
  17. package/dist/cjs/gov-backdrop.cjs.entry.js.map +1 -1
  18. package/dist/cjs/gov-badge.cjs.entry.js +17 -17
  19. package/dist/cjs/gov-badge.cjs.entry.js.map +1 -1
  20. package/dist/cjs/gov-breadcrumbs.cjs.entry.js +1 -1
  21. package/dist/cjs/gov-breadcrumbs.cjs.entry.js.map +1 -1
  22. package/dist/cjs/gov-button.cjs.entry.js +2 -2
  23. package/dist/cjs/gov-button.cjs.entry.js.map +1 -1
  24. package/dist/cjs/gov-card.cjs.entry.js +1 -1
  25. package/dist/cjs/gov-card.cjs.entry.js.map +1 -1
  26. package/dist/cjs/gov-form-checkbox.cjs.entry.js +1 -1
  27. package/dist/cjs/gov-form-checkbox.cjs.entry.js.map +1 -1
  28. package/dist/cjs/gov-form-file.cjs.entry.js +1 -1
  29. package/dist/cjs/gov-form-file.cjs.entry.js.map +1 -1
  30. package/dist/cjs/gov-form-input.cjs.entry.js +2 -2
  31. package/dist/cjs/gov-form-input.cjs.entry.js.map +1 -1
  32. package/dist/cjs/gov-form-multi-select.cjs.entry.js +3 -3
  33. package/dist/cjs/gov-form-multi-select.cjs.entry.js.map +1 -1
  34. package/dist/cjs/gov-form-password-power.cjs.entry.js +28 -0
  35. package/dist/cjs/gov-form-password-power.cjs.entry.js.map +1 -0
  36. package/dist/cjs/gov-form-select.cjs.entry.js +3 -3
  37. package/dist/cjs/gov-form-select.cjs.entry.js.map +1 -1
  38. package/dist/cjs/gov-icon.cjs.entry.js +1 -1
  39. package/dist/cjs/gov-modal.cjs.entry.js +19 -13
  40. package/dist/cjs/gov-modal.cjs.entry.js.map +1 -1
  41. package/dist/cjs/gov-pagination.cjs.entry.js +49 -14
  42. package/dist/cjs/gov-pagination.cjs.entry.js.map +1 -1
  43. package/dist/cjs/gov-prompt.cjs.entry.js +12 -6
  44. package/dist/cjs/gov-prompt.cjs.entry.js.map +1 -1
  45. package/dist/cjs/gov-side-nav-item.cjs.entry.js +1 -1
  46. package/dist/cjs/gov-side-nav-item.cjs.entry.js.map +1 -1
  47. package/dist/cjs/gov-spacer.cjs.entry.js +1 -1
  48. package/dist/cjs/gov-spacer.cjs.entry.js.map +1 -1
  49. package/dist/cjs/gov-statsbar-item.cjs.entry.js +1 -1
  50. package/dist/cjs/gov-statsbar.cjs.entry.js +2 -2
  51. package/dist/cjs/gov-statsbar.cjs.entry.js.map +1 -1
  52. package/dist/cjs/gov-tabs.cjs.entry.js +1 -1
  53. package/dist/cjs/gov-tabs.cjs.entry.js.map +1 -1
  54. package/dist/cjs/gov-tile.cjs.entry.js +2 -2
  55. package/dist/cjs/gov-tile.cjs.entry.js.map +1 -1
  56. package/dist/cjs/gov-tiles.cjs.entry.js +2 -1
  57. package/dist/cjs/gov-tiles.cjs.entry.js.map +1 -1
  58. package/dist/cjs/gov-toast.cjs.entry.js +1 -1
  59. package/dist/cjs/gov-toast.cjs.entry.js.map +1 -1
  60. package/dist/cjs/gov-wizzard-item.cjs.entry.js +1 -1
  61. package/dist/cjs/gov-wizzard-item.cjs.entry.js.map +1 -1
  62. package/dist/cjs/index-356717ae.js +4 -0
  63. package/dist/cjs/loader.cjs.js +1 -1
  64. package/dist/collection/collection-manifest.json +1 -0
  65. package/dist/collection/components/gov-accordion/gov-accordion-item.css +37 -5
  66. package/dist/collection/components/gov-accordion/gov-accordion-item.js +1 -1
  67. package/dist/collection/components/gov-accordion/gov-accordion-item.js.map +1 -1
  68. package/dist/collection/components/gov-accordion/gov-accordion.css +6 -0
  69. package/dist/collection/components/gov-accordion/gov-accordion.js +19 -0
  70. package/dist/collection/components/gov-accordion/gov-accordion.js.map +1 -1
  71. package/dist/collection/components/gov-alert/gov-alert.css +3 -0
  72. package/dist/collection/components/gov-alert/gov-alert.js +1 -1
  73. package/dist/collection/components/gov-alert/gov-alert.js.map +1 -1
  74. package/dist/collection/components/gov-app/gov-app.css +3 -0
  75. package/dist/collection/components/gov-attachments/gov-attachments-item.css +3 -0
  76. package/dist/collection/components/gov-attachments/gov-attachments-item.js +1 -1
  77. package/dist/collection/components/gov-attachments/gov-attachments-item.js.map +1 -1
  78. package/dist/collection/components/gov-attachments/gov-attachments.css +3 -0
  79. package/dist/collection/components/gov-backdrop/gov-backdrop.css +3 -0
  80. package/dist/collection/components/gov-backdrop/gov-backdrop.js +5 -4
  81. package/dist/collection/components/gov-backdrop/gov-backdrop.js.map +1 -1
  82. package/dist/collection/components/gov-badge/constants.js +4 -1
  83. package/dist/collection/components/gov-badge/constants.js.map +1 -1
  84. package/dist/collection/components/gov-badge/gov-badge.css +204 -96
  85. package/dist/collection/components/gov-badge/gov-badge.js +26 -47
  86. package/dist/collection/components/gov-badge/gov-badge.js.map +1 -1
  87. package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.css +3 -0
  88. package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.js +1 -1
  89. package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.js.map +1 -1
  90. package/dist/collection/components/gov-button/constants.js +2 -1
  91. package/dist/collection/components/gov-button/constants.js.map +1 -1
  92. package/dist/collection/components/gov-button/gov-button.css +210 -131
  93. package/dist/collection/components/gov-button/gov-button.js +6 -6
  94. package/dist/collection/components/gov-button/gov-button.js.map +1 -1
  95. package/dist/collection/components/gov-card/gov-card.css +3 -0
  96. package/dist/collection/components/gov-card/gov-card.js +1 -1
  97. package/dist/collection/components/gov-card/gov-card.js.map +1 -1
  98. package/dist/collection/components/gov-container/gov-container.css +3 -0
  99. package/dist/collection/components/gov-cookiebar/gov-cookiebar.css +3 -0
  100. package/dist/collection/components/gov-empty/gov-empty.css +3 -0
  101. package/dist/collection/components/gov-error-code/gov-error-code.css +3 -0
  102. package/dist/collection/components/gov-form/autocomplete/gov-form-autocomplete.css +3 -0
  103. package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.css +3 -0
  104. package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.js +1 -1
  105. package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.js.map +1 -1
  106. package/dist/collection/components/gov-form/control/gov-form-control.css +3 -0
  107. package/dist/collection/components/gov-form/file/gov-form-file.css +3 -0
  108. package/dist/collection/components/gov-form/file/gov-form-file.js +1 -1
  109. package/dist/collection/components/gov-form/file/gov-form-file.js.map +1 -1
  110. package/dist/collection/components/gov-form/group/gov-form-group.css +3 -0
  111. package/dist/collection/components/gov-form/input/gov-form-input.css +6 -3
  112. package/dist/collection/components/gov-form/input/gov-form-input.js +1 -1
  113. package/dist/collection/components/gov-form/input/gov-form-input.js.map +1 -1
  114. package/dist/collection/components/gov-form/label/gov-form-label.css +3 -0
  115. package/dist/collection/components/gov-form/message/gov-form-message.css +3 -0
  116. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.css +3 -3
  117. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js +2 -2
  118. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.js.map +1 -1
  119. package/dist/collection/components/gov-form/password-power/constants.js +6 -0
  120. package/dist/collection/components/gov-form/password-power/constants.js.map +1 -0
  121. package/dist/collection/components/gov-form/password-power/gov-form-password-power.css +246 -0
  122. package/dist/collection/components/gov-form/password-power/gov-form-password-power.js +43 -0
  123. package/dist/collection/components/gov-form/password-power/gov-form-password-power.js.map +1 -0
  124. package/dist/collection/components/gov-form/radio/gov-form-radio.css +3 -0
  125. package/dist/collection/components/gov-form/search/gov-form-search.css +3 -0
  126. package/dist/collection/components/gov-form/select/gov-form-select.css +3 -3
  127. package/dist/collection/components/gov-form/select/gov-form-select.js +2 -2
  128. package/dist/collection/components/gov-form/select/gov-form-select.js.map +1 -1
  129. package/dist/collection/components/gov-form/switch/gov-form-switch.css +3 -0
  130. package/dist/collection/components/gov-grid/gov-grid-item.css +3 -0
  131. package/dist/collection/components/gov-grid/gov-grid.css +3 -0
  132. package/dist/collection/components/gov-icon/gov-icon.css +3 -0
  133. package/dist/collection/components/gov-icon/list.js +148 -5
  134. package/dist/collection/components/gov-icon/list.js.map +1 -1
  135. package/dist/collection/components/gov-layout/gov-layout-column.css +3 -0
  136. package/dist/collection/components/gov-layout/gov-layout.css +3 -0
  137. package/dist/collection/components/gov-loading/gov-loading.css +3 -0
  138. package/dist/collection/components/gov-message/gov-message.css +3 -0
  139. package/dist/collection/components/gov-modal/gov-modal.css +6 -3
  140. package/dist/collection/components/gov-modal/gov-modal.js +35 -22
  141. package/dist/collection/components/gov-modal/gov-modal.js.map +1 -1
  142. package/dist/collection/components/gov-nav/gov-nav-item.css +3 -0
  143. package/dist/collection/components/gov-nav/gov-nav.css +3 -0
  144. package/dist/collection/components/gov-pagination/gov-pagination.css +87 -39
  145. package/dist/collection/components/gov-pagination/gov-pagination.js +63 -29
  146. package/dist/collection/components/gov-pagination/gov-pagination.js.map +1 -1
  147. package/dist/collection/components/gov-promp/gov-prompt.css +6 -3
  148. package/dist/collection/components/gov-promp/gov-prompt.js +18 -5
  149. package/dist/collection/components/gov-promp/gov-prompt.js.map +1 -1
  150. package/dist/collection/components/gov-side-nav/gov-side-nav-item.css +3 -0
  151. package/dist/collection/components/gov-side-nav/gov-side-nav-item.js +1 -1
  152. package/dist/collection/components/gov-side-nav/gov-side-nav-item.js.map +1 -1
  153. package/dist/collection/components/gov-side-nav/gov-side-nav.css +3 -0
  154. package/dist/collection/components/gov-spacer/gov-spacer.css +3 -0
  155. package/dist/collection/components/gov-spacer/gov-spacer.js +3 -2
  156. package/dist/collection/components/gov-spacer/gov-spacer.js.map +1 -1
  157. package/dist/collection/components/gov-statsbar/constants.js +1 -1
  158. package/dist/collection/components/gov-statsbar/constants.js.map +1 -1
  159. package/dist/collection/components/gov-statsbar/gov-statsbar-item.css +3 -0
  160. package/dist/collection/components/gov-statsbar/gov-statsbar.css +3 -0
  161. package/dist/collection/components/gov-statsbar/gov-statsbar.js +2 -2
  162. package/dist/collection/components/gov-statsbar/gov-statsbar.js.map +1 -1
  163. package/dist/collection/components/gov-stepper/gov-stepper-item.css +3 -0
  164. package/dist/collection/components/gov-stepper/gov-stepper.css +3 -0
  165. package/dist/collection/components/gov-tabs/gov-tabs-item.css +3 -0
  166. package/dist/collection/components/gov-tabs/gov-tabs.css +3 -0
  167. package/dist/collection/components/gov-tabs/gov-tabs.js +1 -1
  168. package/dist/collection/components/gov-tabs/gov-tabs.js.map +1 -1
  169. package/dist/collection/components/gov-tile/gov-tile.css +4 -1
  170. package/dist/collection/components/gov-tile/gov-tile.js +1 -1
  171. package/dist/collection/components/gov-tile/gov-tile.js.map +1 -1
  172. package/dist/collection/components/gov-tiles/gov-tiles.css +6 -0
  173. package/dist/collection/components/gov-tiles/gov-tiles.js +19 -0
  174. package/dist/collection/components/gov-tiles/gov-tiles.js.map +1 -1
  175. package/dist/collection/components/gov-toast/gov-toast.css +3 -0
  176. package/dist/collection/components/gov-toast/gov-toast.js +1 -1
  177. package/dist/collection/components/gov-toast/gov-toast.js.map +1 -1
  178. package/dist/collection/components/gov-tooltip/gov-tooltip-content.css +3 -0
  179. package/dist/collection/components/gov-tooltip/gov-tooltip.css +3 -0
  180. package/dist/collection/components/gov-wizzard/gov-wizzard-item.css +3 -0
  181. package/dist/collection/components/gov-wizzard/gov-wizzard-item.js +1 -1
  182. package/dist/collection/components/gov-wizzard/gov-wizzard-item.js.map +1 -1
  183. package/dist/collection/components/gov-wizzard/gov-wizzard.css +3 -0
  184. package/dist/collection/pages/Accordion.js +97 -2
  185. package/dist/collection/pages/Accordion.js.map +1 -1
  186. package/dist/collection/pages/Badge.js +27 -0
  187. package/dist/collection/pages/Badge.js.map +1 -1
  188. package/dist/collection/pages/Button.js +440 -120
  189. package/dist/collection/pages/Button.js.map +1 -1
  190. package/dist/collection/pages/Error.js +1 -1
  191. package/dist/collection/pages/Error.js.map +1 -1
  192. package/dist/collection/pages/Forms.js +31 -23
  193. package/dist/collection/pages/Forms.js.map +1 -1
  194. package/dist/collection/pages/Pagination.js +12 -2
  195. package/dist/collection/pages/Pagination.js.map +1 -1
  196. package/dist/collection/pages/Stepper.js +6 -6
  197. package/dist/collection/pages/Stepper.js.map +1 -1
  198. package/dist/collection/pages/Tiles.js +39 -0
  199. package/dist/collection/pages/Tiles.js.map +1 -1
  200. package/dist/collection/pages/ToastMessage.js +1 -1
  201. package/dist/collection/pages/ToastMessage.js.map +1 -1
  202. package/dist/collection/pages/ToastMessageCountdown.js +1 -1
  203. package/dist/collection/pages/ToastMessageCountdown.js.map +1 -1
  204. package/dist/collection/pages/Wizzard.js +3 -3
  205. package/dist/collection/pages/Wizzard.js.map +1 -1
  206. package/dist/collection/utils/array.utils.js +2 -0
  207. package/dist/collection/utils/array.utils.js.map +1 -0
  208. package/dist/components/constants11.js +2 -2
  209. package/dist/components/constants11.js.map +1 -1
  210. package/dist/components/constants3.js +2 -1
  211. package/dist/components/constants3.js.map +1 -1
  212. package/dist/components/gov-accordion-item.js +2 -2
  213. package/dist/components/gov-accordion-item.js.map +1 -1
  214. package/dist/components/gov-accordion.js +3 -1
  215. package/dist/components/gov-accordion.js.map +1 -1
  216. package/dist/components/gov-alert.js +1 -1
  217. package/dist/components/gov-alert.js.map +1 -1
  218. package/dist/components/gov-app.js +658 -159
  219. package/dist/components/gov-app.js.map +1 -1
  220. package/dist/components/gov-attachments-item2.js +1 -1
  221. package/dist/components/gov-attachments-item2.js.map +1 -1
  222. package/dist/components/gov-backdrop2.js +5 -4
  223. package/dist/components/gov-backdrop2.js.map +1 -1
  224. package/dist/components/gov-badge2.js +16 -17
  225. package/dist/components/gov-badge2.js.map +1 -1
  226. package/dist/components/gov-breadcrumbs.js +1 -1
  227. package/dist/components/gov-breadcrumbs.js.map +1 -1
  228. package/dist/components/gov-button2.js +5 -5
  229. package/dist/components/gov-button2.js.map +1 -1
  230. package/dist/components/gov-card.js +1 -1
  231. package/dist/components/gov-card.js.map +1 -1
  232. package/dist/components/gov-form-checkbox.js +1 -1
  233. package/dist/components/gov-form-checkbox.js.map +1 -1
  234. package/dist/components/gov-form-file.js +1 -1
  235. package/dist/components/gov-form-file.js.map +1 -1
  236. package/dist/components/gov-form-input2.js +2 -2
  237. package/dist/components/gov-form-input2.js.map +1 -1
  238. package/dist/components/gov-form-multi-select.js +3 -3
  239. package/dist/components/gov-form-multi-select.js.map +1 -1
  240. package/dist/components/gov-form-password-power.d.ts +11 -0
  241. package/dist/components/gov-form-password-power.js +44 -0
  242. package/dist/components/gov-form-password-power.js.map +1 -0
  243. package/dist/components/gov-form-select2.js +3 -3
  244. package/dist/components/gov-form-select2.js.map +1 -1
  245. package/dist/components/gov-icon2.js +1 -1
  246. package/dist/components/gov-modal.js +20 -13
  247. package/dist/components/gov-modal.js.map +1 -1
  248. package/dist/components/gov-pagination.js +49 -14
  249. package/dist/components/gov-pagination.js.map +1 -1
  250. package/dist/components/gov-prompt.js +13 -6
  251. package/dist/components/gov-prompt.js.map +1 -1
  252. package/dist/components/gov-side-nav-item.js +1 -1
  253. package/dist/components/gov-side-nav-item.js.map +1 -1
  254. package/dist/components/gov-spacer.js +1 -1
  255. package/dist/components/gov-spacer.js.map +1 -1
  256. package/dist/components/gov-statsbar.js +2 -2
  257. package/dist/components/gov-statsbar.js.map +1 -1
  258. package/dist/components/gov-tabs.js +1 -1
  259. package/dist/components/gov-tabs.js.map +1 -1
  260. package/dist/components/gov-tile.js +2 -2
  261. package/dist/components/gov-tile.js.map +1 -1
  262. package/dist/components/gov-tiles.js +4 -2
  263. package/dist/components/gov-tiles.js.map +1 -1
  264. package/dist/components/gov-toast.js +1 -1
  265. package/dist/components/gov-toast.js.map +1 -1
  266. package/dist/components/gov-wizzard-item.js +1 -1
  267. package/dist/components/gov-wizzard-item.js.map +1 -1
  268. package/dist/components/index.d.ts +1 -0
  269. package/dist/components/index.js +1 -0
  270. package/dist/components/index.js.map +1 -1
  271. package/dist/core/core.esm.js +1 -1
  272. package/dist/core/core.esm.js.map +1 -1
  273. package/dist/core/{p-e7dd2002.entry.js → p-00e1e600.entry.js} +2 -2
  274. package/dist/core/p-00e1e600.entry.js.map +1 -0
  275. package/dist/core/p-0950ba85.entry.js +2 -0
  276. package/dist/core/p-0950ba85.entry.js.map +1 -0
  277. package/dist/core/{p-5fa41af9.js → p-1020a160.js} +1 -1
  278. package/dist/core/p-1020a160.js.map +1 -0
  279. package/dist/core/p-165fe5f4.entry.js +2 -0
  280. package/dist/core/{p-0a152bb7.entry.js.map → p-165fe5f4.entry.js.map} +1 -1
  281. package/dist/core/{p-9e6a41cc.entry.js → p-16608a87.entry.js} +2 -2
  282. package/dist/core/p-16608a87.entry.js.map +1 -0
  283. package/dist/core/{p-f5ee7634.entry.js → p-1bb5184f.entry.js} +2 -2
  284. package/dist/core/{p-f5ee7634.entry.js.map → p-1bb5184f.entry.js.map} +1 -1
  285. package/dist/core/p-1cc7b8d3.entry.js +2 -0
  286. package/dist/core/p-1cc7b8d3.entry.js.map +1 -0
  287. package/dist/core/{p-b48a3112.entry.js → p-4b375a4d.entry.js} +2 -2
  288. package/dist/core/{p-b48a3112.entry.js.map → p-4b375a4d.entry.js.map} +1 -1
  289. package/dist/core/{p-ad0cc981.entry.js → p-54f367db.entry.js} +2 -2
  290. package/dist/core/{p-ad0cc981.entry.js.map → p-54f367db.entry.js.map} +1 -1
  291. package/dist/core/p-5b4e3bdf.entry.js +2 -0
  292. package/dist/core/p-5b4e3bdf.entry.js.map +1 -0
  293. package/dist/core/p-613d8ed8.entry.js +2 -0
  294. package/dist/core/p-613d8ed8.entry.js.map +1 -0
  295. package/dist/core/{p-6d40721b.entry.js → p-63d2e8ec.entry.js} +2 -2
  296. package/dist/core/{p-6d40721b.entry.js.map → p-63d2e8ec.entry.js.map} +1 -1
  297. package/dist/core/{p-38fb2d42.entry.js → p-692eb701.entry.js} +2 -2
  298. package/dist/core/p-692eb701.entry.js.map +1 -0
  299. package/dist/core/{p-5cecdaaf.entry.js → p-72f16a95.entry.js} +2 -2
  300. package/dist/core/p-7ac5f119.entry.js +2 -0
  301. package/dist/core/{p-63079b80.entry.js.map → p-7ac5f119.entry.js.map} +1 -1
  302. package/dist/core/{p-03d40bf4.entry.js → p-833ab414.entry.js} +2 -2
  303. package/dist/core/{p-03d40bf4.entry.js.map → p-833ab414.entry.js.map} +1 -1
  304. package/dist/core/{p-34360f92.entry.js → p-84fda9dd.entry.js} +2 -2
  305. package/dist/core/{p-34360f92.entry.js.map → p-84fda9dd.entry.js.map} +1 -1
  306. package/dist/core/p-86a3c0d5.entry.js +2 -0
  307. package/dist/core/p-86a3c0d5.entry.js.map +1 -0
  308. package/dist/core/p-8dacc8dc.entry.js +2 -0
  309. package/dist/core/p-8dacc8dc.entry.js.map +1 -0
  310. package/dist/core/p-99155ec0.entry.js +2 -0
  311. package/dist/core/p-99155ec0.entry.js.map +1 -0
  312. package/dist/core/{p-7591ecd4.entry.js → p-9ca0a11c.entry.js} +2 -2
  313. package/dist/core/{p-7591ecd4.entry.js.map → p-9ca0a11c.entry.js.map} +1 -1
  314. package/dist/core/p-a0c491a6.entry.js +2 -0
  315. package/dist/core/p-a0c491a6.entry.js.map +1 -0
  316. package/dist/core/p-a0dd0a95.entry.js +2 -0
  317. package/dist/core/{p-e52a042f.entry.js.map → p-a0dd0a95.entry.js.map} +1 -1
  318. package/dist/core/p-b966062a.entry.js +2 -0
  319. package/dist/core/p-b966062a.entry.js.map +1 -0
  320. package/dist/core/{p-fc1581f9.entry.js → p-bd560ffc.entry.js} +2 -2
  321. package/dist/core/{p-fc1581f9.entry.js.map → p-bd560ffc.entry.js.map} +1 -1
  322. package/dist/core/p-c9948e57.entry.js +2 -0
  323. package/dist/core/p-c9948e57.entry.js.map +1 -0
  324. package/dist/core/p-cd869237.js +2 -0
  325. package/dist/core/p-cd869237.js.map +1 -0
  326. package/dist/core/{p-93facb4a.entry.js → p-da2b921e.entry.js} +2 -2
  327. package/dist/core/p-da2b921e.entry.js.map +1 -0
  328. package/dist/core/{p-9cc6ed83.entry.js → p-e57d250f.entry.js} +2 -2
  329. package/dist/core/p-e57d250f.entry.js.map +1 -0
  330. package/dist/core/{p-f5ffcb3d.entry.js → p-e9c94ef7.entry.js} +2 -2
  331. package/dist/core/p-fac1c202.entry.js +2 -0
  332. package/dist/core/p-fac1c202.entry.js.map +1 -0
  333. package/dist/custom-elements/index.d.ts +6 -0
  334. package/dist/custom-elements/index.js +1 -1
  335. package/dist/custom-elements/index.js.map +1 -1
  336. package/dist/esm/{constants-d550c816.js → constants-037c35bc.js} +3 -3
  337. package/dist/esm/constants-037c35bc.js.map +1 -0
  338. package/dist/esm/{constants-1a2146b2.js → constants-45f6db4c.js} +3 -2
  339. package/dist/esm/constants-45f6db4c.js.map +1 -0
  340. package/dist/esm/core.js +1 -1
  341. package/dist/esm/gov-accordion-item.entry.js +2 -2
  342. package/dist/esm/gov-accordion-item.entry.js.map +1 -1
  343. package/dist/esm/gov-accordion.entry.js +2 -1
  344. package/dist/esm/gov-accordion.entry.js.map +1 -1
  345. package/dist/esm/gov-alert.entry.js +1 -1
  346. package/dist/esm/gov-alert.entry.js.map +1 -1
  347. package/dist/esm/gov-app.entry.js +658 -159
  348. package/dist/esm/gov-app.entry.js.map +1 -1
  349. package/dist/esm/gov-attachments_3.entry.js +1 -1
  350. package/dist/esm/gov-attachments_3.entry.js.map +1 -1
  351. package/dist/esm/gov-backdrop.entry.js +5 -4
  352. package/dist/esm/gov-backdrop.entry.js.map +1 -1
  353. package/dist/esm/gov-badge.entry.js +17 -17
  354. package/dist/esm/gov-badge.entry.js.map +1 -1
  355. package/dist/esm/gov-breadcrumbs.entry.js +1 -1
  356. package/dist/esm/gov-breadcrumbs.entry.js.map +1 -1
  357. package/dist/esm/gov-button.entry.js +2 -2
  358. package/dist/esm/gov-button.entry.js.map +1 -1
  359. package/dist/esm/gov-card.entry.js +1 -1
  360. package/dist/esm/gov-card.entry.js.map +1 -1
  361. package/dist/esm/gov-form-checkbox.entry.js +1 -1
  362. package/dist/esm/gov-form-checkbox.entry.js.map +1 -1
  363. package/dist/esm/gov-form-file.entry.js +1 -1
  364. package/dist/esm/gov-form-file.entry.js.map +1 -1
  365. package/dist/esm/gov-form-input.entry.js +2 -2
  366. package/dist/esm/gov-form-input.entry.js.map +1 -1
  367. package/dist/esm/gov-form-multi-select.entry.js +3 -3
  368. package/dist/esm/gov-form-multi-select.entry.js.map +1 -1
  369. package/dist/esm/gov-form-password-power.entry.js +24 -0
  370. package/dist/esm/gov-form-password-power.entry.js.map +1 -0
  371. package/dist/esm/gov-form-select.entry.js +3 -3
  372. package/dist/esm/gov-form-select.entry.js.map +1 -1
  373. package/dist/esm/gov-icon.entry.js +1 -1
  374. package/dist/esm/gov-modal.entry.js +19 -13
  375. package/dist/esm/gov-modal.entry.js.map +1 -1
  376. package/dist/esm/gov-pagination.entry.js +49 -14
  377. package/dist/esm/gov-pagination.entry.js.map +1 -1
  378. package/dist/esm/gov-prompt.entry.js +12 -6
  379. package/dist/esm/gov-prompt.entry.js.map +1 -1
  380. package/dist/esm/gov-side-nav-item.entry.js +1 -1
  381. package/dist/esm/gov-side-nav-item.entry.js.map +1 -1
  382. package/dist/esm/gov-spacer.entry.js +1 -1
  383. package/dist/esm/gov-spacer.entry.js.map +1 -1
  384. package/dist/esm/gov-statsbar-item.entry.js +1 -1
  385. package/dist/esm/gov-statsbar.entry.js +2 -2
  386. package/dist/esm/gov-statsbar.entry.js.map +1 -1
  387. package/dist/esm/gov-tabs.entry.js +1 -1
  388. package/dist/esm/gov-tabs.entry.js.map +1 -1
  389. package/dist/esm/gov-tile.entry.js +2 -2
  390. package/dist/esm/gov-tile.entry.js.map +1 -1
  391. package/dist/esm/gov-tiles.entry.js +2 -1
  392. package/dist/esm/gov-tiles.entry.js.map +1 -1
  393. package/dist/esm/gov-toast.entry.js +1 -1
  394. package/dist/esm/gov-toast.entry.js.map +1 -1
  395. package/dist/esm/gov-wizzard-item.entry.js +1 -1
  396. package/dist/esm/gov-wizzard-item.entry.js.map +1 -1
  397. package/dist/esm/index-00e9a0d5.js +4 -0
  398. package/dist/esm/loader.js +1 -1
  399. package/dist/hydrate/index.js +830 -247
  400. package/dist/types/components/gov-accordion/gov-accordion.d.ts +4 -0
  401. package/dist/types/components/gov-badge/constants.d.ts +4 -2
  402. package/dist/types/components/gov-badge/gov-badge.d.ts +4 -9
  403. package/dist/types/components/gov-button/constants.d.ts +3 -2
  404. package/dist/types/components/gov-form/password-power/constants.d.ts +5 -0
  405. package/dist/types/components/gov-form/password-power/gov-form-password-power.d.ts +7 -0
  406. package/dist/types/components/gov-modal/gov-modal.d.ts +3 -1
  407. package/dist/types/components/gov-pagination/gov-pagination.d.ts +7 -3
  408. package/dist/types/components/gov-promp/gov-prompt.d.ts +3 -1
  409. package/dist/types/components/gov-statsbar/constants.d.ts +2 -2
  410. package/dist/types/components/gov-tiles/gov-tiles.d.ts +4 -0
  411. package/dist/types/components.d.ts +39 -10
  412. package/dist/types/utils/array.utils.d.ts +1 -0
  413. package/package.json +1 -1
  414. package/dist/cjs/constants-5f6bbc50.js.map +0 -1
  415. package/dist/cjs/constants-dc2ba6bd.js.map +0 -1
  416. package/dist/core/p-00182e76.entry.js +0 -2
  417. package/dist/core/p-00182e76.entry.js.map +0 -1
  418. package/dist/core/p-0278fcb3.entry.js +0 -2
  419. package/dist/core/p-0278fcb3.entry.js.map +0 -1
  420. package/dist/core/p-08f14c8b.entry.js +0 -2
  421. package/dist/core/p-08f14c8b.entry.js.map +0 -1
  422. package/dist/core/p-0a152bb7.entry.js +0 -2
  423. package/dist/core/p-14f8f2fb.js +0 -2
  424. package/dist/core/p-14f8f2fb.js.map +0 -1
  425. package/dist/core/p-2128abe1.entry.js +0 -2
  426. package/dist/core/p-2128abe1.entry.js.map +0 -1
  427. package/dist/core/p-2419f4cd.entry.js +0 -2
  428. package/dist/core/p-2419f4cd.entry.js.map +0 -1
  429. package/dist/core/p-38fb2d42.entry.js.map +0 -1
  430. package/dist/core/p-4681cb3a.entry.js +0 -2
  431. package/dist/core/p-4681cb3a.entry.js.map +0 -1
  432. package/dist/core/p-469273be.entry.js +0 -2
  433. package/dist/core/p-469273be.entry.js.map +0 -1
  434. package/dist/core/p-5547dbb0.entry.js +0 -2
  435. package/dist/core/p-5547dbb0.entry.js.map +0 -1
  436. package/dist/core/p-5fa41af9.js.map +0 -1
  437. package/dist/core/p-63079b80.entry.js +0 -2
  438. package/dist/core/p-93facb4a.entry.js.map +0 -1
  439. package/dist/core/p-9cc6ed83.entry.js.map +0 -1
  440. package/dist/core/p-9e6a41cc.entry.js.map +0 -1
  441. package/dist/core/p-e52a042f.entry.js +0 -2
  442. package/dist/core/p-e7dd2002.entry.js.map +0 -1
  443. package/dist/core/p-f2dc8ce3.entry.js +0 -2
  444. package/dist/core/p-f2dc8ce3.entry.js.map +0 -1
  445. package/dist/core/p-fc91591d.entry.js +0 -2
  446. package/dist/core/p-fc91591d.entry.js.map +0 -1
  447. package/dist/esm/constants-1a2146b2.js.map +0 -1
  448. package/dist/esm/constants-d550c816.js.map +0 -1
  449. /package/dist/core/{p-5cecdaaf.entry.js.map → p-72f16a95.entry.js.map} +0 -0
  450. /package/dist/core/{p-f5ffcb3d.entry.js.map → p-e9c94ef7.entry.js.map} +0 -0
@@ -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,8 +108,8 @@ 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) {
@@ -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,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;EAkED,eAAe,CAAC,QAAgB;IAC/B,YAAY,CAAC,uBAAuB,EAAE,QAAQ,EAAE,oBAAoB,CAAC,IAAI,CAAC,CAAA;EAC3E,CAAC;EAGD,YAAY,CAAC,QAAgB;IAC5B,YAAY,CAAC,oBAAoB,EAAE,QAAQ,EAAE,oBAAoB,CAAC,IAAI,CAAC,CAAA;EACxE,CAAC;EAGD,UAAU,CAAC,QAAkC;IAC5C,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;EAC9B,CAAC;EAED,i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A;EACrC,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,QAAQ,CAAC,KAAa;IAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;EACnB,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,WAAW;IAChB,OAAO,IAAI,CAAC,SAAS,CAAA;EACtB,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,YAAY;IACjB,eAAe,CAAC,IAAI,CAAC,eAAe,EAAE,mBAAmB,EAAE,oBAAoB,CAAC,IAAI,CAAC,CAAA;IACrF,eAAe,CAAC,IAAI,CAAC,cAAc,EAAE,kBAAkB,EAAE,oBAAoB,CAAC,IAAI,CAAC,CAAA;IACnF,eAAe,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,eAA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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=\"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\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"]}
@@ -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
  */
@@ -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
  */
@@ -317,9 +320,6 @@
317
320
  [invalid="1"].gov-form-select *[slot=right-icon] {
318
321
  color: var(--gov-form-state-color-error, var(--gov-color-error));
319
322
  }
320
- [invalid=""].gov-form-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow), [invalid=true i].gov-form-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow), [invalid="1"].gov-form-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow) {
321
- display: none;
322
- }
323
323
  [success=""].gov-form-select *[slot=right-icon], [success=true i].gov-form-select *[slot=right-icon], [success="1"].gov-form-select *[slot=right-icon] {
324
324
  color: var(--gov-form-state-color-success, var(--gov-color-success));
325
325
  }
@@ -50,7 +50,7 @@ export class GovFormSelect {
50
50
  }
51
51
  }
52
52
  render() {
53
- return (h(Host, { class: FormSelectClass.root, size: this.size, variant: this.variant }, this.h.hasSlot('prefix') && h("slot", { name: "prefix" }), h("span", { class: "element" }, h("gov-icon", { slot: "right-icon", name: "arrow-down" }), h("select", { id: this.identifier || this.selectId, onFocus: this.onFocusHandler.bind(this), onChange: this.onChangeHandler.bind(this), onBlur: this.onBlurHandler.bind(this), required: this.required, name: this.name, disabled: this.disabled, ref: el => (this.selectRef = el), "aria-disabled": toBoolAttrIfDefined(this.disabled), "aria-activedescendant": this.wcagActiveDescendant, "aria-controls": this.wcagControls, "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))), this.h.hasSlot('sufix') && h("slot", { name: "sufix" })));
53
+ return (h(Host, { class: FormSelectClass.root, size: this.size, variant: this.variant }, this.h.hasSlot('prefix') && h("slot", { name: "prefix" }), h("span", { class: "element" }, h("gov-icon", { slot: "right-icon", name: "chevron-down" }), h("select", { id: this.identifier || this.selectId, onFocus: this.onFocusHandler.bind(this), onChange: this.onChangeHandler.bind(this), onBlur: this.onBlurHandler.bind(this), required: this.required, name: this.name, disabled: this.disabled, ref: el => (this.selectRef = el), "aria-disabled": toBoolAttrIfDefined(this.disabled), "aria-activedescendant": this.wcagActiveDescendant, "aria-controls": this.wcagControls, "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))), this.h.hasSlot('sufix') && h("slot", { name: "sufix" })));
54
54
  }
55
55
  onFocusHandler(e) {
56
56
  this.focused = true;
@@ -63,7 +63,7 @@ export class GovFormSelect {
63
63
  onChangeHandler(e) {
64
64
  this.value = e.target.value;
65
65
  e.stopPropagation();
66
- this.govChange.emit(e);
66
+ this.govChange.emit(e.target);
67
67
  }
68
68
  /**
69
69
  * Returns the current state of the component
@@ -1 +1 @@
1
- {"version":3,"file":"gov-form-select.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/select/gov-form-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;AAE5G,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAA;AAC5E,OAAO,EAAuB,kBAAkB,EAAyB,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC9H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AC,CAAA;IACzE,eAAe,CAAC,IAAI,CAAC,eAAe,EAAE,mBAAmB,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;IAChF,eAAe,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;IACjE,oBAAoB,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;EAClG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, h, State, Prop, Event, EventEmitter, Watch, Host, Method } from '@stencil/core'\nimport { GovHost } from '../../../helpers/Dom/template.types'\nimport { toBoolAttrIfDefined, govHost } from '../../../helpers/Dom/template'\nimport { FormSelectSizesType, FormSelectVariants, FormSelectVariantType, FormSelectClass, FormSelectSizes } from './constants'\nimport { validateProp } from '../../../helpers/Validate/props'\nimport { validateWcagLabelFor, validateWcagRef } from '../../../helpers/Validate/wcag'\nimport { canValidateWcagOnRender } from '../../../helpers/Dom/win'\nimport { createID } from '../../../utils/string.utils'\nimport { delay } from '../../../utils/utils'\nimport { GovForm } from '../../../helpers/Dom/form.types'\nimport { govForm } from '../../../helpers/Dom/form'\n\n@Component({\n\ttag: 'gov-form-select',\n\tstyleUrl: 'gov-form-select.scss',\n})\nexport class GovFormSelect {\n\tprivate f: GovForm\n\tprivate h: GovHost\n\tprivate selectRef?: HTMLSelectElement\n\n\tprivate readonly selectId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.selectId = createID('GovSelect')\n\t\tthis.f = govForm(govHost(this.host))\n\t}\n\n\t@Element() host: HTMLGovFormSelectElement\n\t/**\n\t * Value of select\n\t */\n\t@Prop({ reflect: true, mutable: true }) value: string\n\t/**\n\t * Custom select identifier.\n\t */\n\t@Prop({ attribute: 'identifier' }) readonly identifier: string\n\t/**\n\t * Style variation of the form select.\n\t */\n\t@Prop() readonly variant?: FormSelectVariantType\n\t/**\n\t * Select’s size.\n\t */\n\t@Prop() readonly size?: FormSelectSizesType = 'm'\n\t/**\n\t * Name of the select.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * 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 related component’s visually focused element.\n\t */\n\t@Prop({ attribute: 'wcag-active-descendant' }) readonly wcagActiveDescendant: string\n\t/**\n\t * Use this prop to add an aria-controls attribute. Use the attribute to indicate the id of a component controlled by this component.\n\t */\n\t@Prop({ attribute: 'wcag-controls' }) readonly wcagControls: string\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\n\t@State() focused: boolean\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormSelectVariants, newValue, FormSelectClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormSelectSizes, newValue, FormSelectClass.root)\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\n\t\tthis.host.querySelectorAll('option').forEach((option: HTMLOptionElement) => {\n\t\t\tif (option.value === this.value) {\n\t\t\t\toption.setAttribute('selected', 'true')\n\t\t\t}\n\t\t})\n\n\t\tthis.f.passAttrToControl('type', 'select')\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\treturn (\n\t\t\t<Host class={FormSelectClass.root} size={this.size} variant={this.variant}>\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<gov-icon slot=\"right-icon\" name=\"arrow-down\"></gov-icon>\n\t\t\t\t\t<select\n\t\t\t\t\t\tid={this.identifier || this.selectId}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\tref={el => (this.selectRef = el as HTMLSelectElement)}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\taria-activedescendant={this.wcagActiveDescendant}\n\t\t\t\t\t\taria-controls={this.wcagControls}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\taria-owns={this.wcagOwns}\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t</select>\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 onChangeHandler(e: Event) {\n\t\tthis.value = (e.target as HTMLSelectElement).value\n\t\te.stopPropagation()\n\t\tthis.govChange.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.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.wcagActiveDescendant, 'wcag-active-descendant', FormSelectClass.root)\n\t\tvalidateWcagRef(this.wcagControls, 'wcag-controls', FormSelectClass.root)\n\t\tvalidateWcagRef(this.wcagDescribedBy, 'wcag-described-by', FormSelectClass.root)\n\t\tvalidateWcagRef(this.wcagOwns, 'wcag-owns', FormSelectClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.selectId, this.wcagLabelledBy, FormSelectClass.root)\n\t}\n}\n"]}
1
+ {"version":3,"file":"gov-form-select.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/select/gov-form-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;AAE5G,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAA;AAC5E,OAAO,EAAuB,kBAAkB,EAAyB,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC9H,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,MAAM,6BAA6B,CAAA;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAMnD,MAAM,OAAO,aAAa;EAOzB;;;;gBAsB8C,GAAG;;oBASZ,KAAK;;;;;;;;;IA9BzC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAA;IACrC,IAAI,CAAC,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, h, State, Prop, Event, EventEmitter, Watch, Host, Method } from '@stencil/core'\nimport { GovHost } from '../../../helpers/Dom/template.types'\nimport { toBoolAttrIfDefined, govHost } from '../../../helpers/Dom/template'\nimport { FormSelectSizesType, FormSelectVariants, FormSelectVariantType, FormSelectClass, FormSelectSizes } from './constants'\nimport { validateProp } from '../../../helpers/Validate/props'\nimport { validateWcagLabelFor, validateWcagRef } from '../../../helpers/Validate/wcag'\nimport { canValidateWcagOnRender } from '../../../helpers/Dom/win'\nimport { createID } from '../../../utils/string.utils'\nimport { delay } from '../../../utils/utils'\nimport { GovForm } from '../../../helpers/Dom/form.types'\nimport { govForm } from '../../../helpers/Dom/form'\n\n@Component({\n\ttag: 'gov-form-select',\n\tstyleUrl: 'gov-form-select.scss',\n})\nexport class GovFormSelect {\n\tprivate f: GovForm\n\tprivate h: GovHost\n\tprivate selectRef?: HTMLSelectElement\n\n\tprivate readonly selectId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.selectId = createID('GovSelect')\n\t\tthis.f = govForm(govHost(this.host))\n\t}\n\n\t@Element() host: HTMLGovFormSelectElement\n\t/**\n\t * Value of select\n\t */\n\t@Prop({ reflect: true, mutable: true }) value: string\n\t/**\n\t * Custom select identifier.\n\t */\n\t@Prop({ attribute: 'identifier' }) readonly identifier: string\n\t/**\n\t * Style variation of the form select.\n\t */\n\t@Prop() readonly variant?: FormSelectVariantType\n\t/**\n\t * Select’s size.\n\t */\n\t@Prop() readonly size?: FormSelectSizesType = 'm'\n\t/**\n\t * Name of the select.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * 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 related component’s visually focused element.\n\t */\n\t@Prop({ attribute: 'wcag-active-descendant' }) readonly wcagActiveDescendant: string\n\t/**\n\t * Use this prop to add an aria-controls attribute. Use the attribute to indicate the id of a component controlled by this component.\n\t */\n\t@Prop({ attribute: 'wcag-controls' }) readonly wcagControls: string\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\n\t@State() focused: boolean\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormSelectVariants, newValue, FormSelectClass.root)\n\t}\n\n\t@Watch('size')\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormSelectSizes, newValue, FormSelectClass.root)\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\n\t\tthis.host.querySelectorAll('option').forEach((option: HTMLOptionElement) => {\n\t\t\tif (option.value === this.value) {\n\t\t\t\toption.setAttribute('selected', 'true')\n\t\t\t}\n\t\t})\n\n\t\tthis.f.passAttrToControl('type', 'select')\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\treturn (\n\t\t\t<Host class={FormSelectClass.root} size={this.size} variant={this.variant}>\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<gov-icon slot=\"right-icon\" name=\"chevron-down\"></gov-icon>\n\t\t\t\t\t<select\n\t\t\t\t\t\tid={this.identifier || this.selectId}\n\t\t\t\t\t\tonFocus={this.onFocusHandler.bind(this)}\n\t\t\t\t\t\tonChange={this.onChangeHandler.bind(this)}\n\t\t\t\t\t\tonBlur={this.onBlurHandler.bind(this)}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\tref={el => (this.selectRef = el as HTMLSelectElement)}\n\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\taria-activedescendant={this.wcagActiveDescendant}\n\t\t\t\t\t\taria-controls={this.wcagControls}\n\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\taria-owns={this.wcagOwns}\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t</select>\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 onChangeHandler(e: Event) {\n\t\tthis.value = (e.target as HTMLSelectElement).value\n\t\te.stopPropagation()\n\t\tthis.govChange.emit(e.target)\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.wcagActiveDescendant, 'wcag-active-descendant', FormSelectClass.root)\n\t\tvalidateWcagRef(this.wcagControls, 'wcag-controls', FormSelectClass.root)\n\t\tvalidateWcagRef(this.wcagDescribedBy, 'wcag-described-by', FormSelectClass.root)\n\t\tvalidateWcagRef(this.wcagOwns, 'wcag-owns', FormSelectClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.selectId, this.wcagLabelledBy, FormSelectClass.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
  */
@@ -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
  */