vxe-table 3.21.8 → 3.21.9
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/style.css +1 -1
- package/es/table/render/index.js +166 -24
- package/es/table/src/methods.js +53 -0
- package/es/table/src/util.js +1 -0
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +277 -29
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/render/index.js +272 -25
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/methods.js +2 -2
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/util.js +1 -0
- package/lib/table/src/util.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 +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +2 -2
- package/packages/table/render/index.ts +166 -24
- package/packages/table/src/methods.ts +56 -0
- package/packages/table/src/util.ts +2 -0
- /package/es/{iconfont.1780726754772.ttf → iconfont.1780878069088.ttf} +0 -0
- /package/es/{iconfont.1780726754772.woff → iconfont.1780878069088.woff} +0 -0
- /package/es/{iconfont.1780726754772.woff2 → iconfont.1780878069088.woff2} +0 -0
- /package/lib/{iconfont.1780726754772.ttf → iconfont.1780878069088.ttf} +0 -0
- /package/lib/{iconfont.1780726754772.woff → iconfont.1780878069088.woff} +0 -0
- /package/lib/{iconfont.1780726754772.woff2 → iconfont.1780878069088.woff2} +0 -0
package/es/table/render/index.js
CHANGED
|
@@ -839,7 +839,24 @@ renderer.mixin({
|
|
|
839
839
|
renderTableEdit: nativeSelectEditRender,
|
|
840
840
|
renderTableDefault: nativeSelectEditRender,
|
|
841
841
|
renderTableCell(h, renderOpts, params) {
|
|
842
|
-
|
|
842
|
+
const { options, optionGroups } = renderOpts;
|
|
843
|
+
const { $table, row, column } = params;
|
|
844
|
+
const opSize = options ? options.length : null;
|
|
845
|
+
const ogSize = optionGroups ? optionGroups.length : null;
|
|
846
|
+
const { cellResult } = $table.effectCellData(row, column, {
|
|
847
|
+
key: 'render_table_cell',
|
|
848
|
+
isChanged({ oldValue, cellValue }) {
|
|
849
|
+
return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
|
|
850
|
+
},
|
|
851
|
+
setValue({ cellValue }) {
|
|
852
|
+
return [cellValue, opSize, ogSize];
|
|
853
|
+
},
|
|
854
|
+
getResult({ cellValue }) {
|
|
855
|
+
return handleSelectCellValue(cellValue, renderOpts);
|
|
856
|
+
}
|
|
857
|
+
});
|
|
858
|
+
// const cellResult = getSelectCellValue(renderOpts, params)
|
|
859
|
+
return getCellLabelVNs(h, renderOpts, params, cellResult);
|
|
843
860
|
},
|
|
844
861
|
renderTableFilter(h, renderOpts, params) {
|
|
845
862
|
const { column } = params;
|
|
@@ -954,15 +971,20 @@ renderer.mixin({
|
|
|
954
971
|
tableAutoFocus: 'input',
|
|
955
972
|
renderTableEdit: defaultEditRender,
|
|
956
973
|
renderTableCell(h, renderOpts, params) {
|
|
957
|
-
const
|
|
958
|
-
const { row, column } = params;
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
974
|
+
const props = renderOpts.props || {};
|
|
975
|
+
const { $table, row, column } = params;
|
|
976
|
+
const { cellResult } = $table.effectCellData(row, column, {
|
|
977
|
+
key: 'render_table_cell',
|
|
978
|
+
getResult({ cellValue }) {
|
|
979
|
+
if (cellValue) {
|
|
980
|
+
if (props.type !== 'time') {
|
|
981
|
+
return getLabelFormatDate(cellValue, props);
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
return cellValue;
|
|
963
985
|
}
|
|
964
|
-
}
|
|
965
|
-
return getCellLabelVNs(h, renderOpts, params,
|
|
986
|
+
});
|
|
987
|
+
return getCellLabelVNs(h, renderOpts, params, cellResult);
|
|
966
988
|
},
|
|
967
989
|
tableCellFormatter: handleFormatDatePicker,
|
|
968
990
|
renderTableDefault: defaultEditRender,
|
|
@@ -1013,6 +1035,40 @@ renderer.mixin({
|
|
|
1013
1035
|
})
|
|
1014
1036
|
];
|
|
1015
1037
|
},
|
|
1038
|
+
renderTableDefault(h, renderOpts, params) {
|
|
1039
|
+
const { startField, endField } = renderOpts;
|
|
1040
|
+
const { row, column } = params;
|
|
1041
|
+
const { model } = column;
|
|
1042
|
+
const cellValue = getCellValue(row, column);
|
|
1043
|
+
const seProps = {};
|
|
1044
|
+
const seOs = {};
|
|
1045
|
+
if (startField && endField) {
|
|
1046
|
+
seProps.startValue = XEUtils.get(row, startField);
|
|
1047
|
+
seProps.endValue = XEUtils.get(row, endField);
|
|
1048
|
+
seOs['update:startValue'] = (value) => {
|
|
1049
|
+
if (startField) {
|
|
1050
|
+
XEUtils.set(row, startField, value);
|
|
1051
|
+
}
|
|
1052
|
+
};
|
|
1053
|
+
seOs['update:endValue'] = (value) => {
|
|
1054
|
+
if (endField) {
|
|
1055
|
+
XEUtils.set(row, endField, value);
|
|
1056
|
+
}
|
|
1057
|
+
};
|
|
1058
|
+
}
|
|
1059
|
+
return [
|
|
1060
|
+
h(getDefaultComponent(renderOpts), {
|
|
1061
|
+
props: getCellEditProps(renderOpts, params, cellValue, seProps),
|
|
1062
|
+
on: getComponentOns(renderOpts, params, {
|
|
1063
|
+
model(cellValue) {
|
|
1064
|
+
model.update = true;
|
|
1065
|
+
model.value = cellValue;
|
|
1066
|
+
setCellValue(row, column, cellValue);
|
|
1067
|
+
}
|
|
1068
|
+
}, seOs)
|
|
1069
|
+
})
|
|
1070
|
+
];
|
|
1071
|
+
},
|
|
1016
1072
|
renderTableCell(h, renderOpts, params) {
|
|
1017
1073
|
const { startField, endField } = renderOpts;
|
|
1018
1074
|
const { row, column } = params;
|
|
@@ -1045,6 +1101,7 @@ renderer.mixin({
|
|
|
1045
1101
|
},
|
|
1046
1102
|
VxeTextarea: {
|
|
1047
1103
|
tableAutoFocus: 'textarea',
|
|
1104
|
+
renderTableDefault: defaultEditRender,
|
|
1048
1105
|
renderTableEdit: defaultEditRender
|
|
1049
1106
|
},
|
|
1050
1107
|
VxeButton: {
|
|
@@ -1066,7 +1123,24 @@ renderer.mixin({
|
|
|
1066
1123
|
renderTableEdit: defaultSelectEditRender,
|
|
1067
1124
|
renderTableDefault: defaultSelectEditRender,
|
|
1068
1125
|
renderTableCell(h, renderOpts, params) {
|
|
1069
|
-
|
|
1126
|
+
const { options, optionGroups } = renderOpts;
|
|
1127
|
+
const { $table, row, column } = params;
|
|
1128
|
+
const opSize = options ? options.length : null;
|
|
1129
|
+
const ogSize = optionGroups ? optionGroups.length : null;
|
|
1130
|
+
const { cellResult } = $table.effectCellData(row, column, {
|
|
1131
|
+
key: 'render_table_cell',
|
|
1132
|
+
isChanged({ oldValue, cellValue }) {
|
|
1133
|
+
return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
|
|
1134
|
+
},
|
|
1135
|
+
setValue({ cellValue }) {
|
|
1136
|
+
return [cellValue, opSize, ogSize];
|
|
1137
|
+
},
|
|
1138
|
+
getResult({ cellValue }) {
|
|
1139
|
+
return handleSelectCellValue(cellValue, renderOpts);
|
|
1140
|
+
}
|
|
1141
|
+
});
|
|
1142
|
+
// const cellResult = getSelectCellValue(renderOpts, params)
|
|
1143
|
+
return getCellLabelVNs(h, renderOpts, params, cellResult);
|
|
1070
1144
|
},
|
|
1071
1145
|
createTableFilterOptions: defaultFilterOptions,
|
|
1072
1146
|
renderTableFilter(h, renderOpts, params) {
|
|
@@ -1134,7 +1208,24 @@ renderer.mixin({
|
|
|
1134
1208
|
},
|
|
1135
1209
|
FormatSelect: {
|
|
1136
1210
|
renderTableDefault(h, renderOpts, params) {
|
|
1137
|
-
|
|
1211
|
+
const { options, optionGroups } = renderOpts;
|
|
1212
|
+
const { $table, row, column } = params;
|
|
1213
|
+
const opSize = options ? options.length : null;
|
|
1214
|
+
const ogSize = optionGroups ? optionGroups.length : null;
|
|
1215
|
+
const { cellResult } = $table.effectCellData(row, column, {
|
|
1216
|
+
key: 'render_table_cell',
|
|
1217
|
+
isChanged({ oldValue, cellValue }) {
|
|
1218
|
+
return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
|
|
1219
|
+
},
|
|
1220
|
+
setValue({ cellValue }) {
|
|
1221
|
+
return [cellValue, opSize, ogSize];
|
|
1222
|
+
},
|
|
1223
|
+
getResult({ cellValue }) {
|
|
1224
|
+
return handleSelectCellValue(cellValue, renderOpts);
|
|
1225
|
+
}
|
|
1226
|
+
});
|
|
1227
|
+
// const cellResult = getSelectCellValue(renderOpts, params)
|
|
1228
|
+
return getCellLabelVNs(h, renderOpts, params, cellResult);
|
|
1138
1229
|
},
|
|
1139
1230
|
tableCellFormatter: handleFormatSelect,
|
|
1140
1231
|
tableCellCopyMethod: handleFormatSelect,
|
|
@@ -1146,18 +1237,24 @@ renderer.mixin({
|
|
|
1146
1237
|
tableAutoFocus: 'input',
|
|
1147
1238
|
renderTableEdit: defaultTableOrTreeSelectEditRender,
|
|
1148
1239
|
renderTableCell(h, renderOpts, params) {
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1240
|
+
const { options, optionGroups } = renderOpts;
|
|
1241
|
+
const { $table, row, column } = params;
|
|
1242
|
+
const opSize = options ? options.length : null;
|
|
1243
|
+
const ogSize = optionGroups ? optionGroups.length : null;
|
|
1244
|
+
const { cellResult } = $table.effectCellData(row, column, {
|
|
1245
|
+
key: 'render_table_cell',
|
|
1246
|
+
isChanged({ oldValue, cellValue }) {
|
|
1247
|
+
return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
|
|
1248
|
+
},
|
|
1249
|
+
setValue({ cellValue }) {
|
|
1250
|
+
return [cellValue, opSize, ogSize];
|
|
1251
|
+
},
|
|
1252
|
+
getResult({ cellValue }) {
|
|
1253
|
+
return handleTreeSelectCellValue(cellValue, renderOpts);
|
|
1254
|
+
}
|
|
1255
|
+
});
|
|
1256
|
+
// const cellResult = getTreeSelectCellValue(renderOpts, params)
|
|
1257
|
+
return getCellLabelVNs(h, renderOpts, params, cellResult);
|
|
1161
1258
|
},
|
|
1162
1259
|
tableCellFormatter: handleFormatTreeSelect,
|
|
1163
1260
|
tableCellCopyMethod: handleFormatTreeSelect,
|
|
@@ -1175,7 +1272,52 @@ renderer.mixin({
|
|
|
1175
1272
|
},
|
|
1176
1273
|
FormatTreeSelect: {
|
|
1177
1274
|
renderTableDefault(h, renderOpts, params) {
|
|
1178
|
-
|
|
1275
|
+
const { options, optionGroups } = renderOpts;
|
|
1276
|
+
const { $table, row, column } = params;
|
|
1277
|
+
const opSize = options ? options.length : null;
|
|
1278
|
+
const ogSize = optionGroups ? optionGroups.length : null;
|
|
1279
|
+
const { cellResult } = $table.effectCellData(row, column, {
|
|
1280
|
+
key: 'render_table_cell',
|
|
1281
|
+
isChanged({ oldValue, cellValue }) {
|
|
1282
|
+
return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
|
|
1283
|
+
},
|
|
1284
|
+
setValue({ cellValue }) {
|
|
1285
|
+
return [cellValue, opSize, ogSize];
|
|
1286
|
+
},
|
|
1287
|
+
getResult({ cellValue }) {
|
|
1288
|
+
return handleTreeSelectCellValue(cellValue, renderOpts);
|
|
1289
|
+
}
|
|
1290
|
+
});
|
|
1291
|
+
// const cellResult = getTreeSelectCellValue(renderOpts, params)
|
|
1292
|
+
return getCellLabelVNs(h, renderOpts, params, cellResult);
|
|
1293
|
+
},
|
|
1294
|
+
tableCellFormatter: handleFormatTreeSelect,
|
|
1295
|
+
tableCellCopyMethod: handleFormatTreeSelect,
|
|
1296
|
+
tableCellPasteMethod: handleSetTreeSelectValue,
|
|
1297
|
+
tableExportMethod: handleExportTreeSelectMethod
|
|
1298
|
+
},
|
|
1299
|
+
VxeTableSelect: {
|
|
1300
|
+
tableAutoFocus: 'input',
|
|
1301
|
+
renderTableEdit: defaultTableOrTreeSelectEditRender,
|
|
1302
|
+
renderTableCell(h, renderOpts, params) {
|
|
1303
|
+
const { options, optionGroups } = renderOpts;
|
|
1304
|
+
const { $table, row, column } = params;
|
|
1305
|
+
const opSize = options ? options.length : null;
|
|
1306
|
+
const ogSize = optionGroups ? optionGroups.length : null;
|
|
1307
|
+
const { cellResult } = $table.effectCellData(row, column, {
|
|
1308
|
+
key: 'render_table_cell',
|
|
1309
|
+
isChanged({ oldValue, cellValue }) {
|
|
1310
|
+
return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
|
|
1311
|
+
},
|
|
1312
|
+
setValue({ cellValue }) {
|
|
1313
|
+
return [cellValue, opSize, ogSize];
|
|
1314
|
+
},
|
|
1315
|
+
getResult({ cellValue }) {
|
|
1316
|
+
return handleTreeSelectCellValue(cellValue, renderOpts);
|
|
1317
|
+
}
|
|
1318
|
+
});
|
|
1319
|
+
// const cellResult = getTreeSelectCellValue(renderOpts, params)
|
|
1320
|
+
return getCellLabelVNs(h, renderOpts, params, cellResult);
|
|
1179
1321
|
},
|
|
1180
1322
|
tableCellFormatter: handleFormatTreeSelect,
|
|
1181
1323
|
tableCellCopyMethod: handleFormatTreeSelect,
|
package/es/table/src/methods.js
CHANGED
|
@@ -3454,6 +3454,7 @@ function loadTableData($xeTable, datas, isReload, isReset) {
|
|
|
3454
3454
|
internalData.removeRowMaps = {};
|
|
3455
3455
|
reactData.removeRowFlag++;
|
|
3456
3456
|
internalData.fullCellHeightMaps = {};
|
|
3457
|
+
internalData.fullCellStoreMaps = {};
|
|
3457
3458
|
const sYLoad = updateScrollYStatus($xeTable, fullData);
|
|
3458
3459
|
// 全量数据
|
|
3459
3460
|
internalData.tableFullData = fullData;
|
|
@@ -5334,6 +5335,58 @@ const tableMethods = {
|
|
|
5334
5335
|
}
|
|
5335
5336
|
return $xeTable.$nextTick();
|
|
5336
5337
|
},
|
|
5338
|
+
effectCellData(row, column, options) {
|
|
5339
|
+
const $xeTable = this;
|
|
5340
|
+
const internalData = $xeTable;
|
|
5341
|
+
const { fullCellStoreMaps } = internalData;
|
|
5342
|
+
const editOpts = $xeTable.computeEditOpts;
|
|
5343
|
+
const { key, isChanged, setValue, getResult } = options;
|
|
5344
|
+
const rowid = getRowid($xeTable, row);
|
|
5345
|
+
const colid = column.id;
|
|
5346
|
+
let rowStore = fullCellStoreMaps[rowid];
|
|
5347
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
5348
|
+
const restParams = {
|
|
5349
|
+
$table: $xeTable,
|
|
5350
|
+
row,
|
|
5351
|
+
rowid,
|
|
5352
|
+
column,
|
|
5353
|
+
colid,
|
|
5354
|
+
cellValue,
|
|
5355
|
+
oldValue: null
|
|
5356
|
+
};
|
|
5357
|
+
if (editOpts.cache === false && key === 'render_table_cell') {
|
|
5358
|
+
const rest = restParams;
|
|
5359
|
+
rest.cellResult = getResult ? getResult(restParams) : cellValue;
|
|
5360
|
+
return rest;
|
|
5361
|
+
}
|
|
5362
|
+
if (!rowStore) {
|
|
5363
|
+
rowStore = {};
|
|
5364
|
+
fullCellStoreMaps[rowid] = rowStore;
|
|
5365
|
+
}
|
|
5366
|
+
let cellStore = rowStore[colid];
|
|
5367
|
+
if (!cellStore) {
|
|
5368
|
+
cellStore = {
|
|
5369
|
+
value: undefined,
|
|
5370
|
+
result: {}
|
|
5371
|
+
};
|
|
5372
|
+
rowStore[colid] = cellStore;
|
|
5373
|
+
}
|
|
5374
|
+
const restData = rowStore[colid];
|
|
5375
|
+
const oldValue = restData.value;
|
|
5376
|
+
restParams.oldValue = oldValue;
|
|
5377
|
+
if (isChanged ? !isChanged(restParams) : oldValue !== cellValue) {
|
|
5378
|
+
restData.value = setValue ? setValue(restParams) : cellValue;
|
|
5379
|
+
restData.result = {};
|
|
5380
|
+
}
|
|
5381
|
+
const storeData = restData.result;
|
|
5382
|
+
if (XEUtils.isUndefined(storeData[key])) {
|
|
5383
|
+
storeData[key] = getResult ? getResult(restParams) : cellValue;
|
|
5384
|
+
}
|
|
5385
|
+
const cellResult = storeData[key];
|
|
5386
|
+
const rest = restParams;
|
|
5387
|
+
rest.cellResult = cellResult;
|
|
5388
|
+
return rest;
|
|
5389
|
+
},
|
|
5337
5390
|
getCellElement(row, fieldOrColumn) {
|
|
5338
5391
|
const $xeTable = this;
|
|
5339
5392
|
const internalData = $xeTable;
|
package/es/table/src/util.js
CHANGED
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED