vxe-table 3.21.17 → 3.21.19
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/custom/panel.js +5 -2
- package/es/table/module/edit/mixin.js +16 -4
- package/es/table/src/columnInfo.js +6 -6
- package/es/table/src/footer.js +5 -5
- package/es/table/src/header.js +10 -8
- package/es/table/src/methods.js +67 -15
- package/es/table/src/table.js +1 -2
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +4 -3
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +1003 -972
- 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/custom/panel.js +5 -2
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/mixin.js +18 -4
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/src/columnInfo.js +6 -0
- package/lib/table/src/footer.js +5 -4
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +12 -8
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +6 -4
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +1 -1
- package/lib/table/src/table.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +4 -3
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +3 -3
- package/packages/table/module/custom/panel.ts +5 -2
- package/packages/table/module/edit/mixin.ts +15 -4
- package/packages/table/src/footer.ts +5 -5
- package/packages/table/src/header.ts +10 -8
- package/packages/table/src/methods.ts +64 -15
- package/packages/table/src/table.ts +1 -2
- package/packages/table/src/util.ts +2 -16
- package/packages/ui/src/log.ts +3 -2
- package/styles/theme/dark.scss +1 -1
- package/styles/variable.scss +1 -1
- /package/es/{iconfont.1781876872867.ttf → iconfont.1782286848090.ttf} +0 -0
- /package/es/{iconfont.1781876872867.woff → iconfont.1782286848090.woff} +0 -0
- /package/es/{iconfont.1781876872867.woff2 → iconfont.1782286848090.woff2} +0 -0
- /package/lib/{iconfont.1781876872867.ttf → iconfont.1782286848090.ttf} +0 -0
- /package/lib/{iconfont.1781876872867.woff → iconfont.1782286848090.woff} +0 -0
- /package/lib/{iconfont.1781876872867.woff2 → iconfont.1782286848090.woff2} +0 -0
|
@@ -1188,8 +1188,11 @@ export default {
|
|
|
1188
1188
|
const resizeParams = {
|
|
1189
1189
|
$table: $xeTable,
|
|
1190
1190
|
column,
|
|
1191
|
-
columnIndex:
|
|
1192
|
-
$columnIndex:
|
|
1191
|
+
columnIndex: $xeTable.getColumnIndex(column),
|
|
1192
|
+
$columnIndex: $xeTable.getVMColumnIndex(column),
|
|
1193
|
+
_columnIndex: $xeTable.getVTColumnIndex(column),
|
|
1194
|
+
rowIndex: -1,
|
|
1195
|
+
_rowIndex: -1,
|
|
1193
1196
|
$rowIndex: -1
|
|
1194
1197
|
};
|
|
1195
1198
|
if (reMinWidth) {
|
|
@@ -780,16 +780,28 @@ export default {
|
|
|
780
780
|
const props = $xeTable;
|
|
781
781
|
const internalData = $xeTable;
|
|
782
782
|
const { keepSource, treeConfig } = props;
|
|
783
|
-
const { tableFullData } = internalData;
|
|
783
|
+
const { tableFullData, tableFullTreeData } = internalData;
|
|
784
784
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
785
|
+
const updateRecords = [];
|
|
785
786
|
if (keepSource) {
|
|
786
787
|
syncActivedCell($xeTable);
|
|
787
788
|
if (treeConfig) {
|
|
788
|
-
|
|
789
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
790
|
+
XEUtils.eachTree(tableFullTreeData, row => {
|
|
791
|
+
if ($xeTable.isUpdateByRow(row)) {
|
|
792
|
+
updateRecords.push(row);
|
|
793
|
+
}
|
|
794
|
+
}, { children: childrenField });
|
|
795
|
+
}
|
|
796
|
+
else {
|
|
797
|
+
tableFullData.forEach((row) => {
|
|
798
|
+
if ($xeTable.isUpdateByRow(row)) {
|
|
799
|
+
updateRecords.push(row);
|
|
800
|
+
}
|
|
801
|
+
});
|
|
789
802
|
}
|
|
790
|
-
return tableFullData.filter((row) => $xeTable.isUpdateByRow(row));
|
|
791
803
|
}
|
|
792
|
-
return
|
|
804
|
+
return updateRecords;
|
|
793
805
|
},
|
|
794
806
|
/**
|
|
795
807
|
* 处理激活编辑
|
|
@@ -152,11 +152,11 @@ export class ColumnInfo {
|
|
|
152
152
|
// 跨列
|
|
153
153
|
colSpan: 1,
|
|
154
154
|
// 数据排序
|
|
155
|
-
order: null,
|
|
156
|
-
sortTime: 0,
|
|
155
|
+
order: null, // 用于记录排序类型,升序和倒序
|
|
156
|
+
sortTime: 0, // 用于多列的先后顺序
|
|
157
157
|
// 列排序
|
|
158
|
-
sortNumber: 0,
|
|
159
|
-
renderSortNumber: 0,
|
|
158
|
+
sortNumber: 0, // 用于记录自定义列顺序
|
|
159
|
+
renderSortNumber: 0, // 用于记录自定义列顺序
|
|
160
160
|
renderAggFn: '',
|
|
161
161
|
renderAggDigits: null,
|
|
162
162
|
renderAggFormat: null,
|
|
@@ -166,9 +166,9 @@ export class ColumnInfo {
|
|
|
166
166
|
renderHeight: 0,
|
|
167
167
|
renderResizeWidth: 0,
|
|
168
168
|
renderAutoWidth: 0,
|
|
169
|
-
resizeWidth: 0,
|
|
169
|
+
resizeWidth: 0, // 手动调整
|
|
170
170
|
renderLeft: 0,
|
|
171
|
-
renderArgs: [],
|
|
171
|
+
renderArgs: [], // 渲染参数可用于扩展
|
|
172
172
|
model: {},
|
|
173
173
|
renderHeader: renderHeader || colConfs.renderHeader,
|
|
174
174
|
renderCell: renderCell || colConfs.renderCell,
|
package/es/table/src/footer.js
CHANGED
|
@@ -194,17 +194,17 @@ function renderHeads(h, _vm, isOptimizeMode, renderColumnList) {
|
|
|
194
194
|
const tableProps = $xeTable;
|
|
195
195
|
const { fixedType, footerTableData } = props;
|
|
196
196
|
const { footerRowClassName, footerRowStyle } = tableProps;
|
|
197
|
-
return footerTableData.map((row,
|
|
198
|
-
const
|
|
199
|
-
const rowParams = { $table: $xeTable, row, _rowIndex, $rowIndex, fixed: fixedType, type: renderType };
|
|
197
|
+
return footerTableData.map((row, _rowIndex) => {
|
|
198
|
+
const $rowIndex = _rowIndex;
|
|
199
|
+
const rowParams = { $table: $xeTable, row, rowIndex: _rowIndex, _rowIndex, $rowIndex, fixed: fixedType, type: renderType };
|
|
200
200
|
return h('tr', {
|
|
201
|
-
key:
|
|
201
|
+
key: _rowIndex,
|
|
202
202
|
class: [
|
|
203
203
|
'vxe-footer--row',
|
|
204
204
|
footerRowClassName ? XEUtils.isFunction(footerRowClassName) ? footerRowClassName(rowParams) : footerRowClassName : ''
|
|
205
205
|
],
|
|
206
206
|
style: footerRowStyle ? (XEUtils.isFunction(footerRowStyle) ? footerRowStyle(rowParams) : footerRowStyle) : undefined
|
|
207
|
-
}, renderRows(h, _vm, isOptimizeMode, renderColumnList, footerTableData, row,
|
|
207
|
+
}, renderRows(h, _vm, isOptimizeMode, renderColumnList, footerTableData, row, _rowIndex, _rowIndex));
|
|
208
208
|
});
|
|
209
209
|
}
|
|
210
210
|
export default {
|
package/es/table/src/header.js
CHANGED
|
@@ -7,7 +7,7 @@ import { getSlotVNs } from '../../ui/src/vn';
|
|
|
7
7
|
const { renderer, renderEmptyElement } = VxeUI;
|
|
8
8
|
const sourceType = 'table';
|
|
9
9
|
const renderType = 'header';
|
|
10
|
-
function renderRows(h, _vm, isGroup, isOptimizeMode, headerGroups,
|
|
10
|
+
function renderRows(h, _vm, isGroup, isOptimizeMode, headerGroups, _rowIndex, cols) {
|
|
11
11
|
const props = _vm;
|
|
12
12
|
const $xeTable = _vm.$parent;
|
|
13
13
|
const $xeGrid = $xeTable.$xeGrid;
|
|
@@ -27,7 +27,7 @@ function renderRows(h, _vm, isGroup, isOptimizeMode, headerGroups, $rowIndex, co
|
|
|
27
27
|
const headerCellOpts = $xeTable.computeHeaderCellOpts;
|
|
28
28
|
const currCellHeight = getCalcHeight(headerCellOpts.height) || defaultRowHeight;
|
|
29
29
|
const { disabledMethod: dragDisabledMethod, isCrossDrag, isPeerDrag } = columnDragOpts;
|
|
30
|
-
const isLastRow =
|
|
30
|
+
const isLastRow = _rowIndex === headerGroups.length - 1;
|
|
31
31
|
return cols.map((column, $columnIndex) => {
|
|
32
32
|
const { type, showHeaderOverflow, headerAlign, align, filters, headerClassName, editRender, cellRender } = column;
|
|
33
33
|
// const { enabled } = tooltipOpts
|
|
@@ -56,7 +56,9 @@ function renderRows(h, _vm, isGroup, isOptimizeMode, headerGroups, $rowIndex, co
|
|
|
56
56
|
$table: $xeTable,
|
|
57
57
|
$grid: $xeGrid,
|
|
58
58
|
$gantt: $xeGantt,
|
|
59
|
-
|
|
59
|
+
rowIndex: _rowIndex,
|
|
60
|
+
_rowIndex,
|
|
61
|
+
$rowIndex: _rowIndex,
|
|
60
62
|
column,
|
|
61
63
|
columnIndex,
|
|
62
64
|
$columnIndex,
|
|
@@ -78,7 +80,7 @@ function renderRows(h, _vm, isGroup, isOptimizeMode, headerGroups, $rowIndex, co
|
|
|
78
80
|
thAttrs.rowspan = column.rowSpan > 1 ? column.rowSpan : null;
|
|
79
81
|
}
|
|
80
82
|
if (mergeHeadFlag && mergeHeaderList.length && (showCustomHeader || isLastRow)) {
|
|
81
|
-
const spanRest = mergeHeaderCellMaps[`${
|
|
83
|
+
const spanRest = mergeHeaderCellMaps[`${_rowIndex}:${showCustomHeader ? $columnIndex : _columnIndex}`];
|
|
82
84
|
if (spanRest) {
|
|
83
85
|
const { rowspan, colspan } = spanRest;
|
|
84
86
|
if (!rowspan || !colspan) {
|
|
@@ -317,16 +319,16 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups, renderColumn
|
|
|
317
319
|
const { fixedType } = props;
|
|
318
320
|
const { headerRowClassName, headerRowStyle } = tableProps;
|
|
319
321
|
const floatingFilterOpts = $xeTable.computeFloatingFilterOpts;
|
|
320
|
-
const rowVNs = headerGroups.map((cols,
|
|
321
|
-
const params = { $table: $xeTable, $rowIndex, fixed: fixedType, type: renderType };
|
|
322
|
+
const rowVNs = headerGroups.map((cols, _rowIndex) => {
|
|
323
|
+
const params = { $table: $xeTable, rowIndex: _rowIndex, _rowIndex, $rowIndex: _rowIndex, fixed: fixedType, type: renderType };
|
|
322
324
|
return h('tr', {
|
|
323
|
-
key:
|
|
325
|
+
key: _rowIndex,
|
|
324
326
|
class: [
|
|
325
327
|
'vxe-header--row',
|
|
326
328
|
headerRowClassName ? XEUtils.isFunction(headerRowClassName) ? headerRowClassName(params) : headerRowClassName : ''
|
|
327
329
|
],
|
|
328
330
|
style: headerRowStyle ? (XEUtils.isFunction(headerRowStyle) ? headerRowStyle(params) : headerRowStyle) : undefined
|
|
329
|
-
}, renderRows(h, _vm, isGroup, isOptimizeMode, headerGroups,
|
|
331
|
+
}, renderRows(h, _vm, isGroup, isOptimizeMode, headerGroups, _rowIndex, cols));
|
|
330
332
|
});
|
|
331
333
|
if (floatingFilterOpts.enabled) {
|
|
332
334
|
rowVNs.push(h('tr', {
|
package/es/table/src/methods.js
CHANGED
|
@@ -17,16 +17,20 @@ const maxYHeight = 5e6;
|
|
|
17
17
|
const maxXWidth = 5e6;
|
|
18
18
|
const sourceType = 'table';
|
|
19
19
|
let crossTableDragRowObj = null;
|
|
20
|
-
function eqCellValue(
|
|
21
|
-
const val1 = XEUtils.get(
|
|
22
|
-
const val2 = XEUtils.get(
|
|
20
|
+
function eqCellValue(newRow, oldRow, field) {
|
|
21
|
+
const val1 = XEUtils.get(newRow, field);
|
|
22
|
+
const val2 = XEUtils.get(oldRow, field);
|
|
23
|
+
let result = false;
|
|
23
24
|
if (eqEmptyValue(val1) && eqEmptyValue(val2)) {
|
|
24
|
-
|
|
25
|
+
result = true;
|
|
25
26
|
}
|
|
26
|
-
if (XEUtils.isString(val1) || XEUtils.isNumber(val1)) {
|
|
27
|
-
|
|
27
|
+
else if (XEUtils.isString(val1) || XEUtils.isNumber(val1)) {
|
|
28
|
+
result = ('' + val1) === ('' + val2);
|
|
28
29
|
}
|
|
29
|
-
|
|
30
|
+
else {
|
|
31
|
+
result = XEUtils.isEqual(val1, val2);
|
|
32
|
+
}
|
|
33
|
+
return { newValue: val1, oldValue: val2, result };
|
|
30
34
|
}
|
|
31
35
|
function hangleStorageDefaultValue(value, isAll) {
|
|
32
36
|
return XEUtils.isBoolean(value) ? value : isAll;
|
|
@@ -5815,18 +5819,60 @@ const tableMethods = {
|
|
|
5815
5819
|
}
|
|
5816
5820
|
const row = rowRest.row;
|
|
5817
5821
|
const oRow = sourceDataRowIdData[rowid];
|
|
5818
|
-
if (oRow) {
|
|
5819
|
-
|
|
5820
|
-
|
|
5822
|
+
if (!oRow) {
|
|
5823
|
+
return false;
|
|
5824
|
+
}
|
|
5825
|
+
if (arguments.length > 1) {
|
|
5826
|
+
return !eqCellValue(oRow, row, field).result;
|
|
5827
|
+
}
|
|
5828
|
+
for (let i = 0; i < keepFields.length; i++) {
|
|
5829
|
+
if (!eqCellValue(oRow, row, keepFields[i]).result) {
|
|
5830
|
+
return true;
|
|
5831
|
+
}
|
|
5832
|
+
}
|
|
5833
|
+
}
|
|
5834
|
+
return false;
|
|
5835
|
+
},
|
|
5836
|
+
getUpdateCells() {
|
|
5837
|
+
const $xeTable = this;
|
|
5838
|
+
const props = $xeTable;
|
|
5839
|
+
const internalData = $xeTable;
|
|
5840
|
+
const { keepSource, treeConfig } = props;
|
|
5841
|
+
const { tableFullData, tableFullTreeData, fullDataRowIdData, sourceDataRowIdData, fullColumnFieldData } = internalData;
|
|
5842
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
5843
|
+
const keepFields = $xeTable.computeKeepFields;
|
|
5844
|
+
const cellList = [];
|
|
5845
|
+
if (keepSource) {
|
|
5846
|
+
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
5847
|
+
const handleCell = (item) => {
|
|
5848
|
+
const rowid = handleGetRowId(item);
|
|
5849
|
+
const rowRest = fullDataRowIdData[rowid];
|
|
5850
|
+
// 新增的数据不需要检测
|
|
5851
|
+
if (!rowRest) {
|
|
5852
|
+
return;
|
|
5853
|
+
}
|
|
5854
|
+
const row = rowRest.row;
|
|
5855
|
+
const oRow = sourceDataRowIdData[rowid];
|
|
5856
|
+
if (!oRow) {
|
|
5857
|
+
return;
|
|
5821
5858
|
}
|
|
5822
5859
|
for (let i = 0; i < keepFields.length; i++) {
|
|
5823
|
-
|
|
5824
|
-
|
|
5860
|
+
const field = keepFields[i];
|
|
5861
|
+
const { result, newValue, oldValue } = eqCellValue(oRow, row, field);
|
|
5862
|
+
if (!result) {
|
|
5863
|
+
const column = fullColumnFieldData[field] ? fullColumnFieldData[field].column : null;
|
|
5864
|
+
cellList.push({ row, rowid, column, field, newValue, oldValue });
|
|
5825
5865
|
}
|
|
5826
5866
|
}
|
|
5867
|
+
};
|
|
5868
|
+
if (treeConfig) {
|
|
5869
|
+
XEUtils.eachTree(tableFullTreeData, handleCell, treeOpts);
|
|
5870
|
+
}
|
|
5871
|
+
else {
|
|
5872
|
+
tableFullData.forEach(handleCell);
|
|
5827
5873
|
}
|
|
5828
5874
|
}
|
|
5829
|
-
return
|
|
5875
|
+
return cellList;
|
|
5830
5876
|
},
|
|
5831
5877
|
/**
|
|
5832
5878
|
* 获取表格的可视列,也可以指定索引获取列
|
|
@@ -9534,7 +9580,13 @@ const tableMethods = {
|
|
|
9534
9580
|
}
|
|
9535
9581
|
if (editOpts.trigger === 'manual') {
|
|
9536
9582
|
if (actived.args && actived.row === row && column !== actived.column) {
|
|
9537
|
-
|
|
9583
|
+
if (editOpts.mode === 'row') {
|
|
9584
|
+
handleChangeCell($xeTable, evnt, params);
|
|
9585
|
+
}
|
|
9586
|
+
else {
|
|
9587
|
+
checkValidate($xeTable, 'blur')
|
|
9588
|
+
.catch((e) => e);
|
|
9589
|
+
}
|
|
9538
9590
|
}
|
|
9539
9591
|
}
|
|
9540
9592
|
else if (!actived.args || row !== actived.row || column !== actived.column) {
|
|
@@ -11191,7 +11243,7 @@ const tableMethods = {
|
|
|
11191
11243
|
style: null,
|
|
11192
11244
|
options: [],
|
|
11193
11245
|
column: null,
|
|
11194
|
-
multiple: false,
|
|
11246
|
+
multiple: false, // 选项是覅多选
|
|
11195
11247
|
visible: false
|
|
11196
11248
|
});
|
|
11197
11249
|
}
|
package/es/table/src/table.js
CHANGED
|
@@ -1921,8 +1921,7 @@ export default {
|
|
|
1921
1921
|
}
|
|
1922
1922
|
if ((props.showOverflow === true || props.showOverflow === 'tooltip') ||
|
|
1923
1923
|
(props.showHeaderOverflow === true || props.showHeaderOverflow === 'tooltip') ||
|
|
1924
|
-
(props.showFooterOverflow === true || props.showFooterOverflow === 'tooltip')
|
|
1925
|
-
props.tooltipConfig || props.editRules) {
|
|
1924
|
+
(props.showFooterOverflow === true || props.showFooterOverflow === 'tooltip')) {
|
|
1926
1925
|
if (!VxeUITooltipComponent) {
|
|
1927
1926
|
if (props.showOverflow === true) {
|
|
1928
1927
|
errLog('vxe.error.errProp', ['show-overflow=true', 'show-overflow=title']);
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { VxeUI } from '@vxe-ui/core';
|
|
2
2
|
const { log } = VxeUI;
|
|
3
|
-
const tableVersion = `table v${"3.21.
|
|
3
|
+
const tableVersion = `table v${"3.21.19"}`;
|
|
4
4
|
export function createComponentLog(name) {
|
|
5
5
|
const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
|
|
6
6
|
const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
|
|
7
7
|
const designVersion = VxeUI.designVersion ? `design v${VxeUI.designVersion}` : '';
|
|
8
|
+
const versionInfo = [uiVersion, tableVersion, ganttVersion, designVersion].join(' ');
|
|
8
9
|
return {
|
|
9
|
-
warnLog: log.create('warn',
|
|
10
|
-
errLog: log.create('error',
|
|
10
|
+
warnLog: log.create('warn', versionInfo + '] [' + name),
|
|
11
|
+
errLog: log.create('error', versionInfo + '] [' + name)
|
|
11
12
|
};
|
|
12
13
|
}
|
|
13
14
|
export const warnLog = log.create('warn', tableVersion);
|