vxe-table 3.15.0-beta.4 → 3.15.0

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 (40) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/style.css +1 -1
  4. package/es/style.min.css +1 -1
  5. package/es/table/src/methods.js +58 -43
  6. package/es/table/src/table.js +2 -1
  7. package/es/table/style.css +12 -0
  8. package/es/table/style.min.css +1 -1
  9. package/es/ui/index.js +1 -1
  10. package/es/ui/src/log.js +1 -1
  11. package/es/vxe-table/style.css +12 -0
  12. package/es/vxe-table/style.min.css +1 -1
  13. package/lib/index.css +1 -1
  14. package/lib/index.min.css +1 -1
  15. package/lib/index.umd.js +67 -46
  16. package/lib/index.umd.min.js +1 -1
  17. package/lib/style.css +1 -1
  18. package/lib/style.min.css +1 -1
  19. package/lib/table/src/methods.js +63 -43
  20. package/lib/table/src/methods.min.js +1 -1
  21. package/lib/table/src/table.js +2 -1
  22. package/lib/table/src/table.min.js +1 -1
  23. package/lib/table/style/style.css +12 -0
  24. package/lib/table/style/style.min.css +1 -1
  25. package/lib/ui/index.js +1 -1
  26. package/lib/ui/index.min.js +1 -1
  27. package/lib/ui/src/log.js +1 -1
  28. package/lib/ui/src/log.min.js +1 -1
  29. package/lib/vxe-table/style/style.css +12 -0
  30. package/lib/vxe-table/style/style.min.css +1 -1
  31. package/package.json +2 -2
  32. package/packages/table/src/methods.ts +65 -44
  33. package/packages/table/src/table.ts +23 -22
  34. package/styles/components/table.scss +19 -0
  35. /package/es/{iconfont.1744095177947.ttf → iconfont.1744252945243.ttf} +0 -0
  36. /package/es/{iconfont.1744095177947.woff → iconfont.1744252945243.woff} +0 -0
  37. /package/es/{iconfont.1744095177947.woff2 → iconfont.1744252945243.woff2} +0 -0
  38. /package/lib/{iconfont.1744095177947.ttf → iconfont.1744252945243.ttf} +0 -0
  39. /package/lib/{iconfont.1744095177947.woff → iconfont.1744252945243.woff} +0 -0
  40. /package/lib/{iconfont.1744095177947.woff2 → iconfont.1744252945243.woff2} +0 -0
@@ -1461,10 +1461,8 @@ function autoCellWidth($xeTable) {
1461
1461
  const reactData = $xeTable;
1462
1462
  const internalData = $xeTable;
1463
1463
  const { elemStore } = internalData;
1464
- const scrollbarOpts = $xeTable.computeScrollbarOpts;
1465
- const tableBody = $xeTable.$refs.refTableBody;
1466
- const bodyElem = tableBody ? tableBody.$el : null;
1467
- if (!bodyElem) {
1464
+ const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper']);
1465
+ if (!bodyWrapperElem) {
1468
1466
  return;
1469
1467
  }
1470
1468
  const yHandleEl = $xeTable.$refs.refScrollYHandleElem;
@@ -1477,7 +1475,7 @@ function autoCellWidth($xeTable) {
1477
1475
  }
1478
1476
  let tWidth = 0;
1479
1477
  const minCellWidth = 40; // 列宽最少限制 40px
1480
- const bodyWidth = bodyElem.clientWidth;
1478
+ const bodyWidth = bodyWrapperElem.clientWidth;
1481
1479
  let remainWidth = bodyWidth;
1482
1480
  let meanWidth = remainWidth / 100;
1483
1481
  const { fit } = props;
@@ -1546,9 +1544,9 @@ function autoCellWidth($xeTable) {
1546
1544
  });
1547
1545
  if (fit) {
1548
1546
  /**
1549
- * 偏移量算法
1550
- * 如果所有列足够放的情况下,从最后动态列开始分配
1551
- */
1547
+ * 偏移量算法
1548
+ * 如果所有列足够放的情况下,从最后动态列开始分配
1549
+ */
1552
1550
  const dynamicList = scaleList.concat(scaleMinList).concat(pxMinList).concat(autoMinList).concat(remainList);
1553
1551
  let dynamicSize = dynamicList.length - 1;
1554
1552
  if (dynamicSize > 0) {
@@ -1562,28 +1560,10 @@ function autoCellWidth($xeTable) {
1562
1560
  }
1563
1561
  }
1564
1562
  }
1565
- const tableHeight = bodyElem.offsetHeight;
1566
- const overflowY = yHandleEl.scrollHeight > yHandleEl.clientHeight;
1567
- reactData.scrollbarWidth = Math.max(scrollbarOpts.width || 0, yHandleEl.offsetWidth - yHandleEl.clientWidth);
1568
- reactData.overflowY = overflowY;
1569
1563
  reactData.scrollXWidth = tWidth;
1570
- internalData.tableHeight = tableHeight;
1571
- const headerTableElem = getRefElem(elemStore['main-header-table']);
1572
- const footerTableElem = getRefElem(elemStore['main-footer-table']);
1573
- const headerHeight = headerTableElem ? headerTableElem.clientHeight : 0;
1574
- const overflowX = tWidth > bodyWidth;
1575
- const footerHeight = footerTableElem ? footerTableElem.clientHeight : 0;
1576
- reactData.scrollbarHeight = Math.max(scrollbarOpts.height || 0, xHandleEl.offsetHeight - xHandleEl.clientHeight);
1577
- internalData.headerHeight = headerHeight;
1578
- internalData.footerHeight = footerHeight;
1579
- reactData.overflowX = overflowX;
1580
1564
  reactData.resizeWidthFlag++;
1581
1565
  updateColumnOffsetLeft($xeTable);
1582
1566
  updateHeight($xeTable);
1583
- reactData.parentHeight = Math.max(internalData.headerHeight + footerHeight + 20, $xeTable.getParentHeight());
1584
- if (overflowX) {
1585
- $xeTable.checkScrolling();
1586
- }
1587
1567
  }
