@gov-design-system-ce/components 0.0.56 → 0.0.58

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 (221) hide show
  1. package/dist/cjs/core.cjs.js +1 -1
  2. package/dist/cjs/gov-accordion-item.cjs.entry.js +1 -1
  3. package/dist/cjs/gov-accordion-item.cjs.entry.js.map +1 -1
  4. package/dist/cjs/gov-app.cjs.entry.js +71 -6
  5. package/dist/cjs/gov-app.cjs.entry.js.map +1 -1
  6. package/dist/cjs/gov-badge.cjs.entry.js +1 -1
  7. package/dist/cjs/gov-badge.cjs.entry.js.map +1 -1
  8. package/dist/cjs/gov-button.cjs.entry.js +1 -1
  9. package/dist/cjs/gov-button.cjs.entry.js.map +1 -1
  10. package/dist/cjs/gov-form-checkbox.cjs.entry.js +1 -1
  11. package/dist/cjs/gov-form-checkbox.cjs.entry.js.map +1 -1
  12. package/dist/cjs/gov-form-input.cjs.entry.js +1 -1
  13. package/dist/cjs/gov-form-input.cjs.entry.js.map +1 -1
  14. package/dist/cjs/gov-form-multi-select.cjs.entry.js +1 -1
  15. package/dist/cjs/gov-form-multi-select.cjs.entry.js.map +1 -1
  16. package/dist/cjs/gov-form-radio.cjs.entry.js +1 -1
  17. package/dist/cjs/gov-form-radio.cjs.entry.js.map +1 -1
  18. package/dist/cjs/gov-form-select.cjs.entry.js +2 -2
  19. package/dist/cjs/gov-form-select.cjs.entry.js.map +1 -1
  20. package/dist/cjs/gov-form-switch.cjs.entry.js +1 -1
  21. package/dist/cjs/gov-form-switch.cjs.entry.js.map +1 -1
  22. package/dist/cjs/gov-icon.cjs.entry.js +2 -2
  23. package/dist/cjs/gov-icon.cjs.entry.js.map +1 -1
  24. package/dist/cjs/gov-loading.cjs.entry.js +2 -3
  25. package/dist/cjs/gov-loading.cjs.entry.js.map +1 -1
  26. package/dist/cjs/gov-modal.cjs.entry.js +1 -1
  27. package/dist/cjs/gov-modal.cjs.entry.js.map +1 -1
  28. package/dist/cjs/gov-prompt.cjs.entry.js +1 -1
  29. package/dist/cjs/gov-prompt.cjs.entry.js.map +1 -1
  30. package/dist/cjs/gov-stepper-item.cjs.entry.js +1 -1
  31. package/dist/cjs/gov-stepper-item.cjs.entry.js.map +1 -1
  32. package/dist/cjs/gov-toast.cjs.entry.js +9 -15
  33. package/dist/cjs/gov-toast.cjs.entry.js.map +1 -1
  34. package/dist/cjs/gov-wizard-item.cjs.entry.js +1 -1
  35. package/dist/cjs/gov-wizard-item.cjs.entry.js.map +1 -1
  36. package/dist/cjs/loader.cjs.js +1 -1
  37. package/dist/collection/components/gov-accordion/gov-accordion-item.css +1 -0
  38. package/dist/collection/components/gov-badge/gov-badge.css +12 -12
  39. package/dist/collection/components/gov-button/default/gov-button.css +12 -12
  40. package/dist/collection/components/gov-form/checkbox/gov-form-checkbox.css +1 -0
  41. package/dist/collection/components/gov-form/input/gov-form-input.css +17 -7
  42. package/dist/collection/components/gov-form/multiselect/gov-form-multi-select.css +32 -11
  43. package/dist/collection/components/gov-form/radio/gov-form-radio.css +1 -0
  44. package/dist/collection/components/gov-form/select/gov-form-select.css +29 -11
  45. package/dist/collection/components/gov-form/select/gov-form-select.js +1 -1
  46. package/dist/collection/components/gov-form/select/gov-form-select.js.map +1 -1
  47. package/dist/collection/components/gov-form/switch/gov-form-switch.css +4 -8
  48. package/dist/collection/components/gov-icon/gov-icon.css +6 -2
  49. package/dist/collection/components/gov-icon/list.js +10 -0
  50. package/dist/collection/components/gov-icon/list.js.map +1 -1
  51. package/dist/collection/components/gov-loading/loading/gov-loading.css +4 -3
  52. package/dist/collection/components/gov-loading/loading/gov-loading.js +1 -24
  53. package/dist/collection/components/gov-loading/loading/gov-loading.js.map +1 -1
  54. package/dist/collection/components/gov-modal/gov-modal.css +0 -4
  55. package/dist/collection/components/gov-promp/gov-prompt.css +0 -4
  56. package/dist/collection/components/gov-stepper/gov-stepper-item.css +0 -1
  57. package/dist/collection/components/gov-toast/gov-toast.js +15 -21
  58. package/dist/collection/components/gov-toast/gov-toast.js.map +1 -1
  59. package/dist/collection/components/gov-wizard/gov-wizard-item.css +3 -1
  60. package/dist/collection/pages/Accordion.js +2 -2
  61. package/dist/collection/pages/Accordion.js.map +1 -1
  62. package/dist/collection/pages/Forms.js +69 -4
  63. package/dist/collection/pages/Forms.js.map +1 -1
  64. package/dist/components/gov-accordion-item.js +1 -1
  65. package/dist/components/gov-accordion-item.js.map +1 -1
  66. package/dist/components/gov-alert.js +1 -1
  67. package/dist/components/gov-app.js +1 -1
  68. package/dist/components/gov-app.js.map +1 -1
  69. package/dist/components/gov-attachments-item.js +1 -1
  70. package/dist/components/gov-badge.js +1 -1
  71. package/dist/components/gov-button.js +1 -1
  72. package/dist/components/gov-card.js +1 -1
  73. package/dist/components/gov-form-autocomplete.js +1 -1
  74. package/dist/components/gov-form-checkbox.js +1 -1
  75. package/dist/components/gov-form-checkbox.js.map +1 -1
  76. package/dist/components/gov-form-file.js +1 -1
  77. package/dist/components/gov-form-input.js +1 -1
  78. package/dist/components/gov-form-multi-select.js +1 -1
  79. package/dist/components/gov-form-multi-select.js.map +1 -1
  80. package/dist/components/gov-form-radio.js +1 -1
  81. package/dist/components/gov-form-radio.js.map +1 -1
  82. package/dist/components/gov-form-select.js +1 -1
  83. package/dist/components/gov-form-switch.js +1 -1
  84. package/dist/components/gov-form-switch.js.map +1 -1
  85. package/dist/components/gov-icon.js +1 -1
  86. package/dist/components/gov-loading.js +1 -1
  87. package/dist/components/gov-loading.js.map +1 -1
  88. package/dist/components/gov-modal.js +1 -1
  89. package/dist/components/gov-modal.js.map +1 -1
  90. package/dist/components/gov-pagination.js +1 -1
  91. package/dist/components/gov-prompt.js +1 -1
  92. package/dist/components/gov-prompt.js.map +1 -1
  93. package/dist/components/gov-side-nav-item.js +1 -1
  94. package/dist/components/gov-stepper-item.js +1 -1
  95. package/dist/components/gov-stepper-item.js.map +1 -1
  96. package/dist/components/gov-tabs.js +1 -1
  97. package/dist/components/gov-tile.js +1 -1
  98. package/dist/components/gov-toast.js +1 -1
  99. package/dist/components/gov-toast.js.map +1 -1
  100. package/dist/components/gov-wizard-item.js +1 -1
  101. package/dist/components/gov-wizard-item.js.map +1 -1
  102. package/dist/components/{p-a2e601c5.js → p-0378da4d.js} +2 -2
  103. package/dist/components/{p-a2e601c5.js.map → p-0378da4d.js.map} +1 -1
  104. package/dist/components/p-35f6490a.js +2 -0
  105. package/dist/components/{p-04bfe959.js.map → p-35f6490a.js.map} +1 -1
  106. package/dist/components/{p-6ca0c464.js → p-70d9d879.js} +2 -2
  107. package/dist/components/{p-6ca0c464.js.map → p-70d9d879.js.map} +1 -1
  108. package/dist/components/{p-f516d8f6.js → p-9cba3cd3.js} +2 -2
  109. package/dist/components/p-a6915747.js +2 -0
  110. package/dist/components/p-a6915747.js.map +1 -0
  111. package/dist/components/p-da3b225f.js +2 -0
  112. package/dist/components/{p-2753b6e4.js.map → p-da3b225f.js.map} +1 -1
  113. package/dist/components/{p-594ba760.js → p-ee60cdd1.js} +2 -2
  114. package/dist/core/core.esm.js +1 -1
  115. package/dist/core/core.esm.js.map +1 -1
  116. package/dist/core/p-2944bf77.entry.js +2 -0
  117. package/dist/core/{p-64f7e661.entry.js.map → p-2944bf77.entry.js.map} +1 -1
  118. package/dist/core/p-2bb9f781.entry.js +2 -0
  119. package/dist/core/p-2bb9f781.entry.js.map +1 -0
  120. package/dist/core/p-4c79a97a.entry.js +2 -0
  121. package/dist/core/p-4c79a97a.entry.js.map +1 -0
  122. package/dist/core/p-667dc3de.entry.js +2 -0
  123. package/dist/core/p-667dc3de.entry.js.map +1 -0
  124. package/dist/core/p-69f944d1.entry.js +2 -0
  125. package/dist/core/p-69f944d1.entry.js.map +1 -0
  126. package/dist/core/{p-bfb4d904.entry.js → p-6a65af35.entry.js} +2 -2
  127. package/dist/core/{p-bfb4d904.entry.js.map → p-6a65af35.entry.js.map} +1 -1
  128. package/dist/core/p-85258200.entry.js +2 -0
  129. package/dist/core/{p-f0a5847a.entry.js.map → p-85258200.entry.js.map} +1 -1
  130. package/dist/core/p-8fce08d1.entry.js +2 -0
  131. package/dist/core/p-8fce08d1.entry.js.map +1 -0
  132. package/dist/core/p-9bfab069.entry.js +2 -0
  133. package/dist/core/{p-fc853777.entry.js.map → p-9bfab069.entry.js.map} +1 -1
  134. package/dist/core/p-a85f4a62.entry.js +2 -0
  135. package/dist/core/p-a85f4a62.entry.js.map +1 -0
  136. package/dist/core/{p-accf8575.entry.js → p-af646ce2.entry.js} +2 -2
  137. package/dist/core/{p-accf8575.entry.js.map → p-af646ce2.entry.js.map} +1 -1
  138. package/dist/core/p-cacd0fed.entry.js +2 -0
  139. package/dist/core/{p-22a86871.entry.js.map → p-cacd0fed.entry.js.map} +1 -1
  140. package/dist/core/p-d4cfa93a.entry.js +2 -0
  141. package/dist/core/{p-81643870.entry.js.map → p-d4cfa93a.entry.js.map} +1 -1
  142. package/dist/core/{p-3858e2c8.entry.js → p-dd39ede4.entry.js} +2 -2
  143. package/dist/core/p-dd39ede4.entry.js.map +1 -0
  144. package/dist/core/p-de5c9181.entry.js +2 -0
  145. package/dist/core/p-de5c9181.entry.js.map +1 -0
  146. package/dist/core/p-f8252fea.entry.js +2 -0
  147. package/dist/core/{p-ea4459ae.entry.js.map → p-f8252fea.entry.js.map} +1 -1
  148. package/dist/core/p-fb99f144.entry.js +2 -0
  149. package/dist/core/p-fb99f144.entry.js.map +1 -0
  150. package/dist/esm/core.js +1 -1
  151. package/dist/esm/gov-accordion-item.entry.js +1 -1
  152. package/dist/esm/gov-accordion-item.entry.js.map +1 -1
  153. package/dist/esm/gov-app.entry.js +71 -6
  154. package/dist/esm/gov-app.entry.js.map +1 -1
  155. package/dist/esm/gov-badge.entry.js +1 -1
  156. package/dist/esm/gov-badge.entry.js.map +1 -1
  157. package/dist/esm/gov-button.entry.js +1 -1
  158. package/dist/esm/gov-button.entry.js.map +1 -1
  159. package/dist/esm/gov-form-checkbox.entry.js +1 -1
  160. package/dist/esm/gov-form-checkbox.entry.js.map +1 -1
  161. package/dist/esm/gov-form-input.entry.js +1 -1
  162. package/dist/esm/gov-form-input.entry.js.map +1 -1
  163. package/dist/esm/gov-form-multi-select.entry.js +1 -1
  164. package/dist/esm/gov-form-multi-select.entry.js.map +1 -1
  165. package/dist/esm/gov-form-radio.entry.js +1 -1
  166. package/dist/esm/gov-form-radio.entry.js.map +1 -1
  167. package/dist/esm/gov-form-select.entry.js +2 -2
  168. package/dist/esm/gov-form-select.entry.js.map +1 -1
  169. package/dist/esm/gov-form-switch.entry.js +1 -1
  170. package/dist/esm/gov-form-switch.entry.js.map +1 -1
  171. package/dist/esm/gov-icon.entry.js +2 -2
  172. package/dist/esm/gov-icon.entry.js.map +1 -1
  173. package/dist/esm/gov-loading.entry.js +2 -3
  174. package/dist/esm/gov-loading.entry.js.map +1 -1
  175. package/dist/esm/gov-modal.entry.js +1 -1
  176. package/dist/esm/gov-modal.entry.js.map +1 -1
  177. package/dist/esm/gov-prompt.entry.js +1 -1
  178. package/dist/esm/gov-prompt.entry.js.map +1 -1
  179. package/dist/esm/gov-stepper-item.entry.js +1 -1
  180. package/dist/esm/gov-stepper-item.entry.js.map +1 -1
  181. package/dist/esm/gov-toast.entry.js +9 -15
  182. package/dist/esm/gov-toast.entry.js.map +1 -1
  183. package/dist/esm/gov-wizard-item.entry.js +1 -1
  184. package/dist/esm/gov-wizard-item.entry.js.map +1 -1
  185. package/dist/esm/loader.js +1 -1
  186. package/dist/hydrate/index.js +98 -42
  187. package/dist/types/components/gov-loading/loading/gov-loading.d.ts +0 -4
  188. package/dist/types/components/gov-toast/gov-toast.d.ts +4 -6
  189. package/dist/types/components.d.ts +4 -12
  190. package/package.json +3 -3
  191. package/dist/components/p-04bfe959.js +0 -2
  192. package/dist/components/p-2753b6e4.js +0 -2
  193. package/dist/components/p-baf87688.js +0 -2
  194. package/dist/components/p-baf87688.js.map +0 -1
  195. package/dist/core/p-22a86871.entry.js +0 -2
  196. package/dist/core/p-23385300.entry.js +0 -2
  197. package/dist/core/p-23385300.entry.js.map +0 -1
  198. package/dist/core/p-3858e2c8.entry.js.map +0 -1
  199. package/dist/core/p-48cfc1c6.entry.js +0 -2
  200. package/dist/core/p-48cfc1c6.entry.js.map +0 -1
  201. package/dist/core/p-4df62a13.entry.js +0 -2
  202. package/dist/core/p-4df62a13.entry.js.map +0 -1
  203. package/dist/core/p-64f7e661.entry.js +0 -2
  204. package/dist/core/p-74f0be51.entry.js +0 -2
  205. package/dist/core/p-74f0be51.entry.js.map +0 -1
  206. package/dist/core/p-801f1147.entry.js +0 -2
  207. package/dist/core/p-801f1147.entry.js.map +0 -1
  208. package/dist/core/p-81643870.entry.js +0 -2
  209. package/dist/core/p-82f64673.entry.js +0 -2
  210. package/dist/core/p-82f64673.entry.js.map +0 -1
  211. package/dist/core/p-aa4e716e.entry.js +0 -2
  212. package/dist/core/p-aa4e716e.entry.js.map +0 -1
  213. package/dist/core/p-e769f3ee.entry.js +0 -2
  214. package/dist/core/p-e769f3ee.entry.js.map +0 -1
  215. package/dist/core/p-ea4459ae.entry.js +0 -2
  216. package/dist/core/p-f0a5847a.entry.js +0 -2
  217. package/dist/core/p-fc853777.entry.js +0 -2
  218. package/dist/globals.d.ts +0 -2
  219. package/dist/types/types/typings.d.ts +0 -6
  220. /package/dist/components/{p-f516d8f6.js.map → p-9cba3cd3.js.map} +0 -0
  221. /package/dist/components/{p-594ba760.js.map → p-ee60cdd1.js.map} +0 -0
@@ -2,9 +2,5 @@ export declare class GovLoading {
2
2
  private h;
3
3
  constructor();
4
4
  host: HTMLGovLoadingElement;
5
- /**
6
- * Determine if loading is active
7
- */
8
- loading: boolean;
9
5
  render(): any;
10
6
  }
