vxe-table 4.17.32 → 4.17.33

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.
@@ -360,6 +360,7 @@ export const Cell = {
360
360
  const renderOpts = editConfig && isEnableConf(editRender) ? editRender : (isEnableConf(cellRender) ? cellRender : null);
361
361
  const defaultSlot = slots ? slots.default : null;
362
362
  const gcSlot = slots ? (slots.groupContent || slots['group-content']) : null;
363
+ const gvSlot = slots ? (slots.groupValues || slots['group-values']) : null;
363
364
  let cellValue = '';
364
365
  if (isRowGroupStatus && field && row.isAggregate) {
365
366
  const aggRow = row;
@@ -394,9 +395,6 @@ export const Cell = {
394
395
  */
395
396
  totalValue: childCount
396
397
  };
397
- if (gcSlot) {
398
- return renderCellBaseVNs(params, $table.callSlot(gcSlot, Object.assign({ groupField, groupContent, childList, childCount }, params)));
399
- }
400
398
  if (mode === 'column' ? field === aggRow.groupField : rowGroupNode) {
401
399
  cellValue = groupContent;
402
400
  if (contentMethod) {
@@ -405,9 +403,16 @@ export const Cell = {
405
403
  if (showTotal) {
406
404
  cellValue = getI18n('vxe.table.rowGroupContentTotal', [cellValue, totalMethod ? totalMethod(ctParams) : childCount, childCount]);
407
405
  }
406
+ if (gcSlot) {
407
+ return renderCellBaseVNs(params, $table.callSlot(gcSlot, Object.assign({ groupField, groupContent, childList, childCount }, params)));
408
+ }
408
409
  }
409
410
  else if ($table.getPivotTableAggregateCellAggValue) {
410
411
  cellValue = $table.getPivotTableAggregateCellAggValue(params);
412
+ ctParams.aggValue = cellValue;
413
+ if (gvSlot) {
414
+ return renderCellBaseVNs(params, $table.callSlot(gvSlot, Object.assign({ groupField, groupContent, childList, childCount }, params, ctParams)));
415
+ }
411
416
  }
412
417
  else if (aggFunc === true || (countFields && countFields.includes(field))) {
413
418
  cellValue = currAggData ? currAggData.value : childCount;
@@ -415,6 +420,9 @@ export const Cell = {
415
420
  if (formatValuesMethod) {
416
421
  cellValue = formatValuesMethod(ctParams);
417
422
  }
423
+ if (gvSlot) {
424
+ return renderCellBaseVNs(params, $table.callSlot(gvSlot, Object.assign({ groupField, groupContent, childList, childCount }, params, ctParams)));
425
+ }
418
426
  }
419
427
  }
420
428
  else {
@@ -323,7 +323,7 @@ export default defineVxeComponent({
323
323
  ]);
324
324
  });
325
325
  };
326
- const renderHeads = (isGroup, isOptimizeMode, headerGroups) => {
326
+ const renderHeads = (isGroup, isOptimizeMode, headerGroups, renderColumnList) => {
327
327
  const { fixedType } = props;
328
328
  const { headerRowClassName, headerRowStyle } = tableProps;
329
329
  const floatingFilterOpts = computeFloatingFilterOpts.value;
@@ -344,7 +344,7 @@ export default defineVxeComponent({
344
344
  class: [
345
345
  'vxe-header--row'
346
346
  ]
347
- }, renderFilterRows(isOptimizeMode, headerGroups[headerGroups.length - 1])));
347
+ }, renderFilterRows(isOptimizeMode, renderColumnList)));
348
348
  }
349
349
  return rowVNs;
350
350
  };
@@ -446,7 +446,7 @@ export default defineVxeComponent({
446
446
  */
447
447
  h('thead', {
448
448
  ref: refHeaderTHead
449
- }, renderHeads(isGroup, isOptimizeMode, renderHeaderList))
449
+ }, renderHeads(isGroup, isOptimizeMode, renderHeaderList, renderColumnList))
450
450
  ]),
451
451
  mouseConfig && mouseOpts.area
