vxe-table 3.7.0-beta.8 → 3.7.0-beta.9

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 (71) hide show
  1. package/lib/edit/src/mixin.js +7 -6
  2. package/lib/edit/src/mixin.min.js +1 -1
  3. package/lib/export/src/mixin.js +1 -1
  4. package/lib/export/src/mixin.min.js +1 -1
  5. package/lib/icon/style/style.css +1 -1
  6. package/lib/icon/style/style.min.css +1 -1
  7. package/lib/index.css +1 -1
  8. package/lib/index.umd.js +54 -57
  9. package/lib/index.umd.min.js +1 -1
  10. package/lib/style.css +1 -1
  11. package/lib/style.min.css +1 -1
  12. package/lib/table/src/body.js +2 -2
  13. package/lib/table/src/body.min.js +1 -1
  14. package/lib/table/src/cell.js +5 -3
  15. package/lib/table/src/cell.min.js +1 -1
  16. package/lib/table/src/columnInfo.js +3 -3
  17. package/lib/table/src/columnInfo.min.js +1 -1
  18. package/lib/table/src/methods.js +35 -29
  19. package/lib/table/src/methods.min.js +1 -1
  20. package/lib/table/src/table.js +11 -5
  21. package/lib/table/src/table.min.js +1 -1
  22. package/lib/table/src/util.js +1 -1
  23. package/lib/table/src/util.min.js +1 -1
  24. package/lib/table/style/style.css +5 -0
  25. package/lib/table/style/style.min.css +1 -1
  26. package/lib/toolbar/src/toolbar.js +5 -1
  27. package/lib/toolbar/src/toolbar.min.js +1 -1
  28. package/lib/tools/log.js +1 -1
  29. package/lib/tools/log.min.js +1 -1
  30. package/lib/tooltip/style/style.css +0 -6
  31. package/lib/tooltip/style/style.min.css +1 -1
  32. package/lib/v-x-e-table/index.js +1 -1
  33. package/lib/v-x-e-table/index.min.js +1 -1
  34. package/lib/v-x-e-table/src/commands.js +7 -5
  35. package/lib/v-x-e-table/src/commands.min.js +1 -1
  36. package/lib/v-x-e-table/src/conf.js +3 -3
  37. package/lib/v-x-e-table/src/conf.min.js +1 -1
  38. package/lib/v-x-e-table/src/formats.js +7 -5
  39. package/lib/v-x-e-table/src/formats.min.js +1 -1
  40. package/lib/v-x-e-table/src/menus.js +7 -5
  41. package/lib/v-x-e-table/src/menus.min.js +1 -1
  42. package/lib/validator/src/mixin.js +10 -0
  43. package/lib/validator/src/mixin.min.js +1 -1
  44. package/package.json +1 -1
  45. package/packages/edit/src/mixin.js +6 -6
  46. package/packages/export/src/mixin.js +1 -1
  47. package/packages/table/src/body.js +2 -2
  48. package/packages/table/src/cell.js +3 -3
  49. package/packages/table/src/columnInfo.js +3 -3
  50. package/packages/table/src/methods.js +32 -32
  51. package/packages/table/src/table.js +11 -5
  52. package/packages/table/src/util.js +1 -1
  53. package/packages/toolbar/src/toolbar.js +4 -1
  54. package/packages/v-x-e-table/src/commands.js +6 -4
  55. package/packages/v-x-e-table/src/conf.js +3 -3
  56. package/packages/v-x-e-table/src/formats.js +6 -4
  57. package/packages/v-x-e-table/src/menus.js +6 -4
  58. package/packages/validator/src/mixin.js +10 -0
  59. package/styles/table.scss +7 -0
  60. package/styles/tooltip.scss +0 -8
  61. package/types/all.d.ts +2 -2
  62. package/types/table.d.ts +20 -4
  63. package/types/v-x-e-table/formats.d.ts +1 -1
  64. package/types/v-x-e-table/index.d.ts +3 -3
  65. package/types/v-x-e-table/setup.d.ts +10 -33
  66. /package/lib/icon/style/{iconfont.1690504677290.ttf → iconfont.1690761747506.ttf} +0 -0
  67. /package/lib/icon/style/{iconfont.1690504677290.woff → iconfont.1690761747506.woff} +0 -0
  68. /package/lib/icon/style/{iconfont.1690504677290.woff2 → iconfont.1690761747506.woff2} +0 -0
  69. /package/lib/{iconfont.1690504677290.ttf → iconfont.1690761747506.ttf} +0 -0
  70. /package/lib/{iconfont.1690504677290.woff → iconfont.1690761747506.woff} +0 -0
  71. /package/lib/{iconfont.1690504677290.woff2 → iconfont.1690761747506.woff2} +0 -0
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var iconPrefix="vxe-icon-",_default={size:null,zIndex:999,version:0,emptyCell:" ",table:{fit:!0,showHeader:!0,animat:!0,delayHover:250,autoResize:!0,minHeight:144,resizeConfig:{refreshDelay:250},radioConfig:{strict:!0},checkboxConfig:{strict:!0},tooltipConfig:{enterable:!0},validConfig:{showMessage:!0,autoClear:!0,message:"inline",msgMode:"single"},columnConfig:{maxFixedSize:4},sortConfig:{showIcon:!0},filterConfig:{showIcon:!0},treeConfig:{rowField:"id",parentField:"parentId",children:"children",hasChild:"hasChild",mapChildren:"_X_ROW_CHILD",indent:20,showIcon:!0},expandConfig:{showIcon:!0},editConfig:{showIcon:!0,showAsterisk:!0},importConfig:{modes:["insert","covering"]},exportConfig:{modes:["current","selected"]},printConfig:{modes:["current","selected"]},mouseConfig:{extension:!0},keyboardConfig:{isEsc:!0},areaConfig:{selectCellByHeader:!0},clipConfig:{isCopy:!0,isCut:!0,isPaste:!0},fnrConfig:{isFind:!0,isReplace:!0},scrollX:{enabled:!0,gt:60},scrollY:{enabled:!0,gt:100}},export:{types:{}},icon:{LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",TABLE_SORT_ASC:iconPrefix+"caret-up",TABLE_SORT_DESC:iconPrefix+"caret-down",TABLE_FILTER_NONE:iconPrefix+"funnel",TABLE_FILTER_MATCH:iconPrefix+"funnel",TABLE_EDIT:iconPrefix+"edit",TABLE_HELP:iconPrefix+"question-circle-fill",TABLE_TREE_LOADED:iconPrefix+"spinner roll",TABLE_TREE_OPEN:iconPrefix+"caret-right rotate90",TABLE_TREE_CLOSE:iconPrefix+"caret-right",TABLE_EXPAND_LOADED:iconPrefix+"spinner roll",TABLE_EXPAND_OPEN:iconPrefix+"arrow-right rotate90",TABLE_EXPAND_CLOSE:iconPrefix+"arrow-right",TABLE_CHECKBOX_CHECKED:iconPrefix+"checkbox-checked",TABLE_CHECKBOX_UNCHECKED:iconPrefix+"checkbox-unchecked",TABLE_CHECKBOX_INDETERMINATE:iconPrefix+"checkbox-indeterminate",TABLE_RADIO_CHECKED:iconPrefix+"radio-checked",TABLE_RADIO_UNCHECKED:iconPrefix+"radio-unchecked",BUTTON_DROPDOWN:iconPrefix+"arrow-down",BUTTON_LOADING:iconPrefix+"spinner roll",SELECT_LOADED:iconPrefix+"spinner roll",SELECT_OPEN:iconPrefix+"caret-down rotate180",SELECT_CLOSE:iconPrefix+"caret-down",PAGER_JUMP_PREV:iconPrefix+"arrow-double-left",PAGER_JUMP_NEXT:iconPrefix+"arrow-double-right",PAGER_PREV_PAGE:iconPrefix+"arrow-left",PAGER_NEXT_PAGE:iconPrefix+"arrow-right",PAGER_JUMP_MORE:iconPrefix+"ellipsis-h",INPUT_CLEAR:iconPrefix+"error-circle-fill",INPUT_PWD:iconPrefix+"eye-fill",INPUT_SHOW_PWD:iconPrefix+"eye-fill-close",INPUT_PREV_NUM:iconPrefix+"caret-up",INPUT_NEXT_NUM:iconPrefix+"caret-down",INPUT_DATE:iconPrefix+"calendar",INPUT_SEARCH:iconPrefix+"search",MODAL_ZOOM_IN:iconPrefix+"square",MODAL_ZOOM_OUT:iconPrefix+"maximize",MODAL_CLOSE:iconPrefix+"close",MODAL_INFO:iconPrefix+"info-circle-fill",MODAL_SUCCESS:iconPrefix+"success-circle-fill",MODAL_WARNING:iconPrefix+"warnion-circle-fill",MODAL_ERROR:iconPrefix+"error-circle-fill",MODAL_QUESTION:iconPrefix+"question-circle-fill",MODAL_LOADING:iconPrefix+"spinner roll",TOOLBAR_TOOLS_REFRESH:iconPrefix+"repeat",TOOLBAR_TOOLS_REFRESH_LOADING:iconPrefix+"repeat roll",TOOLBAR_TOOLS_IMPORT:iconPrefix+"upload",TOOLBAR_TOOLS_EXPORT:iconPrefix+"download",TOOLBAR_TOOLS_PRINT:iconPrefix+"print",TOOLBAR_TOOLS_FULLSCREEN:iconPrefix+"fullscreen",TOOLBAR_TOOLS_MINIMIZE:iconPrefix+"minimize",TOOLBAR_TOOLS_CUSTOM:iconPrefix+"custom-column",TOOLBAR_TOOLS_FIXED_LEFT:iconPrefix+"fixed-left",TOOLBAR_TOOLS_FIXED_LEFT_ACTIVED:iconPrefix+"fixed-left-fill",TOOLBAR_TOOLS_FIXED_RIGHT:iconPrefix+"fixed-right",TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVED:iconPrefix+"fixed-right-fill",FORM_PREFIX:iconPrefix+"question-circle-fill",FORM_SUFFIX:iconPrefix+"question-circle-fill",FORM_FOLDING:iconPrefix+"arrow-up rotate180",FORM_UNFOLDING:iconPrefix+"arrow-up"},grid:{formConfig:{enabled:!0},pagerConfig:{enabled:!0},toolbarConfig:{enabled:!0},proxyConfig:{enabled:!0,autoLoad:!0,message:!0,props:{list:null,result:"result",total:"page.total",message:"message"}}},tooltip:{trigger:"hover",theme:"dark",enterDelay:500,leaveDelay:300},pager:{},form:{validConfig:{showMessage:!0,autoPos:!0},tooltipConfig:{enterable:!0},titleAsterisk:!0},input:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1,digits:2,controls:!0},textarea:{},select:{multiCharOverflow:8},toolbar:{custom:{allowFixed:!0,showFooter:!0}},button:{},radio:{strict:!0},radioButton:{strict:!0},radioGroup:{strict:!0},checkbox:{},switch:{},modal:{top:15,showHeader:!0,minWidth:340,minHeight:140,lockView:!0,mask:!0,duration:3e3,marginSize:0,dblclickZoom:!0,showTitleOverflow:!0,animat:!0,showClose:!0,draggable:!0,storageKey:"VXE_MODAL_POSITION"},list:{scrollY:{enabled:!0,gt:100}},i18n:function(e){return e}};exports.default=_default;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var iconPrefix="vxe-icon-",_default={size:null,zIndex:999,version:0,emptyCell:" ",table:{fit:!0,showHeader:!0,animat:!0,delayHover:250,autoResize:!0,minHeight:144,resizeConfig:{refreshDelay:250},radioConfig:{strict:!0},checkboxConfig:{strict:!0},tooltipConfig:{enterable:!0},validConfig:{showMessage:!0,autoClear:!0,message:"inline",msgMode:"single"},columnConfig:{maxFixedSize:4},sortConfig:{showIcon:!0},filterConfig:{showIcon:!0},treeConfig:{rowField:"id",parentField:"parentId",childrenField:"children",hasChildField:"hasChild",mapChildrenField:"_X_ROW_CHILD",indent:20,showIcon:!0},expandConfig:{showIcon:!0},editConfig:{showIcon:!0,showAsterisk:!0},importConfig:{modes:["insert","covering"]},exportConfig:{modes:["current","selected"]},printConfig:{modes:["current","selected"]},mouseConfig:{extension:!0},keyboardConfig:{isEsc:!0},areaConfig:{selectCellByHeader:!0},clipConfig:{isCopy:!0,isCut:!0,isPaste:!0},fnrConfig:{isFind:!0,isReplace:!0},scrollX:{enabled:!0,gt:60},scrollY:{enabled:!0,gt:100}},export:{types:{}},icon:{LOADING:iconPrefix+"spinner roll vxe-loading--default-icon",TABLE_SORT_ASC:iconPrefix+"caret-up",TABLE_SORT_DESC:iconPrefix+"caret-down",TABLE_FILTER_NONE:iconPrefix+"funnel",TABLE_FILTER_MATCH:iconPrefix+"funnel",TABLE_EDIT:iconPrefix+"edit",TABLE_HELP:iconPrefix+"question-circle-fill",TABLE_TREE_LOADED:iconPrefix+"spinner roll",TABLE_TREE_OPEN:iconPrefix+"caret-right rotate90",TABLE_TREE_CLOSE:iconPrefix+"caret-right",TABLE_EXPAND_LOADED:iconPrefix+"spinner roll",TABLE_EXPAND_OPEN:iconPrefix+"arrow-right rotate90",TABLE_EXPAND_CLOSE:iconPrefix+"arrow-right",TABLE_CHECKBOX_CHECKED:iconPrefix+"checkbox-checked",TABLE_CHECKBOX_UNCHECKED:iconPrefix+"checkbox-unchecked",TABLE_CHECKBOX_INDETERMINATE:iconPrefix+"checkbox-indeterminate",TABLE_RADIO_CHECKED:iconPrefix+"radio-checked",TABLE_RADIO_UNCHECKED:iconPrefix+"radio-unchecked",BUTTON_DROPDOWN:iconPrefix+"arrow-down",BUTTON_LOADING:iconPrefix+"spinner roll",SELECT_LOADED:iconPrefix+"spinner roll",SELECT_OPEN:iconPrefix+"caret-down rotate180",SELECT_CLOSE:iconPrefix+"caret-down",PAGER_JUMP_PREV:iconPrefix+"arrow-double-left",PAGER_JUMP_NEXT:iconPrefix+"arrow-double-right",PAGER_PREV_PAGE:iconPrefix+"arrow-left",PAGER_NEXT_PAGE:iconPrefix+"arrow-right",PAGER_JUMP_MORE:iconPrefix+"ellipsis-h",INPUT_CLEAR:iconPrefix+"error-circle-fill",INPUT_PWD:iconPrefix+"eye-fill",INPUT_SHOW_PWD:iconPrefix+"eye-fill-close",INPUT_PREV_NUM:iconPrefix+"caret-up",INPUT_NEXT_NUM:iconPrefix+"caret-down",INPUT_DATE:iconPrefix+"calendar",INPUT_SEARCH:iconPrefix+"search",MODAL_ZOOM_IN:iconPrefix+"square",MODAL_ZOOM_OUT:iconPrefix+"maximize",MODAL_CLOSE:iconPrefix+"close",MODAL_INFO:iconPrefix+"info-circle-fill",MODAL_SUCCESS:iconPrefix+"success-circle-fill",MODAL_WARNING:iconPrefix+"warnion-circle-fill",MODAL_ERROR:iconPrefix+"error-circle-fill",MODAL_QUESTION:iconPrefix+"question-circle-fill",MODAL_LOADING:iconPrefix+"spinner roll",TOOLBAR_TOOLS_REFRESH:iconPrefix+"repeat",TOOLBAR_TOOLS_REFRESH_LOADING:iconPrefix+"repeat roll",TOOLBAR_TOOLS_IMPORT:iconPrefix+"upload",TOOLBAR_TOOLS_EXPORT:iconPrefix+"download",TOOLBAR_TOOLS_PRINT:iconPrefix+"print",TOOLBAR_TOOLS_FULLSCREEN:iconPrefix+"fullscreen",TOOLBAR_TOOLS_MINIMIZE:iconPrefix+"minimize",TOOLBAR_TOOLS_CUSTOM:iconPrefix+"custom-column",TOOLBAR_TOOLS_FIXED_LEFT:iconPrefix+"fixed-left",TOOLBAR_TOOLS_FIXED_LEFT_ACTIVED:iconPrefix+"fixed-left-fill",TOOLBAR_TOOLS_FIXED_RIGHT:iconPrefix+"fixed-right",TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVED:iconPrefix+"fixed-right-fill",FORM_PREFIX:iconPrefix+"question-circle-fill",FORM_SUFFIX:iconPrefix+"question-circle-fill",FORM_FOLDING:iconPrefix+"arrow-up rotate180",FORM_UNFOLDING:iconPrefix+"arrow-up"},grid:{formConfig:{enabled:!0},pagerConfig:{enabled:!0},toolbarConfig:{enabled:!0},proxyConfig:{enabled:!0,autoLoad:!0,message:!0,props:{list:null,result:"result",total:"page.total",message:"message"}}},tooltip:{trigger:"hover",theme:"dark",enterDelay:500,leaveDelay:300},pager:{},form:{validConfig:{showMessage:!0,autoPos:!0},tooltipConfig:{enterable:!0},titleAsterisk:!0},input:{startDate:new Date(1900,0,1),endDate:new Date(2100,0,1),startDay:1,selectDay:1,digits:2,controls:!0},textarea:{},select:{multiCharOverflow:8},toolbar:{custom:{allowFixed:!0,showFooter:!0}},button:{},radio:{strict:!0},radioButton:{strict:!0},radioGroup:{strict:!0},checkbox:{},switch:{},modal:{top:15,showHeader:!0,minWidth:340,minHeight:140,lockView:!0,mask:!0,duration:3e3,marginSize:0,dblclickZoom:!0,showTitleOverflow:!0,animat:!0,showClose:!0,draggable:!0,storageKey:"VXE_MODAL_POSITION"},list:{scrollY:{enabled:!0,gt:100}},i18n:function(e){return e}};exports.default=_default;
@@ -34,11 +34,13 @@ var VXEFormatsStore = /*#__PURE__*/function () {
34
34
  value: function add(name, render) {
35
35
  var conf = this.store[name];
36
36
  // 兼容
37
- if (_xeUtils["default"].isFunction(render)) {
38
- // warnLog('vxe.error.delProp', ['callback', 'formatMethod'])
39
- render = {
40
- formatMethod: render
41
- };
37
+ if (process.env.NODE_ENV === 'development') {
38
+ if (_xeUtils["default"].isFunction(render)) {
39
+ (0, _log.warnLog)('vxe.error.delProp', ['callback', 'cellFormatMethod']);
40
+ render = {
41
+ cellFormatMethod: render
42
+ };
43
+ }
42
44
  }
43
45
 
44
46
  // 检测是否覆盖
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.formats=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_log=require("../../tools/log");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var VXEFormatsStore=function(){function n(){_classCallCheck(this,n),this.store={}}return _createClass(n,[{key:"mixin",value:function(e){var r=this;return _xeUtils.default.each(e,function(e,t){r.add(t,e)}),n}},{key:"get",value:function(e){return this.store[e]}},{key:"add",value:function(r,e){var o,t=this.store[r];return _xeUtils.default.isFunction(e)&&(e={formatMethod:e}),"development"===process.env.NODE_ENV&&(o=_xeUtils.default.keys(t),_xeUtils.default.each(e,function(e,t){o.includes(t)&&(0,_log.warnLog)("vxe.error.coverProp",[r,t])})),this.store[r]=t?_xeUtils.default.merge(t,e):e,n}},{key:"delete",value:function(e){return delete this.store[e],n}}]),n}(),formats=new VXEFormatsStore;exports.formats=formats,"development"===process.env.NODE_ENV&&Object.assign(formats,{_name:"Formats"});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.formats=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_log=require("../../tools/log");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var VXEFormatsStore=function(){function n(){_classCallCheck(this,n),this.store={}}return _createClass(n,[{key:"mixin",value:function(e){var r=this;return _xeUtils.default.each(e,function(e,t){r.add(t,e)}),n}},{key:"get",value:function(e){return this.store[e]}},{key:"add",value:function(r,e){var o,t=this.store[r];return"development"===process.env.NODE_ENV&&_xeUtils.default.isFunction(e)&&((0,_log.warnLog)("vxe.error.delProp",["callback","cellFormatMethod"]),e={cellFormatMethod:e}),"development"===process.env.NODE_ENV&&(o=_xeUtils.default.keys(t),_xeUtils.default.each(e,function(e,t){o.includes(t)&&(0,_log.warnLog)("vxe.error.coverProp",[r,t])})),this.store[r]=t?_xeUtils.default.merge(t,e):e,n}},{key:"delete",value:function(e){return delete this.store[e],n}}]),n}(),formats=new VXEFormatsStore;exports.formats=formats,"development"===process.env.NODE_ENV&&Object.assign(formats,{_name:"Formats"});
@@ -34,11 +34,13 @@ var VXEMenusStore = /*#__PURE__*/function () {
34
34
  value: function add(name, render) {
35
35
  var conf = this.store[name];
36
36
  // 兼容
37
- if (_xeUtils["default"].isFunction(render)) {
38
- // warnLog('vxe.error.delProp', ['callback', 'menuMethod'])
39
- render = {
40
- menuMethod: render
41
- };
37
+ if (process.env.NODE_ENV === 'development') {
38
+ if (_xeUtils["default"].isFunction(render)) {
39
+ (0, _log.warnLog)('vxe.error.delProp', ['callback', 'menuMethod']);
40
+ render = {
41
+ menuMethod: render
42
+ };
43
+ }
42
44
  }
43
45
 
44
46
  // 检测是否覆盖
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.menus=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_log=require("../../tools/log");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var VXEMenusStore=function(){function o(){_classCallCheck(this,o),this.store={}}return _createClass(o,[{key:"mixin",value:function(e){var r=this;return _xeUtils.default.each(e,function(e,t){r.add(t,e)}),o}},{key:"get",value:function(e){return this.store[e]}},{key:"add",value:function(r,e){var n,t=this.store[r];return _xeUtils.default.isFunction(e)&&(e={menuMethod:e}),"development"===process.env.NODE_ENV&&(n=_xeUtils.default.keys(t),_xeUtils.default.each(e,function(e,t){n.includes(t)&&(0,_log.warnLog)("vxe.error.coverProp",[r,t])})),this.store[r]=t?_xeUtils.default.merge(t,e):e,o}},{key:"delete",value:function(e){return delete this.store[e],o}}]),o}(),menus=new VXEMenusStore;exports.menus=menus,"development"===process.env.NODE_ENV&&Object.assign(menus,{_name:"Menus"});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.menus=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_log=require("../../tools/log");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var VXEMenusStore=function(){function o(){_classCallCheck(this,o),this.store={}}return _createClass(o,[{key:"mixin",value:function(e){var r=this;return _xeUtils.default.each(e,function(e,t){r.add(t,e)}),o}},{key:"get",value:function(e){return this.store[e]}},{key:"add",value:function(r,e){var n,t=this.store[r];return"development"===process.env.NODE_ENV&&_xeUtils.default.isFunction(e)&&((0,_log.warnLog)("vxe.error.delProp",["callback","menuMethod"]),e={menuMethod:e}),"development"===process.env.NODE_ENV&&(n=_xeUtils.default.keys(t),_xeUtils.default.each(e,function(e,t){n.includes(t)&&(0,_log.warnLog)("vxe.error.coverProp",[r,t])})),this.store[r]=t?_xeUtils.default.merge(t,e):e,o}},{key:"delete",value:function(e){return delete this.store[e],o}}]),o}(),menus=new VXEMenusStore;exports.menus=menus,"development"===process.env.NODE_ENV&&Object.assign(menus,{_name:"Menus"});
@@ -81,12 +81,22 @@ var _default = {
81
81
  * 完整校验,和 validate 的区别就是会给有效数据中的每一行进行校验
82
82
  */
83
83
  _fullValidate: function _fullValidate(rows, cb) {
84
+ if (process.env.NODE_ENV === 'development') {
85
+ if (_xeUtils["default"].isFunction(cb)) {
86
+ (0, _log.warnLog)('vxe.error.notValidators', ['fullValidate(rows, callback)', 'fullValidate(rows)']);
87
+ }
88
+ }
84
89
  return this.beginValidate(rows, cb, true);
85
90
  },
86
91
  /**
87
92
  * 快速校验,如果存在记录不通过的记录,则返回不再继续校验(异步校验除外)
88
93
  */
89
94
  _validate: function _validate(rows, cb) {
95
+ if (process.env.NODE_ENV === 'development') {
96
+ if (_xeUtils["default"].isFunction(cb)) {
97
+ (0, _log.warnLog)('vxe.error.notValidators', ['validate(rows, callback)', 'validate(rows)']);
98
+ }
99
+ }
90
100
  return this.beginValidate(rows, cb);
91
101
  },
92
102
  /**
@@ -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=require("../../tools/utils"),_log=require("../../tools/log"),_dom=_interopRequireDefault(require("../../tools/dom"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var l=t[r];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Rule=function(){function t(e){_classCallCheck(this,t),Object.assign(this,{$options:e,required:e.required,min:e.min,max:e.max,type:e.type,pattern:e.pattern,validator:e.validator,trigger:e.trigger,maxWidth:e.maxWidth})}return _createClass(t,[{key:"content",get:function(){return(0,_utils.getFuncText)(this.$options.content||this.$options.message)}},{key:"message",get:function(){return this.content}}]),t}();function validErrorRuleValue(e,t){var r=e.type,l=e.min,i=e.max,e=e.pattern,r="number"===r,n=r?_xeUtils.default.toNumber(t):_xeUtils.default.getSize(t);return!(!r||!isNaN(t))||!_xeUtils.default.eqNull(l)&&n<_xeUtils.default.toNumber(l)||!_xeUtils.default.eqNull(i)&&n>_xeUtils.default.toNumber(i)||!(!e||(_xeUtils.default.isRegExp(e)?e:new RegExp(e)).test(t))}var _default={methods:{_fullValidate:function(e,t){return this.beginValidate(e,t,!0)},_validate:function(e,t){return this.beginValidate(e,t)},handleValidError:function(t){var r=this;return new Promise(function(e){!1===r.validOpts.autoPos?(r.emitEvent("valid-error",t),e()):r.handleActived(t,{type:"valid-error",trigger:"call"}).then(function(){setTimeout(function(){e(r.showValidTooltip(t))},10)})})},beginValidate:function(e,a,l){var t,i,u=this,s={},n=this.editRules,c=this.afterFullData,d=this.treeConfig,r=this.treeOpts,o=(!0===e?t=c:e&&(_xeUtils.default.isFunction(e)?a=e:t=_xeUtils.default.isArray(e)?e:[e]),t=t||this.getInsertRecords().concat(this.getUpdateRecords()),[]);return this.lastCallTime=Date.now(),this.validRuleErr=!1,this.clearValidate(),n?(i=this.getColumns(),e=function(r){var e;!l&&u.validRuleErr||(e=[],i.forEach(function(t){!l&&u.validRuleErr||!_xeUtils.default.has(n,t.property)||e.push(u.validCellRules("all",r,t).catch(function(e){e={rule:e.rule,rules:e.rules,rowIndex:u.getRowIndex(r),row:r,columnIndex:u.getColumnIndex(t),column:t,field:t.property,$table:u};if(s[t.property]||(s[t.property]=[]),s[t.property].push(e),!l)return u.validRuleErr=!0,Promise.reject(e)}))}),o.push(Promise.all(e)))},d?_xeUtils.default.eachTree(t,e,r):t.forEach(e),Promise.all(o).then(function(){var e=Object.keys(s);return u.$nextTick().then(function(){if(e.length)return Promise.reject(s[e[0]][0]);a&&a()})}).catch(function(o){return new Promise(function(e,t){function r(){u.$nextTick(function(){a?(a(s),e()):("obsolete"===_conf.default.validToReject?t:e)(s)})}function l(){o.cell=u.getCell(o.row,o.column),_dom.default.scrollToView(o.cell),u.handleValidError(o).then(r)}var i=o.row,n=c.indexOf(i),n=0<n?c[n-1]:i;!1===u.validOpts.autoPos?r():(d?u.scrollToTreeRow(n):u.scrollToRow(n)).then(l)})})):this.$nextTick().then(function(){a&&a()})},hasCellRules:function(t,e,r){var l=this.editRules,r=r.property;return!(!r||!l)&&(l=_xeUtils.default.get(l,r))&&_xeUtils.default.find(l,function(e){return"all"===t||!e.trigger||t===e.trigger})},validCellRules:function(u,s,c,e){var d,f,h=this,t=this.editRules,r=c.property,p=[],g=[];return r&&t&&(d=_xeUtils.default.get(t,r))&&(f=_xeUtils.default.isUndefined(e)?_xeUtils.default.get(s,r):e,d.forEach(function(t){var e,r,l,i=t.type,n=t.trigger,o=t.required,a=t.validator;"all"!==u&&n&&u!==n||(a?(l={cellValue:f,rule:t,rules:d,row:s,rowIndex:h.getRowIndex(s),column:c,columnIndex:h.getColumnIndex(c),field:c.property,$table:h},_xeUtils.default.isString(a)?(r=_vXETable.default.validators.get(a))?r.cellValidatorMethod?e=r.cellValidatorMethod(l):"development"===process.env.NODE_ENV&&(0,_log.warnLog)("vxe.error.notValidators",[a]):"development"===process.env.NODE_ENV&&(0,_log.errLog)("vxe.error.notValidators",[a]):e=a(l),e&&(_xeUtils.default.isError(e)?(h.validRuleErr=!0,p.push(new Rule({type:"custom",trigger:n,content:e.message,rule:new Rule(t)}))):e.catch&&g.push(e.catch(function(e){h.validRuleErr=!0,p.push(new Rule({type:"custom",trigger:n,content:e&&e.message?e.message:t.content||t.message,rule:new Rule(t)}))})))):(r="array"===i,a=_xeUtils.default.isArray(f),l=!0,l=r||a?!a||!f.length:_xeUtils.default.isString(f)?(0,_utils.eqEmptyValue)(f.trim()):(0,_utils.eqEmptyValue)(f),(o?l||validErrorRuleValue(t,f):!l&&validErrorRuleValue(t,f))&&(h.validRuleErr=!0,p.push(new Rule(t)))))})),Promise.all(g).then(function(){if(p.length)return Promise.reject({rules:p,rule:p[0]})})},_clearValidate:function(){var e=this.$refs.validTip;return Object.assign(this.validStore,{visible:!1,row:null,column:null,content:"",rule:null}),e&&e.visible&&e.close(),this.$nextTick()},triggerValidate:function(t){var r=this,e=this.editConfig,l=this.editStore,i=this.editRules,n=this.validStore,l=l.actived;if(l.row&&i){var i=l.args,o=i.row,a=i.column,u=i.cell;if(this.hasCellRules(t,o,a))return this.validCellRules(t,o,a).then(function(){"row"===e.mode&&n.visible&&n.row===o&&n.column===a&&r.clearValidate()}).catch(function(e){var e=e.rule;return e.trigger&&t!==e.trigger?Promise.resolve():(r.showValidTooltip(e={rule:e,row:o,column:a,cell:u}),Promise.reject(e))})}return Promise.resolve()},showValidTooltip:function(e){var t=this,r=this.$refs,l=this.height,i=this.tableData,n=this.validOpts,o=e.rule,a=e.row,u=e.column,s=e.cell,c=r.validTip,d=o.content;return this.$nextTick(function(){if(Object.assign(t.validStore,{row:a,column:u,rule:o,content:d,visible:!0}),t.emitEvent("valid-error",e),c&&("tooltip"===n.message||"default"===n.message&&!l&&i.length<2))return c.open(s,d)})}}};exports.default=_default;
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=require("../../tools/utils"),_log=require("../../tools/log"),_dom=_interopRequireDefault(require("../../tools/dom"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var l=t[r];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Rule=function(){function t(e){_classCallCheck(this,t),Object.assign(this,{$options:e,required:e.required,min:e.min,max:e.max,type:e.type,pattern:e.pattern,validator:e.validator,trigger:e.trigger,maxWidth:e.maxWidth})}return _createClass(t,[{key:"content",get:function(){return(0,_utils.getFuncText)(this.$options.content||this.$options.message)}},{key:"message",get:function(){return this.content}}]),t}();function validErrorRuleValue(e,t){var r=e.type,l=e.min,i=e.max,e=e.pattern,r="number"===r,n=r?_xeUtils.default.toNumber(t):_xeUtils.default.getSize(t);return!(!r||!isNaN(t))||!_xeUtils.default.eqNull(l)&&n<_xeUtils.default.toNumber(l)||!_xeUtils.default.eqNull(i)&&n>_xeUtils.default.toNumber(i)||!(!e||(_xeUtils.default.isRegExp(e)?e:new RegExp(e)).test(t))}var _default={methods:{_fullValidate:function(e,t){return"development"===process.env.NODE_ENV&&_xeUtils.default.isFunction(t)&&(0,_log.warnLog)("vxe.error.notValidators",["fullValidate(rows, callback)","fullValidate(rows)"]),this.beginValidate(e,t,!0)},_validate:function(e,t){return"development"===process.env.NODE_ENV&&_xeUtils.default.isFunction(t)&&(0,_log.warnLog)("vxe.error.notValidators",["validate(rows, callback)","validate(rows)"]),this.beginValidate(e,t)},handleValidError:function(t){var r=this;return new Promise(function(e){!1===r.validOpts.autoPos?(r.emitEvent("valid-error",t),e()):r.handleActived(t,{type:"valid-error",trigger:"call"}).then(function(){setTimeout(function(){e(r.showValidTooltip(t))},10)})})},beginValidate:function(e,a,l){var t,i,u=this,s={},n=this.editRules,c=this.afterFullData,d=this.treeConfig,r=this.treeOpts,o=(!0===e?t=c:e&&(_xeUtils.default.isFunction(e)?a=e:t=_xeUtils.default.isArray(e)?e:[e]),t=t||this.getInsertRecords().concat(this.getUpdateRecords()),[]);return this.lastCallTime=Date.now(),this.validRuleErr=!1,this.clearValidate(),n?(i=this.getColumns(),e=function(r){var e;!l&&u.validRuleErr||(e=[],i.forEach(function(t){!l&&u.validRuleErr||!_xeUtils.default.has(n,t.property)||e.push(u.validCellRules("all",r,t).catch(function(e){e={rule:e.rule,rules:e.rules,rowIndex:u.getRowIndex(r),row:r,columnIndex:u.getColumnIndex(t),column:t,field:t.property,$table:u};if(s[t.property]||(s[t.property]=[]),s[t.property].push(e),!l)return u.validRuleErr=!0,Promise.reject(e)}))}),o.push(Promise.all(e)))},d?_xeUtils.default.eachTree(t,e,r):t.forEach(e),Promise.all(o).then(function(){var e=Object.keys(s);return u.$nextTick().then(function(){if(e.length)return Promise.reject(s[e[0]][0]);a&&a()})}).catch(function(o){return new Promise(function(e,t){function r(){u.$nextTick(function(){a?(a(s),e()):("obsolete"===_conf.default.validToReject?t:e)(s)})}function l(){o.cell=u.getCell(o.row,o.column),_dom.default.scrollToView(o.cell),u.handleValidError(o).then(r)}var i=o.row,n=c.indexOf(i),n=0<n?c[n-1]:i;!1===u.validOpts.autoPos?r():(d?u.scrollToTreeRow(n):u.scrollToRow(n)).then(l)})})):this.$nextTick().then(function(){a&&a()})},hasCellRules:function(t,e,r){var l=this.editRules,r=r.property;return!(!r||!l)&&(l=_xeUtils.default.get(l,r))&&_xeUtils.default.find(l,function(e){return"all"===t||!e.trigger||t===e.trigger})},validCellRules:function(u,s,c,e){var d,f,h=this,t=this.editRules,r=c.property,v=[],p=[];return r&&t&&(d=_xeUtils.default.get(t,r))&&(f=_xeUtils.default.isUndefined(e)?_xeUtils.default.get(s,r):e,d.forEach(function(t){var e,r,l,i=t.type,n=t.trigger,o=t.required,a=t.validator;"all"!==u&&n&&u!==n||(a?(l={cellValue:f,rule:t,rules:d,row:s,rowIndex:h.getRowIndex(s),column:c,columnIndex:h.getColumnIndex(c),field:c.property,$table:h},_xeUtils.default.isString(a)?(r=_vXETable.default.validators.get(a))?r.cellValidatorMethod?e=r.cellValidatorMethod(l):"development"===process.env.NODE_ENV&&(0,_log.warnLog)("vxe.error.notValidators",[a]):"development"===process.env.NODE_ENV&&(0,_log.errLog)("vxe.error.notValidators",[a]):e=a(l),e&&(_xeUtils.default.isError(e)?(h.validRuleErr=!0,v.push(new Rule({type:"custom",trigger:n,content:e.message,rule:new Rule(t)}))):e.catch&&p.push(e.catch(function(e){h.validRuleErr=!0,v.push(new Rule({type:"custom",trigger:n,content:e&&e.message?e.message:t.content||t.message,rule:new Rule(t)}))})))):(r="array"===i,a=_xeUtils.default.isArray(f),l=!0,l=r||a?!a||!f.length:_xeUtils.default.isString(f)?(0,_utils.eqEmptyValue)(f.trim()):(0,_utils.eqEmptyValue)(f),(o?l||validErrorRuleValue(t,f):!l&&validErrorRuleValue(t,f))&&(h.validRuleErr=!0,v.push(new Rule(t)))))})),Promise.all(p).then(function(){if(v.length)return Promise.reject({rules:v,rule:v[0]})})},_clearValidate:function(){var e=this.$refs.validTip;return Object.assign(this.validStore,{visible:!1,row:null,column:null,content:"",rule:null}),e&&e.visible&&e.close(),this.$nextTick()},triggerValidate:function(t){var r=this,e=this.editConfig,l=this.editStore,i=this.editRules,n=this.validStore,l=l.actived;if(l.row&&i){var i=l.args,o=i.row,a=i.column,u=i.cell;if(this.hasCellRules(t,o,a))return this.validCellRules(t,o,a).then(function(){"row"===e.mode&&n.visible&&n.row===o&&n.column===a&&r.clearValidate()}).catch(function(e){var e=e.rule;return e.trigger&&t!==e.trigger?Promise.resolve():(r.showValidTooltip(e={rule:e,row:o,column:a,cell:u}),Promise.reject(e))})}return Promise.resolve()},showValidTooltip:function(e){var t=this,r=this.$refs,l=this.height,i=this.tableData,n=this.validOpts,o=e.rule,a=e.row,u=e.column,s=e.cell,c=r.validTip,d=o.content;return this.$nextTick(function(){if(Object.assign(t.validStore,{row:a,column:u,rule:o,content:d,visible:!0}),t.emitEvent("valid-error",e),c&&("tooltip"===n.message||"default"===n.message&&!l&&i.length<2))return c.open(s,d)})}}};exports.default=_default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vxe-table",
3
- "version": "3.7.0-beta.8",
3
+ "version": "3.7.0-beta.9",
4
4
  "description": "一个基于 vue 的 PC 端表单/表格组件,支持增删改查、虚拟列表、虚拟树、懒加载、快捷菜单、数据校验、树形结构、打印导出、表单渲染、数据分页、弹窗、自定义模板、渲染器、JSON 配置式为零代码而设计...",
5
5
  "scripts": {
6
6
  "update": "npm install --legacy-peer-deps",
@@ -7,19 +7,19 @@ import { warnLog, errLog, getLog } from '../../tools/log'
7
7
 
8
8
  function insertTreeRow (_vm, newRecords, isAppend) {
9
9
  const { tableFullTreeData, afterFullData, fullDataRowIdData, fullAllDataRowIdData, treeOpts } = _vm
10
- const { rowField, parentField, children, mapChildren } = treeOpts
10
+ const { rowField, parentField, childrenField, children, mapChildrenField } = treeOpts
11
11
  const funcName = isAppend ? 'push' : 'unshift'
12
12
  newRecords.forEach(item => {
13
13
  const parentRowId = item[parentField]
14
14
  const rowid = getRowid(_vm, item)
15
- const matchObj = parentRowId ? XEUtils.findTree(tableFullTreeData, item => parentRowId === item[rowField], { children: mapChildren }) : null
15
+ const matchObj = parentRowId ? XEUtils.findTree(tableFullTreeData, item => parentRowId === item[rowField], { children: mapChildrenField }) : null
16
16
  if (matchObj) {
17
17
  const { item: parentRow } = matchObj
18
18
  const parentRest = fullAllDataRowIdData[getRowid(_vm, parentRow)]
19
19
  const parentLevel = parentRest ? parentRest.level : 0
20
- let parentChilds = parentRow[children]
20
+ let parentChilds = parentRow[childrenField || children]
21
21
  if (!XEUtils.isArray(parentChilds)) {
22
- parentChilds = parentRow[children] = []
22
+ parentChilds = parentRow[childrenField || children] = []
23
23
  }
24
24
  parentChilds[funcName](item)
25
25
  const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, items: parentChilds, parent, level: parentLevel + 1 }
@@ -60,7 +60,7 @@ export default {
60
60
  */
61
61
  _insertAt (records, row) {
62
62
  const { tableFullTreeData, mergeList, afterFullData, editStore, tableFullData, treeConfig, fullDataRowIdData, fullAllDataRowIdData, treeOpts } = this
63
- const { transform, rowField, mapChildren } = treeOpts
63
+ const { transform, rowField, mapChildrenField } = treeOpts
64
64
  if (!XEUtils.isArray(records)) {
65
65
  records = [records]
66
66
  }
@@ -99,7 +99,7 @@ export default {
99
99
  } else {
100
100
  // 如果为虚拟树
101
101
  if (treeConfig && transform) {
102
- const matchObj = XEUtils.findTree(tableFullTreeData, item => row[rowField] === item[rowField], { children: mapChildren })
102
+ const matchObj = XEUtils.findTree(tableFullTreeData, item => row[rowField] === item[rowField], { children: mapChildrenField })
103
103
  if (matchObj) {
104
104
  const { parent: parentRow } = matchObj
105
105
  const parentChilds = matchObj.items
@@ -38,7 +38,7 @@ function getExportBlobByContent (content, options) {
38
38
 
39
39
  function hasTreeChildren ($xetable, row) {
40
40
  const treeOpts = $xetable.treeOpts
41
- return row[treeOpts.children] && row[treeOpts.children].length > 0
41
+ return row[treeOpts.childrenField || treeOpts.children] && row[treeOpts.childrenField || treeOpts.children].length > 0
42
42
  }
43
43
 
44
44
  function getSeq ($xetable, row, $rowIndex, column, $columnIndex) {
@@ -30,7 +30,7 @@ function renderLine (h, _vm, $xetable, params) {
30
30
  if (slots && slots.line) {
31
31
  return $xetable.callSlot(slots.line, params, h)
32
32
  }
33
- if (treeConfig && treeNode && treeOpts.line) {
33
+ if (treeConfig && treeNode && (treeOpts.showLine || treeOpts.line)) {
34
34
  return [
35
35
  h('div', {
36
36
  class: 'vxe-tree--line-wrapper'
@@ -350,7 +350,7 @@ function renderRows (h, _vm, $xetable, fixedType, tableData, tableColumn) {
350
350
  isNewRow = $xetable.isInsertByRow(row)
351
351
  }
352
352
  if (treeConfig && !scrollYLoad && !treeOpts.transform && treeExpandeds.length) {
353
- rowChildren = row[treeOpts.children]
353
+ rowChildren = row[treeOpts.childrenField || treeOpts.children]
354
354
  isExpandTree = rowChildren && rowChildren.length && treeExpandeds.indexOf(row) > -1
355
355
  }
356
356
  rows.push(
@@ -207,8 +207,8 @@ export const Cell = {
207
207
  const { treeOpts, treeExpandeds, treeLazyLoadeds } = $table
208
208
  const { row, column, level } = params
209
209
  const { slots } = column
210
- const { children, hasChild, indent, lazy, trigger, iconLoaded, showIcon, iconOpen, iconClose } = treeOpts
211
- const rowChilds = row[children]
210
+ const { childrenField, children, hasChildField, hasChild, indent, lazy, trigger, iconLoaded, showIcon, iconOpen, iconClose } = treeOpts
211
+ const rowChilds = row[childrenField || children]
212
212
  let hasLazyChilds = false
213
213
  let isAceived = false
214
214
  let isLazyLoaded = false
@@ -220,7 +220,7 @@ export const Cell = {
220
220
  isAceived = $table.findRowIndexOf(treeExpandeds, row) > -1
221
221
  if (lazy) {
222
222
  isLazyLoaded = $table.findRowIndexOf(treeLazyLoadeds, row) > -1
223
- hasLazyChilds = row[hasChild]
223
+ hasLazyChilds = row[hasChildField || hasChild]
224
224
  }
225
225
  }
226
226
  if (!trigger || trigger === 'default') {
@@ -28,7 +28,7 @@ export class ColumnInfo {
28
28
  warnLog('vxe.error.errConflicts', ['column.cell-render', 'column.edit-render'])
29
29
  }
30
30
  if (_vm.type === 'expand') {
31
- if ($xetable.treeConfig && $xetable.treeOpts.line) {
31
+ if ($xetable.treeConfig && ($xetable.treeOpts.showLine || $xetable.treeOpts.line)) {
32
32
  errLog('vxe.error.errConflicts', ['tree-config.line', 'column.type=expand'])
33
33
  }
34
34
  }
@@ -41,12 +41,12 @@ export class ColumnInfo {
41
41
  if (formatter) {
42
42
  if (XEUtils.isString(formatter)) {
43
43
  const gFormatOpts = formats.get(formatter) || XEUtils[formatter]
44
- if (!gFormatOpts || !XEUtils.isFunction(gFormatOpts.formatMethod)) {
44
+ if (!gFormatOpts || !XEUtils.isFunction(gFormatOpts.cellFormatMethod)) {
45
45
  errLog('vxe.error.notFormats', [formatter])
46
46
  }
47
47
  } else if (XEUtils.isArray(formatter)) {
48
48
  const gFormatOpts = formats.get(formatter[0]) || XEUtils[formatter[0]]
49
- if (!gFormatOpts || !XEUtils.isFunction(gFormatOpts.formatMethod)) {
49
+ if (!gFormatOpts || !XEUtils.isFunction(gFormatOpts.cellFormatMethod)) {
50
50
  errLog('vxe.error.notFormats', [formatter[0]])
51
51
  }
52
52
  }
@@ -369,26 +369,26 @@ const Methods = {
369
369
  if (!treeOpts.parentField) {
370
370
  errLog('vxe.error.reqProp', ['table.tree-config.parentField'])
371
371
  }
372
- if (!treeOpts.children) {
373
- errLog('vxe.error.reqProp', ['tree-config.children'])
372
+ if (!(treeOpts.childrenField || treeOpts.children)) {
373
+ errLog('vxe.error.reqProp', ['tree-config.childrenField'])
374
374
  }
375
- if (!treeOpts.mapChildren) {
376
- errLog('vxe.error.reqProp', ['tree-config.mapChildren'])
375
+ if (!treeOpts.mapChildrenField) {
376
+ errLog('vxe.error.reqProp', ['tree-config.mapChildrenField'])
377
377
  }
378
- if (treeOpts.children === treeOpts.mapChildren) {
379
- errLog('vxe.error.errConflicts', ['tree-config.children', 'tree-config.mapChildren'])
378
+ if ((treeOpts.treeOpts || treeOpts.children) === treeOpts.mapChildrenField) {
379
+ errLog('vxe.error.errConflicts', ['tree-config.childrenField', 'tree-config.mapChildrenField'])
380
380
  }
381
381
  fullData.forEach(row => {
382
- if (row[treeOpts.children] && row[treeOpts.children].length) {
383
- warnLog('vxe.error.errConflicts', ['tree-config.transform', `row.${treeOpts.children}`])
382
+ if (row[treeOpts.childrenField || treeOpts.children] && row[treeOpts.childrenField || treeOpts.children].length) {
383
+ warnLog('vxe.error.errConflicts', ['tree-config.transform', `row.${treeOpts.childrenField || treeOpts.children}`])
384
384
  }
385
385
  })
386
386
  }
387
387
  treeData = XEUtils.toArrayTree(fullData, {
388
388
  key: treeOpts.rowField,
389
389
  parentKey: treeOpts.parentField,
390
- children: treeOpts.children,
391
- mapChildren: treeOpts.mapChildren
390
+ children: treeOpts.childrenField || treeOpts.children,
391
+ mapChildren: treeOpts.mapChildrenField
392
392
  })
393
393
  fullData = treeData.slice(0)
394
394
  } else {
@@ -602,8 +602,8 @@ const Methods = {
602
602
  rowid = getRowUniqueId()
603
603
  XEUtils.set(row, rowkey, rowid)
604
604
  }
605
- if (isLazy && row[treeOpts.hasChild] && XEUtils.isUndefined(row[treeOpts.children])) {
606
- row[treeOpts.children] = null
605
+ if (isLazy && row[treeOpts.hasChildField || treeOpts.hasChild] && XEUtils.isUndefined(row[treeOpts.childrenField || treeOpts.children])) {
606
+ row[treeOpts.childrenField || treeOpts.children] = null
607
607
  }
608
608
  const rest = { row, rowid, seq, index: treeConfig && parent ? -1 : index, _index: -1, $index: -1, items, parent, level }
609
609
  if (source) {
@@ -651,7 +651,7 @@ const Methods = {
651
651
  },
652
652
  loadTreeChildren (row, childRecords) {
653
653
  const { keepSource, tableSourceData, treeOpts, fullDataRowIdData, fullDataRowMap, fullAllDataRowMap, fullAllDataRowIdData } = this
654
- const { transform, children, mapChildren } = treeOpts
654
+ const { transform, childrenField, children, mapChildrenField } = treeOpts
655
655
  const rest = fullAllDataRowIdData[getRowid(this, row)]
656
656
  const parentLevel = rest ? rest.level : 0
657
657
  return this.createData(childRecords).then((rows) => {
@@ -659,7 +659,7 @@ const Methods = {
659
659
  const rowid = getRowid(this, row)
660
660
  const matchObj = XEUtils.findTree(tableSourceData, (item) => rowid === getRowid(this, item), treeOpts)
661
661
  if (matchObj) {
662
- matchObj.item[children] = XEUtils.clone(rows, true)
662
+ matchObj.item[childrenField || children] = XEUtils.clone(rows, true)
663
663
  }
664
664
  }
665
665
  XEUtils.eachTree(rows, (childRow, index, items, path, parent, nodes) => {
@@ -670,9 +670,9 @@ const Methods = {
670
670
  fullAllDataRowIdData[rowid] = rest
671
671
  fullAllDataRowMap.set(childRow, rest)
672
672
  }, treeOpts)
673
- row[children] = rows
673
+ row[childrenField || children] = rows
674
674
  if (transform) {
675
- row[mapChildren] = rows
675
+ row[mapChildrenField] = rows
676
676
  }
677
677
  this.updateAfterDataIndex()
678
678
  return rows
@@ -956,8 +956,8 @@ const Methods = {
956
956
  XEUtils.set(record, key, null)
957
957
  }
958
958
  })
959
- if (treeConfig && treeOpts.lazy && XEUtils.isUndefined(record[treeOpts.children])) {
960
- record[treeOpts.children] = null
959
+ if (treeConfig && treeOpts.lazy && XEUtils.isUndefined(record[treeOpts.childrenField || treeOpts.children])) {
960
+ record[treeOpts.childrenField || treeOpts.children] = null
961
961
  }
962
962
  // 必须有行数据的唯一主键,可以自行设置;也可以默认生成一个随机数
963
963
  if (eqEmptyValue(XEUtils.get(record, rowkey))) {
@@ -1156,20 +1156,20 @@ const Methods = {
1156
1156
  */
1157
1157
  getCheckboxRecords (isFull) {
1158
1158
  const { tableFullData, afterFullData, treeConfig, treeOpts, checkboxOpts, tableFullTreeData, afterTreeFullData } = this
1159
- const { transform, children, mapChildren } = treeOpts
1159
+ const { transform, childrenField, children, mapChildrenField } = treeOpts
1160
1160
  const { checkField } = checkboxOpts
1161
1161
  const currTableData = isFull ? (transform ? tableFullTreeData : tableFullData) : (transform ? afterTreeFullData : afterFullData)
1162
1162
  let rowList = []
1163
1163
  if (checkField) {
1164
1164
  if (treeConfig) {
1165
- rowList = XEUtils.filterTree(currTableData, row => XEUtils.get(row, checkField), { children: transform ? mapChildren : children })
1165
+ rowList = XEUtils.filterTree(currTableData, row => XEUtils.get(row, checkField), { children: transform ? mapChildrenField : (childrenField || children) })
1166
1166
  } else {
1167
1167
  rowList = currTableData.filter(row => XEUtils.get(row, checkField))
1168
1168
  }
1169
1169
  } else {
1170
1170
  const { selectCheckboxRows } = this
1171
1171
  if (treeConfig) {
1172
- rowList = XEUtils.filterTree(currTableData, row => this.findRowIndexOf(selectCheckboxRows, row) > -1, { children: transform ? mapChildren : children })
1172
+ rowList = XEUtils.filterTree(currTableData, row => this.findRowIndexOf(selectCheckboxRows, row) > -1, { children: transform ? mapChildrenField : (childrenField || children) })
1173
1173
  } else {
1174
1174
  rowList = currTableData.filter(row => this.findRowIndexOf(selectCheckboxRows, row) > -1)
1175
1175
  }
@@ -1190,7 +1190,7 @@ const Methods = {
1190
1190
  expandMaps.set(row, 1)
1191
1191
  fullData.push(row)
1192
1192
  }
1193
- }, { children: treeOpts.mapChildren })
1193
+ }, { children: treeOpts.mapChildrenField })
1194
1194
  this.afterFullData = fullData
1195
1195
  this.updateScrollYStatus(fullData)
1196
1196
  return fullData
@@ -1327,7 +1327,7 @@ const Methods = {
1327
1327
  fullAllDataRowIdData[rowid] = rest
1328
1328
  fullDataRowIdData[rowid] = rest
1329
1329
  }
1330
- }, { children: treeOpts.transform ? treeOpts.mapChildren : treeOpts.children })
1330
+ }, { children: treeOpts.transform ? treeOpts.mapChildrenField : (treeOpts.childrenField || treeOpts.children) })
1331
1331
  } else {
1332
1332
  afterFullData.forEach((row, index) => {
1333
1333
  const rowid = getRowid(this, row)
@@ -4142,8 +4142,8 @@ const Methods = {
4142
4142
  */
4143
4143
  reloadTreeExpand (row) {
4144
4144
  const { treeOpts, treeLazyLoadeds } = this
4145
- const { transform, lazy, hasChild } = treeOpts
4146
- if (lazy && row[hasChild] && treeLazyLoadeds.indexOf(row) === -1) {
4145
+ const { transform, lazy, hasChildField, hasChild } = treeOpts
4146
+ if (lazy && row[hasChildField || hasChild] && treeLazyLoadeds.indexOf(row) === -1) {
4147
4147
  this.clearTreeExpandLoaded(row).then(() => {
4148
4148
  return this.handleAsyncTreeExpandChilds(row)
4149
4149
  }).then(() => {
@@ -4252,10 +4252,10 @@ const Methods = {
4252
4252
  */
4253
4253
  setAllTreeExpand (expanded) {
4254
4254
  const { tableFullData, treeOpts } = this
4255
- const { lazy, children } = treeOpts
4255
+ const { lazy, childrenField, children } = treeOpts
4256
4256
  const expandeds = []
4257
4257
  XEUtils.eachTree(tableFullData, row => {
4258
- const rowChildren = row[children]
4258
+ const rowChildren = row[childrenField || children]
4259
4259
  if (lazy || (rowChildren && rowChildren.length)) {
4260
4260
  expandeds.push(row)
4261
4261
  }
@@ -4270,7 +4270,7 @@ const Methods = {
4270
4270
  */
4271
4271
  handleBaseTreeExpand (rows, expanded) {
4272
4272
  const { fullAllDataRowMap, tableFullData, treeExpandeds, treeOpts, treeLazyLoadeds, treeNodeColumn } = this
4273
- const { reserve, lazy, hasChild, children, accordion, toggleMethod } = treeOpts
4273
+ const { reserve, lazy, hasChildField, hasChild, childrenField, children, accordion, toggleMethod } = treeOpts
4274
4274
  const result = []
4275
4275
  const columnIndex = this.getColumnIndex(treeNodeColumn)
4276
4276
  const $columnIndex = this.getVMColumnIndex(treeNodeColumn)
@@ -4287,12 +4287,12 @@ const Methods = {
4287
4287
  validRows.forEach(row => {
4288
4288
  if (treeExpandeds.indexOf(row) === -1) {
4289
4289
  const rest = fullAllDataRowMap.get(row)
4290
- const isLoad = lazy && row[hasChild] && !rest.treeLoaded && treeLazyLoadeds.indexOf(row) === -1
4290
+ const isLoad = lazy && row[(hasChildField || hasChild)] && !rest.treeLoaded && treeLazyLoadeds.indexOf(row) === -1
4291
4291
  // 是否使用懒加载
4292
4292
  if (isLoad) {
4293
4293
  result.push(this.handleAsyncTreeExpandChilds(row))
4294
4294
  } else {
4295
- if (row[children] && row[children].length) {
4295
+ if (row[childrenField || children] && row[childrenField || children].length) {
4296
4296
  treeExpandeds.push(row)
4297
4297
  }
4298
4298
  }
@@ -4865,10 +4865,10 @@ const Methods = {
4865
4865
  const formatParams = { cellValue, row, rowIndex: this.getRowIndex(row), column, columnIndex: this.getColumnIndex(column) }
4866
4866
  if (XEUtils.isString(formatter)) {
4867
4867
  const gFormatOpts = formats.get(formatter)
4868
- cellLabel = gFormatOpts && gFormatOpts.formatMethod ? gFormatOpts.formatMethod(formatParams) : ''
4868
+ cellLabel = gFormatOpts && gFormatOpts.cellFormatMethod ? gFormatOpts.cellFormatMethod(formatParams) : ''
4869
4869
  } else if (XEUtils.isArray(formatter)) {
4870
4870
  const gFormatOpts = formats.get(formatter[0])
4871
- cellLabel = gFormatOpts && gFormatOpts.formatMethod ? gFormatOpts.formatMethod(formatParams, ...formatter.slice(1)) : ''
4871
+ cellLabel = gFormatOpts && gFormatOpts.cellFormatMethod ? gFormatOpts.cellFormatMethod(formatParams, ...formatter.slice(1)) : ''
4872
4872
  } else {
4873
4873
  cellLabel = formatter(formatParams)
4874
4874
  }
@@ -775,7 +775,7 @@ export default {
775
775
  if (this.editConfig && editOpts.showStatus && !this.keepSource) {
776
776
  warnLog('vxe.error.reqProp', ['keep-source'])
777
777
  }
778
- if (treeConfig && treeOpts.line && (!(this.rowKey || rowOpts.useKey) || !showOverflow)) {
778
+ if (treeConfig && (treeOpts.showLine || treeOpts.line) && (!(this.rowKey || rowOpts.useKey) || !showOverflow)) {
779
779
  warnLog('vxe.error.reqProp', ['row-config.useKey | show-overflow'])
780
780
  }
781
781
  if (this.showFooter && !this.footerMethod) {
@@ -832,6 +832,12 @@ export default {
832
832
  return
833
833
  }
834
834
  }
835
+ if (this.treeConfig && treeOpts.children) {
836
+ warnLog('vxe.error.delProp', ['tree-config.children', 'tree-config.childrenField'])
837
+ }
838
+ if (this.treeConfig && treeOpts.line) {
839
+ warnLog('vxe.error.delProp', ['tree-config.line', 'tree-config.showLine'])
840
+ }
835
841
  if (this.mouseOpts.area && this.mouseOpts.selected) {
836
842
  warnLog('vxe.error.errConflicts', ['mouse-config.area', 'mouse-config.selected'])
837
843
  }
@@ -876,9 +882,9 @@ export default {
876
882
  if (this.emptyRender && !XEUtils.isObject(this.emptyRender)) {
877
883
  warnLog('vxe.error.errProp', [`table.empty-render=${this.emptyRender}`, 'table.empty-render={}'])
878
884
  }
879
- // if (this.editConfig && this.editConfig.activeMethod) {
880
- // warnLog('vxe.error.delProp', ['table.edit-config.activeMethod', 'table.edit-config.beforeEditMethod'])
881
- // }
885
+ if (this.editConfig && this.editOpts.activeMethod) {
886
+ warnLog('vxe.error.delProp', ['table.edit-config.activeMethod', 'table.edit-config.beforeEditMethod'])
887
+ }
882
888
  }
883
889
 
884
890
  // 检查是否有安装需要的模块
@@ -1033,7 +1039,7 @@ export default {
1033
1039
  'is--header': showHeader,
1034
1040
  'is--footer': showFooter,
1035
1041
  'is--group': isGroup,
1036
- 'is--tree-line': treeConfig && treeOpts.line,
1042
+ 'is--tree-line': treeConfig && (treeOpts.showLine || treeOpts.line),
1037
1043
  'is--fixed-left': leftList.length,
1038
1044
  'is--fixed-right': rightList.length,
1039
1045
  'is--animat': !!this.animat,
@@ -157,7 +157,7 @@ function countTreeExpand (prevRow, params) {
157
157
  return count
158
158
  }
159
159
  const { $table } = params
160
- const rowChildren = prevRow[$table.treeOpts.children]
160
+ const rowChildren = prevRow[$table.treeOpts.childrenField || $table.treeOpts.children]
161
161
  if ($table.isTreeExpandByRow(prevRow)) {
162
162
  for (let index = 0; index < rowChildren.length; index++) {
163
163
  count += countTreeExpand(rowChildren[index], params)
@@ -352,7 +352,7 @@ export default {
352
352
  }
353
353
  },
354
354
  created () {
355
- const { refresh, refreshOpts } = this
355
+ const { refresh, refreshOpts, customOpts } = this
356
356
  this.$nextTick(() => {
357
357
  const $xetable = this.fintTable()
358
358
  const queryMethod = refreshOpts.queryMethod || refreshOpts.query
@@ -363,6 +363,9 @@ export default {
363
363
  $xetable.connect(this)
364
364
  }
365
365
  if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
366
+ if (customOpts.isFooter) {
367
+ warnLog('vxe.error.notValidators', ['custom.isFooter', 'custom.showFooter'])
368
+ }
366
369
  if (this.buttons) {
367
370
  this.buttons.forEach(item => {
368
371
  const { buttonRender } = item
@@ -20,10 +20,12 @@ class VXECommandsStore {
20
20
  add (name, render) {
21
21
  const conf = this.store[name]
22
22
  // 兼容
23
- if (XEUtils.isFunction(render)) {
24
- // warnLog('vxe.error.delProp', ['callback', 'commandMethod'])
25
- render = {
26
- commandMethod: render
23
+ if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
24
+ if (XEUtils.isFunction(render)) {
25
+ warnLog('vxe.error.delProp', ['callback', 'commandMethod'])
26
+ render = {
27
+ commandMethod: render
28
+ }
27
29
  }
28
30
  }
29
31
 
@@ -76,9 +76,9 @@ export default {
76
76
  treeConfig: {
77
77
  rowField: 'id',
78
78
  parentField: 'parentId',
79
- children: 'children',
80
- hasChild: 'hasChild',
81
- mapChildren: '_X_ROW_CHILD',
79
+ childrenField: 'children',
80
+ hasChildField: 'hasChild',
81
+ mapChildrenField: '_X_ROW_CHILD',
82
82
  indent: 20,
83
83
  showIcon: true
84
84
  },
@@ -20,10 +20,12 @@ class VXEFormatsStore {
20
20
  add (name, render) {
21
21
  const conf = this.store[name]
22
22
  // 兼容
23
- if (XEUtils.isFunction(render)) {
24
- // warnLog('vxe.error.delProp', ['callback', 'formatMethod'])
25
- render = {
26
- formatMethod: render
23
+ if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
24
+ if (XEUtils.isFunction(render)) {
25
+ warnLog('vxe.error.delProp', ['callback', 'cellFormatMethod'])
26
+ render = {
27
+ cellFormatMethod: render
28
+ }
27
29
  }
28
30
  }
29
31
 
@@ -20,10 +20,12 @@ class VXEMenusStore {
20
20
  add (name, render) {
21
21
  const conf = this.store[name]
22
22
  // 兼容
23
- if (XEUtils.isFunction(render)) {
24
- // warnLog('vxe.error.delProp', ['callback', 'menuMethod'])
25
- render = {
26
- menuMethod: render
23
+ if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
24
+ if (XEUtils.isFunction(render)) {
25
+ warnLog('vxe.error.delProp', ['callback', 'menuMethod'])
26
+ render = {
27
+ menuMethod: render
28
+ }
27
29
  }
28
30
  }
29
31
 
@@ -65,12 +65,22 @@ export default {
65
65
  * 完整校验,和 validate 的区别就是会给有效数据中的每一行进行校验
66
66
  */
67
67
  _fullValidate (rows, cb) {
68
+ if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
69
+ if (XEUtils.isFunction(cb)) {
70
+ warnLog('vxe.error.notValidators', ['fullValidate(rows, callback)', 'fullValidate(rows)'])
71
+ }
72
+ }
68
73
  return this.beginValidate(rows, cb, true)
69
74
  },
70
75
  /**
71
76
  * 快速校验,如果存在记录不通过的记录,则返回不再继续校验(异步校验除外)
72
77
  */
73
78
  _validate (rows, cb) {
79
+ if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
80
+ if (XEUtils.isFunction(cb)) {
81
+ warnLog('vxe.error.notValidators', ['validate(rows, callback)', 'validate(rows)'])
82
+ }
83
+ }
74
84
  return this.beginValidate(rows, cb)
75
85
  },
76
86
  /**