@toolbox-web/grid-angular 0.14.0 → 0.14.1
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.
|
@@ -2114,6 +2114,29 @@ class GridAdapter {
|
|
|
2114
2114
|
}
|
|
2115
2115
|
}
|
|
2116
2116
|
}
|
|
2117
|
+
/**
|
|
2118
|
+
* Unmount a specific container (e.g., detail panel, tool panel).
|
|
2119
|
+
* Finds the matching view or component ref whose DOM nodes are inside
|
|
2120
|
+
* the container and properly destroys it to prevent memory leaks.
|
|
2121
|
+
*/
|
|
2122
|
+
unmount(container) {
|
|
2123
|
+
for (let i = this.viewRefs.length - 1; i >= 0; i--) {
|
|
2124
|
+
const ref = this.viewRefs[i];
|
|
2125
|
+
if (ref.rootNodes.some((n) => container.contains(n))) {
|
|
2126
|
+
ref.destroy();
|
|
2127
|
+
this.viewRefs.splice(i, 1);
|
|
2128
|
+
return;
|
|
2129
|
+
}
|
|
2130
|
+
}
|
|
2131
|
+
for (let i = this.componentRefs.length - 1; i >= 0; i--) {
|
|
2132
|
+
const ref = this.componentRefs[i];
|
|
2133
|
+
if (container.contains(ref.location.nativeElement)) {
|
|
2134
|
+
ref.destroy();
|
|
2135
|
+
this.componentRefs.splice(i, 1);
|
|
2136
|
+
return;
|
|
2137
|
+
}
|
|
2138
|
+
}
|
|
2139
|
+
}
|
|
2117
2140
|
/**
|
|
2118
2141
|
* Clean up all view references and component references.
|
|
2119
2142
|
* Call this when your app/component is destroyed.
|