452
452
  ? h('div', {
@@ -3614,7 +3614,6 @@ export default defineVxeComponent({
3614
3614
  };
3615
3615
  const initData = () => {
3616
3616
  const { data } = props;
3617
- dispatchEvent('ready', {}, null);
3618
3617
  loadTableData(data || [], true, true).then(() => {
3619
3618
  if (data && data.length) {
3620
3619
  internalData.inited = true;
@@ -3628,6 +3627,9 @@ export default defineVxeComponent({
3628
3627
  updateRowOffsetTop();
3629
3628
  }
3630
3629
  });
3630
+ nextTick(() => {
3631
+ dispatchEvent('ready', {}, null);
3632
+ });
3631
3633
  };
3632
3634
  /**
3633
3635
  * 加载表格数据
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 = "4.17.32";
3
+ export const version = "4.17.33";
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${"4.17.32"}`;
3
+ const version = `table v${"4.17.33"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
package/lib/index.umd.js CHANGED
@@ -3141,7 +3141,7 @@ function eqEmptyValue(cellValue) {
3141
3141
  ;// ./packages/ui/index.ts
3142
3142
 
3143
3143
 
3144
- const version = "4.17.32";
3144
+ const version = "4.17.33";
3145
3145
  core_.VxeUI.version = version;
3146
3146
  core_.VxeUI.tableVersion = version;
3147
3147
  core_.VxeUI.setConfig({
@@ -3656,7 +3656,7 @@ var esnext_iterator_some = __webpack_require__(7550);
3656
3656
  const {
3657
3657
  log: log_log
3658
3658
  } = core_.VxeUI;
3659
- const log_version = `table v${"4.17.32"}`;
3659
+ const log_version = `table v${"4.17.33"}`;
3660
3660
  const warnLog = log_log.create('warn', log_version);
3661
3661
  const errLog = log_log.create('error', log_version);
3662
3662
  ;// ./packages/table/src/columnInfo.ts
@@ -5410,6 +5410,7 @@ const Cell = {
5410
5410
  const renderOpts = editConfig && isEnableConf(editRender) ? editRender : isEnableConf(cellRender) ? cellRender : null;
5411
5411
  const defaultSlot = slots ? slots.default : null;
5412
5412
  const gcSlot = slots ? slots.groupContent || slots['group-content'] : null;
5413
+ const gvSlot = slots ? slots.groupValues || slots['group-values'] : null;
5413
5414
  let cellValue = '';
5414
5415
  if (isRowGroupStatus && field && row.isAggregate) {
5415
5416
  const aggRow = row;
@@ -5456,14 +5457,6 @@ const Cell = {
5456
5457
  */
5457
5458
  totalValue: childCount
5458
5459
  };
5459
- if (gcSlot) {
5460
- return renderCellBaseVNs(params, $table.callSlot(gcSlot, Object.assign({
5461
- groupField,
5462
- groupContent,
5463
- childList,
5464
- childCount
5465
- }, params)));
5466
- }
5467
5460
  if (mode === 'column' ? field === aggRow.groupField : rowGroupNode) {
5468
5461
  cellValue = groupContent;
5469
5462
  if (contentMethod) {
@@ -5472,14 +5465,39 @@ const Cell = {
5472
5465
  if (showTotal) {
5473
5466
  cellValue = cell_getI18n('vxe.table.rowGroupContentTotal', [cellValue, totalMethod ? totalMethod(ctParams) : childCount, childCount]);
5474
5467
  }
5468
+ if (gcSlot) {
5469
+ return renderCellBaseVNs(params, $table.callSlot(gcSlot, Object.assign({
5470
+ groupField,
5471
+ groupContent,
5472
+ childList,
5473
+ childCount
5474
+ }, params)));
5475
+ }
5475
5476
  } else if ($table.getPivotTableAggregateCellAggValue) {
5476
5477
  cellValue = $table.getPivotTableAggregateCellAggValue(params);
5478
+ ctParams.aggValue = cellValue;
5479
+ if (gvSlot) {
5480
+ return renderCellBaseVNs(params, $table.callSlot(gvSlot, Object.assign({
5481
+ groupField,
5482
+ groupContent,
5483
+ childList,
5484
+ childCount
5485
+ }, params, ctParams)));
5486
+ }
5477
5487
  } else if (aggFunc === true || countFields && countFields.includes(field)) {
5478
5488
  cellValue = currAggData ? currAggData.value : childCount;
5479
5489
  ctParams.aggValue = cellValue;
5480
5490
  if (formatValuesMethod) {
5481
5491
  cellValue = formatValuesMethod(ctParams);
5482
5492
  }
5493
+ if (gvSlot) {
5494
+ return renderCellBaseVNs(params, $table.callSlot(gvSlot, Object.assign({
5495
+ groupField,
5496
+ groupContent,
5497
+ childList,
5498
+ childCount
5499
+ }, params, ctParams)));
5500
+ }
5483
5501
  }
5484
5502
  } else {
5485
5503
  if (defaultSlot) {
@@ -8554,7 +8572,7 @@ const header_renderType = 'header';
8554
8572
  }, flSlot ? $xeTable.callSlot(flSlot, cellParams) : rtFloatingFilter && firstFilterOption ? getSlotVNs(rtFloatingFilter(filterRender, cellParams)) : [])])]);
8555
8573
  });
