ng-easycommerce-v18 0.3.19-beta.1 → 0.3.20-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 (212) hide show
  1. package/README.md +110 -96
  2. package/assets/decidirFormEc.html +514 -514
  3. package/assets/ec-i18n/ct.json +282 -282
  4. package/assets/ec-i18n/en.json +0 -1
  5. package/assets/ec-i18n/es.json +433 -434
  6. package/assets/ec-i18n/fr.json +0 -0
  7. package/assets/ec-i18n/gl.json +282 -282
  8. package/assets/ec-i18n/pr.json +282 -282
  9. package/assets/images/cards-occasional.svg +21 -21
  10. package/assets/recaptcha/recaptcha-site-keys.json +3 -3
  11. package/assets/recaptcha/recaptcha-sites-prod.json +38 -38
  12. package/assets/recaptcha/recaptcha-sites.json +52 -52
  13. package/esm2022/lib/api/connection.service.mjs +1 -1
  14. package/esm2022/lib/classes/checkout/steps.mjs +1 -1
  15. package/esm2022/lib/classes/component-helper.mjs +1 -1
  16. package/esm2022/lib/classes/filters/attributes-filter.mjs +74 -4
  17. package/esm2022/lib/classes/filters/category-filter.mjs +105 -26
  18. package/esm2022/lib/classes/filters/dynamics-filter.mjs +1 -1
  19. package/esm2022/lib/classes/filters/filter-factory.mjs +7 -3
  20. package/esm2022/lib/classes/filters/filter.mjs +1 -1
  21. package/esm2022/lib/classes/filters/index.mjs +1 -1
  22. package/esm2022/lib/classes/filters/price_range-filter.mjs +3 -3
  23. package/esm2022/lib/classes/filters/sort-filter.mjs +1 -1
  24. package/esm2022/lib/classes/index.mjs +1 -1
  25. package/esm2022/lib/classes/user.mjs +1 -1
  26. package/esm2022/lib/constants/api.constants.service.mjs +19 -15
  27. package/esm2022/lib/constants/core.constants.service.mjs +16 -5
  28. package/esm2022/lib/constants/index.mjs +1 -1
  29. package/esm2022/lib/ec-components/abstractions-components/block-ec.component.mjs +1 -1
  30. package/esm2022/lib/ec-components/abstractions-components/index.mjs +1 -1
  31. package/esm2022/lib/ec-components/abstractions-components/menu-ec.component.mjs +17 -1
  32. package/esm2022/lib/ec-components/account-ec/account-ec.component.mjs +3 -3
  33. package/esm2022/lib/ec-components/account-ec/index.mjs +1 -1
  34. package/esm2022/lib/ec-components/account-ec/order-ec/order-ec.component.mjs +3 -3
  35. package/esm2022/lib/ec-components/account-ec/orders-list-ec/orders-list-ec.component.mjs +3 -3
  36. package/esm2022/lib/ec-components/auth-ec/auth-ec.component.mjs +3 -3
  37. package/esm2022/lib/ec-components/auth-ec/confirm-account-ec/confirm-account-ec.component.mjs +3 -3
  38. package/esm2022/lib/ec-components/auth-ec/forgot-password-ec/forgot-password-ec.component.mjs +3 -3
  39. package/esm2022/lib/ec-components/auth-ec/index.mjs +1 -1
  40. package/esm2022/lib/ec-components/auth-ec/login-form-ec/login-form-ec.component.mjs +28 -18
  41. package/esm2022/lib/ec-components/auth-ec/password-reset-ec/password-reset-ec.component.mjs +27 -23
  42. package/esm2022/lib/ec-components/auth-ec/register-form-ec/register-form-ec.component.mjs +3 -3
  43. package/esm2022/lib/ec-components/auth-ec/register-wholesaler-form-ec/register-wholesaler-form-ec.component.mjs +3 -3
  44. package/esm2022/lib/ec-components/blocks-ec/block-banner-box-ec/block-banner-box-ec.component.mjs +3 -3
  45. package/esm2022/lib/ec-components/blocks-ec/block-banner-full-ec/block-banner-full-ec.component.mjs +3 -3
  46. package/esm2022/lib/ec-components/blocks-ec/block-form-contact-ec/block-form-contact-ec.component.mjs +3 -3
  47. package/esm2022/lib/ec-components/blocks-ec/block-html-ec/block-html-ec.component.mjs +3 -3
  48. package/esm2022/lib/ec-components/blocks-ec/block-newsletter-ec/block-newsletter-ec.component.mjs +3 -3
  49. package/esm2022/lib/ec-components/blocks-ec/block-products-ec/block-products-ec.component.mjs +6 -18
  50. package/esm2022/lib/ec-components/blocks-ec/blocks-ec.component.mjs +3 -3
  51. package/esm2022/lib/ec-components/blocks-ec/index.mjs +1 -1
  52. package/esm2022/lib/ec-components/breadcrumb-ec/breadcrumb-ec.component.mjs +3 -3
  53. package/esm2022/lib/ec-components/cart-ec/cart-ec.component.mjs +3 -3
  54. package/esm2022/lib/ec-components/cart-ec/cart-item-ec/cart-item-ec.component.mjs +11 -39
  55. package/esm2022/lib/ec-components/cart-ec/index.mjs +1 -1
  56. package/esm2022/lib/ec-components/checkout-ec/checkout-ec.component.mjs +3 -3
  57. package/esm2022/lib/ec-components/checkout-ec/dataform-ec/dataform-ec.component.mjs +3 -3
  58. package/esm2022/lib/ec-components/checkout-ec/dataform-ec/input-ec/input-ec.component.mjs +3 -3
  59. package/esm2022/lib/ec-components/checkout-ec/detail-checkout-block-ec/detail-checkout-block-ec.component.mjs +3 -3
  60. package/esm2022/lib/ec-components/checkout-ec/payment-ec/payment-ec.component.mjs +3 -3
  61. package/esm2022/lib/ec-components/checkout-ec/payment-ec/payment-methods/bank-transfer-ec/bank-transfer-ec.component.mjs +3 -3
  62. package/esm2022/lib/ec-components/checkout-ec/payment-ec/payment-methods/index.mjs +1 -1
  63. package/esm2022/lib/ec-components/checkout-ec/payment-ec/payment-methods/mp-redirect-ec/mp-redirect-ec.component.mjs +3 -3
  64. package/esm2022/lib/ec-components/checkout-ec/payment-ec/payment-methods/offline-ec/offline-ec.component.mjs +3 -3
  65. package/esm2022/lib/ec-components/checkout-ec/shipment-ec/shipment-ec.component.mjs +3 -3
  66. package/esm2022/lib/ec-components/checkout-ec/step-container-ec/step-container-ec.component.mjs +3 -3
  67. package/esm2022/lib/ec-components/checkout-ec/success-ec/success-ec.component.mjs +3 -3
  68. package/esm2022/lib/ec-components/collection-ec/collection-ec.component.mjs +43 -19
  69. package/esm2022/lib/ec-components/contact-ec/contact-ec.component.mjs +1 -1
  70. package/esm2022/lib/ec-components/coupon-ec/coupon-ec.component.mjs +3 -3
  71. package/esm2022/lib/ec-components/faqs-ec/faqs-ec.component.mjs +3 -3
  72. package/esm2022/lib/ec-components/filters-ec/filters-ec.component.mjs +74 -16
  73. package/esm2022/lib/ec-components/filters-sort-ec/filters-sort-ec.component.mjs +3 -3
  74. package/esm2022/lib/ec-components/footer-ec/footer-ec.component.mjs +3 -3
  75. package/esm2022/lib/ec-components/header-ec/header-ec.component.mjs +43 -27
  76. package/esm2022/lib/ec-components/home-ec/home-ec.component.mjs +3 -3
  77. package/esm2022/lib/ec-components/index.mjs +1 -1
  78. package/esm2022/lib/ec-components/price-range-filter/price-range-filter.component.mjs +15 -4
  79. package/esm2022/lib/ec-components/product-detail-ec/product-detail-ec.component.mjs +12 -7
  80. package/esm2022/lib/ec-components/product-ec/product-ec.component.mjs +8 -56
  81. package/esm2022/lib/ec-components/related-products-ec/related-products-ec.component.mjs +3 -3
  82. package/esm2022/lib/ec-components/reviews-ec/reviews-ec.component.mjs +3 -3
  83. package/esm2022/lib/ec-components/reviews-form-ec/reviews-form-ec.component.mjs +3 -3
  84. package/esm2022/lib/ec-components/section-container-ec/section-container-ec.component.mjs +3 -3
  85. package/esm2022/lib/ec-components/share-ec/share-buttons-ec/index.mjs +1 -1
  86. package/esm2022/lib/ec-components/share-ec/share-buttons-ec/share-email-ec/share-email-ec.component.mjs +3 -3
  87. package/esm2022/lib/ec-components/share-ec/share-buttons-ec/share-facebook-ec/share-facebook-ec.component.mjs +3 -3
  88. package/esm2022/lib/ec-components/share-ec/share-buttons-ec/share-pinterest-ec/share-pinterest-ec.component.mjs +3 -3
  89. package/esm2022/lib/ec-components/share-ec/share-buttons-ec/share-twitter-ec/share-twitter-ec.component.mjs +3 -3
  90. package/esm2022/lib/ec-components/share-ec/share-buttons-ec/share-whatsapp-ec/share-whatsapp-ec.component.mjs +3 -3
  91. package/esm2022/lib/ec-components/share-ec/share-ec.component.mjs +3 -3
  92. package/esm2022/lib/ec-components/sidebar-ec/sidebar-ec.component.mjs +3 -3
  93. package/esm2022/lib/ec-components/stores-ec/stores-ec.component.mjs +20 -11
  94. package/esm2022/lib/ec-components/variants-ec/variants-ec.component.mjs +3 -3
  95. package/esm2022/lib/ec-components/widgets-ec/decidir-ec/decidir-ec.component.mjs +14 -8
  96. package/esm2022/lib/ec-components/widgets-ec/index.mjs +1 -1
  97. package/esm2022/lib/ec-components/widgets-ec/loading/index.mjs +1 -1
  98. package/esm2022/lib/ec-components/widgets-ec/loading/loading-full-ec/loading-full-ec.component.mjs +3 -3
  99. package/esm2022/lib/ec-components/widgets-ec/loading/loading-inline-ec/loading-inline-ec.component.mjs +3 -3
  100. package/esm2022/lib/ec-components/widgets-ec/loading/loading-section-ec/loading-section-ec.component.mjs +3 -3
  101. package/esm2022/lib/ec-components/widgets-ec/magnizoom-ec/magnizoom-ec.component.mjs +8 -6
  102. package/esm2022/lib/ec-components/widgets-ec/price-ec/price-ec.component.mjs +3 -3
  103. package/esm2022/lib/ec-components/widgets-ec/rating-ec/rating-ec.component.mjs +3 -3
  104. package/esm2022/lib/ec-components/widgets-ec/re-captcha-ec/re-captcha-ec.component.mjs +3 -3
  105. package/esm2022/lib/ec-components/widgets-ec/redsys-catch-ec/redsys-catch-ec.component.mjs +3 -3
  106. package/esm2022/lib/ec-directive/index.mjs +1 -1
  107. package/esm2022/lib/ec-directive/product-off.directive.mjs +1 -1
  108. package/esm2022/lib/ec-directive/product-stock.directive.mjs +1 -1
  109. package/esm2022/lib/ec-guards/auth.guard.mjs +1 -1
  110. package/esm2022/lib/ec-pipe/ec-currency-symbol.pipe.mjs +1 -1
  111. package/esm2022/lib/ec-pipe/ec-safe-html.pipe.mjs +1 -1
  112. package/esm2022/lib/ec-pipe/index.mjs +1 -1
  113. package/esm2022/lib/ec-services/addressing.service.mjs +1 -1
  114. package/esm2022/lib/ec-services/analytics/analytics.service.mjs +1 -1
  115. package/esm2022/lib/ec-services/analytics/doppler.service.mjs +1 -1
  116. package/esm2022/lib/ec-services/analytics/facebook-pixel.service.mjs +1 -1
  117. package/esm2022/lib/ec-services/analytics/google-analytics.service.mjs +4 -4
  118. package/esm2022/lib/ec-services/analytics/gtm.service.mjs +10 -6
  119. package/esm2022/lib/ec-services/analytics/index.mjs +1 -1
  120. package/esm2022/lib/ec-services/analytics/metricool-pixel.service.mjs +17 -18
  121. package/esm2022/lib/ec-services/auth.service.mjs +1 -1
  122. package/esm2022/lib/ec-services/auth.storage.service.mjs +1 -1
  123. package/esm2022/lib/ec-services/base-api.service.mjs +148 -0
  124. package/esm2022/lib/ec-services/blocks-repository.service.mjs +1 -1
  125. package/esm2022/lib/ec-services/blocks.service.mjs +1 -1
  126. package/esm2022/lib/ec-services/cart.service.mjs +4 -22
  127. package/esm2022/lib/ec-services/channel.service.mjs +1 -1
  128. package/esm2022/lib/ec-services/checkout.service.mjs +4 -2
  129. package/esm2022/lib/ec-services/currency.service.mjs +1 -1
  130. package/esm2022/lib/ec-services/filters.service.mjs +124 -18
  131. package/esm2022/lib/ec-services/form.service.mjs +1 -1
  132. package/esm2022/lib/ec-services/index.mjs +3 -1
  133. package/esm2022/lib/ec-services/local-storage.service.mjs +1 -1
  134. package/esm2022/lib/ec-services/ngx-local-storage.service.mjs +1 -1
  135. package/esm2022/lib/ec-services/options.service.mjs +1 -1
  136. package/esm2022/lib/ec-services/order-utility.service.mjs +1 -1
  137. package/esm2022/lib/ec-services/orders.service.mjs +1 -1
  138. package/esm2022/lib/ec-services/pagination.service.mjs +70 -22
  139. package/esm2022/lib/ec-services/parameters.service.mjs +1 -1
  140. package/esm2022/lib/ec-services/payment.service.mjs +1 -1
  141. package/esm2022/lib/ec-services/product-detail.service.mjs +1 -11
  142. package/esm2022/lib/ec-services/products.service.mjs +5 -3
  143. package/esm2022/lib/ec-services/re-captcha.service.mjs +1 -1
  144. package/esm2022/lib/ec-services/reviews.service.mjs +1 -1
  145. package/esm2022/lib/ec-services/runtime-config.service.mjs +190 -0
  146. package/esm2022/lib/ec-services/shipment.service.mjs +1 -1
  147. package/esm2022/lib/ec-services/stores.service.mjs +1 -1
  148. package/esm2022/lib/ec-services/test.service.mjs +1 -1
  149. package/esm2022/lib/ec-services/toast.service.mjs +1 -1
  150. package/esm2022/lib/interceptors/auth.interceptor.mjs +1 -1
  151. package/esm2022/lib/interceptors/index.mjs +2 -1
  152. package/esm2022/lib/interceptors/runtime-config.interceptor.mjs +41 -0
  153. package/esm2022/lib/interfaces/analytics/event-key.mjs +1 -1
  154. package/esm2022/lib/interfaces/analytics/facebook-pixel-data.mjs +1 -1
  155. package/esm2022/lib/interfaces/analytics/gtm-config.mjs +1 -1
  156. package/esm2022/lib/interfaces/analytics/index.mjs +1 -1
  157. package/esm2022/lib/interfaces/blocks.mjs +1 -1
  158. package/esm2022/lib/interfaces/checkout.mjs +1 -1
  159. package/esm2022/lib/interfaces/connection.mjs +1 -1
  160. package/esm2022/lib/interfaces/coupon.mjs +1 -1
  161. package/esm2022/lib/interfaces/currency.mjs +1 -1
  162. package/esm2022/lib/interfaces/deserializable.mjs +1 -1
  163. package/esm2022/lib/interfaces/environment.mjs +1 -1
  164. package/esm2022/lib/interfaces/faqs.mjs +1 -1
  165. package/esm2022/lib/interfaces/filter.mjs +1 -1
  166. package/esm2022/lib/interfaces/index.mjs +2 -1
  167. package/esm2022/lib/interfaces/options.mjs +1 -1
  168. package/esm2022/lib/interfaces/pagination.mjs +1 -1
  169. package/esm2022/lib/interfaces/parameter.mjs +1 -1
  170. package/esm2022/lib/interfaces/product.mjs +1 -1
  171. package/esm2022/lib/interfaces/runtime-config.mjs +2 -0
  172. package/esm2022/lib/interfaces/step.mjs +1 -1
  173. package/esm2022/lib/interfaces/storage.mjs +1 -1
  174. package/esm2022/lib/interfaces/store.mjs +1 -1
  175. package/esm2022/lib/interfaces/types/user.type.mjs +1 -1
  176. package/esm2022/lib/providers/index.mjs +2 -1
  177. package/esm2022/lib/providers/provideEnvironment.mjs +1 -1
  178. package/esm2022/lib/providers/provideRuntimeConfig.mjs +42 -0
  179. package/esm2022/lib/stores/currency.store.mjs +1 -1
  180. package/esm2022/public-api.mjs +1 -1
  181. package/fesm2022/ng-easycommerce-v18.mjs +1285 -509
  182. package/fesm2022/ng-easycommerce-v18.mjs.map +1 -1
  183. package/lib/classes/filters/attributes-filter.d.ts +24 -0
  184. package/lib/classes/filters/category-filter.d.ts +30 -3
  185. package/lib/constants/api.constants.service.d.ts +1 -0
  186. package/lib/constants/core.constants.service.d.ts +7 -0
  187. package/lib/ec-components/abstractions-components/menu-ec.component.d.ts +12 -0
  188. package/lib/ec-components/auth-ec/login-form-ec/login-form-ec.component.d.ts +2 -0
  189. package/lib/ec-components/cart-ec/cart-item-ec/cart-item-ec.component.d.ts +1 -1
  190. package/lib/ec-components/collection-ec/collection-ec.component.d.ts +5 -4
  191. package/lib/ec-components/filters-ec/filters-ec.component.d.ts +25 -4
  192. package/lib/ec-components/price-range-filter/price-range-filter.component.d.ts +2 -0
  193. package/lib/ec-components/product-ec/product-ec.component.d.ts +0 -4
  194. package/lib/ec-services/analytics/gtm.service.d.ts +1 -1
  195. package/lib/ec-services/base-api.service.d.ts +64 -0
  196. package/lib/ec-services/cart.service.d.ts +1 -1
  197. package/lib/ec-services/filters.service.d.ts +18 -1
  198. package/lib/ec-services/index.d.ts +2 -0
  199. package/lib/ec-services/pagination.service.d.ts +21 -5
  200. package/lib/ec-services/products.service.d.ts +1 -1
  201. package/lib/ec-services/runtime-config.service.d.ts +63 -0
  202. package/lib/interceptors/index.d.ts +1 -0
  203. package/lib/interceptors/runtime-config.interceptor.d.ts +7 -0
  204. package/lib/interfaces/environment.d.ts +1 -0
  205. package/lib/interfaces/filter.d.ts +1 -0
  206. package/lib/interfaces/index.d.ts +1 -0
  207. package/lib/interfaces/options.d.ts +2 -0
  208. package/lib/interfaces/product.d.ts +0 -6
  209. package/lib/interfaces/runtime-config.d.ts +22 -0
  210. package/lib/providers/index.d.ts +1 -0
  211. package/lib/providers/provideRuntimeConfig.d.ts +13 -0
  212. package/package.json +1 -1
