vxe-table 3.12.10-beta.2 → 3.12.10-beta.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 (178) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/locale/lang/ar-EG.js +2 -1
  4. package/es/locale/lang/de-DE.js +2 -1
  5. package/es/locale/lang/en-US.js +2 -1
  6. package/es/locale/lang/es-ES.js +2 -1
  7. package/es/locale/lang/fr-FR.js +2 -1
  8. package/es/locale/lang/hu-HU.js +2 -1
  9. package/es/locale/lang/hy-AM.js +2 -1
  10. package/es/locale/lang/it-IT.js +2 -1
  11. package/es/locale/lang/ja-JP.js +2 -1
  12. package/es/locale/lang/ko-KR.js +2 -1
  13. package/es/locale/lang/nb-NO.js +2 -1
  14. package/es/locale/lang/pt-BR.js +2 -1
  15. package/es/locale/lang/ru-RU.js +4 -3
  16. package/es/locale/lang/th-TH.js +2 -1
  17. package/es/locale/lang/ug-CN.js +2 -1
  18. package/es/locale/lang/uk-UA.js +518 -517
  19. package/es/locale/lang/vi-VN.js +2 -1
  20. package/es/locale/lang/zh-CHT.js +2 -1
  21. package/es/locale/lang/zh-CN.js +2 -1
  22. package/es/style.css +1 -1
  23. package/es/style.min.css +1 -1
  24. package/es/table/module/edit/mixin.js +7 -7
  25. package/es/table/module/export/mixin.js +55 -32
  26. package/es/table/module/keyboard/mixin.js +68 -25
  27. package/es/table/module/menu/mixin.js +3 -1
  28. package/es/table/src/body.js +96 -64
  29. package/es/table/src/cell.js +3 -7
  30. package/es/table/src/column.js +2 -0
  31. package/es/table/src/columnInfo.js +1 -0
  32. package/es/table/src/footer.js +31 -6
  33. package/es/table/src/header.js +45 -141
  34. package/es/table/src/methods.js +918 -456
  35. package/es/table/src/props.js +6 -2
  36. package/es/table/src/table.js +299 -149
  37. package/es/table/src/util.js +67 -57
  38. package/es/table/style.css +299 -191
  39. package/es/table/style.min.css +1 -1
  40. package/es/ui/index.js +20 -10
  41. package/es/ui/src/log.js +1 -1
  42. package/es/vxe-table/style.css +299 -191
  43. package/es/vxe-table/style.min.css +1 -1
  44. package/lib/index.css +1 -1
  45. package/lib/index.min.css +1 -1
  46. package/lib/index.umd.js +1735 -1025
  47. package/lib/index.umd.min.js +1 -1
  48. package/lib/locale/lang/ar-EG.js +2 -1
  49. package/lib/locale/lang/ar-EG.min.js +1 -1
  50. package/lib/locale/lang/de-DE.js +2 -1
  51. package/lib/locale/lang/de-DE.min.js +1 -1
  52. package/lib/locale/lang/en-US.js +2 -1
  53. package/lib/locale/lang/en-US.min.js +1 -1
  54. package/lib/locale/lang/en-US.umd.js +2 -1
  55. package/lib/locale/lang/es-ES.js +2 -1
  56. package/lib/locale/lang/es-ES.min.js +1 -1
  57. package/lib/locale/lang/es-ES.umd.js +2 -1
  58. package/lib/locale/lang/fr-FR.js +2 -1
  59. package/lib/locale/lang/fr-FR.min.js +1 -1
  60. package/lib/locale/lang/hu-HU.js +2 -1
  61. package/lib/locale/lang/hu-HU.min.js +1 -1
  62. package/lib/locale/lang/hu-HU.umd.js +2 -1
  63. package/lib/locale/lang/hy-AM.js +2 -1
  64. package/lib/locale/lang/hy-AM.min.js +1 -1
  65. package/lib/locale/lang/it-IT.js +2 -1
  66. package/lib/locale/lang/it-IT.min.js +1 -1
  67. package/lib/locale/lang/ja-JP.js +2 -1
  68. package/lib/locale/lang/ja-JP.min.js +1 -1
  69. package/lib/locale/lang/ja-JP.umd.js +2 -1
  70. package/lib/locale/lang/ko-KR.js +2 -1
  71. package/lib/locale/lang/ko-KR.min.js +1 -1
  72. package/lib/locale/lang/ko-KR.umd.js +2 -1
  73. package/lib/locale/lang/nb-NO.js +2 -1
  74. package/lib/locale/lang/nb-NO.min.js +1 -1
  75. package/lib/locale/lang/pt-BR.js +2 -1
  76. package/lib/locale/lang/pt-BR.min.js +1 -1
  77. package/lib/locale/lang/pt-BR.umd.js +2 -1
  78. package/lib/locale/lang/ru-RU.js +4 -3
  79. package/lib/locale/lang/ru-RU.min.js +1 -1
  80. package/lib/locale/lang/ru-RU.umd.js +4 -3
  81. package/lib/locale/lang/th-TH.js +2 -1
  82. package/lib/locale/lang/th-TH.min.js +1 -1
  83. package/lib/locale/lang/ug-CN.js +2 -1
  84. package/lib/locale/lang/ug-CN.min.js +1 -1
  85. package/lib/locale/lang/uk-UA.js +518 -517
  86. package/lib/locale/lang/uk-UA.min.js +1 -1
  87. package/lib/locale/lang/uk-UA.umd.js +518 -517
  88. package/lib/locale/lang/vi-VN.js +2 -1
  89. package/lib/locale/lang/vi-VN.min.js +1 -1
  90. package/lib/locale/lang/zh-CHT.js +2 -1
  91. package/lib/locale/lang/zh-CHT.min.js +1 -1
  92. package/lib/locale/lang/zh-CHT.umd.js +2 -1
  93. package/lib/locale/lang/zh-CN.js +2 -1
  94. package/lib/locale/lang/zh-CN.min.js +1 -1
  95. package/lib/locale/lang/zh-CN.umd.js +2 -1
  96. package/lib/style.css +1 -1
  97. package/lib/style.min.css +1 -1
  98. package/lib/table/module/edit/mixin.js +12 -2
  99. package/lib/table/module/edit/mixin.min.js +1 -1
  100. package/lib/table/module/export/mixin.js +52 -27
  101. package/lib/table/module/export/mixin.min.js +1 -1
  102. package/lib/table/module/keyboard/mixin.js +73 -27
  103. package/lib/table/module/keyboard/mixin.min.js +1 -1
  104. package/lib/table/module/menu/mixin.js +3 -1
  105. package/lib/table/src/body.js +89 -60
  106. package/lib/table/src/body.min.js +1 -1
  107. package/lib/table/src/cell.js +3 -5
  108. package/lib/table/src/cell.min.js +1 -1
  109. package/lib/table/src/column.js +2 -0
  110. package/lib/table/src/column.min.js +1 -1
  111. package/lib/table/src/columnInfo.js +1 -0
  112. package/lib/table/src/columnInfo.min.js +1 -1
  113. package/lib/table/src/footer.js +26 -6
  114. package/lib/table/src/footer.min.js +1 -1
  115. package/lib/table/src/header.js +38 -153
  116. package/lib/table/src/header.min.js +1 -1
  117. package/lib/table/src/methods.js +1076 -551
  118. package/lib/table/src/methods.min.js +1 -1
  119. package/lib/table/src/props.js +6 -2
  120. package/lib/table/src/props.min.js +1 -1
  121. package/lib/table/src/table.js +269 -129
  122. package/lib/table/src/table.min.js +1 -1
  123. package/lib/table/src/util.js +80 -70
  124. package/lib/table/src/util.min.js +1 -1
  125. package/lib/table/style/style.css +299 -191
  126. package/lib/table/style/style.min.css +1 -1
  127. package/lib/ui/index.js +20 -10
  128. package/lib/ui/index.min.js +1 -1
  129. package/lib/ui/src/log.js +1 -1
  130. package/lib/ui/src/log.min.js +1 -1
  131. package/lib/vxe-table/style/style.css +299 -191
  132. package/lib/vxe-table/style/style.min.css +1 -1
  133. package/package.json +2 -2
  134. package/packages/locale/lang/ar-EG.ts +2 -1
  135. package/packages/locale/lang/de-DE.ts +2 -1
  136. package/packages/locale/lang/en-US.ts +2 -1
  137. package/packages/locale/lang/es-ES.ts +2 -1
  138. package/packages/locale/lang/fr-FR.ts +2 -1
  139. package/packages/locale/lang/hu-HU.ts +2 -1
  140. package/packages/locale/lang/hy-AM.ts +2 -1
  141. package/packages/locale/lang/it-IT.ts +2 -1
  142. package/packages/locale/lang/ja-JP.ts +2 -1
  143. package/packages/locale/lang/ko-KR.ts +2 -1
  144. package/packages/locale/lang/nb-NO.ts +2 -1
  145. package/packages/locale/lang/pt-BR.ts +2 -1
  146. package/packages/locale/lang/ru-RU.ts +4 -3
  147. package/packages/locale/lang/th-TH.ts +2 -1
  148. package/packages/locale/lang/ug-CN.ts +2 -1
  149. package/packages/locale/lang/uk-UA.ts +518 -517
  150. package/packages/locale/lang/vi-VN.ts +2 -1
  151. package/packages/locale/lang/zh-CHT.ts +2 -1
  152. package/packages/locale/lang/zh-CN.ts +2 -1
  153. package/packages/table/module/edit/mixin.ts +7 -7
  154. package/packages/table/module/export/mixin.ts +50 -27
  155. package/packages/table/module/keyboard/mixin.ts +65 -24
  156. package/packages/table/module/menu/mixin.ts +4 -1
  157. package/packages/table/src/body.ts +102 -61
  158. package/packages/table/src/cell.ts +3 -7
  159. package/packages/table/src/column.ts +7 -2
  160. package/packages/table/src/columnInfo.ts +1 -0
  161. package/packages/table/src/footer.ts +31 -6
  162. package/packages/table/src/header.ts +45 -141
  163. package/packages/table/src/methods.ts +957 -461
  164. package/packages/table/src/props.ts +6 -2
  165. package/packages/table/src/table.ts +325 -149
  166. package/packages/table/src/util.ts +75 -62
  167. package/packages/ui/index.ts +21 -9
  168. package/styles/components/table.scss +352 -260
  169. package/styles/theme/base.scss +4 -6
  170. package/styles/theme/dark.scss +1 -0
  171. package/styles/theme/light.scss +1 -0
  172. package/styles/variable.scss +1 -0
  173. /package/es/{iconfont.1736736807414.ttf → iconfont.1737182271148.ttf} +0 -0
  174. /package/es/{iconfont.1736736807414.woff → iconfont.1737182271148.woff} +0 -0
  175. /package/es/{iconfont.1736736807414.woff2 → iconfont.1737182271148.woff2} +0 -0
  176. /package/lib/{iconfont.1736736807414.ttf → iconfont.1737182271148.ttf} +0 -0
  177. /package/lib/{iconfont.1736736807414.woff → iconfont.1737182271148.woff} +0 -0
  178. /package/lib/{iconfont.1736736807414.woff2 → iconfont.1737182271148.woff2} +0 -0