8556
8574
  };
8557
- const renderHeads = (isGroup, isOptimizeMode, headerGroups) => {
8575
+ const renderHeads = (isGroup, isOptimizeMode, headerGroups, renderColumnList) => {
8558
8576
  const {
8559
8577
  fixedType
8560
8578
  } = props;
@@ -8580,7 +8598,7 @@ const header_renderType = 'header';
8580
8598
  rowVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', {
8581
8599
  key: 'ff',
8582
8600
  class: ['vxe-header--row']
8583
- }, renderFilterRows(isOptimizeMode, headerGroups[headerGroups.length - 1])));
8601
+ }, renderFilterRows(isOptimizeMode, renderColumnList)));
8584
8602
  }
8585
8603
  return rowVNs;
8586
8604
  };
@@ -8690,7 +8708,7 @@ const header_renderType = 'header';
8690
8708
  */
8691
8709
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('thead', {
8692
8710
  ref: refHeaderTHead
8693
- }, renderHeads(isGroup, isOptimizeMode, renderHeaderList))]), mouseConfig && mouseOpts.area ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
8711
+ }, renderHeads(isGroup, isOptimizeMode, renderHeaderList, renderColumnList))]), mouseConfig && mouseOpts.area ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
8694
8712
  class: 'vxe-table--cell-area',
8695
8713
  xid: xID
8696
8714
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
@@ -19187,7 +19205,7 @@ if(reWidth){calcCellWidth();}if(reFull){autoCellWidth();}if(reHeight){calcCellHe
19187
19205
  * 已废弃
19188
19206
  * @deprecated
19189
19207
  */totalValue:childCount};let aggVal=0;// 如果下层同时也是分组