@@ -1,14 +1,38 @@
1
1
  import { FilterElement, FilterType } from "../../interfaces";
2
2
  import { Filter } from "./filter";
3
+ import { Params } from "@angular/router";
4
+ /**
5
+ * AttributesFilter
6
+ * - Gestiona el filtro de atributos (estructura de padres/children).
7
+ * - Soporta hidratación desde query params y aplicación de códigos seleccionados.
8
+ */
3
9
  export declare class AttributesFilter extends Filter {
4
10
  private _optionsService;
5
11
  data: FilterElement[];
6
12
  multi: boolean;
13
+ private _codesFromQuery;
7
14
  constructor(initialValue?: any, options?: any);
8
15
  type(): FilterType;
9
16
  setContent(options: any, initialValue?: any): void;
10
17
  getContent(): FilterElement[];
18
+ /**
19
+ * ADDED: toUrlParams construye la porción de query string que representa las selecciones de atributos.
20
+ */
11
21
  toUrlParams(actual_url?: string, sublist?: any, already?: any): string;
12
22
  cleanResult(text: string): string;
23
+ /**
24
+ * ADDED: createElement transforma cada nodo original en FilterElement y marca selección inicial si corresponde.
25
+ */
13
26
  createElement(filter: any, original: any, initialValue?: any): any;
27
+ /** hidratar desde la URL */
28
+ hydrateFromQuery(params: Params): void;
29
+ /**
30
+ * ADDED: applyCodes recorre la estructura y marca selected=true en los children cuyo código está en 'codes'.
31
+ * Además marca el parent como seleccionado si alguno de sus hijos lo está.
32
+ */
33
+ private applyCodes;
34
+ /**
35
+ * ADDED: clearSelection desmarca todos los parents y children (restablece el filtro).
36
+ */
37
+ private clearSelection;
14
38
  }