1588
1568
  const calcCellAutoHeight = (rowRest, wrapperEl) => {
1589
1569
  const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
@@ -1944,7 +1924,7 @@ function computeScrollLoad($xeTable) {
1944
1924
  }
1945
1925
  // 计算 Y 逻辑
1946
1926
  const rowHeight = computeRowHeight($xeTable);
1947
- scrollYStore.rowHeight = rowHeight;
1927
+ scrollYStore.rowHeight = rowHeight; // 已废弃
1948
1928
  reactData.rowHeight = rowHeight;
1949
1929
  const { toVisibleIndex: toYVisibleIndex, visibleSize: visibleYSize } = handleVirtualYVisible($xeTable);
1950
1930
  if (scrollYLoad) {
@@ -1962,11 +1942,43 @@ function computeScrollLoad($xeTable) {
1962
1942
  else {
1963
1943
  $xeTable.updateScrollYSpace();
1964
1944
  }
1965
- $xeTable.$nextTick(() => {
1966
- updateStyle($xeTable);
1967
- });
1968
1945
  });
1969
1946
  }
1947
+ function calcScrollbar($xeTable) {
1948
+ const reactData = $xeTable;
1949
+ const internalData = $xeTable;
1950
+ const { scrollXWidth, scrollYHeight } = reactData;
1951
+ const { elemStore } = internalData;
1952
+ const scrollbarOpts = $xeTable.computeScrollbarOpts;
1953
+ const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper']);
1954
+ const headerTableElem = getRefElem(elemStore['main-header-table']);
1955
+ const footerTableElem = getRefElem(elemStore['main-footer-table']);
1956
+ const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
1957
+ const yHandleEl = $xeTable.$refs.refScrollYHandleElem;
1958
+ let overflowY = false;
1959
+ let overflowX = false;
1960
+ if (bodyWrapperElem) {
1961
+ overflowY = scrollYHeight > bodyWrapperElem.clientHeight;
1962
+ if (yHandleEl) {
1963
+ reactData.scrollbarWidth = Math.max(scrollbarOpts.width || 0, yHandleEl.offsetWidth - yHandleEl.clientWidth);
1964
+ }
1965
+ reactData.overflowY = overflowY;
1966
+ overflowX = scrollXWidth > bodyWrapperElem.clientWidth;
1967
+ if (xHandleEl) {
1968
+ reactData.scrollbarHeight = Math.max(scrollbarOpts.height || 0, xHandleEl.offsetHeight - xHandleEl.clientHeight);
1969
+ }
1970
+ reactData.overflowX = overflowX;
1971
+ const headerHeight = headerTableElem ? headerTableElem.clientHeight : 0;
1972
+ const footerHeight = footerTableElem ? footerTableElem.clientHeight : 0;
1973
+ internalData.tableHeight = bodyWrapperElem.offsetHeight;
1974
+ internalData.headerHeight = headerHeight;
1975
+ internalData.footerHeight = footerHeight;
1976
+ reactData.parentHeight = Math.max(internalData.headerHeight + footerHeight + 20, $xeTable.getParentHeight());
1977
+ }
1978
+ if (overflowX) {
1979
+ $xeTable.checkScrolling();
1980
+ }
1981
+ }
1970
1982
  function handleRecalculateLayout($xeTable, reFull) {
1971
1983
  const internalData = $xeTable;
1972
1984
  const el = $xeTable.$refs.refElem;
@@ -1984,21 +1996,22 @@ function handleRecalculateLayout($xeTable, reFull) {
1984
1996
  }
1985
1997
  calcCellWidth($xeTable);
1986
1998
  autoCellWidth($xeTable);
1999
+ calcScrollbar($xeTable);
1987
2000
  updateStyle($xeTable);
1988
- if (reFull) {
1989
- updateRowOffsetTop($xeTable);
1990
- }
1991
2001
  updateRowExpandStyle($xeTable);
1992
2002
  return computeScrollLoad($xeTable).then(() => {
1993
- if (reFull === true) {
1994
- // 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
1995
- calcCellWidth($xeTable);
2003
+ // 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
2004
+ calcCellWidth($xeTable);
2005
+ if (reFull) {
1996
2006
  autoCellWidth($xeTable);
1997
- updateStyle($xeTable);
1998
- if (reFull) {
1999
- updateRowOffsetTop($xeTable);
2000
- }
2001
- updateRowExpandStyle($xeTable);
2007
+ }
2008
+ calcScrollbar($xeTable);
2009
+ updateStyle($xeTable);
2010
+ if (reFull) {
2011
+ updateRowOffsetTop($xeTable);
2012
+ }
2013
+ updateRowExpandStyle($xeTable);
2014
+ if (reFull) {
2002
2015
  return computeScrollLoad($xeTable);
2003
2016
  }
2004
2017
  });
@@ -2874,6 +2887,7 @@ const Methods = {
2874
2887
  }
2875
2888
  reactData.isRowLoading = false;
2876
2889
  calcCellHeight($xeTable);
2890
+ updateRowOffsetTop($xeTable);
2877
2891
  // 是否变更虚拟滚动
2878
2892
  if (oldScrollYLoad === sYLoad) {
2879
2893
  restoreScrollLocation($xeTable, targetScrollLeft, targetScrollTop)
@@ -4857,6 +4871,7 @@ const Methods = {
4857
4871
  }
4858
4872
  }
4859
4873
  return $xeTable.$nextTick().then(() => {
4874
+ updateRowOffsetTop($xeTable);
4860
4875
  return { status };
4861
4876
  });
4862
4877
  },
@@ -8978,11 +8993,11 @@ const Methods = {
8978
8993
  const firstRow = afterFullData[startIndex];
8979
8994
  let rowid = getRowid($xeTable, firstRow);
8980
8995
  let rowRest = fullAllDataRowIdData[rowid] || {};
8981
- ySpaceTop = rowRest.oTop;
8996
+ ySpaceTop = (rowRest.oTop || 0);
8982
8997
  const lastRow = afterFullData[afterFullData.length - 1];
8983
8998
  rowid = getRowid($xeTable, lastRow);
8984
8999
  rowRest = fullAllDataRowIdData[rowid] || {};
8985
- scrollYHeight = rowRest.oTop + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight);
9000
+ scrollYHeight = (rowRest.oTop || 0) + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight);
8986
9001
  // 是否展开行
