ng-easycommerce-v18 0.3.18-beta.1 → 0.3.18-beta.3
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/README.md +6 -0
- package/esm2022/lib/ec-components/abstractions-components/menu-ec.component.mjs +17 -1
- package/esm2022/lib/ec-components/filters-ec/filters-ec.component.mjs +30 -5
- package/esm2022/lib/ec-services/runtime-config.service.mjs +53 -12
- package/esm2022/lib/interceptors/index.mjs +2 -1
- package/esm2022/lib/interceptors/runtime-config.interceptor.mjs +41 -0
- package/esm2022/lib/interfaces/filter.mjs +1 -1
- package/esm2022/lib/interfaces/options.mjs +1 -1
- package/esm2022/lib/providers/provideRuntimeConfig.mjs +17 -14
- package/fesm2022/ng-easycommerce-v18.mjs +161 -38
- package/fesm2022/ng-easycommerce-v18.mjs.map +1 -1
- package/lib/ec-components/abstractions-components/menu-ec.component.d.ts +12 -0
- package/lib/ec-components/filters-ec/filters-ec.component.d.ts +12 -4
- package/lib/ec-services/runtime-config.service.d.ts +9 -2
- package/lib/interceptors/index.d.ts +1 -0
- package/lib/interceptors/runtime-config.interceptor.d.ts +7 -0
- package/lib/interfaces/filter.d.ts +1 -0
- package/lib/interfaces/options.d.ts +2 -0
- package/lib/providers/provideRuntimeConfig.d.ts +3 -2
- package/package.json +1 -1
|
@@ -75,6 +75,18 @@ export declare class MenuEcComponent {
|
|
|
75
75
|
* @returns true si la categoría es visible, false en caso contrario
|
|
76
76
|
*/
|
|
77
77
|
hasVisibleProperty(category: Category): boolean;
|
|
78
|
+
private filterVisibleTree;
|
|
79
|
+
categoriesVisible$: Observable<Category[]>;
|
|
80
|
+
sectionsVisible$: Observable<Section[]>;
|
|
81
|
+
attributesVisible$: Observable<Attribute[]>;
|
|
82
|
+
getVisibleChildren<T extends {
|
|
83
|
+
isVisible?: boolean;
|
|
84
|
+
children?: T[];
|
|
85
|
+
}>(node?: T): T[];
|
|
86
|
+
hasVisibleChildren<T extends {
|
|
87
|
+
isVisible?: boolean;
|
|
88
|
+
children?: T[];
|
|
89
|
+
}>(node?: T): boolean;
|
|
78
90
|
static ɵfac: i0.ɵɵFactoryDeclaration<MenuEcComponent, never>;
|
|
79
91
|
static ɵcmp: i0.ɵɵComponentDeclaration<MenuEcComponent, "lib-footer-ec", never, {}, {}, never, never, true, never>;
|
|
80
92
|
}
|
|
@@ -31,11 +31,19 @@ export declare class FiltersEcComponent {
|
|
|
31
31
|
scrollUp: () => boolean;
|
|
32
32
|
hasAppliedFilters(): boolean;
|
|
33
33
|
/**
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
* Verifica si una categoría tiene la propiedad isVisible y está marcada como visible
|
|
35
|
+
* @param category - La categoría a verificar
|
|
36
|
+
* @returns true si la categoría es visible, false en caso contrario
|
|
37
|
+
*/
|
|
38
38
|
hasVisibleProperty(category: FilterElement): boolean;
|
|
39
|
+
/** Lista visible (filtra recursivo por isVisible) */
|
|
40
|
+
getVisibleData(filter: Filter | null): FilterElement[];
|
|
41
|
+
/** Children visibles de un nodo */
|
|
42
|
+
getVisibleChildren(node?: FilterElement): FilterElement[];
|
|
43
|
+
/** Tiene hijos visibles? */
|
|
44
|
+
hasVisibleChildren(node?: FilterElement): boolean;
|
|
45
|
+
/** Utilidad recursiva */
|
|
46
|
+
private filterVisibleTree;
|
|
39
47
|
static ɵfac: i0.ɵɵFactoryDeclaration<FiltersEcComponent, never>;
|
|
40
48
|
static ɵcmp: i0.ɵɵComponentDeclaration<FiltersEcComponent, "lib-filters-ec", never, { "setSelect": { "alias": "setSelect"; "required": false; }; }, {}, never, never, true, never>;
|
|
41
49
|
}
|
|
@@ -8,11 +8,18 @@ export declare class RuntimeConfigService {
|
|
|
8
8
|
private configSubject;
|
|
9
9
|
config$: Observable<RuntimeConfig | null>;
|
|
10
10
|
private _config;
|
|
11
|
+
private _loadPromise;
|
|
12
|
+
private _isLoaded;
|
|
11
13
|
constructor(platformId: Object, http: HttpClient);
|
|
12
14
|
/**
|
|
13
|
-
*
|
|
15
|
+
* Inicialización única - llamada por APP_INITIALIZER
|
|
16
|
+
* Garantiza que la configuración se carga solo una vez al inicio
|
|
17
|
+
*/
|
|
18
|
+
initialize(): Promise<RuntimeConfig>;
|
|
19
|
+
/**
|
|
20
|
+
* Carga la configuración en runtime (optimizada para una sola carga)
|
|
14
21
|
* - En SSR: Lee desde el objeto window inyectado por el servidor
|
|
15
|
-
* - En Browser: Hace petición HTTP a /runtime-config.json
|
|
22
|
+
* - En Browser: Hace petición HTTP a /runtime-config.json (solo si no está en window)
|
|
16
23
|
*/
|
|
17
24
|
loadConfig(): Observable<RuntimeConfig>;
|
|
18
25
|
/**
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HttpInterceptorFn } from '@angular/common/http';
|
|
2
|
+
/**
|
|
3
|
+
* Interceptor que garantiza que las peticiones HTTP no se hagan hasta que
|
|
4
|
+
* el runtime config esté completamente cargado
|
|
5
|
+
* Evita que se hagan peticiones con URLs incorrectas
|
|
6
|
+
*/
|
|
7
|
+
export declare const runtimeConfigInterceptor: HttpInterceptorFn;
|
|
@@ -4,6 +4,7 @@ export interface Category {
|
|
|
4
4
|
slug: string;
|
|
5
5
|
position: number;
|
|
6
6
|
path: string;
|
|
7
|
+
isVisible?: boolean;
|
|
7
8
|
children?: Category[];
|
|
8
9
|
images?: any[];
|
|
9
10
|
}
|
|
@@ -23,4 +24,5 @@ export interface Attribute {
|
|
|
23
24
|
slug: string;
|
|
24
25
|
useToFilter: boolean;
|
|
25
26
|
styles?: any[];
|
|
27
|
+
isVisible?: boolean;
|
|
26
28
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { EnvironmentProviders } from '@angular/core';
|
|
2
2
|
import { RuntimeConfigService } from '../ec-services/runtime-config.service';
|
|
3
3
|
/**
|
|
4
|
-
* Factory function para APP_INITIALIZER
|
|
5
|
-
* Carga la configuración runtime antes de que Angular bootstrap la aplicación
|
|
4
|
+
* Factory function para APP_INITIALIZER (OPTIMIZADA)
|
|
5
|
+
* Carga la configuración runtime UNA SOLA VEZ antes de que Angular bootstrap la aplicación
|
|
6
|
+
* Evita múltiples cargas y mejora el rendimiento
|
|
6
7
|
*/
|
|
7
8
|
export declare function initializeRuntimeConfig(runtimeConfigService: RuntimeConfigService): () => Promise<any>;
|
|
8
9
|
/**
|