@@ -1,14 +1,41 @@
1
1
  import { FilterElement, FilterType } from "../../interfaces";
2
2
  import { Filter } from "./filter";
3
+ /**
4
+ * CategoryFilter
5
+ * - Gestiona el filtro de categorías.
6
+ * - Mantiene la estructura de categorías (parents/children) y permite:
7
+ * * Inicializar desde OptionsService.
8
+ * * Marcar elementos según slug o query param.
9
+ * * Generar porción de query string (&category=...).
10
+ */
3
11
  export declare class CategoryFilter extends Filter {
4
- private initialValues?;
5
12
  private _optionsService;
13
+ private _filtersService;
6
14
  data: FilterElement[];
7
15
  multi: boolean;
8
- constructor(initialValues?: any);
16
+ constructor(initialValue?: any);
9
17
  type(): FilterType;
10
18
  setContent(options: any, initialValue?: any): void;
11
19
  getContent(): FilterElement[];
12
- toUrlParams(actual_url?: string, sublist?: any): string;
20
+ /**
21
+ * toUrlParams
22
+ * - Recorre la estructura y devuelve la porción de query string para la categoría seleccionada.
23
+ * - Prioriza el primer selected encontrado (solo una categoría se envía).
24
+ */
25
+ toUrlParams(): string;
13
26
  createElement(filter: any, original: any, initialValue?: any): any;
27
+ /**
28
+ * setFromSlug
29
+ * - Marca como selected los nodos cuyo slug/path/name coincide con el slug proporcionado.
30
+ * - Utiliza removeAccents para comparar sin tildes y en minúsculas.
31
+ * - No retorna valor, solo modifica this.data.
32
+ */
33
+ setFromSlug(slug: string): void;
34
+ /**
35
+ * hydrateFromQuery
36
+ * - Marca la categoría según el parámetro de query 'category' si existe.
37
+ * - Busca el code exacto en la estructura y marca el nodo correspondiente.
38
+ * - Loggea si se encontró o no la categoría.
39
+ */
40
+ hydrateFromQuery(query: any): void;
14
41
  }
