ng-easycommerce-v18 0.3.14-beta.4 → 0.3.14-beta.6

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.
Files changed (38) hide show
  1. package/README.md +20 -0
  2. package/esm2022/lib/constants/core.constants.service.mjs +2 -2
  3. package/esm2022/lib/ec-components/abstractions-components/menu-ec.component.mjs +17 -1
  4. package/esm2022/lib/ec-components/auth-ec/login-form-ec/login-form-ec.component.mjs +5 -1
  5. package/esm2022/lib/ec-components/auth-ec/register-form-ec/register-form-ec.component.mjs +5 -1
  6. package/esm2022/lib/ec-components/cart-ec/cart-item-ec/cart-item-ec.component.mjs +6 -2
  7. package/esm2022/lib/ec-components/checkout-ec/payment-ec/payment-methods/mp-redirect-ec/mp-redirect-ec.component.mjs +141 -75
  8. package/esm2022/lib/ec-components/filters-ec/filters-ec.component.mjs +30 -5
  9. package/esm2022/lib/ec-components/header-ec/header-ec.component.mjs +23 -3
  10. package/esm2022/lib/ec-components/product-detail-ec/product-detail-ec.component.mjs +11 -10
  11. package/esm2022/lib/ec-components/product-ec/product-ec.component.mjs +95 -5
  12. package/esm2022/lib/ec-components/stores-ec/stores-ec.component.mjs +21 -6
  13. package/esm2022/lib/ec-components/widgets-ec/decidir-ec/decidir-ec.component.mjs +3 -1
  14. package/esm2022/lib/ec-components/widgets-ec/index.mjs +2 -1
  15. package/esm2022/lib/ec-components/widgets-ec/redsys-catch-ec/redsys-catch-ec.component.mjs +193 -0
  16. package/esm2022/lib/ec-services/analytics/google-analytics.service.mjs +4 -2
  17. package/esm2022/lib/ec-services/analytics/gtm.service.mjs +6 -3
  18. package/esm2022/lib/ec-services/analytics/metricool-pixel.service.mjs +4 -2
  19. package/esm2022/lib/interfaces/filter.mjs +1 -1
  20. package/esm2022/lib/interfaces/options.mjs +1 -1
  21. package/fesm2022/ng-easycommerce-v18.mjs +559 -124
  22. package/fesm2022/ng-easycommerce-v18.mjs.map +1 -1
  23. package/lib/ec-components/abstractions-components/menu-ec.component.d.ts +12 -0
  24. package/lib/ec-components/auth-ec/login-form-ec/login-form-ec.component.d.ts +2 -0
  25. package/lib/ec-components/auth-ec/register-form-ec/register-form-ec.component.d.ts +2 -0
  26. package/lib/ec-components/cart-ec/cart-item-ec/cart-item-ec.component.d.ts +5 -0
  27. package/lib/ec-components/checkout-ec/payment-ec/payment-methods/mp-redirect-ec/mp-redirect-ec.component.d.ts +38 -16
  28. package/lib/ec-components/filters-ec/filters-ec.component.d.ts +12 -4
  29. package/lib/ec-components/header-ec/header-ec.component.d.ts +5 -1
  30. package/lib/ec-components/product-ec/product-ec.component.d.ts +10 -1
  31. package/lib/ec-components/stores-ec/stores-ec.component.d.ts +2 -1
  32. package/lib/ec-components/widgets-ec/index.d.ts +1 -0
  33. package/lib/ec-components/widgets-ec/redsys-catch-ec/redsys-catch-ec.component.d.ts +47 -0
  34. package/lib/ec-services/analytics/google-analytics.service.d.ts +1 -1
  35. package/lib/ec-services/analytics/gtm.service.d.ts +1 -1
  36. package/lib/interfaces/filter.d.ts +1 -0
  37. package/lib/interfaces/options.d.ts +2 -0
  38. 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
  }
