@department-of-veterans-affairs/component-library 49.0.0 → 49.1.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/2387.app.bundle.js +1 -1
- package/dist/4064.app.bundle.js +1 -1
- package/dist/4117.app.bundle.js +1 -1
- package/dist/6527.app.bundle.js +1 -1
- package/dist/7821.app.bundle.js +1 -1
- package/dist/8762.app.bundle.js +1 -1
- package/dist/9288.app.bundle.js +1 -1
- package/dist/9724.app.bundle.js +1 -1
- package/dist/app.bundle.js +1 -1
- package/dist/components/types/components.d.ts +16 -0
- package/dist/components/va-file-input-multiple.js +1 -1
- package/dist/components/va-file-input2.js +1 -1
- package/dist/components/va-radio-option.js +1 -1
- package/dist/components/va-table-inner2.js +1 -1
- package/dist/components/va-table.js +1 -1
- package/dist/components/va-telephone2.js +1 -1
- package/dist/components/va-textarea.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import{i as isNumeric}from"./utils.js";import{d as defineCustomElement$3}from"./va-icon2.js";import{d as defineCustomElement$2}from"./va-table-inner2.js";const months={january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12},ordinals={first:1,second:2,third:3,fourth:4,fifth:5,sixth:6,seventh:7,eighth:8,ninth:9,tenth:10,eleventh:11,twelfth:12,thirteenth:13,fourteenth:14,fifteenth:15,sixteenth:16,seventeenth:17,eighteenth:18,nineteenth:19,twentieth:20},dateRegex=/^(\d{1,2}\/){1,2}(\d{2}|\d{4})$/;function _isNumeric(a){const t=cleanString(a);return!dateRegex.test(a)&&("number"==typeof t||isNumeric(t))}function cleanString(a){if(""===a)return-1/0;const t=a.toLowerCase();return t in ordinals?ordinals[t]:a.replace(/[$%,]|(th)|(st)|(rd)|(nd)/g,"")}function numSort(a){return function(t,e){return difference(+cleanString(t),+cleanString(e),a)}}function isValidDate(a){const t=new Date(a);return!isNaN(t.getTime())||!!months[a.toLowerCase()]}function getDateValue(a){if(""===a)return-1/0;return months[a.toLowerCase()]||new Date(a).getTime()}function dateSort(a){return function(t,e){return difference(getDateValue(t),getDateValue(e),a)}}function alphaSort(a){var t;let e=null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.getAttribute("lang");return e=e||"en-US",function(t,r){const s="ascending"===a,o=s?t:r,d=s?r:t;return new Intl.Collator(e,{sensitivity:"base"}).compare(o,d)}}function difference(a,t,e){return"ascending"===e?a-t:t-a}function _getCompareFunc(a,t){let e;return e=_isNumeric(a)?numSort(t):isValidDate(a)?dateSort(t):alphaSort.bind(this)(t),e}function getCompareFunc(a,t,e){for(const r of a){const a=r.children[t].innerHTML.trim();if(""!==a)return _getCompareFunc.bind(this)(a,e)}return null}const vaTableCss='.usa-table{font-family:Source Sans Pro Web, Helvetica Neue, Helvetica, Roboto, Arial, sans-serif;font-size:1.06rem;line-height:1.5;border-collapse:collapse;border-spacing:0;color:#1b1b1b;margin:1.25rem 0;text-align:left;}.usa-table thead th{background-clip:padding-box;color:#1b1b1b;font-weight:700;line-height:1.3}.usa-table thead th,.usa-table thead td{background-color:#dfe1e2;color:#1b1b1b}.usa-table tbody th{text-align:left}.usa-table th,.usa-table td{background-color:white;border:1px solid #1b1b1b;font-weight:normal;padding:0.5rem 1rem}.usa-table caption{font-family:Source Sans Pro Web, Helvetica Neue, Helvetica, Roboto, Arial, sans-serif;font-size:1rem;font-weight:700;margin-bottom:0.75rem;text-align:left}.usa-table th[data-sortable]{padding-right:2.5rem;position:relative}.usa-table th[data-sortable]::after{border-bottom-color:transparent;border-bottom-style:solid;border-bottom-width:1px;bottom:0;content:"";height:0;left:0;position:absolute;width:100%}.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button{color:#005ea2;text-decoration:underline;background-color:transparent;border:0;border-radius:0;-webkit-box-shadow:none;box-shadow:none;font-weight:normal;-ms-flex-pack:normal;justify-content:normal;text-align:left;margin:0;padding:0;width:auto;height:2rem;width:2rem;background-position:center center;background-size:1.5rem;color:#71767a;cursor:pointer;display:inline-block;margin:0;position:absolute;right:0.25rem;text-align:center;text-decoration:none;top:50%;-webkit-transform:translate(0, -50%);transform:translate(0, -50%)}.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:visited,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:visited{color:#54278f}.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:hover,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:hover{color:#1a4480}.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:active,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:active{color:#162e51}.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:focus,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:focus{outline:0.25rem solid #2491ff;outline-offset:0rem}.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:hover,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button.usa-button--hover,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:disabled:hover,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button[aria-disabled=true]:hover,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:disabled.usa-button--hover,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button[aria-disabled=true].usa-button--hover,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:active,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button.usa-button--active,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:disabled:active,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button[aria-disabled=true]:active,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:disabled.usa-button--active,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button[aria-disabled=true].usa-button--active,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:disabled:focus,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button[aria-disabled=true]:focus,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:disabled.usa-focus,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button[aria-disabled=true].usa-focus,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:disabled,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button[aria-disabled=true],.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button.usa-button--disabled,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:hover,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button.usa-button--hover,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:disabled:hover,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button[aria-disabled=true]:hover,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:disabled.usa-button--hover,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button[aria-disabled=true].usa-button--hover,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:active,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button.usa-button--active,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:disabled:active,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button[aria-disabled=true]:active,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:disabled.usa-button--active,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button[aria-disabled=true].usa-button--active,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:disabled:focus,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button[aria-disabled=true]:focus,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:disabled.usa-focus,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button[aria-disabled=true].usa-focus,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:disabled,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button[aria-disabled=true],.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button.usa-button--disabled{background-color:transparent;-webkit-box-shadow:none;box-shadow:none;text-decoration:underline}.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button.usa-button--hover,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button.usa-button--hover{color:#1a4480}.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button.usa-button--active,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button.usa-button--active{color:#162e51}.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:disabled,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button[aria-disabled=true],.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:disabled:hover,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button[aria-disabled=true]:hover,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button[aria-disabled=true]:focus,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:disabled,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button[aria-disabled=true],.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:disabled:hover,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button[aria-disabled=true]:hover,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button[aria-disabled=true]:focus{color:#757575}@media (forced-colors: active){.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:disabled,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button[aria-disabled=true],.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:disabled:hover,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button[aria-disabled=true]:hover,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button[aria-disabled=true]:focus,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:disabled,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button[aria-disabled=true],.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:disabled:hover,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button[aria-disabled=true]:hover,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button[aria-disabled=true]:focus{color:GrayText}}.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button .usa-icon,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button .usa-icon{height:1.5rem;width:1.5rem;vertical-align:middle}.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button .usa-icon>g,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button .usa-icon>g{fill:transparent}.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button .usa-icon>g.unsorted,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button .usa-icon>g.unsorted{fill:#1b1b1b}.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:hover .usa-icon>g.unsorted,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:hover .usa-icon>g.unsorted{fill:black}.usa-table th[data-sortable][aria-sort=descending],.usa-table th[data-sortable][aria-sort=ascending]{background-color:#97d4ea}.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button{color:#005ea2;text-decoration:underline;background-color:transparent;border:0;border-radius:0;-webkit-box-shadow:none;box-shadow:none;font-weight:normal;-ms-flex-pack:normal;justify-content:normal;text-align:left;margin:0;padding:0;width:auto;height:2rem;width:2rem;background-position:center center;background-size:1.5rem;color:#71767a;cursor:pointer;display:inline-block;margin:0;position:absolute;right:0.25rem;text-align:center;text-decoration:none;top:50%;-webkit-transform:translate(0, -50%);transform:translate(0, -50%)}.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:visited{color:#54278f}.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:hover{color:#1a4480}.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:active{color:#162e51}.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:focus{outline:0.25rem solid #2491ff;outline-offset:0rem}.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:hover,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button.usa-button--hover,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:disabled:hover,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button[aria-disabled=true]:hover,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:disabled.usa-button--hover,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button[aria-disabled=true].usa-button--hover,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:active,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button.usa-button--active,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:disabled:active,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button[aria-disabled=true]:active,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:disabled.usa-button--active,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button[aria-disabled=true].usa-button--active,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:disabled:focus,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button[aria-disabled=true]:focus,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:disabled.usa-focus,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button[aria-disabled=true].usa-focus,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:disabled,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button[aria-disabled=true],.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button.usa-button--disabled{background-color:transparent;-webkit-box-shadow:none;box-shadow:none;text-decoration:underline}.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button.usa-button--hover{color:#1a4480}.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button.usa-button--active{color:#162e51}.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:disabled,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button[aria-disabled=true],.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:disabled:hover,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button[aria-disabled=true]:hover,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button[aria-disabled=true]:focus{color:#757575}@media (forced-colors: active){.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:disabled,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button[aria-disabled=true],.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:disabled:hover,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button[aria-disabled=true]:hover,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button[aria-disabled=true]:focus{color:GrayText}}.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button .usa-icon{height:1.5rem;width:1.5rem;vertical-align:middle}.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button .usa-icon>g{fill:transparent}.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button .usa-icon>g.descending{fill:#1b1b1b}.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button{color:#005ea2;text-decoration:underline;background-color:transparent;border:0;border-radius:0;-webkit-box-shadow:none;box-shadow:none;font-weight:normal;-ms-flex-pack:normal;justify-content:normal;text-align:left;margin:0;padding:0;width:auto;height:2rem;width:2rem;background-position:center center;background-size:1.5rem;color:#71767a;cursor:pointer;display:inline-block;margin:0;position:absolute;right:0.25rem;text-align:center;text-decoration:none;top:50%;-webkit-transform:translate(0, -50%);transform:translate(0, -50%)}.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:visited{color:#54278f}.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:hover{color:#1a4480}.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:active{color:#162e51}.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:focus{outline:0.25rem solid #2491ff;outline-offset:0rem}.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:hover,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button.usa-button--hover,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:disabled:hover,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button[aria-disabled=true]:hover,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:disabled.usa-button--hover,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button[aria-disabled=true].usa-button--hover,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:active,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button.usa-button--active,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:disabled:active,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button[aria-disabled=true]:active,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:disabled.usa-button--active,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button[aria-disabled=true].usa-button--active,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:disabled:focus,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button[aria-disabled=true]:focus,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:disabled.usa-focus,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button[aria-disabled=true].usa-focus,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:disabled,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button[aria-disabled=true],.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button.usa-button--disabled{background-color:transparent;-webkit-box-shadow:none;box-shadow:none;text-decoration:underline}.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button.usa-button--hover{color:#1a4480}.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button.usa-button--active{color:#162e51}.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:disabled,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button[aria-disabled=true],.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:disabled:hover,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button[aria-disabled=true]:hover,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button[aria-disabled=true]:focus{color:#757575}@media (forced-colors: active){.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:disabled,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button[aria-disabled=true],.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:disabled:hover,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button[aria-disabled=true]:hover,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button[aria-disabled=true]:focus{color:GrayText}}.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button .usa-icon{height:1.5rem;width:1.5rem;vertical-align:middle}.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button .usa-icon>g{fill:transparent}.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button .usa-icon>g.ascending{fill:#1b1b1b}.usa-table thead th[aria-sort]{background-color:#97d4ea;color:#1b1b1b}.usa-table td[data-sort-active],.usa-table th[data-sort-active]{background-color:#e1f3f8;color:#1b1b1b}.usa-table--borderless thead{}.usa-table--borderless thead th{background-color:white;border-top:0;color:#1b1b1b}.usa-table--borderless thead th[aria-sort]{color:#1b1b1b}.usa-table--borderless thead th[data-sortable]:not([aria-sort]) .usa-table__header__button .usa-icon>g.unsorted{fill:#1b1b1b}.usa-table--borderless thead th[data-sortable]:not([aria-sort]) .usa-table__header__button:hover .usa-icon>g.unsorted{fill:black}.usa-table--borderless th,.usa-table--borderless td{border-left:0;border-right:0}.usa-table--compact th,.usa-table--compact td{padding:0.25rem 0.75rem}.usa-table--striped tbody tr:nth-child(odd) td,.usa-table--striped tbody tr:nth-child(odd) th{background-color:#f0f0f0;color:#1b1b1b}.usa-table--striped tbody tr:nth-child(odd) td[data-sort-active],.usa-table--striped tbody tr:nth-child(odd) th[data-sort-active]{background-color:#c3ebfa;color:#1b1b1b}@media all and (max-width: 29.99em){.usa-table--stacked thead{display:none}.usa-table--stacked th,.usa-table--stacked td{border-bottom-width:0;display:block;width:100%}.usa-table--stacked tr{border-bottom:0.25rem solid #1b1b1b;border-top-width:0;width:100%}.usa-table--stacked tr th:first-child,.usa-table--stacked tr td:first-child{border-top-width:0}.usa-table--stacked tr:nth-child(odd) td,.usa-table--stacked tr:nth-child(odd) th{background-color:inherit}.usa-table--stacked tr:first-child th:first-child,.usa-table--stacked tr:first-child td:first-child{border-top:0.25rem solid #1b1b1b}.usa-table--stacked th[data-label],.usa-table--stacked td[data-label]{padding-bottom:0.75rem}.usa-table--stacked th[data-label]:before,.usa-table--stacked td[data-label]:before{content:attr(data-label);display:block;font-weight:700;margin:-0.5rem -1rem 0rem;padding:0.75rem 1rem 0.25rem}}@media all and (max-width: 29.99em){.usa-table--stacked-header thead{display:none}.usa-table--stacked-header th,.usa-table--stacked-header td{border-bottom-width:0;display:block;width:100%}.usa-table--stacked-header tr{border-bottom:0.25rem solid #1b1b1b;border-top-width:0;width:100%}.usa-table--stacked-header tr th:first-child,.usa-table--stacked-header tr td:first-child{border-top-width:0}.usa-table--stacked-header tr:nth-child(odd) td,.usa-table--stacked-header tr:nth-child(odd) th{background-color:inherit}.usa-table--stacked-header tr:first-child th:first-child,.usa-table--stacked-header tr:first-child td:first-child{border-top:0.25rem solid #1b1b1b}.usa-table--stacked-header th[data-label],.usa-table--stacked-header td[data-label]{padding-bottom:0.75rem}.usa-table--stacked-header th[data-label]:before,.usa-table--stacked-header td[data-label]:before{content:attr(data-label);display:block;font-weight:700;margin:-0.5rem -1rem 0rem;padding:0.75rem 1rem 0.25rem}.usa-table--stacked-header tr td:first-child,.usa-table--stacked-header tr th:first-child{font-family:Source Sans Pro Web, Helvetica Neue, Helvetica, Roboto, Arial, sans-serif;font-size:1.06rem;line-height:1.1;background-color:#dfe1e2;color:#1b1b1b;font-weight:700;padding:0.75rem 1rem}.usa-table--stacked-header tr td:first-child:before,.usa-table--stacked-header tr th:first-child:before{display:none}}.width-mobile .usa-table--stacked thead{display:none}.width-mobile .usa-table--stacked th,.width-mobile .usa-table--stacked td{border-bottom-width:0;display:block;width:100%}.width-mobile .usa-table--stacked tr{border-bottom:0.25rem solid #1b1b1b;border-top-width:0;width:100%}.width-mobile .usa-table--stacked tr th:first-child,.width-mobile .usa-table--stacked tr td:first-child{border-top-width:0}.width-mobile .usa-table--stacked tr:nth-child(odd) td,.width-mobile .usa-table--stacked tr:nth-child(odd) th{background-color:inherit}.width-mobile .usa-table--stacked tr:first-child th:first-child,.width-mobile .usa-table--stacked tr:first-child td:first-child{border-top:0.25rem solid #1b1b1b}.width-mobile .usa-table--stacked th[data-label],.width-mobile .usa-table--stacked td[data-label]{padding-bottom:0.75rem}.width-mobile .usa-table--stacked th[data-label]:before,.width-mobile .usa-table--stacked td[data-label]:before{content:attr(data-label);display:block;font-weight:700;margin:-0.5rem -1rem 0rem;padding:0.75rem 1rem 0.25rem}.width-mobile .usa-table--stacked-header thead{display:none}.width-mobile .usa-table--stacked-header th,.width-mobile .usa-table--stacked-header td{border-bottom-width:0;display:block;width:100%}.width-mobile .usa-table--stacked-header tr{border-bottom:0.25rem solid #1b1b1b;border-top-width:0;width:100%}.width-mobile .usa-table--stacked-header tr th:first-child,.width-mobile .usa-table--stacked-header tr td:first-child{border-top-width:0}.width-mobile .usa-table--stacked-header tr:nth-child(odd) td,.width-mobile .usa-table--stacked-header tr:nth-child(odd) th{background-color:inherit}.width-mobile .usa-table--stacked-header tr:first-child th:first-child,.width-mobile .usa-table--stacked-header tr:first-child td:first-child{border-top:0.25rem solid #1b1b1b}.width-mobile .usa-table--stacked-header th[data-label],.width-mobile .usa-table--stacked-header td[data-label]{padding-bottom:0.75rem}.width-mobile .usa-table--stacked-header th[data-label]:before,.width-mobile .usa-table--stacked-header td[data-label]:before{content:attr(data-label);display:block;font-weight:700;margin:-0.5rem -1rem 0rem;padding:0.75rem 1rem 0.25rem}.width-mobile .usa-table--stacked-header tr td:first-child,.width-mobile .usa-table--stacked-header tr th:first-child{font-family:Source Sans Pro Web, Helvetica Neue, Helvetica, Roboto, Arial, sans-serif;font-size:1.06rem;line-height:1.1;background-color:#dfe1e2;color:#1b1b1b;font-weight:700;padding:0.75rem 1rem}.width-mobile .usa-table--stacked-header tr td:first-child:before,.width-mobile .usa-table--stacked-header tr th:first-child:before{display:none}.usa-table--sticky-header{border:1px solid #1b1b1b;border-collapse:separate}.usa-table--sticky-header td,.usa-table--sticky-header th{border-left:none;border-top:none}.usa-table--sticky-header td:last-child,.usa-table--sticky-header th:last-child{border-right:none}.usa-table--sticky-header tbody tr:last-child td,.usa-table--sticky-header tbody tr:last-child th{border-bottom:none}.usa-table--sticky-header thead{position:-webkit-sticky;position:sticky;top:-1px}.usa-table--sticky-header.usa-table--borderless{border:none}.usa-table--sticky-header.usa-table--borderless thead th{background-color:white}.usa-table--sticky-header.usa-table--borderless td,.usa-table--sticky-header.usa-table--borderless th{border-right:none}.usa-table-container--scrollable{margin:1.25rem 0;overflow-y:hidden}.usa-table-container--scrollable .usa-table{margin:0}.usa-table-container--scrollable td{white-space:nowrap}va-table-row{display:none}',VaTableStyle0=vaTableCss,VaTable$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.tableTitle=void 0,this.tableType="borderless",this.stacked=!0,this.scrollable=!1,this.sortable=!1,this.striped=!1,this.rows=void 0,this.cols=void 0,this.cells=null}getCellsInRow(a){const t=a.querySelectorAll("span"),e=Array.from(t);return this.cols||(this.cols=e.length),e}getRows(){const a=Array.from(this.el.querySelectorAll("va-table-row"));return a.forEach((a=>a.removeAttribute("role"))),this.rows||(this.rows=a.length),a}getAllCells(a=this.getRows()){const t=[];let e=0;for(const r of a){const a=this.getCellsInRow(r);a.forEach((a=>{a.setAttribute("slot",`va-table-slot-${e}`),e++})),t.push(...a)}this.cells=t}makeFragment(){const a=document.createDocumentFragment();return this.cells.forEach((t=>{a.appendChild(t.cloneNode(!0))})),a}makeVATable(a,t){const e=document.createElement("va-table-inner");e.setAttribute("rows",`${this.rows}`),e.setAttribute("cols",`${this.cols}`),e.setAttribute("stacked",this.stacked&&!this.sortable?"true":"false"),e.setAttribute("sortable",`${this.sortable}`),e.setAttribute("scrollable",this.scrollable?"true":"false"),e.setAttribute("striped",this.striped?"true":"false"),this.sortable&&a&&t&&(e.dataset.sortdir=a,e.dataset.sortindex=`${t}`),this.tableTitle&&e.setAttribute("table-title",this.tableTitle),this.tableType&&e.setAttribute("table-type",this.tableType);const r=this.makeFragment();return e.appendChild(r),e}resetVaTableInner(){const a=this.el.querySelector("va-table-inner");a&&(a.remove(),this.rows=null,this.cols=null,this.cells=null)}watchForDataChanges(){const a=this.el.querySelectorAll("va-table-row")[1];this.observer=new MutationObserver((()=>{this.resetVaTableInner(),this.addVaTableInner()})),this.observer.observe(a,{childList:!0,subtree:!0,characterData:!0})}disconnectedCallback(){this.observer&&this.observer.disconnect()}addVaTableInner(a=null,t=null){this.getAllCells();const e=this.makeVATable(a,t);this.el.appendChild(e)}componentWillLoad(){this.addVaTableInner(),this.watchForDataChanges()}doSort(a){a.stopPropagation();const{index:t,sortdir:e}=a.detail,[r,...s]=this.getRows(),o=getCompareFunc.bind(this)(s,t,e);if(null!==o){s.sort(((a,e)=>{const r=a.children[t].innerHTML.trim(),s=e.children[t].innerHTML.trim();return o(r,s)}));const a=[r,...s];this.resetVaTableInner(),this.el.replaceChildren(...a),this.addVaTableInner("ascending"===e?"descending":"ascending",t)}}render(){return h(Host,{key:"5358e8b1ec042c7592688d67d83fd67efcfc9ddb"},h("slot",{key:"3cd3a26b22cd538ba4fe8bccd9bb27d30fb391d7"}))}get el(){return this}static get style(){return VaTableStyle0}},[1,"va-table",{tableTitle:[1,"table-title"],tableType:[1,"table-type"],stacked:[4],scrollable:[4],sortable:[4],striped:[4],rows:[32],cols:[32],cells:[32]},[[0,"sortTable","doSort"]]]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-table","va-icon","va-table-inner"].forEach((a=>{switch(a){case"va-table":customElements.get(a)||customElements.define(a,VaTable$1);break;case"va-icon":customElements.get(a)||defineCustomElement$3();break;case"va-table-inner":customElements.get(a)||defineCustomElement$2()}}))}const VaTable=VaTable$1,defineCustomElement=defineCustomElement$1;export{VaTable,defineCustomElement};
|
|
1
|
+
import{proxyCustomElement,HTMLElement,h,Host}from"@stencil/core/internal/client";import{i as isNumeric}from"./utils.js";import{d as defineCustomElement$3}from"./va-icon2.js";import{d as defineCustomElement$2}from"./va-table-inner2.js";const months={january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12},ordinals={first:1,second:2,third:3,fourth:4,fifth:5,sixth:6,seventh:7,eighth:8,ninth:9,tenth:10,eleventh:11,twelfth:12,thirteenth:13,fourteenth:14,fifteenth:15,sixteenth:16,seventeenth:17,eighteenth:18,nineteenth:19,twentieth:20},dateRegex=/^(\d{1,2}\/){1,2}(\d{2}|\d{4})$/;function _isNumeric(a){const t=cleanString(a);return!dateRegex.test(a)&&("number"==typeof t||isNumeric(t))}function cleanString(a){if(""===a)return-1/0;const t=a.toLowerCase();return t in ordinals?ordinals[t]:a.replace(/[$%,]|(th)|(st)|(rd)|(nd)/g,"")}function numSort(a){return function(t,e){return difference(+cleanString(t),+cleanString(e),a)}}function isValidDate(a){const t=new Date(a);return!isNaN(t.getTime())||!!months[a.toLowerCase()]}function getDateValue(a){if(""===a)return-1/0;return months[a.toLowerCase()]||new Date(a).getTime()}function dateSort(a){return function(t,e){return difference(getDateValue(t),getDateValue(e),a)}}function alphaSort(a){var t;let e=null===(t=null==this?void 0:this.el)||void 0===t?void 0:t.getAttribute("lang");return e=e||"en-US",function(t,r){const s="ascending"===a,o=s?t:r,d=s?r:t;return new Intl.Collator(e,{sensitivity:"base"}).compare(o,d)}}function difference(a,t,e){return"ascending"===e?a-t:t-a}function _getCompareFunc(a,t){let e;return e=_isNumeric(a)?numSort(t):isValidDate(a)?dateSort(t):alphaSort.bind(this)(t),e}function getCompareFunc(a,t,e){for(const r of a){const a=r.children[t].innerHTML.trim();if(""!==a)return _getCompareFunc.bind(this)(a,e)}return null}const vaTableCss='.usa-table{font-family:Source Sans Pro Web, Helvetica Neue, Helvetica, Roboto, Arial, sans-serif;font-size:1.06rem;line-height:1.5;border-collapse:collapse;border-spacing:0;color:#1b1b1b;margin:1.25rem 0;text-align:left;}.usa-table thead th{background-clip:padding-box;color:#1b1b1b;font-weight:700;line-height:1.3}.usa-table thead th,.usa-table thead td{background-color:#dfe1e2;color:#1b1b1b}.usa-table tbody th{text-align:left}.usa-table th,.usa-table td{background-color:white;border:1px solid #1b1b1b;font-weight:normal;padding:0.5rem 1rem}.usa-table caption{font-family:Source Sans Pro Web, Helvetica Neue, Helvetica, Roboto, Arial, sans-serif;font-size:1rem;font-weight:700;margin-bottom:0.75rem;text-align:left}.usa-table th[data-sortable]{padding-right:2.5rem;position:relative}.usa-table th[data-sortable]::after{border-bottom-color:transparent;border-bottom-style:solid;border-bottom-width:1px;bottom:0;content:"";height:0;left:0;position:absolute;width:100%}.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button{color:#005ea2;text-decoration:underline;background-color:transparent;border:0;border-radius:0;-webkit-box-shadow:none;box-shadow:none;font-weight:normal;-ms-flex-pack:normal;justify-content:normal;text-align:left;margin:0;padding:0;width:auto;height:2rem;width:2rem;background-position:center center;background-size:1.5rem;color:#71767a;cursor:pointer;display:inline-block;margin:0;position:absolute;right:0.25rem;text-align:center;text-decoration:none;top:50%;-webkit-transform:translate(0, -50%);transform:translate(0, -50%)}.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:visited,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:visited{color:#54278f}.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:hover,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:hover{color:#1a4480}.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:active,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:active{color:#162e51}.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:focus,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:focus{outline:0.25rem solid #2491ff;outline-offset:0rem}.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:hover,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button.usa-button--hover,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:disabled:hover,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button[aria-disabled=true]:hover,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:disabled.usa-button--hover,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button[aria-disabled=true].usa-button--hover,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:active,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button.usa-button--active,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:disabled:active,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button[aria-disabled=true]:active,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:disabled.usa-button--active,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button[aria-disabled=true].usa-button--active,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:disabled:focus,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button[aria-disabled=true]:focus,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:disabled.usa-focus,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button[aria-disabled=true].usa-focus,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:disabled,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button[aria-disabled=true],.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button.usa-button--disabled,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:hover,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button.usa-button--hover,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:disabled:hover,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button[aria-disabled=true]:hover,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:disabled.usa-button--hover,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button[aria-disabled=true].usa-button--hover,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:active,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button.usa-button--active,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:disabled:active,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button[aria-disabled=true]:active,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:disabled.usa-button--active,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button[aria-disabled=true].usa-button--active,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:disabled:focus,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button[aria-disabled=true]:focus,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:disabled.usa-focus,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button[aria-disabled=true].usa-focus,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:disabled,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button[aria-disabled=true],.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button.usa-button--disabled{background-color:transparent;-webkit-box-shadow:none;box-shadow:none;text-decoration:underline}.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button.usa-button--hover,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button.usa-button--hover{color:#1a4480}.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button.usa-button--active,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button.usa-button--active{color:#162e51}.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:disabled,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button[aria-disabled=true],.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:disabled:hover,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button[aria-disabled=true]:hover,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button[aria-disabled=true]:focus,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:disabled,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button[aria-disabled=true],.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:disabled:hover,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button[aria-disabled=true]:hover,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button[aria-disabled=true]:focus{color:#757575}@media (forced-colors: active){.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:disabled,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button[aria-disabled=true],.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:disabled:hover,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button[aria-disabled=true]:hover,.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button[aria-disabled=true]:focus,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:disabled,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button[aria-disabled=true],.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:disabled:hover,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button[aria-disabled=true]:hover,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button[aria-disabled=true]:focus{color:GrayText}}.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button .usa-icon,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button .usa-icon{height:1.5rem;width:1.5rem;vertical-align:middle}.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button .usa-icon>g,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button .usa-icon>g{fill:transparent}.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button .usa-icon>g.unsorted,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button .usa-icon>g.unsorted{fill:#1b1b1b}.usa-table th[data-sortable]:not([aria-sort]) .usa-table__header__button:hover .usa-icon>g.unsorted,.usa-table th[data-sortable][aria-sort=none] .usa-table__header__button:hover .usa-icon>g.unsorted{fill:black}.usa-table th[data-sortable][aria-sort=descending],.usa-table th[data-sortable][aria-sort=ascending]{background-color:#97d4ea}.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button{color:#005ea2;text-decoration:underline;background-color:transparent;border:0;border-radius:0;-webkit-box-shadow:none;box-shadow:none;font-weight:normal;-ms-flex-pack:normal;justify-content:normal;text-align:left;margin:0;padding:0;width:auto;height:2rem;width:2rem;background-position:center center;background-size:1.5rem;color:#71767a;cursor:pointer;display:inline-block;margin:0;position:absolute;right:0.25rem;text-align:center;text-decoration:none;top:50%;-webkit-transform:translate(0, -50%);transform:translate(0, -50%)}.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:visited{color:#54278f}.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:hover{color:#1a4480}.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:active{color:#162e51}.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:focus{outline:0.25rem solid #2491ff;outline-offset:0rem}.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:hover,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button.usa-button--hover,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:disabled:hover,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button[aria-disabled=true]:hover,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:disabled.usa-button--hover,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button[aria-disabled=true].usa-button--hover,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:active,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button.usa-button--active,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:disabled:active,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button[aria-disabled=true]:active,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:disabled.usa-button--active,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button[aria-disabled=true].usa-button--active,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:disabled:focus,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button[aria-disabled=true]:focus,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:disabled.usa-focus,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button[aria-disabled=true].usa-focus,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:disabled,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button[aria-disabled=true],.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button.usa-button--disabled{background-color:transparent;-webkit-box-shadow:none;box-shadow:none;text-decoration:underline}.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button.usa-button--hover{color:#1a4480}.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button.usa-button--active{color:#162e51}.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:disabled,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button[aria-disabled=true],.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:disabled:hover,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button[aria-disabled=true]:hover,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button[aria-disabled=true]:focus{color:#757575}@media (forced-colors: active){.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:disabled,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button[aria-disabled=true],.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button:disabled:hover,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button[aria-disabled=true]:hover,.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button[aria-disabled=true]:focus{color:GrayText}}.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button .usa-icon{height:1.5rem;width:1.5rem;vertical-align:middle}.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button .usa-icon>g{fill:transparent}.usa-table th[data-sortable][aria-sort=descending] .usa-table__header__button .usa-icon>g.descending{fill:#1b1b1b}.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button{color:#005ea2;text-decoration:underline;background-color:transparent;border:0;border-radius:0;-webkit-box-shadow:none;box-shadow:none;font-weight:normal;-ms-flex-pack:normal;justify-content:normal;text-align:left;margin:0;padding:0;width:auto;height:2rem;width:2rem;background-position:center center;background-size:1.5rem;color:#71767a;cursor:pointer;display:inline-block;margin:0;position:absolute;right:0.25rem;text-align:center;text-decoration:none;top:50%;-webkit-transform:translate(0, -50%);transform:translate(0, -50%)}.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:visited{color:#54278f}.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:hover{color:#1a4480}.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:active{color:#162e51}.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:focus{outline:0.25rem solid #2491ff;outline-offset:0rem}.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:hover,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button.usa-button--hover,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:disabled:hover,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button[aria-disabled=true]:hover,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:disabled.usa-button--hover,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button[aria-disabled=true].usa-button--hover,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:active,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button.usa-button--active,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:disabled:active,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button[aria-disabled=true]:active,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:disabled.usa-button--active,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button[aria-disabled=true].usa-button--active,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:disabled:focus,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button[aria-disabled=true]:focus,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:disabled.usa-focus,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button[aria-disabled=true].usa-focus,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:disabled,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button[aria-disabled=true],.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button.usa-button--disabled{background-color:transparent;-webkit-box-shadow:none;box-shadow:none;text-decoration:underline}.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button.usa-button--hover{color:#1a4480}.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button.usa-button--active{color:#162e51}.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:disabled,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button[aria-disabled=true],.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:disabled:hover,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button[aria-disabled=true]:hover,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button[aria-disabled=true]:focus{color:#757575}@media (forced-colors: active){.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:disabled,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button[aria-disabled=true],.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button:disabled:hover,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button[aria-disabled=true]:hover,.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button[aria-disabled=true]:focus{color:GrayText}}.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button .usa-icon{height:1.5rem;width:1.5rem;vertical-align:middle}.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button .usa-icon>g{fill:transparent}.usa-table th[data-sortable][aria-sort=ascending] .usa-table__header__button .usa-icon>g.ascending{fill:#1b1b1b}.usa-table thead th[aria-sort]{background-color:#97d4ea;color:#1b1b1b}.usa-table td[data-sort-active],.usa-table th[data-sort-active]{background-color:#e1f3f8;color:#1b1b1b}.usa-table--borderless thead{}.usa-table--borderless thead th{background-color:white;border-top:0;color:#1b1b1b}.usa-table--borderless thead th[aria-sort]{color:#1b1b1b}.usa-table--borderless thead th[data-sortable]:not([aria-sort]) .usa-table__header__button .usa-icon>g.unsorted{fill:#1b1b1b}.usa-table--borderless thead th[data-sortable]:not([aria-sort]) .usa-table__header__button:hover .usa-icon>g.unsorted{fill:black}.usa-table--borderless th,.usa-table--borderless td{border-left:0;border-right:0}.usa-table--compact th,.usa-table--compact td{padding:0.25rem 0.75rem}.usa-table--striped tbody tr:nth-child(odd) td,.usa-table--striped tbody tr:nth-child(odd) th{background-color:#f0f0f0;color:#1b1b1b}.usa-table--striped tbody tr:nth-child(odd) td[data-sort-active],.usa-table--striped tbody tr:nth-child(odd) th[data-sort-active]{background-color:#c3ebfa;color:#1b1b1b}@media all and (max-width: 29.99em){.usa-table--stacked thead{display:none}.usa-table--stacked th,.usa-table--stacked td{border-bottom-width:0;display:block;width:100%}.usa-table--stacked tr{border-bottom:0.25rem solid #1b1b1b;border-top-width:0;width:100%}.usa-table--stacked tr th:first-child,.usa-table--stacked tr td:first-child{border-top-width:0}.usa-table--stacked tr:nth-child(odd) td,.usa-table--stacked tr:nth-child(odd) th{background-color:inherit}.usa-table--stacked tr:first-child th:first-child,.usa-table--stacked tr:first-child td:first-child{border-top:0.25rem solid #1b1b1b}.usa-table--stacked th[data-label],.usa-table--stacked td[data-label]{padding-bottom:0.75rem}.usa-table--stacked th[data-label]:before,.usa-table--stacked td[data-label]:before{content:attr(data-label);display:block;font-weight:700;margin:-0.5rem -1rem 0rem;padding:0.75rem 1rem 0.25rem}}@media all and (max-width: 29.99em){.usa-table--stacked-header thead{display:none}.usa-table--stacked-header th,.usa-table--stacked-header td{border-bottom-width:0;display:block;width:100%}.usa-table--stacked-header tr{border-bottom:0.25rem solid #1b1b1b;border-top-width:0;width:100%}.usa-table--stacked-header tr th:first-child,.usa-table--stacked-header tr td:first-child{border-top-width:0}.usa-table--stacked-header tr:nth-child(odd) td,.usa-table--stacked-header tr:nth-child(odd) th{background-color:inherit}.usa-table--stacked-header tr:first-child th:first-child,.usa-table--stacked-header tr:first-child td:first-child{border-top:0.25rem solid #1b1b1b}.usa-table--stacked-header th[data-label],.usa-table--stacked-header td[data-label]{padding-bottom:0.75rem}.usa-table--stacked-header th[data-label]:before,.usa-table--stacked-header td[data-label]:before{content:attr(data-label);display:block;font-weight:700;margin:-0.5rem -1rem 0rem;padding:0.75rem 1rem 0.25rem}.usa-table--stacked-header tr td:first-child,.usa-table--stacked-header tr th:first-child{font-family:Source Sans Pro Web, Helvetica Neue, Helvetica, Roboto, Arial, sans-serif;font-size:1.06rem;line-height:1.1;background-color:#dfe1e2;color:#1b1b1b;font-weight:700;padding:0.75rem 1rem}.usa-table--stacked-header tr td:first-child:before,.usa-table--stacked-header tr th:first-child:before{display:none}}.width-mobile .usa-table--stacked thead{display:none}.width-mobile .usa-table--stacked th,.width-mobile .usa-table--stacked td{border-bottom-width:0;display:block;width:100%}.width-mobile .usa-table--stacked tr{border-bottom:0.25rem solid #1b1b1b;border-top-width:0;width:100%}.width-mobile .usa-table--stacked tr th:first-child,.width-mobile .usa-table--stacked tr td:first-child{border-top-width:0}.width-mobile .usa-table--stacked tr:nth-child(odd) td,.width-mobile .usa-table--stacked tr:nth-child(odd) th{background-color:inherit}.width-mobile .usa-table--stacked tr:first-child th:first-child,.width-mobile .usa-table--stacked tr:first-child td:first-child{border-top:0.25rem solid #1b1b1b}.width-mobile .usa-table--stacked th[data-label],.width-mobile .usa-table--stacked td[data-label]{padding-bottom:0.75rem}.width-mobile .usa-table--stacked th[data-label]:before,.width-mobile .usa-table--stacked td[data-label]:before{content:attr(data-label);display:block;font-weight:700;margin:-0.5rem -1rem 0rem;padding:0.75rem 1rem 0.25rem}.width-mobile .usa-table--stacked-header thead{display:none}.width-mobile .usa-table--stacked-header th,.width-mobile .usa-table--stacked-header td{border-bottom-width:0;display:block;width:100%}.width-mobile .usa-table--stacked-header tr{border-bottom:0.25rem solid #1b1b1b;border-top-width:0;width:100%}.width-mobile .usa-table--stacked-header tr th:first-child,.width-mobile .usa-table--stacked-header tr td:first-child{border-top-width:0}.width-mobile .usa-table--stacked-header tr:nth-child(odd) td,.width-mobile .usa-table--stacked-header tr:nth-child(odd) th{background-color:inherit}.width-mobile .usa-table--stacked-header tr:first-child th:first-child,.width-mobile .usa-table--stacked-header tr:first-child td:first-child{border-top:0.25rem solid #1b1b1b}.width-mobile .usa-table--stacked-header th[data-label],.width-mobile .usa-table--stacked-header td[data-label]{padding-bottom:0.75rem}.width-mobile .usa-table--stacked-header th[data-label]:before,.width-mobile .usa-table--stacked-header td[data-label]:before{content:attr(data-label);display:block;font-weight:700;margin:-0.5rem -1rem 0rem;padding:0.75rem 1rem 0.25rem}.width-mobile .usa-table--stacked-header tr td:first-child,.width-mobile .usa-table--stacked-header tr th:first-child{font-family:Source Sans Pro Web, Helvetica Neue, Helvetica, Roboto, Arial, sans-serif;font-size:1.06rem;line-height:1.1;background-color:#dfe1e2;color:#1b1b1b;font-weight:700;padding:0.75rem 1rem}.width-mobile .usa-table--stacked-header tr td:first-child:before,.width-mobile .usa-table--stacked-header tr th:first-child:before{display:none}.usa-table--sticky-header{border:1px solid #1b1b1b;border-collapse:separate}.usa-table--sticky-header td,.usa-table--sticky-header th{border-left:none;border-top:none}.usa-table--sticky-header td:last-child,.usa-table--sticky-header th:last-child{border-right:none}.usa-table--sticky-header tbody tr:last-child td,.usa-table--sticky-header tbody tr:last-child th{border-bottom:none}.usa-table--sticky-header thead{position:-webkit-sticky;position:sticky;top:-1px}.usa-table--sticky-header.usa-table--borderless{border:none}.usa-table--sticky-header.usa-table--borderless thead th{background-color:white}.usa-table--sticky-header.usa-table--borderless td,.usa-table--sticky-header.usa-table--borderless th{border-right:none}.usa-table-container--scrollable{margin:1.25rem 0;overflow-y:hidden}.usa-table-container--scrollable .usa-table{margin:0}.usa-table-container--scrollable td{white-space:nowrap}va-table-row{display:none}',VaTableStyle0=vaTableCss,VaTable$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.tableTitle=void 0,this.tableType="borderless",this.stacked=!0,this.scrollable=!1,this.sortable=!1,this.striped=!1,this.fullWidth=!1,this.rows=void 0,this.cols=void 0,this.cells=null}getCellsInRow(a){const t=a.querySelectorAll("span"),e=Array.from(t);return this.cols||(this.cols=e.length),e}getRows(){const a=Array.from(this.el.querySelectorAll("va-table-row"));return a.forEach((a=>a.removeAttribute("role"))),this.rows||(this.rows=a.length),a}getAllCells(a=this.getRows()){const t=[];let e=0;for(const r of a){const a=this.getCellsInRow(r);a.forEach((a=>{a.setAttribute("slot",`va-table-slot-${e}`),e++})),t.push(...a)}this.cells=t}makeFragment(){const a=document.createDocumentFragment();return this.cells.forEach((t=>{a.appendChild(t.cloneNode(!0))})),a}makeVATable(a,t){const e=document.createElement("va-table-inner");e.setAttribute("rows",`${this.rows}`),e.setAttribute("cols",`${this.cols}`),e.setAttribute("stacked",this.stacked&&!this.sortable?"true":"false"),e.setAttribute("sortable",`${this.sortable}`),e.setAttribute("scrollable",this.scrollable?"true":"false"),e.setAttribute("striped",this.striped?"true":"false"),this.sortable&&a&&t&&(e.dataset.sortdir=a,e.dataset.sortindex=`${t}`),this.tableTitle&&e.setAttribute("table-title",this.tableTitle),this.tableType&&e.setAttribute("table-type",this.tableType),this.fullWidth&&e.setAttribute("full-width",String(this.fullWidth));const r=this.makeFragment();return e.appendChild(r),e}resetVaTableInner(){const a=this.el.querySelector("va-table-inner");a&&(a.remove(),this.rows=null,this.cols=null,this.cells=null)}watchForDataChanges(){const a=this.el.querySelectorAll("va-table-row")[1];this.observer=new MutationObserver((()=>{this.resetVaTableInner(),this.addVaTableInner()})),this.observer.observe(a,{childList:!0,subtree:!0,characterData:!0})}disconnectedCallback(){this.observer&&this.observer.disconnect()}addVaTableInner(a=null,t=null){this.getAllCells();const e=this.makeVATable(a,t);this.el.appendChild(e)}componentWillLoad(){this.addVaTableInner(),this.watchForDataChanges()}doSort(a){a.stopPropagation();const{index:t,sortdir:e}=a.detail,[r,...s]=this.getRows(),o=getCompareFunc.bind(this)(s,t,e);if(null!==o){s.sort(((a,e)=>{const r=a.children[t].innerHTML.trim(),s=e.children[t].innerHTML.trim();return o(r,s)}));const a=[r,...s];this.resetVaTableInner(),this.el.replaceChildren(...a),this.addVaTableInner("ascending"===e?"descending":"ascending",t)}}render(){return h(Host,{key:"4e03f68e870ce1699e182428d61c7a51d2a06f24"},h("slot",{key:"0f0ecd7dd39aab374fb7a0ca88d61c64c58dda72"}))}get el(){return this}static get style(){return VaTableStyle0}},[1,"va-table",{tableTitle:[1,"table-title"],tableType:[1,"table-type"],stacked:[4],scrollable:[4],sortable:[4],striped:[4],fullWidth:[4,"full-width"],rows:[32],cols:[32],cells:[32]},[[0,"sortTable","doSort"]]]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-table","va-icon","va-table-inner"].forEach((a=>{switch(a){case"va-table":customElements.get(a)||customElements.define(a,VaTable$1);break;case"va-icon":customElements.get(a)||defineCustomElement$3();break;case"va-table-inner":customElements.get(a)||defineCustomElement$2()}}))}const VaTable=VaTable$1,defineCustomElement=defineCustomElement$1;export{VaTable,defineCustomElement};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement,HTMLElement,createEvent,h,Host,Fragment}from"@stencil/core/internal/client";const vaTelephoneCss="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{font-size:1.06rem}a{white-space:nowrap}a,a:hover{text-decoration:underline}",VaTelephoneStyle0=vaTelephoneCss,VaTelephone=proxyCustomElement(class t extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.contact=void 0,this.extension=void 0,this.notClickable=!1,this.international=!1,this.countryCode=void 0,this.tty=!1,this.sms=!1,this.vanity=void 0,this.messageAriaDescribedby=void 0}static cleanContact(t){return(t||"").replace(/[^\d]/g,"")}static splitContact(e){const n=t.cleanContact(e);if(10===n.length){const t=[.../^(\d{3})(\d{3})(\d{4})$/g.exec(n)];return 4===t.length?t.slice(-3):[n]}return[n]}static formatPhoneNumber({contact:e,extension:n,international:o=!1,countryCode:i,vanity:a,tty:s=!1}){const r=i?[e]:t.splitContact(e);let c=r.join("");if(10===c.length&&!i){const[t,e,i]=r;c=`${t}-${e}-${i}`,o&&(c=`+1-${c}`),n&&(c=`${c}, ext. ${n}`),a&&(c=`${t}-${e}-${a} (${i})`)}return i&&(c=`+${i} ${c}`),s&&(c=`TTY: ${c}`),c}static createHref({contact:e,extension:n,sms:o,countryCode:i}){const a=t.cleanContact(e),s=3===a.length;let r=null;return r=o?`sms:${a}`:s?`tel:${a}`:i?`tel:+${i}${a}`:`tel:+1${a}`,`${r}${n?`,${n}`:""}`}handleClick(){this.componentLibraryAnalytics.emit({componentName:"va-telephone",action:"click",details:{contact:this.contact,extension:this.extension}})}render(){const{contact:e,extension:n,notClickable:o,international:i,countryCode:a,tty:s,vanity:r,sms:c,messageAriaDescribedby:l}=this,d=t.formatPhoneNumber({contact:e,extension:n,international:i,countryCode:a,vanity:r,tty:s}),u=t.createHref({contact:e,extension:n,sms:c,countryCode:a}),p=l?"number-description":null;return h(Host,{key:"a6227c0bd2f393091f2a6f779aee551cc042fe09"},o?h(Fragment,null,h("span",{"aria-
|
|
1
|
+
import{proxyCustomElement,HTMLElement,createEvent,h,Host,Fragment}from"@stencil/core/internal/client";const vaTelephoneCss="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{font-size:1.06rem}a{white-space:nowrap}a,a:hover{text-decoration:underline}",VaTelephoneStyle0=vaTelephoneCss,VaTelephone=proxyCustomElement(class t extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.contact=void 0,this.extension=void 0,this.notClickable=!1,this.international=!1,this.countryCode=void 0,this.tty=!1,this.sms=!1,this.vanity=void 0,this.messageAriaDescribedby=void 0}static cleanContact(t){return(t||"").replace(/[^\d]/g,"")}static splitContact(e){const n=t.cleanContact(e);if(10===n.length){const t=[.../^(\d{3})(\d{3})(\d{4})$/g.exec(n)];return 4===t.length?t.slice(-3):[n]}return[n]}static formatPhoneNumber({contact:e,extension:n,international:o=!1,countryCode:i,vanity:a,tty:s=!1}){const r=i?[e]:t.splitContact(e);let c=r.join("");if(10===c.length&&!i){const[t,e,i]=r;c=`${t}-${e}-${i}`,o&&(c=`+1-${c}`),n&&(c=`${c}, ext. ${n}`),a&&(c=`${t}-${e}-${a} (${i})`)}return i&&(c=`+${i} ${c}`),s&&(c=`TTY: ${c}`),c}static createHref({contact:e,extension:n,sms:o,countryCode:i}){const a=t.cleanContact(e),s=3===a.length;let r=null;return r=o?`sms:${a}`:s?`tel:${a}`:i?`tel:+${i}${a}`:`tel:+1${a}`,`${r}${n?`,${n}`:""}`}handleClick(){this.componentLibraryAnalytics.emit({componentName:"va-telephone",action:"click",details:{contact:this.contact,extension:this.extension}})}render(){const{contact:e,extension:n,notClickable:o,international:i,countryCode:a,tty:s,vanity:r,sms:c,messageAriaDescribedby:l}=this,d=t.formatPhoneNumber({contact:e,extension:n,international:i,countryCode:a,vanity:r,tty:s}),u=t.createHref({contact:e,extension:n,sms:c,countryCode:a}),p=l?"number-description":null;return h(Host,{key:"a6227c0bd2f393091f2a6f779aee551cc042fe09"},o?h(Fragment,null,h("span",{"aria-describedby":p},d)):h("a",{"aria-describedby":p,href:u,onClick:this.handleClick.bind(this)},d),l&&h("span",{key:"38fe237c3f2cd452453d5d858a7f8d6c048d1a1e",id:"number-description",class:"sr-only"},l))}static get style(){return VaTelephoneStyle0}},[1,"va-telephone",{contact:[1],extension:[1],notClickable:[4,"not-clickable"],international:[4],countryCode:[1,"country-code"],tty:[4],sms:[4],vanity:[1],messageAriaDescribedby:[1,"message-aria-describedby"]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["va-telephone"].forEach((t=>{"va-telephone"===t&&(customElements.get(t)||customElements.define(t,VaTelephone))}))}export{VaTelephone as V,defineCustomElement as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Build,proxyCustomElement,HTMLElement,createEvent,forceUpdate,h,Fragment,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import"./i18n-setup.js";import"./contacts.js";import{c as consoleDevError,b as getCharacterMessage,a as getHeaderLevel}from"./utils.js";import{i as instance}from"./i18next.js";const vaTextareaCss='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", "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-textarea,.usa-hint,.usa-input{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3}.usa-textarea,.usa-input{border-width:1px;border-color:#565c65;border-style:solid;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:0;color:#1b1b1b;display:block;height:2.5rem;margin-top:0.5rem;max-width:30rem;padding:0.5rem;width:100%}.usa-sr-only{position:absolute;left:-999em;right:auto}.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-input:disabled,.usa-input[aria-disabled=true]{color:#454545;background-color:#c9c9c9;cursor:not-allowed;opacity:1;-webkit-text-fill-color:#454545}.usa-input:disabled:hover,.usa-input:disabled:active,.usa-input:disabled:focus,.usa-input:disabled.usa-focus,.usa-input[aria-disabled=true]:hover,.usa-input[aria-disabled=true]:active,.usa-input[aria-disabled=true]:focus,.usa-input[aria-disabled=true].usa-focus{color:#454545;background-color:#c9c9c9}@media (forced-colors: active){.usa-input:disabled,.usa-input[aria-disabled=true]{border:0;color:GrayText}.usa-input:disabled:hover,.usa-input:disabled:active,.usa-input:disabled:focus,.usa-input:disabled.usa-focus,.usa-input[aria-disabled=true]:hover,.usa-input[aria-disabled=true]:active,.usa-input[aria-disabled=true]:focus,.usa-input[aria-disabled=true].usa-focus{color:GrayText}}@media (forced-colors: active){.usa-input:disabled,.usa-input[aria-disabled=true]{border:2px solid GrayText}}.usa-input--error{border-width:0.25rem;border-color:#b50909;border-style:solid;padding-top:calc(0.5rem - 0.25rem);padding-bottom:calc(0.5rem - 0.25rem)}.usa-input--success{border-width:0.25rem;border-color:#00a91c;border-style:solid;padding-top:calc(0.5rem - 0.25rem);padding-bottom:calc(0.5rem - 0.25rem)}.usa-error-message{padding-bottom:0.25rem;padding-top:0.25rem;color:#b50909;display:block;font-weight:700}.usa-hint{color:#71767a}.usa-hint--required{color:#b50909}.usa-textarea:disabled,.usa-textarea[aria-disabled=true]{color:#454545;background-color:#c9c9c9;cursor:not-allowed;opacity:1}.usa-textarea:disabled:hover,.usa-textarea:disabled:active,.usa-textarea:disabled:focus,.usa-textarea:disabled.usa-focus,.usa-textarea[aria-disabled=true]:hover,.usa-textarea[aria-disabled=true]:active,.usa-textarea[aria-disabled=true]:focus,.usa-textarea[aria-disabled=true].usa-focus{color:#454545;background-color:#c9c9c9}@media (forced-colors: active){.usa-textarea:disabled,.usa-textarea[aria-disabled=true]{border:0;color:GrayText}.usa-textarea:disabled:hover,.usa-textarea:disabled:active,.usa-textarea:disabled:focus,.usa-textarea:disabled.usa-focus,.usa-textarea[aria-disabled=true]:hover,.usa-textarea[aria-disabled=true]:active,.usa-textarea[aria-disabled=true]:focus,.usa-textarea[aria-disabled=true].usa-focus{color:GrayText}}@media (forced-colors: active){.usa-textarea:disabled,.usa-textarea[aria-disabled=true]{border:2px solid GrayText}}.usa-textarea{height:10rem}.usa-character-count__status{display:inline-block;padding-top:0.25rem}.usa-character-count__status.usa-character-count__status--invalid{color:#b50909;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}}:host{color:var(--vads-color-base);display:block;resize:both;font-family:var(--font-source-sans)}:host(:focus){outline:none !important}.usa-hint{display:block}',VaTextareaStyle0=vaTextareaCss;Build.isTesting&&instance.init({lng:"cimode"});const VaTextarea$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.handleInput=e=>{const a=e.target;this.value=a.value},this.handleBlur=()=>{this.enableAnalytics&&this.value&&this.componentLibraryAnalytics.emit({componentName:"va-textarea",action:"blur",details:{label:this.label,value:this.value}})},this.label=void 0,this.error=void 0,this.placeholder=void 0,this.name=void 0,this.required=!1,this.hint=void 0,this.messageAriaDescribedby=void 0,this.maxlength=void 0,this.value=void 0,this.enableAnalytics=!1,this.labelHeaderLevel=void 0,this.headerAriaDescribedby=void 0,this.useFormsPattern=void 0,this.formHeadingLevel=3,this.formHeading=void 0,this.charcount=!1}connectedCallback(){instance.on("languageChanged",(()=>{forceUpdate(this.el)}))}disconnectedCallback(){instance.off("languageChanged")}getMaxlength(){if(!(this.maxlength<=0))return this.maxlength;consoleDevError("The maxlength prop must be positive!")}render(){const{label:e,error:a,placeholder:t,name:r,required:i,value:s,hint:o,charcount:n,messageAriaDescribedby:l,useFormsPattern:d,formHeadingLevel:c,headerAriaDescribedby:u,formHeading:m}=this,b=this.getMaxlength(),f=`${a?"input-error-message":""} ${n&&b?"charcount-message":""} ${l?"input-message":""}`.trim()||null,p=`${d&&m?"form-question":""} ${d?"form-description":""} ${d&&e?"input-label":""}`.trim()||null,g=getHeaderLevel(this.labelHeaderLevel),v=u?"header-message":null,x=n&&(null==s?void 0:s.length)>b,y=classnames({"usa-label":!0,"usa-label--error":a}),w=classnames({"usa-textarea":!0,"usa-input--error":a}),k=classnames({"usa-hint":!0,"usa-character-count__status":n,"usa-character-count__status--invalid":n&&b&&(null==s?void 0:s.length)>b});let T=null;if("single"===d||"multiple"===d){const e=getHeaderLevel(c);T=h(Fragment,{key:"e65c44d03ceae41e4bfc5e7af1c583b29cd31fd2"},m&&h(e,{key:"0a86be92c85bec0cad41b302c8b5efd92fb790e2",id:"form-question",part:"form-header"},m),h("div",{key:"afc44aa093f1c82d950de977c573880b083fb4dc",id:"form-description"},h("slot",{key:"9d408f29e8797e74563a2c158bd5561705d3fc9d",name:"form-description"})))}return h(Host,{key:"d1b8d8a52b428ad5ef519184157fe5e7eeed1b95"},T,h("div",{key:"7fcf77fb29e78984f6bca110c2d0b1176f1c554c",class:"input-wrap"},e&&h("label",{key:"099ff5748b5caaf4bc44e2346564e8912e9eeb4e",htmlFor:"input-type-textarea",id:"input-label",class:y,part:"label"},g?h(g,{part:"header","aria-describedby":v},e):e," ","multiple"===d&&h("span",{key:"5651d1bc3f845bd945e296a95c3078be4e4f7bcd",id:"header-message",class:"usa-sr-only"},e),u&&h("span",{key:"542f807f481139a1f6cb55c7944ba15491526529",id:"header-message",class:"usa-sr-only"},u),i&&h("span",{key:"d9132d576c6f724b4e940f708babf3c4ee99fbe0",class:"usa-label--required"},instance.t("required")),o&&h("div",{key:"e02bef853ee66515e236e16d5c01a16be07efa98",class:"usa-hint"},o)),h("slot",{key:"be2ca6ea534a80aa8f79ecdffbcc29185c2e3917"}),h("span",{key:"fd5b8d2953ac1a84799de59980abe6cc3dabeb02",id:"input-error-message",role:"alert"},a&&h(Fragment,{key:"daf59db9af3585e19331a4a5a1c37c86134899e8"},h("span",{key:"7ea64d767b941f32c80227564363feb02874ac67",class:"usa-sr-only"},instance.t("error")),h("span",{key:"2603c7cfa2536a15381336c27d4df0935838c466",class:"usa-error-message"},a))),h("textarea",{key:"f61c5180cda95dbbaf0fb0373bae7ed4e7a2f42f",class:w,"aria-describedby":f,"aria-invalid":a||x?"true":"false","aria-labelledby":p,onInput:this.handleInput,onBlur:this.handleBlur,id:"input-type-textarea",placeholder:t,name:r,maxLength:n?void 0:b,value:s,part:"input-type-textarea"}),!n&&b&&(null==s?void 0:s.length)>=b&&h("span",{key:"5eb857e04fe8ed3f8705d6d858f122a1c08ac150",class:k,"aria-live":"polite"},instance.t("max-chars",{length:b})),n&&b&&h("span",{key:"24a32e56135fdc88f3a97871bf6ccde00c96ac4e",id:"charcount-message",class:k,"aria-live":"polite"},getCharacterMessage(s,b)),l&&h("span",{key:"3a221246779adcbbb919fbf41bfe4051fc8aa357",id:"input-message",class:"usa-sr-only dd-privacy-hidden"},l)))}get el(){return this}static get style(){return VaTextareaStyle0}},[1,"va-textarea",{label:[1],error:[1],placeholder:[1],name:[1],required:[4],hint:[1],messageAriaDescribedby:[1,"message-aria-describedby"],maxlength:[2],value:[1537],enableAnalytics:[4,"enable-analytics"],labelHeaderLevel:[1,"label-header-level"],headerAriaDescribedby:[1,"header-aria-describedby"],useFormsPattern:[1,"use-forms-pattern"],formHeadingLevel:[2,"form-heading-level"],formHeading:[1,"form-heading"],charcount:[4]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-textarea"].forEach((e=>{"va-textarea"===e&&(customElements.get(e)||customElements.define(e,VaTextarea$1))}))}const VaTextarea=VaTextarea$1,defineCustomElement=defineCustomElement$1;export{VaTextarea,defineCustomElement};
|
|
1
|
+
import{Build,proxyCustomElement,HTMLElement,createEvent,forceUpdate,h,Fragment,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import"./i18n-setup.js";import"./contacts.js";import{c as consoleDevError,b as getCharacterMessage,a as getHeaderLevel}from"./utils.js";import{i as instance}from"./i18next.js";const vaTextareaCss='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", "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-textarea,.usa-hint,.usa-input{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3}.usa-textarea,.usa-input{border-width:1px;border-color:#565c65;border-style:solid;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:0;color:#1b1b1b;display:block;height:2.5rem;margin-top:0.5rem;max-width:30rem;padding:0.5rem;width:100%}.usa-sr-only{position:absolute;left:-999em;right:auto}.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-input:disabled,.usa-input[aria-disabled=true]{color:#454545;background-color:#c9c9c9;cursor:not-allowed;opacity:1;-webkit-text-fill-color:#454545}.usa-input:disabled:hover,.usa-input:disabled:active,.usa-input:disabled:focus,.usa-input:disabled.usa-focus,.usa-input[aria-disabled=true]:hover,.usa-input[aria-disabled=true]:active,.usa-input[aria-disabled=true]:focus,.usa-input[aria-disabled=true].usa-focus{color:#454545;background-color:#c9c9c9}@media (forced-colors: active){.usa-input:disabled,.usa-input[aria-disabled=true]{border:0;color:GrayText}.usa-input:disabled:hover,.usa-input:disabled:active,.usa-input:disabled:focus,.usa-input:disabled.usa-focus,.usa-input[aria-disabled=true]:hover,.usa-input[aria-disabled=true]:active,.usa-input[aria-disabled=true]:focus,.usa-input[aria-disabled=true].usa-focus{color:GrayText}}@media (forced-colors: active){.usa-input:disabled,.usa-input[aria-disabled=true]{border:2px solid GrayText}}.usa-input--error{border-width:0.25rem;border-color:#b50909;border-style:solid;padding-top:calc(0.5rem - 0.25rem);padding-bottom:calc(0.5rem - 0.25rem)}.usa-input--success{border-width:0.25rem;border-color:#00a91c;border-style:solid;padding-top:calc(0.5rem - 0.25rem);padding-bottom:calc(0.5rem - 0.25rem)}.usa-error-message{padding-bottom:0.25rem;padding-top:0.25rem;color:#b50909;display:block;font-weight:700}.usa-hint{color:#71767a}.usa-hint--required{color:#b50909}.usa-textarea:disabled,.usa-textarea[aria-disabled=true]{color:#454545;background-color:#c9c9c9;cursor:not-allowed;opacity:1}.usa-textarea:disabled:hover,.usa-textarea:disabled:active,.usa-textarea:disabled:focus,.usa-textarea:disabled.usa-focus,.usa-textarea[aria-disabled=true]:hover,.usa-textarea[aria-disabled=true]:active,.usa-textarea[aria-disabled=true]:focus,.usa-textarea[aria-disabled=true].usa-focus{color:#454545;background-color:#c9c9c9}@media (forced-colors: active){.usa-textarea:disabled,.usa-textarea[aria-disabled=true]{border:0;color:GrayText}.usa-textarea:disabled:hover,.usa-textarea:disabled:active,.usa-textarea:disabled:focus,.usa-textarea:disabled.usa-focus,.usa-textarea[aria-disabled=true]:hover,.usa-textarea[aria-disabled=true]:active,.usa-textarea[aria-disabled=true]:focus,.usa-textarea[aria-disabled=true].usa-focus{color:GrayText}}@media (forced-colors: active){.usa-textarea:disabled,.usa-textarea[aria-disabled=true]{border:2px solid GrayText}}.usa-textarea{height:10rem}.usa-character-count__status{display:inline-block;padding-top:0.25rem}.usa-character-count__status.usa-character-count__status--invalid{color:#b50909;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}}:host{color:var(--vads-color-base);display:block;resize:both;font-family:var(--font-source-sans)}:host(:focus){outline:none !important}.usa-hint{display:block}h1 .usa-label,h2 .usa-label,h3 .usa-label,h4 .usa-label,h5 .usa-label,h6 .usa-label{font-family:inherit;font-size:inherit;font-weight:inherit}h1 .usa-label .usa-label--required,h2 .usa-label .usa-label--required,h3 .usa-label .usa-label--required,h4 .usa-label .usa-label--required,h5 .usa-label .usa-label--required,h6 .usa-label .usa-label--required{font-family:var(--font-source-sans);font-size:initial;font-weight:initial}',VaTextareaStyle0=vaTextareaCss;Build.isTesting&&instance.init({lng:"cimode"});const VaTextarea$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.handleInput=e=>{const a=e.target;this.value=a.value},this.handleBlur=()=>{this.enableAnalytics&&this.value&&this.componentLibraryAnalytics.emit({componentName:"va-textarea",action:"blur",details:{label:this.label,value:this.value}})},this.label=void 0,this.error=void 0,this.placeholder=void 0,this.name=void 0,this.required=!1,this.hint=void 0,this.messageAriaDescribedby=void 0,this.maxlength=void 0,this.value=void 0,this.enableAnalytics=!1,this.labelHeaderLevel=void 0,this.headerAriaDescribedby=void 0,this.useFormsPattern=void 0,this.formHeadingLevel=3,this.formHeading=void 0,this.charcount=!1}connectedCallback(){instance.on("languageChanged",(()=>{forceUpdate(this.el)}))}disconnectedCallback(){instance.off("languageChanged")}getMaxlength(){if(!(this.maxlength<=0))return this.maxlength;consoleDevError("The maxlength prop must be positive!")}render(){const{label:e,error:a,placeholder:t,name:r,required:i,value:s,hint:o,charcount:l,messageAriaDescribedby:n,useFormsPattern:d,formHeadingLevel:u,headerAriaDescribedby:c,formHeading:b}=this,m=this.getMaxlength(),f=`${a?"input-error-message":""} ${l&&m?"charcount-message":""} ${n?"input-message":""}`.trim()||null,p=`${d&&b?"form-question":""} ${d?"form-description":""} ${d&&e?"input-label":""}`.trim()||null,g=getHeaderLevel(this.labelHeaderLevel),v=c?"header-message":null,x=l&&(null==s?void 0:s.length)>m,y=classnames({"usa-label":!0,"usa-label--error":a}),w=classnames({"usa-textarea":!0,"usa-input--error":a}),k=classnames({"usa-hint":!0,"usa-character-count__status":l,"usa-character-count__status--invalid":l&&m&&(null==s?void 0:s.length)>m});let T=null;if("single"===d||"multiple"===d){const e=getHeaderLevel(u);T=h(Fragment,{key:"360b1728a7a82a5c30d6e47bff8bbbd210f91ab9"},b&&h(e,{key:"a991b9c8a18f5890862821b7cafbd46513ac3725",id:"form-question",part:"form-header"},b),h("div",{key:"6e093523d9935f8a529c4084a8be16c4a11bf103",id:"form-description"},h("slot",{key:"9d1f6fcad5c242f59eb33ee6a7b89786ddb50afc",name:"form-description"})))}const H=h("label",{key:"f08887a1b95fd18ad50e202e59c905cf269890ff",htmlFor:"input-type-textarea",id:"input-label",class:y,part:"label"},e,"multiple"===d&&h("span",{key:"b0abfef84e801edb4b7f29e2477aef945ae906b8",id:"header-message",class:"usa-sr-only"},e),c&&h("span",{key:"21251170d27c1b2679315b47ad0c8983b8d9bca5",id:"header-message",class:"usa-sr-only"},c),i&&h("span",{key:"7df268e1815267c1b04106da4892b92f9d87c661",class:"usa-label--required"}," ",instance.t("required")),o&&h("div",{key:"f7edd37578db7c25da76ef70d2b9d12d6a063446",class:"usa-hint"},o));return h(Host,{key:"d2d28c869ac1992c80cc01a5da7da10bec92c315"},T,h("div",{key:"c02f236ace0b3534ddf0427cec3d164d9d8e7aad",class:"input-wrap"},e&&g?h(g,{part:"header","aria-describedby":v},H):h(Fragment,null,H),h("slot",{key:"d7ed98d78b960edd39028ae84f38f9fc65a0ee86"}),h("span",{key:"eb70429f74948c36816ffdfbaa34d1365e1bc0a9",id:"input-error-message",role:"alert"},a&&h(Fragment,{key:"9efccc00af46fd7ffa154ddeb65aeae4e328adb5"},h("span",{key:"f1b5f8fa9c3f74600438a4d50578f9d9bcd2ef50",class:"usa-sr-only"},instance.t("error")),h("span",{key:"e7c41428ba32ad9d866fc74f692dd3284c148408",class:"usa-error-message"},a))),h("textarea",{key:"d30dc824d5caf2fc2790cefcd955064d721a43ca",class:w,"aria-describedby":f,"aria-invalid":a||x?"true":"false","aria-labelledby":p,onInput:this.handleInput,onBlur:this.handleBlur,id:"input-type-textarea",placeholder:t,name:r,maxLength:l?void 0:m,value:s,part:"input-type-textarea"}),!l&&m&&(null==s?void 0:s.length)>=m&&h("span",{key:"d745aeb889c683a2f4a111e72fb135bc6d5c8fa8",class:k,"aria-live":"polite"},instance.t("max-chars",{length:m})),l&&m&&h("span",{key:"978ef3079142bbfaedee44eed0679ae3c1884bc3",id:"charcount-message",class:k,"aria-live":"polite"},getCharacterMessage(s,m)),n&&h("span",{key:"9a277a391dfcbb7c5c99ebf5fcb0d51ad40b7492",id:"input-message",class:"usa-sr-only dd-privacy-hidden"},n)))}get el(){return this}static get style(){return VaTextareaStyle0}},[1,"va-textarea",{label:[1],error:[1],placeholder:[1],name:[1],required:[4],hint:[1],messageAriaDescribedby:[1,"message-aria-describedby"],maxlength:[2],value:[1537],enableAnalytics:[4,"enable-analytics"],labelHeaderLevel:[1,"label-header-level"],headerAriaDescribedby:[1,"header-aria-describedby"],useFormsPattern:[1,"use-forms-pattern"],formHeadingLevel:[2,"form-heading-level"],formHeading:[1,"form-heading"],charcount:[4]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-textarea"].forEach((e=>{"va-textarea"===e&&(customElements.get(e)||customElements.define(e,VaTextarea$1))}))}const VaTextarea=VaTextarea$1,defineCustomElement=defineCustomElement$1;export{VaTextarea,defineCustomElement};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@department-of-veterans-affairs/component-library",
|
|
3
3
|
"description": "VA.gov component library. Includes React and web components.",
|
|
4
|
-
"version": "49.
|
|
4
|
+
"version": "49.1.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "webpack"
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"module": "src/main.js",
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@department-of-veterans-affairs/react-components": "28.1.0",
|
|
19
|
-
"@department-of-veterans-affairs/web-components": "17.
|
|
19
|
+
"@department-of-veterans-affairs/web-components": "17.1.0",
|
|
20
20
|
"i18next": "^21.6.14",
|
|
21
21
|
"i18next-browser-languagedetector": "^6.1.4",
|
|
22
22
|
"react-focus-on": "^3.5.1",
|