ng-easycommerce 0.0.660-beta.1 → 0.0.661

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 (47) hide show
  1. package/README.md +22 -58
  2. package/assets/ec-i18n/en.json +3 -1
  3. package/assets/ec-i18n/es.json +3 -1
  4. package/bundles/ng-easycommerce.umd.js +179 -512
  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 +6 -1
  9. package/esm2015/lib/ec-component/account-ec/order-ec/order-ec.component.js +5 -3
  10. package/esm2015/lib/ec-component/cart-ec/cart-ec.component.js +8 -5
  11. package/esm2015/lib/ec-component/checkout-ec/dataform-ec/dataform-ec.component.js +11 -5
  12. package/esm2015/lib/ec-component/collection-ec/collection-ec.component.js +14 -450
  13. package/esm2015/lib/ec-component/product-detail-ec/product-detail-ec.component.js +30 -3
  14. package/esm2015/lib/ec-component/product-ec/product-ec.component.js +1 -2
  15. package/esm2015/lib/ec-component/sidebar-ec/sidebar-ec.component.js +8 -5
  16. package/esm2015/lib/ec-component/widgets-ec/paypal-express-ec/paypal-express-ec.component.js +1 -3
  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 +2 -1
  19. package/esm2015/lib/services/cart.service.js +27 -12
  20. package/esm2015/lib/services/currency.service.js +43 -7
  21. package/esm5/lib/core.consts.js +6 -1
  22. package/esm5/lib/ec-component/account-ec/order-ec/order-ec.component.js +5 -3
  23. package/esm5/lib/ec-component/cart-ec/cart-ec.component.js +8 -5
  24. package/esm5/lib/ec-component/checkout-ec/dataform-ec/dataform-ec.component.js +11 -5
  25. package/esm5/lib/ec-component/collection-ec/collection-ec.component.js +13 -458
  26. package/esm5/lib/ec-component/product-detail-ec/product-detail-ec.component.js +48 -3
  27. package/esm5/lib/ec-component/product-ec/product-ec.component.js +1 -2
  28. package/esm5/lib/ec-component/sidebar-ec/sidebar-ec.component.js +8 -5
  29. package/esm5/lib/ec-component/widgets-ec/paypal-express-ec/paypal-express-ec.component.js +1 -3
  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 +2 -1
  32. package/esm5/lib/services/cart.service.js +27 -12
  33. package/esm5/lib/services/currency.service.js +43 -7
  34. package/fesm2015/ng-easycommerce.js +157 -499
  35. package/fesm2015/ng-easycommerce.js.map +1 -1
  36. package/fesm5/ng-easycommerce.js +180 -513
  37. package/fesm5/ng-easycommerce.js.map +1 -1
  38. package/lib/core.consts.d.ts +5 -0
  39. package/lib/ec-component/account-ec/order-ec/order-ec.component.d.ts +1 -0
  40. package/lib/ec-component/cart-ec/cart-ec.component.d.ts +1 -0
  41. package/lib/ec-component/collection-ec/collection-ec.component.d.ts +4 -34
  42. package/lib/ec-component/product-detail-ec/product-detail-ec.component.d.ts +3 -0
  43. package/lib/ec-component/sidebar-ec/sidebar-ec.component.d.ts +1 -0
  44. package/lib/services/cart.service.d.ts +2 -2
  45. package/lib/services/currency.service.d.ts +14 -2
  46. package/ng-easycommerce.metadata.json +1 -1
  47. package/package.json +1 -1
