vxe-table 4.13.0-beta.3 → 4.13.0-beta.5
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/emits.js +4 -0
- package/es/table/src/table.js +83 -47
- 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/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +15 -13
- 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/emits.js +1 -1
- package/lib/table/src/emits.min.js +1 -1
- package/lib/table/src/table.js +98 -53
- 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/grid/src/grid.ts +1 -1
- package/packages/table/src/emits.ts +7 -1
- package/packages/table/src/table.ts +87 -48
- package/styles/components/table.scss +19 -0
- /package/es/{iconfont.1744078815150.ttf → iconfont.1744249431265.ttf} +0 -0
- /package/es/{iconfont.1744078815150.woff → iconfont.1744249431265.woff} +0 -0
- /package/es/{iconfont.1744078815150.woff2 → iconfont.1744249431265.woff2} +0 -0
- /package/lib/{iconfont.1744078815150.ttf → iconfont.1744249431265.ttf} +0 -0
- /package/lib/{iconfont.1744078815150.woff → iconfont.1744249431265.woff} +0 -0
- /package/lib/{iconfont.1744078815150.woff2 → iconfont.1744249431265.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
|
});
|
|
@@ -8105,7 +8119,7 @@ export default defineComponent({
|
|
|
8105
8119
|
isChange = oldValue === newValue;
|
|
8106
8120
|
if (isChange) {
|
|
8107
8121
|
newValue = null;
|
|
8108
|
-
|
|
8122
|
+
$xeTable.clearRadioRow();
|
|
8109
8123
|
}
|
|
8110
8124
|
}
|
|
8111
8125
|
if (isChange) {
|
|
@@ -8113,25 +8127,40 @@ export default defineComponent({
|
|
|
8113
8127
|
}
|
|
8114
8128
|
},
|
|
8115
8129
|
triggerCurrentColumnEvent(evnt, params) {
|
|
8130
|
+
const { currentColumn: oldValue } = reactData;
|
|
8116
8131
|
const columnOpts = computeColumnOpts.value;
|
|
8117
|
-
const
|
|
8118
|
-
const
|
|
8119
|
-
|
|
8120
|
-
|
|
8132
|
+
const currentColumnOpts = computeCurrentColumnOpts.value;
|
|
8133
|
+
const beforeRowMethod = currentColumnOpts.beforeSelectMethod || columnOpts.currentMethod;
|
|
8134
|
+
const { column: newValue } = params;
|
|
8135
|
+
const isChange = oldValue !== newValue;
|
|
8136
|
+
if (!beforeRowMethod || beforeRowMethod({ column: newValue, $table: $xeTable })) {
|
|
8137
|
+
$xeTable.setCurrentColumn(newValue);
|
|
8138
|
+
if (isChange) {
|
|
8139
|
+
dispatchEvent('current-column-change', Object.assign({ oldValue, newValue }, params), evnt);
|
|
8140
|
+
}
|
|
8141
|
+
}
|
|
8142
|
+
else {
|
|
8143
|
+
dispatchEvent('current-column-disabled', params, evnt);
|
|
8121
8144
|
}
|
|
8122
8145
|
},
|
|
8123
8146
|
triggerCurrentRowEvent(evnt, params) {
|
|
8124
8147
|
const { currentRow: oldValue } = reactData;
|
|
8125
8148
|
const rowOpts = computeRowOpts.value;
|
|
8126
|
-
const
|
|
8149
|
+
const currentRowOpts = computeCurrentRowOpts.value;
|
|
8150
|
+
const beforeRowMethod = currentRowOpts.beforeSelectMethod || rowOpts.currentMethod;
|
|
8127
8151
|
const { row: newValue } = params;
|
|
8128
8152
|
const isChange = oldValue !== newValue;
|
|
8129
|
-
if (!
|
|
8130
|
-
|
|
8153
|
+
if (!beforeRowMethod || beforeRowMethod({ row: newValue, $table: $xeTable })) {
|
|
8154
|
+
$xeTable.setCurrentRow(newValue);
|
|
8131
8155
|
if (isChange) {
|
|
8156
|
+
dispatchEvent('current-row-change', Object.assign({ oldValue, newValue }, params), evnt);
|
|
8157
|
+
// 已废弃
|
|
8132
8158
|
dispatchEvent('current-change', Object.assign({ oldValue, newValue }, params), evnt);
|
|
8133
8159
|
}
|
|
8134
8160
|
}
|
|
8161
|
+
else {
|
|
8162
|
+
dispatchEvent('current-row-disabled', params, evnt);
|
|
8163
|
+
}
|
|
8135
8164
|
},
|
|
8136
8165
|
/**
|
|
8137
8166
|
* 展开行事件
|
|
@@ -9461,11 +9490,11 @@ export default defineComponent({
|
|
|
9461
9490
|
const firstRow = afterFullData[startIndex];
|
|
9462
9491
|
let rowid = getRowid($xeTable, firstRow);
|
|
9463
9492
|
let rowRest = fullAllDataRowIdData[rowid] || {};
|
|
9464
|
-
ySpaceTop = rowRest.oTop;
|
|
9493
|
+
ySpaceTop = (rowRest.oTop || 0);
|
|
9465
9494
|
const lastRow = afterFullData[afterFullData.length - 1];
|
|
9466
9495
|
rowid = getRowid($xeTable, lastRow);
|
|
9467
9496
|
rowRest = fullAllDataRowIdData[rowid] || {};
|
|
9468
|
-
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);
|
|
9469
9498
|
// 是否展开行
|
|
9470
9499
|
if (expandColumn && rowExpandedMaps[rowid]) {
|
|
9471
9500
|
scrollYHeight += rowRest.expandHeight || expandOpts.height || 0;
|
|
@@ -9531,7 +9560,7 @@ export default defineComponent({
|
|
|
9531
9560
|
updateScrollXData() {
|
|
9532
9561
|
const { isAllOverflow } = reactData;
|
|
9533
9562
|
handleTableColumn();
|
|
9534
|
-
$xeTable.
|
|
9563
|
+
$xeTable.updateScrollXSpace();
|
|
9535
9564
|
return nextTick().then(() => {
|
|
9536
9565
|
handleTableColumn();
|
|
9537
9566
|
$xeTable.updateScrollXSpace();
|
|
@@ -10198,7 +10227,8 @@ export default defineComponent({
|
|
|
10198
10227
|
theme: tableTipConfig.theme,
|
|
10199
10228
|
enterable: tableTipConfig.enterable,
|
|
10200
10229
|
enterDelay: tableTipConfig.enterDelay,
|
|
10201
|
-
leaveDelay: tableTipConfig.leaveDelay
|
|
10230
|
+
leaveDelay: tableTipConfig.leaveDelay,
|
|
10231
|
+
useHTML: tableTipConfig.useHTML
|
|
10202
10232
|
}),
|
|
10203
10233
|
/**
|
|
10204
10234
|
* 校验提示
|
|
@@ -10527,6 +10557,12 @@ export default defineComponent({
|
|
|
10527
10557
|
if (checkboxOpts.halfField) {
|
|
10528
10558
|
warnLog('vxe.error.delProp', ['checkbox-config.halfField', 'checkbox-config.indeterminateField']);
|
|
10529
10559
|
}
|
|
10560
|
+
if (rowOpts.currentMethod) {
|
|
10561
|
+
warnLog('vxe.error.delProp', ['row-config.currentMethod', 'current-row-config.beforeSelectMethod']);
|
|
10562
|
+
}
|
|
10563
|
+
if (columnOpts.currentMethod) {
|
|
10564
|
+
warnLog('vxe.error.delProp', ['row-config.currentMethod', 'current-column-config.beforeSelectMethod']);
|
|
10565
|
+
}
|
|
10530
10566
|
if ((rowOpts.isCurrent || highlightCurrentRow) && props.keyboardConfig && keyboardOpts.isArrow && !XEUtils.isBoolean(currentRowOpts.isFollowSelected)) {
|
|
10531
10567
|
warnLog('vxe.error.notConflictProp', ['row-config.isCurrent', 'current-row-config.isFollowSelected']);
|
|
10532
10568
|
}
|
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;
|