vxe-table 4.21.0-beta.0 → 4.21.0-beta.2

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 (144) hide show
  1. package/dist/all.esm.js +104 -12
  2. package/dist/style.css +1 -1
  3. package/es/locale/lang/ar-EG.js +2 -0
  4. package/es/locale/lang/de-DE.js +2 -0
  5. package/es/locale/lang/en-US.js +2 -0
  6. package/es/locale/lang/es-ES.js +2 -0
  7. package/es/locale/lang/fr-FR.js +2 -0
  8. package/es/locale/lang/hu-HU.js +2 -0
  9. package/es/locale/lang/hy-AM.js +2 -0
  10. package/es/locale/lang/id-ID.js +2 -0
  11. package/es/locale/lang/it-IT.js +2 -0
  12. package/es/locale/lang/ja-JP.js +2 -0
  13. package/es/locale/lang/ko-KR.js +2 -0
  14. package/es/locale/lang/ms-MY.js +2 -0
  15. package/es/locale/lang/nb-NO.js +2 -0
  16. package/es/locale/lang/pt-BR.js +2 -0
  17. package/es/locale/lang/ru-RU.js +2 -0
  18. package/es/locale/lang/th-TH.js +2 -0
  19. package/es/locale/lang/ug-CN.js +2 -0
  20. package/es/locale/lang/uk-UA.js +2 -0
  21. package/es/locale/lang/uz-UZ.js +2 -0
  22. package/es/locale/lang/vi-VN.js +2 -0
  23. package/es/locale/lang/zh-CHT.js +2 -0
  24. package/es/locale/lang/zh-CN.js +2 -0
  25. package/es/style.css +1 -1
  26. package/es/table/module/export/hook.js +79 -3
  27. package/es/table/render/index.js +6 -6
  28. package/es/table/src/table.js +8 -0
  29. package/es/ui/index.js +1 -1
  30. package/es/ui/src/dom.js +7 -1
  31. package/es/ui/src/log.js +1 -1
  32. package/lib/index.umd.js +100 -13
  33. package/lib/index.umd.min.js +1 -1
  34. package/lib/locale/lang/ar-EG.js +2 -0
  35. package/lib/locale/lang/ar-EG.min.js +1 -1
  36. package/lib/locale/lang/ar-EG.umd.js +2 -0
  37. package/lib/locale/lang/de-DE.js +2 -0
  38. package/lib/locale/lang/de-DE.min.js +1 -1
  39. package/lib/locale/lang/de-DE.umd.js +2 -0
  40. package/lib/locale/lang/en-US.js +2 -0
  41. package/lib/locale/lang/en-US.min.js +1 -1
  42. package/lib/locale/lang/en-US.umd.js +2 -0
  43. package/lib/locale/lang/es-ES.js +2 -0
  44. package/lib/locale/lang/es-ES.min.js +1 -1
  45. package/lib/locale/lang/es-ES.umd.js +2 -0
  46. package/lib/locale/lang/fr-FR.js +2 -0
  47. package/lib/locale/lang/fr-FR.min.js +1 -1
  48. package/lib/locale/lang/fr-FR.umd.js +2 -0
  49. package/lib/locale/lang/hu-HU.js +2 -0
  50. package/lib/locale/lang/hu-HU.min.js +1 -1
  51. package/lib/locale/lang/hu-HU.umd.js +2 -0
  52. package/lib/locale/lang/hy-AM.js +2 -0
  53. package/lib/locale/lang/hy-AM.min.js +1 -1
  54. package/lib/locale/lang/hy-AM.umd.js +2 -0
  55. package/lib/locale/lang/id-ID.js +2 -0
  56. package/lib/locale/lang/id-ID.min.js +1 -1
  57. package/lib/locale/lang/id-ID.umd.js +2 -0
  58. package/lib/locale/lang/it-IT.js +2 -0
  59. package/lib/locale/lang/it-IT.min.js +1 -1
  60. package/lib/locale/lang/it-IT.umd.js +2 -0
  61. package/lib/locale/lang/ja-JP.js +2 -0
  62. package/lib/locale/lang/ja-JP.min.js +1 -1
  63. package/lib/locale/lang/ja-JP.umd.js +2 -0
  64. package/lib/locale/lang/ko-KR.js +2 -0
  65. package/lib/locale/lang/ko-KR.min.js +1 -1
  66. package/lib/locale/lang/ko-KR.umd.js +2 -0
  67. package/lib/locale/lang/ms-MY.js +2 -0
  68. package/lib/locale/lang/ms-MY.min.js +1 -1
  69. package/lib/locale/lang/ms-MY.umd.js +2 -0
  70. package/lib/locale/lang/nb-NO.js +2 -0
  71. package/lib/locale/lang/nb-NO.min.js +1 -1
  72. package/lib/locale/lang/nb-NO.umd.js +2 -0
  73. package/lib/locale/lang/pt-BR.js +2 -0
  74. package/lib/locale/lang/pt-BR.min.js +1 -1
  75. package/lib/locale/lang/pt-BR.umd.js +2 -0
  76. package/lib/locale/lang/ru-RU.js +2 -0
  77. package/lib/locale/lang/ru-RU.min.js +1 -1
  78. package/lib/locale/lang/ru-RU.umd.js +2 -0
  79. package/lib/locale/lang/th-TH.js +2 -0
  80. package/lib/locale/lang/th-TH.min.js +1 -1
  81. package/lib/locale/lang/th-TH.umd.js +2 -0
  82. package/lib/locale/lang/ug-CN.js +2 -0
  83. package/lib/locale/lang/ug-CN.min.js +1 -1
  84. package/lib/locale/lang/ug-CN.umd.js +2 -0
  85. package/lib/locale/lang/uk-UA.js +2 -0
  86. package/lib/locale/lang/uk-UA.min.js +1 -1
  87. package/lib/locale/lang/uk-UA.umd.js +2 -0
  88. package/lib/locale/lang/uz-UZ.js +2 -0
  89. package/lib/locale/lang/uz-UZ.min.js +1 -1
  90. package/lib/locale/lang/uz-UZ.umd.js +2 -0
  91. package/lib/locale/lang/vi-VN.js +2 -0
  92. package/lib/locale/lang/vi-VN.min.js +1 -1
  93. package/lib/locale/lang/vi-VN.umd.js +2 -0
  94. package/lib/locale/lang/zh-CHT.js +2 -0
  95. package/lib/locale/lang/zh-CHT.min.js +1 -1
  96. package/lib/locale/lang/zh-CHT.umd.js +2 -0
  97. package/lib/locale/lang/zh-CN.js +2 -0
  98. package/lib/locale/lang/zh-CN.min.js +1 -1
  99. package/lib/locale/lang/zh-CN.umd.js +2 -0
  100. package/lib/style.css +1 -1
  101. package/lib/table/module/export/hook.js +82 -3
  102. package/lib/table/module/export/hook.min.js +1 -1
  103. package/lib/table/render/index.js +6 -6
  104. package/lib/table/src/table.js +1 -1
  105. package/lib/table/src/table.min.js +1 -1
  106. package/lib/ui/index.js +1 -1
  107. package/lib/ui/index.min.js +1 -1
  108. package/lib/ui/src/dom.js +7 -1
  109. package/lib/ui/src/dom.min.js +1 -1
  110. package/lib/ui/src/log.js +1 -1
  111. package/lib/ui/src/log.min.js +1 -1
  112. package/package.json +2 -2
  113. package/packages/locale/lang/ar-EG.ts +2 -0
  114. package/packages/locale/lang/de-DE.ts +2 -0
  115. package/packages/locale/lang/en-US.ts +2 -0
  116. package/packages/locale/lang/es-ES.ts +2 -0
  117. package/packages/locale/lang/fr-FR.ts +2 -0
  118. package/packages/locale/lang/hu-HU.ts +2 -0
  119. package/packages/locale/lang/hy-AM.ts +2 -0
  120. package/packages/locale/lang/id-ID.ts +2 -0
  121. package/packages/locale/lang/it-IT.ts +2 -0
  122. package/packages/locale/lang/ja-JP.ts +2 -0
  123. package/packages/locale/lang/ko-KR.ts +2 -0
  124. package/packages/locale/lang/ms-MY.ts +2 -0
  125. package/packages/locale/lang/nb-NO.ts +2 -0
  126. package/packages/locale/lang/pt-BR.ts +2 -0
  127. package/packages/locale/lang/ru-RU.ts +2 -0
  128. package/packages/locale/lang/th-TH.ts +2 -0
  129. package/packages/locale/lang/ug-CN.ts +2 -0
  130. package/packages/locale/lang/uk-UA.ts +2 -0
  131. package/packages/locale/lang/uz-UZ.ts +2 -0
  132. package/packages/locale/lang/vi-VN.ts +2 -0
  133. package/packages/locale/lang/zh-CHT.ts +2 -0
  134. package/packages/locale/lang/zh-CN.ts +2 -0
  135. package/packages/table/module/export/hook.ts +76 -3
  136. package/packages/table/render/index.ts +6 -6
  137. package/packages/table/src/table.ts +8 -0
  138. package/packages/ui/src/dom.ts +7 -1
  139. /package/es/{iconfont.1786796867061.ttf → iconfont.1787119217086.ttf} +0 -0
  140. /package/es/{iconfont.1786796867061.woff → iconfont.1787119217086.woff} +0 -0
  141. /package/es/{iconfont.1786796867061.woff2 → iconfont.1787119217086.woff2} +0 -0
  142. /package/lib/{iconfont.1786796867061.ttf → iconfont.1787119217086.ttf} +0 -0
  143. /package/lib/{iconfont.1786796867061.woff → iconfont.1787119217086.woff} +0 -0
  144. /package/lib/{iconfont.1786796867061.woff2 → iconfont.1787119217086.woff2} +0 -0
