var le=Object.defineProperty,ie=Object.defineProperties;var se=Object.getOwnPropertyDescriptors;var j=Object.getOwnPropertySymbols;var ce=Object.prototype.hasOwnProperty,re=Object.prototype.propertyIsEnumerable;var U=(e,t,o)=>t in e?le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,N=(e,t)=>{for(var o in t||(t={}))ce.call(t,o)&&U(e,o,t[o]);if(j)for(var o of j(t))re.call(t,o)&&U(e,o,t[o]);return e},G=(e,t)=>ie(e,se(t));import{b as p,dc as ue,d as de,b8 as pe,bL as fe,bQ as he,bY as ge,e as me,ar as Ce,r as x,q as ve,m as ke,f as H,u as C,G as z,aN as be,J as Se,cm as q,ah as Ie,aj as Le,f0 as xe,aT as Oe,aU as g,o as D,a as Pe,w as d,j as J,t as k,x as _,h as S,g as B,F as M,bt as we,i as ye}from"./index-f4658ae7.js";import{C as Q}from"./index-297faa0c.js";import{D as De}from"./index-0e56c5c3.js";import{useTableContext as _e}from"./useTableContext-e652508f.js";import{S as $e}from"./sortable.esm-13e502da.js";import{S as Ve}from"./SettingOutlined-20e7662a.js";import"./Checkbox-abf1420e.js";import"./createForOfIteratorHelper-eb4541b9.js";var Ae={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.3 506.3L781.7 405.6a7.23 7.23 0 00-11.7 5.7V476H548V254h64.8c6 0 9.4-7 5.7-11.7L517.7 114.7a7.14 7.14 0 00-11.3 0L405.6 242.3a7.23 7.23 0 005.7 11.7H476v222H254v-64.8c0-6-7-9.4-11.7-5.7L114.7 506.3a7.14 7.14 0 000 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h222v222h-64.8c-6 0-9.4 7-5.7 11.7l100.8 127.5c2.9 3.7 8.5 3.7 11.3 0l100.8-127.5c3.7-4.7.4-11.7-5.7-11.7H548V548h222v64.8c0 6 7 9.4 11.7 5.7l127.5-100.8a7.3 7.3 0 00.1-11.4z"}}]},name:"drag",theme:"outlined"};const Te=Ae;function Y(e){for(var t=1;tC(c==null?void 0:c.getBindValues)||{});z(()=>{setTimeout(()=>{c.getColumns().length&&!r.isInit&&T()},0)}),z(()=>{const n=C(A);w.value=!!n.showIndexColumn,y.value=!!n.rowSelection});function l(){const n=[];return c.getColumns({ignoreIndex:!0,ignoreAction:!0}).forEach(a=>{n.push(N({label:a.title||a.customTitle,value:a.dataIndex||a.title},a))}),n}function T(){const n=l(),a=c.getColumns({ignoreAction:!0,ignoreIndex:!0}).map(i=>i.defaultHidden?"":i.dataIndex||i.title).filter(Boolean);m.value.length?C(m).forEach(i=>{const s=n.find(u=>u.dataIndex===i.dataIndex);s&&(i.fixed=s.fixed)}):(m.value=n,h.value=n,O.value=n,r.defaultCheckList=a),r.isInit=!0,r.checkedList=a}function W(n){const a=m.value.map(i=>i.value);n.target.checked?(r.checkedList=a,L(a)):(r.checkedList=[],L([]))}const X=H(()=>{const n=m.value.length;let a=r.checkedList.length;return a>0&&as.value);n.sort((s,u)=>i.indexOf(s)-i.indexOf(u)),L(n)}let F,E=[];function K(){r.checkedList=[...r.defaultCheckList],r.checkAll=!0,m.value=C(O),h.value=C(O),L(c.getCacheColumns()),F.sort(E)}function ee(){b||Se(()=>{const n=C(I);if(!n)return;const a=n.$el;a&&(F=$e.create(C(a),{animation:500,delay:400,delayOnTouchOnly:!0,handle:".table-column-drag-icon ",onEnd:i=>{const{oldIndex:s,newIndex:u}=i;if(q(s)||q(u)||s===u)return;const f=Ie(h.value);s>u?(f.splice(u,0,f[s]),f.splice(s+1,1)):(f.splice(u+1,0,f[s]),f.splice(s,1)),h.value=f,L(f.map(P=>P.value).filter(P=>r.checkedList.includes(P)))}}),E=F.toArray(),b=!0)})}function ne(n){c.setProps({showIndexColumn:n.target.checked})}function te(n){c.setProps({rowSelection:n.target.checked?$:void 0})}function oe(n,a){var f;if(!r.checkedList.includes(n.dataIndex))return;const i=l(),s=n.fixed===a?!1:a,u=i.findIndex(P=>P.dataIndex===n.dataIndex);u!==-1&&(i[u].fixed=s),n.fixed=s,s&&!n.width&&(n.width=100),(f=c.setCacheColumnsByField)==null||f.call(c,n.dataIndex,{fixed:s}),L(i)}function L(n){c.setColumns(n);const a=C(h).map(i=>{const s=n.findIndex(u=>u===i.value||typeof u!="string"&&u.dataIndex===i.value)!==-1;return{dataIndex:i.value,fixed:i.fixed,visible:s}});t("columns-change",a)}function ae(){return Le(o.getPopupContainer)?o.getPopupContainer():xe()}return G(N({t:v},be(r)),{indeterminate:X,onCheckAllChange:W,onChange:Z,plainOptions:m,reset:K,prefixCls:V,columnListRef:I,handleVisibleChange:ee,checkIndex:w,checkSelect:y,handleIndexCheckChange:ne,handleSelectCheckChange:te,defaultRowSelection:$,handleColumnFixed:oe,getPopupContainer:ae})}});function Re(e,t,o,v,c,$){const b=g("Checkbox"),O=g("a-button"),m=g("DragOutlined"),h=g("Icon"),I=g("Tooltip"),r=g("Divider"),w=g("CheckboxGroup"),y=g("ScrollContainer"),V=g("SettingOutlined"),A=g("Popover");return D(),Pe(I,{placement:"top"},{title:d(()=>[J("span",null,k(e.t("component.table.settingColumn")),1)]),default:d(()=>[p(A,{placement:"bottomLeft",trigger:"click",onVisibleChange:e.handleVisibleChange,overlayClassName:`${e.prefixCls}__cloumn-list`,getPopupContainer:e.getPopupContainer},{title:d(()=>[J("div",{class:_(`${e.prefixCls}__popover-title`)},[p(b,{indeterminate:e.indeterminate,checked:e.checkAll,"onUpdate:checked":t[0]||(t[0]=l=>e.checkAll=l),onChange:e.onCheckAllChange},{default:d(()=>[S(k(e.t("component.table.settingColumnShow")),1)]),_:1},8,["indeterminate","checked","onChange"]),p(b,{checked:e.checkIndex,"onUpdate:checked":t[1]||(t[1]=l=>e.checkIndex=l),onChange:e.handleIndexCheckChange},{default:d(()=>[S(k(e.t("component.table.settingIndexColumnShow")),1)]),_:1},8,["checked","onChange"]),p(b,{checked:e.checkSelect,"onUpdate:checked":t[2]||(t[2]=l=>e.checkSelect=l),onChange:e.handleSelectCheckChange,disabled:!e.defaultRowSelection},{default:d(()=>[S(k(e.t("component.table.settingSelectColumnShow")),1)]),_:1},8,["checked","onChange","disabled"]),p(O,{size:"small",type:"link",onClick:e.reset},{default:d(()=>[S(k(e.t("common.resetText")),1)]),_:1},8,["onClick"])],2)]),content:d(()=>[p(y,null,{default:d(()=>[p(w,{value:e.checkedList,"onUpdate:value":t[3]||(t[3]=l=>e.checkedList=l),onChange:e.onChange,ref:"columnListRef"},{default:d(()=>[(D(!0),B(M,null,we(e.plainOptions,l=>(D(),B(M,{key:l.value},["ifShow"in l&&!l.ifShow?ye("",!0):(D(),B("div",{key:0,class:_(`${e.prefixCls}__check-item`)},[p(m,{class:"table-column-drag-icon"}),p(b,{value:l.value},{default:d(()=>[S(k(l.label),1)]),_:2},1032,["value"]),p(I,{placement:"bottomLeft",mouseLeaveDelay:.4,getPopupContainer:e.getPopupContainer},{title:d(()=>[S(k(e.t("component.table.settingFixedLeft")),1)]),default:d(()=>[p(h,{icon:"line-md:arrow-align-left",class:_([`${e.prefixCls}__fixed-left`,{active:l.fixed==="left",disabled:!e.checkedList.includes(l.value)}]),onClick:T=>e.handleColumnFixed(l,"left")},null,8,["class","onClick"])]),_:2},1032,["getPopupContainer"]),p(r,{type:"vertical"}),p(I,{placement:"bottomLeft",mouseLeaveDelay:.4,getPopupContainer:e.getPopupContainer},{title:d(()=>[S(k(e.t("component.table.settingFixedRight")),1)]),default:d(()=>[p(h,{icon:"line-md:arrow-align-left",class:_([`${e.prefixCls}__fixed-right`,{active:l.fixed==="right",disabled:!e.checkedList.includes(l.value)}]),onClick:T=>e.handleColumnFixed(l,"right")},null,8,["class","onClick"])]),_:2},1032,["getPopupContainer"])],2))],64))),128))]),_:1},8,["value","onChange"])]),_:1})]),default:d(()=>[p(V)]),_:1},8,["onVisibleChange","overlayClassName","getPopupContainer"])]),_:1})}const Qe=Oe(Be,[["render",Re]]);export{Qe as default};