@smartsoft001/angular 2.95.0 → 2.97.0

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.
@@ -452,53 +452,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImpor
452
452
  const DYNAMIC_COMPONENTS_STORE = new InjectionToken('DYNAMIC_COMPONENTS_STORE');
453
453
  class DynamicComponentStorageService {
454
454
  static get(key, moduleRef) {
455
- // Changed DynamicComponentType to string
456
455
  const getComponents = (k, m) => {
457
- // Changed DynamicComponentType to string
458
456
  if (!m)
459
457
  return [];
460
- // Attempt to get components from the DYNAMIC_COMPONENTS_STORE first
461
458
  const fromStore = m.injector.get(DYNAMIC_COMPONENTS_STORE, null);
462
- let declarations = [];
463
- if (fromStore) {
464
- declarations = fromStore;
465
- }
466
- else if (m.instance &&
467
- m.instance.constructor &&
468
- m.instance.constructor['ɵmod']) {
469
- // Fallback to internal Angular API if DYNAMIC_COMPONENTS_STORE is not provided
470
- // This is fragile and might break in future Angular versions.
471
- declarations =
472
- m.instance.constructor['ɵmod'].declarations || [];
473
- }
474
- else {
475
- console.warn('DynamicComponentStorageService: Could not retrieve declarations from moduleRef.');
476
- }
477
- return declarations.filter((c) => c['smartType'] === k);
459
+ return (fromStore ? fromStore : m.instance.constructor['ɵmod'].declarations).filter((c) => c['smartType'] === k);
478
460
  };
479
461
  let components = getComponents(key, moduleRef);
480
- // Attempt to look in the root AppModule if not found in the current moduleRef
481
462
  if (!components.length && moduleRef) {
482
- const applicationRef = moduleRef.injector.get(ApplicationRef, null);
483
- if (applicationRef &&
484
- applicationRef.components &&
485
- applicationRef.components.length > 0) {
486
- // Try to find AppComponent, otherwise use the first available component's injector
487
- let appComponentInjector = applicationRef.components.find((t) => t.componentType.name === 'AppComponent')?.injector;
488
- if (!appComponentInjector) {
489
- appComponentInjector = applicationRef.components[0]?.injector;
490
- }
491
- if (appComponentInjector) {
492
- const appModuleRef = appComponentInjector.get(NgModuleRef, null);
493
- if (appModuleRef && appModuleRef !== moduleRef) {
494
- // Avoid infinite loop if already root
495
- components = getComponents(key, appModuleRef);
496
- }
497
- }
463
+ const applicationRef = moduleRef.injector.get(ApplicationRef);
464
+ let appComponentInjector = applicationRef.components.find((t) => t.componentType.name === 'AppComponent')?.injector;
465
+ if (!appComponentInjector) {
466
+ appComponentInjector = applicationRef.components[0]?.injector;
498
467
  }
499
- }
500
- if (!components || components.length === 0) {
501
- console.warn(`DynamicComponentStorageService: No components found for key '${key}'`);
468
+ if (!appComponentInjector) {
469
+ return [];
470
+ }
471
+ const appModuleRef = appComponentInjector.get(NgModuleRef);
472
+ components = getComponents(key, appModuleRef);
502
473
  }
503
474
  return components;
504
475
  }
@@ -6475,7 +6446,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImpor
6475
6446
  }] });
6476
6447
 
6477
6448
  class ListComponent extends CreateDynamicComponent('list') {
6478
- _options;
6449
+ _options = signal({}, ...(ngDevMode ? [{ debugName: "_options" }] : []));
6479
6450
  hardwareService = inject(HardwareService);
6480
6451
  mode = signal(ListMode.desktop, ...(ngDevMode ? [{ debugName: "mode" }] : []));
6481
6452
  ListMode = ListMode;