methods.min.js 55 KB
Newer Older
YazhouChen's avatar
YazhouChen committed
1
"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.inited=!1,this.clearSort(),this.clearCurrentRow(),this.clearCurrentColumn(),this.clearCheckboxRow(),this.clearCheckboxReserve(),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){var t=this,i=this.height,o=this.maxHeight,r=this.showOverflow,l=this.treeConfig,n=this.editStore,s=this.optimizeOpts,a=this.scrollYStore,c=s.scrollY,h=e?e.slice(0):[],u=!l&&c&&c.gt&&c.gt<h.length;return a.startIndex=0,a.visibleIndex=0,n.insertList=[],n.removeList=[],this.tableFullData=h,this.updateCache(!0),this.tableSynchData=e,this.tableSourceData=_xeUtils.default.clone(h,!0),!(this.scrollYLoad=u)||i||o||_tools.UtilTools.error("plx.error.reqProp",["height | max-height"]),u&&!r&&_tools.UtilTools.warn("plx.error.reqProp",["show-overflow"]),this.handleTableData(!0),this.updateFooter(),this.computeScrollLoad().then(function(){return t.isLoadData=!0,t.computeRowHeight(),t.handleReserveStatus(),t.checkSelectionStatus(),t.$nextTick().then(t.recalculate).then(t.refreshScroll)})},loadData:function(e){return this.inited=!0,this.loadTableData(e).then(this.recalculate)},reloadData:function(e){var t=this;return this.clearAll().then(function(){return t.inited=!0,t.loadTableData(e)}).then(this.handleDefaults)},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("plx.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("plx.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("plx.error.delFunc",["getAllRecords","getRecordset"]),this.getRecordset()},getSelectRecords:function(){return this.getCheckboxRecords()},getCheckboxRecords: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)}},handleDefaults:function(){var e=this;(this.checkboxConfig||this.selectConfig)&&this.handleDefaultSelectionChecked(),this.radioConfig&&this.handleDefaultRadioChecked(),this.sortConfig&&this.handleDefaultSort(),this.expandConfig&&this.handleDefaultRowExpand(),this.treeConfig&&this.handleDefaultTreeExpand(),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.resetColumn(!0)},hideColumn:function(e){return this.handleVisibleColumn(e,!1)},showColumn:function(e){return this.handleVisibleColumn(e,!0)},resetColumn:function(e){var t=Object.assign({visible:!0},e);return!0!==e&&!t.resizable||this.handleResetResizable(),t.visible?this.handleVisibleColumn():this.$nextTick()},resetCustoms:function(){return this.resetColumn()},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()},handleResetResizable:function(){return this.tableFullColumn.forEach(function(e){e.resizeWidth=0}),this.$toolbar&&this.$toolbar.resetResizable(),this.analyColumnWidth(),this.recalculate(!0)},resetResizable:function(){return this.handleResetResizable()},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("plx.error.groupFixed"),p&&(this.isGroup&&_tools.UtilTools.warn("plx.error.scrollXNotGroup"),this.showHeader&&!this.showHeaderOverflow&&_tools.UtilTools.warn("plx.error.reqProp",["show-header-overflow"]),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 x=d.concat(f).concat(h).concat(p),g=x.length-1;if(0<g){var v=l-r;if(0<v){for(;0<v&&0<=g;)v--,x[g--].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.isCoverBody=l-2<=r,this.parentHeight=this.getParentHeight(),e&&(this.headerHeight=e.clientHeight,e.scrollLeft!==t.scrollLeft&&(e.scrollLeft=t.scrollLeft)),i){var b=i.offsetHeight;this.scrollbarHeight=Math.max(b-i.clientHeight,0),this.overflowX=r>i.clientWidth,this.footerHeight=b}else this.scrollbarHeight=Math.max(w-t.clientHeight,0),this.overflowX=l<r;this.overflowX&&this.checkScrolling()},updateStyle:function(){var g=this,t=this.$refs,v=this.isGroup,w=this.fullColumnIdData,m=this.maxHeight,e=this.height,b=this.parentHeight,T=this.border,R=this.tableColumn,C=this.headerHeight,_=this.showHeaderOverflow,y=this.showFooter,E=this.showOverflow,S=this.footerHeight,k=this.tableHeight,D=this.tableWidth,U=this.scrollbarHeight,$=this.scrollbarWidth,O=this.scrollXLoad,I=this.scrollYLoad,A=this.cellOffsetWidth,L=this.columnStore,M=this.elemStore,i=this.editStore,o=this.currentRow,r=this.mouseConfig,F=0;e&&(F="auto"===e?b:(_tools.DomTools.isScale(e)?Math.floor(parseInt(e)/100*b):_xeUtils.default.toNumber(e))-this.getExcludeHeight(),y&&(F+=U+1));var l=t.emptyPlaceholder;return l&&(l.style.top=e?"":"".concat(C,"px")),["main","left","right"].forEach(function(d,e){var f=0<e?d:"",p=L["".concat(f,"List")],x=t["".concat(f,"Container")];["header","body","footer"].forEach(function(a){var e=M["".concat(d,"-").concat(a,"-wrapper")],t=M["".concat(d,"-").concat(a,"-table")];if("header"===a){var i=D;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(".plx-resizable"),function(e){e.style.height="".concat(e.parentNode.offsetHeight,"px")}));var o=M["".concat(d,"-").concat(a,"-repair")];o&&(o.style.width="".concat(D,"px"));var r=M["".concat(d,"-").concat(a,"-list")];v&&r&&_xeUtils.default.arrayEach(r.querySelectorAll(".col--group"),function(e){var t=g.getColumnNode(e).item,i=t.showHeaderOverflow,o=_xeUtils.default.isBoolean(i)?i:_,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-(T?2:0),"px"))})}else if("body"===a){var l=M["".concat(d,"-").concat(a,"-emptyBlock")];if(e&&(m?(m="auto"===m?b:_tools.DomTools.isScale(m)?Math.floor(parseInt(m)/100*b):_xeUtils.default.toNumber(m),e.style.maxHeight="".concat(f?m-C-(y?0:U):m-C,"px")):e.style.height=0<F?"".concat(f?(0<F?F-C-S:k)-(y?0:U):F-C-S,"px"):""),x){var n="right"===f,s=L["".concat(f,"List")];e.style.top="".concat(C,"px"),x.style.height="".concat((0<F?F-C-S:k)+C+S-U*(y?2:1),"px"),x.style.width="".concat(s.reduce(function(e,t){return e+t.renderWidth},n?$:0)-(!0===T?1:0),"px")}var c=D;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=D;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&&(x&&(e.style.top="".concat(0<F?F-S:k+C,"px")),e.style.marginTop="".concat(-U-1,"px")),t&&(t.style.width=h?"".concat(h+$,"px"):"")}var u=M["".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)?_:o:_xeUtils.default.isUndefined(r)||_xeUtils.default.isNull(r)?E:r)||(!0===i||"tooltip"===i)||"ellipsis"===i,n=M["".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(".plx-cell"),o=s.renderWidth;if(i){if(1<t)for(var r=g.getColumnIndex(s),l=1;l<t;l++){var n=g.getColumns(r+l);n&&(o+=n.renderWidth)}i.style.width="".concat(o-A*t,"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-Math.ceil(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.mouseConfig,l=this.mouseOpts,n=this.editStore,s=this.ctxMenuStore,a=this.editOpts,c=this.filterStore,h=this.getRowNode,u=n.actived,d=e.filterWrapper,f=e.validTip,p=t&&(l.range||l.checked);d&&(_tools.DomTools.getEventTargetNode(i,r,"plx-filter-wrapper").flag||_tools.DomTools.getEventTargetNode(i,d.$el).flag||this.preventEvent(i,"event.clearFilter",c.args,this.closeFilter)),u.row?!1!==a.autoClear&&(f&&_tools.DomTools.getEventTargetNode(i,f.$el).flag||(!this.lastCallTime||this.lastCallTime+50<Date.now())&&this.preventEvent(i,"event.clearActived",u.args,function(){var e;if("row"===a.mode){var t=_tools.DomTools.getEventTargetNode(i,r,"plx-body--row");e=!!t.flag&&h(t.targetElem).item!==h(u.args.cell.parentNode).item}else e=!_tools.DomTools.getEventTargetNode(i,r,"col--edit").flag;!(e=(e=e||_tools.DomTools.getEventTargetNode(i,r,"plx-header--row").flag)||_tools.DomTools.getEventTargetNode(i,r,"plx-footer--row").flag)&&_tools.DomTools.getEventTargetNode(i,r).flag||setTimeout(function(){return o.clearActived(i)})})):t&&(_tools.DomTools.getEventTargetNode(i,r).flag||(p&&(this.clearIndexChecked(),this.clearHeaderChecked(),this.clearChecked()),this.clearSelected())),s.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,x=8===p,g=9===p,v=13===p,w=27===p,m=32===p,b=37===p,T=38===p,R=39===p,C=40===p,_=46===p,y=65===p,E=67===p,S=86===p,k=88===p,D=113===p,U=F.ctrlKey,$=F.shiftKey,O=b||T||R||C,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.isEnter&&(d.row||f.row||a&&h&&u)){if(d.row||f.row)W.moveSelected(d.row?d.args:f.args,b,T,R,!0,F);else if(a&&h&&u){var A=u[c.children];if(A&&A.length){F.preventDefault();var L=A[0];e={$table:W,row:L},W.setTreeExpansion(u,!0).then(function(){return W.scrollToRow(L)}).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(D)d.row&&d.column&&(F.preventDefault(),W.handleActived(d.args,F));else if(O&&s.isArrow)d.row&&d.column?W.moveSelected(d.args,b,T,R,C,F):(T||C)&&h&&u&&W.moveCurrentRow(T,C,F);else if(g&&s.isTab)d.row||d.column?W.moveTabSelected(d.args,$,F):(f.row||f.column)&&W.moveTabSelected(f.args,$,F);else if(_||(a&&h&&u?x&&s.isArrow:x)){if(s.isDel&&(d.row||d.column))_tools.UtilTools.setCellValue(d.row,d.column,null),x&&W.handleActived(d.args,F);else if(x&&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&&U&&(y||k||E||S)?y?W.handleAllChecked(F):k||E?W.handleCopyed(k,F):W.handlePaste(F):s.isEdit&&!U&&(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.closeMenu(),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.editOpts,r=this.editStore,l=this.tooltipStore,n=r.actived,s=t.row,a=t.column;this.handleTargetEnterEvent(),i&&("row"===o.mode&&n.row===s||n.row===s&&n.column===a)||l.column===a&&l.row===s&&l.visible||this.handleTooltip(e,a,s)},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()},handleDefaultSelectionChecked:function(){var t=this.fullDataRowIdData,e=this.checkboxOpts,i=e.checkAll,o=e.checkRowKeys;if(i)this.setAllCheckboxRow(!0);else if(o){var r=[];o.forEach(function(e){t[e]&&r.push(t[e].row)}),this.setCheckboxRow(r,!0)}},setSelection:function(e,t){return this.setCheckboxRow(e,t)},setCheckboxRow: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){return _tools.UtilTools.warn("plx.error.delFunc",["isCheckedByRow","isCheckedByCheckboxRow"]),this.isCheckedByCheckboxRow(e)},isCheckedByCheckboxRow: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.afterFullData,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,x=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 g=f.items.filter(function(e){return _xeUtils.default.get(e,h)});p=g.filter(function(e){return-1<x.indexOf(e)}).length===x.length||!(!g.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 b=v.items.filter(function(e){return-1<l.indexOf(e)});w=b.filter(function(e){return-1<m.indexOf(e)}).length===m.length||!(!b.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.getCheckboxRecords(),reserves:this.getCheckboxReserveRecords(),checked:i,$table:this},t),e]))},toggleRowSelection:function(e){return this.toggleCheckboxRow(e)},toggleCheckboxRow:function(e){return this.handleToggleCheckRowEvent({row:e}),this.$nextTick()},setAllSelection:function(e){return this.setAllCheckboxRow(e)},setAllCheckboxRow:function(o){var i=this,t=this.afterFullData,e=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=[],f=e?[]:l.filter(function(e){return-1===t.indexOf(e)});if(!h){if(a){var p="".concat(e?"$":"","rowIndex"),x=function(e,t){var i;u&&!u((_defineProperty(i={row:e},p,t),_defineProperty(i,"$rowIndex",t),i))||_xeUtils.default.set(e,a,o)},g=function(e,t){var i;(!u||!u((_defineProperty(i={row:e},p,t),_defineProperty(i,"$rowIndex",t),i))&&-1<l.indexOf(e))&&_xeUtils.default.set(e,a,o)};e?_xeUtils.default.eachTree(t,o?x:g,r):t.forEach(o?x:g)}else e?o?_xeUtils.default.eachTree(t,function(e,t){u&&!u({row:e,$rowIndex:t})||d.push(e)},r):u&&_xeUtils.default.eachTree(t,function(e,t){!u({row:e,$rowIndex:t})&&-1<l.indexOf(e)&&d.push(e)},r):o?d=u?t.filter(function(e,t){return-1<l.indexOf(e)||u({row:e,rowIndex:t,$rowIndex:t})}):t.slice(0):u&&(d=t.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}):t.forEach(function(e){var t=_tools.UtilTools.getRowid(i,e);n[t]&&delete n[t]})),this.selection=f.concat(d)}this.treeIndeterminates=[],this.checkSelectionStatus()},checkSelectionStatus:function(){var e=this.afterFullData,i=this.selection,t=this.treeIndeterminates,o=this.checkboxOpts,r=o.checkField,l=o.checkStrictly,n=o.checkMethod;l||(r?(this.isAllSelected=e.length&&e.every(n?function(e,t){return!n({row:e,rowIndex:t,$rowIndex:t})||_xeUtils.default.get(e,r)}:function(e){return _xeUtils.default.get(e,r)}),this.isIndeterminate=!this.isAllSelected&&e.some(function(e){return _xeUtils.default.get(e,r)||-1<t.indexOf(e)})):(this.isAllSelected=e.length&&e.every(n?function(e,t){return!n({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<t.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(){return this.getCheckboxReserveRecords()},getCheckboxReserveRecords: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(){return this.clearCheckboxReserve()},clearCheckboxReserve:function(){return this.selectReserveRowMap={},this.$nextTick()},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.setAllCheckboxRow(t),_tools.UtilTools.emitEvent(this,"select-all",[{selection:this.getCheckboxRecords(),reserves:this.getCheckboxReserveRecords(),checked:t,$table:this},e])},toggleAllSelection:function(){return this.toggleAllCheckboxRow()},toggleAllCheckboxRow:function(){return this.triggerCheckAllEvent(null,!this.isAllSelected),this.$nextTick()},clearSelection:function(){return this.clearCheckboxRow()},clearCheckboxRow: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()},handleDefaultRadioChecked: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()},isCheckedByRadioRow:function(e){return this.selectRow===e},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.getCurrentRecord()},getCurrentRecord:function(){return this.currentRow},getRadioRow:function(){return this.getRadioRecord()},getRadioRecord: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(".plx-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,"plx-sort-wrapper").flag,a=_tools.DomTools.getEventTargetNode(e,l,"plx-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.editOpts,h=this.checkboxOpts,u=this.mouseConfig,d=this.mouseOpts,f=r.actived,p=t.row,x=t.column,g=u&&(d.range||d.checked);isTargetRadioOrCheckbox(e,x,"radio")||isTargetRadioOrCheckbox(e,x,"checkbox","checkbox")||isTargetRadioOrCheckbox(e,x,"selection","checkbox")||("row"!==n.trigger&&("expand"!==x.type||"cell"!==n.trigger)||_tools.DomTools.getEventTargetNode(e,i,"plx-table--expanded").flag||this.triggerRowExpandEvent(e,t),("row"===s.trigger||x.treeNode&&"cell"===s.trigger)&&this.triggerTreeExpandEvent(e,t),x.treeNode&&_tools.DomTools.getEventTargetNode(e,i,"plx-tree--btn-wrapper").flag||"expand"===x.type&&_tools.DomTools.getEventTargetNode(e,i,"plx-table--expanded").flag||(o&&("row"!==l.trigger&&(_tools.DomTools.getEventTargetNode(e,i,"plx-cell--checkbox").flag||_tools.DomTools.getEventTargetNode(e,i,"plx-cell--radio").flag)||this.triggerCurrentRowEvent(e,t)),"row"!==l.trigger&&("radio"!==x.type||"cell"!==l.trigger)||_tools.DomTools.getEventTargetNode(e,i,"plx-cell--radio").flag||this.triggerRadioRowEvent(e,t),"row"!==h.trigger&&("checkbox"!==x.type&&"selection"!==x.type||"cell"!==h.trigger)||_tools.DomTools.getEventTargetNode(e,t.cell,"plx-cell--checkbox").flag||this.handleToggleCheckRowEvent(t,e),g||a&&("manual"===c.trigger?f.args&&f.row===p&&x!==f.column&&this.handleChangeCell(e,t):f.args&&p===f.row&&x===f.column||("click"===c.trigger?this.handleChangeCell(e,t):"dblclick"===c.trigger&&"row"===c.mode&&f.row===p&&this.handleChangeCell(e,t)))),_tools.UtilTools.emitEvent(this,"cell-click",[t,e]))},triggerCellDBLClickEvent:function(e,t){var i=this,o=this.editStore,r=this.editConfig,l=this.editOpts,n=o.actived;r&&"dblclick"===l.trigger&&(n.args&&e.currentTarget===n.args.cell||("row"===l.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"===l.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;if(t&&i){var o=_xeUtils.default.find(this.visibleColumn,function(e){return e.property===t});o&&!o.order&&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)},getSortColumn:function(){return this.visibleColumn.find(function(e){return e.sortable&&e.order})},closeFilter:function(){return Object.assign(this.filterStore,{isAllSelected:!1,isIndeterminate:!1,options:[],visible:!1}),this.$nextTick()},isFilter:function(e){if(e){var t=this.getColumnByField(e);return t.filters&&t.filters.some(function(e){return e.checked})}return this.visibleColumn.some(function(e){return e.filters&&e.filters.some(function(e){return e.checked})})},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("plx.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("plx.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("plx.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.isCheckedByCheckboxRow(i)&&o.setCheckboxRow(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("plx.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(){return this.getTableScroll()},getTableScroll:function(){var e=this.$refs,t=this.scrollXLoad,i=this.scrollYLoad,o=e.tableBody.$el;return{scrollX:t,isX:t,scrollY:i,isY: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=i.length,f=0;f<d;f++)if(a<(h+=i[f].renderWidth)){c=f;break}if(e||o.visibleIndex!==c){var p=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(0,c-p))):(u=r+l<=c+s+n)&&(o.startIndex=Math.max(0,Math.min(i.length-l,c-p))),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 T=this;return this.$nextTick().then(function(){var e=T.vSize,t=T.scrollXLoad,i=T.scrollYLoad,o=T.scrollYStore,r=T.scrollXStore,l=T.visibleColumn,n=T.optimizeOpts,s=T.rowHeightMaps,a=n.scrollX,c=n.scrollY,h=T.$refs.tableBody,u=h?h.$el:null,d=T.$refs.tableHeader;if(u){if(t){var f=u.clientWidth,p=_xeUtils.default.toNumber(a.vSize);if(!a.vSize)for(var x=p=l.length,g=0,v=0;v<x;v++)if(f<(g+=l[v].renderWidth)){p=v+1;break}r.visibleSize=p,a.oSize||(r.offsetSize=p),a.rSize||(r.renderSize=p+4),T.updateScrollXData()}else T.updateScrollXSpace();if(i){var w;if(c.rHeight)w=c.rHeight;else{var m=u.querySelector("tbody>tr");!m&&d&&(m=d.$el.querySelector("thead>tr")),m&&(w=m.clientHeight)}w=w||s[e||"default"];var b=_xeUtils.default.toNumber(c.vSize||Math.ceil(u.clientHeight/w));o.visibleSize=b,o.rowHeight=w,c.oSize||(o.offsetSize=b),c.rSize||(o.renderSize=browse.edge?10*b:isWebkit?b+2:6*b),T.updateScrollYData()}else T.updateScrollYSpace()}T.$nextTick(T.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(".plx-table--header"):null,u=a.$el.querySelector(".plx-table--body"),d=c?c.$el.querySelector(".plx-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="setFilter,filter,clearFilter,closeMenu,getMouseSelecteds,getMouseCheckeds,clearCopyed,clearChecked,clearHeaderChecked,clearIndexChecked,clearSelected,insert,insertAt,remove,removeSelecteds,revert,revertData,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearActived,getActiveRecord,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;