cloud-ide-element 1.1.90 → 1.1.92

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.
@@ -11763,6 +11763,9 @@ class CideEleDataGridComponent {
11763
11763
  const newExpanded = new Set(expanded);
11764
11764
  const shouldAutoExpand = this.shouldAutoExpandGroups();
11765
11765
  groups.forEach((group, groupKey) => {
11766
+ // Calculate actual row count - only count direct rows in this group, not nested children
11767
+ // Nested children are part of the tree structure, not separate group rows
11768
+ const actualRowCount = group.rows.length;
11766
11769
  // Add group header row
11767
11770
  const groupHeader = {
11768
11771
  ...group.rows[0],
@@ -11771,7 +11774,7 @@ class CideEleDataGridComponent {
11771
11774
  _groupValue: group.value,
11772
11775
  _groupColumnKey: groupColumnKey,
11773
11776
  _groupLevel: level,
11774
- _groupRowCount: group.rows.length,
11777
+ _groupRowCount: actualRowCount,
11775
11778
  _groupPath: level > 0 ? this.buildGroupPath(group.rows[0], groupColumns, level) : []
11776
11779
  };
11777
11780
  result.push(groupHeader);
@@ -11790,18 +11793,32 @@ class CideEleDataGridComponent {
11790
11793
  // Check if this row has children (tree structure)
11791
11794
  const children = treeConfig?.enabled ? this.getNestedValue(row, childrenKey) : undefined;
11792
11795
  if (children && Array.isArray(children) && children.length > 0) {
11796
+ // This row has children - check if children belong to the same group
11797
+ const parentGroupValue = this.getGroupValueForRow(row, groupColumnKey, displayValueGetter, groupKeyGetter);
11798
+ // Check if all children belong to the same group as parent
11799
+ const childrenInSameGroup = children.every(child => {
11800
+ const childGroupValue = this.getGroupValueForRow(child, groupColumnKey, displayValueGetter, groupKeyGetter);
11801
+ return this.getFilterValueKey(childGroupValue) === this.getFilterValueKey(parentGroupValue);
11802
+ });
11793
11803
  // This row has children - preserve tree structure
11794
11804
  const processedRow = { ...row };
11795
- // Recursively process children if there are more grouping levels
11796
- if (level + 1 < groupColumns.length) {
11797
- // Apply grouping to children
11798
- const groupedChildren = this.groupDataRecursive(children, groupColumns, level + 1);
11799
- // Update the row with grouped children
11800
- this.setNestedValue(processedRow, childrenKey, groupedChildren);
11805
+ if (childrenInSameGroup) {
11806
+ // All children are in the same group as parent - don't create group headers for them
11807
+ // Just preserve children structure without grouping
11808
+ this.setNestedValue(processedRow, childrenKey, children);
11801
11809
  }
11802
11810
  else {
11803
- // No more grouping levels, but preserve children structure
11804
- this.setNestedValue(processedRow, childrenKey, children);
11811
+ // Children are in different groups - apply grouping to show group headers
11812
+ if (level + 1 < groupColumns.length) {
11813
+ // Apply grouping to children to create group headers
11814
+ const groupedChildren = this.groupDataRecursive(children, groupColumns, level + 1);
11815
+ // Update the row with grouped children
11816
+ this.setNestedValue(processedRow, childrenKey, groupedChildren);
11817
+ }
11818
+ else {
11819
+ // No more grouping levels, but preserve children structure
11820
+ this.setNestedValue(processedRow, childrenKey, children);
11821
+ }
11805
11822
  }
11806
11823
  processedRows.push(processedRow);
11807
11824
  }
@@ -11829,6 +11846,19 @@ class CideEleDataGridComponent {
11829
11846
  }
11830
11847
  return result;
11831
11848
  }
11849
+ /**
11850
+ * Get the group value for a row (helper for checking if parent and children are in same group)
11851
+ */
11852
+ getGroupValueForRow(row, columnKey, displayValueGetter, groupKeyGetter) {
11853
+ let rawValue;
11854
+ if (groupKeyGetter.includes('.') || groupKeyGetter !== columnKey) {
11855
+ rawValue = this.getNestedValue(row, groupKeyGetter);
11856
+ }
11857
+ else {
11858
+ rawValue = row[columnKey];
11859
+ }
11860
+ return rawValue;
11861
+ }
11832
11862
  /**
11833
11863
  * Get the group path for nested grouping display (internal method)
11834
11864
  */