vxe-table 4.13.0-beta.4 → 4.13.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 (38) 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/table.js +54 -39
  6. package/es/table/style.css +12 -0
  7. package/es/table/style.min.css +1 -1
  8. package/es/ui/index.js +1 -1
  9. package/es/ui/src/log.js +1 -1
  10. package/es/vxe-table/style.css +12 -0
  11. package/es/vxe-table/style.min.css +1 -1
  12. package/helper/vetur/attributes.json +1 -1
  13. package/helper/vetur/tags.json +1 -1
  14. package/lib/index.css +1 -1
  15. package/lib/index.min.css +1 -1
  16. package/lib/index.umd.js +11 -10
  17. package/lib/index.umd.min.js +1 -1
  18. package/lib/style.css +1 -1
  19. package/lib/style.min.css +1 -1
  20. package/lib/table/src/table.js +59 -39
  21. package/lib/table/src/table.min.js +1 -1
  22. package/lib/table/style/style.css +12 -0
  23. package/lib/table/style/style.min.css +1 -1
  24. package/lib/ui/index.js +1 -1
  25. package/lib/ui/index.min.js +1 -1
  26. package/lib/ui/src/log.js +1 -1
  27. package/lib/ui/src/log.min.js +1 -1
  28. package/lib/vxe-table/style/style.css +12 -0
  29. package/lib/vxe-table/style/style.min.css +1 -1
  30. package/package.json +2 -2
  31. package/packages/table/src/table.ts +60 -40
  32. package/styles/components/table.scss +19 -0
  33. /package/es/{iconfont.1744095189878.ttf → iconfont.1744252965278.ttf} +0 -0
  34. /package/es/{iconfont.1744095189878.woff → iconfont.1744252965278.woff} +0 -0
  35. /package/es/{iconfont.1744095189878.woff2 → iconfont.1744252965278.woff2} +0 -0
  36. /package/lib/{iconfont.1744095189878.ttf → iconfont.1744252965278.ttf} +0 -0
  37. /package/lib/{iconfont.1744095189878.woff → iconfont.1744252965278.woff} +0 -0
  38. /package/lib/{iconfont.1744095189878.woff2 → iconfont.1744252965278.woff2} +0 -0
