vxe-table 4.23.3 → 4.23.5
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/dist/all.esm.js +76 -33
- package/dist/style.css +1 -1
- package/dist/style.min.css +1 -1
- 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/edit/hook.js +2 -2
- package/es/table/src/table.js +72 -29
- package/es/table/style.css +30 -11
- 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 +30 -11
- 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 +25 -21
- 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/edit/hook.js +2 -2
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/src/table.js +21 -17
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +30 -11
- 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 +30 -11
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/table/module/edit/hook.ts +2 -2
- package/packages/table/src/table.ts +78 -32
- package/styles/components/table-module/filter.scss +26 -13
- package/styles/components/table.scss +6 -0
- package/styles/theme/base.scss +1 -0
- /package/es/{iconfont.1792723098707.ttf → iconfont.1792838769925.ttf} +0 -0
- /package/es/{iconfont.1792723098707.woff → iconfont.1792838769925.woff} +0 -0
- /package/es/{iconfont.1792723098707.woff2 → iconfont.1792838769925.woff2} +0 -0
- /package/lib/{iconfont.1792723098707.ttf → iconfont.1792838769925.ttf} +0 -0
- /package/lib/{iconfont.1792723098707.woff → iconfont.1792838769925.woff} +0 -0
- /package/lib/{iconfont.1792723098707.woff2 → iconfont.1792838769925.woff2} +0 -0
package/dist/all.esm.js
CHANGED
|
@@ -56,7 +56,7 @@ function getDefaultConfig(val1, def1) {
|
|
|
56
56
|
return XEUtils.eqNull(val1) ? def1 : val1;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
const version = "4.23.
|
|
59
|
+
const version = "4.23.5";
|
|
60
60
|
VxeUI.version = version;
|
|
61
61
|
VxeUI.tableVersion = version;
|
|
62
62
|
VxeUI.setConfig({
|
|
@@ -952,7 +952,7 @@ function getPopupAppendElement(appendTo) {
|
|
|
952
952
|
}
|
|
953
953
|
|
|
954
954
|
const { log } = VxeUI;
|
|
955
|
-
const tableVersion = `table v${"4.23.
|
|
955
|
+
const tableVersion = `table v${"4.23.5"}`;
|
|
956
956
|
function createComponentLog(name) {
|
|
957
957
|
const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
|
|
958
958
|
const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
|
|
@@ -10075,7 +10075,7 @@ hooks$5.add('tableEditModule', {
|
|
|
10075
10075
|
}
|
|
10076
10076
|
reactData.removeRowFlag++;
|
|
10077
10077
|
reactData.insertRowFlag++;
|
|
10078
|
-
$xeTable.cacheRowMap(false);
|
|
10078
|
+
$xeTable.cacheRowMap(false, false);
|
|
10079
10079
|
$xeTable.updateScrollYStatus();
|
|
10080
10080
|
$xeTable.handleTableData(treeConfig && transform);
|
|
10081
10081
|
if (!(treeConfig && transform)) {
|
|
@@ -10442,7 +10442,7 @@ hooks$5.add('tableEditModule', {
|
|
|
10442
10442
|
reactData.removeRowFlag++;
|
|
10443
10443
|
reactData.insertRowFlag++;
|
|
10444
10444
|
reactData.pendingRowFlag++;
|
|
10445
|
-
$xeTable.cacheRowMap(false);
|
|
10445
|
+
$xeTable.cacheRowMap(false, false);
|
|
10446
10446
|
$xeTable.handleTableData(treeConfig && transform);
|
|
10447
10447
|
$xeTable.updateFooter();
|
|
10448
10448
|
$xeTable.handleUpdateBodyMerge();
|
|
@@ -16974,7 +16974,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
16974
16974
|
};
|
|
16975
16975
|
const calcVarRowHeightConfig = (sizeKey, sizeEl) => {
|
|
16976
16976
|
const { rowHeightStore } = reactData;
|
|
16977
|
-
if (sizeEl && sizeEl.clientHeight) {
|
|
16977
|
+
if (sizeKey && sizeEl && sizeEl.clientHeight) {
|
|
16978
16978
|
rowHeightStore[sizeKey] = sizeEl.clientHeight;
|
|
16979
16979
|
}
|
|
16980
16980
|
};
|
|
@@ -17608,7 +17608,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
17608
17608
|
internalData.tableFullGroupData = groupRest.treeData;
|
|
17609
17609
|
reactData.isRowGroupStatus = true;
|
|
17610
17610
|
reactData.rowGroupList = aggGroupConfs;
|
|
17611
|
-
$xeTable.cacheRowMap(false);
|
|
17611
|
+
$xeTable.cacheRowMap(false, false);
|
|
17612
17612
|
}
|
|
17613
17613
|
// 如果自定义了顺序
|
|
17614
17614
|
if (isCustomSort && sortData) {
|
|
@@ -19137,7 +19137,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
19137
19137
|
}
|
|
19138
19138
|
}
|
|
19139
19139
|
};
|
|
19140
|
-
const handleAsyncTreeExpandChilds = (row) => {
|
|
19140
|
+
const handleAsyncTreeExpandChilds = (row, autoExpand) => {
|
|
19141
19141
|
const treeOpts = computeTreeOpts.value;
|
|
19142
19142
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
19143
19143
|
const { transform, loadMethod } = treeOpts;
|
|
@@ -19161,7 +19161,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
19161
19161
|
if (childRecords) {
|
|
19162
19162
|
return $xeTable.loadTreeChildren(row, childRecords).then(childRows => {
|
|
19163
19163
|
const { treeExpandedMaps } = internalData;
|
|
19164
|
-
if (childRows.length && !treeExpandedMaps[rowid]) {
|
|
19164
|
+
if (autoExpand && childRows.length && !treeExpandedMaps[rowid]) {
|
|
19165
19165
|
treeExpandedMaps[rowid] = row;
|
|
19166
19166
|
}
|
|
19167
19167
|
reactData.treeExpandedFlag++;
|
|
@@ -19380,7 +19380,9 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
19380
19380
|
}
|
|
19381
19381
|
const varEl = refVarElem.value;
|
|
19382
19382
|
if (varEl) {
|
|
19383
|
-
const [defEl, mediumEl, smallEl, miniEl] = varEl.children;
|
|
19383
|
+
const [dxlargeEl, largeEl, defEl, mediumEl, smallEl, miniEl] = varEl.children;
|
|
19384
|
+
calcVarRowHeightConfig('xlarge', dxlargeEl);
|
|
19385
|
+
calcVarRowHeightConfig('large', largeEl);
|
|
19384
19386
|
calcVarRowHeightConfig('default', defEl);
|
|
19385
19387
|
calcVarRowHeightConfig('medium', mediumEl);
|
|
19386
19388
|
calcVarRowHeightConfig('small', smallEl);
|
|
@@ -19867,7 +19869,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
19867
19869
|
internalData.tableFullTreeData = isRGroup ? [] : treeData;
|
|
19868
19870
|
internalData.tableFullGroupData = isRGroup ? treeData : [];
|
|
19869
19871
|
// 缓存数据
|
|
19870
|
-
$xeTable.cacheRowMap(isReset);
|
|
19872
|
+
$xeTable.cacheRowMap(isReset, true);
|
|
19871
19873
|
// 原始数据
|
|
19872
19874
|
internalData.tableSynchData = datas;
|
|
19873
19875
|
if (isReset) {
|
|
@@ -20338,7 +20340,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
20338
20340
|
const isLoad = lazy && row[hasChildField] && !rowRest.treeLoaded && !treeExpandLazyLoadedMaps[rowid];
|
|
20339
20341
|
// 是否使用懒加载
|
|
20340
20342
|
if (isLoad) {
|
|
20341
|
-
result.push(handleAsyncTreeExpandChilds(row));
|
|
20343
|
+
result.push(handleAsyncTreeExpandChilds(row, true));
|
|
20342
20344
|
}
|
|
20343
20345
|
else {
|
|
20344
20346
|
if (row[childrenField] && row[childrenField].length) {
|
|
@@ -21329,7 +21331,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
21329
21331
|
if (reDelFlag) {
|
|
21330
21332
|
reactData.removeRowFlag++;
|
|
21331
21333
|
$xeTable.updateFooter();
|
|
21332
|
-
$xeTable.cacheRowMap(false);
|
|
21334
|
+
$xeTable.cacheRowMap(false, true);
|
|
21333
21335
|
$xeTable.handleTableData(treeConfig && transform);
|
|
21334
21336
|
if (!(treeConfig && transform)) {
|
|
21335
21337
|
$xeTable.updateAfterDataIndex();
|
|
@@ -23567,7 +23569,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
23567
23569
|
* 重新懒加载树节点,并展开该节点
|
|
23568
23570
|
* @param {Row} row 行对象
|
|
23569
23571
|
*/
|
|
23570
|
-
reloadTreeExpand(row) {
|
|
23572
|
+
reloadTreeExpand(row, autoExpand = true) {
|
|
23571
23573
|
const { treeExpandLazyLoadedMaps } = internalData;
|
|
23572
23574
|
const treeOpts = computeTreeOpts.value;
|
|
23573
23575
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
@@ -23575,7 +23577,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
23575
23577
|
const rowid = getRowid($xeTable, row);
|
|
23576
23578
|
if (lazy && row[hasChildField] && !treeExpandLazyLoadedMaps[rowid]) {
|
|
23577
23579
|
return $xeTable.clearTreeExpandLoaded(row).then(() => {
|
|
23578
|
-
return handleAsyncTreeExpandChilds(row);
|
|
23580
|
+
return handleAsyncTreeExpandChilds(row, autoExpand);
|
|
23579
23581
|
}).then(() => {
|
|
23580
23582
|
if (transform) {
|
|
23581
23583
|
handleVirtualTreeToList();
|
|
@@ -25465,7 +25467,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
25465
25467
|
internalData.insertRowMaps = iRowMaps;
|
|
25466
25468
|
internalData.removeRowMaps = rRowMaps;
|
|
25467
25469
|
internalData.afterFullData = afterFullList;
|
|
25468
|
-
$xeTable.cacheRowMap(false);
|
|
25470
|
+
$xeTable.cacheRowMap(false, false);
|
|
25469
25471
|
$xeTable.handleTableData(treeConfig && transform);
|
|
25470
25472
|
$xeTable.updateFooter();
|
|
25471
25473
|
$xeTable.handleUpdateBodyMerge();
|
|
@@ -25693,7 +25695,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
25693
25695
|
/**
|
|
25694
25696
|
* 更新数据行的 Map
|
|
25695
25697
|
*/
|
|
25696
|
-
cacheRowMap(isReset) {
|
|
25698
|
+
cacheRowMap(isReset, isReLoaded) {
|
|
25697
25699
|
const { treeConfig } = props;
|
|
25698
25700
|
const { isRowGroupStatus } = reactData;
|
|
25699
25701
|
const { currKeyField, fullAllDataRowIdData, tableFullData, tableFullTreeData, tableFullGroupData, treeExpandedMaps, rowExpandedMaps, selectCheckboxMaps } = internalData;
|
|
@@ -25712,8 +25714,10 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
25712
25714
|
fullDataRowIdMaps[rowid] = rowRest;
|
|
25713
25715
|
fullAllDataRowIdMaps[rowid] = rowRest;
|
|
25714
25716
|
}
|
|
25715
|
-
|
|
25716
|
-
|
|
25717
|
+
if (isReset || isReLoaded) {
|
|
25718
|
+
rowRest.treeLoaded = false;
|
|
25719
|
+
rowRest.expandLoaded = false;
|
|
25720
|
+
}
|
|
25717
25721
|
rowRest._seq = rowNum++;
|
|
25718
25722
|
rowRest.row = row;
|
|
25719
25723
|
rowRest.items = items;
|
|
@@ -27747,7 +27751,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
27747
27751
|
}
|
|
27748
27752
|
$xeTable.handleClearStack();
|
|
27749
27753
|
$xeTable.handleTableData(treeConfig && transform);
|
|
27750
|
-
$xeTable.cacheRowMap(false);
|
|
27754
|
+
$xeTable.cacheRowMap(false, false);
|
|
27751
27755
|
updateScrollYStatus();
|
|
27752
27756
|
if (!(treeConfig && transform)) {
|
|
27753
27757
|
$xeTable.updateAfterDataIndex();
|
|
@@ -28104,31 +28108,62 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
28104
28108
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
28105
28109
|
const { prevDragRow, prevDragPos } = internalData;
|
|
28106
28110
|
const rowDragOpts = computeRowDragOpts.value;
|
|
28107
|
-
const { isCrossTableDrag } = rowDragOpts;
|
|
28111
|
+
const { isCrossDrag, isCrossTableDrag, isAutoExpandToChild, isAutoLazyLoadToChild } = rowDragOpts;
|
|
28112
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
28108
28113
|
// 跨表拖拽
|
|
28109
|
-
if (isCrossTableDrag && crossTableDragRowObj) {
|
|
28114
|
+
if (isCrossTableDrag && (!treeConfig || isCrossDrag) && crossTableDragRowObj) {
|
|
28110
28115
|
const { $newTable } = crossTableDragRowObj;
|
|
28111
28116
|
if ($newTable && $newTable.xID !== $xeTable.xID) {
|
|
28112
28117
|
$newTable.handleCrossTableRowDragInsertEvent(evnt);
|
|
28113
28118
|
return;
|
|
28114
28119
|
}
|
|
28115
28120
|
}
|
|
28116
|
-
if (treeConfig &&
|
|
28121
|
+
if (treeConfig && prevDragToChild) {
|
|
28117
28122
|
// 懒加载
|
|
28118
|
-
const
|
|
28119
|
-
const rowRest = fullAllDataRowIdData[
|
|
28120
|
-
if (
|
|
28121
|
-
|
|
28123
|
+
const prevRowid = getRowid($xeTable, prevDragRow);
|
|
28124
|
+
const rowRest = fullAllDataRowIdData[prevRowid];
|
|
28125
|
+
if (!rowRest) {
|
|
28126
|
+
handleRowDragEndClearStatus();
|
|
28127
|
+
return;
|
|
28128
|
+
}
|
|
28129
|
+
const hasLazyChilds = prevDragRow[hasChildField];
|
|
28130
|
+
const rowChilds = prevDragRow[childrenField];
|
|
28131
|
+
// 如果懒加载节点未被加载
|
|
28132
|
+
if (isAutoExpandToChild) {
|
|
28133
|
+
// 判断目标节点是否有树子级
|
|
28134
|
+
if ((lazy && hasLazyChilds) || (rowChilds && rowChilds.length)) {
|
|
28135
|
+
hideDropTip();
|
|
28136
|
+
$xeTable.setTreeExpand(prevDragRow, true).then(() => {
|
|
28137
|
+
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
28138
|
+
});
|
|
28139
|
+
return;
|
|
28140
|
+
}
|
|
28141
|
+
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild).then(() => {
|
|
28142
|
+
if (!$xeTable.isTreeExpandByRow(prevDragRow)) {
|
|
28143
|
+
$xeTable.setTreeExpand(prevDragRow, true);
|
|
28144
|
+
}
|
|
28145
|
+
});
|
|
28146
|
+
return;
|
|
28147
|
+
}
|
|
28148
|
+
// 如果是懒加载节点。只加载不自动展开
|
|
28149
|
+
if ((lazy && hasLazyChilds) && isAutoLazyLoadToChild) {
|
|
28150
|
+
if (rowChilds && rowChilds.length) {
|
|
28122
28151
|
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
28152
|
+
return;
|
|
28123
28153
|
}
|
|
28154
|
+
hideDropTip();
|
|
28155
|
+
$xeTable.reloadTreeExpand(prevDragRow, false).then(() => {
|
|
28156
|
+
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
28157
|
+
});
|
|
28158
|
+
return;
|
|
28124
28159
|
}
|
|
28125
|
-
|
|
28126
|
-
|
|
28160
|
+
// 懒加载的行默认需要先展开过后才允许拖拽,除非启用 isAutoExpandToChild | isAutoLazyLoadToChild
|
|
28161
|
+
if (lazy && hasLazyChilds && !rowRest.treeLoaded) {
|
|
28162
|
+
handleRowDragEndClearStatus();
|
|
28163
|
+
return;
|
|
28127
28164
|
}
|
|
28128
28165
|
}
|
|
28129
|
-
|
|
28130
|
-
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
28131
|
-
}
|
|
28166
|
+
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
28132
28167
|
},
|
|
28133
28168
|
handleRowDragDragoverEvent(evnt) {
|
|
28134
28169
|
const { treeConfig } = props;
|
|
@@ -28138,7 +28173,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
28138
28173
|
const { lazy, transform, parentField } = treeOpts;
|
|
28139
28174
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
28140
28175
|
const rowDragOpts = computeRowDragOpts.value;
|
|
28141
|
-
const { isPeerDrag, isCrossDrag, isToChildDrag, isCrossTableDrag } = rowDragOpts;
|
|
28176
|
+
const { isPeerDrag, isCrossDrag, isToChildDrag, isCrossTableDrag, isAutoLazyLoadToChild, isAutoExpandToChild } = rowDragOpts;
|
|
28142
28177
|
if (!dragRow && !(isCrossTableDrag && (!treeConfig || isCrossDrag) && crossTableDragRowObj)) {
|
|
28143
28178
|
evnt.preventDefault();
|
|
28144
28179
|
return;
|
|
@@ -28182,7 +28217,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
28182
28217
|
}
|
|
28183
28218
|
}
|
|
28184
28219
|
if ($xeTable.eqRow(dragRow, row) ||
|
|
28185
|
-
(isControlKey && treeConfig && lazy && row[hasChildField] && rowRest && !rowRest.treeLoaded) ||
|
|
28220
|
+
(isControlKey && treeConfig && lazy && row[hasChildField] && (rowRest && !rowRest.treeLoaded) && !isAutoLazyLoadToChild && !isAutoExpandToChild) ||
|
|
28186
28221
|
(!isCrossDrag && treeConfig && transform && (isPeerDrag ? dragRow[parentField] !== row[parentField] : rowRest.level))) {
|
|
28187
28222
|
showDropTip(evnt, trEl, null, false, dragPos);
|
|
28188
28223
|
return;
|
|
@@ -30125,12 +30160,20 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
30125
30160
|
* 隐藏列
|
|
30126
30161
|
*/
|
|
30127
30162
|
h('div', {
|
|
30163
|
+
key: 'tss',
|
|
30128
30164
|
class: 'vxe-table-slots'
|
|
30129
30165
|
}, slots.default ? slots.default({}) : []),
|
|
30130
30166
|
h('div', {
|
|
30167
|
+
key: 'tvr',
|
|
30131
30168
|
ref: refVarElem,
|
|
30132
30169
|
class: 'vxe-table-vars'
|
|
30133
30170
|
}, [
|
|
30171
|
+
h('div', {
|
|
30172
|
+
class: 'vxe-table-var-xlarge'
|
|
30173
|
+
}),
|
|
30174
|
+
h('div', {
|
|
30175
|
+
class: 'vxe-table-var-large'
|
|
30176
|
+
}),
|
|
30134
30177
|
h('div', {
|
|
30135
30178
|
class: 'vxe-table-var-default'
|
|
30136
30179
|
}),
|