ng-miam 6.4.13 → 7.0.0

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 (208) hide show
  1. package/bundles/ng-miam.umd.js +8539 -10855
  2. package/bundles/ng-miam.umd.js.map +1 -1
  3. package/bundles/ng-miam.umd.min.js +2 -2
  4. package/bundles/ng-miam.umd.min.js.map +1 -1
  5. package/esm2015/lib/_components/abstracts/event-tracer.component.js +3 -2
  6. package/esm2015/lib/_components/accordion/accordion.component.js +75 -0
  7. package/esm2015/lib/_components/components.module.js +27 -21
  8. package/esm2015/lib/_components/counter-input/counter-input.component.js +86 -76
  9. package/esm2015/lib/_components/icon/icon.component.js +1 -1
  10. package/esm2015/lib/_components/index.js +5 -5
  11. package/esm2015/lib/_components/like-button/like-button.component.js +1 -1
  12. package/esm2015/lib/_components/list-input/list-input.component.js +5 -5
  13. package/esm2015/lib/_components/loader/loader.component.js +1 -1
  14. package/esm2015/lib/_components/meals-planner-link/meals-planner-link.component.js +3 -3
  15. package/esm2015/lib/_components/modal/modal.component.js +155 -137
  16. package/esm2015/lib/_components/product-card/product-card.component.js +333 -0
  17. package/esm2015/lib/_components/products-picker/products-picker.component.js +155 -0
  18. package/esm2015/lib/_components/progress-tracker/progress-tracker.component.js +1 -1
  19. package/esm2015/lib/_components/recipe-filters/recipe-filters.component.js +166 -217
  20. package/esm2015/lib/_components/recipe-pricing/recipe-pricing.component.js +55 -35
  21. package/esm2015/lib/_components/slider-tabs/slider-tabs.component.js +84 -0
  22. package/esm2015/lib/_components/sponsor-blocks/sponsor-image-and-text-block/sponsor-image-and-text-block.component.js +1 -1
  23. package/esm2015/lib/_components/sponsor-blocks/sponsor-text-and-image-block/sponsor-text-and-image-block.component.js +1 -1
  24. package/esm2015/lib/_components/tabs/tabs.component.js +48 -88
  25. package/esm2015/lib/_components/toaster/toaster.component.js +48 -84
  26. package/esm2015/lib/_components/tooltipable-content/tooltipable-content.component.js +1 -1
  27. package/esm2015/lib/_models/basket-entry.js +33 -49
  28. package/esm2015/lib/_models/basket-preview-line.js +5 -5
  29. package/esm2015/lib/_models/basket.js +15 -12
  30. package/esm2015/lib/_models/item.js +2 -2
  31. package/esm2015/lib/_models/recipe.js +2 -15
  32. package/esm2015/lib/_models/user.js +1 -1
  33. package/esm2015/lib/_services/analytics.service.js +24 -5
  34. package/esm2015/lib/_services/baskets-synchronizing/baskets-comparator.service.js +1 -10
  35. package/esm2015/lib/_services/baskets-synchronizing/baskets-synchronizer.service.js +15 -15
  36. package/esm2015/lib/_services/baskets.service.js +478 -60
  37. package/esm2015/lib/_services/context.service.js +22 -35
  38. package/esm2015/lib/_services/index.js +3 -5
  39. package/esm2015/lib/_services/interceptor.service.js +2 -2
  40. package/esm2015/lib/_services/items.service.js +27 -4
  41. package/esm2015/lib/_services/recipe-details.service.js +198 -0
  42. package/esm2015/lib/_services/recipe-likes.service.js +1 -1
  43. package/esm2015/lib/_services/recipes.service.js +24 -53
  44. package/esm2015/lib/_services/scrolling.service.js +17 -0
  45. package/esm2015/lib/_services/toaster.service.js +4 -5
  46. package/esm2015/lib/_services/user.service.js +2 -2
  47. package/esm2015/lib/_types/basket-action-type.enum.js +11 -0
  48. package/esm2015/lib/_types/basket-action.js +2 -0
  49. package/esm2015/lib/_types/basket-stats.js +2 -0
  50. package/esm2015/lib/_types/builded/miam-interface.js +1 -1
  51. package/esm2015/lib/_types/event-trace.js +5 -0
  52. package/esm2015/lib/_types/items-comparator.js +1 -10
  53. package/esm2015/lib/_types/recipe-filters.js +1 -1
  54. package/esm2015/lib/_types/toaster.js +1 -1
  55. package/esm2015/lib/_utils/directives/index.js +2 -1
  56. package/esm2015/lib/_utils/directives/reach-top.directive.js +33 -0
  57. package/esm2015/lib/_utils/pipes/readable-float-number/readable-float-number.pipe.js +8 -2
  58. package/esm2015/lib/_utils/utils.module.js +12 -8
  59. package/esm2015/lib/_web-components/basket-preview/basket-preview-block/basket-preview-block.component.js +140 -118
  60. package/esm2015/lib/_web-components/basket-preview/basket-preview-disabled/basket-preview-disabled.component.js +2 -2
  61. package/esm2015/lib/_web-components/basket-preview/basket-preview-line/basket-preview-line.component.js +125 -444
  62. package/esm2015/lib/_web-components/basket-preview/replace-item/replace-item.component.js +211 -108
  63. package/esm2015/lib/_web-components/index.js +1 -4
  64. package/esm2015/lib/_web-components/list-scan/basket-preview/basket-preview.component.js +11 -14
  65. package/esm2015/lib/_web-components/list-scan/files-inputs/files-inputs.component.js +13 -13
  66. package/esm2015/lib/_web-components/list-scan/ingredients-list/ingredients-list.component.js +6 -6
  67. package/esm2015/lib/_web-components/list-scan/list-scan.component.js +10 -10
  68. package/esm2015/lib/_web-components/list-scan/overlay-button/overlay-button.component.js +23 -11
  69. package/esm2015/lib/_web-components/meals-planner/meals-planner-basket-confirmation/meals-planner-basket-confirmation.component.js +1 -1
  70. package/esm2015/lib/_web-components/meals-planner/meals-planner-catalog/meals-planner-catalog.component.js +1 -1
  71. package/esm2015/lib/_web-components/meals-planner/meals-planner-form/meals-planner-form.component.js +7 -7
  72. package/esm2015/lib/_web-components/meals-planner/meals-planner-result/meals-planner-result.component.js +5 -5
  73. package/esm2015/lib/_web-components/meals-planner/meals-planner.component.js +16 -20
  74. package/esm2015/lib/_web-components/planner-side-menu/planner-side-menu.component.js +4 -53
  75. package/esm2015/lib/_web-components/recipe-cards/add-recipe-card/add-recipe-card.component.js +1 -1
  76. package/esm2015/lib/_web-components/recipe-cards/index.js +1 -3
  77. package/esm2015/lib/_web-components/recipe-cards/recipe-card/recipe-card.component.js +326 -404
  78. package/esm2015/lib/_web-components/recipe-cards/recipe-card-cta/recipe-card-cta.component.js +50 -146
  79. package/esm2015/lib/_web-components/recipe-cards/recipe-cards.module.js +3 -15
  80. package/esm2015/lib/_web-components/recipe-catalog/catalog-article-card/catalog-article-card.component.js +1 -1
  81. package/esm2015/lib/_web-components/recipe-catalog/catalog-category/catalog-category.component.js +35 -29
  82. package/esm2015/lib/_web-components/recipe-catalog/catalog-header/catalog-header.component.js +1 -1
  83. package/esm2015/lib/_web-components/recipe-catalog/catalog-list/catalog-list.component.js +27 -31
  84. package/esm2015/lib/_web-components/recipe-catalog/recipe-catalog.component.js +98 -100
  85. package/esm2015/lib/_web-components/recipe-creation/recipe-form/recipe-form.component.js +2 -2
  86. package/esm2015/lib/_web-components/recipe-creation/recipe-stepper/recipe-stepper.component.js +7 -7
  87. package/esm2015/lib/_web-components/recipe-creation/tags-creator/tags-creator.component.js +4 -4
  88. package/esm2015/lib/_web-components/recipe-creation/tags-selector/tags-selector.component.js +8 -8
  89. package/esm2015/lib/_web-components/recipe-details/recipe-addon/recipe-addon.component.js +7 -3
  90. package/esm2015/lib/_web-components/recipe-details/recipe-details-infos/recipe-details-infos.component.js +57 -358
  91. package/esm2015/lib/_web-components/recipe-details/recipe-details-ingredients/recipe-details-ingredients.component.js +59 -122
  92. package/esm2015/lib/_web-components/recipe-details/recipe-details-steps/recipe-details-steps.component.js +51 -72
  93. package/esm2015/lib/_web-components/recipe-details/recipe-details.component.js +313 -363
  94. package/esm2015/lib/_web-components/recipe-details/recipe-details.module.js +8 -4
  95. package/esm2015/lib/_web-components/recipe-details/sponsor-storytelling/sponsor-storytelling.component.js +1 -1
  96. package/esm2015/lib/_web-components/recipe-helper/recipe-helper.component.js +89 -113
  97. package/esm2015/lib/_web-components/recipe-modal/recipe-modal.component.js +78 -69
  98. package/esm2015/lib/_web-components/recipe-tags/recipe-tags.component.js +5 -5
  99. package/esm2015/lib/_web-components/toaster-stack/toaster-stack.component.js +8 -4
  100. package/esm2015/lib/_web-components/web-components.module.js +3 -19
  101. package/esm2015/lib/ng-miam.module.js +5 -7
  102. package/fesm2015/ng-miam.js +5165 -6973
  103. package/fesm2015/ng-miam.js.map +1 -1
  104. package/lib/_components/abstracts/event-tracer.component.d.ts +2 -1
  105. package/lib/_components/accordion/accordion.component.d.ts +23 -0
  106. package/lib/_components/components.module.d.ts +38 -36
  107. package/lib/_components/counter-input/counter-input.component.d.ts +12 -14
  108. package/lib/_components/index.d.ts +4 -4
  109. package/lib/_components/modal/modal.component.d.ts +18 -18
  110. package/lib/_components/product-card/product-card.component.d.ts +40 -0
  111. package/lib/_components/products-picker/products-picker.component.d.ts +17 -0
  112. package/lib/_components/recipe-pricing/recipe-pricing.component.d.ts +12 -8
  113. package/lib/_components/slider-tabs/slider-tabs.component.d.ts +16 -0
  114. package/lib/_components/tabs/tabs.component.d.ts +11 -11
  115. package/lib/_components/toaster/toaster.component.d.ts +4 -2
  116. package/lib/_models/basket-entry.d.ts +16 -20
  117. package/lib/_models/basket-preview-line.d.ts +1 -0
  118. package/lib/_models/basket.d.ts +12 -5
  119. package/lib/_models/item.d.ts +1 -1
  120. package/lib/_models/recipe.d.ts +0 -5
  121. package/lib/_models/user.d.ts +0 -1
  122. package/lib/_services/analytics.service.d.ts +8 -22
  123. package/lib/_services/baskets-synchronizing/baskets-comparator.service.d.ts +0 -5
  124. package/lib/_services/baskets-synchronizing/baskets-synchronizer.service.d.ts +3 -6
  125. package/lib/_services/baskets.service.d.ts +137 -18
  126. package/lib/_services/context.service.d.ts +2 -4
  127. package/lib/_services/index.d.ts +2 -4
  128. package/lib/_services/items.service.d.ts +9 -2
  129. package/lib/_services/recipe-details.service.d.ts +84 -0
  130. package/lib/_services/recipe-likes.service.d.ts +2 -1
  131. package/lib/_services/recipes.service.d.ts +10 -14
  132. package/lib/_services/scrolling.service.d.ts +8 -0
  133. package/lib/_services/toaster.service.d.ts +1 -1
  134. package/lib/_types/basket-action-type.enum.d.ts +9 -0
  135. package/lib/_types/basket-action.d.ts +14 -0
  136. package/lib/_types/basket-stats.d.ts +5 -0
  137. package/lib/_types/builded/miam-interface.d.ts +16 -25
  138. package/lib/_types/event-trace.d.ts +22 -0
  139. package/lib/_types/items-comparator.d.ts +0 -5
  140. package/lib/_types/recipe-filters.d.ts +0 -2
  141. package/lib/_types/toaster.d.ts +1 -1
  142. package/lib/_utils/directives/index.d.ts +1 -0
  143. package/lib/_utils/directives/reach-top.directive.d.ts +13 -0
  144. package/lib/_utils/pipes/readable-float-number/readable-float-number.pipe.d.ts +1 -1
  145. package/lib/_utils/utils.module.d.ts +2 -2
  146. package/lib/_web-components/basket-preview/basket-preview-block/basket-preview-block.component.d.ts +9 -8
  147. package/lib/_web-components/basket-preview/basket-preview-line/basket-preview-line.component.d.ts +11 -9
  148. package/lib/_web-components/basket-preview/replace-item/replace-item.component.d.ts +27 -20
  149. package/lib/_web-components/index.d.ts +0 -3
  150. package/lib/_web-components/list-scan/basket-preview/basket-preview.component.d.ts +1 -2
  151. package/lib/_web-components/list-scan/files-inputs/files-inputs.component.d.ts +6 -5
  152. package/lib/_web-components/list-scan/ingredients-list/ingredients-list.component.d.ts +3 -3
  153. package/lib/_web-components/list-scan/list-scan.component.d.ts +3 -3
  154. package/lib/_web-components/list-scan/overlay-button/overlay-button.component.d.ts +8 -6
  155. package/lib/_web-components/meals-planner/meals-planner.component.d.ts +2 -3
  156. package/lib/_web-components/recipe-cards/index.d.ts +0 -2
  157. package/lib/_web-components/recipe-cards/recipe-card/recipe-card.component.d.ts +58 -17
  158. package/lib/_web-components/recipe-cards/recipe-card-cta/recipe-card-cta.component.d.ts +5 -12
  159. package/lib/_web-components/recipe-cards/recipe-cards.module.d.ts +7 -9
  160. package/lib/_web-components/recipe-catalog/catalog-category/catalog-category.component.d.ts +8 -6
  161. package/lib/_web-components/recipe-catalog/catalog-list/catalog-list.component.d.ts +7 -4
  162. package/lib/_web-components/recipe-catalog/recipe-catalog.component.d.ts +2 -3
  163. package/lib/_web-components/recipe-details/recipe-addon/recipe-addon.component.d.ts +5 -2
  164. package/lib/_web-components/recipe-details/recipe-details-infos/recipe-details-infos.component.d.ts +6 -18
  165. package/lib/_web-components/recipe-details/recipe-details-ingredients/recipe-details-ingredients.component.d.ts +6 -13
  166. package/lib/_web-components/recipe-details/recipe-details-steps/recipe-details-steps.component.d.ts +2 -10
  167. package/lib/_web-components/recipe-details/recipe-details.component.d.ts +29 -36
  168. package/lib/_web-components/recipe-details/recipe-details.module.d.ts +2 -1
  169. package/lib/_web-components/recipe-helper/recipe-helper.component.d.ts +2 -6
  170. package/lib/_web-components/recipe-modal/recipe-modal.component.d.ts +11 -9
  171. package/lib/_web-components/toaster-stack/toaster-stack.component.d.ts +5 -2
  172. package/lib/_web-components/web-components.module.d.ts +23 -29
  173. package/miam-style.css +1 -1
  174. package/package.json +1 -1
  175. package/esm2015/lib/_components/abstracts/abstract-recipe-card.component.js +0 -130
  176. package/esm2015/lib/_components/skeleton/skeleton.component.js +0 -70
  177. package/esm2015/lib/_components/tabs/tab-body.component.js +0 -30
  178. package/esm2015/lib/_components/tabs/tab-item.component.js +0 -36
  179. package/esm2015/lib/_components/tabs/tab-label.component.js +0 -30
  180. package/esm2015/lib/_models/groceries-entry.js +0 -42
  181. package/esm2015/lib/_models/groceries-list.js +0 -36
  182. package/esm2015/lib/_services/counter.service.js +0 -20
  183. package/esm2015/lib/_services/groceries-entries.service.js +0 -21
  184. package/esm2015/lib/_services/groceries-lists.service.js +0 -240
  185. package/esm2015/lib/_services/recipe-events.service.js +0 -63
  186. package/esm2015/lib/_types/skeleton.enum.js +0 -7
  187. package/esm2015/lib/_web-components/drawer/drawer.component.js +0 -273
  188. package/esm2015/lib/_web-components/pos-card/pos-card.component.js +0 -207
  189. package/esm2015/lib/_web-components/pos-selection/pos-selection.component.js +0 -283
  190. package/esm2015/lib/_web-components/recipe-cards/catalog-recipe-card/catalog-recipe-card.component.js +0 -632
  191. package/esm2015/lib/_web-components/recipe-cards/suggestion-card/suggestion-card.component.js +0 -144
  192. package/lib/_components/abstracts/abstract-recipe-card.component.d.ts +0 -49
  193. package/lib/_components/skeleton/skeleton.component.d.ts +0 -11
  194. package/lib/_components/tabs/tab-body.component.d.ts +0 -8
  195. package/lib/_components/tabs/tab-item.component.d.ts +0 -11
  196. package/lib/_components/tabs/tab-label.component.d.ts +0 -8
  197. package/lib/_models/groceries-entry.d.ts +0 -20
  198. package/lib/_models/groceries-list.d.ts +0 -30
  199. package/lib/_services/counter.service.d.ts +0 -10
  200. package/lib/_services/groceries-entries.service.d.ts +0 -10
  201. package/lib/_services/groceries-lists.service.d.ts +0 -68
  202. package/lib/_services/recipe-events.service.d.ts +0 -23
  203. package/lib/_types/skeleton.enum.d.ts +0 -5
  204. package/lib/_web-components/drawer/drawer.component.d.ts +0 -37
  205. package/lib/_web-components/pos-card/pos-card.component.d.ts +0 -24
  206. package/lib/_web-components/pos-selection/pos-selection.component.d.ts +0 -38
  207. package/lib/_web-components/recipe-cards/catalog-recipe-card/catalog-recipe-card.component.d.ts +0 -49
  208. package/lib/_web-components/recipe-cards/suggestion-card/suggestion-card.component.d.ts +0 -42