@@ -7,6 +7,7 @@ import * as i0 from "@angular/core";
7
7
  export declare class ApiConstantsService {
8
8
  private _localStorage;
9
9
  private _translate;
10
+ private _runtimeConfig;
10
11
  /**
11
12
  * Contiene los datos provisto por el frontend en el archivo environment.ts
12
13
  */
@@ -27,6 +27,11 @@ export declare class CoreConstantsService {
27
27
  * Guarda la variable window del web browser.
28
28
  */
29
29
  private window?;
30
+ /**
31
+ * Tipo de ruta actual (ej: 'categories', 'attributes', etc).
32
+ * Lo usamos para que PaginationService sepa qué filtro esperar.
33
+ */
34
+ currentRouteType: string | null;
30
35
  constructor();
31
36
  /**
32
37
  * Path usado en las colecciones de productos.
@@ -144,6 +149,8 @@ export declare class CoreConstantsService {
144
149
  getParamsProductsWithUniqueVariant: () => ParamsProductsWithUniqueVariant;
145
150
  getChannel(): string;
146
151
  form_sender: boolean;
152
+ setCurrentRouteType(type: string | null): void;
153
+ getCurrentRouteType(): string | null;
147
154
  static ɵfac: i0.ɵɵFactoryDeclaration<CoreConstantsService, never>;
148
155
  static ɵprov: i0.ɵɵInjectableDeclaration<CoreConstantsService>;
149
156
  }
@@ -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
  }
@@ -2,10 +2,12 @@ import { EventEmitter } from '@angular/core';
2
2
  import { UserRoleType } from '../../../interfaces';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class LoginFormEcComponent {
5
+ private platformId;
5
6
  private _authService;
6
7
  private _formBuilder;
7
8
  private _toastService;
8
9
  private _router;
10
+ constructor(platformId: Object);
9
11
  showPassword: boolean;
10
12
  /**
11
13
  * Parametro para indicar si tras loguear
@@ -16,8 +16,8 @@ export declare class CartItemEcComponent implements OnInit {
16
16
  isQuantityUpdating: boolean;
17
17
  ngOnInit(): void;
18
18
  updateQuantity(stock: number): void;
19
- plus(stock: number, value?: number): void;
20
19
  less(stock: number, value?: number): void;
20
+ plus(stock: number, value?: number): void;
21
21
  deleteCartItem(): void;
22
22
  getVariants(product: any): any;
23
23
  createDiscountMessage(saleprice: number, price: number): string;
@@ -1,4 +1,4 @@
1
- import { OnInit } from '@angular/core';
1
+ import { OnDestroy, OnInit } from '@angular/core';
2
2
  import { DefaultFilter, FilterType, Product } from '../../interfaces';
3
3
  import { AuthService, OptionsService, ProductsService } from '../../ec-services';
4
4
  import { ActivatedRoute } from '@angular/router';
@@ -6,10 +6,11 @@ import { CoreConstantsService } from '../../constants';
6
6
  import { Observable } from 'rxjs';
7
7
  import { Filter } from '../../classes';
8
8
  import * as i0 from "@angular/core";
9
- export declare class CollectionEcComponent implements OnInit {
9
+ export declare class CollectionEcComponent implements OnInit, OnDestroy {
10
10
  protected _productsService: ProductsService;
11
11
  protected _activeRoute: ActivatedRoute;
12
12
  protected _optionsService: OptionsService;
13
+ private _filtersService;
13
14
  params$: Observable<import("@angular/router").Params>;
14
15
  queryParams$: Observable<import("@angular/router").Params>;
15
16
  products$: Observable<Product[]>;
@@ -22,17 +23,17 @@ export declare class CollectionEcComponent implements OnInit {
22
23
  private loaded;
23
24
  optionsFilters: FilterType[];
24
25
  filters_sort: Filter[];
25
- private _filtersService;
26
26
  filters$: Observable<Filter[]>;
27
27
  ready$: Observable<boolean>;
28
28
  private window?;
29
29
  isList: boolean;
30
+ private destroy$;
30
31
  setAsList: (value: boolean) => boolean;
31
32
  ngOnInit(): void;
32
33
  private total;
33
34
  private platformId;
34
35
  constructor();
35
- getProducts(): void;
36
+ ngOnDestroy(): void;
36
37
  onScroll(): void;
37
38
  productHasStock(product: Product): boolean;
38
39
  static ɵfac: i0.ɵɵFactoryDeclaration<CollectionEcComponent, never>;
@@ -15,6 +15,7 @@ export declare class FiltersEcComponent {
15
15
  injector: Injector;
16
16
  isAuthenticated$: boolean;
17
17
  hidePrices: boolean;
18
+ private route;
18
19
  setSelect: any;
19
20
  ngOnInit(): void;
20
21
  constructor();
@@ -23,6 +24,18 @@ export declare class FiltersEcComponent {
23
24
  /** 2) Para cualquier otro FilterType, devuelvo Filter */
24
25
  getSpecificFilter(type: FilterType): Filter | null;
25
26
  onSelect(event: any, filter: FilterElement[] | null): void;
27
+ /**
28
+ * Maneja el click sobre un elemento de filtro (categoría, atributo, etc.).
29
+ *
30
+ * - Para categorías: navega a la URL de la categoría.
31
+ * - Para atributos: actualiza la query string de la URL con `attributeCodes`.
32
+ * - Para otros filtros: delega en FiltersService para marcar seleccionado.
33
+ *
34
+ * La idea es que **la URL siempre represente los filtros aplicados**,
35
+ * de modo que:
36
+ * - al hacer F5 no se pierdan los filtros,
37
+ * - los links sean compartibles (deep linking).
38
+ */
26
39
  setSelected(filter: Filter | null, selected: FilterElement | null): void;
27
40
  uniqueSelection(filter: {
28
41
  data: any[];
@@ -31,11 +44,19 @@ export declare class FiltersEcComponent {
31
44
  scrollUp: () => boolean;
32
45
  hasAppliedFilters(): boolean;
33
46
  /**
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
- */
47
+ * Verifica si una categoría tiene la propiedad isVisible y está marcada como visible
48
+ * @param category - La categoría a verificar
49
+ * @returns true si la categoría es visible, false en caso contrario
50
+ */
38
51
  hasVisibleProperty(category: FilterElement): boolean;
52
+ /** Lista visible (filtra recursivo por isVisible) */
53
+ getVisibleData(filter: Filter | null): FilterElement[];
54
+ /** Children visibles de un nodo */
55
+ getVisibleChildren(node?: FilterElement): FilterElement[];
56
+ /** Tiene hijos visibles? */
57
+ hasVisibleChildren(node?: FilterElement): boolean;
58
+ /** Utilidad recursiva */
59
+ private filterVisibleTree;
39
60
  static ɵfac: i0.ɵɵFactoryDeclaration<FiltersEcComponent, never>;
40
61
  static ɵcmp: i0.ɵɵComponentDeclaration<FiltersEcComponent, "lib-filters-ec", never, { "setSelect": { "alias": "setSelect"; "required": false; }; }, {}, never, never, true, never>;
41
62
  }
@@ -3,6 +3,8 @@ import { PriceRangeFilter } from '../../classes/filters/price_range-filter';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class PriceRangeFilterComponent {
5
5
  private _filtersService;
6
+ private router;
7
+ private route;
6
8
  priceGap: number;
7
9
  roundStep: number;
8
10
  filter: PriceRangeFilter;
@@ -50,10 +50,6 @@ export declare class ProductEcComponent implements OnInit {
50
50
  plus(stock?: number, multipleQuantity?: number): void;
51
51
  less(multipleQuantity?: number): void;
52
52
  addToCart(): void;
53
- /**
54
- * Valida las restricciones de cantidad del producto
55
- */
56
- private validateQuantity;
57
53
  checkStock(stock: number): void;
58
54
  onQuantityChange(event: Event): void;
59
55
  static ɵfac: i0.ɵɵFactoryDeclaration<ProductEcComponent, never>;
@@ -23,6 +23,7 @@ export declare class GTMService {
23
23
  private window?;
24
24
  private rendererFactory;
25
25
  private document;
26
+ private platformId;
26
27
  /**
27
28
  * Servicio de ruteo de angular.
28
29
  */
@@ -31,7 +32,6 @@ export declare class GTMService {
31
32
  * Configuración de Google Tag Manager.
32
33
  */
33
34
  private config;
34
- private platformId;
35
35
  constructor();
36
36
  /**
37
37
  * Obtiene el dataLayer del objecto window
@@ -0,0 +1,64 @@
1
+ import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
2
+ import { Observable } from 'rxjs';
3
+ import { RuntimeConfigService } from './runtime-config.service';
4
+ import * as i0 from "@angular/core";
5
+ export interface ApiRequestOptions {
6
+ headers?: HttpHeaders | {
7
+ [header: string]: string | string[];
8
+ };
9
+ params?: HttpParams | {
10
+ [param: string]: string | string[];
11
+ };
12
+ withCredentials?: boolean;
13
+ }
14
+ /**
15
+ * Servicio base para realizar peticiones HTTP usando configuración dinámica
16
+ * Todos los servicios de la aplicación deben extender este servicio o usar sus métodos
17
+ */
18
+ export declare class BaseApiService {
19
+ protected http: HttpClient;
20
+ protected runtimeConfigService: RuntimeConfigService;
21
+ constructor(http: HttpClient, runtimeConfigService: RuntimeConfigService);
22
+ /**
23
+ * Construye una URL completa usando la API_URL del runtime
24
+ */
25
+ protected buildApiUrl(endpoint: string): string;
26
+ /**
27
+ * Obtiene headers comunes que incluyen información del runtime
28
+ */
29
+ protected getCommonHeaders(): HttpHeaders;
30
+ /**
31
+ * Método GET genérico
32
+ */
33
+ get<T>(endpoint: string, options?: ApiRequestOptions): Observable<T>;
34
+ /**
35
+ * Método POST genérico
36
+ */
37
+ post<T>(endpoint: string, data: any, options?: ApiRequestOptions): Observable<T>;
38
+ /**
39
+ * Método PUT genérico
40
+ */
41
+ put<T>(endpoint: string, data: any, options?: ApiRequestOptions): Observable<T>;
42
+ /**
43
+ * Método PATCH genérico
44
+ */
45
+ patch<T>(endpoint: string, data: any, options?: ApiRequestOptions): Observable<T>;
46
+ /**
47
+ * Método DELETE genérico
48
+ */
49
+ delete<T>(endpoint: string, options?: ApiRequestOptions): Observable<T>;
50
+ /**
51
+ * Método para peticiones que necesitan esperar a que la config esté cargada
52
+ */
53
+ getWithConfig<T>(endpoint: string, options?: ApiRequestOptions): Observable<T>;
54
+ /**
55
+ * Método para POST que necesitan esperar a que la config esté cargada
56
+ */
57
+ postWithConfig<T>(endpoint: string, data: any, options?: ApiRequestOptions): Observable<T>;
58
+ /**
59
+ * Combina headers personalizados con los headers comunes
60
+ */
61
+ private mergeHeaders;
62
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaseApiService, never>;
63
+ static ɵprov: i0.ɵɵInjectableDeclaration<BaseApiService>;
64
+ }
@@ -115,7 +115,7 @@ export declare class CartService {
115
115
  * @param item el item a actualizar.
116
116
  * @param quantity la cantidad nueva.
117
117
  */
118
- updateItemQuantity(item: CartItem, quantity: number): boolean;
118
+ updateItemQuantity(item: CartItem, quantity: number): void;
119
119
  /**
120
120
  * Maneja el error en caso de que no se pueda agregar al carrito el producto.
121
121
  * @param err
@@ -1,6 +1,7 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { Filter } from '../classes';
3
3
  import { FilterElement, PaginationSettings, FilterType } from '../interfaces';
4
+ import { Params } from '@angular/router';
4
5
  import * as i0 from "@angular/core";
5
6
  export declare class FiltersService {
6
7
  private _apiConsts;
@@ -16,6 +17,7 @@ export declare class FiltersService {
16
17
  private _defaultFilters;
17
18
  private _paginationSettings;
18
19
  private _filtersInitialized;
20
+ private _lastRouteQuery;
19
21
  constructor();
20
22
  /**
21
23
  * Retorna la url para el filtrado
@@ -30,7 +32,7 @@ export declare class FiltersService {
30
32
  */
31
33
  generateFinalApi(search_value?: string): string;
32
34
  private isUpdated;
33
- setFilters(paginationSettings: PaginationSettings, search_value?: string): void;
35
+ setFilters(paginationSettings: PaginationSettings, search_value?: string, routeQueryParams?: any): void;
34
36
  getFilters(paginationSettings?: PaginationSettings): Filter[] | undefined;
35
37
  getSpecificFilters(types: FilterType[]): Filter[];
36
38
  setFilterSelected(filterObj: Filter, filterElem: FilterElement): void;
@@ -40,6 +42,21 @@ export declare class FiltersService {
40
42
  * el array de filtros para que PaginationService vuelva a llamar
41
43
  */
42
44
  updatePriceRangeFilter(min: number, max: number): void;
45
+ /**
46
+ * Fuerza a emitir de nuevo los filtros actuales.
47
+ * Útil cuando un filtro async (categorías, atributos) termina de cargarse
48
+ * y necesitamos que PaginationService vuelva a armar la URL.
49
+ */
50
+ refreshFilters(): void;
51
+ /**
52
+ * Punto central donde se hidratan los filtros a partir de la URL:
53
+ * - Lee type/value de la ruta (ej. /collection/categories/:value).
54
+ * - Lee query params (category, price_min, price_max, attributeCodes, search, etc.).
55
+ * - Crea instancias de filtros y les delega la hidratación específica.
56
+ *
57
+ * Este método se llama tanto en SSR como en navegador.
58
+ */
59
+ hydrateFromRoute(paginationSettings: PaginationSettings, routeParams: Params, routeQuery: Params): void;
43
60
  static ɵfac: i0.ɵɵFactoryDeclaration<FiltersService, never>;
44
61
  static ɵprov: i0.ɵɵInjectableDeclaration<FiltersService>;
45
62
  }
@@ -24,3 +24,5 @@ export * from './order-utility.service';
24
24
  export * from './payment.service';
25
25
  export * from './test.service';
26
26
  export * from './orders.service';
27
+ export * from './runtime-config.service';
28
+ export * from './base-api.service';
@@ -3,14 +3,30 @@ import { Pagination, Product } from '../interfaces';
3
3
  import { Filter } from '../classes';
4
4
  import * as i0 from "@angular/core";
5
5
  /**
6
- * Servicio para manejar la paginación de los productos.
7
- * @class PaginationService
6
+ * Servicio para manejar la paginación y la carga de productos.
7
+ *
8
+ * Se encarga de:
9
+ * - Escuchar los cambios en los filtros (categorías, atributos, precio, búsqueda, etc.).
10
+ * - Construir la URL al backend con esos filtros.
11
+ * - Pedir los productos al endpoint de product-search.
12
+ * - Exponer un observable con la última página de productos (`paginationData$`)
13
+ * y otros helpers (precio mínimo/máximo, siguiente página, etc.).
8
14
  */
9
15
  export declare class PaginationService {
10
16
  private _connectionService;
11
17
  private _filtersService;
12
18
  private _constants;
13
- paginationData$: Observable<any>;
19
+ /**
20
+ * Flujo principal: a partir de los filtros → arma URL → consulta backend → devuelve productos.
21
+ *
22
+ * Pasos:
23
+ * 1) Espera a que `FiltersService` emita filtros válidos.
24
+ * 2) Construye la URL final con `buildUrl()`.
25
+ * 3) Evita repetir llamadas si la URL no cambió (`distinctUntilChanged`).
26
+ * 4) Llama al backend con `getData(url)`.
27
+ * 5) Comparte el último resultado con todos los suscriptores (`shareReplay(1)`).
28
+ */
29
+ paginationData$: Observable<Product[]>;
14
30
  private _dataPagination;
15
31
  private _waiting;
16
32
  private _finished;
@@ -85,11 +101,11 @@ export declare class PaginationService {
85
101
  */
86
102
  buildUrl(filters: Filter[]): string;
87
103
  /**
88
- * Devuelve un observable de los productos que devolvio la última página obtenida.
104
+ * Devuelve un observable de los productos que devolvió la última página obtenida.
89
105
  * @param url
90
106
  * @returns
91
107
  */
92
- getData(url: string): Observable<any>;
108
+ getData(url: string): Observable<Product[]>;
93
109
  static ɵfac: i0.ɵɵFactoryDeclaration<PaginationService, never>;
94
110
  static ɵprov: i0.ɵɵInjectableDeclaration<PaginationService>;
95
111
  }
@@ -25,7 +25,7 @@ export declare class ProductsService {
25
25
  * @param paginationSettings
26
26
  * @param searchValue
27
27
  */
28
- getProductsForFilter(paginationSettings?: PaginationSettings, searchValue?: any): any;
28
+ getProductsForFilter(paginationSettings?: PaginationSettings, searchValue?: any, routeQueryParams?: any): any;
29
29
  /**
30
30
  * Actualiza los productos con los de la siguiente pagina.
31
31
  */
@@ -0,0 +1,63 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { Observable } from 'rxjs';
3
+ import { RuntimeConfig } from '../interfaces/runtime-config';
4
+ import * as i0 from "@angular/core";
5
+ export declare class RuntimeConfigService {
6
+ private platformId;
7
+ private http;
8
+ private configSubject;
9
+ config$: Observable<RuntimeConfig | null>;
10
+ private _config;
11
+ private _loadPromise;
12
+ private _isLoaded;
13
+ constructor(platformId: Object, http: HttpClient);
14
+ /**
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)
21
+ * - En SSR: Lee desde el objeto window inyectado por el servidor
22
+ * - En Browser: Hace petición HTTP a /runtime-config.json (solo si no está en window)
23
+ */
24
+ loadConfig(): Observable<RuntimeConfig>;
25
+ /**
26
+ * Obtiene la configuración actual (síncrono)
27
+ */
28
+ getConfig(): RuntimeConfig | null;
29
+ /**
30
+ * Obtiene la API URL actual
31
+ */
32
+ getApiUrl(): string;
33
+ /**
34
+ * Obtiene la Frontend URL actual
35
+ */
36
+ getFrontendUrl(): string | undefined;
37
+ /**
38
+ * Obtiene el entorno actual
39
+ */
40
+ getAppEnv(): string;
41
+ /**
42
+ * Verifica si estamos en producción
43
+ */
44
+ isProduction(): boolean;
45
+ /**
46
+ * Obtiene el locale actual
47
+ */
48
+ getLocale(): string;
49
+ /**
50
+ * Obtiene el canal actual
51
+ */
52
+ getChannel(): string;
53
+ /**
54
+ * Método helper para construir URLs de API
55
+ */
56
+ buildApiUrl(endpoint: string): string;
57
+ /**
58
+ * Método helper para construir URLs del frontend
59
+ */
60
+ buildFrontendUrl(path: string): string;
61
+ static ɵfac: i0.ɵɵFactoryDeclaration<RuntimeConfigService, never>;
62
+ static ɵprov: i0.ɵɵInjectableDeclaration<RuntimeConfigService>;
63
+ }
@@ -1 +1,2 @@
1
1
  export * from './auth.interceptor';
2
+ export * from './runtime-config.interceptor';
@@ -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,4 +4,5 @@ export interface Environment {
4
4
  frontendUrl?: string;
5
5
  locale: string;
6
6
  channel: string;
7
+ appEnv?: string;
7
8
  }
@@ -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;
@@ -16,3 +16,4 @@ export * from './coupon';
16
16
  export * from './step';
17
17
  export * from './checkout';
18
18
  export * from './faqs';
19
+ export * from './runtime-config';
@@ -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
  }
@@ -5,9 +5,6 @@ export interface OptionValue {
5
5
  name: string;
6
6
  description?: string;
7
7
  selected?: boolean;
8
- maximumItemsQuantity?: number;
9
- minimumItemsQuantity?: number;
10
- multipleQuantity?: number;
11
8
  }
12
9
  export interface Options {
13
10
  code: string;
@@ -37,9 +34,6 @@ export interface Product {
37
34
  productWithUniqueVariant?: Product[];
38
35
  stock?: number;
39
36
  variant_id?: number;
40
- maximumItemsQuantity?: number;
41
- minimumItemsQuantity?: number;
42
- multipleQuantity?: number;
43
37
  }
44
38
  export interface ProductToCartItem {
45
39
  productCode?: string;
@@ -0,0 +1,22 @@
1
+ export interface RuntimeConfig {
2
+ apiUrl: string;
3
+ frontendUrl?: string;
4
+ /** Ambiente de la aplicación. Valores válidos: 'prod', 'preprod', 'test' */
5
+ appEnv: 'prod' | 'preprod' | 'test';
6
+ production: boolean;
7
+ locale: string;
8
+ channel: string;
9
+ port?: number;
10
+ host?: string;
11
+ }
12
+ export interface ServerEnvironmentVariables {
13
+ API_URL?: string;
14
+ FRONTEND_URL?: string;
15
+ /** Ambiente de la aplicación. Valores válidos: 'prod', 'preprod', 'test' */
16
+ APP_ENV?: 'prod' | 'preprod' | 'test';
17
+ PORT?: string;
18
+ HOST?: string;
19
+ NODE_ENV?: 'development' | 'production';
20
+ LOCALE?: string;
21
+ CHANNEL?: string;
22
+ }
@@ -1 +1,2 @@
1
1
  export * from './provideEnvironment';
2
+ export * from './provideRuntimeConfig';
@@ -0,0 +1,13 @@
1
+ import { EnvironmentProviders } from '@angular/core';
2
+ import { RuntimeConfigService } from '../ec-services/runtime-config.service';
3
+ /**
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
7
+ */
8
+ export declare function initializeRuntimeConfig(runtimeConfigService: RuntimeConfigService): () => Promise<any>;
9
+ /**
10
+ * Función que configura el RuntimeConfigService y su inicialización
11
+ * Debe ser usado en app.config.ts junto con provideEnvironment
12
+ */
13
+ export declare function provideRuntimeConfig(): EnvironmentProviders;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ng-easycommerce-v18",
3
- "version": "0.3.19-beta.1",
3
+ "version": "0.3.20-beta.1",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^18.2.0",
6
6
  "@angular/core": "^18.2.0"