@department-of-veterans-affairs/component-library 54.4.2 → 54.5.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/dist/1214.app.bundle.js +1 -1
- package/dist/1450.app.bundle.js +1 -1
- package/dist/2222.app.bundle.js +1 -1
- package/dist/2387.app.bundle.js +1 -1
- package/dist/2858.app.bundle.js +1 -1
- package/dist/3071.app.bundle.js +1 -1
- package/dist/3156.app.bundle.js +1 -1
- package/dist/4064.app.bundle.js +1 -1
- package/dist/4117.app.bundle.js +1 -1
- package/dist/4140.app.bundle.js +1 -1
- package/dist/5019.app.bundle.js +1 -1
- package/dist/5155.app.bundle.js +1 -1
- package/dist/5306.app.bundle.js +1 -1
- package/dist/5610.app.bundle.js +1 -1
- package/dist/5830.app.bundle.js +1 -1
- package/dist/6034.app.bundle.js +1 -1
- package/dist/6246.app.bundle.js +1 -1
- package/dist/6247.app.bundle.js +1 -1
- package/dist/6527.app.bundle.js +1 -1
- package/dist/6655.app.bundle.js +1 -1
- package/dist/7531.app.bundle.js +1 -1
- package/dist/7663.app.bundle.js +1 -1
- package/dist/7821.app.bundle.js +1 -1
- package/dist/8495.app.bundle.js +1 -1
- package/dist/8735.app.bundle.js +1 -1
- package/dist/8762.app.bundle.js +1 -1
- package/dist/9288.app.bundle.js +1 -1
- package/dist/9463.app.bundle.js +1 -1
- package/dist/9670.app.bundle.js +1 -1
- package/dist/9724.app.bundle.js +1 -1
- package/dist/9794.app.bundle.js +1 -1
- package/dist/9800.app.bundle.js +1 -1
- package/dist/9966.app.bundle.js +1 -1
- package/dist/app.bundle.js +1 -1
- package/dist/components/contacts.js +1 -0
- package/dist/components/date-utils.js +1 -0
- package/dist/components/index.js +1 -1
- package/dist/components/{p-a5dce9e6.js → index2.js} +1 -1
- package/dist/components/types/components.d.ts +18 -2
- package/dist/components/utils.js +1 -0
- package/dist/components/va-accordion-item.js +1 -1
- package/dist/components/va-accordion-item2.js +1 -0
- package/dist/components/va-accordion.js +1 -1
- package/dist/components/va-accordion2.js +1 -0
- package/dist/components/va-additional-info.js +1 -1
- package/dist/components/va-alert-expandable.js +1 -1
- package/dist/components/va-alert-sign-in.js +1 -1
- package/dist/components/va-alert.js +1 -1
- package/dist/components/va-alert2.js +1 -0
- package/dist/components/va-back-to-top.js +1 -1
- package/dist/components/va-banner.js +1 -1
- package/dist/components/va-breadcrumbs.js +1 -1
- package/dist/components/va-button-icon.js +1 -1
- package/dist/components/va-button-icon2.js +1 -0
- package/dist/components/va-button-pair.js +1 -1
- package/dist/components/va-button-segmented.js +1 -1
- package/dist/components/va-button.js +1 -1
- package/dist/components/va-button2.js +1 -0
- package/dist/components/va-card.js +1 -1
- package/dist/components/va-card2.js +1 -0
- package/dist/components/va-checkbox-group.js +1 -1
- package/dist/components/va-checkbox-group2.js +1 -0
- package/dist/components/va-checkbox.js +1 -1
- package/dist/components/va-checkbox2.js +1 -0
- package/dist/components/va-combo-box.js +1 -1
- package/dist/components/{p-d20739b4.js → va-combo-box2.js} +4 -4
- package/dist/components/va-crisis-line-modal.js +1 -1
- package/dist/components/va-crisis-line-modal2.js +1 -0
- package/dist/components/va-critical-action.js +1 -1
- package/dist/components/va-critical-action2.js +1 -0
- package/dist/components/va-date.js +1 -1
- package/dist/components/va-file-input-multiple.js +1 -1
- package/dist/components/va-file-input.js +1 -1
- package/dist/components/va-file-input2.js +1 -0
- package/dist/components/va-header-minimal.js +1 -1
- package/dist/components/va-icon.js +1 -1
- package/dist/components/va-icon2.js +1 -0
- package/dist/components/va-language-toggle.js +1 -1
- package/dist/components/va-link-action.js +1 -1
- package/dist/components/va-link.js +1 -1
- package/dist/components/va-link2.js +1 -0
- package/dist/components/va-loading-indicator.js +1 -1
- package/dist/components/va-maintenance-banner.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-modal.js +1 -1
- package/dist/components/va-modal2.js +1 -0
- package/dist/components/va-need-help.js +1 -1
- package/dist/components/va-notification.js +1 -1
- package/dist/components/va-official-gov-banner.js +1 -1
- package/dist/components/va-official-gov-banner2.js +1 -0
- package/dist/components/va-omb-info.js +1 -1
- package/dist/components/va-on-this-page.js +1 -1
- package/dist/components/va-pagination.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-progress-bar2.js +1 -0
- package/dist/components/va-promo-banner.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-filter.js +1 -1
- package/dist/components/va-search-input.js +1 -1
- package/dist/components/va-segmented-progress-bar.js +1 -1
- package/dist/components/va-select.js +1 -1
- package/dist/components/va-select2.js +1 -0
- package/dist/components/va-service-list-item.js +1 -1
- package/dist/components/va-sidenav-item.js +1 -1
- package/dist/components/va-sidenav-submenu.js +1 -1
- package/dist/components/va-sidenav.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-tab-item.js +1 -1
- package/dist/components/va-tab-panel.js +1 -1
- package/dist/components/va-table-inner.js +1 -1
- package/dist/components/va-table-inner2.js +1 -0
- package/dist/components/va-table-row.js +1 -1
- package/dist/components/va-table.js +1 -1
- package/dist/components/va-tabs.js +1 -1
- package/dist/components/va-tag-status.js +1 -1
- package/dist/components/va-telephone-input.js +1 -1
- package/dist/components/va-telephone.js +1 -1
- package/dist/components/va-telephone2.js +1 -0
- package/dist/components/va-text-input.js +1 -1
- package/dist/components/va-text-input2.js +1 -0
- package/dist/components/va-textarea.js +1 -1
- package/dist/react-bindings/index.d.ts +67 -6
- package/dist/react-bindings/index.js +1 -1
- package/dist/react-bindings/index.js.map +1 -1
- package/dist/react-bindings/index.ts +75 -6
- package/dist/react-bindings/react-component-lib/createComponent.d.ts +10 -0
- package/dist/react-bindings/react-component-lib/createComponent.js +1 -0
- package/dist/react-bindings/react-component-lib/createComponent.js.map +1 -0
- package/dist/react-bindings/react-component-lib/createComponent.tsx +106 -0
- package/dist/react-bindings/react-component-lib/createOverlayComponent.d.ts +21 -0
- package/dist/react-bindings/react-component-lib/createOverlayComponent.js +1 -0
- package/dist/react-bindings/react-component-lib/createOverlayComponent.js.map +1 -0
- package/dist/react-bindings/react-component-lib/createOverlayComponent.tsx +142 -0
- package/dist/react-bindings/react-component-lib/index.d.ts +2 -0
- package/dist/react-bindings/react-component-lib/index.js +1 -0
- package/dist/react-bindings/react-component-lib/index.js.map +1 -0
- package/dist/react-bindings/react-component-lib/index.ts +2 -0
- package/dist/react-bindings/react-component-lib/interfaces.d.ts +29 -0
- package/dist/react-bindings/react-component-lib/interfaces.js +1 -0
- package/dist/react-bindings/react-component-lib/interfaces.js.map +1 -0
- package/dist/react-bindings/react-component-lib/interfaces.ts +34 -0
- package/dist/react-bindings/react-component-lib/utils/attachProps.d.ts +16 -0
- package/dist/react-bindings/react-component-lib/utils/attachProps.js +2 -0
- package/dist/react-bindings/react-component-lib/utils/attachProps.js.LICENSE.txt +4 -0
- package/dist/react-bindings/react-component-lib/utils/attachProps.js.map +1 -0
- package/dist/react-bindings/react-component-lib/utils/attachProps.ts +125 -0
- package/dist/react-bindings/react-component-lib/utils/case.d.ts +2 -0
- package/dist/react-bindings/react-component-lib/utils/case.js +1 -0
- package/dist/react-bindings/react-component-lib/utils/case.js.map +1 -0
- package/dist/react-bindings/react-component-lib/utils/case.ts +7 -0
- package/dist/react-bindings/react-component-lib/utils/dev.d.ts +2 -0
- package/dist/react-bindings/react-component-lib/utils/dev.js +1 -0
- package/dist/react-bindings/react-component-lib/utils/dev.js.map +1 -0
- package/dist/react-bindings/react-component-lib/utils/dev.ts +14 -0
- package/dist/react-bindings/react-component-lib/utils/index.d.ts +10 -0
- package/dist/react-bindings/react-component-lib/utils/index.js +1 -0
- package/dist/react-bindings/react-component-lib/utils/index.js.map +1 -0
- package/dist/react-bindings/react-component-lib/utils/index.tsx +50 -0
- package/package.json +3 -4
- package/Modal.unit.spec.js +0 -1
- package/dist/components/p-0311e4e3.js +0 -1
- package/dist/components/p-067d7618.js +0 -1
- package/dist/components/p-3962731f.js +0 -1
- package/dist/components/p-40738d84.js +0 -1
- package/dist/components/p-494b538e.js +0 -1
- package/dist/components/p-6a3cf3d7.js +0 -1
- package/dist/components/p-6b349d85.js +0 -1
- package/dist/components/p-6e4b9401.js +0 -1
- package/dist/components/p-70a619e9.js +0 -1
- package/dist/components/p-7129443f.js +0 -1
- package/dist/components/p-784bed9b.js +0 -1
- package/dist/components/p-a12014b1.js +0 -1
- package/dist/components/p-b92d2c38.js +0 -1
- package/dist/components/p-bac94659.js +0 -1
- package/dist/components/p-bea05aab.js +0 -1
- package/dist/components/p-c3fdb782.js +0 -1
- package/dist/components/p-ce1b8abc.js +0 -1
- package/dist/components/p-cf580be9.js +0 -1
- package/dist/components/p-d4b7abf9.js +0 -1
- package/dist/components/p-d9f21f0d.js +0 -1
- package/dist/components/p-dffbc03b.js +0 -1
- package/dist/components/p-e1092a04.js +0 -1
- package/dist/components/p-ef5c0d66.js +0 -1
- package/dist/components/p-f3a1dcd5.js +0 -1
- package/dist/components/p-fda59844.js +0 -1
- package/dist/react-bindings/components.d.ts +0 -336
- package/dist/react-bindings/components.js +0 -1
- package/dist/react-bindings/components.js.map +0 -1
- package/dist/react-bindings/components.ts +0 -961
- package/format-date.unit.spec.js +0 -1
- package/utilities.unit.spec.js +0 -1
- /package/dist/components/{p-a836c3e1.js → i18next.js} +0 -0
- /package/dist/components/{p-a5dce9e6.js.LICENSE.txt → index2.js.LICENSE.txt} +0 -0
- /package/dist/components/{p-b276cef8.js → parsePhoneNumber_.js} +0 -0
- /package/dist/components/{p-d20739b4.js.LICENSE.txt → va-combo-box2.js.LICENSE.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{V as VACrisisLineModal,d as defineCustomElement$1}from"./
|
|
1
|
+
import{V as VACrisisLineModal,d as defineCustomElement$1}from"./va-crisis-line-modal2.js";const VaCrisisLineModal=VACrisisLineModal,defineCustomElement=defineCustomElement$1;export{VaCrisisLineModal,defineCustomElement};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import{a as CONTACTS_WITH_EXTENSION}from"./contacts.js";import{d as defineCustomElement$4}from"./va-button2.js";import{d as defineCustomElement$3}from"./va-icon2.js";import{d as defineCustomElement$2}from"./va-modal2.js";import{d as defineCustomElement$1}from"./va-telephone2.js";import{i as instance}from"./i18next.js";const vaCrisisLineModalCss='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,a.va-sidenav-submenu__link:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px;z-index:2}.va-crisis-line-container{position:relative;margin:auto;background-color:var(--vads-color-secondary-dark)}@media (min-width: 1024px){.va-crisis-line-container{max-width:60.938rem;background-color:transparent}}a{color:var(--vads-color-link)}button.va-crisis-line{cursor:pointer;background-color:var(--vads-color-secondary-darkest);display:block;border-radius:0;color:var(--vads-button-color-text-primary-alt-on-light);font-family:var(--font-source-sans);font-size:16px;font-weight:normal;text-decoration:none;padding:0;margin:0;width:100%;border:0;-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:background-color;transition-property:background-color}button.va-crisis-line:focus{outline-offset:-2px}button.va-crisis-line:hover,button.va-crisis-line:active{background-color:#8b0a03}@media (min-width: 1024px){button.va-crisis-line:hover .va-crisis-line-icon,button.va-crisis-line:active .va-crisis-line-icon{background-color:#b51d09}}@media (min-width: 1024px){button.va-crisis-line{width:auto;border-radius:0 0 2.3px 2.3px;-webkit-box-shadow:0 2px 5px var(--vads-color-base);box-shadow:0 2px 5px var(--vads-color-base)}}.va-crisis-line-inner{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;margin:auto}@media (min-width: 1024px){.va-crisis-line-inner{text-align:left;-ms-flex-pack:justify;justify-content:space-between}}.va-crisis-line-icon{content:"";background:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 viewBox%3D%220 0 96 60%22 width%3D%2296px%22 height%3D%2260px%22%3E%3Cpath d%3D%22M58 14c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zM58 30c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zM58 46c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm-48 2L32 60h-2V48H4c-2.20914 0-4-1.79086-4-4V4c0-2.20914 1.79086-4 4-4h40c2.20914 0 4 1.79086 4 4v40c0 2.20914-1.79086 4-4 4h-2zM24 31.72174L33.86667 39l-3.73334-11.86087L40 20.13043H28L24 8l-4 12.13043H8l9.86667 7.0087L14.13333 39 24 31.72174z%22 fill%3D%22%23FFF%22 fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E") no-repeat right 29%;background-size:30px auto;background-position:8px 8px;width:40px;height:36px;padding-right:3px;-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:background-color;transition-property:background-color}@media (max-width: 480px){.va-crisis-line-icon{display:none}}@media (min-width: 1024px){.va-crisis-line-icon{border-bottom-left-radius:3.2px}}.va-crisis-line-text{padding:8px}.va-icon__right-arrow{position:relative;top:2px}.va-clm__icon{position:relative;top:15px;margin-right:23px}.va-crisis-panel{color:var(--vads-color-base)}.va-crisis-panel-body{max-height:100%}.va-crisis-panel-title{color:var(--vads-color-base);padding-left:41px;background-image:url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 viewBox%3D%220 0 96 60%22 width%3D%2296px%22 height%3D%2260px%22%3E%3Cpath d%3D%22M58 14c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zM58 30c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zM58 46c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm16 0c-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6-2.6863 6-6 6zm-48 2L32 60h-2V48H4c-2.20914 0-4-1.79086-4-4V4c0-2.20914 1.79086-4 4-4h40c2.20914 0 4 1.79086 4 4v40c0 2.20914-1.79086 4-4 4h-2zM24 31.72174L33.86667 39l-3.73334-11.86087L40 20.13043H28L24 8l-4 12.13043H8l9.86667 7.0087L14.13333 39 24 31.72174z%22 fill%3D%22%23FFF%22 fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E") no-repeat left;background-position:left 5px;background-size:32px auto}.va-crisis-panel-list{list-style:none;padding:0}.va-crisis-panel-list>li{display:-ms-flexbox;display:flex;min-height:56px;margin-bottom:0;border-top:1px solid var(--vads-color-base-light)}.va-crisis-panel-list>li:last-child{border-bottom:1px solid var(--vads-color-base-light)}.va-crisis-panel-list>li>a,.va-crisis-panel-list>li>span{padding:8px 0;-ms-flex-item-align:center;align-self:center}',VaCrisisLineModalStyle0=vaCrisisLineModalCss,VACrisisLineModal=proxyCustomElement(class e extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.allowModalRender=!1,this.phoneNumber="988",this.phoneExtension="1",this.textNumber="838255",this.chatUrl="https://www.veteranscrisisline.net/get-help-now/chat/",this.ttyNumber=CONTACTS_WITH_EXTENSION.CRISIS_MODAL_TTY.phoneNumber||"711",this.ttyCrisisExtension=CONTACTS_WITH_EXTENSION.CRISIS_MODAL_TTY.extension||"988",this.mode=void 0,this.isOpen=!1,this.shifted=!1}handleGlobalOpen(){this.allowModalRender&&this.open()}open(){this.setVisible()}setVisible(){this.isOpen=!0}setNotVisible(){this.isOpen=!1}componentWillLoad(){e.modalOwner||"trigger"===this.mode||(this.allowModalRender=!0,e.modalOwner=this.el)}disconnectedCallback(){e.modalOwner===this.el&&(e.modalOwner=null)}trackShiftKey(e){this.shifted=e.shiftKey}trapFocus(){var e;const i=null===(e=this.el)||void 0===e?void 0:e.shadowRoot.querySelector("va-modal"),t=null==i?void 0:i.getAttribute("visible");if(null!==t&&"false"!==t){let e;const t=this.shifted?".last-focusable-child":'[role="document"]';e=this.shifted?null==i?void 0:i.querySelector(t):null==i?void 0:i.shadowRoot.querySelector(t),null==e||e.focus()}}render(){const{phoneNumber:e,phoneExtension:i,textNumber:t,chatUrl:s,ttyNumber:n,ttyCrisisExtension:a,mode:o}=this,c="modal"!==o,l=this.allowModalRender&&"trigger"!==o;return h(Host,{key:"88996025fcdc1122068df01cdbb286ce7dbe1ca3"},c&&h("div",{key:"8ca76bd5525e87c7e2d5baa3ee2d9ec697bdeb33",class:"va-crisis-line-container"},h("button",{key:"ff230af3b7ae30b4e2acfada0f9cc96252b4ee43",onClick:()=>document.dispatchEvent(new CustomEvent("vaCrisisLineModalOpen")),onFocusin:()=>this.trapFocus(),"data-show":"#modal-crisisline",class:"va-crisis-line va-overlay-trigger",part:"button"},h("div",{key:"c9b1200a32d95e5900412630b317bd89e53603f2",class:"va-crisis-line-inner"},h("span",{key:"095f4f84351c0e079148dab58bcce488cf84e424",class:"va-crisis-line-icon","aria-hidden":"true"}),h("span",{key:"dedec2994be5d539f6766f4d5363883d6e839c60",class:"va-crisis-line-text",innerHTML:instance.t("crisis-line-trigger-text")}),h("va-icon",{key:"67403aa0e9a4903d7f0385e1bccee3f4d02545a1",class:"va-icon__right-arrow",icon:"navigate_next",size:3})))),l&&h("va-modal",{key:"1188106f0740a332ea48d2ba62286c4de1ea2902",modalTitle:instance.t("crisis-line-modal-title"),onPrimaryButtonClick:()=>this.setNotVisible(),onCloseEvent:()=>this.setNotVisible(),visible:this.isOpen,large:!0},h("p",{key:"56160927cdc08a2ef882204f85812cd73fb2a831"},instance.t("crisis-line-intro")),h("ul",{key:"6e1a36268509617d8e57380bfc9dc8a28a4566c7",class:"va-crisis-panel-list"},h("li",{key:"700d2bfc15dca8c06db7b75d15dea23d3bf56890"},h("va-icon",{key:"1d23a524dc9792e6e7a4d09b5a8a839fbccf161a",class:"va-clm__icon",icon:"phone",size:3}),h("span",{key:"59a1661b09c8aa9e6126d34b80b2fe3c54802657"},instance.t("crisis-line-phone-label")+" "," ",h("strong",{key:"935d09b1bce83e714a1cd37d5897c15989337ae2"},h("va-telephone",{key:"747ed72e35f04c845833cbfe09235157c8187009",contact:e}),i?` ${instance.t("crisis-line-phone-extension-label")} ${i}`:null))),h("li",{key:"aeede56bad734f94133bcf5591b5b67d3c8fff6a"},h("va-icon",{key:"f0ddbdbf66ee74d82dc0bfddaa0f7e0a3ab876b8",icon:"phone_iphone",class:"va-clm__icon",size:3}),h("span",{key:"ed2320795746f7d6389d1d460d397f70a66ea713"},instance.t("crisis-line-text-label")+" "," ",h("strong",{key:"f330d828ae8d16f84d6400d85113667cf7cab014"},h("va-telephone",{key:"39d1cdd2ba7ebef934b8141294d9ffc8d0ea193b",sms:!0,contact:t})))),h("li",{key:"1144f351bb07ff02c2b2e9c4b9c1655154c5e1a4"},h("va-icon",{key:"8ed4fbe5d0c38e9a24bcb8821e56039089bad21e",icon:"chat",class:"va-clm__icon",size:3}),h("a",{key:"382d7434d4562f304ee4d06988c79a3185b7ee9d",class:"no-external-icon",href:s},instance.t("crisis-line-chat-label"))),h("li",{key:"19d0c97e974ad7a0636d77bc6494930b3d4e2170"},h("va-icon",{key:"013b9601534c628160d8364a99dcda6570116b97",icon:"tty",class:"va-clm__icon",size:3}),h("p",{key:"e34dc521517f7092411d1860ef50f8a8b02b979a"},instance.t("crisis-line-tty-label")+" ",h("strong",{key:"f46ac0836caed675365caadb2c96108187f6a6f1"},h("va-telephone",{key:"e9b0e4f6e43be4950c2e76c7f81bb5f352074fb0",contact:n}),a?` ${instance.t("crisis-line-tty-extension-label")} ${a}`:null)))),h("p",{key:"1e65899bba6878050240021802eee22e580851e4"},instance.t("crisis-line-resources-link-label")+" ",h("a",{key:"8835e5ac2c94c138370d377f31a6ae0d8f544b7f",class:"no-external-icon",href:"https://www.veteranscrisisline.net/"},instance.t("crisis-line-resources-link-text")))))}get el(){return this}static get style(){return VaCrisisLineModalStyle0}},[1,"va-crisis-line-modal",{phoneNumber:[1,"phone-number"],phoneExtension:[1,"phone-extension"],textNumber:[1,"text-number"],chatUrl:[1,"chat-url"],ttyNumber:[1,"tty-number"],ttyCrisisExtension:[1,"tty-crisis-extension"],mode:[1],isOpen:[32],shifted:[32]},[[4,"vaCrisisLineModalOpen","handleGlobalOpen"],[8,"keydown","trackShiftKey"]]]);function defineCustomElement(){"undefined"!=typeof customElements&&["va-crisis-line-modal","va-button","va-icon","va-modal","va-telephone"].forEach(e=>{switch(e){case"va-crisis-line-modal":customElements.get(e)||customElements.define(e,VACrisisLineModal);break;case"va-button":customElements.get(e)||defineCustomElement$4();break;case"va-icon":customElements.get(e)||defineCustomElement$3();break;case"va-modal":customElements.get(e)||defineCustomElement$2();break;case"va-telephone":customElements.get(e)||defineCustomElement$1()}})}VACrisisLineModal.modalOwner=null;export{VACrisisLineModal as V,defineCustomElement as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{V as VaCriticalAction$1,d as defineCustomElement$1}from"./
|
|
1
|
+
import{V as VaCriticalAction$1,d as defineCustomElement$1}from"./va-critical-action2.js";const VaCriticalAction=VaCriticalAction$1,defineCustomElement=defineCustomElement$1;export{VaCriticalAction,defineCustomElement};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import{d as defineCustomElement$1}from"./va-icon2.js";const vaCriticalActionCss=":host{display:block}.critical-info{display:-ms-flexbox;display:flex;border-radius:5px;padding:0.75rem 1rem;margin-top:1rem;background-color:var(--vads-color-feedback-border-warning-on-dark);position:relative;min-height:2.063rem}@media (min-width: 768px){.critical-info{left:0;width:auto}}.critical-info:hover .action-link{color:var(--vads-color-link-active)}.critical-info:hover .link-icon{background-color:var(--vads-color-link-active)}.action-link{color:var(--vads-color-base);font-weight:700;font-size:var(--vads-font-size-source-sans-normalized);line-height:1.528rem;width:100%;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;padding:4px}.action-link:focus{outline:none;background-color:var(--vads-color-warning-lighter);color:var(--vads-color-base);-webkit-box-shadow:0px 4px 0px var(--vads-color-base);box-shadow:0px 4px 0px var(--vads-color-base)}.action-link:focus .link-icon{color:var(--vads-color-warning-lighter);background-color:var(--vads-color-base);margin-top:0}.action-link:active{outline:none;background-color:var(--vads-color-warning-lighter);color:var(--vads-color-base);-webkit-box-shadow:0px 4px 0px var(--vads-color-base);box-shadow:0px 4px 0px var(--vads-color-base)}.action-link:active .link-icon{color:var(--vads-color-warning-lighter)}.action-link:visited{color:var(--vads-color-link-visited)}.action-link:visited .link-icon{background-color:var(--vads-color-link-visited);color:var(--vads-color-feedback-border-warning-on-dark)}.action-link:visited:focus .link-icon{color:var(--vads-color-warning-lighter)}.action-link:visited:active .link-icon{color:var(--vads-color-warning-lighter)}.action-link:hover{color:var(--vads-color-link-active)}.action-link:hover .link-icon{background-color:var(--vads-color-link-active);color:var(--vads-color-feedback-border-warning-on-dark)}.action-link:hover:active .link-icon{color:var(--vads-color-warning-lighter)}.action-link:hover:focus .link-icon{color:var(--vads-color-warning-lighter)}.text-and-chevron{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;width:100%}@media (min-width: 0px){.text-and-chevron{-ms-flex-align:start;align-items:flex-start}}.text-and-chevron:focus{outline:none}.link-text{max-width:calc(100% - 32px)}.link-icon{margin-left:auto;border-radius:50%;color:var(--vads-color-feedback-border-warning-on-dark);background-color:var(--vads-color-base);-ms-flex-negative:0;flex-shrink:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}",VaCriticalActionStyle0=vaCriticalActionCss,VaCriticalAction=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.link=void 0,this.text=void 0}render(){const{link:o,text:i}=this;return o&&i?h(Host,null,h("div",{class:"critical-info"},h("a",{href:o,class:"action-link","aria-label":`Action required: ${i}`},h("div",{class:"text-and-chevron"},h("span",{class:"link-text"},i),h("va-icon",{class:"link-icon hydrated",icon:"chevron_right",size:3}))))):null}static get style(){return VaCriticalActionStyle0}},[1,"va-critical-action",{link:[1],text:[1]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["va-critical-action","va-icon"].forEach(o=>{switch(o){case"va-critical-action":customElements.get(o)||customElements.define(o,VaCriticalAction);break;case"va-icon":customElements.get(o)||defineCustomElement$1()}})}export{VaCriticalAction as V,defineCustomElement as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{proxyCustomElement,HTMLElement,createEvent,h,Host,Fragment}from"@stencil/core/internal/client";import"./contacts.js";import{v as validate,z as zeroPadStart,d as daysForSelectedMonth,g as getErrorParameters,m as months}from"./date-utils.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 vaDateCss='.sr-only{border:0;clip:rect(0, 0, 0, 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute !important;width:1px;word-wrap:normal !important}.hint-text{color:#71767A;display:block;font-size:1.06rem}#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=""])),:host(.va-form-group--error){border-left:0.3rem solid var(--vads-color-secondary-dark);padding-left:1.25rem;position:relative}@media screen and (min-width: 1024px){:host([error]:not([error=""])),:host(.va-form-group--error){margin-left:-1.4375rem;}}.usa-error-message{font-size:1.06rem}:host([error]:not([error=""])),:host(.va-form-group--error){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""])[use-forms-pattern=multiple]),:host(.va-form-group--error[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap,:host(.va-form-group--error[use-forms-pattern=multiple]) .input-wrap{border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1024px){:host([error]:not([error=""])),:host(.va-form-group--error){margin-left:-0.9rem}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap,:host(.va-form-group--error[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1023px){:host([error]:not([error=""])[use-forms-pattern=multiple]),:host(.va-form-group--error[use-forms-pattern=multiple]){padding-left:0}}.usa-label--required{color:var(--vads-color-secondary-dark)}.usa-error-message{color:var(--vads-color-secondary-dark)}:host{display:block;font-family:var(--font-source-sans);margin-top:1.875rem}fieldset{border:none;margin:0;padding:0}legend{border:0;font-size:1.06rem;padding:0}span.required{color:var(--vads-color-secondary-dark)}#error-message{color:var(--vads-color-secondary-dark);display:block;margin-bottom:0}.date-container{display:-ms-flexbox;display:flex;margin-top:12px;-ms-flex-wrap:wrap;flex-wrap:wrap;row-gap:12px}:host([error]:not([error=""])) .date-container{padding-top:0}.select-month{width:8.125rem;margin-right:0.9375rem}.select-day{width:5rem;margin-right:0.9375rem}.input-year{width:5rem}va-select::part(label),va-text-input::part(label){margin-top:0;margin-bottom:12px}va-text-input::part(validation){display:none}',VaDateStyle0=vaDateCss,VaDate$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[t,r,a]=(this.value||"").split("-").map(e=>Number(e));if(validate({component:this,year:t,month:r,day:a,yearTouched:this.yearTouched,monthTouched:this.monthTouched,dayTouched:this.dayTouched,monthSelect:!0,monthYearOnly:this.monthYearOnly,monthOptional:this.monthOptional}),!this.error&&(this.setValue(t,r,a),this.dateBlur.emit(e),this.enableAnalytics)){const e={componentName:"va-date",action:"blur",details:{year:t,month:r,day:a,"month-year-only":this.monthYearOnly}};this.componentLibraryAnalytics.emit(e)}},this.handleDateChange=e=>{const t=e.target;let[r,a,o]=(this.value||"").split("-");t.classList.contains("select-month")&&(a=t.value),t.classList.contains("select-day")&&(o=t.value),t.classList.contains("input-year")&&(r=t.value),this.setValue(parseInt(r),parseInt(a),parseInt(o)),this.dateChange.emit(e)},this.handleMonthBlur=()=>{this.monthTouched=!0},this.handleDayBlur=()=>{this.dayTouched=!0},this.handleYearBlur=()=>{this.yearTouched=!0},this.required=!1,this.label=void 0,this.name=void 0,this.hint=void 0,this.error=void 0,this.monthYearOnly=!1,this.monthOptional=!1,this.value=void 0,this.invalidDay=!1,this.invalidMonth=!1,this.invalidYear=!1,this.enableAnalytics=!1}setValue(e,t,r){const a=`${e||""}-${t?zeroPadStart(t):""}-${r?zeroPadStart(r):""}`.replace(/-+$/,"");this.value=a||null}render(){const{required:e,label:t,name:r,error:a,handleDateBlur:o,handleDateChange:n,monthYearOnly:i,value:s,hint:l}=this,[d,m,u]=(s||"").split("-").map(e=>parseInt(e)),p=Array.from({length:daysForSelectedMonth(d,m)},(e,t)=>t+1);return h(Host,{onBlur:o},h("fieldset",null,h("legend",null,t," ",e&&h("span",{class:"required"},"(*Required)")),l&&h("span",{class:"hint-text"},l),h("slot",null),h("span",{id:"error-message",role:"alert"},a&&h(Fragment,null,h("span",{class:"sr-only"},"Error")," ",instance.t(a,(e=>getErrorParameters(e,d,m))(a)))),h("div",{class:"date-container"},h("va-select",{label:"Month","aria-describedby":a?"error-message":void 0,name:`${r}Month`,value:null==m?void 0:m.toString(),onVaSelect:n,onBlur:this.handleMonthBlur,invalid:this.invalidMonth,class:"select-month",required:e,hideRequiredText:!0,error:this.monthTouched&&this.invalidMonth?a:null,showError:!1},months&&months.map(e=>h("option",{value:e.value},e.label))),!i&&h("va-select",{label:"Day","aria-describedby":a?"error-message":void 0,name:`${r}Day`,value:null==u?void 0:u.toString(),onVaSelect:n,onBlur:this.handleDayBlur,invalid:this.invalidDay,class:"select-day",required:e,hideRequiredText:!0,error:this.dayTouched&&this.invalidDay?this.error:null,showError:!1},p.map(e=>h("option",{value:e},e))),h("va-text-input",{label:"Year","aria-describedby":a?"error-message":void 0,name:`${r}Year`,maxlength:4,pattern:"[0-9]{4}",value:d?d.toString():"",invalid:this.invalidYear,onInput:n,onBlur:this.handleYearBlur,required:e,hideRequiredText:!0,error:this.yearTouched&&this.invalidYear?a:null,"show-input-error":"false",class:"input-year",inputmode:"numeric",type:"text","aria-label":"Please enter four digits for the year"}))))}get el(){return this}static get style(){return VaDateStyle0}},[1,"va-date",{required:[4],label:[1],name:[1],hint:[1],error:[1537],monthYearOnly:[4,"month-year-only"],monthOptional:[4,"month-optional"],value:[1537],invalidDay:[1028,"invalid-day"],invalidMonth:[1028,"invalid-month"],invalidYear:[1028,"invalid-year"],enableAnalytics:[4,"enable-analytics"]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-date","va-icon","va-select","va-text-input"].forEach(e=>{switch(e){case"va-date":customElements.get(e)||customElements.define(e,VaDate$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 VaDate=VaDate$1,defineCustomElement=defineCustomElement$1;export{VaDate,defineCustomElement};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as proxyCustomElement,H,d as createEvent,h,c as Host}from"./p-ef5c0d66.js";import"./p-6a3cf3d7.js";import{d as defineCustomElement$9}from"./p-6e4b9401.js";import{d as defineCustomElement$8}from"./p-e1092a04.js";import{d as defineCustomElement$7}from"./p-bac94659.js";import{d as defineCustomElement$6}from"./p-a12014b1.js";import{d as defineCustomElement$5}from"./p-784bed9b.js";import{d as defineCustomElement$4}from"./p-c3fdb782.js";import{d as defineCustomElement$3}from"./p-40738d84.js";import{d as defineCustomElement$2}from"./p-cf580be9.js";import{i as instance}from"./p-a836c3e1.js";const vaFileInputMultipleCss='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,a.va-sidenav-submenu__link:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px;z-index:2}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", "Source Sans Pro", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;font-weight:700}h1{margin-top:0;font-size:2.5rem}h2{font-size:2rem}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:1.875rem}h2{font-size:1.5rem}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}@media (max-width: 481px){h1{font-size:1.875rem}h2{font-size:1.5rem}}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}@import \'~@department-of-veterans-affairs/css-library/dist/stylesheets/base/headings.css\';: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{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3}.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-sr-only{position:absolute;left:-999em;right:auto}.usa-error-message{padding-bottom:0.25rem;padding-top:0.25rem;color:#b50909;display:block;font-weight:700}.usa-error-message{font-size:1.06rem}:host([error]:not([error=""])),:host(.va-form-group--error){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""])[use-forms-pattern=multiple]),:host(.va-form-group--error[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap,:host(.va-form-group--error[use-forms-pattern=multiple]) .input-wrap{border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1024px){:host([error]:not([error=""])),:host(.va-form-group--error){margin-left:-0.9rem}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap,:host(.va-form-group--error[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1023px){:host([error]:not([error=""])[use-forms-pattern=multiple]),:host(.va-form-group--error[use-forms-pattern=multiple]){padding-left:0}}[hidden]{display:none}:host{display:block;font-family:var(--font-source-sans);font-size:16.96px;}:host .label-header{color:var(--vads-color-base);font-weight:var(--font-weight-normal)}:host .label-header-tag{margin:0;display:inline-block}:host .file-input-wrapper{display:block;max-width:30rem;width:100%;position:relative;margin:8px 0}:host .file-input{cursor:pointer;height:100%;width:100%;max-width:none;top:0;left:0;z-index:1;margin:0;position:absolute;text-indent:-999em;-webkit-box-sizing:border-box;box-sizing:border-box}:host .file-input-target{border:1px dashed var(--vads-color-action-border-base-active-on-dark);display:block;margin-top:0.3125rem;position:relative;text-align:center;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}:host .file-input-target.file-input-target-error{border:2px dashed var(--vads-color-secondary-dark)}:host .file-input-box{background:var(--vads-color-white);height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:2}:host .file-input-instructions{font-size:1.06rem;padding:1.25rem 0.625rem;pointer-events:none;position:relative;z-index:3}:host .file-input-choose-text{color:var(--vads-color-link);text-decoration:underline;font-weight:var(--font-weight-normal)}:host .file-icon{color:var(--vads-color-primary-alt-darkest)}:host .selected-files-wrapper{background-color:var(--vads-color-primary-lighter);border:1px solid var(--vads-color-base-light)}:host .selected-files-label{color:var(--vads-color-base);font-weight:var(--font-weight-bold);font-size:1.06rem;border-bottom:1px solid var(--vads-color-white);margin-bottom:8px;padding:8px}:host .va-card{margin:8px}:host .file-label{color:var(--vads-color-base);font-weight:var(--font-weight-bold);font-size:1.06rem;padding:0 8px;display:block;width:100%;word-wrap:break-word;word-break:break-word;overflow:hidden}:host #input-error-message{padding:0 8px;width:100%}:host .file-size-label,:host .file-status-label{color:var(--vads-color-base-dark);font-weight:var(--font-weight-normal);font-size:1.06rem;padding:0 8px;display:block}:host .file-status-label{font-style:italic}:host .file-info-section{padding:0 8px 8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .file-button-section{margin-top:8px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-direction:row;flex-direction:row}:host .file-button-section>va-button-icon{font-size:1.06rem}@media screen and (max-width: 320px){:host .file-button-section{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start}}:host .with-separator{border-top:1px solid var(--vads-color-base-lighter)}:host .vads-u-line-height--2{line-height:1.15}:host .thumbnail-container{height:40px;width:40px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .thumbnail-preview{max-width:40px;width:auto;max-height:40px;height:auto}:host .thumbnail-error{color:#b21d38}:host va-progress-bar{font-size:var(--vads-font-size-root);display:block;margin-left:16px}:host .uploading-status{font-style:var(--font-style-italic)}:host(.has-error){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1024px){:host(.has-error){margin-left:-0.9rem}}.required{color:var(--vads-color-secondary-dark);margin-left:0.25rem}h1 .required,h2 .required,h3 .required,h4 .required,h5 .required,h6 .required{font-family:var(--font-source-sans);font-size:initial;font-weight:initial}.usa-error-message{font-size:1.06rem}:host([error]:not([error=""])),:host(.va-form-group--error){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""])[use-forms-pattern=multiple]),:host(.va-form-group--error[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap,:host(.va-form-group--error[use-forms-pattern=multiple]) .input-wrap{border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1024px){:host([error]:not([error=""])),:host(.va-form-group--error){margin-left:-0.9rem}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap,:host(.va-form-group--error[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1023px){:host([error]:not([error=""])[use-forms-pattern=multiple]),:host(.va-form-group--error[use-forms-pattern=multiple]){padding-left:0}}:host.has-error{border-left:0.25rem solid #b50909;padding-left:1rem}:host .outer-wrap{background-color:var(--vads-color-primary-lighter);border:1px solid var(--vads-color-base-light);display:block;max-width:30rem;width:100%;position:relative;margin:8px 0}:host va-file-input.no-file{margin:0 8px}:host va-file-input:not(:last-child){border-bottom:1px solid var(--vads-color-white)}:host va-file-input.has-error{border-left:none;padding-left:0}@media screen and (min-width: 1024px){:host va-file-input.has-error{margin-left:0}}',VaFileInputMultipleStyle0=vaFileInputMultipleCss,VaFileInputMultiple$1=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.vaMultipleChange=createEvent(this,"vaMultipleChange",7),this.fileKeyCounter=0,this.additionalSlot=null,this.getAdditionalFileUploadMessage=()=>h("span",null,"Drag an additional file here or"," ",h("span",{class:"file-input-choose-text"},"choose from folder")),this.renderLabelOrHeader=(e,t,i)=>{const r=t?h("span",{class:"required"}," ",instance.t("required")):null;return h("div",{class:"label-header"},i&&i>=1&&i<=6?h(`h${i}`,{part:"label",class:"label-header-tag"},e,r):h("label",{part:"label",class:"usa-label"},e,r))},this.addValueFiles=async()=>(this.files.shift(),this.value.forEach(e=>{this.files.push({file:e,key:this.fileKeyCounter,content:this.getAdditionalContent()||null}),this.fileKeyCounter++}),this.readOnly||this.files.push({file:null,key:this.fileKeyCounter,content:null}),this.valueAdded=!0,Promise.resolve()),this.hasErrors=()=>this.errors.some(e=>!!e),this.label=void 0,this.name=void 0,this.required=!1,this.accept=void 0,this.errors=[],this.passwordErrors=[],this.encrypted=[],this.hint=void 0,this.enableAnalytics=!1,this.headerSize=void 0,this.value=void 0,this.readOnly=!1,this.slotFieldIndexes=null,this.percentUploaded=[],this.maxFileSize=1/0,this.minFileSize=0,this.statusText=void 0,this.uploadedFiles=void 0,this.files=[{key:0,file:null,content:null,hasError:!1}],this.valueAdded=!1}findFileByKey(e){return this.files.find(t=>t.key===e)}findIndexByKey(e){return this.files.indexOf(this.files.find(t=>t.key===e))}isEmpty(){return null===this.files[0].file&&!0!==this.files[0].hasError}setSlotContent(){const e=this.el.shadowRoot.querySelector("slot");this.additionalSlot||(this.additionalSlot=e?e.assignedElements({flatten:!0}):[]),null==e||e.remove()}getAdditionalContent(){return this.additionalSlot&&this.additionalSlot.map(e=>e.cloneNode(!0))}ensurePlaceholder(){if(!this.readOnly&&!this.files.some(e=>null===e.file&&!0!==e.hasError)){this.fileKeyCounter++;const e={file:null,key:this.fileKeyCounter,content:null,error:!1};this.files=[...this.files,e]}}handleChange(e,t,i){const r=e.detail.files[0];let s,o,a;if(r){const e=this.findFileByKey(t);e.hasError&&(e.hasError=!1),e.file?(o="FILE_UPDATED",a=r,e.file=r):(o="FILE_ADDED",a=r,e.file=r,e.content=this.getAdditionalContent(),this.fileKeyCounter++,this.files=[...this.files],this.ensurePlaceholder()),s=this.buildFilesArray(this.files,!1,this.findIndexByKey(t))}else{o="FILE_REMOVED",a=this.files[i].file;const e=[...this.files];e.splice(i,1),this.files=e;const t=this.el.shadowRoot.querySelector("#statusMessage");t.textContent="",setTimeout(()=>{t.textContent="File deleted.",setTimeout(()=>{t.textContent=""},1e4)},1e3),s=this.buildFilesArray(this.files,!0)}this.ensurePlaceholder(),this.updateFilesState(),this.vaMultipleChange.emit({action:o,file:a,state:s,index:i})}handlePasswordChange(e,t,i){const r=this.findFileByKey(t);r.password=e.detail.password;const s=this.buildFilesArray(this.files,!1,this.findIndexByKey(t)),o={action:"PASSWORD_UPDATE",file:r.file,state:s,index:i};this.vaMultipleChange.emit(o)}updateFilesState(){this.files=[...this.files]}buildFilesArray(e,t,i){let r=e.filter(e=>!!e.file).map(e=>({file:e.file,changed:!1,password:e.password}));return!t&&r[i]&&(r[i].changed=!0),r}componentDidRender(){const e=this.el.shadowRoot.querySelectorAll("va-file-input");return this.setSlotContent(),e.forEach((e,t)=>{!this.files[t].content||this.slotFieldIndexes&&!this.slotFieldIndexes.includes(t)||this.files[t].content.forEach(t=>e.append(t))}),this.value&&this.value.length&&!this.valueAdded?this.addValueFiles():Promise.resolve()}render(){const{label:e,required:t,headerSize:i,hint:r,files:s,name:o,accept:a,errors:l,encrypted:n,percentUploaded:d,passwordErrors:m,enableAnalytics:f,readOnly:p,maxFileSize:u,minFileSize:c,statusText:b,uploadedFiles:g}=this,v=this.isEmpty()?"":"outer-wrap",x=this.hasErrors()?"has-error":"";return h(Host,{key:"59ebf2f2aa24d163b5f6de91bd9091c056d42db9",class:x,error:x?"error":""},e&&!p&&this.renderLabelOrHeader(e,t,i),r&&!p&&h("div",{key:"f85aff6acbe3f0e54fac53d7546ae1fc1d8bf1d9",class:"usa-hint",id:"input-hint-message"},r),h("div",{key:"463737f15c632f90f79b5a7a0b865759d6576d31",class:v},h("div",{key:"bb4d1b4d316ddee685db7166760bb7a04dd9db85",class:"usa-sr-only","aria-live":"polite",id:"statusMessage"}),!this.isEmpty()&&h("div",{key:"33635cbf1164cf863309db70f7832a65831ae08d",class:"selected-files-label"},p?"Files you uploaded":"Selected files"),s.map((i,s)=>{const v=d&&d.length>=s?d[s]:null,x=m&&m.length>=s?m[s]:null,y=g&&g.length>=s?g[s]:null;return h("va-file-input",Object.assign({key:i.key,id:`instance-${s}`,headless:!0,label:e,hint:r,name:`${o}-${i.key}`,accept:a,required:t},s>0?{uploadMessage:this.getAdditionalFileUploadMessage()}:{},{error:l[s],encrypted:n[s],percentUploaded:v,passwordError:x,onVaChange:e=>this.handleChange(e,i.key,s),onVaFileInputError:()=>{const e=this.findIndexByKey(i.key);e>-1&&(this.files[e]=Object.assign(Object.assign({},this.files[e]),{hasError:!0}),this.updateFilesState(),this.ensurePlaceholder())},onVaPasswordChange:e=>this.handlePasswordChange(e,i.key,s),"enable-analytics":f,value:i.file,readOnly:p,maxFileSize:u,minFileSize:c,statusText:b,uploadedFile:y,class:i.file||i.hasError?"has-file":"no-file","max-file-size":u,"min-file-size":c}))})),h("slot",{key:"358b2c4d0af79aad4d654a9b817c316c4998abaa"}))}get el(){return this}static get style(){return VaFileInputMultipleStyle0}},[1,"va-file-input-multiple",{label:[1],name:[1],required:[4],accept:[1],errors:[16],passwordErrors:[16],encrypted:[16],hint:[1],enableAnalytics:[4,"enable-analytics"],headerSize:[2,"header-size"],value:[16],readOnly:[4,"read-only"],slotFieldIndexes:[16],percentUploaded:[16],maxFileSize:[2,"max-file-size"],minFileSize:[2,"min-file-size"],statusText:[1,"status-text"],uploadedFiles:[16],files:[32],valueAdded:[32]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-file-input-multiple","va-button","va-button-icon","va-card","va-file-input","va-icon","va-modal","va-progress-bar","va-text-input"].forEach(e=>{switch(e){case"va-file-input-multiple":customElements.get(e)||customElements.define(e,VaFileInputMultiple$1);break;case"va-button":customElements.get(e)||defineCustomElement$9();break;case"va-button-icon":customElements.get(e)||defineCustomElement$8();break;case"va-card":customElements.get(e)||defineCustomElement$7();break;case"va-file-input":customElements.get(e)||defineCustomElement$6();break;case"va-icon":customElements.get(e)||defineCustomElement$5();break;case"va-modal":customElements.get(e)||defineCustomElement$4();break;case"va-progress-bar":customElements.get(e)||defineCustomElement$3();break;case"va-text-input":customElements.get(e)||defineCustomElement$2()}})}const VaFileInputMultiple=VaFileInputMultiple$1,defineCustomElement=defineCustomElement$1;export{VaFileInputMultiple,defineCustomElement};
|
|
1
|
+
import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";import"./contacts.js";import{d as defineCustomElement$9}from"./va-button2.js";import{d as defineCustomElement$8}from"./va-button-icon2.js";import{d as defineCustomElement$7}from"./va-card2.js";import{d as defineCustomElement$6}from"./va-file-input2.js";import{d as defineCustomElement$5}from"./va-icon2.js";import{d as defineCustomElement$4}from"./va-modal2.js";import{d as defineCustomElement$3}from"./va-progress-bar2.js";import{d as defineCustomElement$2}from"./va-text-input2.js";import{i as instance}from"./i18next.js";const vaFileInputMultipleCss='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,a.va-sidenav-submenu__link:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px;z-index:2}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", "Source Sans Pro", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;font-weight:700}h1{margin-top:0;font-size:2.5rem}h2{font-size:2rem}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:1.875rem}h2{font-size:1.5rem}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}@media (max-width: 481px){h1{font-size:1.875rem}h2{font-size:1.5rem}}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}@import \'~@department-of-veterans-affairs/css-library/dist/stylesheets/base/headings.css\';: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{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3}.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-sr-only{position:absolute;left:-999em;right:auto}.usa-error-message{padding-bottom:0.25rem;padding-top:0.25rem;color:#b50909;display:block;font-weight:700}.usa-error-message{font-size:1.06rem}:host([error]:not([error=""])),:host(.va-form-group--error){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""])[use-forms-pattern=multiple]),:host(.va-form-group--error[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap,:host(.va-form-group--error[use-forms-pattern=multiple]) .input-wrap{border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1024px){:host([error]:not([error=""])),:host(.va-form-group--error){margin-left:-0.9rem}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap,:host(.va-form-group--error[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1023px){:host([error]:not([error=""])[use-forms-pattern=multiple]),:host(.va-form-group--error[use-forms-pattern=multiple]){padding-left:0}}[hidden]{display:none}:host{display:block;font-family:var(--font-source-sans);font-size:16.96px;}:host .label-header{color:var(--vads-color-base);font-weight:var(--font-weight-normal)}:host .label-header-tag{margin:0;display:inline-block}:host .file-input-wrapper{display:block;max-width:30rem;width:100%;position:relative;margin:8px 0}:host .file-input{cursor:pointer;height:100%;width:100%;max-width:none;top:0;left:0;z-index:1;margin:0;position:absolute;text-indent:-999em;-webkit-box-sizing:border-box;box-sizing:border-box}:host .file-input.with-file{pointer-events:none}:host .file-input-target{border:1px dashed var(--vads-color-action-border-base-active-on-dark);display:block;margin-top:0.3125rem;position:relative;text-align:center;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}:host .file-input-target.file-input-target-error{border:2px dashed var(--vads-color-secondary-dark)}:host .file-input-box{background:var(--vads-color-white);height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:2}:host .file-input-instructions{font-size:1.06rem;padding:1.25rem 0.625rem;pointer-events:none;position:relative;z-index:3}:host .file-input-choose-text{color:var(--vads-color-link);text-decoration:underline;font-weight:var(--font-weight-normal)}:host .file-icon{color:var(--vads-color-primary-alt-darkest)}:host .selected-files-wrapper{background-color:var(--vads-color-primary-lighter);border:1px solid var(--vads-color-base-light)}:host .selected-files-label{color:var(--vads-color-base);font-weight:var(--font-weight-bold);font-size:1.06rem;border-bottom:1px solid var(--vads-color-white);margin-bottom:8px;padding:8px}:host .va-card{margin:8px}:host .file-info-group{padding-left:0.5rem}:host #input-error-message{padding:0.25rem 0;width:100%}:host va-card #input-error-message{padding:0}:host .file-label{color:var(--vads-color-base);font-weight:var(--font-weight-bold);font-size:1.06rem;display:block;width:100%;word-wrap:break-word;word-break:break-word;overflow:hidden}:host .file-size-label,:host .file-status-label{color:var(--vads-color-base-dark);font-weight:var(--font-weight-normal);font-size:var(--vads-font-size-source-sans-normalized);line-height:var(--vads-font-line-height-1);display:block}:host .file-status-label{font-style:italic}:host .file-info-section{padding:0 8px 8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .file-button-section,:host .additional-info-slot,:host .progress-bar-and-cancel-button,:host va-text-input{position:relative;z-index:2}:host .file-button-section{margin-top:8px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-direction:row;flex-direction:row}:host .file-button-section>va-button-icon{font-size:1.06rem}@media screen and (max-width: 320px){:host .file-button-section{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start}}:host .with-separator{border-top:1px solid var(--vads-color-base-lighter)}:host .vads-u-line-height--2{line-height:1.15}:host .thumbnail-container{height:40px;width:40px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;-ms-flex-negative:0;flex-shrink:0}:host .thumbnail-preview{max-width:40px;width:auto;max-height:40px;height:auto}:host .thumbnail-error{color:#b21d38}:host va-progress-bar{font-size:var(--vads-font-size-root);display:block;margin-left:16px}:host .uploading-status{font-style:var(--font-style-italic)}:host(.has-error){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1024px){:host(.has-error){margin-left:-0.9rem}}.required{color:var(--vads-color-secondary-dark);margin-left:0.25rem}h1 .required,h2 .required,h3 .required,h4 .required,h5 .required,h6 .required{font-family:var(--font-source-sans);font-size:initial;font-weight:initial}.usa-error-message{font-size:1.06rem}:host([error]:not([error=""])),:host(.va-form-group--error){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""])[use-forms-pattern=multiple]),:host(.va-form-group--error[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap,:host(.va-form-group--error[use-forms-pattern=multiple]) .input-wrap{border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1024px){:host([error]:not([error=""])),:host(.va-form-group--error){margin-left:-0.9rem}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap,:host(.va-form-group--error[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1023px){:host([error]:not([error=""])[use-forms-pattern=multiple]),:host(.va-form-group--error[use-forms-pattern=multiple]){padding-left:0}}:host.has-error{border-left:0.25rem solid #b50909;padding-left:1rem}:host .outer-wrap{background-color:var(--vads-color-primary-lighter);border:1px solid var(--vads-color-base-light);display:block;max-width:30rem;width:100%;position:relative;margin:8px 0}:host va-file-input.no-file{margin:0 8px}:host va-file-input:not(:last-child){border-bottom:1px solid var(--vads-color-white)}:host va-file-input.has-error{border-left:none;padding-left:0}@media screen and (min-width: 1024px){:host va-file-input.has-error{margin-left:0}}',VaFileInputMultipleStyle0=vaFileInputMultipleCss,VaFileInputMultiple$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.vaMultipleChange=createEvent(this,"vaMultipleChange",7),this.fileKeyCounter=0,this.additionalSlot=null,this.getAdditionalFileUploadMessage=()=>h("span",null,"Drag an additional file here or"," ",h("span",{class:"file-input-choose-text"},"choose from folder")),this.renderLabelOrHeader=(e,t,i)=>{const r=t?h("span",{class:"required"}," ",instance.t("required")):null;return h("div",{class:"label-header"},i&&i>=1&&i<=6?h(`h${i}`,{part:"label",class:"label-header-tag"},e,r):h("label",{part:"label",class:"usa-label"},e,r))},this.addValueFiles=async()=>(this.files.shift(),this.value.forEach(e=>{this.files.push({file:e,key:this.fileKeyCounter,content:this.getAdditionalContent()||null}),this.fileKeyCounter++}),this.readOnly||this.files.push({file:null,key:this.fileKeyCounter,content:null}),this.valueAdded=!0,Promise.resolve()),this.hasErrors=()=>this.errors.some(e=>!!e),this.label=void 0,this.name=void 0,this.required=!1,this.accept=void 0,this.errors=[],this.passwordErrors=[],this.encrypted=[],this.hint=void 0,this.enableAnalytics=!1,this.headerSize=void 0,this.value=void 0,this.readOnly=!1,this.slotFieldIndexes=null,this.percentUploaded=[],this.maxFileSize=1/0,this.minFileSize=0,this.statusText=void 0,this.uploadedFiles=void 0,this.files=[{key:0,file:null,content:null,hasError:!1}],this.valueAdded=!1}findFileByKey(e){return this.files.find(t=>t.key===e)}findIndexByKey(e){return this.files.indexOf(this.files.find(t=>t.key===e))}isEmpty(){return null===this.files[0].file&&!0!==this.files[0].hasError}setSlotContent(){const e=this.el.shadowRoot.querySelector("slot");this.additionalSlot||(this.additionalSlot=e?e.assignedElements({flatten:!0}):[]),null==e||e.remove()}getAdditionalContent(){return this.additionalSlot&&this.additionalSlot.map(e=>e.cloneNode(!0))}ensurePlaceholder(){if(!this.readOnly&&!this.files.some(e=>null===e.file&&!0!==e.hasError)){this.fileKeyCounter++;const e={file:null,key:this.fileKeyCounter,content:null,error:!1};this.files=[...this.files,e]}}handleChange(e,t,i){const r=e.detail.files[0];let o,s,a;if(r){const e=this.findFileByKey(t);e.hasError&&(e.hasError=!1),e.file?(s="FILE_UPDATED",a=r,e.file=r):(s="FILE_ADDED",a=r,e.file=r,e.content=this.getAdditionalContent(),this.fileKeyCounter++,this.files=[...this.files],this.ensurePlaceholder()),o=this.buildFilesArray(this.files,!1,this.findIndexByKey(t))}else{s="FILE_REMOVED",a=this.files[i].file;const e=[...this.files];e.splice(i,1),this.files=e;const t=this.el.shadowRoot.querySelector("#statusMessage");t.textContent="",setTimeout(()=>{t.textContent="File deleted.",setTimeout(()=>{t.textContent=""},1e4)},1e3),o=this.buildFilesArray(this.files,!0)}this.ensurePlaceholder(),this.updateFilesState(),this.vaMultipleChange.emit({action:s,file:a,state:o,index:i})}handlePasswordChange(e,t,i){const r=this.findFileByKey(t);r.password=e.detail.password;const o=this.buildFilesArray(this.files,!1,this.findIndexByKey(t)),s={action:"PASSWORD_UPDATE",file:r.file,state:o,index:i};this.vaMultipleChange.emit(s)}updateFilesState(){this.files=[...this.files]}buildFilesArray(e,t,i){let r=e.filter(e=>!!e.file).map(e=>({file:e.file,changed:!1,password:e.password}));return!t&&r[i]&&(r[i].changed=!0),r}componentDidRender(){const e=this.el.shadowRoot.querySelectorAll("va-file-input");return this.setSlotContent(),e.forEach((e,t)=>{!this.files[t].content||this.slotFieldIndexes&&!this.slotFieldIndexes.includes(t)||this.files[t].content.forEach(t=>e.append(t))}),this.value&&this.value.length&&!this.valueAdded?this.addValueFiles():Promise.resolve()}render(){const{label:e,required:t,headerSize:i,hint:r,files:o,name:s,accept:a,errors:n,encrypted:l,percentUploaded:d,passwordErrors:m,enableAnalytics:f,readOnly:u,maxFileSize:p,minFileSize:c,statusText:g,uploadedFiles:b}=this,v=this.isEmpty()?"":"outer-wrap",x=this.hasErrors()?"has-error":"";return h(Host,{key:"a591c365947bd32563dde1d75768e1eedb5a9e6d",class:x,error:x?"error":""},e&&!u&&this.renderLabelOrHeader(e,t,i),r&&!u&&h("div",{key:"8d661d9d6a09913e9f546302d5f5e5111b63bee6",class:"usa-hint",id:"input-hint-message"},r),h("div",{key:"654ce5558ab72e46856bc1f2b4c76411e11dffe3",class:v},h("div",{key:"d1a9d69b9ff92ec2d0d0f4b0ca5b02b9e02a3071",class:"usa-sr-only","aria-live":"polite",id:"statusMessage"}),!this.isEmpty()&&h("div",{key:"4ccb3dfa070790d2b2d635fdf9d8f80d8a13ee06",class:"selected-files-label"},u?"Files you uploaded":"Selected files"),o.map((i,o)=>{const v=d&&d.length>=o?d[o]:null,x=m&&m.length>=o?m[o]:null,y=b&&b.length>=o?b[o]:null;return h("va-file-input",Object.assign({key:i.key,id:`instance-${o}`,headless:!0,label:e,hint:r,name:`${s}-${i.key}`,accept:a,required:t},o>0?{uploadMessage:this.getAdditionalFileUploadMessage()}:{},{error:n[o],encrypted:l[o],percentUploaded:v,passwordError:x,onVaChange:e=>this.handleChange(e,i.key,o),onVaFileInputError:()=>{const e=this.findIndexByKey(i.key);e>-1&&(this.files[e]=Object.assign(Object.assign({},this.files[e]),{hasError:!0}),this.updateFilesState(),this.ensurePlaceholder())},onVaPasswordChange:e=>this.handlePasswordChange(e,i.key,o),"enable-analytics":f,value:i.file,readOnly:u,maxFileSize:p,minFileSize:c,statusText:g,uploadedFile:y,class:i.file||i.hasError?"has-file":"no-file","max-file-size":p,"min-file-size":c}))})),h("slot",{key:"7358088d30b9fb6da56c5bc9fbcb17087b2cde0e"}))}get el(){return this}static get style(){return VaFileInputMultipleStyle0}},[1,"va-file-input-multiple",{label:[1],name:[1],required:[4],accept:[1],errors:[16],passwordErrors:[16],encrypted:[16],hint:[1],enableAnalytics:[4,"enable-analytics"],headerSize:[2,"header-size"],value:[16],readOnly:[4,"read-only"],slotFieldIndexes:[16],percentUploaded:[16],maxFileSize:[2,"max-file-size"],minFileSize:[2,"min-file-size"],statusText:[1,"status-text"],uploadedFiles:[16],files:[32],valueAdded:[32]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-file-input-multiple","va-button","va-button-icon","va-card","va-file-input","va-icon","va-modal","va-progress-bar","va-text-input"].forEach(e=>{switch(e){case"va-file-input-multiple":customElements.get(e)||customElements.define(e,VaFileInputMultiple$1);break;case"va-button":customElements.get(e)||defineCustomElement$9();break;case"va-button-icon":customElements.get(e)||defineCustomElement$8();break;case"va-card":customElements.get(e)||defineCustomElement$7();break;case"va-file-input":customElements.get(e)||defineCustomElement$6();break;case"va-icon":customElements.get(e)||defineCustomElement$5();break;case"va-modal":customElements.get(e)||defineCustomElement$4();break;case"va-progress-bar":customElements.get(e)||defineCustomElement$3();break;case"va-text-input":customElements.get(e)||defineCustomElement$2()}})}const VaFileInputMultiple=VaFileInputMultiple$1,defineCustomElement=defineCustomElement$1;export{VaFileInputMultiple,defineCustomElement};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{V as VaFileInput$1,d as defineCustomElement$1}from"./
|
|
1
|
+
import{V as VaFileInput$1,d as defineCustomElement$1}from"./va-file-input2.js";const VaFileInput=VaFileInput$1,defineCustomElement=defineCustomElement$1;export{VaFileInput,defineCustomElement};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h,proxyCustomElement,HTMLElement,createEvent,forceUpdate,Host,Fragment}from"@stencil/core/internal/client";import{s as selectOrMatches,S as Sanitizer}from"./utils.js";import"./contacts.js";import{i as instance}from"./i18next.js";import{d as defineCustomElement$7}from"./va-button2.js";import{d as defineCustomElement$6}from"./va-button-icon2.js";import{d as defineCustomElement$5}from"./va-card2.js";import{d as defineCustomElement$4}from"./va-icon2.js";import{d as defineCustomElement$3}from"./va-modal2.js";import{d as defineCustomElement$2}from"./va-progress-bar2.js";import{d as defineCustomElement$1}from"./va-text-input2.js";const PREFIX="usa",DROPZONE_CLASS="usa-file-input",DROPZONE=`.${DROPZONE_CLASS}`,INPUT_CLASS="usa-file-input__input",TARGET_CLASS="usa-file-input__target",INPUT=`.${INPUT_CLASS}`,BOX_CLASS="usa-file-input__box",INSTRUCTIONS_CLASS="usa-file-input__instructions",PREVIEW_CLASS="usa-file-input__preview",PREVIEW_HEADING_CLASS="usa-file-input__preview-heading",DISABLED_CLASS="usa-file-input--disabled",CHOOSE_CLASS="usa-file-input__choose",ACCEPTED_FILE_MESSAGE_CLASS="usa-file-input__accepted-files-message",DRAG_TEXT_CLASS="usa-file-input__drag-text",DRAG_CLASS="usa-file-input--drag",LOADING_CLASS="is-loading",INVALID_FILE_CLASS="has-invalid-file",GENERIC_PREVIEW_CLASS_NAME="usa-file-input__preview-image",GENERIC_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--generic`,PDF_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--pdf`,WORD_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--word`,VIDEO_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--video`,EXCEL_PREVIEW_CLASS=`${GENERIC_PREVIEW_CLASS_NAME}--excel`,SR_ONLY_CLASS="usa-sr-only",SPACER_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";let TYPE_IS_VALID=Boolean(!0),DEFAULT_ARIA_LABEL_TEXT="",DEFAULT_FILE_STATUS_TEXT="";const getFileInputContext=e=>{const t=e.closest(DROPZONE);if(!t)throw new Error(`Element is missing outer ${DROPZONE}`);const i=t.querySelector(INPUT);return{dropZoneEl:t,inputEl:i}},disable=e=>{const{dropZoneEl:t,inputEl:i}=getFileInputContext(e);i.disabled=!0,t.classList.add(DISABLED_CLASS)},ariaDisable=e=>{const{dropZoneEl:t}=getFileInputContext(e);t.classList.add(DISABLED_CLASS)},enable=e=>{const{dropZoneEl:t,inputEl:i}=getFileInputContext(e);i.disabled=!1,t.classList.remove(DISABLED_CLASS),t.removeAttribute("aria-disabled")},replaceName=e=>{const t=e.charCodeAt(0);return 32===t?"-":t>=65&&t<=90?`img_${e.toLowerCase()}`:`__000${t.toString(16).slice(-4)}`},makeSafeForID=e=>e.replace(/[^a-z0-9]/g,replaceName),createUniqueID=e=>`${e}-${Math.floor(Date.now()/1e3)}`,getItemsLabel=e=>e.hasAttribute("multiple")?"files":"file",createTargetArea=e=>{const t=document.createElement("div"),i=document.createElement("div"),a=document.createElement("div");return e.classList.remove(DROPZONE_CLASS),e.classList.add(INPUT_CLASS),t.classList.add(DROPZONE_CLASS),a.classList.add(BOX_CLASS),i.classList.add(TARGET_CLASS),i.prepend(a),e.parentNode.insertBefore(i,e),e.parentNode.insertBefore(t,i),i.appendChild(e),t.appendChild(i),i},createVisibleInstructions=e=>{const t=e.closest(DROPZONE),i=getItemsLabel(e),a=document.createElement("div"),s=`Drag ${i} here or`,n="choose from folder";return DEFAULT_ARIA_LABEL_TEXT=`${s} ${n}`,a.classList.add(INSTRUCTIONS_CLASS),a.setAttribute("aria-hidden","true"),e.setAttribute("aria-label",DEFAULT_ARIA_LABEL_TEXT),a.innerHTML=Sanitizer.escapeHTML(`<span class="${DRAG_TEXT_CLASS}">${s}</span> <span class="${CHOOSE_CLASS}">${n}</span>`),e.parentNode.insertBefore(a,e),(/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.querySelector(`.${DRAG_TEXT_CLASS}`).outerHTML=""),a},createSROnlyStatus=e=>{const t=document.createElement("div"),i=getItemsLabel(e),a=e.closest(DROPZONE),s=e.closest(`.${TARGET_CLASS}`);DEFAULT_FILE_STATUS_TEXT=`No ${i} selected.`,t.classList.add("usa-sr-only"),t.setAttribute("aria-live","polite"),t.textContent=DEFAULT_FILE_STATUS_TEXT,a.insertBefore(t,s)},enhanceFileInput=e=>{const t=e.hasAttribute("aria-disabled")||e.hasAttribute("disabled"),i=createTargetArea(e),a=createVisibleInstructions(e),{dropZoneEl:s}=getFileInputContext(e);return t?s.classList.add(DISABLED_CLASS):createSROnlyStatus(e),{instructions:a,dropTarget:i}},removeOldPreviews=(e,t)=>{const i=e.querySelectorAll(`.${PREVIEW_CLASS}`),a=e.querySelector(`.${PREVIEW_HEADING_CLASS}`),s=e.querySelector(`.${ACCEPTED_FILE_MESSAGE_CLASS}`);a&&(a.outerHTML=""),s&&(s.outerHTML="",e.classList.remove("has-invalid-file")),null!==i&&(t&&t.removeAttribute("hidden"),Array.prototype.forEach.call(i,e=>{e.parentNode.removeChild(e)}))},updateStatusMessage=(e,t,i)=>{const a=e;let s=DEFAULT_FILE_STATUS_TEXT;1===t.length?s=`You have selected the file: ${i}`:t.length>1&&(s=`You have selected ${t.length} files: ${i.join(", ")}`),setTimeout(()=>{a.textContent=s},1e3)},addPreviewHeading=(e,t)=>{const i=document.createElement("div"),a=e.closest(`.${TARGET_CLASS}`),s=a.querySelector(`.${INSTRUCTIONS_CLASS}`);let n="Change file",r="";1===t.length?r=Sanitizer.escapeHTML(`Selected file <span class="usa-file-input__choose">${n}</span>`):t.length>1&&(n="Change files",r=Sanitizer.escapeHTML(`${t.length} files selected <span class="usa-file-input__choose">${n}</span>`)),s.setAttribute("hidden","true"),i.classList.add(PREVIEW_HEADING_CLASS),i.innerHTML=r,a.insertBefore(i,s),e.setAttribute("aria-label",n)},handleChange=(e,t,i,a)=>{const s=t.getAttribute("multiple")?e.target.files:[e.target.files[0]],n=a.closest(`.${DROPZONE_CLASS}`).querySelector(".usa-sr-only"),r=[];removeOldPreviews(a,i);for(let e=0;e<s.length;e+=1){const t=new FileReader,n=s[e].name;let o;r.push(n),t.onloadstart=function(){o=createUniqueID(makeSafeForID(n)),i.insertAdjacentHTML("afterend",Sanitizer.escapeHTML(`<div class="${PREVIEW_CLASS}" aria-hidden="true">\n <img id="${o}" src="${SPACER_GIF}" alt="" class="${GENERIC_PREVIEW_CLASS_NAME} is-loading"/>${n}\n <div>`))},t.onloadend=function(){const e=a.querySelector(`#${o}`);n.indexOf(".pdf")>0?e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${PDF_PREVIEW_CLASS}")`):n.indexOf(".doc")>0||n.indexOf(".pages")>0?e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${WORD_PREVIEW_CLASS}")`):n.indexOf(".xls")>0||n.indexOf(".numbers")>0?e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${EXCEL_PREVIEW_CLASS}")`):n.indexOf(".mov")>0||n.indexOf(".mp4")>0?e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${VIDEO_PREVIEW_CLASS}")`):e.setAttribute("onerror",`this.onerror=null;this.src="${SPACER_GIF}"; this.classList.add("${GENERIC_PREVIEW_CLASS}")`),e.classList.remove("is-loading"),e.src=t.result},s[e]&&t.readAsDataURL(s[e])}0===s.length?t.setAttribute("aria-label",DEFAULT_ARIA_LABEL_TEXT):addPreviewHeading(t,s),updateStatusMessage(n,s,r)},preventInvalidFiles=(e,t,i,a)=>{const s=t.getAttribute("accept");a.classList.remove("has-invalid-file");const n=(e,t)=>{let i=!1;return e.indexOf(t)>=0&&(i=!0),i};if(s){const r=s.split(","),o=document.createElement("div");let l=!0;const d=e.target.files||e.dataTransfer.files;for(let e=0;e<d.length;e+=1){const t=d[e];if(!l)break;for(let e=0;e<r.length;e+=1){const i=r[e];if(l=t.name.indexOf(i)>0||n(t.type,i.replace(/\*/g,"")),l){TYPE_IS_VALID=!0;break}}}l||(removeOldPreviews(a,i),t.value="",a.insertBefore(o,t),o.textContent=t.dataset.errormessage||"This is not a valid file type.",o.classList.add(ACCEPTED_FILE_MESSAGE_CLASS),a.classList.add("has-invalid-file"),TYPE_IS_VALID=!1,e.preventDefault(),e.stopPropagation())}},handleUpload=(e,t,i,a)=>{preventInvalidFiles(e,t,i,a),!0===TYPE_IS_VALID&&handleChange(e,t,i,a)},fileInput={init(e){selectOrMatches(DROPZONE,e).forEach(e=>{const{instructions:t,dropTarget:i}=enhanceFileInput(e);i.addEventListener("dragover",function(){this.classList.add(DRAG_CLASS)},!1),i.addEventListener("dragleave",function(){this.classList.remove(DRAG_CLASS)},!1),i.addEventListener("drop",function(a){a.preventDefault(),this.classList.remove(DRAG_CLASS);const s=a.dataTransfer;if(a.target.files=s.files,s.files.length>1)return;handleUpload(a,e,t,i);const n=new CustomEvent("change",{detail:{files:s.files}});e.dispatchEvent(n)},!1),e.addEventListener("input",a=>handleUpload(a,e,t,i),!1)})},teardown(e){selectOrMatches(INPUT,e).forEach(e=>{const t=e.parentElement.parentElement;t.parentElement.replaceChild(e,t),e.className=DROPZONE_CLASS})},getFileInputContext:getFileInputContext,disable:disable,ariaDisable:ariaDisable,enable:enable},extensionToMimeType={".txt":"text/plain",".pdf":"application/pdf",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".odt":"application/vnd.oasis.opendocument.text",".rtf":"application/rtf",".csv":"text/csv",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".gif":"image/gif",".bmp":"image/bmp",".webp":"image/webp",".tif":"image/tiff",".tiff":"image/tiff",".svg":"image/svg+xml",".mp3":"audio/mpeg",".wav":"audio/wav",".ogg":"audio/ogg",".m4a":"audio/mp4",".aac":"audio/aac",".mp4":"video/mp4",".avi":"video/x-msvideo",".mov":"video/quicktime",".wmv":"video/x-ms-wmv",".flv":"video/x-flv",".mkv":"video/x-matroska",".webm":"video/webm",".zip":"application/zip",".rar":"application/x-rar-compressed",".7z":"application/x-7z-compressed",".tar":"application/x-tar",".gz":"application/gzip",".json":"application/json",".xml":"application/xml",".html":"text/html",".htm":"text/html",".css":"text/css",".js":"application/javascript",".heic":"image/heic"},chooseFileString="choose from folder",dragFileString="Drag a file here or ",changeFileAriaLabelPrefix="change file.",deleteFileAriaLabelPrefix="delete file.",errorAriaLabelString="Error:",fileDeletedAriaLabelPrefix="File deleted. No file selected.",fileSelectedAriaLabelPrefix="You have selected the file:";function focusOnElementWithRetries(e,t,i){let a=0;const s=()=>{const n=e.shadowRoot.querySelector(t),r=null==n?void 0:n.shadowRoot.querySelector(i);r?r.focus():a<10&&(a++,setTimeout(s,100))};setTimeout(s,250)}function focusOnChangeButton(e){focusOnElementWithRetries(e,"va-button-icon","button")}function focusOnInputAfterAriaLabelUpdate(e){requestAnimationFrame(()=>{requestAnimationFrame(()=>{e&&e.focus()})})}function focusOnPasswordInput(e){focusOnElementWithRetries(e,"va-text-input","input")}function formatFileSize(e){const t=["B","KB","MB","GB","TB"];if(0===e)return"0 B";const i=Math.floor(Math.log(e)/Math.log(1024));return 0===i?`${e} ${t[i]}`:`${(e/Math.pow(1024,i)).toFixed(i<2?0:1)} ${t[i]}`}function getAriaLabelsForInputAndButtons(e,t,i,a,s,n){let r,o,l=`${e}${t?" "+instance.t("required"):""}. ${dragFileString}${chooseFileString}`;return i?{inputAriaLabel:`Error: ${i} ${l}`,deleteFileAriaLabel:`delete file. Error: ${i}`,changeFileAriaLabel:`change file. Error: ${i}`}:(a&&s?l=`${fileSelectedAriaLabelPrefix} ${s.name}.`:!a&&n?l=`${fileSelectedAriaLabelPrefix} ${n.name}.`:!a||s||n||(l=`${fileDeletedAriaLabelPrefix} ${l}`),s?(r=`change file. ${s.name}`,o=`delete file. ${s.name}`):n&&(r=`change file. ${n.name}`,o=`delete file. ${n.name}`),{inputAriaLabel:l,deleteFileAriaLabel:o,changeFileAriaLabel:r})}function isAcceptedFileType(e,t){for(const i of t){if(i===e)return!0;if(i.endsWith("/*")&&e.startsWith(i.slice(0,-1)))return!0}return!1}function getExtension(e){const t=e.name.replace(/^\./,"");return(t.includes(".")?`.${t.split(".").pop()}`:null)||e.type}function getFileTypeErrorMessage(e){const t=getExtension(e);return`We do not accept ${t?`${t} files`:"this file type"}. Choose a new file.`}function normalizeAcceptProp(e){return e.split(",").map(e=>(e=e.trim()).startsWith(".")?extensionToMimeType[e]:e)}function renderErrorAlert(e){if(e)return h("span",{id:"input-error-message",class:"usa-error-message"},e)}function renderFileThumbnail(e,t,i){return e?h("div",{class:"thumbnail-container"},h("va-icon",{icon:"error",size:3,class:"thumbnail-preview thumbnail-error"})):t&&(null==i?void 0:i.startsWith("image/"))?h("div",{class:"thumbnail-container","aria-hidden":"true"},h("img",{class:"thumbnail-preview",src:t,alt:"image"})):h("div",{class:"thumbnail-container","aria-hidden":"true"},h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"#07648d",width:"40px",height:"40px"},h("path",{d:"M224 136V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zm160-14.1v6.1H256V0h6.1c6.4 0 12.5 2.5 17 7l97.9 98c4.5 4.5 7 10.6 7 16.9z"})))}function renderLabelOrHeader(e,t,i){const a=t?h("span",{class:"required"}," ",instance.t("required")):null;return h("div",{class:"label-header"},i&&i>=1&&i<=6?h(`h${i}`,{htmlFor:"fileInputField",part:"label",class:"label-header-tag"},e,a):h("label",{htmlFor:"fileInputField",part:"label",class:"usa-label"},e,a))}function renderUploadMessage(e){return e||h("span",null,dragFileString,h("span",{class:"file-input-choose-text"},chooseFileString))}const vaFileInputCss='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,a.va-sidenav-submenu__link:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px;z-index:2}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", "Source Sans Pro", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;font-weight:700}h1{margin-top:0;font-size:2.5rem}h2{font-size:2rem}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:1.875rem}h2{font-size:1.5rem}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}@media (max-width: 481px){h1{font-size:1.875rem}h2{font-size:1.5rem}}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{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3}.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-sr-only{position:absolute;left:-999em;right:auto}.usa-error-message{padding-bottom:0.25rem;padding-top:0.25rem;color:#b50909;display:block;font-weight:700}.usa-error-message{font-size:1.06rem}:host([error]:not([error=""])),:host(.va-form-group--error){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""])[use-forms-pattern=multiple]),:host(.va-form-group--error[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap,:host(.va-form-group--error[use-forms-pattern=multiple]) .input-wrap{border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1024px){:host([error]:not([error=""])),:host(.va-form-group--error){margin-left:-0.9rem}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap,:host(.va-form-group--error[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1023px){:host([error]:not([error=""])[use-forms-pattern=multiple]),:host(.va-form-group--error[use-forms-pattern=multiple]){padding-left:0}}[hidden]{display:none}:host{display:block;font-family:var(--font-source-sans);font-size:16.96px;}:host .label-header{color:var(--vads-color-base);font-weight:var(--font-weight-normal)}:host .label-header-tag{margin:0;display:inline-block}:host .file-input-wrapper{display:block;max-width:30rem;width:100%;position:relative;margin:8px 0}:host .file-input{cursor:pointer;height:100%;width:100%;max-width:none;top:0;left:0;z-index:1;margin:0;position:absolute;text-indent:-999em;-webkit-box-sizing:border-box;box-sizing:border-box}:host .file-input.with-file{pointer-events:none}:host .file-input-target{border:1px dashed var(--vads-color-action-border-base-active-on-dark);display:block;margin-top:0.3125rem;position:relative;text-align:center;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}:host .file-input-target.file-input-target-error{border:2px dashed var(--vads-color-secondary-dark)}:host .file-input-box{background:var(--vads-color-white);height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:2}:host .file-input-instructions{font-size:1.06rem;padding:1.25rem 0.625rem;pointer-events:none;position:relative;z-index:3}:host .file-input-choose-text{color:var(--vads-color-link);text-decoration:underline;font-weight:var(--font-weight-normal)}:host .file-icon{color:var(--vads-color-primary-alt-darkest)}:host .selected-files-wrapper{background-color:var(--vads-color-primary-lighter);border:1px solid var(--vads-color-base-light)}:host .selected-files-label{color:var(--vads-color-base);font-weight:var(--font-weight-bold);font-size:1.06rem;border-bottom:1px solid var(--vads-color-white);margin-bottom:8px;padding:8px}:host .va-card{margin:8px}:host .file-info-group{padding-left:0.5rem}:host #input-error-message{padding:0.25rem 0;width:100%}:host va-card #input-error-message{padding:0}:host .file-label{color:var(--vads-color-base);font-weight:var(--font-weight-bold);font-size:1.06rem;display:block;width:100%;word-wrap:break-word;word-break:break-word;overflow:hidden}:host .file-size-label,:host .file-status-label{color:var(--vads-color-base-dark);font-weight:var(--font-weight-normal);font-size:var(--vads-font-size-source-sans-normalized);line-height:var(--vads-font-line-height-1);display:block}:host .file-status-label{font-style:italic}:host .file-info-section{padding:0 8px 8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .file-button-section,:host .additional-info-slot,:host .progress-bar-and-cancel-button,:host va-text-input{position:relative;z-index:2}:host .file-button-section{margin-top:8px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-direction:row;flex-direction:row}:host .file-button-section>va-button-icon{font-size:1.06rem}@media screen and (max-width: 320px){:host .file-button-section{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start}}:host .with-separator{border-top:1px solid var(--vads-color-base-lighter)}:host .vads-u-line-height--2{line-height:1.15}:host .thumbnail-container{height:40px;width:40px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;-ms-flex-negative:0;flex-shrink:0}:host .thumbnail-preview{max-width:40px;width:auto;max-height:40px;height:auto}:host .thumbnail-error{color:#b21d38}:host va-progress-bar{font-size:var(--vads-font-size-root);display:block;margin-left:16px}:host .uploading-status{font-style:var(--font-style-italic)}:host(.has-error){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1024px){:host(.has-error){margin-left:-0.9rem}}.required{color:var(--vads-color-secondary-dark);margin-left:0.25rem}h1 .required,h2 .required,h3 .required,h4 .required,h5 .required,h6 .required{font-family:var(--font-source-sans);font-size:initial;font-weight:initial}',VaFileInputStyle0=vaFileInputCss,VaFileInput=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.vaChange=createEvent(this,"vaChange",7),this.vaPasswordChange=createEvent(this,"vaPasswordChange",7),this.vaFileInputError=createEvent(this,"vaFileInputError",7),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.delayPasswordInputFocusUntilWindowFocus=!1,this.delayChangeButtonFocusUntilWindowFocus=!1,this.slottedContent=null,this.windowHasFocus=!0,this.initialUploadAttemptHasTakenPlace=!1,this.FILE_PREVIEW_SIZE_LIMIT=5242880,this.handleChange=e=>{const t=e.target;this.fileContents=null,t.files&&t.files.length>0&&this.handleFile(t.files[0],!0)},this.handleDrop=e=>{e.preventDefault(),e.stopPropagation();const t=e.dataTransfer.files;t.length>0&&this.handleFile(t[0],!0)},this.removeFile=(e=!0)=>{this.internalError=null,e&&this.vaChange.emit({files:[]}),this.file=null,this.uploadedFile=null,this.fileInputRef&&(this.fileInputRef.value=""),this.closeModal()},this.openModal=()=>{this.el.shadowRoot.querySelector("va-modal").setAttribute("status","warning"),this.showModal=!0},this.closeModal=()=>{this.showModal=!1},this.changeFile=()=>{this.fileInputRef&&this.fileInputRef.click()},this.file=void 0,this.fileContents=void 0,this.internalError=void 0,this.showModal=!1,this.showSeparator=!0,this.label=void 0,this.name=void 0,this.value=void 0,this.required=!1,this.accept=void 0,this.error=void 0,this.hint=void 0,this.statusText=void 0,this.uploadMessage=null,this.enableAnalytics=!1,this.headerSize=void 0,this.headless=!1,this.readOnly=!1,this.encrypted=!1,this.uploadedFile=void 0,this.maxFileSize=1/0,this.minFileSize=0,this.percentUploaded=null,this.passwordError=void 0}handleExternalErrorChange(e,t){t&&e?this.resetState():e&&focusOnInputAfterAriaLabelUpdate(this.fileInputRef)}handleInternalErrorChange(e){e&&this.windowHasFocus?focusOnChangeButton(this.el):e&&!this.windowHasFocus&&(this.delayChangeButtonFocusUntilWindowFocus=!0)}percentHandler(e){e>=100&&this.resetState()}handleShowModalChange(e){e||this.file||focusOnInputAfterAriaLabelUpdate(this.fileInputRef)}handleStatusTextChange(e){e&&focusOnInputAfterAriaLabelUpdate(this.fileInputRef)}handleEncryptedChange(e){e&&this.file&&(this.windowHasFocus?focusOnPasswordInput(this.el):this.delayPasswordInputFocusUntilWindowFocus=!0)}handleFileChange(e,t){e&&e!==t&&this.encrypted&&(this.windowHasFocus?focusOnPasswordInput(this.el):this.delayPasswordInputFocusUntilWindowFocus=!0)}handleValueChange(e){e&&e!==this.file?this.handleFile(e,!1,!0):e||this.removeFile(!1)}handleWindowBlur(){this.windowHasFocus=!1}handleWindowFocus(){if(this.windowHasFocus=!0,this.delayChangeButtonFocusUntilWindowFocus||this.delayPasswordInputFocusUntilWindowFocus)return this.delayChangeButtonFocusUntilWindowFocus?(this.delayChangeButtonFocusUntilWindowFocus=!1,void focusOnChangeButton(this.el)):void(this.delayPasswordInputFocusUntilWindowFocus&&(this.encrypted||this.passwordError)&&(this.delayPasswordInputFocusUntilWindowFocus=!1,focusOnPasswordInput(this.el)))}resetState(){this.fileContents=null,this.percentUploaded=null,forceUpdate(this.el)}handleFile(e,t=!0,i=!1){this.initialUploadAttemptHasTakenPlace=!0;let a=null;if(this.accept){const t=normalizeAcceptProp(this.accept);isAcceptedFileType(e.type,t)||(this.removeFile(!1),a=getFileTypeErrorMessage(e))}if(0===e.size&&(a="The file you selected is empty. Files must be larger than 0B."),e.size>this.maxFileSize&&(a=`\n We can't upload your file because it's too big. Files must be less than ${formatFileSize(this.maxFileSize)}.`),e.size<this.minFileSize&&(a=`We can't upload your file because it's too small. Files must be at least ${formatFileSize(this.minFileSize)}.`),this.uploadedFile=null,this.file=e,a)return this.internalError=a,this.vaFileInputError.emit({error:a}),void this.resetState();t&&this.vaChange.emit({files:[this.file]}),this.internalError=null,e.size<this.FILE_PREVIEW_SIZE_LIMIT&&this.generateFileContents(this.file),i||focusOnInputAfterAriaLabelUpdate(this.fileInputRef),this.enableAnalytics&&this.componentLibraryAnalytics.emit({componentName:"va-file-input",action:"change",details:{label:this.label}})}async generateFileContents(e){if(!e)return;const t=e.slice(0,20),i=await t.arrayBuffer();if(new Uint8Array(i).every(e=>0===e))return;const a=new FileReader;this.fileType=e.type,a.onloadend=()=>{this.fileContents=a.result},!this.fileType||"application/pdf"!==this.fileType&&!this.fileType.startsWith("image/")||this.fileType.includes("heic")||a.readAsDataURL(e)}handlePasswordChange(e){this.vaPasswordChange.emit({password:e.target.value})}componentWillRender(){this.slottedContent=Array.from(this.el.querySelectorAll(":scope > *")),!this.value||this.file||this.initialUploadAttemptHasTakenPlace||(this.handleFile(this.value,!1,!0),this.initialUploadAttemptHasTakenPlace=!0);const e=!(!this.value&&!this.file||this.readOnly);this.showSeparator=this.slottedContent.length>0||e}componentDidLoad(){fileInput.init(this.el)}render(){const{label:e,name:t,required:i,accept:a,error:s,hint:n,initialUploadAttemptHasTakenPlace:r,uploadMessage:o,headerSize:l,fileContents:d,fileType:c,headless:u,readOnly:p,encrypted:f,statusText:m,uploadedFile:g,percentUploaded:v,passwordError:b,internalError:E}=this,{file:S}=this,A=s||E,C=("file-input-target "+(A?"file-input-target-error":"")).trim();let w=u?"headless-selected-files-wrapper":"selected-files-wrapper";const L=null!==v&&v<100;let x="file-status-label";L&&(x=`${x} uploading-status`);const{inputAriaLabel:_,deleteFileAriaLabel:I,changeFileAriaLabel:F}=getAriaLabelsForInputAndButtons(e,i,A,r,S,g);return h(Host,{key:"2c0d0b8ca817db08ca5cefaa28d8e196112be508",class:{"has-error":!!A}},!p&&!u&&h("span",{key:"6bf32739027312a5274c478d15bf7524433417f9"},e&&renderLabelOrHeader(e,i,l)),n&&!p&&!u&&h("div",{key:"9be648ac17f9d1d299d9d3a39f71bcb31572a442",class:"usa-hint",id:"input-hint-message"},n),h("div",{key:"6e36282114d2bbf4a4c853d7e9e64a6e0b95f649",class:"file-input-wrapper",onDrop:this.handleDrop},h("input",{key:"c60cb5ef06fe9f25587a486458404455529617b3",id:"fileInputField",class:"file-input "+(S||g?"with-file":""),"aria-label":_,type:"file",ref:e=>this.fileInputRef=e,name:t,accept:a,onChange:this.handleChange}),g||S?h("div",{class:w},!u&&h("div",{class:"selected-files-label"},p?"Files you uploaded":"Selected files"),h("va-card",{class:"va-card"},h("div",{class:"file-info-section"},renderFileThumbnail(A,d,c),h("div",{class:"file-info-group vads-u-line-height--2"},h("span",{class:"file-label"},S?S.name:g.name),renderErrorAlert(A),!L&&h("span",{class:"file-size-label"},formatFileSize(S?S.size:g.size)),(L||m)&&h("span",{class:x},L?"Uploading...":m))),h("div",{class:this.showSeparator?"with-separator":void 0},!p&&L&&h("div",{class:"progress-bar-and-cancel-button"},h("va-progress-bar",{percent:v,noPercentScreenReader:!0}),h("va-button-icon",{buttonType:"cancel",onClick:this.resetState.bind(this)})),!L&&h(Fragment,null,f&&h("va-text-input",{type:"password",onInput:e=>{this.handlePasswordChange(e)},label:"File password",required:!0,error:b}),h("div",{class:"additional-info-slot"},h("slot",null))),!p&&!L&&h(Fragment,null,h("div",{class:"file-button-section"},h("va-button-icon",{buttonType:"change-file",onClick:this.changeFile,label:F}),h("va-button-icon",{buttonType:"delete",onClick:this.openModal,label:I})),h("va-modal",{modalTitle:"Delete this file?",visible:this.showModal,primaryButtonText:"Yes, delete this",secondaryButtonText:"No, keep this",onCloseEvent:this.closeModal,onPrimaryButtonClick:()=>this.removeFile(!0),onSecondaryButtonClick:this.closeModal},"We'll delete the uploaded file"," ",h("span",{class:"file-label"},S?S.name:g.name)))))):h("div",null,h("span",{id:"file-input-error-alert"},renderErrorAlert(A)),h("div",{class:C},h("div",{class:"file-input-box"}),h("div",{class:"file-input-instructions"},renderUploadMessage(o))))))}get el(){return this}static get watchers(){return{error:["handleExternalErrorChange"],internalError:["handleInternalErrorChange"],percentUploaded:["percentHandler"],showModal:["handleShowModalChange"],statusText:["handleStatusTextChange"],encrypted:["handleEncryptedChange"],file:["handleFileChange"],value:["handleValueChange"]}}static get style(){return VaFileInputStyle0}},[1,"va-file-input",{label:[1],name:[1],value:[16],required:[4],accept:[1],error:[1],hint:[1],statusText:[1,"status-text"],uploadMessage:[16],enableAnalytics:[4,"enable-analytics"],headerSize:[2,"header-size"],headless:[4],readOnly:[4,"read-only"],encrypted:[4],uploadedFile:[1040],maxFileSize:[2,"max-file-size"],minFileSize:[2,"min-file-size"],percentUploaded:[1538,"percent-uploaded"],passwordError:[1,"password-error"],file:[32],fileContents:[32],internalError:[32],showModal:[32],showSeparator:[32]},[[8,"blur","handleWindowBlur"],[8,"focus","handleWindowFocus"]],{error:["handleExternalErrorChange"],internalError:["handleInternalErrorChange"],percentUploaded:["percentHandler"],showModal:["handleShowModalChange"],statusText:["handleStatusTextChange"],encrypted:["handleEncryptedChange"],file:["handleFileChange"],value:["handleValueChange"]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["va-file-input","va-button","va-button-icon","va-card","va-icon","va-modal","va-progress-bar","va-text-input"].forEach(e=>{switch(e){case"va-file-input":customElements.get(e)||customElements.define(e,VaFileInput);break;case"va-button":customElements.get(e)||defineCustomElement$7();break;case"va-button-icon":customElements.get(e)||defineCustomElement$6();break;case"va-card":customElements.get(e)||defineCustomElement$5();break;case"va-icon":customElements.get(e)||defineCustomElement$4();break;case"va-modal":customElements.get(e)||defineCustomElement$3();break;case"va-progress-bar":customElements.get(e)||defineCustomElement$2();break;case"va-text-input":customElements.get(e)||defineCustomElement$1()}})}export{VaFileInput as V,defineCustomElement as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import{d as defineCustomElement$7}from"./va-button2.js";import{d as defineCustomElement$6}from"./va-crisis-line-modal2.js";import{d as defineCustomElement$5}from"./va-icon2.js";import{d as defineCustomElement$4}from"./va-modal2.js";import{d as defineCustomElement$3}from"./va-official-gov-banner2.js";import{d as defineCustomElement$2}from"./va-telephone2.js";const vaSealSvg="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1Ny42IDM1LjIiIHJvbGU9ImltZyI+PHRpdGxlPlZBPC90aXRsZT48ZyBmaWxsPSIjRkZGIj48cGF0aCBkPSJNMTEuMSAzNS4yTDAgMGg4LjZsNC4yIDE0LjljMS4yIDQuMiAyLjIgOC4yIDMuMSAxMi42aC4xYy45LTQuMiAxLjktOC40IDMuMS0xMi40TDIzLjUgMGg4LjNMMjAuMiAzNS4yaC05LjF6TTM2LjYgMjYuMmwtMi41IDloLThMMzYuNiAwaDEwLjJsMTAuOCAzNS4yaC04LjVsLTIuNy05aC05Ljh6bTguOC02bC0yLjItNy41Yy0uNi0yLjEtMS4yLTQuNy0xLjctNi44aC0uMWMtLjUgMi4xLTEgNC44LTEuNiA2LjhsLTIgNy41aDcuNnoiPjwvcGF0aD48L2c+PC9zdmc+",vaHeaderMinimalCss=".va-header{display:-ms-flexbox;display:flex;margin-left:auto;margin-right:auto;max-width:1000px;background-color:var(--vads-color-primary-darker);color:var(--vads-button-color-text-primary-alt-on-light);-ms-flex-align:center;align-items:center;padding:10px 8px;line-height:22px}@media (min-width: 481px){.va-header{padding:10px 16px}}.va-logo-link:focus{outline:2px solid var(--vads-color-action-focus-on-light)}.va-logo{margin-right:8px;min-height:30px;min-width:48px}@media (min-width: 481px){.va-logo{margin-right:16px}}.header-container{padding-left:8px;border-left:1px solid var(--vads-color-white)}@media (min-width: 481px){.header-container{padding-left:16px}}.header-container h1,.header-container .header{font-size:20px;margin:0;font-weight:700}.header-container h2,.header-container .subheader{font-size:20px;margin:0;font-weight:100}@media (min-width: 1024px){va-crisis-line-modal::part(button){position:absolute;right:0;bottom:-5px}}",VaHeaderMinimalStyle0=vaHeaderMinimalCss,VaHeaderMinimal$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.shifted=!1,this.header=void 0,this.subheader=void 0,this.enableHeadings=!1}trackShiftKey(e){this.shifted=e.shiftKey}trapFocus(){var e;const a=null===(e=this.el)||void 0===e?void 0:e.shadowRoot.querySelector("va-crisis-line-modal").shadowRoot.querySelector("va-modal"),t=null==a?void 0:a.getAttribute("visible");if(null!==t&&"false"!==t){let e;const t=this.shifted?".last-focusable-child":".va-modal-close";e=this.shifted?null==a?void 0:a.querySelector(t):null==a?void 0:a.shadowRoot.querySelector(t),null==e||e.focus()}}render(){const{header:e,subheader:a,enableHeadings:t}=this;return h(Host,{key:"247293dceda2d1afdbf24a3c2eb82204949613c9",role:"banner"},h("va-official-gov-banner",{key:"b3f809f861d4a3f45443c7d3cb7c217356b0366d"}),h("va-crisis-line-modal",{key:"764bbbec041d349bbc3e9874244320a8144d4d03"}),h("div",{key:"acd4c4458e9fcd28e6df6a040df8b0c77b054dbf",onFocusin:()=>this.trapFocus(),class:"va-header"},h("a",{key:"765a6b8c5e134ad0a808284b92892e7ea6347a17",href:"/",title:"Go to VA.gov",class:"va-logo-link"},h("img",{key:"7d2e3be2528a6cc2ba087f90d49d7af51f03c6a6",class:"va-logo",src:vaSealSvg,alt:"VA logo and Seal, U.S. Department of Veterans Affairs"})),h("div",{key:"37166b0bd5a5e66a02a3bb0b1d0c9a2eef72e550",class:"header-container"},t?h("h1",null,e):h("div",{class:"header"},e),a&&(t?h("h2",null,a):h("div",{class:"subheader"},a)))))}get el(){return this}static get style(){return VaHeaderMinimalStyle0}},[1,"va-header-minimal",{header:[1],subheader:[1],enableHeadings:[4,"enable-headings"],shifted:[32]},[[8,"keydown","trackShiftKey"]]]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-header-minimal","va-button","va-crisis-line-modal","va-icon","va-modal","va-official-gov-banner","va-telephone"].forEach(e=>{switch(e){case"va-header-minimal":customElements.get(e)||customElements.define(e,VaHeaderMinimal$1);break;case"va-button":customElements.get(e)||defineCustomElement$7();break;case"va-crisis-line-modal":customElements.get(e)||defineCustomElement$6();break;case"va-icon":customElements.get(e)||defineCustomElement$5();break;case"va-modal":customElements.get(e)||defineCustomElement$4();break;case"va-official-gov-banner":customElements.get(e)||defineCustomElement$3();break;case"va-telephone":customElements.get(e)||defineCustomElement$2()}})}const VaHeaderMinimal=VaHeaderMinimal$1,defineCustomElement=defineCustomElement$1;export{VaHeaderMinimal,defineCustomElement};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{V as VaIcon$1,d as defineCustomElement$1}from"./
|
|
1
|
+
import{V as VaIcon$1,d as defineCustomElement$1}from"./va-icon2.js";const VaIcon=VaIcon$1,defineCustomElement=defineCustomElement$1;export{VaIcon,defineCustomElement};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{c as consoleDevError}from"./utils.js";function initIconSpriteLocation(){const i="__VA_ICON_SPRITE_LOCATION__";globalThis.setVaIconSpriteLocation=e=>{globalThis[i]=e},globalThis.getVaIconSpriteLocation=()=>globalThis[i]||"/img/sprite.svg"}const vaIconCss=".usa-icon{display:inline-block;fill:currentColor;height:1em;position:relative;width:1em}.usa-icon--size-3{height:1.5rem;width:1.5rem}.usa-icon--size-4{height:2rem;width:2rem}.usa-icon--size-5{height:2.5rem;width:2.5rem}.usa-icon--size-6{height:3rem;width:3rem}.usa-icon--size-7{height:3.5rem;width:3.5rem}.usa-icon--size-8{height:4rem;width:4rem}.usa-icon--size-9{height:4.5rem;width:4.5rem}:host{display:inline-block;line-height:0;vertical-align:bottom}",VaIconStyle0=vaIconCss,VaIcon=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.fallbackSpriteLocation="/img/sprite.svg",this.icon=void 0,this.spriteLocation=void 0,this.size=void 0,this.srtext=void 0}getSize(){return this.size&&![3,4,5,6,7,8,9].includes(this.size)?(consoleDevError("Size must be an integer between 3 and 9, inclusive."),null):this.size}validateSpriteLocation(i){let e=this.fallbackSpriteLocation,t=`Invalid SVG sprite path provided to <va-icon>: ${i}`;try{const o=new URL(i,window.location.origin);return o.origin===window.location.origin&&o.pathname.endsWith(".svg")&&!i.includes("..")?e=o.pathname:consoleDevError(t),e}catch(i){return consoleDevError(t),e}}componentWillLoad(){globalThis.getVaIconSpriteLocation||initIconSpriteLocation()}render(){const{icon:i,srtext:e,spriteLocation:t}=this,o=this.getSize(),n=classnames({"usa-icon":!0,[`usa-icon--size-${o}`]:!!o}),s=this.validateSpriteLocation(t||globalThis.getVaIconSpriteLocation())+`#${i}`;return h(Host,{key:"1dce98b22837741699aa01d61bb34c807373031d"},h("svg",{key:"80fcffaa8c744404427e40c01053d4b5f870386f",class:n,"aria-labelledby":e?"icon-title":null,"aria-hidden":e?null:"true",focusable:"false",role:"img"},e&&h("title",{key:"03f9f60081aa755a56b783fd5a4a5fd2b81a988d",id:"icon-title"},e),h("use",{key:"933f896066edb3c2d57d28bcdbc1208846c24249",href:s})))}static get assetsDirs(){return["../img"]}static get style(){return VaIconStyle0}},[1,"va-icon",{icon:[1],spriteLocation:[1,"sprite-location"],size:[2],srtext:[1]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["va-icon"].forEach(i=>{"va-icon"===i&&(customElements.get(i)||customElements.define(i,VaIcon))})}export{VaIcon as V,defineCustomElement as d,initIconSpriteLocation as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
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{font-size:1rem}:host div{display:inline-block}:host div div.inner-div{border-right:1px solid var(--vads-color-base-light);padding-right:var(--units-1);margin-right:var(--units-1)}:host div a.is-current-lang{font-weight:var(--font-weight-bold);color:var(--vads-color-black);text-decoration:none;padding-top:var(--units-1p5);padding-bottom:var(--units-2)}:host div a.is-current-lang:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}: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;padding-top:var(--units-1p5);padding-bottom:var(--units-2)}",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,a){this.routerLinks&&(e.preventDefault(),window.history.replaceState(null,null,this.getUrl(t)),this.language=t),this.vaLanguageToggle.emit({language:t});const n={componentName:"va-language-toggle",action:"linkClick",details:{"pipe-delimited-list-header":t,label:a}};this.componentLibraryAnalytics.emit(n)}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:"dd90defc5bbc931323a23121ff83dd5810579f4a"},h("div",{key:"06fb66230bec1138ea397b99cc78aa581354d022",role:"group","aria-label":"Language selection"},t.map(({href:a,lang:n,label:s},l)=>{const o=classnames({"is-current-lang":n===e}),i=classnames({"inner-div":l<t.length-1});return h("div",{class:i},n===e?h("a",{class:o,href:a,hrefLang:n,onClick:e=>this.handleToggle(e,n,s),"aria-current":"language"},s):h("va-link",{class:o,href:a,language:n,onClick:e=>this.handleToggle(e,n,s),text:s,disableAnalytics:!0}))})))}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{
|
|
1
|
+
import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{i as isMessageSet}from"./utils.js";import{d as defineCustomElement$2}from"./va-icon2.js";const vaLinkActionCss="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,a.va-sidenav-submenu__link:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px;z-index:2}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)}.sr-only{border:0;clip:rect(0, 0, 0, 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute !important;width:1px;word-wrap:normal !important}:host{display:-ms-inline-flexbox;display:inline-flex}:host a{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:start;align-items:flex-start;cursor:pointer;text-decoration:underline;font-weight:700;font-size:1.06rem;padding:0.5rem 0}:host a:active{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}:host a.va-link--primary:hover,:host a.va-link--primary:active,:host a.va-link--secondary:hover,:host a.va-link--secondary:active{color:var(--vads-color-link) !important}:host a.va-link--reverse{color:var(--vads-color-white);-webkit-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}:host a.va-link--reverse:hover,:host a.va-link--reverse:active{color:var(--vads-color-action-focus-on-light);background-color:transparent}:host a.va-link--reverse va-icon{-webkit-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}:host a.va-link--reverse va-icon:hover,:host a.va-link--reverse va-icon:active{background-color:var(--vads-color-action-focus-on-light)}.link-icon--left{margin-right:8px;vertical-align:baseline;position:relative}.link-icon{border-radius:50%;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;color:white;print-color-adjust:exact;-webkit-print-color-adjust:exact}.va-link--primary va-icon{background-color:var(--vads-color-success-dark)}.va-link--secondary va-icon{background-color:var(--vads-color-primary)}.link-icon--reverse{background-color:var(--vads-color-white);color:var(--vads-color-black)}:host a.va-link--reverse:hover va-icon,:host a.va-link--reverse:active va-icon{background-color:var(--vads-color-action-focus-on-light) !important}.link-text{display:inline-block;vertical-align:top;max-width:calc(100% - 24px);white-space:pre-wrap}:host(.host--primary-entry){width:100%}:host a.va-link--primary-entry{position:relative;display:-ms-inline-flexbox;display:inline-flex;background-color:var(--vads-color-primary);color:var(--vads-color-white);text-decoration:none;padding:15px 15px 15px 45px;margin:0 1.5rem 0 0;-webkit-clip-path:polygon(0 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 0 100%);clip-path:polygon(0 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 0 100%);-webkit-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out;width:95%;line-height:1.4;min-height:24px;max-width:var(--vads-size-line-length-5);}@media (min-width: 768px){:host a.va-link--primary-entry{width:75%}}:host a.va-link--primary-entry va-icon.link-icon{position:absolute;left:12px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);color:var(--vads-color-primary);background-color:var(--vads-color-white)}:host a.va-link--primary-entry .link-text{font-weight:bold;display:inline-block;vertical-align:middle;text-decoration:underline}:host a.va-link--primary-entry:hover:not(:focus) va-icon.link-icon{background-color:var(--vads-color-action-focus-on-light)}:host a.va-link--primary-entry:hover:not(:focus) .link-text{-webkit-text-decoration-color:var(--vads-color-action-focus-on-light);text-decoration-color:var(--vads-color-action-focus-on-light);color:var(--vads-color-action-focus-on-light)}:host a.va-link--primary-entry:focus,:host a.va-link--primary-entry:active{background-color:var(--vads-color-action-focus-on-light);outline:none;-webkit-transition:none;transition:none}:host a.va-link--primary-entry:focus va-icon.link-icon,:host a.va-link--primary-entry:active va-icon.link-icon{background-color:var(--vads-color-black);color:var(--vads-color-action-focus-on-light)}:host a.va-link--primary-entry:focus .link-text,:host a.va-link--primary-entry:active .link-text{text-decoration:underline;-webkit-text-decoration-color:var(--vads-color-black);text-decoration-color:var(--vads-color-black);color:var(--vads-color-black)}:host a.va-link--primary-entry:focus:hover{background-color:var(--vads-color-action-focus-on-light)}:host a.va-link--primary-entry:focus:hover va-icon.link-icon,:host a.va-link--primary-entry:focus:hover .link-text{text-decoration:underline;-webkit-text-decoration-color:var(--vads-color-black);text-decoration-color:var(--vads-color-black)}",VaLinkActionStyle0=vaLinkActionCss,VaLinkAction$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.handleClick=i=>{if(!this.disableAnalytics){const i={componentName:"va-link-action",action:"click",details:{label:this.text,destination:this.href,origin:window.location.href}};this.componentLibraryAnalytics.emit(i)}},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 i=getComputedStyle(this.linkRef),o=parseFloat(i.lineHeight),e=this.linkRef.clientHeight;this.isSingleLine=e<=o}}render(){const{handleClick:i,href:o,text:e,messageAriaDescribedby:t,type:a,label:n}=this,r=classnames({"host--primary-entry":"primary-entry"===a}),s=classnames({"va-link--reverse":"reverse"===a,"va-link--primary":"primary"===a,"va-link--secondary":"secondary"===a,"va-link--primary-entry":"primary-entry"===a}),l=classnames("link-icon--left","link-icon",{"link-icon--reverse":"reverse"===a});return h(Host,{key:"5c6f5b08362fcffdc0b38bc6465c783bdbc56a9d",class:r},h("a",{key:"e29a4989298edbea1159370602affa87ee8ca4cf",href:o,class:s,"aria-label":n,"aria-describedby":t?"link-description":null,onClick:i,ref:i=>this.linkRef=i},h("va-icon",{key:"1aadb3d565d2ad15af9358f2b87756a66d98dc35",class:l,icon:"chevron_right",size:3}),h("span",{key:"f0198065a6de8d254bf31daefc48a81c72ca3ddd",class:"link-text"},e)),isMessageSet(t)&&h("span",{key:"9030b07e12c0113899bf776bcaa13d02119378d2",id:"link-description",class:"sr-only"},t))}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(i=>{switch(i){case"va-link-action":customElements.get(i)||customElements.define(i,VaLinkAction$1);break;case"va-icon":customElements.get(i)||defineCustomElement$2()}})}const VaLinkAction=VaLinkAction$1,defineCustomElement=defineCustomElement$1;export{VaLinkAction,defineCustomElement};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{V as VaLink$1,d as defineCustomElement$1}from"./
|
|
1
|
+
import{V as VaLink$1,d as defineCustomElement$1}from"./va-link2.js";const VaLink=VaLink$1,defineCustomElement=defineCustomElement$1;export{VaLink,defineCustomElement};
|
|
@@ -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$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,a.va-sidenav-submenu__link:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px;z-index:2}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}:host .link-icon--active-icon-wrapper{white-space:nowrap}.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}@media print{.screen-only{display:none}}',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:a,filetype:t,filename:l,getAbbreviationTitle:r,handleClick:s,href:c,pages:d,text:v,video:u,reverse:b,external:k,iconName:f,iconSize:m,language:p,label:g}=this,y=classnames({"va-link--reverse":b,"link--center":f});if(e)return h(Host,null,h("a",{href:c,class:y,onClick:s,"aria-label":g},v,h("span",{class:"link-icon--active-icon-wrapper"},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:y,onClick:s,"aria-label":g},v)))}if(o||u)return h(Host,null,h("a",{href:c,class:y,"aria-label":g,onClick:s,rel:"noopener",target:"_blank"},h("va-icon",{class:"link-icon--left",icon:o?"youtube":"play_circle"}),v," ",h("dfn",null,o?"YouTube":"on YouTube")));if(n)return h(Host,null,h("a",{href:c,class:y,download:l,"aria-label":g,onClick:s},h("va-icon",{class:"link-icon--left",icon:"calendar_today"}),v));if(a)return h(Host,null,h("a",{href:c,class:y,download:l,"aria-label":g,onClick:s},h("va-icon",{class:"link-icon--left",icon:"file_download"}),v," ",t&&h("dfn",null,"(",h("abbr",{title:r()},t),d&&`, ${d} pages`,")")));if(f)return h(Host,null,h("a",{href:c,class:y,"aria-label":g,onClick:s},h("va-icon",{icon:f,size:m,part:"icon"}),v));if(k)return h(Host,null,h("a",{href:c,rel:"noreferrer",class:y,onClick:s,"aria-label":g,target:"_blank"},v," ",h("span",{class:"screen-only"},"(opens in a new tab)")));const x=p||null;return h(Host,null,h("a",{href:c,class:y,onClick:s,"aria-label":g,part:"anchor",lang:x,hrefLang:x},v))}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{
|
|
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(){var e;this.setFocus&&this.spinner&&this.spinner.focus(),this.loadingStartTime=Date.now();const t=null===(e=this.el)||void 0===e?void 0:e.parentNode;t instanceof Node&&(this.observer=new MutationObserver(e=>{for(const i of e)if("childList"===i.type){const e=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&&e){const e=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}}});t.dispatchEvent(e)}}}),this.observer.observe(t,{childList:!0}))}render(){const{message:e,label:t}=this;let i="loading-indicator";return isChromatic()&&(i+=" chromatic"),h(Host,{key:"1ee7210312e8b1e1e3b3adc262d72d1b4d4cee47","aria-live":"polite"},h("div",{key:"6b74c07687a216f8b3212bb26467b1613f46ba10",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{
|
|
1
|
+
import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{i as isDateSameDay,f as formatDate,a as isDateBefore,b as isDateAfter}from"./date-utils.js";import{g as getHeaderLevel}from"./utils.js";import{d as defineCustomElement$2}from"./va-icon2.js";const vaMaintenanceBannerCss='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,a.va-sidenav-submenu__link:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px;z-index:2}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;border-radius:5px;color:var(--vads-button-color-text-primary-alt-on-light);cursor:pointer;display:inline-block;font-family:var(--font-source-sans);font-size:1rem;font-weight:700;line-height:1;padding:0.625rem 1.25rem;text-align:center;text-decoration:none}.maintenance-banner{border-top:8px solid;background-color:var(--vads-color-base-lightest);position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}.maintenance-banner__content{font-size:1.06rem}.maintenance-banner p{-webkit-margin-before:1em;margin-block-start:1em;-webkit-margin-after:1em;margin-block-end:1em}.maintenance-banner--warning{border-color:var(--vads-color-warning)}.maintenance-banner--error{border-color:var(--vads-color-secondary-dark)}.maintenance-banner__icon{position:absolute;top:18px;left:18px}.maintenance-banner--error .maintenance-banner__icon{color:var(--vads-color-secondary-dark)}.maintenance-banner__title{font-family:var(--font-serif);margin:0 0 8px;font-size:20px}.maintenance-banner__body{padding:16px 56px;position:relative;max-width:1000px;margin:0px auto}.maintenance-banner__close{-ms-flex-item-align:start;align-self:flex-start;color:var(--vads-color-base);margin-top:8px}.maintenance-banner__close:hover{color:var(--vads-color-base)}',VaMaintenanceBannerStyle0=vaMaintenanceBannerCss,VaMaintenanceBanner$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.closeEvent=createEvent(this,"closeEvent",7),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.derivePostContent=(e,n)=>{let a=n.getTime()-e.getTime();const t=Math.floor(a/36e5),i=60*(a/36e5-t),r=`${t>0?t+" hours ":""} ${i>0?i+" minutes":""}`;return isDateSameDay(e,n),h("div",null,h("p",null,h("strong",null,"Date:")," ",formatDate(e,{dateStyle:"full"})),h("p",null,h("strong",null,"Time:")," ",formatDate(e,{hour:"numeric",minute:"numeric",timeZoneName:"short"})),h("p",null,h("strong",null,"Duration:")," ",r))},this.onCloseAlert=()=>{if(this.closeEvent.emit(),window.localStorage.setItem("MAINTENANCE_BANNER",this.bannerId),this.maintenanceBannerEl.remove(),!this.disableAnalytics){const e={componentName:"va-maintenance-banner",action:"close",details:{header:isDateBefore(new Date,new Date(this.maintenanceStartDateTime))?this.upcomingWarnTitle:this.maintenanceTitle,upcomingWarnStartDateTime:this.upcomingWarnStartDateTime,maintenanceStartDateTime:this.maintenanceStartDateTime,maintenanceEndDateTime:this.maintenanceEndDateTime,displayedContent:this.maintenanceBannerContent.innerText}};this.componentLibraryAnalytics.emit(e)}},this.disableAnalytics=!1,this.bannerId=void 0,this.maintenanceStartDateTime=void 0,this.maintenanceEndDateTime=void 0,this.maintenanceTitle=void 0,this.maintenanceTitleHeaderLevel=2,this.upcomingWarnStartDateTime=void 0,this.upcomingWarnTitle=void 0,this.isError=void 0}render(){const{upcomingWarnStartDateTime:e,maintenanceEndDateTime:n,isError:a,maintenanceTitleHeaderLevel:t}=this,i=new Date,r=getHeaderLevel(t);if(isDateBefore(i,new Date(e)))return null;if(isDateAfter(i,new Date(n)))return null;if(window.localStorage.getItem("MAINTENANCE_BANNER")!==this.bannerId){const{upcomingWarnTitle:e,maintenanceStartDateTime:t,maintenanceTitle:o}=this,s=isDateBefore(i,new Date(t))&&!a,c=classnames({"maintenance-banner":!0,"maintenance-banner--warning":s,"maintenance-banner--error":!s});return h(Host,null,h("div",{class:c,ref:e=>this.maintenanceBannerEl=e},h("va-icon",{class:"maintenance-banner__icon",icon:a?"error":"warning",size:4}),h("div",{class:"maintenance-banner__body"},h(r,{class:"maintenance-banner__title"},s?e:o),h("div",{class:"maintenance-banner__content",ref:e=>this.maintenanceBannerContent=e},h("slot",s?{name:"warn-content"}:{name:"maintenance-content"})),h("div",{class:"maintenance-banner__derived-content"},this.derivePostContent(new Date(t),new Date(n)))),h("button",{"aria-label":"Close notification",class:"maintenance-banner__close",onClick:this.onCloseAlert,type:"button"},h("va-icon",{icon:"close",size:4}))))}return null}static get style(){return VaMaintenanceBannerStyle0}},[1,"va-maintenance-banner",{disableAnalytics:[4,"disable-analytics"],bannerId:[1,"banner-id"],maintenanceStartDateTime:[1,"maintenance-start-date-time"],maintenanceEndDateTime:[1,"maintenance-end-date-time"],maintenanceTitle:[1,"maintenance-title"],maintenanceTitleHeaderLevel:[2,"maintenance-title-header-level"],upcomingWarnStartDateTime:[1,"upcoming-warn-start-date-time"],upcomingWarnTitle:[1,"upcoming-warn-title"],isError:[4,"is-error"]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-maintenance-banner","va-icon"].forEach(e=>{switch(e){case"va-maintenance-banner":customElements.get(e)||customElements.define(e,VaMaintenanceBanner$1);break;case"va-icon":customElements.get(e)||defineCustomElement$2()}})}const VaMaintenanceBanner=VaMaintenanceBanner$1,defineCustomElement=defineCustomElement$1;export{VaMaintenanceBanner,defineCustomElement};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as proxyCustomElement,H,d as createEvent,f as forceUpdate,h,F as Fragment,c as Host}from"./p-ef5c0d66.js";import{v as validate,z as zeroPadStart,g as getErrorParameters,m as months}from"./p-70a619e9.js";import{g as getHeaderLevel}from"./p-494b538e.js";import"./p-6a3cf3d7.js";import{c as classnames}from"./p-a5dce9e6.js";import{d as defineCustomElement$4}from"./p-784bed9b.js";import{d as defineCustomElement$3}from"./p-f3a1dcd5.js";import{d as defineCustomElement$2}from"./p-cf580be9.js";import{i as instance}from"./p-a836c3e1.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,a.va-sidenav-submenu__link:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px;z-index:2}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", "Source Sans Pro", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;font-weight:700}h1{margin-top:0;font-size:2.5rem}h2{font-size:2rem}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:1.875rem}h2{font-size:1.5rem}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}@media (max-width: 481px){h1{font-size:1.875rem}h2{font-size:1.5rem}}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}#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=""])),:host(.va-form-group--error){border-left:0.3rem solid var(--vads-color-secondary-dark);padding-left:1.25rem;position:relative}@media screen and (min-width: 1024px){:host([error]:not([error=""])),:host(.va-form-group--error){margin-left:-1.4375rem;}}.usa-error-message{font-size:1.06rem}:host([error]:not([error=""])),:host(.va-form-group--error){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""])[use-forms-pattern=multiple]),:host(.va-form-group--error[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap,:host(.va-form-group--error[use-forms-pattern=multiple]) .input-wrap{border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1024px){:host([error]:not([error=""])),:host(.va-form-group--error){margin-left:-0.9rem}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap,:host(.va-form-group--error[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1023px){:host([error]:not([error=""])[use-forms-pattern=multiple]),:host(.va-form-group--error[use-forms-pattern=multiple]){padding-left:0}}:host{display:block;font-family:var(--font-source-sans);margin-top:24px}legend{-webkit-padding-end:0;padding-inline-end:0;-webkit-padding-start:0;padding-inline-start:0}#error-message{margin-bottom:0}.usa-hint{display:block}slot:not([name])::slotted(*:last-child){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,VaMemorableDate$1=proxyCustomElement(class extends H{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=>{let a;const{currentYear:t,currentMonth:r,currentDay:o}=this,s=Number(t||a),i=Number(r||a),n=Number(o||a);if(validate({component:this,year:s,month:i,day:n,yearTouched:this.yearTouched,monthTouched:this.monthTouched,dayTouched:this.dayTouched,monthSelect:this.monthSelect}),this.error)this.externalValidation&&this.dateBlur.emit(e);else if(this.value=t||r||o?[t,r?zeroPadStart(i):"",o?zeroPadStart(n):""].join("-"):"",this.dateBlur.emit(e),this.enableAnalytics){const e={componentName:"va-memorable-date",action:"blur",details:{label:this.label,year:s,month:i,day:n}};this.componentLibraryAnalytics.emit(e)}},this.handleMonthChange=e=>{const a=e.target;this.currentMonth=a.value,this.handleDateChange(e)},this.handleDayChange=e=>{const a=e.target;this.currentDay=a.value,this.handleDateChange(e)},this.handleYearChange=e=>{const a=e.target;this.currentYear=a.value,this.handleDateChange(e)},this.handleDateChange=e=>{const{currentYear:a,currentMonth:t,currentDay:r}=this;this.value=a||t||r?[a||"",t||"",r||""].join("-"):"",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.removeDateHint=!1,this.externalValidation=!1,this.invalidDay=!1,this.invalidMonth=!1,this.invalidYear=!1,this.enableAnalytics=!1,this.labelHeaderLevel=void 0,this.headerAriaDescribedby=void 0}connectedCallback(){instance.on("languageChanged",()=>{forceUpdate(this.el)})}disconnectedCallback(){instance.off("languageChanged")}componentWillLoad(){this.parseValueProp()}parseValueProp(){const[e,a,t]=(this.value||"").split("-");this.currentYear=e,this.currentMonth=a,this.currentDay=t}handleValueChange(){this.parseValueProp(),this.error=null,this.invalidDay=!1,this.invalidMonth=!1,this.invalidYear=!1}render(){var e;const{required:a,label:t,name:r,hint:o,error:s,handleDateBlur:i,monthSelect:n,useFormsPattern:l,formHeadingLevel:u,formHeading:m,removeDateHint:d,headerAriaDescribedby:p}=this,c=this.externalValidation&&(null===(e=this.el)||void 0===e?void 0:e.getAttribute("error"))||s,{currentYear:f,currentMonth:g,currentDay:b}=this,v=n?instance.t("date-hint-with-select"):instance.t("date-hint"),w=e=>instance.t(e,(e=>{const a=parseInt(f,10),t=parseInt(g,10);return getErrorParameters(e,a,t)})(e)),y=`${l&&m?"form-question":""} ${l?"form-description":""} ${l&&t?"input-label":""}`.trim()||null,x="single"===l||"multiple"===l,M=getHeaderLevel(this.labelHeaderLevel),D=p?"header-message":null;let S=null;if(x){const e=getHeaderLevel(u);S=h(Fragment,null,m&&h(e,{id:"form-question",part:"form-header"},m),h("div",{id:"form-description"},h("slot",{name:"form-description"})))}const C=n?h("div",{class:"usa-form-group usa-form-group--month usa-form-group--select"},h("va-select",{label:instance.t("month"),name:r?`${r}Month`:"Month","aria-labelledby":y,invalid:this.invalidMonth,onVaSelect:this.handleMonthChange,onBlur:this.handleMonthBlur,class:"usa-form-group--month-select",reflectInputError:"month-range"===c,value:g?String(parseInt(g,10)):g,required:a,hideRequiredText:!0,error:this.invalidMonth?w(c):null,showError:!1,messageAriaDescribedby:instance.t("date-hint-month-select")},months&&months.map(e=>h("option",{value:e.value,selected:e.value===parseInt(g,10)},e.label)))):h("div",{class:"usa-form-group usa-form-group--month"},h("va-text-input",{label:instance.t("month"),name:r?`${r}Month`:"Month",maxlength:2,pattern:"[0-9]*","aria-labelledby":y,invalid:this.invalidMonth,value:null==g?void 0:g.toString(),onInput:this.handleMonthChange,onBlur:this.handleMonthBlur,class:"usa-form-group--month-input memorable-date-input",reflectInputError:"month-range"===c,inputmode:"numeric",type:"text",required:a,hideRequiredText:!0,error:this.invalidMonth?w(c):null,"show-input-error":"false",messageAriaDescribedby:instance.t("date-hint-month")})),E=classnames({"usa-legend":!0,"usa-label--error":c}),H=h(Fragment,null,t,"multiple"===l?h("span",{id:"header-message",class:"usa-sr-only"},t):p&&h("span",{id:"header-message",class:"usa-sr-only"},p));return h(Host,{onBlur:i},S,h("div",{class:"input-wrap"},h("fieldset",{class:"usa-form usa-fieldset"},h("legend",{class:E,id:"input-label",part:"legend"},t&&M?h(M,{"aria-describedby":D},H):h(Fragment,null,H),a&&h("span",{class:"usa-label--required"}," ",instance.t("required")),o&&h("div",{class:"usa-hint",id:"hint"},o)),!d&&h("span",{class:"usa-hint",id:"dateHint"},v),h("span",{id:"error-message",role:"alert"},c&&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)})(c)))),h("slot",null),h("div",{class:"usa-memorable-date"},C,h("div",{class:"usa-form-group usa-form-group--day"},h("va-text-input",{label:instance.t("day"),name:r?`${r}Day`:"Day",maxlength:2,pattern:"[0-9]*",invalid:this.invalidDay,value:null==b?void 0:b.toString(),onInput:this.handleDayChange,onBlur:this.handleDayBlur,class:"usa-form-group--day-input memorable-date-input",reflectInputError:"day-range"===c,inputmode:"numeric",type:"text",required:a,hideRequiredText:!0,error:this.invalidDay?w(c):null,"show-input-error":"false",messageAriaDescribedby:instance.t("date-hint-day")})),h("div",{class:"usa-form-group usa-form-group--year"},h("va-text-input",{label:instance.t("year"),name:r?`${r}Year`:"Year",maxlength:4,pattern:"[0-9]*",invalid:this.invalidYear,value:null==f?void 0:f.toString(),onInput:this.handleYearChange,onBlur:this.handleYearBlur,class:"usa-form-group--year-input memorable-date-input",reflectInputError:"year-range"===c,inputmode:"numeric",type:"text",required:a,hideRequiredText:!0,error:this.invalidYear?w(c):null,"show-input-error":"false",messageAriaDescribedby:instance.t("date-hint-year")}))))))}get el(){return this}static get watchers(){return{value:["handleValueChange"]}}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"],removeDateHint:[4,"remove-date-hint"],externalValidation:[4,"external-validation"],invalidDay:[1028,"invalid-day"],invalidMonth:[1028,"invalid-month"],invalidYear:[1028,"invalid-year"],enableAnalytics:[4,"enable-analytics"],labelHeaderLevel:[1,"label-header-level"],headerAriaDescribedby:[1,"header-aria-describedby"]},void 0,{value:["handleValueChange"]}]);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{g as getHeaderLevel}from"./utils.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,a.va-sidenav-submenu__link:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px;z-index:2}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", "Source Sans Pro", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;font-weight:700}h1{margin-top:0;font-size:2.5rem}h2{font-size:2rem}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:1.875rem}h2{font-size:1.5rem}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}@media (max-width: 481px){h1{font-size:1.875rem}h2{font-size:1.5rem}}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}#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=""])),:host(.va-form-group--error){border-left:0.3rem solid var(--vads-color-secondary-dark);padding-left:1.25rem;position:relative}@media screen and (min-width: 1024px){:host([error]:not([error=""])),:host(.va-form-group--error){margin-left:-1.4375rem;}}.usa-error-message{font-size:1.06rem}:host([error]:not([error=""])),:host(.va-form-group--error){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""])[use-forms-pattern=multiple]),:host(.va-form-group--error[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap,:host(.va-form-group--error[use-forms-pattern=multiple]) .input-wrap{border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1024px){:host([error]:not([error=""])),:host(.va-form-group--error){margin-left:-0.9rem}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap,:host(.va-form-group--error[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1023px){:host([error]:not([error=""])[use-forms-pattern=multiple]),:host(.va-form-group--error[use-forms-pattern=multiple]){padding-left:0}}:host{display:block;font-family:var(--font-source-sans);margin-top:24px}legend{-webkit-padding-end:0;padding-inline-end:0;-webkit-padding-start:0;padding-inline-start:0}#error-message{margin-bottom:0}.usa-hint{display:block}slot:not([name])::slotted(*:last-child){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=>{let a;const{currentYear:t,currentMonth:r,currentDay:o}=this,s=Number(t||a),i=Number(r||a),n=Number(o||a);if(validate({component:this,year:s,month:i,day:n,yearTouched:this.yearTouched,monthTouched:this.monthTouched,dayTouched:this.dayTouched,monthSelect:this.monthSelect}),this.error)this.externalValidation&&this.dateBlur.emit(e);else if(this.value=t||r||o?[t,r?zeroPadStart(i):"",o?zeroPadStart(n):""].join("-"):"",this.dateBlur.emit(e),this.enableAnalytics){const e={componentName:"va-memorable-date",action:"blur",details:{label:this.label,year:s,month:i,day:n}};this.componentLibraryAnalytics.emit(e)}},this.handleMonthChange=e=>{const a=e.target;this.currentMonth=a.value,this.handleDateChange(e)},this.handleDayChange=e=>{const a=e.target;this.currentDay=a.value,this.handleDateChange(e)},this.handleYearChange=e=>{const a=e.target;this.currentYear=a.value,this.handleDateChange(e)},this.handleDateChange=e=>{const{currentYear:a,currentMonth:t,currentDay:r}=this;this.value=a||t||r?[a||"",t||"",r||""].join("-"):"",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.removeDateHint=!1,this.externalValidation=!1,this.invalidDay=!1,this.invalidMonth=!1,this.invalidYear=!1,this.enableAnalytics=!1,this.labelHeaderLevel=void 0,this.headerAriaDescribedby=void 0}connectedCallback(){instance.on("languageChanged",()=>{forceUpdate(this.el)})}disconnectedCallback(){instance.off("languageChanged")}componentWillLoad(){this.parseValueProp()}parseValueProp(){const[e,a,t]=(this.value||"").split("-");this.currentYear=e,this.currentMonth=a,this.currentDay=t}handleValueChange(){this.parseValueProp(),this.error=null,this.invalidDay=!1,this.invalidMonth=!1,this.invalidYear=!1}render(){var e;const{required:a,label:t,name:r,hint:o,error:s,handleDateBlur:i,monthSelect:n,useFormsPattern:l,formHeadingLevel:u,formHeading:m,removeDateHint:d,headerAriaDescribedby:p}=this,c=this.externalValidation&&(null===(e=this.el)||void 0===e?void 0:e.getAttribute("error"))||s,{currentYear:f,currentMonth:g,currentDay:b}=this,v=n?instance.t("date-hint-with-select"):instance.t("date-hint"),w=e=>instance.t(e,(e=>{const a=parseInt(f,10),t=parseInt(g,10);return getErrorParameters(e,a,t)})(e)),y=`${l&&m?"form-question":""} ${l?"form-description":""} ${l&&t?"input-label":""}`.trim()||null,x="single"===l||"multiple"===l,M=getHeaderLevel(this.labelHeaderLevel),D=p?"header-message":null;let S=null;if(x){const e=getHeaderLevel(u);S=h(Fragment,null,m&&h(e,{id:"form-question",part:"form-header"},m),h("div",{id:"form-description"},h("slot",{name:"form-description"})))}const C=n?h("div",{class:"usa-form-group usa-form-group--month usa-form-group--select"},h("va-select",{label:instance.t("month"),name:r?`${r}Month`:"Month","aria-labelledby":y,invalid:this.invalidMonth,onVaSelect:this.handleMonthChange,onBlur:this.handleMonthBlur,class:"usa-form-group--month-select",reflectInputError:"month-range"===c,value:g?String(parseInt(g,10)):g,required:a,hideRequiredText:!0,error:this.invalidMonth?w(c):null,showError:!1,messageAriaDescribedby:instance.t("date-hint-month-select")},months&&months.map(e=>h("option",{value:e.value,selected:e.value===parseInt(g,10)},e.label)))):h("div",{class:"usa-form-group usa-form-group--month"},h("va-text-input",{label:instance.t("month"),name:r?`${r}Month`:"Month",maxlength:2,pattern:"[0-9]*","aria-labelledby":y,invalid:this.invalidMonth,value:null==g?void 0:g.toString(),onInput:this.handleMonthChange,onBlur:this.handleMonthBlur,class:"usa-form-group--month-input memorable-date-input",reflectInputError:"month-range"===c,inputmode:"numeric",type:"text",required:a,hideRequiredText:!0,error:this.invalidMonth?w(c):null,"show-input-error":"false",messageAriaDescribedby:instance.t("date-hint-month")})),E=classnames({"usa-legend":!0,"usa-label--error":c}),H=h(Fragment,null,t,"multiple"===l?h("span",{id:"header-message",class:"usa-sr-only"},t):p&&h("span",{id:"header-message",class:"usa-sr-only"},p));return h(Host,{onBlur:i},S,h("div",{class:"input-wrap"},h("fieldset",{class:"usa-form usa-fieldset"},h("legend",{class:E,id:"input-label",part:"legend"},t&&M?h(M,{"aria-describedby":D},H):h(Fragment,null,H),a&&h("span",{class:"usa-label--required"}," ",instance.t("required")),o&&h("div",{class:"usa-hint",id:"hint"},o)),!d&&h("span",{class:"usa-hint",id:"dateHint"},v),h("span",{id:"error-message",role:"alert"},c&&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)})(c)))),h("slot",null),h("div",{class:"usa-memorable-date"},C,h("div",{class:"usa-form-group usa-form-group--day"},h("va-text-input",{label:instance.t("day"),name:r?`${r}Day`:"Day",maxlength:2,pattern:"[0-9]*",invalid:this.invalidDay,value:null==b?void 0:b.toString(),onInput:this.handleDayChange,onBlur:this.handleDayBlur,class:"usa-form-group--day-input memorable-date-input",reflectInputError:"day-range"===c,inputmode:"numeric",type:"text",required:a,hideRequiredText:!0,error:this.invalidDay?w(c):null,"show-input-error":"false",messageAriaDescribedby:instance.t("date-hint-day")})),h("div",{class:"usa-form-group usa-form-group--year"},h("va-text-input",{label:instance.t("year"),name:r?`${r}Year`:"Year",maxlength:4,pattern:"[0-9]*",invalid:this.invalidYear,value:null==f?void 0:f.toString(),onInput:this.handleYearChange,onBlur:this.handleYearBlur,class:"usa-form-group--year-input memorable-date-input",reflectInputError:"year-range"===c,inputmode:"numeric",type:"text",required:a,hideRequiredText:!0,error:this.invalidYear?w(c):null,"show-input-error":"false",messageAriaDescribedby:instance.t("date-hint-year")}))))))}get el(){return this}static get watchers(){return{value:["handleValueChange"]}}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"],removeDateHint:[4,"remove-date-hint"],externalValidation:[4,"external-validation"],invalidDay:[1028,"invalid-day"],invalidMonth:[1028,"invalid-month"],invalidYear:[1028,"invalid-year"],enableAnalytics:[4,"enable-analytics"],labelHeaderLevel:[1,"label-header-level"],headerAriaDescribedby:[1,"header-aria-describedby"]},void 0,{value:["handleValueChange"]}]);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};
|