vxe-table 3.9.0-rc.2 → 3.9.0-rc.21

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 (186) hide show
  1. package/es/grid/src/grid.js +120 -66
  2. package/es/locale/lang/en-US.js +2 -8
  3. package/es/locale/lang/es-ES.js +2 -1
  4. package/es/locale/lang/hu-HU.d.ts +2 -0
  5. package/es/locale/lang/hu-HU.js +497 -501
  6. package/es/locale/lang/ja-JP.js +2 -8
  7. package/es/locale/lang/ko-KR.d.ts +2 -0
  8. package/es/locale/lang/ko-KR.js +2 -8
  9. package/es/locale/lang/pt-BR.js +2 -8
  10. package/es/locale/lang/ru-RU.d.ts +2 -0
  11. package/es/locale/lang/ru-RU.js +497 -503
  12. package/es/locale/lang/uk-UA.d.ts +2 -0
  13. package/es/locale/lang/uk-UA.js +667 -0
  14. package/es/locale/lang/vi-VN.js +2 -8
  15. package/es/locale/lang/zh-CHT.d.ts +2 -0
  16. package/es/locale/lang/zh-CHT.js +667 -0
  17. package/es/locale/lang/zh-CN.js +2 -8
  18. package/es/locale/lang/zh-HK.js +2 -2
  19. package/es/locale/lang/zh-MO.js +2 -2
  20. package/es/locale/lang/zh-TC.js +2 -673
  21. package/es/locale/lang/zh-TW.js +2 -2
  22. package/es/style.css +1 -1
  23. package/es/style.min.css +1 -1
  24. package/es/table/index.js +29 -3
  25. package/es/table/module/custom/panel.js +183 -173
  26. package/es/table/module/edit/mixin.js +33 -24
  27. package/es/table/module/export/export-panel.js +32 -4
  28. package/es/table/module/export/import-panel.js +24 -5
  29. package/es/table/module/export/mixin.js +11 -11
  30. package/es/table/module/menu/mixin.js +2 -2
  31. package/es/table/module/validator/mixin.js +4 -4
  32. package/es/table/render/index.js +23 -38
  33. package/es/table/src/body.js +1 -0
  34. package/es/table/src/columnInfo.js +3 -3
  35. package/es/table/src/methods.js +48 -40
  36. package/es/table/src/props.js +65 -15
  37. package/es/table/src/table.js +161 -55
  38. package/es/table/src/util.js +3 -2
  39. package/es/table/style.css +37 -23
  40. package/es/table/style.min.css +1 -1
  41. package/es/toolbar/src/toolbar.js +21 -7
  42. package/es/ui/index.js +5 -4
  43. package/es/ui/src/log.js +1 -1
  44. package/es/ui/src/vn.js +24 -1
  45. package/es/vxe-table/style.css +37 -23
  46. package/es/vxe-table/style.min.css +1 -1
  47. package/lib/grid/src/grid.js +115 -68
  48. package/lib/grid/src/grid.min.js +1 -1
  49. package/lib/index.umd.js +632 -330
  50. package/lib/index.umd.min.js +1 -1
  51. package/lib/locale/lang/en-US.js +2 -8
  52. package/lib/locale/lang/en-US.min.js +1 -1
  53. package/lib/locale/lang/en-US.umd.js +2 -8
  54. package/lib/locale/lang/es-ES.js +2 -1
  55. package/lib/locale/lang/es-ES.min.js +1 -1
  56. package/lib/locale/lang/es-ES.umd.js +2 -1
  57. package/lib/locale/lang/hu-HU.d.ts +2 -0
  58. package/lib/locale/lang/hu-HU.js +497 -501
  59. package/lib/locale/lang/hu-HU.min.js +1 -1
  60. package/lib/locale/lang/hu-HU.umd.js +687 -0
  61. package/lib/locale/lang/ja-JP.js +2 -8
  62. package/lib/locale/lang/ja-JP.min.js +1 -1
  63. package/lib/locale/lang/ja-JP.umd.js +2 -8
  64. package/lib/locale/lang/ko-KR.d.ts +2 -0
  65. package/lib/locale/lang/ko-KR.js +2 -8
  66. package/lib/locale/lang/ko-KR.min.js +1 -1
  67. package/lib/locale/lang/ko-KR.umd.js +687 -0
  68. package/lib/locale/lang/pt-BR.js +2 -8
  69. package/lib/locale/lang/pt-BR.min.js +1 -1
  70. package/lib/locale/lang/pt-BR.umd.js +2 -8
  71. package/lib/locale/lang/ru-RU.d.ts +2 -0
  72. package/lib/locale/lang/ru-RU.js +497 -503
  73. package/lib/locale/lang/ru-RU.min.js +1 -1
  74. package/lib/locale/lang/ru-RU.umd.js +687 -0
  75. package/lib/locale/lang/uk-UA.d.ts +2 -0
  76. package/lib/locale/lang/uk-UA.js +673 -0
  77. package/lib/locale/lang/uk-UA.min.js +1 -0
  78. package/lib/locale/lang/uk-UA.umd.js +687 -0
  79. package/lib/locale/lang/vi-VN.js +2 -8
  80. package/lib/locale/lang/vi-VN.min.js +1 -1
  81. package/lib/locale/lang/zh-CHT.d.ts +2 -0
  82. package/lib/locale/lang/zh-CHT.js +673 -0
  83. package/lib/locale/lang/zh-CHT.min.js +1 -0
  84. package/lib/locale/lang/zh-CHT.umd.js +687 -0
  85. package/lib/locale/lang/zh-CN.js +2 -8
  86. package/lib/locale/lang/zh-CN.min.js +1 -1
  87. package/lib/locale/lang/zh-CN.umd.js +2 -8
  88. package/lib/locale/lang/zh-HK.js +2 -2
  89. package/lib/locale/lang/zh-HK.min.js +1 -1
  90. package/lib/locale/lang/zh-HK.umd.js +7 -677
  91. package/lib/locale/lang/zh-MO.js +2 -2
  92. package/lib/locale/lang/zh-MO.min.js +1 -1
  93. package/lib/locale/lang/zh-MO.umd.js +7 -677
  94. package/lib/locale/lang/zh-TC.js +3 -673
  95. package/lib/locale/lang/zh-TC.min.js +1 -1
  96. package/lib/locale/lang/zh-TC.umd.js +7 -677
  97. package/lib/locale/lang/zh-TW.js +2 -2
  98. package/lib/locale/lang/zh-TW.min.js +1 -1
  99. package/lib/locale/lang/zh-TW.umd.js +7 -677
  100. package/lib/style.css +1 -1
  101. package/lib/style.min.css +1 -1
  102. package/lib/table/index.js +30 -3
  103. package/lib/table/index.min.js +1 -1
  104. package/lib/table/module/custom/panel.js +12 -7
  105. package/lib/table/module/custom/panel.min.js +1 -1
  106. package/lib/table/module/edit/mixin.js +32 -23
  107. package/lib/table/module/edit/mixin.min.js +1 -1
  108. package/lib/table/module/export/export-panel.js +31 -4
  109. package/lib/table/module/export/export-panel.min.js +1 -1
  110. package/lib/table/module/export/import-panel.js +23 -5
  111. package/lib/table/module/export/import-panel.min.js +1 -1
  112. package/lib/table/module/export/mixin.js +11 -11
  113. package/lib/table/module/export/mixin.min.js +1 -1
  114. package/lib/table/module/menu/mixin.js +2 -2
  115. package/lib/table/module/menu/mixin.min.js +1 -1
  116. package/lib/table/module/validator/mixin.js +4 -4
  117. package/lib/table/module/validator/mixin.min.js +1 -1
  118. package/lib/table/render/index.js +27 -41
  119. package/lib/table/render/index.min.js +1 -1
  120. package/lib/table/src/body.js +1 -1
  121. package/lib/table/src/body.min.js +1 -1
  122. package/lib/table/src/columnInfo.js +3 -3
  123. package/lib/table/src/columnInfo.min.js +1 -1
  124. package/lib/table/src/methods.js +47 -40
  125. package/lib/table/src/methods.min.js +1 -1
  126. package/lib/table/src/props.js +7 -0
  127. package/lib/table/src/props.min.js +1 -1
  128. package/lib/table/src/table.js +147 -48
  129. package/lib/table/src/table.min.js +1 -1
  130. package/lib/table/src/util.js +3 -2
  131. package/lib/table/src/util.min.js +1 -1
  132. package/lib/table/style/style.css +37 -23
  133. package/lib/table/style/style.min.css +1 -1
  134. package/lib/toolbar/src/toolbar.js +21 -7
  135. package/lib/toolbar/src/toolbar.min.js +1 -1
  136. package/lib/ui/index.js +6 -5
  137. package/lib/ui/index.min.js +1 -1
  138. package/lib/ui/src/log.js +1 -1
  139. package/lib/ui/src/log.min.js +1 -1
  140. package/lib/ui/src/vn.js +26 -1
  141. package/lib/ui/src/vn.min.js +1 -1
  142. package/lib/vxe-table/style/style.css +37 -23
  143. package/lib/vxe-table/style/style.min.css +1 -1
  144. package/package.json +2 -2
  145. package/packages/grid/src/grid.ts +127 -65
  146. package/packages/locale/lang/en-US.ts +2 -10
  147. package/packages/locale/lang/es-ES.ts +2 -1
  148. package/packages/locale/lang/hu-HU.ts +497 -503
  149. package/packages/locale/lang/ja-JP.ts +2 -10
  150. package/packages/locale/lang/ko-KR.ts +2 -10
  151. package/packages/locale/lang/pt-BR.ts +2 -10
  152. package/packages/locale/lang/ru-RU.ts +497 -505
  153. package/packages/locale/lang/uk-UA.ts +667 -0
  154. package/packages/locale/lang/vi-VN.ts +2 -10
  155. package/packages/locale/lang/zh-CHT.ts +667 -0
  156. package/packages/locale/lang/zh-CN.ts +2 -10
  157. package/packages/locale/lang/zh-HK.ts +2 -2
  158. package/packages/locale/lang/zh-MO.ts +2 -2
  159. package/packages/locale/lang/zh-TC.ts +2 -674
  160. package/packages/locale/lang/zh-TW.ts +2 -2
  161. package/packages/table/index.ts +28 -5
  162. package/packages/table/module/custom/panel.ts +186 -175
  163. package/packages/table/module/edit/mixin.ts +32 -23
  164. package/packages/table/module/export/export-panel.ts +36 -4
  165. package/packages/table/module/export/import-panel.ts +28 -5
  166. package/packages/table/module/export/mixin.ts +11 -11
  167. package/packages/table/module/menu/mixin.ts +2 -2
  168. package/packages/table/module/validator/mixin.ts +4 -4
  169. package/packages/table/render/index.ts +26 -40
  170. package/packages/table/src/body.ts +1 -0
  171. package/packages/table/src/columnInfo.ts +3 -3
  172. package/packages/table/src/methods.ts +47 -40
  173. package/packages/table/src/props.ts +68 -15
  174. package/packages/table/src/table.ts +167 -56
  175. package/packages/table/src/util.ts +3 -2
  176. package/packages/toolbar/src/toolbar.ts +21 -7
  177. package/packages/ui/index.ts +3 -2
  178. package/packages/ui/src/vn.ts +26 -1
  179. package/styles/components/table.scss +82 -17
  180. package/types/all.d.ts +2 -2
  181. /package/es/{iconfont.1726028471123.ttf → iconfont.1727868548661.ttf} +0 -0
  182. /package/es/{iconfont.1726028471123.woff → iconfont.1727868548661.woff} +0 -0
  183. /package/es/{iconfont.1726028471123.woff2 → iconfont.1727868548661.woff2} +0 -0
  184. /package/lib/{iconfont.1726028471123.ttf → iconfont.1727868548661.ttf} +0 -0
  185. /package/lib/{iconfont.1726028471123.woff → iconfont.1727868548661.woff} +0 -0
  186. /package/lib/{iconfont.1726028471123.woff2 → iconfont.1727868548661.woff2} +0 -0