package/dist/all.esm.js CHANGED
@@ -44,7 +44,7 @@ function eqEmptyValue(cellValue) {
44
44
  return cellValue === '' || XEUtils.eqNull(cellValue);
45
45
  }
46
46
 
47
- const version = "4.21.0-beta.0";
47
+ const version = "4.21.0-beta.2";
48
48
  VxeUI.version = version;
49
49
  VxeUI.tableVersion = version;
50
50
  VxeUI.setConfig({
@@ -603,7 +603,13 @@ function isScale(val) {
603
603
  return val && /^\d+(\.\d+)?%$/.test(val);
604
604
  }
605
605
  function hasClass(elem, cls) {
606
- return !!(elem && elem.className && elem.className.match && elem.className.match(getClsRE(cls)));
606
+ if (elem) {
607
+ if (elem.classList) {
608
+ return elem.classList.contains(cls);
609
+ }
610
+ return !!(elem.className && elem.className.match && elem.className.match(getClsRE(cls)));
611
+ }
612
+ return false;
607
613
  }
608
614
  function removeClass(elem, cls) {
609
615
  if (elem && hasClass(elem, cls)) {
@@ -760,7 +766,7 @@ function wheelScrollTopTo(diffNum, cb) {
760
766
  }
761
767
 
762
768
  const { log } = VxeUI;
763
- const tableVersion = `table v${"4.21.0-beta.0"}`;
769
+ const tableVersion = `table v${"4.21.0-beta.2"}`;
764
770
  function createComponentLog(name) {
765
771
  const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
766
772
  const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
@@ -12060,7 +12066,16 @@ hooks$4.add('tableExportModule', {
12060
12066
  }
12061
12067
  if (!handleOptions.print) {
12062
12068
  if (beforeExportMethod) {
12063
- beforeExportMethod({ options: handleOptions, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt });
12069
+ const beRest = beforeExportMethod({ options: handleOptions, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt });
12070
+ if (XEUtils.isBoolean(beRest)) {
12071
+ if (!beRest) {
12072
+ const params = { status: false };
12073
+ return Promise.reject(params);
12074
+ }
12075
+ }
12076
+ else {
12077
+ warnLog$4('vxe.error.returnErr', ['beforeExportMethod', 'boolean', beRest]);
12078
+ }
12064
12079
  }
12065
12080
  }
12066
12081
  if (!handleOptions.data) {
@@ -12168,7 +12183,16 @@ hooks$4.add('tableExportModule', {
12168
12183
  const opts = Object.assign({}, options);
12169
12184
  const { beforeImportMethod } = opts;
12170
12185
  if (beforeImportMethod) {
12171
- beforeImportMethod({ options: opts, $table: $xeTable });
12186
+ const biRest = beforeImportMethod({ options: opts, $table: $xeTable });
12187
+ if (XEUtils.isBoolean(biRest)) {
12188
+ if (!biRest) {
12189
+ const params = { status: false };
12190
+ return Promise.reject(params);
12191
+ }
12192
+ }
12193
+ else {
12194
+ warnLog$4('vxe.error.returnErr', ['beforeImportMethod', 'boolean', biRest]);
12195
+ }
12172
12196
  }
12173
12197
  return handleFileImport(file, opts);
12174
12198
  },
@@ -12181,7 +12205,16 @@ hooks$4.add('tableExportModule', {
12181
12205
  }, importOpts, options);
12182
12206
  const { beforeImportMethod, afterImportMethod } = opts;
12183
12207
  if (beforeImportMethod) {
12184
- beforeImportMethod({ options: opts, $table: $xeTable });
12208
+ const biRest = beforeImportMethod({ options: opts, $table: $xeTable });
12209
+ if (XEUtils.isBoolean(biRest)) {
12210
+ if (!biRest) {
12211
+ const params = { status: false };
12212
+ return Promise.reject(params);
12213
+ }
12214
+ }
12215
+ else {
12216
+ warnLog$4('vxe.error.returnErr', ['beforeImportMethod', 'boolean', biRest]);
12217
+ }
12185
12218
  }
12186
12219
  return VxeUI.readFile(opts).catch(e => {
12187
12220
  if (afterImportMethod) {
@@ -12231,6 +12264,7 @@ hooks$4.add('tableExportModule', {
12231
12264
  printTitle = document.title || '';
12232
12265
  }
12233
12266
  const beforePrintMethod = opts.beforePrintMethod;
12267
+ const printMethod = opts.printMethod;
12234
12268
  const tableHtml = opts.html || opts.content;
12235
12269
  return new Promise((resolve, reject) => {
12236
12270
  if (VxeUI.print) {
@@ -12250,6 +12284,30 @@ hooks$4.add('tableExportModule', {
12250
12284
  $gantt: $xeGantt
12251
12285
  });
12252
12286
  }
12287
+ : undefined,
12288
+ beforePrintMethod: beforePrintMethod
12289
+ ? ({ html }) => {
12290
+ return beforePrintMethod({
12291
+ html,
12292
+ content: html,
12293
+ options: opts,
12294
+ $table: $xeTable,
12295
+ $grid: $xeGrid,
12296
+ $gantt: $xeGantt
12297
+ });
12298
+ }
12299
+ : undefined,
12300
+ printMethod: printMethod
12301
+ ? ({ html }) => {
12302
+ return printMethod({
12303
+ html,
12304
+ content: html,
12305
+ options: opts,
12306
+ $table: $xeTable,
12307
+ $grid: $xeGrid,
12308
+ $gantt: $xeGantt
12309
+ });
12310
+ }
12253
12311
  : undefined
12254
12312
  }));
12255
12313
  }
@@ -12270,6 +12328,30 @@ hooks$4.add('tableExportModule', {
12270
12328
  $gantt: $xeGantt
12271
12329
  });
12272
12330
  }
12331
+ : undefined,
12332
+ beforePrintMethod: beforePrintMethod
12333
+ ? ({ html }) => {
12334
+ return beforePrintMethod({
12335
+ html,
12336
+ content: html,
12337
+ options: opts,
12338
+ $table: $xeTable,
12339
+ $grid: $xeGrid,
12340
+ $gantt: $xeGantt
12341
+ });
12342
+ }
12343
+ : undefined,
12344
+ printMethod: printMethod
12345
+ ? ({ html }) => {
12346
+ return printMethod({
12347
+ html,
12348
+ content: html,
12349
+ options: opts,
12350
+ $table: $xeTable,
12351
+ $grid: $xeGrid,
12352
+ $gantt: $xeGantt
12353
+ });
12354
+ }
12273
12355
  : undefined
12274
12356
  });
12275
12357
  }));
@@ -14658,9 +14740,9 @@ function handleNumberCell(cellValue, renderOpts, params) {
14658
14740
  }
14659
14741
  : {});
14660
14742
  }
14661
- function handleFormatDatePicker(renderOpts, params) {
14743
+ function handleFormatDatePicker(renderOpts, renderParams) {
14662
14744
  const { props = {} } = renderOpts;
14663
- const { cellValue } = params;
14745
+ const { cellValue } = renderParams;
14664
14746
  if (cellValue) {
14665
14747
  if (props.type !== 'time') {
14666
14748
  return getLabelFormatDate(cellValue, props);
@@ -14668,12 +14750,12 @@ function handleFormatDatePicker(renderOpts, params) {
14668
14750
  }
14669
14751
  return cellValue;
14670
14752
  }
14671
- function handleFormatSelect(renderOpts, params) {
14672
- const { cellValue } = params;
14753
+ function handleFormatSelect(renderOpts, renderParams) {
14754
+ const { cellValue } = renderParams;
14673
14755
  return handleSelectCellValue(cellValue, renderOpts);
14674
14756
  }
14675
- function handleSetSelectValue(renderOpts, params) {
14676
- const { row, column, cellValue } = params;
14757
+ function handleSetSelectValue(renderOpts, renderParams) {
14758
+ const { row, column, cellValue } = renderParams;
14677
14759
  const { field } = column;
14678
14760
  if (field) {
14679
14761
  const { options, optionGroups, optionProps = {}, optionGroupProps = {}, props } = renderOpts;
@@ -19973,6 +20055,7 @@ var VxeTableComponent = defineVxeComponent({
19973
20055
  };
19974
20056
  const handleSyncScroll = (isRollX, isRollY) => {
19975
20057
  const { scrollXLoad, scrollYLoad, isAllOverflow } = reactData;
20058
+ const autoWidthColumnList = computeAutoWidthColumnList.value;
19976
20059
  internalData.lcsRunTime = Date.now();
19977
20060
  internalData.lcsTimeout = undefined;
19978
20061
  internalData.intoRunScroll = false;
@@ -19993,7 +20076,14 @@ var VxeTableComponent = defineVxeComponent({
19993
20076
  xRest = $xeTable.updateScrollXData();
19994
20077
  }
19995
20078
  if (isRollY && scrollYLoad) {
20079
+ if (autoWidthColumnList.length) {
20080
+ calcCellWidth();
20081
+ }
19996
20082
  yRest = $xeTable.updateScrollYData().then(() => {
20083
+ if (autoWidthColumnList.length) {
20084
+ calcCellWidth();
20085
+ autoCellWidth();
20086
+ }
19997
20087
  if (!isAllOverflow) {
19998
20088
  calcCellHeight();
19999
20089
  updateRowOffsetTop();
@@ -32711,6 +32801,8 @@ var zhCN = {
32711
32801
  noTree: '树结构不支持 "{0}"',
32712
32802
  noGroup: '数据分组后不支持 "{0}"',
32713
32803
  notProp: '不支持的参数 "{0}"',
32804
+ returnErr: '参数 "{0}" 的返回值期望是 "{1}" 实际是 "{2}"',
32805
+ notSupportReturn: '当返回值为 "{0}" 时的参数应该使用用 "{1}" 而不是 "{2}"',
32714
32806
  checkProp: '当数据量过大时可能会导致复选框卡顿,建议设置参数 "{0}" 提升渲染速度',
32715
32807
  coverProp: '"{0}" 的参数 "{1}" 重复定义,这可能会出现错误',
32716
32808
  uniField: '字段名 "{0}" 重复定义,这可能会出现错误',