vxe-table 3.12.10-beta.2 → 3.12.10-beta.4
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/body.js +2 -1
- package/es/table/src/footer.js +2 -1
- package/es/table/src/header.js +28 -17
- package/es/table/src/methods.js +11 -5
- package/es/table/style.css +7 -4
- 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 +7 -4
- 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 +43 -24
- 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/body.js +2 -1
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +2 -1
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +26 -15
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +11 -5
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/style/style.css +7 -4
- 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 +7 -4
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/table/src/body.ts +2 -1
- package/packages/table/src/footer.ts +2 -1
- package/packages/table/src/header.ts +28 -17
- package/packages/table/src/methods.ts +11 -5
- package/styles/components/table.scss +7 -5
- /package/es/{iconfont.1736736807414.ttf → iconfont.1736759318847.ttf} +0 -0
- /package/es/{iconfont.1736736807414.woff → iconfont.1736759318847.woff} +0 -0
- /package/es/{iconfont.1736736807414.woff2 → iconfont.1736759318847.woff2} +0 -0
- /package/lib/{iconfont.1736736807414.ttf → iconfont.1736759318847.ttf} +0 -0
- /package/lib/{iconfont.1736736807414.woff → iconfont.1736759318847.woff} +0 -0
- /package/lib/{iconfont.1736736807414.woff2 → iconfont.1736759318847.woff2} +0 -0
package/es/table/src/header.js
CHANGED
|
@@ -2,7 +2,7 @@ import XEUtils from 'xe-utils';
|
|
|
2
2
|
import { VxeUI } from '../../ui';
|
|
3
3
|
import { getClass } from '../../ui/src/utils';
|
|
4
4
|
import { getOffsetPos, hasClass, addClass, removeClass } from '../../ui/src/dom';
|
|
5
|
-
import { convertHeaderColumnToRows, getColReMinWidth } from './util';
|
|
5
|
+
import { convertHeaderColumnToRows, getColReMinWidth, getRefElem } from './util';
|
|
6
6
|
const { getI18n, renderer, renderEmptyElement } = VxeUI;
|
|
7
7
|
const cellType = 'header';
|
|
8
8
|
const renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) => {
|
|
@@ -73,6 +73,8 @@ const renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) => {
|
|
|
73
73
|
thOns.mouseup = $xeTable.handleHeaderCellDragMouseupEvent;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
+
const isLastColumn = $columnIndex === cols.length - 1;
|
|
77
|
+
const showResizable = (XEUtils.isBoolean(column.resizable) ? column.resizable : (columnOpts.resizable || allResizable));
|
|
76
78
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
77
79
|
let isPreLoadStatus = false;
|
|
78
80
|
if (scrollXLoad && !isGroup && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex || _columnIndex > scrollXStore.visibleEndIndex)) {
|
|
@@ -82,7 +84,7 @@ const renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) => {
|
|
|
82
84
|
class: ['vxe-header--column', colid, {
|
|
83
85
|
[`col--${headAlign}`]: headAlign,
|
|
84
86
|
[`col--${type}`]: type,
|
|
85
|
-
'col--last':
|
|
87
|
+
'col--last': isLastColumn,
|
|
86
88
|
'col--fixed': column.fixed,
|
|
87
89
|
'col--group': isColGroup,
|
|
88
90
|
'col--ellipsis': hasEllipsis,
|
|
@@ -110,7 +112,7 @@ const renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) => {
|
|
|
110
112
|
/**
|
|
111
113
|
* 列宽拖动
|
|
112
114
|
*/
|
|
113
|
-
!fixedHiddenColumn &&
|
|
115
|
+
!fixedHiddenColumn && showResizable
|
|
114
116
|
? h('div', {
|
|
115
117
|
class: ['vxe-resizable', {
|
|
116
118
|
'is--line': !border || border === 'none'
|
|
@@ -120,7 +122,7 @@ const renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) => {
|
|
|
120
122
|
dblclick: (evnt) => $xeTable.handleResizeDblclickEvent(evnt, params)
|
|
121
123
|
}
|
|
122
124
|
})
|
|
123
|
-
:
|
|
125
|
+
: renderEmptyElement($xeTable)
|
|
124
126
|
]);
|
|
125
127
|
});
|
|
126
128
|
};
|
|
@@ -352,19 +354,28 @@ export default {
|
|
|
352
354
|
const tableInternalData = $xeTable;
|
|
353
355
|
const { column } = params;
|
|
354
356
|
const { $parent: $xetable, fixedType } = this;
|
|
355
|
-
const { visibleColumn } = tableInternalData;
|
|
356
|
-
const {
|
|
357
|
+
const { elemStore, visibleColumn } = tableInternalData;
|
|
358
|
+
const { refLeftContainer, refRightContainer } = $xetable.$refs;
|
|
357
359
|
const tableEl = $xeTable.$el;
|
|
358
360
|
const resizeBarElem = $xetable.$refs.refCellResizeBar;
|
|
359
361
|
const resizeTipElem = $xetable.$refs.refCellResizeTip;
|
|
360
362
|
const wrapperElem = this.$el;
|
|
361
363
|
const { clientX: dragClientX } = evnt;
|
|
362
364
|
const dragBtnElem = evnt.target;
|
|
365
|
+
let resizeColumn = column;
|
|
366
|
+
if (column.children && column.children.length) {
|
|
367
|
+
XEUtils.eachTree(column.children, childColumn => {
|
|
368
|
+
resizeColumn = childColumn;
|
|
369
|
+
});
|
|
370
|
+
}
|
|
363
371
|
const cell = dragBtnElem.parentNode;
|
|
364
372
|
const cellParams = Object.assign(params, { cell });
|
|
365
373
|
const resizableOpts = $xeTable.computeResizableOpts;
|
|
366
374
|
let dragLeft = 0;
|
|
367
|
-
const
|
|
375
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
376
|
+
if (!bodyScrollElem) {
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
368
379
|
const pos = getOffsetPos(dragBtnElem, tableEl);
|
|
369
380
|
const dragBtnWidth = dragBtnElem.clientWidth;
|
|
370
381
|
const dragBtnOffsetWidth = Math.floor(dragBtnWidth / 2);
|
|
@@ -399,10 +410,10 @@ export default {
|
|
|
399
410
|
evnt.preventDefault();
|
|
400
411
|
const offsetX = evnt.clientX - dragClientX;
|
|
401
412
|
let left = dragPosLeft + offsetX;
|
|
402
|
-
const scrollLeft = fixedType ? 0 :
|
|
413
|
+
const scrollLeft = fixedType ? 0 : bodyScrollElem.scrollLeft;
|
|
403
414
|
if (isLeftFixed) {
|
|
404
415
|
// 左固定列(不允许超过右侧固定列、不允许超过右边距)
|
|
405
|
-
left = Math.min(left, (refRightContainer ? refRightContainer.offsetLeft :
|
|
416
|
+
left = Math.min(left, (refRightContainer ? refRightContainer.offsetLeft : bodyScrollElem.clientWidth) - fixedOffsetWidth - minInterval);
|
|
406
417
|
}
|
|
407
418
|
else if (isRightFixed) {
|
|
408
419
|
// 右侧固定列(不允许超过左侧固定列、不允许超过左边距)
|
|
@@ -410,11 +421,11 @@ export default {
|
|
|
410
421
|
left = Math.min(left, dragPosLeft + cell.clientWidth - minInterval);
|
|
411
422
|
}
|
|
412
423
|
else {
|
|
413
|
-
dragMinLeft = Math.max(
|
|
414
|
-
// left = Math.min(left,
|
|
424
|
+
dragMinLeft = Math.max(bodyScrollElem.scrollLeft, dragMinLeft);
|
|
425
|
+
// left = Math.min(left, bodyScrollElem.clientWidth + bodyScrollElem.scrollLeft - 40)
|
|
415
426
|
}
|
|
416
427
|
dragLeft = Math.max(left, dragMinLeft);
|
|
417
|
-
const resizeBarLeft = dragLeft - scrollLeft;
|
|
428
|
+
const resizeBarLeft = Math.max(1, dragLeft - scrollLeft);
|
|
418
429
|
resizeBarElem.style.left = `${resizeBarLeft}px`;
|
|
419
430
|
if (resizableOpts.showDragTip && resizeTipElem) {
|
|
420
431
|
const tableWidth = tableEl.clientWidth;
|
|
@@ -424,14 +435,14 @@ export default {
|
|
|
424
435
|
const resizeTipHeight = resizeTipElem.clientHeight;
|
|
425
436
|
let resizeTipLeft = -resizeTipWidth;
|
|
426
437
|
if (resizeBarLeft < resizeTipWidth + resizeBarWidth) {
|
|
427
|
-
resizeTipLeft =
|
|
438
|
+
resizeTipLeft = 0;
|
|
428
439
|
}
|
|
429
440
|
else if (resizeBarLeft > tableWidth) {
|
|
430
441
|
resizeTipLeft += tableWidth - resizeBarLeft;
|
|
431
442
|
}
|
|
432
443
|
resizeTipElem.style.left = `${resizeTipLeft}px`;
|
|
433
444
|
resizeTipElem.style.top = `${Math.min(tableEl.clientHeight - resizeTipHeight, Math.max(0, evnt.clientY - wrapperRect.y - resizeTipHeight / 2))}px`;
|
|
434
|
-
resizeTipElem.textContent = getI18n('vxe.table.resizeColTip', [
|
|
445
|
+
resizeTipElem.textContent = getI18n('vxe.table.resizeColTip', [resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft)]);
|
|
435
446
|
}
|
|
436
447
|
};
|
|
437
448
|
$xetable._isResize = true;
|
|
@@ -441,11 +452,11 @@ export default {
|
|
|
441
452
|
document.onmouseup = function (evnt) {
|
|
442
453
|
document.onmousemove = domMousemove;
|
|
443
454
|
document.onmouseup = domMouseup;
|
|
444
|
-
const resizeWidth =
|
|
445
|
-
|
|
455
|
+
const resizeWidth = resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft);
|
|
456
|
+
resizeColumn.resizeWidth = resizeWidth;
|
|
446
457
|
if (resizableOpts.dragMode === 'fixed') {
|
|
447
458
|
visibleColumn.forEach((item) => {
|
|
448
|
-
if (item.id !==
|
|
459
|
+
if (item.id !== resizeColumn.id) {
|
|
449
460
|
if (!item.resizeWidth) {
|
|
450
461
|
item.resizeWidth = item.renderWidth;
|
|
451
462
|
}
|
package/es/table/src/methods.js
CHANGED
|
@@ -196,7 +196,7 @@ function cacheColumnMap($xeTable) {
|
|
|
196
196
|
fullColumnFieldData[field] = rest;
|
|
197
197
|
}
|
|
198
198
|
else {
|
|
199
|
-
if (storage || (columnOpts.drag && (isCrossDrag || isSelfToChildDrag))) {
|
|
199
|
+
if ((storage && !type) || (columnOpts.drag && (isCrossDrag || isSelfToChildDrag))) {
|
|
200
200
|
errLog('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field`]);
|
|
201
201
|
}
|
|
202
202
|
}
|
|
@@ -3437,17 +3437,23 @@ const Methods = {
|
|
|
3437
3437
|
if (isDblclickAutoWidth && el) {
|
|
3438
3438
|
const { fullColumnIdData } = internalData;
|
|
3439
3439
|
const { column } = params;
|
|
3440
|
-
|
|
3440
|
+
let resizeColumn = column;
|
|
3441
|
+
if (column.children && column.children.length) {
|
|
3442
|
+
XEUtils.eachTree(column.children, childColumn => {
|
|
3443
|
+
resizeColumn = childColumn;
|
|
3444
|
+
});
|
|
3445
|
+
}
|
|
3446
|
+
const colid = resizeColumn.id;
|
|
3441
3447
|
const colRest = fullColumnIdData[colid];
|
|
3442
3448
|
const dragBtnElem = evnt.target;
|
|
3443
3449
|
const cell = dragBtnElem.parentNode;
|
|
3444
3450
|
const cellParams = Object.assign(params, { cell });
|
|
3445
3451
|
const colMinWidth = getColReMinWidth(cellParams);
|
|
3446
|
-
let resizeWidth = calcColumnAutoWidth(
|
|
3452
|
+
let resizeWidth = calcColumnAutoWidth(resizeColumn, el);
|
|
3447
3453
|
if (colRest) {
|
|
3448
3454
|
resizeWidth = Math.max(resizeWidth, colRest.width);
|
|
3449
3455
|
}
|
|
3450
|
-
|
|
3456
|
+
resizeColumn.resizeWidth = Math.max(colMinWidth, resizeWidth);
|
|
3451
3457
|
reactData._isResize = false;
|
|
3452
3458
|
internalData._lastResizeTime = Date.now();
|
|
3453
3459
|
$xeTable.analyColumnWidth();
|
|
@@ -4852,7 +4858,7 @@ const Methods = {
|
|
|
4852
4858
|
}
|
|
4853
4859
|
vLen++;
|
|
4854
4860
|
});
|
|
4855
|
-
const isSelected =
|
|
4861
|
+
const isSelected = vLen > 0 ? sLen >= vLen : sLen >= rootList.length;
|
|
4856
4862
|
const halfSelect = !isSelected && (sLen >= 1 || hLen >= 1);
|
|
4857
4863
|
reactData.isAllSelected = isSelected;
|
|
4858
4864
|
reactData.isIndeterminate = halfSelect;
|
package/es/table/style.css
CHANGED
|
@@ -1738,20 +1738,23 @@
|
|
|
1738
1738
|
}
|
|
1739
1739
|
|
|
1740
1740
|
.vxe-table--header-inner-wrapper,
|
|
1741
|
+
.vxe-table--body-inner-wrapper,
|
|
1741
1742
|
.vxe-table--footer-inner-wrapper {
|
|
1743
|
+
position: relative;
|
|
1742
1744
|
width: 100%;
|
|
1743
1745
|
height: 100%;
|
|
1746
|
+
scrollbar-width: none;
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
.vxe-table--header-inner-wrapper,
|
|
1750
|
+
.vxe-table--footer-inner-wrapper {
|
|
1744
1751
|
overflow-y: hidden;
|
|
1745
1752
|
overflow-x: scroll;
|
|
1746
|
-
scrollbar-width: none;
|
|
1747
1753
|
}
|
|
1748
1754
|
|
|
1749
1755
|
.vxe-table--body-inner-wrapper {
|
|
1750
|
-
width: 100%;
|
|
1751
|
-
height: 100%;
|
|
1752
1756
|
overflow-y: scroll;
|
|
1753
1757
|
overflow-x: scroll;
|
|
1754
|
-
scrollbar-width: none;
|
|
1755
1758
|
}
|
|
1756
1759
|
|
|
1757
1760
|
.vxe-loading--custom-wrapper {
|