@@ -559,7 +559,7 @@ function downloadFile($xetable, opts, content) {
559
559
  saveLocalFile({ filename, type, content }).then(() => {
560
560
  if (opts.message !== false) {
561
561
  // 检测弹窗模块
562
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
562
+ if (process.env.NODE_ENV === 'development') {
563
563
  if (!VxeUI.modal) {
564
564
  errLog('vxe.error.reqModule', ['Modal']);
565
565
  }
@@ -777,7 +777,7 @@ function handleImport($xetable, content, opts) {
777
777
  }
778
778
  if (opts.message !== false) {
779
779
  // 检测弹窗模块
780
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
780
+ if (process.env.NODE_ENV === 'development') {
781
781
  if (!VxeUI.modal) {
782
782
  errLog('vxe.error.reqModule', ['Modal']);
783
783
  }
@@ -793,7 +793,7 @@ function handleImport($xetable, content, opts) {
793
793
  }
794
794
  else if (opts.message !== false) {
795
795
  // 检测弹窗模块
796
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
796
+ if (process.env.NODE_ENV === 'development') {
797
797
  if (!VxeUI.modal) {
798
798
  errLog('vxe.error.reqModule', ['Modal']);
799
799
  }
@@ -812,7 +812,7 @@ function handleFileImport($xetable, file, opts) {
812
812
  if (!importMethod && !XEUtils.includes(XEUtils.keys(importOpts._typeMaps), type)) {
813
813
  if (opts.message !== false) {
814
814
  // 检测弹窗模块
815
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
815
+ if (process.env.NODE_ENV === 'development') {
816
816
  if (!VxeUI.modal) {
817
817
  errLog('vxe.error.reqModule', ['Modal']);
818
818
  }
@@ -865,7 +865,7 @@ function handleFileImport($xetable, file, opts) {
865
865
  }
866
866
  else {
867
867
  // 不支持的浏览器
868
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
868
+ if (process.env.NODE_ENV === 'development') {
869
869
  errLog('vxe.error.notExp');
870
870
  }
871
871
  _importResolve({ status: true });
@@ -921,7 +921,7 @@ export function readLocalFile(options = {}) {
921
921
  else {
922
922
  if (options.message !== false) {
923
923
  // 检测弹窗模块
924
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
924
+ if (process.env.NODE_ENV === 'development') {
925
925
  if (!VxeUI.modal) {
926
926
  errLog('vxe.error.reqModule', ['Modal']);
927
927
  }
@@ -1239,7 +1239,7 @@ export default {
1239
1239
  }
1240
1240
  // 检查类型,如果为自定义导出,则不需要校验类型
1241
1241
  if (!opts.exportMethod && !XEUtils.includes(XEUtils.keys(exportOpts._typeMaps), type)) {
1242
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
1242
+ if (process.env.NODE_ENV === 'development') {
1243
1243
  errLog('vxe.error.notType', [type]);
1244
1244
  }
1245
1245
  const params = { status: false };
@@ -1262,7 +1262,7 @@ export default {
1262
1262
  }
1263
1263
  }
1264
1264
  else if (mode === 'all') {
1265
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
1265
+ if (process.env.NODE_ENV === 'development') {
1266
1266
  if (!$xegrid) {
1267
1267
  warnLog('vxe.error.errProp', ['all', 'mode=current,selected']);
1268
1268
  }
@@ -1272,7 +1272,7 @@ export default {
1272
1272
  const ajaxMethods = ajax.queryAll;
1273
1273
  const queryAllSuccessMethods = ajax.queryAllSuccess;
1274
1274
  const queryAllErrorMethods = ajax.queryAllError;
1275
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
1275
+ if (process.env.NODE_ENV === 'development') {
1276
1276
  if (!ajaxMethods) {
1277
1277
  warnLog('vxe.error.notFunc', ['proxy-config.ajax.queryAll']);
1278
1278
  }
@@ -1443,7 +1443,7 @@ export default {
1443
1443
  },
1444
1444
  _openExport(options) {
1445
1445
  const { exportOpts } = this;
1446
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
1446
+ if (process.env.NODE_ENV === 'development') {
1447
1447
  if (!this.exportConfig) {
1448
1448
  errLog('vxe.error.reqProp', ['export-config']);
1449
1449
  }
@@ -1452,7 +1452,7 @@ export default {
1452
1452
  },
1453
1453
  _openPrint(options) {
1454
1454
  const { printOpts } = this;
1455
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
1455
+ if (process.env.NODE_ENV === 'development') {
1456
1456
  if (!this.printConfig) {
1457
1457
  errLog('vxe.error.reqProp', ['print-config']);
1458
1458
  }
@@ -110,7 +110,7 @@ export default {
110
110
  this.handleOpenMenuEvent(evnt, layout, params);
111
111
  // 在 v4 中废弃事件 cell-context-menu、header-cell-context-menu、footer-cell-context-menu
112
112
  if (this.$listeners[`${typePrefix}cell-context-menu`]) {
113
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
113
+ if (process.env.NODE_ENV === 'development') {
114
114
  warnLog('vxe.error.delEvent', [`${typePrefix}cell-context-menu`, `${typePrefix}cell-menu`]);
115
115
  }
116
116
  this.emitEvent(`${typePrefix}cell-context-menu`, params, evnt);
@@ -267,7 +267,7 @@ export default {
267
267
  }
268
268
  // 在 v4 中废弃事件 context-menu-click
269
269
  if (this.$listeners['context-menu-click']) {
270
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
270
+ if (process.env.NODE_ENV === 'development') {
271
271
  warnLog('vxe.error.delEvent', ['context-menu-click', 'menu-click']);
272
272
  }
273
273
  this.emitEvent('context-menu-click', params, evnt);
@@ -67,7 +67,7 @@ export default {
67
67
  * 完整校验,和 validate 的区别就是会给有效数据中的每一行进行校验
68
68
  */
69
69
  _fullValidate(rows, cb) {
70
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
70
+ if (process.env.NODE_ENV === 'development') {
71
71
  if (XEUtils.isFunction(cb)) {
72
72
  warnLog('vxe.error.notValidators', ['fullValidate(rows, callback)', 'fullValidate(rows)']);
73
73
  }
@@ -78,7 +78,7 @@ export default {
78
78
  * 快速校验,如果存在记录不通过的记录,则返回不再继续校验(异步校验除外)
79
79
  */
80
80
  _validate(rows, cb) {
81
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
81
+ if (process.env.NODE_ENV === 'development') {
82
82
  if (XEUtils.isFunction(cb)) {
83
83
  warnLog('vxe.error.notValidators', ['validate(rows, callback)', 'validate(rows)']);
84
84
  }
@@ -314,13 +314,13 @@ export default {
314
314
  customValid = gvItem.cellValidatorMethod(validParams);
315
315
  }
316
316
  else {
317
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
317
+ if (process.env.NODE_ENV === 'development') {
318
318
  warnLog('vxe.error.notValidators', [validator]);
319
319
  }
320
320
  }
321
321
  }
322
322
  else {
323
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
323
+ if (process.env.NODE_ENV === 'development') {
324
324
  errLog('vxe.error.notValidators', [validator]);
325
325
  }
326
326
  }
@@ -2,32 +2,11 @@ import XEUtils from 'xe-utils';
2
2
  import { VxeUI } from '../../ui';
3
3
  import { getCellValue, setCellValue } from '../src/util';
4
4
  import { getFuncText, formatText, isEmptyValue } from '../../ui/src/utils';
5
- import { getOnName } from '../../ui/src/vn';
5
+ import { getOnName, getModelEvent, getChangeEvent } from '../../ui/src/vn';
6
6
  import { errLog } from '../../ui/src/log';
7
7
  const { getConfig, renderer, getI18n } = VxeUI;
8
- const componentDefaultModelProp = 'modelValue';
8
+ const componentDefaultModelProp = 'value';
9
9
  const defaultCompProps = { transfer: true };
10
- function getModelEvent(renderOpts) {
11
- switch (renderOpts.name) {
12
- case 'input':
13
- case 'textarea':
14
- return 'input';
15
- }
16
- return 'update:modelValue';
17
- }
18
- function getChangeEvent(renderOpts) {
19
- switch (renderOpts.name) {
20
- case 'input':
21
- case 'textarea':
22
- case 'VxeInput':
23
- case 'VxeNumberInput':
24
- case 'VxeTextarea':
25
- case '$input':
26
- case '$textarea':
27
- return 'input';
28
- }
29
- return 'change';
30
- }
31
10
  function parseDate(value, props) {
32
11
  return value && props.valueFormat ? XEUtils.toStringDate(value, props.valueFormat) : value;
33
12
  }
@@ -36,7 +15,7 @@ function getFormatDate(value, props, defaultFormat) {
36
15
  return XEUtils.toDateString(parseDate(value, props), dateConfig.labelFormat || defaultFormat);
37
16
  }
38
17
  function getLabelFormatDate(value, props) {
39
- return getFormatDate(value, props, getI18n(`vxe.input.date.labelFormat.${props.type}`));
18
+ return getFormatDate(value, props, getI18n(`vxe.input.date.labelFormat.${props.type || 'date'}`));
40
19
  }
41
20
  /**
42
21
  * 已废弃
@@ -110,7 +89,7 @@ function getCellLabelVNs(h, renderOpts, params, cellLabel) {
110
89
  * @param modelFunc
111
90
  * @param changeFunc
112
91
  */
113
- function getElementOns(renderOpts, params, modelFunc, changeFunc) {
92
+ function getNativeElementOns(renderOpts, params, modelFunc, changeFunc) {
114
93
  const { events } = renderOpts;
115
94
  const modelEvent = getModelEvent(renderOpts);
116
95
  const changeEvent = getChangeEvent(renderOpts);
@@ -220,7 +199,7 @@ function getFilterOns(renderOpts, params, option) {
220
199
  function getNativeEditOns(renderOpts, params) {
221
200
  const { $table, row, column } = params;
222
201
  const { model } = column;
223
- return getElementOns(renderOpts, params, (evnt) => {
202
+ return getNativeElementOns(renderOpts, params, (evnt) => {
224
203
  // 处理 model 值双向绑定
225
204
  const cellValue = evnt.target.value;
226
205
  if (isImmediateCell(renderOpts, params)) {
@@ -237,7 +216,7 @@ function getNativeEditOns(renderOpts, params) {
237
216
  });
238
217
  }
239
218
  function getNativeFilterOns(renderOpts, params, option) {
240
- return getElementOns(renderOpts, params, (evnt) => {
219
+ return getNativeElementOns(renderOpts, params, (evnt) => {
241
220
  // 处理 model 值双向绑定
242
221
  option.data = evnt.target.value;
243
222
  }, () => {
@@ -332,7 +311,7 @@ function renderNativeOptgroups(h, renderOpts, params, renderOptionsMethods) {
332
311
  return optionGroups.map((group, gIndex) => {
333
312
  return h('optgroup', {
334
313
  key: gIndex,
335
- props: {
314
+ attrs: {
336
315
  label: group[groupLabel]
337
316
  }
338
317
  }, renderOptionsMethods(h, group[groupOptions], renderOpts, params));
@@ -609,15 +588,7 @@ renderer.mixin({
609
588
  const { row, column } = params;
610
589
  let cellValue = XEUtils.get(row, column.field);
611
590
  if (cellValue) {
612
- switch (props.type) {
613
- case 'date':
614
- case 'week':
615
- case 'month':
616
- case 'quarter':
617
- case 'year':
618
- cellValue = getLabelFormatDate(cellValue, props);
619
- break;
620
- }
591
+ cellValue = getLabelFormatDate(cellValue, props);
621
592
  }
622
593
  return getCellLabelVNs(h, renderOpts, params, cellValue);
623
594
  },
@@ -626,7 +597,8 @@ renderer.mixin({
626
597
  tableFilterDefaultMethod: handleFilterMethod
627
598
  },
628
599
  VxeTextarea: {
629
- tableAutoFocus: 'VxeTextarea'
600
+ tableAutoFocus: 'textarea',
601
+ renderTableEdit: defaultEditRender
630
602
  },
631
603
  VxeButton: {
632
604
  renderTableDefault: buttonCellRender
@@ -721,6 +693,19 @@ renderer.mixin({
721
693
  ];
722
694
  }
723
695
  },
696
+ VxeTextEllipsis: {
697
+ renderTableDefault(h, renderOpts, params) {
698
+ const { row, column } = params;
699
+ const { props } = renderOpts;
700
+ const cellValue = getCellValue(row, column);
701
+ return [
702
+ h(getDefaultComponent(renderOpts), {
703
+ props: Object.assign(Object.assign({}, props), { content: cellValue }),
704
+ on: getEditOns(renderOpts, params)
705
+ })
706
+ ];
707
+ }
708
+ },
724
709
  // 以下已废弃
725
710
  $input: {
726
711
  tableAutoFocus: '.vxe-input--inner',
@@ -236,6 +236,7 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
236
236
  'col--tree-node': treeNode,
237
237
  'col--edit': isEdit,
238
238
  'col--ellipsis': hasEllipsis,
239
+ 'col--height': !!rowOpts.height,
239
240
  'fixed--hidden': fixedHiddenColumn,
240
241
  'col--dirty': isDirty,
241
242
  'col--active': editConfig && isEdit && (actived.row === row && (actived.column === column || editOpts.mode === 'row')),
@@ -11,7 +11,7 @@ export class ColumnInfo {
11
11
  const proxyOpts = $xegrid ? $xegrid.proxyOpts : null;
12
12
  const formatter = _vm.formatter;
13
13
  const visible = XEUtils.isBoolean(_vm.visible) ? _vm.visible : true;
14
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
14
+ if (process.env.NODE_ENV === 'development') {
15
15
  const types = ['seq', 'checkbox', 'radio', 'expand', 'html'];
16
16
  if (_vm.type && types.indexOf(_vm.type) === -1) {
17
17
  warnLog('vxe.error.errProp', [`type=${_vm.type}`, types.join(', ')]);
@@ -39,13 +39,13 @@ export class ColumnInfo {
39
39
  if (formatter) {
40
40
  if (XEUtils.isString(formatter)) {
41
41
  const gFormatOpts = formats.get(formatter) || XEUtils[formatter];
42
- if (!gFormatOpts || !XEUtils.isFunction(gFormatOpts.cellFormatMethod)) {
42
+ if (!gFormatOpts || !XEUtils.isFunction(gFormatOpts.tableCellFormatMethod || gFormatOpts.cellFormatMethod)) {
43
43
  errLog('vxe.error.notFormats', [formatter]);
44
44
  }
45
45
  }
46
46
  else if (XEUtils.isArray(formatter)) {
47
47
  const gFormatOpts = formats.get(formatter[0]) || XEUtils[formatter[0]];
48
- if (!gFormatOpts || !XEUtils.isFunction(gFormatOpts.cellFormatMethod)) {
48
+ if (!gFormatOpts || !XEUtils.isFunction(gFormatOpts.tableCellFormatMethod || gFormatOpts.cellFormatMethod)) {
49
49
  errLog('vxe.error.notFormats', [formatter[0]]);
50
50
  }
51
51
  }
@@ -95,9 +95,10 @@ function computeVirtualX(_vm) {
95
95
  return { toVisibleIndex: 0, visibleSize: 8 };
96
96
  }
97
97
  function computeVirtualY(_vm) {
98
- const { $refs, vSize, rowHeightMaps } = _vm;
98
+ const { $refs, computeSize, rowHeightMaps } = _vm;
99
99
  const { tableHeader, tableBody } = $refs;
100
100
  const tableBodyElem = tableBody ? tableBody.$el : null;
101
+ const vSize = computeSize;
101
102
  if (tableBodyElem) {
102
103
  const tableHeaderElem = tableHeader ? tableHeader.$el : null;
103
104
  let rowHeight = 0;
@@ -382,7 +383,7 @@ const Methods = {
382
383
  if (treeConfig) {
383
384
  // 树结构自动转换
384
385
  if (treeOpts.transform) {
385
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
386
+ if (process.env.NODE_ENV === 'development') {
386
387
  if (!treeOpts.rowField) {
387
388
  errLog('vxe.error.reqProp', ['table.tree-config.rowField']);
388
389
  }
@@ -437,7 +438,7 @@ const Methods = {
437
438
  if (keepSource) {
438
439
  this.cacheSourceMap(fullData);
439
440
  }
440
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
441
+ if (process.env.NODE_ENV === 'development') {
441
442
  if (sYLoad) {
442
443
  if (!(this.height || this.maxHeight)) {
443
444
  errLog('vxe.error.reqProp', ['table.height | table.max-height | table.scroll-y={enabled: false}']);
@@ -571,7 +572,7 @@ const Methods = {
571
572
  this.tableData = tableData.slice(0);
572
573
  }
573
574
  else {
574
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
575
+ if (process.env.NODE_ENV === 'development') {
575
576
  warnLog('vxe.error.reqProp', ['keep-source']);
576
577
  }
577
578
  }
@@ -621,7 +622,7 @@ const Methods = {
621
622
  this.clearMergeCells();
622
623
  this.clearMergeFooterItems();
623
624
  this.handleTableData(true);
624
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
625
+ if (process.env.NODE_ENV === 'development') {
625
626
  if ((this.scrollXLoad || this.scrollYLoad) && this.expandColumn) {
626
627
  warnLog('vxe.error.scrollErrProp', ['column.type=expand']);
627
628
  }
@@ -761,7 +762,7 @@ const Methods = {
761
762
  const { id: colid, field, fixed, type, treeNode } = column;
762
763
  const rest = { column, colid, index, items, parent };
763
764
  if (field) {
764
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
765
+ if (process.env.NODE_ENV === 'development') {
765
766
  if (fullColumnFieldData[field]) {
766
767
  warnLog('vxe.error.colRepet', ['field', field]);
767
768
  }
@@ -775,7 +776,7 @@ const Methods = {
775
776
  htmlColumn = column;
776
777
  }
777
778
  if (treeNode) {
778
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
779
+ if (process.env.NODE_ENV === 'development') {
779
780
  if (treeNodeColumn) {
780
781
  warnLog('vxe.error.colRepet', ['tree-node', treeNode]);
781
782
  }
@@ -785,7 +786,7 @@ const Methods = {
785
786
  }
786
787
  }
787
788
  else if (type === 'expand') {
788
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
789
+ if (process.env.NODE_ENV === 'development') {
789
790
  if (expandColumn) {
790
791
  warnLog('vxe.error.colRepet', ['type', type]);
791
792
  }
@@ -794,7 +795,7 @@ const Methods = {
794
795
  expandColumn = column;
795
796
  }
796
797
  }
797
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
798
+ if (process.env.NODE_ENV === 'development') {
798
799
  if (type === 'checkbox') {
799
800
  if (checkboxColumn) {
800
801
  warnLog('vxe.error.colRepet', ['type', type]);
@@ -812,7 +813,7 @@ const Methods = {
812
813
  }
813
814
  }
814
815
  }
815
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
816
+ if (process.env.NODE_ENV === 'development') {
816
817
  if (this.showOverflow && column.showOverflow === false) {
817
818
  warnLog('vxe.error.errConflicts', [`table.show-overflow=${this.showOverflow}`, `column.show-overflow=${column.showOverflow}`]);
818
819
  }
@@ -823,7 +824,7 @@ const Methods = {
823
824
  warnLog('vxe.error.errConflicts', [`table.show-footer-overflow=${this.showFooterOverflow}`, `column.show-footer-overflow=${column.showFooterOverflow}`]);
824
825
  }
825
826
  }
826
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
827
+ if (process.env.NODE_ENV === 'development') {
827
828
  if (htmlColumn) {
828
829
  if (!columnOpts.useKey) {
829
830
  errLog('vxe.error.reqProp', ['column-config.useKey', 'column.type=html']);
@@ -852,7 +853,7 @@ const Methods = {
852
853
  else {
853
854
  tableFullColumn.forEach(handleFunc);
854
855
  }
855
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
856
+ if (process.env.NODE_ENV === 'development') {
856
857
  if (expandColumn && this.mouseOpts.area) {
857
858
  errLog('vxe.error.errConflicts', ['mouse-config.area', 'column.type=expand']);
858
859
  }
@@ -923,7 +924,7 @@ const Methods = {
923
924
  },
924
925
  // 在 v3 中废弃
925
926
  _getRowIndex(row) {
926
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
927
+ if (process.env.NODE_ENV === 'development') {
927
928
  warnLog('vxe.error.delFunc', ['_getRowIndex', 'getVTRowIndex']);
928
929
  }
929
930
  return this.getVTRowIndex(row);
@@ -937,7 +938,7 @@ const Methods = {
937
938
  },
938
939
  // 在 v3 中废弃
939
940
  $getRowIndex(row) {
940
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
941
+ if (process.env.NODE_ENV === 'development') {
941
942
  warnLog('vxe.error.delFunc', ['$getRowIndex', 'getVMRowIndex']);
942
943
  }
943
944
  return this.getVMRowIndex(row);
@@ -958,7 +959,7 @@ const Methods = {
958
959
  },
959
960
  // 在 v3 中废弃
960
961
  _getColumnIndex(column) {
961
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
962
+ if (process.env.NODE_ENV === 'development') {
962
963
  warnLog('vxe.error.delFunc', ['_getColumnIndex', 'getVTColumnIndex']);
963
964
  }
964
965
  return this.getVTColumnIndex(column);
@@ -972,7 +973,7 @@ const Methods = {
972
973
  },
973
974
  // 在 v3 中废弃
974
975
  $getColumnIndex(column) {
975
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
976
+ if (process.env.NODE_ENV === 'development') {
976
977
  warnLog('vxe.error.delFunc', ['$getColumnIndex', 'getVMColumnIndex']);
977
978
  }
978
979
  return this.getVMColumnIndex(column);
@@ -1060,7 +1061,7 @@ const Methods = {
1060
1061
  revertData(rows, field) {
1061
1062
  const { keepSource, tableSourceData, treeConfig } = this;
1062
1063
  if (!keepSource) {
1063
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
1064
+ if (process.env.NODE_ENV === 'development') {
1064
1065
  warnLog('vxe.error.reqProp', ['keep-source']);
1065
1066
  }
1066
1067
  return this.$nextTick();
@@ -1173,11 +1174,13 @@ const Methods = {
1173
1174
  const formatParams = { cellValue, row, rowIndex: this.getRowIndex(row), column, columnIndex: this.getColumnIndex(column) };
1174
1175
  if (XEUtils.isString(formatter)) {
1175
1176
  const gFormatOpts = formats.get(formatter);
1176
- cellLabel = gFormatOpts && gFormatOpts.cellFormatMethod ? gFormatOpts.cellFormatMethod(formatParams) : '';
1177
+ const tcFormatMethod = gFormatOpts ? (gFormatOpts.tableCellFormatMethod || gFormatOpts.cellFormatMethod) : null;
1178
+ cellLabel = tcFormatMethod ? tcFormatMethod(formatParams) : '';
1177
1179
  }
1178
1180
  else if (XEUtils.isArray(formatter)) {
1179
1181
  const gFormatOpts = formats.get(formatter[0]);
1180
- cellLabel = gFormatOpts && gFormatOpts.cellFormatMethod ? gFormatOpts.cellFormatMethod(formatParams, ...formatter.slice(1)) : '';
1182
+ const tcFormatMethod = gFormatOpts ? (gFormatOpts.tableCellFormatMethod || gFormatOpts.cellFormatMethod) : null;
1183
+ cellLabel = tcFormatMethod ? tcFormatMethod(formatParams, ...formatter.slice(1)) : '';
1181
1184
  }
1182
1185
  else {
1183
1186
  cellLabel = formatter(formatParams);
@@ -1387,8 +1390,8 @@ const Methods = {
1387
1390
  if (valueList.length && !allRemoteFilter) {
1388
1391
  const { filterMethod, filterRender, field } = column;
1389
1392
  const compConf = isEnableConf(filterRender) ? renderer.get(filterRender.name) : null;
1390
- const compFilterMethod = compConf && compConf.renderFilter ? (compConf.tableFilterMethod || compConf.filterMethod) : null;
1391
- const defaultFilterMethod = compConf ? (compConf.tableFilterDefaultMethod || compConf.defaultTableFilterMethod || compConf.defaultFilterMethod) : null;
1393
+ const compFilterMethod = compConf ? (compConf.tableFilterMethod || compConf.filterMethod) : null;
1394
+ const tdFilterMethod = compConf ? (compConf.tableFilterDefaultMethod || compConf.defaultTableFilterMethod || compConf.defaultFilterMethod) : null;
1392
1395
  const cellValue = getCellValue(row, column);
1393
1396
  if (filterMethod) {
1394
1397
  return itemList.some((item) => filterMethod({ value: item.value, option: item, cellValue, row, column, $table: this }));
@@ -1399,8 +1402,8 @@ const Methods = {
1399
1402
  else if (allFilterMethod) {
1400
1403
  return allFilterMethod({ options: itemList, values: valueList, cellValue, row, column });
1401
1404
  }
1402
- else if (defaultFilterMethod) {
1403
- return itemList.some((item) => defaultFilterMethod({ value: item.value, option: item, cellValue, row, column, $table: this }));
1405
+ else if (tdFilterMethod) {
1406
+ return itemList.some((item) => tdFilterMethod({ value: item.value, option: item, cellValue, row, column, $table: this }));
1404
1407
  }
1405
1408
  return valueList.indexOf(XEUtils.get(row, field)) > -1;
1406
1409
  }
@@ -2003,7 +2006,7 @@ const Methods = {
2003
2006
  this.hasFixedColumn = leftList.length > 0 || rightList.length > 0;
2004
2007
  Object.assign(columnStore, { leftList, centerList, rightList });
2005
2008
  if (scrollXLoad) {
2006
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
2009
+ if (process.env.NODE_ENV === 'development') {
2007
2010
  // if (this.showHeader && !this.showHeaderOverflow) {
2008
2011
  // warnLog('vxe.error.reqProp', ['show-header-overflow'])
2009
2012
  // }
@@ -2158,10 +2161,21 @@ const Methods = {
2158
2161
  paddingSize = Math.floor(XEUtils.toNumber(cellStyle.paddingLeft) + XEUtils.toNumber(cellStyle.paddingRight)) + 2;
2159
2162
  }
2160
2163
  let colWidth = column.renderAutoWidth - paddingSize;
2161
- XEUtils.arrayEach(cellElList, (cellEl) => {
2162
- const labelEl = cellEl.firstChild;
2163
- if (labelEl) {
2164
- colWidth = Math.max(colWidth, Math.ceil(labelEl.offsetWidth) + 4);
2164
+ XEUtils.arrayEach(cellElList, (itemEl) => {
2165
+ const cellEl = itemEl;
2166
+ const thElem = cellEl.parentNode;
2167
+ let titleWidth = 0;
2168
+ if (`${thElem.tagName}`.toLowerCase() === 'th') {
2169
+ XEUtils.arrayEach(cellEl.children, (btnEl) => {
2170
+ titleWidth += btnEl.offsetWidth + 1;
2171
+ });
2172
+ }
2173
+ else {
2174
+ const labelEl = cellEl.firstChild;
2175
+ titleWidth = labelEl.offsetWidth;
2176
+ }
2177
+ if (titleWidth) {
2178
+ colWidth = Math.max(colWidth, Math.ceil(titleWidth) + 4);
2165
2179
  }
2166
2180
  });
2167
2181
  column.renderAutoWidth = colWidth + paddingSize;
@@ -2587,7 +2601,7 @@ const Methods = {
2587
2601
  // 兼容老版本
2588
2602
  if (!evntList.length && type === 'event.clearEdit') {
2589
2603
  evntList = interceptor.get('event.clearActived');
2590
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
2604
+ if (process.env.NODE_ENV === 'development') {
2591
2605
  if (evntList.length) {
2592
2606
  warnLog('vxe.error.delEvent', ['event.clearActived', 'event.clearEdit']);
2593
2607
  }
@@ -3012,12 +3026,6 @@ const Methods = {
3012
3026
  setCellValue(selected.row, selected.column, null);
3013
3027
  this.handleEdit(selected.args, evnt);
3014
3028
  }
3015
- const afterEditMethod = editOpts.afterEditMethod;
3016
- if (afterEditMethod) {
3017
- this.$nextTick(() => {
3018
- afterEditMethod(params);
3019
- });
3020
- }
3021
3029
  }
3022
3030
  }
3023
3031
  }
@@ -4457,7 +4465,7 @@ const Methods = {
4457
4465
  },
4458
4466
  // 在 v3 中废弃
4459
4467
  getSortColumn() {
4460
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
4468
+ if (process.env.NODE_ENV === 'development') {
4461
4469
  warnLog('vxe.error.delFunc', ['getSortColumn', 'getSortColumns']);
4462
4470
  }
4463
4471
  return XEUtils.find(this.tableFullColumn, column => (column.sortable || column.remoteSort) && column.order);
@@ -4554,7 +4562,7 @@ const Methods = {
4554
4562
  return this.$nextTick();
4555
4563
  },
4556
4564
  reloadExpandContent(row) {
4557
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
4565
+ if (process.env.NODE_ENV === 'development') {
4558
4566
  warnLog('vxe.error.delFunc', ['reloadExpandContent', 'reloadRowExpand']);
4559
4567
  }
4560
4568
  // 即将废弃
@@ -4721,7 +4729,7 @@ const Methods = {
4721
4729
  return !!rowExpandedMaps[rowid];
4722
4730
  },
4723
4731
  isExpandByRow(row) {
4724
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
4732
+ if (process.env.NODE_ENV === 'development') {
4725
4733
  warnLog('vxe.error.delFunc', ['isExpandByRow', 'isRowExpandByRow']);
4726
4734
  }
4727
4735
  // 即将废弃
@@ -4839,7 +4847,7 @@ const Methods = {
4839
4847
  return this.$nextTick();
4840
4848
  },
4841
4849
  reloadTreeChilds(row) {
4842
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
4850
+ if (process.env.NODE_ENV === 'development') {
4843
4851
  warnLog('vxe.error.delFunc', ['reloadTreeChilds', 'reloadTreeExpand']);
4844
4852
  }
4845
4853
  // 即将废弃
@@ -5615,7 +5623,7 @@ const Methods = {
5615
5623
  const funcs = 'setFilter,openFilter,clearFilter,getCheckedFilters,updateFilterOptionStatus,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,getCopyCellAreas,clearCopyCellArea,setCellAreas,openFNR,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,insertNextAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearEdit,clearActived,getEditRecord,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,openExport,openPrint,getPrintHtml,exportData,openImport,importData,saveFile,readFile,importByFile,print,openCustom,closeCustom'.split(',');
5616
5624
  funcs.forEach(name => {
5617
5625
  Methods[name] = function (...args) {
5618
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
5626
+ if (process.env.NODE_ENV === 'development') {
5619
5627
  if (!this[`_${name}`]) {
5620
5628
  if ('openExport,openPrint,exportData,openImport,importData,saveFile,readFile,importByFile,print'.split(',').includes(name)) {
5621
5629
  errLog('vxe.error.reqModule', ['VxeTableExportModule']);