import{s as b,t as y,a5 as z,f as o,ef as A,y as E,b4 as h,z as P,D as N}from"./index-BPRWoLf4.js";var I=function(s){b(a,s);function a(){return s!==null&&s.apply(this,arguments)||this}return a.prototype.render=function(){var e=this.props;e.className,e.store;var d=e.render,i=e.classPrefix,g=e.classnames,k=e.tooltip,c=e.align,r=e.cols,m=e.toggleAllColumns,v=e.toggleToggle,f=e.data,T=e.size,_=e.popOverContainer,u=y(e,["className","store","render","classPrefix","classnames","tooltip","align","cols","toggleAllColumns","toggleToggle","data","size","popOverContainer"]),p=u.translate,x=u.env;if(!r)return null;var n=r.filter(function(t){return z(t.pristine||t,f)&&t.toggable!==!1}),l=n.filter(function(t){return t.toggled!==!1});return o.createElement(A,E({},u,{render:d,tooltip:k||p("Table.columnsVisibility"),tooltipContainer:_||x.getModalContainer,isActived:r.findIndex(function(t){return!t.toggled})!==-1,align:c??"right",size:T||"sm",classnames:g,classPrefix:i,key:"columns-toggable",columns:r,activeToggaleColumns:l,data:f}),n!=null&&n.length?o.createElement("li",{className:g("ColumnToggler-menuItem"),key:"selectAll",onClick:function(){m&&m((l==null?void 0:l.length)<=0)}},o.createElement(h,{size:"sm",classPrefix:i,key:"checkall",checked:!!(l!=null&&l.length),partial:!!(l!=null&&l.length&&(l==null?void 0:l.length)!==(n==null?void 0:n.length))},p("Select.checkAll"))):null,n==null?void 0:n.map(function(t,C){return o.createElement("li",{className:g("ColumnToggler-menuItem"),key:"item"+(t.index||C),onClick:function(){v&&v(C)}},o.createElement(h,{size:"sm",classPrefix:i,checked:t.toggled!==!1},t.title?d("tpl",t.title):t.label||null))}))},a=P([N({type:"column-toggler",name:"column-toggler"})],a),a}(o.Component);export{I as ColumnTogglerRenderer};