@@ -23,16 +23,25 @@ export interface MiamInterface {
23
23
  */
24
24
  basketIsReady$: Observable<boolean>;
25
25
  /**
26
- * Fetch the first GroceriesList & Basket early (before any action requires it on Miam's
26
+ * Fetch the first Basket early (before any action requires it on Miam's
27
27
  * side), so you can start the basket-sync earlier
28
28
  */
29
29
  initialize: () => void;
30
+ /**
31
+ * Resets Miam's basket : empties all products & recipes added by the user
32
+ * /!\ We heavily recommend not to use this method except in the console for testing purposes /!\
33
+ */
34
+ reset: () => void;
30
35
  /**
31
36
  * If you have different price tables (or pricebooks) for the same point of sale, you can call this
32
37
  * method to make Miam know on which pricebook you are using
33
38
  * For example, prices can be different depending on if the user chose home delivery or drive-in
34
39
  */
35
- updatePricebook: (pricebookName: string) => void;
40
+ updatePricebook: (pricebookName: string) => Observable<void>;
41
+ /**
42
+ * @returns A BehaviorSubject that emits the current number of recipes in Miam's Basket
43
+ */
44
+ recipeCount: () => Observable<number>;
36
45
  };
37
46
  basketSync: {
38
47
  /**
@@ -57,7 +66,7 @@ export interface MiamInterface {
57
66
  retailerBasketChanged: (comparableProducts: ComparableProduct[]) => void;
58
67
  /**
59
68
  * Call to notify Miam that the user's cart was paid
60
- * Miam then refreshes the groceries-list and basket for the next user's cart
69
+ * Miam then refreshes the basket for the next user's cart
61
70
  *
62
71
  * @param total The total price of the cart paid
63
72
  */
@@ -103,17 +112,6 @@ export interface MiamInterface {
103
112
  */
104
113
  setHookCallback: (callback: (isLogged: any, isPosValid: any) => boolean) => void;
105
114
  };
106
- list: {
107
- /**
108
- * Resets Miam's GroceriesList & empties all products & recipes added by the user
109
- * /!\ We heavily recommend not to use this method outside of the web console for testing purposes /!\
110
- */
111
- reset: () => void;
112
- /**
113
- * @returns A BehaviorSubject that emits the current number of recipes in Miam's GroceriesList
114
- */
115
- recipeCount: () => Observable<number>;
116
- };
117
115
  pos: {
118
116
  /**
119
117
  * Call to inform Miam of the point of sale the user is currently on. Do not forget to call the method
@@ -128,10 +126,6 @@ export interface MiamInterface {
128
126
  * An observable that emits a value when the recipe-modal is closed
129
127
  */
130
128
  hidden: Observable<boolean>;
131
- /**
132
- * If called with a parameter to true, recipe-details will show a picture next to the ingredients
133
- */
134
- shouldDisplayIngredientPicturesOnRecipeCards: (should: boolean) => void;
135
129
  /**
136
130
  * Call with an url of a picture to change the default picture displayed if an ingredient doesn't have a picture
137
131
  * and if ingredients picture have been enabled with recipes.shouldDisplayIngredientPicturesOnRecipeCards(true)
@@ -151,6 +145,10 @@ export interface MiamInterface {
151
145
  * If called, adding a recipe to Miam's basket will display a confirmation toaster
152
146
  */
153
147
  showConfirmationToaster: () => void;
148
+ /**
149
+ * @param should if set to true, the recipe-cards will display the ingredients of their recipe
150
+ */
151
+ shouldDisplayIngredientPicturesOnRecipeCards: (should: boolean) => void;
154
152
  };
155
153
  router: {
156
154
  /**
@@ -208,13 +206,6 @@ export interface MiamInterface {
208
206
  */
209
207
  setFavoriteItems: (favoriteProductIds: string[]) => Observable<object>;
210
208
  };
211
- view: {
212
- /**
213
- * Call to notify Miam of the scrollable element of the client's page, if it is not <body>
214
- * This is necessary to prevent the page to scroll in the backgroud when Miam opens a popup/modal/drawer
215
- */
216
- setGlobalScrollableElement: (element: HTMLElement) => void;
217
- };
218
209
  /**
219
210
  * Override two times will not be considered (DEPRECATED)
220
211
  * @param icon have to be a knowed icon name see section 'Custom icons' in read me
@@ -0,0 +1,22 @@
1
+ export declare class CustomProperties {
2
+ recipe_id?: string | number;
3
+ category_id?: string | number;
4
+ entry_name?: string;
5
+ basket_id?: string | number;
6
+ miam_amount?: string | number;
7
+ total_amount?: string | number;
8
+ pos_id?: string;
9
+ pos_name?: string;
10
+ search_term?: string;
11
+ abTestKey?: string;
12
+ budget_user?: string | number;
13
+ budget_planner?: string | number;
14
+ recipes_count?: string | number;
15
+ guests?: string | number;
16
+ uses_count?: string | number;
17
+ time_passed?: string | number;
18
+ }
19
+ export declare class EventTrace {
20
+ originPath: string;
21
+ props: CustomProperties;
22
+ }
@@ -13,11 +13,6 @@ export declare class ItemsComparator {
13
13
  */
14
14
  updatePreviousQuantity(): void;
15
15
  clearRetailerProduct(): void;
16
- /**
17
- * Sets all of miam's quantities to 0 to make as if the products were added on retailer's side
18
- * Is useful only in very specific situations, usage not recommanded
19
- */
20
- setAsRetailerProduct(): void;
21
16
  /**
22
17
  * retailerProducts is a array for some retailer (like retailer)
23
18
  * so to have the moset standart code we turn it into an array
@@ -11,8 +11,6 @@ export interface IAdditionnalFilters {
11
11
  price?: string;
12
12
  in_basket?: boolean;
13
13
  primary_completion_perc?: string;
14
- guests?: string;
15
- point_of_sale_id?: string;
16
14
  }
17
15
  interface IRecipeFilters {
18
16
  difficulty?: RecipeFilter[];
@@ -2,6 +2,6 @@ import { MessageType } from './message-type.enum';
2
2
  export declare class Toaster {
3
3
  type: MessageType;
4
4
  title: string;
5
- recipeAdded: boolean;
6
5
  customMessage?: string;
6
+ displayIcon: boolean;
7
7
  }
@@ -1 +1,2 @@
1
1
  export * from './auto-width-input.directive';
2
+ export * from './reach-top.directive';
@@ -0,0 +1,13 @@
1
+ import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class ReachTopDirective implements AfterViewInit, OnDestroy {
4
+ private elementRef;
5
+ private cdr;
6
+ reachedTop: EventEmitter<boolean>;
7
+ observer: IntersectionObserver;
8
+ constructor(elementRef: ElementRef, cdr: ChangeDetectorRef);
9
+ ngAfterViewInit(): void;
10
+ ngOnDestroy(): void;
11
+ static ɵfac: i0.ɵɵFactoryDef<ReachTopDirective, never>;
12
+ static ɵdir: i0.ɵɵDirectiveDefWithMeta<ReachTopDirective, "[ngMiamReachTop]", never, {}, { "reachedTop": "reachedTop"; }, never>;
13
+ }
@@ -2,7 +2,7 @@ import { PipeTransform } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class ReadableFloatNumberPipe implements PipeTransform {
4
4
  constructor();
5
- transform(value: string, unit?: string): string;
5
+ transform(value: string | number, unit?: string): string;
6
6
  /**
7
7
  * Algo Faray to find aproximative fraction
8
8
  * @param value
@@ -5,8 +5,8 @@ import * as i3 from "./pipes/safePipe/safe.pipe";
5
5
  import * as i4 from "./pipes/capitalize-first-letter/capitalize-first-letter.pipe";
6
6
  import * as i5 from "./directives/auto-width-input.directive";
7
7
  import * as i6 from "./pipes/extended-date/extended-date.pipe";
8
+ import * as i7 from "./directives/reach-top.directive";
8
9
  export declare class UtilsModule {
9
- constructor();
10
- static ɵmod: i0.ɵɵNgModuleDefWithMeta<UtilsModule, [typeof i1.ReadableFloatNumberPipe, typeof i2.EllipsisPipe, typeof i3.SafePipe, typeof i4.CapitalizeFirstLetterPipe, typeof i5.AutowidthInputDirective, typeof i6.ExtendedDatePipe], never, [typeof i1.ReadableFloatNumberPipe, typeof i2.EllipsisPipe, typeof i3.SafePipe, typeof i4.CapitalizeFirstLetterPipe, typeof i5.AutowidthInputDirective, typeof i6.ExtendedDatePipe]>;
10
+ static ɵmod: i0.ɵɵNgModuleDefWithMeta<UtilsModule, [typeof i1.ReadableFloatNumberPipe, typeof i2.EllipsisPipe, typeof i3.SafePipe, typeof i4.CapitalizeFirstLetterPipe, typeof i5.AutowidthInputDirective, typeof i6.ExtendedDatePipe, typeof i7.ReachTopDirective], never, [typeof i1.ReadableFloatNumberPipe, typeof i2.EllipsisPipe, typeof i3.SafePipe, typeof i4.CapitalizeFirstLetterPipe, typeof i5.AutowidthInputDirective, typeof i6.ExtendedDatePipe, typeof i7.ReachTopDirective]>;
11
11
  static ɵinj: i0.ɵɵInjectorDef<UtilsModule>;
12
12
  }
@@ -1,19 +1,20 @@
1
1
  import { OnInit, OnDestroy, ChangeDetectorRef, EventEmitter, OnChanges, SimpleChanges, AfterViewInit, QueryList } from '@angular/core';
2
- import { BehaviorSubject } from 'rxjs';
3
- import { GroceriesListsService } from '../../../_services/groceries-lists.service';
4
- import { BasketsService, BasketStats } from '../../../_services/baskets.service';
2
+ import { BehaviorSubject, Observable } from 'rxjs';
3
+ import { BasketsService } from '../../../_services/baskets.service';
5
4
  import { BasketPreviewLine } from '../../../_models/basket-preview-line';
6
5
  import { BasketPreviewLineComponent } from '../basket-preview-line/basket-preview-line.component';
7
6
  import { PointOfSalesService } from '../../../_services/point-of-sales.service';
8
7
  import { ContextService } from '../../../_services/context.service';
9
8
  import { Icon } from '../../../_types/icon.enum';
10
9
  import { MediaMatcher } from '@angular/cdk/layout';
11
- import { AnalyticsService, CustomProperties } from '../../../_services/analytics.service';
10
+ import { AnalyticsService } from '../../../_services/analytics.service';
12
11
  import { EventTracerComponent } from '../../../_components/abstracts/event-tracer.component';
12
+ import { Basket } from '../../../_models';
13
+ import { BasketStats } from '../../../_types/basket-stats';
14
+ import { CustomProperties } from '../../../_types/event-trace';
13
15
  import * as i0 from "@angular/core";
14
16
  export declare class BasketPreviewBlockComponent extends EventTracerComponent implements OnInit, OnDestroy, OnChanges, AfterViewInit {
15
17
  private cdr;
16
- listsService: GroceriesListsService;
17
18
  posService: PointOfSalesService;
18
19
  private contextService;
19
20
  basketsService: BasketsService;
@@ -30,7 +31,6 @@ export declare class BasketPreviewBlockComponent extends EventTracerComponent im
30
31
  loading: BehaviorSubject<boolean>;
31
32
  lineComponents: BasketPreviewLineComponent[];
32
33
  basketPreviewRecipeRows: QueryList<BasketPreviewLineComponent>;
33
- showLines: boolean;
34
34
  lines: BasketPreviewLine[];
35
35
  corsIssues: boolean;
36
36
  icon: typeof Icon;
@@ -42,13 +42,14 @@ export declare class BasketPreviewBlockComponent extends EventTracerComponent im
42
42
  }>;
43
43
  private subscriptions;
44
44
  private linesHashes;
45
- constructor(cdr: ChangeDetectorRef, listsService: GroceriesListsService, posService: PointOfSalesService, contextService: ContextService, basketsService: BasketsService, mediaMatcher: MediaMatcher, analyticsService: AnalyticsService);
45
+ constructor(cdr: ChangeDetectorRef, posService: PointOfSalesService, contextService: ContextService, basketsService: BasketsService, mediaMatcher: MediaMatcher, analyticsService: AnalyticsService);
46
46
  ngOnInit(): void;
47
47
  ngOnChanges(changes: SimpleChanges): void;
48
48
  ngAfterViewInit(): void;
49
49
  ngOnDestroy(): void;
50
50
  currentPath(): string;
51
- toggleLines(): void;
51
+ loadPreviewWhenBasketIsReady(): void;
52
+ loadPreview(basket: Basket): Observable<BasketPreviewLine[]>;
52
53
  removeRecipe(line: BasketPreviewLine): void;
53
54
  updateRecipe(line: BasketPreviewLine): void;
54
55
  closeOverlay(): void;
@@ -1,17 +1,14 @@
1
- import { EventEmitter, OnDestroy, ChangeDetectorRef, OnInit, ElementRef } from '@angular/core';
2
- import { BasketPreviewLine } from '../../../_models/basket-preview-line';
1
+ import { ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
+ import { BasketEntry, BasketPreviewLine } from '../../../_models';
3
3
  import { BehaviorSubject } from 'rxjs';
4
- import { BasketEntry } from '../../../_models/basket-entry';
5
- import { GroceriesListsService } from '../../../_services/groceries-lists.service';
6
- import { BasketsService, ContextService, PointOfSalesService, RecipesService, UserService, SuppliersService } from '../../../_services';
7
- import { AnalyticsService, CustomProperties } from '../../../_services/analytics.service';
4
+ import { AnalyticsService, BasketsService, ContextService, PointOfSalesService, RecipesService, SuppliersService, UserService } from '../../../_services';
8
5
  import { Icon } from '../../../_types/icon.enum';
9
6
  import { EventTracerComponent } from '../../../_components/abstracts/event-tracer.component';
7
+ import { CustomProperties } from '../../../_types/event-trace';
10
8
  import * as i0 from "@angular/core";
11
9
  export declare class BasketPreviewLineComponent extends EventTracerComponent implements OnInit, OnDestroy {
12
10
  cdr: ChangeDetectorRef;
13
11
  recipesService: RecipesService;
14
- private listsService;
15
12
  private basketsService;
16
13
  protected analyticsService: AnalyticsService;
17
14
  protected posService: PointOfSalesService;
@@ -42,6 +39,8 @@ export declare class BasketPreviewLineComponent extends EventTracerComponent imp
42
39
  expanded: boolean;
43
40
  loading: boolean;
44
41
  disableItemSelector: boolean;
42
+ disableCounter: boolean;
43
+ disableRemove: boolean;
45
44
  selectItem: boolean;
46
45
  icon: typeof Icon;
47
46
  removing: boolean;
@@ -50,7 +49,7 @@ export declare class BasketPreviewLineComponent extends EventTracerComponent imp
50
49
  };
51
50
  currency: import("rxjs").Observable<string>;
52
51
  private subscriptions;
53
- constructor(cdr: ChangeDetectorRef, recipesService: RecipesService, listsService: GroceriesListsService, basketsService: BasketsService, analyticsService: AnalyticsService, posService: PointOfSalesService, userService: UserService, contextService: ContextService, elementRef: ElementRef<HTMLElement>, supplierService: SuppliersService);
52
+ constructor(cdr: ChangeDetectorRef, recipesService: RecipesService, basketsService: BasketsService, analyticsService: AnalyticsService, posService: PointOfSalesService, userService: UserService, contextService: ContextService, elementRef: ElementRef<HTMLElement>, supplierService: SuppliersService);
54
53
  ngOnInit(): void;
55
54
  ngOnDestroy(): void;
56
55
  currentPath(): string;
@@ -60,7 +59,7 @@ export declare class BasketPreviewLineComponent extends EventTracerComponent imp
60
59
  toggleExpanded(event: any): void;
61
60
  deleteEntry(entry: BasketEntry): void;
62
61
  changeProduct(line: BasketPreviewLine): void;
63
- productChosen(line?: BasketPreviewLine): void;
62
+ productChosen(basketEntryId?: string): void;
64
63
  buildEntriesLines(): void;
65
64
  addEntry(entry: BasketEntry): void;
66
65
  trackByItemId(index: number, line: BasketPreviewLine): string;
@@ -69,6 +68,9 @@ export declare class BasketPreviewLineComponent extends EventTracerComponent imp
69
68
  removeLine(event: any): void;
70
69
  priceIntegerPart(): string;
71
70
  priceDecimalPart(): string;
71
+ private initRemoveLoading;
72
+ private initRecipeIsBeingModifiedCheck;
73
+ private initBasketIsBeingUpdated;
72
74
  private priceToDisplay;
73
75
  private initSponsorisedEntries;
74
76
  static ɵfac: i0.ɵɵFactoryDef<BasketPreviewLineComponent, never>;
@@ -1,36 +1,43 @@
1
- import { OnInit, EventEmitter, ChangeDetectorRef } from '@angular/core';
2
- import { BasketPreviewLine } from '../../../_models/basket-preview-line';
3
- import { Item } from '../../../_models/item';
4
- import { Icon } from '../../../_types/icon.enum';
5
- import { BasketsService, SuppliersService } from '../../../_services';
6
- import { AnalyticsService, CustomProperties } from '../../../_services/analytics.service';
1
+ import { ChangeDetectorRef, EventEmitter, OnChanges, OnDestroy, OnInit } from '@angular/core';
2
+ import { Subscription } from 'rxjs';
7
3
  import { EventTracerComponent } from '../../../_components/abstracts/event-tracer.component';
4
+ import { BasketEntry, Ingredient, Item, Recipe } from '../../../_models';
5
+ import { AnalyticsService, BasketsService, SuppliersService, ItemsService } from '../../../_services';
6
+ import { CustomProperties } from '../../../_types/event-trace';
7
+ import { Icon } from '../../../_types/icon.enum';
8
8
  import * as i0 from "@angular/core";
9
- export declare class ReplaceItemComponent extends EventTracerComponent implements OnInit {
9
+ export declare class ReplaceItemComponent extends EventTracerComponent implements OnInit, OnChanges, OnDestroy {
10
10
  private cdr;
11
11
  private basketsService;
12
12
  protected analyticsService: AnalyticsService;
13
13
  private supplierService;
14
- line: BasketPreviewLine;
14
+ private itemsService;
15
+ basketEntry: BasketEntry;
16
+ recipe: Recipe;
17
+ ignoreSelected: boolean;
18
+ ingredient: Ingredient;
15
19
  selected: EventEmitter<string>;
16
- items: Array<Item>;
17
- currentItem: any;
20
+ searchStringChanged: EventEmitter<string>;
21
+ state: string;
18
22
  icon: typeof Icon;
23
+ searchString: string;
24
+ private searchSubject;
25
+ itemsList: Item[];
19
26
  currency: import("rxjs").Observable<string>;
20
- constructor(cdr: ChangeDetectorRef, basketsService: BasketsService, analyticsService: AnalyticsService, supplierService: SuppliersService);
27
+ protected subscriptions: Subscription[];
28
+ constructor(cdr: ChangeDetectorRef, basketsService: BasketsService, analyticsService: AnalyticsService, supplierService: SuppliersService, itemsService: ItemsService);
21
29
  ngOnInit(): void;
30
+ ngOnDestroy(): void;
31
+ ngOnChanges(): void;
22
32
  onClose(): void;
23
33
  currentPath(): string;
24
34
  protected currentProps(): CustomProperties;
35
+ fetchItems(): void;
36
+ setupSearchObservable(): void;
37
+ onSearchKeydown(event: KeyboardEvent): void;
38
+ onSearchInputChange(): void;
25
39
  onSelectItem(item: Item): void;
26
- private initLine;
27
- priceIntegerPart(price: string): string;
28
- /**
29
- * @param price item?.attributes["unit-price"] is a string
30
- * and we wan two decimal (not 0.8 or 0.800)
31
- * @returns first two decimal
32
- */
33
- priceDecimalPart(price: string): string;
40
+ addToBasket(): void;
34
41
  static ɵfac: i0.ɵɵFactoryDef<ReplaceItemComponent, never>;
35
- static ɵcmp: i0.ɵɵComponentDefWithMeta<ReplaceItemComponent, "ng-miam-replace-item", never, { "line": "line"; }, { "selected": "selected"; }, never, never>;
42
+ static ɵcmp: i0.ɵɵComponentDefWithMeta<ReplaceItemComponent, "ng-miam-replace-item", never, { "basketEntry": "basketEntry"; "recipe": "recipe"; "ignoreSelected": "ignoreSelected"; "ingredient": "ingredient"; }, { "selected": "selected"; "searchStringChanged": "searchStringChanged"; }, never, never>;
36
43
  }