@@ -118,7 +118,7 @@ function getElementMarginWidth(elem) {
118
118
  }
119
119
  export function handleFieldOrColumn(_vm, fieldOrColumn) {
120
120
  if (fieldOrColumn) {
121
- return XEUtils.isString(fieldOrColumn) ? _vm.getColumnByField(fieldOrColumn) : fieldOrColumn;
121
+ return XEUtils.isString(fieldOrColumn) || XEUtils.isNumber(fieldOrColumn) ? _vm.getColumnByField(`${fieldOrColumn}`) : fieldOrColumn;
122
122
  }
123
123
  return null;
124
124
  }
@@ -180,6 +180,7 @@ export function toFilters(filters) {
180
180
  }
181
181
  export function getColReMinWidth(params) {
182
182
  const { $table, column, cell } = params;
183
+ const internalData = $table;
183
184
  const { showHeaderOverflow: allColumnHeaderOverflow, resizableOpts } = $table;
184
185
  const { minWidth } = resizableOpts;
185
186
  // 如果自定义调整宽度逻辑
@@ -189,6 +190,7 @@ export function getColReMinWidth(params) {
189
190
  return Math.max(1, XEUtils.toNumber(customMinWidth));
190
191
  }
191
192
  }
193
+ const { elemStore } = internalData;
192
194
  const { showHeaderOverflow, minWidth: colMinWidth } = column;
