Files
vxe-table/lib/table/src/table.min.js
xuliangzhan 727b6f4969 update
2019-09-04 23:18:09 +08:00

1 line
63 KiB
JavaScript

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils/methods/xe-utils")),_conf=_interopRequireDefault(require("../../conf")),_cell=_interopRequireDefault(require("../../cell")),_vXETable=_interopRequireWildcard(require("../../v-x-e-table")),_tools=require("../../tools");function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var l=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,i):{};l.get||l.set?Object.defineProperty(t,i,l):t[i]=e[i]}return t.default=e,t}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}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var i=0;i<t.length;i++){var l=t[i];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}function _createClass(e,t,i){return t&&_defineProperties(e.prototype,t),i&&_defineProperties(e,i),e}var rowUniqueId=0,browse=_tools.DomTools.browse,isWebkit=browse["-webkit"]&&!browse.edge,debounceScrollYDuration=browse.msie?40:20,Rule=function(){function t(e){_classCallCheck(this,t),Object.assign(this,{$options:e,required:e.required,min:e.min,max:e.min,type:e.type,pattern:e.pattern,validator:e.validator,trigger:e.trigger,maxWidth:e.maxWidth})}return _createClass(t,[{key:"message",get:function(){return _tools.UtilTools.getFuncText(this.$options.message)}}]),t}();function getRowUniqueId(){return"row_".concat(++rowUniqueId)}function renderFixed(e,t,i){var l=t.tableData,o=t.tableColumn,r=t.visibleColumn,n=t.collectColumn,s=t.isGroup,a=t.vSize,u=t.showHeader,c=t.showFooter,h=t.columnStore,d=t.footerData,f=h["".concat(i,"List")];return e("div",{class:"vxe-table--fixed-".concat(i,"-wrapper"),ref:"".concat(i,"Container")},[u?e("vxe-table-header",{props:{fixedType:i,tableData:l,tableColumn:o,visibleColumn:r,collectColumn:n,size:a,fixedColumn:f,isGroup:s},ref:"".concat(i,"Header")}):null,e("vxe-table-body",{props:{fixedType:i,tableData:l,tableColumn:o,visibleColumn:r,collectColumn:n,fixedColumn:f,size:a,isGroup:s},ref:"".concat(i,"Body")}),c?e("vxe-table-footer",{props:{fixedType:i,footerData:d,tableColumn:o,visibleColumn:r,size:a,fixedColumn:f},ref:"".concat(i,"Footer")}):null])}var headerProps={children:"children"},_default2={name:"VxeTable",props:{data:Array,customs:Array,height:[Number,String],maxHeight:[Number,String],resizable:{type:Boolean,default:function(){return _conf.default.resizable}},stripe:{type:Boolean,default:function(){return _conf.default.stripe}},border:{type:Boolean,default:function(){return _conf.default.border}},size:{type:String,default:function(){return _conf.default.size}},fit:{type:Boolean,default:function(){return _conf.default.fit}},loading:Boolean,align:{type:String,default:function(){return _conf.default.align}},headerAlign:{type:String,default:function(){return _conf.default.headerAlign}},showHeader:{type:Boolean,default:function(){return _conf.default.showHeader}},startIndex:{type:Number,default:0},highlightCurrentRow:{type:Boolean,default:function(){return _conf.default.highlightCurrentRow}},highlightHoverRow:{type:Boolean,default:function(){return _conf.default.highlightHoverRow}},highlightCurrentColumn:{type:Boolean,default:function(){return _conf.default.highlightCurrentColumn}},highlightHoverColumn:{type:Boolean,default:function(){return _conf.default.highlightHoverColumn}},highlightCell:Boolean,showFooter:Boolean,footerMethod:Function,rowClassName:[String,Function],cellClassName:[String,Function],headerRowClassName:[String,Function],headerCellClassName:[String,Function],footerRowClassName:[String,Function],footerCellClassName:[String,Function],spanMethod:Function,showOverflow:{type:[Boolean,String],default:function(){return _conf.default.showOverflow}},showHeaderOverflow:{type:[Boolean,String],default:function(){return _conf.default.showHeaderOverflow}},remoteFilter:Boolean,remoteSort:Boolean,sortMethod:Function,columnWidth:[Number,String],columnMinWidth:[Number,String],columnKey:Boolean,rowKey:Boolean,rowId:{type:String,default:function(){return _conf.default.rowId}},autoResize:Boolean,syncResize:Boolean,sortConfig:Object,radioConfig:Object,selectConfig:Object,tooltipConfig:Object,expandConfig:Object,treeConfig:Object,contextMenu:Object,mouseConfig:Object,keyboardConfig:Object,editConfig:Object,validConfig:Object,editRules:Object,optimization:Object,params:Object},provide:function(){return{$table:this}},inject:{$grid:{default:null}},data:function(){return{id:_xeUtils.default.uniqueId(),collectColumn:[],tableFullColumn:[],tableColumn:[],tableData:[],scrollXLoad:!1,scrollYLoad:!1,overflowY:!0,overflowX:!1,scrollbarWidth:0,scrollbarHeight:0,isAllSelected:!1,isIndeterminate:!1,selection:[],currentRow:null,selectRow:null,footerData:[],expandeds:[],treeExpandeds:[],treeIndeterminates:[],filterStore:{isAllSelected:!1,isIndeterminate:!1,style:null,options:[],column:null,multiple:!1,visible:!1},columnStore:{leftList:[],centerList:[],rightList:[],resizeList:[],pxList:[],pxMinList:[],scaleList:[],scaleMinList:[],autoList:[]},ctxMenuStore:{selected:null,visible:!1,showChild:!1,selectChild:null,list:[],style:null},editStore:{indexs:{columns:[]},titles:{columns:[]},checked:{rows:[],columns:[],tRows:[],tColumns:[]},selected:{row:null,column:null},copyed:{cut:!1,rows:[],columns:[]},actived:{row:null,column:null},insertList:[],removeList:[]},validStore:{visible:!1,row:null,column:null,content:"",rule:null,isArrow:!1}}},computed:{vSize:function(){return this.size||this.$parent.size||this.$parent.vSize},validOpts:function(){return Object.assign({message:"default"},_conf.default.validConfig,this.validConfig)},optimizeOpts:function(){return Object.assign({},_conf.default.optimization,this.optimization)},vaildTipOpts:function(){return Object.assign({isArrow:!1},this.tooltipConfig)},sortOpts:function(){return Object.assign({},_conf.default.sortConfig,this.sortConfig)},isGroup:function(){return this.collectColumn.some(function(e){return _tools.UtilTools.hasChildrenList(e)})},hasTip:function(){return _vXETable.default._tooltip},visibleColumn:function(){return this.tableFullColumn?this.tableFullColumn.filter(function(e){return e.visible}):[]},isResizable:function(){return this.resizable||this.tableFullColumn.some(function(e){return e.resizable})},hasFilter:function(){return this.tableColumn.some(function(e){return e.filters&&e.filters.length})},headerCtxMenu:function(){return this.ctxMenuOpts.header&&this.ctxMenuOpts.header.options?this.ctxMenuOpts.header.options:[]},bodyCtxMenu:function(){return this.ctxMenuOpts.body&&this.ctxMenuOpts.body.options?this.ctxMenuOpts.body.options:[]},isCtxMenu:function(){return this.headerCtxMenu.length||this.bodyCtxMenu.length},ctxMenuOpts:function(){return Object.assign({},_conf.default.menu,this.contextMenu)},ctxMenuList:function(){var t=[];return this.ctxMenuStore.list.forEach(function(e){e.forEach(function(e){t.push(e)})}),t}},watch:{data:function(e){this._isUpdateData||this.loadTableData(e,!0).then(this.handleDefault),this._isUpdateData=!1},customs:function(e){this.isUpdateCustoms||this.mergeCustomColumn(e),this.isUpdateCustoms=!1},collectColumn:function(e){var t=_tools.UtilTools.getColumnList(e);if(this.tableFullColumn=t,this.cacheColumnMap(),this.customs&&this.mergeCustomColumn(this.customs),this.refreshColumn(),this.handleTableData(!0),this.$toolbar&&this.$toolbar.updateColumn(t),t.length){var i=Math.floor((t.length-1)/2);t[i].prop&&_tools.UtilTools.warn("vxe.error.delProp"),t[i].label&&_tools.UtilTools.warn("vxe.error.delLabel")}},tableColumn:function(){this.analyColumnWidth()},height:function(){this.$nextTick(this.recalculate)},loading:function(){this._isLoading||(this._isLoading=!0)},syncResize:function(e){e&&this.$nextTick(this.recalculate)}},created:function(){var e=this,t=Object.assign(this,{elemStore:{},scrollXStore:{},scrollYStore:{},tooltipStore:{},parentHeight:0,tableWidth:0,tableHeight:0,headerHeight:0,footerHeight:0,lastScrollLeft:0,lastScrollTop:0,tableFullData:[],afterFullData:[],fullAllDataRowMap:new Map,fullAllDataRowIdData:{},fullDataRowMap:new Map,fullDataRowIdData:{},fullColumnMap:new Map,fullColumnIdData:{}}),i=t.scrollYStore,l=t.optimizeOpts,o=t.data,r=t.loading,n=l.scrollY;if(this._isLoading=r,_tools.UtilTools.getRowkey(this)||_tools.UtilTools.error("vxe.error.rowIdEmpty"),!_vXETable.default._keyboard&&(this.keyboardConfig||this.mouseConfig))throw new Error(_tools.UtilTools.error("vxe.error.reqKeyboard"));if(!_vXETable.default._resize&&this.autoResize)throw new Error(_tools.UtilTools.error("vxe.error.reqResize"));n&&Object.assign(i,{startIndex:0,visibleIndex:0,adaptive:!_xeUtils.default.isBoolean(n.adaptive)||n.adaptive,renderSize:_xeUtils.default.toNumber(n.rSize),offsetSize:_xeUtils.default.toNumber(n.oSize)}),this.loadTableData(o,!0).then(function(){e.handleDefault(),e.updateStyle()}),_tools.GlobalEvent.on(this,"mousedown",this.handleGlobalMousedownEvent),_tools.GlobalEvent.on(this,"blur",this.handleGlobalBlurEvent),_tools.GlobalEvent.on(this,"mousewheel",this.handleGlobalMousewheelEvent),_tools.GlobalEvent.on(this,"keydown",this.handleGlobalKeydownEvent),_tools.GlobalEvent.on(this,"resize",this.handleGlobalResizeEvent),_tools.GlobalEvent.on(this,"contextmenu",this.handleGlobalContextmenuEvent)},mounted:function(){this.autoResize&&_vXETable.default._resize&&this.bindResize(),document.body.appendChild(this.$refs.tableWrapper)},activated:function(){var e=this,t=this.lastScrollLeft,i=this.lastScrollTop;(t||i)&&this.clearScroll().then(this.recalculate).then(function(){return e.scrollTo(t,i)})},beforeDestroy:function(){var e=this.$refs.tableWrapper;e&&e.parentNode&&e.parentNode.removeChild(e),_vXETable.default._resize&&this.unbindResize(),this.closeFilter(),this.closeMenu()},destroyed:function(){_tools.GlobalEvent.off(this,"mousedown"),_tools.GlobalEvent.off(this,"blur"),_tools.GlobalEvent.off(this,"mousewheel"),_tools.GlobalEvent.off(this,"keydown"),_tools.GlobalEvent.off(this,"resize"),_tools.GlobalEvent.off(this,"contextmenu")},render:function(e){var t,i=this._e,l=this.id,o=this.tableData,r=this.tableColumn,n=this.visibleColumn,s=this.collectColumn,a=this.isGroup,u=this.hasFilter,c=this.isResizable,h=this.isCtxMenu,d=this.loading,f=this._isLoading,g=this.showHeader,v=this.border,p=this.stripe,m=this.height,x=this.highlightHoverRow,b=this.highlightHoverColumn,w=this.highlightCell,C=this.vSize,_=this.showOverflow,T=this.showHeaderOverflow,S=this.editConfig,y=this.validOpts,R=this.mouseConfig,E=void 0===R?{}:R,D=this.editRules,U=this.showFooter,k=this.footerMethod,$=this.overflowX,O=this.overflowY,I=this.scrollbarHeight,F=this.optimizeOpts,M=this.vaildTipOpts,z=this.tooltipConfig,L=this.columnStore,A=this.filterStore,H=this.ctxMenuStore,W=this.footerData,P=this.hasTip,N=L.leftList,j=L.rightList;return e("div",{class:(t={"vxe-table":1},_defineProperty(t,"size--".concat(C),C),_defineProperty(t,"vxe-editable",S),_defineProperty(t,"show--head",g),_defineProperty(t,"show--foot",U),_defineProperty(t,"scroll--y",O),_defineProperty(t,"scroll--x",$),_defineProperty(t,"fixed--left",N.length),_defineProperty(t,"fixed--right",j.length),_defineProperty(t,"all-overflow",_),_defineProperty(t,"all-head-overflow",T),_defineProperty(t,"c--highlight",w),_defineProperty(t,"t--animat",F.animat),_defineProperty(t,"t--stripe",p),_defineProperty(t,"t--border",v),_defineProperty(t,"t--checked",E.checked),_defineProperty(t,"is--loading",d),_defineProperty(t,"row--highlight",x),_defineProperty(t,"column--highlight",b),t)},[e("div",{class:"vxe-table-hidden-column",ref:"hideColumn"},this.$slots.default),g?e("vxe-table-header",{ref:"tableHeader",props:{tableData:o,tableColumn:r,visibleColumn:n,collectColumn:s,size:C,isGroup:a}}):i(),e("vxe-table-body",{ref:"tableBody",props:{tableData:o,tableColumn:r,visibleColumn:n,collectColumn:s,size:C,isGroup:a}}),U?e("vxe-table-footer",{props:{footerData:W,footerMethod:k,tableColumn:r,visibleColumn:n,size:C},ref:"tableFooter"}):i(),N&&N.length&&$?renderFixed(e,this,"left"):i(),j&&j.length&&$?renderFixed(e,this,"right"):i(),c?e("div",{class:"vxe-table--resizable-bar",style:$?{"padding-bottom":"".concat(I,"px")}:null,ref:"resizeBar"}):i(),f?e("vxe-table-loading",{props:{visible:d}}):i(),e("div",{class:"vxe-table".concat(l,"-wrapper ").concat(this.$vnode.data.staticClass||""),ref:"tableWrapper"},[u?e("vxe-table-filter",{props:{optimizeOpts:F,filterStore:A},ref:"filterWrapper"}):i(),h?e("vxe-table-context-menu",{props:{ctxMenuStore:H},ref:"ctxWrapper"}):i(),P?e("vxe-tooltip",{ref:"tooltip",props:z}):i(),P&&D&&("default"===y.message?!m:"tooltip"===y.message)?e("vxe-tooltip",{class:"vxe-table--valid-error",props:"tooltip"===y.message||1===o.length?M:null,ref:"validTip"}):i()])])},methods:{clearAll:function(){return this.clearScroll(),this.clearSort(),this.clearCurrentRow(),this.clearCurrentColumn(),this.clearSelection(),this.clearRowExpand(),this.clearTreeExpand(),_vXETable.default._filter&&this.clearFilter(),(this.keyboardConfig||this.mouseConfig)&&(this.clearIndexChecked(),this.clearHeaderChecked(),this.clearChecked(),this.clearSelected(),this.clearCopyed()),this.clearActived()},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,l=e?this.updateAfterFullData():this.afterFullData;return this.tableData=t?l.slice(i.startIndex,i.startIndex+i.renderSize):l.slice(0),this.$nextTick()},loadTableData:function(e,t){var i=this,l=this.height,o=this.maxHeight,r=this.editStore,n=this.optimizeOpts,s=this.lastScrollLeft,a=this.lastScrollTop,u=n.scrollY,c=e?e.slice(0):[],h=u&&u.gt&&u.gt<c.length;r.insertList=[],r.removeList=[],this.tableFullData=c,this.updateCache(!0),this.tableSynchData=e,this.tableSourceData=_xeUtils.default.clone(c,!0),!(this.scrollYLoad=h)||l||o||_tools.UtilTools.error("vxe.error.scrollYHeight"),this.clearScroll(),this.handleTableData(!0),this.reserveCheckSelection(),this.checkSelectionStatus();var d=this.$nextTick();return t||(d=d.then(this.recalculate)),d.then(function(){if((i.scrollXLoad||i.scrollYLoad)&&i.mouseConfig&&_tools.UtilTools.error("vxe.error.notMouse"),s||a)return i.scrollTo(s,a)})},loadData:function(e){return this.loadTableData(e).then(this.recalculate)},reloadData:function(e){return this.clearAll(),this.loadTableData(e).then(this.handleDefault)},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(o){var r=this,e=this.treeConfig,t=this.tableFullData,n=this.fullDataRowIdData,s=this.fullDataRowMap,a=this.fullAllDataRowMap,u=this.fullAllDataRowIdData,c=_tools.UtilTools.getRowkey(this),i=function(e,t){var i=_tools.UtilTools.getRowid(r,e);i||(i=getRowUniqueId(),_xeUtils.default.set(e,c,i));var l={row:e,rowid:i,index:t};o&&(n[i]=l,s.set(e,l)),u[i]=l,a.set(e,l)};o&&(n=this.fullDataRowIdData={},s.clear()),u=this.fullAllDataRowIdData={},a.clear(),e?_xeUtils.default.eachTree(t,i,e):t.forEach(i)},cacheColumnMap:function(){var e=this.tableFullColumn,l=this.fullColumnMap,o=this.fullColumnIdData={};l.clear(),e.forEach(function(e,t){var i={column:e,colid:e.id,index:t};o[e.id]=i,l.set(e,i)})},getRowNode:function(e){var t=this;if(e){var i=this.treeConfig,l=this.tableFullData,o=this.fullAllDataRowIdData,r=e.getAttribute("data-rowid");if(i){var n=_xeUtils.default.findTree(l,function(e){return _tools.UtilTools.getRowid(t,e)===r},i);if(n)return n}else if(o[r]){var s=o[r];return{item:s.row,index:s.index,items:l}}}return null},getColumnNode:function(e){if(e){var t=this.isGroup,i=this.fullColumnIdData,l=this.tableFullColumn,o=e.getAttribute("data-colid");if(!t){var r=i[o];return{item:r.column,index:r.index,items:l}}var n=_xeUtils.default.findTree(l,function(e){return e.id===o},headerProps);if(n)return n}return null},getRowIndex:function(e){return this.fullDataRowMap.has(e)?this.fullDataRowMap.get(e).index:-1},getColumnIndex:function(e){return this.fullColumnMap.has(e)?this.fullColumnMap.get(e).index:-1},hasIndexColumn:function(e){return e&&"index"===e.type},insert:function(e){return this.insertAt(e)},insertAt:function(e,t){var i=this,l=this.afterFullData,o=this.editStore,r=this.scrollYLoad,n=this.tableFullData;if(this.treeConfig)throw new Error(_tools.UtilTools.error("vxe.error.treeInsert"));_xeUtils.default.isArray(e)||(e=[e]);var s=l,a=e.map(function(e){return i.defineField(Object.assign({},e))});if(t)if(-1===t)s.push.apply(s,a),n.push.apply(n,a);else{var u=s.indexOf(t);if(-1===u)throw new Error(_tools.UtilTools.error("vxe.error.unableInsert"));s.splice.apply(s,[u,0].concat(a)),n.splice.apply(n,[n.indexOf(t),0].concat(a))}else s.unshift.apply(s,a),n.unshift.apply(n,a);return[].unshift.apply(o.insertList,a),this.handleTableData(),this.updateCache(),this.checkSelectionStatus(),r&&this.updateScrollYSpace(),this.$nextTick().then(function(){return i.recalculate(),{row:a.length?a[a.length-1]:null,rows:a}})},defineField:function(l){var e=_tools.UtilTools.getRowkey(this);return this.visibleColumn.forEach(function(e){var t=e.property,i=e.editRender;t&&!_xeUtils.default.has(l,t)&&_xeUtils.default.set(l,t,i&&!_xeUtils.default.isUndefined(i.defaultValue)?i.defaultValue:null)}),_xeUtils.default.get(l,e)||_xeUtils.default.set(l,e,getRowUniqueId()),l},createData:function(e){var t=this;return this.$nextTick().then(function(){return e.map(t.defineField)})},createRow:function(t){var i=this,l=_xeUtils.default.isArray(t);return l||(t=[t]),this.$nextTick().then(function(){var e=t.map(function(e){return i.defineField(Object.assign({},e))});return l?e:e[0]})},remove:function(n){var e=this,t=this.afterFullData,s=this.tableFullData,i=this.editStore,a=this.treeConfig,l=this.selectConfig,o=void 0===l?{}:l,u=this.selection,c=this.hasRowInsert,r=this.scrollYLoad,h=i.removeList,d=i.insertList,f=o.checkField,g=[],v=t;return n?_xeUtils.default.isArray(n)||(n=[n]):n=s,a?n.forEach(function(t){var e=_xeUtils.default.findTree(s,function(e){return e===t},a);if(e){var i=e.item,l=e.items,o=e.index;c(i)||h.push(i);var r=l.splice(o,1)[0];f||_xeUtils.default.remove(u,function(e){return-1<n.indexOf(e)}),g.push(r)}}):(n.forEach(function(e){c(e)||h.push(e)}),f||_xeUtils.default.remove(u,function(e){return-1<n.indexOf(e)}),s===n?(n=s.slice(0),s.length=0,v.length=0):(g=_xeUtils.default.remove(s,function(e){return-1<n.indexOf(e)}),_xeUtils.default.remove(v,function(e){return-1<n.indexOf(e)}))),_xeUtils.default.remove(d,function(e){return-1<n.indexOf(e)}),this.handleTableData(),this.updateCache(),this.checkSelectionStatus(),r&&this.updateScrollYSpace(),this.$nextTick().then(function(){return e.recalculate(),{row:n&&n.length?n[n.length-1]:null,rows:g}})},removeSelecteds:function(){var t=this;return this.remove(this.getSelectRecords()).then(function(e){return t.clearSelection(),e})},revert:function(){return _tools.UtilTools.warn("vxe.error.delRevert"),this.revertData.apply(this,arguments)},revertData:function(e,l){var o=this.tableSourceData,r=this.getRowIndex;return arguments.length?(e&&!_xeUtils.default.isArray(e)&&(e=[e]),e.forEach(function(e){var t=r(e),i=o[t];i&&e&&(l?_xeUtils.default.set(e,l,_xeUtils.default.get(i,l)):_xeUtils.default.destructuring(e,i))}),this.$nextTick()):this.reloadData(o)},clearData:function(e,t){var i=this.tableFullData,l=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){l.forEach(function(e){e.property&&_tools.UtilTools.setCellValue(t,e,null)})}),this.$nextTick()},hasRowInsert:function(e){return-1<this.editStore.insertList.indexOf(e)},hasRowChange:function(e,t){var i,l,o=this,r=this.visibleColumn,n=this.treeConfig,s=this.tableSourceData,a=this.fullDataRowIdData,u=_tools.UtilTools.getRowid(this,e);if(!a[u])return!1;if(n){var c=n.children,h=_xeUtils.default.findTree(s,function(e){return u===_tools.UtilTools.getRowid(o,e)},n);e=Object.assign({},e,_defineProperty({},c,null)),h&&(i=Object.assign({},h.item,_defineProperty({},c,null)))}else{i=s[a[u].index]}if(i){if(1<arguments.length)return!_xeUtils.default.isEqual(_xeUtils.default.get(i,t),_xeUtils.default.get(e,t));for(var d=0,f=r.length;d<f;d++)if((l=r[d].property)&&!_xeUtils.default.isEqual(_xeUtils.default.get(i,l),_xeUtils.default.get(e,l)))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 this.visibleColumn.find(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.delGetRecords"),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.delGetAllRecords"),this.getRecordset()},getRecordset:function(){return{insertRecords:this.getInsertRecords(),removeRecords:this.getRemoveRecords(),updateRecords:this.getUpdateRecords()}},getInsertRecords:function(){return this.editStore.insertList},getRemoveRecords:function(){return this.editStore.removeList},getSelectRecords:function(){var e=this.tableFullData,t=this.editStore,i=this.treeConfig,l=this.selectConfig,o=(void 0===l?{}:l).checkField,r=[],n=[];if(o)r=i?_xeUtils.default.filterTree(e,function(e){return _xeUtils.default.get(e,o)},i):e.filter(function(e){return _xeUtils.default.get(e,o)}),n=t.insertList.filter(function(e){return _xeUtils.default.get(e,o)});else{var s=this.selection;r=i?_xeUtils.default.filterTree(e,function(e){return-1<s.indexOf(e)},i):e.filter(function(e){return-1<s.indexOf(e)}),n=t.insertList.filter(function(e){return-1<s.indexOf(e)})}return r.concat(n)},getUpdateRecords:function(){var e=this.tableFullData,t=this.hasRowChange,i=this.treeConfig;return i?_xeUtils.default.filterTree(e,function(e){return t(e)},i):e.filter(function(e){return t(e)})},updateAfterFullData:function(){var e=this.visibleColumn,t=this.tableFullData,i=this.remoteSort,u=this.remoteFilter,l=t,o=e.find(function(e){return e.order}),r=e.filter(function(e){var t=e.filters;return t&&t.length});if((l=l.filter(function(a){return r.every(function(t){var e=t.filters,i=t.filterRender,l=i?_vXETable.Renderer.get(i.name):null,o=[],r=[];if(e&&e.length&&(e.forEach(function(e){e.checked&&(r.push(e),o.push(e.value))}),o.length&&!u)){var n=t.property,s=t.filterMethod;return!s&&l&&l.renderFilter&&(s=l.filterMethod),s?r.some(function(e){return s({value:e.value,option:e,row:a,column:t})}):-1<o.indexOf(_xeUtils.default.get(a,n))}return!0})}),o&&o.order)&&!(_xeUtils.default.isBoolean(o.remoteSort)?o.remoteSort:i))if(this.sortMethod)l=this.sortMethod({data:l,column:o,property:o.property,order:o.order,$table:this})||l;else{var n=o.sortMethod?l.sort(o.sortMethod):_xeUtils.default.sortBy(l,o.property);l="desc"===o.order?n.reverse():n}return this.afterFullData=l},getRowById:function(e){var t=this.fullDataRowIdData;return t[e]?t[e].row:null},getTableData:function(){var e=this.tableFullData,t=this.afterFullData,i=this.tableData,l=this.footerData;return{fullData:e.slice(0),visibleData:t.slice(0),tableData:i.slice(0),footerData:l.slice(0)}},handleDefault:function(){var e=this;this.selectConfig&&this.handleSelectionDefChecked(),this.radioConfig&&this.handleRadioDefChecked(),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=i.find(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.updateSetting(),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,l=0,o=[],r=null,n=null,s=[],a=[],t=this.tableFullColumn,u=this.isGroup,c=this.columnStore,h=this.scrollXStore,d=this.optimizeOpts.scrollX;u&&_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===r&&(r=l),i||(t-l!=0?i=!0:l++),o.push(e)):"right"===e.fixed?(i||(null===n&&(n=t),t-n!=0?i=!0:n++),a.push(e)):s.push(e)});var f=o.concat(s).concat(a),g=d&&d.gt&&d.gt<t.length;return Object.assign(c,{leftList:o,centerList:s,rightList:a}),u&&(i||r||null!==n&&n!==f.length)&&_tools.UtilTools.error("vxe.error.groupFixed"),g&&((this.resizable||f.some(function(e){return e.resizable}))&&_tools.UtilTools.warn("vxe.error.notResizable"),Object.assign(h,{startIndex:0,visibleIndex:0,renderSize:_xeUtils.default.toNumber(d.rSize),offsetSize:_xeUtils.default.toNumber(d.oSize)}),f=f.slice(h.startIndex,h.startIndex+h.renderSize)),this.scrollXLoad=g,this.tableColumn=f,this.$nextTick().then(function(){e.updateFooter(),e.recalculate(!0)})},analyColumnWidth:function(){var t=this.columnWidth,i=this.columnMinWidth,l=[],o=[],r=[],n=[],s=[],a=[];this.tableFullColumn.forEach(function(e){t&&!e.width&&(e.width=t),i&&!e.minWidth&&(e.minWidth=i),e.visible&&(e.resizeWidth?l.push(e):_tools.DomTools.isPx(e.width)?o.push(e):_tools.DomTools.isScale(e.width)?n.push(e):_tools.DomTools.isPx(e.minWidth)?r.push(e):_tools.DomTools.isScale(e.minWidth)?s.push(e):a.push(e))}),Object.assign(this.columnStore,{resizeList:l,pxList:o,pxMinList:r,scaleList:n,scaleMinList:s,autoList:a})},recalculate:function(e){var t=this,i=this.$refs,l=i.tableBody,o=i.tableHeader,r=i.tableFooter,n=l?l.$el:null,s=o?o.$el:null,a=r?r.$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,n=t.clientWidth,l=n,s=this.$el,a=this.fit,u=this.columnStore,c=u.resizeList,h=u.pxMinList,d=u.pxList,f=u.scaleList,g=u.scaleMinList,v=u.autoList;h.forEach(function(e){var t=parseInt(e.minWidth);r+=t,e.renderWidth=t}),o=l/100,g.forEach(function(e){var t=Math.floor(parseInt(e.minWidth)*o);r+=t,e.renderWidth=t}),f.forEach(function(e){var t=Math.floor(parseInt(e.width)*o);r+=t,e.renderWidth=t}),d.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<(l-=r)?Math.floor(l/(g.length+h.length+v.length)):0,a?0<l&&g.concat(h).forEach(function(e){r+=o,e.renderWidth+=o}):o=40,v.forEach(function(e,t){var i=Math.max(o,40);if(e.renderWidth=i,r+=i,a&&t===v.length-1){var l=n-r;0<l&&(e.renderWidth+=l,r=n)}});var p=t.offsetHeight,m=t.scrollHeight>t.clientHeight;if(this.scrollbarWidth=m?t.offsetWidth-n:0,this.overflowY=m,this.tableWidth=r,this.tableHeight=p,this.parentHeight=s.parentNode.clientHeight,e&&(this.headerHeight=e.offsetHeight),i){var x=i.offsetHeight;this.scrollbarHeight=Math.max(x-i.clientHeight,0),this.overflowX=r>i.clientWidth,this.footerHeight=x}else this.scrollbarHeight=Math.max(p-t.clientHeight,0),this.overflowX=n<r;this.overflowX&&this.checkScrolling()},resetResizable:function(){return this.visibleColumn.forEach(function(e){e.resizeWidth=0}),this.$toolbar&&this.$toolbar.resetResizable(),this.analyColumnWidth(),this.recalculate(!0)},updateStyle:function(){var t=this.$refs,p=this.fullColumnIdData,m=this.maxHeight,e=this.height,x=this.parentHeight,b=this.border,w=this.tableColumn,C=this.headerHeight,_=this.showHeaderOverflow,T=this.showFooter,S=this.showOverflow,y=this.footerHeight,R=this.tableHeight,E=this.tableWidth,D=this.overflowY,U=this.scrollbarHeight,k=this.scrollbarWidth,$=this.scrollXLoad,O=this.columnStore,I=this.elemStore,i=this.currentRow,F="auto"===e?x:_tools.DomTools.isScale(e)?Math.floor(parseInt(e)/100*x):_xeUtils.default.toNumber(e);return["main","left","right"].forEach(function(d,e){var f=0<e?d:"",g=O["".concat(f,"List")],v=t["".concat(f,"Container")];["header","body","footer"].forEach(function(u){var e=I["".concat(d,"-").concat(u,"-wrapper")],t=I["".concat(d,"-").concat(u,"-table")];if("header"===u){var i=E;$&&(f&&(w=g),i=w.reduce(function(e,t){return e+t.renderWidth},0)),t&&(t.style.width=null===i?i:"".concat(i+k,"px"));var l=I["".concat(d,"-").concat(u,"-repair")];l&&(l.style.width="".concat(E,"px"));var o=I["".concat(d,"-").concat(u,"-list")];o&&_xeUtils.default.arrayEach(o.querySelectorAll(".col--gutter"),function(e){e.style.width="".concat(k,"px")})}else if("body"===u){var r=I["".concat(d,"-").concat(u,"-emptyBlock")];if(e&&(0<F?e.style.height="".concat(f?(0<F?F-C-y:R)-(T?0:U):F-C-y,"px"):m&&(m=_tools.DomTools.isScale(m)?Math.floor(parseInt(m)/100*x):_xeUtils.default.toNumber(m),e.style.maxHeight="".concat(f?m-C-(T?0:U):m-C,"px"))),v){var n="right"===f,s=O["".concat(f,"List")];e.style.top="".concat(C,"px"),v.style.height="".concat((0<F?F-C-y:R)+C+y-U*(T?2:1),"px"),v.style.width="".concat(s.reduce(function(e,t){return e+t.renderWidth},n?k:0),"px")}var a=E;f&&S?a=(w=g).reduce(function(e,t){return e+t.renderWidth},0):$&&(f&&(w=g),a=w.reduce(function(e,t){return e+t.renderWidth},0)),t&&(t.style.width=a?"".concat(a,"px"):a,D&&f&&(browse["-moz"]||browse.safari)&&(t.style.paddingRight="".concat(k,"px"))),r&&(r.style.width=a?"".concat(a,"px"):a)}else if("footer"===u){var c=E;f&&S?c=(w=g).reduce(function(e,t){return e+t.renderWidth},0):$&&(f&&(w=g),c=w.reduce(function(e,t){return e+t.renderWidth},0)),e&&(v&&(e.style.top="".concat(F?F-y:R+C,"px")),e.style.marginTop="".concat(-U-1,"px")),t&&(t.style.width=null===c?c:"".concat(c+k,"px"))}var h=I["".concat(d,"-").concat(u,"-colgroup")];h&&_xeUtils.default.arrayEach(h.children,function(e){var t=e.getAttribute("name");if("col-gutter"===t&&(e.width="".concat(k||"")),p[t]){var i,l=p[t].column,o=l.showHeaderOverflow,r=l.showOverflow,n=l.renderWidth;e.width="".concat(l.renderWidth||"");var s="title"===(i="header"===u?_xeUtils.default.isUndefined(o)||_xeUtils.default.isNull(o)?_:o:_xeUtils.default.isUndefined(r)||_xeUtils.default.isNull(r)?S:r)||(!0===i||"tooltip"===i)||"ellipsis"===i,a=I["".concat(d,"-").concat(u,"-list")];a&&s&&_xeUtils.default.arrayEach(a.querySelectorAll(".".concat(l.id)),function(e){var t=e.querySelector(".vxe-cell");t&&(t.style.width="".concat(b?n-1:n,"px"))})}})})}),i&&this.setCurrentRow(i),this.$nextTick()},checkScrolling:function(){var e=this.$refs,t=e.tableBody,i=e.leftContainer,l=e.rightContainer,o=t?t.$el:null;o&&(i&&_tools.DomTools[0<o.scrollLeft?"addClass":"removeClass"](i,"scrolling--middle"),l&&_tools.DomTools[o.clientWidth<o.scrollWidth-o.scrollLeft?"addClass":"removeClass"](l,"scrolling--middle"))},preventEvent:function(t,e,i,l,o){var r=this;_vXETable.Interceptor.get(e).some(function(e){return!1===e(i,t,r)})||l&&l(),o&&o()},handleGlobalMousedownEvent:function(o){var r=this,n=this.$el,e=this.$refs,t=this.editStore,i=this.ctxMenuStore,l=this.editConfig,s=void 0===l?{}:l,a=this.filterStore,u=t.actived,c=e.filterWrapper,h=e.validTip;c&&(this.getEventTargetNode(o,n,"vxe-filter-wrapper").flag||this.getEventTargetNode(o,c.$el).flag||this.preventEvent(o,"event.clear_filter",a.args,this.closeFilter)),u.row&&!1!==s.autoClear&&(h&&this.getEventTargetNode(o,h.$el).flag||(!this.lastCallTime||this.lastCallTime+50<Date.now())&&this.preventEvent(o,"event.clear_actived",u.args,function(){var e,t=!r.getEventTargetNode(o,n,"col--edit").flag;if("row"===s.mode){var i=r.getEventTargetNode(o,n,"vxe-body--row"),l=i.flag?i.targetElem!==u.args.cell.parentNode:0;e="manual"===s.trigger?l:l&&t}else e=t;!e&&r.getEventTargetNode(o,n).flag||setTimeout(function(){return r.clearActived(o)})})),i.visible&&this.$refs.ctxWrapper&&!this.getEventTargetNode(o,this.$refs.ctxWrapper.$el).flag&&this.closeMenu()},handleGlobalBlurEvent:function(e){this.closeFilter(),this.closeMenu()},handleGlobalMousewheelEvent:function(e){this.clostTooltip(),this.closeMenu()},handleGlobalKeydownEvent:function(e){var t,i=this,l=this.isCtxMenu,o=this.ctxMenuStore,r=this.editStore,n=this.mouseConfig,s=void 0===n?{}:n,a=this.keyboardConfig,u=void 0===a?{}:a,c=this.treeConfig,h=this.highlightCurrentRow,d=this.currentRow,f=r.selected,g=r.actived,v=e.keyCode,p=8===v,m=9===v,x=13===v,b=27===v,w=32===v,C=37===v,_=38===v,T=39===v,S=40===v,y=46===v,R=65===v,E=67===v,D=86===v,U=88===v,k=113===v,$=e.ctrlKey,O=C||_||T||S,I=l&&o.visible&&(x||w||O);if(b)this.closeMenu(),this.closeFilter(),g.row&&(t=g.args,this.clearActived(e),s.selected&&this.$nextTick(function(){return i.handleSelected(t,e)}));else if(w&&(u.isArrow||u.isTab)&&f.row&&f.column&&("selection"===f.column.type||"radio"===f.column.type))e.preventDefault(),"selection"===f.column.type?this.handleToggleCheckRowEvent(f.args,e):this.triggerRadioRowEvent(e,f.args);else if(x&&(u.isArrow||u.isTab)&&(f.row||g.row||c&&h&&d)){if(f.row||g.row)this.moveSelected(f.row?f.args:g.args,C,_,T,!0,e);else if(c&&h&&d){var F=d[c.children];if(F&&F.length){e.preventDefault();var M=F[0];t={$table:this,row:M},this.setTreeExpansion(d,!0).then(function(){return i.scrollToRow(M)}).then(function(){return i.triggerCurrentRowEvent(e,t)})}}}else if(I)e.preventDefault(),o.showChild&&_tools.UtilTools.hasChildrenList(o.selected)?this.moveCtxMenu(e,v,o,"selectChild",37,!1,o.selected.children):this.moveCtxMenu(e,v,o,"selected",39,!0,this.ctxMenuList);else if(k)f.row&&f.column&&(e.preventDefault(),this.handleActived(f.args,e));else if(O&&u.isArrow)f.row&&f.column?this.moveSelected(f.args,C,_,T,S,e):(_||S)&&h&&d&&this.moveCurrentRow(_,S,e);else if(m&&u.isTab)f.row||f.column?this.moveTabSelected(f.args,e):(g.row||g.column)&&this.moveTabSelected(g.args,e);else if(y||(c&&h&&d?p&&u.isArrow:p)){if(u.isDel&&(f.row||f.column))_tools.UtilTools.setCellValue(f.row,f.column,null),p&&this.handleActived(f.args,e);else if(p&&u.isArrow&&c&&h&&d){var z=_xeUtils.default.findTree(this.afterFullData,function(e){return e===d},c).parent;z&&(e.preventDefault(),t={$table:this,row:z},this.setTreeExpansion(z,!1).then(function(){return i.scrollToRow(z)}).then(function(){return i.triggerCurrentRowEvent(e,t)}))}}else u.isCut&&$&&(R||U||E||D)?R?this.handleAllChecked(e):U||E?this.handleCopyed(U,e):this.handlePaste(e):u.isEdit&&!$&&(48<=v&&v<=57||65<=v&&v<=90||96<=v&&v<=111||186<=v&&v<=192||219<=v&&v<=222||32===v)&&f.column&&f.row&&f.column.editRender&&(u.editMethod&&!1===u.editMethod(f.args,e)||(_tools.UtilTools.setCellValue(f.row,f.column,null),this.handleActived(f.args,e)));this.preventEvent(e,"event.keydown",{$table:this})},handleGlobalResizeEvent:function(){this.recalculate()},closeMenu:function(){return Object.assign(this.ctxMenuStore,{visible:!1,selected:null,selectChild:null,showChild:!1}),this.$nextTick()},triggerHeaderTooltipEvent:function(e,t){var i=this.tooltipStore,l=t.column;i.column===l&&i.visible||this.handleTooltip(e,l)},triggerFooterTooltipEvent:function(e,t){var i=t.column,l=this.tooltipStore;l.column===i&&l.visible||this.handleTooltip(e,i)},triggerTooltipEvent:function(e,t){var i=this.editConfig,l=this.editStore,o=this.tooltipStore,r=l.actived,n=t.row,s=t.column;i&&("row"===i.mode&&r.row===n||r.row===n&&r.column===s)||o.column===s&&o.row===n&&o.visible||this.handleTooltip(e,s,n)},handleTooltip:function(e,t,i){var l=e.currentTarget,o=this.$refs.tooltip,r=l.children[0],n=l.innerText;return n&&r.scrollWidth>r.clientWidth&&(Object.assign(this.tooltipStore,{row:i,column:t,visible:!0}),o&&o.toVisible(l,_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 e=this.selectConfig,t=void 0===e?{}:e,i=this.fullDataRowIdData,l=t.checkAll,o=t.checkRowKeys;if(l)this.setAllSelection(!0);else if(o){var r=[];o.forEach(function(e){i[e]&&r.push(i[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()},handleSelectRow:function(e,i){var l=e.row,o=this.selection,t=this.tableFullData,r=this.selectConfig,n=void 0===r?{}:r,s=this.treeConfig,a=this.treeIndeterminates,u=n.checkField,c=n.checkStrictly,h=n.checkMethod;if(u)if(s&&!c){-1===i?(a.push(l),_xeUtils.default.set(l,u,!1)):(_xeUtils.default.eachTree([l],function(e,t){l!==e&&h&&!h({row:e,$rowIndex:t})||_xeUtils.default.set(e,u,i)},s),_xeUtils.default.remove(a,function(e){return e===l}));var d=_xeUtils.default.findTree(t,function(e){return e===l},s);if(d&&d.parent){var f,g=h?d.items.filter(function(e,t){return h({row:e,$rowIndex:t})}):d.items;if(d.items.find(function(e){return-1<a.indexOf(e)}))f=-1;else{var v=d.items.filter(function(e){return _xeUtils.default.get(e,u)});f=v.filter(function(e){return-1<g.indexOf(e)}).length===g.length||!(!v.length&&-1!==i)&&-1}return this.handleSelectRow({row:d.parent},f)}}else _xeUtils.default.set(l,u,i);else if(s&&!c){-1===i?(a.push(l),_xeUtils.default.remove(o,function(e){return e===l})):(_xeUtils.default.eachTree([l],function(t,e){l!==t&&h&&!h({row:t,$rowIndex:e})||(i?o.push(t):_xeUtils.default.remove(o,function(e){return e===t}))},s),_xeUtils.default.remove(a,function(e){return e===l}));var p=_xeUtils.default.findTree(t,function(e){return e===l},s);if(p&&p.parent){var m,x=h?p.items.filter(function(e,t){return h({row:e,$rowIndex:t})}):p.items;if(p.items.find(function(e){return-1<a.indexOf(e)}))m=-1;else{var b=p.items.filter(function(e){return-1<o.indexOf(e)});m=b.filter(function(e){return-1<x.indexOf(e)}).length===x.length||!(!b.length&&-1!==i)&&-1}return this.handleSelectRow({row:p.parent},m)}}else i?-1===o.indexOf(l)&&o.push(l):_xeUtils.default.remove(o,function(e){return e===l});this.checkSelectionStatus()},handleToggleCheckRowEvent:function(e,t){var i=this.selectConfig,l=void 0===i?{}:i,o=this.selection,r=l.checkField,n=e.row,s=r?!_xeUtils.default.get(n,r):-1===o.indexOf(n);t?this.triggerCheckRowEvent(t,e,s):this.handleSelectRow(e,s)},triggerCheckRowEvent:function(e,t,i){this.handleSelectRow(t,i),_tools.UtilTools.emitEvent(this,"select-change",[Object.assign({selection:this.getSelectRecords(),checked:i,$table:this},t),e])},toggleRowSelection:function(e){return this.handleToggleCheckRowEvent({row:e}),this.$nextTick()},setAllSelection:function(i){var e=this.tableFullData,t=this.editStore,l=this.selectConfig,o=void 0===l?{}:l,r=this.treeConfig,n=this.selection,s=o.checkField,a=o.reserve,u=o.checkStrictly,c=o.checkMethod,h=t.insertList,d=[];if(h.length&&(e=e.concat(h)),!u){if(s){var f="".concat(r?"$":"","rowIndex"),g=function(e,t){c&&!c(_defineProperty({row:e},f,t))||_xeUtils.default.set(e,s,i)},v=function(e,t){(!c||!c(_defineProperty({row:e},f,t))&&-1<n.indexOf(e))&&_xeUtils.default.set(e,s,i)};r?_xeUtils.default.eachTree(e,i?g:v,r):e.forEach(i?g:v)}else r?i?_xeUtils.default.eachTree(e,function(e,t){c&&!c({row:e,$rowIndex:t})||d.push(e)},r):c&&_xeUtils.default.eachTree(e,function(e,t){!c({row:e,$rowIndex:t})&&-1<n.indexOf(e)&&d.push(e)},r):i?d=c?e.filter(function(e,t){return-1<n.indexOf(e)||c({row:e,rowIndex:t})}):e.slice(0):c&&(d=e.filter(function(e,t){return c({row:e,rowIndex:t})?0:-1<n.indexOf(e)}));this.selection=i&&a?n.concat(d.filter(function(e){return-1===n.indexOf(e)})):d}this.treeIndeterminates=[],this.checkSelectionStatus()},checkSelectionStatus:function(){var e=this.tableFullData,t=this.editStore,i=this.selectConfig,l=void 0===i?{}:i,o=this.selection,r=this.treeIndeterminates,n=l.checkField,s=l.checkStrictly,a=l.checkMethod,u=t.insertList;u.length&&(e=e.concat(u)),s||(n?(this.isAllSelected=e.length&&e.every(a?function(e,t){return!a({row:e,rowIndex:t})||_xeUtils.default.get(e,n)}:function(e){return _xeUtils.default.get(e,n)}),this.isIndeterminate=!this.isAllSelected&&e.some(function(e){return _xeUtils.default.get(e,n)||-1<r.indexOf(e)})):(this.isAllSelected=e.length&&e.every(a?function(e,t){return!a({row:e,rowIndex:t})||-1<o.indexOf(e)}:function(e){return-1<o.indexOf(e)}),this.isIndeterminate=!this.isAllSelected&&e.some(function(e){return-1<r.indexOf(e)||-1<o.indexOf(e)})))},reserveCheckSelection:function(){var e=this.selectConfig,t=void 0===e?{}:e,i=this.selection,l=this.fullDataRowIdData,o=t.reserve,r=_tools.UtilTools.getRowkey(this);o&&i.length&&(this.selection=i.map(function(e){var t=""+_xeUtils.default.get(e,r);return l[t]?l[t].row:e}))},triggerCheckAllEvent:function(e,t){this.setAllSelection(t),_tools.UtilTools.emitEvent(this,"select-all",[{selection:this.getSelectRecords(),checked:t,$table:this},e])},toggleAllSelection:function(){return this.triggerCheckAllEvent(null,!this.isAllSelected),this.$nextTick()},clearSelection:function(){var e=this.tableFullData,t=this.selectConfig,i=void 0===t?{}:t,l=this.treeConfig,o=i.checkField;return o&&(l?_xeUtils.default.eachTree(e,function(e){return _xeUtils.default.set(e,o,!1)},l):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.radioConfig,t=void 0===e?{}:e,i=this.fullDataRowIdData,l=t.checkRowKey;l&&i[l]&&this.setRadioRow(i[l].row)},triggerRadioRowEvent:function(e,t){var i=this.selectRow!==t.row;this.setRadioRow(t.row),i&&_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,l=this.sortOpts,o=t.column,r=t.cell,n=i&&i>Date.now()-300,s=this.getEventTargetNode(e,r,"vxe-sort-wrapper").flag,a=this.getEventTargetNode(e,r,"vxe-filter-wrapper").flag;return"cell"!==l.trigger||n||s||a||this.sort(o.property),_tools.UtilTools.emitEvent(this,"header-cell-click",[Object.assign({triggerResizable:n,triggerSort:s,triggerFilter:a},t),e]),this.highlightCurrentColumn?this.setCurrentColumn(o,!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()},triggerCellClickEvent:function(e,t){var i=this,l=this.$el,o=this.highlightCurrentRow,r=this.editStore,n=this.radioConfig,s=void 0===n?{}:n,a=this.selectConfig,u=void 0===a?{}:a,c=this.expandConfig,h=void 0===c?{}:c,d=this.treeConfig,f=void 0===d?{}:d,g=this.editConfig,v=this.mouseConfig,p=void 0===v?{}:v,m=r.actived,x=t.column,b=t.cell;"row"!==h.trigger&&("expand"!==x.type||"cell"!==h.trigger)||this.getEventTargetNode(e,l,"vxe-table--expanded").flag||this.triggerRowExpandEvent(e,t),("row"===f.trigger||x.treeNode&&"cell"===f.trigger)&&this.triggerTreeExpandEvent(e,t),x.treeNode&&this.getEventTargetNode(e,l,"vxe-tree-wrapper").flag||"expand"===x.type&&this.getEventTargetNode(e,l,"vxe-table--expanded").flag||(o&&("row"!==s.trigger&&(this.getEventTargetNode(e,l,"vxe-checkbox").flag||this.getEventTargetNode(e,l,"vxe-radio").flag)||this.triggerCurrentRowEvent(e,t)),"row"!==s.trigger&&("radio"!==x.type||"cell"!==s.trigger)||this.getEventTargetNode(e,l,"vxe-radio").flag||this.triggerRadioRowEvent(e,t),"row"!==u.trigger&&("selection"!==x.type||"cell"!==u.trigger)||this.getEventTargetNode(e,t.cell,"vxe-checkbox").flag||this.handleToggleCheckRowEvent(t,e),p.checked||g&&(m.args&&b===m.args.cell||("click"===g.trigger?this.triggerValidate("blur").catch(function(e){return e}).then(function(){i.handleActived(t,e).then(function(){return i.triggerValidate("change")}).catch(function(e){return e})}):"dblclick"===g.trigger&&("row"===g.mode&&m.row===t.row?this.triggerValidate("blur").catch(function(e){return e}).then(function(){i.handleActived(t,e).then(function(){return i.triggerValidate("change")}).catch(function(e){return e})}):this.handleSelected(t,e))))),_tools.UtilTools.emitEvent(this,"cell-click",[t,e])},triggerCellDBLClickEvent:function(e,t){var i=this,l=this.editStore,o=this.editConfig,r=l.actived;o&&"dblclick"===o.trigger&&(r.args&&e.currentTarget===r.args.cell||("row"===o.mode?this.triggerValidate("blur").catch(function(e){return e}).then(function(){i.handleActived(t,e).then(function(){return i.triggerValidate("change")}).catch(function(e){return e})}):"cell"===o.mode&&this.handleActived(t,e).then(function(){return i.triggerValidate("change")}).catch(function(e){return e}))),_tools.UtilTools.emitEvent(this,"cell-dblclick",[t,e])},handleActived:function(e,t){var i=this,l=this.editStore,o=this.editConfig,r=this.tableColumn,n=o.activeMethod,s=l.actived,a=e.row,u=e.column,c=e.cell,h=u.model;if(u.editRender&&c)if(s.row!==a||"cell"===o.mode&&s.column!==u){var d="edit-disabled";n&&!n(e)||((this.keyboardConfig||this.mouseConfig)&&(this.clearCopyed(t),this.clearChecked(),this.clearSelected(t)),this.clostTooltip(),this.clearActived(t),d="edit-actived",u.renderHeight=c.offsetHeight,s.args=e,s.row=a,s.column=u,"row"===o.mode?r.forEach(function(e){e.editRender&&(e.model.value=_tools.UtilTools.getCellValue(a,e),e.model.update=!1)}):(h.value=_tools.UtilTools.getCellValue(a,u),h.update=!1),this.$nextTick(function(){i.handleFocus(e,t)})),_tools.UtilTools.emitEvent(this,d,[e,t])}else{var f=s.column;if(f!==u){var g=f.model;g.update&&_tools.UtilTools.setCellValue(a,f,g.value),this.clearValidate()}u.renderHeight=c.offsetHeight,s.args=e,s.column=u,setTimeout(function(){i.handleFocus(e,t)})}return this.$nextTick()},clearActived:function(e){var t=this.editStore.actived,i=t.args,l=t.row,o=t.column;if(l||o){var r=o.model;r.update&&(_tools.UtilTools.setCellValue(l,o,r.value),r.update=!1,r.value=null,this.updateFooter()),_tools.UtilTools.emitEvent(this,"edit-closed",[i,e])}return t.args=null,t.row=null,t.column=null,this.clearValidate().then(this.recalculate)},getActiveRow:function(){var e=this.$el,t=this.editStore,i=this.tableData,l=t.actived,o=l.args,r=l.row;return o&&-1<i.indexOf(r)&&e.querySelectorAll(".vxe-body--column.col--actived").length?Object.assign({},o):null},hasActiveRow:function(e){return this.editStore.actived.row===e},handleFocus:function(e,t){var i=e.column,l=e.cell,o=i.editRender;if(o){var r,n=_vXETable.Renderer.get(o.name),s=o.autofocus,a=o.autoselect;if(s&&(r=l.querySelector(s)),!r&&n&&n.autofocus&&(r=l.querySelector(n.autofocus)),r&&(r[a?"select":"focus"](),browse.msie)){var u=r.createTextRange();u.collapse(!1),u.select()}}},setActiveRow:function(e){return this.setActiveCell(e,this.visibleColumn.find(function(e){return e.editRender}).property)},setActiveCell:function(i,l){var o=this;return this.scrollToRow(i,!0).then(function(){if(i&&l){var e=o.visibleColumn.find(function(e){return e.property===l});if(e&&e.editRender){var t=_tools.DomTools.getCell(o,{row:i,column:e});t&&(o.handleActived({row:i,rowIndex:o.getRowIndex(i),column:e,columnIndex:o.getColumnIndex(e),cell:t,$table:o}),o.lastCallTime=Date.now())}}return o.$nextTick()})},setSelectCell:function(e,t){var i=this.tableData,l=this.editConfig,o=this.visibleColumn;if(e&&t&&"manual"!==l.trigger){var r=o.find(function(e){return e.property===t}),n=i.indexOf(e);if(-1<n&&r){var s=_tools.DomTools.getCell(this,{row:e,rowIndex:n,column:r}),a={row:e,rowIndex:n,column:r,columnIndex:o.indexOf(r),cell:s};this.handleSelected(a,{})}}return this.$nextTick()},handleSelected:function(o,r){var n=this,e=this.mouseConfig,s=void 0===e?{}:e,a=this.editConfig,t=this.editStore,u=this.elemStore,c=t.actived,h=t.selected,d=o.row,f=o.column,g=o.cell;return function(){if((h.row!==d||h.column!==f)&&(c.row!==d||"cell"===a.mode&&c.column!==f)){if((n.keyboardConfig||n.mouseConfig)&&(n.clearChecked(r),n.clearIndexChecked(),n.clearHeaderChecked(),n.clearSelected(r)),n.clearActived(r),h.args=o,h.row=d,h.column=f,s.selected){var e=u["main-body-list"],t=_tools.UtilTools.getRowid(n,d),i=e.querySelector('[data-rowid="'.concat(t,'"]')).querySelector(".".concat(f.id));_tools.DomTools.addClass(i,"col--selected")}if(s.checked){var l=u["main-header-list"];n.handleChecked([[g]]),l&&n.handleHeaderChecked([[l.querySelector(".".concat(f.id))]]),n.handleIndexChecked([[g.parentNode.querySelector(".col--index")]])}}return n.$nextTick()}()},triggerSortEvent:function(e,t,i,l){t.order===l?this.clearSort(t.property):this.sort(t.property,l)},sort:function(t,e){var i=this.visibleColumn,l=this.tableFullColumn,o=this.remoteSort,r=i.find(function(e){return e.property===t}),n=_xeUtils.default.isBoolean(r.remoteSort)?r.remoteSort:o;return r.sortable||r.remoteSort?(e||(e="desc"===r.order?"asc":"desc"),r.order!==e&&(l.forEach(function(e){e.order=null}),r.order=e,n||this.handleTableData(!0),_tools.UtilTools.emitEvent(this,"sort-change",[{column:r,property:t,prop:t,field:t,order:e,$table:this}])),this.$nextTick().then(this.updateStyle)):this.$nextTick()},clearSort:function(){return this.tableFullColumn.forEach(function(e){e.order=null}),this.handleTableData(!0)},closeFilter:function(e){return Object.assign(this.filterStore,{isAllSelected:!1,isIndeterminate:!1,options:[],visible:!1}),this.$nextTick()},triggerRowExpandEvent:function(e,t){var i=t.row,l=this.toggleRowExpansion(i);return _tools.UtilTools.emitEvent(this,"toggle-expand-change",[{row:i,rowIndex:this.getRowIndex(i),$table:this},e]),l},toggleRowExpansion:function(e){return this.setRowExpansion(e)},handleDefaultRowExpand:function(){var e=this.expandConfig,t=void 0===e?{}:e,i=this.tableFullData,l=this.fullDataRowIdData,o=t.expandAll,r=t.expandRowKeys;if(o)this.expandeds=i.slice(0);else if(r){var n=[];r.forEach(function(e){l[e]&&n.push(l[e].row)}),this.expandeds=n}},setAllRowExpansion:function(e){return this.expandeds=e?this.tableFullData.slice(0):[],this.$nextTick()},setRowExpansion:function(e,i){var l=this.expandeds,t=this.expandConfig,o=void 0===t?{}:t,r=1===arguments.length;return e&&(_xeUtils.default.isArray(e)||(e=[e]),o.accordion&&(l.length=0,e=e.slice(e.length-1,e.length)),e.forEach(function(e){var t=l.indexOf(e);-1<t?!r&&i||l.splice(t,1):(r||i)&&l.push(e)})),this.$nextTick()},hasRowExpand:function(e){return-1<this.expandeds.indexOf(e)},clearRowExpand:function(){return this.expandeds=[],this.$nextTick()},triggerTreeExpandEvent:function(e,t){var i=this,l=t.row,o=this.toggleTreeExpansion(l);return _tools.UtilTools.emitEvent(this,"toggle-tree-change",[{row:l,rowIndex:this.getRowIndex(l),$table:this},e]),this.$nextTick(function(){var e=i.currentRow,t=i.currentColumn;e?i.setCurrentRow(e):t&&i.setCurrentColumn(t)}),o},toggleTreeExpansion:function(e){return this.setTreeExpansion(e)},handleDefaultTreeExpand:function(){var l=this.treeConfig,o=this.tableFullData;if(l){var e=l.expandAll,t=l.expandRowKeys,r=l.children,n=[];if(e)_xeUtils.default.filterTree(o,function(e){var t=e[r];t&&t.length&&n.push(e)},l),this.treeExpandeds=n;else if(t){var s=_tools.UtilTools.getRowkey(this);t.forEach(function(t){var e=_xeUtils.default.findTree(o,function(e){return t===_xeUtils.default.get(e,s)},l),i=e?e.item[r]:0;i&&i.length&&n.push(e.item)}),this.treeExpandeds=n}}},setAllTreeExpansion:function(e){var t=this.tableFullData,i=this.treeConfig,l=i.children,o=[];return e&&_xeUtils.default.eachTree(t,function(e){var t=e[l];t&&t.length&&o.push(e)},i),this.treeExpandeds=o,this.$nextTick()},setTreeExpansion:function(e,o){var r=this.tableFullData,n=this.treeExpandeds,s=this.treeConfig,a=s.children,u=1===arguments.length;return e&&(_xeUtils.default.isArray(e)||(e=[e]),s.accordion&&(e=e.slice(e.length-1,e.length)),e.forEach(function(t){var e=t[a];if(e&&e.length){var i=n.indexOf(t);if(s.accordion){var l=_xeUtils.default.findTree(r,function(e){return e===t},s);_xeUtils.default.remove(n,function(e){return-1<l.items.indexOf(e)})}-1<i?!u&&o||n.splice(i,1):(u||o)&&n.push(t)}})),this.$nextTick()},hasTreeExpand:function(e){return-1<this.treeExpandeds.indexOf(e)},clearTreeExpand:function(){return this.treeExpandeds=[],this.$nextTick()},getVirtualScroller:function(){var e=this.$refs,t=this.scrollXLoad,i=this.scrollYLoad,l=e.tableBody.$el;return{scrollX:t,scrollY:i,scrollTop:l.scrollTop,scrollLeft:l.scrollLeft}},triggerScrollXEvent:function(e){for(var t=this.$refs,i=this.visibleColumn,l=this.scrollXStore,o=l.startIndex,r=l.renderSize,n=l.offsetSize,s=l.visibleSize,a=t.tableBody.$el.scrollLeft,u=0,c=0,h=!1,d=0;d<i.length;d++)if(a<(c+=i[d].renderWidth)){u=d;break}if(l.visibleIndex!==u){var f=Math.min(Math.floor((r-s)/2),s);l.visibleIndex>u?(h=u-n<=o)&&(l.startIndex=Math.max(0,u-Math.max(f,r-s))):(h=o+r<=u+s+n)&&(l.startIndex=Math.max(0,Math.min(i.length-r,u-f))),h&&this.updateScrollXData(),l.visibleIndex=u}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,l=i.startIndex,o=i.renderSize,r=i.offsetSize,n=i.visibleSize,s=i.rowHeight,a=e.target.scrollTop,u=Math.ceil(a/s),c=!1;if(i.visibleIndex!==u){var h=Math.min(Math.floor((o-n)/2),n);i.visibleIndex>u?(c=u-r<=l)&&(i.startIndex=Math.max(0,u-Math.max(h,o-n))):(c=l+o<=u+n+r)&&(i.startIndex=Math.max(0,Math.min(t.length-o,u-h))),c&&this.updateScrollYData(),i.visibleIndex=u}},computeScrollLoad:function(){var x=this;return this.$nextTick().then(function(){var e=x.vSize,t=x.scrollXLoad,i=x.scrollYLoad,l=x.scrollYStore,o=x.scrollXStore,r=x.visibleColumn,n=x.optimizeOpts,s=n.scrollX,a=n.scrollY,u=x.$refs.tableBody,c=u?u.$el:null,h=x.$refs.tableHeader;if(c){if(t){var d=r[0],f=d?d.renderWidth:40,g=_xeUtils.default.toNumber(s.vSize||Math.ceil(c.clientWidth/f));o.visibleSize=g,s.oSize||(o.offsetSize=g),s.rSize||(o.renderSize=g+2),x.updateScrollXData()}else x.updateScrollXSpace();if(i){var v;if(a.rHeight)v=a.rHeight;else{var p=c.querySelector("tbody>tr");!p&&h&&(p=h.$el.querySelector("thead>tr")),p&&(v=p.clientHeight)}if(!v)switch(e){case"medium":v=44;break;case"small":v=40;break;case"mini":v=36;break;default:v=48}var m=_xeUtils.default.toNumber(a.vSize||Math.ceil(c.clientHeight/v));l.visibleSize=m,l.rowHeight=v,a.oSize||(l.offsetSize=m),a.rSize||(l.renderSize=browse.firefox?6*m:browse.edge?10*m:isWebkit?m+2:6*m),x.updateScrollYData()}else x.updateScrollYSpace()}x.$nextTick(x.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,l=this.elemStore,t=this.visibleColumn,i=this.scrollXStore,o=this.scrollXLoad,r=this.tableWidth,n=this.scrollbarWidth,s=e.tableHeader,a=e.tableBody,u=e.tableFooter,c=s?s.$el.querySelector(".vxe-table--header"):null,h=a.$el.querySelector(".vxe-table--body"),d=u?u.$el.querySelector(".vxe-table--footer"):null,f=t.slice(0,i.startIndex).reduce(function(e,t){return e+t.renderWidth},0),g="";o&&(g="".concat(f,"px")),c&&(c.style.marginLeft=g),h.style.marginLeft=g,d&&(d.style.marginLeft=g);["main"].forEach(function(i){["header","body","footer"].forEach(function(e){var t=l["".concat(i,"-").concat(e,"-xSpace")];t&&(t.style.width=o?"".concat(r+("header"===e?n:0),"px"):"")})}),this.$nextTick(this.updateStyle)},updateScrollYData:function(){this.handleTableData(),this.updateScrollYSpace()},updateScrollYSpace:function(){var l=this.elemStore,e=this.scrollYStore,t=this.scrollYLoad,i=this.afterFullData.length*e.rowHeight,o=Math.max(e.startIndex*e.rowHeight,0),r="",n="";t&&(r="".concat(o,"px"),n="".concat(i,"px")),["main","left","right"].forEach(function(i){var e=l["".concat(i,"-body-table")];e&&(e.style.marginTop=r),["header","body","footer"].forEach(function(e){var t=l["".concat(i,"-").concat(e,"-ySpace")];t&&(t.style.height=n)})}),this.$nextTick(this.updateStyle)},scrollTo:function(e,t){var i=this.$refs.tableBody.$el;if(_xeUtils.default.isNumber(e)){var l=this.$refs.tableFooter;l?l.$el.scrollLeft=e:i.scrollLeft=e}if(_xeUtils.default.isNumber(t)){var o=this.$refs.rightBody;o&&(o.$el.scrollTop=t),i.scrollTop=t}return this.$nextTick()},scrollToRow:function(e,t,i){return e&&this.fullAllDataRowMap.has(e)&&_tools.DomTools.rowToVisible(this,e),this.scrollToColumn(t,i||_xeUtils.default.isBoolean(t))},scrollToColumn:function(e,t){var i=this;return e&&this.fullColumnMap.has(e)&&_tools.DomTools.colToVisible(this,e),t&&this.scrollYLoad?new Promise(function(e){return setTimeout(function(){return e(i.$nextTick())},50)}):this.$nextTick()},clearScroll:function(){var o=this;return this.lastScrollLeft=0,this.lastScrollTop=0,Object.assign(this.scrollXStore,{startIndex:0,visibleIndex:0}),Object.assign(this.scrollYStore,{startIndex:0,visibleIndex:0}),this.$nextTick(function(){var e=o.$refs.tableBody,t=e?e.$el:null,i=o.$refs.tableFooter,l=i?i.$el:null;t&&(t.scrollTop=0,t.scrollLeft=0),l&&(l.scrollLeft=0)}),this.$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,u){var c=this,h=!_xeUtils.default.isUndefined(u);return this.$nextTick().then(function(){var e=c.$refs,t=c.tableData,i=c.editRules,l=c.validStore;if(a&&e.tableBody&&i){var o=a.row,r=a.column;if(c.hasCellRules("change",o,r)){var n=t.indexOf(o),s=_tools.DomTools.getCell(c,{row:o,rowIndex:n,column:r});if(s)return c.validCellRules("change",o,r,u).then(function(){h&&l.visible&&_tools.UtilTools.setCellValue(o,r,u),c.clearValidate()}).catch(function(e){var t=e.rule;h&&_tools.UtilTools.setCellValue(o,r,u),c.showValidTooltip({rule:t,row:o,column:r,cell:s})})}}})},triggerValidate:function(l){var o=this,e=this.editConfig,t=this.editStore,i=this.editRules,r=this.validStore,n=t.actived;if(n.row&&i){var s=n.args,a=s.row,u=s.column,c=s.cell;if(this.hasCellRules(l,a,u))return this.validCellRules(l,a,u).then(function(){"row"===e.mode&&r.visible&&r.row===a&&r.column===u&&o.clearValidate()}).catch(function(e){var t=e.rule;if(t.trigger&&l!==t.trigger)return Promise.resolve();var i={rule:t,row:a,column:u,cell:c};return o.showValidTooltip(i),Promise.reject(i)})}return Promise.resolve()},fullValidate:function(e,t){return this.beginValidate(e,t,!0)},validate:function(e,t){return this.beginValidate(e,t)},beginValidate:function(e,r,s){var a=this,u={},n=!0,t=this.editRules,i=this.tableData,l=this.tableFullData,c=this.scrollYLoad,o=c?l:i;e&&(_xeUtils.default.isFunction(e)?r=e:o=_xeUtils.default.isArray(e)?e:[e]);var h=[];if(this.lastCallTime=Date.now(),this.clearValidate(),t){var d=this.getColumns();return o.forEach(function(n){var e=[];d.forEach(function(o,r){_xeUtils.default.has(t,o.property)&&e.push(new Promise(function(i,l){a.validCellRules("all",n,o).then(i).catch(function(e){var t={rule:e.rule,rules:e.rules,rowIndex:a.getRowIndex(n),row:n,columnIndex:r,column:o,$table:a};return s?(u[o.property]||(u[o.property]=[]),u[o.property].push(t),i()):l(t)})}))}),h.push(Promise.all(e))}),Promise.all(h).then(function(){var e=Object.keys(u);if(e.length)return Promise.reject(u[e[0]][0]);r&&r(n)}).catch(function(l){var o=s?u:_defineProperty({},l.column.property,l);return new Promise(function(e,t){var i=function(){l.cell=_tools.DomTools.getCell(a,l),a.handleValidError(l),r?e(r(n=!1,o)):t(o)};c?a.scrollToRow(l.row,!0).then(i):i()})})}return r&&r(n),Promise.resolve(!0)},hasCellRules:function(t,e,i){var l=this.editRules,o=i.property;if(o&&l){var r=_xeUtils.default.get(l,o);return r&&r.find(function(e){return"all"===t||!e.trigger||t===e.trigger})}return!1},validCellRules:function(s,a,u,e){var c=this,t=this.editRules,i=u.property,h=[],l=[];if(i&&t){var d=_xeUtils.default.get(t,i),f=_xeUtils.default.isUndefined(e)?_xeUtils.default.get(a,i):e;d&&d.forEach(function(n){l.push(new Promise(function(i){var e=!0===n.required;if("all"!==s&&n.trigger&&s!==n.trigger)i();else if(_xeUtils.default.isFunction(n.validator))n.validator(n,f,function(e){if(_xeUtils.default.isError(e)){var t={type:"custom",trigger:n.trigger,message:e.message,rule:new Rule(n)};h.push(new Rule(t))}return i()},{rules:d,row:a,column:u,rowIndex:c.getRowIndex(a),columnIndex:c.getColumnIndex(u)});else{var t,l=f,o="number"===n.type,r=null==f||""===f;o?l=_xeUtils.default.toNumber(f):t=_xeUtils.default.getSize(l),e&&r?h.push(new Rule(n)):(o&&isNaN(f)||_xeUtils.default.isRegExp(n.pattern)&&!n.pattern.test(f)||_xeUtils.default.isNumber(n.min)&&(o?l<n.min:t<n.min)||_xeUtils.default.isNumber(n.max)&&(o?l>n.max:t>n.max))&&h.push(new Rule(n)),i()}}))})}return Promise.all(l).then(function(){if(h.length){var e={rules:h,rule:h[0]};return Promise.reject(e)}})},clearValidate:function(){var e=this.$refs.validTip;return Object.assign(this.validStore,{visible:!1,row:null,column:null,content:"",rule:null}),e&&e.visible&&e.close(),this.$nextTick()},handleValidError:function(e){var t=this;this.handleActived(e,{type:"valid-error",trigger:"call"}).then(function(){return t.showValidTooltip(e)})},showValidTooltip:function(e){var t=this,i=this.$refs,l=this.height,o=this.tableData,r=this.validOpts,n=e.rule,s=e.row,a=e.column,u=e.cell,c=i.validTip,h=n.message;this.$nextTick(function(){Object.assign(t.validStore,{row:s,column:a,rule:n,content:h,visible:!0}),c&&("tooltip"===r.message||"default"===r.message&&!l&&o.length<2)&&c.toVisible(u,h),_tools.UtilTools.emitEvent(t,"valid-error",[e])})},connect:function(e){var t=e.toolbar;this.$toolbar=t},getEventTargetNode:_tools.DomTools.getEventTargetNode}};exports.default=_default2;