vxe-table 3.7.0-beta.1 → 3.7.0-beta.4
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/helper/vetur/attributes.json +63 -19
- package/helper/vetur/tags.json +12 -1
- package/lib/export/src/mixin.js +22 -12
- package/lib/export/src/mixin.min.js +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.umd.js +75 -50
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/methods.js +57 -42
- package/lib/table/src/methods.min.js +1 -1
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/v-x-e-table/index.js +1 -1
- package/lib/v-x-e-table/index.min.js +1 -1
- package/package.json +1 -1
- package/packages/export/src/mixin.js +20 -12
- package/packages/table/src/methods.js +35 -18
- package/types/export.d.ts +1 -0
- package/types/table.d.ts +1 -0
- /package/lib/icon/style/{iconfont.1688948811910.ttf → iconfont.1689208376629.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1688948811910.woff → iconfont.1689208376629.woff} +0 -0
- /package/lib/icon/style/{iconfont.1688948811910.woff2 → iconfont.1689208376629.woff2} +0 -0
- /package/lib/{iconfont.1688948811910.ttf → iconfont.1689208376629.ttf} +0 -0
- /package/lib/{iconfont.1688948811910.woff → iconfont.1689208376629.woff} +0 -0
- /package/lib/{iconfont.1688948811910.woff2 → iconfont.1689208376629.woff2} +0 -0
package/lib/table/src/methods.js
CHANGED
|
@@ -491,7 +491,7 @@ var Methods = {
|
|
|
491
491
|
this.tableSynchData = datas;
|
|
492
492
|
// 克隆原数据,用于显示编辑状态,与编辑值做对比
|
|
493
493
|
if (keepSource) {
|
|
494
|
-
this.
|
|
494
|
+
this.cacheSourceMap(fullData);
|
|
495
495
|
}
|
|
496
496
|
if (process.env.NODE_ENV === 'development') {
|
|
497
497
|
if (sYLoad) {
|
|
@@ -734,8 +734,35 @@ var Methods = {
|
|
|
734
734
|
tableFullData.forEach(handleCache);
|
|
735
735
|
}
|
|
736
736
|
},
|
|
737
|
-
|
|
737
|
+
cacheSourceMap: function cacheSourceMap(fullData) {
|
|
738
738
|
var _this11 = this;
|
|
739
|
+
var treeConfig = this.treeConfig,
|
|
740
|
+
treeOpts = this.treeOpts,
|
|
741
|
+
sourceDataRowIdData = this.sourceDataRowIdData;
|
|
742
|
+
var sourceData = _xeUtils["default"].clone(fullData, true);
|
|
743
|
+
var rowkey = (0, _util.getRowkey)(this);
|
|
744
|
+
sourceDataRowIdData = this.sourceDataRowIdData = {};
|
|
745
|
+
var handleSourceRow = function handleSourceRow(row) {
|
|
746
|
+
var rowid = (0, _util.getRowid)(_this11, row);
|
|
747
|
+
if ((0, _utils.eqEmptyValue)(rowid)) {
|
|
748
|
+
rowid = getRowUniqueId();
|
|
749
|
+
_xeUtils["default"].set(row, rowkey, rowid);
|
|
750
|
+
}
|
|
751
|
+
sourceDataRowIdData[rowid] = {
|
|
752
|
+
row: row,
|
|
753
|
+
rowid: rowid
|
|
754
|
+
};
|
|
755
|
+
};
|
|
756
|
+
// 源数据缓存
|
|
757
|
+
if (treeConfig && !treeOpts.transform) {
|
|
758
|
+
_xeUtils["default"].eachTree(sourceData, handleSourceRow, treeOpts);
|
|
759
|
+
} else {
|
|
760
|
+
sourceData.forEach(handleSourceRow);
|
|
761
|
+
}
|
|
762
|
+
this.tableSourceData = sourceData;
|
|
763
|
+
},
|
|
764
|
+
loadTreeChildren: function loadTreeChildren(row, childRecords) {
|
|
765
|
+
var _this12 = this;
|
|
739
766
|
var keepSource = this.keepSource,
|
|
740
767
|
tableSourceData = this.tableSourceData,
|
|
741
768
|
treeOpts = this.treeOpts,
|
|
@@ -750,16 +777,16 @@ var Methods = {
|
|
|
750
777
|
var parentLevel = rest ? rest.level : 0;
|
|
751
778
|
return this.createData(childRecords).then(function (rows) {
|
|
752
779
|
if (keepSource) {
|
|
753
|
-
var rowid = (0, _util.getRowid)(
|
|
780
|
+
var rowid = (0, _util.getRowid)(_this12, row);
|
|
754
781
|
var matchObj = _xeUtils["default"].findTree(tableSourceData, function (item) {
|
|
755
|
-
return rowid === (0, _util.getRowid)(
|
|
782
|
+
return rowid === (0, _util.getRowid)(_this12, item);
|
|
756
783
|
}, treeOpts);
|
|
757
784
|
if (matchObj) {
|
|
758
785
|
matchObj.item[children] = _xeUtils["default"].clone(rows, true);
|
|
759
786
|
}
|
|
760
787
|
}
|
|
761
788
|
_xeUtils["default"].eachTree(rows, function (childRow, index, items, path, parent, nodes) {
|
|
762
|
-
var rowid = (0, _util.getRowid)(
|
|
789
|
+
var rowid = (0, _util.getRowid)(_this12, childRow);
|
|
763
790
|
var rest = {
|
|
764
791
|
row: childRow,
|
|
765
792
|
rowid: rowid,
|
|
@@ -780,7 +807,7 @@ var Methods = {
|
|
|
780
807
|
if (transform) {
|
|
781
808
|
row[mapChildren] = rows;
|
|
782
809
|
}
|
|
783
|
-
|
|
810
|
+
_this12.updateAfterDataIndex();
|
|
784
811
|
return rows;
|
|
785
812
|
});
|
|
786
813
|
},
|
|
@@ -789,7 +816,7 @@ var Methods = {
|
|
|
789
816
|
* 牺牲数据组装的耗时,用来换取使用过程中的流畅
|
|
790
817
|
*/
|
|
791
818
|
cacheColumnMap: function cacheColumnMap() {
|
|
792
|
-
var
|
|
819
|
+
var _this13 = this;
|
|
793
820
|
var tableFullColumn = this.tableFullColumn,
|
|
794
821
|
collectColumn = this.collectColumn,
|
|
795
822
|
fullColumnMap = this.fullColumnMap,
|
|
@@ -870,14 +897,14 @@ var Methods = {
|
|
|
870
897
|
}
|
|
871
898
|
}
|
|
872
899
|
if (process.env.NODE_ENV === 'development') {
|
|
873
|
-
if (
|
|
874
|
-
(0, _log.warnLog)('vxe.error.errConflicts', ["table.show-overflow=".concat(
|
|
900
|
+
if (_this13.showOverflow && column.showOverflow === false) {
|
|
901
|
+
(0, _log.warnLog)('vxe.error.errConflicts', ["table.show-overflow=".concat(_this13.showOverflow), "column.show-overflow=".concat(column.showOverflow)]);
|
|
875
902
|
}
|
|
876
|
-
if (
|
|
877
|
-
(0, _log.warnLog)('vxe.error.errConflicts', ["table.show-header-overflow=".concat(
|
|
903
|
+
if (_this13.showHeaderOverflow && column.showHeaderOverflow === false) {
|
|
904
|
+
(0, _log.warnLog)('vxe.error.errConflicts', ["table.show-header-overflow=".concat(_this13.showHeaderOverflow), "column.show-header-overflow=".concat(column.showHeaderOverflow)]);
|
|
878
905
|
}
|
|
879
|
-
if (
|
|
880
|
-
(0, _log.warnLog)('vxe.error.errConflicts', ["table.show-footer-overflow=".concat(
|
|
906
|
+
if (_this13.showFooterOverflow && column.showFooterOverflow === false) {
|
|
907
|
+
(0, _log.warnLog)('vxe.error.errConflicts', ["table.show-footer-overflow=".concat(_this13.showFooterOverflow), "column.show-footer-overflow=".concat(column.showFooterOverflow)]);
|
|
881
908
|
}
|
|
882
909
|
}
|
|
883
910
|
if (process.env.NODE_ENV === 'development') {
|
|
@@ -1057,7 +1084,7 @@ var Methods = {
|
|
|
1057
1084
|
* @param {Row} records 行数据
|
|
1058
1085
|
*/
|
|
1059
1086
|
defineField: function defineField(records) {
|
|
1060
|
-
var
|
|
1087
|
+
var _this14 = this;
|
|
1061
1088
|
var radioOpts = this.radioOpts,
|
|
1062
1089
|
checkboxOpts = this.checkboxOpts,
|
|
1063
1090
|
treeConfig = this.treeConfig,
|
|
@@ -1068,7 +1095,7 @@ var Methods = {
|
|
|
1068
1095
|
records = [records || {}];
|
|
1069
1096
|
}
|
|
1070
1097
|
return records.map(function (record) {
|
|
1071
|
-
|
|
1098
|
+
_this14.tableFullColumn.forEach(function (column) {
|
|
1072
1099
|
var field = column.field,
|
|
1073
1100
|
editRender = column.editRender;
|
|
1074
1101
|
if (field && !_xeUtils["default"].has(record, field)) {
|
|
@@ -1108,9 +1135,9 @@ var Methods = {
|
|
|
1108
1135
|
* @param {Array} records 新数据
|
|
1109
1136
|
*/
|
|
1110
1137
|
createData: function createData(records) {
|
|
1111
|
-
var
|
|
1138
|
+
var _this15 = this;
|
|
1112
1139
|
return this.$nextTick().then(function () {
|
|
1113
|
-
return
|
|
1140
|
+
return _this15.defineField(records);
|
|
1114
1141
|
});
|
|
1115
1142
|
},
|
|
1116
1143
|
/**
|
|
@@ -1135,7 +1162,7 @@ var Methods = {
|
|
|
1135
1162
|
* 如果还额外传了 field 则还原指定的单元格数据
|
|
1136
1163
|
*/
|
|
1137
1164
|
revertData: function revertData(rows, field) {
|
|
1138
|
-
var
|
|
1165
|
+
var _this16 = this;
|
|
1139
1166
|
var keepSource = this.keepSource,
|
|
1140
1167
|
tableSourceData = this.tableSourceData,
|
|
1141
1168
|
treeConfig = this.treeConfig;
|
|
@@ -1155,8 +1182,8 @@ var Methods = {
|
|
|
1155
1182
|
}
|
|
1156
1183
|
if (targetRows.length) {
|
|
1157
1184
|
targetRows.forEach(function (row) {
|
|
1158
|
-
if (!
|
|
1159
|
-
var rowIndex =
|
|
1185
|
+
if (!_this16.isInsertByRow(row)) {
|
|
1186
|
+
var rowIndex = _this16.getRowIndex(row);
|
|
1160
1187
|
if (treeConfig && rowIndex === -1) {
|
|
1161
1188
|
(0, _log.errLog)('vxe.error.noTree', ['revertData']);
|
|
1162
1189
|
}
|
|
@@ -1230,39 +1257,24 @@ var Methods = {
|
|
|
1230
1257
|
* @param {String} field 字段名
|
|
1231
1258
|
*/
|
|
1232
1259
|
isUpdateByRow: function isUpdateByRow(row, field) {
|
|
1233
|
-
var _this16 = this;
|
|
1234
1260
|
var tableFullColumn = this.tableFullColumn,
|
|
1235
1261
|
keepSource = this.keepSource,
|
|
1236
|
-
|
|
1237
|
-
treeOpts = this.treeOpts,
|
|
1238
|
-
tableSourceData = this.tableSourceData,
|
|
1262
|
+
sourceDataRowIdData = this.sourceDataRowIdData,
|
|
1239
1263
|
fullDataRowIdData = this.fullDataRowIdData;
|
|
1240
1264
|
if (keepSource) {
|
|
1241
|
-
var oRow, property;
|
|
1242
1265
|
var rowid = (0, _util.getRowid)(this, row);
|
|
1243
1266
|
// 新增的数据不需要检测
|
|
1244
1267
|
if (!fullDataRowIdData[rowid]) {
|
|
1245
1268
|
return false;
|
|
1246
1269
|
}
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
var
|
|
1250
|
-
return rowid === (0, _util.getRowid)(_this16, item);
|
|
1251
|
-
}, treeOpts);
|
|
1252
|
-
row = Object.assign({}, row, _defineProperty({}, children, null));
|
|
1253
|
-
if (matchObj) {
|
|
1254
|
-
oRow = Object.assign({}, matchObj.item, _defineProperty({}, children, null));
|
|
1255
|
-
}
|
|
1256
|
-
} else {
|
|
1257
|
-
var oRowIndex = fullDataRowIdData[rowid].index;
|
|
1258
|
-
oRow = tableSourceData[oRowIndex];
|
|
1259
|
-
}
|
|
1260
|
-
if (oRow) {
|
|
1270
|
+
var oldRest = sourceDataRowIdData[rowid];
|
|
1271
|
+
if (oldRest) {
|
|
1272
|
+
var oRow = oldRest.row;
|
|
1261
1273
|
if (arguments.length > 1) {
|
|
1262
1274
|
return !eqCellValue(oRow, row, field);
|
|
1263
1275
|
}
|
|
1264
1276
|
for (var index = 0, len = tableFullColumn.length; index < len; index++) {
|
|
1265
|
-
property = tableFullColumn[index].field;
|
|
1277
|
+
var property = tableFullColumn[index].field;
|
|
1266
1278
|
if (property && !eqCellValue(oRow, row, property)) {
|
|
1267
1279
|
return true;
|
|
1268
1280
|
}
|
|
@@ -1795,7 +1807,7 @@ var Methods = {
|
|
|
1795
1807
|
*/
|
|
1796
1808
|
showColumn: function showColumn(fieldOrColumn) {
|
|
1797
1809
|
var column = (0, _util.handleFieldOrColumn)(this, fieldOrColumn);
|
|
1798
|
-
if (column
|
|
1810
|
+
if (column && column.visible) {
|
|
1799
1811
|
column.visible = true;
|
|
1800
1812
|
return this.handleCustom();
|
|
1801
1813
|
}
|
|
@@ -4541,7 +4553,10 @@ var Methods = {
|
|
|
4541
4553
|
if (!remote || firstSortColumn && firstSortColumn.remoteSort) {
|
|
4542
4554
|
this.handleTableData(true);
|
|
4543
4555
|
}
|
|
4544
|
-
return this.$nextTick().then(
|
|
4556
|
+
return this.$nextTick().then(function () {
|
|
4557
|
+
_this41.updateCellAreas();
|
|
4558
|
+
return _this41.updateStyle();
|
|
4559
|
+
});
|
|
4545
4560
|
}
|
|
4546
4561
|
return this.$nextTick();
|
|
4547
4562
|
},
|