@department-of-veterans-affairs/component-library 50.4.0 → 51.0.0
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/0.app.bundle.js +1 -1
- package/dist/141.app.bundle.js +1 -1
- package/dist/1822.app.bundle.js +1 -1
- package/dist/1966.app.bundle.js +1 -1
- package/dist/2205.app.bundle.js +1 -1
- package/dist/2236.app.bundle.js +1 -1
- package/dist/2482.app.bundle.js +1 -1
- package/dist/251.app.bundle.js +1 -1
- package/dist/2986.app.bundle.js +1 -1
- package/dist/323.app.bundle.js +1 -1
- package/dist/3305.app.bundle.js +2 -0
- package/dist/3397.app.bundle.js +1 -1
- package/dist/3589.app.bundle.js +1 -1
- package/dist/4351.app.bundle.js +1 -1
- package/dist/4400.app.bundle.js +1 -1
- package/dist/4432.app.bundle.js +1 -1
- package/dist/4475.app.bundle.js +1 -1
- package/dist/4780.app.bundle.js +1 -1
- package/dist/5119.app.bundle.js +1 -1
- package/dist/5663.app.bundle.js +1 -1
- package/dist/5689.app.bundle.js +1 -1
- package/dist/5845.app.bundle.js +1 -1
- package/dist/5990.app.bundle.js +1 -1
- package/dist/6498.app.bundle.js +1 -1
- package/dist/6555.app.bundle.js +1 -1
- package/dist/6650.app.bundle.js +1 -1
- package/dist/6718.app.bundle.js +1 -1
- package/dist/6832.app.bundle.js +1 -1
- package/dist/7166.app.bundle.js +1 -1
- package/dist/7307.app.bundle.js +1 -1
- package/dist/7372.app.bundle.js +1 -1
- package/dist/7481.app.bundle.js +1 -1
- package/dist/7495.app.bundle.js +1 -1
- package/dist/7508.app.bundle.js +1 -0
- package/dist/7734.app.bundle.js +1 -1
- package/dist/8255.app.bundle.js +2 -0
- package/dist/8255.app.bundle.js.LICENSE.txt +5 -0
- package/dist/8463.app.bundle.js +1 -1
- package/dist/8913.app.bundle.js +1 -1
- package/dist/9186.app.bundle.js +1 -1
- package/dist/9474.app.bundle.js +1 -1
- package/dist/9496.app.bundle.js +1 -1
- package/dist/9851.app.bundle.js +1 -1
- package/dist/app.bundle.js +1 -1
- package/dist/components/index.d.ts +4 -2
- package/dist/components/index.js +1 -1
- package/dist/components/types/components.d.ts +253 -118
- package/dist/components/utils.js +1 -1
- package/dist/components/va-accordion-item2.js +1 -1
- package/dist/components/va-additional-info.js +1 -1
- package/dist/components/va-button-segmented.d.ts +11 -0
- package/dist/components/va-button-segmented.js +1 -0
- package/dist/components/va-card2.js +1 -1
- package/dist/components/va-checkbox-group2.js +1 -1
- package/dist/components/va-checkbox2.js +1 -1
- package/dist/components/va-combo-box2.js +4 -4
- package/dist/components/va-crisis-line-modal2.js +1 -1
- package/dist/components/va-file-input-multiple.js +1 -1
- package/dist/components/va-file-input2.js +1 -1
- package/dist/components/va-header-minimal.js +1 -1
- package/dist/components/va-icon2.js +1 -1
- package/dist/components/va-language-toggle.js +1 -1
- package/dist/components/va-link-action.js +1 -1
- package/dist/components/va-link2.js +1 -1
- package/dist/components/va-loading-indicator.js +1 -1
- package/dist/components/va-minimal-footer.js +1 -1
- package/dist/components/va-need-help.js +1 -1
- package/dist/components/va-official-gov-banner2.js +1 -1
- package/dist/components/va-omb-info.js +1 -1
- package/dist/components/va-privacy-agreement.js +1 -1
- package/dist/components/va-process-list-item.js +1 -1
- package/dist/components/va-process-list.js +1 -1
- package/dist/components/va-progress-bar2.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-select2.js +1 -1
- package/dist/components/va-statement-of-truth.js +1 -1
- package/dist/components/va-summary-box.js +1 -1
- package/dist/components/va-table-inner2.js +1 -1
- package/dist/components/va-table-row.js +1 -1
- package/dist/components/va-table.js +1 -1
- package/dist/components/{va-input-telephone.d.ts → va-telephone-input.d.ts} +4 -4
- package/dist/components/va-telephone-input.js +1 -0
- package/dist/components/va-telephone2.js +1 -1
- package/dist/components/va-text-input2.js +1 -1
- package/dist/components/va-textarea.js +1 -1
- package/dist/main.css +1 -1
- package/dist/react-bindings/index.d.ts +2 -1
- package/dist/react-bindings/index.js +1 -1
- package/dist/react-bindings/index.js.map +1 -1
- package/dist/react-bindings/index.ts +2 -1
- package/package.json +2 -2
- package/dist/4775.app.bundle.js +0 -2
- package/dist/7373.app.bundle.js +0 -1
- package/dist/components/va-input-telephone.js +0 -1
- /package/dist/{4775.app.bundle.js.LICENSE.txt → 3305.app.bundle.js.LICENSE.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import{C as CONTACTS}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";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{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}.va-crisis-line-container{position:relative;margin:auto;background-color:var(--vads-color-secondary-dark)}@media (min-width: 1008px){.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: 1008px){button.va-crisis-line:hover .va-crisis-line-icon,button.va-crisis-line:active .va-crisis-line-icon{background-color:#b51d09}}@media (min-width: 1008px){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: 1008px){.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: 1008px){.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 extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.isOpen=!1,this.shifted=!1}setVisible(){this.isOpen=!0}setNotVisible(){this.isOpen=!1}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"),a=null==i?void 0:i.getAttribute("visible");if(null!==a&&"false"!==a){let e;const a=this.shifted?".last-focusable-child":'[role="document"]';e=this.shifted?null==i?void 0:i.querySelector(a):null==i?void 0:i.shadowRoot.querySelector(a),null==e||e.focus()}}render(){return h(Host,{key:"36f879c01d0b6a74e940e7e469f73452e4297563"},h("div",{key:"f12f3e781c1a41f9aeb1814854b47d4637262f39",class:"va-crisis-line-container"},h("button",{key:"e5fff59bc49108aad42124c8c6cb3c6767bec7cb",onClick:()=>this.setVisible(),onFocusin:()=>this.trapFocus(),"data-show":"#modal-crisisline",class:"va-crisis-line va-overlay-trigger",part:"button"},h("div",{key:"091b036014a9099390d6835ae85991bb6d3e361c",class:"va-crisis-line-inner"},h("span",{key:"eb9a6adfaf6445f3f82a33a2fb66454e7c165112",class:"va-crisis-line-icon","aria-hidden":"true"}),h("span",{key:"dc1c49e9fb993d9d72a77632a93235749216adbf",class:"va-crisis-line-text"},"Talk to the ",h("strong",{key:"cf35186666f42ce728e915c4ad99a3206b75abc4"},"Veterans Crisis Line")," now"),h("va-icon",{key:"1e7416c30c47f0e99c8d4a4491759f8dc475d87c",class:"va-icon__right-arrow",icon:"navigate_next",size:3})))),h("va-modal",{key:"23149ce5f7ee422f72ce58e68510eee32b39217f",modalTitle:"We’re here anytime, day or night – 24/7",onPrimaryButtonClick:()=>this.setNotVisible(),onCloseEvent:()=>this.setNotVisible(),visible:this.isOpen,large:!0},h("p",{key:"95a7a779092359eb2ee4d551ff819dea18a398a5"},"If you are a Veteran in crisis or concerned about one, connect with our caring, qualified responders for confidential help. Many of them are Veterans themselves."),h("ul",{key:"3255b05fff6debc9ab6d29b19b25e25f1c32a890",class:"va-crisis-panel-list"},h("li",{key:"d768def20402342f41c8d9cd8702bc009cc1fd6f"},h("va-icon",{key:"4e5dfdae2ea6baa6a891c65243feac4f61ebb0e4",class:"va-clm__icon",icon:"phone",size:3}),h("span",{key:"b221a37645003deee45c436bc56f5e1464a3cdb9"},"Call"," ",h("strong",{key:"033edd4a02fda19531e0e303b36a879685c84ab6"},h("va-telephone",{key:"54ef398bd29f270fc9ae19d82eff594a7d4641d3",contact:"988"})," and select 1"))),h("li",{key:"c7079191f92efa3e3ed989acd02ba7171b68da9f"},h("va-icon",{key:"06320970bd797531a7c8903b1fdc0d4f5efdf951",icon:"phone_iphone",class:"va-clm__icon",size:3}),h("span",{key:"95494da98e0f35291bd1c632fef9011b236b28a2"},"Text ",h("strong",{key:"c0fdd2729ae49cb70b1248516a772c3b97bdd441"},h("va-telephone",{key:"d5ea7dd5b47660beac9eaf202b47ab4305827f6a",sms:!0,contact:"838255"})))),h("li",{key:"f2dca76ec54dad33c4a58a9ada35a6c4bd5df20a"},h("va-icon",{key:"d27d8527489fdbdb57bb92ac69af943866c5d999",icon:"chat",class:"va-clm__icon",size:3}),h("a",{key:"1354c19be43173ccb7eb3e7269506d024daad9ca",class:"no-external-icon",href:"https://www.veteranscrisisline.net/get-help-now/chat/"},"Start a confidential chat")),h("li",{key:"2e545c2469ef2af443feacfb65c9a38376a94d3c"},h("va-icon",{key:"b862ccf452347399daefe5696a80ab3b113f21d7",icon:"tty",class:"va-clm__icon",size:3}),h("p",{key:"ce540a5741a0a654a5c9a2a62cf17544c0fb683e"},"Call TTY if you have hearing loss"," ",h("strong",{key:"7b78d78695b79b2e9576f050414b675db5f75158"},h("va-telephone",{key:"e2e1c38f0f2e98156b4041f594baadccb9af59d9",tty:!0,contact:CONTACTS.CRISIS_TTY}))))),h("p",{key:"601993e4047dea6e42e72080260cea29677e7951"},"Get more resources at"," ",h("a",{key:"a9cc66fcaad9e6340784c181ab95e4551222c3cd",class:"no-external-icon",href:"https://www.veteranscrisisline.net/"},"VeteransCrisisLine.net"))))}get el(){return this}static get style(){return VaCrisisLineModalStyle0}},[1,"va-crisis-line-modal",{isOpen:[32],shifted:[32]},[[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()}}))}export{VACrisisLineModal as V,defineCustomElement as d};
|
|
1
|
+
import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import{C as CONTACTS}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";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{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}.va-crisis-line-container{position:relative;margin:auto;background-color:var(--vads-color-secondary-dark)}@media (min-width: 1008px){.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: 1008px){button.va-crisis-line:hover .va-crisis-line-icon,button.va-crisis-line:active .va-crisis-line-icon{background-color:#b51d09}}@media (min-width: 1008px){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: 1008px){.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: 1008px){.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 extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.isOpen=!1,this.shifted=!1}setVisible(){this.isOpen=!0}setNotVisible(){this.isOpen=!1}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"),a=null==i?void 0:i.getAttribute("visible");if(null!==a&&"false"!==a){let e;const a=this.shifted?".last-focusable-child":'[role="document"]';e=this.shifted?null==i?void 0:i.querySelector(a):null==i?void 0:i.shadowRoot.querySelector(a),null==e||e.focus()}}render(){return h(Host,{key:"9abdb650f83b1ebaf8d6c47897caa5d20fd13e06"},h("div",{key:"96618055c7c7a11d1180c5870eae1298d7c67867",class:"va-crisis-line-container"},h("button",{key:"ca66ad606aa88a5837686eafbdbdaa74d3b5f4a1",onClick:()=>this.setVisible(),onFocusin:()=>this.trapFocus(),"data-show":"#modal-crisisline",class:"va-crisis-line va-overlay-trigger",part:"button"},h("div",{key:"8f07f3ff5edd14ec01a216c8cf1849e21642bbef",class:"va-crisis-line-inner"},h("span",{key:"ff2cf54c5ff807679e0820b4607a810f77fab3cd",class:"va-crisis-line-icon","aria-hidden":"true"}),h("span",{key:"01ccfb67535e3fe4fd0873d3d86f7b1b9340ba4b",class:"va-crisis-line-text"},"Talk to the ",h("strong",{key:"240691554fa7b48ba9510382dc3f1214cc633469"},"Veterans Crisis Line")," now"),h("va-icon",{key:"657c49341568c2c6cecfa0c57bce6d216fc3b3a4",class:"va-icon__right-arrow",icon:"navigate_next",size:3})))),h("va-modal",{key:"8a8646b05be73d32edb10a951606ed377bb6f3df",modalTitle:"We’re here anytime, day or night – 24/7",onPrimaryButtonClick:()=>this.setNotVisible(),onCloseEvent:()=>this.setNotVisible(),visible:this.isOpen,large:!0},h("p",{key:"0aa6c308c9e92d3221b8776e47a20854936caac6"},"If you are a Veteran in crisis or concerned about one, connect with our caring, qualified responders for confidential help. Many of them are Veterans themselves."),h("ul",{key:"895c26d0e826ae7953704c7eefbae3ad6bc329e8",class:"va-crisis-panel-list"},h("li",{key:"8cf6852edb3a84e5c0fba7c49e2f550971c28b9d"},h("va-icon",{key:"50ae8afa383e9140bd8cd195e518725c01eb1bb0",class:"va-clm__icon",icon:"phone",size:3}),h("span",{key:"183f56dca2957a3bf8a40a7618839fd2b314b776"},"Call"," ",h("strong",{key:"a36c35b6920e48ae4ce464362651a8a3a07a28c4"},h("va-telephone",{key:"d262dab146969d6e01966f539875dec8e28ef3b7",contact:"988"})," and select 1"))),h("li",{key:"fb001af22341fbdda8827fba41fe024f264a52f6"},h("va-icon",{key:"4d922bac42139ac20f1fc1417ed62064d20e719a",icon:"phone_iphone",class:"va-clm__icon",size:3}),h("span",{key:"486842b866cee9715eeeafcb19a16919fb71e83f"},"Text ",h("strong",{key:"6a2016562c1279c05606ddd748ba78166720a567"},h("va-telephone",{key:"e6bd065e2d3381254020f612fc3680366e13a6c3",sms:!0,contact:"838255"})))),h("li",{key:"969edac9d2ba76ba55662ad6351845e07864b851"},h("va-icon",{key:"3a5e4a39e56e235913317259ee48c4eea4788b32",icon:"chat",class:"va-clm__icon",size:3}),h("a",{key:"d4722da3256da6da43cd8bd51460491dead644c0",class:"no-external-icon",href:"https://www.veteranscrisisline.net/get-help-now/chat/"},"Start a confidential chat")),h("li",{key:"73f16a72346b8b889b0de617d207875ca022a3c8"},h("va-icon",{key:"6b85e8d63cad91435de0764c2e2e6560152d7a09",icon:"tty",class:"va-clm__icon",size:3}),h("p",{key:"aee5ec33cce7164ce0227c443b2325651d9a48dd"},"Call TTY if you have hearing loss"," ",h("strong",{key:"c901785e83e3ebe67908ebfc7cd205b95b751db9"},h("va-telephone",{key:"2d6a7c2cd00fc660514a1cba9b6014261ff3e10d",tty:!0,contact:CONTACTS.CRISIS_TTY}))))),h("p",{key:"4ba3381cb65d93ee35edbf205fd3e0f86ed31066"},"Get more resources at"," ",h("a",{key:"be70893a771ebdead2aff28b6889257d05668945",class:"no-external-icon",href:"https://www.veteranscrisisline.net/"},"VeteransCrisisLine.net"))))}get el(){return this}static get style(){return VaCrisisLineModalStyle0}},[1,"va-crisis-line-modal",{isOpen:[32],shifted:[32]},[[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()}}))}export{VACrisisLineModal as V,defineCustomElement as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";import"./i18n-setup.js";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{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}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:1.875rem}h3{font-size:1.25rem}h4{font-size:1.0625rem}h5{font-size:0.9375rem}h6{font-size:0.9375rem}@media (max-width: 481px){h1{font-size:30px}h2{font-size:24px}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}@media (max-width: 481px){h1{font-size:30px}h2{font-size:24px}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}:host legend :is(h1,h2,h3,h4,h5,h6),:host label :is(h1,h2,h3,h4,h5,h6){display:inline;margin:0px}:host legend :is(h1,h2,h3,h4,h5),:host label :is(h1,h2,h3,h4,h5){font-family:var(--font-serif)}:host h1+*,:host h2+*,:host h3+*,:host h4+*,:host h5+*,:host h6+*{margin-top:unset}:host #form-question{margin-bottom:1rem}@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=""])){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""])[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1008px){:host([error]:not([error=""])){margin-left:-0.9rem}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1008px){:host([error]:not([error=""])[use-forms-pattern=multiple]){padding-left:0}}[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 .separator{border:0;border-top:1px solid var(--vads-color-base-lighter);margin:0}: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: 1008px){: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=""])){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""])[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1008px){:host([error]:not([error=""])){margin-left:-0.9rem}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1008px){:host([error]:not([error=""])[use-forms-pattern=multiple]){padding-left:0}}:host.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: 1008px){: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.additionalFileUploadMessage=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 o=t?h("span",{class:"required"}," ",instance.t("required")):null;return i&&i>=1&&i<=6?h("div",{class:"label-header"},h(`h${i}`,{htmlFor:"fileInputField",part:"label",class:"label-header-tag"},e,o)):h("div",{class:"label-header"},h("span",{part:"label",class:"usa-label"},e),o)},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.encrypted=[],this.hint=void 0,this.enableAnalytics=!1,this.headerSize=void 0,this.value=void 0,this.readOnly=!1,this.slotFieldIndexes=null,this.files=[{key:0,file:null,content:null}],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}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)))}handleChange(e,t,i){const o=e.detail.files[0];let s,r,a;if(o){const e=this.findFileByKey(t);e.file?(r="FILE_UPDATED",a=o,e.file=o):(r="FILE_ADDED",a=o,e.file=o,e.content=this.getAdditionalContent(),this.fileKeyCounter++,this.files.push({file:null,key:this.fileKeyCounter,content:null})),s=this.buildFilesArray(this.files,!1,this.findIndexByKey(t))}else{r="FILE_REMOVED",a=this.files[i].file,this.files.splice(i,1);const e=this.el.shadowRoot.querySelector("#statusMessage");e.textContent="",setTimeout((()=>{e.textContent="File removed."}),1e3),s=this.buildFilesArray(this.files,!0)}const n={action:r,file:a,state:s};this.vaMultipleChange.emit(n),this.files=Array.of(...this.files)}handlePasswordChange(e,t){const i=this.findFileByKey(t);i.password=e.detail.password;const o=this.buildFilesArray(this.files,!1,this.findIndexByKey(t)),s={action:"PASSWORD_UPDATE",file:i.file,state:o};this.vaMultipleChange.emit(s)}buildFilesArray(e,t,i){let o=e.filter((e=>!!e.file)).map((e=>({file:e.file,changed:!1,password:e.password})));return!t&&o[i]&&(o[i].changed=!0),o}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:o,files:s,name:r,accept:a,errors:n,encrypted:l,enableAnalytics:d,readOnly:m}=this,f=this.isEmpty()?"":"outer-wrap",p=this.hasErrors()?"has-error":"";return h(Host,{key:"49b4084c657a5eccf588a0e7f3d04e64076d6b27",class:p},e&&!m&&this.renderLabelOrHeader(e,t,i),o&&!m&&h("div",{key:"03da602a3609d3a806c767ebba7624fcf15efe23",class:"usa-hint",id:"input-hint-message"},o),h("div",{key:"020c010cf091c9a0eb5e08f10d71949375584e47",class:f},h("div",{key:"03a31cae8be123db1e1853b5a34107838bebe76d",class:"usa-sr-only","aria-live":"polite",id:"statusMessage"}),!this.isEmpty()&&h("div",{key:"a3a62f0134fdc3ad17a8f48538cdc2313ce1ae9d",class:"selected-files-label"},m?"Files you uploaded":"Selected files"),s.map(((i,s)=>h("va-file-input",Object.assign({key:i.key,headless:!0,label:e,hint:o,name:`${r}-${i.key}`,accept:a,required:t},s>0?{uploadMessage:this.additionalFileUploadMessage}:{},{error:n[s],encrypted:l[s],onVaChange:e=>this.handleChange(e,i.key,s),onVaPasswordChange:e=>this.handlePasswordChange(e,i.key),"enable-analytics":d,value:i.file,readOnly:m,class:i.file?"has-file":"no-file"}))))),h("slot",{key:"d05bf27eab649268fcf501b7e011882561fa4c50"}))}get el(){return this}static get style(){return VaFileInputMultipleStyle0}},[1,"va-file-input-multiple",{label:[1],name:[1],required:[4],accept:[1],errors:[16],encrypted:[16],hint:[1],enableAnalytics:[4,"enable-analytics"],headerSize:[2,"header-size"],value:[16],readOnly:[4,"read-only"],slotFieldIndexes:[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"./i18n-setup.js";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{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}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:1.875rem}h3{font-size:1.25rem}h4{font-size:1.0625rem}h5{font-size:0.9375rem}h6{font-size:0.9375rem}@media (max-width: 481px){h1{font-size:30px}h2{font-size:24px}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}@media (max-width: 481px){h1{font-size:30px}h2{font-size:24px}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}:host legend :is(h1,h2,h3,h4,h5,h6),:host label :is(h1,h2,h3,h4,h5,h6){display:inline;margin:0px}:host legend :is(h1,h2,h3,h4,h5),:host label :is(h1,h2,h3,h4,h5){font-family:var(--font-serif)}:host h1+*,:host h2+*,:host h3+*,:host h4+*,:host h5+*,:host h6+*{margin-top:unset}:host #form-question{margin-bottom:1rem}@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=""])){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""])[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1008px){:host([error]:not([error=""])){margin-left:-0.9rem}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1008px){:host([error]:not([error=""])[use-forms-pattern=multiple]){padding-left:0}}[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 .separator{border:0;border-top:1px solid var(--vads-color-base-lighter);margin:0}: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: 1008px){: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=""])){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""])[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1008px){:host([error]:not([error=""])){margin-left:-0.9rem}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1008px){:host([error]:not([error=""])[use-forms-pattern=multiple]){padding-left:0}}:host.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: 1008px){: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.additionalFileUploadMessage=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 o=t?h("span",{class:"required"}," ",instance.t("required")):null;return i&&i>=1&&i<=6?h("div",{class:"label-header"},h(`h${i}`,{htmlFor:"fileInputField",part:"label",class:"label-header-tag"},e,o)):h("div",{class:"label-header"},h("span",{part:"label",class:"usa-label"},e),o)},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.encrypted=[],this.hint=void 0,this.enableAnalytics=!1,this.headerSize=void 0,this.value=void 0,this.readOnly=!1,this.slotFieldIndexes=null,this.files=[{key:0,file:null,content:null}],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}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)))}handleChange(e,t,i){const o=e.detail.files[0];let s,r,a;if(o){const e=this.findFileByKey(t);e.file?(r="FILE_UPDATED",a=o,e.file=o):(r="FILE_ADDED",a=o,e.file=o,e.content=this.getAdditionalContent(),this.fileKeyCounter++,this.files.push({file:null,key:this.fileKeyCounter,content:null})),s=this.buildFilesArray(this.files,!1,this.findIndexByKey(t))}else{r="FILE_REMOVED",a=this.files[i].file,this.files.splice(i,1);const e=this.el.shadowRoot.querySelector("#statusMessage");e.textContent="",setTimeout((()=>{e.textContent="File removed."}),1e3),s=this.buildFilesArray(this.files,!0)}const n={action:r,file:a,state:s};this.vaMultipleChange.emit(n),this.files=Array.of(...this.files)}handlePasswordChange(e,t){const i=this.findFileByKey(t);i.password=e.detail.password;const o=this.buildFilesArray(this.files,!1,this.findIndexByKey(t)),s={action:"PASSWORD_UPDATE",file:i.file,state:o};this.vaMultipleChange.emit(s)}buildFilesArray(e,t,i){let o=e.filter((e=>!!e.file)).map((e=>({file:e.file,changed:!1,password:e.password})));return!t&&o[i]&&(o[i].changed=!0),o}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:o,files:s,name:r,accept:a,errors:n,encrypted:l,enableAnalytics:d,readOnly:m}=this,f=this.isEmpty()?"":"outer-wrap",p=this.hasErrors()?"has-error":"";return h(Host,{key:"0156ba46fb8380ea7a1f31a936eed8c07816b05b",class:p},e&&!m&&this.renderLabelOrHeader(e,t,i),o&&!m&&h("div",{key:"74964bef97bbb0efa13429c3828b09b0f4387068",class:"usa-hint",id:"input-hint-message"},o),h("div",{key:"71854dad83b75dd540d8e938a8b16b8f4f822139",class:f},h("div",{key:"d51b60a006dedbd083ddb7bc6605f7b274321cb5",class:"usa-sr-only","aria-live":"polite",id:"statusMessage"}),!this.isEmpty()&&h("div",{key:"dec914be713c5aca6887b071285a82d48124864e",class:"selected-files-label"},m?"Files you uploaded":"Selected files"),s.map(((i,s)=>h("va-file-input",Object.assign({key:i.key,headless:!0,label:e,hint:o,name:`${r}-${i.key}`,accept:a,required:t},s>0?{uploadMessage:this.additionalFileUploadMessage}:{},{error:n[s],encrypted:l[s],onVaChange:e=>this.handleChange(e,i.key,s),onVaPasswordChange:e=>this.handlePasswordChange(e,i.key),"enable-analytics":d,value:i.file,readOnly:m,class:i.file?"has-file":"no-file"}))))),h("slot",{key:"c1265273819fa699a082158a09f854c4a10ceac7"}))}get el(){return this}static get style(){return VaFileInputMultipleStyle0}},[1,"va-file-input-multiple",{label:[1],name:[1],required:[4],accept:[1],errors:[16],encrypted:[16],hint:[1],enableAnalytics:[4,"enable-analytics"],headerSize:[2,"header-size"],value:[16],readOnly:[4,"read-only"],slotFieldIndexes:[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{proxyCustomElement,HTMLElement,createEvent,h,forceUpdate,Host,Fragment}from"@stencil/core/internal/client";import"./i18n-setup.js";import"./contacts.js";import{s as selectOrMatches,S as Sanitizer}from"./utils.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";import{i as instance}from"./i18next.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",o="";1===t.length?o=Sanitizer.escapeHTML(`Selected file <span class="usa-file-input__choose">${n}</span>`):t.length>1&&(n="Change files",o=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=o,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"),o=[];removeOldPreviews(a,i);for(let e=0;e<s.length;e+=1){const t=new FileReader,n=s[e].name;let r;o.push(n),t.onloadstart=function(){r=createUniqueID(makeSafeForID(n)),i.insertAdjacentHTML("afterend",Sanitizer.escapeHTML(`<div class="${PREVIEW_CLASS}" aria-hidden="true">\n <img id="${r}" src="${SPACER_GIF}" alt="" class="${GENERIC_PREVIEW_CLASS_NAME} is-loading"/>${n}\n <div>`))},t.onloadend=function(){const e=a.querySelector(`#${r}`);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,o)},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 o=s.split(","),r=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<o.length;e+=1){const i=o[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(r,t),r.textContent=t.dataset.errormessage||"This is not a valid file type.",r.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"},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{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}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:1.875rem}h3{font-size:1.25rem}h4{font-size:1.0625rem}h5{font-size:0.9375rem}h6{font-size:0.9375rem}@media (max-width: 481px){h1{font-size:30px}h2{font-size:24px}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}@media (max-width: 481px){h1{font-size:30px}h2{font-size:24px}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}:host legend :is(h1,h2,h3,h4,h5,h6),:host label :is(h1,h2,h3,h4,h5,h6){display:inline;margin:0px}:host legend :is(h1,h2,h3,h4,h5),:host label :is(h1,h2,h3,h4,h5){font-family:var(--font-serif)}:host h1+*,:host h2+*,:host h3+*,:host h4+*,:host h5+*,:host h6+*{margin-top:unset}:host #form-question{margin-bottom:1rem}.usa-hint{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=""])){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""])[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1008px){:host([error]:not([error=""])){margin-left:-0.9rem}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1008px){:host([error]:not([error=""])[use-forms-pattern=multiple]){padding-left:0}}[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 .separator{border:0;border-top:1px solid var(--vads-color-base-lighter);margin:0}: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: 1008px){: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.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.uploadStatus="idle",this.chooseFileString="choose from folder",this.dragFileString="Drag a file here or ",this.handleChange=e=>{const t=e.target;t.files&&t.files.length>0&&this.handleFile(t.files[0]),t.value=""},this.handleDrop=e=>{e.preventDefault(),e.stopPropagation();const t=e.dataTransfer.files;t.length>0&&this.handleFile(t[0])},this.handleFile=(e,t=!0)=>{if(this.accept){const t=this.normalizeAcceptProp(this.accept);if(!this.isAcceptedFileType(e.type,t))return this.removeFile(!1),void(this.internalError="This is not a valid file type.")}if(e.size>this.maxFileSize)return this.internalError=`\n We can't upload your file because it's too big. Files must be less than ${this.formatFileSize(this.maxFileSize)}.`,this.fileContents=null,void(this.uploadStatus="idle");this.uploadedFile=null,this.file=e,t&&this.vaChange.emit({files:[this.file]}),this.uploadStatus="success",this.internalError=null,this.generateFileContents(this.file),this.updateStatusMessage(`You have selected the file: ${this.file.name}`),this.el.focus(),this.enableAnalytics&&this.componentLibraryAnalytics.emit({componentName:"va-file-input",action:"change",details:{label:this.label}})},this.removeFile=(e=!0)=>{this.closeModal(),this.uploadStatus="idle",this.internalError=null,e&&this.vaChange.emit({files:[]}),this.file=null,this.uploadedFile=null,this.updateStatusMessage("File removed. No file selected."),this.el.focus()},this.openModal=()=>{this.el.shadowRoot.querySelector("va-modal").setAttribute("status","warning"),this.showModal=!0},this.closeModal=()=>{this.showModal=!1,setTimeout((()=>{this.fileInputRef.focus()}),0)},this.changeFile=()=>{this.fileInputRef&&this.fileInputRef.click()},this.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]}`},this.normalizeAcceptProp=e=>e.split(",").map((e=>(e=e.trim()).startsWith(".")?extensionToMimeType[e]:e)),this.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},this.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))},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.buttonText=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.percentUploaded=null}handleValueChange(e){setTimeout((()=>{this.updateStatusMessage(e)}))}percentHandler(e){e>=100&&this.resetState()}resetState(){this.fileContents=null,this.uploadStatus="idle",this.percentUploaded=null,forceUpdate(this.el)}updateStatusMessage(e){setTimeout((()=>{const t=this.el.shadowRoot.querySelector("#statusMessage");t&&(t.textContent=e)}),1e3)}generateFileContents(e){if(!e)return;const t=new FileReader;this.fileType=e.type,t.onloadend=()=>{this.fileContents=t.result},this.fileType&&("application/pdf"===this.fileType||this.fileType.startsWith("image/"))&&t.readAsDataURL(e)}componentWillRender(){const e=!!this.el.querySelector(":scope > *"),t=!(!this.value&&!this.file||this.readOnly);this.showSeparator=e||t}componentDidLoad(){fileInput.init(this.el)}connectedCallback(){this.el.addEventListener("change",this.handleChange)}disconnectedCallback(){this.el.removeEventListener("change",this.handleChange)}getDefaultUploadMessage(){return h("span",null,this.dragFileString,h("span",{class:"file-input-choose-text"},this.chooseFileString))}handlePasswordChange(e){this.vaPasswordChange.emit({password:e.target.value})}render(){const{label:e,name:t,required:i,accept:a,error:s,hint:n,file:o,uploadStatus:r,dragFileString:l,chooseFileString:d,uploadMessage:c,headerSize:p,fileContents:f,fileType:u,headless:m,value:b,readOnly:g,encrypted:v,statusText:S,uploadedFile:E,percentUploaded:A}=this;b&&!this.file&&this.handleFile(b,!1);const C=this.error||this.internalError,_=`${n?"input-hint-message":""} ${C?"input-error-message":""}`.trim()||null,x=("file-input-target "+(C?"file-input-target-error":"")).trim();let y=h("div",{key:"337b425bd91060370c15e9f57a20175eeb198312",class:"thumbnail-container"},h("svg",{key:"96831fd8198e3c52d036a91cfc593ce2fa33aabe",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"#07648d",width:"40px",height:"40px"},h("path",{key:"eaf74a855880e0cd2f16b01233b2a7b9ae70da5d",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"})));s?y=h("div",{key:"dd586c73f2a756b14d5f824455d46a1d2d52d61d",class:"thumbnail-container"},h("va-icon",{key:"3e3f6da4a9307fefafd45bea2270b73a6c13f84d",icon:"error",size:3,class:"thumbnail-preview thumbnail-error"})):f&&(u.startsWith("image/")?y=h("div",{key:"95d804cdd96a6702ce6414efa6195192a691b486",class:"thumbnail-container","aria-hidden":"true"},h("img",{key:"64e1a72f0b8350c4f16674f79d9ea0c23d98dc44",class:"thumbnail-preview",src:f,alt:"image"})):"application/pdf"===u&&(y=h("div",{key:"4781eec8800de7234c9cac060a6d10df4ba162cf",class:"thumbnail-container","aria-hidden":"true"},h("object",{key:"b8cf2d21c1b27e7041361132ad5ac790f689f849",class:"thumbnail-preview",data:f,type:"application/pdf"}))));let L=m?"headless-selected-files-wrapper":"selected-files-wrapper";const w="usa-hint"+(m?" usa-sr-only":""),T=null!==A&&A<100;let I="file-status-label";return T&&(I=`${I} uploading-status`),h(Host,{key:"016bb5b069cd0886cb57b3a27ddb348d3de192f9",class:{"has-error":!!C}},!g&&h("span",{key:"dcc5c07424fc16d5dd31b2583821b69b11a1df10",class:{"usa-sr-only":!!m}},e&&this.renderLabelOrHeader(e,i,p)),n&&!g&&h("div",{key:"c67eaba61a960f10202f56c43ba2c1b1690618c3",class:w,id:"input-hint-message"},n),h("div",{key:"4bb955f3cef39c2c18b04f2617046f45ded0fc3b",class:"file-input-wrapper",onDrop:this.handleDrop},h("input",{key:"73e27f3d845a7723f5cc4e89bc8cf5c710242adc",id:"fileInputField",class:"file-input","aria-label":`${e}${i?" "+instance.t("required"):""}. ${l}${d}`,style:{visibility:"success"===this.uploadStatus||E?"hidden":"unset"},type:"file",ref:e=>this.fileInputRef=e,name:t,accept:a,"aria-describedby":_,onChange:this.handleChange}),"idle"===r&&!E&&h("div",{key:"515bd5d0743d82448a9becfede71e004c739030c"},h("span",{key:"e4bcaf8197e3b3b11cf529bb8e45ed56cd4d37d5",id:"file-input-error-alert",role:"alert"},C&&h(Fragment,{key:"50b1db1b603495d1646a22c97479ff40b02ebb42"},h("span",{key:"2031b00832fce3b73e7ea5e62f048d9d4cc00db6",class:"usa-sr-only"},instance.t("error")),h("span",{key:"51bee39bd0d885d8e845187adee3aaa0b1247006",class:"usa-error-message"},C))),h("div",{key:"bc547bf28de49b843248c9a0f0139ac5e32e7165",class:"usa-sr-only","aria-live":"polite",id:"statusMessage"}),h("div",{key:"60e6f55592c07ce6c59c687af6361fa72bc8572c",class:x},h("div",{key:"79b65ab1a27ac98eee82ac2057b2af9d1af2b4a4",class:"file-input-box"}),h("div",{key:"61319c94736485ab878600a5534ad8410ca65713",class:"file-input-instructions"},c||this.getDefaultUploadMessage()))),("idle"!==r||E)&&h("div",{key:"bf271c54f69810d29e8f5c54d99e9312922cd94e",class:L},!m&&h("div",{key:"ac71abfab1a50585747d5ba7649b3b0e70a367f1",class:"selected-files-label"},g?"Files you uploaded":"Selected files"),h("div",{key:"6bea68e4bc02c1caa882ea275e06f6675d7ce753",class:"usa-sr-only","aria-live":"polite",id:"statusMessage"}),h("va-card",{key:"56aa2f7e7872365f52e590ea7857057ac67c4331",class:"va-card"},h("div",{key:"e4f49a2ed6d1b4d3da824212e8b8e14c484fc5cb",class:"file-info-section"},y,h("div",{key:"673e512065d7cf58589666b62fbf9cd97cf87581",class:"file-info-group vads-u-line-height--2"},h("span",{key:"b7f87720edf38a64fa0fa06e64f6fc3e8f46acbe",class:"file-label"},o?o.name:E.name),C&&h("span",{key:"6c7627e01436dd7eb11b29aee8abd555eaa74587",id:"input-error-message",role:"alert"},h("span",{key:"524521ef5ab316aebf9f9677a18d80204f970316",class:"usa-sr-only"},instance.t("error")),h("span",{key:"07ef2ae491a0f37f1c093087587a19e8f5756b3a","aria-live":"polite",class:"usa-error-message"},C)),!T&&h("span",{key:"e054e2f18028cf78291f13125008eae5ae399c82",class:"file-size-label"},this.formatFileSize(o?o.size:E.size)),h("span",{key:"f02c4008193536b59e981369bca8b603df9064d3",class:I,"aria-live":"polite"},T?"Uploading...":S))),(o||b||E)&&h("div",{key:"511671ac033652b487ad942ce95e44181e645f7a"},this.showSeparator&&h("hr",{key:"4372398c861195bc9a383ead3c5df9fdd32df1a2",class:"separator"}),v&&h("va-text-input",{key:"41022d25f4ec729a0f41b486227caf5ab4cb34c2",onInput:e=>{this.handlePasswordChange(e)},label:"File password",required:!0}),h("div",{key:"11658bc79739aa4fac1b2879a4b51c88e9217a1e",class:"additional-info-slot"},h("slot",{key:"8c8e65c8db034304bed123515c137e4e316ee284"})),g?null:T?h(Fragment,null,h("va-progress-bar",{percent:A}),h("va-button-icon",{buttonType:"cancel",onClick:this.resetState.bind(this)})):h(Fragment,null,h("div",{class:"file-button-section"},h("va-button-icon",{buttonType:"change-file",onClick:this.changeFile,label:"Change file","aria-label":`change file ${o?o.name:E.name}`}),h("va-button-icon",{buttonType:"delete",onClick:this.openModal,"aria-label":`delete file ${o?o.name:E.name}`,label:"Delete"})),h("va-modal",{modalTitle:"Delete this file?",visible:this.showModal,primaryButtonText:"Yes, remove this",secondaryButtonText:"No, keep this",onCloseEvent:this.closeModal,onPrimaryButtonClick:()=>this.removeFile(!0),onSecondaryButtonClick:this.closeModal},"We'll remove the uploaded document"," ",h("span",{class:"file-label"},o?o.name:E.name))))))))}get el(){return this}static get watchers(){return{statusText:["handleValueChange"],percentUploaded:["percentHandler"]}}static get style(){return VaFileInputStyle0}},[1,"va-file-input",{label:[1],name:[1],buttonText:[1,"button-text"],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:[16],maxFileSize:[2,"max-file-size"],percentUploaded:[1026,"percent-uploaded"],file:[32],fileContents:[32],internalError:[32],showModal:[32],showSeparator:[32]},void 0,{statusText:["handleValueChange"],percentUploaded:["percentHandler"]}]);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
|
+
import{proxyCustomElement,HTMLElement,createEvent,h,forceUpdate,Host,Fragment}from"@stencil/core/internal/client";import"./i18n-setup.js";import"./contacts.js";import{s as selectOrMatches,S as Sanitizer}from"./utils.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";import{i as instance}from"./i18next.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",o="";1===t.length?o=Sanitizer.escapeHTML(`Selected file <span class="usa-file-input__choose">${n}</span>`):t.length>1&&(n="Change files",o=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=o,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"),o=[];removeOldPreviews(a,i);for(let e=0;e<s.length;e+=1){const t=new FileReader,n=s[e].name;let r;o.push(n),t.onloadstart=function(){r=createUniqueID(makeSafeForID(n)),i.insertAdjacentHTML("afterend",Sanitizer.escapeHTML(`<div class="${PREVIEW_CLASS}" aria-hidden="true">\n <img id="${r}" src="${SPACER_GIF}" alt="" class="${GENERIC_PREVIEW_CLASS_NAME} is-loading"/>${n}\n <div>`))},t.onloadend=function(){const e=a.querySelector(`#${r}`);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,o)},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 o=s.split(","),r=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<o.length;e+=1){const i=o[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(r,t),r.textContent=t.dataset.errormessage||"This is not a valid file type.",r.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"},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{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}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:1.875rem}h3{font-size:1.25rem}h4{font-size:1.0625rem}h5{font-size:0.9375rem}h6{font-size:0.9375rem}@media (max-width: 481px){h1{font-size:30px}h2{font-size:24px}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}@media (max-width: 481px){h1{font-size:30px}h2{font-size:24px}}h6{margin:0.5em 0 0;text-transform:none;font-weight:700}:host legend :is(h1,h2,h3,h4,h5,h6),:host label :is(h1,h2,h3,h4,h5,h6){display:inline;margin:0px}:host legend :is(h1,h2,h3,h4,h5),:host label :is(h1,h2,h3,h4,h5){font-family:var(--font-serif)}:host h1+*,:host h2+*,:host h3+*,:host h4+*,:host h5+*,:host h6+*{margin-top:unset}:host #form-question{margin-bottom:1rem}.usa-hint{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=""])){border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}:host([error]:not([error=""])[use-forms-pattern=multiple]){border-left:none}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{border-left:0.25rem solid #b50909;padding-left:1rem;position:relative}@media screen and (min-width: 1008px){:host([error]:not([error=""])){margin-left:-0.9rem}:host([error]:not([error=""])[use-forms-pattern=multiple]) .input-wrap{margin-left:-0.9rem}}@media screen and (max-width: 1008px){:host([error]:not([error=""])[use-forms-pattern=multiple]){padding-left:0}}[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 .separator{border:0;border-top:1px solid var(--vads-color-base-lighter);margin:0}: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: 1008px){: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.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.uploadStatus="idle",this.chooseFileString="choose from folder",this.dragFileString="Drag a file here or ",this.handleChange=e=>{const t=e.target;t.files&&t.files.length>0&&this.handleFile(t.files[0]),t.value=""},this.handleDrop=e=>{e.preventDefault(),e.stopPropagation();const t=e.dataTransfer.files;t.length>0&&this.handleFile(t[0])},this.handleFile=(e,t=!0)=>{if(this.accept){const t=this.normalizeAcceptProp(this.accept);if(!this.isAcceptedFileType(e.type,t))return this.removeFile(!1),void(this.internalError="This is not a valid file type.")}if(e.size>this.maxFileSize)return this.internalError=`\n We can't upload your file because it's too big. Files must be less than ${this.formatFileSize(this.maxFileSize)}.`,this.fileContents=null,void(this.uploadStatus="idle");this.uploadedFile=null,this.file=e,t&&this.vaChange.emit({files:[this.file]}),this.uploadStatus="success",this.internalError=null,this.generateFileContents(this.file),this.updateStatusMessage(`You have selected the file: ${this.file.name}`),this.el.focus(),this.enableAnalytics&&this.componentLibraryAnalytics.emit({componentName:"va-file-input",action:"change",details:{label:this.label}})},this.removeFile=(e=!0)=>{this.closeModal(),this.uploadStatus="idle",this.internalError=null,e&&this.vaChange.emit({files:[]}),this.file=null,this.uploadedFile=null,this.updateStatusMessage("File removed. No file selected."),this.el.focus()},this.openModal=()=>{this.el.shadowRoot.querySelector("va-modal").setAttribute("status","warning"),this.showModal=!0},this.closeModal=()=>{this.showModal=!1,setTimeout((()=>{this.fileInputRef.focus()}),0)},this.changeFile=()=>{this.fileInputRef&&this.fileInputRef.click()},this.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]}`},this.normalizeAcceptProp=e=>e.split(",").map((e=>(e=e.trim()).startsWith(".")?extensionToMimeType[e]:e)),this.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},this.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))},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.buttonText=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.percentUploaded=null}handleValueChange(e){setTimeout((()=>{this.updateStatusMessage(e)}))}percentHandler(e){e>=100&&this.resetState()}resetState(){this.fileContents=null,this.uploadStatus="idle",this.percentUploaded=null,forceUpdate(this.el)}updateStatusMessage(e){setTimeout((()=>{const t=this.el.shadowRoot.querySelector("#statusMessage");t&&(t.textContent=e)}),1e3)}generateFileContents(e){if(!e)return;const t=new FileReader;this.fileType=e.type,t.onloadend=()=>{this.fileContents=t.result},this.fileType&&("application/pdf"===this.fileType||this.fileType.startsWith("image/"))&&t.readAsDataURL(e)}componentWillRender(){const e=!!this.el.querySelector(":scope > *"),t=!(!this.value&&!this.file||this.readOnly);this.showSeparator=e||t}componentDidLoad(){fileInput.init(this.el)}connectedCallback(){this.el.addEventListener("change",this.handleChange)}disconnectedCallback(){this.el.removeEventListener("change",this.handleChange)}getDefaultUploadMessage(){return h("span",null,this.dragFileString,h("span",{class:"file-input-choose-text"},this.chooseFileString))}handlePasswordChange(e){this.vaPasswordChange.emit({password:e.target.value})}render(){const{label:e,name:t,required:i,accept:a,error:s,hint:n,file:o,uploadStatus:r,dragFileString:l,chooseFileString:d,uploadMessage:c,headerSize:f,fileContents:p,fileType:u,headless:m,value:b,readOnly:g,encrypted:v,statusText:S,uploadedFile:E,percentUploaded:A}=this;b&&!this.file&&this.handleFile(b,!1);const C=this.error||this.internalError,_=`${n?"input-hint-message":""} ${C?"input-error-message":""}`.trim()||null,x=("file-input-target "+(C?"file-input-target-error":"")).trim();let y=h("div",{key:"9774ee87adb4230027fed51725a8a0ad5bab9b74",class:"thumbnail-container"},h("svg",{key:"c3a40e412d03ae708ea73a2ec7bb1310e450ce6e",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",fill:"#07648d",width:"40px",height:"40px"},h("path",{key:"c73b653eac4c05b2e919b48247dd1c869d867811",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"})));s?y=h("div",{key:"9a8f992c107c9774b2fa09e2288bf1f208d04b75",class:"thumbnail-container"},h("va-icon",{key:"89d62f84123ec4d0ae1d0f65765f21991305494c",icon:"error",size:3,class:"thumbnail-preview thumbnail-error"})):p&&(u.startsWith("image/")?y=h("div",{key:"bdbad7b10ac810c9ae857c76b567fc972d8103b2",class:"thumbnail-container","aria-hidden":"true"},h("img",{key:"e8ab4196d10ee00f2066f1f8c9c1f25d198ca8aa",class:"thumbnail-preview",src:p,alt:"image"})):"application/pdf"===u&&(y=h("div",{key:"7c2113699ec614ba1d27b51861dd21087c624aaa",class:"thumbnail-container","aria-hidden":"true"},h("object",{key:"87cd12cb0a730c50c07aa60a36e8d18df847aa7b",class:"thumbnail-preview",data:p,type:"application/pdf"}))));let L=m?"headless-selected-files-wrapper":"selected-files-wrapper";const w="usa-hint"+(m?" usa-sr-only":""),T=null!==A&&A<100;let I="file-status-label";return T&&(I=`${I} uploading-status`),h(Host,{key:"401ecd730a4166004d4d63a87e7d0f92b6f56d3c",class:{"has-error":!!C}},!g&&h("span",{key:"c0fec0820f20e94fa854621b803daa0f36d0d2e7",class:{"usa-sr-only":!!m}},e&&this.renderLabelOrHeader(e,i,f)),n&&!g&&h("div",{key:"3afcc31a2f352a3a47d725f144e96c38775b1978",class:w,id:"input-hint-message"},n),h("div",{key:"848269b7bd2194919156084db84b1b7db76732ce",class:"file-input-wrapper",onDrop:this.handleDrop},h("input",{key:"d811e3dd2002a60813d8dbc07ad1587535b6b2da",id:"fileInputField",class:"file-input","aria-label":`${e}${i?" "+instance.t("required"):""}. ${l}${d}`,style:{visibility:"success"===this.uploadStatus||E?"hidden":"unset"},type:"file",ref:e=>this.fileInputRef=e,name:t,accept:a,"aria-describedby":_,onChange:this.handleChange}),"idle"===r&&!E&&h("div",{key:"9f2d9e5cf7c6ec5ba4574315c20f2be8a11beea0"},h("span",{key:"2541b03b36d3b29ead5f5ae0987f4f68bc021779",id:"file-input-error-alert",role:"alert"},C&&h(Fragment,{key:"1e71efb317203fcddecc87fcfe30ce936e0b7670"},h("span",{key:"6d0b154e43199d42ab62dc0f29e086bd56dd6482",class:"usa-sr-only"},instance.t("error")),h("span",{key:"431b612a5a22ba5c954e0535b6208df68b93f9b2",class:"usa-error-message"},C))),h("div",{key:"31276bffff19ce38caec4f32adbbeec0636cddac",class:"usa-sr-only","aria-live":"polite",id:"statusMessage"}),h("div",{key:"e425e82b35fbd338711c979eaad1151b218528d3",class:x},h("div",{key:"ecc36240f55fce0f9b43573808fb9561035dbfc2",class:"file-input-box"}),h("div",{key:"1f141bcd08b7d6e6d1b962db0add2a1a1b487cb7",class:"file-input-instructions"},c||this.getDefaultUploadMessage()))),("idle"!==r||E)&&h("div",{key:"ea50efb490141b116748d0928d3efe659f87fd46",class:L},!m&&h("div",{key:"7e2a11ce853166f911b4aec98b71d5f23514457d",class:"selected-files-label"},g?"Files you uploaded":"Selected files"),h("div",{key:"2c7f72031c57dd6d4f2b4eebebce550f92a87eb3",class:"usa-sr-only","aria-live":"polite",id:"statusMessage"}),h("va-card",{key:"794fe8a544d543c8e7c3b7c54e42057bd033de89",class:"va-card"},h("div",{key:"cb4a4947ff477d870b3443d906b5433b43ba3b3d",class:"file-info-section"},y,h("div",{key:"3cd687739b95959cc77b63ff9fa29c23cd784c22",class:"file-info-group vads-u-line-height--2"},h("span",{key:"d51642b3b1a23d7c624e23a13f294a27ceef4d4a",class:"file-label"},o?o.name:E.name),C&&h("span",{key:"e9ad2ac117d67c5fa8d186644782e0e74fb27c66",id:"input-error-message",role:"alert"},h("span",{key:"2699fa09aa2b455d4d12f6fce8fbc27e65be49dc",class:"usa-sr-only"},instance.t("error")),h("span",{key:"a14b42b3ee642abdc2db87fd61bf4cd30801913f","aria-live":"polite",class:"usa-error-message"},C)),!T&&h("span",{key:"5fd9456980f44027a2e313ba1a160a86f8d37e68",class:"file-size-label"},this.formatFileSize(o?o.size:E.size)),h("span",{key:"720fff3bd78dfd56a5f7337f2d536a5ff6651d03",class:I,"aria-live":"polite"},T?"Uploading...":S))),(o||b||E)&&h("div",{key:"fe642adaf645a1799129c2dcacd3c8f83e366cc5"},this.showSeparator&&h("hr",{key:"775903c2317b23e806e00f0230e76fd38d90a610",class:"separator"}),v&&h("va-text-input",{key:"9ef6109d27d72c2a475ef528b4e65608d9621077",onInput:e=>{this.handlePasswordChange(e)},label:"File password",required:!0}),h("div",{key:"ca4cf00a4cf0c0e44d7e8578849724679eadff04",class:"additional-info-slot"},h("slot",{key:"378c4d8ec1ca2607a29e2f32ad1d0000eec22a78"})),g?null:T?h(Fragment,null,h("va-progress-bar",{percent:A}),h("va-button-icon",{buttonType:"cancel",onClick:this.resetState.bind(this)})):h(Fragment,null,h("div",{class:"file-button-section"},h("va-button-icon",{buttonType:"change-file",onClick:this.changeFile,label:"Change file","aria-label":`change file ${o?o.name:E.name}`}),h("va-button-icon",{buttonType:"delete",onClick:this.openModal,"aria-label":`delete file ${o?o.name:E.name}`,label:"Delete"})),h("va-modal",{modalTitle:"Delete this file?",visible:this.showModal,primaryButtonText:"Yes, remove this",secondaryButtonText:"No, keep this",onCloseEvent:this.closeModal,onPrimaryButtonClick:()=>this.removeFile(!0),onSecondaryButtonClick:this.closeModal},"We'll remove the uploaded document"," ",h("span",{class:"file-label"},o?o.name:E.name))))))))}get el(){return this}static get watchers(){return{statusText:["handleValueChange"],percentUploaded:["percentHandler"]}}static get style(){return VaFileInputStyle0}},[1,"va-file-input",{label:[1],name:[1],buttonText:[1,"button-text"],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:[16],maxFileSize:[2,"max-file-size"],percentUploaded:[1026,"percent-uploaded"],file:[32],fileContents:[32],internalError:[32],showModal:[32],showSeparator:[32]},void 0,{statusText:["handleValueChange"],percentUploaded:["percentHandler"]}]);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{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: 1008px){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:"
|
|
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: 1008px){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:"4b35ae6142b89e346f616ba48593e6c78d6843fc",role:"banner"},h("va-official-gov-banner",{key:"4daa46002d93e352bcafb03dd8c24f1e1e36d7ae"}),h("va-crisis-line-modal",{key:"7d166e27b7487dda235aaa6730f15e221460f4ba"}),h("div",{key:"a06a17caa99b30f51802a965438511b43c70866d",onFocusin:()=>this.trapFocus(),class:"va-header"},h("a",{key:"af5103ee821de50a653a76019a98fc84dfd3b429",href:"/",title:"Go to VA.gov",class:"va-logo-link"},h("img",{key:"21283f1efb98db8761c32b0abee5d6fbda49d0fa",class:"va-logo",src:vaSealSvg,alt:"VA logo and Seal, U.S. Department of Veterans Affairs"})),h("div",{key:"cf6d60ca6801f0a4305c40742e1757398857eea8",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{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{c as consoleDevError}from"./utils.js";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.icon=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}render(){const{icon:e,srtext:i}=this,t=this.getSize(),s=classnames({"usa-icon":!0,[`usa-icon--size-${t}`]:!!t}),n=`/img/sprite.svg#${e}`;return h(Host,{key:"
|
|
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";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.icon=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}render(){const{icon:e,srtext:i}=this,t=this.getSize(),s=classnames({"usa-icon":!0,[`usa-icon--size-${t}`]:!!t}),n=`/img/sprite.svg#${e}`;return h(Host,{key:"8d347fa7b9d89a01e16cc69aa7c5f218cf575339"},h("svg",{key:"32322bbb29bbb0bfb447620ea2ef5ab990683e3c",class:s,"aria-labelledby":i?"icon-title":null,"aria-hidden":i?null:"true",focusable:"false",role:"img"},i&&h("title",{key:"5d83b737406db012a18fc590fd2f94e54df955e7",id:"icon-title"},i),h("use",{key:"cbe161afba3de1135748e6f699027c147009d768",href:n})))}static get assetsDirs(){return["../img"]}static get style(){return VaIconStyle0}},[1,"va-icon",{icon:[1],size:[2],srtext:[1]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["va-icon"].forEach((e=>{"va-icon"===e&&(customElements.get(e)||customElements.define(e,VaIcon))}))}export{VaIcon as V,defineCustomElement as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{d as defineCustomElement$3}from"./va-icon2.js";import{d as defineCustomElement$2}from"./va-link2.js";const vaLanguageToggleCss=":host div{display:inline-block}:host div div.inner-div{border-right:1px solid var(--vads-color-base-light);padding-right:8px;margin-right:8px}:host div a.is-current-lang{font-weight:var(--font-weight-bold);color:var(--vads-color-black);text-decoration:none;padding-top:10px;padding-bottom:16px}: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:10px;padding-bottom:16px}",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:"
|
|
1
|
+
import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{d as defineCustomElement$3}from"./va-icon2.js";import{d as defineCustomElement$2}from"./va-link2.js";const vaLanguageToggleCss=":host div{display:inline-block}:host div div.inner-div{border-right:1px solid var(--vads-color-base-light);padding-right:8px;margin-right:8px}:host div a.is-current-lang{font-weight:var(--font-weight-bold);color:var(--vads-color-black);text-decoration:none;padding-top:10px;padding-bottom:16px}: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:10px;padding-bottom:16px}",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:"94c39337d53eb77d80aefd8616b636e47459a254"},h("div",{key:"be68363860d3a4c113eb04012a9a4af447fab534",role:"group","aria-label":"Language selection"},t.map((({href:a,lang:n,label:l},s)=>{const o=classnames({"is-current-lang":n===e}),i=classnames({"inner-div":s<t.length-1});return h("div",{class:i},n===e?h("a",{class:o,href:a,hrefLang:n,onClick:e=>this.handleToggle(e,n,l),"aria-current":"language"},l):h("va-link",{class:o,href:a,language:n,onClick:e=>this.handleToggle(e,n,l),text:l,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{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{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}a{text-decoration:none;color:var(--vads-color-link);-webkit-transition-duration:0.3s;transition-duration:0.3s;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-property:color, background-color, border-color;transition-property:color, background-color, border-color}a:hover{background-color:rgba(0, 0, 0, 0.05);color:inherit}a:visited{color:var(--vads-color-link-visited)}.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)}: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: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}.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:inline-block;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}:host a.va-link--primary-entry:hover:not(:focus){text-decoration:none}: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{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);text-decoration:none;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{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);text-decoration-thickness:2px;text-underline-offset:4px}",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:"
|
|
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{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}a{text-decoration:none;color:var(--vads-color-link);-webkit-transition-duration:0.3s;transition-duration:0.3s;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-property:color, background-color, border-color;transition-property:color, background-color, border-color}a:hover{background-color:rgba(0, 0, 0, 0.05);color:inherit}a:visited{color:var(--vads-color-link-visited)}.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)}: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: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:inline-block;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}:host a.va-link--primary-entry:hover:not(:focus){text-decoration:none}: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{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);text-decoration:none;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{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);text-decoration-thickness:2px;text-underline-offset:4px}",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:"741ceb11f745e5367efda82b7bdd1375a6dbc912",class:r},h("a",{key:"1a9798908f569c4b416af1c45763e2233c074606",href:o,class:s,"aria-label":n,"aria-describedby":t?"link-description":null,onClick:i,ref:i=>this.linkRef=i},h("va-icon",{key:"fa1300d06b5b29a56147bad20f9f7c7428fd3c19",class:l,icon:"chevron_right",size:3}),h("span",{key:"5dfba4f71c2b4a9615ca61ba1ee4bdf2ab9f9b1d",class:"link-text"},e)),isMessageSet(t)&&h("span",{key:"2f5e9a8f564921d4dd68950e6f53c7b3843eaf97",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{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{d as defineCustomElement$1}from"./va-icon2.js";const vaLinkCss='p,a,ol,ul,li,dl,dt,dd,form,label,button{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.5}button:not([disabled]):focus,select:not([disabled]):focus,a:not([disabled]):focus,h1:focus,input:not([disabled]):focus,textarea:not([disabled]):focus,#form-question [role=\'option\']:focus,*[tabindex]:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}a{text-decoration:none;color:var(--vads-color-link);-webkit-transition-duration:0.3s;transition-duration:0.3s;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-property:color, background-color, border-color;transition-property:color, background-color, border-color}a:hover{background-color:rgba(0, 0, 0, 0.05);color:inherit}a:visited{color:var(--vads-color-link-visited)}.usa-sr-only{position:absolute;left:-999em;right:auto}:host{display:inline}:host([href]:focus){outline:none !important}:host a{cursor:pointer;text-decoration:underline;font:inherit}:host a.va-link--reverse,:host a.va-link--reverse .link-icon--back{color:var(--vads-color-white)}:host a.va-link--reverse:hover,:host a.va-link--reverse:active,:host a.va-link--reverse:hover .link-icon--back,:host a.va-link--reverse:active .link-icon--back,:host a.va-link--reverse .link-icon--back:hover,:host a.va-link--reverse .link-icon--back:active,:host a.va-link--reverse .link-icon--back:hover .link-icon--back,:host a.va-link--reverse .link-icon--back:active .link-icon--back{color:var(--vads-color-action-focus-on-light);background-color:transparent}:host([active]:not([active=false])) a{font-weight:700}:host([icon-name]) va-icon{margin-right:4px}.link-icon--active{vertical-align:baseline;position:relative;top:3px}.link-icon--left{margin-right:4px;vertical-align:baseline;position:relative;top:3px}.link-container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}.link-icon--back{color:var(--vads-color-gray-medium);-webkit-transition-duration:0.3s;transition-duration:0.3s;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-property:color, background-color, border-color;transition-property:color, background-color, border-color}.link--center{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}dfn{font-style:normal}abbr{text-decoration:none}.external-link-icon{margin-left:4px}@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:t,filetype:a,filename:l,getAbbreviationTitle:r,handleClick:s,href:c,pages:d,text:u,video:v,reverse:b,external:k,iconName:f,iconSize:m,language:p,label:g}=this,y=classnames({"va-link--reverse":b,"link--center":f
|
|
1
|
+
import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{d as defineCustomElement$1}from"./va-icon2.js";const vaLinkCss='p,a,ol,ul,li,dl,dt,dd,form,label,button{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.5}button:not([disabled]):focus,select:not([disabled]):focus,a:not([disabled]):focus,h1:focus,input:not([disabled]):focus,textarea:not([disabled]):focus,#form-question [role=\'option\']:focus,*[tabindex]:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}a{text-decoration:none;color:var(--vads-color-link);-webkit-transition-duration:0.3s;transition-duration:0.3s;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-property:color, background-color, border-color;transition-property:color, background-color, border-color}a:hover{background-color:rgba(0, 0, 0, 0.05);color:inherit}a:visited{color:var(--vads-color-link-visited)}.usa-sr-only{position:absolute;left:-999em;right:auto}:host{display:inline}:host([href]:focus){outline:none !important}:host a{cursor:pointer;text-decoration:underline;font:inherit}:host a.va-link--reverse,:host a.va-link--reverse .link-icon--back{color:var(--vads-color-white)}:host a.va-link--reverse:hover,:host a.va-link--reverse:active,:host a.va-link--reverse:hover .link-icon--back,:host a.va-link--reverse:active .link-icon--back,:host a.va-link--reverse .link-icon--back:hover,:host a.va-link--reverse .link-icon--back:active,:host a.va-link--reverse .link-icon--back:hover .link-icon--back,:host a.va-link--reverse .link-icon--back:active .link-icon--back{color:var(--vads-color-action-focus-on-light);background-color:transparent}:host([active]:not([active=false])) a{font-weight:700}:host([icon-name]) va-icon{margin-right:4px}.link-icon--active{vertical-align:baseline;position:relative;top:3px}.link-icon--left{margin-right:4px;vertical-align:baseline;position:relative;top:3px}.link-container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}.link-icon--back{color:var(--vads-color-gray-medium);-webkit-transition-duration:0.3s;transition-duration:0.3s;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-property:color, background-color, border-color;transition-property:color, background-color, border-color}.link--center{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}dfn{font-style:normal}abbr{text-decoration:none}.external-link-icon{margin-left:4px}@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:t,filetype:a,filename:l,getAbbreviationTitle:r,handleClick:s,href:c,pages:d,text:u,video:v,reverse:b,external:k,iconName:f,iconSize:m,language:p,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},u,h("va-icon",{class:"link-icon--active",icon:"chevron_right"})));if(i){const e=h("va-icon",{icon:"arrow_back",class:"link-icon--left link-icon--back"});return h(Host,null,h("div",{class:"link-container"},e,h("a",{href:c,class:y,onClick:s,"aria-label":g},u)))}if(o||v)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"}),u," ",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"}),u));if(t)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"}),u," ",a&&h("dfn",null,"(",h("abbr",{title:r()},a),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"}),u));if(k)return h(Host,null,h("a",{href:c,rel:"noreferrer",class:y,onClick:s,"aria-label":g,target:"_blank"},u," ",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},u))}static get style(){return VaLinkStyle0}},[1,"va-link",{abbrTitle:[1,"abbr-title"],active:[516],back:[4],calendar:[4],channel:[4],disableAnalytics:[4,"disable-analytics"],download:[4],href:[1],filename:[1],filetype:[1],pages:[2],text:[1],video:[4],reverse:[4],external:[4],label:[1],iconName:[1,"icon-name"],iconSize:[2,"icon-size"],language:[1]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["va-link","va-icon"].forEach((e=>{switch(e){case"va-link":customElements.get(e)||customElements.define(e,VaLink);break;case"va-icon":customElements.get(e)||defineCustomElement$1()}}))}export{VaLink as V,defineCustomElement as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";var isChromatic=function(
|
|
1
|
+
import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";var isChromatic=function(e){const t=e||"undefined"!=typeof window&&window;return!(!t||!t.navigator.userAgent.match(/Chromatic/)&&!t.location.href.match(/chromatic=true/))};const vaLoadingIndicatorCss=":host{display:block;font-size:1.06rem;text-align:center}.loading-indicator{display:block;height:4rem;margin-top:1rem}.loading-indicator:after{content:' ';display:inline-block;width:2.1875rem;height:2.1875rem;margin:1px;border-radius:50%;border:8px solid var(--vads-color-primary);border-color:var(--vads-color-primary) transparent var(--vads-color-primary)\n transparent;-webkit-animation:spin 1.5s linear infinite;animation:spin 1.5s linear infinite}.loading-indicator.chromatic:after{-webkit-animation:none;animation:none}.loading-indicator:focus{outline:none}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}",VaLoadingIndicatorStyle0=vaLoadingIndicatorCss,VaLoadingIndicator$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.loadingStartTime=null,this.observer=null,this.message=void 0,this.label="Loading",this.setFocus=!1,this.enableAnalytics=!1}componentDidLoad(){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:"ae535fc8b5c06ddbb097f3017e51ed7a9ee1dd1e","aria-live":"polite"},h("div",{key:"be8c213b4a346300d62f483263329dc1b0575650",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};
|