vxe-table 4.17.0 → 4.17.1
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 +3 -4
- package/README.zh-TW.md +1 -1
- package/es/grid/src/grid.js +13 -5
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/locale/lang/en-US.js +22 -22
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/src/table.js +74 -21
- package/es/table/src/util.js +19 -16
- package/es/table/style.css +29 -2
- 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 +29 -2
- package/es/vxe-table/style.min.css +1 -1
- package/lib/grid/src/grid.js +12 -4
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +36 -33
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +22 -22
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +22 -22
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/table.js +15 -11
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +7 -16
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +29 -2
- 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 +29 -2
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +53 -45
- package/packages/locale/lang/en-US.ts +22 -22
- package/packages/table/src/table.ts +77 -21
- package/packages/table/src/util.ts +27 -16
- package/styles/components/table.scss +52 -2
- /package/es/{iconfont.1760925752102.ttf → iconfont.1761181613193.ttf} +0 -0
- /package/es/{iconfont.1760925752102.woff → iconfont.1761181613193.woff} +0 -0
- /package/es/{iconfont.1760925752102.woff2 → iconfont.1761181613193.woff2} +0 -0
- /package/lib/{iconfont.1760925752102.ttf → iconfont.1761181613193.ttf} +0 -0
- /package/lib/{iconfont.1760925752102.woff → iconfont.1761181613193.woff} +0 -0
- /package/lib/{iconfont.1760925752102.woff2 → iconfont.1761181613193.woff2} +0 -0
package/es/table/src/table.js
CHANGED
|
@@ -1469,7 +1469,7 @@ export default defineVxeComponent({
|
|
|
1469
1469
|
});
|
|
1470
1470
|
};
|
|
1471
1471
|
const calcTableHeight = (key) => {
|
|
1472
|
-
const { editConfig } = props;
|
|
1472
|
+
const { editConfig, editRules } = props;
|
|
1473
1473
|
const { parentHeight } = reactData;
|
|
1474
1474
|
let val = props[key];
|
|
1475
1475
|
if (key === 'minHeight') {
|
|
@@ -1477,7 +1477,7 @@ export default defineVxeComponent({
|
|
|
1477
1477
|
if (XEUtils.eqNull(val)) {
|
|
1478
1478
|
if (eqEmptyValue(defMinHeight)) {
|
|
1479
1479
|
// 编辑模式默认最小高度
|
|
1480
|
-
if (isEnableConf(editConfig)) {
|
|
1480
|
+
if (editRules && isEnableConf(editConfig)) {
|
|
1481
1481
|
val = 144;
|
|
1482
1482
|
}
|
|
1483
1483
|
}
|
|
@@ -2328,7 +2328,7 @@ export default defineVxeComponent({
|
|
|
2328
2328
|
const { visibleColumn, tableHeight, elemStore, customHeight, customMinHeight, customMaxHeight, tHeaderHeight, tFooterHeight } = internalData;
|
|
2329
2329
|
const $xeGanttView = internalData.xeGanttView;
|
|
2330
2330
|
const el = refElem.value;
|
|
2331
|
-
if (!el || !el.clientHeight) {
|
|
2331
|
+
if (!el || (internalData.tBodyHeight && !el.clientHeight)) {
|
|
2332
2332
|
return;
|
|
2333
2333
|
}
|
|
2334
2334
|
const containerList = ['main', 'left', 'right'];
|
|
@@ -6854,14 +6854,40 @@ export default defineVxeComponent({
|
|
|
6854
6854
|
* 获取表格的滚动状态
|
|
6855
6855
|
*/
|
|
6856
6856
|
getScroll() {
|
|
6857
|
-
|
|
6857
|
+
return $xeTable.getScrollData();
|
|
6858
|
+
},
|
|
6859
|
+
/**
|
|
6860
|
+
* 获取表格的滚动数据
|
|
6861
|
+
*/
|
|
6862
|
+
getScrollData() {
|
|
6863
|
+
const { scrollXLoad, scrollYLoad, scrollbarHeight, scrollbarWidth } = reactData;
|
|
6858
6864
|
const { elemStore } = internalData;
|
|
6859
6865
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
6866
|
+
const scrollTop = bodyScrollElem ? bodyScrollElem.scrollTop : 0;
|
|
6867
|
+
const scrollLeft = bodyScrollElem ? bodyScrollElem.scrollLeft : 0;
|
|
6868
|
+
const clientHeight = bodyScrollElem ? bodyScrollElem.clientHeight : 0;
|
|
6869
|
+
const clientWidth = bodyScrollElem ? bodyScrollElem.clientWidth : 0;
|
|
6870
|
+
const scrollHeight = bodyScrollElem ? bodyScrollElem.scrollHeight : 0;
|
|
6871
|
+
const scrollWidth = bodyScrollElem ? bodyScrollElem.scrollWidth : 0;
|
|
6872
|
+
const isTop = scrollTop <= 0;
|
|
6873
|
+
const isBottom = scrollTop + clientHeight >= scrollHeight;
|
|
6874
|
+
const isLeft = scrollLeft <= 0;
|
|
6875
|
+
const isRight = scrollLeft + clientWidth >= scrollWidth;
|
|
6860
6876
|
return {
|
|
6861
6877
|
virtualX: scrollXLoad,
|
|
6862
6878
|
virtualY: scrollYLoad,
|
|
6863
|
-
|
|
6864
|
-
|
|
6879
|
+
isTop,
|
|
6880
|
+
isBottom,
|
|
6881
|
+
isLeft,
|
|
6882
|
+
isRight,
|
|
6883
|
+
scrollbarHeight,
|
|
6884
|
+
scrollbarWidth,
|
|
6885
|
+
scrollTop,
|
|
6886
|
+
scrollLeft,
|
|
6887
|
+
scrollHeight,
|
|
6888
|
+
scrollWidth,
|
|
6889
|
+
clientHeight,
|
|
6890
|
+
clientWidth
|
|
6865
6891
|
};
|
|
6866
6892
|
},
|
|
6867
6893
|
/**
|
|
@@ -6981,6 +7007,8 @@ export default defineVxeComponent({
|
|
|
6981
7007
|
scrollYStore.endIndex = scrollYStore.visibleSize;
|
|
6982
7008
|
scrollYStore.visibleEndIndex = scrollYStore.visibleSize;
|
|
6983
7009
|
return nextTick().then(() => {
|
|
7010
|
+
internalData.lastScrollLeft = 0;
|
|
7011
|
+
internalData.lastScrollTop = 0;
|
|
6984
7012
|
internalData.intoRunScroll = false;
|
|
6985
7013
|
});
|
|
6986
7014
|
},
|
|
@@ -8202,7 +8230,7 @@ export default defineVxeComponent({
|
|
|
8202
8230
|
const el = refElem.value;
|
|
8203
8231
|
if (el) {
|
|
8204
8232
|
const parentElem = el.parentNode;
|
|
8205
|
-
|
|
8233
|
+
let parentPaddingSize = 0;
|
|
8206
8234
|
let parentWrapperHeight = 0;
|
|
8207
8235
|
if (parentElem) {
|
|
8208
8236
|
if ($xeGantt && hasClass(parentElem, 'vxe-gantt--table-wrapper')) {
|
|
@@ -8213,6 +8241,7 @@ export default defineVxeComponent({
|
|
|
8213
8241
|
}
|
|
8214
8242
|
else {
|
|
8215
8243
|
parentWrapperHeight = parentElem.clientHeight;
|
|
8244
|
+
parentPaddingSize = height === '100%' || height === 'auto' ? getPaddingTopBottomSize(parentElem) : 0;
|
|
8216
8245
|
}
|
|
8217
8246
|
}
|
|
8218
8247
|
return Math.floor(parentWrapperHeight - parentPaddingSize);
|
|
@@ -11242,11 +11271,10 @@ export default defineVxeComponent({
|
|
|
11242
11271
|
const { scrollXLoad, scrollYLoad, expandColumn } = reactData;
|
|
11243
11272
|
const leftFixedWidth = computeLeftFixedWidth.value;
|
|
11244
11273
|
const rightFixedWidth = computeRightFixedWidth.value;
|
|
11245
|
-
if (!(leftFixedWidth || rightFixedWidth || expandColumn)) {
|
|
11246
|
-
return;
|
|
11247
|
-
}
|
|
11248
11274
|
const { elemStore, lastScrollTop, lastScrollLeft } = internalData;
|
|
11249
11275
|
const rowOpts = computeRowOpts.value;
|
|
11276
|
+
const scrollbarXOpts = computeScrollbarXOpts.value;
|
|
11277
|
+
const scrollbarYOpts = computeScrollbarYOpts.value;
|
|
11250
11278
|
const xHandleEl = refScrollXHandleElem.value;
|
|
11251
11279
|
const yHandleEl = refScrollYHandleElem.value;
|
|
11252
11280
|
const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
|
|
@@ -11255,12 +11283,6 @@ export default defineVxeComponent({
|
|
|
11255
11283
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
11256
11284
|
const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
|
|
11257
11285
|
const rowExpandEl = refRowExpandElem.value;
|
|
11258
|
-
if (!xHandleEl) {
|
|
11259
|
-
return;
|
|
11260
|
-
}
|
|
11261
|
-
if (!yHandleEl) {
|
|
11262
|
-
return;
|
|
11263
|
-
}
|
|
11264
11286
|
if (!bodyScrollElem) {
|
|
11265
11287
|
return;
|
|
11266
11288
|
}
|
|
@@ -11273,13 +11295,28 @@ export default defineVxeComponent({
|
|
|
11273
11295
|
const scrollLeft = currScrollLeft + deltaLeft;
|
|
11274
11296
|
const isRollX = scrollLeft !== lastScrollLeft;
|
|
11275
11297
|
const isRollY = scrollTop !== lastScrollTop;
|
|
11298
|
+
if (isRollX) {
|
|
11299
|
+
// 如果禁用滚动
|
|
11300
|
+
if (scrollbarXOpts.visible === 'hidden') {
|
|
11301
|
+
evnt.preventDefault();
|
|
11302
|
+
return;
|
|
11303
|
+
}
|
|
11304
|
+
}
|
|
11276
11305
|
if (isRollY) {
|
|
11306
|
+
// 如果禁用滚动
|
|
11307
|
+
if (scrollbarYOpts.visible === 'hidden') {
|
|
11308
|
+
evnt.preventDefault();
|
|
11309
|
+
return;
|
|
11310
|
+
}
|
|
11277
11311
|
const isTopWheel = deltaTop < 0;
|
|
11278
11312
|
// 如果滚动位置已经是顶部或底部,则不需要触发
|
|
11279
11313
|
if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
|
|
11280
11314
|
return;
|
|
11281
11315
|
}
|
|
11282
11316
|
}
|
|
11317
|
+
if (!(leftFixedWidth || rightFixedWidth || expandColumn)) {
|
|
11318
|
+
return;
|
|
11319
|
+
}
|
|
11283
11320
|
if (rowOpts.isHover || highlightHoverRow) {
|
|
11284
11321
|
$xeTable.clearHoverRow();
|
|
11285
11322
|
}
|
|
@@ -11796,7 +11833,7 @@ export default defineVxeComponent({
|
|
|
11796
11833
|
const osYBehavior = XEUtils.eqNull(overscrollYBehavior) ? scrollbarOpts.overscrollBehavior : overscrollYBehavior;
|
|
11797
11834
|
return h('div', {
|
|
11798
11835
|
ref: isFixedLeft ? refLeftContainer : refRightContainer,
|
|
11799
|
-
class: [`vxe-table--fixed-${fixedType}-wrapper`, {
|
|
11836
|
+
class: [`vxe-table--fixed-${fixedType}-wrapper`, `sx--${scrollbarXOpts.visible}`, `sy--${scrollbarYOpts.visible}`, {
|
|
11800
11837
|
[`x-ob--${osXBehavior}`]: osXBehavior,
|
|
11801
11838
|
[`y-ob--${osYBehavior}`]: osYBehavior
|
|
11802
11839
|
}]
|
|
@@ -12103,7 +12140,7 @@ export default defineVxeComponent({
|
|
|
12103
12140
|
}]
|
|
12104
12141
|
}, [
|
|
12105
12142
|
h('div', {
|
|
12106
|
-
class: 'vxe-table--main-wrapper'
|
|
12143
|
+
class: ['vxe-table--main-wrapper', `sx--${scrollbarXOpts.visible}`, `sy--${scrollbarYOpts.visible}`]
|
|
12107
12144
|
}, [
|
|
12108
12145
|
/**
|
|
12109
12146
|
* 表头
|
|
@@ -12269,11 +12306,15 @@ export default defineVxeComponent({
|
|
|
12269
12306
|
h('div', {
|
|
12270
12307
|
key: 'tn',
|
|
12271
12308
|
ref: refEmptyPlaceholder,
|
|
12272
|
-
class: 'vxe-table--empty-
|
|
12309
|
+
class: 'vxe-table--empty-place-wrapper'
|
|
12273
12310
|
}, [
|
|
12274
12311
|
h('div', {
|
|
12275
|
-
class: 'vxe-table--empty-
|
|
12276
|
-
},
|
|
12312
|
+
class: 'vxe-table--empty-placeholder'
|
|
12313
|
+
}, [
|
|
12314
|
+
h('div', {
|
|
12315
|
+
class: 'vxe-table--empty-content'
|
|
12316
|
+
}, renderEmptyBody())
|
|
12317
|
+
])
|
|
12277
12318
|
]),
|
|
12278
12319
|
/**
|
|
12279
12320
|
* 边框线
|
|
@@ -12580,6 +12621,18 @@ export default defineVxeComponent({
|
|
|
12580
12621
|
watch(() => VxeUI.getLanguage(), () => {
|
|
12581
12622
|
reLayoutFlag.value++;
|
|
12582
12623
|
});
|
|
12624
|
+
watch(() => {
|
|
12625
|
+
const scrollbarXOpts = computeScrollbarXOpts.value;
|
|
12626
|
+
return scrollbarXOpts.visible;
|
|
12627
|
+
}, () => {
|
|
12628
|
+
reLayoutFlag.value++;
|
|
12629
|
+
});
|
|
12630
|
+
watch(() => {
|
|
12631
|
+
const scrollbarYOpts = computeScrollbarYOpts.value;
|
|
12632
|
+
return scrollbarYOpts.visible;
|
|
12633
|
+
}, () => {
|
|
12634
|
+
reLayoutFlag.value++;
|
|
12635
|
+
});
|
|
12583
12636
|
watch(reLayoutFlag, () => {
|
|
12584
12637
|
$xeTable.recalculate(true);
|
|
12585
12638
|
});
|
package/es/table/src/util.js
CHANGED
|
@@ -627,28 +627,31 @@ export function calcTreeLine(params, prevRow) {
|
|
|
627
627
|
export function clearTableDefaultStatus($xeTable) {
|
|
628
628
|
const { props, internalData } = $xeTable;
|
|
629
629
|
internalData.initStatus = false;
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
630
|
+
const actionList = [
|
|
631
|
+
$xeTable.clearSort(),
|
|
632
|
+
$xeTable.clearCurrentRow(),
|
|
633
|
+
$xeTable.clearCurrentColumn(),
|
|
634
|
+
$xeTable.clearRadioRow(),
|
|
635
|
+
$xeTable.clearRadioReserve(),
|
|
636
|
+
$xeTable.clearCheckboxRow(),
|
|
637
|
+
$xeTable.clearCheckboxReserve(),
|
|
638
|
+
$xeTable.clearRowExpand(),
|
|
639
|
+
$xeTable.clearTreeExpand(),
|
|
640
|
+
$xeTable.clearTreeExpandReserve(),
|
|
641
|
+
$xeTable.clearPendingRow()
|
|
642
|
+
];
|
|
641
643
|
if ($xeTable.clearFilter) {
|
|
642
|
-
$xeTable.clearFilter();
|
|
644
|
+
actionList.push($xeTable.clearFilter());
|
|
643
645
|
}
|
|
644
646
|
if ($xeTable.clearSelected && (props.keyboardConfig || props.mouseConfig)) {
|
|
645
|
-
$xeTable.clearSelected();
|
|
647
|
+
actionList.push($xeTable.clearSelected());
|
|
646
648
|
}
|
|
647
649
|
if ($xeTable.clearCellAreas && props.mouseConfig) {
|
|
648
|
-
$xeTable.clearCellAreas();
|
|
649
|
-
$xeTable.clearCopyCellArea();
|
|
650
|
+
actionList.push($xeTable.clearCellAreas(), $xeTable.clearCopyCellArea());
|
|
650
651
|
}
|
|
651
|
-
return
|
|
652
|
+
return Promise.all(actionList).then(() => {
|
|
653
|
+
return $xeTable.clearScroll();
|
|
654
|
+
});
|
|
652
655
|
}
|
|
653
656
|
export function clearTableAllStatus($xeTable) {
|
|
654
657
|
if ($xeTable.clearFilter) {
|
package/es/table/style.css
CHANGED
|
@@ -1839,6 +1839,28 @@
|
|
|
1839
1839
|
overflow-x: scroll;
|
|
1840
1840
|
}
|
|
1841
1841
|
|
|
1842
|
+
.vxe-table--main-wrapper.sx--hidden > .vxe-table--header-wrapper > .vxe-table--header-inner-wrapper {
|
|
1843
|
+
overflow-x: hidden;
|
|
1844
|
+
}
|
|
1845
|
+
.vxe-table--main-wrapper.sx--hidden > .vxe-table--body-wrapper > .vxe-table--body-inner-wrapper {
|
|
1846
|
+
overflow-x: hidden;
|
|
1847
|
+
}
|
|
1848
|
+
.vxe-table--main-wrapper.sx--hidden > .vxe-table--footer-wrapper > .vxe-table--footer-inner-wrapper {
|
|
1849
|
+
overflow-x: hidden;
|
|
1850
|
+
}
|
|
1851
|
+
.vxe-table--main-wrapper.sy--hidden > .vxe-table--body-wrapper > .vxe-table--body-inner-wrapper {
|
|
1852
|
+
overflow-y: hidden;
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1855
|
+
.vxe-table--fixed-left-wrapper.sx--hidden > .vxe-table--body-wrapper > .vxe-table--body-inner-wrapper,
|
|
1856
|
+
.vxe-table--fixed-right-wrapper.sx--hidden > .vxe-table--body-wrapper > .vxe-table--body-inner-wrapper {
|
|
1857
|
+
overflow-x: hidden;
|
|
1858
|
+
}
|
|
1859
|
+
.vxe-table--fixed-left-wrapper.sy--hidden > .vxe-table--body-wrapper > .vxe-table--body-inner-wrapper,
|
|
1860
|
+
.vxe-table--fixed-right-wrapper.sy--hidden > .vxe-table--body-wrapper > .vxe-table--body-inner-wrapper {
|
|
1861
|
+
overflow-y: hidden;
|
|
1862
|
+
}
|
|
1863
|
+
|
|
1842
1864
|
.vxe-loading--custom-wrapper {
|
|
1843
1865
|
display: none;
|
|
1844
1866
|
position: absolute;
|
|
@@ -3496,11 +3518,16 @@
|
|
|
3496
3518
|
display: none;
|
|
3497
3519
|
visibility: hidden;
|
|
3498
3520
|
}
|
|
3499
|
-
.vxe-table--render-default .vxe-table--empty-
|
|
3521
|
+
.vxe-table--render-default .vxe-table--empty-place-wrapper {
|
|
3500
3522
|
display: none;
|
|
3501
3523
|
position: absolute;
|
|
3524
|
+
width: 100%;
|
|
3502
3525
|
top: 0;
|
|
3503
3526
|
z-index: 5;
|
|
3527
|
+
overflow: hidden;
|
|
3528
|
+
}
|
|
3529
|
+
.vxe-table--render-default .vxe-table--empty-placeholder {
|
|
3530
|
+
display: flex;
|
|
3504
3531
|
}
|
|
3505
3532
|
.vxe-table--render-default .vxe-table--empty-content {
|
|
3506
3533
|
display: block;
|
|
@@ -3508,7 +3535,7 @@
|
|
|
3508
3535
|
pointer-events: auto;
|
|
3509
3536
|
}
|
|
3510
3537
|
.vxe-table--render-default.is--empty .vxe-table--empty-block,
|
|
3511
|
-
.vxe-table--render-default.is--empty .vxe-table--empty-
|
|
3538
|
+
.vxe-table--render-default.is--empty .vxe-table--empty-place-wrapper {
|
|
3512
3539
|
display: flex;
|
|
3513
3540
|
}
|
|
3514
3541
|
.vxe-table--render-default .vxe-body--column.col--selected {
|