// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built define("exports ./componentsUtils ./loadable ./t9n ./locale ./component ./icon".split(" "),function(e,b,d,c,f,l,m){function g(){"undefined"!==typeof customElements&&["calcite-table-header","calcite-icon"].forEach(a=>{switch(a){case "calcite-table-header":customElements.get(a)||customElements.define(a,h);break;case "calcite-icon":customElements.get(a)||m.defineCustomElement()}})}const h=b.proxyCustomElement(class extends b.H{constructor(){super();this.__registerHost();this.__attachShadow();this.onContainerBlur= ()=>{this.focused=!1};this.onContainerFocus=()=>{this.focused=!0};this.alignment="start";this.rowSpan=this.heading=this.description=this.colSpan=void 0;this.interactionMode="interactive";this.lastCell=void 0;this.numberCell=!1;this.parentRowAlignment="start";this.selectedRowCountLocalized=this.selectedRowCount=this.scale=this.positionInRow=this.parentRowType=this.parentRowIsSelected=void 0;this.selectionCell=!1;this.defaultMessages=this.messageOverrides=this.messages=this.bodyRowCount=this.selectionMode= void 0;this.focused=!1;this.effectiveLocale=this.screenReaderText=""}onSelectedChange(){this.updateScreenReaderText()}onMessagesChange(){}async componentWillLoad(){d.setUpLoadableComponent(this);await c.setUpMessages(this);this.updateScreenReaderText()}componentDidLoad(){d.setComponentLoaded(this)}connectedCallback(){f.connectLocalized(this);c.connectMessages(this)}disconnectedCallback(){f.disconnectLocalized(this);c.disconnectMessages(this)}effectiveLocaleChange(){c.updateMessages(this,this.effectiveLocale)}async setFocus(){await d.componentFocusable(this); this.containerEl.focus()}updateScreenReaderText(){var a="";a=`${this.selectedRowCountLocalized} ${this.messages?.selected}`;this.screenReaderText=a=this.numberCell?this.messages?.rowNumber:"single"===this.selectionMode?`${this.messages?.selectionColumn}. ${a}`:this.bodyRowCount===this.selectedRowCount?`${this.messages?.selectionColumn}. ${this.messages?.all} ${a} ${this.messages?.keyboardDeselectAll}`:`${this.messages?.selectionColumn}. ${a} ${this.messages?.keyboardSelectAll}`}render(){const a=this.selectedRowCount=== this.bodyRowCount,n=a?"check-square-f":"check-square",k="static"===this.interactionMode&&!this.selectionCell;return b.h(b.Host,{key:"8903d493aaa6fe46c1e7ee00814bc0d409fe05e4"},b.h("th",{key:"a8268eb7f5f7e272d9f228ee722ff09d2755fea7","aria-colindex":"head"===this.parentRowType?this.positionInRow:void 0,class:{["body-row"]:"body"===this.parentRowType,["footer-row"]:"foot"===this.parentRowType,["content-cell"]:!this.numberCell&&!this.selectionCell,["number-cell"]:this.numberCell,["selection-cell"]:this.selectionCell, ["selected-cell"]:this.parentRowIsSelected,["cell--multiple-selection"]:"multiple"===this.selectionMode,["static-cell"]:k,["last-cell"]:this.lastCell&&(!this.rowSpan||this.colSpan&&!!this.rowSpan),[this.parentRowAlignment]:"center"===this.parentRowAlignment||"end"===this.parentRowAlignment},colSpan:this.colSpan,onBlur:this.onContainerBlur,onFocus:this.onContainerFocus,role:"head"===this.parentRowType?"columnheader":"rowheader",rowSpan:this.rowSpan,scope:this.rowSpan?"rowgroup":this.colSpan?"colgroup": "body"===this.parentRowType?"row":"col",tabIndex:this.selectionCell?0:k?-1:0,ref:p=>this.containerEl=p},this.heading&&b.h("div",{key:"171a02cb89d9db736a4dda50b643e413e4de3828",class:"heading"},this.heading),this.description&&b.h("div",{key:"29fbf42a560ddcce82713de3003a70b67fd0c596",class:"description"},this.description),this.selectionCell&&"multiple"===this.selectionMode&&b.h("calcite-icon",{key:"232d1ac6051ad58768b94c5813e96357088b4c4a",class:{active:a},icon:n,scale:l.getIconScale(this.scale)}), (this.selectionCell||this.numberCell)&&b.h("span",{key:"f91e4e2de889f0c8397006470adb8b330d9c50d4","aria-hidden":!0,"aria-live":this.focused?"polite":"off",class:"assistive-text"},this.screenReaderText)))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{selectedRowCount:["onSelectedChange"],selectedRowCountLocalized:["onSelectedChange"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return":host{--calcite-internal-table-header-background:var(--calcite-table-header-background, var(--calcite-color-foreground-2));--calcite-internal-table-header-border-color:var(--calcite-table-border-color, var(--calcite-color-border-3));display:contents}:host([alignment\x3dcenter]) th{text-align:center}:host([alignment\x3dend]) th{text-align:end}.assistive-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}th{white-space:normal;text-align:start;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1);font-size:var(--calcite-internal-table-cell-font-size);border-inline-end:1px solid var(--calcite-internal-table-header-border-color);border-block-end:1px solid var(--calcite-internal-table-header-border-color);padding-block:calc(var(--calcite-internal-table-cell-padding) * 1.5);padding-inline:var(--calcite-internal-table-cell-padding);background-color:var(--calcite-internal-table-header-background)}th:not(.static-cell){outline-color:transparent}th:not(.static-cell):not(.static-cell):focus-within{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-offset-invert-focus),\n 1\n )\n )\n )}th:not(.center):not(.end).content-cell{vertical-align:top}th.center{vertical-align:middle}th.end.content-cell{vertical-align:bottom}th.body-row,th.footer-row{padding-block:var(--calcite-internal-table-cell-padding);border-block-end:0}th.footer-row{border-block-start:1px solid var(--calcite-internal-table-header-border-color)}th.last-cell{border-inline-end:0}.cell--multiple-selection{cursor:pointer;vertical-align:middle;color:var(--calcite-color-text-3)}.cell--multiple-selection:not(.end){vertical-align:middle}.selected-cell:not(.number-cell):not(.footer-cell){--calcite-internal-table-header-background:var(--calcite-color-foreground-current)}.number-cell,.selection-cell{color:var(--calcite-color-text-2);inline-size:2rem;min-inline-size:2rem}.selection-cell calcite-icon.active{color:var(--calcite-color-brand)}.number-cell calcite-icon,.selection-cell calcite-icon{margin-inline-start:auto;margin-inline-end:auto;vertical-align:middle}.heading{color:var(--calcite-color-text-1)}.description{color:var(--calcite-color-text-3);font-size:var(--calcite-internal-table-cell-font-size-secondary)}"}}, [1,"calcite-table-header",{alignment:[513],colSpan:[514,"col-span"],description:[513],heading:[513],rowSpan:[514,"row-span"],interactionMode:[1,"interaction-mode"],lastCell:[4,"last-cell"],numberCell:[4,"number-cell"],parentRowAlignment:[1,"parent-row-alignment"],parentRowIsSelected:[4,"parent-row-is-selected"],parentRowType:[1,"parent-row-type"],positionInRow:[2,"position-in-row"],scale:[1],selectedRowCount:[2,"selected-row-count"],selectedRowCountLocalized:[1,"selected-row-count-localized"],selectionCell:[4, "selection-cell"],selectionMode:[1,"selection-mode"],bodyRowCount:[2,"body-row-count"],messages:[1040],messageOverrides:[1040],defaultMessages:[32],focused:[32],screenReaderText:[32],effectiveLocale:[32],setFocus:[64]},void 0,{selectedRowCount:["onSelectedChange"],selectedRowCountLocalized:["onSelectedChange"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);g();e.TableHeader=h;e.defineCustomElement=g});