vxe-table 3.8.4-beta.0 → 3.8.5-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/README.md +4 -3
  2. package/lib/custom/src/panel.js +18 -3
  3. package/lib/custom/src/panel.min.js +1 -1
  4. package/lib/custom/style/style.css +15 -9
  5. package/lib/custom/style/style.min.css +1 -1
  6. package/lib/edit/src/mixin.js +97 -88
  7. package/lib/edit/src/mixin.min.js +1 -1
  8. package/lib/icon/style/style.css +1 -1
  9. package/lib/icon/style/style.min.css +1 -1
  10. package/lib/index.css +1 -1
  11. package/lib/index.umd.js +156 -116
  12. package/lib/index.umd.min.js +1 -1
  13. package/lib/locale/lang/en-US.js +2 -1
  14. package/lib/locale/lang/en-US.min.js +1 -1
  15. package/lib/locale/lang/en-US.umd.js +2 -1
  16. package/lib/locale/lang/es-ES.js +2 -1
  17. package/lib/locale/lang/es-ES.min.js +1 -1
  18. package/lib/locale/lang/es-ES.umd.js +2 -1
  19. package/lib/locale/lang/ja-JP.js +2 -1
  20. package/lib/locale/lang/ja-JP.min.js +1 -1
  21. package/lib/locale/lang/ja-JP.umd.js +2 -1
  22. package/lib/locale/lang/pt-BR.js +2 -1
  23. package/lib/locale/lang/pt-BR.min.js +1 -1
  24. package/lib/locale/lang/pt-BR.umd.js +2 -1
  25. package/lib/locale/lang/zh-CN.js +2 -1
  26. package/lib/locale/lang/zh-CN.min.js +1 -1
  27. package/lib/locale/lang/zh-CN.umd.js +2 -1
  28. package/lib/locale/lang/zh-HK.min.js +1 -1
  29. package/lib/locale/lang/zh-HK.umd.js +2 -1
  30. package/lib/locale/lang/zh-MO.min.js +1 -1
  31. package/lib/locale/lang/zh-MO.umd.js +2 -1
  32. package/lib/locale/lang/zh-TC.js +2 -1
  33. package/lib/locale/lang/zh-TC.min.js +1 -1
  34. package/lib/locale/lang/zh-TC.umd.js +2 -1
  35. package/lib/locale/lang/zh-TW.min.js +1 -1
  36. package/lib/locale/lang/zh-TW.umd.js +2 -1
  37. package/lib/menu/src/mixin.js +5 -5
  38. package/lib/menu/src/mixin.min.js +1 -1
  39. package/lib/style.css +1 -1
  40. package/lib/style.min.css +1 -1
  41. package/lib/table/src/methods.js +32 -13
  42. package/lib/table/src/methods.min.js +1 -1
  43. package/lib/table/src/table.js +14 -9
  44. package/lib/table/src/table.min.js +1 -1
  45. package/lib/table/src/util.js +2 -2
  46. package/lib/table/src/util.min.js +1 -1
  47. package/lib/table/style/style.css +0 -6
  48. package/lib/table/style/style.min.css +1 -1
  49. package/lib/tools/log.js +1 -1
  50. package/lib/tools/log.min.js +1 -1
  51. package/lib/v-x-e-table/index.js +1 -1
  52. package/lib/v-x-e-table/index.min.js +1 -1
  53. package/lib/v-x-e-table/src/interceptor.js +1 -1
  54. package/lib/v-x-e-table/src/interceptor.min.js +1 -1
  55. package/lib/vxe-table/style/style.css +0 -6
  56. package/lib/vxe-table/style/style.min.css +1 -1
  57. package/lib/vxe-table-custom-module/style/style.css +15 -9
  58. package/lib/vxe-table-custom-module/style/style.min.css +1 -1
  59. package/package.json +2 -2
  60. package/packages/custom/src/panel.js +22 -5
  61. package/packages/edit/src/mixin.js +87 -80
  62. package/packages/locale/lang/en-US.js +2 -1
  63. package/packages/locale/lang/es-ES.js +2 -1
  64. package/packages/locale/lang/ja-JP.js +2 -1
  65. package/packages/locale/lang/pt-BR.js +2 -1
  66. package/packages/locale/lang/zh-CN.js +2 -1
  67. package/packages/locale/lang/zh-TC.js +2 -1
  68. package/packages/menu/src/mixin.js +5 -5
  69. package/packages/table/src/methods.js +32 -15
  70. package/packages/table/src/table.js +14 -9
  71. package/packages/table/src/util.js +2 -2
  72. package/packages/v-x-e-table/src/interceptor.js +1 -1
  73. package/styles/custom.scss +14 -2
  74. package/styles/table.scss +14 -14
  75. package/types/checkbox-group.d.ts +1 -1
  76. package/types/colgroup.d.ts +2 -4
  77. package/types/column.d.ts +7 -9
  78. package/types/table.d.ts +3 -4
  79. package/types/v-x-e-table/renderer.d.ts +1 -2
  80. /package/lib/icon/style/{iconfont.1714444985876.ttf → iconfont.1714960961818.ttf} +0 -0
  81. /package/lib/icon/style/{iconfont.1714444985876.woff → iconfont.1714960961818.woff} +0 -0
  82. /package/lib/icon/style/{iconfont.1714444985876.woff2 → iconfont.1714960961818.woff2} +0 -0
  83. /package/lib/{iconfont.1714444985876.ttf → iconfont.1714960961818.ttf} +0 -0
  84. /package/lib/{iconfont.1714444985876.woff → iconfont.1714960961818.woff} +0 -0
  85. /package/lib/{iconfont.1714444985876.woff2 → iconfont.1714960961818.woff2} +0 -0
package/README.md CHANGED
@@ -70,9 +70,10 @@
70
70
  * [x] 渲染器
71
71
  * [x] 虚拟滚动
72
72
  * [x] 虚拟合并