8987
9002
  if (expandColumn && rowExpandedMaps[rowid]) {
8988
9003
  scrollYHeight += rowRest.expandHeight || expandOpts.height || 0;
@@ -1928,7 +1928,8 @@ export default {
1928
1928
  theme: tableTipConfig.theme,
1929
1929
  enterable: tableTipConfig.enterable,
1930
1930
  enterDelay: tableTipConfig.enterDelay,
1931
- leaveDelay: tableTipConfig.leaveDelay
1931
+ leaveDelay: tableTipConfig.leaveDelay,
1932
+ useHTML: tableTipConfig.useHTML
1932
1933
  }
1933
1934
  })
1934
1935
  : renderEmptyElement($xeTable),
@@ -2326,10 +2326,17 @@
2326
2326
  height: 100%;
2327
2327
  }
2328
2328
 
2329
+ .vxe-header--column:last-child > .vxe-cell--col-resizable {
2330
+ right: 0;
2331
+ }
2332
+
2329
2333
  .vxe-table--fixed-right-wrapper .vxe-cell--col-resizable {
2330
2334
  right: auto;
2331
2335
  left: -0.3em;
2332
2336
  }
2337
+ .vxe-table--fixed-right-wrapper .vxe-header--column:last-child > .vxe-cell--col-resizable {
2338
+ left: 0;
2339
+ }
2333
2340
 
2334
2341
  .vxe-body--column .vxe-cell--row-resizable {
2335
2342
  position: absolute;
@@ -2458,6 +2465,11 @@
2458
2465
  .vxe-table--render-default.column--highlight .vxe-header--column:not(.col--seq):hover {
2459
2466
  background-color: var(--vxe-ui-table-column-hover-background-color);
2460
2467
  }
2468
+ .vxe-table--render-default.header-cell--area .vxe-table--header-wrapper {
2469
+ -webkit-user-select: none;
2470
+ -moz-user-select: none;
2471
+ user-select: none;
2472
+ }
2461
2473
  .vxe-table--render-default.body-cell--area .vxe-table--body-wrapper {
2462
2474
  -webkit-user-select: none;
2463
2475
  -moz-user-select: none;