@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.
@@ -7184,7 +7184,6 @@
7184
7184
  "[ngsPdfViewerAnnotation]",
7185
7185
  "[ngsPdfViewerAnnotationDef]",
7186
7186
  "ngs-pdf-viewer",
7187
- "ngs-pdf-viewer-annotation-test-host",
7188
7187
  "ngs-pdf-viewer-annotations",
7189
7188
  "ngs-pdf-viewer-search"
7190
7189
  ],
@@ -2343,24 +2343,35 @@ class FormBuilderFieldHost {
2343
2343
  statusSubscription.unsubscribe();
2344
2344
  });
2345
2345
  });
2346
- effect(async () => {
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 renderer = definitions.find(definition => definition.type === field.type)?.renderer;
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
- const componentType = await renderer();
2358
- const componentRef = viewContainer.createComponent(componentType);
2359
- componentRef.setInput('field', field);
2360
- componentRef.setInput('control', control);
2361
- componentRef.setInput('readonly', this.readonly());
2362
- componentRef.setInput('definition', definitions.find(definition => definition.type === field.type));
2363
- this.customLoaded.set(true);
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) {