@cqa-lib/cqa-ui 1.1.499 → 1.1.500
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.
- package/esm2020/lib/table/dynamic-table/dynamic-cell-container.directive.mjs +24 -14
- package/fesm2015/cqa-lib-cqa-ui.mjs +24 -14
- package/fesm2015/cqa-lib-cqa-ui.mjs.map +1 -1
- package/fesm2020/cqa-lib-cqa-ui.mjs +23 -13
- package/fesm2020/cqa-lib-cqa-ui.mjs.map +1 -1
- package/lib/table/dynamic-table/dynamic-cell-container.directive.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1050,6 +1050,7 @@ class DynamicCellContainerDirective {
|
|
|
1050
1050
|
this.viewContainerRef = viewContainerRef;
|
|
1051
1051
|
this.cdr = cdr;
|
|
1052
1052
|
this.initialized = false;
|
|
1053
|
+
this.isApplyingInputChanges = false;
|
|
1053
1054
|
}
|
|
1054
1055
|
ngOnInit() {
|
|
1055
1056
|
if (this.componentConfig && !this.initialized) {
|
|
@@ -1061,16 +1062,25 @@ class DynamicCellContainerDirective {
|
|
|
1061
1062
|
if (this.componentRef &&
|
|
1062
1063
|
this.componentConfig &&
|
|
1063
1064
|
(changes['componentConfig'] || changes['row'] || changes['column'] || changes['rowIndex'] || changes['colId'])) {
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1065
|
+
if (this.isApplyingInputChanges) {
|
|
1066
|
+
return;
|
|
1067
|
+
}
|
|
1068
|
+
this.isApplyingInputChanges = true;
|
|
1069
|
+
try {
|
|
1070
|
+
// Refresh component inputs when config or row context changes.
|
|
1071
|
+
const inputs = this.getComponentInputs(this.componentConfig);
|
|
1072
|
+
Object.keys(inputs).forEach(inputKey => {
|
|
1073
|
+
if (this.componentRef?.instance && inputKey in this.componentRef.instance) {
|
|
1074
|
+
this.componentRef.instance[inputKey] = inputs[inputKey];
|
|
1075
|
+
}
|
|
1076
|
+
});
|
|
1077
|
+
// Avoid synchronous detectChanges inside ngOnChanges to prevent re-entrant CD loops.
|
|
1078
|
+
this.componentRef.changeDetectorRef.markForCheck();
|
|
1079
|
+
this.cdr.markForCheck();
|
|
1080
|
+
}
|
|
1081
|
+
finally {
|
|
1082
|
+
this.isApplyingInputChanges = false;
|
|
1083
|
+
}
|
|
1074
1084
|
}
|
|
1075
1085
|
else if (changes['componentConfig'] && this.componentConfig && !this.initialized) {
|
|
1076
1086
|
// Create component if it wasn't created yet
|
|
@@ -1113,9 +1123,9 @@ class DynamicCellContainerDirective {
|
|
|
1113
1123
|
}
|
|
1114
1124
|
}
|
|
1115
1125
|
});
|
|
1116
|
-
//
|
|
1117
|
-
this.componentRef.changeDetectorRef.
|
|
1118
|
-
this.cdr.
|
|
1126
|
+
// Schedule checks without forcing nested synchronous cycles.
|
|
1127
|
+
this.componentRef.changeDetectorRef.markForCheck();
|
|
1128
|
+
this.cdr.markForCheck();
|
|
1119
1129
|
}
|
|
1120
1130
|
catch (err) {
|
|
1121
1131
|
console.error('Failed to create component in table cell:', err);
|