vxe-table 3.17.0-beta.2 → 3.17.0-beta.3

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.
@@ -505,24 +505,15 @@ function handleRowGroupVirtualExpand($xeTable, rows, expanded) {
505
505
  */
506
506
  function handleDefaultRowGroupExpand($xeTable) {
507
507
  const reactData = $xeTable;
508
- const internalData = $xeTable;
509
508
  const { isRowGroupStatus } = reactData;
510
509
  if (isRowGroupStatus) {
511
- const { fullDataRowIdData } = internalData;
512
510
  const aggregateOpts = $xeTable.computeAggregateOpts;
513
- const { expandAll, expandRowKeys } = aggregateOpts;
511
+ const { expandAll, expandGroupFields } = aggregateOpts;
514
512
  if (expandAll) {
515
513
  $xeTable.setAllRowGroupExpand(true);
516
514
  }
517
- else if (expandRowKeys) {
518
- const defExpandeds = [];
519
- expandRowKeys.forEach((rowid) => {
520
- const rowRest = fullDataRowIdData[rowid];
521
- if (rowRest) {
522
- defExpandeds.push(rowRest.row);
523
- }
524
- });
525
- $xeTable.setRowGroupExpand(defExpandeds, true);
515
+ else if (expandGroupFields && expandGroupFields.length) {
516
+ $xeTable.setRowGroupExpandByField(expandGroupFields, true);
526
517
  }
527
518
  }
528
519
  }
@@ -9224,6 +9215,35 @@ const Methods = {
9224
9215
  }
9225
9216
  return $xeTable.$nextTick();
9226
9217
  },
9218
+ setRowGroupExpandByField(groupFields, expanded) {
9219
+ const $xeTable = this;
9220
+ const reactData = $xeTable;
9221
+ const internalData = $xeTable;
9222
+ const { isRowGroupStatus } = reactData;
9223
+ const aggregateOpts = $xeTable.computeAggregateOpts;
9224
+ const { childrenField } = aggregateOpts;
9225
+ if (groupFields) {
9226
+ if (!XEUtils.isArray(groupFields)) {
9227
+ groupFields = [groupFields];
9228
+ }
9229
+ if (isRowGroupStatus) {
9230
+ const rows = [];
9231
+ const gfKeys = {};
9232
+ groupFields.forEach(groupField => {
9233
+ gfKeys[groupField] = true;
9234
+ });
9235
+ XEUtils.eachTree(internalData.afterGroupFullData, (row) => {
9236
+ if (row.isAggregate && gfKeys[row.groupField]) {
9237
+ rows.push(row);
9238
+ }
9239
+ }, { children: childrenField });
9240
+ if (rows.length) {
9241
+ return handleRowGroupVirtualExpand($xeTable, rows, expanded);
9242
+ }
9243
+ }
9244
+ }
9245
+ return $xeTable.$nextTick();
9246
+ },
9227
9247
  setAllRowGroupExpand(expanded) {
9228
9248
  const $xeTable = this;
9229
9249
  const reactData = $xeTable;
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.0-beta.2";
3
+ export const version = "3.17.0-beta.3";
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.0-beta.2"}`;
3
+ const version = `table v${"3.17.0-beta.3"}`;
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.17.0-beta.2";
2005
+ const version = "3.17.0-beta.3";
2006
2006
  core_.VxeUI.version = version;
2007
2007
  core_.VxeUI.tableVersion = version;
2008
2008
  core_.VxeUI.setConfig({
@@ -2667,7 +2667,7 @@ function isNodeElement(elem) {
2667
2667
  const {
2668
2668
  log: log_log
2669
2669
  } = core_.VxeUI;
2670
- const log_version = `table v${"3.17.0-beta.2"}`;
2670
+ const log_version = `table v${"3.17.0-beta.3"}`;
2671
2671
  const warnLog = log_log.create('warn', log_version);
2672
2672
  const errLog = log_log.create('error', log_version);
2673
2673
  ;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
@@ -5837,30 +5837,19 @@ function handleRowGroupVirtualExpand($xeTable, rows, expanded) {
5837
5837
  */
5838
5838
  function handleDefaultRowGroupExpand($xeTable) {
5839
5839
  const reactData = $xeTable;
5840
- const internalData = $xeTable;
5841
5840
  const {
5842
5841
  isRowGroupStatus
5843
5842
  } = reactData;
5844
5843
  if (isRowGroupStatus) {
5845
- const {
5846
- fullDataRowIdData
5847
- } = internalData;
5848
5844
  const aggregateOpts = $xeTable.computeAggregateOpts;
5849
5845
  const {
5850
5846
  expandAll,
5851
- expandRowKeys
5847
+ expandGroupFields
5852
5848
  } = aggregateOpts;
5853
5849
  if (expandAll) {
5854
5850
  $xeTable.setAllRowGroupExpand(true);
5855
- } else if (expandRowKeys) {
5856
- const defExpandeds = [];
5857
- expandRowKeys.forEach(rowid => {
5858
- const rowRest = fullDataRowIdData[rowid];
5859
- if (rowRest) {
5860
- defExpandeds.push(rowRest.row);
5861
- }
5862
- });
5863
- $xeTable.setRowGroupExpand(defExpandeds, true);
5851
+ } else if (expandGroupFields && expandGroupFields.length) {
5852
+ $xeTable.setRowGroupExpandByField(expandGroupFields, true);
5864
5853
  }
5865
5854
  }
5866
5855
  }
@@ -16010,6 +15999,41 @@ const Methods = {
16010
15999
  }
16011
16000
  return $xeTable.$nextTick();
16012
16001
  },
16002
+ setRowGroupExpandByField(groupFields, expanded) {
16003
+ const $xeTable = this;
16004
+ const reactData = $xeTable;
16005
+ const internalData = $xeTable;
16006
+ const {
16007
+ isRowGroupStatus
16008
+ } = reactData;
16009
+ const aggregateOpts = $xeTable.computeAggregateOpts;
16010
+ const {
16011
+ childrenField
16012
+ } = aggregateOpts;
16013
+ if (groupFields) {
16014
+ if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(groupFields)) {
16015
+ groupFields = [groupFields];
16016
+ }
16017
+ if (isRowGroupStatus) {
16018
+ const rows = [];
16019
+ const gfKeys = {};
16020
+ groupFields.forEach(groupField => {
16021
+ gfKeys[groupField] = true;
16022
+ });
16023
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(internalData.afterGroupFullData, row => {
16024
+ if (row.isAggregate && gfKeys[row.groupField]) {
16025
+ rows.push(row);
16026
+ }
16027
+ }, {
16028
+ children: childrenField
16029
+ });
16030
+ if (rows.length) {
16031
+ return handleRowGroupVirtualExpand($xeTable, rows, expanded);
16032
+ }
16033
+ }
16034
+ }
16035
+ return $xeTable.$nextTick();
16036
+ },
16013
16037
  setAllRowGroupExpand(expanded) {
16014
16038
  const $xeTable = this;
16015
16039
  const reactData = $xeTable;