vxe-table 4.13.27 → 4.13.29
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/module/filter/hook.js +1 -0
- package/es/table/src/table.js +90 -50
- package/es/table/style.css +6 -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 +6 -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 +13 -11
- 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/filter/hook.js +1 -0
- package/lib/table/src/table.js +10 -9
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +6 -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 +6 -0
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/table/module/filter/hook.ts +1 -0
- package/packages/table/src/table.ts +91 -50
- package/styles/components/table.scss +14 -0
- /package/es/{iconfont.1747176259693.ttf → iconfont.1747286444797.ttf} +0 -0
- /package/es/{iconfont.1747176259693.woff → iconfont.1747286444797.woff} +0 -0
- /package/es/{iconfont.1747176259693.woff2 → iconfont.1747286444797.woff2} +0 -0
- /package/lib/{iconfont.1747176259693.ttf → iconfont.1747286444797.ttf} +0 -0
- /package/lib/{iconfont.1747176259693.woff → iconfont.1747286444797.woff} +0 -0
- /package/lib/{iconfont.1747176259693.woff2 → iconfont.1747286444797.woff2} +0 -0
package/es/table/src/table.js
CHANGED
|
@@ -9,7 +9,7 @@ import TableHeaderComponent from './header';
|
|
|
9
9
|
import TableFooterComponent from './footer';
|
|
10
10
|
import tableProps from './props';
|
|
11
11
|
import tableEmits from './emits';
|
|
12
|
-
import { getRowUniqueId, clearTableAllStatus, hasDeepKey, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth, createHandleUpdateRowId, createHandleGetRowId, getCellHeight } from './util';
|
|
12
|
+
import { getRowUniqueId, clearTableAllStatus, toFilters, hasDeepKey, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth, createHandleUpdateRowId, createHandleGetRowId, getCellHeight } from './util';
|
|
13
13
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
14
14
|
import { warnLog, errLog } from '../../ui/src/log';
|
|
15
15
|
import TableCustomPanelComponent from '../module/custom/panel';
|
|
@@ -882,7 +882,7 @@ export default defineComponent({
|
|
|
882
882
|
};
|
|
883
883
|
const getNextSortOrder = (column) => {
|
|
884
884
|
const sortOpts = computeSortOpts.value;
|
|
885
|
-
const { orders } = sortOpts;
|
|
885
|
+
const { orders = [] } = sortOpts;
|
|
886
886
|
const currOrder = column.order || null;
|
|
887
887
|
const oIndex = orders.indexOf(currOrder) + 1;
|
|
888
888
|
return orders[oIndex < orders.length ? oIndex : 0];
|
|
@@ -1291,6 +1291,53 @@ export default defineComponent({
|
|
|
1291
1291
|
}
|
|
1292
1292
|
return rest;
|
|
1293
1293
|
};
|
|
1294
|
+
const handleSortEvent = (evnt, sortConfs, isUpdate) => {
|
|
1295
|
+
const sortOpts = computeSortOpts.value;
|
|
1296
|
+
const { multiple, remote, orders } = sortOpts;
|
|
1297
|
+
if (!XEUtils.isArray(sortConfs)) {
|
|
1298
|
+
sortConfs = [sortConfs];
|
|
1299
|
+
}
|
|
1300
|
+
if (sortConfs && sortConfs.length) {
|
|
1301
|
+
if (!multiple) {
|
|
1302
|
+
sortConfs = [sortConfs[0]];
|
|
1303
|
+
clearAllSort();
|
|
1304
|
+
}
|
|
1305
|
+
let firstColumn = null;
|
|
1306
|
+
sortConfs.forEach((confs, index) => {
|
|
1307
|
+
let { field, order } = confs;
|
|
1308
|
+
let column = field;
|
|
1309
|
+
if (XEUtils.isString(field)) {
|
|
1310
|
+
column = $xeTable.getColumnByField(field);
|
|
1311
|
+
}
|
|
1312
|
+
if (!firstColumn) {
|
|
1313
|
+
firstColumn = column;
|
|
1314
|
+
}
|
|
1315
|
+
if (column && column.sortable) {
|
|
1316
|
+
if (orders && orders.indexOf(order) === -1) {
|
|
1317
|
+
order = getNextSortOrder(column);
|
|
1318
|
+
}
|
|
1319
|
+
if (column.order !== order) {
|
|
1320
|
+
column.order = order;
|
|
1321
|
+
}
|
|
1322
|
+
column.sortTime = Date.now() + index;
|
|
1323
|
+
}
|
|
1324
|
+
});
|
|
1325
|
+
if (isUpdate) {
|
|
1326
|
+
if (!remote) {
|
|
1327
|
+
$xeTable.handleTableData(true);
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
if (evnt) {
|
|
1331
|
+
$xeTable.handleColumnSortEvent(evnt, firstColumn);
|
|
1332
|
+
}
|
|
1333
|
+
return nextTick().then(() => {
|
|
1334
|
+
updateRowOffsetTop();
|
|
1335
|
+
$xeTable.updateCellAreas();
|
|
1336
|
+
return updateStyle();
|
|
1337
|
+
});
|
|
1338
|
+
}
|
|
1339
|
+
return nextTick();
|
|
1340
|
+
};
|
|
1294
1341
|
const clearAllSort = () => {
|
|
1295
1342
|
const { tableFullColumn } = internalData;
|
|
1296
1343
|
tableFullColumn.forEach((column) => {
|
|
@@ -3711,7 +3758,7 @@ export default defineComponent({
|
|
|
3711
3758
|
}, fpsTime);
|
|
3712
3759
|
};
|
|
3713
3760
|
const checkLastSyncScroll = (isRollX, isRollY) => {
|
|
3714
|
-
const { scrollXLoad, scrollYLoad } = reactData;
|
|
3761
|
+
const { scrollXLoad, scrollYLoad, isAllOverflow } = reactData;
|
|
3715
3762
|
const { lcsTimeout } = internalData;
|
|
3716
3763
|
if (lcsTimeout) {
|
|
3717
3764
|
clearTimeout(lcsTimeout);
|
|
@@ -3726,13 +3773,19 @@ export default defineComponent({
|
|
|
3726
3773
|
internalData.inBodyScroll = false;
|
|
3727
3774
|
internalData.inFooterScroll = false;
|
|
3728
3775
|
internalData.scrollRenderType = '';
|
|
3729
|
-
|
|
3776
|
+
if (!isAllOverflow) {
|
|
3777
|
+
calcCellHeight();
|
|
3778
|
+
updateRowOffsetTop();
|
|
3779
|
+
}
|
|
3730
3780
|
if (isRollX && scrollXLoad) {
|
|
3731
3781
|
$xeTable.updateScrollXData();
|
|
3732
3782
|
}
|
|
3733
3783
|
if (isRollY && scrollYLoad) {
|
|
3734
3784
|
$xeTable.updateScrollYData().then(() => {
|
|
3735
|
-
|
|
3785
|
+
if (!isAllOverflow) {
|
|
3786
|
+
calcCellHeight();
|
|
3787
|
+
updateRowOffsetTop();
|
|
3788
|
+
}
|
|
3736
3789
|
$xeTable.updateScrollYSpace();
|
|
3737
3790
|
});
|
|
3738
3791
|
}
|
|
@@ -4768,6 +4821,7 @@ export default defineComponent({
|
|
|
4768
4821
|
}
|
|
4769
4822
|
XEUtils.eachTree([targetColumn], (column) => {
|
|
4770
4823
|
column.fixed = fixed;
|
|
4824
|
+
column.renderFixed = fixed;
|
|
4771
4825
|
});
|
|
4772
4826
|
tablePrivateMethods.saveCustomStore('update:fixed');
|
|
4773
4827
|
if (!status) {
|
|
@@ -4792,6 +4846,7 @@ export default defineComponent({
|
|
|
4792
4846
|
if (targetColumn && targetColumn.fixed) {
|
|
4793
4847
|
XEUtils.eachTree([targetColumn], (column) => {
|
|
4794
4848
|
column.fixed = null;
|
|
4849
|
+
column.renderFixed = null;
|
|
4795
4850
|
});
|
|
4796
4851
|
tablePrivateMethods.saveCustomStore('update:fixed');
|
|
4797
4852
|
if (!status) {
|
|
@@ -5575,49 +5630,11 @@ export default defineComponent({
|
|
|
5575
5630
|
return nextTick();
|
|
5576
5631
|
},
|
|
5577
5632
|
setSort(sortConfs, isUpdate) {
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
if (sortConfs && sortConfs.length) {
|
|
5584
|
-
if (!multiple) {
|
|
5585
|
-
sortConfs = [sortConfs[0]];
|
|
5586
|
-
clearAllSort();
|
|
5587
|
-
}
|
|
5588
|
-
let firstColumn = null;
|
|
5589
|
-
sortConfs.forEach((confs, index) => {
|
|
5590
|
-
let { field, order } = confs;
|
|
5591
|
-
let column = field;
|
|
5592
|
-
if (XEUtils.isString(field)) {
|
|
5593
|
-
column = tableMethods.getColumnByField(field);
|
|
5594
|
-
}
|
|
5595
|
-
if (!firstColumn) {
|
|
5596
|
-
firstColumn = column;
|
|
5597
|
-
}
|
|
5598
|
-
if (column && column.sortable) {
|
|
5599
|
-
if (orders && orders.indexOf(order) === -1) {
|
|
5600
|
-
order = getNextSortOrder(column);
|
|
5601
|
-
}
|
|
5602
|
-
if (column.order !== order) {
|
|
5603
|
-
column.order = order;
|
|
5604
|
-
}
|
|
5605
|
-
column.sortTime = Date.now() + index;
|
|
5606
|
-
}
|
|
5607
|
-
});
|
|
5608
|
-
if (isUpdate) {
|
|
5609
|
-
if (!remote) {
|
|
5610
|
-
$xeTable.handleTableData(true);
|
|
5611
|
-
}
|
|
5612
|
-
$xeTable.handleColumnSortEvent(new Event('click'), firstColumn);
|
|
5613
|
-
}
|
|
5614
|
-
return nextTick().then(() => {
|
|
5615
|
-
updateRowOffsetTop();
|
|
5616
|
-
tableMethods.updateCellAreas();
|
|
5617
|
-
return updateStyle();
|
|
5618
|
-
});
|
|
5619
|
-
}
|
|
5620
|
-
return nextTick();
|
|
5633
|
+
// 已废弃,即将去掉事件触发 new Event('click') -> null
|
|
5634
|
+
return handleSortEvent(new Event('click'), sortConfs, isUpdate);
|
|
5635
|
+
},
|
|
5636
|
+
setSortByEvent(evnt, sortConfs, isUpdate) {
|
|
5637
|
+
return handleSortEvent(evnt, sortConfs, isUpdate);
|
|
5621
5638
|
},
|
|
5622
5639
|
/**
|
|
5623
5640
|
* 清空指定列的排序条件
|
|
@@ -5702,6 +5719,16 @@ export default defineComponent({
|
|
|
5702
5719
|
}
|
|
5703
5720
|
return sortList;
|
|
5704
5721
|
},
|
|
5722
|
+
setFilterByEvent(evnt, fieldOrColumn, options, isUpdate) {
|
|
5723
|
+
const column = handleFieldOrColumn($xeTable, fieldOrColumn);
|
|
5724
|
+
if (column && column.filters) {
|
|
5725
|
+
column.filters = toFilters(options || []);
|
|
5726
|
+
if (isUpdate) {
|
|
5727
|
+
return $xeTable.handleColumnConfirmFilter(column, evnt);
|
|
5728
|
+
}
|
|
5729
|
+
}
|
|
5730
|
+
return nextTick();
|
|
5731
|
+
},
|
|
5705
5732
|
/**
|
|
5706
5733
|
* 关闭筛选
|
|
5707
5734
|
* @param {Event} evnt 事件
|
|
@@ -8436,10 +8463,14 @@ export default defineComponent({
|
|
|
8436
8463
|
if (tooltipStore.column !== column || tooltipStore.row !== row || !tooltipStore.visible) {
|
|
8437
8464
|
const ctEl = tdEl.querySelector('.vxe-cell--wrapper');
|
|
8438
8465
|
let ovEl = null;
|
|
8466
|
+
let tipEl = tdEl.querySelector(column.type === 'html' ? '.vxe-cell--html' : '.vxe-cell--label');
|
|
8439
8467
|
if (column.treeNode) {
|
|
8440
8468
|
ovEl = tdEl.querySelector('.vxe-tree-cell');
|
|
8441
8469
|
}
|
|
8442
|
-
|
|
8470
|
+
if (!tipEl) {
|
|
8471
|
+
tipEl = ctEl;
|
|
8472
|
+
}
|
|
8473
|
+
handleTooltip(evnt, tdEl, ovEl || ctEl, tipEl, params);
|
|
8443
8474
|
}
|
|
8444
8475
|
},
|
|
8445
8476
|
/**
|
|
@@ -8451,7 +8482,16 @@ export default defineComponent({
|
|
|
8451
8482
|
const tdEl = evnt.currentTarget;
|
|
8452
8483
|
handleTargetEnterEvent(tooltipStore.column !== column || !!tooltipStore.row);
|
|
8453
8484
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
8454
|
-
|
|
8485
|
+
const ctEl = tdEl.querySelector('.vxe-cell--wrapper');
|
|
8486
|
+
let ovEl = null;
|
|
8487
|
+
let tipEl = tdEl.querySelector(column.type === 'html' ? '.vxe-cell--html' : '.vxe-cell--label');
|
|
8488
|
+
if (column.type === 'html') {
|
|
8489
|
+
ovEl = tdEl.querySelector('.vxe-cell--html');
|
|
8490
|
+
}
|
|
8491
|
+
if (!tipEl) {
|
|
8492
|
+
tipEl = ctEl;
|
|
8493
|
+
}
|
|
8494
|
+
handleTooltip(evnt, tdEl, ovEl || ctEl, tipEl, params);
|
|
8455
8495
|
}
|
|
8456
8496
|
},
|
|
8457
8497
|
handleTargetLeaveEvent() {
|
package/es/table/style.css
CHANGED
|
@@ -2550,6 +2550,12 @@
|
|
|
2550
2550
|
.vxe-table--render-default .vxe-footer--column.col--right > .vxe-cell {
|
|
2551
2551
|
justify-content: right;
|
|
2552
2552
|
}
|
|
2553
|
+
.vxe-table--render-default .vxe-header--column.col--ellipsis.col--center .vxe-cell--wrapper {
|
|
2554
|
+
justify-content: center;
|
|
2555
|
+
}
|
|
2556
|
+
.vxe-table--render-default .vxe-header--column.col--ellipsis.col--right .vxe-cell--wrapper {
|
|
2557
|
+
justify-content: right;
|
|
2558
|
+
}
|
|
2553
2559
|
.vxe-table--render-default .vxe-header--column.col--ellipsis.col--center .vxe-cell,
|
|
2554
2560
|
.vxe-table--render-default .vxe-footer--column.col--ellipsis.col--center .vxe-cell {
|
|
2555
2561
|
justify-content: center;
|