@gov-design-system-ce/components 0.0.52 → 0.0.53

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 (255) hide show
  1. package/dist/cjs/{constants-0883e74c.js → constants-393e915a.js} +2 -2
  2. package/dist/cjs/{constants-0883e74c.js.map → constants-393e915a.js.map} +1 -1
  3. package/dist/cjs/core.cjs.js +1 -1
  4. package/dist/cjs/gov-accordion-item.cjs.entry.js +13 -37
  5. package/dist/cjs/gov-accordion-item.cjs.entry.js.map +1 -1
  6. package/dist/cjs/gov-accordion.cjs.entry.js +2 -2
  7. package/dist/cjs/gov-accordion.cjs.entry.js.map +1 -1
  8. package/dist/cjs/gov-app.cjs.entry.js +158 -326
  9. package/dist/cjs/gov-app.cjs.entry.js.map +1 -1
  10. package/dist/cjs/gov-backdrop.cjs.entry.js.map +1 -1
  11. package/dist/cjs/gov-badge.cjs.entry.js +5 -11
  12. package/dist/cjs/gov-badge.cjs.entry.js.map +1 -1
  13. package/dist/cjs/gov-breadcrumbs.cjs.entry.js.map +1 -1
  14. package/dist/cjs/gov-control-group.cjs.entry.js.map +1 -1
  15. package/dist/cjs/gov-form-control.cjs.entry.js +1 -1
  16. package/dist/cjs/gov-form-control.cjs.entry.js.map +1 -1
  17. package/dist/cjs/gov-form-group.cjs.entry.js +7 -1
  18. package/dist/cjs/gov-form-group.cjs.entry.js.map +1 -1
  19. package/dist/cjs/gov-form-input.cjs.entry.js +14 -12
  20. package/dist/cjs/gov-form-input.cjs.entry.js.map +1 -1
  21. package/dist/cjs/gov-icon.cjs.entry.js +5 -3
  22. package/dist/cjs/gov-icon.cjs.entry.js.map +1 -1
  23. package/dist/cjs/gov-modal.cjs.entry.js.map +1 -1
  24. package/dist/cjs/gov-prompt.cjs.entry.js.map +1 -1
  25. package/dist/cjs/gov-spacer.cjs.entry.js +2 -2
  26. package/dist/cjs/gov-spacer.cjs.entry.js.map +1 -1
  27. package/dist/cjs/gov-statsbar.cjs.entry.js +3 -3
  28. package/dist/cjs/gov-statsbar.cjs.entry.js.map +1 -1
  29. package/dist/cjs/gov-tabs.cjs.entry.js +1 -1
  30. package/dist/cjs/gov-tabs.cjs.entry.js.map +1 -1
  31. package/dist/cjs/loader.cjs.js +1 -1
  32. package/dist/collection/components/gov-accordion/constants.js +1 -1
  33. package/dist/collection/components/gov-accordion/constants.js.map +1 -1
  34. package/dist/collection/components/gov-accordion/gov-accordion-item.css +82 -84
  35. package/dist/collection/components/gov-accordion/gov-accordion-item.js +16 -117
  36. package/dist/collection/components/gov-accordion/gov-accordion-item.js.map +1 -1
  37. package/dist/collection/components/gov-accordion/gov-accordion.js +1 -1
  38. package/dist/collection/components/gov-accordion/gov-accordion.js.map +1 -1
  39. package/dist/collection/components/gov-backdrop/gov-backdrop.js +1 -1
  40. package/dist/collection/components/gov-backdrop/gov-backdrop.js.map +1 -1
  41. package/dist/collection/components/gov-badge/gov-badge.css +20 -20
  42. package/dist/collection/components/gov-badge/gov-badge.js +8 -40
  43. package/dist/collection/components/gov-badge/gov-badge.js.map +1 -1
  44. package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.js +3 -3
  45. package/dist/collection/components/gov-breadcrumbs/gov-breadcrumbs.js.map +1 -1
  46. package/dist/collection/components/gov-control-group/constants.js +1 -1
  47. package/dist/collection/components/gov-control-group/constants.js.map +1 -1
  48. package/dist/collection/components/gov-control-group/gov-control-group.js +3 -3
  49. package/dist/collection/components/gov-control-group/gov-control-group.js.map +1 -1
  50. package/dist/collection/components/gov-form/control/gov-form-control.css +4 -4
  51. package/dist/collection/components/gov-form/group/constants.js +5 -0
  52. package/dist/collection/components/gov-form/group/constants.js.map +1 -1
  53. package/dist/collection/components/gov-form/group/gov-form-group.css +8 -1
  54. package/dist/collection/components/gov-form/group/gov-form-group.js +25 -0
  55. package/dist/collection/components/gov-form/group/gov-form-group.js.map +1 -1
  56. package/dist/collection/components/gov-form/input/gov-form-input.js +27 -19
  57. package/dist/collection/components/gov-form/input/gov-form-input.js.map +1 -1
  58. package/dist/collection/components/gov-icon/gov-icon.js +4 -2
  59. package/dist/collection/components/gov-icon/gov-icon.js.map +1 -1
  60. package/dist/collection/components/gov-modal/gov-modal.js +8 -2
  61. package/dist/collection/components/gov-modal/gov-modal.js.map +1 -1
  62. package/dist/collection/components/gov-promp/gov-prompt.js +9 -4
  63. package/dist/collection/components/gov-promp/gov-prompt.js.map +1 -1
  64. package/dist/collection/components/gov-spacer/constants.js +1 -1
  65. package/dist/collection/components/gov-spacer/constants.js.map +1 -1
  66. package/dist/collection/components/gov-spacer/gov-spacer.js +3 -3
  67. package/dist/collection/components/gov-spacer/gov-spacer.js.map +1 -1
  68. package/dist/collection/components/gov-statsbar/gov-statsbar.js +5 -5
  69. package/dist/collection/components/gov-statsbar/gov-statsbar.js.map +1 -1
  70. package/dist/collection/components/gov-tabs/gov-tabs.js +1 -1
  71. package/dist/collection/components/gov-tabs/gov-tabs.js.map +1 -1
  72. package/dist/collection/core/constants/tokens.js +17 -0
  73. package/dist/collection/core/constants/tokens.js.map +1 -0
  74. package/dist/collection/pages/Accordion.js +158 -326
  75. package/dist/collection/pages/Accordion.js.map +1 -1
  76. package/dist/components/gov-accordion-item.js +1 -1
  77. package/dist/components/gov-accordion-item.js.map +1 -1
  78. package/dist/components/gov-accordion.js +1 -1
  79. package/dist/components/gov-accordion.js.map +1 -1
  80. package/dist/components/gov-alert.js +1 -1
  81. package/dist/components/gov-alert.js.map +1 -1
  82. package/dist/components/gov-app.js +1 -1
  83. package/dist/components/gov-app.js.map +1 -1
  84. package/dist/components/gov-attachments-item.js +1 -1
  85. package/dist/components/gov-badge.js +1 -1
  86. package/dist/components/gov-breadcrumbs.js +1 -1
  87. package/dist/components/gov-breadcrumbs.js.map +1 -1
  88. package/dist/components/gov-button.js +1 -1
  89. package/dist/components/gov-card.js +1 -1
  90. package/dist/components/gov-control-group.js.map +1 -1
  91. package/dist/components/gov-form-autocomplete.js +1 -1
  92. package/dist/components/gov-form-checkbox.js +1 -1
  93. package/dist/components/gov-form-control.js +1 -1
  94. package/dist/components/gov-form-control.js.map +1 -1
  95. package/dist/components/gov-form-file.js +1 -1
  96. package/dist/components/gov-form-group.js +1 -1
  97. package/dist/components/gov-form-group.js.map +1 -1
  98. package/dist/components/gov-form-input.js +1 -1
  99. package/dist/components/gov-form-multi-select.js +1 -1
  100. package/dist/components/gov-form-select.js +1 -1
  101. package/dist/components/gov-icon.js +1 -1
  102. package/dist/components/gov-loading.js +1 -1
  103. package/dist/components/gov-modal.js +1 -1
  104. package/dist/components/gov-modal.js.map +1 -1
  105. package/dist/components/gov-pagination.js +1 -1
  106. package/dist/components/gov-prompt.js +1 -1
  107. package/dist/components/gov-prompt.js.map +1 -1
  108. package/dist/components/gov-side-nav-item.js +1 -1
  109. package/dist/components/gov-spacer.js +1 -1
  110. package/dist/components/gov-spacer.js.map +1 -1
  111. package/dist/components/gov-statsbar-item.js +1 -1
  112. package/dist/components/gov-statsbar.js +1 -1
  113. package/dist/components/gov-statsbar.js.map +1 -1
  114. package/dist/components/gov-tabs.js +1 -1
  115. package/dist/components/gov-tabs.js.map +1 -1
  116. package/dist/components/gov-tile.js +1 -1
  117. package/dist/components/gov-toast.js +1 -1
  118. package/dist/components/gov-wizzard-item.js +1 -1
  119. package/dist/components/{p-d305407a.js → p-103c7bd5.js} +2 -2
  120. package/dist/{core/p-1020a160.js → components/p-17ebfe85.js} +2 -2
  121. package/dist/components/p-37a7409e.js +2 -0
  122. package/dist/components/p-37a7409e.js.map +1 -0
  123. package/dist/components/p-386409dc.js.map +1 -1
  124. package/dist/components/{p-ec26407a.js → p-7bea2390.js} +2 -2
  125. package/dist/components/{p-cd440c95.js → p-a20f1683.js} +2 -2
  126. package/dist/components/p-a20f1683.js.map +1 -0
  127. package/dist/components/{p-1026d931.js → p-c0e49b09.js} +2 -2
  128. package/dist/components/{p-9da782bf.js → p-c3f560b9.js} +2 -2
  129. package/dist/components/{p-9da782bf.js.map → p-c3f560b9.js.map} +1 -1
  130. package/dist/components/p-cf493ba0.js +2 -0
  131. package/dist/components/p-cf493ba0.js.map +1 -0
  132. package/dist/components/{p-80b2c231.js → p-db22f9ce.js} +2 -2
  133. package/dist/core/core.esm.js +1 -1
  134. package/dist/core/core.esm.js.map +1 -1
  135. package/dist/core/{p-42cd2cc4.entry.js → p-05dc3d89.entry.js} +2 -2
  136. package/dist/core/{p-42cd2cc4.entry.js.map → p-05dc3d89.entry.js.map} +1 -1
  137. package/dist/core/{p-a857915f.entry.js → p-0c769f1a.entry.js} +2 -2
  138. package/dist/core/p-11be550d.entry.js.map +1 -1
  139. package/dist/core/p-16c3a489.entry.js +2 -0
  140. package/dist/core/p-16c3a489.entry.js.map +1 -0
  141. package/dist/{components/p-1020a160.js → core/p-17ebfe85.js} +2 -2
  142. package/dist/core/{p-abfa0beb.entry.js → p-2c7af892.entry.js} +2 -2
  143. package/dist/core/{p-abfa0beb.entry.js.map → p-2c7af892.entry.js.map} +1 -1
  144. package/dist/core/p-37a7409e.js +2 -0
  145. package/dist/core/p-37a7409e.js.map +1 -0
  146. package/dist/core/{p-3dbf7f49.js → p-3bacd021.js} +2 -2
  147. package/dist/core/p-3bc977e2.entry.js +2 -0
  148. package/dist/core/p-3bc977e2.entry.js.map +1 -0
  149. package/dist/core/{p-f969eec7.entry.js → p-41f72892.entry.js} +2 -2
  150. package/dist/core/p-41f72892.entry.js.map +1 -0
  151. package/dist/core/p-5195fd36.entry.js +2 -0
  152. package/dist/core/p-5195fd36.entry.js.map +1 -0
  153. package/dist/core/p-722218fd.entry.js.map +1 -1
  154. package/dist/core/{p-02c3a3fd.entry.js → p-7d680665.entry.js} +2 -2
  155. package/dist/core/{p-6dacb8d3.entry.js → p-88010439.entry.js} +2 -2
  156. package/dist/core/p-88010439.entry.js.map +1 -0
  157. package/dist/core/p-89921159.entry.js.map +1 -1
  158. package/dist/core/p-9a3e3ace.entry.js.map +1 -1
  159. package/dist/core/p-ab426e50.entry.js +2 -0
  160. package/dist/core/p-ab426e50.entry.js.map +1 -0
  161. package/dist/core/{p-1e3cad4b.entry.js → p-c81d62db.entry.js} +2 -2
  162. package/dist/core/p-e0c04c5f.entry.js.map +1 -1
  163. package/dist/core/{p-2790d89e.entry.js → p-e1780dba.entry.js} +2 -2
  164. package/dist/core/p-e1780dba.entry.js.map +1 -0
  165. package/dist/core/p-e39cd83c.entry.js +2 -0
  166. package/dist/core/p-e39cd83c.entry.js.map +1 -0
  167. package/dist/core/p-eda868dc.entry.js.map +1 -1
  168. package/dist/esm/{constants-037c35bc.js → constants-27b48cd1.js} +2 -2
  169. package/dist/esm/{constants-037c35bc.js.map → constants-27b48cd1.js.map} +1 -1
  170. package/dist/esm/{constants-ab132d9c.js → constants-858966b9.js} +2 -2
  171. package/dist/esm/{constants-ab132d9c.js.map → constants-858966b9.js.map} +1 -1
  172. package/dist/esm/{constants-5708696f.js → constants-ba92640d.js} +2 -2
  173. package/dist/esm/{constants-5708696f.js.map → constants-ba92640d.js.map} +1 -1
  174. package/dist/esm/core.js +1 -1
  175. package/dist/esm/gov-accordion-item.entry.js +13 -37
  176. package/dist/esm/gov-accordion-item.entry.js.map +1 -1
  177. package/dist/esm/gov-accordion.entry.js +2 -2
  178. package/dist/esm/gov-accordion.entry.js.map +1 -1
  179. package/dist/esm/gov-app.entry.js +158 -326
  180. package/dist/esm/gov-app.entry.js.map +1 -1
  181. package/dist/esm/gov-backdrop.entry.js.map +1 -1
  182. package/dist/esm/gov-badge.entry.js +6 -12
  183. package/dist/esm/gov-badge.entry.js.map +1 -1
  184. package/dist/esm/gov-breadcrumbs.entry.js.map +1 -1
  185. package/dist/esm/gov-button.entry.js +1 -1
  186. package/dist/esm/gov-control-group.entry.js.map +1 -1
  187. package/dist/esm/gov-dropdown.entry.js +1 -1
  188. package/dist/esm/gov-form-control.entry.js +1 -1
  189. package/dist/esm/gov-form-control.entry.js.map +1 -1
  190. package/dist/esm/gov-form-group.entry.js +7 -1
  191. package/dist/esm/gov-form-group.entry.js.map +1 -1
  192. package/dist/esm/gov-form-input.entry.js +14 -12
  193. package/dist/esm/gov-form-input.entry.js.map +1 -1
  194. package/dist/esm/gov-icon.entry.js +5 -3
  195. package/dist/esm/gov-icon.entry.js.map +1 -1
  196. package/dist/esm/gov-modal.entry.js.map +1 -1
  197. package/dist/esm/gov-prompt.entry.js.map +1 -1
  198. package/dist/esm/gov-spacer.entry.js +2 -2
  199. package/dist/esm/gov-spacer.entry.js.map +1 -1
  200. package/dist/esm/gov-statsbar-item.entry.js +1 -1
  201. package/dist/esm/gov-statsbar.entry.js +4 -4
  202. package/dist/esm/gov-statsbar.entry.js.map +1 -1
  203. package/dist/esm/gov-tabs.entry.js +1 -1
  204. package/dist/esm/gov-tabs.entry.js.map +1 -1
  205. package/dist/esm/loader.js +1 -1
  206. package/dist/hydrate/index.js +210 -404
  207. package/dist/stencil.config.js +1 -2
  208. package/dist/stencil.config.js.map +1 -1
  209. package/dist/types/components/gov-accordion/constants.d.ts +1 -1
  210. package/dist/types/components/gov-accordion/gov-accordion-item.d.ts +1 -19
  211. package/dist/types/components/gov-backdrop/gov-backdrop.d.ts +1 -1
  212. package/dist/types/components/gov-badge/gov-badge.d.ts +3 -8
  213. package/dist/types/components/gov-breadcrumbs/gov-breadcrumbs.d.ts +2 -2
  214. package/dist/types/components/gov-control-group/constants.d.ts +2 -2
  215. package/dist/types/components/gov-control-group/gov-control-group.d.ts +2 -2
  216. package/dist/types/components/gov-form/group/constants.d.ts +5 -0
  217. package/dist/types/components/gov-form/group/gov-form-group.d.ts +5 -1
  218. package/dist/types/components/gov-form/input/gov-form-input.d.ts +5 -4
  219. package/dist/types/components/gov-modal/gov-modal.d.ts +2 -1
  220. package/dist/types/components/gov-promp/gov-prompt.d.ts +2 -1
  221. package/dist/types/components/gov-spacer/constants.d.ts +1 -1
  222. package/dist/types/components/gov-statsbar/gov-statsbar.d.ts +1 -1
  223. package/dist/types/components.d.ts +31 -63
  224. package/dist/types/core/constants/tokens.d.ts +1 -0
  225. package/package.json +2 -2
  226. package/dist/components/p-5bf5a42e.js +0 -2
  227. package/dist/components/p-5bf5a42e.js.map +0 -1
  228. package/dist/components/p-a5d69694.js +0 -2
  229. package/dist/components/p-a5d69694.js.map +0 -1
  230. package/dist/components/p-cd440c95.js.map +0 -1
  231. package/dist/core/p-0eadfb3e.entry.js +0 -2
  232. package/dist/core/p-0eadfb3e.entry.js.map +0 -1
  233. package/dist/core/p-2790d89e.entry.js.map +0 -1
  234. package/dist/core/p-6dacb8d3.entry.js.map +0 -1
  235. package/dist/core/p-7ab82a55.entry.js +0 -2
  236. package/dist/core/p-7ab82a55.entry.js.map +0 -1
  237. package/dist/core/p-9e208f40.entry.js +0 -2
  238. package/dist/core/p-9e208f40.entry.js.map +0 -1
  239. package/dist/core/p-a5d69694.js +0 -2
  240. package/dist/core/p-a5d69694.js.map +0 -1
  241. package/dist/core/p-e86db39c.entry.js +0 -2
  242. package/dist/core/p-e86db39c.entry.js.map +0 -1
  243. package/dist/core/p-f95bca5f.entry.js +0 -2
  244. package/dist/core/p-f95bca5f.entry.js.map +0 -1
  245. package/dist/core/p-f969eec7.entry.js.map +0 -1
  246. /package/dist/components/{p-d305407a.js.map → p-103c7bd5.js.map} +0 -0
  247. /package/dist/components/{p-1020a160.js.map → p-17ebfe85.js.map} +0 -0
  248. /package/dist/components/{p-ec26407a.js.map → p-7bea2390.js.map} +0 -0
  249. /package/dist/components/{p-1026d931.js.map → p-c0e49b09.js.map} +0 -0
  250. /package/dist/components/{p-80b2c231.js.map → p-db22f9ce.js.map} +0 -0
  251. /package/dist/core/{p-a857915f.entry.js.map → p-0c769f1a.entry.js.map} +0 -0
  252. /package/dist/core/{p-1020a160.js.map → p-17ebfe85.js.map} +0 -0
  253. /package/dist/core/{p-3dbf7f49.js.map → p-3bacd021.js.map} +0 -0
  254. /package/dist/core/{p-02c3a3fd.entry.js.map → p-7d680665.entry.js.map} +0 -0
  255. /package/dist/core/{p-1e3cad4b.entry.js.map → p-c81d62db.entry.js.map} +0 -0
