@department-of-veterans-affairs/component-library 48.0.2 → 48.1.1
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.
- package/Modal.js +1 -1
- package/dist/{9356.app.bundle.js → 1214.app.bundle.js} +1 -1
- package/dist/1339.app.bundle.js +2 -0
- package/dist/1365.app.bundle.js +1 -0
- package/dist/{1680.app.bundle.js → 1450.app.bundle.js} +1 -1
- package/dist/196.app.bundle.js +2 -0
- package/dist/20.app.bundle.js +2 -0
- package/dist/2222.app.bundle.js +2 -0
- package/dist/2387.app.bundle.js +1 -0
- package/dist/{1059.app.bundle.js → 2472.app.bundle.js} +1 -1
- package/dist/2654.app.bundle.js +2 -0
- package/dist/2664.app.bundle.js +2 -0
- package/dist/286.app.bundle.js +2 -0
- package/dist/{3977.app.bundle.js → 3071.app.bundle.js} +1 -1
- package/dist/{5585.app.bundle.js → 3156.app.bundle.js} +1 -1
- package/dist/326.app.bundle.js +1 -0
- package/dist/4064.app.bundle.js +1 -0
- package/dist/4117.app.bundle.js +2 -0
- package/dist/{4348.app.bundle.js → 4140.app.bundle.js} +1 -1
- package/dist/415.app.bundle.js +1 -0
- package/dist/4493.app.bundle.js +2 -0
- package/dist/{2010.app.bundle.js → 5155.app.bundle.js} +1 -1
- package/dist/5189.app.bundle.js +2 -0
- package/dist/5306.app.bundle.js +2 -0
- package/dist/{1558.app.bundle.js → 5610.app.bundle.js} +1 -1
- package/dist/{8912.app.bundle.js → 5628.app.bundle.js} +1 -1
- package/dist/5699.app.bundle.js +2 -0
- package/dist/575.app.bundle.js +2 -0
- package/dist/5830.app.bundle.js +2 -0
- package/dist/6034.app.bundle.js +2 -0
- package/dist/6246.app.bundle.js +2 -0
- package/dist/{7422.app.bundle.js → 6247.app.bundle.js} +1 -1
- package/dist/6527.app.bundle.js +2 -0
- package/dist/6633.app.bundle.js +2 -0
- package/dist/6683.app.bundle.js +2 -0
- package/dist/{3510.app.bundle.js → 6771.app.bundle.js} +1 -1
- package/dist/6823.app.bundle.js +1 -0
- package/dist/6824.app.bundle.js +2 -0
- package/dist/712.app.bundle.js +2 -0
- package/dist/7367.app.bundle.js +2 -0
- package/dist/{1274.app.bundle.js → 7531.app.bundle.js} +1 -1
- package/dist/7663.app.bundle.js +1 -0
- package/dist/{5431.app.bundle.js → 7821.app.bundle.js} +1 -1
- package/dist/8175.app.bundle.js +2 -0
- package/dist/82.app.bundle.js +2 -0
- package/dist/8762.app.bundle.js +2 -0
- package/dist/8859.app.bundle.js +1 -0
- package/dist/890.app.bundle.js +2 -0
- package/dist/9157.app.bundle.js +2 -0
- package/dist/9288.app.bundle.js +1 -0
- package/dist/9670.app.bundle.js +1 -0
- package/dist/9724.app.bundle.js +2 -0
- package/dist/9724.app.bundle.js.LICENSE.txt +5 -0
- package/dist/9800.app.bundle.js +2 -0
- package/dist/9800.app.bundle.js.LICENSE.txt +5 -0
- package/dist/app.bundle.js +1 -1
- package/dist/app.bundle.js.LICENSE.txt +0 -2
- package/dist/components/i18n-setup.js +1 -1
- package/dist/components/i18next.js +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -1
- package/dist/components/types/components.d.ts +103 -1
- package/dist/components/utils.js +1 -1
- package/dist/components/va-accordion.js +1 -1
- package/dist/components/va-alert2.js +1 -1
- package/dist/components/va-back-to-top.js +1 -1
- package/dist/components/va-banner.js +1 -1
- package/dist/components/va-checkbox-group.js +1 -1
- package/dist/components/va-file-input-multiple.js +1 -1
- package/dist/components/va-file-input2.js +1 -1
- package/dist/components/va-language-toggle.d.ts +11 -0
- package/dist/components/va-language-toggle.js +1 -0
- package/dist/components/va-link-action.js +1 -1
- package/dist/components/va-link2.js +1 -1
- package/dist/components/va-loading-indicator.js +1 -1
- package/dist/components/va-memorable-date.js +1 -1
- package/dist/components/va-minimal-footer.js +1 -1
- package/dist/components/va-need-help.js +1 -1
- package/dist/components/va-official-gov-banner2.js +1 -1
- package/dist/components/va-omb-info.js +1 -1
- package/dist/components/va-privacy-agreement.js +1 -1
- package/dist/components/va-process-list-item.js +1 -1
- package/dist/components/va-process-list.js +1 -1
- package/dist/components/va-progress-bar.js +1 -1
- package/dist/components/va-radio-option.js +1 -1
- package/dist/components/va-radio.js +1 -1
- package/dist/components/va-search-input.js +1 -1
- package/dist/components/va-select2.js +1 -1
- package/dist/components/va-statement-of-truth.js +1 -1
- package/dist/components/va-summary-box.js +1 -1
- package/dist/components/va-table-inner2.js +1 -1
- package/dist/components/va-table-row.js +1 -1
- package/dist/components/va-table.js +1 -1
- package/dist/components/va-telephone2.js +1 -1
- package/dist/components/va-text-input2.js +1 -1
- package/dist/components/va-textarea.js +1 -1
- package/dist/main.css +1 -1
- package/dist/react-bindings/index.d.ts +1 -0
- package/dist/react-bindings/index.js +1 -1
- package/dist/react-bindings/index.js.map +1 -1
- package/dist/react-bindings/index.ts +1 -0
- package/package.json +3 -3
- package/dist/1237.app.bundle.js +0 -2
- package/dist/1321.app.bundle.js +0 -2
- package/dist/1563.app.bundle.js +0 -2
- package/dist/2025.app.bundle.js +0 -2
- package/dist/2159.app.bundle.js +0 -2
- package/dist/2272.app.bundle.js +0 -1
- package/dist/2715.app.bundle.js +0 -1
- package/dist/2783.app.bundle.js +0 -2
- package/dist/3848.app.bundle.js +0 -1
- package/dist/3853.app.bundle.js +0 -2
- package/dist/3882.app.bundle.js +0 -2
- package/dist/4114.app.bundle.js +0 -1
- package/dist/4397.app.bundle.js +0 -2
- package/dist/4934.app.bundle.js +0 -1
- package/dist/5194.app.bundle.js +0 -2
- package/dist/5847.app.bundle.js +0 -1
- package/dist/5889.app.bundle.js +0 -2
- package/dist/6230.app.bundle.js +0 -1
- package/dist/646.app.bundle.js +0 -2
- package/dist/6879.app.bundle.js +0 -1
- package/dist/7183.app.bundle.js +0 -2
- package/dist/7339.app.bundle.js +0 -2
- package/dist/7384.app.bundle.js +0 -2
- package/dist/7568.app.bundle.js +0 -2
- package/dist/7576.app.bundle.js +0 -1
- package/dist/7785.app.bundle.js +0 -2
- package/dist/7906.app.bundle.js +0 -2
- package/dist/8074.app.bundle.js +0 -2
- package/dist/8151.app.bundle.js +0 -2
- package/dist/8361.app.bundle.js +0 -2
- package/dist/8429.app.bundle.js +0 -2
- package/dist/8750.app.bundle.js +0 -2
- package/dist/8991.app.bundle.js +0 -2
- package/dist/9101.app.bundle.js +0 -1
- package/dist/9200.app.bundle.js +0 -2
- package/dist/9275.app.bundle.js +0 -2
- package/dist/9407.app.bundle.js +0 -2
- /package/dist/{1237.app.bundle.js.LICENSE.txt → 1339.app.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{1321.app.bundle.js.LICENSE.txt → 196.app.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{1563.app.bundle.js.LICENSE.txt → 20.app.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{2025.app.bundle.js.LICENSE.txt → 2222.app.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{2159.app.bundle.js.LICENSE.txt → 2654.app.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{2783.app.bundle.js.LICENSE.txt → 2664.app.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{3853.app.bundle.js.LICENSE.txt → 286.app.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{3882.app.bundle.js.LICENSE.txt → 4117.app.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{4397.app.bundle.js.LICENSE.txt → 4493.app.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{5194.app.bundle.js.LICENSE.txt → 5189.app.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{5889.app.bundle.js.LICENSE.txt → 5306.app.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{646.app.bundle.js.LICENSE.txt → 5699.app.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{7183.app.bundle.js.LICENSE.txt → 575.app.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{7339.app.bundle.js.LICENSE.txt → 5830.app.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{7384.app.bundle.js.LICENSE.txt → 6034.app.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{7568.app.bundle.js.LICENSE.txt → 6246.app.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{7785.app.bundle.js.LICENSE.txt → 6527.app.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{7906.app.bundle.js.LICENSE.txt → 6633.app.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{8074.app.bundle.js.LICENSE.txt → 6683.app.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{8151.app.bundle.js.LICENSE.txt → 6824.app.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{8361.app.bundle.js.LICENSE.txt → 712.app.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{8429.app.bundle.js.LICENSE.txt → 7367.app.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{8750.app.bundle.js.LICENSE.txt → 8175.app.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{8991.app.bundle.js.LICENSE.txt → 82.app.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{9200.app.bundle.js.LICENSE.txt → 8762.app.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{9275.app.bundle.js.LICENSE.txt → 890.app.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{9407.app.bundle.js.LICENSE.txt → 9157.app.bundle.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{d as defineCustomElement$3}from"./va-icon2.js";import{d as defineCustomElement$2}from"./va-link2.js";const vaLanguageToggleCss=":host div{display:inline-block}:host div div.inner-div{border-right:1px solid var(--vads-color-base-light);padding-right:8px;margin-right:8px}:host div va-link{color:var(--vads-color-link);padding-bottom:2px;border-bottom:1px solid var(--vads-color-link)}:host div va-link::part(anchor){text-decoration:none}:host div va-link.is-current-lang{font-weight:var(--font-weight-bold)}",VaLanguageToggleStyle0=vaLanguageToggleCss,VaLanguageToggle$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.vaLanguageToggle=createEvent(this,"vaLanguageToggle",7),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.language="en",this.enHref=void 0,this.esHref=void 0,this.tlHref=void 0,this.urls=void 0,this.routerLinks=!1}getUrl(e){const t=new URL(window.location.href);return t.searchParams.set("lang",e),t.href}handleToggle(e,t){this.routerLinks&&(e.preventDefault(),window.history.replaceState(null,null,this.getUrl(t)),this.language=t),this.vaLanguageToggle.emit({language:t});const a={componentName:"va-language-toggle",action:"linkClick",details:{"pipe-delimited-list-header":t}};this.componentLibraryAnalytics.emit(a)}componentWillLoad(){this.urls=[{label:"English",lang:"en",href:this.enHref}],this.esHref&&(this.urls=[...this.urls,{label:"Español",lang:"es",href:this.esHref}]),this.tlHref&&(this.urls=[...this.urls,{label:"Tagalog",lang:"tl",href:this.tlHref}])}render(){const{language:e,urls:t}=this;return h(Host,{key:"6bb29816a6e51e0d10635529391fa07974bdc6c2"},h("div",{key:"f51067276cc62e0eaf859b0f8748fd08c2579ba6"},t.map((({href:a,lang:n,label:s},l)=>{const i=classnames({"is-current-lang":n===e}),o=classnames({"inner-div":l<t.length-1});return h("div",{class:o},h("va-link",{class:i,href:a,language:n,onClick:e=>this.handleToggle(e,n),text:s}))}))))}static get style(){return VaLanguageToggleStyle0}},[1,"va-language-toggle",{language:[1025],enHref:[1,"en-href"],esHref:[1,"es-href"],tlHref:[1,"tl-href"],routerLinks:[4,"router-links"],urls:[32]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-language-toggle","va-icon","va-link"].forEach((e=>{switch(e){case"va-language-toggle":customElements.get(e)||customElements.define(e,VaLanguageToggle$1);break;case"va-icon":customElements.get(e)||defineCustomElement$3();break;case"va-link":customElements.get(e)||defineCustomElement$2()}}))}const VaLanguageToggle=VaLanguageToggle$1,defineCustomElement=defineCustomElement$1;export{VaLanguageToggle,defineCustomElement};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{d as defineCustomElement$2}from"./va-icon2.js";const vaLinkActionCss="/* From the USWDS styles: */\n/* https://github.com/uswds/uswds/blob/3dc296ec56cd621fe52d918701fd94621d96a198/src/stylesheets/core/mixins/_focus.scss#L12-L13 */\nbutton:not([disabled]):focus,\nselect:not([disabled]):focus,\na:not([disabled]):focus,\nh1:focus,\ninput:not([disabled]):focus,\ntextarea:not([disabled]):focus,\n#form-question\n[role='option']:focus,\n*[tabindex]:focus {\n outline: 2px solid var(--vads-color-action-focus-on-light);\n outline-offset: 2px;\n}\n\n\na {\n text-decoration: none;\n color: var(--vads-color-link);\n -webkit-transition-duration: 0.3s;\n transition-duration: 0.3s;\n -webkit-transition-timing-function: ease-in-out;\n transition-timing-function: ease-in-out;\n -webkit-transition-property: color, background-color, border-color;\n transition-property: color, background-color, border-color;\n}\n\na:hover {\n background-color: rgba(0, 0, 0, 0.05);\n color: inherit;\n}\n\na:visited {\n color: var(--vads-color-link-visited);\n}\n\n.sr-only {\n border: 0;\n clip: rect(0, 0, 0, 0);\n -webkit-clip-path: inset(50%);\n clip-path: inset(50%);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute !important;\n width: 1px;\n /* Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1241631 */\n word-wrap: normal !important;\n}\n\n\n:host {\n display: -ms-inline-flexbox;\n display: inline-flex;\n}\n\n:host a {\n display: -ms-inline-flexbox;\n display: inline-flex;\n -ms-flex-align: start;\n align-items: flex-start;\n cursor: pointer;\n text-decoration: underline;\n font-weight: 700;\n font-size: 1.06rem;\n padding: 0.5rem 0;\n &:active {\n outline: 2px solid var(--vads-color-action-focus-on-light);\n outline-offset: 2px;\n }\n}\n\n:host a.va-link--primary,\n:host a.va-link--secondary {\n &:hover, &:active {\n color: var(--vads-color-link) !important;\n }\n}\n\n:host a.va-link--reverse {\n color: var(--vads-color-white);\n\n &:hover, &:active {\n color: var(--vads-color-action-focus-on-light);\n background-color: transparent;\n }\n}\n\n:host a.va-link--reverse va-icon {\n &:hover, &:active {\n background-color: var(--vads-color-action-focus-on-light);\n }\n}\n\n.link-icon--left {\n margin-right: 8px;\n vertical-align: baseline;\n position: relative;\n}\n\n.link-icon {\n border-radius: 50%;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: center;\n justify-content: center;\n color: white;\n -webkit-transition-duration: 0.3s;\n transition-duration: 0.3s;\n -webkit-transition-timing-function: ease-in-out;\n transition-timing-function: ease-in-out;\n -webkit-transition-property: color, background-color, border-color;\n transition-property: color, background-color, border-color;\n}\n\n.va-link--primary {\n va-icon {\n background-color: var(--vads-color-success-dark);\n }\n}\n\n.va-link--secondary {\n va-icon {\n background-color: var(--vads-color-primary);\n }\n}\n\n.link-icon--reverse {\n background-color: var(--vads-color-white);\n color: var(--vads-color-black);\n}\n\n:host a.va-link--reverse:hover va-icon,\n:host a.va-link--reverse:active va-icon {\n background-color: var(--vads-color-action-focus-on-light) !important;\n}\n\n.link-text {\n display: inline-block;\n vertical-align: top;\n max-width: calc(100% - 24px);\n white-space: pre-wrap;\n}",VaLinkActionStyle0=vaLinkActionCss,VaLinkAction$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.handleClick=n=>{if(!this.disableAnalytics){const n={componentName:"va-link-action",action:"click",details:{label:this.text,destination:this.href,origin:window.location.href}};this.componentLibraryAnalytics.emit(n)}},this.disableAnalytics=!1,this.href=void 0,this.text=void 0,this.messageAriaDescribedby=void 0,this.type="primary",this.label=void 0,this.isSingleLine=!0}
|
|
1
|
+
import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{d as defineCustomElement$2}from"./va-icon2.js";const vaLinkActionCss="/* From the USWDS styles: */\n/* https://github.com/uswds/uswds/blob/3dc296ec56cd621fe52d918701fd94621d96a198/src/stylesheets/core/mixins/_focus.scss#L12-L13 */\nbutton:not([disabled]):focus,\nselect:not([disabled]):focus,\na:not([disabled]):focus,\nh1:focus,\ninput:not([disabled]):focus,\ntextarea:not([disabled]):focus,\n#form-question\n[role='option']:focus,\n*[tabindex]:focus {\n outline: 2px solid var(--vads-color-action-focus-on-light);\n outline-offset: 2px;\n}\n\n\na {\n text-decoration: none;\n color: var(--vads-color-link);\n -webkit-transition-duration: 0.3s;\n transition-duration: 0.3s;\n -webkit-transition-timing-function: ease-in-out;\n transition-timing-function: ease-in-out;\n -webkit-transition-property: color, background-color, border-color;\n transition-property: color, background-color, border-color;\n}\n\na:hover {\n background-color: rgba(0, 0, 0, 0.05);\n color: inherit;\n}\n\na:visited {\n color: var(--vads-color-link-visited);\n}\n\n.sr-only {\n border: 0;\n clip: rect(0, 0, 0, 0);\n -webkit-clip-path: inset(50%);\n clip-path: inset(50%);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute !important;\n width: 1px;\n /* Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1241631 */\n word-wrap: normal !important;\n}\n\n\n:host {\n display: -ms-inline-flexbox;\n display: inline-flex;\n}\n\n:host a {\n display: -ms-inline-flexbox;\n display: inline-flex;\n -ms-flex-align: start;\n align-items: flex-start;\n cursor: pointer;\n text-decoration: underline;\n font-weight: 700;\n font-size: 1.06rem;\n padding: 0.5rem 0;\n &:active {\n outline: 2px solid var(--vads-color-action-focus-on-light);\n outline-offset: 2px;\n }\n}\n\n:host a.va-link--primary,\n:host a.va-link--secondary {\n &:hover, &:active {\n color: var(--vads-color-link) !important;\n }\n}\n\n:host a.va-link--reverse {\n color: var(--vads-color-white);\n\n &:hover, &:active {\n color: var(--vads-color-action-focus-on-light);\n background-color: transparent;\n }\n}\n\n:host a.va-link--reverse va-icon {\n &:hover, &:active {\n background-color: var(--vads-color-action-focus-on-light);\n }\n}\n\n.link-icon--left {\n margin-right: 8px;\n vertical-align: baseline;\n position: relative;\n}\n\n.link-icon {\n border-radius: 50%;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: center;\n justify-content: center;\n color: white;\n -webkit-transition-duration: 0.3s;\n transition-duration: 0.3s;\n -webkit-transition-timing-function: ease-in-out;\n transition-timing-function: ease-in-out;\n -webkit-transition-property: color, background-color, border-color;\n transition-property: color, background-color, border-color;\n}\n\n.va-link--primary {\n va-icon {\n background-color: var(--vads-color-success-dark);\n }\n}\n\n.va-link--secondary {\n va-icon {\n background-color: var(--vads-color-primary);\n }\n}\n\n.link-icon--reverse {\n background-color: var(--vads-color-white);\n color: var(--vads-color-black);\n}\n\n:host a.va-link--reverse:hover va-icon,\n:host a.va-link--reverse:active va-icon {\n background-color: var(--vads-color-action-focus-on-light) !important;\n}\n\n.link-text {\n display: inline-block;\n vertical-align: top;\n max-width: calc(100% - 24px);\n white-space: pre-wrap;\n}",VaLinkActionStyle0=vaLinkActionCss,VaLinkAction$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.handleClick=n=>{if(!this.disableAnalytics){const n={componentName:"va-link-action",action:"click",details:{label:this.text,destination:this.href,origin:window.location.href}};this.componentLibraryAnalytics.emit(n)}},this.disableAnalytics=!1,this.href=void 0,this.text=void 0,this.messageAriaDescribedby=void 0,this.type="primary",this.label=void 0,this.isSingleLine=!0}componentWillLoad(){this.checkTextLines()}checkTextLines(){if(this.linkRef){const n=getComputedStyle(this.linkRef),i=parseFloat(n.lineHeight),e=this.linkRef.clientHeight;this.isSingleLine=e<=i}}render(){const{handleClick:n,href:i,text:e,messageAriaDescribedby:o,type:t,label:a}=this,s=classnames({"va-link--reverse":"reverse"===t,"va-link--primary":"primary"===t,"va-link--secondary":"secondary"===t}),r=classnames("link-icon--left","link-icon",{"link-icon--reverse":"reverse"===t});return h(Host,{key:"03d2c1b81566b4d8fb66b4f7562c1cd2b0991b9f"},h("a",{key:"06e7f7263eaf5dbd69ed5fcd9143f7b3ff0b022d",href:i,class:s,"aria-label":a,"aria-describedby":o?"link-description":null,onClick:n,ref:n=>this.linkRef=n},h("va-icon",{key:"9eb006b28f056f9aff9d60ccf181f764c4a1ae0b",class:r,icon:"chevron_right",size:3}),h("span",{key:"3d5f7140749b63e644c46c89d7edb5d5e80bb5fd",class:"link-text"},e)),o&&h("span",{key:"ddd9606f205be4daa9fe37d4cc70c4d0a5ad0048",id:"link-description",class:"sr-only"},o))}static get watchers(){return{text:["checkTextLines"]}}static get style(){return VaLinkActionStyle0}},[1,"va-link-action",{disableAnalytics:[4,"disable-analytics"],href:[1],text:[1],messageAriaDescribedby:[1,"message-aria-describedby"],type:[1],label:[1],isSingleLine:[32]},void 0,{text:["checkTextLines"]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-link-action","va-icon"].forEach((n=>{switch(n){case"va-link-action":customElements.get(n)||customElements.define(n,VaLinkAction$1);break;case"va-icon":customElements.get(n)||defineCustomElement$2()}}))}const VaLinkAction=VaLinkAction$1,defineCustomElement=defineCustomElement$1;export{VaLinkAction,defineCustomElement};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{d as defineCustomElement$1}from"./va-icon2.js";const vaLinkCss='p,a,ol,ul,li,dl,dt,dd,form,label,button{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.5}button:not([disabled]):focus,select:not([disabled]):focus,a:not([disabled]):focus,h1:focus,input:not([disabled]):focus,textarea:not([disabled]):focus,#form-question [role=\'option\']:focus,*[tabindex]:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}a{text-decoration:none;color:var(--vads-color-link);-webkit-transition-duration:0.3s;transition-duration:0.3s;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-property:color, background-color, border-color;transition-property:color, background-color, border-color}a:hover{background-color:rgba(0, 0, 0, 0.05);color:inherit}a:visited{color:var(--vads-color-link-visited)}.usa-sr-only{position:absolute;left:-999em;right:auto}:host{display:inline}:host([href]:focus){outline:none !important}:host a{cursor:pointer;text-decoration:underline;font:inherit}:host a.va-link--reverse,:host a.va-link--reverse .link-icon--back{color:var(--vads-color-white)}:host a.va-link--reverse:hover,:host a.va-link--reverse:active,:host a.va-link--reverse:hover .link-icon--back,:host a.va-link--reverse:active .link-icon--back,:host a.va-link--reverse .link-icon--back:hover,:host a.va-link--reverse .link-icon--back:active,:host a.va-link--reverse .link-icon--back:hover .link-icon--back,:host a.va-link--reverse .link-icon--back:active .link-icon--back{color:var(--vads-color-action-focus-on-light);background-color:transparent}:host([active]:not([active=false])) a{font-weight:700}:host([icon-name]) va-icon{margin-right:4px}.link-icon--active{vertical-align:baseline;position:relative;top:3px}.link-icon--left{margin-right:4px;vertical-align:baseline;position:relative;top:3px}.link-container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}.link-icon--back{color:var(--vads-color-gray-medium);-webkit-transition-duration:0.3s;transition-duration:0.3s;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-property:color, background-color, border-color;transition-property:color, background-color, border-color}.link--center{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}dfn{font-style:normal}abbr{text-decoration:none}.external-link-icon{margin-left:4px}',VaLinkStyle0=vaLinkCss,VaLink=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.handleClick=e=>{if(!this.disableAnalytics){const e={componentName:"va-link",action:"click",details:{label:this.text,destination:this.href,origin:window.location.href}};this.componentLibraryAnalytics.emit(e)}},this.getAbbreviationTitle=()=>{const{abbrTitle:e,filetype:i}=this;return"PDF"===i?"Portable Document Format":e},this.abbrTitle=void 0,this.active=!1,this.back=!1,this.calendar=!1,this.channel=!1,this.disableAnalytics=!1,this.download=!1,this.href=void 0,this.filename=void 0,this.filetype=void 0,this.pages=void 0,this.text=void 0,this.video=!1,this.reverse=!1,this.external=!1,this.label=null,this.iconName=null,this.iconSize=3}render(){const{active:e,back:i,calendar:n,channel:o,download:t,filetype:a,filename:l,getAbbreviationTitle:
|
|
1
|
+
import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{d as defineCustomElement$1}from"./va-icon2.js";const vaLinkCss='p,a,ol,ul,li,dl,dt,dd,form,label,button{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.5}button:not([disabled]):focus,select:not([disabled]):focus,a:not([disabled]):focus,h1:focus,input:not([disabled]):focus,textarea:not([disabled]):focus,#form-question [role=\'option\']:focus,*[tabindex]:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}a{text-decoration:none;color:var(--vads-color-link);-webkit-transition-duration:0.3s;transition-duration:0.3s;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-property:color, background-color, border-color;transition-property:color, background-color, border-color}a:hover{background-color:rgba(0, 0, 0, 0.05);color:inherit}a:visited{color:var(--vads-color-link-visited)}.usa-sr-only{position:absolute;left:-999em;right:auto}:host{display:inline}:host([href]:focus){outline:none !important}:host a{cursor:pointer;text-decoration:underline;font:inherit}:host a.va-link--reverse,:host a.va-link--reverse .link-icon--back{color:var(--vads-color-white)}:host a.va-link--reverse:hover,:host a.va-link--reverse:active,:host a.va-link--reverse:hover .link-icon--back,:host a.va-link--reverse:active .link-icon--back,:host a.va-link--reverse .link-icon--back:hover,:host a.va-link--reverse .link-icon--back:active,:host a.va-link--reverse .link-icon--back:hover .link-icon--back,:host a.va-link--reverse .link-icon--back:active .link-icon--back{color:var(--vads-color-action-focus-on-light);background-color:transparent}:host([active]:not([active=false])) a{font-weight:700}:host([icon-name]) va-icon{margin-right:4px}.link-icon--active{vertical-align:baseline;position:relative;top:3px}.link-icon--left{margin-right:4px;vertical-align:baseline;position:relative;top:3px}.link-container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}.link-icon--back{color:var(--vads-color-gray-medium);-webkit-transition-duration:0.3s;transition-duration:0.3s;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-property:color, background-color, border-color;transition-property:color, background-color, border-color}.link--center{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}dfn{font-style:normal}abbr{text-decoration:none}.external-link-icon{margin-left:4px}',VaLinkStyle0=vaLinkCss,VaLink=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.handleClick=e=>{if(!this.disableAnalytics){const e={componentName:"va-link",action:"click",details:{label:this.text,destination:this.href,origin:window.location.href}};this.componentLibraryAnalytics.emit(e)}},this.getAbbreviationTitle=()=>{const{abbrTitle:e,filetype:i}=this;return"PDF"===i?"Portable Document Format":e},this.abbrTitle=void 0,this.active=!1,this.back=!1,this.calendar=!1,this.channel=!1,this.disableAnalytics=!1,this.download=!1,this.href=void 0,this.filename=void 0,this.filetype=void 0,this.pages=void 0,this.text=void 0,this.video=!1,this.reverse=!1,this.external=!1,this.label=null,this.iconName=null,this.iconSize=3,this.language=void 0}render(){const{active:e,back:i,calendar:n,channel:o,download:t,filetype:a,filename:l,getAbbreviationTitle:r,handleClick:s,href:c,pages:d,text:u,video:v,reverse:b,external:k,iconName:f,iconSize:m,language:p}=this,g=classnames({"va-link--reverse":b,"link--center":f||k});if(e)return h(Host,null,h("a",{href:c,class:g,onClick:s,"aria-label":this.label},u,h("va-icon",{class:"link-icon--active",icon:"chevron_right"})));if(i){const e=h("va-icon",{icon:"arrow_back",class:"link-icon--left link-icon--back"});return h(Host,null,h("div",{class:"link-container"},e,h("a",{href:c,class:g,onClick:s,"aria-label":this.label},u)))}if(o||v)return h(Host,null,h("a",{href:c,class:g,onClick:s,rel:"noopener",target:"_blank"},h("va-icon",{class:"link-icon--left",icon:o?"youtube":"play_circle"}),u," ",h("dfn",null,o?"YouTube":"on YouTube")));if(n)return h(Host,null,h("a",{href:c,class:g,download:l,onClick:s},h("va-icon",{class:"link-icon--left",icon:"calendar_today"}),u));if(t)return h(Host,null,h("a",{href:c,class:g,download:l,onClick:s},h("va-icon",{class:"link-icon--left",icon:"file_download"}),u," ",a&&h("dfn",null,"(",h("abbr",{title:r()},a),d&&`, ${d} pages`,")")));if(f)return h(Host,null,h("a",{href:c,class:g,onClick:s},h("va-icon",{icon:f,size:m,part:"icon"}),u));if(k)return h(Host,null,h("a",{href:c,rel:"noreferrer",class:g,onClick:s,target:"_blank"},u," (opens in a new tab)",h("span",{class:"usa-sr-only"},"opens in a new tab")));const y=p||null;return h(Host,null,h("a",{href:c,class:g,onClick:s,"aria-label":this.label,part:"anchor",lang:y,hrefLang:y},u))}static get style(){return VaLinkStyle0}},[1,"va-link",{abbrTitle:[1,"abbr-title"],active:[516],back:[4],calendar:[4],channel:[4],disableAnalytics:[4,"disable-analytics"],download:[4],href:[1],filename:[1],filetype:[1],pages:[2],text:[1],video:[4],reverse:[4],external:[4],label:[1],iconName:[1,"icon-name"],iconSize:[2,"icon-size"],language:[1]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["va-link","va-icon"].forEach((e=>{switch(e){case"va-link":customElements.get(e)||customElements.define(e,VaLink);break;case"va-icon":customElements.get(e)||defineCustomElement$1()}}))}export{VaLink as V,defineCustomElement as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";var isChromatic=function(
|
|
1
|
+
import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";var isChromatic=function(e){const t=e||"undefined"!=typeof window&&window;return!(!t||!t.navigator.userAgent.match(/Chromatic/)&&!t.location.href.match(/chromatic=true/))};const vaLoadingIndicatorCss=":host{display:block;font-size:1.06rem;text-align:center}.loading-indicator{display:block;height:4rem;margin-top:1rem}.loading-indicator:after{content:' ';display:inline-block;width:2.1875rem;height:2.1875rem;margin:1px;border-radius:50%;border:8px solid var(--vads-color-primary);border-color:var(--vads-color-primary) transparent var(--vads-color-primary)\n transparent;-webkit-animation:spin 1.5s linear infinite;animation:spin 1.5s linear infinite}.loading-indicator.chromatic:after{-webkit-animation:none;animation:none}.loading-indicator:focus{outline:none}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}",VaLoadingIndicatorStyle0=vaLoadingIndicatorCss,VaLoadingIndicator$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.loadingStartTime=null,this.observer=null,this.message=void 0,this.label="Loading",this.setFocus=!1,this.enableAnalytics=!1}componentDidLoad(){this.setFocus&&this.spinner&&this.spinner.focus(),this.loadingStartTime=Date.now();const e=this.el.parentNode;this.observer=new MutationObserver((t=>{for(const i of t)if("childList"===i.type){const t=Array.from(i.removedNodes.values()).filter((e=>{var t;return"va-loading-indicator"===(null===(t=null==e?void 0:e.tagName)||void 0===t?void 0:t.toLowerCase())})).length>0;if(this.enableAnalytics&&t){const t=new CustomEvent("component-library-analytics",{bubbles:!0,composed:!0,detail:{componentName:"va-loading-indicator",action:"displayed",details:{displayTime:Date.now()-this.loadingStartTime,message:this.message}}});e.dispatchEvent(t)}}})),this.observer.observe(e,{childList:!0})}render(){const{message:e,label:t}=this;let i="loading-indicator";return isChromatic()&&(i+=" chromatic"),h(Host,{key:"54be1943f1ee7ed5619e097c84388da9e644228c","aria-live":"polite"},h("div",{key:"89a7d36d03fca5e12399b0c23b35db4675da0910",ref:e=>this.spinner=e,class:i,role:"progressbar","aria-label":t,"aria-valuetext":e,tabindex:"-1"}),e)}get el(){return this}static get style(){return VaLoadingIndicatorStyle0}},[1,"va-loading-indicator",{message:[1],label:[1],setFocus:[4,"set-focus"],enableAnalytics:[4,"enable-analytics"]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-loading-indicator"].forEach((e=>{"va-loading-indicator"===e&&(customElements.get(e)||customElements.define(e,VaLoadingIndicator$1))}))}const VaLoadingIndicator=VaLoadingIndicator$1,defineCustomElement=defineCustomElement$1;export{VaLoadingIndicator,defineCustomElement};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Build,proxyCustomElement,HTMLElement,createEvent,forceUpdate,h,Fragment,Host}from"@stencil/core/internal/client";import{v as validate,z as zeroPadStart,g as getErrorParameters,m as months}from"./date-utils.js";import{a as getHeaderLevel}from"./utils.js";import"./i18n-setup.js";import"./contacts.js";import{c as classnames}from"./index2.js";import{d as defineCustomElement$4}from"./va-icon2.js";import{d as defineCustomElement$3}from"./va-select2.js";import{d as defineCustomElement$2}from"./va-text-input2.js";import{i as instance}from"./i18next.js";const vaMemorableDateCss='button:not([disabled]):focus,select:not([disabled]):focus,a:not([disabled]):focus,h1:focus,input:not([disabled]):focus,textarea:not([disabled]):focus,#form-question [role=\'option\']:focus,*[tabindex]:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}#error-message{margin-bottom:0.75rem}#error-message,#input-error-message{color:var(--vads-color-secondary-dark);display:block;font-weight:700;font-size:1.06rem}:host([error]:not([error=\'\'])){border-left:0.3rem solid var(--vads-color-secondary-dark);padding-left:1.25rem;position:relative}@media screen and (min-width: 1008px){:host([error]:not([error=\'\'])){margin-left:-1.4375rem;}}h1{margin-top:0}h1,h2,h3,h4,h5,h6{margin-bottom:0;margin-top:0;clear:both}*+h1,*+h2,*+h3,*+h4,*+h5,*+h6{margin-top:1.5em}h1+*,h2+*,h3+*,h4+*,h5+*,h6+*{margin-top:1em}h1{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:2.44rem;line-height:1.2;font-weight:700}h2{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:1.95rem;line-height:1.2;font-weight:700}h3{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:1.34rem;line-height:1.2;font-weight:700}h4{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:0.98rem;line-height:1.2;font-weight:700}h5{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:0.91rem;line-height:1.2;font-weight:700}h6{font-family:Source Sans Pro Web, Helvetica Neue, Helvetica, Roboto, Arial, sans-serif;font-size:0.87rem;line-height:1.1;font-weight:normal;letter-spacing:0.025em;text-transform:uppercase}h1,h2,h3,h4,h5{font-family:Bitter, Georgia, Cambria, "Times New Roman", Times, serif;font-weight:700}h6{font-family:"Source Sans Pro", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;font-weight:700}h1{margin-top:0;font-size:2.5rem}h2{font-size:1.875rem}h3{font-size:1.25rem}h4{font-size:1.0625rem}h5{font-size:0.9375rem}h6{font-size:0.9375rem}@media (max-width: 481px){h1{font-size:30px}h2{font-size:24px}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}@media (max-width: 481px){h1{font-size:30px}h2{font-size:24px}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}:host legend :is(h1,h2,h3,h4,h5,h6),:host label :is(h1,h2,h3,h4,h5,h6){display:inline;margin:0px}:host legend :is(h1,h2,h3,h4,h5),:host label :is(h1,h2,h3,h4,h5){font-family:var(--font-serif)}:host h1+*,:host h2+*,:host h3+*,:host h4+*,:host h5+*,:host h6+*{margin-top:unset}:host #form-question{margin-bottom:1rem}.usa-hint,.usa-fieldset{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3}.usa-sr-only{position:absolute;left:-999em;right:auto}.usa-form{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3}@media all and (min-width: 30em){.usa-form{max-width:20rem}}.usa-form abbr[title=required]{text-decoration:none}.usa-form .usa-input,.usa-form .usa-range,.usa-form .usa-select,.usa-form .usa-textarea{max-width:none}.usa-form .usa-input--2xs,.usa-form .usa-input-group--2xs{max-width:5ex}.usa-form .usa-input--xs,.usa-form .usa-input-group--xs{max-width:9ex}.usa-form .usa-input--sm,.usa-form .usa-input--small,.usa-form .usa-input-group--sm,.usa-form .usa-input-group--small{max-width:13ex}.usa-form .usa-input--md,.usa-form .usa-input--medium,.usa-form .usa-input-group--md,.usa-form .usa-input-group--medium{max-width:20ex}.usa-form .usa-input--lg,.usa-form .usa-input-group--lg{max-width:30ex}.usa-form .usa-input--xl,.usa-form .usa-input-group--xl{max-width:40ex}.usa-form .usa-input--2xl,.usa-form .usa-input-group--2xl{max-width:50ex}.usa-form .usa-button{margin-top:0.5rem}@media all and (min-width: 30em){.usa-form .usa-button{margin-top:1.5rem}}.usa-form a:where(:not(.usa-button)){color:#005ea2;text-decoration:underline}.usa-form a:where(:not(.usa-button)):visited{color:#54278f}.usa-form a:where(:not(.usa-button)):hover{color:#1a4480}.usa-form a:where(:not(.usa-button)):active{color:#162e51}.usa-form a:where(:not(.usa-button)):focus{outline:0.25rem solid #2491ff;outline-offset:0rem}@media all and (min-width: 30em){.usa-form--large{max-width:30rem}}.usa-show-password{color:#005ea2;text-decoration:underline;background-color:transparent;border:0;border-radius:0;-webkit-box-shadow:none;box-shadow:none;font-weight:normal;-ms-flex-pack:normal;justify-content:normal;text-align:left;margin:0;padding:0;width:auto;cursor:pointer}.usa-show-password:visited{color:#54278f}.usa-show-password:hover{color:#1a4480}.usa-show-password:active{color:#162e51}.usa-show-password:focus{outline:0.25rem solid #2491ff;outline-offset:0rem}.usa-show-password:hover,.usa-show-password.usa-button--hover,.usa-show-password:disabled:hover,.usa-show-password[aria-disabled=true]:hover,.usa-show-password:disabled.usa-button--hover,.usa-show-password[aria-disabled=true].usa-button--hover,.usa-show-password:active,.usa-show-password.usa-button--active,.usa-show-password:disabled:active,.usa-show-password[aria-disabled=true]:active,.usa-show-password:disabled.usa-button--active,.usa-show-password[aria-disabled=true].usa-button--active,.usa-show-password:disabled:focus,.usa-show-password[aria-disabled=true]:focus,.usa-show-password:disabled.usa-focus,.usa-show-password[aria-disabled=true].usa-focus,.usa-show-password:disabled,.usa-show-password[aria-disabled=true],.usa-show-password.usa-button--disabled{background-color:transparent;-webkit-box-shadow:none;box-shadow:none;text-decoration:underline}.usa-show-password.usa-button--hover{color:#1a4480}.usa-show-password.usa-button--active{color:#162e51}.usa-show-password:disabled,.usa-show-password[aria-disabled=true],.usa-show-password:disabled:hover,.usa-show-password[aria-disabled=true]:hover,.usa-show-password[aria-disabled=true]:focus{color:#757575}@media (forced-colors: active){.usa-show-password:disabled,.usa-show-password[aria-disabled=true],.usa-show-password:disabled:hover,.usa-show-password[aria-disabled=true]:hover,.usa-show-password[aria-disabled=true]:focus{color:GrayText}}.usa-form__note,.usa-show-password{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:0.93rem;line-height:1.3;float:right;margin:0.25rem 0 1rem}.usa-fieldset{border:none;margin:0;padding:0}.usa-legend{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3;display:block;font-weight:normal;margin-top:1.5rem;max-width:30rem}.usa-legend--large{font-size:2.13rem;font-weight:700;margin-top:1rem}.usa-label{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3;display:block;font-weight:normal;margin-top:1.5rem;max-width:30rem}.usa-label--error{font-weight:700;margin-top:0}.usa-label--required{color:#b50909}.usa-hint{color:#71767a}.usa-hint--required{color:#b50909}.usa-form-group{margin-top:1.5rem}.usa-form-group .usa-label:first-child{margin-top:0}.usa-form-group--error{border-left-width:0.25rem;border-left-color:#b50909;border-left-style:solid;padding-left:1rem;position:relative}@media all and (min-width: 64em){.usa-form-group--error{margin-left:-1.25rem}}.usa-error-message{padding-bottom:0.25rem;padding-top:0.25rem;color:#b50909;display:block;font-weight:700}.usa-memorable-date{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.usa-memorable-date [type=number]{-moz-appearance:textfield}.usa-memorable-date [type=number]::-webkit-inner-spin-button{-webkit-appearance:none;appearance:none}.usa-memorable-date [type=number]::-webkit-contacts-auto-fill-button{visibility:hidden;display:none !important;pointer-events:none;height:0;width:0;margin:0}.usa-memorable-date .usa-form-group{margin-top:1rem}.usa-form-group--day,.usa-form-group--month,.usa-form-group--year{-ms-flex:0 1 auto;flex:0 1 auto;margin-right:1rem;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.usa-form-group--day input,.usa-form-group--month input{width:3rem}.usa-form-group--month select{width:15rem}.usa-form-group--year input{width:4.5rem}.usa-error-message{font-size:1.06rem}:host([error]:not([error=""])){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""])[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1008px){:host([error]:not([error=""])){margin-left:-0.9rem}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1008px){:host([error]:not([error=""])[use-forms-pattern=multiple]){padding-left:0}}:host{display:block;font-family:var(--font-source-sans);margin-top:24px}#error-message{margin-bottom:0}.usa-hint{display:block}slot:not([name])::slotted(*){margin-bottom:0.5rem}va-select::part(label),va-text-input::part(label){margin-top:0;margin-bottom:12px}va-text-input::part(validation){display:none}.usa-memorable-date{margin-top:16px;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.usa-memorable-date .usa-form-group{margin-top:0px}.usa-form-group--month{margin-right:16px}.usa-form-group--month-input{width:48px}.usa-form-group--month-select{width:15rem}.usa-form-group--day-input{width:3rem}.usa-form-group--year-input{width:4.5rem}@media (max-width: 480px){.usa-form-group--month-select{width:100%}.usa-form-group--select{-ms-flex:0 1 50%;flex:0 1 50%;width:50%}}',VaMemorableDateStyle0=vaMemorableDateCss;Build.isTesting&&instance.init({lng:"cimode"});const VaMemorableDate$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.dateChange=createEvent(this,"dateChange",7),this.dateBlur=createEvent(this,"dateBlur",7),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.dayTouched=!1,this.monthTouched=!1,this.yearTouched=!1,this.handleDateBlur=e=>{const[a,t,r]=(this.value||"").split("-"),o=Number(a),s=Number(t),i=Number(r);if(validate({component:this,year:o,month:s,day:i,yearTouched:this.yearTouched,monthTouched:this.monthTouched,dayTouched:this.dayTouched,monthSelect:this.monthSelect}),!this.error&&(this.value=a||t||r?`${a}-${t?zeroPadStart(s):""}-${r?zeroPadStart(i):""}`:"",this.dateBlur.emit(e),this.enableAnalytics)){const e={componentName:"va-memorable-date",action:"blur",details:{label:this.label,year:o,month:s,day:i}};this.componentLibraryAnalytics.emit(e)}},this.handleMonthChange=e=>{this.handleDateChange(e)},this.handleDateChange=e=>{const a=e.target;let[t,r,o]=(this.value||"").split("-");(a.classList.contains("input-month")||a.classList.contains("usa-form-group--month-input")||a.classList.contains("usa-form-group--month-select"))&&(r=a.value),(a.classList.contains("input-day")||a.classList.contains("usa-form-group--day-input"))&&(o=a.value),(a.classList.contains("input-year")||a.classList.contains("usa-form-group--year-input"))&&(t=a.value),this.value=t||r||o?`${t}-${r||""}-${o||""}`:"",this.dateChange.emit(e)},this.handleMonthBlur=()=>{this.monthTouched=!0},this.handleDayBlur=()=>{this.dayTouched=!0},this.handleYearBlur=()=>{this.yearTouched=!0},this.required=!1,this.useFormsPattern=void 0,this.formHeadingLevel=3,this.formHeading=void 0,this.monthSelect=!1,this.label=void 0,this.name=void 0,this.hint=void 0,this.error=void 0,this.value=void 0,this.customDayErrorMessage=void 0,this.customMonthErrorMessage=void 0,this.customYearErrorMessage=void 0,this.invalidDay=!1,this.invalidMonth=!1,this.invalidYear=!1,this.enableAnalytics=!1}connectedCallback(){instance.on("languageChanged",(()=>{forceUpdate(this.el)}))}disconnectedCallback(){instance.off("languageChanged")}render(){const{required:e,label:a,name:t,hint:r,error:o,handleDateBlur:s,handleDateChange:i,value:n,monthSelect:l,useFormsPattern:u,formHeadingLevel:m,formHeading:d}=this,[p,f,c]=(n||"").split("-"),g=["dateHint",r?"hint":""].filter(Boolean).join(" "),b=l?instance.t("date-hint-with-select"):instance.t("date-hint"),w=e=>instance.t(e,(e=>{const a=parseInt(p),t=parseInt(f);return getErrorParameters(e,a,t)})(e)),v=`${u&&d?"form-question":""} ${u?"form-description":""} ${u&&a?"input-label":""}`.trim()||null;let y=null;if("single"===u||"multiple"===u){const e=getHeaderLevel(m);y=h(Fragment,null,d&&h(e,{id:"form-question",part:"form-header"},d),h("div",{id:"form-description"},h("slot",{name:"form-description"})))}const x=l?h("div",{class:"usa-form-group usa-form-group--month usa-form-group--select"},h("va-select",{label:instance.t("month"),name:t?`${t}Month`:"Month","aria-describedby":g,"aria-labelledby":v,invalid:this.invalidMonth,onVaSelect:this.handleMonthChange,onBlur:this.handleMonthBlur,class:"usa-form-group--month-select",reflectInputError:"month-range"===o,value:f?String(parseInt(f)):f,error:this.invalidMonth?w(o):null,showError:!1},months&&months.map((e=>h("option",{value:e.value,selected:e.value===parseInt(f)},e.label))))):h("div",{class:"usa-form-group usa-form-group--month"},h("va-text-input",{label:instance.t("month"),name:t?`${t}Month`:"Month",maxlength:2,pattern:"[0-9]*","aria-describedby":g,"aria-labelledby":v,invalid:this.invalidMonth,value:null==f?void 0:f.toString(),onInput:i,onBlur:this.handleMonthBlur,class:"usa-form-group--month-input memorable-date-input",reflectInputError:"month-range"===o,inputmode:"numeric",type:"text",error:this.invalidMonth?w(o):null,"show-input-error":"false"})),M=classnames({"usa-legend":!0,"usa-label--error":o});return h(Host,{onBlur:s},y,h("div",{class:"input-wrap"},h("fieldset",{class:"usa-form usa-fieldset"},h("legend",{class:M,id:"input-label",part:"legend"},a,e&&h("span",{class:"usa-label--required"}," ",instance.t("required")),r&&h("div",{class:"usa-hint",id:"hint"},r),h("span",{class:"usa-hint",id:"dateHint"},b)),h("span",{id:"error-message",role:"alert"},o&&h(Fragment,null,h("span",{class:"usa-sr-only"},instance.t("error")),h("span",{class:"usa-error-message"},(e=>{let a="";return this.invalidDay?a=this.customDayErrorMessage:this.invalidMonth?a=this.customMonthErrorMessage:this.invalidYear&&(a=this.customYearErrorMessage),a||w(e)})(o)))),h("slot",null),h("div",{class:"usa-memorable-date"},x,h("div",{class:"usa-form-group usa-form-group--day"},h("va-text-input",{label:instance.t("day"),name:t?`${t}Day`:"Day",maxlength:2,pattern:"[0-9]*","aria-describedby":g,invalid:this.invalidDay,value:null==c?void 0:c.toString(),onInput:i,onBlur:this.handleDayBlur,class:"usa-form-group--day-input memorable-date-input",reflectInputError:"day-range"===o,inputmode:"numeric",type:"text",error:this.invalidDay?w(o):null,"show-input-error":"false"})),h("div",{class:"usa-form-group usa-form-group--year"},h("va-text-input",{label:instance.t("year"),name:t?`${t}Year`:"Year",maxlength:4,pattern:"[0-9]*","aria-describedby":g,invalid:this.invalidYear,value:null==p?void 0:p.toString(),onInput:i,onBlur:this.handleYearBlur,class:"usa-form-group--year-input memorable-date-input",reflectInputError:"year-range"===o,inputmode:"numeric",type:"text",error:this.invalidYear?w(o):null,"show-input-error":"false"}))))))}get el(){return this}static get style(){return VaMemorableDateStyle0}},[1,"va-memorable-date",{required:[4],useFormsPattern:[1,"use-forms-pattern"],formHeadingLevel:[2,"form-heading-level"],formHeading:[1,"form-heading"],monthSelect:[4,"month-select"],label:[1],name:[1],hint:[1],error:[1537],value:[1537],customDayErrorMessage:[1,"custom-day-error-message"],customMonthErrorMessage:[1,"custom-month-error-message"],customYearErrorMessage:[1,"custom-year-error-message"],invalidDay:[1028,"invalid-day"],invalidMonth:[1028,"invalid-month"],invalidYear:[1028,"invalid-year"],enableAnalytics:[4,"enable-analytics"]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-memorable-date","va-icon","va-select","va-text-input"].forEach((e=>{switch(e){case"va-memorable-date":customElements.get(e)||customElements.define(e,VaMemorableDate$1);break;case"va-icon":customElements.get(e)||defineCustomElement$4();break;case"va-select":customElements.get(e)||defineCustomElement$3();break;case"va-text-input":customElements.get(e)||defineCustomElement$2()}}))}const VaMemorableDate=VaMemorableDate$1,defineCustomElement=defineCustomElement$1;export{VaMemorableDate,defineCustomElement};
|
|
1
|
+
import{Build,proxyCustomElement,HTMLElement,createEvent,forceUpdate,h,Fragment,Host}from"@stencil/core/internal/client";import{v as validate,z as zeroPadStart,g as getErrorParameters,m as months}from"./date-utils.js";import{a as getHeaderLevel}from"./utils.js";import"./i18n-setup.js";import"./contacts.js";import{c as classnames}from"./index2.js";import{d as defineCustomElement$4}from"./va-icon2.js";import{d as defineCustomElement$3}from"./va-select2.js";import{d as defineCustomElement$2}from"./va-text-input2.js";import{i as instance}from"./i18next.js";const vaMemorableDateCss='button:not([disabled]):focus,select:not([disabled]):focus,a:not([disabled]):focus,h1:focus,input:not([disabled]):focus,textarea:not([disabled]):focus,#form-question [role=\'option\']:focus,*[tabindex]:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}#error-message{margin-bottom:0.75rem}#error-message,#input-error-message{color:var(--vads-color-secondary-dark);display:block;font-weight:700;font-size:1.06rem}:host([error]:not([error=\'\'])){border-left:0.3rem solid var(--vads-color-secondary-dark);padding-left:1.25rem;position:relative}@media screen and (min-width: 1008px){:host([error]:not([error=\'\'])){margin-left:-1.4375rem;}}h1{margin-top:0}h1,h2,h3,h4,h5,h6{margin-bottom:0;margin-top:0;clear:both}*+h1,*+h2,*+h3,*+h4,*+h5,*+h6{margin-top:1.5em}h1+*,h2+*,h3+*,h4+*,h5+*,h6+*{margin-top:1em}h1{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:2.44rem;line-height:1.2;font-weight:700}h2{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:1.95rem;line-height:1.2;font-weight:700}h3{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:1.34rem;line-height:1.2;font-weight:700}h4{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:0.98rem;line-height:1.2;font-weight:700}h5{font-family:Merriweather Web, Georgia, Cambria, Times New Roman, Times, serif;font-size:0.91rem;line-height:1.2;font-weight:700}h6{font-family:Source Sans Pro Web, Helvetica Neue, Helvetica, Roboto, Arial, sans-serif;font-size:0.87rem;line-height:1.1;font-weight:normal;letter-spacing:0.025em;text-transform:uppercase}h1,h2,h3,h4,h5{font-family:Bitter, Georgia, Cambria, "Times New Roman", Times, serif;font-weight:700}h6{font-family:"Source Sans Pro Web", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;font-weight:700}h1{margin-top:0;font-size:2.5rem}h2{font-size:1.875rem}h3{font-size:1.25rem}h4{font-size:1.0625rem}h5{font-size:0.9375rem}h6{font-size:0.9375rem}@media (max-width: 481px){h1{font-size:30px}h2{font-size:24px}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}@media (max-width: 481px){h1{font-size:30px}h2{font-size:24px}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}:host legend :is(h1,h2,h3,h4,h5,h6),:host label :is(h1,h2,h3,h4,h5,h6){display:inline;margin:0px}:host legend :is(h1,h2,h3,h4,h5),:host label :is(h1,h2,h3,h4,h5){font-family:var(--font-serif)}:host h1+*,:host h2+*,:host h3+*,:host h4+*,:host h5+*,:host h6+*{margin-top:unset}:host #form-question{margin-bottom:1rem}.usa-hint,.usa-fieldset{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3}.usa-sr-only{position:absolute;left:-999em;right:auto}.usa-form{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3}@media all and (min-width: 30em){.usa-form{max-width:20rem}}.usa-form abbr[title=required]{text-decoration:none}.usa-form .usa-input,.usa-form .usa-range,.usa-form .usa-select,.usa-form .usa-textarea{max-width:none}.usa-form .usa-input--2xs,.usa-form .usa-input-group--2xs{max-width:5ex}.usa-form .usa-input--xs,.usa-form .usa-input-group--xs{max-width:9ex}.usa-form .usa-input--sm,.usa-form .usa-input--small,.usa-form .usa-input-group--sm,.usa-form .usa-input-group--small{max-width:13ex}.usa-form .usa-input--md,.usa-form .usa-input--medium,.usa-form .usa-input-group--md,.usa-form .usa-input-group--medium{max-width:20ex}.usa-form .usa-input--lg,.usa-form .usa-input-group--lg{max-width:30ex}.usa-form .usa-input--xl,.usa-form .usa-input-group--xl{max-width:40ex}.usa-form .usa-input--2xl,.usa-form .usa-input-group--2xl{max-width:50ex}.usa-form .usa-button{margin-top:0.5rem}@media all and (min-width: 30em){.usa-form .usa-button{margin-top:1.5rem}}.usa-form a:where(:not(.usa-button)){color:#005ea2;text-decoration:underline}.usa-form a:where(:not(.usa-button)):visited{color:#54278f}.usa-form a:where(:not(.usa-button)):hover{color:#1a4480}.usa-form a:where(:not(.usa-button)):active{color:#162e51}.usa-form a:where(:not(.usa-button)):focus{outline:0.25rem solid #2491ff;outline-offset:0rem}@media all and (min-width: 30em){.usa-form--large{max-width:30rem}}.usa-show-password{color:#005ea2;text-decoration:underline;background-color:transparent;border:0;border-radius:0;-webkit-box-shadow:none;box-shadow:none;font-weight:normal;-ms-flex-pack:normal;justify-content:normal;text-align:left;margin:0;padding:0;width:auto;cursor:pointer}.usa-show-password:visited{color:#54278f}.usa-show-password:hover{color:#1a4480}.usa-show-password:active{color:#162e51}.usa-show-password:focus{outline:0.25rem solid #2491ff;outline-offset:0rem}.usa-show-password:hover,.usa-show-password.usa-button--hover,.usa-show-password:disabled:hover,.usa-show-password[aria-disabled=true]:hover,.usa-show-password:disabled.usa-button--hover,.usa-show-password[aria-disabled=true].usa-button--hover,.usa-show-password:active,.usa-show-password.usa-button--active,.usa-show-password:disabled:active,.usa-show-password[aria-disabled=true]:active,.usa-show-password:disabled.usa-button--active,.usa-show-password[aria-disabled=true].usa-button--active,.usa-show-password:disabled:focus,.usa-show-password[aria-disabled=true]:focus,.usa-show-password:disabled.usa-focus,.usa-show-password[aria-disabled=true].usa-focus,.usa-show-password:disabled,.usa-show-password[aria-disabled=true],.usa-show-password.usa-button--disabled{background-color:transparent;-webkit-box-shadow:none;box-shadow:none;text-decoration:underline}.usa-show-password.usa-button--hover{color:#1a4480}.usa-show-password.usa-button--active{color:#162e51}.usa-show-password:disabled,.usa-show-password[aria-disabled=true],.usa-show-password:disabled:hover,.usa-show-password[aria-disabled=true]:hover,.usa-show-password[aria-disabled=true]:focus{color:#757575}@media (forced-colors: active){.usa-show-password:disabled,.usa-show-password[aria-disabled=true],.usa-show-password:disabled:hover,.usa-show-password[aria-disabled=true]:hover,.usa-show-password[aria-disabled=true]:focus{color:GrayText}}.usa-form__note,.usa-show-password{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:0.93rem;line-height:1.3;float:right;margin:0.25rem 0 1rem}.usa-fieldset{border:none;margin:0;padding:0}.usa-legend{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3;display:block;font-weight:normal;margin-top:1.5rem;max-width:30rem}.usa-legend--large{font-size:2.13rem;font-weight:700;margin-top:1rem}.usa-label{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3;display:block;font-weight:normal;margin-top:1.5rem;max-width:30rem}.usa-label--error{font-weight:700;margin-top:0}.usa-label--required{color:#b50909}.usa-hint{color:#71767a}.usa-hint--required{color:#b50909}.usa-form-group{margin-top:1.5rem}.usa-form-group .usa-label:first-child{margin-top:0}.usa-form-group--error{border-left-width:0.25rem;border-left-color:#b50909;border-left-style:solid;padding-left:1rem;position:relative}@media all and (min-width: 64em){.usa-form-group--error{margin-left:-1.25rem}}.usa-error-message{padding-bottom:0.25rem;padding-top:0.25rem;color:#b50909;display:block;font-weight:700}.usa-memorable-date{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.usa-memorable-date [type=number]{-moz-appearance:textfield}.usa-memorable-date [type=number]::-webkit-inner-spin-button{-webkit-appearance:none;appearance:none}.usa-memorable-date [type=number]::-webkit-contacts-auto-fill-button{visibility:hidden;display:none !important;pointer-events:none;height:0;width:0;margin:0}.usa-memorable-date .usa-form-group{margin-top:1rem}.usa-form-group--day,.usa-form-group--month,.usa-form-group--year{-ms-flex:0 1 auto;flex:0 1 auto;margin-right:1rem;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.usa-form-group--day input,.usa-form-group--month input{width:3rem}.usa-form-group--month select{width:15rem}.usa-form-group--year input{width:4.5rem}.usa-error-message{font-size:1.06rem}:host([error]:not([error=""])){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""])[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1008px){:host([error]:not([error=""])){margin-left:-0.9rem}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1008px){:host([error]:not([error=""])[use-forms-pattern=multiple]){padding-left:0}}:host{display:block;font-family:var(--font-source-sans);margin-top:24px}#error-message{margin-bottom:0}.usa-hint{display:block}slot:not([name])::slotted(*){margin-bottom:0.5rem}va-select::part(label),va-text-input::part(label){margin-top:0;margin-bottom:12px}va-text-input::part(validation){display:none}.usa-memorable-date{margin-top:16px;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.usa-memorable-date .usa-form-group{margin-top:0px}.usa-form-group--month{margin-right:16px}.usa-form-group--month-input{width:48px}.usa-form-group--month-select{width:15rem}.usa-form-group--day-input{width:3rem}.usa-form-group--year-input{width:4.5rem}@media (max-width: 480px){.usa-form-group--month-select{width:100%}.usa-form-group--select{-ms-flex:0 1 50%;flex:0 1 50%;width:50%}}',VaMemorableDateStyle0=vaMemorableDateCss;Build.isTesting&&instance.init({lng:"cimode"});const VaMemorableDate$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.dateChange=createEvent(this,"dateChange",7),this.dateBlur=createEvent(this,"dateBlur",7),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.dayTouched=!1,this.monthTouched=!1,this.yearTouched=!1,this.handleDateBlur=e=>{const[a,t,r]=(this.value||"").split("-"),o=Number(a),s=Number(t),i=Number(r);if(validate({component:this,year:o,month:s,day:i,yearTouched:this.yearTouched,monthTouched:this.monthTouched,dayTouched:this.dayTouched,monthSelect:this.monthSelect}),!this.error&&(this.value=a||t||r?`${a}-${t?zeroPadStart(s):""}-${r?zeroPadStart(i):""}`:"",this.dateBlur.emit(e),this.enableAnalytics)){const e={componentName:"va-memorable-date",action:"blur",details:{label:this.label,year:o,month:s,day:i}};this.componentLibraryAnalytics.emit(e)}},this.handleMonthChange=e=>{this.handleDateChange(e)},this.handleDateChange=e=>{const a=e.target;let[t,r,o]=(this.value||"").split("-");(a.classList.contains("input-month")||a.classList.contains("usa-form-group--month-input")||a.classList.contains("usa-form-group--month-select"))&&(r=a.value),(a.classList.contains("input-day")||a.classList.contains("usa-form-group--day-input"))&&(o=a.value),(a.classList.contains("input-year")||a.classList.contains("usa-form-group--year-input"))&&(t=a.value),this.value=t||r||o?`${t}-${r||""}-${o||""}`:"",this.dateChange.emit(e)},this.handleMonthBlur=()=>{this.monthTouched=!0},this.handleDayBlur=()=>{this.dayTouched=!0},this.handleYearBlur=()=>{this.yearTouched=!0},this.required=!1,this.useFormsPattern=void 0,this.formHeadingLevel=3,this.formHeading=void 0,this.monthSelect=!1,this.label=void 0,this.name=void 0,this.hint=void 0,this.error=void 0,this.value=void 0,this.customDayErrorMessage=void 0,this.customMonthErrorMessage=void 0,this.customYearErrorMessage=void 0,this.invalidDay=!1,this.invalidMonth=!1,this.invalidYear=!1,this.enableAnalytics=!1}connectedCallback(){instance.on("languageChanged",(()=>{forceUpdate(this.el)}))}disconnectedCallback(){instance.off("languageChanged")}render(){const{required:e,label:a,name:t,hint:r,error:o,handleDateBlur:s,handleDateChange:i,value:n,monthSelect:l,useFormsPattern:u,formHeadingLevel:m,formHeading:d}=this,[p,f,c]=(n||"").split("-"),g=["dateHint",r?"hint":""].filter(Boolean).join(" "),b=l?instance.t("date-hint-with-select"):instance.t("date-hint"),w=e=>instance.t(e,(e=>{const a=parseInt(p),t=parseInt(f);return getErrorParameters(e,a,t)})(e)),v=`${u&&d?"form-question":""} ${u?"form-description":""} ${u&&a?"input-label":""}`.trim()||null;let y=null;if("single"===u||"multiple"===u){const e=getHeaderLevel(m);y=h(Fragment,null,d&&h(e,{id:"form-question",part:"form-header"},d),h("div",{id:"form-description"},h("slot",{name:"form-description"})))}const x=l?h("div",{class:"usa-form-group usa-form-group--month usa-form-group--select"},h("va-select",{label:instance.t("month"),name:t?`${t}Month`:"Month","aria-describedby":g,"aria-labelledby":v,invalid:this.invalidMonth,onVaSelect:this.handleMonthChange,onBlur:this.handleMonthBlur,class:"usa-form-group--month-select",reflectInputError:"month-range"===o,value:f?String(parseInt(f)):f,error:this.invalidMonth?w(o):null,showError:!1},months&&months.map((e=>h("option",{value:e.value,selected:e.value===parseInt(f)},e.label))))):h("div",{class:"usa-form-group usa-form-group--month"},h("va-text-input",{label:instance.t("month"),name:t?`${t}Month`:"Month",maxlength:2,pattern:"[0-9]*","aria-describedby":g,"aria-labelledby":v,invalid:this.invalidMonth,value:null==f?void 0:f.toString(),onInput:i,onBlur:this.handleMonthBlur,class:"usa-form-group--month-input memorable-date-input",reflectInputError:"month-range"===o,inputmode:"numeric",type:"text",error:this.invalidMonth?w(o):null,"show-input-error":"false"})),M=classnames({"usa-legend":!0,"usa-label--error":o});return h(Host,{onBlur:s},y,h("div",{class:"input-wrap"},h("fieldset",{class:"usa-form usa-fieldset"},h("legend",{class:M,id:"input-label",part:"legend"},a,e&&h("span",{class:"usa-label--required"}," ",instance.t("required")),r&&h("div",{class:"usa-hint",id:"hint"},r),h("span",{class:"usa-hint",id:"dateHint"},b)),h("span",{id:"error-message",role:"alert"},o&&h(Fragment,null,h("span",{class:"usa-sr-only"},instance.t("error")),h("span",{class:"usa-error-message"},(e=>{let a="";return this.invalidDay?a=this.customDayErrorMessage:this.invalidMonth?a=this.customMonthErrorMessage:this.invalidYear&&(a=this.customYearErrorMessage),a||w(e)})(o)))),h("slot",null),h("div",{class:"usa-memorable-date"},x,h("div",{class:"usa-form-group usa-form-group--day"},h("va-text-input",{label:instance.t("day"),name:t?`${t}Day`:"Day",maxlength:2,pattern:"[0-9]*","aria-describedby":g,invalid:this.invalidDay,value:null==c?void 0:c.toString(),onInput:i,onBlur:this.handleDayBlur,class:"usa-form-group--day-input memorable-date-input",reflectInputError:"day-range"===o,inputmode:"numeric",type:"text",error:this.invalidDay?w(o):null,"show-input-error":"false"})),h("div",{class:"usa-form-group usa-form-group--year"},h("va-text-input",{label:instance.t("year"),name:t?`${t}Year`:"Year",maxlength:4,pattern:"[0-9]*","aria-describedby":g,invalid:this.invalidYear,value:null==p?void 0:p.toString(),onInput:i,onBlur:this.handleYearBlur,class:"usa-form-group--year-input memorable-date-input",reflectInputError:"year-range"===o,inputmode:"numeric",type:"text",error:this.invalidYear?w(o):null,"show-input-error":"false"}))))))}get el(){return this}static get style(){return VaMemorableDateStyle0}},[1,"va-memorable-date",{required:[4],useFormsPattern:[1,"use-forms-pattern"],formHeadingLevel:[2,"form-heading-level"],formHeading:[1,"form-heading"],monthSelect:[4,"month-select"],label:[1],name:[1],hint:[1],error:[1537],value:[1537],customDayErrorMessage:[1,"custom-day-error-message"],customMonthErrorMessage:[1,"custom-month-error-message"],customYearErrorMessage:[1,"custom-year-error-message"],invalidDay:[1028,"invalid-day"],invalidMonth:[1028,"invalid-month"],invalidYear:[1028,"invalid-year"],enableAnalytics:[4,"enable-analytics"]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-memorable-date","va-icon","va-select","va-text-input"].forEach((e=>{switch(e){case"va-memorable-date":customElements.get(e)||customElements.define(e,VaMemorableDate$1);break;case"va-icon":customElements.get(e)||defineCustomElement$4();break;case"va-select":customElements.get(e)||defineCustomElement$3();break;case"va-text-input":customElements.get(e)||defineCustomElement$2()}}))}const VaMemorableDate=VaMemorableDate$1,defineCustomElement=defineCustomElement$1;export{VaMemorableDate,defineCustomElement};
|