import{__decorate as e}from"tslib";import{html as t}from"lit";import{property as i,customElement as s}from"lit/decorators.js";import{s as r}from"./nile-grid-head-item.css.esm.js";import{N as a}from"../../internal/nile-element.esm.js";import{i as l,a as o,h as n,b as d,r as c}from"./nile-grid-head-item.utils.esm.js";import"../../internal/accessibility/a11y.state.enum.esm.js";import"../../internal/accessibility/a11y.property.enum.esm.js";import"../../internal/accessibility/role.enum.esm.js";let m=class extends a{constructor(){super(...arguments),this.colspan=1,this.rowspan=1,this.resizable=!1,this.width=null,this.sticky=null,this.lockWidth=!1,this.onHandlePointerDown=e=>{const t=this,i=this.closest("nile-grid"),s={value:0},r={value:0},a=l(t,e,s,r);if(!a)return;const{target:m,col:p}=a,h=e=>n(t,p,r.value,s.value,e,i),u=e=>{d(t,p,e,m,h),c(m,h,u)};o(m,h,u)}}static get styles(){return[r]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","row")}disconnectedCallback(){super.disconnectedCallback(),this.removeAttribute("role")}render(){return t`
      <div part="grid-head-item-base" class="head-item-base">
        <slot></slot>
        ${this.resizable?t`
              <div
                aria-hidden="false"
                class="resize-handle"
                part="resize-handle"
                @pointerdown=${this.onHandlePointerDown}
              ></div>
            `:null}
      </div>
    `}};e([i({type:Number,reflect:!0,attribute:!0})],m.prototype,"colspan",void 0),e([i({type:Number,reflect:!0,attribute:!0})],m.prototype,"rowspan",void 0),e([i({type:Boolean,reflect:!0,attribute:!0})],m.prototype,"resizable",void 0),e([i({type:String,reflect:!0,attribute:!0})],m.prototype,"width",void 0),e([i({type:String,reflect:!0,attribute:!0})],m.prototype,"sticky",void 0),e([i({type:Boolean,reflect:!0,attribute:!0})],m.prototype,"lockWidth",void 0),m=e([s("nile-grid-head-item")],m);export{m as N};
