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.
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/src/table.js +54 -39
- package/es/table/style.css +12 -0
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +12 -0
- package/es/vxe-table/style.min.css +1 -1
- package/helper/vetur/attributes.json +1 -1
- package/helper/vetur/tags.json +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +11 -10
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/table.js +59 -39
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +12 -0
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +12 -0
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/table/src/table.ts +60 -40
- package/styles/components/table.scss +19 -0
- /package/es/{iconfont.1744095189878.ttf → iconfont.1744252965278.ttf} +0 -0
- /package/es/{iconfont.1744095189878.woff → iconfont.1744252965278.woff} +0 -0
- /package/es/{iconfont.1744095189878.woff2 → iconfont.1744252965278.woff2} +0 -0
- /package/lib/{iconfont.1744095189878.ttf → iconfont.1744252965278.ttf} +0 -0
- /package/lib/{iconfont.1744095189878.woff → iconfont.1744252965278.woff} +0 -0
- /package/lib/{iconfont.1744095189878.woff2 → iconfont.1744252965278.woff2} +0 -0
package/es/table/src/table.js
CHANGED
|
@@ -1454,10 +1454,8 @@ export default defineComponent({
|
|
|
1454
1454
|
*/
|
|
1455
1455
|
const autoCellWidth = () => {
|
|
1456
1456
|
const { elemStore } = internalData;
|
|
1457
|
-
const
|
|
1458
|
-
|
|
1459
|
-
const bodyElem = tableBody ? tableBody.$el : null;
|
|
1460
|
-
if (!bodyElem) {
|
|
1457
|
+
const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper']);
|
|
1458
|
+
if (!bodyWrapperElem) {
|
|
1461
1459
|
return;
|
|
1462
1460
|
}
|
|
1463
1461
|
const yHandleEl = refScrollYHandleElem.value;
|
|
@@ -1470,7 +1468,7 @@ export default defineComponent({
|
|
|
1470
1468
|
}
|
|
1471
1469
|
let tWidth = 0;
|
|
1472
1470
|
const minCellWidth = 40; // 列宽最少限制 40px
|
|
1473
|
-
const bodyWidth =
|
|
1471
|
+
const bodyWidth = bodyWrapperElem.clientWidth;
|
|
1474
1472
|
let remainWidth = bodyWidth;
|
|
1475
1473
|
let meanWidth = remainWidth / 100;
|
|
1476
1474
|
const { fit } = props;
|
|
@@ -1555,28 +1553,10 @@ export default defineComponent({
|
|
|
1555
1553
|
}
|
|
1556
1554
|
}
|
|
1557
1555
|
}
|
|
1558
|
-
const tableHeight = bodyElem.offsetHeight;
|
|
1559
|
-
const overflowY = yHandleEl.scrollHeight > yHandleEl.clientHeight;
|
|
1560
|
-
reactData.scrollbarWidth = Math.max(scrollbarOpts.width || 0, yHandleEl.offsetWidth - yHandleEl.clientWidth);
|
|
1561
|
-
reactData.overflowY = overflowY;
|
|
1562
1556
|
reactData.scrollXWidth = tWidth;
|
|
1563
|
-
internalData.tableHeight = tableHeight;
|
|
1564
|
-
const headerTableElem = getRefElem(elemStore['main-header-table']);
|
|
1565
|
-
const footerTableElem = getRefElem(elemStore['main-footer-table']);
|
|
1566
|
-
const headerHeight = headerTableElem ? headerTableElem.clientHeight : 0;
|
|
1567
|
-
const overflowX = tWidth > bodyWidth;
|
|
1568
|
-
const footerHeight = footerTableElem ? footerTableElem.clientHeight : 0;
|
|
1569
|
-
reactData.scrollbarHeight = Math.max(scrollbarOpts.height || 0, xHandleEl.offsetHeight - xHandleEl.clientHeight);
|
|
1570
|
-
internalData.headerHeight = headerHeight;
|
|
1571
|
-
internalData.footerHeight = footerHeight;
|
|
1572
|
-
reactData.overflowX = overflowX;
|
|
1573
1557
|
reactData.resizeWidthFlag++;
|
|
1574
1558
|
updateColumnOffsetLeft();
|
|
1575
1559
|
updateHeight();
|
|
1576
|
-
reactData.parentHeight = Math.max(internalData.headerHeight + footerHeight + 20, $xeTable.getParentHeight());
|
|
1577
|
-
if (overflowX) {
|
|
1578
|
-
$xeTable.checkScrolling();
|
|
1579
|
-
}
|
|
1580
1560
|
};
|
|
1581
1561
|
const calcCellAutoHeight = (rowRest, wrapperEl) => {
|
|
1582
1562
|
const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
|
|
@@ -2641,7 +2621,7 @@ export default defineComponent({
|
|
|
2641
2621
|
}
|
|
2642
2622
|
// 计算 Y 逻辑
|
|
2643
2623
|
const rowHeight = computeRowHeight();
|
|
2644
|
-
scrollYStore.rowHeight = rowHeight;
|
|
2624
|
+
scrollYStore.rowHeight = rowHeight; // 已废弃
|
|
2645
2625
|
reactData.rowHeight = rowHeight;
|
|
2646
2626
|
const { toVisibleIndex: toYVisibleIndex, visibleSize: visibleYSize } = handleVirtualYVisible();
|
|
2647
2627
|
if (scrollYLoad) {
|
|
@@ -2659,11 +2639,41 @@ export default defineComponent({
|
|
|
2659
2639
|
else {
|
|
2660
2640
|
$xeTable.updateScrollYSpace();
|
|
2661
2641
|
}
|
|
2662
|
-
nextTick(() => {
|
|
2663
|
-
updateStyle();
|
|
2664
|
-
});
|
|
2665
2642
|
});
|
|
2666
2643
|
};
|
|
2644
|
+
const calcScrollbar = () => {
|
|
2645
|
+
const { scrollXWidth, scrollYHeight } = reactData;
|
|
2646
|
+
const { elemStore } = internalData;
|
|
2647
|
+
const scrollbarOpts = computeScrollbarOpts.value;
|
|
2648
|
+
const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper']);
|
|
2649
|
+
const headerTableElem = getRefElem(elemStore['main-header-table']);
|
|
2650
|
+
const footerTableElem = getRefElem(elemStore['main-footer-table']);
|
|
2651
|
+
const xHandleEl = refScrollXHandleElem.value;
|
|
2652
|
+
const yHandleEl = refScrollYHandleElem.value;
|
|
2653
|
+
let overflowY = false;
|
|
2654
|
+
let overflowX = false;
|
|
2655
|
+
if (bodyWrapperElem) {
|
|
2656
|
+
overflowY = scrollYHeight > bodyWrapperElem.clientHeight;
|
|
2657
|
+
if (yHandleEl) {
|
|
2658
|
+
reactData.scrollbarWidth = Math.max(scrollbarOpts.width || 0, yHandleEl.offsetWidth - yHandleEl.clientWidth);
|
|
2659
|
+
}
|
|
2660
|
+
reactData.overflowY = overflowY;
|
|
2661
|
+
overflowX = scrollXWidth > bodyWrapperElem.clientWidth;
|
|
2662
|
+
if (xHandleEl) {
|
|
2663
|
+
reactData.scrollbarHeight = Math.max(scrollbarOpts.height || 0, xHandleEl.offsetHeight - xHandleEl.clientHeight);
|
|
2664
|
+
}
|
|
2665
|
+
const headerHeight = headerTableElem ? headerTableElem.clientHeight : 0;
|
|
2666
|
+
const footerHeight = footerTableElem ? footerTableElem.clientHeight : 0;
|
|
2667
|
+
internalData.tableHeight = bodyWrapperElem.offsetHeight;
|
|
2668
|
+
internalData.headerHeight = headerHeight;
|
|
2669
|
+
internalData.footerHeight = footerHeight;
|
|
2670
|
+
reactData.overflowX = overflowX;
|
|
2671
|
+
reactData.parentHeight = Math.max(internalData.headerHeight + footerHeight + 20, $xeTable.getParentHeight());
|
|
2672
|
+
}
|
|
2673
|
+
if (overflowX) {
|
|
2674
|
+
$xeTable.checkScrolling();
|
|
2675
|
+
}
|
|
2676
|
+
};
|
|
2667
2677
|
const handleRecalculateLayout = (reFull) => {
|
|
2668
2678
|
const el = refElem.value;
|
|
2669
2679
|
internalData.rceRunTime = Date.now();
|
|
@@ -2680,18 +2690,22 @@ export default defineComponent({
|
|
|
2680
2690
|
}
|
|
2681
2691
|
calcCellWidth();
|
|
2682
2692
|
autoCellWidth();
|
|
2693
|
+
calcScrollbar();
|
|
2683
2694
|
updateStyle();
|
|
2684
2695
|
updateRowExpandStyle();
|
|
2685
2696
|
return computeScrollLoad().then(() => {
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2697
|
+
// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
2698
|
+
calcCellWidth();
|
|
2699
|
+
if (reFull) {
|
|
2689
2700
|
autoCellWidth();
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2701
|
+
}
|
|
2702
|
+
calcScrollbar();
|
|
2703
|
+
updateStyle();
|
|
2704
|
+
if (reFull) {
|
|
2705
|
+
updateRowOffsetTop();
|
|
2706
|
+
}
|
|
2707
|
+
updateRowExpandStyle();
|
|
2708
|
+
if (reFull) {
|
|
2695
2709
|
return computeScrollLoad();
|
|
2696
2710
|
}
|
|
2697
2711
|
});
|
|
@@ -9476,11 +9490,11 @@ export default defineComponent({
|
|
|
9476
9490
|
const firstRow = afterFullData[startIndex];
|
|
9477
9491
|
let rowid = getRowid($xeTable, firstRow);
|
|
9478
9492
|
let rowRest = fullAllDataRowIdData[rowid] || {};
|
|
9479
|
-
ySpaceTop = rowRest.oTop;
|
|
9493
|
+
ySpaceTop = (rowRest.oTop || 0);
|
|
9480
9494
|
const lastRow = afterFullData[afterFullData.length - 1];
|
|
9481
9495
|
rowid = getRowid($xeTable, lastRow);
|
|
9482
9496
|
rowRest = fullAllDataRowIdData[rowid] || {};
|
|
9483
|
-
scrollYHeight = rowRest.oTop + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight);
|
|
9497
|
+
scrollYHeight = (rowRest.oTop || 0) + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight);
|
|
9484
9498
|
// 是否展开行
|
|
9485
9499
|
if (expandColumn && rowExpandedMaps[rowid]) {
|
|
9486
9500
|
scrollYHeight += rowRest.expandHeight || expandOpts.height || 0;
|
|
@@ -9546,7 +9560,7 @@ export default defineComponent({
|
|
|
9546
9560
|
updateScrollXData() {
|
|
9547
9561
|
const { isAllOverflow } = reactData;
|
|
9548
9562
|
handleTableColumn();
|
|
9549
|
-
$xeTable.
|
|
9563
|
+
$xeTable.updateScrollXSpace();
|
|
9550
9564
|
return nextTick().then(() => {
|
|
9551
9565
|
handleTableColumn();
|
|
9552
9566
|
$xeTable.updateScrollXSpace();
|
|
@@ -10213,7 +10227,8 @@ export default defineComponent({
|
|
|
10213
10227
|
theme: tableTipConfig.theme,
|
|
10214
10228
|
enterable: tableTipConfig.enterable,
|
|
10215
10229
|
enterDelay: tableTipConfig.enterDelay,
|
|
10216
|
-
leaveDelay: tableTipConfig.leaveDelay
|
|
10230
|
+
leaveDelay: tableTipConfig.leaveDelay,
|
|
10231
|
+
useHTML: tableTipConfig.useHTML
|
|
10217
10232
|
}),
|
|
10218
10233
|
/**
|
|
10219
10234
|
* 校验提示
|
package/es/table/style.css
CHANGED
|
@@ -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;
|