ng-easycommerce 0.0.658-beta.1 → 0.0.660-beta.1

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 (48) hide show
  1. package/README.md +58 -22
  2. package/assets/ec-i18n/en.json +1 -3
  3. package/assets/ec-i18n/es.json +1 -3
  4. package/bundles/ng-easycommerce.umd.js +515 -181
  5. package/bundles/ng-easycommerce.umd.js.map +1 -1
  6. package/bundles/ng-easycommerce.umd.min.js +1 -1
  7. package/bundles/ng-easycommerce.umd.min.js.map +1 -1
  8. package/esm2015/lib/core.consts.js +1 -6
  9. package/esm2015/lib/ec-component/account-ec/order-ec/order-ec.component.js +3 -5
  10. package/esm2015/lib/ec-component/cart-ec/cart-ec.component.js +5 -8
  11. package/esm2015/lib/ec-component/checkout-ec/dataform-ec/dataform-ec.component.js +8 -13
  12. package/esm2015/lib/ec-component/collection-ec/collection-ec.component.js +450 -14
  13. package/esm2015/lib/ec-component/product-detail-ec/product-detail-ec.component.js +3 -30
  14. package/esm2015/lib/ec-component/product-ec/product-ec.component.js +2 -1
  15. package/esm2015/lib/ec-component/sidebar-ec/sidebar-ec.component.js +5 -8
  16. package/esm2015/lib/ec-component/widgets-ec/paypal-express-ec/paypal-express-ec.component.js +3 -1
  17. package/esm2015/lib/ec-component/widgets-ec/price-ec/price-ec.component.js +3 -3
  18. package/esm2015/lib/ec-pipe/ec-currency-symbol.pipe.js +1 -2
  19. package/esm2015/lib/services/cart.service.js +12 -27
  20. package/esm2015/lib/services/currency.service.js +7 -43
  21. package/esm5/lib/core.consts.js +1 -6
  22. package/esm5/lib/ec-component/account-ec/order-ec/order-ec.component.js +3 -5
  23. package/esm5/lib/ec-component/cart-ec/cart-ec.component.js +5 -8
  24. package/esm5/lib/ec-component/checkout-ec/dataform-ec/dataform-ec.component.js +8 -13
  25. package/esm5/lib/ec-component/collection-ec/collection-ec.component.js +458 -13
  26. package/esm5/lib/ec-component/product-detail-ec/product-detail-ec.component.js +3 -48
  27. package/esm5/lib/ec-component/product-ec/product-ec.component.js +2 -1
  28. package/esm5/lib/ec-component/sidebar-ec/sidebar-ec.component.js +5 -8
  29. package/esm5/lib/ec-component/widgets-ec/paypal-express-ec/paypal-express-ec.component.js +3 -1
  30. package/esm5/lib/ec-component/widgets-ec/price-ec/price-ec.component.js +3 -3
  31. package/esm5/lib/ec-pipe/ec-currency-symbol.pipe.js +1 -2
  32. package/esm5/lib/services/cart.service.js +12 -27
  33. package/esm5/lib/services/currency.service.js +7 -43
  34. package/fesm2015/ng-easycommerce.js +502 -159
  35. package/fesm2015/ng-easycommerce.js.map +1 -1
  36. package/fesm5/ng-easycommerce.js +516 -182
  37. package/fesm5/ng-easycommerce.js.map +1 -1
  38. package/lib/core.consts.d.ts +0 -5
  39. package/lib/ec-component/account-ec/order-ec/order-ec.component.d.ts +0 -1
  40. package/lib/ec-component/cart-ec/cart-ec.component.d.ts +0 -1
  41. package/lib/ec-component/checkout-ec/dataform-ec/dataform-ec.component.d.ts +1 -1
  42. package/lib/ec-component/collection-ec/collection-ec.component.d.ts +34 -4
  43. package/lib/ec-component/product-detail-ec/product-detail-ec.component.d.ts +0 -3
  44. package/lib/ec-component/sidebar-ec/sidebar-ec.component.d.ts +0 -1
  45. package/lib/services/cart.service.d.ts +2 -2
  46. package/lib/services/currency.service.d.ts +2 -14
  47. package/ng-easycommerce.metadata.json +1 -1
  48. package/package.json +1 -1
