UNPKG

vxe-table

Version:

A PC-end table component based on Vxe UI, supporting copy-paste, data pivot table, and high-performance virtual list table solution.

1 lines • 28.4 kB
Object.defineProperty(exports,"__esModule",{value:!0}),exports.createInternalData=createInternalData,exports.default=void 0;var _vue=require("vue"),_comp=require("../../../ui/src/comp"),_ui=require("../../../ui"),_utils=require("../../../ui/src/utils"),_dom=require("../../../ui/src/dom"),_log=require("../../../ui/src/log"),_xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let errLog=(0,_log.createComponentLog)("table").errLog,{getI18n,getIcon,renderEmptyElement}=_ui.VxeUI;function createInternalData(){return{}}var _default=exports.default=(0,_comp.defineVxeComponent)({name:"TableCustomPanel",props:{customStore:{type:Object,default:()=>({})}},setup(R,t){var e=_xeUtils.default.uniqueId();let V=_ui.VxeUI.getComponent("VxeModal"),M=_ui.VxeUI.getComponent("VxeDrawer"),H=_ui.VxeUI.getComponent("VxeButton"),G=_ui.VxeUI.getComponent("VxeNumberInput"),P=_ui.VxeUI.getComponent("VxeRadioGroup"),N=(0,_vue.inject)("$xeTable",{}),{props:z,reactData:$,internalData:n}=N,{computeSize:W,computeCustomOpts:K,computeColumnDragOpts:X,computeColumnOpts:q,computeIsMaxFixedColumn:j,computeResizableOpts:a,computeAggregateOpts:re}=N.getComputeMaps(),Y=(0,_vue.ref)(),Z=(0,_vue.ref)(),J=(0,_vue.ref)(),u=(0,_vue.ref)(),c=(0,_vue.ref)(),T=(0,_vue.reactive)({dragCol:null,dragGroupField:null,dragAggFnCol:null,dragTipText:""}),f=createInternalData(),s={refElem:Y,refBodyWrapperElem:Z,refCustomBodyElem:J,refDragLineElem:u,refDragTipElem:c},r={},ue=e=>{var t=R.customStore;t.activeWrapper=!0,N.customOpenEvent(e)},ce=e=>{let t=R.customStore;t.activeWrapper=!1,setTimeout(()=>{t.activeBtn||t.activeWrapper||N.customCloseEvent(e)},300)},Q=({$event:e})=>{$.isCustomStatus=!0,N.saveCustom(),N.closeCustom(),N.emitCustomEvent("confirm",e),N.dispatchEvent("custom-confirm",{},e),N.emitCustomEvent("close",e),N.dispatchEvent("custom-close",{},e)},ee=({$event:e})=>{N.closeCustom(),N.emitCustomEvent("close",e),N.dispatchEvent("custom-close",{},e)},te=({$event:e})=>{N.cancelCustom(),N.closeCustom(),N.emitCustomEvent("cancel",e),N.dispatchEvent("custom-cancel",{},e),N.emitCustomEvent("close",e),N.dispatchEvent("custom-close",{},e)},l=e=>{N.resetCustom(!0),N.closeCustom(),N.emitCustomEvent("reset",e),N.dispatchEvent("custom-reset",{},e),N.emitCustomEvent("close",e),N.dispatchEvent("custom-close",{},e)},le=({$event:t})=>{_ui.VxeUI.modal?_ui.VxeUI.modal.confirm({content:getI18n("vxe.custom.cstmConfirmRestore"),className:"vxe-table--ignore-clear",escClosable:!0}).then(e=>{"confirm"===e&&l(t)}):l(t)},o=t=>{var e=$.customColumnList,e=_xeUtils.default.findTree(e,e=>e===t);e&&e.parent&&(e=e.parent,e.children)&&e.children.length&&(e.renderVisible=e.children.every(e=>e.renderVisible),e.halfVisible=!e.renderVisible&&e.children.some(e=>e.renderVisible||e.halfVisible),o(e))},oe=(e,t)=>{let l=!e.renderVisible;K.value.immediate?(_xeUtils.default.eachTree([e],e=>{e.visible=l,e.renderVisible=l,e.halfVisible=!1}),$.isCustomStatus=!0,N.handleCustom(),N.saveCustomStore("update:visible")):_xeUtils.default.eachTree([e],e=>{e.renderVisible=l,e.halfVisible=!1}),o(e),N.checkCustomStatus(),N.dispatchEvent("custom-visible-change",{column:e,checked:l},t)},de=e=>{K.value.immediate&&e.renderResizeWidth!==e.renderWidth&&(e.resizeWidth=e.renderResizeWidth,e.renderWidth=e.renderResizeWidth,$.isCustomStatus=!0,N.handleCustom(),N.saveCustomStore("update:width"))},ae=(e,t,l)=>{var o=j.value;let a=null;K.value.immediate?(e.renderFixed===t?(a="",_xeUtils.default.eachTree([e],e=>{e.fixed="",e.renderFixed=""})):o&&!e.renderFixed||(a=t,_xeUtils.default.eachTree([e],e=>{e.fixed=t,e.renderFixed=t})),$.isCustomStatus=!0,N.handleCustom(),N.saveCustomStore("update:fixed")):e.renderFixed===t?(a="",_xeUtils.default.eachTree([e],e=>{e.renderFixed=""})):o&&!e.renderFixed||(a=t,_xeUtils.default.eachTree([e],e=>{e.renderFixed=t})),null!==a&&N.dispatchEvent("custom-fixed-change",{column:e,fixed:a},l)},se=(e,t,l,o,a,s)=>{K.value.immediate?(e[l]=t,e[o]=t,$.isCustomStatus=!0,N.handleCustom(),N.saveCustomStore("update:"+l)):e[o]=t,N.dispatchEvent(a,{column:e,[l]:t},s)},ie=e=>{var t=$.customStore,t=!t.isAll;N.toggleCustomAllCheckbox(),N.dispatchEvent("custom-visible-all",{checked:t},e)},m=(e,t,l,o)=>{var a,s,i,n,r=Z.value;r&&(n=J.value)&&(a=f.prevDragToChild,s=r.getBoundingClientRect(),n=n.getBoundingClientRect(),i=u.value,t?i&&(l?(t=t.getBoundingClientRect(),i.style.display="block",i.style.left=Math.max(0,n.x-s.x)+"px",i.style.top=Math.max(1,t.y+r.scrollTop-s.y)+"px",i.style.height=t.height+"px",i.style.width=t.width+"px",i.setAttribute("drag-pos",o),i.setAttribute("drag-to-child",a?"y":"n")):i.style.display=""):i&&(i.style.display="node"),n=c.value)&&(n.style.display="block",n.style.top=Math.min(r.clientHeight+r.scrollTop-n.clientHeight,e.clientY+r.scrollTop-s.y)+"px",n.style.left=Math.min(r.clientWidth+r.scrollLeft-n.clientWidth,e.clientX+r.scrollLeft-s.x)+"px",n.setAttribute("drag-status",l?a?"sub":"normal":"disabled"))},d=()=>{var e=T.dragCol,t=X.value.tooltipMethod;let l="";l=t?""+(t({$table:N,column:e})||""):getI18n("vxe.custom.cstmDragTarget",[e&&"html"!==e.type?e.getTitle():""]),T.dragTipText=l},i=()=>{var e=c.value,t=u.value;e&&(e.style.display=""),t&&(t.style.display="")},ne=e=>{var e=e.currentTarget.parentElement.parentElement.parentElement,t=e.getAttribute("colid"),t=N.getColumnById(t);e.draggable=!0,T.dragCol=t,T.dragGroupField=null,T.dragAggFnCol=null,d(),(0,_dom.addClass)(e,"active--drag-origin")},me=e=>{e=e.currentTarget.parentElement.parentElement.parentElement;i(),e.draggable=!1,T.dragCol=null,T.dragGroupField=null,(T.dragAggFnCol=null,_dom.removeClass)(e,"active--drag-origin")},ve=e=>{var t=f.customDragTime;e.dataTransfer&&e.dataTransfer.setDragImage((0,_dom.getTpImg)(),0,0),t&&clearTimeout(t),$.isCustomDragStatus=!0,f.prevDragGroupField=null,f.prevDragAggFnColid=null},pe=c=>{let d=z.mouseConfig,m=$.customColumnList,v=n.collectColumn;let p=K.value.immediate;var e=c.currentTarget;let{isCrossDrag:g,isPeerDrag:h,isSelfToChildDrag:x,isToChildDrag:_,dragEndMethod:t}=X.value;var l=T.dragCol;let{prevDragCol:o,prevDragGroupField:a,prevDragAggFnColid:s,prevDragPos:b,prevDragToChild:C}=f,E="bottom"===b?1:0;if(a||s)N.handlePivotTableAggregatePanelDragendEvent&&N.handlePivotTableAggregatePanelDragendEvent(c);else if(o&&l&&o!==l){let r=l,u=o;Promise.resolve(!t||t({oldColumn:r,newColumn:u,dragColumn:r,dragPos:b,dragToChild:!!C,offsetIndex:E})).then(a=>{if(a){let e=-1,t=-1,l={},o=(_xeUtils.default.eachTree([r],e=>{l[e.id]=e}),!1);if(p){if(r.parentId&&u.parentId)if(h&&!g){if(r.parentId!==u.parentId)return}else{if(!g)return;if(l[u.id]&&(o=!0,!g||!x))return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.message({status:"error",content:getI18n("vxe.error.treeDragChild")}))}else if(r.parentId){if(!g)return}else if(u.parentId){if(!g)return;if(l[u.id]&&(o=!0,!g||!x))return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.message({status:"error",content:getI18n("vxe.error.treeDragChild")}))}var s,i,n,a=_xeUtils.default.findTree(v,e=>e.id===r.id),a=(o&&g&&x?a&&({items:s,index:n}=a,(i=r.children||[]).forEach(e=>{e.parentId=r.parentId}),s.splice(n,1,...i),r.children=[]):a&&({items:s,index:n,parent:i}=a,s.splice(n,1),i||(e=n)),_xeUtils.default.findTree(v,e=>e.id===u.id));a&&({items:s,index:i,parent:n}=a,g&&_&&C?(r.parentId=u.id,u.children=(u.children||[]).concat([r])):(r.parentId=u.parentId,s.splice(i+E,0,r)),n||(t=i)),_xeUtils.default.eachTree(v,(e,t,l,o,a)=>{a||(e.renderSortNumber=t+1)})}else e=_xeUtils.default.findIndexOf(m,e=>e.id===r.id),m.splice(e,1),t=_xeUtils.default.findIndexOf(m,e=>e.id===u.id),m.splice(t+E,0,r);d&&(N.clearSelected&&N.clearSelected(),N.clearCellAreas)&&(N.clearCellAreas(),N.clearCopyCellArea());a={oldColumn:r,newColumn:u,dragColumn:r,dragPos:b,offsetIndex:E,_index:{newIndex:t,oldIndex:e}};N.dispatchEvent("custom-sort-change",a,c),N.dispatchEvent("column-dragend",a,c),p&&($.customColumnList=v.slice(0),N.handleColDragSwapColumn()),I()}}).catch(()=>{})}i(),T.dragCol=null,T.dragGroupField=null,T.dragAggFnCol=null,f.prevDragGroupField=null,f.prevDragAggFnColid=null,e.draggable=!1,e.removeAttribute("drag-pos"),(0,_dom.removeClass)(e,"active--drag-target"),(0,_dom.removeClass)(e,"active--drag-origin")},ge=e=>{var t,{showSortDragButton:l,allowSort:o,immediate:a}=K.value,{isCrossDrag:s,isPeerDrag:i,isToChildDrag:n}=X.value,r=e.currentTarget,u=(0,_dom.hasControlKey)(e),c=r.getAttribute("colid"),c=N.getColumnById(c),d=T.dragCol;f.prevDragGroupField=null,f.prevDragAggFnColid=null,c&&(s||i||1===c.level)&&(e.preventDefault(),t=e.clientY-r.getBoundingClientRect().y<r.clientHeight/2?"top":"bottom",!d||!l||!o||d&&d.id===c.id||!s&&(i?d.parentId!==c.parentId:1<c.level)||!a&&1<c.level||!s&&(i?d.parentId!==c.parentId:1<d.level)||!a&&1<d.level?m(e,r,!1,t):(f.prevDragToChild=!!(s&&n&&u&&a),f.prevDragCol=c,f.prevDragPos=t,m(e,r,!0,t)))},I=()=>{f.customDragTime=setTimeout(()=>{$.isCustomDragStatus=!1,f.customDragTime=void 0},350)},he=(e,t)=>{var o=$.customColumnList,o=_xeUtils.default.findTree(o,e=>e===t);if(o){let{item:e,items:t,index:l}=o;0<l&&($.isCustomDragStatus=!0,(0,_vue.nextTick)(()=>{t.splice(l,1),t.splice(l-1,0,e),I()}))}},xe=(e,t)=>{var o=$.customColumnList,o=_xeUtils.default.findTree(o,e=>e===t);if(o){let{item:e,items:t,index:l}=o;l<t.length-1&&($.isCustomDragStatus=!0,(0,_vue.nextTick)(()=>{t.splice(l,1),t.splice(l+1,0,e),I()}))}},_e=(e,t)=>{let a=$.customColumnList;var s=_xeUtils.default.findTree(a,e=>e===t);if(s){let{item:e,items:t,index:l,parent:o}=s;(o||0<l)&&($.isCustomDragStatus=!0,(0,_vue.nextTick)(()=>{e.parentId=null,t.splice(l,1),a.unshift(e),I()}))}},be=(e,t)=>{let a=$.customColumnList;var s=_xeUtils.default.findTree(a,e=>e===t);if(s){let{item:e,items:t,index:l,parent:o}=s;(o||l<t.length-1)&&($.isCustomDragStatus=!0,(0,_vue.nextTick)(()=>{e.parentId=null,t.splice(l,1),a.push(e),I()}))}},Ce=()=>{var e=T.dragTipText,t=X.value;return(0,_vue.h)("div",{},[(0,_vue.h)("div",{ref:u,class:["vxe-table-custom-popup--drag-line",{"is--guides":t.showGuidesStatus}]}),(0,_vue.h)("div",{ref:c,class:"vxe-table-custom-popup--drag-tip"},[(0,_vue.h)("div",{class:"vxe-table-custom-popup--drag-tip-wrapper"},[(0,_vue.h)("div",{class:"vxe-table-custom-popup--drag-tip-status"},[(0,_vue.h)("span",{class:["vxe-table-custom-popup--drag-tip-normal-status",getIcon().TABLE_DRAG_STATUS_ROW]}),(0,_vue.h)("span",{class:["vxe-table-custom-popup--drag-tip-sub-status",getIcon().TABLE_DRAG_STATUS_SUB_ROW]}),(0,_vue.h)("span",{class:["vxe-table-custom-popup--drag-tip-group-status",getIcon().TABLE_DRAG_STATUS_AGG_GROUP]}),(0,_vue.h)("span",{class:["vxe-table-custom-popup--drag-tip-values-status",getIcon().TABLE_DRAG_STATUS_AGG_VALUES]}),(0,_vue.h)("span",{class:["vxe-table-custom-popup--drag-tip-disabled-status",getIcon().TABLE_DRAG_DISABLED]})]),(0,_vue.h)("div",{class:"vxe-table-custom-popup--drag-tip-content"},""+(e||""))])])])},Ee=()=>{let g=z.resizable;var e=$.customColumnList,t=K.value,l=X.value;let{immediate:h,showSortDragButton:x,showSortMoveButton:_,showSortPutButton:b,allowVisible:C,allowSort:E,allowFixed:T,allowAlign:f,allowHeaderAlign:I,allowFooterAlign:y,allowResizable:A,allowGroup:D,allowValues:k,checkMethod:S,visibleMethod:w}=t,F=q.value,{minWidth:L,maxWidth:O}=a.value,B=j.value,{isCrossDrag:U,isPeerDrag:V}=l,R=[];return _xeUtils.default.eachTree(e,(o,a,s,e,i)=>{if(!w||w({$table:N,column:o})){let e=0,t=0;A&&(n={$table:N,column:o,columnIndex:N.getColumnIndex(o),$columnIndex:N.getVMColumnIndex(o),_columnIndex:N.getVTColumnIndex(o),rowIndex:-1,_rowIndex:-1,$rowIndex:-1},L&&(e=_xeUtils.default.toNumber(_xeUtils.default.isFunction(L)?L(n):L)),O)&&(t=_xeUtils.default.toNumber(_xeUtils.default.isFunction(O)?O(n):O));var n=o.renderVisible,r=o.halfVisible,u=(0,_utils.formatText)(o.getTitle(),1),c=o.children&&o.children.length;let l=!!S&&!S({$table:N,column:o});var d=!n,m=!(!U&&!V)&&h||1===o.level,v=[{icon:getIcon().TABLE_CUSTOM_ALIGN_LEFT,value:"left",title:getI18n("vxe.custom.setting.anLeftTitle"),disabled:d},{icon:getIcon().TABLE_CUSTOM_ALIGN_CENTER,value:"center",title:getI18n("vxe.custom.setting.anCenterTitle"),disabled:d},{icon:getIcon().TABLE_CUSTOM_ALIGN_RIGHT,value:"right",title:getI18n("vxe.custom.setting.anRightTitle"),disabled:d}],p=[];C&&p.push((0,_vue.h)("td",{key:"av",class:"vxe-table-custom-popup--column-td col--visible"},[(0,_vue.h)("div",{class:["vxe-table-custom--checkbox-option",{"is--checked":n,"is--indeterminate":r,"is--disabled":l}],title:getI18n("vxe.custom.setting.colVisible"),onClick:e=>{l||oe(o,e)}},[(0,_vue.h)("span",{class:["vxe-checkbox--icon",r?getIcon().TABLE_CHECKBOX_INDETERMINATE:n?getIcon().TABLE_CHECKBOX_CHECKED:getIcon().TABLE_CHECKBOX_UNCHECKED]})])])),p.push((0,_vue.h)("td",{key:"at",class:"vxe-table-custom-popup--column-td col--name"},[(0,_vue.h)("div",{class:"vxe-table-custom-popup--name"},[E&&x||D||k?m||(D||k)&&!c?(0,_vue.h)("div",Object.assign({class:["vxe-table-custom-popup--column-sort-btn",{"is--disabled":d}],title:getI18n("vxe.custom.setting.sortHelpTip")},d?{}:{onMousedown:ne,onMouseup:me}),[(0,_vue.h)("i",{class:getIcon().TABLE_CUSTOM_SORT})]):(0,_vue.h)("div",{class:"vxe-table-custom-popup--column-sort-placeholder"}):renderEmptyElement(N),"html"===o.type?(0,_vue.h)("div",{key:"1",class:"vxe-table-custom-popup--title",innerHTML:u}):(0,_vue.h)("div",{key:"0",class:"vxe-table-custom-popup--title",title:u},u),m&&(_||b)?(0,_vue.h)("div",{class:"vxe-table-custom-popup--move-btn"},H?[_?(0,_vue.h)(H,{mode:"text",icon:"vxe-icon-arrows-up",title:getI18n("vxe.custom.setting.moveUpTitle"),disabled:a<=0,onClick(e){he(e,o)}}):renderEmptyElement(N),_?(0,_vue.h)(H,{mode:"text",icon:"vxe-icon-arrows-down",title:getI18n("vxe.custom.setting.moveDnTitle"),disabled:a>=s.length-1,onClick(e){xe(e,o)}}):renderEmptyElement(N),b&&!i?(0,_vue.h)(H,{mode:"text",icon:"vxe-icon-top",title:getI18n("vxe.custom.setting.putTopTitle"),disabled:a<=0,onClick(e){_e(e,o)}}):renderEmptyElement(N),b&&!i?(0,_vue.h)(H,{mode:"text",icon:"vxe-icon-bottom",title:getI18n("vxe.custom.setting.putBottomTitle"),disabled:a>=s.length-1,onClick(e){be(e,o)}}):renderEmptyElement(N)]:[]):renderEmptyElement(N)])])),A&&p.push((0,_vue.h)("td",{key:"aw",class:"vxe-table-custom-popup--column-td col--resizable"},[o.children&&o.children.length||!(_xeUtils.default.isBoolean(o.resizable)?o.resizable:F.resizable||g)?(0,_vue.h)("span","-"):G?(0,_vue.h)(G,{type:"integer",immediate:!1,disabled:d,modelValue:o.renderResizeWidth,min:e||void 0,max:t||void 0,"onUpdate:modelValue"(e){e=Math.max(0,Number(e));o.renderResizeWidth=e},onChange(){de(o)}}):renderEmptyElement(N)])),T&&p.push((0,_vue.h)("td",{key:"af",class:"vxe-table-custom-popup--column-td col--fixed"},i?[(0,_vue.h)("span","-")]:P?[(0,_vue.h)(H,{icon:"left"===o.renderFixed?getIcon().TOOLBAR_TOOLS_FIXED_LEFT_ACTIVE:getIcon().TOOLBAR_TOOLS_FIXED_LEFT,status:"left"===o.renderFixed?"primary":"",disabled:d||B&&!o.renderFixed,title:getI18n("left"===o.renderFixed?"vxe.toolbar.cancelFixed":"vxe.toolbar.fixedLeft"),onClick:({$event:e})=>{ae(o,"left",e)}}),(0,_vue.h)(H,{icon:"right"===o.renderFixed?getIcon().TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVE:getIcon().TOOLBAR_TOOLS_FIXED_RIGHT,status:"right"===o.renderFixed?"primary":"",disabled:d||B&&!o.renderFixed,title:getI18n("right"===o.renderFixed?"vxe.toolbar.cancelFixed":"vxe.toolbar.fixedRight"),onClick:({$event:e})=>{ae(o,"right",e)}})]:[])),f&&p.push((0,_vue.h)("td",{key:"aa",class:"vxe-table-custom-popup--column-td col--align"},P?[(0,_vue.h)(P,{modelValue:o.renderAlign||"",type:"button",strict:!1,disabled:d,options:v,onChange({value:e,$event:t}){se(o,e,"align","renderAlign","custom-align-change",t)}})]:[])),I&&p.push((0,_vue.h)("td",{key:"aha",class:"vxe-table-custom-popup--column-td col--header-align"},c?[(0,_vue.h)("span","-")]:P?[(0,_vue.h)(P,{modelValue:o.renderHeaderAlign||"",type:"button",strict:!1,disabled:d,options:v,onChange({value:e,$event:t}){se(o,e,"headerAlign","renderHeaderAlign","custom-header-align-change",t)}})]:[])),y&&p.push((0,_vue.h)("td",{key:"afa",class:"vxe-table-custom-popup--column-td col--footer-align"},c?[(0,_vue.h)("span","-")]:P?[(0,_vue.h)(P,{modelValue:o.renderFooterAlign||"",type:"button",strict:!1,disabled:d,options:v,onChange({value:e,$event:t}){se(o,e,"footerAlign","renderFooterAlign","custom-footer-align-change",t)}})]:[])),R.push((0,_vue.h)("tr",{key:o.id,colid:o.id,class:["vxe-table-custom-popup--row level--"+o.level,{"is--group":c}],onDragstart:ve,onDragend:pe,onDragover:ge},p))}}),R};(0,_vue.nextTick)(()=>{var e=K.value.mode;V||"modal"!==e||errLog("vxe.error.reqComp",["vxe-modal"]),M||"drawer"!==e||errLog("vxe.error.reqComp",["vxe-drawer"]),H||errLog("vxe.error.reqComp",["vxe-button"]),G||errLog("vxe.error.reqComp",["vxe-number-input"]),P||errLog("vxe.error.reqComp",["vxe-radio-group"])});e={xID:e,props:R,context:t,reactData:T,internalData:f,xeTable:N,getRefMaps:()=>s,getComputeMaps:()=>r,renderVN:()=>{var e=K.value;return(["modal","drawer","popup"].includes(""+e.mode)?()=>{var e=N.xeGrid,t=N.xeGantt;let l=R.customStore,{treeConfig:o,rowGroupConfig:a,aggregateConfig:s}=z,{isCustomStatus:i,customColumnList:n}=$,r=W.value,u=K.value;var c=re.value;let d=l.panePopupStyle,m=c.placement,{mode:v,immediate:p,modalOptions:g,drawerOptions:h,allowVisible:x,allowFixed:_,allowAlign:b,allowHeaderAlign:C,allowFooterAlign:E,allowResizable:T}=u;var c=q.value.maxFixedSize,f=Object.assign({},g),I=Object.assign({},h),y=u.slots||{};let A=y.header,D=y.top,k=y.bottom,S=y.default,w=y.footer;var y=l.isAll,F=l.isIndeterminate;let L="right"===m||"bottom"===m,O={$table:N,$grid:e,$gantt:t,columns:n,isAllChecked:y,isAllIndeterminate:F,isCustomStatus:i},B=[],U=[];x&&(B.push((0,_vue.h)("col",{key:"av",class:"vxe-table-custom-popup--column-col col--checkbox"})),U.push((0,_vue.h)("th",{key:"av",class:"vxe-table-custom-popup--column-th col--checkbox"},[(0,_vue.h)("div",{class:["vxe-table-custom--checkbox-option",{"is--checked":y,"is--indeterminate":F}],title:getI18n("vxe.table.allTitle"),onClick:ie},[(0,_vue.h)("span",{class:["vxe-checkbox--icon",F?getIcon().TABLE_CHECKBOX_INDETERMINATE:y?getIcon().TABLE_CHECKBOX_CHECKED:getIcon().TABLE_CHECKBOX_UNCHECKED]})])]))),B.push((0,_vue.h)("col",{key:"at",class:"vxe-table-custom-popup--column-col col--title"})),U.push((0,_vue.h)("th",{key:"at",class:"vxe-table-custom-popup--column-th col--title"},getI18n("vxe.custom.setting.colTitle"))),T&&(B.push((0,_vue.h)("col",{key:"aw",class:"vxe-table-custom-popup--column-col col--width"})),U.push((0,_vue.h)("th",{key:"aw",class:"vxe-table-custom-popup--column-th col--width"},getI18n("vxe.custom.setting.colResizable")))),_&&(B.push((0,_vue.h)("col",{key:"af",class:"vxe-table-custom-popup--column-col col--fixed"})),U.push((0,_vue.h)("th",{key:"af",class:"vxe-table-custom-popup--column-th col--fixed"},getI18n("vxe.custom.setting."+(c?"colFixedMax":"colFixed"),[c])))),b&&(B.push((0,_vue.h)("col",{key:"aa",class:"vxe-table-custom-popup--column-col col--align"})),U.push((0,_vue.h)("th",{key:"aa",class:"vxe-table-custom-popup--column-th col--align"},getI18n("vxe.custom.setting.colAlign")))),C&&(B.push((0,_vue.h)("col",{key:"aha",class:"vxe-table-custom-popup--column-col col--header-align"})),U.push((0,_vue.h)("th",{key:"aha",class:"vxe-table-custom-popup--column-th col--header-align"},getI18n("vxe.custom.setting.colHeadAlign")))),E&&(B.push((0,_vue.h)("col",{key:"afa",class:"vxe-table-custom-popup--column-col col--footer-align"})),U.push((0,_vue.h)("th",{key:"afa",class:"vxe-table-custom-popup--column-th col--footer-align"},getI18n("vxe.custom.setting.colFootAlign"))));e={default:()=>(0,_vue.h)("div",{ref:Z,class:["vxe-table-custom-popup--body-wrapper","agg-layout--"+m,{["size--"+r]:r}],style:d},S?N.callSlot(S,O):[L||o||!s&&!a||!N.getPivotTableAggregatePopupPanel?renderEmptyElement(N):(0,_vue.h)(N.getPivotTableAggregatePopupPanel(),{customStore:l}),(0,_vue.h)("div",{ref:J,class:"vxe-table-custom-popup--handle-wrapper"},[D?(0,_vue.h)("div",{class:"vxe-table-custom-popup--table-top"},N.callSlot(D,O)):renderEmptyElement(N),(0,_vue.h)("div",{class:"vxe-table-custom-popup--table-wrapper"},[(0,_vue.h)("table",{},[(0,_vue.h)("colgroup",{},B),(0,_vue.h)("thead",{},[(0,_vue.h)("tr",{},U)]),(0,_vue.h)(_vue.TransitionGroup,{class:"vxe-table-custom--panel-list",tag:"tbody",name:"vxe-table-custom--list"},{default:()=>Ee()})])]),k?(0,_vue.h)("div",{class:"vxe-table-custom-popup--table-bottom"},N.callSlot(k,O)):renderEmptyElement(N),Ce()]),L&&!o&&(s||a)&&N.getPivotTableAggregatePopupPanel?(0,_vue.h)(N.getPivotTableAggregatePopupPanel(),{customStore:l}):renderEmptyElement(N)]),footer:()=>w?N.callSlot(w,O):(0,_vue.h)("div",{class:"vxe-table-custom-popup--footer"},[H?(0,_vue.h)(H,{content:u.resetButtonText||getI18n("vxe.custom.cstmRestore"),disabled:!i,onClick:le}):renderEmptyElement(N),p?H?(0,_vue.h)(H,{status:"primary",content:u.closeButtonText||getI18n("vxe.table.customClose"),onClick:ee}):renderEmptyElement(N):H?(0,_vue.h)(H,{content:u.cancelButtonText||getI18n("vxe.table.customCancel"),onClick:te}):renderEmptyElement(N),!p&&H?(0,_vue.h)(H,{status:"primary",content:u.confirmButtonText||getI18n("vxe.custom.cstmConfirm"),onClick:Q}):renderEmptyElement(N)])};return A&&(e.header=()=>N.callSlot(A,O)),"drawer"===v?M?(0,_vue.h)(M,{key:"drawer",className:["vxe-table-custom-drawer-wrapper","vxe-table--ignore-clear",I.className||""].join(" "),modelValue:l.visible,title:I.title||getI18n("vxe.custom.cstmTitle"),width:I.width||Math.min(880,Math.floor(.6*document.documentElement.clientWidth)),position:I.position,resize:!!I.resize,escClosable:!!I.escClosable,maskClosable:!!I.maskClosable,destroyOnClose:!0,showFooter:!0,"onUpdate:modelValue"(e){l.visible=e}},e):renderEmptyElement(N):V?(0,_vue.h)(V,{key:"modal",className:["vxe-table-custom-modal-wrapper","vxe-table--ignore-clear",f.className||""].join(" "),modelValue:l.visible,title:f.title||getI18n("vxe.custom.cstmTitle"),width:f.width||Math.min(1e3,document.documentElement.clientWidth),minWidth:f.minWidth||800,height:f.height||Math.min(680,document.documentElement.clientHeight),minHeight:f.minHeight||400,showZoom:f.showZoom,showMaximize:f.showMaximize,showMinimize:f.showMinimize,mask:f.mask,lockView:f.lockView,resize:f.resize,transfer:f.transfer,escClosable:!!f.escClosable,maskClosable:!!f.maskClosable,destroyOnClose:!0,showFooter:!0,"onUpdate:modelValue"(e){l.visible=e}},e):renderEmptyElement(N)}:()=>{var e=N.xeGrid,t=N.xeGantt,l=N.props,o=R.customStore,{treeConfig:l,rowGroupConfig:a,aggregateConfig:s}=l,{isCustomStatus:i,customColumnList:n,isCustomDragStatus:r}=$,u=K.value,c=X.value,d=o.defPopupStyle;let{immediate:m,checkMethod:v,visibleMethod:p,allowVisible:g,allowSort:h,allowFixed:x,allowGroup:_,allowValues:b,trigger:C,placement:E,showSortDragButton:T,showSortMoveButton:f,showSortPutButton:I}=u,y=j.value;var A=W.value;let{isCrossDrag:D,isPeerDrag:V}=c;var c=u.slots||{},k=c.header,S=c.top,w=c.bottom,F=c.default,c=c.footer;let L=[];var O={},B=o.isAll,U=o.isIndeterminate,e=("hover"===C&&(O.onMouseenter=ue,O.onMouseleave=ce),{$table:N,$grid:e,$gantt:t,columns:n,isAllChecked:B,isAllIndeterminate:U,isCustomStatus:i});return _xeUtils.default.eachTree(n,(l,e,o,t,a)=>{if(!p||p({$table:N,column:l})){var s=l.renderVisible,i=l.halfVisible,n=l.children&&l.children.length,r=(0,_utils.formatText)(l.getTitle(),1);let t=!!v&&!v({$table:N,column:l});var u=!s,c=!(!D&&!V)&&m||1===l.level;L.push((0,_vue.h)("li",{key:l.id,colid:l.id,class:["vxe-table-custom--option","level--"+l.level,{"is--hidden":t||u,"is--group":n}],onDragstart:ve,onDragend:pe,onDragover:ge},[g?(0,_vue.h)("div",{class:["vxe-table-custom--checkbox-option",{"is--checked":s,"is--indeterminate":i,"is--disabled":t}],title:getI18n("vxe.custom.setting.colVisible"),onClick:e=>{t||oe(l,e)}},[(0,_vue.h)("span",{class:["vxe-checkbox--icon",i?getIcon().TABLE_CHECKBOX_INDETERMINATE:s?getIcon().TABLE_CHECKBOX_CHECKED:getIcon().TABLE_CHECKBOX_UNCHECKED]})]):renderEmptyElement(N),(0,_vue.h)("div",{class:"vxe-table-custom--name-option"},[(h&&T||_||b)&&(c||(_||b)&&!n)?(0,_vue.h)("div",{class:"vxe-table-custom--sort-option"},[(0,_vue.h)("span",Object.assign({class:["vxe-table-custom--sort-btn",{"is--disabled":u}],title:getI18n("vxe.custom.setting.sortHelpTip")},u?{}:{onMousedown:ne,onMouseup:me}),[(0,_vue.h)("i",{class:getIcon().TABLE_CUSTOM_SORT})])]):renderEmptyElement(N),"html"===l.type?(0,_vue.h)("div",{key:"1",class:"vxe-table-custom--checkbox-label",innerHTML:r}):(0,_vue.h)("div",{key:"0",class:"vxe-table-custom--checkbox-label"},r)]),c&&(f||I)?(0,_vue.h)("div",{class:"vxe-table-custom--move-btn-option"},H?[f?(0,_vue.h)(H,{mode:"text",icon:"vxe-icon-arrows-up",title:getI18n("vxe.custom.setting.moveUpTitle"),disabled:e<=0,onClick(e){he(e,l)}}):renderEmptyElement(N),f?(0,_vue.h)(H,{mode:"text",icon:"vxe-icon-arrows-down",title:getI18n("vxe.custom.setting.moveDnTitle"),disabled:e>=o.length-1,onClick(e){xe(e,l)}}):renderEmptyElement(N),I&&!a?(0,_vue.h)(H,{mode:"text",icon:"vxe-icon-top",title:getI18n("vxe.custom.setting.putTopTitle"),disabled:e<=0,onClick(e){_e(e,l)}}):renderEmptyElement(N),I&&!a?(0,_vue.h)(H,{mode:"text",icon:"vxe-icon-bottom",title:getI18n("vxe.custom.setting.putBottomTitle"),disabled:e>=o.length-1,onClick(e){be(e,l)}}):renderEmptyElement(N)]:[]):renderEmptyElement(N),!a&&x?(0,_vue.h)("div",{class:"vxe-table-custom--fixed-option"},H?[(0,_vue.h)(H,{mode:"text",icon:"left"===l.renderFixed?getIcon().TOOLBAR_TOOLS_FIXED_LEFT_ACTIVE:getIcon().TOOLBAR_TOOLS_FIXED_LEFT,status:"left"===l.renderFixed?"primary":"",disabled:u||y&&!l.renderFixed,title:getI18n("left"===l.renderFixed?"vxe.toolbar.cancelFixed":"vxe.toolbar.fixedLeft"),onClick:({$event:e})=>{ae(l,"left",e)}}),(0,_vue.h)(H,{mode:"text",icon:"right"===l.renderFixed?getIcon().TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVE:getIcon().TOOLBAR_TOOLS_FIXED_RIGHT,status:"right"===l.renderFixed?"primary":"",disabled:u||y&&!l.renderFixed,title:getI18n("right"===l.renderFixed?"vxe.toolbar.cancelFixed":"vxe.toolbar.fixedRight"),onClick:({$event:e})=>{ae(l,"right",e)}})]:[]):renderEmptyElement(N)]))}}),(0,_vue.h)("div",{ref:Y,key:"simple",class:["vxe-table-custom-wrapper","placement--"+E,{["size--"+A]:A,"is--active":o.visible}],style:d},o.visible?[(0,_vue.h)("div",{ref:Z,class:"vxe-table-custom-simple--body-wrapper"},[!l&&(s||a)&&N.getPivotTableAggregateSimplePanel?(0,_vue.h)(N.getPivotTableAggregateSimplePanel(),{customStore:o}):renderEmptyElement(N),(0,_vue.h)("div",{ref:J,class:"vxe-table-custom--handle-wrapper"},[(0,_vue.h)("div",{class:"vxe-table-custom--header"},k?N.callSlot(k,e):[(0,_vue.h)("ul",{class:"vxe-table-custom--panel-list"},[(0,_vue.h)("li",{class:"vxe-table-custom--option"},[g?(0,_vue.h)("div",{class:["vxe-table-custom--checkbox-option",{"is--checked":B,"is--indeterminate":U}],title:getI18n("vxe.table.allTitle"),onClick:ie},[(0,_vue.h)("span",{class:["vxe-checkbox--icon",U?getIcon().TABLE_CHECKBOX_INDETERMINATE:B?getIcon().TABLE_CHECKBOX_CHECKED:getIcon().TABLE_CHECKBOX_UNCHECKED]}),(0,_vue.h)("span",{class:"vxe-checkbox--label"},getI18n("vxe.toolbar.customAll"))]):(0,_vue.h)("span",{class:"vxe-checkbox--label"},getI18n("vxe.table.customTitle"))])])]),(0,_vue.h)("div",{class:"vxe-table-custom--body"},[S?(0,_vue.h)("div",{class:"vxe-table-custom--panel-top"},N.callSlot(S,e)):renderEmptyElement(N),F?(0,_vue.h)("div",{class:"vxe-table-custom--panel-body"},N.callSlot(F,e)):(0,_vue.h)(_vue.TransitionGroup,Object.assign({class:"vxe-table-custom--panel-list",name:r?"vxe-table-custom--list":"",tag:"ul"},O),{default:()=>L}),w?(0,_vue.h)("div",{class:"vxe-table-custom--panel-bottom"},N.callSlot(w,e)):renderEmptyElement(N)]),u.showFooter?(0,_vue.h)("div",{class:"vxe-table-custom--footer"},c?N.callSlot(c,e):[(0,_vue.h)("div",{class:"vxe-table-custom--footer-buttons"},[H?(0,_vue.h)(H,{mode:"text",content:u.resetButtonText||getI18n("vxe.table.customRestore"),disabled:!i,onClick:le}):renderEmptyElement(N),m?H?(0,_vue.h)(H,{mode:"text",content:u.closeButtonText||getI18n("vxe.table.customClose"),onClick:ee}):renderEmptyElement(N):H?(0,_vue.h)(H,{mode:"text",content:u.cancelButtonText||getI18n("vxe.table.customCancel"),onClick:te}):renderEmptyElement(N),!m&&H?(0,_vue.h)(H,{mode:"text",status:"primary",content:u.confirmButtonText||getI18n("vxe.table.customConfirm"),onClick:Q}):renderEmptyElement(N)])]):null]),Ce()])]:[])})()}};return(0,_vue.onUnmounted)(()=>{f=createInternalData()}),(0,_vue.provide)("$xeTableCustomPanel",e),e},render(){return this.renderVN()}});