vxe-table 3.17.11 → 3.17.13

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.
@@ -369,6 +369,7 @@ export const Cell = {
369
369
  const { isRowGroupStatus } = tableReactData;
370
370
  const { field, slots, editRender, cellRender, rowGroupNode, aggFunc } = column;
371
371
  const renderOpts = editRender || cellRender;
372
+ const gcSlot = slots ? (slots.groupContent || slots['group-content']) : null;
372
373
  let cellValue = '';
373
374
  if (isRowGroupStatus && field && row.isAggregate) {
374
375
  const aggRow = row;
@@ -387,15 +388,23 @@ export const Cell = {
387
388
  groupColumn: (colRest ? colRest.column : null),
388
389
  column,
389
390
  groupValue: groupContent,
390
- children: childList,
391
+ childList,
391
392
  childCount,
392
393
  aggValue: null,
394
+ /**
395
+ * 已废弃
396
+ * @deprecated
397
+ */
398
+ children: childList,
393
399
  /**
394
400
  * 已废弃
395
401
  * @deprecated
396
402
  */
397
403
  totalValue: childCount
398
404
  };
405
+ if (gcSlot) {
406
+ return renderCellBaseVNs(h, params, $table.callSlot(gcSlot, Object.assign({ groupField, groupContent, childList, childCount }, params), h));
407
+ }
399
408
  if (mode === 'column' ? field === aggRow.groupField : rowGroupNode) {
400
409
  cellValue = groupContent;
401
410
  if (contentMethod) {
@@ -1116,10 +1125,14 @@ export const Cell = {
1116
1125
  return Cell.renderDeepNodeBtn(h, params, Cell.renderCellEdit(h, params));
1117
1126
  },
1118
1127
  runRenderer(h, params, _vm, isEdit) {
1119
- const { $table, column } = params;
1120
- const { slots, editRender, formatter } = column;
1128
+ const { $table, row, column } = params;
1129
+ const tableReactData = $table;
1130
+ const { isRowGroupStatus } = tableReactData;
1131
+ const { slots, field, editRender, formatter } = column;
1121
1132
  const compConf = renderer.get(editRender.name);
1122
1133
  const rtEdit = compConf ? (compConf.renderTableEdit || compConf.renderEdit) : null;
1134
+ const defaultSlot = slots ? slots.default : null;
1135
+ const gcSlot = slots ? (slots.groupContent || slots['group-content']) : null;
1123
1136
  const cellParams = Object.assign({ $type: '', isEdit }, params);
1124
1137
  if (isEdit) {
1125
1138
  if (slots && slots.edit) {
@@ -1130,8 +1143,22 @@ export const Cell = {
1130
1143
  }
1131
1144
  return [];
1132
1145
  }
1133
- if (slots && slots.default) {
1134
- return renderCellBaseVNs(h, params, $table.callSlot(slots.default, cellParams, h));
1146
+ if (isRowGroupStatus && field && row.isAggregate) {
1147
+ const aggRow = row;
1148
+ const aggregateOpts = $table.computeAggregateOpts;
1149
+ const { mapChildrenField } = aggregateOpts;
1150
+ const groupField = aggRow.groupField;
1151
+ const groupContent = aggRow.groupContent;
1152
+ const childList = mapChildrenField ? (aggRow[mapChildrenField] || []) : [];
1153
+ const childCount = aggRow.childCount;
1154
+ if (gcSlot) {
1155
+ return renderCellBaseVNs(h, params, $table.callSlot(gcSlot, Object.assign({ groupField, groupContent, childList, childCount }, params), h));
1156
+ }
1157
+ }
1158
+ else {
1159
+ if (defaultSlot) {
1160
+ return renderCellBaseVNs(h, params, $table.callSlot(defaultSlot, cellParams, h));
1161
+ }
1135
1162
  }
1136
1163
  if (formatter) {
1137
1164
  return renderCellBaseVNs(h, params, [
@@ -3018,6 +3018,7 @@ function loadTableData($xeTable, datas, isReset) {
3018
3018
  }).then(() => {
3019
3019
  computeScrollLoad($xeTable);
3020
3020
  }).then(() => {
3021
+ const virtualYOpts = $xeTable.computeVirtualYOpts;
3021
3022
  // 是否启用了虚拟滚动
3022
3023
  if (sYLoad) {
3023
3024
  scrollYStore.endIndex = scrollYStore.visibleSize;
@@ -3026,6 +3027,9 @@ function loadTableData($xeTable, datas, isReset) {
3026
3027
  if (reactData.expandColumn && expandOpts.mode !== 'fixed') {
3027
3028
  errLog('vxe.error.notConflictProp', ['column.type="expand', 'expand-config.mode="fixed"']);
3028
3029
  }
3030
+ if (virtualYOpts.mode === 'scroll' && expandOpts.mode === 'fixed') {
3031
+ warnLog('vxe.error.notConflictProp', ['virtual-y-config.mode=scroll', 'expand-config.mode=inside']);
3032
+ }
3029
3033
  // if (showOverflow) {
3030
3034
  // if (!rowOpts.height) {
3031
3035
  // const errColumn = internalData.tableFullColumn.find(column => column.showOverflow === false)
@@ -1464,6 +1464,12 @@ export default {
1464
1464
  if (props.resizable) {
1465
1465
  warnLog('vxe.error.delProp', ['resizable', 'column-config.resizable']);
1466
1466
  }
1467
+ if (props.virtualXConfig && props.scrollX) {
1468
+ warnLog('vxe.error.notSupportProp', ['virtual-x-config', 'scroll-x', 'scroll-x=null']);
1469
+ }
1470
+ if (props.virtualYConfig && props.scrollY) {
1471
+ warnLog('vxe.error.notSupportProp', ['virtual-y-config', 'scroll-y', 'scroll-y=null']);
1472
+ }
1467
1473
  // if (props.scrollY) {
1468
1474
  // warnLog('vxe.error.delProp', ['scroll-y', 'virtual-y-config'])
1469
1475
  // }
@@ -1550,7 +1556,15 @@ export default {
1550
1556
  errLog('vxe.error.errConflicts', ['tree-config', 'checkbox-config.isShiftKey']);
1551
1557
  }
1552
1558
  if (checkboxOpts.halfField) {
1553
- warnLog('vxe.error.delProp', ['checkbox-config.halfField', 'checkbox-config.indeterminateField']);
1559
+ errLog('vxe.error.delProp', ['checkbox-config.halfField', 'checkbox-config.indeterminateField']);
1560
+ }
1561
+ if (treeConfig) {
1562
+ XEUtils.arrayEach(['rowField', 'parentField', 'childrenField', 'hasChildField', 'mapChildrenField'], key => {
1563
+ const val = treeOpts[key];
1564
+ if (val && val.indexOf('.') > -1) {
1565
+ errLog('vxe.error.errProp', [`${key}=${val}`, `${key}=${val.split('.')[0]}`]);
1566
+ }
1567
+ });
1554
1568
  }
1555
1569
  // 在 v3.0 中废弃 context-menu
1556
1570
  if (this.contextMenu) {
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.17.11";
3
+ export const version = "3.17.13";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
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.17.11"}`;
3
+ const version = `table v${"3.17.13"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
package/lib/index.umd.js CHANGED
@@ -3234,7 +3234,7 @@ function getClass(property, params) {
3234
3234
  ;// ./packages/ui/index.ts
3235
3235
 
3236
3236
 
3237
- const version = "3.17.11";
3237
+ const version = "3.17.13";
3238
3238
  core_.VxeUI.version = version;
3239
3239
  core_.VxeUI.tableVersion = version;
3240
3240
  core_.VxeUI.setConfig({
@@ -3918,7 +3918,7 @@ var es_iterator_map = __webpack_require__(1701);
3918
3918
  const {
3919
3919
  log: log_log
3920
3920
  } = core_.VxeUI;
3921
- const log_version = `table v${"3.17.11"}`;
3921
+ const log_version = `table v${"3.17.13"}`;
3922
3922
  const warnLog = log_log.create('warn', log_version);
3923
3923
  const errLog = log_log.create('error', log_version);
3924
3924
  ;// ./packages/table/src/columnInfo.ts
@@ -5344,6 +5344,7 @@ const Cell = {
5344
5344
  aggFunc
5345
5345
  } = column;
5346
5346
  const renderOpts = editRender || cellRender;
5347
+ const gcSlot = slots ? slots.groupContent || slots['group-content'] : null;
5347
5348
  let cellValue = '';
5348
5349
  if (isRowGroupStatus && field && row.isAggregate) {
5349
5350
  const aggRow = row;
@@ -5371,15 +5372,28 @@ const Cell = {
5371
5372
  groupColumn: colRest ? colRest.column : null,
5372
5373
  column,
5373
5374
  groupValue: groupContent,
5374
- children: childList,
5375
+ childList,
5375
5376
  childCount,
5376
5377
  aggValue: null,
5378
+ /**
5379
+ * 已废弃
5380
+ * @deprecated
5381
+ */
5382
+ children: childList,
5377
5383
  /**
5378
5384
  * 已废弃
5379
5385
  * @deprecated
5380
5386
  */
5381
5387
  totalValue: childCount
5382
5388
  };
5389
+ if (gcSlot) {
5390
+ return renderCellBaseVNs(h, params, $table.callSlot(gcSlot, Object.assign({
5391
+ groupField,
5392
+ groupContent,
5393
+ childList,
5394
+ childCount
5395
+ }, params), h));
5396
+ }
5383
5397
  if (mode === 'column' ? field === aggRow.groupField : rowGroupNode) {
5384
5398
  cellValue = groupContent;
5385
5399
  if (contentMethod) {
@@ -6268,15 +6282,23 @@ const Cell = {
6268
6282
  runRenderer(h, params, _vm, isEdit) {
6269
6283
  const {
6270
6284
  $table,
6285
+ row,
6271
6286
  column
6272
6287
  } = params;
6288
+ const tableReactData = $table;
6289
+ const {
6290
+ isRowGroupStatus
6291
+ } = tableReactData;
6273
6292
  const {
6274
6293
  slots,
6294
+ field,
6275
6295
  editRender,
6276
6296
  formatter
6277
6297
  } = column;
6278
6298
  const compConf = cell_renderer.get(editRender.name);
6279
6299
  const rtEdit = compConf ? compConf.renderTableEdit || compConf.renderEdit : null;
6300
+ const defaultSlot = slots ? slots.default : null;
6301
+ const gcSlot = slots ? slots.groupContent || slots['group-content'] : null;
6280
6302
  const cellParams = Object.assign({
6281
6303
  $type: '',
6282
6304
  isEdit
@@ -6290,8 +6312,28 @@ const Cell = {
6290
6312
  }
6291
6313
  return [];
6292
6314
  }
6293
- if (slots && slots.default) {
6294
- return renderCellBaseVNs(h, params, $table.callSlot(slots.default, cellParams, h));
6315
+ if (isRowGroupStatus && field && row.isAggregate) {
6316
+ const aggRow = row;
6317
+ const aggregateOpts = $table.computeAggregateOpts;
6318
+ const {
6319
+ mapChildrenField
6320
+ } = aggregateOpts;
6321
+ const groupField = aggRow.groupField;
6322
+ const groupContent = aggRow.groupContent;
6323
+ const childList = mapChildrenField ? aggRow[mapChildrenField] || [] : [];
6324
+ const childCount = aggRow.childCount;
6325
+ if (gcSlot) {
6326
+ return renderCellBaseVNs(h, params, $table.callSlot(gcSlot, Object.assign({
6327
+ groupField,
6328
+ groupContent,
6329
+ childList,
6330
+ childCount
6331
+ }, params), h));
6332
+ }
6333
+ } else {
6334
+ if (defaultSlot) {
6335
+ return renderCellBaseVNs(h, params, $table.callSlot(defaultSlot, cellParams, h));
6336
+ }
6295
6337
  }
6296
6338
  if (formatter) {
6297
6339
  return renderCellBaseVNs(h, params, [h('span', {
@@ -10554,6 +10596,7 @@ function loadTableData($xeTable, datas, isReset) {
10554
10596
  }).then(() => {
10555
10597
  computeScrollLoad($xeTable);
10556
10598
  }).then(() => {
10599
+ const virtualYOpts = $xeTable.computeVirtualYOpts;
10557
10600
  // 是否启用了虚拟滚动
10558
10601
  if (sYLoad) {
10559
10602
  scrollYStore.endIndex = scrollYStore.visibleSize;
@@ -10562,6 +10605,9 @@ function loadTableData($xeTable, datas, isReset) {
10562
10605
  if (reactData.expandColumn && expandOpts.mode !== 'fixed') {
10563
10606
  errLog('vxe.error.notConflictProp', ['column.type="expand', 'expand-config.mode="fixed"']);
10564
10607
  }
10608
+ if (virtualYOpts.mode === 'scroll' && expandOpts.mode === 'fixed') {
10609
+ warnLog('vxe.error.notConflictProp', ['virtual-y-config.mode=scroll', 'expand-config.mode=inside']);
10610
+ }
10565
10611
  // if (showOverflow) {
10566
10612
  // if (!rowOpts.height) {
10567
10613
  // const errColumn = internalData.tableFullColumn.find(column => column.showOverflow === false)
@@ -31309,6 +31355,12 @@ function renderBody(h, $xeTable) {
31309
31355
  if (props.resizable) {
31310
31356
  warnLog('vxe.error.delProp', ['resizable', 'column-config.resizable']);
31311
31357
  }
31358
+ if (props.virtualXConfig && props.scrollX) {
31359
+ warnLog('vxe.error.notSupportProp', ['virtual-x-config', 'scroll-x', 'scroll-x=null']);
31360
+ }
31361
+ if (props.virtualYConfig && props.scrollY) {
31362
+ warnLog('vxe.error.notSupportProp', ['virtual-y-config', 'scroll-y', 'scroll-y=null']);
31363
+ }
31312
31364
  // if (props.scrollY) {
31313
31365
  // warnLog('vxe.error.delProp', ['scroll-y', 'virtual-y-config'])
31314
31366
  // }
@@ -31395,7 +31447,15 @@ function renderBody(h, $xeTable) {
31395
31447
  errLog('vxe.error.errConflicts', ['tree-config', 'checkbox-config.isShiftKey']);
31396
31448
  }
31397
31449
  if (checkboxOpts.halfField) {
31398
- warnLog('vxe.error.delProp', ['checkbox-config.halfField', 'checkbox-config.indeterminateField']);
31450
+ errLog('vxe.error.delProp', ['checkbox-config.halfField', 'checkbox-config.indeterminateField']);
31451
+ }
31452
+ if (treeConfig) {
31453
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(['rowField', 'parentField', 'childrenField', 'hasChildField', 'mapChildrenField'], key => {
31454
+ const val = treeOpts[key];
31455
+ if (val && val.indexOf('.') > -1) {
31456
+ errLog('vxe.error.errProp', [`${key}=${val}`, `${key}=${val.split('.')[0]}`]);
31457
+ }
31458
+ });
31399
31459
  }
31400
31460
  // 在 v3.0 中废弃 context-menu
31401
31461
  if (this.contextMenu) {