193
195
  const headOverflow = XEUtils.isUndefined(showHeaderOverflow) || XEUtils.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
194
196
  const showEllipsis = headOverflow === 'ellipsis';
@@ -212,11 +214,10 @@ export function getColReMinWidth(params) {
212
214
  }
213
215
  // 如果设置最小宽
214
216
  if (colMinWidth) {
215
- const { refTableBody } = $table.$refs;
216
- const bodyElem = refTableBody ? refTableBody.$el : null;
217
- if (bodyElem) {
217
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
218
+ if (bodyScrollElem) {
218
219
  if (isScale(colMinWidth)) {
219
- const bodyWidth = bodyElem.clientWidth - 1;
220
+ const bodyWidth = bodyScrollElem.clientWidth - 1;
220
221
  const meanWidth = bodyWidth / 100;
221
222
  return Math.max(mWidth, Math.floor(XEUtils.toInteger(colMinWidth) * meanWidth));
222
223
  }
@@ -257,13 +258,31 @@ export function getOffsetSize($xeTable) {
257
258
  return 0;
258
259
  }
259
260
  export function calcTreeLine(params, prevRow) {
260
- const { $table } = params;
261
+ const { $table, row } = params;
262
+ const tableProps = $table;
261
263
  const tableReactData = $table;
264
+ const tableInternalData = $table;
265
+ const { showOverflow } = tableProps;
266
+ const { scrollYLoad } = tableReactData;
267
+ const { fullAllDataRowIdData } = tableInternalData;
268
+ const rowOpts = $table.computeRowOpts;
269
+ const cellOpts = $table.computeCellOpts;
270
+ const defaultRowHeight = $table.computeDefaultRowHeight;
271
+ const rowid = getRowid($table, row);
272
+ const rowRest = fullAllDataRowIdData[rowid];
273
+ const currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight;
262
274
  let expandSize = 1;
263
275
  if (prevRow) {
264
276
  expandSize = countTreeExpand(prevRow, params);
265
277
  }
266
- return tableReactData.rowHeight * expandSize - (prevRow ? 1 : (12 - getOffsetSize($table)));
278
+ let cellHeight = currCellHeight;
279
+ const vnHeight = rowRest.height;
280
+ if (scrollYLoad) {
281
+ if (!showOverflow) {
282
+ cellHeight = vnHeight || currCellHeight;
283
+ }
284
+ }
285
+ return cellHeight * expandSize - (prevRow ? 1 : (12 - getOffsetSize($table)));
267
286
  }
268
287
  export function mergeBodyMethod(mergeList, _rowIndex, _columnIndex) {
269
288
  for (let mIndex = 0; mIndex < mergeList.length; mIndex++) {
@@ -327,29 +346,23 @@ export function createColumn($xeTable, options, renderOptions) {
327
346
  return isColumnInfo(options) ? options : new ColumnInfo($xeTable, options, renderOptions);
328
347
  }
329
348
  export function rowToVisible($xeTable, row) {
349
+ const tableProps = $xeTable;
330
350
  const reactData = $xeTable;
331
351
  const internalData = $xeTable;
332
- const tableProps = $xeTable;
333
352
  const { showOverflow } = tableProps;
334
- const refTableBody = $xeTable.$refs.refTableBody;
335
- const { columnStore, scrollYLoad } = reactData;
336
- const { afterFullData, scrollYStore, fullAllDataRowIdData } = internalData;
337
- const { rowHeight } = scrollYStore;
338
- const { leftList, rightList } = columnStore;
339
- const bodyElem = refTableBody ? refTableBody.$el : null;
353
+ const { scrollYLoad } = reactData;
354
+ const { elemStore, afterFullData, fullAllDataRowIdData, isResizeCellHeight } = internalData;
355
+ const rowOpts = $xeTable.computeRowOpts;
356
+ const cellOpts = $xeTable.computeCellOpts;
357
+ const defaultRowHeight = $xeTable.computeDefaultRowHeight;
358
+ const leftFixedWidth = $xeTable.computeLeftFixedWidth;
359
+ const rightFixedWidth = $xeTable.computeRightFixedWidth;
360
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
340
361
  const rowid = getRowid($xeTable, row);
341
- let offsetFixedLeft = 0;
342
- leftList.forEach((item) => {
343
- offsetFixedLeft += item.renderWidth;
344
- });
345
- let offsetFixedRight = 0;
346
- rightList.forEach((item) => {
347
- offsetFixedRight += item.renderWidth;
348
- });
349
- if (bodyElem) {
350
- const bodyHeight = bodyElem.clientHeight;
351
- const bodyScrollTop = bodyElem.scrollTop;
352
- const trElem = bodyElem.querySelector(`[rowid="${rowid}"]`);
362
+ if (bodyScrollElem) {
363
+ const bodyHeight = bodyScrollElem.clientHeight;
364
+ const bodyScrollTop = bodyScrollElem.scrollTop;
365
+ const trElem = bodyScrollElem.querySelector(`[rowid="${rowid}"]`);
353
366
  if (trElem) {
354
367
  const trOffsetParent = trElem.offsetParent;
355
368
  const trOffsetTop = trElem.offsetTop + (trOffsetParent ? trOffsetParent.offsetTop : 0);
@@ -365,12 +378,13 @@ export function rowToVisible($xeTable, row) {
365
378
  else {
366
379
  // 如果是虚拟渲染滚动
367
380
  if (scrollYLoad) {
368
- if (showOverflow) {
369
- return $xeTable.scrollTo(null, ($xeTable.findRowIndexOf(afterFullData, row) - 1) * rowHeight);
381
+ const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
382
+ if (!isCustomCellHeight && showOverflow) {
383
+ return $xeTable.scrollTo(null, ($xeTable.findRowIndexOf(afterFullData, row) - 1) * defaultRowHeight);
370
384
  }
371
385
  let scrollTop = 0;
372
386
  const rowRest = fullAllDataRowIdData[rowid];
373
- const rHeight = rowRest ? (rowRest.height || rowHeight) : rowHeight;
387
+ const rHeight = rowRest ? (rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight) : defaultRowHeight;
374
388
  for (let i = 0; i < afterFullData.length; i++) {
375
389
  const currRow = afterFullData[i];
376
390
  const currRowid = getRowid($xeTable, currRow);
@@ -378,54 +392,49 @@ export function rowToVisible($xeTable, row) {
378
392
  break;
379
393
  }
380
394
  const rowRest = fullAllDataRowIdData[currRowid];
381
- scrollTop += rowRest ? (rowRest.height || rowHeight) : rowHeight;
395
+ scrollTop += rowRest ? (rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight) : defaultRowHeight;
382
396
  }
383
397
  if (scrollTop < bodyScrollTop) {
384
- return $xeTable.scrollTo(null, scrollTop - offsetFixedLeft - 1);
398
+ return $xeTable.scrollTo(null, scrollTop - leftFixedWidth - 1);
385
399
  }
386
- return $xeTable.scrollTo(null, (scrollTop + rHeight) - (bodyHeight - offsetFixedRight - 1));
400
+ return $xeTable.scrollTo(null, (scrollTop + rHeight) - (bodyHeight - rightFixedWidth - 1));
387
401
  }
388
402
  }
389
403
  }
390
404
  return Promise.resolve();
391
405
  }
392
406
  export function colToVisible($xeTable, column, row) {
393
- const { columnStore, scrollXLoad, visibleColumn } = $xeTable;
394
- const refTableBody = $xeTable.$refs.refTableBody;
395
- const { leftList, rightList } = columnStore;
396
- const bodyElem = refTableBody ? refTableBody.$el : null;
407
+ const reactData = $xeTable;
408
+ const internalData = $xeTable;
409
+ const { scrollXLoad } = reactData;
410
+ const { elemStore, visibleColumn } = internalData;
411
+ const leftFixedWidth = $xeTable.computeLeftFixedWidth;
412
+ const rightFixedWidth = $xeTable.computeRightFixedWidth;
413
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
397
414
  if (column.fixed) {
398
415
  return Promise.resolve();
399
416
  }
400
- let offsetFixedLeft = 0;
401
- leftList.forEach((item) => {
402
- offsetFixedLeft += item.renderWidth;
403
- });
404
- let offsetFixedRight = 0;
405
- rightList.forEach((item) => {
406
- offsetFixedRight += item.renderWidth;
407
- });
408
- if (bodyElem) {
409
- const bodyWidth = bodyElem.clientWidth;
410
- const bodyScrollLeft = bodyElem.scrollLeft;
417
+ if (bodyScrollElem) {
418
+ const bodyWidth = bodyScrollElem.clientWidth;
419
+ const bodyScrollLeft = bodyScrollElem.scrollLeft;
411
420
  let tdElem = null;
412
421
  if (row) {
413
422
  const rowid = getRowid($xeTable, row);
414
- tdElem = bodyElem.querySelector(`[rowid="${rowid}"] .${column.id}`);
423
+ tdElem = bodyScrollElem.querySelector(`[rowid="${rowid}"] .${column.id}`);
415
424
  }
416
425
  if (!tdElem) {
417
- tdElem = bodyElem.querySelector(`.${column.id}`);
426
+ tdElem = bodyScrollElem.querySelector(`.${column.id}`);
418
427
  }
419
428
  if (tdElem) {
420
429
  const tdOffsetParent = tdElem.offsetParent;
421
430
  const tdOffsetLeft = tdElem.offsetLeft + (tdOffsetParent ? tdOffsetParent.offsetLeft : 0);
422
431
  const cellWidth = tdElem.clientWidth;
423
432
  // 检测是否在可视区中
424
- if (tdOffsetLeft < (bodyScrollLeft + offsetFixedLeft)) {
425
- return $xeTable.scrollTo(tdOffsetLeft - offsetFixedLeft - 1);
433
+ if (tdOffsetLeft < (bodyScrollLeft + leftFixedWidth)) {
434
+ return $xeTable.scrollTo(tdOffsetLeft - leftFixedWidth - 1);
426
435
  }
427
- else if ((tdOffsetLeft + cellWidth - bodyScrollLeft) > (bodyWidth - offsetFixedRight)) {
428
- return $xeTable.scrollTo((tdOffsetLeft + cellWidth) - (bodyWidth - offsetFixedRight - 1));
436
+ else if ((tdOffsetLeft + cellWidth - bodyScrollLeft) > (bodyWidth - rightFixedWidth)) {
437
+ return $xeTable.scrollTo((tdOffsetLeft + cellWidth) - (bodyWidth - rightFixedWidth - 1));
429
438
  }
430
439
  }
431
440
  else {
@@ -434,15 +443,16 @@ export function colToVisible($xeTable, column, row) {
434
443
  let scrollLeft = 0;
435
444
  const cellWidth = column.renderWidth;
436
445
  for (let i = 0; i < visibleColumn.length; i++) {
437
- if (visibleColumn[i] === column) {
446
+ const currCol = visibleColumn[i];
447
+ if (currCol === column || currCol.id === column.id) {
438
448
  break;
439
449
  }
440
- scrollLeft += visibleColumn[i].renderWidth;
450
+ scrollLeft += currCol.renderWidth;
441
451
  }
442
452
  if (scrollLeft < bodyScrollLeft) {
443
- return $xeTable.scrollTo(scrollLeft - offsetFixedLeft - 1);
453
+ return $xeTable.scrollTo(scrollLeft - leftFixedWidth - 1);
444
454
  }
445
- return $xeTable.scrollTo((scrollLeft + cellWidth) - (bodyWidth - offsetFixedRight - 1));
455
+ return $xeTable.scrollTo((scrollLeft + cellWidth) - (bodyWidth - rightFixedWidth - 1));
446
456
  }
447
457
  }
448
458
  }