import{r as t,c as o,h as e,g as s,H as l}from"./p-890a2f7e.js";const r=class{constructor(e){t(this,e),this.loadMore=o(this,"loadMore",7)}onSort(t){this.sortedOn&&this.sortedOn!=t.target&&(this.sortedOn.sortDirection=void 0),this.sortedOn=t.target}render(){return[e("slot",null)]}get element(){return s(this)}};r.style=".sc-smoothly-table-h{display:table;text-align:left;border-collapse:collapse;border:3px solid rgb(var(--smoothly-dark-color), 0.5);width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:rgb(var(--smoothly-default-color))}";const n=class{constructor(o){t(this,o)}render(){return e(l,null,e("slot",null))}};n.style=".sc-smoothly-table-cell-h{display:table-cell;padding:0.5em}";const a=class{constructor(e){t(this,e),this.expansionOpen=o(this,"expansionOpen",7),this.expansionLoaded=o(this,"expansionLoaded",7),this.align="left"}openChanged(t){this.expansionElement&&(t?this.beginOpen=!0:this.element.append(this.expansionElement))}onClick(){this.open=!this.open}componentDidLoad(){this.expansionLoaded.emit()}componentDidRender(){this.beginOpen&&(this.beginOpen=!1,this.expansionOpen.emit(this.expansionElement))}render(){return e(l,{style:{textAlign:this.align}},e("slot",null),e("tr",{ref:t=>this.expansionElement=t},e("td",{colSpan:500,class:this.open?"":"hide"},e("slot",{name:"detail"}))))}get element(){return s(this)}static get watchers(){return{open:["openChanged"]}}};a.style=".sc-smoothly-table-expandable-cell-h{display:table-cell;padding:0.5em}.hide.sc-smoothly-table-expandable-cell{display:none}";const i=class{constructor(o){t(this,o),this.expansions=[]}onExpansionLoaded(t){this.expansions.push(t.target)}onDetailsLoaded(t){this.expansions.forEach((o=>{o!=t.target&&(o.open=!1)})),t.detail&&this.element.after(t.detail)}render(){return e(l,null,e("slot",null))}get element(){return s(this)}};i.style=".sc-smoothly-table-expandable-row-h{display:table-row;border:1px solid rgb(var(--smoothly-default-color));cursor:pointer}.sc-smoothly-table-expandable-row-h:nth-child(even){background-color:rgb(var(--smoothly-default-tint))}.sc-smoothly-table-expandable-row-h:hover{background-color:rgb(var(--smoothly-default-color))}";const h=class{constructor(e){t(this,e),this.sort=o(this,"sort",7)}onClick(t){this.sort.emit({property:this.name,direction:this.sortDirection="ascending"==this.sortDirection?"descending":"ascending"}),console.log("sort",this.name,this.sortDirection),t.preventDefault(),t.stopPropagation()}render(){return e(l,null,e("slot",null),this.renderSortIcon())}renderSortIcon(){let t;switch(this.sortDirection){case"ascending":t=e("ion-icon",{name:"chevron-up-outline",class:"sort-icon"});break;case"descending":t=e("ion-icon",{name:"chevron-down-outline",class:"sort-icon"})}return t}};h.style=".sc-smoothly-table-header-h{display:table-cell;padding-top:12px;padding-bottom:12px;background-color:rgb(var(--smoothly-default-color));border:1px solid rgb(var(--smoothly-dark-color), 0.5);padding:0.5em;line-height:40px}.sc-smoothly-table-header-h>ion-icon.sc-smoothly-table-header{height:12px;margin-left:20px}";const c=class{constructor(e){t(this,e),this.expansionOpen=o(this,"expansionOpen",7),this.align="left"}openChanged(t){this.expansionElement&&this.element.after(this.expansionElement)}onClick(t){this.open=!this.open,t.stopPropagation()}componentDidRender(){this.expansionOpen.emit(this.expansionElement),this.expansionElement&&this.open&&this.element.after(this.expansionElement)}render(){return e(l,{style:{textAlign:this.align}},e("slot",null),e("tr",{ref:t=>this.expansionElement=t},e("td",{colSpan:500,class:this.open?"":"hide"},e("slot",{name:"detail"}))))}get element(){return s(this)}static get watchers(){return{open:["openChanged"]}}};c.style=".sc-smoothly-table-row-h{display:table-row;border:1px solid rgb(var(--smoothly-dark-color), 0.5);cursor:pointer}.sc-smoothly-table-row-h:nth-child(even){background-color:rgb(var(--smoothly-default-color))}.sc-smoothly-table-row-h:hover{background-color:rgb(var(--smoothly-default-color))}.hide.sc-smoothly-table-row{display:none}";export{r as smoothly_table,n as smoothly_table_cell,a as smoothly_table_expandable_cell,i as smoothly_table_expandable_row,h as smoothly_table_header,c as smoothly_table_row}