@@ -167,11 +167,6 @@ export declare class Constants {
167
167
  * @example ['AR','ES','GB']
168
168
  */
169
169
  private countries;
170
- /**
171
- * @description contiene un arreglo de string cuyo contenido son los codigos de los paises a excluir.
172
- * @example ['GB']
173
- */
174
- excludedCountries: string[];
175
170
  /**
176
171
  *
177
172
  * @param countries debe contener los codigos de los paises que se quiere mostrar
@@ -24,7 +24,6 @@ export declare class OrderEcComponent extends ComponentHelper implements OnInit
24
24
  hidePrices: boolean;
25
25
  hideDiscounts: boolean;
26
26
  hideTaxes: boolean;
27
- enableFieldNotesInArticleFile: boolean;
28
27
  constructor(ordersService: OrdersService, activedRoute: ActivatedRoute, router: Router, consts: Constants, cartService: CartService, channelConfigService: ChannelConfigService);
29
28
  ngOnInit(): void;
30
29
  toDate: (date: any, format: any) => string;
@@ -38,7 +38,6 @@ export declare class CartEcComponent extends ComponentHelper implements OnInit {
38
38
  creditAccountShowPrices: boolean | null;
39
39
  showTaxLegend: boolean;
40
40
  cartLoading: boolean;
41
- enableFieldNotesInArticleFile: boolean;
42
41
  constructor(cartService: CartService, authService: AuthService, consts: Constants, productsService: ProductsService, router: Router, modalService: BsModalService, toastrService: ToastService, addressingService: AddressingService, channelConfigService: ChannelConfigService);
43
42
  ngOnChanges(): void;
44
43
  updateLoggedIn(): void;
@@ -57,7 +57,6 @@ export declare class DataFormEcComponent extends ComponentHelper implements OnIn
57
57
  postalCodeErrorMessageFacturacion: string;
58
58
  documentErrorMessage: string;
59
59
  documentErrorMessageFacturacion: string;
60
- customerHasCustomerTaxRate: boolean;
61
60
  constructor(authService: AuthService, fb: FormBuilder, toast: ToastService, addressingService: AddressingService, cartService: CartService, modalService: BsModalService, paramsService: ParametersService, consts: Constants, channelConfig: ChannelConfigService);
62
61
  ngOnInit(): void;
63
62
  /**
@@ -91,6 +90,7 @@ export declare class DataFormEcComponent extends ComponentHelper implements OnIn
91
90
  updateDocumentValidationFacturacion(selectedDocumentType: any): void;
92
91
  selectAddress: (items: any) => Promise<void>;
93
92
  getMode: () => boolean;
93
+ prueba(x: any): void;
94
94
  setMode: (mode: any) => boolean;
95
95
  getCountry: (code: any) => any;
96
96
  getProvince: (code: any) => any;
@@ -1,5 +1,5 @@
1
- import { OnInit } from '@angular/core';
2
- import { ActivatedRoute } from '@angular/router';
1
+ import { OnDestroy, OnInit, AfterViewChecked } from '@angular/core';
2
+ import { ActivatedRoute, Router } from '@angular/router';
3
3
  import { FilterElement } from '../../interfaces/filter';
4
4
  import { Subscription } from 'rxjs';
5
5
  import { ComponentHelper } from '../../classes/component-helper';
@@ -15,7 +15,7 @@ import { FiltersService } from '../../services/filters.service';
15
15
  import { OptionsService } from '../../services/options.service';
16
16
  import { ParametersService } from '../../services/parameters.service';
17
17
  import { ProductsService } from '../../services/products/products.service';
18
- export declare class CollectionEcComponent extends ComponentHelper implements OnInit {
18
+ export declare class CollectionEcComponent extends ComponentHelper implements OnInit, OnDestroy, AfterViewChecked {
19
19
  productsService: ProductsService;
20
20
  protected paramsSrv: ParametersService;
21
21
  protected activeRoute: ActivatedRoute;
@@ -25,6 +25,7 @@ export declare class CollectionEcComponent extends ComponentHelper implements On
25
25
  cartService: CartService;
26
26
  consts: Constants;
27
27
  filtersService: FiltersService;
28
+ protected router: Router;
28
29
  filters: Filter[];
29
30
  filters_top: Filter[];
30
31
  private defaultFilters;
@@ -37,13 +38,34 @@ export declare class CollectionEcComponent extends ComponentHelper implements On
37
38
  isCollection: boolean;
38
39
  params: any;
39
40
  filterInView: FilterElement;
41
+ private static stateCache;
42
+ private static maxCacheSize;
43
+ private routerSubscription;
44
+ private stateKey;
45
+ private isRestoringState;
46
+ private clickHandler;
47
+ private usingCachedProducts;
48
+ private allCachedProducts;
49
+ private subscriptionsConfigured;
50
+ private isScrolling;
51
+ private pendingScrollPosition;
52
+ private expectedProductCount;
53
+ private filtersFromCache;
54
+ private isCategoryChange;
55
+ private platformId;
40
56
  type: any;
41
57
  value: any;
42
58
  productsWithUniqueVariant: boolean;
43
59
  optionsFilters: FilterType[];
44
- constructor(productsService: ProductsService, paramsSrv: ParametersService, activeRoute: ActivatedRoute, optionsService: OptionsService, authService: AuthService, analyticsService: AnalyticsService, cartService: CartService, consts: Constants, filtersService: FiltersService);
60
+ constructor(productsService: ProductsService, paramsSrv: ParametersService, activeRoute: ActivatedRoute, optionsService: OptionsService, authService: AuthService, analyticsService: AnalyticsService, cartService: CartService, consts: Constants, filtersService: FiltersService, router: Router, platformId: Object);
45
61
  ngOnInit(): void;
46
62
  getProductsAndSubscribe(): void;
63
+ private originalGetProductsAndSubscribe;
64
+ private setupParentSubscriptionsOnly;
65
+ private setupCustomSubscription;
66
+ private loadNewCategory;
67
+ private generateStateKey;
68
+ private invalidateCache;
47
69
  /**
48
70
  * @description Realiza un sort de productos por el campo dateCreate de la variante
49
71
  * @param a Producto a
@@ -64,4 +86,12 @@ export declare class CollectionEcComponent extends ComponentHelper implements On
64
86
  changeFilter: (e: any) => void;
65
87
  addAllProductosToCart: (products?: any) => void;
66
88
  getObjectWithVariant: () => ParamsProductsWithUniqueVariant;
89
+ ngAfterViewChecked(): void;
90
+ ngOnDestroy(): void;
91
+ private setupBeforeUnloadHandler;
92
+ private saveCurrentState;
93
+ private restoreScrollWithRetries;
94
+ private tryScrollToProductByIndex;
95
+ private waitForProductRendering;
96
+ customSetFilterSelected: (filter: any, filterElement: any) => void;
67
97
  }
@@ -35,13 +35,10 @@ export declare class ProductDetailEcComponent extends ComponentHelper implements
35
35
  showReviews: boolean;
36
36
  hidePrices: boolean;
37
37
  creditAccountShowPrices: boolean | null;
38
- enableFieldNotesInArticleFile: boolean;
39
- private prefillSub?;
40
38
  contact: ElementRef;
41
39
  constructor(productService: ProductDetailService, consts: Constants, activedRoute: ActivatedRoute, cartService: CartService, optionsService: OptionsService, productsService: ProductsService, analyticsService: AnalyticsService, router: Router, toastrService: ToastService, meta: Meta, injector: Injector);
42
40
  deleteHTML(cadena: string): string;
43
41
  ngOnInit(): void;
44
- ngOnDestroy(): void;
45
42
  addToCart: () => void;
46
43
  addAllProductosToCart: () => void;
47
44
  scroll(): void;
@@ -21,7 +21,6 @@ export declare class SidebarEcComponent {
21
21
  creditAccountShowPrices: boolean | null;
22
22
  showTaxLegend: boolean;
23
23
  cartLoading: boolean;
24
- enableFieldNotesInArticleFile: boolean;
25
24
  constructor(cartService: CartService, consts: Constants, authService: AuthService, router: Router, toastrService: ToastService, channelConfigService: ChannelConfigService);
26
25
  ngOnInit(): void;
27
26
  protected actualizarCantidad(item: any, cantidad: number | string, stock: number, id?: string): void;
@@ -92,13 +92,13 @@ export declare class CartService {
92
92
  */
93
93
  addToCart: (product: Product, quantity: number, variant_id: any, comments?: string) => void;
94
94
  addToLot: (product: Product, quantity: number, variant_id: any, id?: any, order_item_id?: any, lot_quantity?: any, unit_price?: any, unit_total?: any, ajustement_total?: any, total_lot?: any, lot_status?: any, date_request?: any, notes?: any, shipping_address_id?: any, shipping_address_name?: any, action?: any) => void;
95
- addToCartPromise: (product: Product, quantity: number, variant_id: any, comments?: string) => Promise<{
95
+ addToCartPromise: (product: Product, quantity: number, variant_id: any) => Promise<{
96
96
  error: boolean;
97
97
  }>;
98
98
  addAllToCart: (items: any[]) => void;
99
99
  addRepeatOrderToCart(items: any[]): void;
100
100
  mergeItemsAddAllToCart: (items: any[]) => any[];
101
- updateItemQuantity: (item: CartItem, quantity: any, comments?: string) => void;
101
+ updateItemQuantity: (item: CartItem, quantity: any) => void;
102
102
  validateQuantity: (item: CartItem, quantity: any) => boolean;
103
103
  private validatePriceAndCredits;
104
104
  hasSufficientCreditsForCartTotal: () => boolean;
@@ -19,7 +19,7 @@ export declare class CurrencyService {
19
19
  private getConvertibilityApi;
20
20
  constructor(consts: Constants, connection: ConnectionService, toastr: ToastService, injector: Injector);
21
21
  /**
22
- * @description Se carga la moneda por defecto con metadatos (símbolo, posición, decimales).
22
+ * @description Se carga la moneda por defecto.
23
23
  */
24
24
  private loadDefaultCurrency;
25
25
  /**
@@ -35,19 +35,7 @@ export declare class CurrencyService {
35
35
  */
36
36
  setCurrency: (code: any) => Promise<void>;
37
37
  /**
38
- * Carga la lista de monedas desde la API y registra la configuración completa en `Constants`.
39
- *
40
- * Si no existe una moneda activa guardada en `localStorage`, inicializa la moneda activa
41
- * tomando la moneda base del canal (`ChannelConfigService.baseCurrency`) y sus metadatos
42
- * obtenidos de la lista (símbolo, posición, decimales). Si no se encuentra la base en la
43
- * lista, usa la primera disponible.
44
- *
45
- * Finalmente, llama a `load()` para propagar la configuración a los observables y (si aplica)
46
- * actualizar `localStorage`.
47
- *
48
- * @sideEffect Actualiza `currencyList$`, `Constants.setCurrencyTypeConfig` y potencialmente
49
- * `Constants.setCurrency`.
50
- * @returns void
38
+ * @description Carga la lista de monedas/currencies.
51
39
  */
52
40
  private loadCurrencyList;
53
41
  /**