vxe-table 4.17.0-beta.1 → 4.17.0-beta.10
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/README.md +2 -2
- 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/module/custom/panel.js +34 -32
- package/es/table/module/export/export-panel.js +22 -22
- package/es/table/module/export/import-panel.js +8 -8
- package/es/table/module/keyboard/hook.js +4 -26
- package/es/table/render/index.js +14 -2
- package/es/table/src/body.js +12 -2
- package/es/table/src/emits.js +2 -0
- package/es/table/src/header.js +1 -1
- package/es/table/src/table.js +50 -15
- package/es/table/src/util.js +3 -3
- package/es/table/style.css +3 -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/ui/src/utils.js +6 -5
- package/es/vxe-table/style.css +3 -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 +99 -101
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/panel.js +26 -24
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/export/export-panel.js +19 -18
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/import-panel.js +8 -7
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/table/module/keyboard/hook.js +3 -28
- package/lib/table/module/keyboard/hook.min.js +1 -1
- package/lib/table/render/index.js +13 -2
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +0 -1
- package/lib/table/src/emits.js +1 -1
- package/lib/table/src/emits.min.js +1 -1
- package/lib/table/src/header.js +1 -1
- package/lib/table/src/table.js +12 -6
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +3 -3
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +3 -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/ui/src/utils.js +8 -5
- package/lib/ui/src/utils.min.js +1 -1
- package/lib/vxe-table/style/style.css +3 -0
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/table/module/custom/panel.ts +34 -32
- package/packages/table/module/export/export-panel.ts +22 -22
- package/packages/table/module/export/import-panel.ts +8 -8
- package/packages/table/module/keyboard/hook.ts +4 -28
- package/packages/table/render/index.ts +26 -17
- package/packages/table/src/body.ts +12 -3
- package/packages/table/src/emits.ts +2 -0
- package/packages/table/src/header.ts +2 -2
- package/packages/table/src/table.ts +48 -15
- package/packages/table/src/util.ts +3 -3
- package/packages/ui/src/utils.ts +7 -5
- package/styles/components/table.scss +3 -0
- /package/es/{iconfont.1759043328183.ttf → iconfont.1760688141383.ttf} +0 -0
- /package/es/{iconfont.1759043328183.woff → iconfont.1760688141383.woff} +0 -0
- /package/es/{iconfont.1759043328183.woff2 → iconfont.1760688141383.woff2} +0 -0
- /package/lib/{iconfont.1759043328183.ttf → iconfont.1760688141383.ttf} +0 -0
- /package/lib/{iconfont.1759043328183.woff → iconfont.1760688141383.woff} +0 -0
- /package/lib/{iconfont.1759043328183.woff2 → iconfont.1760688141383.woff2} +0 -0
package/es/table/src/table.js
CHANGED
|
@@ -2333,7 +2333,6 @@ export default defineVxeComponent({
|
|
|
2333
2333
|
emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - osbHeight}px` : '';
|
|
2334
2334
|
}
|
|
2335
2335
|
const scrollbarXConf = scrollbarOpts.x || {};
|
|
2336
|
-
const scrollbarXToTop = computeScrollbarXToTop.value;
|
|
2337
2336
|
const scrollbarYConf = scrollbarOpts.y || {};
|
|
2338
2337
|
const scrollbarYToLeft = computeScrollbarYToLeft.value;
|
|
2339
2338
|
let xScrollbarVisible = overflowX ? 'visible' : 'hidden';
|
|
@@ -2383,16 +2382,31 @@ export default defineVxeComponent({
|
|
|
2383
2382
|
}
|
|
2384
2383
|
const xWrapperEl = refScrollXWrapperElem.value;
|
|
2385
2384
|
if (xWrapperEl) {
|
|
2386
|
-
xWrapperEl.style.left = scrollbarXToTop ? `${osbWidth}px` : '';
|
|
2387
2385
|
xWrapperEl.style.width = `${el.clientWidth - osbWidth}px`;
|
|
2386
|
+
if (scrollbarYToLeft) {
|
|
2387
|
+
xWrapperEl.style.left = `${osbWidth}px`;
|
|
2388
|
+
}
|
|
2389
|
+
else {
|
|
2390
|
+
xWrapperEl.style.left = '';
|
|
2391
|
+
}
|
|
2388
2392
|
}
|
|
2389
2393
|
if (xLeftCornerEl) {
|
|
2390
|
-
|
|
2391
|
-
|
|
2394
|
+
if (scrollbarYToLeft) {
|
|
2395
|
+
xLeftCornerEl.style.width = `${osbWidth}px`;
|
|
2396
|
+
xLeftCornerEl.style.display = overflowY && osbWidth ? 'block' : '';
|
|
2397
|
+
}
|
|
2398
|
+
else {
|
|
2399
|
+
xLeftCornerEl.style.display = '';
|
|
2400
|
+
}
|
|
2392
2401
|
}
|
|
2393
2402
|
if (xRightCornerEl) {
|
|
2394
|
-
|
|
2395
|
-
|
|
2403
|
+
if (scrollbarYToLeft) {
|
|
2404
|
+
xRightCornerEl.style.display = '';
|
|
2405
|
+
}
|
|
2406
|
+
else {
|
|
2407
|
+
xRightCornerEl.style.width = `${osbWidth}px`;
|
|
2408
|
+
xRightCornerEl.style.display = xScrollbarVisible === 'visible' ? 'block' : '';
|
|
2409
|
+
}
|
|
2396
2410
|
}
|
|
2397
2411
|
const scrollYVirtualEl = refScrollYVirtualElem.value;
|
|
2398
2412
|
if (scrollYVirtualEl) {
|
|
@@ -3970,8 +3984,10 @@ export default defineVxeComponent({
|
|
|
3970
3984
|
updateAfterDataIndex();
|
|
3971
3985
|
return nextTick();
|
|
3972
3986
|
}).then(() => {
|
|
3987
|
+
updateTreeLineStyle();
|
|
3973
3988
|
return handleLazyRecalculate(true, true, true);
|
|
3974
3989
|
}).then(() => {
|
|
3990
|
+
updateTreeLineStyle();
|
|
3975
3991
|
setTimeout(() => {
|
|
3976
3992
|
$xeTable.updateCellAreas();
|
|
3977
3993
|
}, 30);
|
|
@@ -4232,7 +4248,10 @@ export default defineVxeComponent({
|
|
|
4232
4248
|
let countTop = 0;
|
|
4233
4249
|
const step = (timestamp) => {
|
|
4234
4250
|
let progress = (timestamp - startTime) / duration;
|
|
4235
|
-
if (progress
|
|
4251
|
+
if (progress < 0) {
|
|
4252
|
+
progress = 0;
|
|
4253
|
+
}
|
|
4254
|
+
else if (progress > 1) {
|
|
4236
4255
|
progress = 1;
|
|
4237
4256
|
}
|
|
4238
4257
|
const easedProgress = Math.pow(progress, 2);
|
|
@@ -4326,6 +4345,9 @@ export default defineVxeComponent({
|
|
|
4326
4345
|
}
|
|
4327
4346
|
}
|
|
4328
4347
|
};
|
|
4348
|
+
/**
|
|
4349
|
+
* 更新展开行样式
|
|
4350
|
+
*/
|
|
4329
4351
|
const updateRowExpandStyle = () => {
|
|
4330
4352
|
const { expandColumn, scrollYLoad, scrollYTop, isScrollYBig } = reactData;
|
|
4331
4353
|
const expandOpts = computeExpandOpts.value;
|
|
@@ -4381,6 +4403,12 @@ export default defineVxeComponent({
|
|
|
4381
4403
|
}
|
|
4382
4404
|
}
|
|
4383
4405
|
};
|
|
4406
|
+
/**
|
|
4407
|
+
* 更新树连接线样式
|
|
4408
|
+
*/
|
|
4409
|
+
const updateTreeLineStyle = () => {
|
|
4410
|
+
// 待优化
|
|
4411
|
+
};
|
|
4384
4412
|
const handleRowExpandScroll = () => {
|
|
4385
4413
|
const { elemStore } = internalData;
|
|
4386
4414
|
const rowExpandEl = refRowExpandElem.value;
|
|
@@ -11194,6 +11222,10 @@ export default defineVxeComponent({
|
|
|
11194
11222
|
if (target && /^textarea$/i.test(target.tagName)) {
|
|
11195
11223
|
return;
|
|
11196
11224
|
}
|
|
11225
|
+
// 如果滚轮未移动或者触摸板未变化位置
|
|
11226
|
+
if (!deltaY && !deltaX) {
|
|
11227
|
+
return;
|
|
11228
|
+
}
|
|
11197
11229
|
const { highlightHoverRow } = tableProps;
|
|
11198
11230
|
const { scrollXLoad, scrollYLoad, expandColumn } = reactData;
|
|
11199
11231
|
const leftFixedWidth = computeLeftFixedWidth.value;
|
|
@@ -11221,18 +11253,21 @@ export default defineVxeComponent({
|
|
|
11221
11253
|
return;
|
|
11222
11254
|
}
|
|
11223
11255
|
const wheelSpeed = getWheelSpeed(reactData.lastScrollTime);
|
|
11224
|
-
const deltaTop = shiftKey ? 0 :
|
|
11225
|
-
const deltaLeft =
|
|
11226
|
-
const isTopWheel = deltaTop < 0;
|
|
11256
|
+
const deltaTop = shiftKey ? 0 : (deltaY * wheelSpeed);
|
|
11257
|
+
const deltaLeft = (shiftKey ? (deltaX || deltaY) : deltaX) * wheelSpeed;
|
|
11227
11258
|
const currScrollTop = bodyScrollElem.scrollTop;
|
|
11228
|
-
|
|
11229
|
-
if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
|
|
11230
|
-
return;
|
|
11231
|
-
}
|
|
11259
|
+
const currScrollLeft = bodyScrollElem.scrollLeft;
|
|
11232
11260
|
const scrollTop = currScrollTop + deltaTop;
|
|
11233
|
-
const scrollLeft =
|
|
11261
|
+
const scrollLeft = currScrollLeft + deltaLeft;
|
|
11234
11262
|
const isRollX = scrollLeft !== lastScrollLeft;
|
|
11235
11263
|
const isRollY = scrollTop !== lastScrollTop;
|
|
11264
|
+
if (isRollY) {
|
|
11265
|
+
const isTopWheel = deltaTop < 0;
|
|
11266
|
+
// 如果滚动位置已经是顶部或底部,则不需要触发
|
|
11267
|
+
if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
|
|
11268
|
+
return;
|
|
11269
|
+
}
|
|
11270
|
+
}
|
|
11236
11271
|
if (rowOpts.isHover || highlightHoverRow) {
|
|
11237
11272
|
$xeTable.clearHoverRow();
|
|
11238
11273
|
}
|
package/es/table/src/util.js
CHANGED
|
@@ -566,7 +566,7 @@ const lineOffsetSizes = {
|
|
|
566
566
|
medium: 1,
|
|
567
567
|
large: 0
|
|
568
568
|
};
|
|
569
|
-
function
|
|
569
|
+
function countTreeExpandSize(prevRow, params) {
|
|
570
570
|
let count = 1;
|
|
571
571
|
if (!prevRow) {
|
|
572
572
|
return count;
|
|
@@ -583,7 +583,7 @@ function countTreeExpand(prevRow, params) {
|
|
|
583
583
|
const rowChildren = prevRow[transform ? mapChildrenField : childrenField];
|
|
584
584
|
if (rowChildren && treeExpandedFlag && treeExpandedMaps[getRowid($table, prevRow)]) {
|
|
585
585
|
for (let index = 0; index < rowChildren.length; index++) {
|
|
586
|
-
count +=
|
|
586
|
+
count += countTreeExpandSize(rowChildren[index], params);
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
589
|
return count;
|
|
@@ -613,7 +613,7 @@ export function calcTreeLine(params, prevRow) {
|
|
|
613
613
|
const currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
614
614
|
let expandSize = 1;
|
|
615
615
|
if (prevRow) {
|
|
616
|
-
expandSize =
|
|
616
|
+
expandSize = countTreeExpandSize(prevRow, params);
|
|
617
617
|
}
|
|
618
618
|
let cellHeight = currCellHeight;
|
|
619
619
|
const vnHeight = rowRest.height;
|