73
- * [x] (插件) 单元格区域选取
74
- * [x] (插件) 单元格复制/粘贴
75
- * [x] (插件) 单元格查找和替换
73
+ * [x] ([企业版](https://vxetable.cn/pluginDocs/)) 单元格区域选取
74
+ * [x] ([企业版](https://vxetable.cn/pluginDocs/)) 单元格复制/粘贴
75
+ * [x] ([企业版](https://vxetable.cn/pluginDocs/)) 单元格查找和替换
76
+ * [x] ([企业版](https://vxetable.cn/pluginDocs/)) 全键盘操作
76
77
 
77
78
  ## 安装
78
79
 
@@ -161,6 +161,7 @@ function renderPopupPanel(h, _vm) {
161
161
  customStore = _vm.customStore;
162
162
  var customOpts = $xetable.customOpts,
163
163
  customColumnList = $xetable.customColumnList,
164
+ columnOpts = $xetable.columnOpts,
164
165
  isMaxFixedColumn = $xetable.isMaxFixedColumn;
165
166
  var checkMethod = customOpts.checkMethod,
166
167
  visibleMethod = customOpts.visibleMethod;
@@ -262,7 +263,7 @@ function renderPopupPanel(h, _vm) {
262
263
  title: _conf.default.i18n('vxe.custom.cstmTitle'),
263
264
  className: 'vxe-table-custom-popup-wrapper vxe-table--ignore-clear',
264
265
  width: '40vw',
265
- minWidth: 500,
266
+ minWidth: 520,
266
267
  height: '50vh',
267
268
  minHeight: 300,
268
269
  mask: true,
@@ -286,7 +287,7 @@ function renderPopupPanel(h, _vm) {
286
287
  class: 'vxe-table-custom-popup--table-wrapper'
287
288
  }, [h('table', {}, [h('colgroup', {}, [h('col', {
288
289
  style: {
289
- width: '60px'
290
+ width: '80px'
290
291
  }
291
292
  }), h('col'), h('col', {
292
293
  style: {
@@ -296,7 +297,21 @@ function renderPopupPanel(h, _vm) {
296
297
  style: {
297
298
  width: '200px'
298
299
  }
299
- })]), h('thead', {}, [h('tr', {}, [h('th', {}, _conf.default.i18n('vxe.custom.setting.colSort')), h('th', {}, _conf.default.i18n('vxe.custom.setting.colTitle')), h('th', {}, _conf.default.i18n('vxe.custom.setting.colVisible')), h('th', {}, _conf.default.i18n('vxe.custom.setting.colFixed'))])]), h('transition-group', {
300
+ })]), h('thead', {}, [h('tr', {}, [h('th', {}, [h('span', {
301
+ class: 'vxe-table-custom-popup--table-sort-help-title'
302
+ }, _conf.default.i18n('vxe.custom.setting.colSort')), h('vxe-tooltip', {
303
+ props: {
304
+ enterable: true,
305
+ content: '点击并拖动图标可以调整列的排序'
306
+ },
307
+ scopedSlots: {
308
+ default: function _default() {
309
+ return h('i', {
310
+ class: 'vxe-table-custom-popup--table-sort-help-icon vxe-icon-question-circle-fill'
311
+ });
312
+ }
313
+ }
314
+ })]), h('th', {}, _conf.default.i18n('vxe.custom.setting.colTitle')), h('th', {}, _conf.default.i18n('vxe.custom.setting.colVisible')), h('th', {}, _conf.default.i18n('vxe.custom.setting.colFixed', [columnOpts.maxFixedSize || 0]))])]), h('transition-group', {
300
315
  class: 'vxe-table-custom--body',
301
316
  props: {
302
317
  tag: 'tbody',
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _utils=_interopRequireDefault(require("../../tools/utils")),_dom=_interopRequireDefault(require("../../tools/dom")),_conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var formatText=_utils.default.formatText,addClass=_dom.default.addClass,removeClass=_dom.default.removeClass;function updateDropHint(e,t){var o,e=e.$refs,i=e.dragHintElemRef,e=e.bodyElemRef;e&&i&&(o=(e=e.parentNode).getBoundingClientRect(),i.style.display="block",i.style.top="".concat(Math.min(e.clientHeight-e.scrollTop-i.clientHeight,t.clientY-o.y),"px"),i.style.left="".concat(Math.min(e.clientWidth-e.scrollLeft-i.clientWidth-16,t.clientX-o.x),"px"))}function renderSimplePanel(u,d){var e=d.$xetable,t=d.customStore,f=e.customOpts,o=e.customColumnList,m=e.isMaxFixedColumn,e=t.maxHeight,v=f.checkMethod,p=f.visibleMethod,i=f.trigger,x=[],n={},i=("hover"===i&&(n.mouseenter=d.handleWrapperMouseenterEvent,n.mouseleave=d.handleWrapperMouseleaveEvent),_xeUtils.default.eachTree(o,function(e,t,o,i,n){var l,s,a,c,r;p&&!p({column:e})||(l=e.visible,s=e.halfVisible,a=e.children&&e.children.length,c=formatText(e.getTitle(),1),r=!!v&&!v({column:e}),x.push(u("li",{key:e.id,class:["vxe-table-custom--option","level--".concat(e.level),{"is--group":a}]},[u("div",{title:c,class:["vxe-table-custom--checkbox-option",{"is--checked":l,"is--indeterminate":s,"is--disabled":r}],on:{click:function(){r||d.changeCheckboxOption(e)}}},[u("span",{class:["vxe-checkbox--icon",s?_conf.default.icon.TABLE_CHECKBOX_INDETERMINATE:l?_conf.default.icon.TABLE_CHECKBOX_CHECKED:_conf.default.icon.TABLE_CHECKBOX_UNCHECKED]}),u("span",{class:"vxe-checkbox--label"},c)]),!n&&f.allowFixed?u("div",{class:"vxe-table-custom--fixed-option"},[u("span",{class:["vxe-table-custom--fixed-left-option","left"===e.fixed?_conf.default.icon.TOOLBAR_TOOLS_FIXED_LEFT_ACTIVED:_conf.default.icon.TOOLBAR_TOOLS_FIXED_LEFT,{"is--checked":"left"===e.fixed,"is--disabled":m&&!e.fixed}],attrs:{title:_conf.default.i18n("left"===e.fixed?"vxe.toolbar.cancelfixed":"vxe.toolbar.fixedLeft")},on:{click:function(){d.changeFixedOption(e,"left")}}}),u("span",{class:["vxe-table-custom--fixed-right-option","right"===e.fixed?_conf.default.icon.TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVED:_conf.default.icon.TOOLBAR_TOOLS_FIXED_RIGHT,{"is--checked":"right"===e.fixed,"is--disabled":m&&!e.fixed}],attrs:{title:_conf.default.i18n("right"===e.fixed?"vxe.toolbar.cancelfixed":"vxe.toolbar.fixedRight")},on:{click:function(){d.changeFixedOption(e,"right")}}})]):null])))}),t.isAll),o=t.isIndeterminate;return u("div",{key:"simple",class:["vxe-table-custom-wrapper",{"is--active":t.visible}]},[u("ul",{class:"vxe-table-custom--header"},[u("li",{class:"vxe-table-custom--option"},[u("div",{class:["vxe-table-custom--checkbox-option",{"is--checked":i,"is--indeterminate":o}],attrs:{title:_conf.default.i18n("vxe.table.allTitle")},on:{click:d.allCustomEvent}},[u("span",{class:["vxe-checkbox--icon",o?_conf.default.icon.TABLE_CHECKBOX_INDETERMINATE:i?_conf.default.icon.TABLE_CHECKBOX_CHECKED:_conf.default.icon.TABLE_CHECKBOX_UNCHECKED]}),u("span",{class:"vxe-checkbox--label"},_conf.default.i18n("vxe.toolbar.customAll"))])])]),u("ul",{class:"vxe-table-custom--body",style:e?{maxHeight:"".concat(e,"px")}:{},on:n},x),f.showFooter?u("div",{class:"vxe-table-custom--footer"},[u("button",{class:"btn--reset",on:{click:d.resetCustomEvent}},f.resetButtonText||_conf.default.i18n("vxe.toolbar.customRestore")),u("button",{class:"btn--confirm",on:{click:d.confirmCustomEvent}},f.confirmButtonText||_conf.default.i18n("vxe.toolbar.customConfirm"))]):null])}function renderPopupPanel(u,d){var e=d.$xetable,t=d.customStore,f=e.customOpts,o=e.customColumnList,m=e.isMaxFixedColumn,v=f.checkMethod,p=f.visibleMethod,x=[];return _xeUtils.default.eachTree(o,function(t,e,o,i,n){var l,s,a,c,r;p&&!p({column:t})||(l=t.visible,s=t.halfVisible,a=formatText(t.getTitle(),1),c=t.children&&t.children.length,r=!!v&&!v({column:t}),x.push(u("tr",{key:t.id,class:["vxe-table-custom-popup--row level--".concat(t.level),{"is--group":c}],attrs:{colid:t.id},on:{dragstart:d.sortDragstartEvent,dragend:d.sortDragendEvent,dragover:d.sortDragoverEvent}},[u("td",{class:"vxe-table-custom-popup--column-item col--sort"},[1===t.level?u("span",{class:"vxe-table-custom-popup--column-sort-btn",on:{mousedown:d.sortMousedownEvent,mouseup:d.sortMouseupEvent}},[u("i",{class:"vxe-icon-sort"})]):null]),u("td",{class:"vxe-table-custom-popup--column-item col--name"},[u("div",{class:"vxe-table-custom-popup--name",attrs:{title:a}},a)]),u("td",{class:"vxe-table-custom-popup--column-item col--visible"},[u("div",{class:["vxe-table-custom--checkbox-option",{"is--checked":l,"is--indeterminate":s,"is--disabled":r}],on:{click:function(){r||d.changeCheckboxOption(t)}}},[u("span",{class:["vxe-checkbox--icon",s?_conf.default.icon.TABLE_CHECKBOX_INDETERMINATE:l?_conf.default.icon.TABLE_CHECKBOX_CHECKED:_conf.default.icon.TABLE_CHECKBOX_UNCHECKED]})])]),u("td",{class:"vxe-table-custom-popup--column-item col--fixed"},[!n&&f.allowFixed?u("vxe-radio-group",{props:{value:t.fixed||"",type:"button",size:"mini",options:[{label:_conf.default.i18n("vxe.custom.setting.fixedLeft"),value:"left",disabled:m},{label:_conf.default.i18n("vxe.custom.setting.fixedUnset"),value:""},{label:_conf.default.i18n("vxe.custom.setting.fixedRight"),value:"right",disabled:m}]},on:{input:function(e){t.fixed=e},change:function(){d.changePopupFixedOption(t)}}}):null])])))}),u("vxe-modal",{key:"popup",props:{value:t.visible,title:_conf.default.i18n("vxe.custom.cstmTitle"),className:"vxe-table-custom-popup-wrapper vxe-table--ignore-clear",width:"40vw",minWidth:500,height:"50vh",minHeight:300,mask:!0,lockView:!0,showFooter:!0,resize:!0,escClosable:!0,destroyOnClose:!0},on:{input:function(e){t.visible=e}},scopedSlots:{default:function(){return u("div",{ref:"bodyElemRef",class:"vxe-table-custom-popup--body"},[u("div",{class:"vxe-table-custom-popup--table-wrapper"},[u("table",{},[u("colgroup",{},[u("col",{style:{width:"60px"}}),u("col"),u("col",{style:{width:"80px"}}),u("col",{style:{width:"200px"}})]),u("thead",{},[u("tr",{},[u("th",{},_conf.default.i18n("vxe.custom.setting.colSort")),u("th",{},_conf.default.i18n("vxe.custom.setting.colTitle")),u("th",{},_conf.default.i18n("vxe.custom.setting.colVisible")),u("th",{},_conf.default.i18n("vxe.custom.setting.colFixed"))])]),u("transition-group",{class:"vxe-table-custom--body",props:{tag:"tbody",name:"vxe-table-custom--flip"}},x)])]),u("div",{ref:"dragHintElemRef",class:"vxe-table-custom-popup--drag-hint"},_conf.default.i18n("vxe.custom.cstmDragTarget",[d.dragColumn?d.dragColumn.getTitle():""]))])},footer:function(){return u("div",{class:"vxe-table-custom-popup--footer"},[u("vxe-button",{props:{content:f.resetButtonText||_conf.default.i18n("vxe.custom.cstmRestore")},on:{click:d.resetPopupCustomEvent}}),u("vxe-button",{props:{content:f.resetButtonText||_conf.default.i18n("vxe.custom.cstmCancel")},on:{click:d.cancelCustomEvent}}),u("vxe-button",{props:{status:"primary",content:f.confirmButtonText||_conf.default.i18n("vxe.custom.cstmConfirm")},on:{click:d.confirmCustomEvent}})])}}})}var _default2=exports.default={name:"VxeTableCustomPanel",props:{customStore:{type:Object,default:function(){return{}}}},inject:{$xetable:{default:null}},data:function(){return{dragColumn:null}},computed:{},render:function(e){return("popup"===this.$xetable.customOpts.mode?renderPopupPanel:renderSimplePanel)(e,this)},methods:{handleWrapperMouseenterEvent:function(e){var t=this.$xetable;this.customStore.activeWrapper=!0,t.customOpenEvent(e)},handleWrapperMouseleaveEvent:function(e){var t=this.$xetable,o=this.customStore;o.activeWrapper=!1,setTimeout(function(){o.activeBtn||o.activeWrapper||t.customColseEvent(e)},300)},confirmCustomEvent:function(e){var t=this.$xetable;t.closeCustom(),t.emitCustomEvent("confirm",e)},cancelCustomEvent:function(e){var t=this.$xetable;t.closeCustom(),t.emitCustomEvent("cancel",e)},resetCustomEvent:function(e){var t=this.$xetable;t.resetColumn(!0),t.closeCustom(),t.emitCustomEvent("reset",e)},resetPopupCustomEvent:function(e){this.resetCustomEvent(e)},handleOptionCheck:function(t){var e=this.$xetable.customColumnList,e=_xeUtils.default.findTree(e,function(e){return e===t});e&&e.parent&&(e=e.parent).children&&e.children.length&&(e.visible=e.children.every(function(e){return e.visible}),e.halfVisible=!e.visible&&e.children.some(function(e){return e.visible||e.halfVisible}),this.handleOptionCheck(e))},changeCheckboxOption:function(e){var t=this.$xetable,o=t.customOpts,i=!e.visible;_xeUtils.default.eachTree([e],function(e){e.visible=i,e.halfVisible=!1}),this.handleOptionCheck(e),o.immediate&&t.handleCustom(),t.checkCustomStatus()},changeFixedOption:function(e,t){var o=this.$xetable,i=o.isMaxFixedColumn;e.fixed===t?o.clearColumnFixed(e):i&&!e.fixed||o.setColumnFixed(e,t)},changePopupFixedOption:function(e){var t=this.$xetable;t.isMaxFixedColumn||t.setColumnFixed(e,e.fixed)},allCustomEvent:function(){var e=this.$xetable,t=this.customStore,o=e.customOpts,i=e.customColumnList,n=o.checkMethod,l=!t.isAll;_xeUtils.default.eachTree(i,function(e){n&&!n({column:e})||(e.visible=l,e.halfVisible=!1)}),t.isAll=l,e.checkCustomStatus()},sortMousedownEvent:function(e){var t=this.$xetable,e=e.currentTarget.parentNode.parentNode,o=e.getAttribute("colid"),t=t.getColumnById(o);e.draggable=!0,this.dragColumn=t,addClass(e,"active--drag-origin")},sortMouseupEvent:function(e){var e=e.currentTarget.parentNode.parentNode,t=this.$refs.dragHintElemRef;e.draggable=!1,this.dragColumn=null,removeClass(e,"active--drag-origin"),t&&(t.style.display="")},sortDragstartEvent:function(e){var t=new Image;e.dataTransfer&&e.dataTransfer.setDragImage(t,0,0)},sortDragendEvent:function(e){var t=this.$xetable,o=this.prevDropTrEl,i=t.customColumnList,e=e.currentTarget,n=this.$refs.dragHintElemRef;if(o){if(o!==e){var l=o.getAttribute("drag-pos"),s=e.getAttribute("colid"),a=t.getColumnById(s);if(!a)return;var s=_xeUtils.default.findIndexOf(i,function(e){return e.id===a.id}),c=o.getAttribute("colid"),r=t.getColumnById(c);if(!r)return;i.splice(s,1);t=_xeUtils.default.findIndexOf(i,function(e){return e.id===r.id});i.splice(t+("bottom"===l?1:0),0,a)}o.draggable=!1,o.removeAttribute("drag-pos"),removeClass(o,"active--drag-target")}this.dragColumn=null,e.draggable=!1,e.removeAttribute("drag-pos"),n&&(n.style.display=""),removeClass(e,"active--drag-target"),removeClass(e,"active--drag-origin"),i.forEach(function(e,t){e.renderSortNumber=t})},sortDragoverEvent:function(e){var t=this.$xetable,o=this.prevDropTrEl,i=e.currentTarget,o=(o!==i&&removeClass(o,"active--drag-target"),i.getAttribute("colid")),t=t.getColumnById(o);t&&1===t.level&&(e.preventDefault(),o=e.clientY-i.getBoundingClientRect().y<i.clientHeight/2?"top":"bottom",addClass(i,"active--drag-target"),i.setAttribute("drag-pos",o),this.prevDropTrEl=i),updateDropHint(this,e)}}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _utils=_interopRequireDefault(require("../../tools/utils")),_dom=_interopRequireDefault(require("../../tools/dom")),_conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_xeUtils=_interopRequireDefault(require("xe-utils"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var formatText=_utils.default.formatText,addClass=_dom.default.addClass,removeClass=_dom.default.removeClass;function updateDropHint(e,t){var o,e=e.$refs,i=e.dragHintElemRef,e=e.bodyElemRef;e&&i&&(o=(e=e.parentNode).getBoundingClientRect(),i.style.display="block",i.style.top="".concat(Math.min(e.clientHeight-e.scrollTop-i.clientHeight,t.clientY-o.y),"px"),i.style.left="".concat(Math.min(e.clientWidth-e.scrollLeft-i.clientWidth-16,t.clientX-o.x),"px"))}function renderSimplePanel(u,d){var e=d.$xetable,t=d.customStore,f=e.customOpts,o=e.customColumnList,p=e.isMaxFixedColumn,e=t.maxHeight,m=f.checkMethod,v=f.visibleMethod,i=f.trigger,x=[],n={},i=("hover"===i&&(n.mouseenter=d.handleWrapperMouseenterEvent,n.mouseleave=d.handleWrapperMouseleaveEvent),_xeUtils.default.eachTree(o,function(e,t,o,i,n){var l,s,a,c,r;v&&!v({column:e})||(l=e.visible,s=e.halfVisible,a=e.children&&e.children.length,c=formatText(e.getTitle(),1),r=!!m&&!m({column:e}),x.push(u("li",{key:e.id,class:["vxe-table-custom--option","level--".concat(e.level),{"is--group":a}]},[u("div",{title:c,class:["vxe-table-custom--checkbox-option",{"is--checked":l,"is--indeterminate":s,"is--disabled":r}],on:{click:function(){r||d.changeCheckboxOption(e)}}},[u("span",{class:["vxe-checkbox--icon",s?_conf.default.icon.TABLE_CHECKBOX_INDETERMINATE:l?_conf.default.icon.TABLE_CHECKBOX_CHECKED:_conf.default.icon.TABLE_CHECKBOX_UNCHECKED]}),u("span",{class:"vxe-checkbox--label"},c)]),!n&&f.allowFixed?u("div",{class:"vxe-table-custom--fixed-option"},[u("span",{class:["vxe-table-custom--fixed-left-option","left"===e.fixed?_conf.default.icon.TOOLBAR_TOOLS_FIXED_LEFT_ACTIVED:_conf.default.icon.TOOLBAR_TOOLS_FIXED_LEFT,{"is--checked":"left"===e.fixed,"is--disabled":p&&!e.fixed}],attrs:{title:_conf.default.i18n("left"===e.fixed?"vxe.toolbar.cancelfixed":"vxe.toolbar.fixedLeft")},on:{click:function(){d.changeFixedOption(e,"left")}}}),u("span",{class:["vxe-table-custom--fixed-right-option","right"===e.fixed?_conf.default.icon.TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVED:_conf.default.icon.TOOLBAR_TOOLS_FIXED_RIGHT,{"is--checked":"right"===e.fixed,"is--disabled":p&&!e.fixed}],attrs:{title:_conf.default.i18n("right"===e.fixed?"vxe.toolbar.cancelfixed":"vxe.toolbar.fixedRight")},on:{click:function(){d.changeFixedOption(e,"right")}}})]):null])))}),t.isAll),o=t.isIndeterminate;return u("div",{key:"simple",class:["vxe-table-custom-wrapper",{"is--active":t.visible}]},[u("ul",{class:"vxe-table-custom--header"},[u("li",{class:"vxe-table-custom--option"},[u("div",{class:["vxe-table-custom--checkbox-option",{"is--checked":i,"is--indeterminate":o}],attrs:{title:_conf.default.i18n("vxe.table.allTitle")},on:{click:d.allCustomEvent}},[u("span",{class:["vxe-checkbox--icon",o?_conf.default.icon.TABLE_CHECKBOX_INDETERMINATE:i?_conf.default.icon.TABLE_CHECKBOX_CHECKED:_conf.default.icon.TABLE_CHECKBOX_UNCHECKED]}),u("span",{class:"vxe-checkbox--label"},_conf.default.i18n("vxe.toolbar.customAll"))])])]),u("ul",{class:"vxe-table-custom--body",style:e?{maxHeight:"".concat(e,"px")}:{},on:n},x),f.showFooter?u("div",{class:"vxe-table-custom--footer"},[u("button",{class:"btn--reset",on:{click:d.resetCustomEvent}},f.resetButtonText||_conf.default.i18n("vxe.toolbar.customRestore")),u("button",{class:"btn--confirm",on:{click:d.confirmCustomEvent}},f.confirmButtonText||_conf.default.i18n("vxe.toolbar.customConfirm"))]):null])}function renderPopupPanel(u,d){var e=d.$xetable,t=d.customStore,f=e.customOpts,o=e.customColumnList,i=e.columnOpts,p=e.isMaxFixedColumn,m=f.checkMethod,v=f.visibleMethod,x=[];return _xeUtils.default.eachTree(o,function(t,e,o,i,n){var l,s,a,c,r;v&&!v({column:t})||(l=t.visible,s=t.halfVisible,a=formatText(t.getTitle(),1),c=t.children&&t.children.length,r=!!m&&!m({column:t}),x.push(u("tr",{key:t.id,class:["vxe-table-custom-popup--row level--".concat(t.level),{"is--group":c}],attrs:{colid:t.id},on:{dragstart:d.sortDragstartEvent,dragend:d.sortDragendEvent,dragover:d.sortDragoverEvent}},[u("td",{class:"vxe-table-custom-popup--column-item col--sort"},[1===t.level?u("span",{class:"vxe-table-custom-popup--column-sort-btn",on:{mousedown:d.sortMousedownEvent,mouseup:d.sortMouseupEvent}},[u("i",{class:"vxe-icon-sort"})]):null]),u("td",{class:"vxe-table-custom-popup--column-item col--name"},[u("div",{class:"vxe-table-custom-popup--name",attrs:{title:a}},a)]),u("td",{class:"vxe-table-custom-popup--column-item col--visible"},[u("div",{class:["vxe-table-custom--checkbox-option",{"is--checked":l,"is--indeterminate":s,"is--disabled":r}],on:{click:function(){r||d.changeCheckboxOption(t)}}},[u("span",{class:["vxe-checkbox--icon",s?_conf.default.icon.TABLE_CHECKBOX_INDETERMINATE:l?_conf.default.icon.TABLE_CHECKBOX_CHECKED:_conf.default.icon.TABLE_CHECKBOX_UNCHECKED]})])]),u("td",{class:"vxe-table-custom-popup--column-item col--fixed"},[!n&&f.allowFixed?u("vxe-radio-group",{props:{value:t.fixed||"",type:"button",size:"mini",options:[{label:_conf.default.i18n("vxe.custom.setting.fixedLeft"),value:"left",disabled:p},{label:_conf.default.i18n("vxe.custom.setting.fixedUnset"),value:""},{label:_conf.default.i18n("vxe.custom.setting.fixedRight"),value:"right",disabled:p}]},on:{input:function(e){t.fixed=e},change:function(){d.changePopupFixedOption(t)}}}):null])])))}),u("vxe-modal",{key:"popup",props:{value:t.visible,title:_conf.default.i18n("vxe.custom.cstmTitle"),className:"vxe-table-custom-popup-wrapper vxe-table--ignore-clear",width:"40vw",minWidth:520,height:"50vh",minHeight:300,mask:!0,lockView:!0,showFooter:!0,resize:!0,escClosable:!0,destroyOnClose:!0},on:{input:function(e){t.visible=e}},scopedSlots:{default:function(){return u("div",{ref:"bodyElemRef",class:"vxe-table-custom-popup--body"},[u("div",{class:"vxe-table-custom-popup--table-wrapper"},[u("table",{},[u("colgroup",{},[u("col",{style:{width:"80px"}}),u("col"),u("col",{style:{width:"80px"}}),u("col",{style:{width:"200px"}})]),u("thead",{},[u("tr",{},[u("th",{},[u("span",{class:"vxe-table-custom-popup--table-sort-help-title"},_conf.default.i18n("vxe.custom.setting.colSort")),u("vxe-tooltip",{props:{enterable:!0,content:"点击并拖动图标可以调整列的排序"},scopedSlots:{default:function(){return u("i",{class:"vxe-table-custom-popup--table-sort-help-icon vxe-icon-question-circle-fill"})}}})]),u("th",{},_conf.default.i18n("vxe.custom.setting.colTitle")),u("th",{},_conf.default.i18n("vxe.custom.setting.colVisible")),u("th",{},_conf.default.i18n("vxe.custom.setting.colFixed",[i.maxFixedSize||0]))])]),u("transition-group",{class:"vxe-table-custom--body",props:{tag:"tbody",name:"vxe-table-custom--flip"}},x)])]),u("div",{ref:"dragHintElemRef",class:"vxe-table-custom-popup--drag-hint"},_conf.default.i18n("vxe.custom.cstmDragTarget",[d.dragColumn?d.dragColumn.getTitle():""]))])},footer:function(){return u("div",{class:"vxe-table-custom-popup--footer"},[u("vxe-button",{props:{content:f.resetButtonText||_conf.default.i18n("vxe.custom.cstmRestore")},on:{click:d.resetPopupCustomEvent}}),u("vxe-button",{props:{content:f.resetButtonText||_conf.default.i18n("vxe.custom.cstmCancel")},on:{click:d.cancelCustomEvent}}),u("vxe-button",{props:{status:"primary",content:f.confirmButtonText||_conf.default.i18n("vxe.custom.cstmConfirm")},on:{click:d.confirmCustomEvent}})])}}})}var _default2=exports.default={name:"VxeTableCustomPanel",props:{customStore:{type:Object,default:function(){return{}}}},inject:{$xetable:{default:null}},data:function(){return{dragColumn:null}},computed:{},render:function(e){return("popup"===this.$xetable.customOpts.mode?renderPopupPanel:renderSimplePanel)(e,this)},methods:{handleWrapperMouseenterEvent:function(e){var t=this.$xetable;this.customStore.activeWrapper=!0,t.customOpenEvent(e)},handleWrapperMouseleaveEvent:function(e){var t=this.$xetable,o=this.customStore;o.activeWrapper=!1,setTimeout(function(){o.activeBtn||o.activeWrapper||t.customColseEvent(e)},300)},confirmCustomEvent:function(e){var t=this.$xetable;t.closeCustom(),t.emitCustomEvent("confirm",e)},cancelCustomEvent:function(e){var t=this.$xetable;t.closeCustom(),t.emitCustomEvent("cancel",e)},resetCustomEvent:function(e){var t=this.$xetable;t.resetColumn(!0),t.closeCustom(),t.emitCustomEvent("reset",e)},resetPopupCustomEvent:function(e){this.resetCustomEvent(e)},handleOptionCheck:function(t){var e=this.$xetable.customColumnList,e=_xeUtils.default.findTree(e,function(e){return e===t});e&&e.parent&&(e=e.parent).children&&e.children.length&&(e.visible=e.children.every(function(e){return e.visible}),e.halfVisible=!e.visible&&e.children.some(function(e){return e.visible||e.halfVisible}),this.handleOptionCheck(e))},changeCheckboxOption:function(e){var t=this.$xetable,o=t.customOpts,i=!e.visible;_xeUtils.default.eachTree([e],function(e){e.visible=i,e.halfVisible=!1}),this.handleOptionCheck(e),o.immediate&&t.handleCustom(),t.checkCustomStatus()},changeFixedOption:function(e,t){var o=this.$xetable,i=o.isMaxFixedColumn;e.fixed===t?o.clearColumnFixed(e):i&&!e.fixed||o.setColumnFixed(e,t)},changePopupFixedOption:function(e){var t=this.$xetable;t.isMaxFixedColumn||t.setColumnFixed(e,e.fixed)},allCustomEvent:function(){var e=this.$xetable,t=this.customStore,o=e.customOpts,i=e.customColumnList,n=o.checkMethod,l=!t.isAll;_xeUtils.default.eachTree(i,function(e){n&&!n({column:e})||(e.visible=l,e.halfVisible=!1)}),t.isAll=l,e.checkCustomStatus()},sortMousedownEvent:function(e){var t=this.$xetable,e=e.currentTarget.parentNode.parentNode,o=e.getAttribute("colid"),t=t.getColumnById(o);e.draggable=!0,this.dragColumn=t,addClass(e,"active--drag-origin")},sortMouseupEvent:function(e){var e=e.currentTarget.parentNode.parentNode,t=this.$refs.dragHintElemRef;e.draggable=!1,this.dragColumn=null,removeClass(e,"active--drag-origin"),t&&(t.style.display="")},sortDragstartEvent:function(e){var t=new Image;e.dataTransfer&&e.dataTransfer.setDragImage(t,0,0)},sortDragendEvent:function(e){var t=this.$xetable,o=this.prevDropTrEl,i=t.customColumnList,e=e.currentTarget,n=this.$refs.dragHintElemRef;if(o){if(o!==e){var l=o.getAttribute("drag-pos"),s=e.getAttribute("colid"),a=t.getColumnById(s);if(!a)return;var s=_xeUtils.default.findIndexOf(i,function(e){return e.id===a.id}),c=o.getAttribute("colid"),r=t.getColumnById(c);if(!r)return;i.splice(s,1);t=_xeUtils.default.findIndexOf(i,function(e){return e.id===r.id});i.splice(t+("bottom"===l?1:0),0,a)}o.draggable=!1,o.removeAttribute("drag-pos"),removeClass(o,"active--drag-target")}this.dragColumn=null,e.draggable=!1,e.removeAttribute("drag-pos"),n&&(n.style.display=""),removeClass(e,"active--drag-target"),removeClass(e,"active--drag-origin"),i.forEach(function(e,t){e.renderSortNumber=t})},sortDragoverEvent:function(e){var t=this.$xetable,o=this.prevDropTrEl,i=e.currentTarget,o=(o!==i&&removeClass(o,"active--drag-target"),i.getAttribute("colid")),t=t.getColumnById(o);t&&1===t.level&&(e.preventDefault(),o=e.clientY-i.getBoundingClientRect().y<i.clientHeight/2?"top":"bottom",addClass(i,"active--drag-target"),i.setAttribute("drag-pos",o),this.prevDropTrEl=i),updateDropHint(this,e)}}};
@@ -396,6 +396,8 @@
396
396
  .vxe-table-custom-popup--table-wrapper table {
397
397
  width: 100%;
398
398
  border: 0;
399
+ table-layout: fixed;
400
+ word-break: break-all;
399
401
  border-spacing: 0;
400
402
  border-collapse: separate;
401
403
  }
@@ -416,6 +418,9 @@
416
418
  .vxe-table-custom-popup--table-wrapper table tr:first-child td {
417
419
  border-top: 0;
418
420
  }
421
+ .vxe-table-custom-popup--table-wrapper table tr:hover {
422
+ background-color: #f5f7fa;
423
+ }
419
424
  .vxe-table-custom-popup--table-wrapper table th,
420
425
  .vxe-table-custom-popup--table-wrapper table td {
421
426
  height: 44px;
@@ -445,7 +450,6 @@
445
450
  }
446
451
 
447
452
  .vxe-table-custom-popup--name {
448
- max-width: 360px;
449
453
  overflow: hidden;
450
454
  text-overflow: ellipsis;
451
455
  white-space: nowrap;
@@ -453,42 +457,34 @@
453
457
 
454
458
  .vxe-table-custom-popup--row.level--2 .vxe-table-custom-popup--name {
455
459
  padding-left: 24px;
456
- max-width: 236px;
457
460
  }
458
461
 
459
462
  .vxe-table-custom-popup--row.level--3 .vxe-table-custom-popup--name {
460
463
  padding-left: 48px;
461
- max-width: 212px;
462
464
  }
463
465
 
464
466
  .vxe-table-custom-popup--row.level--4 .vxe-table-custom-popup--name {
465
467
  padding-left: 72px;
466
- max-width: 188px;
467
468
  }
468
469
 
469
470
  .vxe-table-custom-popup--row.level--5 .vxe-table-custom-popup--name {
470
471
  padding-left: 96px;
471
- max-width: 164px;
472
472
  }
473
473
 
474
474
  .vxe-table-custom-popup--row.level--6 .vxe-table-custom-popup--name {
475
475
  padding-left: 120px;
476
- max-width: 140px;
477
476
  }
478
477
 
479
478
  .vxe-table-custom-popup--row.level--7 .vxe-table-custom-popup--name {
480
479
  padding-left: 144px;
481
- max-width: 116px;
482
480
  }
483
481
 
484
482
  .vxe-table-custom-popup--row.level--8 .vxe-table-custom-popup--name {
485
483
  padding-left: 168px;
486
- max-width: 92px;
487
484
  }
488
485
 
489
486
  .vxe-table-custom-popup--row.level--9 .vxe-table-custom-popup--name {
490
487
  padding-left: 192px;
491
- max-width: 68px;
492
488
  }
493
489
 
494
490
  .vxe-table-custom-popup--column-item {
@@ -538,4 +534,14 @@
538
534
  }
539
535
  .vxe-table-custom-popup--column-sort-btn:active {
540
536
  cursor: grabbing;
537
+ }
538
+
539
+ .vxe-table-custom-popup--table-sort-help-title,
540
+ .vxe-table-custom-popup--table-sort-help-icon {
541
+ vertical-align: middle;
542
+ }
543
+
544
+ .vxe-table-custom-popup--table-sort-help-icon {
545
+ margin-left: 5px;
546
+ cursor: help;
541
547
  }
@@ -1 +1 @@
1
- [class*=vxe-],[class*=vxe-] :after,[class*=vxe-] :before,[class*=vxe-]:after,[class*=vxe-]:before{box-sizing:border-box}.vxe-table-custom-popup--drag-hint{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[class*=vxe-]{font-variant:tabular-nums;font-feature-settings:"tnum"}.vxe-primary-color{color:#409eff}.vxe-success-color{color:#67c23a}.vxe-info-color{color:#909399}.vxe-warning-color{color:#e6a23c}.vxe-danger-color{color:#f56c6c}.vxe-perfect-color{color:#f8f8f9}.vxe-row:after{content:"";display:block;clear:both;height:0;overflow:hidden;visibility:hidden}.vxe-row>.vxe-col--1{float:left;width:4.16667%}.vxe-row>.vxe-col--2{float:left;width:8.33333%}.vxe-row>.vxe-col--3{float:left;width:12.5%}.vxe-row>.vxe-col--4{float:left;width:16.66667%}.vxe-row>.vxe-col--5{float:left;width:20.83333%}.vxe-row>.vxe-col--6{float:left;width:25%}.vxe-row>.vxe-col--7{float:left;width:29.16667%}.vxe-row>.vxe-col--8{float:left;width:33.33333%}.vxe-row>.vxe-col--9{float:left;width:37.5%}.vxe-row>.vxe-col--10{float:left;width:41.66667%}.vxe-row>.vxe-col--11{float:left;width:45.83333%}.vxe-row>.vxe-col--12{float:left;width:50%}.vxe-row>.vxe-col--13{float:left;width:54.16667%}.vxe-row>.vxe-col--14{float:left;width:58.33333%}.vxe-row>.vxe-col--15{float:left;width:62.5%}.vxe-row>.vxe-col--16{float:left;width:66.66667%}.vxe-row>.vxe-col--17{float:left;width:70.83333%}.vxe-row>.vxe-col--18{float:left;width:75%}.vxe-row>.vxe-col--19{float:left;width:79.16667%}.vxe-row>.vxe-col--20{float:left;width:83.33333%}.vxe-row>.vxe-col--21{float:left;width:87.5%}.vxe-row>.vxe-col--22{float:left;width:91.66667%}.vxe-row>.vxe-col--23{float:left;width:95.83333%}.vxe-row>.vxe-col--24{float:left;width:100%}.is--animat .vxe-filter--btn:after,.is--animat .vxe-filter--btn:before,.is--animat .vxe-sort--asc-btn:after,.is--animat .vxe-sort--asc-btn:before,.is--animat .vxe-sort--desc-btn:after,.is--animat .vxe-sort--desc-btn:before{transition:border .1s ease-in-out}.is--animat .vxe-input--wrapper .vxe-input{transition:border .1s ease-in-out}.is--animat .vxe-table--expand-btn,.is--animat .vxe-tree--node-btn{transition:transform .1s ease-in-out}.is--animat .vxe-checkbox>input:checked+span,.is--animat .vxe-radio>input:checked+span{transition:background-color .1s ease-in-out}.vxe-table-custom--option{display:flex;flex-direction:row}.vxe-table-custom-wrapper{display:none;position:absolute;top:-4px;right:2px;text-align:left;background-color:#fff;z-index:19;border:1px solid #e8eaec;border-radius:4px;box-shadow:0 1px 6px rgba(0,0,0,.2)}.vxe-table-custom-wrapper.is--active{display:block}.vxe-table-custom--body,.vxe-table-custom--header{list-style-type:none;overflow-x:hidden;overflow-y:auto;margin:0;padding:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vxe-table-custom--body>li,.vxe-table-custom--header>li{max-width:18em;min-width:14em;padding:.2em 1em .2em 1em}.vxe-table-custom--body>li.level--2,.vxe-table-custom--header>li.level--2{padding-left:3.5em}.vxe-table-custom--body>li.level--2 .vxe-checkbox--icon,.vxe-table-custom--header>li.level--2 .vxe-checkbox--icon{left:1.8em}.vxe-table-custom--body>li.level--3,.vxe-table-custom--header>li.level--3{padding-left:4.5em}.vxe-table-custom--body>li.level--3 .vxe-checkbox--icon,.vxe-table-custom--header>li.level--3 .vxe-checkbox--icon{left:2.8em}.vxe-table-custom--body>li.level--4,.vxe-table-custom--header>li.level--4{padding-left:5.5em}.vxe-table-custom--body>li.level--4 .vxe-checkbox--icon,.vxe-table-custom--header>li.level--4 .vxe-checkbox--icon{left:3.8em}.vxe-table-custom--body>li.level--5,.vxe-table-custom--header>li.level--5{padding-left:6.5em}.vxe-table-custom--body>li.level--5 .vxe-checkbox--icon,.vxe-table-custom--header>li.level--5 .vxe-checkbox--icon{left:4.8em}.vxe-table-custom--body>li.level--6,.vxe-table-custom--header>li.level--6{padding-left:7.5em}.vxe-table-custom--body>li.level--6 .vxe-checkbox--icon,.vxe-table-custom--header>li.level--6 .vxe-checkbox--icon{left:5.8em}.vxe-table-custom--body>li.level--7,.vxe-table-custom--header>li.level--7{padding-left:8.5em}.vxe-table-custom--body>li.level--7 .vxe-checkbox--icon,.vxe-table-custom--header>li.level--7 .vxe-checkbox--icon{left:6.8em}.vxe-table-custom--body>li.level--8,.vxe-table-custom--header>li.level--8{padding-left:9.5em}.vxe-table-custom--body>li.level--8 .vxe-checkbox--icon,.vxe-table-custom--header>li.level--8 .vxe-checkbox--icon{left:7.8em}.vxe-table-custom--header{padding:.28em 0;font-weight:700;border-bottom:1px solid #dadce0}.vxe-table-custom--body{padding:.2em 0;max-height:20em}.vxe-table-custom--body .vxe-table-custom--checkbox-option:hover{background-color:#f5f7fa}.vxe-table-custom--footer{border-top:1px solid #dadce0;text-align:right}.vxe-table-custom--footer button{background-color:transparent;width:50%;height:2.5em;border:0;color:#606266;text-align:center;cursor:pointer}.vxe-table-custom--footer button:focus{outline:0}.vxe-table-custom--footer button:hover{color:#409eff}.vxe-table-custom--checkbox-option{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-grow:1}.vxe-table-custom--checkbox-option .vxe-checkbox--icon{font-size:1.34em}.vxe-table-custom--checkbox-option .vxe-checkbox--icon{color:#dcdfe6;vertical-align:middle;font-weight:700;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vxe-table-custom--checkbox-option.is--checked,.vxe-table-custom--checkbox-option.is--indeterminate{color:#409eff}.vxe-table-custom--checkbox-option.is--checked .vxe-checkbox--icon,.vxe-table-custom--checkbox-option.is--indeterminate .vxe-checkbox--icon{color:#409eff}.vxe-table-custom--checkbox-option:not(.is--disabled){cursor:pointer}.vxe-table-custom--checkbox-option:not(.is--disabled):hover .vxe-checkbox--icon{color:#409eff}.vxe-table-custom--checkbox-option.is--disabled{color:#bfbfbf;cursor:not-allowed}.vxe-table-custom--checkbox-option.is--disabled .vxe-checkbox--icon{color:#dcdfe6}.vxe-table-custom--checkbox-option .vxe-checkbox--label{padding-left:.5em;vertical-align:middle}.vxe-table-custom--fixed-option{flex-shrink:0;padding-left:.5em;display:flex;flex-direction:row;align-items:center}.vxe-table-custom--fixed-left-option,.vxe-table-custom--fixed-right-option{line-height:1.34em;font-size:1.1em;padding:0 .2em;cursor:pointer}.vxe-table-custom--fixed-left-option.is--checked,.vxe-table-custom--fixed-left-option:hover,.vxe-table-custom--fixed-right-option.is--checked,.vxe-table-custom--fixed-right-option:hover{color:#409eff}.vxe-table-custom--fixed-left-option.is--disabled,.vxe-table-custom--fixed-right-option.is--disabled{cursor:no-drop;color:#dcdfe6}.vxe-table-custom-popup--body{overflow:auto;height:100%}.vxe-table-custom-popup--table-wrapper{border-bottom:1px solid #e8eaec}.vxe-table-custom-popup--table-wrapper table{width:100%;border:0;border-spacing:0;border-collapse:separate}.vxe-table-custom-popup--table-wrapper table th{position:sticky;top:0;text-align:left;border-top:1px solid #e8eaec;border-bottom:1px solid #e8eaec;border-left:1px solid #e8eaec;background-color:#f8f8f9;z-index:7}.vxe-table-custom-popup--table-wrapper table td{border-top:1px solid #e8eaec;border-left:1px solid #e8eaec}.vxe-table-custom-popup--table-wrapper table tr:first-child td{border-top:0}.vxe-table-custom-popup--table-wrapper table td,.vxe-table-custom-popup--table-wrapper table th{height:44px;padding:0 .6em}.vxe-table-custom-popup--table-wrapper table td:last-child,.vxe-table-custom-popup--table-wrapper table th:last-child{border-right:1px solid #e8eaec}.vxe-table-custom-popup--drag-hint{display:none;position:absolute;top:0;left:0;padding:.6em 1em .6em 1.8em;max-width:300px;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;background-color:#fff;box-shadow:0 0 10px 0 rgba(0,0,0,.2);z-index:33}.vxe-table-custom-popup--name{max-width:360px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vxe-table-custom-popup--row.level--2 .vxe-table-custom-popup--name{padding-left:24px;max-width:236px}.vxe-table-custom-popup--row.level--3 .vxe-table-custom-popup--name{padding-left:48px;max-width:212px}.vxe-table-custom-popup--row.level--4 .vxe-table-custom-popup--name{padding-left:72px;max-width:188px}.vxe-table-custom-popup--row.level--5 .vxe-table-custom-popup--name{padding-left:96px;max-width:164px}.vxe-table-custom-popup--row.level--6 .vxe-table-custom-popup--name{padding-left:120px;max-width:140px}.vxe-table-custom-popup--row.level--7 .vxe-table-custom-popup--name{padding-left:144px;max-width:116px}.vxe-table-custom-popup--row.level--8 .vxe-table-custom-popup--name{padding-left:168px;max-width:92px}.vxe-table-custom-popup--row.level--9 .vxe-table-custom-popup--name{padding-left:192px;max-width:68px}.vxe-table-custom-popup--column-item{position:relative}.vxe-table-custom-popup--column-item.col--fixed,.vxe-table-custom-popup--column-item.col--sort,.vxe-table-custom-popup--column-item.col--visible{text-align:center}.vxe-table-custom-popup--row.active--drag-target[drag-pos=top] .vxe-table-custom-popup--column-item::after{display:block;top:-2px}.vxe-table-custom-popup--row.active--drag-target[drag-pos=bottom] .vxe-table-custom-popup--column-item::after{display:block;bottom:-2px}.vxe-table-custom-popup--row:first-child[drag-pos=top] .vxe-table-custom-popup--column-item::after{top:0}.vxe-table-custom-popup--row:last-child[drag-pos=bottom] .vxe-table-custom-popup--column-item::after{bottom:0}.vxe-table-custom-popup--column-item::after{display:none;content:"";position:absolute;left:-1px;width:calc(100% + 1px);height:3px;background-color:#409eff;z-index:12}.vxe-table-custom-popup--column-item:last-child::after{width:100%}.vxe-table-custom--flip-move{transition:transform .35s}.vxe-table-custom-popup--column-sort-btn{font-size:1.2em;padding:.2em .5em;cursor:grab}.vxe-table-custom-popup--column-sort-btn:active{cursor:grabbing}
1
+ [class*=vxe-],[class*=vxe-] :after,[class*=vxe-] :before,[class*=vxe-]:after,[class*=vxe-]:before{box-sizing:border-box}.vxe-table-custom-popup--drag-hint{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[class*=vxe-]{font-variant:tabular-nums;font-feature-settings:"tnum"}.vxe-primary-color{color:#409eff}.vxe-success-color{color:#67c23a}.vxe-info-color{color:#909399}.vxe-warning-color{color:#e6a23c}.vxe-danger-color{color:#f56c6c}.vxe-perfect-color{color:#f8f8f9}.vxe-row:after{content:"";display:block;clear:both;height:0;overflow:hidden;visibility:hidden}.vxe-row>.vxe-col--1{float:left;width:4.16667%}.vxe-row>.vxe-col--2{float:left;width:8.33333%}.vxe-row>.vxe-col--3{float:left;width:12.5%}.vxe-row>.vxe-col--4{float:left;width:16.66667%}.vxe-row>.vxe-col--5{float:left;width:20.83333%}.vxe-row>.vxe-col--6{float:left;width:25%}.vxe-row>.vxe-col--7{float:left;width:29.16667%}.vxe-row>.vxe-col--8{float:left;width:33.33333%}.vxe-row>.vxe-col--9{float:left;width:37.5%}.vxe-row>.vxe-col--10{float:left;width:41.66667%}.vxe-row>.vxe-col--11{float:left;width:45.83333%}.vxe-row>.vxe-col--12{float:left;width:50%}.vxe-row>.vxe-col--13{float:left;width:54.16667%}.vxe-row>.vxe-col--14{float:left;width:58.33333%}.vxe-row>.vxe-col--15{float:left;width:62.5%}.vxe-row>.vxe-col--16{float:left;width:66.66667%}.vxe-row>.vxe-col--17{float:left;width:70.83333%}.vxe-row>.vxe-col--18{float:left;width:75%}.vxe-row>.vxe-col--19{float:left;width:79.16667%}.vxe-row>.vxe-col--20{float:left;width:83.33333%}.vxe-row>.vxe-col--21{float:left;width:87.5%}.vxe-row>.vxe-col--22{float:left;width:91.66667%}.vxe-row>.vxe-col--23{float:left;width:95.83333%}.vxe-row>.vxe-col--24{float:left;width:100%}.is--animat .vxe-filter--btn:after,.is--animat .vxe-filter--btn:before,.is--animat .vxe-sort--asc-btn:after,.is--animat .vxe-sort--asc-btn:before,.is--animat .vxe-sort--desc-btn:after,.is--animat .vxe-sort--desc-btn:before{transition:border .1s ease-in-out}.is--animat .vxe-input--wrapper .vxe-input{transition:border .1s ease-in-out}.is--animat .vxe-table--expand-btn,.is--animat .vxe-tree--node-btn{transition:transform .1s ease-in-out}.is--animat .vxe-checkbox>input:checked+span,.is--animat .vxe-radio>input:checked+span{transition:background-color .1s ease-in-out}.vxe-table-custom--option{display:flex;flex-direction:row}.vxe-table-custom-wrapper{display:none;position:absolute;top:-4px;right:2px;text-align:left;background-color:#fff;z-index:19;border:1px solid #e8eaec;border-radius:4px;box-shadow:0 1px 6px rgba(0,0,0,.2)}.vxe-table-custom-wrapper.is--active{display:block}.vxe-table-custom--body,.vxe-table-custom--header{list-style-type:none;overflow-x:hidden;overflow-y:auto;margin:0;padding:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vxe-table-custom--body>li,.vxe-table-custom--header>li{max-width:18em;min-width:14em;padding:.2em 1em .2em 1em}.vxe-table-custom--body>li.level--2,.vxe-table-custom--header>li.level--2{padding-left:3.5em}.vxe-table-custom--body>li.level--2 .vxe-checkbox--icon,.vxe-table-custom--header>li.level--2 .vxe-checkbox--icon{left:1.8em}.vxe-table-custom--body>li.level--3,.vxe-table-custom--header>li.level--3{padding-left:4.5em}.vxe-table-custom--body>li.level--3 .vxe-checkbox--icon,.vxe-table-custom--header>li.level--3 .vxe-checkbox--icon{left:2.8em}.vxe-table-custom--body>li.level--4,.vxe-table-custom--header>li.level--4{padding-left:5.5em}.vxe-table-custom--body>li.level--4 .vxe-checkbox--icon,.vxe-table-custom--header>li.level--4 .vxe-checkbox--icon{left:3.8em}.vxe-table-custom--body>li.level--5,.vxe-table-custom--header>li.level--5{padding-left:6.5em}.vxe-table-custom--body>li.level--5 .vxe-checkbox--icon,.vxe-table-custom--header>li.level--5 .vxe-checkbox--icon{left:4.8em}.vxe-table-custom--body>li.level--6,.vxe-table-custom--header>li.level--6{padding-left:7.5em}.vxe-table-custom--body>li.level--6 .vxe-checkbox--icon,.vxe-table-custom--header>li.level--6 .vxe-checkbox--icon{left:5.8em}.vxe-table-custom--body>li.level--7,.vxe-table-custom--header>li.level--7{padding-left:8.5em}.vxe-table-custom--body>li.level--7 .vxe-checkbox--icon,.vxe-table-custom--header>li.level--7 .vxe-checkbox--icon{left:6.8em}.vxe-table-custom--body>li.level--8,.vxe-table-custom--header>li.level--8{padding-left:9.5em}.vxe-table-custom--body>li.level--8 .vxe-checkbox--icon,.vxe-table-custom--header>li.level--8 .vxe-checkbox--icon{left:7.8em}.vxe-table-custom--header{padding:.28em 0;font-weight:700;border-bottom:1px solid #dadce0}.vxe-table-custom--body{padding:.2em 0;max-height:20em}.vxe-table-custom--body .vxe-table-custom--checkbox-option:hover{background-color:#f5f7fa}.vxe-table-custom--footer{border-top:1px solid #dadce0;text-align:right}.vxe-table-custom--footer button{background-color:transparent;width:50%;height:2.5em;border:0;color:#606266;text-align:center;cursor:pointer}.vxe-table-custom--footer button:focus{outline:0}.vxe-table-custom--footer button:hover{color:#409eff}.vxe-table-custom--checkbox-option{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-grow:1}.vxe-table-custom--checkbox-option .vxe-checkbox--icon{font-size:1.34em}.vxe-table-custom--checkbox-option .vxe-checkbox--icon{color:#dcdfe6;vertical-align:middle;font-weight:700;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vxe-table-custom--checkbox-option.is--checked,.vxe-table-custom--checkbox-option.is--indeterminate{color:#409eff}.vxe-table-custom--checkbox-option.is--checked .vxe-checkbox--icon,.vxe-table-custom--checkbox-option.is--indeterminate .vxe-checkbox--icon{color:#409eff}.vxe-table-custom--checkbox-option:not(.is--disabled){cursor:pointer}.vxe-table-custom--checkbox-option:not(.is--disabled):hover .vxe-checkbox--icon{color:#409eff}.vxe-table-custom--checkbox-option.is--disabled{color:#bfbfbf;cursor:not-allowed}.vxe-table-custom--checkbox-option.is--disabled .vxe-checkbox--icon{color:#dcdfe6}.vxe-table-custom--checkbox-option .vxe-checkbox--label{padding-left:.5em;vertical-align:middle}.vxe-table-custom--fixed-option{flex-shrink:0;padding-left:.5em;display:flex;flex-direction:row;align-items:center}.vxe-table-custom--fixed-left-option,.vxe-table-custom--fixed-right-option{line-height:1.34em;font-size:1.1em;padding:0 .2em;cursor:pointer}.vxe-table-custom--fixed-left-option.is--checked,.vxe-table-custom--fixed-left-option:hover,.vxe-table-custom--fixed-right-option.is--checked,.vxe-table-custom--fixed-right-option:hover{color:#409eff}.vxe-table-custom--fixed-left-option.is--disabled,.vxe-table-custom--fixed-right-option.is--disabled{cursor:no-drop;color:#dcdfe6}.vxe-table-custom-popup--body{overflow:auto;height:100%}.vxe-table-custom-popup--table-wrapper{border-bottom:1px solid #e8eaec}.vxe-table-custom-popup--table-wrapper table{width:100%;border:0;table-layout:fixed;word-break:break-all;border-spacing:0;border-collapse:separate}.vxe-table-custom-popup--table-wrapper table th{position:sticky;top:0;text-align:left;border-top:1px solid #e8eaec;border-bottom:1px solid #e8eaec;border-left:1px solid #e8eaec;background-color:#f8f8f9;z-index:7}.vxe-table-custom-popup--table-wrapper table td{border-top:1px solid #e8eaec;border-left:1px solid #e8eaec}.vxe-table-custom-popup--table-wrapper table tr:first-child td{border-top:0}.vxe-table-custom-popup--table-wrapper table tr:hover{background-color:#f5f7fa}.vxe-table-custom-popup--table-wrapper table td,.vxe-table-custom-popup--table-wrapper table th{height:44px;padding:0 .6em}.vxe-table-custom-popup--table-wrapper table td:last-child,.vxe-table-custom-popup--table-wrapper table th:last-child{border-right:1px solid #e8eaec}.vxe-table-custom-popup--drag-hint{display:none;position:absolute;top:0;left:0;padding:.6em 1em .6em 1.8em;max-width:300px;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;background-color:#fff;box-shadow:0 0 10px 0 rgba(0,0,0,.2);z-index:33}.vxe-table-custom-popup--name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vxe-table-custom-popup--row.level--2 .vxe-table-custom-popup--name{padding-left:24px}.vxe-table-custom-popup--row.level--3 .vxe-table-custom-popup--name{padding-left:48px}.vxe-table-custom-popup--row.level--4 .vxe-table-custom-popup--name{padding-left:72px}.vxe-table-custom-popup--row.level--5 .vxe-table-custom-popup--name{padding-left:96px}.vxe-table-custom-popup--row.level--6 .vxe-table-custom-popup--name{padding-left:120px}.vxe-table-custom-popup--row.level--7 .vxe-table-custom-popup--name{padding-left:144px}.vxe-table-custom-popup--row.level--8 .vxe-table-custom-popup--name{padding-left:168px}.vxe-table-custom-popup--row.level--9 .vxe-table-custom-popup--name{padding-left:192px}.vxe-table-custom-popup--column-item{position:relative}.vxe-table-custom-popup--column-item.col--fixed,.vxe-table-custom-popup--column-item.col--sort,.vxe-table-custom-popup--column-item.col--visible{text-align:center}.vxe-table-custom-popup--row.active--drag-target[drag-pos=top] .vxe-table-custom-popup--column-item::after{display:block;top:-2px}.vxe-table-custom-popup--row.active--drag-target[drag-pos=bottom] .vxe-table-custom-popup--column-item::after{display:block;bottom:-2px}.vxe-table-custom-popup--row:first-child[drag-pos=top] .vxe-table-custom-popup--column-item::after{top:0}.vxe-table-custom-popup--row:last-child[drag-pos=bottom] .vxe-table-custom-popup--column-item::after{bottom:0}.vxe-table-custom-popup--column-item::after{display:none;content:"";position:absolute;left:-1px;width:calc(100% + 1px);height:3px;background-color:#409eff;z-index:12}.vxe-table-custom-popup--column-item:last-child::after{width:100%}.vxe-table-custom--flip-move{transition:transform .35s}.vxe-table-custom-popup--column-sort-btn{font-size:1.2em;padding:.2em .5em;cursor:grab}.vxe-table-custom-popup--column-sort-btn:active{cursor:grabbing}.vxe-table-custom-popup--table-sort-help-icon,.vxe-table-custom-popup--table-sort-help-title{vertical-align:middle}.vxe-table-custom-popup--table-sort-help-icon{margin-left:5px;cursor:help}
@@ -411,7 +411,7 @@ var _default = exports.default = {
411
411
  }
412
412
  // 如果当前行被激活编辑,则清除激活状态
413
413
  if (actived.row && this.findRowIndexOf(rows, actived.row) > -1) {
414
- this.clearActived();
414
+ this.clearEdit();
415
415
  }
416
416
  // 从新增中移除已删除的数据
417
417
  rows.forEach(function (row) {
@@ -548,94 +548,100 @@ var _default = exports.default = {
548
548
  editConfig = this.editConfig,
549
549
  mouseConfig = this.mouseConfig;
550
550
  var mode = editOpts.mode;
551
- var actived = editStore.actived;
551
+ var actived = editStore.actived,
552
+ focused = editStore.focused;
552
553
  var row = params.row,
553
554
  column = params.column;
554
555
  var editRender = column.editRender;
555
556
  var cell = params.cell = params.cell || this.getCell(row, column);
556
557
  var beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod;
557
- if ((0, _utils.isEnableConf)(editConfig) && (0, _utils.isEnableConf)(editRender) && !this.hasPendingByRow(row) && cell) {
558
- if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
559
- // 判断是否禁用编辑
560
- var type = 'edit-disabled';
561
- if (!beforeEditMethod || beforeEditMethod(_objectSpread(_objectSpread({}, params), {}, {
562
- $table: this,
563
- $grid: this.$xegrid
564
- }))) {
558
+ if (cell && (0, _utils.isEnableConf)(editConfig) && (0, _utils.isEnableConf)(editRender)) {
559
+ // 激活编辑
560
+ if (!this.hasPendingByRow(row)) {
561
+ if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
562
+ // 判断是否禁用编辑
563
+ var type = 'edit-disabled';
564
+ if (!beforeEditMethod || beforeEditMethod(_objectSpread(_objectSpread({}, params), {}, {
565
+ $table: this,
566
+ $grid: this.$xegrid
567
+ }))) {
568
+ if (mouseConfig) {
569
+ this.clearSelected(evnt);
570
+ this.clearCellAreas(evnt);
571
+ this.clearCopyCellArea(evnt);
572
+ }
573
+ this.closeTooltip();
574
+ if (actived.column) {
575
+ this.clearEdit(evnt);
576
+ }
577
+ type = 'edit-activated';
578
+ column.renderHeight = cell.offsetHeight;
579
+ actived.args = params;
580
+ actived.row = row;
581
+ actived.column = column;
582
+ if (mode === 'row') {
583
+ tableColumn.forEach(function (column) {
584
+ return _this6._getColumnModel(row, column);
585
+ });
586
+ } else {
587
+ this._getColumnModel(row, column);
588
+ }
589
+ var afterEditMethod = editOpts.afterEditMethod;
590
+ this.$nextTick(function () {
591
+ _this6.handleFocus(params, evnt);
592
+ if (afterEditMethod) {
593
+ afterEditMethod(_objectSpread(_objectSpread({}, params), {}, {
594
+ $table: _this6,
595
+ $grid: _this6.$xegrid
596
+ }));
597
+ }
598
+ });
599
+ }
600
+ this.emitEvent(type, {
601
+ row: row,
602
+ rowIndex: this.getRowIndex(row),
603
+ $rowIndex: this.getVMRowIndex(row),
604
+ column: column,
605
+ columnIndex: this.getColumnIndex(column),
606
+ $columnIndex: this.getVMColumnIndex(column)
607
+ }, evnt);
608
+
609
+ // v4已废弃
610
+ if (type === 'edit-activated') {
611
+ this.emitEvent('edit-actived', {
612
+ row: row,
613
+ rowIndex: this.getRowIndex(row),
614
+ $rowIndex: this.getVMRowIndex(row),
615
+ column: column,
616
+ columnIndex: this.getColumnIndex(column),
617
+ $columnIndex: this.getVMColumnIndex(column)
618
+ }, evnt);
619
+ }
620
+ } else {
621
+ var oldColumn = actived.column;
565
622
  if (mouseConfig) {
566
623
  this.clearSelected(evnt);
567
624
  this.clearCellAreas(evnt);
568
625
  this.clearCopyCellArea(evnt);
569
626
  }
570
- this.closeTooltip();
571
- if (actived.column) {
572
- this.clearActived(evnt);
627
+ if (oldColumn !== column) {
628
+ var oldModel = oldColumn.model;
629
+ if (oldModel.update) {
630
+ _utils.default.setCellValue(row, oldColumn, oldModel.value);
631
+ }
632
+ this.clearValidate();
573
633
  }
574
- type = 'edit-activated';
575
634
  column.renderHeight = cell.offsetHeight;
576
635
  actived.args = params;
577
- actived.row = row;
578
636
  actived.column = column;
579
- if (mode === 'row') {
580
- tableColumn.forEach(function (column) {
581
- return _this6._getColumnModel(row, column);
582
- });
583
- } else {
584
- this._getColumnModel(row, column);
585
- }
586
- var afterEditMethod = editOpts.afterEditMethod;
587
- this.$nextTick(function () {
637
+ setTimeout(function () {
588
638
  _this6.handleFocus(params, evnt);
589
- if (afterEditMethod) {
590
- afterEditMethod(_objectSpread(_objectSpread({}, params), {}, {
591
- $table: _this6,
592
- $grid: _this6.$xegrid
593
- }));
594
- }
595
639
  });
596
640
  }
597
- this.emitEvent(type, {
598
- row: row,
599
- rowIndex: this.getRowIndex(row),
600
- $rowIndex: this.getVMRowIndex(row),
601
- column: column,
602
- columnIndex: this.getColumnIndex(column),
603
- $columnIndex: this.getVMColumnIndex(column)
604
- }, evnt);
605
-
606
- // v4已废弃
607
- if (type === 'edit-activated') {
608
- this.emitEvent('edit-actived', {
609
- row: row,
610
- rowIndex: this.getRowIndex(row),
611
- $rowIndex: this.getVMRowIndex(row),
612
- column: column,
613
- columnIndex: this.getColumnIndex(column),
614
- $columnIndex: this.getVMColumnIndex(column)
615
- }, evnt);
616
- }
617
- } else {
618
- var oldColumn = actived.column;
619
- if (mouseConfig) {
620
- this.clearSelected(evnt);
621
- this.clearCellAreas(evnt);
622
- this.clearCopyCellArea(evnt);
623
- }
624
- if (oldColumn !== column) {
625
- var oldModel = oldColumn.model;
626
- if (oldModel.update) {
627
- _utils.default.setCellValue(row, oldColumn, oldModel.value);
628
- }
629
- this.clearValidate();
630
- }
631
- column.renderHeight = cell.offsetHeight;
632
- actived.args = params;
633
- actived.column = column;
634
- setTimeout(function () {
635
- _this6.handleFocus(params, evnt);
636
- });
641
+ focused.column = null;
642
+ focused.row = null;
643
+ this.focus();
637
644
  }
638
- this.focus();
639
645
  }
640
646
  return this.$nextTick();
641
647
  },
@@ -675,9 +681,9 @@ var _default = exports.default = {
675
681
  }
676
682
  },
677
683
  _clearActived: function _clearActived(evnt) {
678
- // if (process.env.NODE_ENV === 'development') {
679
- // warnLog('vxe.error.delFunc', ['clearActived', 'clearEdit'])
680
- // }
684
+ if (process.env.NODE_ENV === 'development') {
685
+ (0, _log.warnLog)('vxe.error.delFunc', ['clearActived', 'clearEdit']);
686
+ }
681
687
  // 即将废弃
682
688
  return this.clearEdit(evnt);
683
689
  },
@@ -686,7 +692,8 @@ var _default = exports.default = {
686
692
  */
687
693
  _clearEdit: function _clearEdit(evnt) {
688
694
  var editStore = this.editStore;
689
- var actived = editStore.actived;
695
+ var actived = editStore.actived,
696
+ focused = editStore.focused;
690
697
  var row = actived.row,
691
698
  column = actived.column;
692
699
  if (row || column) {
@@ -704,6 +711,8 @@ var _default = exports.default = {
704
711
  $columnIndex: this.getVMColumnIndex(column)
705
712
  }, evnt);
706
713
  }
714
+ focused.row = null;
715
+ focused.column = null;
707
716
  if (_conf.default.cellVaildMode === 'obsolete') {
708
717
  if (this.clearValidate) {
709
718
  return this.clearValidate();
@@ -712,9 +721,9 @@ var _default = exports.default = {
712
721
  return this.$nextTick();
713
722
  },
714
723
  _getActiveRecord: function _getActiveRecord() {
715
- // if (process.env.NODE_ENV === 'development') {
716
- // warnLog('vxe.error.delFunc', ['getActiveRecord', 'getEditRecord'])
717
- // }
724
+ if (process.env.NODE_ENV === 'development') {
725
+ (0, _log.warnLog)('vxe.error.delFunc', ['getActiveRecord', 'getEditRecord']);
726
+ }
718
727
  // 即将废弃
719
728
  return this.getEditRecord();
720
729
  },
@@ -731,9 +740,9 @@ var _default = exports.default = {
731
740
  return null;
732
741
  },
733
742
  _isActiveByRow: function _isActiveByRow(row) {
734
- // if (process.env.NODE_ENV === 'development') {
735
- // warnLog('vxe.error.delFunc', ['isActiveByRow', 'isEditByRow'])
736
- // }
743
+ if (process.env.NODE_ENV === 'development') {
744
+ (0, _log.warnLog)('vxe.error.delFunc', ['isActiveByRow', 'isEditByRow']);
745
+ }
737
746
  // 即将废弃
738
747
  return this.isEditByRow(row);
739
748
  },
@@ -790,9 +799,9 @@ var _default = exports.default = {
790
799
  }
791
800
  },
792
801
  _setActiveRow: function _setActiveRow(row) {
793
- // if (process.env.NODE_ENV === 'development') {
794
- // warnLog('vxe.error.delFunc', ['setActiveRow', 'setEditRow'])
795
- // }
802
+ if (process.env.NODE_ENV === 'development') {
803
+ (0, _log.warnLog)('vxe.error.delFunc', ['setActiveRow', 'setEditRow']);
804
+ }
796
805
  // 即将废弃
797
806
  return this.setEditRow(row);
798
807
  },
@@ -809,9 +818,9 @@ var _default = exports.default = {
809
818
  return this.setEditCell(row, column);
810
819
  },
811
820
  _setActiveCell: function _setActiveCell(row) {
812
- // if (process.env.NODE_ENV === 'development') {
813
- // warnLog('vxe.error.delFunc', ['setActiveCell', 'setEditCell'])
814
- // }
821
+ if (process.env.NODE_ENV === 'development') {
822
+ (0, _log.warnLog)('vxe.error.delFunc', ['setActiveCell', 'setEditCell']);
823
+ }
815
824
  // 即将废弃
816
825
  return this.setEditCell(row);
817
826
  },
@@ -881,7 +890,7 @@ var _default = exports.default = {
881
890
  var selectMethod = function selectMethod() {
882
891
  if (isMouseSelected && (selected.row !== row || selected.column !== column)) {
883
892
  if (actived.row !== row || (editOpts.mode === 'cell' ? actived.column !== column : false)) {
884
- _this9.clearActived(evnt);
893
+ _this9.clearEdit(evnt);
885
894
  _this9.clearSelected(evnt);
886
895
  _this9.clearCellAreas(evnt);
887
896
  _this9.clearCopyCellArea(evnt);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_vXETable=_interopRequireDefault(require("../../v-x-e-table")),_conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_utils=_interopRequireWildcard(require("../../tools/utils")),_util=require("../../table/src/util"),_dom=_interopRequireWildcard(require("../../tools/dom")),_log=require("../../tools/log");function _getRequireWildcardCache(e){var t,r;return"function"!=typeof WeakMap?null:(t=new WeakMap,r=new WeakMap,(_getRequireWildcardCache=function(e){return e?r:t})(e))}function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=_typeof(e)&&"function"!=typeof e)return{default:e};t=_getRequireWildcardCache(t);if(t&&t.has(e))return t.get(e);var r,i,n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e)"default"!==r&&{}.hasOwnProperty.call(e,r)&&((i=o?Object.getOwnPropertyDescriptor(e,r):null)&&(i.get||i.set)?Object.defineProperty(n,r,i):n[r]=e[r]);return n.default=e,t&&t.set(e,n),n}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 r,i=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,r)),i}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}function insertTreeRow(a,e,t){var s=a.tableFullTreeData,u=a.afterFullData,c=a.fullDataRowIdData,d=a.fullAllDataRowIdData,r=a.treeOpts,f=r.rowField,h=r.parentField,p=r.mapChildrenField,_=r.children||r.childrenField,m=t?"push":"unshift";e.forEach(function(e){var t,r,i,n=e[h],o=(0,_util.getRowid)(a,e),l=n?_xeUtils.default.findTree(s,function(e){return n===e[f]},{children:p}):null;l?(l=l.item,t=(t=d[(0,_util.getRowid)(a,l)])?t.level:0,i=l[_],r=l[p],_xeUtils.default.isArray(i)||(i=l[_]=[]),_xeUtils.default.isArray(r)||(r=l[_]=[]),i[m](e),r[m](e),c[o]=r={row:e,rowid:o,seq:-1,index:-1,_index:-1,$index:-1,items:i,parent:l,level:t+1},d[o]=r):("development"===process.env.NODE_ENV&&n&&(0,_log.warnLog)("vxe.error.unableInsert"),u[m](e),s[m](e),i={row:e,rowid:o,seq:-1,index:-1,_index:-1,$index:-1,items:s,parent:null,level:0},c[o]=i,d[o]=i)})}function handleInsertRowAt(i,e,t,n){var r=i.tableFullTreeData,o=i.mergeList,l=i.afterFullData,a=i.editStore,s=i.tableFullData,u=i.treeConfig,c=i.fullDataRowIdData,d=i.fullAllDataRowIdData,f=i.treeOpts,h=f.transform,p=f.rowField,_=f.mapChildrenField,m=f.children||f.childrenField,w=(_xeUtils.default.isArray(e)||(e=[e]),i.defineField(e.map(function(e){return Object.assign(u&&h?_defineProperty(_defineProperty({},_,[]),m,[]):{},e)})));if(_xeUtils.default.eqNull(t))u&&h?insertTreeRow(i,w,!1):(l.unshift.apply(l,_toConsumableArray(w)),s.unshift.apply(s,_toConsumableArray(w)),o.forEach(function(e){var t=e.row;0<t&&(e.row=t+w.length)}));else if(-1===t)u&&h?insertTreeRow(i,w,!0):(l.push.apply(l,_toConsumableArray(w)),s.push.apply(s,_toConsumableArray(w)),o.forEach(function(e){var t=e.row,r=e.rowspan;t+r>l.length&&(e.rowspan=r+w.length)}));else if(u&&h){var g,v,y,b=_xeUtils.default.findTree(r,function(e){return t[p]===e[p]},{children:_});b?(g=b.parent,v=g?g[_]:r,e=d[(0,_util.getRowid)(i,g)],y=e?e.level:0,w.forEach(function(e,t){var r=(0,_util.getRowid)(i,e),t=("development"===process.env.NODE_ENV&&e[f.parentField]&&g&&e[f.parentField]!==g[p]&&(0,_log.errLog)("vxe.error.errProp",["".concat(f.parentField,"=").concat(e[f.parentField]),"".concat(f.parentField,"=").concat(g[p])]),g&&(e[f.parentField]=g[p]),b.index+t),t=(n&&(t+=1),v.splice(t,0,e),{row:e,rowid:r,seq:-1,index:-1,_index:-1,$index:-1,items:v,parent:g,level:y+1});c[r]=t,d[r]=t}),g&&(e=_xeUtils.default.findTree(r,function(e){return t[p]===e[p]},{children:m}))&&(r=e.items,e=e.index,n&&(e+=1),r.splice.apply(r,[e,0].concat(_toConsumableArray(w))))):("development"===process.env.NODE_ENV&&(0,_log.warnLog)("vxe.error.unableInsert"),insertTreeRow(i,w,!0))}else{if(u)throw new Error((0,_log.getLog)("vxe.error.noTree",["insert"]));var x=-1;if(_xeUtils.default.isNumber(t)?t<l.length&&(x=t):x=i.findRowIndexOf(l,t),-1===(x=n?Math.min(l.length,x+1):x))throw new Error((0,_log.errLog)("vxe.error.unableInsert"));l.splice.apply(l,[x,0].concat(_toConsumableArray(w))),s.splice.apply(s,[i.findRowIndexOf(s,t),0].concat(_toConsumableArray(w))),o.forEach(function(e){var t=e.row,r=e.rowspan;x<t?e.row=t+w.length:x<t+r&&(e.rowspan=r+w.length)})}var r=a.insertList,C=a.insertMaps;return w.forEach(function(e){var t=(0,_util.getRowid)(i,e);C[t]=e}),r.unshift.apply(r,_toConsumableArray(w)),i.cacheRowMap(),i.updateScrollYStatus(),i.handleTableData(u&&h),u&&h||i.updateAfterDataIndex(),i.updateFooter(),i.checkSelectionStatus(),i.scrollYLoad&&i.updateScrollYSpace(),i.$nextTick().then(function(){return i.updateCellAreas(),i.recalculate()}).then(function(){return{row:w.length?w[w.length-1]:null,rows:w}})}var _default=exports.default={methods:{_insert:function(e){return handleInsertRowAt(this,e,null)},_insertAt:function(e,t){return handleInsertRowAt(this,e,t)},_insertNextAt:function(e,t){return handleInsertRowAt(this,e,t,!0)},_remove:function(e){var t,n=this,o=this.afterFullData,r=this.tableFullData,i=this.tableFullTreeData,l=this.treeConfig,a=this.mergeList,s=this.editStore,u=this.checkboxOpts,c=this.selectCheckboxMaps,d=this.isInsertByRow,f=this.treeOpts,h=f.transform,p=f.mapChildrenField,_=f.children||f.childrenField,f=s.actived,m=s.removeList,w=s.insertList,g=s.insertMaps,s=u.checkField,v=[];return e?_xeUtils.default.isArray(e)||(e=[e]):e=r,e.forEach(function(e){d(e)||m.push(e)}),s||(t=_objectSpread({},c),e.forEach(function(e){e=(0,_util.getRowid)(n,e);t[e]&&delete t[e]}),this.selectCheckboxMaps=t),r===e?(e=v=r.slice(0),this.tableFullData=[],this.afterFullData=[],this.clearMergeCells()):l&&h?e.forEach(function(e){var t=(0,_util.getRowid)(n,e),r=_xeUtils.default.findTree(i,function(e){return t===(0,_util.getRowid)(n,e)},{children:p}),r=(r&&(r=r.items.splice(r.index,1),v.push(r[0])),_xeUtils.default.findTree(i,function(e){return t===(0,_util.getRowid)(n,e)},{children:_})),r=(r&&r.items.splice(r.index,1),n.findRowIndexOf(o,e));-1<r&&o.splice(r,1)}):e.forEach(function(e){var t=n.findRowIndexOf(r,e),i=(-1<t&&(t=r.splice(t,1),v.push(t[0])),n.findRowIndexOf(o,e));-1<i&&(a.forEach(function(e){var t=e.row,r=e.rowspan;i<t?e.row=t-1:i<t+r&&(e.rowspan=r-1)}),o.splice(i,1))}),f.row&&-1<this.findRowIndexOf(e,f.row)&&this.clearActived(),e.forEach(function(e){var t=(0,_util.getRowid)(n,e),e=n.findRowIndexOf(w,e);-1<e&&w.splice(e,1),delete g[t]}),this.handleTableData(l&&h),l&&h||this.updateAfterDataIndex(),this.updateFooter(),this.cacheRowMap(),this.checkSelectionStatus(),this.scrollYLoad&&this.updateScrollYSpace(),this.$nextTick().then(function(){return n.updateCellAreas(),n.recalculate()}).then(function(){return{row:v.length?v[v.length-1]:null,rows:v}})},_removeCheckboxRow:function(){var t=this;return this.remove(this.getCheckboxRecords()).then(function(e){return t.clearCheckboxRow(),e})},_removeRadioRow:function(){var t=this,e=this.getRadioRecord();return this.remove(e||[]).then(function(e){return t.clearRadioRow(),e})},_removeCurrentRow:function(){var t=this,e=this.getCurrentRecord();return this.remove(e||[]).then(function(e){return t.clearCurrentRow(),e})},_getRecordset:function(){return{insertRecords:this.getInsertRecords(),removeRecords:this.getRemoveRecords(),updateRecords:this.getUpdateRecords(),pendingRecords:this.getPendingRecords()}},_getInsertRecords:function(){var r=this,i=this.fullAllDataRowIdData,e=this.editStore.insertList,n=[];return e.forEach(function(e){var t=(0,_util.getRowid)(r,e);i[t]&&n.push(e)}),n},_getRemoveRecords:function(){return this.editStore.removeList},_getUpdateRecords:function(){var e=this.keepSource,t=this.tableFullData,r=this.isUpdateByRow,i=this.treeConfig,n=this.treeOpts,o=this.editStore;return e?(o=(e=o.actived).row,e=e.column,(o||e)&&this._syncActivedCell(),i?_xeUtils.default.filterTree(t,function(e){return r(e)},n):t.filter(function(e){return r(e)})):[]},handleActived:function(e,t){var r,i=this,n=this.editStore,o=this.editOpts,l=this.tableColumn,a=this.editConfig,s=this.mouseConfig,u=o.mode,n=n.actived,c=e.row,d=e.column,f=d.editRender,h=e.cell=e.cell||this.getCell(c,d),p=o.beforeEditMethod||o.activeMethod;return(0,_utils.isEnableConf)(a)&&(0,_utils.isEnableConf)(f)&&!this.hasPendingByRow(c)&&h&&(n.row!==c||"cell"===u&&n.column!==d?(a="edit-disabled",p&&!p(_objectSpread(_objectSpread({},e),{},{$table:this,$grid:this.$xegrid}))||(s&&(this.clearSelected(t),this.clearCellAreas(t),this.clearCopyCellArea(t)),this.closeTooltip(),n.column&&this.clearActived(t),a="edit-activated",d.renderHeight=h.offsetHeight,n.args=e,n.row=c,n.column=d,"row"===u?l.forEach(function(e){return i._getColumnModel(c,e)}):this._getColumnModel(c,d),r=o.afterEditMethod,this.$nextTick(function(){i.handleFocus(e,t),r&&r(_objectSpread(_objectSpread({},e),{},{$table:i,$grid:i.$xegrid}))})),this.emitEvent(a,{row:c,rowIndex:this.getRowIndex(c),$rowIndex:this.getVMRowIndex(c),column:d,columnIndex:this.getColumnIndex(d),$columnIndex:this.getVMColumnIndex(d)},t),"edit-activated"===a&&this.emitEvent("edit-actived",{row:c,rowIndex:this.getRowIndex(c),$rowIndex:this.getVMRowIndex(c),column:d,columnIndex:this.getColumnIndex(d),$columnIndex:this.getVMColumnIndex(d)},t)):(f=n.column,s&&(this.clearSelected(t),this.clearCellAreas(t),this.clearCopyCellArea(t)),f!==d&&((p=f.model).update&&_utils.default.setCellValue(c,f,p.value),this.clearValidate()),d.renderHeight=h.offsetHeight,n.args=e,n.column=d,setTimeout(function(){i.handleFocus(e,t)})),this.focus()),this.$nextTick()},_getColumnModel:function(e,t){var r=t.model;t.editRender&&(r.value=_utils.default.getCellValue(e,t),r.update=!1)},_setColumnModel:function(e,t){var r=t.model;t.editRender&&r.update&&(_utils.default.setCellValue(e,t,r.value),r.update=!1,r.value=null)},_syncActivedCell:function(){var t=this,e=this.tableColumn,r=this.editStore,i=this.editOpts,r=r.actived,n=r.row,r=r.column;(n||r)&&("row"===i.mode?e.forEach(function(e){return t._setColumnModel(n,e)}):this._setColumnModel(n,r))},_clearActived:function(e){return this.clearEdit(e)},_clearEdit:function(e){var t=this.editStore.actived,r=t.row,i=t.column;return(r||i)&&(this._syncActivedCell(),t.args=null,t.row=null,t.column=null,this.updateFooter(),this.emitEvent("edit-closed",{row:r,rowIndex:this.getRowIndex(r),$rowIndex:this.getVMRowIndex(r),column:i,columnIndex:this.getColumnIndex(i),$columnIndex:this.getVMColumnIndex(i)},e)),"obsolete"===_conf.default.cellVaildMode&&this.clearValidate?this.clearValidate():this.$nextTick()},_getActiveRecord:function(){return this.getEditRecord()},_getEditRecord:function(){var e=this.$el,t=this.editStore,r=this.afterFullData,t=t.actived,i=t.args,t=t.row;return i&&-1<this.findRowIndexOf(r,t)&&e.querySelectorAll(".vxe-body--column.col--active").length?Object.assign({},i):null},_isActiveByRow:function(e){return this.isEditByRow(e)},_isEditByRow:function(e){return this.editStore.actived.row===e},handleFocus:function(e){var t,r,i,n=e.row,o=e.column,l=e.cell,a=o.editRender;(0,_utils.isEnableConf)(a)&&(i=_vXETable.default.renderer.get(a.name),t=a.autofocus,a=a.autoselect,!t&&i&&(t=i.autofocus),!a&&i&&(a=i.autoselect),_xeUtils.default.isFunction(t)?r=t.call(this,e):t&&(r=l.querySelector(t))&&r.focus(),r?a?r.select():_dom.browse.msie&&((i=r.createTextRange()).collapse(!1),i.select()):this.scrollToRow(n,o))},_setActiveRow:function(e){return this.setEditRow(e)},_setEditRow:function(e,t){var r=_xeUtils.default.find(this.visibleColumn,function(e){return(0,_utils.isEnableConf)(e.editRender)});return t&&(r=_xeUtils.default.isString(t)?this.getColumnByField(t):t),this.setEditCell(e,r)},_setActiveCell:function(e){return this.setEditCell(e)},_setEditCell:function(t,e){var r=this,i=this.editConfig,n=_xeUtils.default.isString(e)?this.getColumnByField(e):e;return t&&n&&(0,_utils.isEnableConf)(i)&&(0,_utils.isEnableConf)(n.editRender)?this.scrollToRow(t,!0).then(function(){var e=r.getCell(t,n);e&&(r.handleActived({row:t,rowIndex:r.getRowIndex(t),column:n,columnIndex:r.getColumnIndex(n),cell:e,$table:r}),r.lastCallTime=Date.now())}):this.$nextTick()},_setSelectCell:function(e,t){var r=this.tableData,i=this.editOpts,n=this.visibleColumn,t=_xeUtils.default.isString(t)?this.getColumnByField(t):t;return e&&t&&"manual"!==i.trigger&&-1<(i=this.findRowIndexOf(r,e))&&(r=this.getCell(e,t),e={row:e,rowIndex:i,column:t,columnIndex:n.indexOf(t),cell:r},this.handleSelected(e,{})),this.$nextTick()},handleSelected:function(e,t){var r=this,i=this.mouseConfig,n=this.mouseOpts,o=this.editOpts,l=this.editStore,a=l.actived,l=l.selected,s=e.row,u=e.column,i=i&&n.selected;return!i||l.row===s&&l.column===u||(a.row!==s||"cell"===o.mode&&a.column!==u)&&(r.clearActived(t),r.clearSelected(t),r.clearCellAreas(t),r.clearCopyCellArea(t),l.args=e,l.row=s,l.column=u,i&&r.addColSdCls(),r.focus(),t)&&r.emitEvent("cell-selected",e,t),r.$nextTick()},_getSelectedCell:function(){var e=this.editStore.selected,t=e.args,e=e.column;return t&&e?Object.assign({},t):null},_clearSelected:function(){var e=this.editStore.selected;return e.row=null,e.column=null,this.reColTitleSdCls(),this.reColSdCls(),this.$nextTick()},reColTitleSdCls:function(){var e=this.elemStore["main-header-list"];e&&_xeUtils.default.arrayEach(e.querySelectorAll(".col--title-selected"),function(e){return _dom.default.removeClass(e,"col--title-selected")})},reColSdCls:function(){var e=this.$el.querySelector(".col--selected");e&&_dom.default.removeClass(e,"col--selected")},addColSdCls:function(){var e=this.editStore.selected,t=e.row,e=e.column;this.reColSdCls(),t&&e&&(t=this.getCell(t,e))&&_dom.default.addClass(t,"col--selected")}}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_vXETable=_interopRequireDefault(require("../../v-x-e-table")),_conf=_interopRequireDefault(require("../../v-x-e-table/src/conf")),_utils=_interopRequireWildcard(require("../../tools/utils")),_util=require("../../table/src/util"),_dom=_interopRequireWildcard(require("../../tools/dom")),_log=require("../../tools/log");function _getRequireWildcardCache(e){var t,r;return"function"!=typeof WeakMap?null:(t=new WeakMap,r=new WeakMap,(_getRequireWildcardCache=function(e){return e?r:t})(e))}function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=_typeof(e)&&"function"!=typeof e)return{default:e};t=_getRequireWildcardCache(t);if(t&&t.has(e))return t.get(e);var r,n,o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e)"default"!==r&&{}.hasOwnProperty.call(e,r)&&((n=i?Object.getOwnPropertyDescriptor(e,r):null)&&(n.get||n.set)?Object.defineProperty(o,r,n):o[r]=e[r]);return o.default=e,t&&t.set(e,o),o}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 r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)),n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}function insertTreeRow(a,e,t){var s=a.tableFullTreeData,u=a.afterFullData,c=a.fullDataRowIdData,d=a.fullAllDataRowIdData,r=a.treeOpts,f=r.rowField,h=r.parentField,p=r.mapChildrenField,_=r.children||r.childrenField,m=t?"push":"unshift";e.forEach(function(e){var t,r,n,o=e[h],i=(0,_util.getRowid)(a,e),l=o?_xeUtils.default.findTree(s,function(e){return o===e[f]},{children:p}):null;l?(l=l.item,t=(t=d[(0,_util.getRowid)(a,l)])?t.level:0,n=l[_],r=l[p],_xeUtils.default.isArray(n)||(n=l[_]=[]),_xeUtils.default.isArray(r)||(r=l[_]=[]),n[m](e),r[m](e),c[i]=r={row:e,rowid:i,seq:-1,index:-1,_index:-1,$index:-1,items:n,parent:l,level:t+1},d[i]=r):("development"===process.env.NODE_ENV&&o&&(0,_log.warnLog)("vxe.error.unableInsert"),u[m](e),s[m](e),n={row:e,rowid:i,seq:-1,index:-1,_index:-1,$index:-1,items:s,parent:null,level:0},c[i]=n,d[i]=n)})}function handleInsertRowAt(n,e,t,o){var r=n.tableFullTreeData,i=n.mergeList,l=n.afterFullData,a=n.editStore,s=n.tableFullData,u=n.treeConfig,c=n.fullDataRowIdData,d=n.fullAllDataRowIdData,f=n.treeOpts,h=f.transform,p=f.rowField,_=f.mapChildrenField,m=f.children||f.childrenField,w=(_xeUtils.default.isArray(e)||(e=[e]),n.defineField(e.map(function(e){return Object.assign(u&&h?_defineProperty(_defineProperty({},_,[]),m,[]):{},e)})));if(_xeUtils.default.eqNull(t))u&&h?insertTreeRow(n,w,!1):(l.unshift.apply(l,_toConsumableArray(w)),s.unshift.apply(s,_toConsumableArray(w)),i.forEach(function(e){var t=e.row;0<t&&(e.row=t+w.length)}));else if(-1===t)u&&h?insertTreeRow(n,w,!0):(l.push.apply(l,_toConsumableArray(w)),s.push.apply(s,_toConsumableArray(w)),i.forEach(function(e){var t=e.row,r=e.rowspan;t+r>l.length&&(e.rowspan=r+w.length)}));else if(u&&h){var v,g,y,b=_xeUtils.default.findTree(r,function(e){return t[p]===e[p]},{children:_});b?(v=b.parent,g=v?v[_]:r,e=d[(0,_util.getRowid)(n,v)],y=e?e.level:0,w.forEach(function(e,t){var r=(0,_util.getRowid)(n,e),t=("development"===process.env.NODE_ENV&&e[f.parentField]&&v&&e[f.parentField]!==v[p]&&(0,_log.errLog)("vxe.error.errProp",["".concat(f.parentField,"=").concat(e[f.parentField]),"".concat(f.parentField,"=").concat(v[p])]),v&&(e[f.parentField]=v[p]),b.index+t),t=(o&&(t+=1),g.splice(t,0,e),{row:e,rowid:r,seq:-1,index:-1,_index:-1,$index:-1,items:g,parent:v,level:y+1});c[r]=t,d[r]=t}),v&&(e=_xeUtils.default.findTree(r,function(e){return t[p]===e[p]},{children:m}))&&(r=e.items,e=e.index,o&&(e+=1),r.splice.apply(r,[e,0].concat(_toConsumableArray(w))))):("development"===process.env.NODE_ENV&&(0,_log.warnLog)("vxe.error.unableInsert"),insertTreeRow(n,w,!0))}else{if(u)throw new Error((0,_log.getLog)("vxe.error.noTree",["insert"]));var x=-1;if(_xeUtils.default.isNumber(t)?t<l.length&&(x=t):x=n.findRowIndexOf(l,t),-1===(x=o?Math.min(l.length,x+1):x))throw new Error((0,_log.errLog)("vxe.error.unableInsert"));l.splice.apply(l,[x,0].concat(_toConsumableArray(w))),s.splice.apply(s,[n.findRowIndexOf(s,t),0].concat(_toConsumableArray(w))),i.forEach(function(e){var t=e.row,r=e.rowspan;x<t?e.row=t+w.length:x<t+r&&(e.rowspan=r+w.length)})}var r=a.insertList,C=a.insertMaps;return w.forEach(function(e){var t=(0,_util.getRowid)(n,e);C[t]=e}),r.unshift.apply(r,_toConsumableArray(w)),n.cacheRowMap(),n.updateScrollYStatus(),n.handleTableData(u&&h),u&&h||n.updateAfterDataIndex(),n.updateFooter(),n.checkSelectionStatus(),n.scrollYLoad&&n.updateScrollYSpace(),n.$nextTick().then(function(){return n.updateCellAreas(),n.recalculate()}).then(function(){return{row:w.length?w[w.length-1]:null,rows:w}})}var _default=exports.default={methods:{_insert:function(e){return handleInsertRowAt(this,e,null)},_insertAt:function(e,t){return handleInsertRowAt(this,e,t)},_insertNextAt:function(e,t){return handleInsertRowAt(this,e,t,!0)},_remove:function(e){var t,o=this,i=this.afterFullData,r=this.tableFullData,n=this.tableFullTreeData,l=this.treeConfig,a=this.mergeList,s=this.editStore,u=this.checkboxOpts,c=this.selectCheckboxMaps,d=this.isInsertByRow,f=this.treeOpts,h=f.transform,p=f.mapChildrenField,_=f.children||f.childrenField,f=s.actived,m=s.removeList,w=s.insertList,v=s.insertMaps,s=u.checkField,g=[];return e?_xeUtils.default.isArray(e)||(e=[e]):e=r,e.forEach(function(e){d(e)||m.push(e)}),s||(t=_objectSpread({},c),e.forEach(function(e){e=(0,_util.getRowid)(o,e);t[e]&&delete t[e]}),this.selectCheckboxMaps=t),r===e?(e=g=r.slice(0),this.tableFullData=[],this.afterFullData=[],this.clearMergeCells()):l&&h?e.forEach(function(e){var t=(0,_util.getRowid)(o,e),r=_xeUtils.default.findTree(n,function(e){return t===(0,_util.getRowid)(o,e)},{children:p}),r=(r&&(r=r.items.splice(r.index,1),g.push(r[0])),_xeUtils.default.findTree(n,function(e){return t===(0,_util.getRowid)(o,e)},{children:_})),r=(r&&r.items.splice(r.index,1),o.findRowIndexOf(i,e));-1<r&&i.splice(r,1)}):e.forEach(function(e){var t=o.findRowIndexOf(r,e),n=(-1<t&&(t=r.splice(t,1),g.push(t[0])),o.findRowIndexOf(i,e));-1<n&&(a.forEach(function(e){var t=e.row,r=e.rowspan;n<t?e.row=t-1:n<t+r&&(e.rowspan=r-1)}),i.splice(n,1))}),f.row&&-1<this.findRowIndexOf(e,f.row)&&this.clearEdit(),e.forEach(function(e){var t=(0,_util.getRowid)(o,e),e=o.findRowIndexOf(w,e);-1<e&&w.splice(e,1),delete v[t]}),this.handleTableData(l&&h),l&&h||this.updateAfterDataIndex(),this.updateFooter(),this.cacheRowMap(),this.checkSelectionStatus(),this.scrollYLoad&&this.updateScrollYSpace(),this.$nextTick().then(function(){return o.updateCellAreas(),o.recalculate()}).then(function(){return{row:g.length?g[g.length-1]:null,rows:g}})},_removeCheckboxRow:function(){var t=this;return this.remove(this.getCheckboxRecords()).then(function(e){return t.clearCheckboxRow(),e})},_removeRadioRow:function(){var t=this,e=this.getRadioRecord();return this.remove(e||[]).then(function(e){return t.clearRadioRow(),e})},_removeCurrentRow:function(){var t=this,e=this.getCurrentRecord();return this.remove(e||[]).then(function(e){return t.clearCurrentRow(),e})},_getRecordset:function(){return{insertRecords:this.getInsertRecords(),removeRecords:this.getRemoveRecords(),updateRecords:this.getUpdateRecords(),pendingRecords:this.getPendingRecords()}},_getInsertRecords:function(){var r=this,n=this.fullAllDataRowIdData,e=this.editStore.insertList,o=[];return e.forEach(function(e){var t=(0,_util.getRowid)(r,e);n[t]&&o.push(e)}),o},_getRemoveRecords:function(){return this.editStore.removeList},_getUpdateRecords:function(){var e=this.keepSource,t=this.tableFullData,r=this.isUpdateByRow,n=this.treeConfig,o=this.treeOpts,i=this.editStore;return e?(i=(e=i.actived).row,e=e.column,(i||e)&&this._syncActivedCell(),n?_xeUtils.default.filterTree(t,function(e){return r(e)},o):t.filter(function(e){return r(e)})):[]},handleActived:function(e,t){var r,n=this,o=this.editStore,i=this.editOpts,l=this.tableColumn,a=this.editConfig,s=this.mouseConfig,u=i.mode,c=o.actived,o=o.focused,d=e.row,f=e.column,h=f.editRender,p=e.cell=e.cell||this.getCell(d,f),_=i.beforeEditMethod||i.activeMethod;return p&&(0,_utils.isEnableConf)(a)&&(0,_utils.isEnableConf)(h)&&(this.hasPendingByRow(d)||(c.row!==d||"cell"===u&&c.column!==f?(a="edit-disabled",_&&!_(_objectSpread(_objectSpread({},e),{},{$table:this,$grid:this.$xegrid}))||(s&&(this.clearSelected(t),this.clearCellAreas(t),this.clearCopyCellArea(t)),this.closeTooltip(),c.column&&this.clearEdit(t),a="edit-activated",f.renderHeight=p.offsetHeight,c.args=e,c.row=d,c.column=f,"row"===u?l.forEach(function(e){return n._getColumnModel(d,e)}):this._getColumnModel(d,f),r=i.afterEditMethod,this.$nextTick(function(){n.handleFocus(e,t),r&&r(_objectSpread(_objectSpread({},e),{},{$table:n,$grid:n.$xegrid}))})),this.emitEvent(a,{row:d,rowIndex:this.getRowIndex(d),$rowIndex:this.getVMRowIndex(d),column:f,columnIndex:this.getColumnIndex(f),$columnIndex:this.getVMColumnIndex(f)},t),"edit-activated"===a&&this.emitEvent("edit-actived",{row:d,rowIndex:this.getRowIndex(d),$rowIndex:this.getVMRowIndex(d),column:f,columnIndex:this.getColumnIndex(f),$columnIndex:this.getVMColumnIndex(f)},t)):(h=c.column,s&&(this.clearSelected(t),this.clearCellAreas(t),this.clearCopyCellArea(t)),h!==f&&((_=h.model).update&&_utils.default.setCellValue(d,h,_.value),this.clearValidate()),f.renderHeight=p.offsetHeight,c.args=e,c.column=f,setTimeout(function(){n.handleFocus(e,t)})),o.column=null,o.row=null,this.focus())),this.$nextTick()},_getColumnModel:function(e,t){var r=t.model;t.editRender&&(r.value=_utils.default.getCellValue(e,t),r.update=!1)},_setColumnModel:function(e,t){var r=t.model;t.editRender&&r.update&&(_utils.default.setCellValue(e,t,r.value),r.update=!1,r.value=null)},_syncActivedCell:function(){var t=this,e=this.tableColumn,r=this.editStore,n=this.editOpts,r=r.actived,o=r.row,r=r.column;(o||r)&&("row"===n.mode?e.forEach(function(e){return t._setColumnModel(o,e)}):this._setColumnModel(o,r))},_clearActived:function(e){return"development"===process.env.NODE_ENV&&(0,_log.warnLog)("vxe.error.delFunc",["clearActived","clearEdit"]),this.clearEdit(e)},_clearEdit:function(e){var t=this.editStore,r=t.actived,t=t.focused,n=r.row,o=r.column;return(n||o)&&(this._syncActivedCell(),r.args=null,r.row=null,r.column=null,this.updateFooter(),this.emitEvent("edit-closed",{row:n,rowIndex:this.getRowIndex(n),$rowIndex:this.getVMRowIndex(n),column:o,columnIndex:this.getColumnIndex(o),$columnIndex:this.getVMColumnIndex(o)},e)),t.row=null,t.column=null,"obsolete"===_conf.default.cellVaildMode&&this.clearValidate?this.clearValidate():this.$nextTick()},_getActiveRecord:function(){return"development"===process.env.NODE_ENV&&(0,_log.warnLog)("vxe.error.delFunc",["getActiveRecord","getEditRecord"]),this.getEditRecord()},_getEditRecord:function(){var e=this.$el,t=this.editStore,r=this.afterFullData,t=t.actived,n=t.args,t=t.row;return n&&-1<this.findRowIndexOf(r,t)&&e.querySelectorAll(".vxe-body--column.col--active").length?Object.assign({},n):null},_isActiveByRow:function(e){return"development"===process.env.NODE_ENV&&(0,_log.warnLog)("vxe.error.delFunc",["isActiveByRow","isEditByRow"]),this.isEditByRow(e)},_isEditByRow:function(e){return this.editStore.actived.row===e},handleFocus:function(e){var t,r,n,o=e.row,i=e.column,l=e.cell,a=i.editRender;(0,_utils.isEnableConf)(a)&&(n=_vXETable.default.renderer.get(a.name),t=a.autofocus,a=a.autoselect,!t&&n&&(t=n.autofocus),!a&&n&&(a=n.autoselect),_xeUtils.default.isFunction(t)?r=t.call(this,e):t&&(r=l.querySelector(t))&&r.focus(),r?a?r.select():_dom.browse.msie&&((n=r.createTextRange()).collapse(!1),n.select()):this.scrollToRow(o,i))},_setActiveRow:function(e){return"development"===process.env.NODE_ENV&&(0,_log.warnLog)("vxe.error.delFunc",["setActiveRow","setEditRow"]),this.setEditRow(e)},_setEditRow:function(e,t){var r=_xeUtils.default.find(this.visibleColumn,function(e){return(0,_utils.isEnableConf)(e.editRender)});return t&&(r=_xeUtils.default.isString(t)?this.getColumnByField(t):t),this.setEditCell(e,r)},_setActiveCell:function(e){return"development"===process.env.NODE_ENV&&(0,_log.warnLog)("vxe.error.delFunc",["setActiveCell","setEditCell"]),this.setEditCell(e)},_setEditCell:function(t,e){var r=this,n=this.editConfig,o=_xeUtils.default.isString(e)?this.getColumnByField(e):e;return t&&o&&(0,_utils.isEnableConf)(n)&&(0,_utils.isEnableConf)(o.editRender)?this.scrollToRow(t,!0).then(function(){var e=r.getCell(t,o);e&&(r.handleActived({row:t,rowIndex:r.getRowIndex(t),column:o,columnIndex:r.getColumnIndex(o),cell:e,$table:r}),r.lastCallTime=Date.now())}):this.$nextTick()},_setSelectCell:function(e,t){var r=this.tableData,n=this.editOpts,o=this.visibleColumn,t=_xeUtils.default.isString(t)?this.getColumnByField(t):t;return e&&t&&"manual"!==n.trigger&&-1<(n=this.findRowIndexOf(r,e))&&(r=this.getCell(e,t),e={row:e,rowIndex:n,column:t,columnIndex:o.indexOf(t),cell:r},this.handleSelected(e,{})),this.$nextTick()},handleSelected:function(e,t){var r=this,n=this.mouseConfig,o=this.mouseOpts,i=this.editOpts,l=this.editStore,a=l.actived,l=l.selected,s=e.row,u=e.column,n=n&&o.selected;return!n||l.row===s&&l.column===u||(a.row!==s||"cell"===i.mode&&a.column!==u)&&(r.clearEdit(t),r.clearSelected(t),r.clearCellAreas(t),r.clearCopyCellArea(t),l.args=e,l.row=s,l.column=u,n&&r.addColSdCls(),r.focus(),t)&&r.emitEvent("cell-selected",e,t),r.$nextTick()},_getSelectedCell:function(){var e=this.editStore.selected,t=e.args,e=e.column;return t&&e?Object.assign({},t):null},_clearSelected:function(){var e=this.editStore.selected;return e.row=null,e.column=null,this.reColTitleSdCls(),this.reColSdCls(),this.$nextTick()},reColTitleSdCls:function(){var e=this.elemStore["main-header-list"];e&&_xeUtils.default.arrayEach(e.querySelectorAll(".col--title-selected"),function(e){return _dom.default.removeClass(e,"col--title-selected")})},reColSdCls:function(){var e=this.$el.querySelector(".col--selected");e&&_dom.default.removeClass(e,"col--selected")},addColSdCls:function(){var e=this.editStore.selected,t=e.row,e=e.column;this.reColSdCls(),t&&e&&(t=this.getCell(t,e))&&_dom.default.addClass(t,"col--selected")}}};