import{r as t,c as s,h as i,H as a,g as e}from"./p-fb8320e0.js";class r{constructor(t,s){this.columnName=t,this.sortDirection=s}}var l;!function(t){t.ASC="ASC",t.DESC="DESC"}(l||(l={}));class o{constructor(i){t(this,i),this.align="start",this.direction=l.ASC,this.sort=s(this,"sort",7)}sortData(){this.sortable&&(this.sort.emit(new r(this.value,this.direction)),this.direction=this.direction===l.DESC?l.ASC:l.DESC)}getColumnClasses(){return{"header-column":!0,"non-sortable-column":!this.sortable,"sortable-column":this.sortable,sorted:this.sortable&&this.sorted}}render(){return i(a,{class:{"align-start":"start"===this.align,"align-end":"end"===this.align,"align-center":"center"===this.align,sortable:this.sortable},style:{flex:this.width?`0 0 ${this.width}`:null,width:this.width?this.width:null}},i("div",{class:this.getColumnClasses(),title:this.description?this.description:this.label,onClick:()=>this.sortData()},i("div",{class:"label"},this.label),this.sortable&&i("materials-icon",{class:"sort-direction",name:this.direction===l.DESC?"arrow_upward":"arrow_downward"})))}get host(){return e(this)}static get style(){return":host{width:100%;line-height:48px;font-family:Roboto,sans-serif;font-size:12px;font-weight:700;color:var(--mdc-theme-on-surface);opacity:.6;height:48px;cursor:default;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1}:host(.align-end) .header-column{padding-right:24px;-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.align-end) .label{text-align:end}:host(.align-center){position:relative}:host(.align-center),:host(.align-center) .header-column{-ms-flex-pack:center;justify-content:center}:host(.align-center) .header-column .label{text-align:center}:host(.align-center) .header-column .sort-direction{position:absolute;right:0}.header-column{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;width:100%}.header-column .label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sort-direction{color:#5f595c}.sortable-column:hover{cursor:pointer;color:#000}.sortable-column materials-icon{opacity:0;display:inline-block}.sortable-column:hover materials-icon{opacity:1;-webkit-transition:opacity .25s linear;transition:opacity .25s linear}.sortable-column.sorted{color:#000!important}.sortable-column.sorted materials-icon{opacity:1!important}"}}export{o as materials_datatable_header_column};