vxe-table 3.19.35 → 3.19.36

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.
@@ -217,11 +217,17 @@ function renderTitleContent(h, params, content) {
217
217
  }
218
218
  function getFooterContent(h, params) {
219
219
  const { $table, column, row } = params;
220
+ const tableProps = $table;
221
+ const { editConfig } = tableProps;
220
222
  const { slots, editRender, cellRender } = column;
221
- const renderOpts = editRender || cellRender;
222
- if (slots && slots.footer) {
223
- return $table.callSlot(slots.footer, params, h);
223
+ const footerSlot = slots ? slots.footer : null;
224
+ if (footerSlot) {
225
+ return $table.callSlot(footerSlot, params, h);
224
226
  }
227
+ const isEnableEdit = editConfig && isEnableConf(editConfig);
228
+ const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
229
+ const cellRenderOpts = isEnableConf(cellRender) ? cellRender : null;
230
+ const renderOpts = editRenderOpts || cellRenderOpts;
225
231
  const itemValue = $table.getFooterCellLabel(row, column);
226
232
  if (renderOpts) {
227
233
  const compConf = renderer.get(renderOpts.name);
@@ -266,7 +272,9 @@ function renderCellHandle(h, params) {
266
272
  case 'html':
267
273
  return isDeepCell ? Cell.renderDeepHTMLCell(h, params) : Cell.renderHTMLCell(h, params);
268
274
  }
269
- if (editConfig && isEnableConf(editOpts) && editRender) {
275
+ const isEnableEdit = editConfig && isEnableConf(editConfig);
276
+ const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
277
+ if (editRenderOpts) {
270
278
  return editOpts.mode === 'cell' ? (isDeepCell ? Cell.renderDeepCellEdit(h, params) : Cell.renderCellEdit(h, params)) : (isDeepCell ? Cell.renderDeepRowEdit(h, params) : Cell.renderRowEdit(h, params));
271
279
  }
272
280
  return isDeepCell ? Cell.renderDeepCell(h, params) : Cell.renderDefaultCell(h, params);
@@ -275,7 +283,6 @@ function renderHeaderHandle(h, params) {
275
283
  const { column, $table } = params;
276
284
  const tableProps = $table;
277
285
  const { editConfig } = tableProps;
278
- const editOpts = $table.computeEditOpts;
279
286
  const { type, filters, sortable, editRender } = column;
280
287
  switch (type) {
281
288
  case 'seq':
@@ -296,7 +303,9 @@ function renderHeaderHandle(h, params) {
296
303
  }
297
304
  break;
298
305
  }
299
- if (editConfig && isEnableConf(editOpts) && editRender) {
306
+ const isEnableEdit = editConfig && isEnableConf(editConfig);
307
+ const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
308
+ if (editRenderOpts) {
300
309
  return Cell.renderEditHeader(h, params);
301
310
  }
302
311
  else if (filters && sortable) {
@@ -331,11 +340,17 @@ export const Cell = {
331
340
  */
332
341
  renderHeaderTitle(h, params) {
333
342
  const { $table, column } = params;
343
+ const tableProps = $table;
344
+ const { editConfig } = tableProps;
334
345
  const { slots, editRender, cellRender } = column;
335
- const renderOpts = editRender || cellRender;
336
- if (slots && slots.header) {
337
- return renderTitleContent(h, params, $table.callSlot(slots.header, params, h));
346
+ const headerSlot = slots ? slots.header : null;
347
+ if (headerSlot) {
348
+ return renderTitleContent(h, params, $table.callSlot(headerSlot, params, h));
338
349
  }
350
+ const isEnableEdit = editConfig && isEnableConf(editConfig);
351
+ const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
352
+ const cellRenderOpts = isEnableConf(cellRender) ? cellRender : null;
353
+ const renderOpts = editRenderOpts || cellRenderOpts;
339
354
  if (renderOpts) {
340
355
  const compConf = renderer.get(renderOpts.name);
341
356
  const rtHeader = compConf ? (compConf.renderTableHeader || compConf.renderHeader) : null;
@@ -356,7 +371,9 @@ export const Cell = {
356
371
  const { isRowGroupStatus } = tableReactData;
357
372
  const { editConfig } = tableProps;
358
373
  const { field, slots, editRender, cellRender, rowGroupNode, aggFunc, formatter } = column;
359
- const renderOpts = editConfig && isEnableConf(editRender) ? editRender : (isEnableConf(cellRender) ? cellRender : null);
374
+ const isEnableEdit = editConfig && isEnableConf(editConfig);
375
+ const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
376
+ const cellRenderOpts = isEnableConf(cellRender) ? cellRender : null;
360
377
  const defaultSlot = slots ? slots.default : null;
361
378
  const gcSlot = slots ? (slots.groupContent || slots['group-content']) : null;
362
379
  const gvSlot = slots ? (slots.groupValues || slots['group-values']) : null;
@@ -427,25 +444,24 @@ export const Cell = {
427
444
  if (defaultSlot) {
428
445
  return renderCellBaseVNs(h, params, $table.callSlot(defaultSlot, params, h));
429
446
  }
447
+ const renderOpts = editRenderOpts || cellRenderOpts;
430
448
  // formatter > (renderTableCell | renderTableDefault)
431
449
  if (renderOpts && !formatter) {
432
450
  const compConf = renderer.get(renderOpts.name);
433
- const rtDefault = compConf ? (compConf.renderTableDefault || compConf.renderDefault) : null;
434
- const rtCell = compConf ? (compConf.renderTableCell || compConf.renderCell) : null;
435
- const renderFn = editRender ? rtCell : rtDefault;
451
+ const renderFn = editRenderOpts ? (compConf.renderTableCell || compConf.renderCell) : (compConf.renderTableDefault || compConf.renderDefault);
436
452
  if (renderFn) {
437
- return renderCellBaseVNs(h, params, getSlotVNs(renderFn.call($table, h, renderOpts, Object.assign({ $type: editRender ? 'edit' : 'cell' }, params))));
453
+ return renderCellBaseVNs(h, params, getSlotVNs(renderFn.call($table, h, renderOpts, Object.assign({ $type: editRenderOpts ? 'edit' : 'cell' }, params))));
438
454
  }
439
455
  }
440
456
  cellValue = $table.getCellLabel(row, column);
441
457
  }
442
- const cellPlaceholder = editRender ? editRender.placeholder : '';
458
+ const cellPlaceholder = editRenderOpts ? editRenderOpts.placeholder : '';
443
459
  return renderCellBaseVNs(h, params, [
444
460
  h('span', {
445
461
  class: 'vxe-cell--label'
446
462
  }, [
447
463
  // 如果设置占位符
448
- editRender && eqEmptyValue(cellValue)
464
+ editRenderOpts && eqEmptyValue(cellValue)
449
465
  ? h('span', {
450
466
  class: 'vxe-cell--placeholder'
451
467
  }, formatText(getFuncText(cellPlaceholder), 1))
@@ -1088,6 +1104,8 @@ export const Cell = {
1088
1104
  const { editConfig, editRules } = tableProps;
1089
1105
  const editOpts = $table.computeEditOpts;
1090
1106
  const { sortable, filters, editRender } = column;
1107
+ const isEnableEdit = editConfig && isEnableConf(editConfig);
1108
+ const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
1091
1109
  let isRequired = false;
1092
1110
  if (editRules) {
1093
1111
  const columnRules = XEUtils.get(editRules, column.field);
@@ -1096,7 +1114,7 @@ export const Cell = {
1096
1114
  }
1097
1115
  }
1098
1116
  let editIconVNs = [];
1099
- if (isEnableConf(editConfig)) {
1117
+ if (isEnableEdit) {
1100
1118
  const { showAsterisk, showIcon, icon } = editOpts;
1101
1119
  editIconVNs = [
1102
1120
  isRequired && showAsterisk
@@ -1108,7 +1126,7 @@ export const Cell = {
1108
1126
  })
1109
1127
  ])
1110
1128
  : renderEmptyElement($table),
1111
- isEnableConf(editRender) && showIcon
1129
+ editRenderOpts && showIcon
1112
1130
  ? h('i', {
1113
1131
  class: 'vxe-cell--edit-icon'
1114
1132
  }, XEUtils.isFunction(icon)
@@ -1128,11 +1146,15 @@ export const Cell = {
1128
1146
  // 行格编辑模式
1129
1147
  renderRowEdit(h, params) {
1130
1148
  const { $table, column } = params;
1149
+ const tableProps = $table;
1131
1150
  const tableReactData = $table;
1151
+ const { editConfig } = tableProps;
1132
1152
  const { editStore } = tableReactData;
1133
1153
  const { actived } = editStore;
1134
1154
  const { editRender } = column;
1135
- return Cell.runRenderer(h, params, this, isEnableConf(editRender) && actived && actived.row === params.row);
1155
+ const isEnableEdit = editConfig && isEnableConf(editConfig);
1156
+ const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
1157
+ return Cell.runRenderer(h, params, !!(editRenderOpts && actived && actived.row === params.row));
1136
1158
  },
1137
1159
  renderDeepRowEdit(h, params) {
1138
1160
  return Cell.renderDeepNodeBtn(h, params, Cell.renderRowEdit(h, params));
@@ -1140,29 +1162,37 @@ export const Cell = {
1140
1162
  // 单元格编辑模式
1141
1163
  renderCellEdit(h, params) {
1142
1164
  const { $table, column } = params;
1165
+ const tableProps = $table;
1143
1166
  const tableReactData = $table;
1167
+ const { editConfig } = tableProps;
1144
1168
  const { editStore } = tableReactData;
1145
1169
  const { actived } = editStore;
1146
1170
  const { editRender } = column;
1147
- return Cell.runRenderer(h, params, this, isEnableConf(editRender) && actived && actived.row === params.row && actived.column === params.column);
1171
+ const isEnableEdit = editConfig && isEnableConf(editConfig);
1172
+ const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
1173
+ return Cell.runRenderer(h, params, !!(editRenderOpts && actived && actived.row === params.row && actived.column === params.column));
1148
1174
  },
1149
1175
  renderDeepCellEdit(h, params) {
1150
1176
  return Cell.renderDeepNodeBtn(h, params, Cell.renderCellEdit(h, params));
1151
1177
  },
1152
1178
  runRenderer(h, params, _vm, isEdit) {
1153
1179
  const { $table, row, column } = params;
1180
+ const tableProps = $table;
1154
1181
  const tableReactData = $table;
1182
+ const { editConfig } = tableProps;
1155
1183
  const { isRowGroupStatus } = tableReactData;
1156
1184
  const { slots, field, editRender, formatter } = column;
1157
- const compConf = renderer.get(editRender.name);
1158
- const rtEdit = compConf ? (compConf.renderTableEdit || compConf.renderEdit) : null;
1185
+ const isEnableEdit = editConfig && isEnableConf(editConfig);
1186
+ const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
1159
1187
  const defaultSlot = slots ? slots.default : null;
1160
1188
  const gcSlot = slots ? (slots.groupContent || slots['group-content']) : null;
1161
1189
  const cellParams = Object.assign({ $type: '', isEdit }, params);
1162
- if (isEdit) {
1190
+ if (isEdit && editRenderOpts) {
1163
1191
  if (slots && slots.edit) {
1164
1192
  return $table.callSlot(slots.edit, cellParams, h);
1165
1193
  }
1194
+ const compConf = renderer.get(editRender.name);
1195
+ const rtEdit = compConf ? (compConf.renderTableEdit || compConf.renderEdit) : null;
1166
1196
  if (rtEdit) {
1167
1197
  return getSlotVNs(rtEdit.call($table, h, editRender, cellParams));
1168
1198
  }
@@ -290,6 +290,8 @@ export const tableProps = {
290
290
  virtualYConfig: Object,
291
291
  // 滚动条配置项
292
292
  scrollbarConfig: Object,
293
+ // 可撤销配置项
294
+ undoHistoryConfig: Object,
293
295
  // (即将废弃)优化相关
294
296
  animat: { type: Boolean, default: () => getConfig().table.animat },
295
297
  // (可能会被废弃的参数,不要使用)
@@ -1463,6 +1463,11 @@ export default {
1463
1463
  }
1464
1464
  return [];
1465
1465
  },
1466
+ computeUndoHistoryOpts() {
1467
+ const $xeTable = this;
1468
+ const props = $xeTable;
1469
+ return Object.assign({}, getConfig().table.undoHistoryConfig, props.undoHistoryConfig);
1470
+ },
1466
1471
  tabsResizeFlag() {
1467
1472
  const $xeTable = this;
1468
1473
  const $xeTabs = $xeTable.$xeTabs;
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  import { getFuncText } from './src/utils';
3
- export const version = "3.19.35";
3
+ export const version = "3.19.36";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
@@ -255,6 +255,9 @@ VxeUI.setConfig({
255
255
  // position: 'right',
256
256
  visible: true
257
257
  }
258
+ },
259
+ undoHistoryConfig: {
260
+ isEditRow: true
258
261
  }
259
262
  },
260
263
  grid: {
package/es/ui/src/log.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const version = `table v${"3.19.35"}`;
3
+ const version = `table v${"3.19.36"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
package/lib/index.umd.js CHANGED
@@ -2005,7 +2005,7 @@ function getClass(property, params) {
2005
2005
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
2006
2006
 
2007
2007
 
2008
- const version = "3.19.35";
2008
+ const version = "3.19.36";
2009
2009
  core_.VxeUI.version = version;
2010
2010
  core_.VxeUI.tableVersion = version;
2011
2011
  core_.VxeUI.setConfig({
@@ -2260,6 +2260,9 @@ core_.VxeUI.setConfig({
2260
2260
  // position: 'right',
2261
2261
  visible: true
2262
2262
  }
2263
+ },
2264
+ undoHistoryConfig: {
2265
+ isEditRow: true
2263
2266
  }
2264
2267
  },
2265
2268
  grid: {
@@ -2715,7 +2718,7 @@ function isNodeElement(elem) {
2715
2718
  const {
2716
2719
  log: log_log
2717
2720
  } = core_.VxeUI;
2718
- const log_version = `table v${"3.19.35"}`;
2721
+ const log_version = `table v${"3.19.36"}`;
2719
2722
  const warnLog = log_log.create('warn', log_version);
2720
2723
  const errLog = log_log.create('error', log_version);
2721
2724
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -3991,15 +3994,23 @@ function getFooterContent(h, params) {
3991
3994
  column,
3992
3995
  row
3993
3996
  } = params;
3997
+ const tableProps = $table;
3998
+ const {
3999
+ editConfig
4000
+ } = tableProps;
3994
4001
  const {
3995
4002
  slots,
3996
4003
  editRender,
3997
4004
  cellRender
3998
4005
  } = column;
3999
- const renderOpts = editRender || cellRender;
4000
- if (slots && slots.footer) {
4001
- return $table.callSlot(slots.footer, params, h);
4006
+ const footerSlot = slots ? slots.footer : null;
4007
+ if (footerSlot) {
4008
+ return $table.callSlot(footerSlot, params, h);
4002
4009
  }
4010
+ const isEnableEdit = editConfig && isEnableConf(editConfig);
4011
+ const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
4012
+ const cellRenderOpts = isEnableConf(cellRender) ? cellRender : null;
4013
+ const renderOpts = editRenderOpts || cellRenderOpts;
4003
4014
  const itemValue = $table.getFooterCellLabel(row, column);
4004
4015
  if (renderOpts) {
4005
4016
  const compConf = cell_renderer.get(renderOpts.name);
@@ -4061,7 +4072,9 @@ function renderCellHandle(h, params) {
4061
4072
  case 'html':
4062
4073
  return isDeepCell ? Cell.renderDeepHTMLCell(h, params) : Cell.renderHTMLCell(h, params);
4063
4074
  }
4064
- if (editConfig && isEnableConf(editOpts) && editRender) {
4075
+ const isEnableEdit = editConfig && isEnableConf(editConfig);
4076
+ const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
4077
+ if (editRenderOpts) {
4065
4078
  return editOpts.mode === 'cell' ? isDeepCell ? Cell.renderDeepCellEdit(h, params) : Cell.renderCellEdit(h, params) : isDeepCell ? Cell.renderDeepRowEdit(h, params) : Cell.renderRowEdit(h, params);
4066
4079
  }
4067
4080
  return isDeepCell ? Cell.renderDeepCell(h, params) : Cell.renderDefaultCell(h, params);
@@ -4075,7 +4088,6 @@ function renderHeaderHandle(h, params) {
4075
4088
  const {
4076
4089
  editConfig
4077
4090
  } = tableProps;
4078
- const editOpts = $table.computeEditOpts;
4079
4091
  const {
4080
4092
  type,
4081
4093
  filters,
@@ -4099,7 +4111,9 @@ function renderHeaderHandle(h, params) {
4099
4111
  }
4100
4112
  break;
4101
4113
  }
4102
- if (editConfig && isEnableConf(editOpts) && editRender) {
4114
+ const isEnableEdit = editConfig && isEnableConf(editConfig);
4115
+ const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
4116
+ if (editRenderOpts) {
4103
4117
  return Cell.renderEditHeader(h, params);
4104
4118
  } else if (filters && sortable) {
4105
4119
  return Cell.renderSortAndFilterHeader(h, params);
@@ -4136,15 +4150,23 @@ const Cell = {
4136
4150
  $table,
4137
4151
  column
4138
4152
  } = params;
4153
+ const tableProps = $table;
4154
+ const {
4155
+ editConfig
4156
+ } = tableProps;
4139
4157
  const {
4140
4158
  slots,
4141
4159
  editRender,
4142
4160
  cellRender
4143
4161
  } = column;
4144
- const renderOpts = editRender || cellRender;
4145
- if (slots && slots.header) {
4146
- return renderTitleContent(h, params, $table.callSlot(slots.header, params, h));
4162
+ const headerSlot = slots ? slots.header : null;
4163
+ if (headerSlot) {
4164
+ return renderTitleContent(h, params, $table.callSlot(headerSlot, params, h));
4147
4165
  }
4166
+ const isEnableEdit = editConfig && isEnableConf(editConfig);
4167
+ const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
4168
+ const cellRenderOpts = isEnableConf(cellRender) ? cellRender : null;
4169
+ const renderOpts = editRenderOpts || cellRenderOpts;
4148
4170
  if (renderOpts) {
4149
4171
  const compConf = cell_renderer.get(renderOpts.name);
4150
4172
  const rtHeader = compConf ? compConf.renderTableHeader || compConf.renderHeader : null;
@@ -4181,7 +4203,9 @@ const Cell = {
4181
4203
  aggFunc,
4182
4204
  formatter
4183
4205
  } = column;
4184
- const renderOpts = editConfig && isEnableConf(editRender) ? editRender : isEnableConf(cellRender) ? cellRender : null;
4206
+ const isEnableEdit = editConfig && isEnableConf(editConfig);
4207
+ const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
4208
+ const cellRenderOpts = isEnableConf(cellRender) ? cellRender : null;
4185
4209
  const defaultSlot = slots ? slots.default : null;
4186
4210
  const gcSlot = slots ? slots.groupContent || slots['group-content'] : null;
4187
4211
  const gvSlot = slots ? slots.groupValues || slots['group-values'] : null;
@@ -4274,26 +4298,25 @@ const Cell = {
4274
4298
  if (defaultSlot) {
4275
4299
  return renderCellBaseVNs(h, params, $table.callSlot(defaultSlot, params, h));
4276
4300
  }
4301
+ const renderOpts = editRenderOpts || cellRenderOpts;
4277
4302
  // formatter > (renderTableCell | renderTableDefault)
4278
4303
  if (renderOpts && !formatter) {
4279
4304
  const compConf = cell_renderer.get(renderOpts.name);
4280
- const rtDefault = compConf ? compConf.renderTableDefault || compConf.renderDefault : null;
4281
- const rtCell = compConf ? compConf.renderTableCell || compConf.renderCell : null;
4282
- const renderFn = editRender ? rtCell : rtDefault;
4305
+ const renderFn = editRenderOpts ? compConf.renderTableCell || compConf.renderCell : compConf.renderTableDefault || compConf.renderDefault;
4283
4306
  if (renderFn) {
4284
4307
  return renderCellBaseVNs(h, params, getSlotVNs(renderFn.call($table, h, renderOpts, Object.assign({
4285
- $type: editRender ? 'edit' : 'cell'
4308
+ $type: editRenderOpts ? 'edit' : 'cell'
4286
4309
  }, params))));
4287
4310
  }
4288
4311
  }
4289
4312
  cellValue = $table.getCellLabel(row, column);
4290
4313
  }
4291
- const cellPlaceholder = editRender ? editRender.placeholder : '';
4314
+ const cellPlaceholder = editRenderOpts ? editRenderOpts.placeholder : '';
4292
4315
  return renderCellBaseVNs(h, params, [h('span', {
4293
4316
  class: 'vxe-cell--label'
4294
4317
  }, [
4295
4318
  // 如果设置占位符
4296
- editRender && eqEmptyValue(cellValue) ? h('span', {
4319
+ editRenderOpts && eqEmptyValue(cellValue) ? h('span', {
4297
4320
  class: 'vxe-cell--placeholder'
4298
4321
  }, formatText(getFuncText(cellPlaceholder), 1)) : h('span', formatText(cellValue, 1))])]);
4299
4322
  },
@@ -5111,6 +5134,8 @@ const Cell = {
5111
5134
  filters,
5112
5135
  editRender
5113
5136
  } = column;
5137
+ const isEnableEdit = editConfig && isEnableConf(editConfig);
5138
+ const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
5114
5139
  let isRequired = false;
5115
5140
  if (editRules) {
5116
5141
  const columnRules = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(editRules, column.field);
@@ -5119,7 +5144,7 @@ const Cell = {
5119
5144
  }
5120
5145
  }
5121
5146
  let editIconVNs = [];
5122
- if (isEnableConf(editConfig)) {
5147
+ if (isEnableEdit) {
5123
5148
  const {
5124
5149
  showAsterisk,
5125
5150
  showIcon,
@@ -5129,7 +5154,7 @@ const Cell = {
5129
5154
  class: 'vxe-cell--required-icon'
5130
5155
  }, [h('i', {
5131
5156
  class: 'vxe-cell--required-icon'
5132
- })]) : renderEmptyElement($table), isEnableConf(editRender) && showIcon ? h('i', {
5157
+ })]) : renderEmptyElement($table), editRenderOpts && showIcon ? h('i', {
5133
5158
  class: 'vxe-cell--edit-icon'
5134
5159
  }, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(icon) ? getSlotVNs(icon({})) : [h('i', {
5135
5160
  class: icon || cell_getIcon().TABLE_EDIT
@@ -5143,7 +5168,11 @@ const Cell = {
5143
5168
  $table,
5144
5169
  column
5145
5170
  } = params;
5171
+ const tableProps = $table;
5146
5172
  const tableReactData = $table;
5173
+ const {
5174
+ editConfig
5175
+ } = tableProps;
5147
5176
  const {
5148
5177
  editStore
5149
5178
  } = tableReactData;
@@ -5153,7 +5182,9 @@ const Cell = {
5153
5182
  const {
5154
5183
  editRender
5155
5184
  } = column;
5156
- return Cell.runRenderer(h, params, this, isEnableConf(editRender) && actived && actived.row === params.row);
5185
+ const isEnableEdit = editConfig && isEnableConf(editConfig);
5186
+ const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
5187
+ return Cell.runRenderer(h, params, !!(editRenderOpts && actived && actived.row === params.row));
5157
5188
  },
5158
5189
  renderDeepRowEdit(h, params) {
5159
5190
  return Cell.renderDeepNodeBtn(h, params, Cell.renderRowEdit(h, params));
@@ -5164,7 +5195,11 @@ const Cell = {
5164
5195
  $table,
5165
5196
  column
5166
5197
  } = params;
5198
+ const tableProps = $table;
5167
5199
  const tableReactData = $table;
5200
+ const {
5201
+ editConfig
5202
+ } = tableProps;
5168
5203
  const {
5169
5204
  editStore
5170
5205
  } = tableReactData;
@@ -5174,7 +5209,9 @@ const Cell = {
5174
5209
  const {
5175
5210
  editRender
5176
5211
  } = column;
5177
- return Cell.runRenderer(h, params, this, isEnableConf(editRender) && actived && actived.row === params.row && actived.column === params.column);
5212
+ const isEnableEdit = editConfig && isEnableConf(editConfig);
5213
+ const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
5214
+ return Cell.runRenderer(h, params, !!(editRenderOpts && actived && actived.row === params.row && actived.column === params.column));
5178
5215
  },
5179
5216
  renderDeepCellEdit(h, params) {
5180
5217
  return Cell.renderDeepNodeBtn(h, params, Cell.renderCellEdit(h, params));
@@ -5185,7 +5222,11 @@ const Cell = {
5185
5222
  row,
5186
5223
  column
5187
5224
  } = params;
5225
+ const tableProps = $table;
5188
5226
  const tableReactData = $table;
5227
+ const {
5228
+ editConfig
5229
+ } = tableProps;
5189
5230
  const {
5190
5231
  isRowGroupStatus
5191
5232
  } = tableReactData;
@@ -5195,18 +5236,20 @@ const Cell = {
5195
5236
  editRender,
5196
5237
  formatter
5197
5238
  } = column;
5198
- const compConf = cell_renderer.get(editRender.name);
5199
- const rtEdit = compConf ? compConf.renderTableEdit || compConf.renderEdit : null;
5239
+ const isEnableEdit = editConfig && isEnableConf(editConfig);
5240
+ const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null;
5200
5241
  const defaultSlot = slots ? slots.default : null;
5201
5242
  const gcSlot = slots ? slots.groupContent || slots['group-content'] : null;
5202
5243
  const cellParams = Object.assign({
5203
5244
  $type: '',
5204
5245
  isEdit
5205
5246
  }, params);
5206
- if (isEdit) {
5247
+ if (isEdit && editRenderOpts) {
5207
5248
  if (slots && slots.edit) {
5208
5249
  return $table.callSlot(slots.edit, cellParams, h);
5209
5250
  }
5251
+ const compConf = cell_renderer.get(editRender.name);
5252
+ const rtEdit = compConf ? compConf.renderTableEdit || compConf.renderEdit : null;
5210
5253
  if (rtEdit) {
5211
5254
  return getSlotVNs(rtEdit.call($table, h, editRender, cellParams));
5212
5255
  }
@@ -5832,6 +5875,8 @@ const tableProps = {
5832
5875
  virtualYConfig: Object,
5833
5876
  // 滚动条配置项
5834
5877
  scrollbarConfig: Object,
5878
+ // 可撤销配置项
5879
+ undoHistoryConfig: Object,
5835
5880
  // (即将废弃)优化相关
5836
5881
  animat: {
5837
5882
  type: Boolean,
@@ -18812,6 +18857,11 @@ function renderBody(h, $xeTable) {
18812
18857
  }
18813
18858
  return [];
18814
18859
  },
18860
+ computeUndoHistoryOpts() {
18861
+ const $xeTable = this;
18862
+ const props = $xeTable;
18863
+ return Object.assign({}, table_getConfig().table.undoHistoryConfig, props.undoHistoryConfig);
18864
+ },
18815
18865
  tabsResizeFlag() {
18816
18866
  const $xeTable = this;
18817
18867
  const $xeTabs = $xeTable.$xeTabs;