@ngstarter-ui/components 21.0.65 → 21.0.66
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.
|
@@ -2343,24 +2343,35 @@ class FormBuilderFieldHost {
|
|
|
2343
2343
|
statusSubscription.unsubscribe();
|
|
2344
2344
|
});
|
|
2345
2345
|
});
|
|
2346
|
-
effect(
|
|
2346
|
+
effect(onCleanup => {
|
|
2347
|
+
let cancelled = false;
|
|
2347
2348
|
const field = this.field();
|
|
2348
2349
|
const control = this.control();
|
|
2349
2350
|
const definitions = this.definitions();
|
|
2350
2351
|
const viewContainer = this.anchor();
|
|
2351
|
-
const
|
|
2352
|
+
const definition = definitions.find(definition => definition.type === field.type);
|
|
2353
|
+
const renderer = definition?.renderer;
|
|
2354
|
+
const readonly = this.readonly();
|
|
2355
|
+
onCleanup(() => {
|
|
2356
|
+
cancelled = true;
|
|
2357
|
+
});
|
|
2352
2358
|
viewContainer.clear();
|
|
2353
2359
|
this.customLoaded.set(false);
|
|
2354
2360
|
if (!renderer) {
|
|
2355
2361
|
return;
|
|
2356
2362
|
}
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2363
|
+
Promise.resolve(renderer()).then(componentType => {
|
|
2364
|
+
if (cancelled) {
|
|
2365
|
+
return;
|
|
2366
|
+
}
|
|
2367
|
+
viewContainer.clear();
|
|
2368
|
+
const componentRef = viewContainer.createComponent(componentType);
|
|
2369
|
+
componentRef.setInput('field', field);
|
|
2370
|
+
componentRef.setInput('control', control);
|
|
2371
|
+
componentRef.setInput('readonly', readonly);
|
|
2372
|
+
componentRef.setInput('definition', definition);
|
|
2373
|
+
this.customLoaded.set(true);
|
|
2374
|
+
});
|
|
2364
2375
|
});
|
|
2365
2376
|
}
|
|
2366
2377
|
onSignatureSaved(signature) {
|