vxe-table 4.23.0-beta.2 → 4.23.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all.esm.js +145 -167
- package/dist/style.css +1 -1
- package/dist/style.min.css +1 -1
- package/es/grid/src/grid.js +3 -0
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/panel.js +2 -2
- package/es/table/module/filter/hook.js +5 -7
- package/es/table/module/filter/panel.js +42 -46
- package/es/table/src/table.js +69 -47
- package/es/table/src/util.js +1 -2
- package/es/table/style.css +31 -12
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +2 -2
- package/es/ui/src/dom.js +11 -8
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +31 -12
- package/es/vxe-table/style.min.css +1 -1
- package/lib/grid/src/grid.js +5 -0
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +79 -127
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/panel.js +2 -2
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/filter/hook.js +6 -7
- package/lib/table/module/filter/hook.min.js +1 -1
- package/lib/table/module/filter/panel.js +34 -33
- package/lib/table/module/filter/panel.min.js +1 -1
- package/lib/table/src/table.js +19 -19
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +1 -2
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +31 -12
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +2 -2
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/dom.js +11 -7
- package/lib/ui/src/dom.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +31 -12
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +3 -0
- package/packages/table/module/custom/panel.ts +2 -2
- package/packages/table/module/filter/hook.ts +5 -7
- package/packages/table/module/filter/panel.ts +45 -46
- package/packages/table/src/table.ts +71 -47
- package/packages/table/src/util.ts +1 -2
- package/packages/ui/index.ts +1 -1
- package/packages/ui/src/dom.ts +12 -8
- package/styles/components/table-module/filter.scss +25 -14
- package/es/table/src/scrollbar.js +0 -54
- package/lib/table/src/scrollbar.js +0 -63
- package/lib/table/src/scrollbar.min.js +0 -1
- package/packages/table/src/scrollbar.ts +0 -57
- /package/es/{iconfont.1792035024476.ttf → iconfont.1792139865095.ttf} +0 -0
- /package/es/{iconfont.1792035024476.woff → iconfont.1792139865095.woff} +0 -0
- /package/es/{iconfont.1792035024476.woff2 → iconfont.1792139865095.woff2} +0 -0
- /package/lib/{iconfont.1792035024476.ttf → iconfont.1792139865095.ttf} +0 -0
- /package/lib/{iconfont.1792035024476.woff → iconfont.1792139865095.woff} +0 -0
- /package/lib/{iconfont.1792035024476.woff2 → iconfont.1792139865095.woff2} +0 -0
|
@@ -427,8 +427,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
427
427
|
} = customPanelInternalData;
|
|
428
428
|
const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
|
|
429
429
|
if (prevDragGroupField || prevDragAggFnColid) {
|
|
430
|
-
if ($xeTable.
|
|
431
|
-
$xeTable.
|
|
430
|
+
if ($xeTable.handlePivotTableAggPanelDragendEvent) {
|
|
431
|
+
$xeTable.handlePivotTableAggPanelDragendEvent(evnt);
|
|
432
432
|
}
|
|
433
433
|
} else if (prevDragCol && dragCol) {
|
|
434
434
|
// 判断是否有拖动
|
|
@@ -1 +1 @@
|
|
|
1
|
-
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,computeMouseOpts:r,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)(),f=(0,_vue.reactive)({dragCol:null,dragGroupField:null,dragAggFnCol:null,dragTipText:""}),I=createInternalData(),s={refElem:Y,refBodyWrapperElem:Z,refCustomBodyElem:J,refDragLineElem:u,refDragTipElem:c},d={},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=I.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"))},v=()=>{var e=f.dragCol,t=X.value.tooltipMethod;let l="";l=t?""+(t({$table:N,column:e})||""):getI18n("vxe.custom.cstmDragTarget",[e&&"html"!==e.type?e.getTitle():""]),f.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,f.dragCol=t,f.dragGroupField=null,f.dragAggFnCol=null,v(),(0,_dom.addClass)(e,"active--drag-origin")},me=e=>{e=e.currentTarget.parentElement.parentElement.parentElement;i(),e.draggable=!1,f.dragCol=null,f.dragGroupField=null,(f.dragAggFnCol=null,_dom.removeClass)(e,"active--drag-origin")},ve=e=>{var t=I.customDragTime;e.dataTransfer&&e.dataTransfer.setDragImage((0,_dom.getTpImg)(),0,0),t&&clearTimeout(t),$.isCustomDragStatus=!0,I.prevDragGroupField=null,I.prevDragAggFnColid=null},pe=c=>{let d=z.mouseConfig,m=$.customColumnList,v=n.collectColumn;var e=K.value;let p=r.value,g=e.immediate;e=c.currentTarget;let{isCrossDrag:h,isPeerDrag:x,isSelfToChildDrag:_,isToChildDrag:b,dragEndMethod:t}=X.value;var l=f.dragCol;let{prevDragCol:o,prevDragGroupField:a,prevDragAggFnColid:s,prevDragPos:C,prevDragToChild:E}=I,T="bottom"===C?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:C,dragToChild:!!E,offsetIndex:T})).then(a=>{if(a){let e=-1,t=-1,l={},o=(_xeUtils.default.eachTree([r],e=>{l[e.id]=e}),!1);if(g){if(r.parentId&&u.parentId)if(x&&!h){if(r.parentId!==u.parentId)return}else{if(!h)return;if(l[u.id]&&(o=!0,!h||!_))return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.message({status:"error",content:getI18n("vxe.error.treeDragChild")}))}else if(r.parentId){if(!h)return}else if(u.parentId){if(!h)return;if(l[u.id]&&(o=!0,!h||!_))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&&h&&_?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,h&&b&&E?(r.parentId=u.id,u.children=(u.children||[]).concat([r])):(r.parentId=u.parentId,s.splice(i+T,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+T,0,r);(0,_utils.hasEnableConf)(d,p)&&(N.clearSelected&&N.clearSelected(),N.clearCellAreas)&&(N.clearCellAreas(),N.clearCopyCellArea());a={oldColumn:r,newColumn:u,dragColumn:r,dragPos:C,offsetIndex:T,_index:{newIndex:t,oldIndex:e}};N.dispatchEvent("custom-sort-change",a,c),N.dispatchEvent("column-dragend",a,c),g&&($.customColumnList=v.slice(0),N.handleColDragSwapColumn()),y()}}).catch(()=>{})}i(),f.dragCol=null,f.dragGroupField=null,f.dragAggFnCol=null,I.prevDragGroupField=null,I.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=f.dragCol;I.prevDragGroupField=null,I.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):(I.prevDragToChild=!!(s&&n&&u&&a),I.prevDragCol=c,I.prevDragPos=t,m(e,r,!0,t)))},y=()=>{I.customDragTime=setTimeout(()=>{$.isCustomDragStatus=!1,I.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),y()}))}},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),y()}))}},_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),y()}))}},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),y()}))}},Ce=()=>{var e=f.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||0,max:t||9999,"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||"left",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||"left",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||"left",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:f,internalData:I,xeTable:N,getRefMaps:()=>s,getComputeMaps:()=>d,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)(()=>{I=createInternalData()}),(0,_vue.provide)("$xeTableCustomPanel",e),e},render(){return this.renderVN()}});
|
|
1
|
+
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,computeMouseOpts:r,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)(),f=(0,_vue.reactive)({dragCol:null,dragGroupField:null,dragAggFnCol:null,dragTipText:""}),I=createInternalData(),s={refElem:Y,refBodyWrapperElem:Z,refCustomBodyElem:J,refDragLineElem:u,refDragTipElem:c},d={},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=I.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"))},v=()=>{var e=f.dragCol,t=X.value.tooltipMethod;let l="";l=t?""+(t({$table:N,column:e})||""):getI18n("vxe.custom.cstmDragTarget",[e&&"html"!==e.type?e.getTitle():""]),f.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,f.dragCol=t,f.dragGroupField=null,f.dragAggFnCol=null,v(),(0,_dom.addClass)(e,"active--drag-origin")},me=e=>{e=e.currentTarget.parentElement.parentElement.parentElement;i(),e.draggable=!1,f.dragCol=null,f.dragGroupField=null,(f.dragAggFnCol=null,_dom.removeClass)(e,"active--drag-origin")},ve=e=>{var t=I.customDragTime;e.dataTransfer&&e.dataTransfer.setDragImage((0,_dom.getTpImg)(),0,0),t&&clearTimeout(t),$.isCustomDragStatus=!0,I.prevDragGroupField=null,I.prevDragAggFnColid=null},pe=c=>{let d=z.mouseConfig,m=$.customColumnList,v=n.collectColumn;var e=K.value;let p=r.value,g=e.immediate;e=c.currentTarget;let{isCrossDrag:h,isPeerDrag:x,isSelfToChildDrag:_,isToChildDrag:b,dragEndMethod:t}=X.value;var l=f.dragCol;let{prevDragCol:o,prevDragGroupField:a,prevDragAggFnColid:s,prevDragPos:C,prevDragToChild:E}=I,T="bottom"===C?1:0;if(a||s)N.handlePivotTableAggPanelDragendEvent&&N.handlePivotTableAggPanelDragendEvent(c);else if(o&&l&&o!==l){let r=l,u=o;Promise.resolve(!t||t({oldColumn:r,newColumn:u,dragColumn:r,dragPos:C,dragToChild:!!E,offsetIndex:T})).then(a=>{if(a){let e=-1,t=-1,l={},o=(_xeUtils.default.eachTree([r],e=>{l[e.id]=e}),!1);if(g){if(r.parentId&&u.parentId)if(x&&!h){if(r.parentId!==u.parentId)return}else{if(!h)return;if(l[u.id]&&(o=!0,!h||!_))return void(_ui.VxeUI.modal&&_ui.VxeUI.modal.message({status:"error",content:getI18n("vxe.error.treeDragChild")}))}else if(r.parentId){if(!h)return}else if(u.parentId){if(!h)return;if(l[u.id]&&(o=!0,!h||!_))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&&h&&_?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,h&&b&&E?(r.parentId=u.id,u.children=(u.children||[]).concat([r])):(r.parentId=u.parentId,s.splice(i+T,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+T,0,r);(0,_utils.hasEnableConf)(d,p)&&(N.clearSelected&&N.clearSelected(),N.clearCellAreas)&&(N.clearCellAreas(),N.clearCopyCellArea());a={oldColumn:r,newColumn:u,dragColumn:r,dragPos:C,offsetIndex:T,_index:{newIndex:t,oldIndex:e}};N.dispatchEvent("custom-sort-change",a,c),N.dispatchEvent("column-dragend",a,c),g&&($.customColumnList=v.slice(0),N.handleColDragSwapColumn()),y()}}).catch(()=>{})}i(),f.dragCol=null,f.dragGroupField=null,f.dragAggFnCol=null,I.prevDragGroupField=null,I.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=f.dragCol;I.prevDragGroupField=null,I.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):(I.prevDragToChild=!!(s&&n&&u&&a),I.prevDragCol=c,I.prevDragPos=t,m(e,r,!0,t)))},y=()=>{I.customDragTime=setTimeout(()=>{$.isCustomDragStatus=!1,I.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),y()}))}},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),y()}))}},_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),y()}))}},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),y()}))}},Ce=()=>{var e=f.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||0,max:t||9999,"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||"left",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||"left",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||"left",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:f,internalData:I,xeTable:N,getRefMaps:()=>s,getComputeMaps:()=>d,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)(()=>{I=createInternalData()}),(0,_vue.provide)("$xeTableCustomPanel",e),e},render(){return this.renderVN()}});
|
|
@@ -34,7 +34,8 @@ hooks.add('tableFilterModule', {
|
|
|
34
34
|
} = $xeTable.getComputeMaps();
|
|
35
35
|
const updatePopupStyle = () => {
|
|
36
36
|
const {
|
|
37
|
-
filterStore
|
|
37
|
+
filterStore,
|
|
38
|
+
scrollbarHeight
|
|
38
39
|
} = reactData;
|
|
39
40
|
const {
|
|
40
41
|
elemStore
|
|
@@ -65,8 +66,6 @@ hooks.add('tableFilterModule', {
|
|
|
65
66
|
if (!filterWrapperElem) {
|
|
66
67
|
return (0, _vue.nextTick)();
|
|
67
68
|
}
|
|
68
|
-
const filterHeadElem = filterWrapperElem.querySelector('.vxe-table--filter-header');
|
|
69
|
-
const filterFootElem = filterWrapperElem.querySelector('.vxe-table--filter-footer');
|
|
70
69
|
/**
|
|
71
70
|
* 是否显示筛选按钮图标
|
|
72
71
|
* 如果不存在图标,则相对单元格居中显示
|
|
@@ -92,6 +91,7 @@ hooks.add('tableFilterModule', {
|
|
|
92
91
|
if (transfer) {
|
|
93
92
|
const ppObj = (0, _dom.updatePanelPlacement)(currEl, filterWrapperElem, {
|
|
94
93
|
defaultPlacement: 'bottom',
|
|
94
|
+
appendTo: '',
|
|
95
95
|
isMinWidth: false,
|
|
96
96
|
teleportTo: transfer
|
|
97
97
|
});
|
|
@@ -101,7 +101,7 @@ hooks.add('tableFilterModule', {
|
|
|
101
101
|
const centerWidth = targetEl ? filterWidth / 2 : (filterWidth - column.renderWidth) / 2;
|
|
102
102
|
left = btnRect.left - tableRect.left - centerWidth;
|
|
103
103
|
top = btnRect.top - tableRect.top + currEl.clientHeight;
|
|
104
|
-
maxHeight = Math.max(40, tableEl.clientHeight - top -
|
|
104
|
+
maxHeight = Math.max(40, tableEl.clientHeight - top - scrollbarHeight);
|
|
105
105
|
if (left < 1) {
|
|
106
106
|
left = 1;
|
|
107
107
|
} else if (left > tableEl.clientWidth - filterWidth - 1) {
|
|
@@ -122,7 +122,6 @@ hooks.add('tableFilterModule', {
|
|
|
122
122
|
if (zIndex) {
|
|
123
123
|
panelStyle.zIndex = zIndex;
|
|
124
124
|
}
|
|
125
|
-
filterStore.style = panelStyle;
|
|
126
125
|
// 筛选面板是自适应表格高度
|
|
127
126
|
if (compConf ? !compConf.tableFilterAutoHeight : false) {
|
|
128
127
|
maxHeight = 0;
|
|
@@ -131,8 +130,8 @@ hooks.add('tableFilterModule', {
|
|
|
131
130
|
maxHeight = customMaxHeight > maxHeight ? maxHeight : customMaxHeight;
|
|
132
131
|
}
|
|
133
132
|
}
|
|
134
|
-
|
|
135
|
-
filterStore.
|
|
133
|
+
panelStyle['--vxe-ui-vxe-table-filter-default-max-height'] = maxHeight ? (0, _dom.toCssUnit)(maxHeight) : 'none';
|
|
134
|
+
filterStore.style = panelStyle;
|
|
136
135
|
};
|
|
137
136
|
handleStyle();
|
|
138
137
|
return (0, _vue.nextTick)().then(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _vue=require("vue"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../../ui"),_util=require("../../src/util"),_dom=require("../../../ui/src/dom"),_utils=require("../../../ui/src/utils");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let{renderer,hooks}=_ui.VxeUI,tableFilterMethodKeys=["openFilter","setFilter","clearFilter","saveFilter","saveFilterByEvent","saveFilterPanel","saveFilterPanelByEvent","resetFilter","resetFilterByEvent","resetFilterPanel","resetFilterPanelByEvent","getCheckedFilters","updateFilterOptionStatus"],sourceType="table";hooks.add("tableFilterModule",{setupTable(s){let a=s.xeGrid,u=s.xeGantt,x=a||u,{props:h,reactData:
|
|
1
|
+
var _vue=require("vue"),_xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../../ui"),_util=require("../../src/util"),_dom=require("../../../ui/src/dom"),_utils=require("../../../ui/src/utils");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let{renderer,hooks}=_ui.VxeUI,tableFilterMethodKeys=["openFilter","setFilter","clearFilter","saveFilter","saveFilterByEvent","saveFilterPanel","saveFilterPanelByEvent","resetFilter","resetFilterByEvent","resetFilterPanel","resetFilterPanelByEvent","getCheckedFilters","updateFilterOptionStatus"],sourceType="table";hooks.add("tableFilterModule",{setupTable(s){let a=s.xeGrid,u=s.xeGantt,x=a||u,{props:h,reactData:g,internalData:o}=s,{refElem:r,refTableFilter:i}=s.getRefMaps(),{computeFilterOpts:k,computeMouseOpts:f,computeRendererOpts:n}=s.getComputeMaps(),d=()=>{let{filterStore:d,scrollbarHeight:c}=g,s=o.elemStore,{column:h,targetEl:f}=d;if(!h)return(0,_vue.nextTick)();let m=r.value;var e=k.value,t=n.value;let{maxHeight:v,transfer:F,zIndex:p}=e;e=h?h.filterRender:null;let _=e&&(0,_utils.isEnableConf)(e)&&e.name?t[e.name]||renderer.get(e.name):null;if(!(0,_util.getRefElem)(s["main-header-scroll"]))return(0,_vue.nextTick)();t=i.value;let C=t?t.getRefMaps().refElem.value:null;if(!C)return(0,_vue.nextTick)();let l=()=>{let e=f;if(f||(r=(r=(0,_util.getRefElem)(s[`${h.fixed||"main"}-header-wrapper`]||s["main-header-wrapper"]))?r.querySelector(".vxe-header--column."+h.id):null)&&(e=r),!e)return(0,_vue.nextTick)();var t,l,r=e.getBoundingClientRect(),i=m.getBoundingClientRect();let n=0,a=0,u=0,o={};o=F?(0,_dom.updatePanelPlacement)(e,C,{defaultPlacement:"bottom",appendTo:"",isMinWidth:!1,teleportTo:F}).style:(t=C.offsetWidth,l=f?t/2:(t-h.renderWidth)/2,n=r.left-i.left-l,a=r.top-i.top+e.clientHeight,u=Math.max(40,m.clientHeight-a-c),n<1?n=1:n>m.clientWidth-t-1&&(n=m.clientWidth-t-1),x&&(l=x.getRefMaps().refElem.value)&&(r=l.getBoundingClientRect(),a+=i.top-r.top),{top:(0,_dom.toCssUnit)(a),left:(0,_dom.toCssUnit)(n)}),p&&(o.zIndex=p),_&&!_.tableFilterAutoHeight?u=0:v&&(u=v>u?u:v),o["--vxe-ui-vxe-table-filter-default-max-height"]=u?(0,_dom.toCssUnit)(u):"none",d.style=o};return l(),(0,_vue.nextTick)().then(()=>{l()})};var e={checkFilterOptions(){var e=g.filterStore,t=e.column;t&&(t=t.filters||[],e.isAllSelected=t.every(e=>e._checked),e.isIndeterminate=!e.isAllSelected&&t.some(e=>e._checked))},handleOpenFilterColumn(e,t,l,r,i){var{initStore:n,filterStore:a}=g;a.column===r&&a.visible?a.visible=!1:(s.handleFilterOptions(r),o._currFilterParams=i,a.targetEl=t,a.style=null,a.visible=!0,n.filter=!0),(0,_vue.nextTick)().then(()=>{d()}),s.dispatchEvent("filter-visible",{column:r,field:r.field,property:r.field,filterList:s.getCheckedFilters(),visible:a.visible},e)},triggerFilterEvent(e,t,l){var r=o.elemStore,i=t.fixed,i=(0,_util.getRefElem)(r[`${i||"main"}-header-wrapper`]||r["main-header-wrapper"]),r=e.currentTarget,i=i?i.querySelector(".vxe-header--column."+t.id):null;s.handleOpenFilterColumn(e,r,i||r,t,l)},handleClearFilter(e){if(e){var{filters:l,filterRender:r}=e;if(l){var i=n.value,i=(0,_utils.isEnableConf)(r)&&r.name?i[r.name]||renderer.get(r.name):null;let t=e.filterResetMethod||(i?i.tableFilterResetMethod||i.filterResetMethod:null);l.forEach(e=>{e._checked=!1,e.checked=!1,t||(e.data=_xeUtils.default.clone(e.resetValue,!0))}),t&&t({options:l,column:e,$table:s})}}},handleColumnConfirmFilter(e,t){var l=h.mouseConfig;let{scrollXLoad:r,scrollYLoad:i}=g;var n=k.value,a=f.value,{field:u,filters:o}=e;let d=[],c=[];(o||[]).forEach(e=>{e.checked&&(d.push(e.value),c.push(e.data))});o=s.getCheckedFilters(),e={$table:s,$event:t,column:e,field:u,property:u,values:d,datas:c,filters:o,filterList:o};return n.remote||(s.handleTableData(!0),s.checkSelectionStatus()),(0,_utils.hasEnableConf)(l,a)&&a.area&&s.handleFilterEvent&&s.handleFilterEvent(t,e),t&&s.dispatchEvent("filter-change",e,t),s.closeFilter(),s.updateFooter().then(()=>{var{scrollXLoad:e,scrollYLoad:t}=g;if(r||e||i||t)return(r||e)&&s.updateScrollXSpace(),(i||t)&&s.updateScrollYSpace(),s.refreshScroll()}).then(()=>(s.updateCellAreas(),s.recalculate(!0))).then(()=>{setTimeout(()=>s.recalculate(),50)})},confirmFilterEvent(e,t){t&&s.handleColumnConfirmFilter(t,e)},handleFilterChangeRadioOption(e,t,l){var r=g.filterStore,r=r.column;r&&((r.filters||[]).forEach(e=>{e._checked=!1}),l._checked=t,s.checkFilterOptions(),s.handleFilterConfirmFilter(e,r))},handleFilterChangeMultipleOption(e,t,l){l._checked=t,s.checkFilterOptions()},handleFilterChangeOption(e,t,l){var r=g.filterStore,i=o.fullColumnIdData;let n=r.column;n||(i=i[l._colId])&&(n=i.column,r.column=n),n&&(n.filterMultiple?s.handleFilterChangeMultipleOption(e,t,l):s.handleFilterChangeRadioOption(e,t,l))},handleFilterConfirmFilter(e,t){t&&((t.filters||[]).forEach(e=>{e.checked=e._checked}),s.confirmFilterEvent(e,t))},handleFilterResetFilter(e,t){t&&(s.handleClearFilter(t),s.confirmFilterEvent(e,t),e)&&s.dispatchEvent("clear-filter",{filterList:[]},e)},handleFilterStyle(){var e=g.filterStore;return(e.visible?d:(0,_vue.nextTick))()}};return Object.assign(Object.assign({},{openFilter(e){let n=(0,_util.handleFieldOrColumn)(s,e);if(n&&n.filters){let e=o.elemStore,{fixed:r,filters:i}=n;return s.scrollToColumn(n).then(()=>{var t=(0,_util.getRefElem)(e[`${r||"main"}-header-wrapper`]||e["main-header-wrapper"]);if(t){var l=t.querySelector(`.vxe-header--column.${n.id} .vxe-cell--filter`);if(l)(0,_dom.triggerEvent)(l,"click");else{l=t.querySelector(".vxe-header--column."+n.id);if(l){let e=null;i&&(e=i[0]);t={$table:s,$grid:a,$gantt:u,$rowIndex:-1,column:n,columnIndex:s.getColumnIndex(n),$columnIndex:s.getVMColumnIndex(n),_columnIndex:s.getVTColumnIndex(n),firstFilterOption:e,fixed:r,source:sourceType,type:"header"};s.handleOpenFilterColumn(new Event("click"),null,l,n,t)}}}})}return(0,_vue.nextTick)()},setFilter(e,t,l){var r=g.filterStore,e=(0,_util.handleFieldOrColumn)(s,e);if(e&&e.filters){if(e.filters=(0,_util.toFilters)(t||[],e.id),l)return s.handleColumnConfirmFilter(e,null);r.visible&&s.handleFilterOptions(e)}return(0,_vue.nextTick)()},clearFilter(e){var t=g.filterStore,l=o.tableFullColumn,r=k.value;let i;return e?(i=(0,_util.handleFieldOrColumn)(s,e))&&s.handleClearFilter(i):l.forEach(s.handleClearFilter),e&&i===t.column||Object.assign(t,{isAllSelected:!1,isIndeterminate:!1,style:null,options:[],column:null,multiple:!1,visible:!1}),r.remote?(0,_vue.nextTick)():s.updateData()},saveFilter(e){return e&&(e=(0,_util.handleFieldOrColumn)(s,e),s.handleFilterConfirmFilter(null,e)),(0,_vue.nextTick)()},saveFilterByEvent(e,t){return t&&(t=(0,_util.handleFieldOrColumn)(s,t),s.handleFilterConfirmFilter(e,t)),(0,_vue.nextTick)()},resetFilter(e){return e&&(e=(0,_util.handleFieldOrColumn)(s,e),s.handleFilterResetFilter(null,e)),(0,_vue.nextTick)()},resetFilterByEvent(e,t){return t&&(t=(0,_util.handleFieldOrColumn)(s,t),s.handleFilterResetFilter(e,t)),(0,_vue.nextTick)()},saveFilterPanel(){var e=g.filterStore;return s.handleFilterConfirmFilter(null,e.column||null),(0,_vue.nextTick)()},saveFilterPanelByEvent(e){var t=g.filterStore;return s.handleFilterConfirmFilter(e,t.column||null),(0,_vue.nextTick)()},resetFilterPanel(){var e=g.filterStore;return s.handleFilterResetFilter(null,e.column||null),(0,_vue.nextTick)()},resetFilterPanelByEvent(e){var t=g.filterStore;return s.handleFilterResetFilter(e,t.column||null),(0,_vue.nextTick)()},getCheckedFilters(){var e=o.tableFullColumn;let n=[];return e.forEach(e=>{var{field:t,filters:l}=e,l=l||[];let r=[],i=[];l&&(l.forEach(e=>{e.checked&&(r.push(e.value),i.push(e.data))}),r.length)&&n.push({column:e,field:t,property:t,values:r,datas:i})}),n},updateFilterOptionStatus(e,t){return e._checked=t,e.checked=t,(0,_vue.nextTick)()}}),e)},setupGrid(e){return e.extendTableMethods(tableFilterMethodKeys)},setupGantt(e){return e.extendTableMethods(tableFilterMethodKeys)}});
|
|
@@ -32,6 +32,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
32
32
|
},
|
|
33
33
|
setup(props, context) {
|
|
34
34
|
const xID = _xeUtils.default.uniqueId();
|
|
35
|
+
const VxeUIScrollbarComponent = _ui.VxeUI.getComponent('VxeScrollbar');
|
|
35
36
|
const $xeTable = (0, _vue.inject)('$xeTable', {});
|
|
36
37
|
const {
|
|
37
38
|
reactData: tableReactData,
|
|
@@ -144,12 +145,15 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
144
145
|
filterStore
|
|
145
146
|
} = props;
|
|
146
147
|
const {
|
|
147
|
-
column
|
|
148
|
-
maxHeight
|
|
148
|
+
column
|
|
149
149
|
} = filterStore;
|
|
150
150
|
if (!column) {
|
|
151
151
|
return [];
|
|
152
152
|
}
|
|
153
|
+
const filterOpts = computeFilterOpts.value;
|
|
154
|
+
const {
|
|
155
|
+
useScrollbar
|
|
156
|
+
} = filterOpts;
|
|
153
157
|
const {
|
|
154
158
|
filterMultiple,
|
|
155
159
|
filters,
|
|
@@ -165,45 +169,19 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
165
169
|
const rtFilter = compConf ? compConf.renderTableFilter || compConf.renderFilter : null;
|
|
166
170
|
if (filterSlot) {
|
|
167
171
|
return [(0, _vue.h)('div', {
|
|
168
|
-
class: 'vxe-table--filter-template'
|
|
169
|
-
style: maxHeight ? {
|
|
170
|
-
maxHeight: (0, _dom.toCssUnit)(maxHeight)
|
|
171
|
-
} : {}
|
|
172
|
+
class: 'vxe-table--filter-template'
|
|
172
173
|
}, $xeTable.callSlot(filterSlot, params))];
|
|
173
174
|
} else if (filterRender && rtFilter) {
|
|
174
175
|
return [(0, _vue.h)('div', {
|
|
175
|
-
class: 'vxe-table--filter-template'
|
|
176
|
-
style: maxHeight ? {
|
|
177
|
-
maxHeight: (0, _dom.toCssUnit)(maxHeight)
|
|
178
|
-
} : {}
|
|
176
|
+
class: 'vxe-table--filter-template'
|
|
179
177
|
}, (0, _vn.getSlotVNs)(rtFilter(filterRender, params)))];
|
|
180
178
|
}
|
|
181
179
|
const isAllChecked = filterMultiple ? filterStore.isAllSelected : !filterOptions.some(item => item._checked);
|
|
182
180
|
const isAllIndeterminate = filterMultiple && filterStore.isIndeterminate;
|
|
183
|
-
|
|
184
|
-
class: 'vxe-table--filter-header'
|
|
185
|
-
}, [(0, _vue.h)('li', {
|
|
186
|
-
class: ['vxe-table--filter-option', {
|
|
187
|
-
'is--checked': isAllChecked,
|
|
188
|
-
'is--indeterminate': isAllIndeterminate
|
|
189
|
-
}],
|
|
190
|
-
title: getI18n(filterMultiple ? 'vxe.table.allTitle' : 'vxe.table.allFilter'),
|
|
191
|
-
onClick: evnt => {
|
|
192
|
-
changeAllOption(evnt, !filterStore.isAllSelected);
|
|
193
|
-
}
|
|
194
|
-
}, (filterMultiple ? [(0, _vue.h)('span', {
|
|
195
|
-
class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
|
|
196
|
-
})] : []).concat([(0, _vue.h)('span', {
|
|
197
|
-
class: 'vxe-checkbox--label'
|
|
198
|
-
}, getI18n('vxe.table.allFilter'))]))]), (0, _vue.h)('ul', {
|
|
199
|
-
class: 'vxe-table--filter-body',
|
|
200
|
-
style: maxHeight ? {
|
|
201
|
-
maxHeight: (0, _dom.toCssUnit)(maxHeight)
|
|
202
|
-
} : {}
|
|
203
|
-
}, filterOptions.map(item => {
|
|
181
|
+
const optVNs = filterOptions.map(item => {
|
|
204
182
|
const isChecked = item._checked;
|
|
205
183
|
const isIndeterminate = false;
|
|
206
|
-
return (0, _vue.h)('
|
|
184
|
+
return (0, _vue.h)('div', {
|
|
207
185
|
class: ['vxe-table--filter-option', {
|
|
208
186
|
'is--checked': item._checked
|
|
209
187
|
}],
|
|
@@ -216,7 +194,30 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
216
194
|
})] : []).concat([(0, _vue.h)('span', {
|
|
217
195
|
class: 'vxe-checkbox--label'
|
|
218
196
|
}, (0, _utils.formatText)(item.label, 1))]));
|
|
219
|
-
})
|
|
197
|
+
});
|
|
198
|
+
return [(0, _vue.h)('div', {
|
|
199
|
+
class: 'vxe-table--filter-header'
|
|
200
|
+
}, [(0, _vue.h)('div', {
|
|
201
|
+
class: ['vxe-table--filter-option', {
|
|
202
|
+
'is--checked': isAllChecked,
|
|
203
|
+
'is--indeterminate': isAllIndeterminate
|
|
204
|
+
}],
|
|
205
|
+
title: getI18n(filterMultiple ? 'vxe.table.allTitle' : 'vxe.table.allFilter'),
|
|
206
|
+
onClick: evnt => {
|
|
207
|
+
changeAllOption(evnt, !filterStore.isAllSelected);
|
|
208
|
+
}
|
|
209
|
+
}, (filterMultiple ? [(0, _vue.h)('span', {
|
|
210
|
+
class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
|
|
211
|
+
})] : []).concat([(0, _vue.h)('span', {
|
|
212
|
+
class: 'vxe-checkbox--label'
|
|
213
|
+
}, getI18n('vxe.table.allFilter'))]))]), useScrollbar ? (0, _vue.h)(VxeUIScrollbarComponent, {
|
|
214
|
+
class: 'vxe-table--scrollbar-filter-body',
|
|
215
|
+
viewClassName: 'vxe-table--scrollbar-filter-body-view'
|
|
216
|
+
}, {
|
|
217
|
+
default: () => optVNs
|
|
218
|
+
}) : (0, _vue.h)('div', {
|
|
219
|
+
class: 'vxe-table--filter-body'
|
|
220
|
+
}, optVNs)];
|
|
220
221
|
};
|
|
221
222
|
const renderFooters = () => {
|
|
222
223
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),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"),_vn=require("../../../ui/src/vn"),_log=require("../../../ui/src/log"),_xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let warnLog=(0,_log.createComponentLog)("table").warnLog,{getI18n,getIcon,renderer,renderEmptyElement}=_ui.VxeUI;var _default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeTableFilterPanel",props:{filterStore:{type:Object,default:()=>({})}},setup(
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),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"),_vn=require("../../../ui/src/vn"),_log=require("../../../ui/src/log"),_xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let warnLog=(0,_log.createComponentLog)("table").warnLog,{getI18n,getIcon,renderer,renderEmptyElement}=_ui.VxeUI;var _default=exports.default=(0,_comp.defineVxeComponent)({name:"VxeTableFilterPanel",props:{filterStore:{type:Object,default:()=>({})}},setup(f,e){var t=_xeUtils.default.uniqueId();let p=_ui.VxeUI.getComponent("VxeScrollbar"),_=(0,_vue.inject)("$xeTable",{}),{reactData:m,internalData:b,getComputeMaps:l}=_,{computeFilterOpts:h,computeRendererOpts:x}=l(),C=(0,_vue.ref)(),r={refElem:C},g={xID:t,props:f,context:e,getRefMaps:()=>r},E=(0,_vue.computed)(()=>{var e=f.filterStore,e=e.column;return e&&e.filters&&e.filters.some(e=>e.checked)}),i=(e,t)=>{var l=f.filterStore,r=l.column;r&&r.filters&&r.filters.forEach(e=>{e._checked=t,e.checked=t}),l.isAllSelected=t,l.isIndeterminate=!1},F=e=>{var t=f.filterStore;e||warnLog("vxe.error.delFunc",["confirmFilter","saveFilterPanelByEvent"]),_.handleFilterConfirmFilter(e||new Event("click"),t.column||null)};let I=e=>{var t=f.filterStore;_.handleFilterResetFilter(e,t.column||null)};let O=(e,t,l)=>{_.handleFilterChangeOption(e,t,l)},S=(e,t)=>{var l=f.filterStore,l=l.column;l&&l.filterMultiple?i(0,t):I(e)};t={changeRadioOption:(e,t,l)=>{_.handleFilterChangeRadioOption(e,t,l)},changeMultipleOption:(e,t,l)=>{_.handleFilterChangeMultipleOption(e,t,l)},changeAllOption:S,changeOption:O,confirmFilter:F,resetFilter:I};Object.assign(g,t);return g.renderVN=()=>{var e,t,l,r,i,a,n,o,s,u=f.filterStore,c=m.initStore,{visible:v,column:d}=u;return d?(t=x.value,l=(t=(e=d?d.filterRender:null)&&(0,_utils.isEnableConf)(e)&&e.name?t[e.name]||renderer.get(e.name):null)?t.tableFilterClassName||t.filterClassName:"",r=Object.assign({},b._currFilterParams,{$panel:g,$table:_}),i=_.props,a=_.getComputeMaps().computeSize,a=a.value,{transfer:n,destroyOnClose:o,className:s}=h.value,(0,_vue.h)(_vue.Teleport,{to:"body",disabled:!n},[(0,_vue.h)("div",{ref:C,class:["vxe-table--filter-wrapper","filter--prevent-default",s,(0,_dom.getPropClass)(l,r),{["size--"+a]:a,"is--animat":i.animat,"is--multiple":d.filterMultiple,"is--active":v}],style:u.style},c.filter&&(!o||v)&&d?((e,t)=>{let l=f.filterStore;var r=l.column;if(!r)return[];var i=h.value.useScrollbar;let{filterMultiple:a,filters:n,slots:o}=r;var r=n||[],s=o?o.filter:null,u=Object.assign({},b._currFilterParams,{option:r[0],$panel:g,$table:_}),t=t?t.renderTableFilter||t.renderFilter:null;if(s)return[(0,_vue.h)("div",{class:"vxe-table--filter-template"},_.callSlot(s,u))];if(e&&t)return[(0,_vue.h)("div",{class:"vxe-table--filter-template"},(0,_vn.getSlotVNs)(t(e,u)))];s=a?l.isAllSelected:!r.some(e=>e._checked),t=a&&l.isIndeterminate;let c=r.map(t=>{var e=t._checked;return(0,_vue.h)("div",{class:["vxe-table--filter-option",{"is--checked":t._checked}],title:t.label,onClick:e=>{O(e,!t._checked,t)}},(a?[(0,_vue.h)("span",{class:["vxe-checkbox--icon",e?getIcon().TABLE_CHECKBOX_CHECKED:getIcon().TABLE_CHECKBOX_UNCHECKED]})]:[]).concat([(0,_vue.h)("span",{class:"vxe-checkbox--label"},(0,_utils.formatText)(t.label,1))]))});return[(0,_vue.h)("div",{class:"vxe-table--filter-header"},[(0,_vue.h)("div",{class:["vxe-table--filter-option",{"is--checked":s,"is--indeterminate":t}],title:getI18n(a?"vxe.table.allTitle":"vxe.table.allFilter"),onClick:e=>{S(e,!l.isAllSelected)}},(a?[(0,_vue.h)("span",{class:["vxe-checkbox--icon",t?getIcon().TABLE_CHECKBOX_INDETERMINATE:s?getIcon().TABLE_CHECKBOX_CHECKED:getIcon().TABLE_CHECKBOX_UNCHECKED]})]:[]).concat([(0,_vue.h)("span",{class:"vxe-checkbox--label"},getI18n("vxe.table.allFilter"))]))]),i?(0,_vue.h)(p,{class:"vxe-table--scrollbar-filter-body",viewClassName:"vxe-table--scrollbar-filter-body-view"},{default:()=>c}):(0,_vue.h)("div",{class:"vxe-table--filter-body"},c)]})(e,t).concat((()=>{var e=f.filterStore,t=e.column;if(!t)return[];var l=h.value,r=x.value,i=E.value,{filterRender:t,filterMultiple:a}=t,{confirmButtonText:l,resetButtonText:n,showFooter:o}=l,r=t&&(0,_utils.isEnableConf)(t)&&t.name?r[t.name]||renderer.get(t.name):null,t=!i&&!e.isAllSelected&&!e.isIndeterminate;let s=!!a;return _xeUtils.default.isBoolean(o)?s=o:r&&(s=!(!1===r.showTableFilterFooter||!1===r.showFilterFooter||!1===r.isFooter)),s?[(0,_vue.h)("div",{class:"vxe-table--filter-footer"},[(0,_vue.h)("button",{class:{"is--disabled":t},disabled:t,onClick:F},l||getI18n("vxe.table.confirmFilter")),(0,_vue.h)("button",{onClick:I},n||getI18n("vxe.table.resetFilter"))])]:[]})()):[])])):renderEmptyElement(g)},g},render(){return this.renderVN()}});
|