/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{__decorate as t}from"tslib";import{property as o,subclass as e}from"../../core/accessorSupport/decorators.js";import i from"./Grid/Column.js";import{css as r}from"./Grid/ColumnCSS.js";import{uniqueColumnNames as n}from"./support/tableUtils.js";const d={action:"esri-column__action"};let s=class extends i{constructor(t){super(t),this.autoWidth=!1,this.callback=()=>{},this.fieldName=n.action,this.flexGrow=0,this.frozenToEnd=!0,this.disabled=null,this.headerRenderFunction=()=>{},this.icon="pencil",this.renderFunction=({root:t,rowData:o})=>{if(!o)return;const{index:e,item:{feature:i}}=o,{callback:n,disabled:s,icon:a,effectiveLabel:l}=this,c="function"==typeof s?s({feature:i,index:e}):!!s,p=t=>{t.stopPropagation(),n({index:e,feature:i,native:t})};if(t.firstChild){const o=t.firstChild;return o.disabled=c,o.icon=a,o.text=l,void(o.onclick=p)}const h=this.createCalciteAction({alignment:"center",className:`${d.action} ${r.contentFull}`,disabled:c,icon:a,text:l,onclick:p});this.removeCellContent(t),t.appendChild(h)},this.resizable=!1,this.sortable=!1,this.width="50px"}};t([o({readOnly:!0})],s.prototype,"autoWidth",void 0),t([o()],s.prototype,"callback",void 0),t([o({readOnly:!0})],s.prototype,"fieldName",void 0),t([o({readOnly:!0})],s.prototype,"flexGrow",void 0),t([o()],s.prototype,"frozenToEnd",void 0),t([o()],s.prototype,"disabled",void 0),t([o()],s.prototype,"headerRenderFunction",void 0),t([o()],s.prototype,"icon",void 0),t([o()],s.prototype,"renderFunction",void 0),t([o({readOnly:!0})],s.prototype,"resizable",void 0),t([o({readOnly:!0})],s.prototype,"sortable",void 0),t([o({readOnly:!0})],s.prototype,"width",void 0),s=t([e("esri.widgets.FeatureTable.ActionColumn")],s);const a=s;export{a as default};
