vxe-table 3.18.0-beta.4 → 3.18.0-beta.6

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,8 @@ 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 defaultSlot = slots ? slots.default : null;
373
+ const gcSlot = slots ? (slots.groupContent || slots['group-content']) : null;
372
374
  let cellValue = '';
373
375
  if (isRowGroupStatus && field && row.isAggregate) {
374
376
  const aggRow = row;
@@ -387,15 +389,23 @@ export const Cell = {
387
389
  groupColumn: (colRest ? colRest.column : null),
388
390
  column,
389
391
  groupValue: groupContent,
390
- children: childList,
392
+ childList,
391
393
  childCount,
392
394
  aggValue: null,
395
+ /**
396
+ * 已废弃
397
+ * @deprecated
398
+ */
399
+ children: childList,
393
400
  /**
394
401
  * 已废弃
395
402
  * @deprecated
396
403
  */
397
404
  totalValue: childCount
398
405
  };
406
+ if (gcSlot) {
407
+ return renderCellBaseVNs(h, params, $table.callSlot(gcSlot, Object.assign({ groupField, groupContent, childList, childCount }, params), h));
408
+ }
399
409
  if (mode === 'column' ? field === aggRow.groupField : rowGroupNode) {
400
410
  cellValue = groupContent;
401
411
  if (contentMethod) {
@@ -416,8 +426,8 @@ export const Cell = {
416
426
  }
417
427
  }
418
428
  else {
419
- if (slots && slots.default) {
420
- return renderCellBaseVNs(h, params, $table.callSlot(slots.default, params, h));
429
+ if (defaultSlot) {
430
+ return renderCellBaseVNs(h, params, $table.callSlot(defaultSlot, params, h));
421
431
  }
422
432
  if (renderOpts) {
423
433
  const compConf = renderer.get(renderOpts.name);
@@ -1116,10 +1126,14 @@ export const Cell = {
1116
1126
  return Cell.renderDeepNodeBtn(h, params, Cell.renderCellEdit(h, params));
1117
1127
  },
1118
1128
  runRenderer(h, params, _vm, isEdit) {
1119
- const { $table, column } = params;
1120
- const { slots, editRender, formatter } = column;
1129
+ const { $table, row, column } = params;
1130
+ const tableReactData = $table;
1131
+ const { isRowGroupStatus } = tableReactData;
1132
+ const { slots, field, editRender, formatter } = column;
1121
1133
  const compConf = renderer.get(editRender.name);
1122
1134
  const rtEdit = compConf ? (compConf.renderTableEdit || compConf.renderEdit) : null;
1135
+ const defaultSlot = slots ? slots.default : null;
1136
+ const gcSlot = slots ? (slots.groupContent || slots['group-content']) : null;
1123
1137
  const cellParams = Object.assign({ $type: '', isEdit }, params);
1124
1138
  if (isEdit) {
1125
1139
  if (slots && slots.edit) {
@@ -1130,8 +1144,22 @@ export const Cell = {
1130
1144
  }
1131
1145
  return [];
1132
1146
  }
1133
- if (slots && slots.default) {
1134
- return renderCellBaseVNs(h, params, $table.callSlot(slots.default, cellParams, h));
1147
+ if (isRowGroupStatus && field && row.isAggregate) {
1148
+ const aggRow = row;
1149
+ const aggregateOpts = $table.computeAggregateOpts;
1150
+ const { mapChildrenField } = aggregateOpts;
1151
+ const groupField = aggRow.groupField;
1152
+ const groupContent = aggRow.groupContent;
1153
+ const childList = mapChildrenField ? (aggRow[mapChildrenField] || []) : [];
1154
+ const childCount = aggRow.childCount;
1155
+ if (gcSlot) {
1156
+ return renderCellBaseVNs(h, params, $table.callSlot(gcSlot, Object.assign({ groupField, groupContent, childList, childCount }, params), h));
1157
+ }
1158
+ }
1159
+ else {
1160
+ if (defaultSlot) {
1161
+ return renderCellBaseVNs(h, params, $table.callSlot(defaultSlot, cellParams, h));
1162
+ }
1135
1163
  }
1136
1164
  if (formatter) {
1137
1165
  return renderCellBaseVNs(h, params, [
@@ -3032,6 +3032,7 @@ function loadTableData($xeTable, datas, isReset) {
3032
3032
  }).then(() => {
3033
3033
  computeScrollLoad($xeTable);
3034
3034
  }).then(() => {
3035
+ const virtualYOpts = $xeTable.computeVirtualYOpts;
3035
3036
  // 是否启用了虚拟滚动
3036
3037
  if (sYLoad) {
3037
3038
  scrollYStore.endIndex = scrollYStore.visibleSize;
@@ -3040,6 +3041,9 @@ function loadTableData($xeTable, datas, isReset) {
3040
3041
  if (reactData.expandColumn && expandOpts.mode !== 'fixed') {
3041
3042
  errLog('vxe.error.notConflictProp', ['column.type="expand', 'expand-config.mode="fixed"']);
3042
3043
  }
3044
+ if (virtualYOpts.mode === 'scroll' && expandOpts.mode === 'fixed') {
3045
+ warnLog('vxe.error.notConflictProp', ['virtual-y-config.mode=scroll', 'expand-config.mode=inside']);
3046
+ }
3043
3047
  // if (showOverflow) {
3044
3048
  // if (!rowOpts.height) {
3045
3049
  // const errColumn = internalData.tableFullColumn.find(column => column.showOverflow === false)
@@ -3756,7 +3760,7 @@ const Methods = {
3756
3760
  const $xeGGWrapper = $xeGrid || $xeGantt;
3757
3761
  if (slotFunc) {
3758
3762
  if ($xeGGWrapper) {
3759
- return $xeGGWrapper.callSlot(slotFunc, params, h, vNodes);
3763
+ return $xeGGWrapper.callSlot(slotFunc, params, h);
3760
3764
  }
3761
3765
  // if (XEUtils.isString(slotFunc)) {
3762
3766
  // slotFunc = slots[slotFunc] || null
@@ -1471,6 +1471,15 @@ export default {
1471
1471
  if (props.resizable) {
1472
1472
  warnLog('vxe.error.delProp', ['resizable', 'column-config.resizable']);
1473
1473
  }
1474
+ if (props.virtualXConfig && props.scrollX) {
1475
+ warnLog('vxe.error.notSupportProp', ['virtual-x-config', 'scroll-x', 'scroll-x=null']);
1476
+ }
1477
+ if (props.virtualYConfig && props.scrollY) {
1478
+ warnLog('vxe.error.notSupportProp', ['virtual-y-config', 'scroll-y', 'scroll-y=null']);
1479
+ }
1480
+ if (props.aggregateConfig && props.rowGroupConfig) {
1481
+ warnLog('vxe.error.notSupportProp', ['aggregate-config', 'row-group-config', 'row-group-config=null']);
1482
+ }
1474
1483
  // if (props.scrollY) {
1475
1484
  // warnLog('vxe.error.delProp', ['scroll-y', 'virtual-y-config'])
1476
1485
  // }
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.18.0-beta.4";
3
+ export const version = "3.18.0-beta.6";
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.18.0-beta.4"}`;
3
+ const version = `table v${"3.18.0-beta.6"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
package/lib/index.umd.js CHANGED
@@ -2002,7 +2002,7 @@ function getClass(property, params) {
2002
2002
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
2003
2003
 
2004
2004
 
2005
- const version = "3.18.0-beta.4";
2005
+ const version = "3.18.0-beta.6";
2006
2006
  core_.VxeUI.version = version;
2007
2007
  core_.VxeUI.tableVersion = version;
2008
2008
  core_.VxeUI.setConfig({
@@ -2678,7 +2678,7 @@ function isNodeElement(elem) {
2678
2678
  const {
2679
2679
  log: log_log
2680
2680
  } = core_.VxeUI;
2681
- const log_version = `table v${"3.18.0-beta.4"}`;
2681
+ const log_version = `table v${"3.18.0-beta.6"}`;
2682
2682
  const warnLog = log_log.create('warn', log_version);
2683
2683
  const errLog = log_log.create('error', log_version);
2684
2684
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -4105,6 +4105,8 @@ const Cell = {
4105
4105
  aggFunc
4106
4106
  } = column;
4107
4107
  const renderOpts = editRender || cellRender;
4108
+ const defaultSlot = slots ? slots.default : null;
4109
+ const gcSlot = slots ? slots.groupContent || slots['group-content'] : null;
4108
4110
  let cellValue = '';
4109
4111
  if (isRowGroupStatus && field && row.isAggregate) {
4110
4112
  const aggRow = row;
@@ -4132,15 +4134,28 @@ const Cell = {
4132
4134
  groupColumn: colRest ? colRest.column : null,
4133
4135
  column,
4134
4136
  groupValue: groupContent,
4135
- children: childList,
4137
+ childList,
4136
4138
  childCount,
4137
4139
  aggValue: null,
4140
+ /**
4141
+ * 已废弃
4142
+ * @deprecated
4143
+ */
4144
+ children: childList,
4138
4145
  /**
4139
4146
  * 已废弃
4140
4147
  * @deprecated
4141
4148
  */
4142
4149
  totalValue: childCount
4143
4150
  };
4151
+ if (gcSlot) {
4152
+ return renderCellBaseVNs(h, params, $table.callSlot(gcSlot, Object.assign({
4153
+ groupField,
4154
+ groupContent,
4155
+ childList,
4156
+ childCount
4157
+ }, params), h));
4158
+ }
4144
4159
  if (mode === 'column' ? field === aggRow.groupField : rowGroupNode) {
4145
4160
  cellValue = groupContent;
4146
4161
  if (contentMethod) {
@@ -4158,8 +4173,8 @@ const Cell = {
4158
4173
  }
4159
4174
  }
4160
4175
  } else {
4161
- if (slots && slots.default) {
4162
- return renderCellBaseVNs(h, params, $table.callSlot(slots.default, params, h));
4176
+ if (defaultSlot) {
4177
+ return renderCellBaseVNs(h, params, $table.callSlot(defaultSlot, params, h));
4163
4178
  }
4164
4179
  if (renderOpts) {
4165
4180
  const compConf = cell_renderer.get(renderOpts.name);
@@ -5029,15 +5044,23 @@ const Cell = {
5029
5044
  runRenderer(h, params, _vm, isEdit) {
5030
5045
  const {
5031
5046
  $table,
5047
+ row,
5032
5048
  column
5033
5049
  } = params;
5050
+ const tableReactData = $table;
5051
+ const {
5052
+ isRowGroupStatus
5053
+ } = tableReactData;
5034
5054
  const {
5035
5055
  slots,
5056
+ field,
5036
5057
  editRender,
5037
5058
  formatter
5038
5059
  } = column;
5039
5060
  const compConf = cell_renderer.get(editRender.name);
5040
5061
  const rtEdit = compConf ? compConf.renderTableEdit || compConf.renderEdit : null;
5062
+ const defaultSlot = slots ? slots.default : null;
5063
+ const gcSlot = slots ? slots.groupContent || slots['group-content'] : null;
5041
5064
  const cellParams = Object.assign({
5042
5065
  $type: '',
5043
5066
  isEdit
@@ -5051,8 +5074,28 @@ const Cell = {
5051
5074
  }
5052
5075
  return [];
5053
5076
  }
5054
- if (slots && slots.default) {
5055
- return renderCellBaseVNs(h, params, $table.callSlot(slots.default, cellParams, h));
5077
+ if (isRowGroupStatus && field && row.isAggregate) {
5078
+ const aggRow = row;
5079
+ const aggregateOpts = $table.computeAggregateOpts;
5080
+ const {
5081
+ mapChildrenField
5082
+ } = aggregateOpts;
5083
+ const groupField = aggRow.groupField;
5084
+ const groupContent = aggRow.groupContent;
5085
+ const childList = mapChildrenField ? aggRow[mapChildrenField] || [] : [];
5086
+ const childCount = aggRow.childCount;
5087
+ if (gcSlot) {
5088
+ return renderCellBaseVNs(h, params, $table.callSlot(gcSlot, Object.assign({
5089
+ groupField,
5090
+ groupContent,
5091
+ childList,
5092
+ childCount
5093
+ }, params), h));
5094
+ }
5095
+ } else {
5096
+ if (defaultSlot) {
5097
+ return renderCellBaseVNs(h, params, $table.callSlot(defaultSlot, cellParams, h));
5098
+ }
5056
5099
  }
5057
5100
  if (formatter) {
5058
5101
  return renderCellBaseVNs(h, params, [h('span', {
@@ -9310,6 +9353,7 @@ function loadTableData($xeTable, datas, isReset) {
9310
9353
  }).then(() => {
9311
9354
  computeScrollLoad($xeTable);
9312
9355
  }).then(() => {
9356
+ const virtualYOpts = $xeTable.computeVirtualYOpts;
9313
9357
  // 是否启用了虚拟滚动
9314
9358
  if (sYLoad) {
9315
9359
  scrollYStore.endIndex = scrollYStore.visibleSize;
@@ -9318,6 +9362,9 @@ function loadTableData($xeTable, datas, isReset) {
9318
9362
  if (reactData.expandColumn && expandOpts.mode !== 'fixed') {
9319
9363
  errLog('vxe.error.notConflictProp', ['column.type="expand', 'expand-config.mode="fixed"']);
9320
9364
  }
9365
+ if (virtualYOpts.mode === 'scroll' && expandOpts.mode === 'fixed') {
9366
+ warnLog('vxe.error.notConflictProp', ['virtual-y-config.mode=scroll', 'expand-config.mode=inside']);
9367
+ }
9321
9368
  // if (showOverflow) {
9322
9369
  // if (!rowOpts.height) {
9323
9370
  // const errColumn = internalData.tableFullColumn.find(column => column.showOverflow === false)
@@ -10141,7 +10188,7 @@ const Methods = {
10141
10188
  const $xeGGWrapper = $xeGrid || $xeGantt;
10142
10189
  if (slotFunc) {
10143
10190
  if ($xeGGWrapper) {
10144
- return $xeGGWrapper.callSlot(slotFunc, params, h, vNodes);
10191
+ return $xeGGWrapper.callSlot(slotFunc, params, h);
10145
10192
  }
10146
10193
  // if (XEUtils.isString(slotFunc)) {
10147
10194
  // slotFunc = slots[slotFunc] || null
@@ -30176,6 +30223,15 @@ function renderBody(h, $xeTable) {
30176
30223
  if (props.resizable) {
30177
30224
  warnLog('vxe.error.delProp', ['resizable', 'column-config.resizable']);
30178
30225
  }
30226
+ if (props.virtualXConfig && props.scrollX) {
30227
+ warnLog('vxe.error.notSupportProp', ['virtual-x-config', 'scroll-x', 'scroll-x=null']);
30228
+ }
30229
+ if (props.virtualYConfig && props.scrollY) {
30230
+ warnLog('vxe.error.notSupportProp', ['virtual-y-config', 'scroll-y', 'scroll-y=null']);
30231
+ }
30232
+ if (props.aggregateConfig && props.rowGroupConfig) {
30233
+ warnLog('vxe.error.notSupportProp', ['aggregate-config', 'row-group-config', 'row-group-config=null']);
30234
+ }
30179
30235
  // if (props.scrollY) {
30180
30236
  // warnLog('vxe.error.delProp', ['scroll-y', 'virtual-y-config'])
30181
30237
  // }