@@ -6,6 +6,7 @@ export declare class LoginFormEcComponent {
6
6
  private _formBuilder;
7
7
  private _toastService;
8
8
  private _router;
9
+ showPassword: boolean;
9
10
  /**
10
11
  * Parametro para indicar si tras loguear
11
12
  * debe redireccionar o no.
@@ -38,6 +39,7 @@ export declare class LoginFormEcComponent {
38
39
  * De lo contrario redirige al contenido de la variable `redirectTo`.
39
40
  */
40
41
  redirectHome(): void;
42
+ togglePassword(): void;
41
43
  static ɵfac: i0.ɵɵFactoryDeclaration<LoginFormEcComponent, never>;
42
44
  static ɵcmp: i0.ɵɵComponentDeclaration<LoginFormEcComponent, "app-login-form-ec", never, { "redirect": { "alias": "redirect"; "required": false; }; "redirectTo": { "alias": "redirectTo"; "required": false; }; "inCart": { "alias": "inCart"; "required": false; }; }, { "ready": "ready"; }, never, never, true, never>;
43
45
  }
@@ -8,6 +8,7 @@ export declare class RegisterFormEcComponent {
8
8
  private _analyticsService;
9
9
  private _formBuilder;
10
10
  private channelConfigService;
11
+ showPassword: boolean;
11
12
  /**
12
13
  * Indica si debe redireccionar o se queda en la misma pantalla
13
14
  */
@@ -41,6 +42,7 @@ export declare class RegisterFormEcComponent {
41
42
  * @returns
42
43
  */
43
44
  register(event: Event): void;
45
+ togglePassword(): void;
44
46
  static ɵfac: i0.ɵɵFactoryDeclaration<RegisterFormEcComponent, never>;
45
47
  static ɵcmp: i0.ɵɵComponentDeclaration<RegisterFormEcComponent, "app-register-form-ec", never, { "redirect": { "alias": "redirect"; "required": false; }; }, { "ready": "ready"; }, never, never, true, never>;
46
48
  }
@@ -1,4 +1,6 @@
1
1
  import { OnInit } from '@angular/core';
2
+ import { Observable } from 'rxjs';
3
+ import { Parameter } from '../../../interfaces';
2
4
  import * as i0 from "@angular/core";
3
5
  export declare class CartItemEcComponent implements OnInit {
4
6
  item: any;
@@ -6,6 +8,7 @@ export declare class CartItemEcComponent implements OnInit {
6
8
  private _cartService;
7
9
  private _toastService;
8
10
  private _constants;
11
+ private parametersService;
9
12
  mediaUrl: string;
10
13
  quantity: number;
11
14
  variantsToShow: string[];
@@ -19,6 +22,8 @@ export declare class CartItemEcComponent implements OnInit {
19
22
  getVariants(product: any): any;
20
23
  createDiscountMessage(saleprice: number, price: number): string;
21
24
  checkStock(product: any): any;
25
+ parameters$: Observable<Parameter[] | null>;
26
+ hasParams: (params: any, code: string) => any;
22
27
  static ɵfac: i0.ɵɵFactoryDeclaration<CartItemEcComponent, never>;
23
28
  static ɵcmp: i0.ɵɵComponentDeclaration<CartItemEcComponent, "app-cart-item-ec", never, { "item": { "alias": "item"; "required": true; }; "inSidebar": { "alias": "inSidebar"; "required": false; }; }, {}, never, never, true, never>;
24
29
  }
@@ -1,30 +1,52 @@
1
- import { EventEmitter, OnInit } from '@angular/core';
1
+ import { EventEmitter, OnInit, OnDestroy } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
- export declare class MpRedirectEcComponent implements OnInit {
3
+ type Phase = 'idle' | 'paying' | 'finalizing';
4
+ export declare class MpRedirectEcComponent implements OnInit, OnDestroy {
4
5
  private _paymentService;
5
6
  private _toastService;
7
+ private platformId;
8
+ private finished;
6
9
  method: null;
7
10
  total_amount: number;
8
11
  allData: any;
9
- ready: EventEmitter<any>;
12
+ ready: EventEmitter<boolean>;
10
13
  protected preference: any;
11
- loading: boolean;
12
- url: any;
13
- closeModal: string;
14
- ventana: any;
15
- window?: Window;
16
- localStorage?: Storage;
17
- private platformId;
18
- constructor();
14
+ url?: string;
15
+ phase: Phase;
16
+ get isIdle(): boolean;
17
+ get isPaying(): boolean;
18
+ get isFinalizing(): boolean;
19
+ private ventana;
20
+ private windowRef?;
21
+ private sid;
22
+ private bc?;
23
+ private pollTimer?;
24
+ private pollStartedAt;
19
25
  ngOnInit(): void;
26
+ ngOnDestroy(): void;
27
+ /** Cancela manualmente el pago y finaliza el flujo con estado "cancel". */
20
28
  clickClose: () => void;
29
+ /**
30
+ * Inicia el pago abriendo `init_point` en una ventana/pestaña nueva.
31
+ * Genera un SID y lo persiste para casar la respuesta del catch.
32
+ * Si el popup es bloqueado, hace fallback navegando en la misma pestaña.
33
+ */
21
34
  iniciar: () => void;
22
- callState: () => void;
23
- processError: (err: any) => void;
35
+ private onWindowMessage;
36
+ private onStorage;
37
+ private onMpMessage;
38
+ private checkLocalStorageOnce;
39
+ /** Cierra el flujo de pago con el estado final y notifica al padre. */
40
+ private finishWithState;
41
+ private genSid;
42
+ private processError;
43
+ /** Limpia posibles residuos de estado en storages. */
24
44
  clearStorageState: () => void;
25
- getPreference: () => Promise<void>;
26
- setError: (message: any) => void;
27
- renderMP: (preference: any) => void;
45
+ /** Obtiene la preferencia e inicializa `url` (init_point). */
46
+ private getPreference;
47
+ private setError;
48
+ private renderMP;
28
49
  static ɵfac: i0.ɵɵFactoryDeclaration<MpRedirectEcComponent, never>;
29
50
  static ɵcmp: i0.ɵɵComponentDeclaration<MpRedirectEcComponent, "app-mp-redirect-ec", never, { "method": { "alias": "method"; "required": false; }; "total_amount": { "alias": "total_amount"; "required": false; }; "allData": { "alias": "allData"; "required": false; }; }, { "ready": "ready"; }, never, never, true, never>;
30
51
  }
52
+ export {};
@@ -31,11 +31,19 @@ export declare class FiltersEcComponent {
31
31
  scrollUp: () => boolean;
32
32
  hasAppliedFilters(): boolean;
33
33
  /**
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
- */
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
  }
@@ -1,4 +1,5 @@
1
1
  import { MenuEcComponent } from '../abstractions-components';
2
+ import { Observable } from 'rxjs';
2
3
  import * as i0 from "@angular/core";
3
4
  /**
4
5
  * Componente que se encarga de manejar la funcionalidad del Header.
@@ -13,12 +14,15 @@ export declare class HeaderEcComponent extends MenuEcComponent {
13
14
  hidePrices: boolean;
14
15
  private __authService;
15
16
  private _channelService;
17
+ private changeDetector;
18
+ private appRouter;
19
+ protected platformId: Object;
20
+ logged$: Observable<boolean>;
16
21
  isAuthenticated$: boolean;
17
22
  constructor();
18
23
  private coreConstantsService;
19
24
  private router;
20
25
  private cdr;
21
- protected platformId: Object;
22
26
  ngOnInit(): void;
23
27
  ngAfterViewInit(): void;
24
28
  /**
@@ -1,4 +1,4 @@
1
- import { EventEmitter, OnInit, Injector } from '@angular/core';
1
+ import { EventEmitter, OnInit, Injector, WritableSignal } from '@angular/core';
2
2
  import { Product } from '../../interfaces';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
@@ -8,6 +8,10 @@ import * as i0 from "@angular/core";
8
8
  export declare class ProductEcComponent implements OnInit {
9
9
  injector: Injector;
10
10
  private routerService;
11
+ private _cartService;
12
+ private _toastService;
13
+ isAddingToCart: WritableSignal<boolean>;
14
+ quantity: WritableSignal<number>;
11
15
  /**
12
16
  * Navega al detalle del producto y sube al inicio de la página
13
17
  * @param productId ID del producto
@@ -43,6 +47,11 @@ export declare class ProductEcComponent implements OnInit {
43
47
  get shouldShowPrice(): boolean;
44
48
  get hasDiscount(): boolean;
45
49
  get discountPercentage(): number | null;
50
+ plus(stock?: number, multipleQuantity?: number): void;
51
+ less(multipleQuantity?: number): void;
52
+ addToCart(): void;
53
+ checkStock(stock: number): void;
54
+ onQuantityChange(event: Event): void;
46
55
  static ɵfac: i0.ɵɵFactoryDeclaration<ProductEcComponent, never>;
47
56
  static ɵcmp: i0.ɵɵComponentDeclaration<ProductEcComponent, "app-product-ec", never, { "product": { "alias": "product"; "required": true; }; "isProductBox": { "alias": "isProductBox"; "required": false; }; "isCollection": { "alias": "isCollection"; "required": false; }; }, { "loaded": "loaded"; }, never, never, true, never>;
48
57
  }
@@ -9,6 +9,7 @@ export declare class StoresEcComponent extends ComponentHelper {
9
9
  storesService: StoresService;
10
10
  consts: CoreConstantsService;
11
11
  protected sanitizer: DomSanitizer;
12
+ private platformId;
12
13
  stores: BehaviorSubject<Store[]>;
13
14
  filterStores: Store[] | null;
14
15
  storesAll: Store[] | null;
@@ -21,7 +22,7 @@ export declare class StoresEcComponent extends ComponentHelper {
21
22
  private markers;
22
23
  private locations;
23
24
  ultimoElementoSeleccionado: any;
24
- constructor(storesService: StoresService, consts: CoreConstantsService, sanitizer: DomSanitizer);
25
+ constructor(storesService: StoresService, consts: CoreConstantsService, sanitizer: DomSanitizer, platformId: Object);
25
26
  ngOnInit(): void;
26
27
  updateMap(url: string): void;
27
28
  /**
@@ -2,3 +2,4 @@ export * from './loading';
2
2
  export * from './price-ec/price-ec.component';
3
3
  export * from './re-captcha-ec/re-captcha-ec.component';
4
4
  export * from './magnizoom-ec/magnizoom-ec.component';
5
+ export * from './redsys-catch-ec/redsys-catch-ec.component';
@@ -0,0 +1,47 @@
1
+ import { OnInit, OnDestroy, Renderer2, ElementRef } from '@angular/core';
2
+ import { ActivatedRoute, Router } from '@angular/router';
3
+ import { ComponentHelper } from '../../../classes/component-helper';
4
+ import { CheckoutService } from '../../../ec-services';
5
+ import * as i0 from "@angular/core";
6
+ /**
7
+ * Catch genérico para redirecciones de pagos.
8
+ * - Normaliza el estado recibido por params/query.
9
+ * - Informa el resultado al opener (postMessage), BroadcastChannel y localStorage.
10
+ * - Intenta cerrarse; si el cierre falla, redirige según el estado.
11
+ */
12
+ export declare class RedsysCatchEcComponent extends ComponentHelper implements OnInit, OnDestroy {
13
+ activedRoute: ActivatedRoute;
14
+ router: Router;
15
+ checkoutService: CheckoutService;
16
+ private renderer;
17
+ private elementRef;
18
+ private document;
19
+ private platformId;
20
+ message: string;
21
+ private subscription;
22
+ private sid;
23
+ private bc?;
24
+ constructor(activedRoute: ActivatedRoute, router: Router, checkoutService: CheckoutService, renderer: Renderer2, elementRef: ElementRef, document: Document, platformId: any);
25
+ ngOnInit(): void;
26
+ ngOnDestroy(): void;
27
+ /** Guarda total_amount si viene desde el PSP. */
28
+ private storeTotalAmount;
29
+ /** Setea mensaje y estado en storages. */
30
+ private setStateInLocal;
31
+ /** Normaliza estados heterogéneos de distintos gateways. */
32
+ private normalizeState;
33
+ /**
34
+ * Informa el resultado: postMessage al opener, BroadcastChannel y localStorage
35
+ * (este último permite polling en la pestaña madre).
36
+ */
37
+ private signalState;
38
+ /** Intenta cerrar la pestaña actual; si falla, ejecuta el callback de fallback. */
39
+ private tryCloseSelf;
40
+ /** Oculta header/footer para esta pantalla mínima. */
41
+ private hideHeaderFooter;
42
+ /** Restaura header/footer al salir. */
43
+ private showHeaderFooter;
44
+ private setStateInSession;
45
+ static ɵfac: i0.ɵɵFactoryDeclaration<RedsysCatchEcComponent, never>;
46
+ static ɵcmp: i0.ɵɵComponentDeclaration<RedsysCatchEcComponent, "app-redsys-catch-ec", never, {}, {}, never, never, true, never>;
47
+ }
@@ -44,7 +44,7 @@ export declare class GoogleAnalyticsService {
44
44
  * @param event_name
45
45
  * @returns
46
46
  */
47
- translateEventName(event_name: AnalyticEventKey): "view_item" | "purchase" | "add_payment_info" | "remove_from_cart" | "view_item_list" | "sign_up" | "add_to_cart" | "begin_checkout" | "add_shipping_info" | null;
47
+ translateEventName(event_name: AnalyticEventKey): "view_item" | "view_item_list" | "begin_checkout" | "add_shipping_info" | "add_payment_info" | "purchase" | "add_to_cart" | "remove_from_cart" | "sign_up" | null;
48
48
  /**
49
49
  * Evalua el evento y devuelve los datos de las funciones relacionadas.
50
50
  * @param event_name Nombre del evento
@@ -67,7 +67,7 @@ export declare class GTMService {
67
67
  * @param event_name
68
68
  * @returns
69
69
  */
70
- translateEventName(event_name: AnalyticEventKey): "view_item" | "purchase" | "add_payment_info" | "remove_from_cart" | "view_item_list" | "sign_up" | "add_to_cart" | "select_promotion" | "select_item" | "begin_checkout" | "add_shipping_info" | null;
70
+ translateEventName(event_name: AnalyticEventKey): "view_item" | "view_item_list" | "begin_checkout" | "add_shipping_info" | "add_payment_info" | "purchase" | "add_to_cart" | "remove_from_cart" | "sign_up" | "select_promotion" | "select_item" | null;
71
71
  /**
72
72
  * Evalua el evento y devuelve los datos de las funciones relacionadas.
73
73
  * @param event_name Nombre del evento
@@ -20,6 +20,7 @@ export interface FilterElement {
20
20
  title: string;
21
21
  type: ElementType;
22
22
  code: string;
23
+ isVisible?: boolean;
23
24
  multi?: boolean;
24
25
  children?: FilterElement[];
25
26
  shape?: FilterShape;
@@ -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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ng-easycommerce-v18",
3
- "version": "0.3.14-beta.4",
3
+ "version": "0.3.14-beta.6",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^18.2.0",
6
6
  "@angular/core": "^18.2.0"