import"./backend-ai-webui-661d9e43.js";import"./vaadin-grid-filter-column-4c9cb29f.js";import"./vaadin-grid-sort-column-7bed08ef.js";import{G as e}from"./vaadin-grid-c3d5c3c2.js";customElements.define("lablup-grid-sort-filter-column",class extends e{static get properties(){return{path:{type:String},header:{type:String},direction:{type:String,notify:!0}}}static get observers(){return["_onHeaderRendererOrBindingChanged(_headerRenderer, _headerCell, path, header, _filterValue)","_onHeaderRendererOrBindingChanged(_headerRenderer, _headerCell, path, header, direction)"]}constructor(){super(),this.__boundOnFilterValueChanged=this.__onFilterValueChanged.bind(this),this.__boundOnDirectionChanged=this.__onDirectionChanged.bind(this)}_defaultHeaderRenderer(e,t){let i=e.firstElementChild,r=i?i.firstElementChild:void 0,d=i?i.lastElementChild:void 0,n=d?d.firstElementChild:void 0;i||(i=document.createElement("div"),i.setAttribute("style","display: flex; flex-direction: column"),r=document.createElement("vaadin-grid-sorter"),r.addEventListener("direction-changed",this.__boundOnDirectionChanged),i.appendChild(r),d=document.createElement("vaadin-grid-filter"),n=document.createElement("vaadin-text-field"),n.setAttribute("slot","filter"),n.setAttribute("theme","small"),n.setAttribute("style","max-width: 100%;"),n.setAttribute("focus-target",""),n.addEventListener("value-changed",this.__boundOnFilterValueChanged),d.appendChild(n),i.appendChild(d),e.appendChild(i)),r.path=this.path,r.__rendererDirection=this.direction,r.direction=this.direction,r.textContent=this.__getHeader(this.header,this.path),d.path=this.path,d.value=this._filterValue,n.__rendererValue=this._filterValue,n.value=this._filterValue}_computeHeaderRenderer(){return this._defaultHeaderRenderer}__onFilterValueChanged(e){e.detail.value!==e.target.__rendererValue&&(this._filterValue=e.detail.value)}__onDirectionChanged(e){e.detail.value!==e.target.__rendererDirection&&(this.direction=e.detail.value)}__getHeader(e,t){return e||(t?this._generateHeader(t):void 0)}});