@@ -1,6 +1,5 @@
1
- import { EventEmitter } from '../../stencil-public-runtime';
2
- import { ToastTypesType } from './constants';
3
- import { ToastVariantType } from './constants';
1
+ import { EventEmitter } from "../../stencil-public-runtime";
2
+ import { ToastTypesType, ToastVariantType } from "./constants";
4
3
  export declare class GovToast {
5
4
  private h;
6
5
  private timeout;
@@ -14,11 +13,11 @@ export declare class GovToast {
14
13
  /**
15
14
  * Toast’s gravity
16
15
  */
17
- readonly gravity: 'top' | 'bottom';
16
+ readonly gravity: "top" | "bottom";
18
17
  /**
19
18
  * Toast’s position
20
19
  */
21
- readonly position: 'left' | 'center' | 'right';
20
+ readonly position: "left" | "center" | "right";
22
21
  /**
23
22
  * Toast type
24
23
  */
@@ -41,7 +40,6 @@ export declare class GovToast {
41
40
  govClose: EventEmitter<string>;
42
41
  validateVariant(newValue: string): void;
43
42
  componentWillLoad(): void;
44
- componentDidLoad(): void;
45
43
  disconnectedCallback(): void;
46
44
  private runTimer;
47
45
  render(): any;
@@ -1290,10 +1290,6 @@ export namespace Components {
1290
1290
  interface GovLayoutColumn {
1291
1291
  }
1292
1292
  interface GovLoading {
1293
- /**
1294
- * Determine if loading is active
1295
- */
1296
- "loading": boolean;
1297
1293
  }
1298
1294
  interface GovMessage {
1299
1295
  /**
@@ -1750,11 +1746,11 @@ export namespace Components {
1750
1746
  /**
1751
1747
  * Toast’s gravity
1752
1748
  */
1753
- "gravity": 'top' | 'bottom';
1749
+ "gravity": "top" | "bottom";
1754
1750
  /**
1755
1751
  * Toast’s position
1756
1752
  */
1757
- "position": 'left' | 'center' | 'right';
1753
+ "position": "left" | "center" | "right";
1758
1754
  /**
1759
1755
  * Number of milliseconds to wait before Toast disappear
1760
1756
  */
@@ -3580,10 +3576,6 @@ declare namespace LocalJSX {
3580
3576
  interface GovLayoutColumn {
3581
3577
  }
3582
3578
  interface GovLoading {
3583
- /**
3584
- * Determine if loading is active
3585
- */
3586
- "loading"?: boolean;
3587
3579
  }
3588
3580
  interface GovMessage {
3589
3581
  /**
@@ -3976,7 +3968,7 @@ declare namespace LocalJSX {
3976
3968
  /**
3977
3969
  * Toast’s gravity
3978
3970
  */
3979
- "gravity"?: 'top' | 'bottom';
3971
+ "gravity"?: "top" | "bottom";
3980
3972
  /**
3981
3973
  * Called when the close button is clicked
3982
3974
  */
@@ -3984,7 +3976,7 @@ declare namespace LocalJSX {
3984
3976
  /**
3985
3977
  * Toast’s position
3986
3978
  */
3987
- "position"?: 'left' | 'center' | 'right';
3979
+ "position"?: "left" | "center" | "right";
3988
3980
  /**
3989
3981
  * Number of milliseconds to wait before Toast disappear
3990
3982
  */
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@gov-design-system-ce/components",
3
3
  "description": "This package includes Gov Design System Web Components and related utilities.",
4
4
  "author": "Zdeněk Vítek",
5
- "version": "0.0.56",
5
+ "version": "0.0.58",
6
6
  "license": "EUPL v1.2 Licensed",
7
7
  "main": "./dist/index.cjs.js",
8
8
  "unpkg": "./dist/core/core.esm.js",
@@ -22,8 +22,8 @@
22
22
  "test": "echo \"Error: no test specified\" && exit 1"
23
23
  },
24
24
  "dependencies" : {
25
- "@gov-design-system-ce/icons": "0.0.9",
25
+ "@gov-design-system-ce/icons": "0.0.11",
26
26
  "@gov-design-system-ce/fonts": "0.0.2",
27
- "@gov-design-system-ce/styles": "0.0.6"
27
+ "@gov-design-system-ce/styles": "0.0.8"
28
28
  }
29
29
  }
@@ -1,2 +0,0 @@
1
- import{p as t,H as s,h as n,d as e}from"./p-80c0109d.js";import{i,a as o}from"./p-cac3881f.js";import{g as r}from"./p-3f37ddb6.js";var a;(function(t){t["BASIC"]="basic";t["COMPLEX"]="complex";t["COLORED"]="colored"})(a||(a={}));const c={root:"gov-icon",holder:"gov-icon__holder"};const l=t=>{const s=new URL(t,f.t);return s.origin!==h.location.origin?s.href:s.pathname};const h=typeof window!=="undefined"?window:{};const f={i:0,t:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,s,n,e)=>t.addEventListener(s,n,e),rel:(t,s,n,e)=>t.removeEventListener(s,n,e),ce:(t,s)=>new CustomEvent(t,s)};const u="0.0.56";const p=()=>u;const d={};const m={};const g=t=>t.startsWith("http://")||t.startsWith("https://");const w=(t,s,n)=>{if(g(t)){return`${t}/${n}/${s}.svg?v=${p()}`}return l(`${t}/${n}/${s}.svg`)+`?v=${p()}`};async function y({name:t,type:s}){const n=s+"-"+t;if(d[n]){return d[n]}if(!m[n]){m[n]=fetch(w(i(),t,s)).then((t=>{if(t.status===200){return t.text()}else{throw new Error("Gov Icon doesn't exists")}}))}const e=await m[n];d[n]=e;return e}const v=".gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-icon{display:inline-flex}.gov-icon__holder,.gov-icon svg{display:inline-flex;width:100%;height:100%}";const b=t(class t extends s{constructor(){super();this.__registerHost();this.name=null;this.type="basic";this.iconData=undefined;this.visible=false;this.error=false;this.h=r(this.host)}async loadIconPathData(){const{name:t,visible:s,type:n}=this;if(!t||!s){return}try{this.iconData=await y({name:t,type:n})}catch(t){this.error=true}}connectedCallback(){if(o()){this.visible=true;this.loadIconPathData().finally()}else{this.waitUntilVisible((async()=>{this.visible=true;await this.loadIconPathData()}))}}disconnectedCallback(){if(this.intersectionObserver){this.intersectionObserver.disconnect();this.intersectionObserver=null}}async componentWillLoad(){await this.loadIconPathData()}waitUntilVisible(t){if(typeof window==="undefined"||!window.IntersectionObserver){t();return}this.intersectionObserver=new IntersectionObserver((s=>{s.forEach((s=>{if(s.isIntersecting){if(this.intersectionObserver){this.intersectionObserver.disconnect();this.intersectionObserver=null}t()}}))}),{rootMargin:"50px"});this.intersectionObserver.observe(this.host)}render(){if(this.error){return null}return n(e,{class:this.h.classes(c.root)},n("span",{class:c.holder,innerHTML:this.iconData}))}static get assetsDirs(){return["assets"]}get host(){return this}static get watchers(){return{name:["loadIconPathData"]}}static get style(){return v}},[0,"gov-icon",{name:[1],type:[1],iconData:[32],visible:[32],error:[32]}]);function $(){if(typeof customElements==="undefined"){return}const t=["gov-icon"];t.forEach((t=>{switch(t){case"gov-icon":if(!customElements.get(t)){customElements.define(t,b)}break}}))}$();export{b as G,$ as d};
2
- //# sourceMappingURL=p-04bfe959.js.map
@@ -1,2 +0,0 @@
1
- import{p as e,H as o,c as t,h as r,d as i}from"./p-80c0109d.js";import{g as s,o as l,p as a,q as c}from"./p-17c1ffc1.js";import{g as n,a as v,t as g}from"./p-3f37ddb6.js";import{c as m}from"./p-cac3881f.js";import{v as f}from"./p-26acf964.js";import{b as d,c as h}from"./p-ae894a40.js";import{c as p}from"./p-24636c53.js";import{d as u}from"./p-03990da5.js";import{d as z}from"./p-04bfe959.js";const x='.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-form-select{position:relative;display:flex;width:100%;align-items:center}.gov-form-select .element{position:relative;display:flex;flex:1 1 auto}.gov-form-select input,.gov-form-select select,.gov-form-select textarea{width:100%;border-radius:var(--gov-border-radius, 0.1875rem);background-color:var(--gov-form-bg-color, var(--gov-color-neutral-white));font-family:var(--gov-font-family, "Roboto", sans-serif)}.gov-form-select input:focus,.gov-form-select select:focus,.gov-form-select textarea:focus{outline:none}.gov-form-select input:focus-visible,.gov-form-select select:focus-visible,.gov-form-select textarea:focus-visible{border-radius:var(--gov-border-radius, 0.1875rem);outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base);outline-offset:0}.gov-form-select input::-moz-placeholder,.gov-form-select select::-moz-placeholder,.gov-form-select textarea::-moz-placeholder{color:var(--gov-form-placeholder-color, var(--gov-color-secondary-600))}.gov-form-select input::placeholder,.gov-form-select select::placeholder,.gov-form-select textarea::placeholder{color:var(--gov-form-placeholder-color, var(--gov-color-secondary-600))}.gov-form-select textarea{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);padding:0.5rem 0.75rem;resize:none}.gov-form-select *[slot=left-icon],.gov-form-select *[slot=right-icon]{position:absolute;top:50%;display:flex;justify-content:center;transform:translateY(-50%);pointer-events:none}.gov-form-select *[slot=left-icon]{left:0}.gov-form-select *[slot=right-icon]{right:0}[size=s].gov-form-select{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);gap:0.5rem var(--gov-form-input-core-s-icon-size, 1rem)}[size=s].gov-form-select input,[size=s].gov-form-select select{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);height:var(--gov-form-input-core-s-height, 2rem);padding:var(--gov-form-input-core-s-padding, 0.25rem 0.75rem)}[size=s].gov-form-select *[slot=left-icon],[size=s].gov-form-select *[slot=right-icon]{width:var(--gov-form-input-core-s-icon-size, 1rem);height:var(--gov-form-input-core-s-icon-size, 1rem)}[size=s].gov-form-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-s-icon-padding, 2rem) - var(--gov-form-input-core-s-icon-size, 1rem)) / 2)}[size=s].gov-form-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-s-icon-padding, 2rem)}[size=s].gov-form-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-s-icon-padding, 2rem) - var(--gov-form-input-core-s-icon-size, 1rem)) / 2)}[size=s].gov-form-select *[slot=right-icon]~input,[size=s].gov-form-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-s-icon-padding, 2rem)}[size=m].gov-form-select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);gap:0.5rem var(--gov-form-input-core-m-icon-size, 1rem)}[size=m].gov-form-select input,[size=m].gov-form-select select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);height:var(--gov-form-input-core-m-height, 2.5rem);padding:var(--gov-form-input-core-m-padding, 0.4375rem 0.75rem)}[size=m].gov-form-select *[slot=left-icon],[size=m].gov-form-select *[slot=right-icon]{width:var(--gov-form-input-core-m-icon-size, 1rem);height:var(--gov-form-input-core-m-icon-size, 1rem)}[size=m].gov-form-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-m-icon-padding, 2.5rem) - var(--gov-form-input-core-m-icon-size, 1rem)) / 2)}[size=m].gov-form-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-m-icon-padding, 2.5rem)}[size=m].gov-form-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-m-icon-padding, 2.5rem) - var(--gov-form-input-core-m-icon-size, 1rem)) / 2)}[size=m].gov-form-select *[slot=right-icon]~input,[size=m].gov-form-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-m-icon-padding, 2.5rem)}[size=l].gov-form-select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);gap:0.5rem var(--gov-form-input-core-l-icon-size, 1rem)}[size=l].gov-form-select input,[size=l].gov-form-select select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);height:var(--gov-form-input-core-l-height, 3rem);padding:var(--gov-form-input-core-l-padding, 0.6875rem 0.75rem)}[size=l].gov-form-select *[slot=left-icon],[size=l].gov-form-select *[slot=right-icon]{width:var(--gov-form-input-core-l-icon-size, 1rem);height:var(--gov-form-input-core-l-icon-size, 1rem)}[size=l].gov-form-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-l-icon-padding, 2.5rem) - var(--gov-form-input-core-l-icon-size, 1rem)) / 2)}[size=l].gov-form-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-l-icon-padding, 2.5rem)}[size=l].gov-form-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-l-icon-padding, 2.5rem) - var(--gov-form-input-core-l-icon-size, 1rem)) / 2)}[size=l].gov-form-select *[slot=right-icon]~input,[size=l].gov-form-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-l-icon-padding, 2.5rem)}[size=xl].gov-form-select{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);gap:0.5rem var(--gov-form-input-core-xl-icon-size, 1.25rem)}[size=xl].gov-form-select input,[size=xl].gov-form-select select{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);height:var(--gov-form-input-core-xl-height, 3.5rem);padding:var(--gov-form-input-core-xl-padding, 0.9375rem 1rem 0.875rem)}[size=xl].gov-form-select *[slot=left-icon],[size=xl].gov-form-select *[slot=right-icon]{width:var(--gov-form-input-core-xl-icon-size, 1.25rem);height:var(--gov-form-input-core-xl-icon-size, 1.25rem)}[size=xl].gov-form-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-xl-icon-padding, 3rem) - var(--gov-form-input-core-xl-icon-size, 1.25rem)) / 2)}[size=xl].gov-form-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-xl-icon-padding, 3rem)}[size=xl].gov-form-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-xl-icon-padding, 3rem) - var(--gov-form-input-core-xl-icon-size, 1.25rem)) / 2)}[size=xl].gov-form-select *[slot=right-icon]~input,[size=xl].gov-form-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-xl-icon-padding, 3rem)}[variant=primary].gov-form-select input,[variant=primary].gov-form-select select,[variant=primary].gov-form-select textarea{color:var(--gov-form-input-color-primary, var(--gov-color-secondary-700));border:var(--gov-form-input-border-primary, 0.0625rem solid var(--gov-color-primary-600))}[variant=primary].gov-form-select *[slot=left-icon],[variant=primary].gov-form-select *[slot=right-icon]{color:var(--gov-form-input-icon-color-primary, var(--gov-color-primary))}[variant=secondary].gov-form-select input,[variant=secondary].gov-form-select select,[variant=secondary].gov-form-select textarea{color:var(--gov-form-input-color-secondary, var(--gov-color-secondary-700));border:var(--gov-form-input-border-secondary, 0.0625rem solid var(--gov-color-secondary-700))}[variant=secondary].gov-form-select *[slot=left-icon],[variant=secondary].gov-form-select *[slot=right-icon]{color:var(--gov-form-input-icon-color-secondary, var(--gov-color-primary))}[disabled=""].gov-form-select,[disabled=true i].gov-form-select,[disabled="1"].gov-form-select{pointer-events:none}[disabled=""].gov-form-select input,[disabled=""].gov-form-select select,[disabled=""].gov-form-select textarea,[disabled=true i].gov-form-select input,[disabled=true i].gov-form-select select,[disabled=true i].gov-form-select textarea,[disabled="1"].gov-form-select input,[disabled="1"].gov-form-select select,[disabled="1"].gov-form-select textarea{border-color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600));background:var(--gov-form-input-disabled-bg, var(--gov-color-secondary-300));color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[disabled=""].gov-form-select *[slot=left-icon],[disabled=""].gov-form-select *[slot=right-icon],[disabled=true i].gov-form-select *[slot=left-icon],[disabled=true i].gov-form-select *[slot=right-icon],[disabled="1"].gov-form-select *[slot=left-icon],[disabled="1"].gov-form-select *[slot=right-icon]{color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[invalid=""].gov-form-select input,[invalid=""].gov-form-select select,[invalid=""].gov-form-select textarea,[invalid=true i].gov-form-select input,[invalid=true i].gov-form-select select,[invalid=true i].gov-form-select textarea,[invalid="1"].gov-form-select input,[invalid="1"].gov-form-select select,[invalid="1"].gov-form-select textarea{border-color:var(--gov-form-state-color-error, var(--gov-color-error));color:var(--gov-form-state-color-error, var(--gov-color-error))}[invalid=""].gov-form-select input::-moz-placeholder,[invalid=""].gov-form-select select::-moz-placeholder,[invalid=""].gov-form-select textarea::-moz-placeholder,[invalid=true i].gov-form-select input::-moz-placeholder,[invalid=true i].gov-form-select select::-moz-placeholder,[invalid=true i].gov-form-select textarea::-moz-placeholder,[invalid="1"].gov-form-select input::-moz-placeholder,[invalid="1"].gov-form-select select::-moz-placeholder,[invalid="1"].gov-form-select textarea::-moz-placeholder{color:var(--gov-form-state-color-error, var(--gov-color-error-300))}[invalid=""].gov-form-select input::placeholder,[invalid=""].gov-form-select select::placeholder,[invalid=""].gov-form-select textarea::placeholder,[invalid=true i].gov-form-select input::placeholder,[invalid=true i].gov-form-select select::placeholder,[invalid=true i].gov-form-select textarea::placeholder,[invalid="1"].gov-form-select input::placeholder,[invalid="1"].gov-form-select select::placeholder,[invalid="1"].gov-form-select textarea::placeholder{color:var(--gov-form-state-color-error, var(--gov-color-error-300))}[invalid=""].gov-form-select *[slot=left-icon],[invalid=""].gov-form-select *[slot=right-icon],[invalid=true i].gov-form-select *[slot=left-icon],[invalid=true i].gov-form-select *[slot=right-icon],[invalid="1"].gov-form-select *[slot=left-icon],[invalid="1"].gov-form-select *[slot=right-icon]{color:var(--gov-form-state-color-error, var(--gov-color-error))}[success=""].gov-form-select *[slot=right-icon],[success=true i].gov-form-select *[slot=right-icon],[success="1"].gov-form-select *[slot=right-icon]{color:var(--gov-form-state-color-success, var(--gov-color-success))}[success=""].gov-form-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[success=true i].gov-form-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[success="1"].gov-form-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow){display:none}.gov-form-select{background:none}.gov-form-select select{-webkit-appearance:none;-moz-appearance:none}.gov-form-select select::-ms-expand{display:none}[size=m].gov-form-select *[slot=right-icon]{right:var(--gov-form-select-m-arrow-right-position, 1rem);width:var(--gov-form-select-m-arrow-size, 0.5rem);height:var(--gov-form-select-m-arrow-size, 0.5rem)}[size=l].gov-form-select *[slot=right-icon]{right:var(--gov-form-select-l-arrow-right-position, 1rem);width:var(--gov-form-select-l-arrow-size, 0.5rem);height:var(--gov-form-select-l-arrow-size, 0.5rem)}[size=xl].gov-form-select *[slot=right-icon]{right:var(--gov-form-select-xl-arrow-right-position, 1.3125rem);width:var(--gov-form-select-xl-arrow-size, 0.625rem);height:var(--gov-form-select-xl-arrow-size, 0.625rem)}';const b=e(class e extends o{constructor(){super();this.__registerHost();this.govFocus=t(this,"gov-focus",7);this.govBlur=t(this,"gov-blur",7);this.govChange=t(this,"gov-change",7);this.value=undefined;this.identifier=undefined;this.variant="secondary";this.size="m";this.name=undefined;this.required=false;this.disabled=undefined;this.invalid=undefined;this.wcagActiveDescendant=undefined;this.wcagControls=undefined;this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.wcagOwns=undefined;this.focused=undefined;this.h=n(this.host);this.f=s(this.h);this.selectId=p("GovSelect")}validateVariant(e){f(a,e,l.root)}validateSize(e){f(c,e,l.root)}watchDisabled(){this.passControlAttrs()}watchValue(){this.markSelectedValue()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("disabled",v(this.disabled));this.f.passAttrToControl("invalid",v(this.invalid));this.f.passAttrToControl("type","select")}componentWillLoad(){this.validateVariant(this.variant);this.validateSize(this.size);this.markSelectedValue();this.passControlAttrs();this.f.passAttrToLabel("required",String(this.required))}async componentDidRender(){if(m()){await u(500);await this.validateWcag()}}markSelectedValue(){this.host.querySelectorAll("option").forEach((e=>{if(e.value===this.value){e.setAttribute("selected","selected")}else{e.removeAttribute("selected")}}))}render(){return r(i,{class:l.root,size:this.size,variant:this.variant},this.h.hasSlot("prefix")&&r("slot",{name:"prefix"}),r("span",{class:"element"},r("gov-icon",{slot:"right-icon",name:"chevron-down"}),r("select",{id:this.identifier||this.selectId,onFocus:this.onFocusHandler.bind(this),onChange:this.onChangeHandler.bind(this),onBlur:this.onBlurHandler.bind(this),required:this.required,name:this.name,disabled:this.disabled,ref:e=>this.selectRef=e,"aria-disabled":g(this.disabled),"aria-activedescendant":this.wcagActiveDescendant,"aria-controls":this.wcagControls,"aria-required":g(this.required),"aria-invalid":g(this.invalid),"aria-describedby":this.wcagDescribedBy,"aria-labelledby":this.wcagLabelledBy,"aria-owns":this.wcagOwns},r("slot",null))),this.h.hasSlot("sufix")&&r("slot",{name:"sufix"}))}onFocusHandler(e){this.focused=true;this.govFocus.emit({component:l.root,originalEvent:e,value:this.value})}onBlurHandler(e){this.focused=false;this.govBlur.emit({component:l.root,originalEvent:e,value:this.value})}onChangeHandler(e){this.value=e.target.value;e.stopPropagation();this.govChange.emit({component:l.root,originalEvent:e,value:this.value})}async setFocus(e){return this.selectRef.focus(e)}async setValue(e){this.value=e}async getRef(){return this.selectRef}async validateWcag(){d(this.wcagActiveDescendant,"wcag-active-descendant",l.root);d(this.wcagControls,"wcag-controls",l.root);d(this.wcagDescribedBy,"wcag-described-by",l.root);d(this.wcagOwns,"wcag-owns",l.root);h(this.identifier||this.selectId,this.wcagLabelledBy,l.root)}get host(){return this}static get watchers(){return{variant:["validateVariant"],size:["validateSize","watchDisabled"],disabled:["watchDisabled"],invalid:["watchDisabled"],value:["watchValue"]}}static get style(){return x}},[4,"gov-form-select",{value:[1537],identifier:[1],variant:[1],size:[1],name:[1],required:[4],disabled:[4],invalid:[4],wcagActiveDescendant:[1,"wcag-active-descendant"],wcagControls:[1,"wcag-controls"],wcagDescribedBy:[1,"wcag-described-by"],wcagLabelledBy:[1,"wcag-labelled-by"],wcagOwns:[1,"wcag-owns"],focused:[32],setFocus:[64],setValue:[64],getRef:[64],validateWcag:[64]}]);function w(){if(typeof customElements==="undefined"){return}const e=["gov-form-select","gov-icon"];e.forEach((e=>{switch(e){case"gov-form-select":if(!customElements.get(e)){customElements.define(e,b)}break;case"gov-icon":if(!customElements.get(e)){z()}break}}))}w();export{b as G,w as d};
2
- //# sourceMappingURL=p-2753b6e4.js.map
@@ -1,2 +0,0 @@
1
- import{p as o,H as i,c as t,h as e,d as r}from"./p-80c0109d.js";import{g as n,c as a,d as s,e as l}from"./p-17c1ffc1.js";import{g as v,a as g,t as c,c as p}from"./p-3f37ddb6.js";import{c as m}from"./p-cac3881f.js";import{v as u}from"./p-26acf964.js";import{b as d,c as f}from"./p-ae894a40.js";import{c as h}from"./p-24636c53.js";import{d as x}from"./p-03990da5.js";import{d as z}from"./p-04bfe959.js";const y='.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-form-input{position:relative;display:flex;width:100%;align-items:center}.gov-form-input .element{position:relative;display:flex;flex:1 1 auto}.gov-form-input input,.gov-form-input select,.gov-form-input textarea{width:100%;border-radius:var(--gov-border-radius, 0.1875rem);background-color:var(--gov-form-bg-color, var(--gov-color-neutral-white));font-family:var(--gov-font-family, "Roboto", sans-serif)}.gov-form-input input:focus,.gov-form-input select:focus,.gov-form-input textarea:focus{outline:none}.gov-form-input input:focus-visible,.gov-form-input select:focus-visible,.gov-form-input textarea:focus-visible{border-radius:var(--gov-border-radius, 0.1875rem);outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base);outline-offset:0}.gov-form-input input::-moz-placeholder,.gov-form-input select::-moz-placeholder,.gov-form-input textarea::-moz-placeholder{color:var(--gov-form-placeholder-color, var(--gov-color-secondary-600))}.gov-form-input input::placeholder,.gov-form-input select::placeholder,.gov-form-input textarea::placeholder{color:var(--gov-form-placeholder-color, var(--gov-color-secondary-600))}.gov-form-input textarea{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);padding:0.5rem 0.75rem;resize:none}.gov-form-input *[slot=left-icon],.gov-form-input *[slot=right-icon]{position:absolute;top:50%;display:flex;justify-content:center;transform:translateY(-50%);pointer-events:none}.gov-form-input *[slot=left-icon]{left:0}.gov-form-input *[slot=right-icon]{right:0}[size=s].gov-form-input{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);gap:0.5rem var(--gov-form-input-core-s-icon-size, 1rem)}[size=s].gov-form-input input,[size=s].gov-form-input select{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);height:var(--gov-form-input-core-s-height, 2rem);padding:var(--gov-form-input-core-s-padding, 0.25rem 0.75rem)}[size=s].gov-form-input *[slot=left-icon],[size=s].gov-form-input *[slot=right-icon]{width:var(--gov-form-input-core-s-icon-size, 1rem);height:var(--gov-form-input-core-s-icon-size, 1rem)}[size=s].gov-form-input *[slot=left-icon]{left:calc((var(--gov-form-input-core-s-icon-padding, 2rem) - var(--gov-form-input-core-s-icon-size, 1rem)) / 2)}[size=s].gov-form-input *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-s-icon-padding, 2rem)}[size=s].gov-form-input *[slot=right-icon]{right:calc((var(--gov-form-input-core-s-icon-padding, 2rem) - var(--gov-form-input-core-s-icon-size, 1rem)) / 2)}[size=s].gov-form-input *[slot=right-icon]~input,[size=s].gov-form-input *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-s-icon-padding, 2rem)}[size=m].gov-form-input{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);gap:0.5rem var(--gov-form-input-core-m-icon-size, 1rem)}[size=m].gov-form-input input,[size=m].gov-form-input select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);height:var(--gov-form-input-core-m-height, 2.5rem);padding:var(--gov-form-input-core-m-padding, 0.4375rem 0.75rem)}[size=m].gov-form-input *[slot=left-icon],[size=m].gov-form-input *[slot=right-icon]{width:var(--gov-form-input-core-m-icon-size, 1rem);height:var(--gov-form-input-core-m-icon-size, 1rem)}[size=m].gov-form-input *[slot=left-icon]{left:calc((var(--gov-form-input-core-m-icon-padding, 2.5rem) - var(--gov-form-input-core-m-icon-size, 1rem)) / 2)}[size=m].gov-form-input *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-m-icon-padding, 2.5rem)}[size=m].gov-form-input *[slot=right-icon]{right:calc((var(--gov-form-input-core-m-icon-padding, 2.5rem) - var(--gov-form-input-core-m-icon-size, 1rem)) / 2)}[size=m].gov-form-input *[slot=right-icon]~input,[size=m].gov-form-input *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-m-icon-padding, 2.5rem)}[size=l].gov-form-input{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);gap:0.5rem var(--gov-form-input-core-l-icon-size, 1rem)}[size=l].gov-form-input input,[size=l].gov-form-input select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);height:var(--gov-form-input-core-l-height, 3rem);padding:var(--gov-form-input-core-l-padding, 0.6875rem 0.75rem)}[size=l].gov-form-input *[slot=left-icon],[size=l].gov-form-input *[slot=right-icon]{width:var(--gov-form-input-core-l-icon-size, 1rem);height:var(--gov-form-input-core-l-icon-size, 1rem)}[size=l].gov-form-input *[slot=left-icon]{left:calc((var(--gov-form-input-core-l-icon-padding, 2.5rem) - var(--gov-form-input-core-l-icon-size, 1rem)) / 2)}[size=l].gov-form-input *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-l-icon-padding, 2.5rem)}[size=l].gov-form-input *[slot=right-icon]{right:calc((var(--gov-form-input-core-l-icon-padding, 2.5rem) - var(--gov-form-input-core-l-icon-size, 1rem)) / 2)}[size=l].gov-form-input *[slot=right-icon]~input,[size=l].gov-form-input *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-l-icon-padding, 2.5rem)}[size=xl].gov-form-input{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);gap:0.5rem var(--gov-form-input-core-xl-icon-size, 1.25rem)}[size=xl].gov-form-input input,[size=xl].gov-form-input select{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);height:var(--gov-form-input-core-xl-height, 3.5rem);padding:var(--gov-form-input-core-xl-padding, 0.9375rem 1rem 0.875rem)}[size=xl].gov-form-input *[slot=left-icon],[size=xl].gov-form-input *[slot=right-icon]{width:var(--gov-form-input-core-xl-icon-size, 1.25rem);height:var(--gov-form-input-core-xl-icon-size, 1.25rem)}[size=xl].gov-form-input *[slot=left-icon]{left:calc((var(--gov-form-input-core-xl-icon-padding, 3rem) - var(--gov-form-input-core-xl-icon-size, 1.25rem)) / 2)}[size=xl].gov-form-input *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-xl-icon-padding, 3rem)}[size=xl].gov-form-input *[slot=right-icon]{right:calc((var(--gov-form-input-core-xl-icon-padding, 3rem) - var(--gov-form-input-core-xl-icon-size, 1.25rem)) / 2)}[size=xl].gov-form-input *[slot=right-icon]~input,[size=xl].gov-form-input *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-xl-icon-padding, 3rem)}[variant=primary].gov-form-input input,[variant=primary].gov-form-input select,[variant=primary].gov-form-input textarea{color:var(--gov-form-input-color-primary, var(--gov-color-secondary-700));border:var(--gov-form-input-border-primary, 0.0625rem solid var(--gov-color-primary-600))}[variant=primary].gov-form-input *[slot=left-icon],[variant=primary].gov-form-input *[slot=right-icon]{color:var(--gov-form-input-icon-color-primary, var(--gov-color-primary))}[variant=secondary].gov-form-input input,[variant=secondary].gov-form-input select,[variant=secondary].gov-form-input textarea{color:var(--gov-form-input-color-secondary, var(--gov-color-secondary-700));border:var(--gov-form-input-border-secondary, 0.0625rem solid var(--gov-color-secondary-700))}[variant=secondary].gov-form-input *[slot=left-icon],[variant=secondary].gov-form-input *[slot=right-icon]{color:var(--gov-form-input-icon-color-secondary, var(--gov-color-primary))}[disabled=""].gov-form-input,[disabled=true i].gov-form-input,[disabled="1"].gov-form-input{pointer-events:none}[disabled=""].gov-form-input input,[disabled=""].gov-form-input select,[disabled=""].gov-form-input textarea,[disabled=true i].gov-form-input input,[disabled=true i].gov-form-input select,[disabled=true i].gov-form-input textarea,[disabled="1"].gov-form-input input,[disabled="1"].gov-form-input select,[disabled="1"].gov-form-input textarea{border-color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600));background:var(--gov-form-input-disabled-bg, var(--gov-color-secondary-300));color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[disabled=""].gov-form-input *[slot=left-icon],[disabled=""].gov-form-input *[slot=right-icon],[disabled=true i].gov-form-input *[slot=left-icon],[disabled=true i].gov-form-input *[slot=right-icon],[disabled="1"].gov-form-input *[slot=left-icon],[disabled="1"].gov-form-input *[slot=right-icon]{color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[invalid=""].gov-form-input input,[invalid=""].gov-form-input select,[invalid=""].gov-form-input textarea,[invalid=true i].gov-form-input input,[invalid=true i].gov-form-input select,[invalid=true i].gov-form-input textarea,[invalid="1"].gov-form-input input,[invalid="1"].gov-form-input select,[invalid="1"].gov-form-input textarea{border-color:var(--gov-form-state-color-error, var(--gov-color-error));color:var(--gov-form-state-color-error, var(--gov-color-error))}[invalid=""].gov-form-input input::-moz-placeholder,[invalid=""].gov-form-input select::-moz-placeholder,[invalid=""].gov-form-input textarea::-moz-placeholder,[invalid=true i].gov-form-input input::-moz-placeholder,[invalid=true i].gov-form-input select::-moz-placeholder,[invalid=true i].gov-form-input textarea::-moz-placeholder,[invalid="1"].gov-form-input input::-moz-placeholder,[invalid="1"].gov-form-input select::-moz-placeholder,[invalid="1"].gov-form-input textarea::-moz-placeholder{color:var(--gov-form-state-color-error, var(--gov-color-error-300))}[invalid=""].gov-form-input input::placeholder,[invalid=""].gov-form-input select::placeholder,[invalid=""].gov-form-input textarea::placeholder,[invalid=true i].gov-form-input input::placeholder,[invalid=true i].gov-form-input select::placeholder,[invalid=true i].gov-form-input textarea::placeholder,[invalid="1"].gov-form-input input::placeholder,[invalid="1"].gov-form-input select::placeholder,[invalid="1"].gov-form-input textarea::placeholder{color:var(--gov-form-state-color-error, var(--gov-color-error-300))}[invalid=""].gov-form-input *[slot=left-icon],[invalid=""].gov-form-input *[slot=right-icon],[invalid=true i].gov-form-input *[slot=left-icon],[invalid=true i].gov-form-input *[slot=right-icon],[invalid="1"].gov-form-input *[slot=left-icon],[invalid="1"].gov-form-input *[slot=right-icon]{color:var(--gov-form-state-color-error, var(--gov-color-error))}[success=""].gov-form-input *[slot=right-icon],[success=true i].gov-form-input *[slot=right-icon],[success="1"].gov-form-input *[slot=right-icon]{color:var(--gov-form-state-color-success, var(--gov-color-success))}[success=""].gov-form-input *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[success=true i].gov-form-input *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[success="1"].gov-form-input *[slot=right-icon]:not(.icon-validation):not(.icon-arrow){display:none}.gov-form-input[invalid=""] *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),.gov-form-input[invalid=true i] *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),.gov-form-input[invalid="1"] *[slot=right-icon]:not(.icon-validation):not(.icon-arrow){display:none}.gov-form-input[type=reset] input{border-width:0}.gov-form-input[type=reset] input:focus{outline:none}';var b;(function(o){o["INPUT"]="input";o["TEXTAREA"]="textarea"})(b||(b={}));const w=o(class o extends i{constructor(){super();this.__registerHost();this.govFocus=t(this,"gov-focus",7);this.govBlur=t(this,"gov-blur",7);this.govInput=t(this,"gov-input",7);this.govKeyUp=t(this,"gov-keyup",7);this.govKeyDown=t(this,"gov-keydown",7);this.value=undefined;this.identifier=undefined;this.variant="secondary";this.success=undefined;this.size="m";this.name=undefined;this.multiline=undefined;this.rows=undefined;this.cols=undefined;this.required=false;this.disabled=undefined;this.placeholder=undefined;this.readonly=undefined;this.minlength=undefined;this.maxlength=undefined;this.min=undefined;this.max=undefined;this.autocomplete=undefined;this.autocorrect=undefined;this.type=undefined;this.inputType="text";this.role=undefined;this.invalid=undefined;this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.wcagOwns=undefined;this.wcagAutocomplete=undefined;this.wcagExpanded=undefined;this.focused=undefined;this.h=v(this.host);this.inputId=h("GovInput");this.f=n(this.h)}validateVariant(o){u(s,o,a.root)}validateSize(o){u(l,o,a.root)}watchDisabled(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("disabled",g(this.disabled));this.f.passAttrToControl("invalid",g(this.invalid));this.f.passAttrToControl("type",this.multiline?b.TEXTAREA:b.INPUT)}componentWillLoad(){this.validateVariant(this.variant);this.validateSize(this.size);this.passControlAttrs();this.f.passAttrToLabel("required",String(this.required))}async componentDidRender(){if(m()){await x(500);await this.validateWcag()}}render(){const o=this.multiline?b.TEXTAREA:b.INPUT;return e(r,{class:a.root,size:this.size,variant:this.variant,type:this.type},this.h.hasSlot("prefix")&&e("slot",{name:"prefix"}),e("span",{class:"element"},this.h.hasSlot("left-icon")&&e("slot",{name:"left-icon"}),this.h.hasSlot("right-icon")&&!(this.success||this.invalid)&&e("slot",{name:"right-icon"}),this.success&&!this.multiline&&e("gov-icon",{slot:"right-icon",class:"icon-validation",name:"check-lg"}),this.invalid&&!this.multiline&&e("gov-icon",{slot:"right-icon",class:"icon-validation",name:"exclamation-lg"}),e(o,{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:o=>this.inputRef=o,placeholder:this.placeholder,value:this.value,readonly:c(this.readonly),autocomplete:p(this.autocomplete),autocorrect:p(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":c(this.required),"aria-invalid":c(this.invalid),"aria-disabled":c(this.disabled),"aria-describedby":this.wcagDescribedBy,"aria-labelledby":this.wcagLabelledBy,"aria-owns":this.wcagOwns,"aria-expanded":c(this.wcagExpanded),"aria-autocomplete":this.wcagAutocomplete})),this.h.hasSlot("sufix")&&e("slot",{name:"sufix"}))}onFocusHandler(o){o.stopPropagation();this.focused=true;this.govFocus.emit({component:a.root,value:this.value,originalEvent:o})}onBlurHandler(o){o.stopPropagation();this.focused=false;this.govBlur.emit({component:a.root,value:this.value,originalEvent:o})}onKeyUpHandler(o){o.stopPropagation();this.govKeyUp.emit({component:a.root,value:this.value,originalEvent:o})}onKeyDownHandler(o){o.stopPropagation();this.govKeyDown.emit({component:a.root,value:this.value,originalEvent:o})}onInputHandler(o){this.value=o.target.value;o.stopPropagation();this.govInput.emit({component:a.root,value:this.value,originalEvent:o})}async setFocus(o){return this.inputRef.focus(o)}async setValue(o){this.value=o}async clearValue(){this.value="";this.inputRef.value=""}async getRef(){return this.inputRef}async validateWcag(){d(this.wcagDescribedBy,"wcag-described-by",a.root);d(this.wcagLabelledBy,"wcag-labelled-by",a.root);d(this.wcagOwns,"wcag-owns",a.root);f(this.identifier||this.inputId,this.wcagLabelledBy,a.root)}get host(){return this}static get watchers(){return{variant:["validateVariant"],size:["validateSize","watchDisabled"],disabled:["watchDisabled"],invalid:["watchDisabled"],type:["watchDisabled"]}}static get style(){return y}},[4,"gov-form-input",{value:[1537],identifier:[1],variant:[1],success:[4],size:[1],name:[1],multiline:[4],rows:[2],cols:[2],required:[4],disabled:[4],placeholder:[1],readonly:[4],minlength:[2],maxlength:[2],min:[8],max:[8],autocomplete:[4],autocorrect:[4],type:[1],inputType:[1,"input-type"],role:[1],invalid:[4],wcagDescribedBy:[1,"wcag-described-by"],wcagLabelledBy:[1,"wcag-labelled-by"],wcagOwns:[1,"wcag-owns"],wcagAutocomplete:[1,"wcag-autocomplete"],wcagExpanded:[4,"wcag-expanded"],focused:[32],setFocus:[64],setValue:[64],clearValue:[64],getRef:[64],validateWcag:[64]}]);function k(){if(typeof customElements==="undefined"){return}const o=["gov-form-input","gov-icon"];o.forEach((o=>{switch(o){case"gov-form-input":if(!customElements.get(o)){customElements.define(o,w)}break;case"gov-icon":if(!customElements.get(o)){z()}break}}))}k();export{w as G,k as d};
2
- //# sourceMappingURL=p-baf87688.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["govFormInputCss","Tags","GovFormInput","proxyCustomElement","H","constructor","this","h","govHost","host","inputId","createID","f","govForm","validateVariant","newValue","validateProp","FormInputVariants","FormInputClass","root","validateSize","FormInputSizes","watchDisabled","passControlAttrs","passAttrToControl","size","toBoolAttr","disabled","invalid","multiline","TEXTAREA","INPUT","componentWillLoad","variant","passAttrToLabel","String","required","componentDidRender","canValidateWcagOnRender","delay","validateWcag","render","Tag","Host","class","type","hasSlot","name","success","slot","inputType","id","identifier","onFocus","onFocusHandler","bind","onInput","onInputHandler","onBlur","onBlurHandler","onKeyUp","onKeyUpHandler","onKeyDown","onKeyDownHandler","ref","el","inputRef","placeholder","value","readonly","toBoolAttrIfDefined","autocomplete","toOnOffAttrIfDefined","autocorrect","minlength","maxlength","min","max","rows","cols","role","wcagDescribedBy","wcagLabelledBy","wcagOwns","wcagExpanded","wcagAutocomplete","e","stopPropagation","focused","govFocus","emit","component","originalEvent","govBlur","govKeyUp","govKeyDown","target","govInput","setFocus","options","focus","setValue","clearValue","getRef","validateWcagRef","validateWcagLabelFor"],"sources":["../../../packages/core/src/components/gov-form/input/gov-form-input.scss?tag=gov-form-input","../../../packages/core/src/components/gov-form/input/gov-form-input.tsx"],"sourcesContent":["/*\n * Input\n */\n\n@import \"../input/gov-form-input-core.scss\";\n$class: \".gov-form-input\";\n\n#{$class} {\n\t@extend %form-input-core;\n\n\t// STATES\n\t@include parameter(\"invalid\") {\n\t\t*[slot=\"right-icon\"]:not(.icon-validation):not(.icon-arrow) {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t// VARIANTS\n\t&[type=\"reset\"] {\n\t\tinput {\n\t\t\tborder-width: 0;\n\t\t\t&:focus {\n\t\t\t\toutline: none;\n\t\t\t}\n\t\t}\n\t}\n}\n","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"],"mappings":"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"}
@@ -1,2 +0,0 @@
1
- import{r as o,c as a,h as e,H as t,g as i}from"./p-10cbc3fe.js";import{c as r}from"./p-24636c53.js";import{b as s}from"./p-ae894a40.js";import{M as d}from"./p-be4aab0e.js";import{c as l}from"./p-cac3881f.js";import{d as n}from"./p-03990da5.js";import{g as m,a as g}from"./p-3f37ddb6.js";import{a as c}from"./p-561fa17b.js";const v='.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-modal{display:none}.gov-modal__dialog{z-index:101;position:fixed;top:50%;left:50%;display:flex;justify-content:center;align-items:center;width:100%;max-width:var(--gov-modal-max-width, 52.5rem);height:100%;padding:0.5rem;border:none;background:transparent;transform:translate(-50%, -50%);pointer-events:none}.gov-modal__inner{position:relative;display:flex;flex-direction:column;width:100%;max-height:100%;border-radius:var(--gov-border-radius, 0.1875rem);background:var(--gov-modal-bg, var(--gov-color-neutral-white));overflow:hidden;pointer-events:auto;box-shadow:0 0 1.5rem rgba(var(--gov-color-secondary-800-rgb), 0.24)}.gov-modal__header{display:flex;gap:1rem;align-items:flex-start;padding:1.5rem 1rem;border-bottom:var(--gov-modal-border-color, 0.0625rem solid var(--gov-color-secondary-500))}.gov-modal__icon{flex:0 0 auto;padding-top:calc((var(--gov-text-3xl-font-size) * 1.5 - 1.5rem) / 2)}.gov-modal__icon>*{width:1.5rem;height:1.5rem}.gov-modal__title{font-weight:var(--gov-text-3xl-font-weight);font-size:var(--gov-text-3xl-font-size);line-height:var(--gov-text-3xl-line-height);letter-spacing:var(--gov-text-3xl-letter-spacing);margin:0}.gov-modal__close{flex:0 0 auto;margin-left:auto;padding-top:calc((var(--gov-text-3xl-font-size) * 1.5 - 2rem) / 2)}.gov-modal__content{height:100%;padding:1.5rem 1rem;color:var(--gov-modal-text-color, var(--gov-color-secondary-700));overflow:auto}.gov-modal__content>*:last-child{margin-bottom:0}.gov-modal__footer,.gov-modal__actions{padding:1.5rem 1rem;border-top:var(--gov-modal-border-color, 0.0625rem solid var(--gov-color-secondary-500))}.gov-modal__actions{display:flex;gap:0.5rem 1rem;flex-wrap:wrap;justify-content:flex-end}.gov-modal__dialog:focus .gov-modal__inner{outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base)}.gov-modal[open=""],.gov-modal[open=true i],.gov-modal[open="1"]{display:block}@media (min-width: 30em){.gov-modal__dialog{max-width:calc(var(--gov-modal-max-width, 52.5rem) + 3rem);padding:1.5rem}.gov-modal__dialog:focus{outline-offset:-1.5rem}.gov-modal__inner{box-shadow:0 0 2rem rgba(var(--gov-color-secondary-800-rgb), 0.32)}.gov-modal--prompt .gov-modal__dialog{max-width:calc(var(--gov-modal-prompt-max-width, 33.125rem) + 3rem)}}@media (min-width: 48em){.gov-modal__header{gap:1.25rem;padding:2rem 2.5rem 2rem 3rem}.gov-modal__close{padding-top:calc((var(--gov-text-3xl-font-size) * 1.5 - 2.5rem) / 2)}.gov-modal__content{padding:2rem 3rem}.gov-modal__footer{padding:1rem 3rem}.gov-modal--prompt .gov-modal__header,.gov-modal--prompt .gov-modal__content,.gov-modal--prompt .gov-modal__footer,.gov-modal--prompt .gov-modal__actions{padding:1.5rem}}';const h=class{constructor(e){o(this,e);this.govClose=a(this,"gov-close",7);this.open=false;this.label=undefined;this.role="dialog";this.labelTag="h2";this.wcagLabelledBy=undefined;this.wcagDescribedBy=undefined;this.wcagCloseLabel=undefined;this.wcagCloseLabelledBy=undefined;this.h=m(this.host);this.labelId=r("GovPromptLabel");this.contentId=r("GovPromptContent")}validateLabelTag(o){const a=["h1","h2","h3","h4","h5","h6"];if(o){if(!a.includes(o)){c(`[${d.root}]: Tag ${o} is not allowed.`)}}}watchOpen(o){this.open=o}showModal(){this.open=true;document.body.classList.add(d.bodyFix)}hideModal(){this.open=false;document.body.classList.remove(d.bodyFix)}async componentWillRender(){if(this.open){this.showModal()}else{this.hideModal()}}async componentDidRender(){if(l()){await n(500);await this.validateWcag()}}render(){const o=this.labelTag;return e(t,{class:this.h.classes(d.rootPrompt),open:this.open},e("dialog",{class:d.dialog,hidden:!this.open,tabindex:"-1",open:this.open,"aria-modal":"true","aria-hidden":g(!this.open),"aria-labelledby":this.wcagLabelledBy||this.labelId,"aria-describedby":this.wcagDescribedBy||this.contentId,role:this.role},e("div",{class:d.inner},e("div",{class:d.header},this.h.hasSlot("icon")&&e("div",{class:d.icon},e("slot",{name:"icon"})),this.label&&e(o,{class:d.title,id:this.labelId},this.label),e("gov-button",{class:d.close,variant:"primary",wcagLabel:this.wcagCloseLabel,wcagLabelledBy:this.wcagCloseLabelledBy,type:"base","on-gov-click":this.onCloseHandler.bind(this)},e("gov-icon",{name:"x-lg"}))),e("div",{class:d.content,id:this.contentId},e("slot",null)),e("div",{class:d.actions},e("slot",{name:"actions"})))),this.open?e("gov-backdrop",{"wcag-label":this.wcagCloseLabel,"wcag-labelled-by":this.wcagCloseLabelledBy,"on-gov-click":this.onCloseHandler.bind(this)}):null)}onCloseHandler(o){o.stopPropagation();this.hideModal();this.govClose.emit(o)}async show(){this.showModal()}async hide(){this.hideModal()}async validateWcag(){s(this.wcagLabelledBy,"wcag-labelled-by",d.root);s(this.wcagDescribedBy,"wcag-described-by",d.root)}get host(){return i(this)}static get watchers(){return{labelTag:["validateLabelTag"],open:["watchOpen"]}}};h.style=v;export{h as gov_prompt};
2
- //# sourceMappingURL=p-22a86871.entry.js.map
@@ -1,2 +0,0 @@
1
- import{r as o,c as i,h as t,H as r,g as e}from"./p-10cbc3fe.js";import{g as n,k as a,l as s,m as l}from"./p-34ed07f6.js";import{g as v,a as g,t as c,c as p}from"./p-3f37ddb6.js";import{c as m}from"./p-cac3881f.js";import{v as f}from"./p-26acf964.js";import{b as d,c as u}from"./p-ae894a40.js";import{c as h}from"./p-24636c53.js";import{d as z}from"./p-03990da5.js";import"./p-55500e5a.js";import"./p-ff7365ae.js";import"./p-6278531b.js";import"./p-9dab01be.js";import"./p-3464136c.js";import"./p-561fa17b.js";const x='.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-form-input{position:relative;display:flex;width:100%;align-items:center}.gov-form-input .element{position:relative;display:flex;flex:1 1 auto}.gov-form-input input,.gov-form-input select,.gov-form-input textarea{width:100%;border-radius:var(--gov-border-radius, 0.1875rem);background-color:var(--gov-form-bg-color, var(--gov-color-neutral-white));font-family:var(--gov-font-family, "Roboto", sans-serif)}.gov-form-input input:focus,.gov-form-input select:focus,.gov-form-input textarea:focus{outline:none}.gov-form-input input:focus-visible,.gov-form-input select:focus-visible,.gov-form-input textarea:focus-visible{border-radius:var(--gov-border-radius, 0.1875rem);outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base);outline-offset:0}.gov-form-input input::-moz-placeholder,.gov-form-input select::-moz-placeholder,.gov-form-input textarea::-moz-placeholder{color:var(--gov-form-placeholder-color, var(--gov-color-secondary-600))}.gov-form-input input::placeholder,.gov-form-input select::placeholder,.gov-form-input textarea::placeholder{color:var(--gov-form-placeholder-color, var(--gov-color-secondary-600))}.gov-form-input textarea{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);padding:0.5rem 0.75rem;resize:none}.gov-form-input *[slot=left-icon],.gov-form-input *[slot=right-icon]{position:absolute;top:50%;display:flex;justify-content:center;transform:translateY(-50%);pointer-events:none}.gov-form-input *[slot=left-icon]{left:0}.gov-form-input *[slot=right-icon]{right:0}[size=s].gov-form-input{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);gap:0.5rem var(--gov-form-input-core-s-icon-size, 1rem)}[size=s].gov-form-input input,[size=s].gov-form-input select{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);height:var(--gov-form-input-core-s-height, 2rem);padding:var(--gov-form-input-core-s-padding, 0.25rem 0.75rem)}[size=s].gov-form-input *[slot=left-icon],[size=s].gov-form-input *[slot=right-icon]{width:var(--gov-form-input-core-s-icon-size, 1rem);height:var(--gov-form-input-core-s-icon-size, 1rem)}[size=s].gov-form-input *[slot=left-icon]{left:calc((var(--gov-form-input-core-s-icon-padding, 2rem) - var(--gov-form-input-core-s-icon-size, 1rem)) / 2)}[size=s].gov-form-input *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-s-icon-padding, 2rem)}[size=s].gov-form-input *[slot=right-icon]{right:calc((var(--gov-form-input-core-s-icon-padding, 2rem) - var(--gov-form-input-core-s-icon-size, 1rem)) / 2)}[size=s].gov-form-input *[slot=right-icon]~input,[size=s].gov-form-input *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-s-icon-padding, 2rem)}[size=m].gov-form-input{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);gap:0.5rem var(--gov-form-input-core-m-icon-size, 1rem)}[size=m].gov-form-input input,[size=m].gov-form-input select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);height:var(--gov-form-input-core-m-height, 2.5rem);padding:var(--gov-form-input-core-m-padding, 0.4375rem 0.75rem)}[size=m].gov-form-input *[slot=left-icon],[size=m].gov-form-input *[slot=right-icon]{width:var(--gov-form-input-core-m-icon-size, 1rem);height:var(--gov-form-input-core-m-icon-size, 1rem)}[size=m].gov-form-input *[slot=left-icon]{left:calc((var(--gov-form-input-core-m-icon-padding, 2.5rem) - var(--gov-form-input-core-m-icon-size, 1rem)) / 2)}[size=m].gov-form-input *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-m-icon-padding, 2.5rem)}[size=m].gov-form-input *[slot=right-icon]{right:calc((var(--gov-form-input-core-m-icon-padding, 2.5rem) - var(--gov-form-input-core-m-icon-size, 1rem)) / 2)}[size=m].gov-form-input *[slot=right-icon]~input,[size=m].gov-form-input *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-m-icon-padding, 2.5rem)}[size=l].gov-form-input{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);gap:0.5rem var(--gov-form-input-core-l-icon-size, 1rem)}[size=l].gov-form-input input,[size=l].gov-form-input select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);height:var(--gov-form-input-core-l-height, 3rem);padding:var(--gov-form-input-core-l-padding, 0.6875rem 0.75rem)}[size=l].gov-form-input *[slot=left-icon],[size=l].gov-form-input *[slot=right-icon]{width:var(--gov-form-input-core-l-icon-size, 1rem);height:var(--gov-form-input-core-l-icon-size, 1rem)}[size=l].gov-form-input *[slot=left-icon]{left:calc((var(--gov-form-input-core-l-icon-padding, 2.5rem) - var(--gov-form-input-core-l-icon-size, 1rem)) / 2)}[size=l].gov-form-input *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-l-icon-padding, 2.5rem)}[size=l].gov-form-input *[slot=right-icon]{right:calc((var(--gov-form-input-core-l-icon-padding, 2.5rem) - var(--gov-form-input-core-l-icon-size, 1rem)) / 2)}[size=l].gov-form-input *[slot=right-icon]~input,[size=l].gov-form-input *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-l-icon-padding, 2.5rem)}[size=xl].gov-form-input{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);gap:0.5rem var(--gov-form-input-core-xl-icon-size, 1.25rem)}[size=xl].gov-form-input input,[size=xl].gov-form-input select{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);height:var(--gov-form-input-core-xl-height, 3.5rem);padding:var(--gov-form-input-core-xl-padding, 0.9375rem 1rem 0.875rem)}[size=xl].gov-form-input *[slot=left-icon],[size=xl].gov-form-input *[slot=right-icon]{width:var(--gov-form-input-core-xl-icon-size, 1.25rem);height:var(--gov-form-input-core-xl-icon-size, 1.25rem)}[size=xl].gov-form-input *[slot=left-icon]{left:calc((var(--gov-form-input-core-xl-icon-padding, 3rem) - var(--gov-form-input-core-xl-icon-size, 1.25rem)) / 2)}[size=xl].gov-form-input *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-xl-icon-padding, 3rem)}[size=xl].gov-form-input *[slot=right-icon]{right:calc((var(--gov-form-input-core-xl-icon-padding, 3rem) - var(--gov-form-input-core-xl-icon-size, 1.25rem)) / 2)}[size=xl].gov-form-input *[slot=right-icon]~input,[size=xl].gov-form-input *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-xl-icon-padding, 3rem)}[variant=primary].gov-form-input input,[variant=primary].gov-form-input select,[variant=primary].gov-form-input textarea{color:var(--gov-form-input-color-primary, var(--gov-color-secondary-700));border:var(--gov-form-input-border-primary, 0.0625rem solid var(--gov-color-primary-600))}[variant=primary].gov-form-input *[slot=left-icon],[variant=primary].gov-form-input *[slot=right-icon]{color:var(--gov-form-input-icon-color-primary, var(--gov-color-primary))}[variant=secondary].gov-form-input input,[variant=secondary].gov-form-input select,[variant=secondary].gov-form-input textarea{color:var(--gov-form-input-color-secondary, var(--gov-color-secondary-700));border:var(--gov-form-input-border-secondary, 0.0625rem solid var(--gov-color-secondary-700))}[variant=secondary].gov-form-input *[slot=left-icon],[variant=secondary].gov-form-input *[slot=right-icon]{color:var(--gov-form-input-icon-color-secondary, var(--gov-color-primary))}[disabled=""].gov-form-input,[disabled=true i].gov-form-input,[disabled="1"].gov-form-input{pointer-events:none}[disabled=""].gov-form-input input,[disabled=""].gov-form-input select,[disabled=""].gov-form-input textarea,[disabled=true i].gov-form-input input,[disabled=true i].gov-form-input select,[disabled=true i].gov-form-input textarea,[disabled="1"].gov-form-input input,[disabled="1"].gov-form-input select,[disabled="1"].gov-form-input textarea{border-color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600));background:var(--gov-form-input-disabled-bg, var(--gov-color-secondary-300));color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[disabled=""].gov-form-input *[slot=left-icon],[disabled=""].gov-form-input *[slot=right-icon],[disabled=true i].gov-form-input *[slot=left-icon],[disabled=true i].gov-form-input *[slot=right-icon],[disabled="1"].gov-form-input *[slot=left-icon],[disabled="1"].gov-form-input *[slot=right-icon]{color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[invalid=""].gov-form-input input,[invalid=""].gov-form-input select,[invalid=""].gov-form-input textarea,[invalid=true i].gov-form-input input,[invalid=true i].gov-form-input select,[invalid=true i].gov-form-input textarea,[invalid="1"].gov-form-input input,[invalid="1"].gov-form-input select,[invalid="1"].gov-form-input textarea{border-color:var(--gov-form-state-color-error, var(--gov-color-error));color:var(--gov-form-state-color-error, var(--gov-color-error))}[invalid=""].gov-form-input input::-moz-placeholder,[invalid=""].gov-form-input select::-moz-placeholder,[invalid=""].gov-form-input textarea::-moz-placeholder,[invalid=true i].gov-form-input input::-moz-placeholder,[invalid=true i].gov-form-input select::-moz-placeholder,[invalid=true i].gov-form-input textarea::-moz-placeholder,[invalid="1"].gov-form-input input::-moz-placeholder,[invalid="1"].gov-form-input select::-moz-placeholder,[invalid="1"].gov-form-input textarea::-moz-placeholder{color:var(--gov-form-state-color-error, var(--gov-color-error-300))}[invalid=""].gov-form-input input::placeholder,[invalid=""].gov-form-input select::placeholder,[invalid=""].gov-form-input textarea::placeholder,[invalid=true i].gov-form-input input::placeholder,[invalid=true i].gov-form-input select::placeholder,[invalid=true i].gov-form-input textarea::placeholder,[invalid="1"].gov-form-input input::placeholder,[invalid="1"].gov-form-input select::placeholder,[invalid="1"].gov-form-input textarea::placeholder{color:var(--gov-form-state-color-error, var(--gov-color-error-300))}[invalid=""].gov-form-input *[slot=left-icon],[invalid=""].gov-form-input *[slot=right-icon],[invalid=true i].gov-form-input *[slot=left-icon],[invalid=true i].gov-form-input *[slot=right-icon],[invalid="1"].gov-form-input *[slot=left-icon],[invalid="1"].gov-form-input *[slot=right-icon]{color:var(--gov-form-state-color-error, var(--gov-color-error))}[success=""].gov-form-input *[slot=right-icon],[success=true i].gov-form-input *[slot=right-icon],[success="1"].gov-form-input *[slot=right-icon]{color:var(--gov-form-state-color-success, var(--gov-color-success))}[success=""].gov-form-input *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[success=true i].gov-form-input *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[success="1"].gov-form-input *[slot=right-icon]:not(.icon-validation):not(.icon-arrow){display:none}.gov-form-input[invalid=""] *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),.gov-form-input[invalid=true i] *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),.gov-form-input[invalid="1"] *[slot=right-icon]:not(.icon-validation):not(.icon-arrow){display:none}.gov-form-input[type=reset] input{border-width:0}.gov-form-input[type=reset] input:focus{outline:none}';var b;(function(o){o["INPUT"]="input";o["TEXTAREA"]="textarea"})(b||(b={}));const y=class{constructor(t){o(this,t);this.govFocus=i(this,"gov-focus",7);this.govBlur=i(this,"gov-blur",7);this.govInput=i(this,"gov-input",7);this.govKeyUp=i(this,"gov-keyup",7);this.govKeyDown=i(this,"gov-keydown",7);this.value=undefined;this.identifier=undefined;this.variant="secondary";this.success=undefined;this.size="m";this.name=undefined;this.multiline=undefined;this.rows=undefined;this.cols=undefined;this.required=false;this.disabled=undefined;this.placeholder=undefined;this.readonly=undefined;this.minlength=undefined;this.maxlength=undefined;this.min=undefined;this.max=undefined;this.autocomplete=undefined;this.autocorrect=undefined;this.type=undefined;this.inputType="text";this.role=undefined;this.invalid=undefined;this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.wcagOwns=undefined;this.wcagAutocomplete=undefined;this.wcagExpanded=undefined;this.focused=undefined;this.h=v(this.host);this.inputId=h("GovInput");this.f=n(this.h)}validateVariant(o){f(s,o,a.root)}validateSize(o){f(l,o,a.root)}watchDisabled(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("disabled",g(this.disabled));this.f.passAttrToControl("invalid",g(this.invalid));this.f.passAttrToControl("type",this.multiline?b.TEXTAREA:b.INPUT)}componentWillLoad(){this.validateVariant(this.variant);this.validateSize(this.size);this.passControlAttrs();this.f.passAttrToLabel("required",String(this.required))}async componentDidRender(){if(m()){await z(500);await this.validateWcag()}}render(){const o=this.multiline?b.TEXTAREA:b.INPUT;return t(r,{class:a.root,size:this.size,variant:this.variant,type:this.type},this.h.hasSlot("prefix")&&t("slot",{name:"prefix"}),t("span",{class:"element"},this.h.hasSlot("left-icon")&&t("slot",{name:"left-icon"}),this.h.hasSlot("right-icon")&&!(this.success||this.invalid)&&t("slot",{name:"right-icon"}),this.success&&!this.multiline&&t("gov-icon",{slot:"right-icon",class:"icon-validation",name:"check-lg"}),this.invalid&&!this.multiline&&t("gov-icon",{slot:"right-icon",class:"icon-validation",name:"exclamation-lg"}),t(o,{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:o=>this.inputRef=o,placeholder:this.placeholder,value:this.value,readonly:c(this.readonly),autocomplete:p(this.autocomplete),autocorrect:p(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":c(this.required),"aria-invalid":c(this.invalid),"aria-disabled":c(this.disabled),"aria-describedby":this.wcagDescribedBy,"aria-labelledby":this.wcagLabelledBy,"aria-owns":this.wcagOwns,"aria-expanded":c(this.wcagExpanded),"aria-autocomplete":this.wcagAutocomplete})),this.h.hasSlot("sufix")&&t("slot",{name:"sufix"}))}onFocusHandler(o){o.stopPropagation();this.focused=true;this.govFocus.emit({component:a.root,value:this.value,originalEvent:o})}onBlurHandler(o){o.stopPropagation();this.focused=false;this.govBlur.emit({component:a.root,value:this.value,originalEvent:o})}onKeyUpHandler(o){o.stopPropagation();this.govKeyUp.emit({component:a.root,value:this.value,originalEvent:o})}onKeyDownHandler(o){o.stopPropagation();this.govKeyDown.emit({component:a.root,value:this.value,originalEvent:o})}onInputHandler(o){this.value=o.target.value;o.stopPropagation();this.govInput.emit({component:a.root,value:this.value,originalEvent:o})}async setFocus(o){return this.inputRef.focus(o)}async setValue(o){this.value=o}async clearValue(){this.value="";this.inputRef.value=""}async getRef(){return this.inputRef}async validateWcag(){d(this.wcagDescribedBy,"wcag-described-by",a.root);d(this.wcagLabelledBy,"wcag-labelled-by",a.root);d(this.wcagOwns,"wcag-owns",a.root);u(this.identifier||this.inputId,this.wcagLabelledBy,a.root)}get host(){return e(this)}static get watchers(){return{variant:["validateVariant"],size:["validateSize","watchDisabled"],disabled:["watchDisabled"],invalid:["watchDisabled"],type:["watchDisabled"]}}};y.style=x;export{y as gov_form_input};
2
- //# sourceMappingURL=p-23385300.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["govFormInputCss","Tags","GovFormInput","constructor","hostRef","this","h","govHost","host","inputId","createID","f","govForm","validateVariant","newValue","validateProp","FormInputVariants","FormInputClass","root","validateSize","FormInputSizes","watchDisabled","passControlAttrs","passAttrToControl","size","toBoolAttr","disabled","invalid","multiline","TEXTAREA","INPUT","componentWillLoad","variant","passAttrToLabel","String","required","componentDidRender","canValidateWcagOnRender","delay","validateWcag","render","Tag","Host","class","type","hasSlot","name","success","slot","inputType","id","identifier","onFocus","onFocusHandler","bind","onInput","onInputHandler","onBlur","onBlurHandler","onKeyUp","onKeyUpHandler","onKeyDown","onKeyDownHandler","ref","el","inputRef","placeholder","value","readonly","toBoolAttrIfDefined","autocomplete","toOnOffAttrIfDefined","autocorrect","minlength","maxlength","min","max","rows","cols","role","wcagDescribedBy","wcagLabelledBy","wcagOwns","wcagExpanded","wcagAutocomplete","e","stopPropagation","focused","govFocus","emit","component","originalEvent","govBlur","govKeyUp","govKeyDown","target","govInput","setFocus","options","focus","setValue","clearValue","getRef","validateWcagRef","validateWcagLabelFor"],"sources":["../../../packages/core/src/components/gov-form/input/gov-form-input.scss?tag=gov-form-input","../../../packages/core/src/components/gov-form/input/gov-form-input.tsx"],"sourcesContent":["/*\n * Input\n */\n\n@import \"../input/gov-form-input-core.scss\";\n$class: \".gov-form-input\";\n\n#{$class} {\n\t@extend %form-input-core;\n\n\t// STATES\n\t@include parameter(\"invalid\") {\n\t\t*[slot=\"right-icon\"]:not(.icon-validation):not(.icon-arrow) {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t// VARIANTS\n\t&[type=\"reset\"] {\n\t\tinput {\n\t\t\tborder-width: 0;\n\t\t\t&:focus {\n\t\t\t\toutline: none;\n\t\t\t}\n\t\t}\n\t}\n}\n","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"],"mappings":"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"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["ToastVariants","pick","Variants","Types","ToastClass","root","hidden","icon","content","close","timer","govToastCss","GovToast","constructor","hostRef","this","h","govHost","host","toastId","createID","validateVariant","newValue","validateProp","componentWillLoad","variant","runTimer","componentDidLoad","existedToasts","document","querySelectorAll","gravity","position","length","Array","from","map","toast","destroy","then","disconnectedCallback","clearTimeout","timeout","isSolid","classList","add","isTimer","setTimeout","bind","time","render","Host","class","classes","type","style","hasSlot","name","role","size","wcagCloseLabel","inverse","onCloseHandler","closeLabel","govClose","emit","catch","Number","isInteger","querySelector","remove"],"sources":["../../../packages/core/src/components/gov-toast/constants.ts","../../../packages/core/src/components/gov-toast/gov-toast.scss?tag=gov-toast","../../../packages/core/src/components/gov-toast/gov-toast.tsx"],"sourcesContent":["import { Variants, Types } from '../../core/constants/variants'\nimport { pick } from '../../utils/utils'\nimport { ValueOf } from '../../types/interfaces'\n\nexport const ToastVariants = pick(Variants, ['SUCCESS', 'WARNING', 'ERROR', 'SECONDARY', 'PRIMARY'])\nexport type ToastVariantType = `${ValueOf<typeof ToastVariants>}`\n\nexport const ToastTypes = pick(Types, ['CLASSIC', 'SOLID'])\nexport type ToastTypesType = `${ValueOf<typeof ToastTypes>}`\n\nexport const ToastClass = {\n\troot: 'gov-toast',\n\thidden: 'gov-toast--hidden',\n\ticon: 'gov-toast__icon',\n\tcontent: 'gov-toast__content',\n\tclose: 'gov-toast__close',\n\ttimer: 'gov-toast__timer',\n}\n","/*\n * Alert\n */\n\n@import \"./gov-toast-message-core.scss\";\n$class: \".gov-toast\";\n\n#{$class} {\n\t@include toast-message-core;\n\t@include z-index(\"toast\", 1);\n\tposition: relative;\n\tposition: fixed;\n\tmax-width: rem-calc(375);\n\tpadding-right: rem-calc(50);\n\topacity: 1;\n\ttransition: opacity 300ms ease-in-out;\n\t&__content {\n\t\tpadding-right: 0;\n\t}\n\t&__close {\n\t\tposition: absolute;\n\t\ttop: rem-calc(8);\n\t\tright: rem-calc(12);\n\t}\n\t&__timer {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tleft: 0;\n\t\tz-index: -1;\n\t}\n\n\t// VARIANTS\n\t&--hidden {\n\t\topacity: 0;\n\t}\n\t&[gravity=\"top\" i] {\n\t\ttop: rem-calc(16);\n\t}\n\t&[gravity=\"bottom\" i] {\n\t\tbottom: rem-calc(16);\n\t}\n\t&[position=\"left\" i] {\n\t\tleft: rem-calc(16);\n\t}\n\t&[position=\"center\" i] {\n\t\tleft: 50%;\n\t\ttransform: translateX(-50%);\n\t}\n\t&[position=\"right\" i] {\n\t\tright: rem-calc(16);\n\t}\n\t&[type=\"solid\" i] {\n\t\tborder: none;\n\t\tborder-radius: rem-calc(4);\n\t\toverflow: hidden;\n\t\tbox-shadow: none;\n\t\t&.is-initialized #{$class}__timer {\n\t\t\ttransform-origin: left;\n\t\t\tanimation: countdown linear forwards var(--toast-duration, 0);\n\t\t}\n\t}\n\n\t@each $variant, $definitions in $toast-message-variants {\n\t\t&[variant=\"#{$variant}\"] {\n\t\t\tborder-left-color: get(\"decor-color\", $definitions);\n\t\t\t#{$class} {\n\t\t\t\t&__icon {\n\t\t\t\t\tcolor: get(\"decor-color\", $definitions);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t&[type=\"solid\" i] {\n\t\t\t\tbackground-color: get(\"background\", $definitions);\n\t\t\t\tcolor: get(\"color\", $definitions);\n\t\t\t\t#{$class} {\n\t\t\t\t\t&__icon {\n\t\t\t\t\t\tcolor: get(\"color\", $definitions);\n\t\t\t\t\t}\n\t\t\t\t\t&__timer {\n\t\t\t\t\t\tbackground-color: get(\"timer-background\", $definitions);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// MQ\n\t@include mq($from: sm) {\n\t\t&__content {\n\t\t\tpadding-right: rem-calc(32);\n\t\t}\n\t}\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Prop, Watch, Method } from '@stencil/core'\nimport { validateProp } from '../../helpers/Validate/props'\nimport { ToastClass, ToastTypesType, ToastVariants } from './constants'\nimport { govHost } from '../../helpers/Dom/template'\nimport { GovHost } from '../../helpers/Dom/template.types'\nimport { ToastVariantType } from './constants'\nimport { createID } from '../../utils/string.utils'\n\n@Component({\n\ttag: 'gov-toast',\n\tstyleUrl: 'gov-toast.scss',\n})\nexport class GovToast {\n\tprivate h: GovHost\n\tprivate timeout\n\tprivate readonly toastId: string\n\n\tconstructor() {\n\t\tthis.h = govHost(this.host)\n\t\tthis.toastId = createID('GovToast')\n\t}\n\n\t@Element() host: HTMLGovToastElement\n\t/**\n\t * Style variation of the toast message.\n\t */\n\t@Prop() readonly variant?: ToastVariantType = 'primary'\n\n\t/**\n\t * Toast’s gravity\n\t */\n\t@Prop() readonly gravity: 'top' | 'bottom' = 'top'\n\t/**\n\t * Toast’s position\n\t */\n\t@Prop() readonly position: 'left' | 'center' | 'right' = 'right'\n\t/**\n\t * Toast type\n\t */\n\t@Prop() readonly type?: ToastTypesType = 'classic'\n\t/**\n\t * Number of milliseconds to wait before Toast disappear\n\t */\n\t@Prop() readonly time: number = 0\n\t/**\n\t * Closing button texting instead of icons\n\t */\n\t@Prop({ attribute: 'close-label' }) readonly closeLabel: string\n\t/**\n\t * Aria label for the closing button. It is mandatory if the alert is closable\n\t */\n\t@Prop({ attribute: 'wcag-close-label' }) readonly wcagCloseLabel: string\n\t/**\n\t * Called when the close button is clicked\n\t */\n\t@Event({ eventName: 'gov-close' }) govClose: EventEmitter<string>\n\n\t@Watch('variant')\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(ToastVariants, newValue, ToastClass.root)\n\t}\n\n\tcomponentWillLoad(): void {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.runTimer()\n\t}\n\n\tcomponentDidLoad() {\n\t\tconst existedToasts = document.querySelectorAll(`gov-toast[gravity=\"${this.gravity}\"][position=\"${this.position}\"]:not([data-toast-id=\"${this.toastId}\"])`)\n\t\tif (existedToasts.length > 0) {\n\t\t\tArray.from(existedToasts).map((toast: HTMLGovToastElement) => toast.destroy().then())\n\t\t}\n\t}\n\n\tdisconnectedCallback() {\n\t\tclearTimeout(this.timeout)\n\t}\n\n\tprivate runTimer() {\n\t\tif (this.isSolid) {\n\t\t\tthis.host.classList.add('is-initialized')\n\t\t}\n\t\tif (this.isTimer) {\n\t\t\tthis.timeout = setTimeout(() => {\n\t\t\t\tthis.host.classList.add(ToastClass.hidden)\n\t\t\t\tsetTimeout(this.destroy.bind(this), 600)\n\t\t\t}, this.time)\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host\n\t\t\t\tclass={this.h.classes([ToastClass.root, 'gov-box-shadow--m'])}\n\t\t\t\tdata-toast-id={this.toastId}\n\t\t\t\tgravity={this.gravity}\n\t\t\t\tposition={this.position}\n\t\t\t\tvariant={this.variant}\n\t\t\t\ttype={this.type}\n\t\t\t\tstyle={{ '--toast-duration': this.time + 'ms' }}\n\t\t\t>\n\t\t\t\t{this.h.hasSlot('icon') && (\n\t\t\t\t\t<span class={ToastClass.icon}>\n\t\t\t\t\t\t<slot name=\"icon\" />\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\n\t\t\t\t<div class={ToastClass.content} aria-live=\"polite\" role=\"status\">\n\t\t\t\t\t<slot />\n\t\t\t\t</div>\n\n\t\t\t\t<div class={ToastClass.close}>\n\t\t\t\t\t<gov-button\n\t\t\t\t\t\tsize=\"s\"\n\t\t\t\t\t\twcag-label={this.wcagCloseLabel}\n\t\t\t\t\t\tvariant={this.isSolid ? this.variant : 'secondary'}\n\t\t\t\t\t\tinverse={this.isSolid}\n\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\ton-gov-click={this.onCloseHandler.bind(this)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{this.closeLabel ? this.closeLabel : <gov-icon name=\"x-lg\"></gov-icon>}\n\t\t\t\t\t</gov-button>\n\t\t\t\t</div>\n\n\t\t\t\t<div class={ToastClass.timer}></div>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onCloseHandler(): void {\n\t\tthis.destroy()\n\t\t\t.then(() => this.govClose.emit(this.toastId))\n\t\t\t.catch()\n\t}\n\n\tget isSolid(): boolean {\n\t\treturn this.type === 'solid'\n\t}\n\n\tget isTimer(): boolean {\n\t\treturn Number.isInteger(this.time) && this.time > 0\n\t}\n\n\t/**\n\t * Remove toast from dom\n\t */\n\t@Method()\n\tasync destroy(): Promise<void> {\n\t\tclearTimeout(this.timeout)\n\t\tconst toast = document.querySelector(`[data-toast-id=\"${this.toastId}\"]`)\n\t\tif (toast) {\n\t\t\ttoast.classList.add(ToastClass.hidden)\n\t\t\tif (typeof toast.remove === 'function') {\n\t\t\t\ttoast.remove()\n\t\t\t}\n\t\t}\n\t}\n}\n"],"mappings":"mRAIO,MAAMA,EAAgBC,EAAKC,EAAU,CAAC,UAAW,UAAW,QAAS,YAAa,YAG/DD,EAAKE,EAAO,CAAC,UAAW,UAG3C,MAAMC,EAAa,CACzBC,KAAM,YACNC,OAAQ,oBACRC,KAAM,kBACNC,QAAS,qBACTC,MAAO,mBACPC,MAAO,oBChBR,MAAMC,EAAc,usK,MCYPC,EAAQ,MAKpB,WAAAC,CAAAC,G,2DAS8C,U,aAKD,M,cAIY,Q,UAIhB,U,UAIT,E,wDAzB/BC,KAAKC,EAAIC,EAAQF,KAAKG,MACtBH,KAAKI,QAAUC,EAAS,W,CAuCzB,eAAAC,CAAgBC,GACfC,EAAavB,EAAesB,EAAUlB,EAAWC,K,CAGlD,iBAAAmB,GACCT,KAAKM,gBAAgBN,KAAKU,SAC1BV,KAAKW,U,CAGN,gBAAAC,GACC,MAAMC,EAAgBC,SAASC,iBAAiB,sBAAsBf,KAAKgB,uBAAuBhB,KAAKiB,kCAAkCjB,KAAKI,cAC9I,GAAIS,EAAcK,OAAS,EAAG,CAC7BC,MAAMC,KAAKP,GAAeQ,KAAKC,GAA+BA,EAAMC,UAAUC,Q,EAIhF,oBAAAC,GACCC,aAAa1B,KAAK2B,Q,CAGX,QAAAhB,GACP,GAAIX,KAAK4B,QAAS,CACjB5B,KAAKG,KAAK0B,UAAUC,IAAI,iB,CAEzB,GAAI9B,KAAK+B,QAAS,CACjB/B,KAAK2B,QAAUK,YAAW,KACzBhC,KAAKG,KAAK0B,UAAUC,IAAIzC,EAAWE,QACnCyC,WAAWhC,KAAKuB,QAAQU,KAAKjC,MAAO,IAAI,GACtCA,KAAKkC,K,EAIV,MAAAC,GACC,OACClC,EAACmC,EAAI,CACJC,MAAOrC,KAAKC,EAAEqC,QAAQ,CAACjD,EAAWC,KAAM,sBAAqB,gBAC9CU,KAAKI,QACpBY,QAAShB,KAAKgB,QACdC,SAAUjB,KAAKiB,SACfP,QAASV,KAAKU,QACd6B,KAAMvC,KAAKuC,KACXC,MAAO,CAAE,mBAAoBxC,KAAKkC,KAAO,OAExClC,KAAKC,EAAEwC,QAAQ,SACfxC,EAAA,QAAMoC,MAAOhD,EAAWG,MACvBS,EAAA,QAAMyC,KAAK,UAIbzC,EAAA,OAAKoC,MAAOhD,EAAWI,QAAO,YAAY,SAASkD,KAAK,UACvD1C,EAAA,cAGDA,EAAA,OAAKoC,MAAOhD,EAAWK,OACtBO,EAAA,cACC2C,KAAK,IAAG,aACI5C,KAAK6C,eACjBnC,QAASV,KAAK4B,QAAU5B,KAAKU,QAAU,YACvCoC,QAAS9C,KAAK4B,QACdW,KAAK,OAAM,eACGvC,KAAK+C,eAAed,KAAKjC,OAEtCA,KAAKgD,WAAahD,KAAKgD,WAAa/C,EAAA,YAAUyC,KAAK,WAItDzC,EAAA,OAAKoC,MAAOhD,EAAWM,Q,CAKlB,cAAAoD,GACP/C,KAAKuB,UACHC,MAAK,IAAMxB,KAAKiD,SAASC,KAAKlD,KAAKI,WACnC+C,O,CAGH,WAAIvB,GACH,OAAO5B,KAAKuC,OAAS,O,CAGtB,WAAIR,GACH,OAAOqB,OAAOC,UAAUrD,KAAKkC,OAASlC,KAAKkC,KAAO,C,CAOnD,aAAMX,GACLG,aAAa1B,KAAK2B,SAClB,MAAML,EAAQR,SAASwC,cAAc,mBAAmBtD,KAAKI,aAC7D,GAAIkB,EAAO,CACVA,EAAMO,UAAUC,IAAIzC,EAAWE,QAC/B,UAAW+B,EAAMiC,SAAW,WAAY,CACvCjC,EAAMiC,Q"}
@@ -1,2 +0,0 @@
1
- import{r as e,c as t,h as o,H as i,g as r}from"./p-10cbc3fe.js";import{g as l,a as s,t as a}from"./p-3f37ddb6.js";import{g as c,c as n,d as m,e as v}from"./p-34ed07f6.js";import{v as g}from"./p-26acf964.js";import{b as f,c as u}from"./p-ae894a40.js";import{c as d}from"./p-cac3881f.js";import{c as h,r as p}from"./p-24636c53.js";import{d as z}from"./p-03990da5.js";import"./p-55500e5a.js";import"./p-ff7365ae.js";import"./p-6278531b.js";import"./p-9dab01be.js";import"./p-3464136c.js";import"./p-561fa17b.js";const x='.gov-form-multi-select__list{margin:0;padding:0}.gov-form-multi-select__list>.gov-form-multi-select__item{margin:0;padding:0;background:none}.gov-form-multi-select__list>.gov-form-multi-select__item::before{display:none}.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-form-multi-select{position:relative;display:flex;width:100%;align-items:center}.gov-form-multi-select .element{position:relative;display:flex;flex:1 1 auto}.gov-form-multi-select input,.gov-form-multi-select select,.gov-form-multi-select textarea{width:100%;border-radius:var(--gov-border-radius, 0.1875rem);background-color:var(--gov-form-bg-color, var(--gov-color-neutral-white));font-family:var(--gov-font-family, "Roboto", sans-serif)}.gov-form-multi-select input:focus,.gov-form-multi-select select:focus,.gov-form-multi-select textarea:focus{outline:none}.gov-form-multi-select input:focus-visible,.gov-form-multi-select select:focus-visible,.gov-form-multi-select textarea:focus-visible{border-radius:var(--gov-border-radius, 0.1875rem);outline:var(--gov-outline-width, 0.125rem) solid var(--gov-color-focus-base);outline-offset:0}.gov-form-multi-select input::-moz-placeholder,.gov-form-multi-select select::-moz-placeholder,.gov-form-multi-select textarea::-moz-placeholder{color:var(--gov-form-placeholder-color, var(--gov-color-secondary-600))}.gov-form-multi-select input::placeholder,.gov-form-multi-select select::placeholder,.gov-form-multi-select textarea::placeholder{color:var(--gov-form-placeholder-color, var(--gov-color-secondary-600))}.gov-form-multi-select textarea{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);padding:0.5rem 0.75rem;resize:none}.gov-form-multi-select *[slot=left-icon],.gov-form-multi-select *[slot=right-icon]{position:absolute;top:50%;display:flex;justify-content:center;transform:translateY(-50%);pointer-events:none}.gov-form-multi-select *[slot=left-icon]{left:0}.gov-form-multi-select *[slot=right-icon]{right:0}[size=s].gov-form-multi-select{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);gap:0.5rem var(--gov-form-input-core-s-icon-size, 1rem)}[size=s].gov-form-multi-select input,[size=s].gov-form-multi-select select{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing);height:var(--gov-form-input-core-s-height, 2rem);padding:var(--gov-form-input-core-s-padding, 0.25rem 0.75rem)}[size=s].gov-form-multi-select *[slot=left-icon],[size=s].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-s-icon-size, 1rem);height:var(--gov-form-input-core-s-icon-size, 1rem)}[size=s].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-s-icon-padding, 2rem) - var(--gov-form-input-core-s-icon-size, 1rem)) / 2)}[size=s].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-s-icon-padding, 2rem)}[size=s].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-s-icon-padding, 2rem) - var(--gov-form-input-core-s-icon-size, 1rem)) / 2)}[size=s].gov-form-multi-select *[slot=right-icon]~input,[size=s].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-s-icon-padding, 2rem)}[size=m].gov-form-multi-select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);gap:0.5rem var(--gov-form-input-core-m-icon-size, 1rem)}[size=m].gov-form-multi-select input,[size=m].gov-form-multi-select select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);height:var(--gov-form-input-core-m-height, 2.5rem);padding:var(--gov-form-input-core-m-padding, 0.4375rem 0.75rem)}[size=m].gov-form-multi-select *[slot=left-icon],[size=m].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-m-icon-size, 1rem);height:var(--gov-form-input-core-m-icon-size, 1rem)}[size=m].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-m-icon-padding, 2.5rem) - var(--gov-form-input-core-m-icon-size, 1rem)) / 2)}[size=m].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-m-icon-padding, 2.5rem)}[size=m].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-m-icon-padding, 2.5rem) - var(--gov-form-input-core-m-icon-size, 1rem)) / 2)}[size=m].gov-form-multi-select *[slot=right-icon]~input,[size=m].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-m-icon-padding, 2.5rem)}[size=l].gov-form-multi-select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);gap:0.5rem var(--gov-form-input-core-l-icon-size, 1rem)}[size=l].gov-form-multi-select input,[size=l].gov-form-multi-select select{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);height:var(--gov-form-input-core-l-height, 3rem);padding:var(--gov-form-input-core-l-padding, 0.6875rem 0.75rem)}[size=l].gov-form-multi-select *[slot=left-icon],[size=l].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-l-icon-size, 1rem);height:var(--gov-form-input-core-l-icon-size, 1rem)}[size=l].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-l-icon-padding, 2.5rem) - var(--gov-form-input-core-l-icon-size, 1rem)) / 2)}[size=l].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-l-icon-padding, 2.5rem)}[size=l].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-l-icon-padding, 2.5rem) - var(--gov-form-input-core-l-icon-size, 1rem)) / 2)}[size=l].gov-form-multi-select *[slot=right-icon]~input,[size=l].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-l-icon-padding, 2.5rem)}[size=xl].gov-form-multi-select{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);gap:0.5rem var(--gov-form-input-core-xl-icon-size, 1.25rem)}[size=xl].gov-form-multi-select input,[size=xl].gov-form-multi-select select{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing);height:var(--gov-form-input-core-xl-height, 3.5rem);padding:var(--gov-form-input-core-xl-padding, 0.9375rem 1rem 0.875rem)}[size=xl].gov-form-multi-select *[slot=left-icon],[size=xl].gov-form-multi-select *[slot=right-icon]{width:var(--gov-form-input-core-xl-icon-size, 1.25rem);height:var(--gov-form-input-core-xl-icon-size, 1.25rem)}[size=xl].gov-form-multi-select *[slot=left-icon]{left:calc((var(--gov-form-input-core-xl-icon-padding, 3rem) - var(--gov-form-input-core-xl-icon-size, 1.25rem)) / 2)}[size=xl].gov-form-multi-select *[slot=left-icon]~input{padding-left:var(--gov-form-input-core-xl-icon-padding, 3rem)}[size=xl].gov-form-multi-select *[slot=right-icon]{right:calc((var(--gov-form-input-core-xl-icon-padding, 3rem) - var(--gov-form-input-core-xl-icon-size, 1.25rem)) / 2)}[size=xl].gov-form-multi-select *[slot=right-icon]~input,[size=xl].gov-form-multi-select *[slot=right-icon]~select{padding-right:var(--gov-form-input-core-xl-icon-padding, 3rem)}[variant=primary].gov-form-multi-select input,[variant=primary].gov-form-multi-select select,[variant=primary].gov-form-multi-select textarea{color:var(--gov-form-input-color-primary, var(--gov-color-secondary-700));border:var(--gov-form-input-border-primary, 0.0625rem solid var(--gov-color-primary-600))}[variant=primary].gov-form-multi-select *[slot=left-icon],[variant=primary].gov-form-multi-select *[slot=right-icon]{color:var(--gov-form-input-icon-color-primary, var(--gov-color-primary))}[variant=secondary].gov-form-multi-select input,[variant=secondary].gov-form-multi-select select,[variant=secondary].gov-form-multi-select textarea{color:var(--gov-form-input-color-secondary, var(--gov-color-secondary-700));border:var(--gov-form-input-border-secondary, 0.0625rem solid var(--gov-color-secondary-700))}[variant=secondary].gov-form-multi-select *[slot=left-icon],[variant=secondary].gov-form-multi-select *[slot=right-icon]{color:var(--gov-form-input-icon-color-secondary, var(--gov-color-primary))}[disabled=""].gov-form-multi-select,[disabled=true i].gov-form-multi-select,[disabled="1"].gov-form-multi-select{pointer-events:none}[disabled=""].gov-form-multi-select input,[disabled=""].gov-form-multi-select select,[disabled=""].gov-form-multi-select textarea,[disabled=true i].gov-form-multi-select input,[disabled=true i].gov-form-multi-select select,[disabled=true i].gov-form-multi-select textarea,[disabled="1"].gov-form-multi-select input,[disabled="1"].gov-form-multi-select select,[disabled="1"].gov-form-multi-select textarea{border-color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600));background:var(--gov-form-input-disabled-bg, var(--gov-color-secondary-300));color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[disabled=""].gov-form-multi-select *[slot=left-icon],[disabled=""].gov-form-multi-select *[slot=right-icon],[disabled=true i].gov-form-multi-select *[slot=left-icon],[disabled=true i].gov-form-multi-select *[slot=right-icon],[disabled="1"].gov-form-multi-select *[slot=left-icon],[disabled="1"].gov-form-multi-select *[slot=right-icon]{color:var(--gov-form-state-color-disabled, var(--gov-color-secondary-600))}[invalid=""].gov-form-multi-select input,[invalid=""].gov-form-multi-select select,[invalid=""].gov-form-multi-select textarea,[invalid=true i].gov-form-multi-select input,[invalid=true i].gov-form-multi-select select,[invalid=true i].gov-form-multi-select textarea,[invalid="1"].gov-form-multi-select input,[invalid="1"].gov-form-multi-select select,[invalid="1"].gov-form-multi-select textarea{border-color:var(--gov-form-state-color-error, var(--gov-color-error));color:var(--gov-form-state-color-error, var(--gov-color-error))}[invalid=""].gov-form-multi-select input::-moz-placeholder,[invalid=""].gov-form-multi-select select::-moz-placeholder,[invalid=""].gov-form-multi-select textarea::-moz-placeholder,[invalid=true i].gov-form-multi-select input::-moz-placeholder,[invalid=true i].gov-form-multi-select select::-moz-placeholder,[invalid=true i].gov-form-multi-select textarea::-moz-placeholder,[invalid="1"].gov-form-multi-select input::-moz-placeholder,[invalid="1"].gov-form-multi-select select::-moz-placeholder,[invalid="1"].gov-form-multi-select textarea::-moz-placeholder{color:var(--gov-form-state-color-error, var(--gov-color-error-300))}[invalid=""].gov-form-multi-select input::placeholder,[invalid=""].gov-form-multi-select select::placeholder,[invalid=""].gov-form-multi-select textarea::placeholder,[invalid=true i].gov-form-multi-select input::placeholder,[invalid=true i].gov-form-multi-select select::placeholder,[invalid=true i].gov-form-multi-select textarea::placeholder,[invalid="1"].gov-form-multi-select input::placeholder,[invalid="1"].gov-form-multi-select select::placeholder,[invalid="1"].gov-form-multi-select textarea::placeholder{color:var(--gov-form-state-color-error, var(--gov-color-error-300))}[invalid=""].gov-form-multi-select *[slot=left-icon],[invalid=""].gov-form-multi-select *[slot=right-icon],[invalid=true i].gov-form-multi-select *[slot=left-icon],[invalid=true i].gov-form-multi-select *[slot=right-icon],[invalid="1"].gov-form-multi-select *[slot=left-icon],[invalid="1"].gov-form-multi-select *[slot=right-icon]{color:var(--gov-form-state-color-error, var(--gov-color-error))}[success=""].gov-form-multi-select *[slot=right-icon],[success=true i].gov-form-multi-select *[slot=right-icon],[success="1"].gov-form-multi-select *[slot=right-icon]{color:var(--gov-form-state-color-success, var(--gov-color-success))}[success=""].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[success=true i].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow),[success="1"].gov-form-multi-select *[slot=right-icon]:not(.icon-validation):not(.icon-arrow){display:none}.gov-form-multi-select{background:none}.gov-form-multi-select select{-webkit-appearance:none;-moz-appearance:none}.gov-form-multi-select select::-ms-expand{display:none}[size=m].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-m-arrow-right-position, 1rem);width:var(--gov-form-select-m-arrow-size, 0.5rem);height:var(--gov-form-select-m-arrow-size, 0.5rem)}[size=l].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-l-arrow-right-position, 1rem);width:var(--gov-form-select-l-arrow-size, 0.5rem);height:var(--gov-form-select-l-arrow-size, 0.5rem)}[size=xl].gov-form-multi-select *[slot=right-icon]{right:var(--gov-form-select-xl-arrow-right-position, 1.3125rem);width:var(--gov-form-select-xl-arrow-size, 0.625rem);height:var(--gov-form-select-xl-arrow-size, 0.625rem)}.gov-form-multi-select{flex-wrap:wrap}.gov-form-multi-select__wrap{display:flex;gap:0.5rem;width:100%}.gov-form-multi-select__list{font-weight:var(--gov-text-xs-font-weight);font-size:var(--gov-text-xs-font-size);line-height:var(--gov-text-xs-line-height);letter-spacing:var(--gov-text-xs-letter-spacing);display:flex;gap:0.5rem;flex-wrap:wrap}.gov-form-multi-select__list>.gov-form-multi-select__item{position:relative;display:flex;flex:0 0 auto;align-items:center;padding:0rem 0rem 0rem 0.5rem;background:var(--gov-form-multiselect-bg, var(--gov-color-primary-200));transition:150ms linear background-color}';const b=class{constructor(o){e(this,o);this.govFocus=t(this,"gov-focus",7);this.govBlur=t(this,"gov-blur",7);this.govChange=t(this,"gov-change",7);this.identifier=undefined;this.placeholder=undefined;this.variant=undefined;this.size="m";this.name=undefined;this.required=false;this.disabled=undefined;this.invalid=undefined;this.wcagDescribedBy=undefined;this.wcagLabelledBy=undefined;this.wcagOwns=undefined;this.focused=undefined;this.value=undefined;this.selectedOptions=[];this.selectId=h("GovSelect");this.listId=h("GovMultiList");this.h=l(this.host);this.f=c(this.h)}validateVariant(e){g(m,e,n.root)}validateSize(e){g(v,e,n.root)}emitChange(e){this.govChange.emit({component:n.root,value:e})}watchDisabled(){this.passControlAttrs()}passControlAttrs(){this.f.passAttrToControl("size",this.size);this.f.passAttrToControl("disabled",s(this.disabled));this.f.passAttrToControl("invalid",s(this.invalid))}componentWillLoad(){this.validateVariant(this.variant);this.validateSize(this.size);this.watchDisabled()}getAvailableOptions(){return Array.from(this.selectRef.querySelectorAll("option")).filter((e=>!(e.disabled||e.selected))).map((e=>({name:e.textContent,value:e.value})))}initAutocomplete(){this.autocompleteRef.addEventListener("gov-select",this.onSelectHandler.bind(this));this.autocompleteRef.addEventListener("gov-input",this.onInputHandler.bind(this));this.autocompleteRef.addEventListener("gov-focus",this.onFocusHandler.bind(this));this.autocompleteRef.addEventListener("gov-blur",this.onBlurHandler.bind(this));this.autocompleteRef.setSearchCallback((e=>new Promise((t=>{const o=this.getAvailableOptions();if(String(e).length===0){return t(o)}t(o.filter((({name:t})=>{if(!t)return false;return p(t).toLowerCase().indexOf(p(e).toLowerCase())>-1})))})))).then()}getOptionIndex(e){return this.selectedOptions.findIndex((t=>t.value===e.value&&t.name===e.name))}getOptionElement(e){return this.selectRef.querySelector('option[value="'+e.value+'"]')}selectOption(e){const t=this.getOptionIndex(e);if(t===-1){this.selectedOptions=[...this.selectedOptions,e];const t=this.getOptionElement(e);if(t){t.selected=true}}}removeOption(e){const t=this.getOptionIndex(e);if(t!==-1){this.selectedOptions.splice(t,1);this.selectedOptions=[...this.selectedOptions];const o=this.getOptionElement(e);if(o){o.selected=false}}}async componentDidRender(){this.initAutocomplete();await z(0);this.selectRef.querySelectorAll("option").forEach((e=>{if(e.selected){this.selectOption({name:e.textContent,value:e.value})}}));if(d()){await z(500);await this.validateWcag()}}render(){return o(i,{class:n.root,size:this.size,variant:this.variant},o("div",{class:n.wrap},o("div",{class:"element"},o("gov-form-autocomplete",{value:this.value,disabled:this.disabled,identifier:this.identifier||this.selectId,required:false,size:this.size,variant:this.variant,invalid:this.invalid,placeholder:this.placeholder,ref:e=>this.autocompleteRef=e,minlength:0,wcagDescribedBy:this.wcagDescribedBy,wcagLabelledBy:this.wcagLabelledBy,wcagOwns:this.listId}),o("gov-icon",{slot:"right-icon",class:"icon-arrow",name:"chevron-down"}),o("select",{hidden:true,"aria-hidden":true,multiple:true,required:this.required,name:this.name,disabled:this.disabled,ref:e=>this.selectRef=e,"aria-disabled":a(this.disabled),"aria-required":a(this.required),"aria-invalid":a(this.invalid),"aria-describedby":this.wcagDescribedBy,"aria-labelledby":this.wcagLabelledBy,"aria-owns":this.wcagOwns},o("slot",null)))),o("ul",{role:"listbox",id:this.listId,class:n.list},this.selectedOptions.map((e=>o("li",{class:n.item,role:"option"},e.name,o("gov-button",{wcagLabel:"Odebrat vybranou položku "+e.name,variant:"primary",type:"base",size:"s","on-gov-click":()=>this.onTagRemove(e)},o("gov-icon",{name:"x-lg"})))))))}onFocusHandler(e){e.stopPropagation();this.focused=true;this.govFocus.emit({component:n.root,originalEvent:e,value:this.selectedOptions})}onBlurHandler(e){e.stopPropagation();e.stopPropagation();this.focused=false;this.govBlur.emit({component:n.root,originalEvent:e,value:this.selectedOptions})}onInputHandler(e){this.value=e.detail.value;e.stopPropagation()}onSelectHandler(e){e.stopPropagation();const t=e.detail.selected;this.selectOption(t);this.value="";this.autocompleteRef.clearValue();this.autocompleteRef.focus()}onTagRemove(e){this.removeOption(e)}async setFocus(e){return this.selectRef.focus(e)}async setValue(e){this.value=e}async getRef(){return this.selectRef}async validateWcag(){f(this.wcagDescribedBy,"wcag-described-by",n.root);f(this.wcagLabelledBy,"wcag-labelled-by",n.root);f(this.wcagOwns,"wcag-owns",n.root);u(this.identifier||this.selectId,this.wcagLabelledBy,n.root)}get host(){return r(this)}static get watchers(){return{variant:["validateVariant"],size:["validateSize","watchDisabled"],selectedOptions:["emitChange"],disabled:["watchDisabled"],invalid:["watchDisabled"]}}};b.style=x;export{b as gov_form_multi_select};
2
- //# sourceMappingURL=p-48cfc1c6.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["govFormMultiSelectCss","GovFormMultiSelect","constructor","hostRef","this","selectId","createID","listId","h","govHost","host","f","govForm","validateVariant","newValue","validateProp","FormMultiselectVariants","FormMultiSelectClass","root","validateSize","FormMultiselectSizes","emitChange","govChange","emit","component","value","watchDisabled","passControlAttrs","passAttrToControl","size","toBoolAttr","disabled","invalid","componentWillLoad","variant","getAvailableOptions","Array","from","selectRef","querySelectorAll","filter","option","selected","map","name","textContent","initAutocomplete","autocompleteRef","addEventListener","onSelectHandler","bind","onInputHandler","onFocusHandler","onBlurHandler","setSearchCallback","Promise","resolve","data","String","length","removeDiacritics","toLowerCase","indexOf","then","getOptionIndex","selectedOptions","findIndex","getOptionElement","querySelector","selectOption","newOption","index","removeOption","splice","componentDidRender","delay","forEach","canValidateWcagOnRender","validateWcag","render","Host","class","wrap","identifier","required","placeholder","ref","el","minlength","wcagDescribedBy","wcagLabelledBy","wcagOwns","slot","hidden","multiple","toBoolAttrIfDefined","role","id","list","item","wcagLabel","type","onTagRemove","e","stopPropagation","focused","govFocus","originalEvent","govBlur","detail","clearValue","focus","setFocus","options","setValue","getRef","validateWcagRef","validateWcagLabelFor"],"sources":["../../../packages/core/src/components/gov-form/multiselect/gov-form-multi-select.scss?tag=gov-form-multi-select","../../../packages/core/src/components/gov-form/multiselect/gov-form-multi-select.tsx"],"sourcesContent":["/*\n * Multiselect\n */\n\n@import \"../select/gov-form-select-core.scss\";\n$class: \".gov-form-multi-select\";\n\n#{$class} {\n\t@extend %form-select-core;\n\tflex-wrap: wrap;\n\t&__wrap {\n\t\tdisplay: flex;\n\t\tgap: rem-calc(8);\n\t\twidth: 100%;\n\t}\n\t&__list {\n\t\t@extend %reset-ul;\n\t\t@include typography($font-size-xs);\n\t\tdisplay: flex;\n\t\tgap: rem-calc(8);\n\t\tflex-wrap: wrap;\n\t}\n\t&__list > &__item {\n\t\t@extend %reset-ul-li;\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t\tflex: 0 0 auto;\n\t\talign-items: center;\n\t\tpadding: rem-calc(0 0 0 8);\n\t\tbackground: $form-multiselect-bg;\n\t\ttransition: $t linear background-color;\n\t}\n}\n","import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from \"@stencil/core\"\nimport { govHost, toBoolAttr, toBoolAttrIfDefined } from \"../../../helpers/Dom/template\"\nimport {\n\tFormMultiSelectClass,\n\tFormMultiselectSizes,\n\tFormMultiselectSizesType,\n\tFormMultiselectVariants,\n\tFormMultiselectVariantType,\n} from \"./constants\"\nimport { validateProp } from \"../../../helpers/Validate/props\"\nimport { validateWcagLabelFor, validateWcagRef } from \"../../../helpers/Validate/wcag\"\nimport { canValidateWcagOnRender } from \"../../../helpers/Dom/win\"\nimport { createID, removeDiacritics } from \"../../../utils/string.utils\"\nimport { delay } from \"../../../utils/utils\"\nimport { Nullable } from \"../../../types/interfaces\"\nimport { FormMultiselectEvent, GovFormMultiSelectItem } from \"./gov-form-multi-select.types\"\nimport { FormAutocompleteEvent } from \"../autocomplete/gov-form-autocomplete.types\"\nimport { GovForm } from \"../../../helpers/Dom/form.types\"\nimport { GovHost } from \"../../../helpers/Dom/template.types\"\nimport { govForm } from \"../../../helpers/Dom/form\"\n\n@Component({\n\ttag: \"gov-form-multi-select\",\n\tstyleUrl: \"gov-form-multi-select.scss\",\n})\nexport class GovFormMultiSelect {\n\tprivate f: GovForm\n\tprivate readonly h: GovHost\n\n\tprivate selectRef?: HTMLSelectElement\n\tprivate autocompleteRef?: HTMLGovFormAutocompleteElement\n\n\tprivate readonly selectId: string\n\tprivate readonly listId: string\n\n\tconstructor() {\n\t\tthis.selectId = createID(\"GovSelect\")\n\t\tthis.listId = createID(\"GovMultiList\")\n\n\t\tthis.h = govHost(this.host)\n\t\tthis.f = govForm(this.h)\n\t}\n\n\t@Element() host: HTMLGovFormSelectElement\n\t/**\n\t * Custom select identifier.\n\t */\n\t@Prop({ attribute: \"identifier\" }) readonly identifier: string\n\t/**\n\t * Custom select placeholder.\n\t */\n\t@Prop({ attribute: \"placeholder\" }) readonly placeholder: string\n\t/**\n\t * Style variation of the form select.\n\t */\n\t@Prop() readonly variant?: FormMultiselectVariantType\n\t/**\n\t * Select’s size.\n\t */\n\t@Prop() readonly size?: FormMultiselectSizesType = \"m\"\n\t/**\n\t * Name of the select.\n\t */\n\t@Prop() readonly name: string\n\t/**\n\t * Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them.\n\t * When using this property you need to also set “novalidate” attribute to your form element to prevent browser from displaying its own validation errors.\n\t */\n\t@Prop() readonly required: boolean = false\n\t/**\n\t * Makes the select component disabled.\n\t * This prevents users from being able to interact with the select, and conveys its inactive state to assistive technologies.\n\t */\n\t@Prop() readonly disabled: boolean\n\t/**\n\t * Indicates the entered value does not conform to the format expected by the application.\n\t */\n\t@Prop() readonly invalid: boolean\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: \"wcag-described-by\" }) readonly wcagDescribedBy: string\n\t/**\n\t * Indicates the id of a component that labels the input.\n\t */\n\t@Prop({ attribute: \"wcag-labelled-by\" }) readonly wcagLabelledBy: string\n\t/**\n\t * Indicates the id of a component that describes the input.\n\t */\n\t@Prop({ attribute: \"wcag-owns\" }) readonly wcagOwns: string\n\t/**\n\t * Emitted when the select has focus.\n\t */\n\t@Event({ eventName: \"gov-focus\" }) govFocus: EventEmitter<FormMultiselectEvent>\n\t/**\n\t * Emitted when the select loses focus.\n\t */\n\t@Event({ eventName: \"gov-blur\" }) govBlur: EventEmitter<FormMultiselectEvent>\n\t/**\n\t * Emitted when the select change value.\n\t */\n\t@Event({ eventName: \"gov-change\" }) govChange: EventEmitter<FormMultiselectEvent>\n\n\t@State() focused: boolean\n\t@State() value: string\n\t@State() selectedOptions: GovFormMultiSelectItem[] = []\n\n\t@Watch(\"variant\")\n\tvalidateVariant(newValue: string): void {\n\t\tvalidateProp(FormMultiselectVariants, newValue, FormMultiSelectClass.root)\n\t}\n\n\t@Watch(\"size\")\n\tvalidateSize(newValue: string): void {\n\t\tvalidateProp(FormMultiselectSizes, newValue, FormMultiSelectClass.root)\n\t}\n\n\t@Watch(\"selectedOptions\")\n\temitChange(newValue: GovFormMultiSelectItem[]) {\n\t\tthis.govChange.emit({\n\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\tvalue: newValue,\n\t\t})\n\t}\n\n\t@Watch(\"disabled\")\n\t@Watch(\"invalid\")\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}\n\n\n\tcomponentWillLoad() {\n\t\tthis.validateVariant(this.variant)\n\t\tthis.validateSize(this.size)\n\t\tthis.watchDisabled()\n\t}\n\n\tprivate getAvailableOptions(): GovFormMultiSelectItem[] {\n\t\treturn Array.from(this.selectRef.querySelectorAll(\"option\"))\n\t\t\t.filter((option: HTMLOptionElement) => !(option.disabled || option.selected))\n\t\t\t.map((option: HTMLOptionElement) => ({ name: option.textContent, value: option.value }))\n\t}\n\n\tprivate initAutocomplete() {\n\t\tthis.autocompleteRef.addEventListener(\"gov-select\", this.onSelectHandler.bind(this))\n\t\tthis.autocompleteRef.addEventListener(\"gov-input\", this.onInputHandler.bind(this))\n\t\tthis.autocompleteRef.addEventListener(\"gov-focus\", this.onFocusHandler.bind(this))\n\t\tthis.autocompleteRef.addEventListener(\"gov-blur\", this.onBlurHandler.bind(this))\n\t\tthis.autocompleteRef\n\t\t\t.setSearchCallback(value => {\n\t\t\t\treturn new Promise(resolve => {\n\t\t\t\t\tconst data = this.getAvailableOptions()\n\t\t\t\t\tif (String(value).length === 0) {\n\t\t\t\t\t\treturn resolve(data)\n\t\t\t\t\t}\n\t\t\t\t\tresolve(\n\t\t\t\t\t\tdata.filter(({ name }) => {\n\t\t\t\t\t\t\tif (!name) return false\n\t\t\t\t\t\t\treturn removeDiacritics(name).toLowerCase().indexOf(removeDiacritics(value).toLowerCase()) > -1\n\t\t\t\t\t\t}),\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t})\n\t\t\t.then()\n\t}\n\n\tprivate getOptionIndex(value: GovFormMultiSelectItem): number {\n\t\treturn this.selectedOptions.findIndex(option => option.value === value.value && option.name === value.name)\n\t}\n\n\tprivate getOptionElement(value: GovFormMultiSelectItem): Nullable<HTMLOptionElement> {\n\t\treturn this.selectRef.querySelector(\"option[value=\\\"\" + value.value + \"\\\"]\") as HTMLOptionElement\n\t}\n\n\tprivate selectOption(newOption: GovFormMultiSelectItem) {\n\t\tconst index = this.getOptionIndex(newOption)\n\t\tif (index === -1) {\n\t\t\tthis.selectedOptions = [...this.selectedOptions, newOption]\n\t\t\tconst option = this.getOptionElement(newOption)\n\t\t\tif (option) {\n\t\t\t\toption.selected = true\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate removeOption(removeOption: GovFormMultiSelectItem) {\n\t\tconst index = this.getOptionIndex(removeOption)\n\t\tif (index !== -1) {\n\t\t\tthis.selectedOptions.splice(index, 1)\n\t\t\tthis.selectedOptions = [...this.selectedOptions]\n\t\t\tconst option = this.getOptionElement(removeOption)\n\t\t\tif (option) {\n\t\t\t\toption.selected = false\n\t\t\t}\n\t\t}\n\t}\n\n\tasync componentDidRender() {\n\t\tthis.initAutocomplete()\n\t\tawait delay(0)\n\t\tthis.selectRef.querySelectorAll(\"option\").forEach((option: HTMLOptionElement) => {\n\t\t\tif (option.selected) {\n\t\t\t\tthis.selectOption({\n\t\t\t\t\tname: option.textContent,\n\t\t\t\t\tvalue: option.value,\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t\tif (canValidateWcagOnRender()) {\n\t\t\tawait delay(500)\n\t\t\tawait this.validateWcag()\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class={FormMultiSelectClass.root} size={this.size} variant={this.variant}>\n\t\t\t\t<div class={FormMultiSelectClass.wrap}>\n\t\t\t\t\t<div class=\"element\">\n\t\t\t\t\t\t<gov-form-autocomplete\n\t\t\t\t\t\t\tvalue={this.value}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tidentifier={this.identifier || this.selectId}\n\t\t\t\t\t\t\trequired={false}\n\t\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\t\tvariant={this.variant}\n\t\t\t\t\t\t\tinvalid={this.invalid}\n\t\t\t\t\t\t\tplaceholder={this.placeholder}\n\t\t\t\t\t\t\tref={el => (this.autocompleteRef = el as HTMLGovFormAutocompleteElement)}\n\t\t\t\t\t\t\tminlength={0}\n\t\t\t\t\t\t\twcagDescribedBy={this.wcagDescribedBy}\n\t\t\t\t\t\t\twcagLabelledBy={this.wcagLabelledBy}\n\t\t\t\t\t\t\twcagOwns={this.listId}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<gov-icon slot=\"right-icon\" class=\"icon-arrow\" name=\"chevron-down\"></gov-icon>\n\t\t\t\t\t\t<select\n\t\t\t\t\t\t\thidden\n\t\t\t\t\t\t\taria-hidden={true}\n\t\t\t\t\t\t\tmultiple\n\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tref={el => (this.selectRef = el as HTMLSelectElement)}\n\t\t\t\t\t\t\taria-disabled={toBoolAttrIfDefined(this.disabled)}\n\t\t\t\t\t\t\taria-required={toBoolAttrIfDefined(this.required)}\n\t\t\t\t\t\t\taria-invalid={toBoolAttrIfDefined(this.invalid)}\n\t\t\t\t\t\t\taria-describedby={this.wcagDescribedBy}\n\t\t\t\t\t\t\taria-labelledby={this.wcagLabelledBy}\n\t\t\t\t\t\t\taria-owns={this.wcagOwns}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<ul role=\"listbox\" id={this.listId} class={FormMultiSelectClass.list}>\n\t\t\t\t\t{this.selectedOptions.map(option => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li class={FormMultiSelectClass.item} role=\"option\">\n\t\t\t\t\t\t\t\t{option.name}\n\t\t\t\t\t\t\t\t<gov-button\n\t\t\t\t\t\t\t\t\twcagLabel={\"Odebrat vybranou položku \" + option.name}\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\ttype=\"base\"\n\t\t\t\t\t\t\t\t\tsize=\"s\"\n\t\t\t\t\t\t\t\t\ton-gov-click={() => this.onTagRemove(option)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<gov-icon name=\"x-lg\"></gov-icon>\n\t\t\t\t\t\t\t\t</gov-button>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)\n\t\t\t\t\t})}\n\t\t\t\t</ul>\n\t\t\t</Host>\n\t\t)\n\t}\n\n\tprivate onFocusHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\tthis.focused = true\n\t\tthis.govFocus.emit({\n\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.selectedOptions,\n\t\t})\n\t}\n\n\tprivate onBlurHandler(e: FocusEvent) {\n\t\te.stopPropagation()\n\t\te.stopPropagation()\n\t\tthis.focused = false\n\t\tthis.govBlur.emit({\n\t\t\tcomponent: FormMultiSelectClass.root,\n\t\t\toriginalEvent: e,\n\t\t\tvalue: this.selectedOptions,\n\t\t})\n\t}\n\n\tprivate onInputHandler(e: CustomEvent<FormAutocompleteEvent>) {\n\t\tthis.value = e.detail.value\n\t\te.stopPropagation()\n\t}\n\n\tprivate onSelectHandler(e: CustomEvent<FormAutocompleteEvent>) {\n\t\te.stopPropagation()\n\t\tconst value = e.detail.selected\n\t\tthis.selectOption(value as GovFormMultiSelectItem)\n\t\tthis.value = \"\"\n\t\tthis.autocompleteRef.clearValue()\n\t\tthis.autocompleteRef.focus()\n\t}\n\n\tprivate onTagRemove(removeOption: GovFormMultiSelectItem) {\n\t\tthis.removeOption(removeOption)\n\t}\n\n\t/**\n\t * Returns the current state of the component\n\t */\n\t@Method()\n\tasync setFocus(options?: FocusOptions): Promise<void> {\n\t\treturn this.selectRef.focus(options)\n\t}\n\n\t/**\n\t * Sets the ordered value of the element\n\t */\n\t@Method()\n\tasync setValue(value: string): Promise<void> {\n\t\tthis.value = value\n\t}\n\n\t/**\n\t * Returns an instance of the native html select element\n\t */\n\t@Method()\n\tasync getRef(): Promise<HTMLSelectElement> {\n\t\treturn this.selectRef\n\t}\n\n\t/**\n\t * Validate the WCAG attributes of the component\n\t */\n\t@Method()\n\tasync validateWcag(): Promise<void> {\n\t\tvalidateWcagRef(this.wcagDescribedBy, \"wcag-described-by\", FormMultiSelectClass.root)\n\t\tvalidateWcagRef(this.wcagLabelledBy, \"wcag-labelled-by\", FormMultiSelectClass.root)\n\t\tvalidateWcagRef(this.wcagOwns, \"wcag-owns\", FormMultiSelectClass.root)\n\t\tvalidateWcagLabelFor(this.identifier || this.selectId, this.wcagLabelledBy, FormMultiSelectClass.root)\n\t}\n}\n"],"mappings":"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"}
@@ -1,2 +0,0 @@
1
- import{a as t,r as s,h as i,H as n,g as e}from"./p-10cbc3fe.js";import{i as o,a}from"./p-cac3881f.js";import{g as r}from"./p-3f37ddb6.js";import"./p-03990da5.js";var c;(function(t){t["BASIC"]="basic";t["COMPLEX"]="complex";t["COLORED"]="colored"})(c||(c={}));const h={root:"gov-icon",holder:"gov-icon__holder"};const l="0.0.56";const f=()=>l;const p={};const d={};const u=t=>t.startsWith("http://")||t.startsWith("https://");const g=(s,i,n)=>{if(u(s)){return`${s}/${n}/${i}.svg?v=${f()}`}return t(`${s}/${n}/${i}.svg`)+`?v=${f()}`};async function m({name:t,type:s}){const i=s+"-"+t;if(p[i]){return p[i]}if(!d[i]){d[i]=fetch(g(o(),t,s)).then((t=>{if(t.status===200){return t.text()}else{throw new Error("Gov Icon doesn't exists")}}))}const n=await d[i];p[i]=n;return n}const y=".gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-icon{display:inline-flex}.gov-icon__holder,.gov-icon svg{display:inline-flex;width:100%;height:100%}";const v=class{constructor(t){s(this,t);this.name=null;this.type="basic";this.iconData=undefined;this.visible=false;this.error=false;this.h=r(this.host)}async loadIconPathData(){const{name:t,visible:s,type:i}=this;if(!t||!s){return}try{this.iconData=await m({name:t,type:i})}catch(t){this.error=true}}connectedCallback(){if(a()){this.visible=true;this.loadIconPathData().finally()}else{this.waitUntilVisible((async()=>{this.visible=true;await this.loadIconPathData()}))}}disconnectedCallback(){if(this.intersectionObserver){this.intersectionObserver.disconnect();this.intersectionObserver=null}}async componentWillLoad(){await this.loadIconPathData()}waitUntilVisible(t){if(typeof window==="undefined"||!window.IntersectionObserver){t();return}this.intersectionObserver=new IntersectionObserver((s=>{s.forEach((s=>{if(s.isIntersecting){if(this.intersectionObserver){this.intersectionObserver.disconnect();this.intersectionObserver=null}t()}}))}),{rootMargin:"50px"});this.intersectionObserver.observe(this.host)}render(){if(this.error){return null}return i(n,{class:this.h.classes(h.root)},i("span",{class:h.holder,innerHTML:this.iconData}))}static get assetsDirs(){return["assets"]}get host(){return e(this)}static get watchers(){return{name:["loadIconPathData"]}}};v.style=y;export{v as gov_icon};
2
- //# sourceMappingURL=p-4df62a13.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["Types","IconClass","root","holder","dsVersion","version","iconCache","requestCache","isExternalUrl","path","startsWith","iconUrl","name","type","getAssetPath","async","fetchIcon","cacheKey","fetch","iconsPath","then","resp","status","text","Error","govIconCss","GovIcon","constructor","hostRef","this","h","govHost","host","loadIconPathData","visible","iconData","e","error","connectedCallback","iconsLazyLoad","finally","waitUntilVisible","disconnectedCallback","intersectionObserver","disconnect","componentWillLoad","callback","window","IntersectionObserver","entries","forEach","entry","isIntersecting","rootMargin","observe","render","Host","class","classes","innerHTML"],"sources":["../../../packages/core/src/components/gov-icon/constants.ts","../../../packages/core/src/utils/ds.utils.ts","../../../packages/core/src/utils/icon.utils.ts","../../../packages/core/src/components/gov-icon/gov-icon.scss?tag=gov-icon","../../../packages/core/src/components/gov-icon/gov-icon.tsx"],"sourcesContent":["import { ValueOf } from '../../types/interfaces'\n\nenum Types {\n\tBASIC = 'basic',\n\tCOMPLEX = 'complex',\n\tCOLORED = 'colored',\n}\nexport type Type = `${ValueOf<typeof Types>}`\n\nexport const IconClass = {\n\troot: 'gov-icon',\n\tholder: 'gov-icon__holder',\n}\n","import { version } from '../../package.json'\n\nexport const dsVersion = (): string => {\n\treturn version\n}\n","import { getAssetPath } from \"@stencil/core\"\nimport { dsVersion } from \"./ds.utils\"\nimport { iconsPath } from \"../helpers/Dom/win\"\n\nconst iconCache: { [key: string]: string } = {}\nconst requestCache: { [key: string]: Promise<string> } = {}\n\nconst isExternalUrl = (path: string) => path.startsWith(\"http://\") || path.startsWith(\"https://\")\nconst iconUrl = (path: string, name: string, type: string) => {\n\tif (isExternalUrl(path)) {\n\t\treturn `${path}/${type}/${name}.svg?v=${dsVersion()}`\n\t}\n\treturn getAssetPath(`${path}/${type}/${name}.svg`) + `?v=${dsVersion()}`\n}\n\nexport async function fetchIcon({ name, type }: { name: string; type: string }): Promise<string> {\n\tconst cacheKey = type + \"-\" + name\n\tif (iconCache[cacheKey]) {\n\t\treturn iconCache[cacheKey]\n\t}\n\tif (!requestCache[cacheKey]) {\n\t\trequestCache[cacheKey] = fetch(iconUrl(iconsPath(), name, type)).then(resp => {\n\t\t\tif (resp.status === 200) {\n\t\t\t\treturn resp.text()\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Gov Icon doesn't exists\")\n\t\t\t}\n\t\t})\n\t}\n\tconst path = await requestCache[cacheKey]\n\ticonCache[cacheKey] = path\n\treturn path\n}\n","/*\n * Icon\n */\n\n$class: \".gov-icon\";\n\n#{$class} {\n\tdisplay: inline-flex;\n\t&__holder,\n\tsvg {\n\t\tdisplay: inline-flex;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t}\n}\n","import { Build, Component, Element, h, Host, Prop, State, Watch } 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\"\nimport { iconsLazyLoad } from \"../../helpers/Dom/win\"\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\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\tif (iconsLazyLoad()) {\n\t\t\tthis.visible = true\n\t\t\tthis.loadIconPathData().finally()\n\t\t} else {\n\t\t\tthis.waitUntilVisible(async () => {\n\t\t\t\tthis.visible = true\n\t\t\t\tawait this.loadIconPathData()\n\t\t\t})\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"],"mappings":"kKAEA,IAAKA,GAAL,SAAKA,GACJA,EAAA,iBACAA,EAAA,qBACAA,EAAA,oBACA,EAJD,CAAKA,MAAK,KAOH,MAAMC,EAAY,CACxBC,KAAM,WACNC,OAAQ,oB,iBCTF,MAAMC,EAAY,IACjBC,ECCR,MAAMC,EAAuC,GAC7C,MAAMC,EAAmD,GAEzD,MAAMC,EAAiBC,GAAiBA,EAAKC,WAAW,YAAcD,EAAKC,WAAW,YACtF,MAAMC,EAAU,CAACF,EAAcG,EAAcC,KAC5C,GAAIL,EAAcC,GAAO,CACxB,MAAO,GAAGA,KAAQI,KAAQD,WAAcR,K,CAEzC,OAAOU,EAAa,GAAGL,KAAQI,KAAQD,SAAc,MAAMR,KAAa,EAGlEW,eAAeC,GAAUJ,KAAEA,EAAIC,KAAEA,IACvC,MAAMI,EAAWJ,EAAO,IAAMD,EAC9B,GAAIN,EAAUW,GAAW,CACxB,OAAOX,EAAUW,E,CAElB,IAAKV,EAAaU,GAAW,CAC5BV,EAAaU,GAAYC,MAAMP,EAAQQ,IAAaP,EAAMC,IAAOO,MAAKC,IACrE,GAAIA,EAAKC,SAAW,IAAK,CACxB,OAAOD,EAAKE,M,KACN,CACN,MAAM,IAAIC,MAAM,0B,KAInB,MAAMf,QAAaF,EAAaU,GAChCX,EAAUW,GAAYR,EACtB,OAAOA,CACR,CChCA,MAAMgB,EAAa,kc,MCYNC,EAAO,MAGnB,WAAAC,CAAAC,G,oBAQuB,K,UAIF,Q,qCAEM,M,WACF,MAdxBC,KAAKC,EAAIC,EAAQF,KAAKG,K,CAkBf,sBAAMC,GACb,MAAMrB,KAAEA,EAAIsB,QAAEA,EAAOrB,KAAEA,GAASgB,KAChC,IAAyBjB,IAASsB,EAAS,CAC1C,M,CAED,IACCL,KAAKM,eAAiBnB,EAAU,CAAEJ,OAAMC,Q,CACvC,MAAOuB,GACRP,KAAKQ,MAAQ,I,EAIf,iBAAAC,GACC,GAAIC,IAAiB,CACpBV,KAAKK,QAAU,KACfL,KAAKI,mBAAmBO,S,KAClB,CACNX,KAAKY,kBAAiB1B,UACrBc,KAAKK,QAAU,WACTL,KAAKI,kBAAkB,G,EAKhC,oBAAAS,GACC,GAAIb,KAAKc,qBAAsB,CAC9Bd,KAAKc,qBAAqBC,aAC1Bf,KAAKc,qBAAuB,I,EAI9B,uBAAME,SACChB,KAAKI,kB,CAGJ,gBAAAQ,CAAiBK,GACxB,UAA+BC,SAAW,cAAiBA,OAAeC,qBAAsB,CAC/FF,IACA,M,CAEDjB,KAAKc,qBAAuB,IAAIK,sBAC/BC,IACCA,EAAQC,SAAQC,IACf,GAAIA,EAAMC,eAAgB,CACzB,GAAIvB,KAAKc,qBAAsB,CAC9Bd,KAAKc,qBAAqBC,aAC1Bf,KAAKc,qBAAuB,I,CAE7BG,G,IAEA,GAEH,CAAEO,WAAY,SAEfxB,KAAKc,qBAAqBW,QAAQzB,KAAKG,K,CAGxC,MAAAuB,GACC,GAAI1B,KAAKQ,MAAO,CACf,OAAO,I,CAER,OACCP,EAAC0B,EAAI,CAACC,MAAO5B,KAAKC,EAAE4B,QAAQzD,EAAUC,OACrC4B,EAAA,QAAM2B,MAAOxD,EAAUE,OAAQwD,UAAW9B,KAAKM,W"}
@@ -1,2 +0,0 @@
1
- import{r as e,c as t,h as r,H as o,g as i}from"./p-10cbc3fe.js";import{a}from"./p-561fa17b.js";import{v as s}from"./p-26acf964.js";import{S as g,c as p}from"./p-9144dde1.js";import{c as n}from"./p-24636c53.js";import{g as v,p as c}from"./p-3f37ddb6.js";import"./p-ff7365ae.js";import"./p-55500e5a.js";import"./p-03990da5.js";const m='.gov-spin-animation,.gov-pseudo-spin-animation::before{animation:spin 4s linear infinite}@keyframes spin{100%{transform:rotate(360deg)}}@keyframes countdown{to{transform:scaleX(0)}}@keyframes progress{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}.gov-stepper-item{position:relative;display:block;width:100%}.gov-stepper-item__header{position:relative;width:100%}.gov-stepper-item__arrow{flex:0 0 auto;width:0.75rem;height:0.75rem}.gov-stepper-item__title{margin:0;padding:0;font-family:var(--gov-font-family, "Roboto", sans-serif);font-weight:400;box-sizing:border-box;display:flex;gap:1rem;align-items:baseline}.gov-stepper-item__prefix{display:flex;flex:0 0 auto;justify-content:center;align-items:center;border-radius:50%;text-align:center}.gov-stepper-item__prefix .gov-icon{width:45%;height:45%}.gov-stepper-item__prefix span[slot=prefix]{display:flex;justify-content:center;align-items:center;width:100%;height:100%}.gov-stepper-item__name{display:flex;flex-direction:column}.gov-stepper-item__label{display:flex;gap:0.5rem;align-items:center;font-weight:var(--gov-wizard-title-font-weight, 400)}.gov-stepper-item__annot{color:var(--gov-color-secondary)}.gov-stepper-item__content>*:last-child{margin-bottom:0}.gov-stepper-item[variant=primary] .gov-stepper-item__header{color:var(--gov-wizard-primary-color, var(--gov-color-primary-800))}.gov-stepper-item[variant=primary] .gov-stepper-item__prefix{background:var(--gov-wizard-primary-indicator-bg, var(--gov-color-primary-300));color:var(--gov-wizard-primary-indicator-color, var(--gov-color-primary-800))}.gov-stepper-item[variant=secondary] .gov-stepper-item__header{color:var(--gov-wizard-secondary-color, var(--gov-color-secondary-700))}.gov-stepper-item[variant=secondary] .gov-stepper-item__prefix{background:var(--gov-wizard-secondary-indicator-bg, var(--gov-color-secondary-400));color:var(--gov-wizard-secondary-indicator-color, var(--gov-color-secondary-700))}.gov-stepper-item[variant=success] .gov-stepper-item__header{color:var(--gov-wizard-success-color, var(--gov-color-success-500))}.gov-stepper-item[variant=success] .gov-stepper-item__prefix{background:var(--gov-wizard-success-indicator-bg, var(--gov-color-success));color:var(--gov-wizard-success-indicator-color, var(--gov-color-neutral-white))}.gov-stepper-item[variant=error] .gov-stepper-item__header{color:var(--gov-wizard-error-color, var(--gov-color-error-500))}.gov-stepper-item[variant=error] .gov-stepper-item__prefix{background:var(--gov-wizard-error-indicator-bg, var(--gov-color-error));color:var(--gov-wizard-error-indicator-color, var(--gov-color-neutral-white))}.gov-stepper-item[variant=warning] .gov-stepper-item__header{color:var(--gov-wizard-warning-color, var(--gov-color-warning-500))}.gov-stepper-item[variant=warning] .gov-stepper-item__prefix{background:var(--gov-wizard-warning-indicator-bg, var(--gov-color-warning));color:var(--gov-wizard-warning-indicator-color, var(--gov-color-neutral-white))}.gov-stepper-item::before{content:"";position:absolute;display:block;width:0.125rem}.gov-stepper-item:last-child::before{content:none}.gov-stepper-item[variant=primary]::before{background:var(--gov-wizard-primary-indicator-bg, var(--gov-color-primary-300))}.gov-stepper-item[variant=secondary]::before{background:var(--gov-wizard-secondary-indicator-bg, var(--gov-color-secondary-400))}.gov-stepper-item[variant=success]::before{background:var(--gov-wizard-success-indicator-bg, var(--gov-color-success))}.gov-stepper-item[variant=error]::before{background:var(--gov-wizard-error-indicator-bg, var(--gov-color-error))}.gov-stepper-item[variant=warning]::before{background:var(--gov-wizard-warning-indicator-bg, var(--gov-color-warning))}.gov-stepper-item[size=xs]{min-height:calc(var(--gov-stepper-xs-indicator-size, 1.5rem) + 3 * var(--gov-stepper-xs-connect-gap, 0.5rem))}.gov-stepper-item[size=xs]::before{top:calc(var(--gov-stepper-xs-indicator-size, 1.5rem) + var(--gov-stepper-xs-connect-gap, 0.5rem));bottom:var(--gov-stepper-xs-connect-gap, 0.5rem);left:calc((var(--gov-stepper-xs-indicator-size, 1.5rem) - 0.125rem) / 2)}.gov-stepper-item[size=xs]:last-child{min-height:0}.gov-stepper-item[size=xs] .gov-stepper-item__title{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing)}.gov-stepper-item[size=xs] .gov-stepper-item__annot{font-weight:var(--gov-text-s-font-weight);font-size:var(--gov-text-s-font-size);line-height:var(--gov-text-s-line-height);letter-spacing:var(--gov-text-s-letter-spacing)}.gov-stepper-item[size=xs] .gov-stepper-item__prefix{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing);width:var(--gov-stepper-xs-indicator-size, 1.5rem);height:var(--gov-stepper-xs-indicator-size, 1.5rem);box-shadow:0 0 0 var(--gov-stepper-xs-connect-gap, 0.5rem) var(--gov-color-neutral-white)}.gov-stepper-item[size=xs] .gov-stepper-item__content{padding:var(--gov-stepper-xs-content-padding, 1rem 1rem 2rem 2.5rem)}.gov-stepper-item--w-annot[size=xs]{min-height:calc(var(--gov-stepper-xs-indicator-size, 1.5rem) * 1.5 + 3 * var(--gov-stepper-xs-connect-gap, 0.5rem))}.gov-stepper-item[size=s]{min-height:calc(var(--gov-stepper-s-indicator-size, 2rem) + 3 * var(--gov-stepper-s-connect-gap, 1rem))}.gov-stepper-item[size=s]::before{top:calc(var(--gov-stepper-s-indicator-size, 2rem) + var(--gov-stepper-s-connect-gap, 1rem));bottom:var(--gov-stepper-s-connect-gap, 1rem);left:calc((var(--gov-stepper-s-indicator-size, 2rem) - 0.125rem) / 2)}.gov-stepper-item[size=s]:last-child{min-height:0}.gov-stepper-item[size=s] .gov-stepper-item__title{font-weight:var(--gov-text-l-font-weight);font-size:var(--gov-text-l-font-size);line-height:var(--gov-text-l-line-height);letter-spacing:var(--gov-text-l-letter-spacing)}.gov-stepper-item[size=s] .gov-stepper-item__annot{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing)}.gov-stepper-item[size=s] .gov-stepper-item__prefix{font-weight:var(--gov-text-xl-font-weight);font-size:var(--gov-text-xl-font-size);line-height:var(--gov-text-xl-line-height);letter-spacing:var(--gov-text-xl-letter-spacing);width:var(--gov-stepper-s-indicator-size, 2rem);height:var(--gov-stepper-s-indicator-size, 2rem);box-shadow:0 0 0 var(--gov-stepper-s-connect-gap, 1rem) var(--gov-color-neutral-white)}.gov-stepper-item[size=s] .gov-stepper-item__content{padding:var(--gov-stepper-s-content-padding, 1rem 1rem 2rem 3rem)}.gov-stepper-item--w-annot[size=s]{min-height:calc(var(--gov-stepper-s-indicator-size, 2rem) * 1.5 + 3 * var(--gov-stepper-s-connect-gap, 1rem))}.gov-stepper-item[size=m]{min-height:calc(var(--gov-stepper-m-indicator-size, 2.5rem) + 3 * var(--gov-stepper-m-connect-gap, 1rem))}.gov-stepper-item[size=m]::before{top:calc(var(--gov-stepper-m-indicator-size, 2.5rem) + var(--gov-stepper-m-connect-gap, 1rem));bottom:var(--gov-stepper-m-connect-gap, 1rem);left:calc((var(--gov-stepper-m-indicator-size, 2.5rem) - 0.125rem) / 2)}.gov-stepper-item[size=m]:last-child{min-height:0}.gov-stepper-item[size=m] .gov-stepper-item__title{font-weight:var(--gov-text-xl-font-weight);font-size:var(--gov-text-xl-font-size);line-height:var(--gov-text-xl-line-height);letter-spacing:var(--gov-text-xl-letter-spacing)}.gov-stepper-item[size=m] .gov-stepper-item__annot{font-weight:var(--gov-text-m-font-weight);font-size:var(--gov-text-m-font-size);line-height:var(--gov-text-m-line-height);letter-spacing:var(--gov-text-m-letter-spacing)}.gov-stepper-item[size=m] .gov-stepper-item__prefix{font-weight:var(--gov-text-xl-font-weight);font-size:var(--gov-text-xl-font-size);line-height:var(--gov-text-xl-line-height);letter-spacing:var(--gov-text-xl-letter-spacing);width:var(--gov-stepper-m-indicator-size, 2.5rem);height:var(--gov-stepper-m-indicator-size, 2.5rem);box-shadow:0 0 0 var(--gov-stepper-m-connect-gap, 1rem) var(--gov-color-neutral-white)}.gov-stepper-item[size=m] .gov-stepper-item__content{padding:var(--gov-stepper-m-content-padding, 1rem 1rem 2rem 3.5rem)}.gov-stepper-item--w-annot[size=m]{min-height:calc(var(--gov-stepper-m-indicator-size, 2.5rem) * 1.5 + 3 * var(--gov-stepper-m-connect-gap, 1rem))}';const l=class{constructor(r){e(this,r);this.govChange=t(this,"gov-change",7);this.isExpandedState=undefined;this.variant="primary";this.size="m";this.identifier=undefined;this.label=undefined;this.annotation=undefined;this.triggerTag="h3";this.h=v(this.host);this.triggerId=n("GovStepperItem");this.contentId=n("GovStepperContent")}validateLabel(e){if(!e){a(`[${g.root}]: Parameter label is required.`)}}validateTriggerTag(e){const t=["h1","h2","h3","h4","h5","h6","span"];if(e){if(!t.includes(e)){a(`[${g.root}]: Tag ${e} is not allowed.`)}}}validateVariant(e){s(p,e,g.root)}componentWillLoad(){this.validateLabel(this.label);this.validateVariant(this.variant);this.validateTriggerTag(this.triggerTag)}render(){const e=this.identifier||this.triggerId;const t=this.contentId;const{label:i}=this;const a=this.triggerTag;return r(o,{class:c([g.root,this.annotation&&g.rootWithAnnot]),variant:this.variant},r("div",{id:e,class:g.header,role:"listitem"},r(a,{class:g.title},this.h.hasSlot("prefix")&&r("span",{class:g.prefix},r("slot",{name:"prefix"})),r("span",{class:g.name},r("span",{class:g.label},i),this.annotation&&r("span",{class:g.annot},this.annotation)))),this.h.hasSlot("content")&&r("div",{class:g.content,id:t,"aria-labelledby":e,role:"tabpanel"},r("slot",{name:"content"})))}async currentState(){return this.isExpandedState}get host(){return i(this)}static get watchers(){return{label:["validateLabel"],triggerTag:["validateTriggerTag"],variant:["validateVariant"]}}};l.style=m;export{l as gov_stepper_item};
2
- //# sourceMappingURL=p-64f7e661.entry.js.map