vxe-table 3.14.0-beta.24 → 3.14.0-beta.26

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.
@@ -415,7 +415,7 @@ function updateStyle($xeTable) {
415
415
  const internalData = $xeTable;
416
416
  const { border, showHeaderOverflow: allColumnHeaderOverflow, showFooterOverflow: allColumnFooterOverflow, mouseConfig, spanMethod, footerSpanMethod } = props;
417
417
  const { isGroup, currentRow, tableColumn, scrollXLoad, scrollYLoad, overflowX, scrollbarWidth, overflowY, scrollbarHeight, scrollXWidth, columnStore, editStore, isAllOverflow, expandColumn } = reactData;
418
- const { visibleColumn, fullColumnIdData, tableHeight, headerHeight, footerHeight, elemStore, customHeight, customMinHeight, customMaxHeight } = internalData;
418
+ const { visibleColumn, tableHeight, headerHeight, footerHeight, elemStore, customHeight, customMinHeight, customMaxHeight } = internalData;
419
419
  const el = $xeTable.$refs.refElem;
420
420
  if (!el) {
421
421
  return;
@@ -424,7 +424,6 @@ function updateStyle($xeTable) {
424
424
  const osbWidth = overflowY ? scrollbarWidth : 0;
425
425
  const osbHeight = overflowX ? scrollbarHeight : 0;
426
426
  const emptyPlaceholderElem = $xeTable.$refs.refEmptyPlaceholder;
427
- const cellOffsetWidth = $xeTable.computeCellOffsetWidth;
428
427
  const mouseOpts = $xeTable.computeMouseOpts;
429
428
  const expandOpts = $xeTable.computeExpandOpts;
430
429
  const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper']);
@@ -692,56 +691,6 @@ function updateStyle($xeTable) {
692
691
  tableElem.style.width = tWidth ? `${tWidth}px` : '';
693
692
  }
694
693
  }
695
- const colgroupElem = getRefElem(elemStore[`${name}-${layout}-colgroup`]);
696
- if (colgroupElem) {
697
- XEUtils.arrayEach(colgroupElem.children, (colElem) => {
698
- const colid = colElem.getAttribute('name');
699
- if (fullColumnIdData[colid]) {
700
- const colRest = fullColumnIdData[colid];
701
- const column = colRest.column;
702
- const { showHeaderOverflow, showFooterOverflow, showOverflow } = column;
703
- let cellOverflow;
704
- colElem.style.width = `${column.renderWidth}px`;
705
- if (layout === 'header') {
706
- cellOverflow = XEUtils.isUndefined(showHeaderOverflow) || XEUtils.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
707
- }
708
- else if (layout === 'footer') {
709
- cellOverflow = XEUtils.isUndefined(showFooterOverflow) || XEUtils.isNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
710
- }
711
- else {
712
- cellOverflow = XEUtils.isUndefined(showOverflow) || XEUtils.isNull(showOverflow) ? isAllOverflow : showOverflow;
713
- }
714
- const showEllipsis = cellOverflow === 'ellipsis';
715
- const showTitle = cellOverflow === 'title';
716
- const showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
717
- let hasEllipsis = showTitle || showTooltip || showEllipsis;
718
- const listElem = getRefElem(elemStore[`${name}-${layout}-list`]);
719
- // 纵向虚拟滚动不支持动态行高
720
- if (scrollYLoad && !hasEllipsis) {
721
- hasEllipsis = true;
722
- }
723
- if (listElem) {
724
- XEUtils.arrayEach(listElem.querySelectorAll(`.${column.id}`), (elem) => {
725
- const colspan = parseInt(elem.getAttribute('colspan') || 1);
726
- const cellElem = elem.querySelector('.vxe-cell');
727
- let colWidth = column.renderWidth;
728
- if (cellElem) {
729
- if (colspan > 1) {
730
- const columnIndex = $xeTable.getColumnIndex(column);
731
- for (let index = 1; index < colspan; index++) {
732
- const nextColumn = $xeTable.getColumns(columnIndex + index);
733
- if (nextColumn) {
734
- colWidth += nextColumn.renderWidth;
735
- }
736
- }
737
- }
738
- cellElem.style.width = hasEllipsis ? `${colWidth - (cellOffsetWidth * colspan)}px` : '';
739
- }
740
- });
741
- }
742
- }
743
- });
744
- }
745
694
  });