@@ -1,12 +1,9 @@
1
1
  export * from './basket-preview';
2
- export * from './drawer/drawer.component';
3
2
  export * from './list-scan';
4
3
  export * from './meals-planner';
5
4
  export * from './planner/planner.component';
6
5
  export * from './planner-calendar/planner-calendar.component';
7
6
  export * from './planner-side-menu/planner-side-menu.component';
8
- export * from './pos-card/pos-card.component';
9
- export * from './pos-selection/pos-selection.component';
10
7
  export * from './recipe-catalog/recipe-catalog.component';
11
8
  export * from './recipe-cards';
12
9
  export * from './recipe-catalog';
@@ -1,7 +1,6 @@
1
1
  import { ChangeDetectorRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
2
  import { EventTracerComponent } from '../../../_components/abstracts/event-tracer.component';
3
3
  import { BasketEntry, BasketPreviewLine } from '../../../_models';
4
- import { GroceriesEntry } from '../../../_models/groceries-entry';
5
4
  import { BasketsService } from '../../../_services';
6
5
  import { AnalyticsService } from '../../../_services/analytics.service';
7
6
  import { Icon } from '../../../_types/icon.enum';
@@ -10,7 +9,7 @@ export declare class ListScanBasketPreviewComponent extends EventTracerComponent
10
9
  private cdr;
11
10
  private basketsService;
12
11
  protected analyticsService: AnalyticsService;
13
- entries: GroceriesEntry[];
12
+ entries: BasketEntry[];
14
13
  title: string;
15
14
  replaceItemTitle: string;
16
15
  closed: EventEmitter<any>;
@@ -1,22 +1,23 @@
1
1
  import { MediaMatcher } from '@angular/cdk/layout';
2
2
  import { ChangeDetectorRef, EventEmitter } from '@angular/core';
3
- import { GroceriesEntry } from '../../../_models/groceries-entry';
4
- import { GroceriesListsService } from '../../../_services';
3
+ import { BasketEntry } from '../../../_models';
4
+ import { BasketEntriesService, BasketsService } from '../../../_services';
5
5
  import { Icon } from '../../../_types/icon.enum';
6
6
  import * as i0 from "@angular/core";
7
7
  export declare class ListScanFilesInputsComponent {
8
8
  private cdr;
9
9
  private mediaMatcher;
10
- private listsService;
10
+ private basketsService;
11
+ private basketEntriesService;
11
12
  overlay: boolean;
12
13
  disableIngredientsMatching: boolean;
13
14
  desktopText: string;
14
15
  mobileText: string;
15
- entriesAdded: EventEmitter<GroceriesEntry[]>;
16
+ entriesAdded: EventEmitter<BasketEntry[]>;
16
17
  icon: typeof Icon;
17
18
  loading: boolean;
18
19
  isMobile: boolean;
19
- constructor(cdr: ChangeDetectorRef, mediaMatcher: MediaMatcher, listsService: GroceriesListsService);
20
+ constructor(cdr: ChangeDetectorRef, mediaMatcher: MediaMatcher, basketsService: BasketsService, basketEntriesService: BasketEntriesService);
20
21
  sendFile(event: any): void;
21
22
  static ɵfac: i0.ɵɵFactoryDef<ListScanFilesInputsComponent, never>;
22
23
  static ɵcmp: i0.ɵɵComponentDefWithMeta<ListScanFilesInputsComponent, "ng-miam-list-scan-files-inputs", never, { "overlay": "overlay"; "disableIngredientsMatching": "disableIngredientsMatching"; "desktopText": "desktopText"; "mobileText": "mobileText"; }, { "entriesAdded": "entriesAdded"; }, never, never>;
@@ -1,12 +1,12 @@
1
1
  import { ChangeDetectorRef, EventEmitter, OnDestroy } from '@angular/core';
2
- import { GroceriesEntry } from '../../../_models/groceries-entry';
2
+ import { BasketEntry } from '../../../_models';
3
3
  import { BasketsService } from '../../../_services/baskets.service';
4
4
  import { Icon } from '../../../_types/icon.enum';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class ListScanIngredientsListComponent implements OnDestroy {
7
7
  private cdr;
8
8
  private basketsService;
9
- entries: GroceriesEntry[];
9
+ entries: BasketEntry[];
10
10
  title: string;
11
11
  closed: EventEmitter<any>;
12
12
  cancelled: EventEmitter<any>;
@@ -15,7 +15,7 @@ export declare class ListScanIngredientsListComponent implements OnDestroy {
15
15
  private subscriptions;
16
16
  constructor(cdr: ChangeDetectorRef, basketsService: BasketsService);
17
17
  ngOnDestroy(): void;
18
- deleteEntry(e: GroceriesEntry): void;
18
+ deleteEntry(e: BasketEntry): void;
19
19
  cancel(): void;
20
20
  confirm(): void;
21
21
  static ɵfac: i0.ɵɵFactoryDef<ListScanIngredientsListComponent, never>;
@@ -1,5 +1,5 @@
1
1
  import { ChangeDetectorRef, EventEmitter, OnDestroy } from '@angular/core';
2
- import { GroceriesEntry } from '../../_models/groceries-entry';
2
+ import { BasketEntry } from '../../_models';
3
3
  import { BasketsService } from '../../_services';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class ListScanComponent implements OnDestroy {
@@ -14,7 +14,7 @@ export declare class ListScanComponent implements OnDestroy {
14
14
  ctaMobileText: string;
15
15
  scanResultsTitle: string;
16
16
  confirmed: EventEmitter<void>;
17
- entries: GroceriesEntry[];
17
+ entries: BasketEntry[];
18
18
  ingredientsShown: boolean;
19
19
  basketPreviewShown: boolean;
20
20
  cancelConfirmationShown: boolean;
@@ -22,7 +22,7 @@ export declare class ListScanComponent implements OnDestroy {
22
22
  private subscriptions;
23
23
  constructor(cdr: ChangeDetectorRef, basketsService: BasketsService);
24
24
  ngOnDestroy(): void;
25
- showIngredients(newEntries: GroceriesEntry[]): void;
25
+ showIngredients(newEntries: BasketEntry[]): void;
26
26
  hideIngredients(): void;
27
27
  returnToIngredients(): void;
28
28
  showBasketPreview(): void;
@@ -1,19 +1,21 @@
1
1
  import { ChangeDetectorRef, EventEmitter } from '@angular/core';
2
- import { GroceriesEntry } from '../../../_models/groceries-entry';
3
- import { GroceriesListsService } from '../../../_services';
2
+ import { BasketEntry } from '../../../_models';
3
+ import { BasketEntriesService, BasketsService } from '../../../_services';
4
4
  import { Icon } from '../../../_types/icon.enum';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class ListScanOverlayButtonComponent {
7
7
  private cdr;
8
- private listsService;
8
+ private basketsService;
9
+ private basketEntriesService;
9
10
  overlay: boolean;
10
- entriesAdded: EventEmitter<GroceriesEntry[]>;
11
+ disableIngredientsMatching: boolean;
12
+ entriesAdded: EventEmitter<BasketEntry[]>;
11
13
  icon: typeof Icon;
12
14
  reduced: string;
13
15
  loading: boolean;
14
- constructor(cdr: ChangeDetectorRef, listsService: GroceriesListsService);
16
+ constructor(cdr: ChangeDetectorRef, basketsService: BasketsService, basketEntriesService: BasketEntriesService);
15
17
  toggleReduce(value: any): void;
16
18
  sendFile(event: any): void;
17
19
  static ɵfac: i0.ɵɵFactoryDef<ListScanOverlayButtonComponent, never>;
18
- static ɵcmp: i0.ɵɵComponentDefWithMeta<ListScanOverlayButtonComponent, "ng-miam-list-scan-overlay-button", never, { "overlay": "overlay"; }, { "entriesAdded": "entriesAdded"; }, never, never>;
20
+ static ɵcmp: i0.ɵɵComponentDefWithMeta<ListScanOverlayButtonComponent, "ng-miam-list-scan-overlay-button", never, { "overlay": "overlay"; "disableIngredientsMatching": "disableIngredientsMatching"; }, { "entriesAdded": "entriesAdded"; }, never, never>;
19
21
  }
@@ -4,7 +4,7 @@ import { AnalyticsService } from "../../_services/analytics.service";
4
4
  import { ContextService } from "../../_services/context.service";
5
5
  import { Recipe } from "../../_models";
6
6
  import { Icon } from "../../_types/icon.enum";
7
- import { BasketsService, GroceriesListsService, PointOfSalesService, RecipesService } from "../../_services";
7
+ import { BasketsService, PointOfSalesService, RecipesService } from "../../_services";
8
8
  import { FormBuilder, FormGroup } from "@angular/forms";
9
9
  import * as i0 from "@angular/core";
10
10
  export declare class MealsPlannerComponent extends EventTracerComponent implements OnDestroy, OnInit, OnChanges {
@@ -12,7 +12,6 @@ export declare class MealsPlannerComponent extends EventTracerComponent implemen
12
12
  cdr: ChangeDetectorRef;
13
13
  protected analyticsService: AnalyticsService;
14
14
  contextService: ContextService;
15
- groceriesListsService: GroceriesListsService;
16
15
  recipesService: RecipesService;
17
16
  private basketsService;
18
17
  private posService;
@@ -36,7 +35,7 @@ export declare class MealsPlannerComponent extends EventTracerComponent implemen
36
35
  private pos;
37
36
  private pricebookKey;
38
37
  private subscriptions;
39
- constructor(fb: FormBuilder, cdr: ChangeDetectorRef, analyticsService: AnalyticsService, contextService: ContextService, groceriesListsService: GroceriesListsService, recipesService: RecipesService, basketsService: BasketsService, posService: PointOfSalesService);
38
+ constructor(fb: FormBuilder, cdr: ChangeDetectorRef, analyticsService: AnalyticsService, contextService: ContextService, recipesService: RecipesService, basketsService: BasketsService, posService: PointOfSalesService);
40
39
  ngOnInit(): void;
41
40
  ngOnChanges(): void;
42
41
  initForm(): void;
@@ -1,6 +1,4 @@
1
1
  export * from './recipe-cards.module';
2
2
  export * from './add-recipe-card/add-recipe-card.component';
3
- export * from './catalog-recipe-card/catalog-recipe-card.component';
4
3
  export * from './recipe-card/recipe-card.component';
5
- export * from './suggestion-card/suggestion-card.component';
6
4
  export * from './recipe-card-cta/recipe-card-cta.component';
@@ -1,7 +1,10 @@
1
- import { ChangeDetectorRef, OnChanges, EventEmitter, ElementRef } from '@angular/core';
2
- import { AbstractRecipeCardComponent } from '../../../_components/abstracts/abstract-recipe-card.component';
3
- import { Recipe } from '../../../_models';
4
- import { AnalyticsService, ContextService, GroceriesListsService, RecipeEventsService, RecipesService, UserService } from '../../../_services';
1
+ import { ChangeDetectorRef, OnChanges, EventEmitter, ElementRef, SimpleChanges, AfterViewInit, OnDestroy, OnInit } from '@angular/core';
2
+ import { Subscription } from 'rxjs';
3
+ import { EventTracerComponent } from '../../../_components/abstracts/event-tracer.component';
4
+ import { Recipe, SimplifiedIngredient } from '../../../_models';
5
+ import { AnalyticsService, BasketsService, ContextService, RecipesService, ScrollingService, UserService } from '../../../_services';
6
+ import { CustomProperties } from '../../../_types/event-trace';
7
+ import { Icon } from '../../../_types/icon.enum';
5
8
  import * as i0 from "@angular/core";
6
9
  /**
7
10
  * This is an angular component design to be a web component
@@ -12,33 +15,71 @@ import * as i0 from "@angular/core";
12
15
  * and alsow style of the parent aplication that will use it
13
16
  * doc -> https://angular.io/api/core/ViewEncapsulation
14
17
  */
15
- export declare class RecipeCardComponent extends AbstractRecipeCardComponent implements OnChanges {
18
+ export declare class RecipeCardComponent extends EventTracerComponent implements OnInit, OnChanges, AfterViewInit, OnDestroy {
16
19
  cdr: ChangeDetectorRef;
17
20
  recipeService: RecipesService;
18
- recipeEventsService: RecipeEventsService;
19
- groceriesListsService: GroceriesListsService;
21
+ basketsService: BasketsService;
20
22
  userService: UserService;
21
23
  contextService: ContextService;
22
24
  protected analyticsService: AnalyticsService;
23
25
  element: ElementRef<HTMLElement>;
26
+ private scrollService;
24
27
  recipeId: string;
25
28
  recipe: Recipe;
29
+ randomModeEnable: boolean;
30
+ productIds: {
31
+ id: string;
32
+ hasHighWeight?: boolean;
33
+ }[];
26
34
  previewAllowed: boolean;
27
35
  helpButtonAllowed: boolean;
36
+ displayPricing: boolean;
37
+ displayGuests: boolean;
38
+ addRecipeMode: boolean;
39
+ replaceMode: boolean;
28
40
  removedFromFavorite: EventEmitter<any>;
29
41
  displayed: EventEmitter<any>;
30
- guestsChanged: EventEmitter<number>;
42
+ actionTriggered: EventEmitter<string>;
43
+ removeFromMealsPlanner: EventEmitter<null>;
44
+ addToMealsPlanner: EventEmitter<Recipe>;
45
+ openCatalog: EventEmitter<null>;
46
+ hide: EventEmitter<void>;
47
+ icon: typeof Icon;
48
+ addButtonLoading: boolean;
49
+ actionsOpened: boolean;
31
50
  isloaded: boolean;
32
- cardType: string;
51
+ protected analyticsEventSent: boolean;
52
+ protected subscriptions: Subscription[];
53
+ protected sendShowEventsOnScroll: boolean;
54
+ private observer;
33
55
  primaryButtonClicked$: EventEmitter<boolean>;
34
- constructor(cdr: ChangeDetectorRef, recipeService: RecipesService, recipeEventsService: RecipeEventsService, groceriesListsService: GroceriesListsService, userService: UserService, contextService: ContextService, analyticsService: AnalyticsService, element: ElementRef<HTMLElement>);
35
- ngOnChanges(): void;
36
- recipeWasLoaded(): void;
37
- removeFromFavorite(): void;
56
+ constructor(cdr: ChangeDetectorRef, recipeService: RecipesService, basketsService: BasketsService, userService: UserService, contextService: ContextService, analyticsService: AnalyticsService, element: ElementRef<HTMLElement>, scrollService: ScrollingService);
57
+ ngOnInit(): void;
58
+ currentPath(): string;
59
+ protected currentProps(): CustomProperties;
60
+ ngOnChanges(simpleChanges: SimpleChanges): void;
61
+ ngAfterViewInit(): void;
62
+ ngOnDestroy(): void;
38
63
  openRecipe(): void;
39
- updateGuests(count: number): void;
40
- _updateBasket(): void;
41
- private loadRecipe;
64
+ ingredientPicture(ingredient: SimplifiedIngredient): string;
65
+ toggleMoreActions(event: Event): void;
66
+ closeMoreActions(): void;
67
+ private isInViewport;
68
+ private sendShowEvent;
69
+ /**
70
+ * Fetch a recipe from its id.
71
+ * Hide the card if none is returned (could be because it does not exists or it is not shared with the supplier)
72
+ */
73
+ private loadRecipeFromId;
74
+ /**
75
+ * Get a suggestion based on context (either productIds or randomMode). Hide the card if none is returned
76
+ */
77
+ private loadRecipeFromContext;
78
+ private fetchSuggestionOrRandom;
79
+ /**
80
+ * Update guests from the value in the basket if the recipe is in the basket
81
+ */
82
+ private updateGuestsIfNecessary;
42
83
  static ɵfac: i0.ɵɵFactoryDef<RecipeCardComponent, never>;
43
- static ɵcmp: i0.ɵɵComponentDefWithMeta<RecipeCardComponent, "ng-miam-recipe-card", never, { "recipeId": "recipeId"; "recipe": "recipe"; "previewAllowed": "previewAllowed"; "helpButtonAllowed": "helpButtonAllowed"; }, { "removedFromFavorite": "removedFromFavorite"; "displayed": "displayed"; "guestsChanged": "guestsChanged"; }, never, never>;
84
+ static ɵcmp: i0.ɵɵComponentDefWithMeta<RecipeCardComponent, "ng-miam-recipe-card", never, { "recipeId": "recipeId"; "recipe": "recipe"; "randomModeEnable": "randomModeEnable"; "productIds": "productIds"; "previewAllowed": "previewAllowed"; "helpButtonAllowed": "helpButtonAllowed"; "displayPricing": "displayPricing"; "displayGuests": "displayGuests"; "addRecipeMode": "addRecipeMode"; "replaceMode": "replaceMode"; }, { "removedFromFavorite": "removedFromFavorite"; "displayed": "displayed"; "actionTriggered": "actionTriggered"; "removeFromMealsPlanner": "removeFromMealsPlanner"; "addToMealsPlanner": "addToMealsPlanner"; "openCatalog": "openCatalog"; "hide": "hide"; }, never, never>;
44
85
  }