vxe-table-select-area
Version:
一个基于 vxe-table 的可区域选中复制、粘贴的组件
1 lines • 26.2 kB
JavaScript
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_vXETable=_interopRequireDefault(require("../../v-x-e-table")),_body=_interopRequireDefault(require("./body")),_header=_interopRequireDefault(require("../../header")),_size=_interopRequireDefault(require("../../mixins/size")),_utils=require("../../tools/utils"),_resize=require("../../tools/resize"),_event=require("../../tools/event"),_vn=require("../../tools/vn"),_methods=_interopRequireDefault(require("./methods")),_log=require("../../tools/log"),_index=_interopRequireDefault(require("../../loading/index")),_index2=_interopRequireDefault(require("../../select-area-editor/index")),_constant=require("../../select-area/common/constant"),_hooksManager=_interopRequireDefault(require("../../select-area/utils/hooks-manager"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}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)}function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(o),!0).forEach(function(e){_defineProperty(t,e,o[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))})}return t}function _defineProperty(e,t,o){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"===_typeof(e)?e:String(e)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0===o)return("string"===t?String:Number)(e);o=o.call(e,t||"default");if("object"!==_typeof(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}function renderFixed(e,t,o){var n=t._e,i=t.tableData,r=t.tableColumn,l=t.tableGroupColumn,s=t.vSize,a=t.showHeader,u=t.showFooter,c=t.columnStore,t=t.footerTableData,c=c["".concat(o,"List")];return e("div",{class:"vxe-table--fixed-".concat(o,"-wrapper"),ref:"".concat(o,"Container")},[a?e(_header.default,{props:{fixedType:o,tableData:i,tableColumn:r,tableGroupColumn:l,size:s,fixedColumn:c},ref:"".concat(o,"Header")}):n(),e("vxe-table-body",{props:{fixedType:o,tableData:i,tableColumn:r,fixedColumn:c,size:s},ref:"".concat(o,"Body")}),u?e("vxe-table-footer",{props:{footerTableData:t,tableColumn:r,fixedColumn:c,fixedType:o,size:s},ref:"".concat(o,"Footer")}):n()])}function renderEmptyContenet(e,t){var o=t.$scopedSlots,n=t.emptyOpts,i={$table:t};return o.empty?o.empty.call(t,i,e):(o=(o=n.name?_vXETable.default.renderer.get(n.name):null)?o.renderEmpty:null)?(0,_vn.getSlotVNs)(o.call(t,e,n,i)):(0,_utils.getFuncText)(t.emptyText)||_conf.default.i18n("vxe.table.emptyText")}function handleUupdateResize(e){var t=e.$el;t&&t.clientWidth&&t.clientHeight&&e.recalculate()}var _default2={name:"VxeTable",mixins:[_size.default],props:{id:String,data:Array,height:[Number,String],maxHeight:[Number,String],resizable:{type:Boolean,default:function(){return _conf.default.table.resizable}},stripe:{type:Boolean,default:function(){return _conf.default.table.stripe}},border:{type:[Boolean,String],default:function(){return _conf.default.table.border}},round:{type:Boolean,default:function(){return _conf.default.table.round}},size:{type:String,default:function(){return _conf.default.table.size||_conf.default.size}},fit:{type:Boolean,default:function(){return _conf.default.table.fit}},loading:Boolean,align:{type:String,default:function(){return _conf.default.table.align}},headerAlign:{type:String,default:function(){return _conf.default.table.headerAlign}},footerAlign:{type:String,default:function(){return _conf.default.table.footerAlign}},showHeader:{type:Boolean,default:function(){return _conf.default.table.showHeader}},highlightCurrentRow:{type:Boolean,default:function(){return _conf.default.table.highlightCurrentRow}},highlightHoverRow:{type:Boolean,default:function(){return _conf.default.table.highlightHoverRow}},highlightCurrentColumn:{type:Boolean,default:function(){return _conf.default.table.highlightCurrentColumn}},highlightHoverColumn:{type:Boolean,default:function(){return _conf.default.table.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],cellStyle:[Object,Function],headerCellStyle:[Object,Function],footerCellStyle:[Object,Function],rowStyle:[Object,Function],headerRowStyle:[Object,Function],footerRowStyle:[Object,Function],mergeCells:Array,mergeFooterItems:Array,spanMethod:Function,footerSpanMethod:Function,showOverflow:{type:[Boolean,String],default:function(){return _conf.default.table.showOverflow}},showHeaderOverflow:{type:[Boolean,String],default:function(){return _conf.default.table.showHeaderOverflow}},showFooterOverflow:{type:[Boolean,String],default:function(){return _conf.default.table.showFooterOverflow}},columnKey:Boolean,rowKey:Boolean,rowId:{type:String,default:function(){return _conf.default.table.rowId}},zIndex:Number,emptyText:{type:String,default:function(){return _conf.default.table.emptyText}},keepSource:{type:Boolean,default:function(){return _conf.default.table.keepSource}},autoResize:{type:Boolean,default:function(){return _conf.default.table.autoResize}},syncResize:[Boolean,String,Number],resizeConfig:Object,columnConfig:Object,rowConfig:Object,resizableConfig:Object,seqConfig:Object,sortConfig:Object,filterConfig:Object,radioConfig:Object,checkboxConfig:Object,tooltipConfig:Object,exportConfig:[Boolean,Object],importConfig:[Boolean,Object],printConfig:Object,expandConfig:Object,treeConfig:[Boolean,Object],menuConfig:[Boolean,Object],contextMenu:[Boolean,Object],mouseConfig:Object,areaConfig:Object,keyboardConfig:Object,clipboardOption:Object,cellAutofillOption:Object,clipConfig:Object,fnrConfig:Object,editConfig:[Boolean,Object],validConfig:Object,editRules:Object,loadingConfig:Object,emptyRender:[Boolean,Object],customConfig:[Boolean,Object],scrollX:Object,scrollY:Object,animat:{type:Boolean,default:function(){return _conf.default.table.animat}},delayHover:{type:Number,default:function(){return _conf.default.table.delayHover}},params:Object},components:{VxeTableBody:_body.default},provide:function(){return{$xetable:this,xecolgroup:null}},inject:{$xegrid:{default:null}},data:function(){return{tId:"".concat(_xeUtils.default.uniqueId()),staticColumns:[],tableGroupColumn:[],tableColumn:[],tableData:[],scrollXLoad:!1,scrollYLoad:!1,overflowY:!0,overflowX:!1,scrollbarWidth:0,scrollbarHeight:0,rowHeight:0,parentHeight:0,isGroup:!1,isAllOverflow:!1,isAllSelected:!1,isIndeterminate:!1,selection:[],currentRow:null,currentColumn:null,selectRow:null,footerTableData:[],expandColumn:null,hasFixedColumn:!1,treeNodeColumn:null,rowExpandeds:[],expandLazyLoadeds:[],treeExpandeds:[],treeLazyLoadeds:[],treeIndeterminates:[],mergeList:[],mergeFooterList:[],initStore:{filter:!1,import:!1,export:!1},filterStore:{isAllSelected:!1,isIndeterminate:!1,style:null,options:[],column:null,multiple:!1,visible:!1,maxHeight:null},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:[]},selected:{row:null,column:null},copyed:{cut:!1,rows:[],columns:[]},actived:{row:null,column:null},insertList:[],insertMaps:{},removeList:[],removeMaps:{}},tooltipStore:{row:null,column:null,visible:!1,currOpts:null},validStore:{visible:!1,row:null,column:null,content:"",rule:null,isArrow:!1},importStore:{inited:!1,file:null,type:"",modeList:[],typeList:[],filename:"",visible:!1},importParams:{mode:"",types:null,message:!0},exportStore:{inited:!1,name:"",modeList:[],typeList:[],columns:[],isPrint:!1,hasFooter:!1,hasTree:!1,hasMerge:!1,hasColgroup:!1,visible:!1},exportParams:{filename:"",sheetName:"",mode:"",type:"",isColgroup:!1,isMerge:!1,isAllExpand:!1,useStyle:!1,original:!1,message:!0,isHeader:!1,isFooter:!1},parentRendered:!1}},computed:{validOpts:function(){return Object.assign({message:"default"},_conf.default.table.validConfig,this.validConfig)},sXOpts:function(){return Object.assign({},_conf.default.table.scrollX,this.scrollX)},sYOpts:function(){return Object.assign({},_conf.default.table.scrollY,this.scrollY)},rowHeightMaps:function(){return{default:48,medium:44,small:40,mini:36}},columnOpts:function(){return Object.assign({},_conf.default.table.columnConfig,this.columnConfig)},rowOpts:function(){return Object.assign({},_conf.default.table.rowConfig,this.rowConfig)},resizeOpts:function(){return Object.assign({},_conf.default.table.resizeConfig,this.resizeConfig)},resizableOpts:function(){return Object.assign({},_conf.default.table.resizableConfig,this.resizableConfig)},seqOpts:function(){return Object.assign({startIndex:0},_conf.default.table.seqConfig,this.seqConfig)},radioOpts:function(){return Object.assign({},_conf.default.table.radioConfig,this.radioConfig)},checkboxOpts:function(){return Object.assign({},_conf.default.table.checkboxConfig,this.checkboxConfig)},tooltipOpts:function(){return Object.assign({},_conf.default.tooltip,_conf.default.table.tooltipConfig,this.tooltipConfig)},tipConfig:function(){return _objectSpread(_objectSpread({},this.tooltipOpts),this.tooltipStore.currOpts)},validTipOpts:function(){return Object.assign({isArrow:!1},this.tooltipOpts)},editOpts:function(){return Object.assign({},_conf.default.table.editConfig,this.editConfig)},sortOpts:function(){return Object.assign({orders:["asc","desc",null]},_conf.default.table.sortConfig,this.sortConfig)},filterOpts:function(){return Object.assign({},_conf.default.table.filterConfig,this.filterConfig)},mouseOpts:function(){return Object.assign({},_conf.default.table.mouseConfig,this.mouseConfig)},areaOpts:function(){return Object.assign({},_conf.default.table.areaConfig,this.areaConfig)},keyboardOpts:function(){return Object.assign({},_conf.default.table.keyboardConfig,this.keyboardConfig)},clipOpts:function(){return Object.assign({},_conf.default.table.clipConfig,this.clipConfig)},fnrOpts:function(){return Object.assign({},_conf.default.table.fnrConfig,this.fnrConfig)},hasTip:function(){return _vXETable.default._tooltip},headerCtxMenu:function(){var e=this.ctxMenuOpts.header;return e&&e.options?e.options:[]},bodyCtxMenu:function(){var e=this.ctxMenuOpts.body;return e&&e.options?e.options:[]},footerCtxMenu:function(){var e=this.ctxMenuOpts.footer;return e&&e.options?e.options:[]},isCtxMenu:function(){return!(!this.contextMenu&&!this.menuConfig||!(0,_utils.isEnableConf)(this.ctxMenuOpts)||!(this.headerCtxMenu.length||this.bodyCtxMenu.length||this.footerCtxMenu.length))},ctxMenuOpts:function(){return Object.assign({},_conf.default.table.menuConfig,this.contextMenu,this.menuConfig)},ctxMenuList:function(){var t=[];return this.ctxMenuStore.list.forEach(function(e){e.forEach(function(e){t.push(e)})}),t},exportOpts:function(){return Object.assign({},_conf.default.table.exportConfig,this.exportConfig)},importOpts:function(){return Object.assign({},_conf.default.table.importConfig,this.importConfig)},printOpts:function(){return Object.assign({},_conf.default.table.printConfig,this.printConfig)},expandOpts:function(){return Object.assign({},_conf.default.table.expandConfig,this.expandConfig)},treeOpts:function(){return Object.assign({},_conf.default.table.treeConfig,this.treeConfig)},emptyOpts:function(){return Object.assign({},_conf.default.table.emptyRender,this.emptyRender)},loadingOpts:function(){return Object.assign({},_conf.default.table.loadingConfig,this.loadingConfig)},cellOffsetWidth:function(){return this.border?Math.max(2,Math.ceil(this.scrollbarWidth/this.tableColumn.length)):1},customOpts:function(){return Object.assign({},_conf.default.table.customConfig,this.customConfig)},tableBorder:function(){var e=this.border;return!0===e?"full":e||"default"},isAllCheckboxDisabled:function(){var e=this.tableFullData,t=this.tableData,o=(this.treeConfig,this.checkboxOpts),n=o.strict,i=o.checkMethod;return!!n&&(!t.length&&!e.length||!!i&&e.every(function(e){return!i({row:e})}))}},watch:{data:function(e){var t=this,o=this.inited,n=this.initStatus;this.loadTableData(e).then(function(){t.inited=!0,t.initStatus=!0,n||t.handleLoadDefaults(),o||t.handleInitDefaults(),t.tableFullColumn.find(function(e){return"checkbox"===e.type})&&300<t.tableFullData.length&&!t.checkboxOpts.checkField&&(0,_log.warnLog)("vxe.error.checkProp",["checkbox-config.checkField"]),(t.scrollXLoad||t.scrollYLoad)&&t.expandColumn&&(0,_log.warnLog)("vxe.error.scrollErrProp",["column.type=expand"]),t.recalculate()})},staticColumns:function(e){this.handleColumn(e)},tableColumn:function(){this.analyColumnWidth()},showHeader:function(){var e=this;this.$nextTick(function(){e.recalculate(!0).then(function(){return e.refreshScroll()})})},showFooter:function(){var e=this;this.$nextTick(function(){e.recalculate(!0).then(function(){return e.refreshScroll()})})},height:function(){var e=this;this.$nextTick(function(){return e.recalculate(!0)})},maxHeight:function(){var e=this;this.$nextTick(function(){return e.recalculate(!0)})},syncResize:function(e){var t=this;e&&(handleUupdateResize(this),this.$nextTick(function(){handleUupdateResize(t),setTimeout(function(){return handleUupdateResize(t)})}))},mergeCells:function(e){var t=this;this.clearMergeCells(),this.$nextTick(function(){return t.setMergeCells(e)})},mergeFooterItems:function(e){var t=this;this.clearMergeFooterItems(),this.$nextTick(function(){return t.setMergeFooterItems(e)})}},created:function(){var e=this,t=Object.assign(this,{tZindex:0,elemStore:{},scrollXStore:{},scrollYStore:{},tableWidth:0,tableHeight:0,headerHeight:0,footerHeight:0,lastScrollLeft:0,lastScrollTop:0,radioReserveRow:null,checkboxReserveRowMap:{},rowExpandedReserveRowMap:{},treeExpandedReserveRowMap:{},tableFullData:[],afterFullData:[],collectColumn:[],tableFullColumn:[],visibleColumn:[],fullAllDataRowMap:new Map,fullAllDataRowIdData:{},fullDataRowMap:new Map,fullDataRowIdData:{},fullColumnMap:new Map,fullColumnIdData:{},fullColumnFieldData:{}}),o=t.scrollXStore,n=t.sYOpts,i=t.scrollYStore,r=t.data,l=t.editOpts,s=t.treeOpts,a=t.treeConfig,u=t.showOverflow,t=t.rowOpts;"development"===process.env.NODE_ENV&&(this.rowId||t.keyField||!(this.checkboxOpts.reserve||this.checkboxOpts.checkRowKeys||this.radioOpts.reserve||this.radioOpts.checkRowKey||this.expandOpts.expandRowKeys||this.treeOpts.expandRowKeys)||(0,_log.warnLog)("vxe.error.reqProp",["row-config.keyField"]),this.editConfig&&l.showStatus&&!this.keepSource&&(0,_log.warnLog)("vxe.error.reqProp",["keep-source"]),!a||!s.line||(this.rowKey||t.useKey)&&u||(0,_log.warnLog)("vxe.error.reqProp",["row-config.useKey | show-overflow"]),this.showFooter&&!this.footerMethod&&(0,_log.warnLog)("vxe.error.reqProp",["footer-method"]),a&&this.stripe&&(0,_log.warnLog)("vxe.error.noTree",["stripe"]),this.tooltipOpts.enabled&&(0,_log.warnLog)("vxe.error.delProp",["tooltip-config.enabled","tooltip-config.showAll"]),l=this.exportConfig,s=this.exportOpts,t=this.importConfig,u=this.importOpts,t&&u.types&&!u.importMethod&&!_xeUtils.default.includeArrays(_vXETable.default.config.importTypes,u.types)&&(0,_log.warnLog)("vxe.error.errProp",["export-config.types=".concat(u.types.join(",")),u.types.filter(function(e){return _xeUtils.default.includes(_vXETable.default.config.importTypes,e)}).join(",")||_vXETable.default.config.importTypes.join(",")]),l)&&s.types&&!s.exportMethod&&!_xeUtils.default.includeArrays(_vXETable.default.config.exportTypes,s.types)&&(0,_log.warnLog)("vxe.error.errProp",["export-config.types=".concat(s.types.join(",")),s.types.filter(function(e){return _xeUtils.default.includes(_vXETable.default.config.exportTypes,e)}).join(",")||_vXETable.default.config.exportTypes.join(",")]),"development"===process.env.NODE_ENV&&(a=this.customOpts,!this.id&&this.customConfig&&(!0===a.storage||a.storage&&a.storage.resizable||a.storage&&a.storage.visible)&&(0,_log.errLog)("vxe.error.reqProp",["id"]),this.treeConfig&&this.checkboxOpts.range&&(0,_log.errLog)("vxe.error.noTree",["checkbox-config.range"]),this.rowOpts.height&&!this.showOverflow&&(0,_log.warnLog)("vxe.error.notProp",["table.show-overflow"]),this.handleUpdateCellAreas||(this.clipConfig&&(0,_log.warnLog)("vxe.error.notProp",["clip-config"]),this.fnrConfig&&(0,_log.warnLog)("vxe.error.notProp",["fnr-config"]),this.mouseOpts.area),this.mouseOpts.area&&this.mouseOpts.selected&&(0,_log.warnLog)("vxe.error.errConflicts",["mouse-config.area","mouse-config.selected"]),this.mouseOpts.area&&this.checkboxOpts.range&&(0,_log.warnLog)("vxe.error.errConflicts",["mouse-config.area","checkbox-config.range"]),this.treeConfig)&&this.mouseOpts.area&&(0,_log.errLog)("vxe.error.noTree",["mouse-config.area"]),"development"===process.env.NODE_ENV&&(this.contextMenu&&((0,_log.warnLog)("vxe.error.delProp",["context-menu","menu-config"]),_xeUtils.default.isObject(this.contextMenu)||(0,_log.warnLog)("vxe.error.errProp",["table.context-menu=".concat(this.contextMenu),"table.context-menu={}"])),this.menuConfig&&!_xeUtils.default.isObject(this.menuConfig)&&(0,_log.warnLog)("vxe.error.errProp",["table.menu-config=".concat(this.menuConfig),"table.menu-config={}"]),this.exportConfig&&!_xeUtils.default.isObject(this.exportConfig)&&(0,_log.warnLog)("vxe.error.errProp",["table.export-config=".concat(this.exportConfig),"table.export-config={}"]),this.importConfig&&!_xeUtils.default.isObject(this.importConfig)&&(0,_log.warnLog)("vxe.error.errProp",["table.import-config=".concat(this.importConfig),"table.import-config={}"]),this.printConfig&&!_xeUtils.default.isObject(this.printConfig)&&(0,_log.warnLog)("vxe.error.errProp",["table.print-config=".concat(this.printConfig),"table.print-config={}"]),this.treeConfig&&!_xeUtils.default.isObject(this.treeConfig)&&(0,_log.warnLog)("vxe.error.errProp",["table.tree-config=".concat(this.treeConfig),"table.tree-config={}"]),this.customConfig&&!_xeUtils.default.isObject(this.customConfig)&&(0,_log.warnLog)("vxe.error.errProp",["table.custom-config=".concat(this.customConfig),"table.custom-config={}"]),this.editConfig&&!_xeUtils.default.isObject(this.editConfig)&&(0,_log.warnLog)("vxe.error.errProp",["table.edit-config=".concat(this.editConfig),"table.edit-config={}"]),this.emptyRender)&&!_xeUtils.default.isObject(this.emptyRender)&&(0,_log.warnLog)("vxe.error.errProp",["table.empty-render=".concat(this.emptyRender),"table.empty-render={}"]),"development"===process.env.NODE_ENV&&(this.editConfig&&!this._insert&&(0,_log.errLog)("vxe.error.reqModule",["Edit"]),this.editRules&&!this._validate&&(0,_log.errLog)("vxe.error.reqModule",["Validator"]),(this.checkboxOpts.range||this.keyboardConfig||this.mouseConfig)&&!this.triggerCellMousedownEvent&&(0,_log.errLog)("vxe.error.reqModule",["Keyboard"]),this.printConfig||this.importConfig||this.exportConfig)&&!this._exportData&&(0,_log.errLog)("vxe.error.reqModule",["Export"]),Object.assign(i,{startIndex:0,endIndex:1,visibleSize:0,adaptive:!1!==n.adaptive}),Object.assign(o,{startIndex:0,endIndex:1,visibleSize:0}),this.loadTableData(r).then(function(){r&&r.length&&(e.inited=!0,e.initStatus=!0,e.handleLoadDefaults(),e.handleInitDefaults()),e.updateStyle()}),_event.GlobalEvent.on(this,"paste",this.handleGlobalPasteEvent),_event.GlobalEvent.on(this,"copy",this.handleGlobalCopyEvent),_event.GlobalEvent.on(this,"cut",this.handleGlobalCutEvent),_event.GlobalEvent.on(this,"mousedown",this.handleGlobalMousedownEvent),_event.GlobalEvent.on(this,"blur",this.handleGlobalBlurEvent),_event.GlobalEvent.on(this,"mousewheel",this.handleGlobalMousewheelEvent),_event.GlobalEvent.on(this,"keydown",this.handleGlobalKeydownEvent),_event.GlobalEvent.on(this,"resize",this.handleGlobalResizeEvent),_event.GlobalEvent.on(this,"contextmenu",this.handleGlobalContextmenuEvent),this.preventEvent(null,"created")},mounted:function(){var e,t=this;"development"===process.env.NODE_ENV&&(e=this.$listeners,!this.menuConfig&&(e["menu-click"]||e["cell-menu"]||e["header-cell-menu"]||e["footer-cell-menu"])&&(0,_log.warnLog)("vxe.error.reqProp",["menu-config"]),this.tooltipConfig||!e["cell-mouseenter"]&&!e["cell-mouseleave"]||(0,_log.warnLog)("vxe.error.reqProp",["tooltip-config"])),this.autoResize&&((e=(0,_resize.createResizeEvent)(this.resizeOpts.refreshDelay?_xeUtils.default.throttle(function(){t.recalculate(!0)},this.resizeOpts.refreshDelay,{leading:!0,trailing:!0}):function(){t.recalculate(!0)})).observe(this.$el),e.observe(this.getParentElem()),this.$resize=e),this.preventEvent(null,"mounted")},activated:function(){var e=this;this.recalculate().then(function(){return e.refreshScroll()}),this.preventEvent(null,"activated")},deactivated:function(){this.preventEvent(null,"deactivated")},beforeDestroy:function(){this.$resize&&this.$resize.disconnect(),this.closeFilter(),this.closeMenu(),this.preventEvent(null,"beforeDestroy")},destroyed:function(){_event.GlobalEvent.off(this,"paste"),_event.GlobalEvent.off(this,"copy"),_event.GlobalEvent.off(this,"cut"),_event.GlobalEvent.off(this,"mousedown"),_event.GlobalEvent.off(this,"blur"),_event.GlobalEvent.off(this,"mousewheel"),_event.GlobalEvent.off(this,"keydown"),_event.GlobalEvent.off(this,"resize"),_event.GlobalEvent.off(this,"contextmenu"),this.preventEvent(null,"destroyed")},render:function(e){var t=this,o=this._e,n=this.$scopedSlots,i=this.tId,r=this.tableData,l=this.tableColumn,s=this.tableGroupColumn,a=this.isGroup,u=this.loading,c=this.stripe,f=this.showHeader,d=this.height,h=this.tableBorder,p=this.treeOpts,g=this.treeConfig,b=this.mouseConfig,m=this.mouseOpts,v=this.vSize,x=this.validOpts,_=this.showFooter,C=this.overflowX,O=this.overflowY,y=this.scrollXLoad,w=this.scrollYLoad,j=this.scrollbarHeight,S=this.highlightCell,E=this.highlightHoverRow,M=this.highlightHoverColumn,F=this.editConfig,q=this.validTipOpts,T=this.initStore,L=this.columnStore,B=this.filterStore,D=this.ctxMenuStore,I=this.ctxMenuOpts,G=this.footerTableData,R=this.hasTip,N=this.columnOpts,H=this.rowOpts,P=this.loadingOpts,z=L.leftList,L=L.rightList,k={ref:this.editInputRef,props:{hooks:new _hooksManager.default,parentRendered:!0,inputStartValue:this.editorInputStartValue,tableData:this.tableData,cellSelectionData:this.cellSelectionData,colgroups:this.colgroups,editingCell:this.editingCell,isCellEditing:this.isCellEditing,allRowKeys:this.colgroups,hasXScrollBar:this.hasXScrollBar,hasYScrollBar:this.hasYScrollBar,hasRightFixedColumn:this.hasRightFixedColumn,scrollBarWidth:this.getScrollBarWidth()},on:(_defineProperty(k={},_constant.EMIT_EVENTS.EDIT_INPUT_VALUE_CHANGE,function(e){t.updateEditingCellValue(e)}),_defineProperty(k,_constant.EMIT_EVENTS.EDIT_INPUT_COPY,function(e){t.editorCopy(e)}),_defineProperty(k,_constant.EMIT_EVENTS.EDIT_INPUT_PASTE,function(e){t.editorPaste(e)}),_defineProperty(k,_constant.EMIT_EVENTS.EDIT_INPUT_CUT,function(e){t.editorCut(e)}),k)};return e("div",{class:["vxe-table","vxe-table--render-default","tid_".concat(i),v?"size--".concat(v):"","border--".concat(h),{"vxe-editable":!!F,"cell--highlight":S,"cell--selected":b&&m.selected,"cell--area":b&&m.area,"row--highlight":H.isHover||E,"column--highlight":N.isHover||M,"is--header":f,"is--footer":_,"is--group":a,"is--tree-line":g&&p.line,"is--fixed-left":z.length,"is--fixed-right":L.length,"is--animat":!!this.animat,"is--round":this.round,"is--stripe":!g&&c,"is--loading":u,"is--empty":!u&&!r.length,"is--scroll-y":O,"is--scroll-x":C,"is--virtual-x":y,"is--virtual-y":w}],on:{keydown:this.keydownEvent}},[e("div",{class:"vxe-table-slots",ref:"hideColumn"},this.$slots.default),e("div",{class:"vxe-table--render-wrapper"},[e("div",{class:"vxe-table--main-wrapper"},[f?e(_header.default,{ref:"tableHeader",props:{tableData:r,tableColumn:l,tableGroupColumn:s,size:v}}):o(),e("vxe-table-body",{ref:"tableBody",props:{tableData:r,tableColumn:l,size:v}}),e(_index2.default,_objectSpread({},k)),_?e("vxe-table-footer",{ref:"tableFooter",props:{footerTableData:G,tableColumn:l,size:v}}):o()]),e("div",{class:"vxe-table--fixed-wrapper"},[z&&z.length&&C?renderFixed(e,this,"left"):o(),L&&L.length&&C?renderFixed(e,this,"right"):o()])]),e("div",{ref:"emptyPlaceholder",class:"vxe-table--empty-placeholder"},[e("div",{class:"vxe-table--empty-content"},renderEmptyContenet(e,this))]),e("div",{class:"vxe-table--border-line"}),e("div",{class:"vxe-table--resizable-bar",style:C?{"padding-bottom":"".concat(j,"px")}:null,ref:"resizeBar"}),e(_index.default,{class:"vxe-table--loading",props:{value:u,icon:P.icon,text:P.text}},this.callSlot(n.loading,{})),T.filter?e("vxe-table-filter",{ref:"filterWrapper",props:{filterStore:B}}):o(),T.import&&this.importConfig?e("vxe-import-panel",{props:{defaultOptions:this.importParams,storeData:this.importStore}}):o(),T.export&&(this.exportConfig||this.printConfig)?e("vxe-export-panel",{props:{defaultOptions:this.exportParams,storeData:this.exportStore}}):o(),D.visible&&this.isCtxMenu?e("vxe-table-context-menu",{ref:"ctxWrapper",props:{ctxMenuStore:D,ctxMenuOpts:I}}):o(),R?e("vxe-tooltip",{ref:"commTip",props:{isArrow:!1,enterable:!1}}):o(),R?e("vxe-tooltip",{ref:"tooltip",props:this.tipConfig}):o(),R&&this.editRules&&x.showMessage&&("default"===x.message?!d:"tooltip"===x.message)?e("vxe-tooltip",{ref:"validTip",class:"vxe-table--valid-error",props:"tooltip"===x.message||1===r.length?q:null}):o()])},methods:_methods.default};exports.default=_default2;