text: "use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils/methods/xe-utils")),_cell=_interopRequireDefault(require("../../cell")),_vXETable=_interopRequireWildcard(require("../../v-x-e-table")),_tools=require("../../tools");function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function(){return e},e}function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!==_typeof(e)&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var l=o?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(i,r,l):i[r]=e[r]}return i.default=e,t&&t.set(e,i),i}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var rowUniqueId=0,browse=_tools.DomTools.browse,isWebkit=browse["-webkit"]&&!browse.edge,debounceScrollYDuration=browse.msie?40:20,headerProps={children:"children"};function getRowUniqueId(){return"row_".concat(++rowUniqueId)}function isTargetRadioOrCheckbox(e,t,i,o){var r=e.target;return r&&t.type===i&&"input"===r.tagName.toLowerCase()&&r.type===(o||i)}var Methods={getParentElem:function(){return this.$grid?this.$grid.$el.parentNode:this.$el.parentNode},getParentHeight:function(){return this.$grid?this.$grid.getParentHeight():this.getParentElem().clientHeight},getExcludeHeight:function(){return this.$grid?this.$grid.getExcludeHeight():0},clearAll:function(){return this.clearSort(),this.clearCurrentRow(),this.clearCurrentColumn(),this.clearSelection(),this.clearSelectReserve(),this.clearRowExpand(),this.clearTreeExpand(),_vXETable.default._edit&&this.clearActived(),_vXETable.default._filter&&this.clearFilter(),(this.keyboardConfig||this.mouseConfig)&&(this.clearIndexChecked(),this.clearHeaderChecked(),this.clearChecked(),this.clearSelected(),this.clearCopyed()),this.clearScroll()},refreshData:function(){var e=this;return this.$nextTick().then(function(){return e.tableData=[],e.$nextTick().then(function(){return e.loadTableData(e.tableFullData)})})},updateData:function(){return this.handleTableData(!0).then(this.updateFooter).then(this.recalculate)},handleTableData:function(e){var t=this.scrollYLoad,i=this.scrollYStore,o=e?this.updateAfterFullData():this.afterFullData;return this.tableData=t?o.slice(i.startIndex,i.startIndex+i.renderSize):o.slice(0),this.$nextTick()},loadTableData:function(e,t){var i=this,o=this.height,r=this.maxHeight,l=this.showOverflow,n=this.treeConfig,s=this.editStore,a=this.optimizeOpts,c=this.scrollYStore,h=a.scrollY,u=e?e.slice(0):[],d=!n&&h&&h.gt&&h.gt<u.length;c.startIndex=0,c.visibleIndex=0,s.insertList=[],s.removeList=[],this.tableFullData=u,this.updateCache(!0),this.tableSynchData=e,this.tableSourceData=_xeUtils.default.clone(u,!0),!(this.scrollYLoad=d)||o||r||_tools.UtilTools.error("vxe.error.scrollYReqProp",["height | max-height"]),d&&!l&&_tools.UtilTools.warn("vxe.error.scrollYReqProp",["show-overflow"]);var f=Promise.resolve();return d&&(f=this.computeScrollLoad()),f.then(function(){return i.isLoadData=!0,i.computeRowHeight(),i.handleTableData(!0),i.handleReserveStatus(),i.checkSelectionStatus(),f=i.$nextTick(),t||(f=f.then(i.recalculate)),f.then(i.refreshScroll)})},loadData:function(e){return this.loadTableData(e).then(this.recalculate)},reloadData:function(e){var t=this;return this.clearAll().then(function(){return t.loadTableData(e)}).then(this.handleDefault)},reloadRow:function(e,t,i){var o=this.tableSourceData,r=this.tableData,l=this.getRowIndex(e),n=o[l];return n&&e&&(i?_xeUtils.default.set(n,i,_xeUtils.default.get(t||e,i)):t?(o[l]=t,_xeUtils.default.clear(e,void 0),Object.assign(e,this.defineField(Object.assign({},t))),this.updateCache(!0)):_xeUtils.default.destructuring(n,_xeUtils.default.clone(e,!0))),this.tableData=r.slice(0),this.$nextTick()},loadColumn:function(e){var t=this;return this.collectColumn=_xeUtils.default.mapTree(e,function(e){return _cell.default.createColumn(t,e)},headerProps),this.$nextTick()},reloadColumn:function(e){return this.clearAll(),this.loadColumn(e)},updateCache:function(r){function e(e,t){var i=_tools.UtilTools.getRowid(l,e);i||(i=getRowUniqueId(),_xeUtils.default.set(e,u,i)),d&&e[n.hasChild]&&_xeUtils.default.isUndefined(e[n.children])&&(e[n.children]=null);var o={row:e,rowid:i,index:t};r&&(s[i]=o,a.set(e,o)),h[i]=o,c.set(e,o)}var l=this,t=this.treeConfig,n=this.treeOpts,i=this.tableFullData,s=this.fullDataRowIdData,a=this.fullDataRowMap,c=this.fullAllDataRowMap,h=this.fullAllDataRowIdData,u=_tools.UtilTools.getRowkey(this),d=t&&n.lazy;r&&(s=this.fullDataRowIdData={},a.clear()),h=this.fullAllDataRowIdData={},c.clear(),t?_xeUtils.default.eachTree(i,e,n):i.forEach(e)},appendTreeCache:function(e,t){var r=this,i=this.tableSourceData,o=this.treeOpts,l=this.fullDataRowIdData,n=this.fullDataRowMap,s=this.fullAllDataRowMap,a=this.fullAllDataRowIdData,c=o.children,h=o.hasChild,u=_tools.UtilTools.getRowkey(this),d=_tools.UtilTools.getRowid(this,e),f=_xeUtils.default.findTree(i,function(e){return d===_tools.UtilTools.getRowid(r,e)},o);_xeUtils.default.eachTree(t,function(e,t){var i=_tools.UtilTools.getRowid(r,e);i||(i=getRowUniqueId(),_xeUtils.default.set(e,u,i)),e[h]&&_xeUtils.default.isUndefined(e[c])&&(e[c]=null);var o={row:e,rowid:i,index:t};l[i]=o,n.set(e,o),a[i]=o,s.set(e,o)},o),f&&(f.item[c]=_xeUtils.default.clone(t,!0))},cacheColumnMap:function(){var e=this.isGroup,t=this.tableFullColumn,i=this.collectColumn,o=this.fullColumnMap,r=this.fullColumnIdData={};o.clear(),e&&_xeUtils.default.eachTree(i,function(e,t){if(e.children&&e.children.length){var i={column:e,colid:e.id,index:t};r[e.id]=i,o.set(e,i)}},headerProps),t.forEach(function(e,t){var i={column:e,colid:e.id,index:t};r[e.id]=i,o.set(e,i)},headerProps)},getRowNode:function(e){var t=this;if(e){var i=this.treeConfig,o=this.treeOpts,r=this.tableFullData,l=this.fullAllDataRowIdData,n=e.getAttribute("data-rowid");if(i){var s=_xeUtils.default.findTree(r,function(e){return _tools.UtilTools.getRowid(t,e)===n},o);if(s)return s}else if(l[n]){var a=l[n];return{item:a.row,index:a.index,items:r}}}return null},getColumnNode:function(e){if(e){var t=this.fullColumnIdData,i=this.tableFullColumn,o=t[e.getAttribute("data-colid")];return{item:o.column,index:o.index,items:i}}return null},getRowIndex:function(e){return this.fullDataRowMap.has(e)?this.fullDataRowMap.get(e).index:-1},$getRowIndex:function(e){return this.afterFullData.indexOf(e)},getColumnIndex:function(e){return this.fullColumnMap.has(e)?this.fullColumnMap.get(e).index:-1},$getColumnIndex:function(e){return this.visibleColumn.indexOf(e)},isSeqColumn:function(e){return e&&("seq"===e.type||"index"===e.type)},defineField:function(o){var e=this.treeConfig,t=this.treeOpts,i=_tools.UtilTools.getRowkey(this);return this.visibleColumn.forEach(function(e){var t=e.property,i=e.editRender;t&&!_xeUtils.default.has(o,t)&&_xeUtils.default.set(o,t,i&&!_xeUtils.default.isUndefined(i.defaultValue)?i.defaultValue:null)}),e&&t.lazy&&_xeUtils.default.isUndefined(o[t.children])&&(o[t.children]=null),_xeUtils.default.get(o,i)||_xeUtils.default.set(o,i,getRowUniqueId()),o},createData:function(e){var t=this;return this.$nextTick().then(function(){return e.map(t.defineField)})},createRow:function(t){var i=this,o=_xeUtils.default.isArray(t);return o||(t=[t]),this.$nextTick().then(function(){var e=t.map(function(e){return i.defineField(Object.assign({},e))});return o?e:e[0]})},clearData:function(e,t){var i=this.tableFullData,o=this.visibleColumn;return arguments.length?e&&!_xeUtils.default.isArray(e)&&(e=[e]):e=i,t?e.forEach(function(e){return _xeUtils.default.set(e,t,null)}):e.forEach(function(t){o.forEach(function(e){e.property&&_tools.UtilTools.setCellValue(t,e,null)})}),this.$nextTick()},isInsertByRow:function(e){return-1<this.editStore.insertList.indexOf(e)},hasRowChange:function(e,t){return _tools.UtilTools.warn("vxe.error.delFunc",["hasRowChange","isUpdateByRow"]),this.isUpdateByRow(e,t)},isUpdateByRow:function(e,t){var i,o,r=this,l=this.visibleColumn,n=this.treeConfig,s=this.treeOpts,a=this.tableSourceData,c=this.fullDataRowIdData,h=_tools.UtilTools.getRowid(this,e);if(!c[h])return!1;if(n){var u=s.children,d=_xeUtils.default.findTree(a,function(e){return h===_tools.UtilTools.getRowid(r,e)},s);e=Object.assign({},e,_defineProperty({},u,null)),d&&(i=Object.assign({},d.item,_defineProperty({},u,null)))}else{i=a[c[h].index]}if(i){if(1<arguments.length)return!_xeUtils.default.isEqual(_xeUtils.default.get(i,t),_xeUtils.default.get(e,t));for(var f=0,p=l.length;f<p;f++)if((o=l[f].property)&&!_xeUtils.default.isEqual(_xeUtils.default.get(i,o),_xeUtils.default.get(e,o)))return!0}return!1},getColumns:function(e){var t=this.visibleColumn;return arguments.length?t[e]:t.slice(0)},getColumnById:function(e){var t=this.fullColumnIdData;return t[e]?t[e].column:null},getColumnByField:function(t){return _xeUtils.default.find(this.tableFullColumn,function(e){return e.property===t})},getTableColumn:function(){return{fullColumn:this.tableFullColumn.slice(0),visibleColumn:this.visibleColumn.slice(0),tableColumn:this.tableColumn.slice(0)}},getRecords:function(){return _tools.UtilTools.warn("vxe.error.delFunc",["getRecords","getData"]),this.getData.apply(this,arguments)},getData:function(e){var t=this.data||this.tableSynchData;return arguments.length?t[e]:t.slice(0)},getAllRecords:function(){return _tools.UtilTools.warn("vxe.error.delFunc",["getAllRecords","getRecordset"]),this.getRecordset()},getSelectRecords:function(){var e=this.tableFullData,t=this.treeConfig,i=this.treeOpts,o=this.checkboxOpts.checkField,r=[];if(o)r=t?_xeUtils.default.filterTree(e,function(e){return _xeUtils.default.get(e,o)},i):e.filter(function(e){return _xeUtils.default.get(e,o)});else{var l=this.selection;r=t?_xeUtils.default.filterTree(e,function(e){return-1<l.indexOf(e)},i):e.filter(function(e){return-1<l.indexOf(e)})}return r},updateAfterFullData:function(){var e=this.visibleColumn,t=this.tableFullData,i=this.remoteSort,c=this.remoteFilter,h=this.filterOpts,o=this.sortOpts,r=t.slice(0),l=_xeUtils.default.find(e,function(e){return e.order}),n=[];if(e.forEach(function(e){if(e.filters&&e.filters.length){var t=[],i=[];e.filters.forEach(function(e){e.checked&&(i.push(e),t.push(e.value))}),n.push({column:e,valueList:t,itemList:i})}}),n.length&&(r=r.filter(function(a){return n.every(function(e){var t=e.column,i=e.valueList,o=e.itemList;if(!i.length||h.remote||c)return!0;var r=t.filterRender,l=t.property,n=t.filterMethod,s=r?_vXETable.Renderer.get(r.name):null;return!n&&s&&s.renderFilter&&(n=s.filterMethod),n?o.some(function(e){return n({value:e.value,option:e,row:a,column:t})}):-1<i.indexOf(_xeUtils.default.get(a,l))})})),l&&l.order){var s=o.sortMethod||this.sortMethod;if(!(_xeUtils.default.isBoolean(l.remoteSort)?l.remoteSort:o.remote||i))if(s)r=s({data:r,column:l,property:l.property,order:l.order,$table:this})||r;else{var a=l.sortMethod?r.sort(l.sortMethod):_xeUtils.default.sortBy(r,l.property);r="desc"===l.order?a.reverse():a}}return this.afterFullData=r},getRowById:function(e){var t=this.fullDataRowIdData;return t[e]?t[e].row:null},getRowid:function(e){var t=this.fullAllDataRowMap;return t.has(e)?t.get(e).rowid:null},getTableData:function(){var e=this.tableFullData,t=this.afterFullData,i=this.tableData,o=this.footerData;return{fullData:e.slice(0),visibleData:t.slice(0),tableData:i.slice(0),footerData:o.slice(0)}},handleDefault:function(){var e=this;(this.checkboxConfig||this.selectConfig)&&this.handleSelectionDefChecked(),this.radioConfig&&this.handleRadioDefChecked(),this.sortConfig&&this.handleDefaultSort(),this.expandConfig&&this.handleDefaultRowExpand(),this.treeConfig&&this.handleDefaultTreeExpand(),this.updateFooter(),this.$nextTick(function(){return setTimeout(e.recalculate)})},mergeCustomColumn:function(i){var e=this.tableFullColumn;this.isUpdateCustoms=!0,i.length&&e.forEach(function(t){var e=_xeUtils.default.find(i,function(e){return t.property&&(e.field||e.prop)===t.property});e&&(_xeUtils.default.isNumber(e.resizeWidth)&&(t.resizeWidth=e.resizeWidth),_xeUtils.default.isBoolean(e.visible)&&(t.visible=e.visible))}),this.$emit("update:customs",e)},resetAll:function(){this.resetCustoms(),this.resetResizable()},hideColumn:function(e){return this.handleVisibleColumn(e,!1)},showColumn:function(e){return this.handleVisibleColumn(e,!0)},resetCustoms:function(){return this.handleVisibleColumn()},handleVisibleColumn:function(e,t){return arguments.length?e.visible=t:this.tableFullColumn.forEach(function(e){e.visible=!0}),this.$toolbar&&this.$toolbar.handleCustoms(),this.$nextTick()},reloadCustoms:function(e){var t=this;return this.$nextTick().then(function(){return t.mergeCustomColumn(e),t.refreshColumn().then(function(){return t.tableFullColumn})})},refreshColumn:function(){var i,e=this,o=0,r=[],l=null,n=null,s=[],a=[],t=this.tableFullColumn,c=this.isGroup,h=this.columnStore,u=this.scrollXStore,d=this.optimizeOpts.scrollX;c&&_xeUtils.default.eachTree(this.collectColumn,function(e){e.children&&e.children.length&&(e.visible=!!_xeUtils.default.findTree(e.children,function(e){return e.children&&e.children.length?0:e.visible},headerProps))},headerProps),t.filter(function(e){return e.visible}).forEach(function(e,t){"left"===e.fixed?(null===l&&(l=o),i||(t-o!=0?i=!0:o++),r.push(e)):"right"===e.fixed?(i||(null===n&&(n=t),t-n!=0?i=!0:n++),a.push(e)):s.push(e)});var f=r.concat(s).concat(a),p=d&&d.gt&&d.gt<t.length;return Object.assign(h,{leftList:r,centerList:s,rightList:a}),c&&(i||l||null!==n&&n!==f.length)&&_tools.UtilTools.error("vxe.error.groupFixed"),p&&(this.isGroup&&_tools.UtilTools.warn("vxe.error.scrollXNotGroup"),Object.assign(u,{startIndex:0,visibleIndex:0}),f=f.slice(u.startIndex,u.startIndex+u.renderSize)),this.scrollXLoad=p,this.tableColumn=f,this.$nextTick().then(function(){e.updateFooter(),e.recalculate(!0)})},analyColumnWidth:function(){var t=this.columnWidth,i=this.columnMinWidth,o=[],r=[],l=[],n=[],s=[],a=[];this.tableFullColumn.forEach(function(e){t&&!e.width&&(e.width=t),i&&!e.minWidth&&(e.minWidth=i),e.visible&&(e.resizeWidth?o.push(e):_tools.DomTools.isPx(e.width)?r.push(e):_tools.DomTools.isScale(e.width)?n.push(e):_tools.DomTools.isPx(e.minWidth)?l.push(e):_tools.DomTools.isScale(e.minWidth)?s.push(e):a.push(e))}),Object.assign(this.columnStore,{resizeList:o,pxList:r,pxMinList:l,scaleList:n,scaleMinList:s,autoList:a})},refreshScroll:function(){var e=this,t=this.lastScrollLeft,i=this.lastScrollTop;return this.clearScroll(),this.$nextTick().then(function(){if(t||i)return e.lastScrollLeft=0,e.lastScrollTop=0,e.scrollTo(t,i)})},recalculate:function(e){var t=this,i=this.$refs,o=i.tableBody,r=i.tableHeader,l=i.tableFooter,n=o?o.$el:null,s=r?r.$el:null,a=l?l.$el:null;return n&&(this.autoCellWidth(s,n,a),!0===e)?this.computeScrollLoad().then(function(){t.autoCellWidth(s,n,a),t.computeScrollLoad()}):this.computeScrollLoad()},autoCellWidth:function(e,t,i){var o,r=0,l=t.clientWidth,n=l,s=this.fit,a=this.columnStore,c=a.resizeList,h=a.pxMinList,u=a.pxList,d=a.scaleList,f=a.scaleMinList,p=a.autoList;if(h.forEach(function(e){var t=parseInt(e.minWidth);r+=t,e.renderWidth=t}),o=n/100,f.forEach(function(e){var t=Math.floor(parseInt(e.minWidth)*o);r+=t,e.renderWidth=t}),d.forEach(function(e){var t=Math.floor(parseInt(e.width)*o);r+=t,e.renderWidth=t}),u.forEach(function(e){var t=parseInt(e.width);r+=t,e.renderWidth=t}),c.forEach(function(e){var t=parseInt(e.resizeWidth);r+=t,e.renderWidth=t}),o=0<(n-=r)?Math.floor(n/(f.length+h.length+p.length)):0,s?0<n&&f.concat(h).forEach(function(e){r+=o,e.renderWidth+=o}):o=40,p.forEach(function(e,t){var i=Math.max(o,40);e.renderWidth=i,r+=i}),s){var g=d.concat(f).concat(h).concat(p),x=g.length-1;if(0<x){var v=l-r;if(0<v){for(;0<v&&0<=x;)v--,g[x--].renderWidth++;r=l}}}var w=t.offsetHeight,m=t.scrollHeight>t.clientHeight;if(this.scrollbarWidth=m?t.offsetWidth-l:0,this.overflowY=m,this.tableWidth=r,this.tableHeight=w,this.parentHeight=this.getParentHeight(),e&&(this.headerHeight=e.offsetHeight,e.scrollLeft!==t.scrollLeft&&(e.scrollLeft=t.scrollLeft)),i){var T=i.offsetHeight;this.scrollbarHeight=Math.max(T-i.clientHeight,0),this.overflowX=r>i.clientWidth,this.footerHeight=T}else this.scrollbarHeight=Math.max(w-t.clientHeight,0),this.overflowX=l<r;this.overflowX&&this.checkScrolling()},resetResizable:function(){return this.tableFullColumn.forEach(function(e){e.resizeWidth=0}),this.$toolbar&&this.$toolbar.resetResizable(),this.analyColumnWidth(),this.recalculate(!0)},updateStyle:function(){var x=this,t=this.$refs,v=this.isGroup,w=this.fullColumnIdData,m=this.maxHeight,e=this.height,T=this.parentHeight,b=this.border,R=this.tableColumn,_=this.headerHeight,C=this.showHeaderOverflow,y=this.showFooter,E=this.showOverflow,S=this.footerHeight,D=this.tableHeight,U=this.tableWidth,k=this.scrollbarHeight,$=this.scrollbarWidth,O=this.scrollXLoad,I=this.scrollYLoad,L=this.columnStore,A=this.elemStore,i=this.editStore,o=this.currentRow,r=this.mouseConfig,M=0;e&&(M="auto"===e?T:(_tools.DomTools.isScale(e)?Math.floor(parseInt(e)/100*T):_xeUtils.default.toNumber(e))-this.getExcludeHeight(),y&&(M+=k+1));var l=t.emptyPlaceholder;return l&&(l.style.top=e?"":"".concat(_,"px")),["main","left","right"].forEach(function(d,e){var f=0<e?d:"",p=L["".concat(f,"List")],g=t["".concat(f,"Container")];["header","body","footer"].forEach(function(a){var e=A["".concat(d,"-").concat(a,"-wrapper")],t=A["".concat(d,"-").concat(a,"-table")];if("header"===a){var i=U;O&&(f&&(R=p),i=R.reduce(function(e,t){return e+t.renderWidth},0)),t&&(t.style.width=i?"".concat(i+$,"px"):"",browse.msie&&_xeUtils.default.arrayEach(t.querySelectorAll(".vxe-resizable"),function(e){e.style.height="".concat(e.parentNode.offsetHeight,"px")}));var o=A["".concat(d,"-").concat(a,"-repair")];o&&(o.style.width="".concat(U,"px"));var r=A["".concat(d,"-").concat(a,"-list")];v&&r&&_xeUtils.default.arrayEach(r.querySelectorAll(".col--group"),function(e){var t=x.getColumnNode(e).item,i=t.showHeaderOverflow,o=_xeUtils.default.isBoolean(i)?i:C,r=0,l=0;"title"!==o&&(!0!==o&&"tooltip"!==o)&&"ellipsis"!==o||(_xeUtils.default.eachTree(t.children,function(e){e.children&&t.children.length||l++,r+=e.renderWidth}),e.style.width="".concat(r-l-(b?2:0),"px"))})}else if("body"===a){var l=A["".concat(d,"-").concat(a,"-emptyBlock")];if(e&&(m?(m="auto"===m?T:_tools.DomTools.isScale(m)?Math.floor(parseInt(m)/100*T):_xeUtils.default.toNumber(m),e.style.maxHeight="".concat(f?m-_-(y?0:k):m-_,"px")):e.style.height=0<M?"".concat(f?(0<M?M-_-S:D)-(y?0:k):M-_-S,"px"):""),g){var n="right"===f,s=L["".concat(f,"List")];e.style.top="".concat(_,"px"),g.style.height="".concat((0<M?M-_-S:D)+_+S-k*(y?2:1),"px"),g.style.width="".concat(s.reduce(function(e,t){return e+t.renderWidth},n?$:0),"px")}var c=U;f&&E?c=(R=p).reduce(function(e,t){return e+t.renderWidth},0):O&&(f&&(R=p),c=R.reduce(function(e,t){return e+t.renderWidth},0)),t&&(t.style.width=c?"".concat(c,"px"):"",t.style.paddingRight=$&&f&&(browse["-moz"]||browse.safari)?"".concat($,"px"):""),l&&(l.style.width=c?"".concat(c,"px"):"")}else if("footer"===a){var h=U;f&&E?h=(R=p).reduce(function(e,t){return e+t.renderWidth},0):O&&(f&&(R=p),h=R.reduce(function(e,t){return e+t.renderWidth},0)),e&&(g&&(e.style.top="".concat(0<M?M-S:D+_,"px")),e.style.marginTop="".concat(-k-1,"px")),t&&(t.style.width=h?"".concat(h+$,"px"):"")}var u=A["".concat(d,"-").concat(a,"-colgroup")];u&&_xeUtils.default.arrayEach(u.children,function(e){var t=e.getAttribute("name");if("col_gutter"===t&&(e.style.width="".concat($,"px")),w[t]){var i,s=w[t].column,o=s.showHeaderOverflow,r=s.showOverflow;e.style.width="".concat(s.renderWidth,"px");var l="title"===(i="header"===a?_xeUtils.default.isUndefined(o)||_xeUtils.default.isNull(o)?C:o:_xeUtils.default.isUndefined(r)||_xeUtils.default.isNull(r)?E:r)||(!0===i||"tooltip"===i)||"ellipsis"===i,n=A["".concat(d,"-").concat(a,"-list")];!O&&!I||l||(l=!0),n&&l&&_xeUtils.default.arrayEach(n.querySelectorAll(".".concat(s.id)),function(e){var t=parseInt(e.getAttribute("colspan")||1),i=e.querySelector(".vxe-cell"),o=s.renderWidth;if(i){if(1<t)for(var r=x.getColumnIndex(s),l=1;l<t;l++){var n=x.getColumns(r+l);n&&(o+=n.renderWidth)}i.style.width="".concat(b?o-2*t:o,"px")}})}})})}),o&&this.setCurrentRow(o),r&&r.selected&&i.selected.row&&i.selected.column&&this.addColSdCls(),this.$nextTick()},checkScrolling:function(){var e=this.$refs,t=e.tableBody,i=e.leftContainer,o=e.rightContainer,r=t?t.$el:null;r&&(i&&_tools.DomTools[0<r.scrollLeft?"addClass":"removeClass"](i,"scrolling--middle"),o&&_tools.DomTools[r.clientWidth<r.scrollWidth-r.scrollLeft?"addClass":"removeClass"](o,"scrolling--middle"))},preventEvent:function(t,e,i,o,r){var l,n=this;return _vXETable.Interceptor.get(e).some(function(e){return!1===e(i,t,n)})||o&&(l=o()),r&&r(),l},handleGlobalMousedownEvent:function(i){var o=this,r=this.$el,e=this.$refs,t=this.editStore,l=this.ctxMenuStore,n=this.editConfig,s=void 0===n?{}:n,a=this.filterStore,c=this.getRowNode,h=t.actived,u=e.filterWrapper,d=e.validTip;u&&(_tools.DomTools.getEventTargetNode(i,r,"vxe-filter-wrapper").flag||_tools.DomTools.getEventTargetNode(i,u.$el).flag||this.preventEvent(i,"event.clearFilter",a.args,this.closeFilter)),h.row&&!1!==s.autoClear&&(d&&_tools.DomTools.getEventTargetNode(i,d.$el).flag||(!this.lastCallTime||this.lastCallTime+50<Date.now())&&this.preventEvent(i,"event.clearActived",h.args,function(){var e;if("row"===s.mode){var t=_tools.DomTools.getEventTargetNode(i,r,"vxe-body--row");e=t.flag?c(t.targetElem).item!==c(h.args.cell.parentNode).item:0}else e=!_tools.DomTools.getEventTargetNode(i,r,"col--edit").flag;!e&&_tools.DomTools.getEventTargetNode(i,r).flag||setTimeout(function(){return o.clearActived(i)})})),l.visible&&this.$refs.ctxWrapper&&!_tools.DomTools.getEventTargetNode(i,this.$refs.ctxWrapper.$el).flag&&this.closeMenu(),this.isActivated=_tools.DomTools.getEventTargetNode(i,(this.$grid||this).$el).flag},handleGlobalBlurEvent:function(){this.closeFilter(),this.closeMenu()},handleGlobalMousewheelEvent:function(){this.clostTooltip(),this.closeMenu()},handleGlobalKeydownEvent:function(F){var W=this;this.isActivated&&this.preventEvent(F,"event.keydown",{$table:this},function(){var e,t=W.isCtxMenu,i=W.ctxMenuStore,o=W.editStore,r=W.mouseConfig,l=void 0===r?{}:r,n=W.keyboardConfig,s=void 0===n?{}:n,a=W.treeConfig,c=W.treeOpts,h=W.highlightCurrentRow,u=W.currentRow,d=o.selected,f=o.actived,p=F.keyCode,g=8===p,x=9===p,v=13===p,w=27===p,m=32===p,T=37===p,b=38===p,R=39===p,_=40===p,C=46===p,y=65===p,E=67===p,S=86===p,D=88===p,U=113===p,k=F.ctrlKey,$=F.shiftKey,O=T||b||R||_,I=t&&i.visible&&(v||m||O);if(w)W.closeMenu(),W.closeFilter(),f.row&&(e=f.args,W.clearActived(F),l.selected&&W.$nextTick(function(){return W.handleSelected(e,F)}));else if(m&&(s.isArrow||s.isTab)&&d.row&&d.column&&("checkbox"===d.column.type||"selection"===d.column.type||"radio"===d.column.type))F.preventDefault(),"checkbox"===d.column.type||"selection"===d.column.type?W.handleToggleCheckRowEvent(d.args,F):W.triggerRadioRowEvent(F,d.args);else if(v&&(s.isArrow||s.isTab)&&(d.row||f.row||a&&h&&u)){if(d.row||f.row)W.moveSelected(d.row?d.args:f.args,T,b,R,!0,F);else if(a&&h&&u){var L=u[c.children];if(L&&L.length){F.preventDefault();var A=L[0];e={$table:W,row:A},W.setTreeExpansion(u,!0).then(function(){return W.scrollToRow(A)}).then(function(){return W.triggerCurrentRowEvent(F,e)})}}}else if(I)F.preventDefault(),i.showChild&&_tools.UtilTools.hasChildrenList(i.selected)?W.moveCtxMenu(F,p,i,"selectChild",37,!1,i.selected.children):W.moveCtxMenu(F,p,i,"selected",39,!0,W.ctxMenuList);else if(U)d.row&&d.column&&(F.preventDefault(),W.handleActived(d.args,F));else if(O&&s.isArrow)d.row&&d.column?W.moveSelected(d.args,T,b,R,_,F):(b||_)&&h&&u&&W.moveCurrentRow(b,_,F);else if(x&&s.isTab)d.row||d.column?W.moveTabSelected(d.args,$,F):(f.row||f.column)&&W.moveTabSelected(f.args,$,F);else if(C||(a&&h&&u?g&&s.isArrow:g)){if(s.isDel&&(d.row||d.column))_tools.UtilTools.setCellValue(d.row,d.column,null),g&&W.handleActived(d.args,F);else if(g&&s.isArrow&&a&&h&&u){var M=_xeUtils.default.findTree(W.afterFullData,function(e){return e===u},c).parent;M&&(F.preventDefault(),e={$table:W,row:M},W.setTreeExpansion(M,!1).then(function(){return W.scrollToRow(M)}).then(function(){return W.triggerCurrentRowEvent(F,e)}))}}else s.isCut&&k&&(y||D||E||S)?y?W.handleAllChecked(F):D||E?W.handleCopyed(D,F):W.handlePaste(F):s.isEdit&&!k&&(48<=p&&p<=57||65<=p&&p<=90||96<=p&&p<=111||186<=p&&p<=192||219<=p&&p<=222||32===p)&&d.column&&d.row&&d.column.editRender&&(s.editMethod&&!1===s.editMethod(d.args,F)||(_tools.UtilTools.setCellValue(d.row,d.column,null),W.handleActived(d.args,F)))})},handleGlobalResizeEvent:function(){this.recalculate()},handleTooltipLeaveEvent:function(){var e=this,t=this.tooltipOpts;setTimeout(function(){e.tooltipActive||e.clostTooltip()},t.leaveDelay)},handleTargetEnterEvent:function(){clearTimeout(this.tooltipTimeout),this.tooltipActive=!0,this.clostTooltip()},handleTargetLeaveEvent:function(){var e=this,t=this.tooltipOpts;this.tooltipActive=!1,t.enterable?this.tooltipTimeout=setTimeout(function(){e.$refs.tooltip.isHover||e.clostTooltip()},t.leaveDelay):this.clostTooltip()},triggerHeaderTooltipEvent:function(e,t){var i=this.tooltipStore,o=t.column;this.handleTargetEnterEvent(),i.column===o&&i.visible||this.handleTooltip(e,o)},triggerFooterTooltipEvent:function(e,t){var i=t.column,o=this.tooltipStore;this.handleTargetEnterEvent(),o.column===i&&o.visible||this.handleTooltip(e,i)},triggerTooltipEvent:function(e,t){var i=this.editConfig,o=this.editStore,r=this.tooltipStore,l=o.actived,n=t.row,s=t.column;this.handleTargetEnterEvent(),i&&("row"===i.mode&&l.row===n||l.row===n&&l.column===s)||r.column===s&&r.row===n&&r.visible||this.handleTooltip(e,s,n)},handleTooltip:function(e,t,i){var o=e.currentTarget,r=this.$refs.tooltip,l=o.children[0],n=o.innerText;return n&&l.scrollWidth>l.clientWidth&&(Object.assign(this.tooltipStore,{row:i,column:t,visible:!0}),r&&r.toVisible(o,_tools.UtilTools.formatText(n))),this.$nextTick()},clostTooltip:function(){var e=this.$refs.tooltip;return Object.assign(this.tooltipStore,{row:null,column:null,content:null,visible:!1}),e&&e.close(),this.$nextTick()},handleSelectionDefChecked:function(){var t=this.fullDataRowIdData,e=this.checkboxOpts,i=e.checkAll,o=e.checkRowKeys;if(i)this.setAllSelection(!0);else if(o){var r=[];o.forEach(function(e){t[e]&&r.push(t[e].row)}),this.setSelection(r,!0)}},setSelection:function(e,t){var i=this;return e&&!_xeUtils.default.isArray(e)&&(e=[e]),e.forEach(function(e){return i.handleSelectRow({row:e},!!t)}),this.$nextTick()},isCheckedByRow:function(e){var t=this.checkboxOpts.checkField;return t?_xeUtils.default.get(e,t):-1<this.selection.indexOf(e)},handleSelectRow:function(e,i){var o=this,r=e.row,l=this.selection,t=this.tableFullData,n=this.treeConfig,s=this.treeOpts,a=this.treeIndeterminates,c=this.checkboxOpts,h=c.checkField,u=c.checkStrictly,d=c.checkMethod;if(h)if(n&&!u){-1===i?(a.push(r),_xeUtils.default.set(r,h,!1)):(_xeUtils.default.eachTree([r],function(e,t){r!==e&&d&&!d({row:e,$rowIndex:t})||(_xeUtils.default.set(e,h,i),o.handleSelectReserveRow(r,i))},s),_xeUtils.default.remove(a,function(e){return e===r}));var f=_xeUtils.default.findTree(t,function(e){return e===r},s);if(f&&f.parent){var p,g=d?f.items.filter(function(e,t){return d({row:e,$rowIndex:t})}):f.items;if(_xeUtils.default.find(f.items,function(e){return-1<a.indexOf(e)}))p=-1;else{var x=f.items.filter(function(e){return _xeUtils.default.get(e,h)});p=x.filter(function(e){return-1<g.indexOf(e)}).length===g.length||!(!x.length&&-1!==i)&&-1}return this.handleSelectRow({row:f.parent},p)}}else _xeUtils.default.set(r,h,i),this.handleSelectReserveRow(r,i);else if(n&&!u){-1===i?(a.push(r),_xeUtils.default.remove(l,function(e){return e===r})):(_xeUtils.default.eachTree([r],function(t,e){r!==t&&d&&!d({row:t,$rowIndex:e})||(i?l.push(t):_xeUtils.default.remove(l,function(e){return e===t}),o.handleSelectReserveRow(r,i))},s),_xeUtils.default.remove(a,function(e){return e===r}));var v=_xeUtils.default.findTree(t,function(e){return e===r},s);if(v&&v.parent){var w,m=d?v.items.filter(function(e,t){return d({row:e,$rowIndex:t})}):v.items;if(_xeUtils.default.find(v.items,function(e){return-1<a.indexOf(e)}))w=-1;else{var T=v.items.filter(function(e){return-1<l.indexOf(e)});w=T.filter(function(e){return-1<m.indexOf(e)}).length===m.length||!(!T.length&&-1!==i)&&-1}return this.handleSelectRow({row:v.parent},w)}}else i?-1===l.indexOf(r)&&l.push(r):_xeUtils.default.remove(l,function(e){return e===r}),this.handleSelectReserveRow(r,i);this.checkSelectionStatus()},handleToggleCheckRowEvent:function(e,t){var i=this.selection,o=this.checkboxOpts.checkField,r=e.row,l=o?!_xeUtils.default.get(r,o):-1===i.indexOf(r);t?this.triggerCheckRowEvent(t,e,l):this.handleSelectRow(e,l)},triggerCheckRowEvent:function(e,t,i){var o=this.checkboxOpts.checkMethod;o&&!o({row:t.row,rowIndex:t.rowIndex,$rowIndex:t.$rowIndex})||(this.handleSelectRow(t,i),_tools.UtilTools.emitEvent(this,"select-change",[Object.assign({selection:this.getSelectRecords(),reserves:this.getSelectReserveRecords(),checked:i,$table:this},t),e]))},toggleRowSelection:function(e){return this.handleToggleCheckRowEvent({row:e}),this.$nextTick()},setAllSelection:function(o){var i=this,e=this.tableFullData,t=this.treeConfig,r=this.treeOpts,l=this.selection,n=this.selectReserveRowMap,s=this.checkboxOpts,a=s.checkField,c=s.reserve,h=s.checkStrictly,u=s.checkMethod,d=[];if(!h){if(a){var f="".concat(t?"$":"","rowIndex"),p=function(e,t){var i;u&&!u((_defineProperty(i={row:e},f,t),_defineProperty(i,"$rowIndex",t),i))||_xeUtils.default.set(e,a,o)},g=function(e,t){var i;(!u||!u((_defineProperty(i={row:e},f,t),_defineProperty(i,"$rowIndex",t),i))&&-1<l.indexOf(e))&&_xeUtils.default.set(e,a,o)};t?_xeUtils.default.eachTree(e,o?p:g,r):e.forEach(o?p:g)}else t?o?_xeUtils.default.eachTree(e,function(e,t){u&&!u({row:e,$rowIndex:t})||d.push(e)},r):u&&_xeUtils.default.eachTree(e,function(e,t){!u({row:e,$rowIndex:t})&&-1<l.indexOf(e)&&d.push(e)},r):o?d=u?e.filter(function(e,t){return-1<l.indexOf(e)||u({row:e,rowIndex:t,$rowIndex:t})}):e.slice(0):u&&(d=e.filter(function(e,t){return u({row:e,rowIndex:t,$rowIndex:t})?0:-1<l.indexOf(e)}));c&&(o?d.forEach(function(e){n[_tools.UtilTools.getRowid(i,e)]=e}):e.forEach(function(e){var t=_tools.UtilTools.getRowid(i,e);n[t]&&delete n[t]})),this.selection=d}this.treeIndeterminates=[],this.checkSelectionStatus()},checkSelectionStatus:function(){var e=this.tableFullData,t=this.editStore,i=this.selection,o=this.treeIndeterminates,r=this.checkboxOpts,l=r.checkField,n=r.checkStrictly,s=r.checkMethod,a=t.insertList;a.length&&(e=e.concat(a)),n||(l?(this.isAllSelected=e.length&&e.every(s?function(e,t){return!s({row:e,rowIndex:t,$rowIndex:t})||_xeUtils.default.get(e,l)}:function(e){return _xeUtils.default.get(e,l)}),this.isIndeterminate=!this.isAllSelected&&e.some(function(e){return _xeUtils.default.get(e,l)||-1<o.indexOf(e)})):(this.isAllSelected=e.length&&e.every(s?function(e,t){return!s({row:e,rowIndex:t,$rowIndex:t})||-1<i.indexOf(e)}:function(e){return-1<i.indexOf(e)}),this.isIndeterminate=!this.isAllSelected&&e.some(function(e){return-1<o.indexOf(e)||-1<i.indexOf(e)})))},handleReserveStatus:function(){var e=this.rowId,t=this.treeConfig,i=this.fullDataRowIdData,o=this.selectReserveRowMap,r=this.checkboxOpts,l=[],n=[],s=[],a=[];e&&this.handleReserveByRowid(this.selection,l),r.reserve&&Object.keys(o).forEach(function(e){i[e]&&-1===l.indexOf(i[e].row)&&l.push(i[e].row)}),this.selection=l,e&&this.handleReserveByRowid(this.rowExpandeds,n),this.rowExpandeds=n,e&&t&&(this.handleReserveByRowid(this.treeIndeterminates,a),this.handleReserveByRowid(this.treeExpandeds,s)),this.treeExpandeds=s,this.treeIndeterminates=a},handleReserveByRowid:function(e,i){var o=this,r=this.fullDataRowIdData;e.forEach(function(e){var t=_tools.UtilTools.getRowid(o,e);r[t]&&i.push(r[t].row)})},getSelectReserveRecords:function(){var i=this.fullDataRowIdData,o=this.selectReserveRowMap,e=this.checkboxOpts,r=[];return e.reserve&&Object.keys(o).forEach(function(e,t){i[e]||r.push(o[e])}),r},clearSelectReserve:function(){this.selectReserveRowMap={}},handleSelectReserveRow:function(e,t){var i=this.selectReserveRowMap;if(this.checkboxOpts.reserve){var o=_tools.UtilTools.getRowid(this,e);t?i[o]=e:i[o]&&delete i[o]}},triggerCheckAllEvent:function(e,t){this.setAllSelection(t),_tools.UtilTools.emitEvent(this,"select-all",[{selection:this.getSelectRecords(),reserves:this.getSelectReserveRecords(),checked:t,$table:this},e])},toggleAllSelection:function(){return this.triggerCheckAllEvent(null,!this.isAllSelected),this.$nextTick()},clearSelection:function(){var e=this.tableFullData,t=this.treeConfig,i=this.treeOpts,o=this.checkboxOpts.checkField;return o&&(t?_xeUtils.default.eachTree(e,function(e){return _xeUtils.default.set(e,o,!1)},i):e.forEach(function(e){return _xeUtils.default.set(e,o,!1)})),this.isAllSelected=!1,this.isIndeterminate=!1,this.selection=[],this.treeIndeterminates=[],this.$nextTick()},handleRadioDefChecked:function(){var e=this.radioOpts,t=this.fullDataRowIdData,i=e.checkRowKey;i&&t[i]&&this.setRadioRow(t[i].row)},triggerRadioRowEvent:function(e,t){var i=this.radioOpts.checkMethod;if(!i||i({row:t.row,rowIndex:t.rowIndex,$rowIndex:t.$rowIndex})){var o=this.selectRow!==t.row;this.setRadioRow(t.row),o&&_tools.UtilTools.emitEvent(this,"radio-change",[t,e])}},triggerCurrentRowEvent:function(e,t){var i=this.currentRow!==t.row;this.setCurrentRow(t.row),i&&_tools.UtilTools.emitEvent(this,"current-change",[t,e])},setCurrentRow:function(e){return this.clearCurrentRow(),this.clearCurrentColumn(),this.currentRow=e,this.highlightCurrentRow&&_xeUtils.default.arrayEach(this.$el.querySelectorAll('[data-rowid="'.concat(_tools.UtilTools.getRowid(this,e),'"]')),function(e){return _tools.DomTools.addClass(e,"row--current")}),this.$nextTick()},setRadioRow:function(e){return this.selectRow!==e&&this.clearRadioRow(),this.selectRow=e,this.$nextTick()},clearCurrentRow:function(){return this.currentRow=null,this.hoverRow=null,_xeUtils.default.arrayEach(this.$el.querySelectorAll(".row--current"),function(e){return _tools.DomTools.removeClass(e,"row--current")}),this.$nextTick()},clearRadioRow:function(){return this.selectRow=null,this.$nextTick()},getCurrentRow:function(){return this.currentRow},getRadioRow:function(){return this.selectRow},triggerHoverEvent:function(e,t){var i=t.row;this.setHoverRow(i)},setHoverRow:function(e){var t=_tools.UtilTools.getRowid(this,e);this.clearHoverRow(),_xeUtils.default.arrayEach(this.$el.querySelectorAll('[data-rowid="'.concat(t,'"]')),function(e){return _tools.DomTools.addClass(e,"row--hover")}),this.hoverRow=e},clearHoverRow:function(){_xeUtils.default.arrayEach(this.$el.querySelectorAll(".vxe-body--row.row--hover"),function(e){return _tools.DomTools.removeClass(e,"row--hover")}),this.hoverRow=null},triggerHeaderCellClickEvent:function(e,t){var i=this._lastResizeTime,o=this.sortOpts,r=t.column,l=t.cell,n=i&&i>Date.now()-300,s=_tools.DomTools.getEventTargetNode(e,l,"vxe-sort-wrapper").flag,a=_tools.DomTools.getEventTargetNode(e,l,"vxe-filter-wrapper").flag;return"cell"!==o.trigger||n||s||a||this.triggerSortEvent(e,r,"desc"===r.order?"asc":"desc"),_tools.UtilTools.emitEvent(this,"header-cell-click",[Object.assign({triggerResizable:n,triggerSort:s,triggerFilter:a},t),e]),this.highlightCurrentColumn?this.setCurrentColumn(r,!0):this.$nextTick()},setCurrentColumn:function(e){return this.clearCurrentRow(),this.clearCurrentColumn(),this.currentColumn=e,_xeUtils.default.arrayEach(this.$el.querySelectorAll(".".concat(e.id)),function(e){return _tools.DomTools.addClass(e,"col--current")}),this.$nextTick()},clearCurrentColumn:function(){return this.currentColumn=null,_xeUtils.default.arrayEach(this.$el.querySelectorAll(".col--current"),function(e){return _tools.DomTools.removeClass(e,"col--current")}),this.$nextTick()},checkValidate:function(e){return _vXETable.default._valid?this.triggerValidate(e):this.$nextTick()},handleChangeCell:function(e,t){var i=this;this.checkValidate("blur").catch(function(e){return e}).then(function(){i.handleActived(t,e).then(function(){return i.checkValidate("change")}).catch(function(e){return e})})},triggerCellClickEvent:function(e,t){var i=this.$el,o=this.highlightCurrentRow,r=this.editStore,l=this.radioOpts,n=this.expandOpts,s=this.treeOpts,a=this.editConfig,c=this.checkboxOpts,h=this.mouseConfig,u=void 0===h?{}:h,d=r.actived,f=t.row,p=t.column;isTargetRadioOrCheckbox(e,p,"radio")||isTargetRadioOrCheckbox(e,p,"checkbox","checkbox")||isTargetRadioOrCheckbox(e,p,"selection","checkbox")||("row"!==n.trigger&&("expand"!==p.type||"cell"!==n.trigger)||_tools.DomTools.getEventTargetNode(e,i,"vxe-table--expanded").flag||this.triggerRowExpandEvent(e,t),("row"===s.trigger||p.treeNode&&"cell"===s.trigger)&&this.triggerTreeExpandEvent(e,t),p.treeNode&&_tools.DomTools.getEventTargetNode(e,i,"vxe-tree-wrapper").flag||"expand"===p.type&&_tools.DomTools.getEventTargetNode(e,i,"vxe-table--expanded").flag||(o&&("row"!==l.trigger&&(_tools.DomTools.getEventTargetNode(e,i,"vxe-checkbox").flag||_tools.DomTools.getEventTargetNode(e,i,"vxe-radio").flag)||this.triggerCurrentRowEvent(e,t)),"row"!==l.trigger&&("radio"!==p.type||"cell"!==l.trigger)||_tools.DomTools.getEventTargetNode(e,i,"vxe-radio").flag||this.triggerRadioRowEvent(e,t),"row"!==c.trigger&&("checkbox"!==p.type&&"selection"!==p.type||"cell"!==c.trigger)||_tools.DomTools.getEventTargetNode(e,t.cell,"vxe-checkbox").flag||this.handleToggleCheckRowEvent(t,e),u.checked||a&&("manual"===a.trigger?d.args&&d.row===f&&p!==d.column&&this.handleChangeCell(e,t):d.args&&f===d.row&&p===d.column||("click"===a.trigger?this.handleChangeCell(e,t):"dblclick"===a.trigger&&("row"===a.mode&&d.row===f?this.handleChangeCell(e,t):this.handleSelected(t,e))))),_tools.UtilTools.emitEvent(this,"cell-click",[t,e]))},triggerCellDBLClickEvent:function(e,t){var i=this,o=this.editStore,r=this.editConfig,l=o.actived;r&&"dblclick"===r.trigger&&(l.args&&e.currentTarget===l.args.cell||("row"===r.mode?this.checkValidate("blur").catch(function(e){return e}).then(function(){i.handleActived(t,e).then(function(){return i.checkValidate("change")}).catch(function(e){return e})}):"cell"===r.mode&&this.handleActived(t,e).then(function(){return i.checkValidate("change")}).catch(function(e){return e}))),_tools.UtilTools.emitEvent(this,"cell-dblclick",[t,e])},handleDefaultSort:function(){var e=this.sortOpts.defaultSort;if(e){var t=e.field,i=e.order;t&&i&&this.sort(t,i)}},triggerSortEvent:function(e,t,i){var o=t.property;if(t.sortable||t.remoteSort){var r={column:t,property:o,field:o,prop:o,order:i,$table:this};t.order===i?(r.order=null,this.clearSort(t.property)):this.sort(o,i),_tools.UtilTools.emitEvent(this,"sort-change",[r,e])}},sort:function(t,e){var i=this.visibleColumn,o=this.tableFullColumn,r=this.remoteSort,l=this.sortOpts,n=_xeUtils.default.find(i,function(e){return e.property===t});if(n){var s=_xeUtils.default.isBoolean(n.remoteSort)?n.remoteSort:l.remote||r;if(n.sortable||n.remoteSort)return e=e||("desc"===n.order?"asc":"desc"),n.order!==e&&(o.forEach(function(e){e.order=null}),n.order=e,s||this.handleTableData(!0)),this.$nextTick().then(this.updateStyle)}return this.$nextTick()},clearSort:function(){return this.tableFullColumn.forEach(function(e){e.order=null}),this.handleTableData(!0)},closeFilter:function(){return Object.assign(this.filterStore,{isAllSelected:!1,isIndeterminate:!1,options:[],visible:!1}),this.$nextTick()},isRowExpandLoaded:function(e){var t=this.fullAllDataRowMap.get(e);return t&&t.expandLoaded},clearRowExpandLoaded:function(t){var e=this.expandOpts,i=this.expandLazyLoadeds,o=this.fullAllDataRowMap,r=e.lazy,l=o.get(t);return r&&l&&(l.expandLoaded=!1,_xeUtils.default.remove(i,function(e){return t===e})),this.$nextTick()},reloadExpandContent:function(e){var t=this,i=this.expandOpts,o=this.expandLazyLoadeds;return i.lazy&&-1===o.indexOf(e)&&this.clearRowExpandLoaded(e).then(function(){return t.handleAsyncRowExpand(e)}),this.$nextTick()},triggerRowExpandEvent:function(e,t){var i=this.$listeners,o=this.expandOpts,r=this.expandLazyLoadeds,l=t.row;if(!o.lazy||-1===r.indexOf(l)){var n=!this.isExpandByRow(l);this.setRowExpansion(l,n),i["toggle-expand-change"]?(_tools.UtilTools.warn("vxe.error.delEvent",["toggle-expand-change","toggle-row-expand"]),_tools.UtilTools.emitEvent(this,"toggle-expand-change",[{expanded:n,row:l,rowIndex:this.getRowIndex(l),$table:this},e])):_tools.UtilTools.emitEvent(this,"toggle-row-expand",[{expanded:n,row:l,rowIndex:this.getRowIndex(l),$table:this},e])}},toggleRowExpansion:function(e){return this.setRowExpansion(e,!this.isExpandByRow(e))},handleDefaultRowExpand:function(){var e=this.expandOpts,t=this.fullDataRowIdData,i=e.expandAll,o=e.expandRowKeys;if(i)this.setAllRowExpansion(!0);else if(o){var r=[];o.forEach(function(e){t[e]&&r.push(t[e].row)}),this.setRowExpansion(r,!0)}},setAllRowExpansion:function(e){return this.expandOpts.lazy?this.setRowExpansion(this.tableData,!0):(this.rowExpandeds=e?this.tableFullData.slice(0):[],this.$nextTick().then(this.recalculate))},handleAsyncRowExpand:function(t){var i=this,e=this.fullAllDataRowMap,o=this.rowExpandeds,r=this.expandLazyLoadeds,l=this.expandOpts.loadMethod,n=e.get(t);return new Promise(function(e){r.push(t),l({$table:i,row:t}).catch(function(e){return e}).then(function(){n.expandLoaded=!0,_xeUtils.default.remove(r,function(e){return e===t}),o.push(t),e(i.$nextTick().then(i.recalculate))})})},setRowExpansion:function(t,e){var i=this,o=this.fullAllDataRowMap,r=this.rowExpandeds,l=this.expandLazyLoadeds,n=this.expandOpts,s=n.lazy,a=n.accordion,c=[];return t&&(_xeUtils.default.isArray(t)||(t=[t]),a&&(r=[],t=t.slice(t.length-1,t.length)),e?t.forEach(function(e){if(-1===r.indexOf(e)){var t=o.get(e);s&&!t.expandLoaded&&-1===l.indexOf(e)?c.push(i.handleAsyncRowExpand(e)):r.push(e)}}):_xeUtils.default.remove(r,function(e){return-1<t.indexOf(e)})),this.rowExpandeds=r,Promise.all(c).then(this.recalculate)},hasRowExpand:function(e){return _tools.UtilTools.warn("vxe.error.delFunc",["hasRowExpand","isExpandByRow"]),this.isExpandByRow(e)},isExpandByRow:function(e){return-1<this.rowExpandeds.indexOf(e)},clearRowExpand:function(){var e=this,t=this.rowExpandeds.length;return this.rowExpandeds=[],this.$nextTick().then(function(){return t?e.recalculate():0})},getRowExpandRecords:function(){return this.rowExpandeds.slice(0)},getTreeExpandRecords:function(){return this.treeExpandeds.slice(0)},getTreeStatus:function(){return this.treeConfig?{config:this.treeOpts,rowExpandeds:this.getTreeExpandRecords()}:null},isTreeExpandLoaded:function(e){var t=this.fullAllDataRowMap.get(e);return t&&t.treeLoaded},clearTreeExpandLoaded:function(t){var e=this.treeOpts,i=this.treeExpandeds,o=this.fullAllDataRowMap,r=e.lazy,l=o.get(t);return r&&l&&(l.treeLoaded=!1,_xeUtils.default.remove(i,function(e){return t===e})),this.$nextTick()},reloadTreeChilds:function(e){var t=this,i=this.treeOpts,o=this.treeLazyLoadeds,r=i.lazy,l=i.hasChild;return r&&e[l]&&-1===o.indexOf(e)&&this.clearTreeExpandLoaded(e).then(function(){return t.handleAsyncTreeExpandChilds(e)}),this.$nextTick()},triggerTreeExpandEvent:function(e,t){var i=this.$listeners,o=this.treeOpts,r=this.treeLazyLoadeds,l=t.row;if(!o.lazy||-1===r.indexOf(l)){var n=!this.isTreeExpandByRow(l);this.setTreeExpansion(l,n),i["toggle-tree-change"]?(_tools.UtilTools.warn("vxe.error.delEvent",["toggle-tree-change","toggle-tree-expand"]),_tools.UtilTools.emitEvent(this,"toggle-tree-change",[{expanded:n,row:l,rowIndex:this.getRowIndex(l),$table:this},e])):_tools.UtilTools.emitEvent(this,"toggle-tree-expand",[{expanded:n,row:l,rowIndex:this.getRowIndex(l),$table:this},e])}},toggleTreeExpansion:function(e){return this.setTreeExpansion(e,!this.isTreeExpandByRow(e))},handleDefaultTreeExpand:function(){var e=this.treeConfig,i=this.treeOpts,o=this.tableFullData;if(e){var t=i.expandAll,r=i.expandRowKeys;if(t)this.setAllTreeExpansion(!0);else if(r){var l=[],n=_tools.UtilTools.getRowkey(this);r.forEach(function(t){var e=_xeUtils.default.findTree(o,function(e){return t===_xeUtils.default.get(e,n)},i);e&&l.push(e.item)}),this.setTreeExpansion(l,!0)}}},handleAsyncTreeExpandChilds:function(i){var o=this,e=this.fullAllDataRowMap,r=this.treeExpandeds,t=this.treeOpts,l=this.treeLazyLoadeds,n=t.loadMethod,s=t.children,a=e.get(i);return new Promise(function(t){l.push(i),n({$table:o,row:i}).catch(function(e){return[]}).then(function(e){a.treeLoaded=!0,_xeUtils.default.remove(l,function(e){return e===i}),_xeUtils.default.isArray(e)||(e=[]),e&&(i[s]=e,o.appendTreeCache(i,e),e.length&&-1===r.indexOf(i)&&r.push(i),o.isCheckedByRow(i)&&o.setSelection(e,!0)),t(o.$nextTick().then(o.recalculate))})})},setAllTreeExpansion:function(e){var t=this,i=this.tableFullData,o=this.treeOpts,r=o.lazy,l=o.children;if(e)if(r)_xeUtils.default.eachTree(i,function(e){t.setTreeExpansion(e,!0)},o);else{var n=[];_xeUtils.default.eachTree(i,function(e){var t=e[l];t&&t.length&&n.push(e)},o),this.treeExpandeds=n}else this.treeExpandeds=[];return this.$nextTick().then(this.recalculate)},setTreeExpansion:function(t,e){var i=this,o=this.fullAllDataRowMap,r=this.tableFullData,l=this.treeExpandeds,n=this.treeOpts,s=this.treeLazyLoadeds,a=n.lazy,c=n.hasChild,h=n.children,u=n.accordion,d=[];if(t&&(_xeUtils.default.isArray(t)||(t=[t]),t.length)){if(u){t=t.slice(t.length-1,t.length);var f=_xeUtils.default.findTree(r,function(e){return e===t[0]},n);_xeUtils.default.remove(l,function(e){return-1<f.items.indexOf(e)})}return e?t.forEach(function(e){if(-1===l.indexOf(e)){var t=o.get(e);a&&e[c]&&!t.treeLoaded&&-1===s.indexOf(e)?d.push(i.handleAsyncTreeExpandChilds(e)):e[h]&&e[h].length&&l.push(e)}}):_xeUtils.default.remove(l,function(e){return-1<t.indexOf(e)}),Promise.all(d).then(this.recalculate)}return Promise.resolve()},hasTreeExpand:function(e){return _tools.UtilTools.warn("vxe.error.delFunc",["hasTreeExpand","isTreeExpandByRow"]),this.isTreeExpandByRow(e)},isTreeExpandByRow:function(e){return-1<this.treeExpandeds.indexOf(e)},clearTreeExpand:function(){var e=this,t=this.treeExpandeds.length;return this.treeExpandeds=[],this.$nextTick().then(function(){return t?e.recalculate():0})},getVirtualScroller:function(){var e=this.$refs,t=this.scrollXLoad,i=this.scrollYLoad,o=e.tableBody.$el;return{scrollX:t,scrollY:i,scrollTop:o.scrollTop,scrollLeft:o.scrollLeft}},triggerScrollXEvent:function(){this.updateVirtualScrollX()},updateVirtualScrollX:function(e){for(var t=this.$refs,i=this.visibleColumn,o=this.scrollXStore,r=o.startIndex,l=o.renderSize,n=o.offsetSize,s=o.visibleSize,a=t.tableBody.$el.scrollLeft,c=0,h=0,u=e||!1,d=0;d<i.length;d++)if(a<(h+=i[d].renderWidth)){c=d;break}if(e||o.visibleIndex!==c){var f=Math.min(Math.floor((l-s)/2),s);o.visibleIndex===c?o.startIndex=c:o.visibleIndex>c?(u=c-n<=r)&&(o.startIndex=Math.max(0,Math.max(f,c-f))):(u=r+l<=c+s+n)&&(o.startIndex=Math.max(0,Math.min(i.length-l,c-f))),u&&this.updateScrollXData(),o.visibleIndex=c}this.clostTooltip()},triggerScrollYEvent:function(e){isWebkit&&this.scrollYStore.adaptive?this.loadScrollYData(e):this.debounceScrollY(e)},debounceScrollY:_xeUtils.default.debounce(function(e){this.loadScrollYData(e)},debounceScrollYDuration,{leading:!1,trailing:!0}),loadScrollYData:function(e){var t=this.afterFullData,i=this.scrollYStore,o=this.isLoadData,r=i.startIndex,l=i.renderSize,n=i.offsetSize,s=i.visibleSize,a=i.rowHeight,c=e.target.scrollTop,h=Math.ceil(c/a),u=!1;if(o||i.visibleIndex!==h){var d=Math.min(Math.floor((l-s)/2),s);i.visibleIndex>h?(u=h-n<=r)&&(i.startIndex=Math.max(0,h-Math.max(d,l-s))):(u=r+l<=h+s+n)&&(i.startIndex=Math.max(0,Math.min(t.length-l,h-d))),u&&this.updateScrollYData(),i.visibleIndex=h,this.isLoadData=!1}},computeRowHeight:function(){var e,t=this.$refs.tableBody,i=t?t.$el:null,o=this.$refs.tableHeader;if(i){var r=i.querySelector("tbody>tr");!r&&o&&(r=o.$el.querySelector("thead>tr")),r&&(e=r.clientHeight)}e=e||this.rowHeightMaps[this.vSize||"default"],this.rowHeight=e},computeScrollLoad:function(){var m=this;return this.$nextTick().then(function(){var e=m.vSize,t=m.scrollXLoad,i=m.scrollYLoad,o=m.scrollYStore,r=m.scrollXStore,l=m.visibleColumn,n=m.optimizeOpts,s=m.rowHeightMaps,a=n.scrollX,c=n.scrollY,h=m.$refs.tableBody,u=h?h.$el:null,d=m.$refs.tableHeader;if(u){if(t){var f=l[0],p=f?f.renderWidth:40,g=_xeUtils.default.toNumber(a.vSize||Math.ceil(u.clientWidth/p));r.visibleSize=g,a.oSize||(r.offsetSize=g),a.rSize||(r.renderSize=g+4),m.updateScrollXData()}else m.updateScrollXSpace();if(i){var x;if(c.rHeight)x=c.rHeight;else{var v=u.querySelector("tbody>tr");!v&&d&&(v=d.$el.querySelector("thead>tr")),v&&(x=v.clientHeight)}x=x||s[e||"default"];var w=_xeUtils.default.toNumber(c.vSize||Math.ceil(u.clientHeight/x));o.visibleSize=w,o.rowHeight=x,c.oSize||(o.offsetSize=w),c.rSize||(o.renderSize=browse.edge?10*w:isWebkit?w+2:6*w),m.updateScrollYData()}else m.updateScrollYSpace()}m.$nextTick(m.updateStyle)})},updateScrollXData:function(){var e=this.visibleColumn,t=this.scrollXStore;this.tableColumn=e.slice(t.startIndex,t.startIndex+t.renderSize),this.updateScrollXSpace()},updateScrollXSpace:function(){var e=this.$refs,o=this.elemStore,t=this.visibleColumn,i=this.scrollXStore,r=this.scrollXLoad,l=this.tableWidth,n=this.scrollbarWidth,s=e.tableHeader,a=e.tableBody,c=e.tableFooter,h=s?s.$el.querySelector(".vxe-table--header"):null,u=a.$el.querySelector(".vxe-table--body"),d=c?c.$el.querySelector(".vxe-table--footer"):null,f=t.slice(0,i.startIndex).reduce(function(e,t){return e+t.renderWidth},0),p="";r&&(p="".concat(f,"px")),h&&(h.style.marginLeft=p),u.style.marginLeft=p,d&&(d.style.marginLeft=p);["main"].forEach(function(i){["header","body","footer"].forEach(function(e){var t=o["".concat(i,"-").concat(e,"-xSpace")];t&&(t.style.width=r?"".concat(l+("header"===e?n:0),"px"):"")})}),this.$nextTick(this.updateStyle)},updateScrollYData:function(){this.handleTableData(),this.updateScrollYSpace()},updateScrollYSpace:function(){var o=this.elemStore,e=this.scrollYStore,t=this.scrollYLoad,i=this.afterFullData.length*e.rowHeight,r=Math.max(e.startIndex*e.rowHeight,0),l="",n="";t&&(l="".concat(r,"px"),n="".concat(i,"px")),["main","left","right"].forEach(function(i){var e=o["".concat(i,"-body-table")];e&&(e.style.marginTop=l),["header","body","footer"].forEach(function(e){var t=o["".concat(i,"-").concat(e,"-ySpace")];t&&(t.style.height=n)})}),this.$nextTick(this.updateStyle)},scrollTo:function(e,t){var i=this,o=this.$refs.tableBody.$el;if(_xeUtils.default.isNumber(e)){var r=this.$refs.tableFooter;r?r.$el.scrollLeft=e:o.scrollLeft=e}if(_xeUtils.default.isNumber(t)){var l=this.$refs.rightBody;l&&(l.$el.scrollTop=t),o.scrollTop=t}return this.scrollXLoad||this.scrollYLoad?new Promise(function(e){return setTimeout(function(){return e(i.$nextTick())},50)}):this.$nextTick()},scrollToRow:function(e,t){var i=[];return e&&(this.treeConfig?i.push(this.scrollToTreeRow(e)):this.fullAllDataRowMap.has(e)&&i.push(_tools.DomTools.rowToVisible(this,e))),i.push(this.scrollToColumn(t)),Promise.all(i)},scrollToColumn:function(e){return e&&this.fullColumnMap.has(e)?_tools.DomTools.colToVisible(this,e):this.$nextTick()},scrollToTreeRow:function(t){var i=this,e=this.tableFullData,o=this.treeConfig,r=this.treeOpts;if(o){var l=_xeUtils.default.findTree(e,function(e){return e===t},r);if(l){var n=l.nodes;n.forEach(function(e,t){t<n.length-1&&!i.isTreeExpandByRow(e)&&i.setTreeExpansion(e,!0)})}}return this.$nextTick()},clearScroll:function(){var t=this,e=this.$refs,i=e.tableBody,o=i?i.$el:null,r=e.tableFooter,l=(r?r.$el:null)||o;return o&&(o.scrollTop=0),l&&(l.scrollLeft=0),new Promise(function(e){return setTimeout(function(){return e(t.$nextTick())})})},updateFooter:function(){var e=this.showFooter,t=this.tableColumn,i=this.footerMethod;return e&&i&&(this.footerData=t.length?i({columns:t,data:this.afterFullData}):[]),this.$nextTick()},updateStatus:function(a,c){var h=this,u=!_xeUtils.default.isUndefined(c);return this.$nextTick().then(function(){var e=h.$refs,t=h.tableData,i=h.editRules,o=h.validStore;if(a&&e.tableBody&&i){var r=a.row,l=a.column;if(h.hasCellRules("change",r,l)){var n=t.indexOf(r),s=_tools.DomTools.getCell(h,{row:r,rowIndex:n,column:l});if(s)return h.validCellRules("change",r,l,c).then(function(){u&&o.visible&&_tools.UtilTools.setCellValue(r,l,c),h.clearValidate()}).catch(function(e){var t=e.rule;u&&_tools.UtilTools.setCellValue(r,l,c),h.showValidTooltip({rule:t,row:r,column:l,cell:s})})}}})},updateZindex:function(){this.tZindex<_tools.UtilTools.getLastZIndex()&&(this.tZindex=_tools.UtilTools.nextZIndex(this))},connect:function(e){var t=e.toolbar;this.$toolbar=t},getEventTargetNode:_tools.DomTools.getEventTargetNode},funcs="filter,clearFilter,closeMenu,getMouseSelecteds,getMouseCheckeds,clearCopyed,clearChecked,clearHeaderChecked,clearIndexChecked,clearSelected,insert,insertAt,remove,removeSelecteds,revert,revertData,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearActived,getActiveRow,hasActiveRow,isActiveByRow,setActiveRow,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,exportCsv,openExport,exportData,openImport,importData,readFile,importByFile,print".split(",");funcs.forEach(function(e){Methods[e]=function(){return this["_".concat(e)]?this["_".concat(e)].apply(this,arguments):null}});var _default=Methods;exports.default=_default;