@@ -1655,10 +1655,8 @@ var _default = exports.default = (0, _vue.defineComponent)({
1655
1655
  const {
1656
1656
  elemStore
1657
1657
  } = internalData;
1658
- const scrollbarOpts = computeScrollbarOpts.value;
1659
- const tableBody = refTableBody.value;
1660
- const bodyElem = tableBody ? tableBody.$el : null;
1661
- if (!bodyElem) {
1658
+ const bodyWrapperElem = (0, _util.getRefElem)(elemStore['main-body-wrapper']);
1659
+ if (!bodyWrapperElem) {
1662
1660
  return;
1663
1661
  }
1664
1662
  const yHandleEl = refScrollYHandleElem.value;
@@ -1671,7 +1669,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
1671
1669
  }
1672
1670
  let tWidth = 0;
1673
1671
  const minCellWidth = 40; // 列宽最少限制 40px
1674
- const bodyWidth = bodyElem.clientWidth;
1672
+ const bodyWidth = bodyWrapperElem.clientWidth;
1675
1673
  let remainWidth = bodyWidth;
1676
1674
  let meanWidth = remainWidth / 100;
1677
1675
  const {
@@ -1768,28 +1766,10 @@ var _default = exports.default = (0, _vue.defineComponent)({
1768
1766
  }
1769
1767
  }
1770
1768
  }
1771
- const tableHeight = bodyElem.offsetHeight;
1772
- const overflowY = yHandleEl.scrollHeight > yHandleEl.clientHeight;
1773
- reactData.scrollbarWidth = Math.max(scrollbarOpts.width || 0, yHandleEl.offsetWidth - yHandleEl.clientWidth);
1774
- reactData.overflowY = overflowY;
1775
1769
  reactData.scrollXWidth = tWidth;
1776
- internalData.tableHeight = tableHeight;
1777
- const headerTableElem = (0, _util.getRefElem)(elemStore['main-header-table']);
1778
- const footerTableElem = (0, _util.getRefElem)(elemStore['main-footer-table']);
1779
- const headerHeight = headerTableElem ? headerTableElem.clientHeight : 0;
1780
- const overflowX = tWidth > bodyWidth;
1781
- const footerHeight = footerTableElem ? footerTableElem.clientHeight : 0;
1782
- reactData.scrollbarHeight = Math.max(scrollbarOpts.height || 0, xHandleEl.offsetHeight - xHandleEl.clientHeight);
1783
- internalData.headerHeight = headerHeight;
1784
- internalData.footerHeight = footerHeight;
1785
- reactData.overflowX = overflowX;
1786
1770
  reactData.resizeWidthFlag++;
1787
1771
  updateColumnOffsetLeft();
1788
1772
  updateHeight();
1789
- reactData.parentHeight = Math.max(internalData.headerHeight + footerHeight + 20, $xeTable.getParentHeight());
1790
- if (overflowX) {
1791
- $xeTable.checkScrolling();
1792
- }
1793
1773
  };
1794
1774
  const calcCellAutoHeight = (rowRest, wrapperEl) => {
1795
1775
  const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
@@ -3123,7 +3103,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
3123
3103
  }
3124
3104
  // 计算 Y 逻辑
3125
3105
  const rowHeight = computeRowHeight();
3126
- scrollYStore.rowHeight = rowHeight;
3106
+ scrollYStore.rowHeight = rowHeight; // 已废弃
3127
3107
  reactData.rowHeight = rowHeight;
3128
3108
  const {
3129
3109
  toVisibleIndex: toYVisibleIndex,
@@ -3143,11 +3123,46 @@ var _default = exports.default = (0, _vue.defineComponent)({
3143
3123
  } else {
3144
3124
  $xeTable.updateScrollYSpace();
3145
3125
  }
3146
- (0, _vue.nextTick)(() => {
3147
- updateStyle();
3148
- });
3149
3126
  });
3150
3127
  };
