cloud-ide-element 1.1.90 → 1.1.91
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,24 @@ 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 (excluding nested group headers)
|
|
11767
|
+
const countActualRows = (rows) => {
|
|
11768
|
+
let count = 0;
|
|
11769
|
+
rows.forEach(row => {
|
|
11770
|
+
// Check if this row has children (tree structure)
|
|
11771
|
+
const children = treeConfig?.enabled ? this.getNestedValue(row, childrenKey) : undefined;
|
|
11772
|
+
if (children && Array.isArray(children) && children.length > 0) {
|
|
11773
|
+
// Count this row plus its children (recursively)
|
|
11774
|
+
count += 1 + countActualRows(children);
|
|
11775
|
+
}
|
|
11776
|
+
else {
|
|
11777
|
+
// Regular row
|
|
11778
|
+
count += 1;
|
|
11779
|
+
}
|
|
11780
|
+
});
|
|
11781
|
+
return count;
|
|
11782
|
+
};
|
|
11783
|
+
const actualRowCount = countActualRows(group.rows);
|
|
11766
11784
|
// Add group header row
|
|
11767
11785
|
const groupHeader = {
|
|
11768
11786
|
...group.rows[0],
|
|
@@ -11771,7 +11789,7 @@ class CideEleDataGridComponent {
|
|
|
11771
11789
|
_groupValue: group.value,
|
|
11772
11790
|
_groupColumnKey: groupColumnKey,
|
|
11773
11791
|
_groupLevel: level,
|
|
11774
|
-
_groupRowCount:
|
|
11792
|
+
_groupRowCount: actualRowCount,
|
|
11775
11793
|
_groupPath: level > 0 ? this.buildGroupPath(group.rows[0], groupColumns, level) : []
|
|
11776
11794
|
};
|
|
11777
11795
|
result.push(groupHeader);
|
|
@@ -11790,18 +11808,32 @@ class CideEleDataGridComponent {
|
|
|
11790
11808
|
// Check if this row has children (tree structure)
|
|
11791
11809
|
const children = treeConfig?.enabled ? this.getNestedValue(row, childrenKey) : undefined;
|
|
11792
11810
|
if (children && Array.isArray(children) && children.length > 0) {
|
|
11811
|
+
// This row has children - check if children belong to the same group
|
|
11812
|
+
const parentGroupValue = this.getGroupValueForRow(row, groupColumnKey, displayValueGetter, groupKeyGetter);
|
|
11813
|
+
// Check if all children belong to the same group as parent
|
|
11814
|
+
const childrenInSameGroup = children.every(child => {
|
|
11815
|
+
const childGroupValue = this.getGroupValueForRow(child, groupColumnKey, displayValueGetter, groupKeyGetter);
|
|
11816
|
+
return this.getFilterValueKey(childGroupValue) === this.getFilterValueKey(parentGroupValue);
|
|
11817
|
+
});
|
|
11793
11818
|
// This row has children - preserve tree structure
|
|
11794
11819
|
const processedRow = { ...row };
|
|
11795
|
-
|
|
11796
|
-
|
|
11797
|
-
//
|
|
11798
|
-
|
|
11799
|
-
// Update the row with grouped children
|
|
11800
|
-
this.setNestedValue(processedRow, childrenKey, groupedChildren);
|
|
11820
|
+
if (childrenInSameGroup) {
|
|
11821
|
+
// All children are in the same group as parent - don't create group headers for them
|
|
11822
|
+
// Just preserve children structure without grouping
|
|
11823
|
+
this.setNestedValue(processedRow, childrenKey, children);
|
|
11801
11824
|
}
|
|
11802
11825
|
else {
|
|
11803
|
-
//
|
|
11804
|
-
|
|
11826
|
+
// Children are in different groups - apply grouping to show group headers
|
|
11827
|
+
if (level + 1 < groupColumns.length) {
|
|
11828
|
+
// Apply grouping to children to create group headers
|
|
11829
|
+
const groupedChildren = this.groupDataRecursive(children, groupColumns, level + 1);
|
|
11830
|
+
// Update the row with grouped children
|
|
11831
|
+
this.setNestedValue(processedRow, childrenKey, groupedChildren);
|
|
11832
|
+
}
|
|
11833
|
+
else {
|
|
11834
|
+
// No more grouping levels, but preserve children structure
|
|
11835
|
+
this.setNestedValue(processedRow, childrenKey, children);
|
|
11836
|
+
}
|
|
11805
11837
|
}
|
|
11806
11838
|
processedRows.push(processedRow);
|
|
11807
11839
|
}
|
|
@@ -11829,6 +11861,19 @@ class CideEleDataGridComponent {
|
|
|
11829
11861
|
}
|
|
11830
11862
|
return result;
|
|
11831
11863
|
}
|
|
11864
|
+
/**
|
|
11865
|
+
* Get the group value for a row (helper for checking if parent and children are in same group)
|
|
11866
|
+
*/
|
|
11867
|
+
getGroupValueForRow(row, columnKey, displayValueGetter, groupKeyGetter) {
|
|
11868
|
+
let rawValue;
|
|
11869
|
+
if (groupKeyGetter.includes('.') || groupKeyGetter !== columnKey) {
|
|
11870
|
+
rawValue = this.getNestedValue(row, groupKeyGetter);
|
|
11871
|
+
}
|
|
11872
|
+
else {
|
|
11873
|
+
rawValue = row[columnKey];
|
|
11874
|
+
}
|
|
11875
|
+
return rawValue;
|
|
11876
|
+
}
|
|
11832
11877
|
/**
|
|
11833
11878
|
* Get the group path for nested grouping display (internal method)
|
|
11834
11879
|
*/
|