vxe-table 3.17.0-beta.9 → 3.17.0
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/grid/src/grid.js +88 -23
- package/es/style.css +1 -1
- package/es/table/module/custom/mixin.js +22 -14
- package/es/table/module/edit/mixin.js +5 -5
- package/es/table/src/body.js +7 -6
- package/es/table/src/columnInfo.js +5 -0
- package/es/table/src/methods.js +201 -76
- package/es/table/src/table.js +7 -6
- package/es/table/src/util.js +9 -0
- package/es/ui/index.js +2 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +104 -29
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +402 -127
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/custom/mixin.js +25 -13
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/edit/mixin.js +5 -0
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/src/body.js +7 -6
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/columnInfo.js +5 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/methods.js +238 -73
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +7 -6
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +10 -0
- package/lib/table/src/util.min.js +1 -1
- package/lib/ui/index.js +2 -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/package.json +2 -2
- package/packages/grid/src/grid.ts +101 -25
- package/packages/table/module/custom/mixin.ts +21 -13
- package/packages/table/module/edit/mixin.ts +5 -5
- package/packages/table/src/body.ts +7 -6
- package/packages/table/src/columnInfo.ts +7 -0
- package/packages/table/src/methods.ts +215 -76
- package/packages/table/src/props.ts +1 -1
- package/packages/table/src/table.ts +7 -6
- package/packages/table/src/util.ts +10 -0
- package/packages/ui/index.ts +1 -0
- /package/es/{iconfont.1753497303145.ttf → iconfont.1753928711953.ttf} +0 -0
- /package/es/{iconfont.1753497303145.woff → iconfont.1753928711953.woff} +0 -0
- /package/es/{iconfont.1753497303145.woff2 → iconfont.1753928711953.woff2} +0 -0
- /package/lib/{iconfont.1753497303145.ttf → iconfont.1753928711953.ttf} +0 -0
- /package/lib/{iconfont.1753497303145.woff → iconfont.1753928711953.woff} +0 -0
- /package/lib/{iconfont.1753497303145.woff2 → iconfont.1753928711953.woff2} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils';
|
|
2
|
+
import { getColumnList } from '../../src/util';
|
|
2
3
|
function calcMaxHeight($xeTable) {
|
|
3
4
|
const reactData = $xeTable;
|
|
4
5
|
const { customStore } = reactData;
|
|
@@ -86,23 +87,22 @@ export default {
|
|
|
86
87
|
}
|
|
87
88
|
});
|
|
88
89
|
reactData.isCustomStatus = true;
|
|
89
|
-
|
|
90
|
-
if (
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
$xeTable.setRowGroups(aggHandleFields);
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
$xeTable.clearRowGroups();
|
|
98
|
-
}
|
|
90
|
+
if (allowGroup && allowValues && !!$xeTable.handlePivotTableAggregateData) {
|
|
91
|
+
if (rowGroupList.length !== aggHandleFields.length || rowGroupList.some((conf, i) => conf.field !== aggHandleFields[i])) {
|
|
92
|
+
// 更新数据分组
|
|
93
|
+
if (aggHandleFields.length) {
|
|
94
|
+
$xeTable.setRowGroups(aggHandleFields);
|
|
99
95
|
}
|
|
100
96
|
else {
|
|
101
|
-
|
|
102
|
-
$xeTable.handleUpdateAggData();
|
|
97
|
+
$xeTable.clearRowGroups();
|
|
103
98
|
}
|
|
104
99
|
}
|
|
105
|
-
|
|
100
|
+
else if (allowValues) {
|
|
101
|
+
// 更新聚合函数
|
|
102
|
+
$xeTable.handleUpdateAggData();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return $xeTable.saveCustomStore('confirm');
|
|
106
106
|
},
|
|
107
107
|
_cancelCustom() {
|
|
108
108
|
const $xeTable = this;
|
|
@@ -147,6 +147,7 @@ export default {
|
|
|
147
147
|
sort: options === true,
|
|
148
148
|
aggFunc: options === true
|
|
149
149
|
}, options);
|
|
150
|
+
const allCols = [];
|
|
150
151
|
XEUtils.eachTree(collectColumn, (column) => {
|
|
151
152
|
if (opts.resizable) {
|
|
152
153
|
column.resizeWidth = 0;
|
|
@@ -156,6 +157,7 @@ export default {
|
|
|
156
157
|
}
|
|
157
158
|
if (opts.sort) {
|
|
158
159
|
column.renderSortNumber = column.sortNumber;
|
|
160
|
+
column.parentId = column.defaultParentId;
|
|
159
161
|
}
|
|
160
162
|
if (!checkMethod || checkMethod({ $table: $xeTable, column })) {
|
|
161
163
|
column.visible = column.defaultVisible;
|
|
@@ -165,9 +167,14 @@ export default {
|
|
|
165
167
|
column.renderAggFn = column.defaultAggFunc;
|
|
166
168
|
}
|
|
167
169
|
column.renderResizeWidth = column.renderWidth;
|
|
170
|
+
allCols.push(column);
|
|
168
171
|
});
|
|
172
|
+
if (opts.sort) {
|
|
173
|
+
const newCollectCols = XEUtils.toArrayTree(XEUtils.orderBy(allCols, 'renderSortNumber'), { key: 'id', parentKey: 'parentId', children: 'children' });
|
|
174
|
+
internalData.collectColumn = newCollectCols;
|
|
175
|
+
internalData.tableFullColumn = getColumnList(newCollectCols);
|
|
176
|
+
}
|
|
169
177
|
reactData.isCustomStatus = false;
|
|
170
|
-
$xeTable.saveCustomStore('reset');
|
|
171
178
|
return $xeTable.handleCustom().then(() => {
|
|
172
179
|
if (opts.aggFunc && $xeTable.handlePivotTableAggregateData) {
|
|
173
180
|
const rowGroupFields = $xeTable.computeRowGroupFields;
|
|
@@ -183,6 +190,7 @@ export default {
|
|
|
183
190
|
$xeTable.handleUpdateAggData();
|
|
184
191
|
}
|
|
185
192
|
}
|
|
193
|
+
$xeTable.saveCustomStore('reset');
|
|
186
194
|
});
|
|
187
195
|
},
|
|
188
196
|
_toggleCustomAllCheckbox() {
|
|
@@ -70,7 +70,7 @@ function insertTreeRow($xeTable, newRecords, isAppend) {
|
|
|
70
70
|
}
|
|
71
71
|
parentChilds[funcName](item);
|
|
72
72
|
mapChilds[funcName](item);
|
|
73
|
-
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, items: parentChilds, parent: parentRow, level: parentLevel + 1, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
|
|
73
|
+
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, _tIndex: -1, items: parentChilds, parent: parentRow, level: parentLevel + 1, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
|
|
74
74
|
fullDataRowIdData[rowid] = rest;
|
|
75
75
|
fullAllDataRowIdData[rowid] = rest;
|
|
76
76
|
}
|
|
@@ -80,7 +80,7 @@ function insertTreeRow($xeTable, newRecords, isAppend) {
|
|
|
80
80
|
}
|
|
81
81
|
afterFullData[funcName](item);
|
|
82
82
|
tableFullTreeData[funcName](item);
|
|
83
|
-
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, items: tableFullTreeData, parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
|
|
83
|
+
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, _tIndex: -1, items: tableFullTreeData, parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
|
|
84
84
|
fullDataRowIdData[rowid] = rest;
|
|
85
85
|
fullAllDataRowIdData[rowid] = rest;
|
|
86
86
|
}
|
|
@@ -118,7 +118,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
118
118
|
else {
|
|
119
119
|
newRecords.forEach(item => {
|
|
120
120
|
const rowid = getRowid($xeTable, item);
|
|
121
|
-
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, items: afterFullData, parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
|
|
121
|
+
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, _tIndex: -1, items: afterFullData, parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
|
|
122
122
|
fullDataRowIdData[rowid] = rest;
|
|
123
123
|
fullAllDataRowIdData[rowid] = rest;
|
|
124
124
|
afterFullData.unshift(item);
|
|
@@ -150,7 +150,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
150
150
|
else {
|
|
151
151
|
newRecords.forEach(item => {
|
|
152
152
|
const rowid = getRowid($xeTable, item);
|
|
153
|
-
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, items: afterFullData, parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
|
|
153
|
+
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, _tIndex: -1, items: afterFullData, parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
|
|
154
154
|
fullDataRowIdData[rowid] = rest;
|
|
155
155
|
fullAllDataRowIdData[rowid] = rest;
|
|
156
156
|
afterFullData.push(item);
|
|
@@ -182,7 +182,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
182
182
|
targetIndex = targetIndex + 1;
|
|
183
183
|
}
|
|
184
184
|
parentMapChilds.splice(targetIndex, 0, item);
|
|
185
|
-
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, items: parentMapChilds, parent: parentRow, level: parentLevel + 1, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
|
|
185
|
+
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, _tIndex: -1, items: parentMapChilds, parent: parentRow, level: parentLevel + 1, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
|
|
186
186
|
fullDataRowIdData[rowid] = rest;
|
|
187
187
|
fullAllDataRowIdData[rowid] = rest;
|
|
188
188
|
});
|
package/es/table/src/body.js
CHANGED
|
@@ -239,7 +239,7 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
|
|
|
239
239
|
if (!fixedHiddenColumn && editConfig && (editRender || cellRender) && (editOpts.showStatus || editOpts.showUpdateStatus)) {
|
|
240
240
|
isDirty = $xeTable.isUpdateByRow(row, column.field);
|
|
241
241
|
}
|
|
242
|
-
const isVNAutoHeight =
|
|
242
|
+
const isVNAutoHeight = !hasEllipsis && (scrollYLoad || scrollXLoad);
|
|
243
243
|
let cellHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight);
|
|
244
244
|
const isLastColumn = $columnIndex === columns.length - 1;
|
|
245
245
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
@@ -276,7 +276,7 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
|
|
|
276
276
|
}
|
|
277
277
|
tcStyle.width = `${column.renderWidth + mergeColWidth - cellOffsetWidth}px`;
|
|
278
278
|
}
|
|
279
|
-
if (scrollYLoad || hasEllipsis || isCsHeight || isRsHeight) {
|
|
279
|
+
if (scrollYLoad || scrollXLoad || hasEllipsis || isCsHeight || isRsHeight) {
|
|
280
280
|
tcStyle.height = `${cellHeight}px`;
|
|
281
281
|
}
|
|
282
282
|
else {
|
|
@@ -456,15 +456,16 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
456
456
|
};
|
|
457
457
|
}
|
|
458
458
|
if (rowRest) {
|
|
459
|
+
rowIndex = rowRest.index;
|
|
460
|
+
_rowIndex = rowRest._index;
|
|
459
461
|
rowLevel = rowRest.level;
|
|
462
|
+
seq = rowRest.seq;
|
|
460
463
|
if (hasRowGroupAggregate || (treeConfig && transform && seqMode === 'increasing')) {
|
|
461
464
|
seq = rowRest._index + 1;
|
|
462
465
|
}
|
|
463
|
-
else {
|
|
464
|
-
seq = rowRest.
|
|
466
|
+
else if ((treeConfig && seqMode === 'fixed')) {
|
|
467
|
+
seq = rowRest._tIndex + 1;
|
|
465
468
|
}
|
|
466
|
-
rowIndex = rowRest.index;
|
|
467
|
-
_rowIndex = rowRest._index;
|
|
468
469
|
}
|
|
469
470
|
const params = { $table: $xeTable, seq, rowid, fixed: fixedType, type: renderType, level: rowLevel, row, rowIndex, $rowIndex, _rowIndex };
|
|
470
471
|
// 行是否被展开
|
|
@@ -119,15 +119,20 @@ export class ColumnInfo {
|
|
|
119
119
|
parentId: null,
|
|
120
120
|
visible,
|
|
121
121
|
// 内部属性(一旦被使用,将导致不可升级版本)
|
|
122
|
+
defaultParentId: null,
|
|
122
123
|
halfVisible: false,
|
|
123
124
|
defaultVisible: visible,
|
|
124
125
|
defaultFixed: _vm.fixed,
|
|
126
|
+
defaultAggGroup: _vm.aggGroup,
|
|
125
127
|
defaultAggFunc: _vm.aggFunc,
|
|
126
128
|
checked: false,
|
|
127
129
|
halfChecked: false,
|
|
128
130
|
disabled: false,
|
|
131
|
+
// 分组层级
|
|
129
132
|
level: 1,
|
|
133
|
+
// 跨行
|
|
130
134
|
rowSpan: 1,
|
|
135
|
+
// 跨列
|
|
131
136
|
colSpan: 1,
|
|
132
137
|
// 数据排序
|
|
133
138
|
order: null,
|