3128
+ const calcScrollbar = () => {
3129
+ const {
3130
+ scrollXWidth,
3131
+ scrollYHeight
3132
+ } = reactData;
3133
+ const {
3134
+ elemStore
3135
+ } = internalData;
3136
+ const scrollbarOpts = computeScrollbarOpts.value;
3137
+ const bodyWrapperElem = (0, _util.getRefElem)(elemStore['main-body-wrapper']);
3138
+ const headerTableElem = (0, _util.getRefElem)(elemStore['main-header-table']);
3139
+ const footerTableElem = (0, _util.getRefElem)(elemStore['main-footer-table']);
3140
+ const xHandleEl = refScrollXHandleElem.value;
3141
+ const yHandleEl = refScrollYHandleElem.value;
3142
+ let overflowY = false;
3143
+ let overflowX = false;
3144
+ if (bodyWrapperElem) {
3145
+ overflowY = scrollYHeight > bodyWrapperElem.clientHeight;
3146
+ if (yHandleEl) {
3147
+ reactData.scrollbarWidth = Math.max(scrollbarOpts.width || 0, yHandleEl.offsetWidth - yHandleEl.clientWidth);
3148
+ }
3149
+ reactData.overflowY = overflowY;
3150
+ overflowX = scrollXWidth > bodyWrapperElem.clientWidth;
3151
+ if (xHandleEl) {
3152
+ reactData.scrollbarHeight = Math.max(scrollbarOpts.height || 0, xHandleEl.offsetHeight - xHandleEl.clientHeight);
3153
+ }
3154
+ const headerHeight = headerTableElem ? headerTableElem.clientHeight : 0;
3155
+ const footerHeight = footerTableElem ? footerTableElem.clientHeight : 0;
3156
+ internalData.tableHeight = bodyWrapperElem.offsetHeight;
3157
+ internalData.headerHeight = headerHeight;
3158
+ internalData.footerHeight = footerHeight;
3159
+ reactData.overflowX = overflowX;
3160
+ reactData.parentHeight = Math.max(internalData.headerHeight + footerHeight + 20, $xeTable.getParentHeight());
3161
+ }
3162
+ if (overflowX) {
3163
+ $xeTable.checkScrolling();
3164
+ }
3165
+ };
3151
3166
  const handleRecalculateLayout = reFull => {
3152
3167
  const el = refElem.value;
3153
3168
  internalData.rceRunTime = Date.now();
@@ -3164,18 +3179,22 @@ var _default = exports.default = (0, _vue.defineComponent)({
3164
3179
  }
3165
3180
  calcCellWidth();
3166
3181
  autoCellWidth();
3182
+ calcScrollbar();
3167
3183
  updateStyle();
3168
3184
  updateRowExpandStyle();
3169
3185
  return computeScrollLoad().then(() => {
3170
- if (reFull === true) {
3171
- // 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
3172
- calcCellWidth();
3186
+ // 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
3187
+ calcCellWidth();
3188
+ if (reFull) {
3173
3189
  autoCellWidth();
3174
- updateStyle();
3175
- if (reFull) {
3176
- updateRowOffsetTop();
3177
- }
3178
- updateRowExpandStyle();
3190
+ }
3191
+ calcScrollbar();
3192
+ updateStyle();
3193
+ if (reFull) {
3194
+ updateRowOffsetTop();
3195
+ }
3196
+ updateRowExpandStyle();
3197
+ if (reFull) {
3179
3198
  return computeScrollLoad();
3180
3199
  }
3181
3200
  });
@@ -11058,11 +11077,11 @@ var _default = exports.default = (0, _vue.defineComponent)({
11058
11077
  const firstRow = afterFullData[startIndex];
11059
11078
  let rowid = (0, _util.getRowid)($xeTable, firstRow);
11060
11079
  let rowRest = fullAllDataRowIdData[rowid] || {};
11061
- ySpaceTop = rowRest.oTop;
11080
+ ySpaceTop = rowRest.oTop || 0;
11062
11081
  const lastRow = afterFullData[afterFullData.length - 1];
11063
11082
  rowid = (0, _util.getRowid)($xeTable, lastRow);
11064
11083
  rowRest = fullAllDataRowIdData[rowid] || {};
11065
- scrollYHeight = rowRest.oTop + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight);
11084
+ scrollYHeight = (rowRest.oTop || 0) + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight);
11066
11085
  // 是否展开行
11067
11086
  if (expandColumn && rowExpandedMaps[rowid]) {
11068
11087
  scrollYHeight += rowRest.expandHeight || expandOpts.height || 0;
@@ -11128,7 +11147,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
11128
11147
  isAllOverflow
11129
11148
  } = reactData;
11130
11149
  handleTableColumn();
11131
- $xeTable.updateScrollYSpace();
11150
+ $xeTable.updateScrollXSpace();
11132
11151
  return (0, _vue.nextTick)().then(() => {
11133
11152
  handleTableColumn();
11134
11153
  $xeTable.updateScrollXSpace();
@@ -11790,7 +11809,8 @@ var _default = exports.default = (0, _vue.defineComponent)({
11790
11809
  theme: tableTipConfig.theme,
11791
11810
  enterable: tableTipConfig.enterable,
11792
11811
  enterDelay: tableTipConfig.enterDelay,
11793
- leaveDelay: tableTipConfig.leaveDelay
11812
+ leaveDelay: tableTipConfig.leaveDelay,
11813
+ useHTML: tableTipConfig.useHTML
11794
11814
  }),
11795
11815
  /**
11796
11816
  * 校验提示