@@ -52,7 +52,7 @@ export class GovBreadcrumbs {
52
52
  "optional": false,
53
53
  "docs": {
54
54
  "tags": [],
55
- "text": "Defines wether the components can be collapsible when element doesn't fit in one row."
55
+ "text": "Defines whether the components can be collapsible when element doesn't fit in one row."
56
56
  },
57
57
  "attribute": "collapsible",
58
58
  "reflect": false,
@@ -107,7 +107,7 @@ export class GovBreadcrumbs {
107
107
  "tags": [],
108
108
  "text": "Indicates the id of a component that labels the pagination."
109
109
  },
110
- "attribute": "wcag-labelded-by",
110
+ "attribute": "wcag-labeled-by",
111
111
  "reflect": false
112
112
  }
113
113
  };
@@ -121,7 +121,7 @@ export class GovBreadcrumbs {
121
121
  "composed": true,
122
122
  "docs": {
123
123
  "tags": [],
124
- "text": "Called when the Breadrumbs state changes"
124
+ "text": "Called when the Breadcrumbs state changes"
125
125
  },
126
126
  "complexType": {
127
127
  "original": "GovBreadcrumbsChangeEvent",
@@ -1 +1 @@
1
- {"version":3,"file":"gov-breadcrumbs.js","sourceRoot":"","sources":["../../../../../../src/components/gov-breadcrumbs/gov-breadcrumbs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAA;AAC9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAOpD,MAAM,OAAO,cAAc;EAG1B;uBAQwC,KAAK;sBAIsB,KAAK;;;IAXvE,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAyBD,KAAK,CAAC,kBAAkB;IACvB,IAAI,uBAAuB,EAAE,EAAE;MAC9B,MAAM,KAAK,CAAC,GAAG,CAAC,CAAA;MAChB,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;KACzB;EACF,CAAC;EAED,MAAM;IACL,OAAO,CACN,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC;MACjD,yBAAiB,IAAI,CAAC,SAAS,qBAAmB,IAAI,CAAC,cAAc;QACpE,eAAO,CACF,CACA,CACP,CAAA;EACF,CAAC;EAGD;;KAEG;EAEH,KAAK,CAAC,YAAY;IACjB,iBAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAA;EAC9E,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, h, Host, Method, Prop, Event, EventEmitter } from '@stencil/core'\nimport { BreadcrumbsClass } from './constants'\nimport { validateWcagLabel } from '../../helpers/Validate/wcag'\nimport { canValidateWcagOnRender } from '../../helpers/Dom/win'\nimport { delay } from '../../utils/utils'\nimport { GovBreadcrumbsChangeEvent } from './gov-breadcrumbs.d'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-breadcrumbs',\n\tstyleUrl: 'gov-breadcrumbs.scss',\n})\nexport class GovBreadcrumbs {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() readonly host: HTMLGovBreadcrumbsElement\n\t/**\n\t * Defines wether the components can be collapsible when element doesn't fit in one row.\n\t */\n\t@Prop() readonly collapsible: boolean = false\n\t/**\n\t * Defines whether the breadcrumbs are open or closed by default\n\t */\n\t@Prop({ attribute: 'is-expanded' }) readonly isExpanded: boolean = false\n\t/**\n\t * Adds accessible label for the pagination that is only shown for screen readers.\n\t */\n\t@Prop({ attribute: 'wcag-label' }) readonly wcagLabel: string\n\t/**\n\t * Indicates the id of a component that labels the pagination.\n\t */\n\t@Prop({ attribute: 'wcag-labelded-by' }) readonly wcagLabelledBy: string\n\n\t/**\n\t * Called when the Breadrumbs state changes\n\t */\n\t@Event({ eventName: 'gov-change' }) govChange: EventEmitter<GovBreadcrumbsChangeEvent>\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={this.h.classes(BreadcrumbsClass.root)}>\n\t\t\t\t<nav aria-label={this.wcagLabel} aria-labelledby={this.wcagLabelledBy}>\n\t\t\t\t\t<slot/>\n\t\t\t\t</nav>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagLabel(this.wcagLabel, this.wcagLabelledBy, BreadcrumbsClass.root)\n\t}\n}\n"]}
1
+ {"version":3,"file":"gov-breadcrumbs.js","sourceRoot":"","sources":["../../../../../../src/components/gov-breadcrumbs/gov-breadcrumbs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAA;AAC9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAOpD,MAAM,OAAO,cAAc;EAG1B;uBAQwC,KAAK;sBAIsB,KAAK;;;IAXvE,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAyBD,KAAK,CAAC,kBAAkB;IACvB,IAAI,uBAAuB,EAAE,EAAE;MAC9B,MAAM,KAAK,CAAC,GAAG,CAAC,CAAA;MAChB,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;KACzB;EACF,CAAC;EAED,MAAM;IACL,OAAO,CACN,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC;MACjD,yBAAiB,IAAI,CAAC,SAAS,qBAAmB,IAAI,CAAC,cAAc;QACpE,eAAO,CACF,CACA,CACP,CAAA;EACF,CAAC;EAGD;;KAEG;EAEH,KAAK,CAAC,YAAY;IACjB,iBAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAA;EAC9E,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, h, Host, Method, Prop, Event, EventEmitter } from '@stencil/core'\nimport { BreadcrumbsClass } from './constants'\nimport { validateWcagLabel } from '../../helpers/Validate/wcag'\nimport { canValidateWcagOnRender } from '../../helpers/Dom/win'\nimport { delay } from '../../utils/utils'\nimport { GovBreadcrumbsChangeEvent } from './gov-breadcrumbs.d'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\ttag: 'gov-breadcrumbs',\n\tstyleUrl: 'gov-breadcrumbs.scss',\n})\nexport class GovBreadcrumbs {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() readonly host: HTMLGovBreadcrumbsElement\n\t/**\n\t * Defines whether the components can be collapsible when element doesn't fit in one row.\n\t */\n\t@Prop() readonly collapsible: boolean = false\n\t/**\n\t * Defines whether the breadcrumbs are open or closed by default\n\t */\n\t@Prop({ attribute: 'is-expanded' }) readonly isExpanded: boolean = false\n\t/**\n\t * Adds accessible label for the pagination that is only shown for screen readers.\n\t */\n\t@Prop({ attribute: 'wcag-label' }) readonly wcagLabel: string\n\t/**\n\t * Indicates the id of a component that labels the pagination.\n\t */\n\t@Prop({ attribute: 'wcag-labeled-by' }) readonly wcagLabelledBy: string\n\n\t/**\n\t * Called when the Breadcrumbs state changes\n\t */\n\t@Event({ eventName: 'gov-change' }) govChange: EventEmitter<GovBreadcrumbsChangeEvent>\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={this.h.classes(BreadcrumbsClass.root)}>\n\t\t\t\t<nav aria-label={this.wcagLabel} aria-labelledby={this.wcagLabelledBy}>\n\t\t\t\t\t<slot/>\n\t\t\t\t</nav>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagLabel(this.wcagLabel, this.wcagLabelledBy, BreadcrumbsClass.root)\n\t}\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { Variants } from "../../core/constants/variants";
2
2
  import { pick } from "../../utils/utils";
3
- export const ControlGroups = pick(Variants, ['PRIMARY', 'SECONDARY']);
3
+ export const ControlGroupVariants = pick(Variants, ['PRIMARY', 'SECONDARY']);
4
4
  export const ControlGroupClass = {
5
5
  root: 'gov-control-group',
6
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../src/components/gov-control-group/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AAExD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAExC,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAA;AAGrE,MAAM,CAAC,MAAM,iBAAiB,GAAG;EAChC,IAAI,EAAE,mBAAmB;CACzB,CAAA","sourcesContent":["import { Variants } from '../../core/constants/variants'\nimport { ValueOf } from '../../types/interfaces'\nimport { pick } from '../../utils/utils'\n\nexport const ControlGroups = pick(Variants, ['PRIMARY', 'SECONDARY'])\nexport type ControlGroupType = `${ValueOf<typeof ControlGroups>}`\n\nexport const ControlGroupClass = {\n\troot: 'gov-control-group',\n}\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../src/components/gov-control-group/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AAExD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAExC,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAA;AAG5E,MAAM,CAAC,MAAM,iBAAiB,GAAG;EAChC,IAAI,EAAE,mBAAmB;CACzB,CAAA","sourcesContent":["import { Variants } from '../../core/constants/variants'\nimport { ValueOf } from '../../types/interfaces'\nimport { pick } from '../../utils/utils'\n\nexport const ControlGroupVariants = pick(Variants, ['PRIMARY', 'SECONDARY'])\nexport type ControlGroupVariantType = `${ValueOf<typeof ControlGroupVariants>}`\n\nexport const ControlGroupClass = {\n\troot: 'gov-control-group',\n}\n"]}
@@ -33,13 +33,13 @@ export class GovControlGroup {
33
33
  "type": "string",
34
34
  "mutable": false,
35
35
  "complexType": {
36
- "original": "ControlGroupType",
36
+ "original": "ControlGroupVariantType",
37
37
  "resolved": "\"primary\" | \"secondary\"",
38
38
  "references": {
39
- "ControlGroupType": {
39
+ "ControlGroupVariantType": {
40
40
  "location": "import",
41
41
  "path": "./constants",
42
- "id": "../../../packages/core/src/components/gov-control-group/constants.ts::ControlGroupType"
42
+ "id": "../../../packages/core/src/components/gov-control-group/constants.ts::ControlGroupVariantType"
43
43
  }
44
44
  }
45
45
  },
@@ -1 +1 @@
1
- {"version":3,"file":"gov-control-group.js","sourceRoot":"","sources":["../../../../../../src/components/gov-control-group/gov-control-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAoB,MAAM,aAAa,CAAA;AAMjE,MAAM,OAAO,eAAe;EAG3B;mBAQ6C,QAAQ,CAAC,OAAO;oBAIE,KAAK;IAXnE,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAaD,eAAe,CAAC,QAAgB;IAC/B,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAA;EACzD,CAAC;EAED,MAAM;IACL,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAA;IACjE,OAAO,CACN,EAAC,IAAI,IACJ,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,EACzD,OAAO,EAAE,IAAI,CAAC,OAAO;MACrB,eAAQ,CACF,CACP,CAAA;EACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, h, Host, Prop, Watch } from \"@stencil/core\"\nimport { Variants } from \"../../core/constants/variants\"\nimport { govHost } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { validateProp } from \"../../helpers/Validate/props\"\nimport { ControlGroupClass, ControlGroupType } from \"./constants\"\n\n@Component({\n\ttag: \"gov-control-group\",\n\tstyleUrl: \"gov-control-group.scss\",\n})\nexport class GovControlGroup {\n\tprivate readonly h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovControlGroupElement\n\t/**\n\t * Style variation of the content message.\n\t */\n\t@Prop() readonly variant: ControlGroupType = Variants.PRIMARY\n\t/**\n\t * Specifies the display of the border between elements\n\t */\n\t@Prop({ attribute: \"no-border\" }) readonly noBorder: boolean = false\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(Variants, newValue, ControlGroupClass.root)\n\t}\n\n\trender() {\n\t\tconst noBorder = this.noBorder === true ? \"no-border\" : undefined\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={this.h.classes([ControlGroupClass.root, noBorder])}\n\t\t\t\tvariant={this.variant}>\n\t\t\t\t<slot />\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"]}
1
+ {"version":3,"file":"gov-control-group.js","sourceRoot":"","sources":["../../../../../../src/components/gov-control-group/gov-control-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAA2B,MAAM,aAAa,CAAA;AAMxE,MAAM,OAAO,eAAe;EAG3B;mBAQoD,QAAQ,CAAC,OAAO;oBAIL,KAAK;IAXnE,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAaD,eAAe,CAAC,QAAgB;IAC/B,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAA;EACzD,CAAC;EAED,MAAM;IACL,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAA;IACjE,OAAO,CACN,EAAC,IAAI,IACJ,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,EACzD,OAAO,EAAE,IAAI,CAAC,OAAO;MACrB,eAAQ,CACF,CACP,CAAA;EACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, h, Host, Prop, Watch } from \"@stencil/core\"\nimport { Variants } from \"../../core/constants/variants\"\nimport { govHost } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { validateProp } from \"../../helpers/Validate/props\"\nimport { ControlGroupClass, ControlGroupVariantType } from \"./constants\"\n\n@Component({\n\ttag: \"gov-control-group\",\n\tstyleUrl: \"gov-control-group.scss\",\n})\nexport class GovControlGroup {\n\tprivate readonly h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovControlGroupElement\n\t/**\n\t * Style variation of the content message.\n\t */\n\t@Prop() readonly variant: ControlGroupVariantType = Variants.PRIMARY\n\t/**\n\t * Specifies the display of the border between elements\n\t */\n\t@Prop({ attribute: \"no-border\" }) readonly noBorder: boolean = false\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(Variants, newValue, ControlGroupClass.root)\n\t}\n\n\trender() {\n\t\tconst noBorder = this.noBorder === true ? \"no-border\" : undefined\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={this.h.classes([ControlGroupClass.root, noBorder])}\n\t\t\t\tvariant={this.variant}>\n\t\t\t\t<slot />\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"]}
@@ -248,19 +248,19 @@
248
248
  .gov-form-control[type=file] .gov-form-control__bottom {
249
249
  margin: 0.5rem 0rem 0rem;
250
250
  }
251
- .gov-form-control[size=xs][type=checkbox] .gov-form-control__bottom, .gov-form-control[size=xs][type=radio] .gov-form-control__bottom {
251
+ .gov-form-control[size=xs][type=checkbox] .gov-form-control__holder > .gov-form-control__bottom, .gov-form-control[size=xs][type=radio] .gov-form-control__holder > .gov-form-control__bottom {
252
252
  margin-top: var(--gov-form-checkbox-core-xs-message-gap, 0.5rem);
253
253
  margin-left: calc(var(--gov-form-checkbox-core-xs-indicator-size, 1.25rem) + var(--gov-form-checkbox-core-xs-gap, 0.75rem));
254
254
  }
255
- .gov-form-control[size=s][type=checkbox] .gov-form-control__bottom, .gov-form-control[size=s][type=radio] .gov-form-control__bottom {
255
+ .gov-form-control[size=s][type=checkbox] .gov-form-control__holder > .gov-form-control__bottom, .gov-form-control[size=s][type=radio] .gov-form-control__holder > .gov-form-control__bottom {
256
256
  margin-top: var(--gov-form-checkbox-core-s-message-gap, 0.5rem);
257
257
  margin-left: calc(var(--gov-form-checkbox-core-s-indicator-size, 1.375rem) + var(--gov-form-checkbox-core-s-gap, 0.75rem));
258
258
  }
259
- .gov-form-control[size=m][type=checkbox] .gov-form-control__bottom, .gov-form-control[size=m][type=radio] .gov-form-control__bottom {
259
+ .gov-form-control[size=m][type=checkbox] .gov-form-control__holder > .gov-form-control__bottom, .gov-form-control[size=m][type=radio] .gov-form-control__holder > .gov-form-control__bottom {
260
260
  margin-top: var(--gov-form-checkbox-core-m-message-gap, 0.75rem);
261
261
  margin-left: calc(var(--gov-form-checkbox-core-m-indicator-size, 1.5rem) + var(--gov-form-checkbox-core-m-gap, 1rem));
262
262
  }
263
- .gov-form-control[size=l][type=checkbox] .gov-form-control__bottom, .gov-form-control[size=l][type=radio] .gov-form-control__bottom {
263
+ .gov-form-control[size=l][type=checkbox] .gov-form-control__holder > .gov-form-control__bottom, .gov-form-control[size=l][type=radio] .gov-form-control__holder > .gov-form-control__bottom {
264
264
  margin-top: var(--gov-form-checkbox-core-l-message-gap, 0.75rem);
265
265
  margin-left: calc(var(--gov-form-checkbox-core-l-indicator-size, 2rem) + var(--gov-form-checkbox-core-l-gap, 1rem));
266
266
  }
@@ -1,6 +1,11 @@
1
1
  import { pick } from "../../../utils/utils";
2
2
  import { Sizes } from "../../../core/constants/sizes";
3
3
  export const FormGroupSizes = pick(Sizes, ['_2XS', '_XS', '_S', '_M', '_L']);
4
+ export var FormGroupOrientation;
5
+ (function (FormGroupOrientation) {
6
+ FormGroupOrientation["HORIZONTAL"] = "horizontal";
7
+ FormGroupOrientation["VERTICAL"] = "vertical";
8
+ })(FormGroupOrientation || (FormGroupOrientation = {}));
4
9
  export const FormGroupClass = {
5
10
  root: 'gov-form-group',
6
11
  };
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/group/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAA;AAGrD,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;AAG5E,MAAM,CAAC,MAAM,cAAc,GAAG;EAC7B,IAAI,EAAE,gBAAgB;CACtB,CAAA","sourcesContent":["import { pick } from \"../../../utils/utils\"\nimport { Sizes } from \"../../../core/constants/sizes\"\nimport { ValueOf } from \"../../../types/interfaces\"\n\nexport const FormGroupSizes = pick(Sizes, ['_2XS', '_XS', '_S', '_M', '_L'])\nexport type FormGroupSizesType = `${ValueOf<typeof FormGroupSizes>}`\n\nexport const FormGroupClass = {\n\troot: 'gov-form-group',\n}\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/group/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAA;AAGrD,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;AAG5E,MAAM,CAAN,IAAY,oBAGX;AAHD,WAAY,oBAAoB;EAC/B,iDAAyB,CAAA;EACzB,6CAAqB,CAAA;AACtB,CAAC,EAHW,oBAAoB,KAApB,oBAAoB,QAG/B;AAGD,MAAM,CAAC,MAAM,cAAc,GAAG;EAC7B,IAAI,EAAE,gBAAgB;CACtB,CAAA","sourcesContent":["import { pick } from \"../../../utils/utils\"\nimport { Sizes } from \"../../../core/constants/sizes\"\nimport { ValueOf } from \"../../../types/interfaces\"\n\nexport const FormGroupSizes = pick(Sizes, ['_2XS', '_XS', '_S', '_M', '_L'])\nexport type FormGroupSizesType = `${ValueOf<typeof FormGroupSizes>}`\n\nexport enum FormGroupOrientation {\n\tHORIZONTAL = 'horizontal',\n\tVERTICAL = 'vertical',\n}\nexport type FormGroupOrientationType = `${ValueOf<typeof FormGroupOrientation>}`\n\nexport const FormGroupClass = {\n\troot: 'gov-form-group',\n}\n"]}
@@ -231,7 +231,7 @@
231
231
  flex-direction: column;
232
232
  align-items: flex-start;
233
233
  }
234
- .gov-form-group .gov-form-label .gov-form-label__label {
234
+ .gov-form-group .gov-form-label__label {
235
235
  margin: 0;
236
236
  }
237
237
  .gov-form-group[gap="2xs"] {
@@ -248,4 +248,11 @@
248
248
  }
249
249
  .gov-form-group[gap=l] {
250
250
  gap: 1.25rem;
251
+ }
252
+ .gov-form-group[orientation=horizontal] {
253
+ flex-direction: row;
254
+ flex-wrap: wrap;
255
+ }
256
+ .gov-form-group[orientation=horizontal] .gov-form-label__label {
257
+ white-space: nowrap;
251
258
  }
@@ -5,6 +5,7 @@ import { validateProp } from "../../../helpers/Validate/props";
5
5
  export class GovFormGroup {
6
6
  constructor() {
7
7
  this.gap = undefined;
8
+ this.orientation = 'vertical';
8
9
  this.h = govHost(this.host);
9
10
  }
10
11
  validateGap(newValue) {
@@ -52,6 +53,30 @@ export class GovFormGroup {
52
53
  "attribute": "gap",
53
54
  "reflect": false,
54
55
  "defaultValue": "undefined"
56
+ },
57
+ "orientation": {
58
+ "type": "string",
59
+ "mutable": false,
60
+ "complexType": {
61
+ "original": "FormGroupOrientationType",
62
+ "resolved": "\"horizontal\" | \"vertical\"",
63
+ "references": {
64
+ "FormGroupOrientationType": {
65
+ "location": "import",
66
+ "path": "./constants",
67
+ "id": "../../../packages/core/src/components/gov-form/group/constants.ts::FormGroupOrientationType"
68
+ }
69
+ }
70
+ },
71
+ "required": false,
72
+ "optional": true,
73
+ "docs": {
74
+ "tags": [],
75
+ "text": "Elements orientation"
76
+ },
77
+ "attribute": "orientation",
78
+ "reflect": false,
79
+ "defaultValue": "'vertical'"
55
80
  }
56
81
  };
57
82
  }
@@ -1 +1 @@
1
- {"version":3,"file":"gov-form-group.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/group/gov-form-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACxE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAsB,MAAM,aAAa,CAAA;AAEhF,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAM9D,MAAM,OAAO,YAAY;EAGxB;eAQ4C,SAAS;IAPpD,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EASD,WAAW,CAAC,QAAgB;IAC3B,YAAY,CAAC,cAAc,EAAE,QAAQ,EAAE,cAAc,CAAC,IAAI,CAAC,CAAA;EAC5D,CAAC;EAED,iBAAiB;IAChB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;EAC3B,CAAC;EAED,MAAM;IACL,OAAO,CACN,EAAC,IAAI,IAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC;MAC9D,eAAa,CACP,CACP,CAAA;EACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, h, Host, Prop, Watch } from \"@stencil/core\"\nimport { FormGroupClass, FormGroupSizes, FormGroupSizesType } from \"./constants\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { govHost } from \"../../../helpers/Dom/template\"\nimport { validateProp } from \"../../../helpers/Validate/props\"\n\n@Component({\n\ttag: \"gov-form-group\",\n\tstyleUrl: \"gov-form-group.scss\",\n})\nexport class GovFormGroup {\n\tprivate readonly h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovFormGroupElement\n\t/**\n\t * Gap's size.\n\t */\n\t@Prop() readonly gap?: FormGroupSizesType = undefined\n\n\t@Watch(\"gap\")\n\tvalidateGap(newValue: string): void {\n\t\tvalidateProp(FormGroupSizes, newValue, FormGroupClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateGap(this.gap)\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host gap={this.gap} class={this.h.classes(FormGroupClass.root)}>\n\t\t\t\t<slot></slot>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"]}
1
+ {"version":3,"file":"gov-form-group.js","sourceRoot":"","sources":["../../../../../../../src/components/gov-form/group/gov-form-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACxE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAgD,MAAM,aAAa,CAAA;AAE1G,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAM9D,MAAM,OAAO,YAAY;EAGxB;eAQ4C,SAAS;uBAIK,UAAU;IAXnE,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAaD,WAAW,CAAC,QAAgB;IAC3B,YAAY,CAAC,cAAc,EAAE,QAAQ,EAAE,cAAc,CAAC,IAAI,CAAC,CAAA;EAC5D,CAAC;EAED,iBAAiB;IAChB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;EAC3B,CAAC;EAED,MAAM;IACL,OAAO,CACN,EAAC,IAAI,IAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC;MAC9D,eAAa,CACP,CACP,CAAA;EACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, h, Host, Prop, Watch } from \"@stencil/core\"\nimport { FormGroupClass, FormGroupSizes, FormGroupSizesType, FormGroupOrientationType } from \"./constants\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { govHost } from \"../../../helpers/Dom/template\"\nimport { validateProp } from \"../../../helpers/Validate/props\"\n\n@Component({\n\ttag: \"gov-form-group\",\n\tstyleUrl: \"gov-form-group.scss\",\n})\nexport class GovFormGroup {\n\tprivate readonly h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\n\t@Element() host: HTMLGovFormGroupElement\n\t/**\n\t * Gap's size.\n\t */\n\t@Prop() readonly gap?: FormGroupSizesType = undefined\n\t/**\n\t * Elements orientation\n\t */\n\t@Prop() readonly orientation?: FormGroupOrientationType = 'vertical'\n\n\t@Watch(\"gap\")\n\tvalidateGap(newValue: string): void {\n\t\tvalidateProp(FormGroupSizes, newValue, FormGroupClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateGap(this.gap)\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host gap={this.gap} class={this.h.classes(FormGroupClass.root)}>\n\t\t\t\t<slot></slot>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Host, h } from "@stencil/core";
1
+ import { h, Host } from "@stencil/core";
2
2
  import { govForm } from "../../../helpers/Dom/form";
3
3
  import { govHost, toBoolAttr, toBoolAttrIfDefined, toOnOffAttrIfDefined } from "../../../helpers/Dom/template";
4
4
  import { canValidateWcagOnRender } from "../../../helpers/Dom/win";
@@ -6,7 +6,7 @@ import { validateProp } from "../../../helpers/Validate/props";
6
6
  import { validateWcagLabelFor, validateWcagRef } from "../../../helpers/Validate/wcag";
7
7
  import { createID } from "../../../utils/string.utils";
8
8
  import { delay } from "../../../utils/utils";
9
- import { FormInputClass, FormInputSizes, FormInputVariants } from "./constants";
9
+ import { FormInputClass, FormInputSizes, FormInputVariants, } from "./constants";
10
10
  var Tags;
11
11
  (function (Tags) {
12
12
  Tags["INPUT"] = "input";
@@ -16,9 +16,9 @@ export class GovFormInput {
16
16
  constructor() {
17
17
  this.value = undefined;
18
18
  this.identifier = undefined;
19
- this.variant = 'secondary';
19
+ this.variant = "secondary";
20
20
  this.success = undefined;
21
- this.size = 'm';
21
+ this.size = "m";
22
22
  this.name = undefined;
23
23
  this.multiline = undefined;
24
24
  this.rows = undefined;
@@ -34,7 +34,7 @@ export class GovFormInput {
34
34
  this.autocomplete = undefined;
35
35
  this.autocorrect = undefined;
36
36
  this.type = undefined;
37
- this.inputType = 'text';
37
+ this.inputType = "text";
38
38
  this.role = undefined;
39
39
  this.invalid = undefined;
40
40
  this.wcagDescribedBy = undefined;
@@ -44,7 +44,7 @@ export class GovFormInput {
44
44
  this.wcagExpanded = undefined;
45
45
  this.focused = undefined;
46
46
  this.h = govHost(this.host);
47
- this.inputId = createID('GovInput');
47
+ this.inputId = createID("GovInput");
48
48
  this.f = govForm(this.h);
49
49
  }
50
50
  validateVariant(newValue) {
@@ -60,13 +60,13 @@ export class GovFormInput {
60
60
  this.f.passAttrToControl("size", this.size);
61
61
  this.f.passAttrToControl("disabled", toBoolAttr(this.disabled));
62
62
  this.f.passAttrToControl("invalid", toBoolAttr(this.invalid));
63
- this.f.passAttrToControl('type', this.multiline ? Tags.TEXTAREA : Tags.INPUT);
63
+ this.f.passAttrToControl("type", this.multiline ? Tags.TEXTAREA : Tags.INPUT);
64
64
  }
65
65
  componentWillLoad() {
66
66
  this.validateVariant(this.variant);
67
67
  this.validateSize(this.size);
68
68
  this.passControlAttrs();
69
- this.f.passAttrToLabel('required', String(this.required));
69
+ this.f.passAttrToLabel("required", String(this.required));
70
70
  }
71
71
  async componentDidRender() {
72
72
  if (canValidateWcagOnRender()) {
@@ -76,7 +76,9 @@ export class GovFormInput {
76
76
  }
77
77
  render() {
78
78
  const Tag = this.multiline ? Tags.TEXTAREA : Tags.INPUT;
79
- 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), onKeyDown: this.onKeyDownHandler.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, min: this.min, max: this.max, 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" })));
79
+ 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 &&
80
+ h("gov-icon", { slot: "right-icon", class: "icon-validation", name: "check-lg" }), this.invalid && !this.multiline &&
81
+ 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), onKeyDown: this.onKeyDownHandler.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, min: this.min, max: this.max, 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" })));
80
82
  }
81
83
  onFocusHandler(e) {
82
84
  e.stopPropagation();
@@ -137,8 +139,8 @@ export class GovFormInput {
137
139
  * Clears input value
138
140
  */
139
141
  async clearValue() {
140
- this.value = '';
141
- this.inputRef.value = '';
142
+ this.value = "";
143
+ this.inputRef.value = "";
142
144
  }
143
145
  /**
144
146
  * Returns an instance of the native html input element
@@ -150,9 +152,9 @@ export class GovFormInput {
150
152
  * Validate the WCAG attributes of the component
151
153
  */
152
154
  async validateWcag() {
153
- validateWcagRef(this.wcagDescribedBy, 'wcag-described-by', FormInputClass.root);
154
- validateWcagRef(this.wcagLabelledBy, 'wcag-labelled-by', FormInputClass.root);
155
- validateWcagRef(this.wcagOwns, 'wcag-owns', FormInputClass.root);
155
+ validateWcagRef(this.wcagDescribedBy, "wcag-described-by", FormInputClass.root);
156
+ validateWcagRef(this.wcagLabelledBy, "wcag-labelled-by", FormInputClass.root);
157
+ validateWcagRef(this.wcagOwns, "wcag-owns", FormInputClass.root);
156
158
  validateWcagLabelFor(this.identifier || this.inputId, this.wcagLabelledBy, FormInputClass.root);
157
159
  }
158
160
  static get is() { return "gov-form-input"; }
@@ -224,7 +226,7 @@ export class GovFormInput {
224
226
  },
225
227
  "attribute": "variant",
226
228
  "reflect": false,
227
- "defaultValue": "'secondary'"
229
+ "defaultValue": "\"secondary\""
228
230
  },
229
231
  "success": {
230
232
  "type": "boolean",
@@ -265,7 +267,7 @@ export class GovFormInput {
265
267
  },
266
268
  "attribute": "size",
267
269
  "reflect": false,
268
- "defaultValue": "'m'"
270
+ "defaultValue": "\"m\""
269
271
  },
270
272
  "name": {
271
273
  "type": "string",
@@ -554,15 +556,21 @@ export class GovFormInput {
554
556
  },
555
557
  "attribute": "input-type",
556
558
  "reflect": false,
557
- "defaultValue": "'text'"
559
+ "defaultValue": "\"text\""
558
560
  },
559
561
  "role": {
560
562
  "type": "string",
561
563
  "mutable": false,
562
564
  "complexType": {
563
- "original": "string",
565
+ "original": "Nullable<string>",
564
566
  "resolved": "string",
565
- "references": {}
567
+ "references": {
568
+ "Nullable": {
569
+ "location": "import",
570
+ "path": "../../../types/interfaces",
571
+ "id": "../../../packages/core/src/types/interfaces.ts::Nullable"
572
+ }
573
+ }
566
574
  },
567
575
  "required": false,
568
576
  "optional": false,
@@ -1 +1 @@
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,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAA;AAC5G,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAEnD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, Event, EventEmitter, Host, Method, Prop, State, Watch, h } from '@stencil/core'\nimport { govForm } from '../../../helpers/Dom/form'\nimport { GovForm } from '../../../helpers/Dom/form.types'\nimport { govHost, toBoolAttr, toBoolAttrIfDefined, toOnOffAttrIfDefined } from \"../../../helpers/Dom/template\"\nimport { GovHost } from '../../../helpers/Dom/template.types'\nimport { canValidateWcagOnRender } from '../../../helpers/Dom/win'\nimport { validateProp } from '../../../helpers/Validate/props'\nimport { validateWcagLabelFor, validateWcagRef } from '../../../helpers/Validate/wcag'\nimport { createID } from '../../../utils/string.utils'\nimport { delay } from '../../../utils/utils'\nimport { FormInputClass, FormInputSizes, FormInputSizesType, FormInputVariantType, FormInputVariants, InputType, Type } from './constants'\nimport { FormInputEvent } from './gov-form-input.types'\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 readonly 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(this.h)\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 = 'secondary'\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 * Minimum value that is acceptable and valid for the input containing the attribute\n\t */\n\t@Prop() readonly min?: string | number\n\t/**\n\t * Maximum value that is acceptable and valid for the input containing the attribute\n\t */\n\t@Prop() readonly max?: string | 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<FormInputEvent>\n\t/**\n\t * Emitted when the input loses focus.\n\t */\n\t@Event({ eventName: 'gov-blur' }) govBlur: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: 'gov-input' }) govInput: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: 'gov-keyup' }) govKeyUp: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: 'gov-keydown' }) govKeyDown: EventEmitter<FormInputEvent>\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\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\t@Watch(\"type\")\n\t@Watch(\"size\")\n\twatchDisabled(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"size\", this.size)\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl('type', this.multiline ? Tags.TEXTAREA : Tags.INPUT)\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t\tthis.passControlAttrs()\n\n\t\tthis.f.passAttrToLabel('required', String(this.required))\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\tonKeyDown={this.onKeyDownHandler.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\tmin={this.min}\n\t\t\t\t\t\tmax={this.max}\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\tthis.focused = true\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.focused = false\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onKeyUpHandler(e: KeyboardEvent) {\n\t\te.stopPropagation()\n\t\tthis.govKeyUp.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onKeyDownHandler(e: KeyboardEvent) {\n\t\te.stopPropagation()\n\t\tthis.govKeyDown.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\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({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.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 getRef(): 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,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAC5G,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAEnD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAA;AAE9G,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAC5C,OAAO,EACN,cAAc,EACd,cAAc,EAEd,iBAAiB,EAGjB,IAAI,GACJ,MAAM,aAAa,CAAA;AAIpB,IAAK,IAGJ;AAHD,WAAK,IAAI;EAC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AAC,IAAI,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,CAAC,IAAI,CAAC,CAAA;IAChE,oBAAoB,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,IAAI,CAAC,CAAA;EAChG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from \"@stencil/core\"\nimport { govForm } from \"../../../helpers/Dom/form\"\nimport { GovForm } from \"../../../helpers/Dom/form.types\"\nimport { govHost, toBoolAttr, toBoolAttrIfDefined, toOnOffAttrIfDefined } from \"../../../helpers/Dom/template\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { canValidateWcagOnRender } from \"../../../helpers/Dom/win\"\nimport { validateProp } from \"../../../helpers/Validate/props\"\nimport { validateWcagLabelFor, validateWcagRef } from \"../../../helpers/Validate/wcag\"\nimport { createID } from \"../../../utils/string.utils\"\nimport { delay } from \"../../../utils/utils\"\nimport {\n\tFormInputClass,\n\tFormInputSizes,\n\tFormInputSizesType,\n\tFormInputVariants,\n\tFormInputVariantType,\n\tInputType,\n\tType,\n} from \"./constants\"\nimport { FormInputEvent } from \"./gov-form-input.types\"\nimport { Nullable } from \"../../../types/interfaces\"\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 readonly 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(this.h)\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 = \"secondary\"\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 * Minimum value that is acceptable and valid for the input containing the attribute\n\t */\n\t@Prop() readonly min?: string | number\n\t/**\n\t * Maximum value that is acceptable and valid for the input containing the attribute\n\t */\n\t@Prop() readonly max?: string | 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: Nullable<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<FormInputEvent>\n\t/**\n\t * Emitted when the input loses focus.\n\t */\n\t@Event({ eventName: \"gov-blur\" }) govBlur: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: \"gov-input\" }) govInput: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: \"gov-keyup\" }) govKeyUp: EventEmitter<FormInputEvent>\n\t/**\n\t * Emitted when the input change value.\n\t */\n\t@Event({ eventName: \"gov-keydown\" }) govKeyDown: EventEmitter<FormInputEvent>\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\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\n\t@Watch(\"type\")\n\t@Watch(\"size\")\n\twatchDisabled(): void {\n\t\tthis.passControlAttrs()\n\t}\n\n\tprivate passControlAttrs() {\n\t\tthis.f.passAttrToControl(\"size\", this.size)\n\t\tthis.f.passAttrToControl(\"disabled\", toBoolAttr(this.disabled))\n\t\tthis.f.passAttrToControl(\"invalid\", toBoolAttr(this.invalid))\n\t\tthis.f.passAttrToControl(\"type\", this.multiline ? Tags.TEXTAREA : Tags.INPUT)\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t\tthis.passControlAttrs()\n\n\t\tthis.f.passAttrToLabel(\"required\", String(this.required))\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 &&\n\t\t\t\t\t\t\t\t\t\t\t<gov-icon slot=\"right-icon\" class=\"icon-validation\" name=\"check-lg\"></gov-icon>}\n\t\t\t\t\t{this.invalid && !this.multiline &&\n\t\t\t\t\t\t\t\t\t\t\t<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\tonKeyDown={this.onKeyDownHandler.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\tmin={this.min}\n\t\t\t\t\t\tmax={this.max}\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\tthis.focused = true\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.focused = false\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onKeyUpHandler(e: KeyboardEvent) {\n\t\te.stopPropagation()\n\t\tthis.govKeyUp.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\tprivate onKeyDownHandler(e: KeyboardEvent) {\n\t\te.stopPropagation()\n\t\tthis.govKeyDown.emit({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\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({\n\t\t\tcomponent: FormInputClass.root,\n\t\t\tvalue: this.value,\n\t\t\toriginalEvent: e,\n\t\t})\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.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 getRef(): 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"]}
@@ -46,8 +46,10 @@ export class GovIcon {
46
46
  this.intersectionObserver = new IntersectionObserver(entries => {
47
47
  entries.forEach(entry => {
48
48
  if (entry.isIntersecting) {
49
- this.intersectionObserver.disconnect();
50
- this.intersectionObserver = null;
49
+ if (this.intersectionObserver) {
50
+ this.intersectionObserver.disconnect();
51
+ this.intersectionObserver = null;
52
+ }
51
53
  callback();
52
54
  }
53
55
  });
@@ -1 +1 @@
1
- {"version":3,"file":"gov-icon.js","sourceRoot":"","sources":["../../../../../../src/components/gov-icon/gov-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACtF,OAAO,EAAE,SAAS,EAAQ,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAQpD,MAAM,OAAO,OAAO;EAGnB;gBAOuB,IAAI;gBAIN,OAAO;;mBAED,KAAK;iBACP,KAAK;IAb7B,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;GAC3B;EAgBO,KAAK,CAAC,gBAAgB;IAC7B,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,IAAI,CAAA;IACpC,IAAI,CAAC,KAAK,CAAC,SAAS,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE;MAC1C,OAAM;KACN;I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AC7C,CAAC;EAED,MAAM;IACL,IAAI,IAAI,CAAC,KAAK,EAAE;MACf,OAAO,IAAI,CAAA;KACX;IACD,OAAO,CACN,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;MAC1C,YAAM,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,QAAQ,GAAS,CAC1D,CACP,CAAA;EACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Build, Component, Element, h, Prop, State, Watch, Host } from '@stencil/core'\nimport { IconClass, Type } from './constants'\nimport { fetchIcon } from '../../utils/icon.utils'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\tassetsDirs: ['assets'],\n\tstyleUrl: 'gov-icon.scss',\n\ttag: 'gov-icon',\n})\nexport class GovIcon {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\t@Element() host: HTMLGovIconElement\n\t/**\n\t * Name of icon\n\t */\n\t@Prop() name: string = null\n\t/**\n\t * Type of icon\n\t */\n\t@Prop() type: Type = 'basic'\n\t@State() private iconData: string\n\t@State() private visible = false\n\t@State() private error = false\n\tprivate intersectionObserver: IntersectionObserver\n\n\t@Watch('name')\n\tprivate async loadIconPathData(): Promise<void> {\n\t\tconst { name, visible, type } = this\n\t\tif (!Build.isBrowser || !name || !visible) {\n\t\t\treturn\n\t\t}\n\t\ttry {\n\t\t\tthis.iconData = await fetchIcon({ name, type })\n\t\t} catch (e) {\n\t\t\tthis.error = true\n\t\t}\n\t}\n\n\tconnectedCallback(): void {\n\t\tthis.waitUntilVisible(async () => {\n\t\t\tthis.visible = true\n\t\t\tawait this.loadIconPathData()\n\t\t})\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tif (this.intersectionObserver) {\n\t\t\tthis.intersectionObserver.disconnect()\n\t\t\tthis.intersectionObserver = null\n\t\t}\n\t}\n\n\tasync componentWillLoad(): Promise<void> {\n\t\tawait this.loadIconPathData()\n\t}\n\n\tprivate waitUntilVisible(callback: () => void): void {\n\t\tif (!Build.isBrowser || typeof window === 'undefined' || !(window as any).IntersectionObserver) {\n\t\t\tcallback()\n\t\t\treturn\n\t\t}\n\t\tthis.intersectionObserver = new IntersectionObserver(\n\t\t\tentries => {\n\t\t\t\tentries.forEach(entry => {\n\t\t\t\t\tif (entry.isIntersecting) {\n\t\t\t\t\t\tthis.intersectionObserver.disconnect()\n\t\t\t\t\t\tthis.intersectionObserver = null\n\t\t\t\t\t\tcallback()\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t},\n\t\t\t{ rootMargin: '50px' }\n\t\t)\n\t\tthis.intersectionObserver.observe(this.host)\n\t}\n\n\trender() {\n\t\tif (this.error) {\n\t\t\treturn null\n\t\t}\n\t\treturn (\n\t\t\t<Host class={this.h.classes(IconClass.root)}>\n\t\t\t\t<span class={IconClass.holder} innerHTML={this.iconData}></span>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"]}
1
+ {"version":3,"file":"gov-icon.js","sourceRoot":"","sources":["../../../../../../src/components/gov-icon/gov-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACtF,OAAO,EAAE,SAAS,EAAQ,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAQpD,MAAM,OAAO,OAAO;EAGnB;gBAOuB,IAAI;gBAIN,OAAO;;mBAED,KAAK;iBACP,KAAK;IAb7B,IAAI,CAAC,CAAC,GAAG,OAAO,CA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C7B,IAAI,CAAC,oBAAoB,CAAC,UAAU,EAAE,CAAA;YACtC,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAA;WAChC;UACD,QAAQ,EAAE,CAAA;SACV;MACF,CAAC,CAAC,CAAA;IACH,CAAC,EACD,EAAE,UAAU,EAAE,MAAM,EAAE,CACtB,CAAA;IACD,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;EAC7C,CAAC;EAED,MAAM;IACL,IAAI,IAAI,CAAC,KAAK,EAAE;MACf,OAAO,IAAI,CAAA;KACX;IACD,OAAO,CACN,EAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;MAC1C,YAAM,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,QAAQ,GAAS,CAC1D,CACP,CAAA;EACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Build, Component, Element, h, Prop, State, Watch, Host } from '@stencil/core'\nimport { IconClass, Type } from './constants'\nimport { fetchIcon } from '../../utils/icon.utils'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\n\n@Component({\n\tassetsDirs: ['assets'],\n\tstyleUrl: 'gov-icon.scss',\n\ttag: 'gov-icon',\n})\nexport class GovIcon {\n\tprivate h: GovHost\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t}\n\t@Element() host: HTMLGovIconElement\n\t/**\n\t * Name of icon\n\t */\n\t@Prop() name: string = null\n\t/**\n\t * Type of icon\n\t */\n\t@Prop() type: Type = 'basic'\n\t@State() private iconData: string\n\t@State() private visible = false\n\t@State() private error = false\n\tprivate intersectionObserver: IntersectionObserver\n\n\t@Watch('name')\n\tprivate async loadIconPathData(): Promise<void> {\n\t\tconst { name, visible, type } = this\n\t\tif (!Build.isBrowser || !name || !visible) {\n\t\t\treturn\n\t\t}\n\t\ttry {\n\t\t\tthis.iconData = await fetchIcon({ name, type })\n\t\t} catch (e) {\n\t\t\tthis.error = true\n\t\t}\n\t}\n\n\tconnectedCallback(): void {\n\t\tthis.waitUntilVisible(async () => {\n\t\t\tthis.visible = true\n\t\t\tawait this.loadIconPathData()\n\t\t})\n\t}\n\n\tdisconnectedCallback(): void {\n\t\tif (this.intersectionObserver) {\n\t\t\tthis.intersectionObserver.disconnect()\n\t\t\tthis.intersectionObserver = null\n\t\t}\n\t}\n\n\tasync componentWillLoad(): Promise<void> {\n\t\tawait this.loadIconPathData()\n\t}\n\n\tprivate waitUntilVisible(callback: () => void): void {\n\t\tif (!Build.isBrowser || typeof window === 'undefined' || !(window as any).IntersectionObserver) {\n\t\t\tcallback()\n\t\t\treturn\n\t\t}\n\t\tthis.intersectionObserver = new IntersectionObserver(\n\t\t\tentries => {\n\t\t\t\tentries.forEach(entry => {\n\t\t\t\t\tif (entry.isIntersecting) {\n\t\t\t\t\t\tif(this.intersectionObserver) {\n\t\t\t\t\t\t\tthis.intersectionObserver.disconnect()\n\t\t\t\t\t\t\tthis.intersectionObserver = null\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcallback()\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t},\n\t\t\t{ rootMargin: '50px' }\n\t\t)\n\t\tthis.intersectionObserver.observe(this.host)\n\t}\n\n\trender() {\n\t\tif (this.error) {\n\t\t\treturn null\n\t\t}\n\t\treturn (\n\t\t\t<Host class={this.h.classes(IconClass.root)}>\n\t\t\t\t<span class={IconClass.holder} innerHTML={this.iconData}></span>\n\t\t\t</Host>\n\t\t)\n\t}\n}\n"]}
@@ -133,9 +133,15 @@ export class GovModal {
133
133
  "type": "string",
134
134
  "mutable": false,
135
135
  "complexType": {
136
- "original": "string",
136
+ "original": "Nullable<string>",
137
137
  "resolved": "string",
138
- "references": {}
138
+ "references": {
139
+ "Nullable": {
140
+ "location": "import",
141
+ "path": "../../types/interfaces",
142
+ "id": "../../../packages/core/src/types/interfaces.ts::Nullable"
143
+ }
144
+ }
139
145
  },
140
146
  "required": false,
141
147
  "optional": false,
@@ -1 +1 @@
1
- {"version":3,"file":"gov-modal.js","sourceRoot":"","sources":["../../../../../../src/components/gov-modal/gov-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAA;AACrG,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAEhE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAMxC,MAAM,OAAO,QAAQ;EAKpB;gBAW8B,KAAK;;gBAQC,QAAQ;oBAIkB,IAAI;;;;;IAtBjE,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3B,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAA;IACxC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAAA;GAC5C;EA0CD,gBAAgB,CAAC,QAAgB;IAChC,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;IACtD,IAAI,QAAQ,EAAE;MACb,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,QAA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IAAI,CACF,CACP,CAAA;EACF,CAAC;EAEO,cAAc,CAAC,CAAe;IACrC,CAAC,CAAC,eAAe,EAAE,CAAA;IACnB,IAAI,CAAC,SAAS,EAAE,CAAA;IAChB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;EACtB,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,IAAI;IACT,IAAI,CAAC,SAAS,EAAE,CAAA;EACjB,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,IAAI;IACT,IAAI,CAAC,SAAS,EAAE,CAAA;EACjB,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,YAAY;IACjB,eAAe,CAAC,IAAI,CAAC,cAAc,EAAE,kBAAkB,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;IACzE,eAAe,CAAC,IAAI,CAAC,eAAe,EAAE,mBAAmB,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;EAC5E,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, Event, EventEmitter, Host, Method, Prop, Watch, h } from \"@stencil/core\"\nimport { govHost, toBoolAttr } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { canValidateWcagOnRender } from \"../../helpers/Dom/win\"\nimport { govErrorLog } from \"../../helpers/Log/gov.log\"\nimport { validateWcagRef } from \"../../helpers/Validate/wcag\"\nimport { createID } from \"../../utils/string.utils\"\nimport { delay } from \"../../utils/utils\"\nimport { ModalClass } from \"./constants\"\n\n@Component({\n\ttag: \"gov-modal\",\n\tstyleUrl: \"gov-modal.scss\",\n})\nexport class GovModal {\n\tprivate h: GovHost\n\tprivate readonly labelId: string\n\tprivate readonly contentId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.labelId = createID(\"GovModalLabel\")\n\t\tthis.contentId = createID(\"GovModalContent\")\n\t}\n\n\t@Element() host: HTMLGovModalElement\n\n\t/**\n\t * Attribute for modal window display\n\t */\n\t@Prop({mutable: true}) open = false\n\t/**\n\t * Title of modal window\n\t */\n\t@Prop() label: string\n\t/**\n\t * Role of modal\n\t */\n\t@Prop({ attribute: \"role\" }) role = \"dialog\"\n\t/**\n\t * Used to change the HTML tag in the modal label for correct semantic structure\n\t */\n\t@Prop({ attribute: \"label-tag\" }) readonly labelTag: string = \"h2\"\n\t/**\n\t * String of id's that indicate alternative labels elements\n\t */\n\t@Prop({ attribute: \"wcag-labelled-by\" }) wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the modal.\n\t */\n\t@Prop({ attribute: \"wcag-described-by\" }) wcagDescribedBy: string\n\t/**\n\t * Adds accessible label for the modal close button that is only shown for screen readers.\n\t */\n\t@Prop({ attribute: \"wcag-close-label\" }) wcagCloseLabel: string\n\t/**\n\t * A string of identifiers that indicate alternative label elements for closing the modal window\n\t */\n\t@Prop({ attribute: \"wcag-close-labelled-by\" }) wcagCloseLabelledBy: string\n\t/**\n\t * Emitted when modal window closes.\n\t */\n\t@Event({ eventName: \"gov-close\" }) govClose: EventEmitter<PointerEvent>\n\n\t@Watch(\"labelTag\")\n\tvalidateLabelTag(newValue: string): void {\n\t\tconst validTags = [\"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\"]\n\t\tif (newValue) {\n\t\t\tif (!validTags.includes(newValue)) {\n\t\t\t\tgovErrorLog(`[${ModalClass.root}]: Tag ${newValue} is not allowed.`)\n\t\t\t}\n\t\t}\n\t}\n\n\t@Watch(\"open\")\n\twatchOpen(newValue: boolean): void {\n\t\tthis.open = newValue\n\t}\n\n\tprivate showModal() {\n\t\tthis.open = true\n\t\tdocument.body.classList.add(ModalClass.bodyFix)\n\t}\n\n\tprivate hideModal() {\n\t\tthis.open = false\n\t\tdocument.body.classList.remove(ModalClass.bodyFix)\n\t}\n\n\tasync componentWillRender() {\n\t\tif (this.open) {\n\t\t\tthis.showModal()\n\t\t} else {\n\t\t\tthis.hideModal()\n\t\t}\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 LabelTag = this.labelTag\n\t\treturn (\n\t\t\t<Host class={this.h.classes(ModalClass.root)} open={this.open}>\n\t\t\t\t<dialog\n\t\t\t\t\tclass={ModalClass.dialog}\n\t\t\t\t\thidden={!this.open}\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\topen={this.open}\n\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\taria-hidden={toBoolAttr(!this.open)}\n\t\t\t\t\taria-labelledby={this.wcagLabelledBy || this.labelId}\n\t\t\t\t\taria-describedby={this.wcagDescribedBy || this.contentId}\n\t\t\t\t\trole={this.role}\n\t\t\t\t>\n\t\t\t\t\t<div class={ModalClass.inner}>\n\t\t\t\t\t\t<div class={ModalClass.header}>\n\t\t\t\t\t\t\t{this.h.hasSlot(\"icon\") && (\n\t\t\t\t\t\t\t\t<div class={ModalClass.icon}>\n\t\t\t\t\t\t\t\t\t<slot name=\"icon\" />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{this.label && (\n\t\t\t\t\t\t\t\t<LabelTag class={ModalClass.title} id={this.labelId}>\n\t\t\t\t\t\t\t\t\t{this.label}\n\t\t\t\t\t\t\t\t</LabelTag>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<gov-button\n\t\t\t\t\t\t\t\tclass={ModalClass.close}\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\twcagLabel={this.wcagCloseLabel}\n\t\t\t\t\t\t\t\twcagLabelledBy={this.wcagCloseLabelledBy}\n\t\t\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<gov-icon name=\"x-lg\" />\n\t\t\t\t\t\t\t</gov-button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class={ModalClass.content} id={this.contentId}>\n\t\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{this.h.hasSlot(\"footer\") && (\n\t\t\t\t\t\t\t<div class={ModalClass.footer}>\n\t\t\t\t\t\t\t\t<slot name=\"footer\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</dialog>\n\n\t\t\t\t{this.open ? (\n\t\t\t\t\t<gov-backdrop\n\t\t\t\t\t\twcag-label={this.wcagCloseLabel}\n\t\t\t\t\t\twcag-labelled-by={this.wcagCloseLabelledBy}\n\t\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t\t/>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onCloseHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t\tthis.hideModal()\n\t\tthis.govClose.emit(e)\n\t}\n\n\t/**\n\t * Showing the modal\n\t */\n\t@Method()\n\tasync show(): Promise<void> {\n\t\tthis.showModal()\n\t}\n\n\t/**\n\t * Hiding the modal\n\t */\n\t@Method()\n\tasync hide(): Promise<void> {\n\t\tthis.hideModal()\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.wcagLabelledBy, \"wcag-labelled-by\", ModalClass.root)\n\t\tvalidateWcagRef(this.wcagDescribedBy, \"wcag-described-by\", ModalClass.root)\n\t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IAChB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;EACtB,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,IAAI;IACT,IAAI,CAAC,SAAS,EAAE,CAAA;EACjB,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,IAAI;IACT,IAAI,CAAC,SAAS,EAAE,CAAA;EACjB,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,YAAY;IACjB,eAAe,CAAC,IAAI,CAAC,cAAc,EAAE,kBAAkB,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;IACzE,eAAe,CAAC,IAAI,CAAC,eAAe,EAAE,mBAAmB,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;EAC5E,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Element, Event, EventEmitter, Host, Method, Prop, Watch, h } from \"@stencil/core\"\nimport { govHost, toBoolAttr } from \"../../helpers/Dom/template\"\nimport { GovHost } from \"../../helpers/Dom/template.types\"\nimport { canValidateWcagOnRender } from \"../../helpers/Dom/win\"\nimport { govErrorLog } from \"../../helpers/Log/gov.log\"\nimport { validateWcagRef } from \"../../helpers/Validate/wcag\"\nimport { createID } from \"../../utils/string.utils\"\nimport { delay } from \"../../utils/utils\"\nimport { ModalClass } from \"./constants\"\nimport { Nullable } from \"../../types/interfaces\"\n\n@Component({\n\ttag: \"gov-modal\",\n\tstyleUrl: \"gov-modal.scss\",\n})\nexport class GovModal {\n\tprivate h: GovHost\n\tprivate readonly labelId: string\n\tprivate readonly contentId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.labelId = createID(\"GovModalLabel\")\n\t\tthis.contentId = createID(\"GovModalContent\")\n\t}\n\n\t@Element() host: HTMLGovModalElement\n\n\t/**\n\t * Attribute for modal window display\n\t */\n\t@Prop({mutable: true}) open = false\n\t/**\n\t * Title of modal window\n\t */\n\t@Prop() label: string\n\t/**\n\t * Role of modal\n\t */\n\t@Prop({ attribute: \"role\" }) role: Nullable<string> = \"dialog\"\n\t/**\n\t * Used to change the HTML tag in the modal label for correct semantic structure\n\t */\n\t@Prop({ attribute: \"label-tag\" }) readonly labelTag: string = \"h2\"\n\t/**\n\t * String of id's that indicate alternative labels elements\n\t */\n\t@Prop({ attribute: \"wcag-labelled-by\" }) wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the modal.\n\t */\n\t@Prop({ attribute: \"wcag-described-by\" }) wcagDescribedBy: string\n\t/**\n\t * Adds accessible label for the modal close button that is only shown for screen readers.\n\t */\n\t@Prop({ attribute: \"wcag-close-label\" }) wcagCloseLabel: string\n\t/**\n\t * A string of identifiers that indicate alternative label elements for closing the modal window\n\t */\n\t@Prop({ attribute: \"wcag-close-labelled-by\" }) wcagCloseLabelledBy: string\n\t/**\n\t * Emitted when modal window closes.\n\t */\n\t@Event({ eventName: \"gov-close\" }) govClose: EventEmitter<PointerEvent>\n\n\t@Watch(\"labelTag\")\n\tvalidateLabelTag(newValue: string): void {\n\t\tconst validTags = [\"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\"]\n\t\tif (newValue) {\n\t\t\tif (!validTags.includes(newValue)) {\n\t\t\t\tgovErrorLog(`[${ModalClass.root}]: Tag ${newValue} is not allowed.`)\n\t\t\t}\n\t\t}\n\t}\n\n\t@Watch(\"open\")\n\twatchOpen(newValue: boolean): void {\n\t\tthis.open = newValue\n\t}\n\n\tprivate showModal() {\n\t\tthis.open = true\n\t\tdocument.body.classList.add(ModalClass.bodyFix)\n\t}\n\n\tprivate hideModal() {\n\t\tthis.open = false\n\t\tdocument.body.classList.remove(ModalClass.bodyFix)\n\t}\n\n\tasync componentWillRender() {\n\t\tif (this.open) {\n\t\t\tthis.showModal()\n\t\t} else {\n\t\t\tthis.hideModal()\n\t\t}\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 LabelTag = this.labelTag\n\t\treturn (\n\t\t\t<Host class={this.h.classes(ModalClass.root)} open={this.open}>\n\t\t\t\t<dialog\n\t\t\t\t\tclass={ModalClass.dialog}\n\t\t\t\t\thidden={!this.open}\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\topen={this.open}\n\t\t\t\t\taria-modal=\"true\"\n\t\t\t\t\taria-hidden={toBoolAttr(!this.open)}\n\t\t\t\t\taria-labelledby={this.wcagLabelledBy || this.labelId}\n\t\t\t\t\taria-describedby={this.wcagDescribedBy || this.contentId}\n\t\t\t\t\trole={this.role}\n\t\t\t\t>\n\t\t\t\t\t<div class={ModalClass.inner}>\n\t\t\t\t\t\t<div class={ModalClass.header}>\n\t\t\t\t\t\t\t{this.h.hasSlot(\"icon\") && (\n\t\t\t\t\t\t\t\t<div class={ModalClass.icon}>\n\t\t\t\t\t\t\t\t\t<slot name=\"icon\" />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{this.label && (\n\t\t\t\t\t\t\t\t<LabelTag class={ModalClass.title} id={this.labelId}>\n\t\t\t\t\t\t\t\t\t{this.label}\n\t\t\t\t\t\t\t\t</LabelTag>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<gov-button\n\t\t\t\t\t\t\t\tclass={ModalClass.close}\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\twcagLabel={this.wcagCloseLabel}\n\t\t\t\t\t\t\t\twcagLabelledBy={this.wcagCloseLabelledBy}\n\t\t\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<gov-icon name=\"x-lg\" />\n\t\t\t\t\t\t\t</gov-button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class={ModalClass.content} id={this.contentId}>\n\t\t\t\t\t\t\t<slot />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{this.h.hasSlot(\"footer\") && (\n\t\t\t\t\t\t\t<div class={ModalClass.footer}>\n\t\t\t\t\t\t\t\t<slot name=\"footer\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</dialog>\n\n\t\t\t\t{this.open ? (\n\t\t\t\t\t<gov-backdrop\n\t\t\t\t\t\twcag-label={this.wcagCloseLabel}\n\t\t\t\t\t\twcag-labelled-by={this.wcagCloseLabelledBy}\n\t\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t\t/>\n\t\t\t\t) : null}\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onCloseHandler(e: PointerEvent) {\n\t\te.stopPropagation()\n\t\tthis.hideModal()\n\t\tthis.govClose.emit(e)\n\t}\n\n\t/**\n\t * Showing the modal\n\t */\n\t@Method()\n\tasync show(): Promise<void> {\n\t\tthis.showModal()\n\t}\n\n\t/**\n\t * Hiding the modal\n\t */\n\t@Method()\n\tasync hide(): Promise<void> {\n\t\tthis.hideModal()\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.wcagLabelledBy, \"wcag-labelled-by\", ModalClass.root)\n\t\tvalidateWcagRef(this.wcagDescribedBy, \"wcag-described-by\", ModalClass.root)\n\t}\n}\n"]}
@@ -4,8 +4,7 @@ import { validateWcagRef } from "../../helpers/Validate/wcag";
4
4
  import { ModalClass } from "../gov-modal/constants";
5
5
  import { canValidateWcagOnRender } from "../../helpers/Dom/win";
6
6
  import { delay } from "../../utils/utils";
7
- import { toBoolAttr } from "../../helpers/Dom/template";
8
- import { govHost } from "../../helpers/Dom/template";
7
+ import { govHost, toBoolAttr } from "../../helpers/Dom/template";
9
8
  import { govErrorLog } from "../../helpers/Log/gov.log";
10
9
  export class GovPrompt {
11
10
  constructor() {
@@ -134,9 +133,15 @@ export class GovPrompt {
134
133
  "type": "string",
135
134
  "mutable": false,
136
135
  "complexType": {
137
- "original": "string",
136
+ "original": "Nullable<string>",
138
137
  "resolved": "string",
139
- "references": {}
138
+ "references": {
139
+ "Nullable": {
140
+ "location": "import",
141
+ "path": "../../types/interfaces",
142
+ "id": "../../../packages/core/src/types/interfaces.ts::Nullable"
143
+ }
144
+ }
140
145
  },
141
146
  "required": false,
142
147
  "optional": false,