19190
- if(childList.length&&childList[0].isAggregate){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(childList,row=>{if(row.isAggregate){const currAggData=row.aggData[field];if(currAggData){aggVal+=currAggData.value;}}});}else{aggVal=aggCalcMethod?aggCalcMethod(ctParams):aggRow.childCount;}aggDtObj[field]={type:'count',value:aggVal,label:aggVal};});aggRow.aggData=aggDtObj;});}}}};const updateGroupData=()=>{const{aggregateConfig,rowGroupConfig}=props;const{isRowGroupStatus}=reactData;const{tableFullGroupData}=internalData;const aggregateOpts=computeAggregateOpts.value;const{mapChildrenField}=aggregateOpts;if((aggregateConfig||rowGroupConfig)&&isRowGroupStatus){const aggList=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullGroupData,row=>{if(row.isAggregate){aggList.push(row);}},{children:mapChildrenField});handleeGroupSummary(aggList);}};const handleGroupData=(list,rowGroups)=>{let fullData=list;let treeData=list;if(rowGroups){const aggregateOpts=computeAggregateOpts.value;const{rowField,parentField,childrenField,mapChildrenField}=aggregateOpts;const checkboxOpts=computeCheckboxOpts.value;const{checkField}=checkboxOpts;const indeterminateField=checkboxOpts.indeterminateField||checkboxOpts.halfField;const rgItem=rowGroups[0];if(rgItem&&rowField&&parentField&&childrenField&&mapChildrenField){fullData=[];treeData=[];const groupField=rgItem.field;const groupColumn=$xeTable.getColumnByField(groupField);const groupMaps={};const aggList=[];const rowkey=getRowkey($xeTable);list.forEach(row=>{const cellValue=groupColumn?$xeTable.getCellLabel(row,groupColumn):external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,groupField);const groupValue=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(cellValue)?'':cellValue;let childList=groupMaps[groupValue];if(!childList){childList=[];groupMaps[groupValue]=childList;}if(row.isAggregate){row.isAggregate=undefined;}childList.push(row);});external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().objectEach(groupMaps,(childList,groupValue)=>{const{fullData:childFullData,treeData:childTreeData}=handleGroupData(childList,rowGroups.slice(1));const aggRow={isAggregate:true,aggData:{},groupContent:groupValue,groupField,childCount:0,[rowField]:getRowUniqueId(),[parentField]:null,[rowkey]:getRowUniqueId(),[childrenField]:childTreeData,[mapChildrenField]:childTreeData};if(checkField){aggRow[checkField]=false;}if(indeterminateField){aggRow[indeterminateField]=false;}aggList.push(aggRow);treeData.push(aggRow);fullData.push(aggRow);if(childFullData.length){fullData.push(...childFullData);}});handleeGroupSummary(aggList);}}return{treeData,fullData};};const initData=()=>{const{data}=props;dispatchEvent('ready',{},null);loadTableData(data||[],true,true).then(()=>{if(data&&data.length){internalData.inited=true;internalData.initStatus=true;handleLoadDefaults();}handleInitDefaults();updateStyle();if(!reactData.isAllOverflow){calcCellHeight();updateRowOffsetTop();}});};/**
19208
+ if(childList.length&&childList[0].isAggregate){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(childList,row=>{if(row.isAggregate){const currAggData=row.aggData[field];if(currAggData){aggVal+=currAggData.value;}}});}else{aggVal=aggCalcMethod?aggCalcMethod(ctParams):aggRow.childCount;}aggDtObj[field]={type:'count',value:aggVal,label:aggVal};});aggRow.aggData=aggDtObj;});}}}};const updateGroupData=()=>{const{aggregateConfig,rowGroupConfig}=props;const{isRowGroupStatus}=reactData;const{tableFullGroupData}=internalData;const aggregateOpts=computeAggregateOpts.value;const{mapChildrenField}=aggregateOpts;if((aggregateConfig||rowGroupConfig)&&isRowGroupStatus){const aggList=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullGroupData,row=>{if(row.isAggregate){aggList.push(row);}},{children:mapChildrenField});handleeGroupSummary(aggList);}};const handleGroupData=(list,rowGroups)=>{let fullData=list;let treeData=list;if(rowGroups){const aggregateOpts=computeAggregateOpts.value;const{rowField,parentField,childrenField,mapChildrenField}=aggregateOpts;const checkboxOpts=computeCheckboxOpts.value;const{checkField}=checkboxOpts;const indeterminateField=checkboxOpts.indeterminateField||checkboxOpts.halfField;const rgItem=rowGroups[0];if(rgItem&&rowField&&parentField&&childrenField&&mapChildrenField){fullData=[];treeData=[];const groupField=rgItem.field;const groupColumn=$xeTable.getColumnByField(groupField);const groupMaps={};const aggList=[];const rowkey=getRowkey($xeTable);list.forEach(row=>{const cellValue=groupColumn?$xeTable.getCellLabel(row,groupColumn):external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,groupField);const groupValue=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(cellValue)?'':cellValue;let childList=groupMaps[groupValue];if(!childList){childList=[];groupMaps[groupValue]=childList;}if(row.isAggregate){row.isAggregate=undefined;}childList.push(row);});external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().objectEach(groupMaps,(childList,groupValue)=>{const{fullData:childFullData,treeData:childTreeData}=handleGroupData(childList,rowGroups.slice(1));const aggRow={isAggregate:true,aggData:{},groupContent:groupValue,groupField,childCount:0,[rowField]:getRowUniqueId(),[parentField]:null,[rowkey]:getRowUniqueId(),[childrenField]:childTreeData,[mapChildrenField]:childTreeData};if(checkField){aggRow[checkField]=false;}if(indeterminateField){aggRow[indeterminateField]=false;}aggList.push(aggRow);treeData.push(aggRow);fullData.push(aggRow);if(childFullData.length){fullData.push(...childFullData);}});handleeGroupSummary(aggList);}}return{treeData,fullData};};const initData=()=>{const{data}=props;loadTableData(data||[],true,true).then(()=>{if(data&&data.length){internalData.inited=true;internalData.initStatus=true;handleLoadDefaults();}handleInitDefaults();updateStyle();if(!reactData.isAllOverflow){calcCellHeight();updateRowOffsetTop();}});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{dispatchEvent('ready',{},null);});};/**
19191
19209
  * 加载表格数据
19192
19210
  * @param {Array} datas 数据
19193
19211
  */const loadTableData=(datas,isReload,isReset)=>{const{keepSource,treeConfig,rowGroupConfig,aggregateConfig}=props;const{rowGroupList,scrollYLoad:oldScrollYLoad}=reactData;const{initStatus,scrollYStore,scrollXStore,lastScrollLeft,lastScrollTop}=internalData;const rowOpts=computeRowOpts.value;const treeOpts=computeTreeOpts.value;const expandOpts=computeExpandOpts.value;const{transform}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;let treeData=[];let fullData=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)(datas?datas.slice(0):[]);// 转为响应式数据