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.
- 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/methods.js +58 -43
- package/es/table/src/table.js +2 -1
- 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 +67 -46
- 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/methods.js +63 -43
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +2 -1
- 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/methods.ts +65 -44
- package/packages/table/src/table.ts +23 -22
- package/styles/components/table.scss +19 -0
- /package/es/{iconfont.1744095177947.ttf → iconfont.1744252945243.ttf} +0 -0
- /package/es/{iconfont.1744095177947.woff → iconfont.1744252945243.woff} +0 -0
- /package/es/{iconfont.1744095177947.woff2 → iconfont.1744252945243.woff2} +0 -0
- /package/lib/{iconfont.1744095177947.ttf → iconfont.1744252945243.ttf} +0 -0
- /package/lib/{iconfont.1744095177947.woff → iconfont.1744252945243.woff} +0 -0
- /package/lib/{iconfont.1744095177947.woff2 → iconfont.1744252945243.woff2} +0 -0
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.15.0
|
|
2223
|
+
const version = "3.15.0";
|
|
2224
2224
|
core_.VxeUI.version = version;
|
|
2225
2225
|
core_.VxeUI.tableVersion = version;
|
|
2226
2226
|
core_.VxeUI.setConfig({
|
|
@@ -2843,7 +2843,7 @@ function isNodeElement(elem) {
|
|
|
2843
2843
|
const {
|
|
2844
2844
|
log: log_log
|
|
2845
2845
|
} = core_.VxeUI;
|
|
2846
|
-
const log_version = `table v${"3.15.0
|
|
2846
|
+
const log_version = `table v${"3.15.0"}`;
|
|
2847
2847
|
const warnLog = log_log.create('warn', log_version);
|
|
2848
2848
|
const errLog = log_log.create('error', log_version);
|
|
2849
2849
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -6885,10 +6885,8 @@ function autoCellWidth($xeTable) {
|
|
|
6885
6885
|
const {
|
|
6886
6886
|
elemStore
|
|
6887
6887
|
} = internalData;
|
|
6888
|
-
const
|
|
6889
|
-
|
|
6890
|
-
const bodyElem = tableBody ? tableBody.$el : null;
|
|
6891
|
-
if (!bodyElem) {
|
|
6888
|
+
const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper']);
|
|
6889
|
+
if (!bodyWrapperElem) {
|
|
6892
6890
|
return;
|
|
6893
6891
|
}
|
|
6894
6892
|
const yHandleEl = $xeTable.$refs.refScrollYHandleElem;
|
|
@@ -6901,7 +6899,7 @@ function autoCellWidth($xeTable) {
|
|
|
6901
6899
|
}
|
|
6902
6900
|
let tWidth = 0;
|
|
6903
6901
|
const minCellWidth = 40; // 列宽最少限制 40px
|
|
6904
|
-
const bodyWidth =
|
|
6902
|
+
const bodyWidth = bodyWrapperElem.clientWidth;
|
|
6905
6903
|
let remainWidth = bodyWidth;
|
|
6906
6904
|
let meanWidth = remainWidth / 100;
|
|
6907
6905
|
const {
|
|
@@ -6982,9 +6980,9 @@ function autoCellWidth($xeTable) {
|
|
|
6982
6980
|
});
|
|
6983
6981
|
if (fit) {
|
|
6984
6982
|
/**
|
|
6985
|
-
|
|
6986
|
-
|
|
6987
|
-
|
|
6983
|
+
* 偏移量算法
|
|
6984
|
+
* 如果所有列足够放的情况下,从最后动态列开始分配
|
|
6985
|
+
*/
|
|
6988
6986
|
const dynamicList = scaleList.concat(scaleMinList).concat(pxMinList).concat(autoMinList).concat(remainList);
|
|
6989
6987
|
let dynamicSize = dynamicList.length - 1;
|
|
6990
6988
|
if (dynamicSize > 0) {
|
|
@@ -6998,28 +6996,10 @@ function autoCellWidth($xeTable) {
|
|
|
6998
6996
|
}
|
|
6999
6997
|
}
|
|
7000
6998
|
}
|
|
7001
|
-
const tableHeight = bodyElem.offsetHeight;
|
|
7002
|
-
const overflowY = yHandleEl.scrollHeight > yHandleEl.clientHeight;
|
|
7003
|
-
reactData.scrollbarWidth = Math.max(scrollbarOpts.width || 0, yHandleEl.offsetWidth - yHandleEl.clientWidth);
|
|
7004
|
-
reactData.overflowY = overflowY;
|
|
7005
6999
|
reactData.scrollXWidth = tWidth;
|
|
7006
|
-
internalData.tableHeight = tableHeight;
|
|
7007
|
-
const headerTableElem = getRefElem(elemStore['main-header-table']);
|
|
7008
|
-
const footerTableElem = getRefElem(elemStore['main-footer-table']);
|
|
7009
|
-
const headerHeight = headerTableElem ? headerTableElem.clientHeight : 0;
|
|
7010
|
-
const overflowX = tWidth > bodyWidth;
|
|
7011
|
-
const footerHeight = footerTableElem ? footerTableElem.clientHeight : 0;
|
|
7012
|
-
reactData.scrollbarHeight = Math.max(scrollbarOpts.height || 0, xHandleEl.offsetHeight - xHandleEl.clientHeight);
|
|
7013
|
-
internalData.headerHeight = headerHeight;
|
|
7014
|
-
internalData.footerHeight = footerHeight;
|
|
7015
|
-
reactData.overflowX = overflowX;
|
|
7016
7000
|
reactData.resizeWidthFlag++;
|
|
7017
7001
|
updateColumnOffsetLeft($xeTable);
|
|
7018
7002
|
updateHeight($xeTable);
|
|
7019
|
-
reactData.parentHeight = Math.max(internalData.headerHeight + footerHeight + 20, $xeTable.getParentHeight());
|
|
7020
|
-
if (overflowX) {
|
|
7021
|
-
$xeTable.checkScrolling();
|
|
7022
|
-
}
|
|
7023
7003
|
}
|
|
7024
7004
|
const calcCellAutoHeight = (rowRest, wrapperEl) => {
|
|
7025
7005
|
const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
|
|
@@ -7428,7 +7408,7 @@ function computeScrollLoad($xeTable) {
|
|
|
7428
7408
|
}
|
|
7429
7409
|
// 计算 Y 逻辑
|
|
7430
7410
|
const rowHeight = computeRowHeight($xeTable);
|
|
7431
|
-
scrollYStore.rowHeight = rowHeight;
|
|
7411
|
+
scrollYStore.rowHeight = rowHeight; // 已废弃
|
|
7432
7412
|
reactData.rowHeight = rowHeight;
|
|
7433
7413
|
const {
|
|
7434
7414
|
toVisibleIndex: toYVisibleIndex,
|
|
@@ -7448,11 +7428,48 @@ function computeScrollLoad($xeTable) {
|
|
|
7448
7428
|
} else {
|
|
7449
7429
|
$xeTable.updateScrollYSpace();
|
|
7450
7430
|
}
|
|
7451
|
-
$xeTable.$nextTick(() => {
|
|
7452
|
-
updateStyle($xeTable);
|
|
7453
|
-
});
|
|
7454
7431
|
});
|
|
7455
7432
|
}
|
|
7433
|
+
function calcScrollbar($xeTable) {
|
|
7434
|
+
const reactData = $xeTable;
|
|
7435
|
+
const internalData = $xeTable;
|
|
7436
|
+
const {
|
|
7437
|
+
scrollXWidth,
|
|
7438
|
+
scrollYHeight
|
|
7439
|
+
} = reactData;
|
|
7440
|
+
const {
|
|
7441
|
+
elemStore
|
|
7442
|
+
} = internalData;
|
|
7443
|
+
const scrollbarOpts = $xeTable.computeScrollbarOpts;
|
|
7444
|
+
const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper']);
|
|
7445
|
+
const headerTableElem = getRefElem(elemStore['main-header-table']);
|
|
7446
|
+
const footerTableElem = getRefElem(elemStore['main-footer-table']);
|
|
7447
|
+
const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
|
|
7448
|
+
const yHandleEl = $xeTable.$refs.refScrollYHandleElem;
|
|
7449
|
+
let overflowY = false;
|
|
7450
|
+
let overflowX = false;
|
|
7451
|
+
if (bodyWrapperElem) {
|
|
7452
|
+
overflowY = scrollYHeight > bodyWrapperElem.clientHeight;
|
|
7453
|
+
if (yHandleEl) {
|
|
7454
|
+
reactData.scrollbarWidth = Math.max(scrollbarOpts.width || 0, yHandleEl.offsetWidth - yHandleEl.clientWidth);
|
|
7455
|
+
}
|
|
7456
|
+
reactData.overflowY = overflowY;
|
|
7457
|
+
overflowX = scrollXWidth > bodyWrapperElem.clientWidth;
|
|
7458
|
+
if (xHandleEl) {
|
|
7459
|
+
reactData.scrollbarHeight = Math.max(scrollbarOpts.height || 0, xHandleEl.offsetHeight - xHandleEl.clientHeight);
|
|
7460
|
+
}
|
|
7461
|
+
reactData.overflowX = overflowX;
|
|
7462
|
+
const headerHeight = headerTableElem ? headerTableElem.clientHeight : 0;
|
|
7463
|
+
const footerHeight = footerTableElem ? footerTableElem.clientHeight : 0;
|
|
7464
|
+
internalData.tableHeight = bodyWrapperElem.offsetHeight;
|
|
7465
|
+
internalData.headerHeight = headerHeight;
|
|
7466
|
+
internalData.footerHeight = footerHeight;
|
|
7467
|
+
reactData.parentHeight = Math.max(internalData.headerHeight + footerHeight + 20, $xeTable.getParentHeight());
|
|
7468
|
+
}
|
|
7469
|
+
if (overflowX) {
|
|
7470
|
+
$xeTable.checkScrolling();
|
|
7471
|
+
}
|
|
7472
|
+
}
|
|
7456
7473
|
function handleRecalculateLayout($xeTable, reFull) {
|
|
7457
7474
|
const internalData = $xeTable;
|
|
7458
7475
|
const el = $xeTable.$refs.refElem;
|
|
@@ -7470,21 +7487,22 @@ function handleRecalculateLayout($xeTable, reFull) {
|
|
|
7470
7487
|
}
|
|
7471
7488
|
calcCellWidth($xeTable);
|
|
7472
7489
|
autoCellWidth($xeTable);
|
|
7490
|
+
calcScrollbar($xeTable);
|
|
7473
7491
|
updateStyle($xeTable);
|
|
7474
|
-
if (reFull) {
|
|
7475
|
-
updateRowOffsetTop($xeTable);
|
|
7476
|
-
}
|
|
7477
7492
|
updateRowExpandStyle($xeTable);
|
|
7478
7493
|
return computeScrollLoad($xeTable).then(() => {
|
|
7479
|
-
|
|
7480
|
-
|
|
7481
|
-
|
|
7494
|
+
// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
7495
|
+
calcCellWidth($xeTable);
|
|
7496
|
+
if (reFull) {
|
|
7482
7497
|
autoCellWidth($xeTable);
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
|
|
7487
|
-
|
|
7498
|
+
}
|
|
7499
|
+
calcScrollbar($xeTable);
|
|
7500
|
+
updateStyle($xeTable);
|
|
7501
|
+
if (reFull) {
|
|
7502
|
+
updateRowOffsetTop($xeTable);
|
|
7503
|
+
}
|
|
7504
|
+
updateRowExpandStyle($xeTable);
|
|
7505
|
+
if (reFull) {
|
|
7488
7506
|
return computeScrollLoad($xeTable);
|
|
7489
7507
|
}
|
|
7490
7508
|
});
|
|
@@ -8471,6 +8489,7 @@ const Methods = {
|
|
|
8471
8489
|
}
|
|
8472
8490
|
reactData.isRowLoading = false;
|
|
8473
8491
|
calcCellHeight($xeTable);
|
|
8492
|
+
updateRowOffsetTop($xeTable);
|
|
8474
8493
|
// 是否变更虚拟滚动
|
|
8475
8494
|
if (oldScrollYLoad === sYLoad) {
|
|
8476
8495
|
restoreScrollLocation($xeTable, targetScrollLeft, targetScrollTop).then(() => {
|
|
@@ -10788,6 +10807,7 @@ const Methods = {
|
|
|
10788
10807
|
}
|
|
10789
10808
|
}
|
|
10790
10809
|
return $xeTable.$nextTick().then(() => {
|
|
10810
|
+
updateRowOffsetTop($xeTable);
|
|
10791
10811
|
return {
|
|
10792
10812
|
status
|
|
10793
10813
|
};
|
|
@@ -15630,11 +15650,11 @@ const Methods = {
|
|
|
15630
15650
|
const firstRow = afterFullData[startIndex];
|
|
15631
15651
|
let rowid = getRowid($xeTable, firstRow);
|
|
15632
15652
|
let rowRest = fullAllDataRowIdData[rowid] || {};
|
|
15633
|
-
ySpaceTop = rowRest.oTop;
|
|
15653
|
+
ySpaceTop = rowRest.oTop || 0;
|
|
15634
15654
|
const lastRow = afterFullData[afterFullData.length - 1];
|
|
15635
15655
|
rowid = getRowid($xeTable, lastRow);
|
|
15636
15656
|
rowRest = fullAllDataRowIdData[rowid] || {};
|
|
15637
|
-
scrollYHeight = rowRest.oTop + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight);
|
|
15657
|
+
scrollYHeight = (rowRest.oTop || 0) + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight);
|
|
15638
15658
|
// 是否展开行
|
|
15639
15659
|
if (expandColumn && rowExpandedMaps[rowid]) {
|
|
15640
15660
|
scrollYHeight += rowRest.expandHeight || expandOpts.height || 0;
|
|
@@ -27997,7 +28017,8 @@ function renderBody(h, $xeTable) {
|
|
|
27997
28017
|
theme: tableTipConfig.theme,
|
|
27998
28018
|
enterable: tableTipConfig.enterable,
|
|
27999
28019
|
enterDelay: tableTipConfig.enterDelay,
|
|
28000
|
-
leaveDelay: tableTipConfig.leaveDelay
|
|
28020
|
+
leaveDelay: tableTipConfig.leaveDelay,
|
|
28021
|
+
useHTML: tableTipConfig.useHTML
|
|
28001
28022
|
}
|
|
28002
28023
|
}) : table_renderEmptyElement($xeTable),
|
|
28003
28024
|
/**
|