@@ -167,6 +167,11 @@ 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[];
170
175
  /**
171
176
  *
172
177
  * @param countries debe contener los codigos de los paises que se quiere mostrar
@@ -24,6 +24,7 @@ export declare class OrderEcComponent extends ComponentHelper implements OnInit
24
24
  hidePrices: boolean;
25
25
  hideDiscounts: boolean;
26
26
  hideTaxes: boolean;
27
+ enableFieldNotesInArticleFile: boolean;
27
28
  constructor(ordersService: OrdersService, activedRoute: ActivatedRoute, router: Router, consts: Constants, cartService: CartService, channelConfigService: ChannelConfigService);
28
29
  ngOnInit(): void;
29
30
  toDate: (date: any, format: any) => string;
@@ -38,6 +38,7 @@ export declare class CartEcComponent extends ComponentHelper implements OnInit {
38
38
  creditAccountShowPrices: boolean | null;
39
39
  showTaxLegend: boolean;
40
40
  cartLoading: boolean;
41
+ enableFieldNotesInArticleFile: boolean;
41
42
  constructor(cartService: CartService, authService: AuthService, consts: Constants, productsService: ProductsService, router: Router, modalService: BsModalService, toastrService: ToastService, addressingService: AddressingService, channelConfigService: ChannelConfigService);
42
43
  ngOnChanges(): void;
43
44
  updateLoggedIn(): void;
@@ -1,5 +1,5 @@
1
- import { OnDestroy, OnInit, AfterViewChecked } from '@angular/core';
2
- import { ActivatedRoute, Router } from '@angular/router';
1
+ import { OnInit } from '@angular/core';
2
+ import { ActivatedRoute } 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, OnDestroy, AfterViewChecked {
18
+ export declare class CollectionEcComponent extends ComponentHelper implements OnInit {
19
19
  productsService: ProductsService;
20
20
  protected paramsSrv: ParametersService;
21
21
  protected activeRoute: ActivatedRoute;
@@ -25,7 +25,6 @@ export declare class CollectionEcComponent extends ComponentHelper implements On
25
25
  cartService: CartService;
26
26
  consts: Constants;
27
27
  filtersService: FiltersService;
28
- protected router: Router;
29
28
  filters: Filter[];
30
29
  filters_top: Filter[];
31
30
  private defaultFilters;
@@ -38,34 +37,13 @@ export declare class CollectionEcComponent extends ComponentHelper implements On
38
37
  isCollection: boolean;
39
38
  params: any;
40
39
  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;
56
40
  type: any;
57
41
  value: any;
58
42
  productsWithUniqueVariant: boolean;
59
43
  optionsFilters: FilterType[];
60
- constructor(productsService: ProductsService, paramsSrv: ParametersService, activeRoute: ActivatedRoute, optionsService: OptionsService, authService: AuthService, analyticsService: AnalyticsService, cartService: CartService, consts: Constants, filtersService: FiltersService, router: Router, platformId: Object);
44
+ constructor(productsService: ProductsService, paramsSrv: ParametersService, activeRoute: ActivatedRoute, optionsService: OptionsService, authService: AuthService, analyticsService: AnalyticsService, cartService: CartService, consts: Constants, filtersService: FiltersService);
61
45
  ngOnInit(): void;
62
46
  getProductsAndSubscribe(): void;
63
- private originalGetProductsAndSubscribe;
64
- private setupParentSubscriptionsOnly;
65
- private setupCustomSubscription;
66
- private loadNewCategory;
67
- private generateStateKey;
68
- private invalidateCache;
69
47
  /**
70
48
  * @description Realiza un sort de productos por el campo dateCreate de la variante
71
49
  * @param a Producto a
@@ -86,12 +64,4 @@ export declare class CollectionEcComponent extends ComponentHelper implements On
86
64
  changeFilter: (e: any) => void;
87
65
  addAllProductosToCart: (products?: any) => void;
88
66
  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;
97
67
  }
@@ -35,10 +35,13 @@ 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?;
38
40
  contact: ElementRef;
39
41
  constructor(productService: ProductDetailService, consts: Constants, activedRoute: ActivatedRoute, cartService: CartService, optionsService: OptionsService, productsService: ProductsService, analyticsService: AnalyticsService, router: Router, toastrService: ToastService, meta: Meta, injector: Injector);
40
42
  deleteHTML(cadena: string): string;
41
43
  ngOnInit(): void;
44
+ ngOnDestroy(): void;
42
45
  addToCart: () => void;
43
46
  addAllProductosToCart: () => void;
44
47
  scroll(): void;
@@ -21,6 +21,7 @@ export declare class SidebarEcComponent {
21
21
  creditAccountShowPrices: boolean | null;
22
22
  showTaxLegend: boolean;
23
23
  cartLoading: boolean;
24
+ enableFieldNotesInArticleFile: boolean;
24
25
  constructor(cartService: CartService, consts: Constants, authService: AuthService, router: Router, toastrService: ToastService, channelConfigService: ChannelConfigService);
25
26
  ngOnInit(): void;
26
27
  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) => Promise<{
95
+ addToCartPromise: (product: Product, quantity: number, variant_id: any, comments?: string) => 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) => void;
101
+ updateItemQuantity: (item: CartItem, quantity: any, comments?: string) => 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.
22
+ * @description Se carga la moneda por defecto con metadatos (símbolo, posición, decimales).
23
23
  */
24
24
  private loadDefaultCurrency;
25
25
  /**
@@ -35,7 +35,19 @@ export declare class CurrencyService {
35
35
  */
36
36
  setCurrency: (code: any) => Promise<void>;
37
37
  /**
38
- * @description Carga la lista de monedas/currencies.
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
39
51
  */
40
52
  private loadCurrencyList;
41
53
  /**