746
695
  });
747
696
  if (currentRow) {
@@ -1475,6 +1424,7 @@ function autoCellWidth($xeTable) {
1475
1424
  internalData.headerHeight = headerHeight;
1476
1425
  internalData.footerHeight = footerHeight;
1477
1426
  reactData.overflowX = overflowX;
1427
+ reactData.resizeWidthFlag++;
1478
1428
  updateColumnOffsetLeft($xeTable);
1479
1429
  updateHeight($xeTable);
1480
1430
  reactData.parentHeight = Math.max(internalData.headerHeight + footerHeight + 20, $xeTable.getParentHeight());
@@ -1944,8 +1894,8 @@ function parseColumns($xeTable, isReset) {
1944
1894
  const props = $xeTable;
1945
1895
  const reactData = $xeTable;
1946
1896
  const internalData = $xeTable;
1947
- const { showOverflow } = props;
1948
- const rowOpts = $xeTable.computeRowOpts;
1897
+ // const { showOverflow } = props
1898
+ // const rowOpts = $xeTable.computeRowOpts
1949
1899
  const leftList = [];
1950
1900
  const centerList = [];
1951
1901
  const rightList = [];
@@ -2018,28 +1968,28 @@ function parseColumns($xeTable, isReset) {
2018
1968
  reactData.hasFixedColumn = leftList.length > 0 || rightList.length > 0;
2019
1969
  Object.assign(columnStore, { leftList, centerList, rightList });
2020
1970
  if (scrollXLoad) {
2021
- if (showOverflow) {
2022
- if (!rowOpts.height) {
2023
- const errColumn = internalData.tableFullColumn.find(column => column.showOverflow === false);
2024
- if (errColumn) {
2025
- errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true']);
2026
- }
2027
- }
2028
- }
2029
- if (process.env.NODE_ENV === 'development') {
2030
- // if (props.showHeader && !props.showHeaderOverflow) {
2031
- // warnLog('vxe.error.reqProp', ['show-header-overflow'])
2032
- // }
2033
- // if (props.showFooter && !props.showFooterOverflow) {
2034
- // warnLog('vxe.error.reqProp', ['show-footer-overflow'])
2035
- // }
2036
- if (props.spanMethod) {
2037
- warnLog('vxe.error.scrollErrProp', ['span-method']);
2038
- }
2039
- if (props.footerSpanMethod) {
2040
- warnLog('vxe.error.scrollErrProp', ['footer-span-method']);
2041
- }
2042
- }
1971
+ // if (showOverflow) {
1972
+ // if (!rowOpts.height) {
1973
+ // const errColumn = internalData.tableFullColumn.find(column => column.showOverflow === false)
1974
+ // if (errColumn) {
1975
+ // errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true'])
1976
+ // }
1977
+ // }
1978
+ // }
1979
+ // if (process.env.NODE_ENV === 'development') {
1980
+ // if (props.showHeader && !props.showHeaderOverflow) {
1981
+ // warnLog('vxe.error.reqProp', ['show-header-overflow'])
1982
+ // }
1983
+ // if (props.showFooter && !props.showFooterOverflow) {
1984
+ // warnLog('vxe.error.reqProp', ['show-footer-overflow'])
1985
+ // }
1986
+ if (props.spanMethod) {
1987
+ warnLog('vxe.error.scrollErrProp', ['span-method']);
1988
+ }
1989
+ if (props.footerSpanMethod) {
1990
+ warnLog('vxe.error.scrollErrProp', ['footer-span-method']);
1991
+ }
1992
+ // }
2043
1993
  if (isReset) {
2044
1994
  const { visibleSize } = handleVirtualXVisible($xeTable);
2045
1995
  scrollXStore.startIndex = 0;
@@ -8540,7 +8490,7 @@ const Methods = {
8540
8490
  const { scrollXLoad, scrollYLoad, expandColumn } = reactData;
8541
8491
  const leftFixedWidth = $xeTable.computeLeftFixedWidth;
8542
8492
  const rightFixedWidth = $xeTable.computeRightFixedWidth;
8543
- if (!(scrollYLoad || leftFixedWidth || rightFixedWidth || expandColumn)) {
8493
+ if (!(leftFixedWidth || rightFixedWidth || expandColumn)) {
8544
8494
  return;
8545
8495
  }
8546
8496
  const { elemStore, lastScrollTop, lastScrollLeft } = internalData;
@@ -633,6 +633,7 @@ export default {
633
633
  rowExpandHeightFlag: 1,
634
634
  calcCellHeightFlag: 1,
635
635
  resizeHeightFlag: 1,
636
+ resizeWidthFlag: 1,
636
637
  isCustomStatus: false,
637
638
  isDragRowMove: false,
638
639
  dragRow: null,
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  import { getFuncText } from './src/utils';
3
- export const version = "3.14.0-beta.24";
3
+ export const version = "3.14.0-beta.26";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
package/es/ui/src/log.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const version = `table v${"3.14.0-beta.24"}`;
3
+ const version = `table v${"3.14.0-beta.26"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
package/lib/index.umd.js CHANGED
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
2220
2220
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
2221
2221
 
2222
2222
 
2223
- const version = "3.14.0-beta.24";
2223
+ const version = "3.14.0-beta.26";
2224
2224
  core_.VxeUI.version = version;
2225
2225
  core_.VxeUI.tableVersion = version;
2226
2226
  core_.VxeUI.setConfig({
@@ -2844,7 +2844,7 @@ function isNodeElement(elem) {
2844
2844
  const {
2845
2845
  log: log_log
2846
2846
  } = core_.VxeUI;
2847
- const log_version = `table v${"3.14.0-beta.24"}`;
2847
+ const log_version = `table v${"3.14.0-beta.26"}`;
2848
2848
  const warnLog = log_log.create('warn', log_version);
2849
2849
  const errLog = log_log.create('error', log_version);
2850
2850
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -5704,7 +5704,6 @@ function updateStyle($xeTable) {
5704
5704
  } = reactData;
5705
5705
  const {
5706
5706
  visibleColumn,
5707
- fullColumnIdData,
5708
5707
  tableHeight,
5709
5708
  headerHeight,
5710
5709
  footerHeight,
@@ -5721,7 +5720,6 @@ function updateStyle($xeTable) {
5721
5720
  const osbWidth = overflowY ? scrollbarWidth : 0;
5722
5721
  const osbHeight = overflowX ? scrollbarHeight : 0;
5723
5722
  const emptyPlaceholderElem = $xeTable.$refs.refEmptyPlaceholder;
5724
- const cellOffsetWidth = $xeTable.computeCellOffsetWidth;
5725
5723
  const mouseOpts = $xeTable.computeMouseOpts;
5726
5724
  const expandOpts = $xeTable.computeExpandOpts;
5727
5725
  const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper']);
@@ -5983,58 +5981,6 @@ function updateStyle($xeTable) {
5983
5981
  tableElem.style.width = tWidth ? `${tWidth}px` : '';
5984
5982
  }
5985
5983
  }
5986
- const colgroupElem = getRefElem(elemStore[`${name}-${layout}-colgroup`]);
5987
- if (colgroupElem) {
5988
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(colgroupElem.children, colElem => {
5989
- const colid = colElem.getAttribute('name');
5990
- if (fullColumnIdData[colid]) {
5991
- const colRest = fullColumnIdData[colid];
5992
- const column = colRest.column;
5993
- const {
5994
- showHeaderOverflow,
5995
- showFooterOverflow,
5996
- showOverflow
5997
- } = column;
5998
- let cellOverflow;
5999
- colElem.style.width = `${column.renderWidth}px`;
6000
- if (layout === 'header') {
6001
- cellOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(showHeaderOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
6002
- } else if (layout === 'footer') {
6003
- cellOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(showFooterOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
6004
- } else {
6005
- cellOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(showOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNull(showOverflow) ? isAllOverflow : showOverflow;
6006
- }
6007
- const showEllipsis = cellOverflow === 'ellipsis';
6008
- const showTitle = cellOverflow === 'title';
6009
- const showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
6010
- let hasEllipsis = showTitle || showTooltip || showEllipsis;
6011
- const listElem = getRefElem(elemStore[`${name}-${layout}-list`]);
6012
- // 纵向虚拟滚动不支持动态行高
6013
- if (scrollYLoad && !hasEllipsis) {
6014
- hasEllipsis = true;
6015
- }
6016
- if (listElem) {
6017
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(listElem.querySelectorAll(`.${column.id}`), elem => {
6018
- const colspan = parseInt(elem.getAttribute('colspan') || 1);
6019
- const cellElem = elem.querySelector('.vxe-cell');
6020
- let colWidth = column.renderWidth;
6021
- if (cellElem) {
6022
- if (colspan > 1) {
6023
- const columnIndex = $xeTable.getColumnIndex(column);
6024
- for (let index = 1; index < colspan; index++) {
6025
- const nextColumn = $xeTable.getColumns(columnIndex + index);
6026
- if (nextColumn) {
6027
- colWidth += nextColumn.renderWidth;
6028
- }
6029
- }
6030
- }
6031
- cellElem.style.width = hasEllipsis ? `${colWidth - cellOffsetWidth * colspan}px` : '';
6032
- }
6033
- });
6034
- }
6035
- }
6036
- });
6037
- }
6038
5984
  });
6039
5985
  });
6040
5986
  if (currentRow) {
@@ -6887,6 +6833,7 @@ function autoCellWidth($xeTable) {
6887
6833
  internalData.headerHeight = headerHeight;
6888
6834
  internalData.footerHeight = footerHeight;
6889
6835
  reactData.overflowX = overflowX;
6836
+ reactData.resizeWidthFlag++;
6890
6837
  updateColumnOffsetLeft($xeTable);
6891
6838
  updateHeight($xeTable);
6892
6839
  reactData.parentHeight = Math.max(internalData.headerHeight + footerHeight + 20, $xeTable.getParentHeight());
@@ -7425,10 +7372,8 @@ function parseColumns($xeTable, isReset) {
7425
7372
  const props = $xeTable;
7426
7373
  const reactData = $xeTable;
7427
7374
  const internalData = $xeTable;
7428
- const {
7429
- showOverflow
7430
- } = props;
7431
- const rowOpts = $xeTable.computeRowOpts;
7375
+ // const { showOverflow } = props
7376
+ // const rowOpts = $xeTable.computeRowOpts
7432
7377
  const leftList = [];
7433
7378
  const centerList = [];
7434
7379
  const rightList = [];
@@ -7505,28 +7450,28 @@ function parseColumns($xeTable, isReset) {
7505
7450
  rightList
7506
7451
  });
7507
7452
  if (scrollXLoad) {
7508
- if (showOverflow) {
7509
- if (!rowOpts.height) {
7510
- const errColumn = internalData.tableFullColumn.find(column => column.showOverflow === false);
7511
- if (errColumn) {
7512
- errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true']);
7513
- }
7514
- }
7453
+ // if (showOverflow) {
7454
+ // if (!rowOpts.height) {
7455
+ // const errColumn = internalData.tableFullColumn.find(column => column.showOverflow === false)
7456
+ // if (errColumn) {
7457
+ // errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true'])
7458
+ // }
7459
+ // }
7460
+ // }
7461
+ // if (process.env.VUE_APP_VXE_ENV === 'development') {
7462
+ // if (props.showHeader && !props.showHeaderOverflow) {
7463
+ // warnLog('vxe.error.reqProp', ['show-header-overflow'])
7464
+ // }
7465
+ // if (props.showFooter && !props.showFooterOverflow) {
7466
+ // warnLog('vxe.error.reqProp', ['show-footer-overflow'])
7467
+ // }
7468
+ if (props.spanMethod) {
7469
+ warnLog('vxe.error.scrollErrProp', ['span-method']);
7515
7470
  }
7516
- if (true) {
7517
- // if (props.showHeader && !props.showHeaderOverflow) {
7518
- // warnLog('vxe.error.reqProp', ['show-header-overflow'])
7519
- // }
7520
- // if (props.showFooter && !props.showFooterOverflow) {
7521
- // warnLog('vxe.error.reqProp', ['show-footer-overflow'])
7522
- // }
7523
- if (props.spanMethod) {
7524
- warnLog('vxe.error.scrollErrProp', ['span-method']);
7525
- }
7526
- if (props.footerSpanMethod) {
7527
- warnLog('vxe.error.scrollErrProp', ['footer-span-method']);
7528
- }
7471
+ if (props.footerSpanMethod) {
7472
+ warnLog('vxe.error.scrollErrProp', ['footer-span-method']);
7529
7473
  }
7474
+ // }
7530
7475
  if (isReset) {
7531
7476
  const {
7532
7477
  visibleSize
@@ -15166,7 +15111,7 @@ const Methods = {
15166
15111
  } = reactData;
15167
15112
  const leftFixedWidth = $xeTable.computeLeftFixedWidth;
15168
15113
  const rightFixedWidth = $xeTable.computeRightFixedWidth;
15169
- if (!(scrollYLoad || leftFixedWidth || rightFixedWidth || expandColumn)) {
15114
+ if (!(leftFixedWidth || rightFixedWidth || expandColumn)) {
15170
15115
  return;
15171
15116
  }
15172
15117
  const {
@@ -16046,7 +15991,8 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
16046
15991
  const tableReactData = $xeTable;
16047
15992
  const tableInternalData = $xeTable;
16048
15993
  const {
16049
- fullAllDataRowIdData
15994
+ fullAllDataRowIdData,
15995
+ visibleColumn
16050
15996
  } = tableInternalData;
16051
15997
  const {
16052
15998
  columnKey,
@@ -16073,6 +16019,7 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
16073
16019
  scrollYLoad,
16074
16020
  calcCellHeightFlag,
16075
16021
  resizeHeightFlag,
16022
+ resizeWidthFlag,
16076
16023
  mergeList,
16077
16024
  editStore,
16078
16025
  isAllOverflow,
@@ -16104,6 +16051,7 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
16104
16051
  const columnOpts = $xeTable.computeColumnOpts;
16105
16052
  const mouseOpts = $xeTable.computeMouseOpts;
16106
16053
  const areaOpts = $xeTable.computeAreaOpts;
16054
+ const cellOffsetWidth = $xeTable.computeCellOffsetWidth;
16107
16055
  const {
16108
16056
  selectCellToRow
16109
16057
  } = areaOpts;
@@ -16297,6 +16245,18 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
16297
16245
  }
16298
16246
  }
16299
16247
  const tcStyle = {};
16248
+ if (hasEllipsis && resizeWidthFlag) {
16249
+ let tsColspan = tdAttrs.colspan || 0;
16250
+ if (tsColspan > 1) {
16251
+ for (let index = 1; index < tsColspan; index++) {
16252
+ const nextColumn = visibleColumn[columnIndex + index];
16253
+ if (nextColumn) {
16254
+ tsColspan += nextColumn.renderWidth;
16255
+ }
16256
+ }
16257
+ }
16258
+ tcStyle.width = `${column.renderWidth - cellOffsetWidth * tsColspan}px`;
16259
+ }
16300
16260
  if (scrollYLoad || hasEllipsis || isCsHeight || isRsHeight) {
16301
16261
  tcStyle.height = `${cellHeight}px`;
16302
16262
  } else {
@@ -26439,6 +26399,7 @@ function renderBody(h, $xeTable) {
26439
26399
  rowExpandHeightFlag: 1,
26440
26400
  calcCellHeightFlag: 1,
26441
26401
  resizeHeightFlag: 1,
26402
+ resizeWidthFlag: 1,
26442
26403
  isCustomStatus: false,
26443
26404
  isDragRowMove: false,
26444
26405
  dragRow: null,