ng-miam 4.1.2 → 4.2.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.
- package/bundles/ng-miam.umd.js +324 -97
- package/bundles/ng-miam.umd.js.map +1 -1
- package/bundles/ng-miam.umd.min.js +1 -1
- package/bundles/ng-miam.umd.min.js.map +1 -1
- package/esm2015/lib/_components/abstracts/abstract-recipe-card.component.js +4 -3
- package/esm2015/lib/_services/context.service.js +12 -2
- package/esm2015/lib/_services/groceries-lists.service.js +25 -3
- package/esm2015/lib/_services/recipes.service.js +3 -3
- package/esm2015/lib/_utils/synchro-basket/basket-handler.js +4 -1
- package/esm2015/lib/_utils/synchro-basket/basket-handling/baskets-comparator.js +4 -1
- package/esm2015/lib/_utils/synchro-basket/basket-handling/comparison-map.js +7 -1
- package/esm2015/lib/_web-components/basket-preview/basket-preview-block/basket-preview-block.component.js +14 -5
- package/esm2015/lib/_web-components/catalog-category/catalog-category.component.js +1 -1
- package/esm2015/lib/_web-components/catalog-header/catalog-header.component.js +20 -20
- package/esm2015/lib/_web-components/list-scan/files-inputs/files-inputs.component.js +2 -2
- package/esm2015/lib/_web-components/modal/modal.component.js +57 -16
- package/esm2015/lib/_web-components/modal/modal.module.js +6 -2
- package/esm2015/lib/_web-components/recipe-details/recipe-details.component.js +2 -2
- package/esm2015/lib/_web-components/recipe-modal/recipe-modal.component.js +51 -18
- package/esm2015/lib/_web-components/recipe-tags/recipe-tags.component.js +108 -36
- package/fesm2015/ng-miam.js +299 -98
- package/fesm2015/ng-miam.js.map +1 -1
- package/lib/_services/context.service.d.ts +3 -0
- package/lib/_services/groceries-lists.service.d.ts +11 -0
- package/lib/_services/recipes.service.d.ts +3 -1
- package/lib/_utils/synchro-basket/basket-handler.d.ts +1 -0
- package/lib/_utils/synchro-basket/basket-handling/baskets-comparator.d.ts +1 -0
- package/lib/_utils/synchro-basket/basket-handling/comparison-map.d.ts +1 -0
- package/lib/_web-components/basket-preview/basket-preview-block/basket-preview-block.component.d.ts +3 -2
- package/lib/_web-components/modal/modal.component.d.ts +5 -1
- package/lib/_web-components/modal/modal.module.d.ts +2 -1
- package/lib/_web-components/recipe-modal/recipe-modal.component.d.ts +14 -4
- package/lib/_web-components/recipe-tags/recipe-tags.component.d.ts +5 -1
- package/package.json +1 -1
package/fesm2015/ng-miam.js
CHANGED
|
@@ -296,10 +296,32 @@ class GroceriesListsService extends Service {
|
|
|
296
296
|
}));
|
|
297
297
|
}));
|
|
298
298
|
}
|
|
299
|
+
/**
|
|
300
|
+
* Will create a temporary list and set it in _list$. The list won't be marked as current and thus
|
|
301
|
+
* will not be reused
|
|
302
|
+
*/
|
|
303
|
+
createTemporaryList() {
|
|
304
|
+
this.listIsFetching = true;
|
|
305
|
+
this.new().save({ include: ['groceries-entries'] }).subscribe((temporaryList) => {
|
|
306
|
+
this._list$.next(this.afterSave(temporaryList));
|
|
307
|
+
this.listIsFetching = false;
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* save() returns an object that isn't a resource so methods aren't attached, so we have to do a little trick
|
|
312
|
+
* @param res result of the save
|
|
313
|
+
* @returns correct GroceriesList with the right attributes & methods
|
|
314
|
+
*/
|
|
315
|
+
afterSave(res) {
|
|
316
|
+
const list = this.new();
|
|
317
|
+
list.fill(res);
|
|
318
|
+
return list;
|
|
319
|
+
}
|
|
299
320
|
saveList(list, openBasket = false) {
|
|
300
321
|
delete (list.attributes['recipes-ids']);
|
|
301
|
-
|
|
302
|
-
|
|
322
|
+
delete (list.relationships['groceries-entries']);
|
|
323
|
+
return list.save({ include: ['groceries-entries'] }).pipe(skipWhile((l) => l.is_loading), tap(l => {
|
|
324
|
+
this._list$.next(this.afterSave(l));
|
|
303
325
|
if (this.saveOperationType === 'ADD') {
|
|
304
326
|
this.recipeWasAdded$.next(list.recipeInfos);
|
|
305
327
|
}
|
|
@@ -2333,12 +2355,12 @@ class RecipesService extends Service {
|
|
|
2333
2355
|
this.displayObject(recipe, { previewAllowed, guests, previewMode });
|
|
2334
2356
|
});
|
|
2335
2357
|
}
|
|
2336
|
-
displayObject(recipe, { previewAllowed = true, guests = null, previewMode = false }) {
|
|
2358
|
+
displayObject(recipe, { previewAllowed = true, guests = null, previewMode = false, wasAdded = false }) {
|
|
2337
2359
|
if (!recipe) {
|
|
2338
2360
|
return;
|
|
2339
2361
|
}
|
|
2340
2362
|
recipe.modifiedGuests = guests || +recipe.guests;
|
|
2341
|
-
this.displayedRecipe$.next({ previewAllowed, recipe, previewMode });
|
|
2363
|
+
this.displayedRecipe$.next({ previewAllowed, recipe, previewMode, wasAdded });
|
|
2342
2364
|
if (!previewMode) {
|
|
2343
2365
|
this.recipeEventsService.sendEvent(recipe, this.recipeEventsService.ACTION_DISPLAYED);
|
|
2344
2366
|
}
|
|
@@ -2832,6 +2854,12 @@ class ComparisonMap {
|
|
|
2832
2854
|
this.addEntryInMapFromRetailer(retailerBasket);
|
|
2833
2855
|
this._setFromMiam(miamBasket);
|
|
2834
2856
|
}
|
|
2857
|
+
setAllProductsAsRetailers() {
|
|
2858
|
+
Object.keys(this._extIdToComparisonItem).forEach((extId) => {
|
|
2859
|
+
this._extIdToComparisonItem[extId].miamQuantity = 0;
|
|
2860
|
+
this._extIdToComparisonItem[extId].miamTargetQuantity = 0;
|
|
2861
|
+
});
|
|
2862
|
+
}
|
|
2835
2863
|
/**
|
|
2836
2864
|
*
|
|
2837
2865
|
* @param extId
|
|
@@ -3064,6 +3092,9 @@ class BasketsComparator {
|
|
|
3064
3092
|
const toRemoveFromMiam = this._comparisonMap.resolveFromRetailer();
|
|
3065
3093
|
this.sendUpdateToMiam(toRemoveFromMiam);
|
|
3066
3094
|
}
|
|
3095
|
+
setAllProductsAsRetailers() {
|
|
3096
|
+
this._comparisonMap.setAllProductsAsRetailers();
|
|
3097
|
+
}
|
|
3067
3098
|
/**
|
|
3068
3099
|
*
|
|
3069
3100
|
* @param {*} basket
|
|
@@ -3125,6 +3156,9 @@ class BasketHandler {
|
|
|
3125
3156
|
constructor(wrapper) {
|
|
3126
3157
|
this.basketWrapper = wrapper;
|
|
3127
3158
|
}
|
|
3159
|
+
setAllProductsAsRetailers() {
|
|
3160
|
+
this.comparator.setAllProductsAsRetailers();
|
|
3161
|
+
}
|
|
3128
3162
|
/**
|
|
3129
3163
|
* Handle payment first if necessary then start basket synchronization
|
|
3130
3164
|
*/
|
|
@@ -3326,8 +3360,16 @@ class ContextService {
|
|
|
3326
3360
|
},
|
|
3327
3361
|
removeEntries: (entries) => this.basketsService.removeBasketEntries(entries),
|
|
3328
3362
|
initBasketSynchro: () => {
|
|
3363
|
+
// We need to initialise the basket and list or the basketSync might not work
|
|
3364
|
+
this.basketsService.initBasket();
|
|
3329
3365
|
this.basketHandler = new BasketHandler(this.basketWrapper);
|
|
3330
3366
|
this.basketHandler.initBasketProcess();
|
|
3367
|
+
},
|
|
3368
|
+
// Modify the comparion-map to make it as is all products were added by the retailer. Useful to reset the list without emptying the retailer's basket
|
|
3369
|
+
setAllProductsAsRetailers: () => {
|
|
3370
|
+
if (this.basketHandler) {
|
|
3371
|
+
this.basketHandler.setAllProductsAsRetailers();
|
|
3372
|
+
}
|
|
3331
3373
|
}
|
|
3332
3374
|
},
|
|
3333
3375
|
basketMapper: {
|
|
@@ -3368,7 +3410,9 @@ class ContextService {
|
|
|
3368
3410
|
list: {
|
|
3369
3411
|
reset: () => this.listsService.resetList().subscribe(),
|
|
3370
3412
|
addRecipe: (recipeId, guests) => this.listsService.appendRecipeToList(recipeId, guests, 'client'),
|
|
3371
|
-
hasRecipe: (recipeId) => this.listsService.recipeIsInList(recipeId)
|
|
3413
|
+
hasRecipe: (recipeId) => this.listsService.recipeIsInList(recipeId),
|
|
3414
|
+
createTemporaryList: () => this.listsService.createTemporaryList(),
|
|
3415
|
+
refresh: () => this.listsService.refreshCurrentList()
|
|
3372
3416
|
},
|
|
3373
3417
|
pos: {
|
|
3374
3418
|
load: (posId) => {
|
|
@@ -8451,15 +8495,19 @@ function BasketPreviewBlockComponent_div_0_ng_container_2_div_3_Template(rf, ctx
|
|
|
8451
8495
|
ɵɵelementStart(0, "div", 24);
|
|
8452
8496
|
ɵɵelement(1, "ng-miam-loader");
|
|
8453
8497
|
ɵɵelementStart(2, "div");
|
|
8454
|
-
ɵɵtext(3
|
|
8498
|
+
ɵɵtext(3);
|
|
8455
8499
|
ɵɵelementEnd();
|
|
8456
8500
|
ɵɵelementEnd();
|
|
8501
|
+
} if (rf & 2) {
|
|
8502
|
+
const ctx_r9 = ɵɵnextContext(3);
|
|
8503
|
+
ɵɵadvance(3);
|
|
8504
|
+
ɵɵtextInterpolate1(" ", ctx_r9.recipeId ? "Chargement du repas..." : "Chargement des repas...", " ");
|
|
8457
8505
|
} }
|
|
8458
8506
|
function BasketPreviewBlockComponent_div_0_ng_container_2_Template(rf, ctx) { if (rf & 1) {
|
|
8459
8507
|
ɵɵelementContainerStart(0);
|
|
8460
8508
|
ɵɵtemplate(1, BasketPreviewBlockComponent_div_0_ng_container_2_h3_1_Template, 5, 5, "h3", 6);
|
|
8461
8509
|
ɵɵtemplate(2, BasketPreviewBlockComponent_div_0_ng_container_2_div_2_Template, 5, 5, "div", 7);
|
|
8462
|
-
ɵɵtemplate(3, BasketPreviewBlockComponent_div_0_ng_container_2_div_3_Template, 4,
|
|
8510
|
+
ɵɵtemplate(3, BasketPreviewBlockComponent_div_0_ng_container_2_div_3_Template, 4, 1, "div", 8);
|
|
8463
8511
|
ɵɵpipe(4, "async");
|
|
8464
8512
|
ɵɵelementContainerEnd();
|
|
8465
8513
|
} if (rf & 2) {
|
|
@@ -8536,6 +8584,11 @@ class BasketPreviewBlockComponent {
|
|
|
8536
8584
|
this.basketsService.basketStats$.pipe(tap(stats => this.statsUpdated.emit(stats))).subscribe()
|
|
8537
8585
|
];
|
|
8538
8586
|
}
|
|
8587
|
+
ngOnChanges(changes) {
|
|
8588
|
+
if (Object.keys(changes).includes('recipeId')) {
|
|
8589
|
+
this.loading.next(true);
|
|
8590
|
+
}
|
|
8591
|
+
}
|
|
8539
8592
|
ngOnDestroy() {
|
|
8540
8593
|
this.subscriptions.forEach((sub) => sub.unsubscribe());
|
|
8541
8594
|
}
|
|
@@ -8613,14 +8666,14 @@ BasketPreviewBlockComponent.ɵcmp = ɵɵdefineComponent({ type: BasketPreviewBlo
|
|
|
8613
8666
|
} if (rf & 2) {
|
|
8614
8667
|
var _t;
|
|
8615
8668
|
ɵɵqueryRefresh(_t = ɵɵloadQuery()) && (ctx.lineComponents = _t);
|
|
8616
|
-
} }, inputs: { recipeId: "recipeId", showNotice: "showNotice", recipesAlwaysExpanded: "recipesAlwaysExpanded", itemsAlwaysExpanded: "itemsAlwaysExpanded", displayItemsUnitaryPrice: "displayItemsUnitaryPrice" }, outputs: { statsUpdated: "statsUpdated", guestCountChanged: "guestCountChanged", loading: "loading" }, decls: 5, vars: 2, consts: [["class", "miam-basket-preview-block", 4, "ngIf", "ngIfElse"], ["cors", ""], ["noPos", ""], [1, "miam-basket-preview-block"], ["previewBlockTop", ""], [4, "ngIf", "ngIfElse"], ["class", "miam-basket-preview-block__header", 4, "ngIf"], ["class", "miam-basket-preview-block__lines", 4, "ngIf"], ["class", "miam-basket-preview-block__lines__loader", 4, "ngIf"], [1, "miam-basket-preview-block__header"], [1, "miam-basket-preview-block__header__actions"], ["class", "m-button-secondary miam-basket-preview-block__header__empty-basket", 3, "click", 4, "ngIf"], [1, "miam-basket-preview-block__header__chevron", 3, "ngClass", "click"], ["height", "32", "width", "32", 3, "iconName"], [1, "m-button-secondary", "miam-basket-preview-block__header__empty-basket", 3, "click"], ["primaryColor", "var(--m-color-secondary)", 3, "iconName"], [1, "miam-basket-preview-block__lines"], [3, "line", "blockStates", "uniqueLine", "recipesAlwaysExpanded", "itemsAlwaysExpanded", "displayItemsUnitaryPrice", "ngStyle", "removed", "countChanged", "replaceItem", 4, "ngFor", "ngForOf"], [3, "line", "selected", 4, "ngIf"], ["class", "miam-basket-preview-block__lines__not-found", 4, "ngIf"], [3, "line", "blockStates", "uniqueLine", "recipesAlwaysExpanded", "itemsAlwaysExpanded", "displayItemsUnitaryPrice", "ngStyle", "removed", "countChanged", "replaceItem"], [3, "line", "selected"], [1, "miam-basket-preview-block__lines__not-found"], [4, "ngIf"], [1, "miam-basket-preview-block__lines__loader"], [1, "miam-basket-preview-block__noPos"]], template: function BasketPreviewBlockComponent_Template(rf, ctx) { if (rf & 1) {
|
|
8669
|
+
} }, inputs: { recipeId: "recipeId", showNotice: "showNotice", recipesAlwaysExpanded: "recipesAlwaysExpanded", itemsAlwaysExpanded: "itemsAlwaysExpanded", displayItemsUnitaryPrice: "displayItemsUnitaryPrice" }, outputs: { statsUpdated: "statsUpdated", guestCountChanged: "guestCountChanged", loading: "loading" }, features: [ɵɵNgOnChangesFeature], decls: 5, vars: 2, consts: [["class", "miam-basket-preview-block", 4, "ngIf", "ngIfElse"], ["cors", ""], ["noPos", ""], [1, "miam-basket-preview-block"], ["previewBlockTop", ""], [4, "ngIf", "ngIfElse"], ["class", "miam-basket-preview-block__header", 4, "ngIf"], ["class", "miam-basket-preview-block__lines", 4, "ngIf"], ["class", "miam-basket-preview-block__lines__loader", 4, "ngIf"], [1, "miam-basket-preview-block__header"], [1, "miam-basket-preview-block__header__actions"], ["class", "m-button-secondary miam-basket-preview-block__header__empty-basket", 3, "click", 4, "ngIf"], [1, "miam-basket-preview-block__header__chevron", 3, "ngClass", "click"], ["height", "32", "width", "32", 3, "iconName"], [1, "m-button-secondary", "miam-basket-preview-block__header__empty-basket", 3, "click"], ["primaryColor", "var(--m-color-secondary)", 3, "iconName"], [1, "miam-basket-preview-block__lines"], [3, "line", "blockStates", "uniqueLine", "recipesAlwaysExpanded", "itemsAlwaysExpanded", "displayItemsUnitaryPrice", "ngStyle", "removed", "countChanged", "replaceItem", 4, "ngFor", "ngForOf"], [3, "line", "selected", 4, "ngIf"], ["class", "miam-basket-preview-block__lines__not-found", 4, "ngIf"], [3, "line", "blockStates", "uniqueLine", "recipesAlwaysExpanded", "itemsAlwaysExpanded", "displayItemsUnitaryPrice", "ngStyle", "removed", "countChanged", "replaceItem"], [3, "line", "selected"], [1, "miam-basket-preview-block__lines__not-found"], [4, "ngIf"], [1, "miam-basket-preview-block__lines__loader"], [1, "miam-basket-preview-block__noPos"]], template: function BasketPreviewBlockComponent_Template(rf, ctx) { if (rf & 1) {
|
|
8617
8670
|
ɵɵtemplate(0, BasketPreviewBlockComponent_div_0_Template, 4, 4, "div", 0);
|
|
8618
8671
|
ɵɵtemplate(1, BasketPreviewBlockComponent_ng_template_1_Template, 1, 0, "ng-template", null, 1, ɵɵtemplateRefExtractor);
|
|
8619
8672
|
ɵɵtemplate(3, BasketPreviewBlockComponent_ng_template_3_Template, 6, 0, "ng-template", null, 2, ɵɵtemplateRefExtractor);
|
|
8620
8673
|
} if (rf & 2) {
|
|
8621
8674
|
const _r1 = ɵɵreference(2);
|
|
8622
8675
|
ɵɵproperty("ngIf", !ctx.corsIssues)("ngIfElse", _r1);
|
|
8623
|
-
} }, directives: [NgIf, NgClass, IconComponent, NgForOf, BasketPreviewLineComponent, NgStyle, ReplaceItemComponent, LoaderComponent, CORSOverlayComponent], pipes: [AsyncPipe], styles: [":host ::-webkit-scrollbar{cursor:-webkit-grab;height:7px;width:5px}:host ::-webkit-scrollbar-track{background:var(--m-color-grey)}:host ::-webkit-scrollbar-thumb{background:var(--m-color-primary);border-radius:5px}.miam-basket-preview-block{position:relative}.miam-basket-preview-block .miam-basket-preview-block__recipe__link{-webkit-tap-highlight-color:transparent;color:var(--m-color-grey-text);cursor:pointer;position:absolute;right:300px;text-decoration:underline;top:60px;transition:var(--m-default-transition)}@media (min-width:1022px){.miam-basket-preview-block .miam-basket-preview-block__recipe__link:hover{color:var(--m-color-primary)}}.miam-basket-preview-block .miam-basket-preview-block__header{display:flex;justify-content:space-between;margin-bottom:0;padding-bottom:10px}.miam-basket-preview-block .miam-basket-preview-block__header .miam-basket-preview-block__header__actions{align-items:center;display:flex}.miam-basket-preview-block .miam-basket-preview-block__header .miam-basket-preview-block__header__actions .miam-basket-preview-block__header__empty-basket{margin-right:20px}.miam-basket-preview-block .miam-basket-preview-block__header .miam-basket-preview-block__header__actions .miam-basket-preview-block__header__empty-basket .fa-trash-alt{margin-right:8px;margin-top:-1px;width:13px}.miam-basket-preview-block .miam-basket-preview-block__header .miam-basket-preview-block__header__actions .miam-basket-preview-block__header__chevron{cursor:pointer;transition-duration:.5s}.miam-basket-preview-block .miam-basket-preview-block__header .miam-basket-preview-block__header__actions .miam-basket-preview-block__header__chevron svg{width:18px}.miam-basket-preview-block .miam-basket-preview-block__header .miam-basket-preview-block__header__actions .miam-basket-preview-block__chevron__down{transform:rotate(-180deg)}.miam-basket-preview-block .miam-basket-preview-block__lines{transition:height .3s}.miam-basket-preview-block .miam-basket-preview-block__lines .miam-basket-preview-block__lines__not-found{margin-left:20px;margin-top:15px}.miam-basket-preview-block .miam-basket-preview-block__lines .miam-basket-preview-block__lines__loader,.miam-basket-preview-block .miam-basket-preview-block__lines__loader{align-items:center;display:flex;flex-direction:column;justify-content:center}.miam-basket-preview-block .miam-basket-preview-block__lines__loader{padding:10px}.miam-basket-preview-block .miam-basket-preview-block__noPos{font-size:17px}"], encapsulation: 2, changeDetection: 0 });
|
|
8676
|
+
} }, directives: [NgIf, NgClass, IconComponent, NgForOf, BasketPreviewLineComponent, NgStyle, ReplaceItemComponent, LoaderComponent, CORSOverlayComponent], pipes: [AsyncPipe], styles: [":host ::-webkit-scrollbar{cursor:-webkit-grab;height:7px;width:5px}:host ::-webkit-scrollbar-track{background:var(--m-color-grey)}:host ::-webkit-scrollbar-thumb{background:var(--m-color-primary);border-radius:5px}.miam-basket-preview-block{height:100%;position:relative}.miam-basket-preview-block .miam-basket-preview-block__recipe__link{-webkit-tap-highlight-color:transparent;color:var(--m-color-grey-text);cursor:pointer;position:absolute;right:300px;text-decoration:underline;top:60px;transition:var(--m-default-transition)}@media (min-width:1022px){.miam-basket-preview-block .miam-basket-preview-block__recipe__link:hover{color:var(--m-color-primary)}}.miam-basket-preview-block .miam-basket-preview-block__header{display:flex;justify-content:space-between;margin-bottom:0;padding-bottom:10px}.miam-basket-preview-block .miam-basket-preview-block__header .miam-basket-preview-block__header__actions{align-items:center;display:flex}.miam-basket-preview-block .miam-basket-preview-block__header .miam-basket-preview-block__header__actions .miam-basket-preview-block__header__empty-basket{margin-right:20px}.miam-basket-preview-block .miam-basket-preview-block__header .miam-basket-preview-block__header__actions .miam-basket-preview-block__header__empty-basket .fa-trash-alt{margin-right:8px;margin-top:-1px;width:13px}.miam-basket-preview-block .miam-basket-preview-block__header .miam-basket-preview-block__header__actions .miam-basket-preview-block__header__chevron{cursor:pointer;transition-duration:.5s}.miam-basket-preview-block .miam-basket-preview-block__header .miam-basket-preview-block__header__actions .miam-basket-preview-block__header__chevron svg{width:18px}.miam-basket-preview-block .miam-basket-preview-block__header .miam-basket-preview-block__header__actions .miam-basket-preview-block__chevron__down{transform:rotate(-180deg)}.miam-basket-preview-block .miam-basket-preview-block__lines{transition:height .3s}.miam-basket-preview-block .miam-basket-preview-block__lines .miam-basket-preview-block__lines__not-found{margin-left:20px;margin-top:15px}.miam-basket-preview-block .miam-basket-preview-block__lines .miam-basket-preview-block__lines__loader,.miam-basket-preview-block .miam-basket-preview-block__lines__loader{align-items:center;display:flex;flex-direction:column;justify-content:center}.miam-basket-preview-block .miam-basket-preview-block__lines__loader{padding:10px}.miam-basket-preview-block .miam-basket-preview-block__noPos{font-size:17px}"], encapsulation: 2, changeDetection: 0 });
|
|
8624
8677
|
/*@__PURE__*/ (function () { ɵsetClassMetadata(BasketPreviewBlockComponent, [{
|
|
8625
8678
|
type: Component,
|
|
8626
8679
|
args: [{
|
|
@@ -8828,7 +8881,8 @@ class AbstractRecipeCardComponent {
|
|
|
8828
8881
|
}
|
|
8829
8882
|
addRecipeActionOK(display) {
|
|
8830
8883
|
this.subscriptions.push(this.groceriesListsService.recipeIsInList(this.recipe.id).subscribe(recipeIsInList => {
|
|
8831
|
-
|
|
8884
|
+
const recipeWasAdded = !recipeIsInList;
|
|
8885
|
+
if (recipeWasAdded) {
|
|
8832
8886
|
this.recipeEventsService.sendEvent(this.recipe, this.recipeEventsService.ACTION_ADDED);
|
|
8833
8887
|
}
|
|
8834
8888
|
this.subscriptions.push(this.groceriesListsService.appendRecipeToList(this.recipe.id, this.recipe.modifiedGuests, this.cardType)
|
|
@@ -8836,7 +8890,7 @@ class AbstractRecipeCardComponent {
|
|
|
8836
8890
|
this.toggleButtonLoader(false);
|
|
8837
8891
|
}));
|
|
8838
8892
|
if (display) {
|
|
8839
|
-
this.recipeService.displayObject(this.recipe, { guests: +this.recipe.modifiedGuests, previewMode: true });
|
|
8893
|
+
this.recipeService.displayObject(this.recipe, { guests: +this.recipe.modifiedGuests, previewMode: true, wasAdded: recipeWasAdded });
|
|
8840
8894
|
}
|
|
8841
8895
|
}));
|
|
8842
8896
|
}
|
|
@@ -10053,7 +10107,7 @@ CatalogCategoryComponent.ɵcmp = ɵɵdefineComponent({ type: CatalogCategoryComp
|
|
|
10053
10107
|
ɵɵtemplate(0, CatalogCategoryComponent_div_0_Template, 21, 13, "div", 0);
|
|
10054
10108
|
} if (rf & 2) {
|
|
10055
10109
|
ɵɵproperty("ngIf", !ctx.hide);
|
|
10056
|
-
} }, directives: [NgIf, IconComponent, NgStyle, NgForOf, LoaderComponent, CatalogRecipeCardComponent, CatalogArticleCardComponent], pipes: [AsyncPipe], styles: [".miam-catalog-category__slider{-webkit-backdrop-filter:blur(12px);align-items:center;backdrop-filter:blur(12px);background-color:rgba(32,32,32,.3);cursor:pointer;display:flex;height:calc(100% - 28px);justify-content:center;margin:12px 0 16px;position:absolute;top:0;width:48px}@media (max-width:1022px){.miam-catalog-category__slider{display:none}}.miam-catalog-category{display:flex;flex-direction:column;margin-bottom:40px}.miam-catalog-category .miam-catalog-category__header{align-items:flex-end;display:flex;flex-direction:row;margin-bottom:16px}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__left{flex:1}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__left .miam-catalog-category__title{-webkit-tap-highlight-color:transparent;color:var(--m-color-black);cursor:pointer;font-size:24px;font-weight:700;line-height:34px;margin-bottom:4px}@media (min-width:1022px){.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__left .miam-catalog-category__title:hover{text-decoration:underline}}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__left .miam-catalog-category__subtitle{color:var(--m-color-black);font-size:14px;line-height:22px}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__right{align-items:center;display:flex}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__right .miam-catalog-category__link{-webkit-tap-highlight-color:transparent;color:var(--m-color-primary);cursor:pointer;font-size:16px;line-height:24px}@media (min-width:1022px){.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__right .miam-catalog-category__link:hover{text-decoration:underline}}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__right ng-miam-icon{margin-top:3px}.miam-catalog-category .miam-catalog-category__header .icon-container{cursor:pointer;margin-bottom:3px;transform:rotate(-90deg)}.miam-catalog-category .miam-catalog-category__content{height:calc(var(--m-catalog-card-height) + var(--m-catalog-cards-spacing));margin:calc(0px - var(--m-catalog-cards-spacing)/2);overflow:hidden;padding:0;position:relative;width:calc(100% + var(--m-catalog-cards-spacing))}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__cards{display:flex;flex-direction:row;flex-wrap:wrap;transition-duration:.5s}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__cards .miam-catalog-category__loader{color:var(--m-color-grey-text);font-size:20px;font-weight:700;text-align:center;width:100%}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__cards .miam-catalog-category__loader .loader{height:80px;margin-bottom:16px;margin-left:calc(50% - 40px);margin-top:80px;width:80px}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__slider__left,.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__slider__right{display:none}@media (max-width:1095px){.miam-catalog-category .miam-catalog-category__content{overflow-x:auto}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__cards{flex-wrap:nowrap}}@media (max-width:607px){.miam-catalog-category .miam-catalog-category__header{align-items:flex-start;flex-direction:column;margin-bottom:8px}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__left{margin-bottom:4px}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__left .miam-catalog-category__title{margin-bottom:0}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__right{align-self:flex-end}}"], encapsulation: 2, changeDetection: 0 });
|
|
10110
|
+
} }, directives: [NgIf, IconComponent, NgStyle, NgForOf, LoaderComponent, CatalogRecipeCardComponent, CatalogArticleCardComponent], pipes: [AsyncPipe], styles: [".miam-catalog-category__slider{-webkit-backdrop-filter:blur(12px);align-items:center;backdrop-filter:blur(12px);background-color:rgba(32,32,32,.3);cursor:pointer;display:flex;height:calc(100% - 28px);justify-content:center;margin:12px 0 16px;position:absolute;top:0;width:48px}@media (max-width:1022px){.miam-catalog-category__slider{display:none}}.miam-catalog-category{display:flex;flex-direction:column;margin-bottom:40px}.miam-catalog-category .miam-catalog-category__header{align-items:flex-end;display:flex;flex-direction:row;margin-bottom:16px}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__left{flex:1}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__left .miam-catalog-category__title{-webkit-tap-highlight-color:transparent;color:var(--m-color-black);cursor:pointer;font-size:24px;font-weight:700;line-height:34px;margin-bottom:4px;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}@media (min-width:1022px){.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__left .miam-catalog-category__title:hover{text-decoration:underline}}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__left .miam-catalog-category__subtitle{color:var(--m-color-black);font-size:14px;line-height:22px}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__right{align-items:center;display:flex}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__right .miam-catalog-category__link{-webkit-tap-highlight-color:transparent;color:var(--m-color-primary);cursor:pointer;font-size:16px;line-height:24px}@media (min-width:1022px){.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__right .miam-catalog-category__link:hover{text-decoration:underline}}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__right ng-miam-icon{margin-top:3px}.miam-catalog-category .miam-catalog-category__header .icon-container{cursor:pointer;margin-bottom:3px;transform:rotate(-90deg)}.miam-catalog-category .miam-catalog-category__content{height:calc(var(--m-catalog-card-height) + var(--m-catalog-cards-spacing));margin:calc(0px - var(--m-catalog-cards-spacing)/2);overflow:hidden;padding:0;position:relative;width:calc(100% + var(--m-catalog-cards-spacing))}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__cards{display:flex;flex-direction:row;flex-wrap:wrap;transition-duration:.5s}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__cards .miam-catalog-category__loader{color:var(--m-color-grey-text);font-size:20px;font-weight:700;text-align:center;width:100%}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__cards .miam-catalog-category__loader .loader{height:80px;margin-bottom:16px;margin-left:calc(50% - 40px);margin-top:80px;width:80px}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__slider__left,.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__slider__right{display:none}@media (max-width:1095px){.miam-catalog-category .miam-catalog-category__content{overflow-x:auto}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__cards{flex-wrap:nowrap}}@media (max-width:607px){.miam-catalog-category .miam-catalog-category__header{align-items:flex-start;flex-direction:column;margin-bottom:8px}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__left{margin-bottom:4px}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__left .miam-catalog-category__title{margin-bottom:0}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__right{align-self:flex-end}}"], encapsulation: 2, changeDetection: 0 });
|
|
10057
10111
|
/*@__PURE__*/ (function () { ɵsetClassMetadata(CatalogCategoryComponent, [{
|
|
10058
10112
|
type: Component,
|
|
10059
10113
|
args: [{
|
|
@@ -10094,8 +10148,8 @@ function CatalogHeaderComponent_ng_miam_icon_8_Template(rf, ctx) { if (rf & 1) {
|
|
|
10094
10148
|
const ctx_r0 = ɵɵnextContext();
|
|
10095
10149
|
ɵɵproperty("iconName", ctx_r0.icon.ChevronDown);
|
|
10096
10150
|
} }
|
|
10097
|
-
function
|
|
10098
|
-
ɵɵelementStart(0, "
|
|
10151
|
+
function CatalogHeaderComponent_a_9_Template(rf, ctx) { if (rf & 1) {
|
|
10152
|
+
ɵɵelementStart(0, "a", 16);
|
|
10099
10153
|
ɵɵtext(1);
|
|
10100
10154
|
ɵɵelementEnd();
|
|
10101
10155
|
} if (rf & 2) {
|
|
@@ -10104,14 +10158,14 @@ function CatalogHeaderComponent_span_9_Template(rf, ctx) { if (rf & 1) {
|
|
|
10104
10158
|
ɵɵtextInterpolate(ctx_r1.title);
|
|
10105
10159
|
} }
|
|
10106
10160
|
function CatalogHeaderComponent_div_11_img_1_Template(rf, ctx) { if (rf & 1) {
|
|
10107
|
-
ɵɵelement(0, "img",
|
|
10161
|
+
ɵɵelement(0, "img", 19);
|
|
10108
10162
|
} if (rf & 2) {
|
|
10109
10163
|
const ctx_r6 = ɵɵnextContext(2);
|
|
10110
10164
|
ɵɵproperty("src", ctx_r6.titlePictureUrl, ɵɵsanitizeUrl);
|
|
10111
10165
|
} }
|
|
10112
10166
|
function CatalogHeaderComponent_div_11_Template(rf, ctx) { if (rf & 1) {
|
|
10113
|
-
ɵɵelementStart(0, "div",
|
|
10114
|
-
ɵɵtemplate(1, CatalogHeaderComponent_div_11_img_1_Template, 1, 1, "img",
|
|
10167
|
+
ɵɵelementStart(0, "div", 17);
|
|
10168
|
+
ɵɵtemplate(1, CatalogHeaderComponent_div_11_img_1_Template, 1, 1, "img", 18);
|
|
10115
10169
|
ɵɵelementEnd();
|
|
10116
10170
|
} if (rf & 2) {
|
|
10117
10171
|
const ctx_r2 = ɵɵnextContext();
|
|
@@ -10120,12 +10174,12 @@ function CatalogHeaderComponent_div_11_Template(rf, ctx) { if (rf & 1) {
|
|
|
10120
10174
|
} }
|
|
10121
10175
|
function CatalogHeaderComponent_div_13_Template(rf, ctx) { if (rf & 1) {
|
|
10122
10176
|
const _r8 = ɵɵgetCurrentView();
|
|
10123
|
-
ɵɵelementStart(0, "div",
|
|
10124
|
-
ɵɵelementStart(1, "input",
|
|
10177
|
+
ɵɵelementStart(0, "div", 20);
|
|
10178
|
+
ɵɵelementStart(1, "input", 21);
|
|
10125
10179
|
ɵɵlistener("ngModelChange", function CatalogHeaderComponent_div_13_Template_input_ngModelChange_1_listener($event) { ɵɵrestoreView(_r8); const ctx_r7 = ɵɵnextContext(); return ctx_r7.searchString = $event; })("keydown.enter", function CatalogHeaderComponent_div_13_Template_input_keydown_enter_1_listener() { ɵɵrestoreView(_r8); const ctx_r9 = ɵɵnextContext(); return ctx_r9.emitSearchString(); })("blur", function CatalogHeaderComponent_div_13_Template_input_blur_1_listener() { ɵɵrestoreView(_r8); const ctx_r10 = ɵɵnextContext(); return ctx_r10.emitSearchString(); });
|
|
10126
10180
|
ɵɵelementEnd();
|
|
10127
|
-
ɵɵelementStart(2, "button",
|
|
10128
|
-
ɵɵelementStart(3, "ng-miam-icon",
|
|
10181
|
+
ɵɵelementStart(2, "button", 22);
|
|
10182
|
+
ɵɵelementStart(3, "ng-miam-icon", 23);
|
|
10129
10183
|
ɵɵlistener("click", function CatalogHeaderComponent_div_13_Template_ng_miam_icon_click_3_listener() { ɵɵrestoreView(_r8); const ctx_r11 = ɵɵnextContext(); return ctx_r11.emitSearchString(); });
|
|
10130
10184
|
ɵɵelementEnd();
|
|
10131
10185
|
ɵɵelementEnd();
|
|
@@ -10143,7 +10197,7 @@ function CatalogHeaderComponent_button_15_span_2_Template(rf, ctx) { if (rf & 1)
|
|
|
10143
10197
|
ɵɵelementEnd();
|
|
10144
10198
|
} }
|
|
10145
10199
|
function CatalogHeaderComponent_button_15_div_3_Template(rf, ctx) { if (rf & 1) {
|
|
10146
|
-
ɵɵelementStart(0, "div",
|
|
10200
|
+
ɵɵelementStart(0, "div", 28);
|
|
10147
10201
|
ɵɵtext(1);
|
|
10148
10202
|
ɵɵelementEnd();
|
|
10149
10203
|
} if (rf & 2) {
|
|
@@ -10154,11 +10208,11 @@ function CatalogHeaderComponent_button_15_div_3_Template(rf, ctx) { if (rf & 1)
|
|
|
10154
10208
|
const _c0$h = function (a0, a1) { return { reverse: a0, reduced: a1 }; };
|
|
10155
10209
|
function CatalogHeaderComponent_button_15_Template(rf, ctx) { if (rf & 1) {
|
|
10156
10210
|
const _r15 = ɵɵgetCurrentView();
|
|
10157
|
-
ɵɵelementStart(0, "button",
|
|
10211
|
+
ɵɵelementStart(0, "button", 24);
|
|
10158
10212
|
ɵɵlistener("click", function CatalogHeaderComponent_button_15_Template_button_click_0_listener() { ɵɵrestoreView(_r15); const ctx_r14 = ɵɵnextContext(); return ctx_r14.filterButtonPressed.emit(); });
|
|
10159
|
-
ɵɵelement(1, "ng-miam-icon",
|
|
10160
|
-
ɵɵtemplate(2, CatalogHeaderComponent_button_15_span_2_Template, 2, 0, "span",
|
|
10161
|
-
ɵɵtemplate(3, CatalogHeaderComponent_button_15_div_3_Template, 2, 1, "div",
|
|
10213
|
+
ɵɵelement(1, "ng-miam-icon", 25);
|
|
10214
|
+
ɵɵtemplate(2, CatalogHeaderComponent_button_15_span_2_Template, 2, 0, "span", 26);
|
|
10215
|
+
ɵɵtemplate(3, CatalogHeaderComponent_button_15_div_3_Template, 2, 1, "div", 27);
|
|
10162
10216
|
ɵɵelementEnd();
|
|
10163
10217
|
} if (rf & 2) {
|
|
10164
10218
|
const ctx_r4 = ɵɵnextContext();
|
|
@@ -10178,10 +10232,10 @@ function CatalogHeaderComponent_button_16_span_2_Template(rf, ctx) { if (rf & 1)
|
|
|
10178
10232
|
const _c1$9 = function (a0, a1) { return { "m-button-primary": a0, reduced: a1 }; };
|
|
10179
10233
|
function CatalogHeaderComponent_button_16_Template(rf, ctx) { if (rf & 1) {
|
|
10180
10234
|
const _r18 = ɵɵgetCurrentView();
|
|
10181
|
-
ɵɵelementStart(0, "button",
|
|
10235
|
+
ɵɵelementStart(0, "button", 29);
|
|
10182
10236
|
ɵɵlistener("click", function CatalogHeaderComponent_button_16_Template_button_click_0_listener() { ɵɵrestoreView(_r18); const ctx_r17 = ɵɵnextContext(); return ctx_r17.favoritesButtonPressed.emit(); });
|
|
10183
|
-
ɵɵelement(1, "ng-miam-icon",
|
|
10184
|
-
ɵɵtemplate(2, CatalogHeaderComponent_button_16_span_2_Template, 2, 0, "span",
|
|
10237
|
+
ɵɵelement(1, "ng-miam-icon", 25);
|
|
10238
|
+
ɵɵtemplate(2, CatalogHeaderComponent_button_16_span_2_Template, 2, 0, "span", 26);
|
|
10185
10239
|
ɵɵelementEnd();
|
|
10186
10240
|
} if (rf & 2) {
|
|
10187
10241
|
const ctx_r5 = ɵɵnextContext();
|
|
@@ -10227,7 +10281,7 @@ class CatalogHeaderComponent {
|
|
|
10227
10281
|
}
|
|
10228
10282
|
}
|
|
10229
10283
|
CatalogHeaderComponent.ɵfac = function CatalogHeaderComponent_Factory(t) { return new (t || CatalogHeaderComponent)(ɵɵdirectiveInject(ChangeDetectorRef), ɵɵdirectiveInject(ContextService)); };
|
|
10230
|
-
CatalogHeaderComponent.ɵcmp = ɵɵdefineComponent({ type: CatalogHeaderComponent, selectors: [["ng-miam-catalog-header"]], inputs: { title: "title", homeLabel: "homeLabel", pictureUrl: "pictureUrl", titlePictureUrl: "titlePictureUrl", searchBarHidden: "searchBarHidden", filterButtonHidden: "filterButtonHidden", favoritesButtonHidden: "favoritesButtonHidden", filterBadgeCount: "filterBadgeCount" }, outputs: { returnButtonPressed: "returnButtonPressed", filterButtonPressed: "filterButtonPressed", favoritesButtonPressed: "favoritesButtonPressed", searchStringChanged: "searchStringChanged" }, features: [ɵɵNgOnChangesFeature], decls: 17, vars: 18, consts: [[1, "miam-catalog-header", 3, "ngClass"], [1, "miam-catalog-header__content"], [1, "miam-catalog-header__nav"], ["href", "/"], ["width", "18", "height", "18", 3, "iconName", "primaryColor"], ["width", "24", "height", "24", 1, "chevron-right", 3, "iconName"], ["href", "javascript:void(0)", 3, "click"], ["class", "chevron-right", "width", "24", "height", "24", 3, "iconName", 4, "ngIf"], [4, "ngIf"], [1, "miam-catalog-header__title-and-search"], ["class", "miam-catalog-header__title", 4, "ngIf"], [1, "miam-catalog-header__search-and-filters", 3, "ngClass"], ["class", "miam-catalog-header__searchbar", 4, "ngIf"], [1, "miam-catalog-header__controls"], ["class", "miam-catalog-header__controls__filter m-button-primary", 3, "ngClass", "click", 4, "ngIf"], ["class", "miam-catalog-header__controls__favorites", 3, "ngClass", "click", 4, "ngIf"], [1, "miam-catalog-header__title"], [3, "src", 4, "ngIf"], [3, "src"], [1, "miam-catalog-header__searchbar"], ["type", "text", "placeholder", "Chercher un ingr\u00E9dient ou un repas", 1, "miam-catalog-header__searchbar__input", 3, "ngModel", "ngModelChange", "keydown.enter", "blur"], [1, "miam-catalog-header__searchbar__button", "m-button-primary"], ["width", "20", "height", "20", 1, "miam-catalog-header__searchbar__icon", 3, "iconName", "click"], [1, "miam-catalog-header__controls__filter", "m-button-primary", 3, "ngClass", "click"], ["width", "18", "height", "18", 3, "iconName"], ["class", "miam-catalog-header__controls__filter-badge", 4, "ngIf"], [1, "miam-catalog-header__controls__filter-badge"], [1, "miam-catalog-header__controls__favorites", 3, "ngClass", "click"]], template: function CatalogHeaderComponent_Template(rf, ctx) { if (rf & 1) {
|
|
10284
|
+
CatalogHeaderComponent.ɵcmp = ɵɵdefineComponent({ type: CatalogHeaderComponent, selectors: [["ng-miam-catalog-header"]], inputs: { title: "title", homeLabel: "homeLabel", pictureUrl: "pictureUrl", titlePictureUrl: "titlePictureUrl", searchBarHidden: "searchBarHidden", filterButtonHidden: "filterButtonHidden", favoritesButtonHidden: "favoritesButtonHidden", filterBadgeCount: "filterBadgeCount" }, outputs: { returnButtonPressed: "returnButtonPressed", filterButtonPressed: "filterButtonPressed", favoritesButtonPressed: "favoritesButtonPressed", searchStringChanged: "searchStringChanged" }, features: [ɵɵNgOnChangesFeature], decls: 17, vars: 18, consts: [[1, "miam-catalog-header", 3, "ngClass"], [1, "miam-catalog-header__content"], [1, "miam-catalog-header__nav"], ["href", "/"], ["width", "18", "height", "18", 3, "iconName", "primaryColor"], ["width", "24", "height", "24", 1, "chevron-right", 3, "iconName"], ["href", "javascript:void(0)", 3, "click"], ["class", "chevron-right", "width", "24", "height", "24", 3, "iconName", 4, "ngIf"], ["href", "javascript:void(0)", 4, "ngIf"], [1, "miam-catalog-header__title-and-search"], ["class", "miam-catalog-header__title", 4, "ngIf"], [1, "miam-catalog-header__search-and-filters", 3, "ngClass"], ["class", "miam-catalog-header__searchbar", 4, "ngIf"], [1, "miam-catalog-header__controls"], ["class", "miam-catalog-header__controls__filter m-button-primary", 3, "ngClass", "click", 4, "ngIf"], ["class", "miam-catalog-header__controls__favorites", 3, "ngClass", "click", 4, "ngIf"], ["href", "javascript:void(0)"], [1, "miam-catalog-header__title"], [3, "src", 4, "ngIf"], [3, "src"], [1, "miam-catalog-header__searchbar"], ["type", "text", "placeholder", "Chercher un ingr\u00E9dient ou un repas", 1, "miam-catalog-header__searchbar__input", 3, "ngModel", "ngModelChange", "keydown.enter", "blur"], [1, "miam-catalog-header__searchbar__button", "m-button-primary"], ["width", "20", "height", "20", 1, "miam-catalog-header__searchbar__icon", 3, "iconName", "click"], [1, "miam-catalog-header__controls__filter", "m-button-primary", 3, "ngClass", "click"], ["width", "18", "height", "18", 3, "iconName"], [4, "ngIf"], ["class", "miam-catalog-header__controls__filter-badge", 4, "ngIf"], [1, "miam-catalog-header__controls__filter-badge"], [1, "miam-catalog-header__controls__favorites", 3, "ngClass", "click"]], template: function CatalogHeaderComponent_Template(rf, ctx) { if (rf & 1) {
|
|
10231
10285
|
ɵɵelementStart(0, "div", 0);
|
|
10232
10286
|
ɵɵelementStart(1, "div", 1);
|
|
10233
10287
|
ɵɵelementStart(2, "div", 2);
|
|
@@ -10240,7 +10294,7 @@ CatalogHeaderComponent.ɵcmp = ɵɵdefineComponent({ type: CatalogHeaderComponen
|
|
|
10240
10294
|
ɵɵtext(7);
|
|
10241
10295
|
ɵɵelementEnd();
|
|
10242
10296
|
ɵɵtemplate(8, CatalogHeaderComponent_ng_miam_icon_8_Template, 1, 1, "ng-miam-icon", 7);
|
|
10243
|
-
ɵɵtemplate(9,
|
|
10297
|
+
ɵɵtemplate(9, CatalogHeaderComponent_a_9_Template, 2, 1, "a", 8);
|
|
10244
10298
|
ɵɵelementEnd();
|
|
10245
10299
|
ɵɵelementStart(10, "div", 9);
|
|
10246
10300
|
ɵɵtemplate(11, CatalogHeaderComponent_div_11_Template, 2, 1, "div", 10);
|
|
@@ -11438,34 +11492,66 @@ function ModalComponent_ng_container_0_ng_content_8_Template(rf, ctx) { if (rf &
|
|
|
11438
11492
|
function ModalComponent_ng_container_0_ng_template_9_Template(rf, ctx) { if (rf & 1) {
|
|
11439
11493
|
ɵɵelement(0, "slot", 12);
|
|
11440
11494
|
} }
|
|
11495
|
+
function ModalComponent_ng_container_0_button_12_span_1_Template(rf, ctx) { if (rf & 1) {
|
|
11496
|
+
ɵɵelementStart(0, "span");
|
|
11497
|
+
ɵɵtext(1);
|
|
11498
|
+
ɵɵelementEnd();
|
|
11499
|
+
} if (rf & 2) {
|
|
11500
|
+
const ctx_r6 = ɵɵnextContext(3);
|
|
11501
|
+
ɵɵadvance(1);
|
|
11502
|
+
ɵɵtextInterpolate(ctx_r6.cancelButtonText);
|
|
11503
|
+
} }
|
|
11504
|
+
function ModalComponent_ng_container_0_button_12_ng_miam_loader_2_Template(rf, ctx) { if (rf & 1) {
|
|
11505
|
+
ɵɵelement(0, "ng-miam-loader");
|
|
11506
|
+
} }
|
|
11441
11507
|
function ModalComponent_ng_container_0_button_12_Template(rf, ctx) { if (rf & 1) {
|
|
11442
|
-
const
|
|
11508
|
+
const _r9 = ɵɵgetCurrentView();
|
|
11443
11509
|
ɵɵelementStart(0, "button", 13);
|
|
11444
|
-
ɵɵlistener("click", function ModalComponent_ng_container_0_button_12_Template_button_click_0_listener() { ɵɵrestoreView(
|
|
11445
|
-
|
|
11510
|
+
ɵɵlistener("click", function ModalComponent_ng_container_0_button_12_Template_button_click_0_listener() { ɵɵrestoreView(_r9); const ctx_r8 = ɵɵnextContext(2); return ctx_r8.onCancel(); });
|
|
11511
|
+
ɵɵtemplate(1, ModalComponent_ng_container_0_button_12_span_1_Template, 2, 1, "span", 0);
|
|
11512
|
+
ɵɵtemplate(2, ModalComponent_ng_container_0_button_12_ng_miam_loader_2_Template, 1, 0, "ng-miam-loader", 0);
|
|
11446
11513
|
ɵɵelementEnd();
|
|
11447
11514
|
} if (rf & 2) {
|
|
11448
11515
|
const ctx_r4 = ɵɵnextContext(2);
|
|
11516
|
+
ɵɵproperty("disabled", ctx_r4.cancelButtonDisabled);
|
|
11517
|
+
ɵɵadvance(1);
|
|
11518
|
+
ɵɵproperty("ngIf", !ctx_r4.cancelButtonIsLoading);
|
|
11449
11519
|
ɵɵadvance(1);
|
|
11450
|
-
|
|
11520
|
+
ɵɵproperty("ngIf", ctx_r4.cancelButtonIsLoading);
|
|
11521
|
+
} }
|
|
11522
|
+
function ModalComponent_ng_container_0_button_13_span_1_Template(rf, ctx) { if (rf & 1) {
|
|
11523
|
+
ɵɵelementStart(0, "span");
|
|
11524
|
+
ɵɵtext(1);
|
|
11525
|
+
ɵɵelementEnd();
|
|
11526
|
+
} if (rf & 2) {
|
|
11527
|
+
const ctx_r10 = ɵɵnextContext(3);
|
|
11528
|
+
ɵɵadvance(1);
|
|
11529
|
+
ɵɵtextInterpolate(ctx_r10.confirmButtonText);
|
|
11530
|
+
} }
|
|
11531
|
+
function ModalComponent_ng_container_0_button_13_ng_miam_loader_2_Template(rf, ctx) { if (rf & 1) {
|
|
11532
|
+
ɵɵelement(0, "ng-miam-loader");
|
|
11451
11533
|
} }
|
|
11452
11534
|
function ModalComponent_ng_container_0_button_13_Template(rf, ctx) { if (rf & 1) {
|
|
11453
|
-
const
|
|
11535
|
+
const _r13 = ɵɵgetCurrentView();
|
|
11454
11536
|
ɵɵelementStart(0, "button", 14);
|
|
11455
|
-
ɵɵlistener("click", function ModalComponent_ng_container_0_button_13_Template_button_click_0_listener() { ɵɵrestoreView(
|
|
11456
|
-
|
|
11537
|
+
ɵɵlistener("click", function ModalComponent_ng_container_0_button_13_Template_button_click_0_listener() { ɵɵrestoreView(_r13); const ctx_r12 = ɵɵnextContext(2); return ctx_r12.onConfirm(); });
|
|
11538
|
+
ɵɵtemplate(1, ModalComponent_ng_container_0_button_13_span_1_Template, 2, 1, "span", 0);
|
|
11539
|
+
ɵɵtemplate(2, ModalComponent_ng_container_0_button_13_ng_miam_loader_2_Template, 1, 0, "ng-miam-loader", 0);
|
|
11457
11540
|
ɵɵelementEnd();
|
|
11458
11541
|
} if (rf & 2) {
|
|
11459
11542
|
const ctx_r5 = ɵɵnextContext(2);
|
|
11543
|
+
ɵɵproperty("disabled", ctx_r5.confirmButtonDisabled);
|
|
11544
|
+
ɵɵadvance(1);
|
|
11545
|
+
ɵɵproperty("ngIf", !ctx_r5.confirmButtonIsLoading);
|
|
11460
11546
|
ɵɵadvance(1);
|
|
11461
|
-
|
|
11547
|
+
ɵɵproperty("ngIf", ctx_r5.confirmButtonIsLoading);
|
|
11462
11548
|
} }
|
|
11463
11549
|
const _c0$l = function (a0, a1) { return { "with-header": a0, "without-header": a1 }; };
|
|
11464
11550
|
function ModalComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
|
|
11465
|
-
const
|
|
11551
|
+
const _r15 = ɵɵgetCurrentView();
|
|
11466
11552
|
ɵɵelementContainerStart(0);
|
|
11467
11553
|
ɵɵelementStart(1, "div", 1);
|
|
11468
|
-
ɵɵlistener("click", function ModalComponent_ng_container_0_Template_div_click_1_listener() { ɵɵrestoreView(
|
|
11554
|
+
ɵɵlistener("click", function ModalComponent_ng_container_0_Template_div_click_1_listener() { ɵɵrestoreView(_r15); const ctx_r14 = ɵɵnextContext(); return ctx_r14.onClose(); });
|
|
11469
11555
|
ɵɵelementEnd();
|
|
11470
11556
|
ɵɵelementStart(2, "div", 2);
|
|
11471
11557
|
ɵɵelementStart(3, "div", 3);
|
|
@@ -11474,14 +11560,14 @@ function ModalComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
11474
11560
|
ɵɵtext(6);
|
|
11475
11561
|
ɵɵelementEnd();
|
|
11476
11562
|
ɵɵelementStart(7, "ng-miam-icon", 6);
|
|
11477
|
-
ɵɵlistener("click", function ModalComponent_ng_container_0_Template_ng_miam_icon_click_7_listener() { ɵɵrestoreView(
|
|
11563
|
+
ɵɵlistener("click", function ModalComponent_ng_container_0_Template_ng_miam_icon_click_7_listener() { ɵɵrestoreView(_r15); const ctx_r16 = ɵɵnextContext(); return ctx_r16.onClose(); });
|
|
11478
11564
|
ɵɵelementEnd();
|
|
11479
11565
|
ɵɵelementEnd();
|
|
11480
11566
|
ɵɵtemplate(8, ModalComponent_ng_container_0_ng_content_8_Template, 1, 0, "ng-content", 7);
|
|
11481
11567
|
ɵɵtemplate(9, ModalComponent_ng_container_0_ng_template_9_Template, 1, 0, "ng-template", null, 8, ɵɵtemplateRefExtractor);
|
|
11482
11568
|
ɵɵelementStart(11, "div", 9);
|
|
11483
|
-
ɵɵtemplate(12, ModalComponent_ng_container_0_button_12_Template,
|
|
11484
|
-
ɵɵtemplate(13, ModalComponent_ng_container_0_button_13_Template,
|
|
11569
|
+
ɵɵtemplate(12, ModalComponent_ng_container_0_button_12_Template, 3, 3, "button", 10);
|
|
11570
|
+
ɵɵtemplate(13, ModalComponent_ng_container_0_button_13_Template, 3, 3, "button", 11);
|
|
11485
11571
|
ɵɵelementEnd();
|
|
11486
11572
|
ɵɵelementEnd();
|
|
11487
11573
|
ɵɵelementEnd();
|
|
@@ -11591,12 +11677,12 @@ class ModalComponent {
|
|
|
11591
11677
|
}
|
|
11592
11678
|
}
|
|
11593
11679
|
ModalComponent.ɵfac = function ModalComponent_Factory(t) { return new (t || ModalComponent)(ɵɵdirectiveInject(ChangeDetectorRef), ɵɵdirectiveInject(MediaMatcher), ɵɵdirectiveInject(ContextService)); };
|
|
11594
|
-
ModalComponent.ɵcmp = ɵɵdefineComponent({ type: ModalComponent, selectors: [["ng-miam-modal"]], inputs: { title: "title", expanded: "expanded", confirmButtonText: "confirmButtonText", cancelButtonText: "cancelButtonText", isAngularComponent: "isAngularComponent", noHeaderMode: "noHeaderMode", containerElement: "containerElement" }, outputs: { expandedChange: "expandedChange", close: "close", cancel: "cancel", confirm: "confirm" }, features: [ɵɵNgOnChangesFeature], ngContentSelectors: _c1$c, decls: 1, vars: 1, consts: [[4, "ngIf"], [1, "miam-shadow-overlay", 3, "click"], [1, "miam-modal", 3, "ngClass"], [1, "miam-modal__container"], [1, "miam-modal__header"], [1, "miam-modal__title"], ["primaryColor", "var(--m-color-grey-text-dark)", 1, "miam-modal__close__icon", 3, "width", "height", "iconName", "click"], [4, "ngIf", "ngIfElse"], ["isWebC", ""], [1, "miam-modal__actions"], ["class", "m-button-secondary", 3, "click", 4, "ngIf"], ["class", "m-button-primary", 3, "click", 4, "ngIf"], ["name", "modal-content"], [1, "m-button-secondary", 3, "click"], [1, "m-button-primary", 3, "click"]], template: function ModalComponent_Template(rf, ctx) { if (rf & 1) {
|
|
11680
|
+
ModalComponent.ɵcmp = ɵɵdefineComponent({ type: ModalComponent, selectors: [["ng-miam-modal"]], inputs: { title: "title", expanded: "expanded", confirmButtonText: "confirmButtonText", cancelButtonText: "cancelButtonText", isAngularComponent: "isAngularComponent", confirmButtonIsLoading: "confirmButtonIsLoading", cancelButtonIsLoading: "cancelButtonIsLoading", confirmButtonDisabled: "confirmButtonDisabled", cancelButtonDisabled: "cancelButtonDisabled", noHeaderMode: "noHeaderMode", containerElement: "containerElement" }, outputs: { expandedChange: "expandedChange", close: "close", cancel: "cancel", confirm: "confirm" }, features: [ɵɵNgOnChangesFeature], ngContentSelectors: _c1$c, decls: 1, vars: 1, consts: [[4, "ngIf"], [1, "miam-shadow-overlay", 3, "click"], [1, "miam-modal", 3, "ngClass"], [1, "miam-modal__container"], [1, "miam-modal__header"], [1, "miam-modal__title"], ["primaryColor", "var(--m-color-grey-text-dark)", 1, "miam-modal__close__icon", 3, "width", "height", "iconName", "click"], [4, "ngIf", "ngIfElse"], ["isWebC", ""], [1, "miam-modal__actions"], ["class", "m-button-secondary", 3, "disabled", "click", 4, "ngIf"], ["class", "m-button-primary", 3, "disabled", "click", 4, "ngIf"], ["name", "modal-content"], [1, "m-button-secondary", 3, "disabled", "click"], [1, "m-button-primary", 3, "disabled", "click"]], template: function ModalComponent_Template(rf, ctx) { if (rf & 1) {
|
|
11595
11681
|
ɵɵprojectionDef();
|
|
11596
11682
|
ɵɵtemplate(0, ModalComponent_ng_container_0_Template, 14, 12, "ng-container", 0);
|
|
11597
11683
|
} if (rf & 2) {
|
|
11598
11684
|
ɵɵproperty("ngIf", ctx.expanded);
|
|
11599
|
-
} }, directives: [NgIf, NgClass, IconComponent], styles: [".miam-shadow-overlay{-webkit-animation-duration:.3s;-webkit-animation-name:show;-webkit-animation-timing-function:ease-in-out;-webkit-tap-highlight-color:transparent;animation-duration:.3s;animation-name:show;animation-timing-function:ease-in-out;background:var(--m-color-black);height:100vh;left:0;opacity:.6;position:fixed;top:0;width:100vw;z-index:var(--m-z-index-modal-overlay)}.miam-modal{-webkit-animation-duration:.5s;-webkit-animation-name:open;-webkit-animation-timing-function:cubic-bezier(.75,0,.2,1);animation-duration:.5s;animation-name:open;animation-timing-function:cubic-bezier(.75,0,.2,1);background-color:var(--m-color-white);height:100%;max-width:1200px;overflow-x:hidden;overflow-y:auto;position:fixed;right:0;top:0;width:80%;z-index:var(--m-z-index-modal)}@media print{.miam-modal{height:unset!important;overflow-y:unset!important;position:unset!important}}@-webkit-keyframes open{0%{right:-1200px}to{right:0}}@keyframes open{0%{right:-1200px}to{right:0}}.miam-modal.with-header .miam-modal__header{background-color:var(--m-color-grey);color:var(--m-color-grey-text-dark);display:flex;flex-direction:row;justify-content:space-between}.miam-modal.with-header .miam-modal__title{color:var(--m-color-grey-text-dark);font-size:var(--m-font-size-large);font-weight:700;overflow:hidden;padding:20px;text-overflow:ellipsis}.miam-modal.with-header .miam-modal__close__icon{-webkit-tap-highlight-color:transparent;height:40px}.miam-modal.without-header .miam-modal__close__icon{border-radius:var(--m-border-radius-circle);display:flex;height:60px;justify-items:center;position:absolute;right:0;top:0;z-index:var(--m-z-index-position-absolute-high)}.miam-modal .miam-modal__container{display:flex;flex-direction:column;height:100%;position:relative}.miam-modal .miam-modal__container .miam-modal__close__icon{cursor:pointer;margin:10px}@media print{.miam-modal .miam-modal__container .miam-modal__close__icon{display:none}}.miam-modal .miam-modal__container .miam-modal__actions{align-items:center;display:flex;justify-content:space-evenly;margin:20px}@-webkit-keyframes show{0%{opacity:0}to{opacity:.6}}@keyframes show{0%{opacity:0}to{opacity:.6}}@media (max-width:1022px){.miam-modal{-webkit-animation-duration:.5s;-webkit-animation-name:openBottomSheet;-webkit-animation-timing-function:cubic-bezier(.075,.82,.165,1);animation-duration:.5s;animation-name:openBottomSheet;animation-timing-function:cubic-bezier(.075,.82,.165,1);background-color:var(--m-color-white);bottom:0;left:0;max-width:100vw;overflow-x:hidden;overflow-y:hidden;position:fixed;right:0;top:100vh;top:unset;width:100vw;z-index:var(--m-z-index-modal)}.miam-modal.with-header .miam-modal__header{align-items:center;background-color:unset}.miam-modal.with-header .miam-modal__title{padding:0 0 0 16px}.miam-modal.with-header ng-miam-icon.miam-modal__close__icon .icon-container{align-items:center;border:1px solid var(--m-color-light-slate);border-radius:36px;display:grid}.miam-modal.with-header ng-miam-icon.miam-modal__close__icon .icon-container svg{fill:var(--m-color-white);height:24px!important;width:24px!important}.miam-modal.without-header .miam-modal__close__icon{height:28px;z-index:8}.miam-modal .miam-modal__actions{background-color:var(--m-color-white);bottom:0;left:0;margin:0!important;position:fixed;right:0;z-index:8}.miam-modal .miam-modal__actions button{font-size:12px;height:44px;margin:16px 5px 5px 0;padding:5px}.miam-modal .miam-modal__actions button:first-of-type{margin:16px 5px 5px}@-webkit-keyframes openBottomSheet{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes openBottomSheet{0%{transform:translateY(100%)}to{transform:translateY(0)}}}"], encapsulation: 2, changeDetection: 0 });
|
|
11685
|
+
} }, directives: [NgIf, NgClass, IconComponent, LoaderComponent], styles: [".miam-shadow-overlay{-webkit-animation-duration:.3s;-webkit-animation-name:show;-webkit-animation-timing-function:ease-in-out;-webkit-tap-highlight-color:transparent;animation-duration:.3s;animation-name:show;animation-timing-function:ease-in-out;background:var(--m-color-black);height:100vh;left:0;opacity:.6;position:fixed;top:0;width:100vw;z-index:var(--m-z-index-modal-overlay)}.miam-modal{-webkit-animation-duration:.5s;-webkit-animation-name:open;-webkit-animation-timing-function:cubic-bezier(.75,0,.2,1);animation-duration:.5s;animation-name:open;animation-timing-function:cubic-bezier(.75,0,.2,1);background-color:var(--m-color-white);height:100%;max-width:1200px;overflow-x:hidden;overflow-y:auto;position:fixed;right:0;top:0;width:80%;z-index:var(--m-z-index-modal)}@media print{.miam-modal{height:unset!important;overflow-y:unset!important;position:unset!important}}@-webkit-keyframes open{0%{right:-1200px}to{right:0}}@keyframes open{0%{right:-1200px}to{right:0}}.miam-modal.with-header .miam-modal__header{background-color:var(--m-color-grey);color:var(--m-color-grey-text-dark);display:flex;flex-direction:row;justify-content:space-between}.miam-modal.with-header .miam-modal__title{color:var(--m-color-grey-text-dark);font-size:var(--m-font-size-large);font-weight:700;overflow:hidden;padding:20px;text-overflow:ellipsis}.miam-modal.with-header .miam-modal__close__icon{-webkit-tap-highlight-color:transparent;height:40px}.miam-modal.without-header .miam-modal__close__icon{border-radius:var(--m-border-radius-circle);display:flex;height:60px;justify-items:center;position:absolute;right:0;top:0;z-index:var(--m-z-index-position-absolute-high)}.miam-modal .miam-modal__container{display:flex;flex-direction:column;height:100%;position:relative}.miam-modal .miam-modal__container .miam-modal__close__icon{cursor:pointer;margin:10px}@media print{.miam-modal .miam-modal__container .miam-modal__close__icon{display:none}}.miam-modal .miam-modal__container .miam-modal__actions{align-items:center;display:flex;justify-content:space-evenly;margin:20px}@-webkit-keyframes show{0%{opacity:0}to{opacity:.6}}@keyframes show{0%{opacity:0}to{opacity:.6}}@media (max-width:1022px){.miam-modal{-webkit-animation-duration:.5s;-webkit-animation-name:openBottomSheet;-webkit-animation-timing-function:cubic-bezier(.075,.82,.165,1);animation-duration:.5s;animation-name:openBottomSheet;animation-timing-function:cubic-bezier(.075,.82,.165,1);background-color:var(--m-color-white);bottom:0;left:0;max-width:100vw;overflow-x:hidden;overflow-y:hidden;position:fixed;right:0;top:100vh;top:unset;width:100vw;z-index:var(--m-z-index-modal)}.miam-modal.with-header .miam-modal__header{align-items:center;background-color:unset}.miam-modal.with-header .miam-modal__title{padding:0 0 0 16px}.miam-modal.with-header ng-miam-icon.miam-modal__close__icon .icon-container{align-items:center;border:1px solid var(--m-color-light-slate);border-radius:36px;display:grid}.miam-modal.with-header ng-miam-icon.miam-modal__close__icon .icon-container svg{fill:var(--m-color-white);height:24px!important;width:24px!important}.miam-modal.without-header .miam-modal__close__icon{height:28px;z-index:8}.miam-modal .miam-modal__actions{background-color:var(--m-color-white);bottom:0;left:0;margin:0!important;position:fixed;right:0;z-index:8}.miam-modal .miam-modal__actions button{font-size:12px;height:44px;margin:16px 5px 5px 0;padding:5px}.miam-modal .miam-modal__actions button:first-of-type{margin:16px 5px 5px}@-webkit-keyframes openBottomSheet{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes openBottomSheet{0%{transform:translateY(100%)}to{transform:translateY(0)}}}"], encapsulation: 2, changeDetection: 0 });
|
|
11600
11686
|
/*@__PURE__*/ (function () { ɵsetClassMetadata(ModalComponent, [{
|
|
11601
11687
|
type: Component,
|
|
11602
11688
|
args: [{
|
|
@@ -11616,6 +11702,14 @@ ModalComponent.ɵcmp = ɵɵdefineComponent({ type: ModalComponent, selectors: [[
|
|
|
11616
11702
|
type: Input
|
|
11617
11703
|
}], isAngularComponent: [{
|
|
11618
11704
|
type: Input
|
|
11705
|
+
}], confirmButtonIsLoading: [{
|
|
11706
|
+
type: Input
|
|
11707
|
+
}], cancelButtonIsLoading: [{
|
|
11708
|
+
type: Input
|
|
11709
|
+
}], confirmButtonDisabled: [{
|
|
11710
|
+
type: Input
|
|
11711
|
+
}], cancelButtonDisabled: [{
|
|
11712
|
+
type: Input
|
|
11619
11713
|
}], noHeaderMode: [{
|
|
11620
11714
|
type: Input
|
|
11621
11715
|
}], containerElement: [{
|
|
@@ -11732,7 +11826,7 @@ class ListScanFilesInputsComponent {
|
|
|
11732
11826
|
this.loading = true;
|
|
11733
11827
|
this.cdr.detectChanges();
|
|
11734
11828
|
// takeFirstList to make sure the list is initialised before checking its value
|
|
11735
|
-
this.listsService.takeFirstList().subscribe(currentList => {
|
|
11829
|
+
this.listsService.takeFirstList().subscribe((currentList) => {
|
|
11736
11830
|
const precedentEntries = currentList.entries.data;
|
|
11737
11831
|
this.listsService.addEntriesFromPicture(file, ['groceries-entries'], this.disableIngredientsMatching).subscribe(list => {
|
|
11738
11832
|
const addedEntries = list.entries.data
|
|
@@ -12378,10 +12472,12 @@ ModalModule.ɵinj = ɵɵdefineInjector({ factory: function ModalModule_Factory(t
|
|
|
12378
12472
|
CommonModule,
|
|
12379
12473
|
FormsModule,
|
|
12380
12474
|
ComponentsModule,
|
|
12475
|
+
LoaderModule
|
|
12381
12476
|
]] });
|
|
12382
12477
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵɵsetNgModuleScope(ModalModule, { declarations: [ModalComponent], imports: [CommonModule,
|
|
12383
12478
|
FormsModule,
|
|
12384
|
-
ComponentsModule
|
|
12479
|
+
ComponentsModule,
|
|
12480
|
+
LoaderModule], exports: [ModalComponent] }); })();
|
|
12385
12481
|
/*@__PURE__*/ (function () { ɵsetClassMetadata(ModalModule, [{
|
|
12386
12482
|
type: NgModule,
|
|
12387
12483
|
args: [{
|
|
@@ -12389,6 +12485,7 @@ ModalModule.ɵinj = ɵɵdefineInjector({ factory: function ModalModule_Factory(t
|
|
|
12389
12485
|
CommonModule,
|
|
12390
12486
|
FormsModule,
|
|
12391
12487
|
ComponentsModule,
|
|
12488
|
+
LoaderModule
|
|
12392
12489
|
],
|
|
12393
12490
|
declarations: [
|
|
12394
12491
|
ModalComponent
|
|
@@ -13975,7 +14072,7 @@ RecipeDetailsComponent.ɵcmp = ɵɵdefineComponent({ type: RecipeDetailsComponen
|
|
|
13975
14072
|
} if (rf & 2) {
|
|
13976
14073
|
var _t;
|
|
13977
14074
|
ɵɵqueryRefresh(_t = ɵɵloadQuery()) && (ctx.topContainerImg = _t.first);
|
|
13978
|
-
} }, inputs: { recipe: "recipe", previewAllowed: "previewAllowed", ingredientsPictures: "ingredientsPictures", forceDisplayTags: "forceDisplayTags", displayTagsIcons: "displayTagsIcons", displayPricing: "displayPricing", displayAddedOnPicture: "displayAddedOnPicture" }, outputs: { recipeAdded: "recipeAdded", recipeChanged: "recipeChanged", recipeError: "recipeError" }, features: [ɵɵNgOnChangesFeature], decls: 3, vars: 2, consts: [["class", "miam-recipe-details", 4, "ngIf", "ngIfElse"], ["addon", ""], [1, "miam-recipe-details"], ["mainContainer", ""], [1, "miam-recipe-details__header"], [1, "miam-recipe-details__bookmark"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/recipe-details/recipe-details-bookmark.svg", 4, "ngIf", "ngIfElse"], ["stamp", ""], ["class", "miam-recipe-details__title", 4, "ngIf"], [1, "miam-recipe-details__header__link", 3, "href"], [1, "miam-recipe-details__container"], [1, "miam-recipe-details__summary"], [1, "miam-recipe-details__summary__container"], [1, "miam-recipe-details__sponsor"], [3, "recipe", "showAddon", 4, "ngIf"], [1, "miam-recipe-details__picture"], ["topContainerImg", ""], [3, "src", "ngClass", 4, "ngIf"], [3, "videoId", "width", "height", 4, "ngIf"], [1, "miam-recipe-details__actionbar"], [1, "miam-recipe-details__actionbar__group"], ["class", "miam-recipe-details__actions__icon", 3, "recipe", "width", "height", 4, "ngIf"], ["primaryColor", "var(--m-color-primary)", 1, "miam-recipe-details__actions__icon", 3, "width", "height", "iconName", "click"], ["primaryColor", "var(--m-color-grey02)", "secondaryColor", "var(--m-color-grey07)", 1, "miam-recipe-details__actions__icon", 3, "width", "height", "iconName", "click"], [3, "recipe", "displayTags", "displayTagsIcons", 4, "ngIf"], ["id", "miam-recipe-details__content", 1, "miam-recipe-details__content"], ["class", "miam-recipe-details__title", "id", "miam-recipe-details__title", 4, "ngIf"], ["class", "miam-recipe-details__content__description", 4, "ngIf"], [3, "recipe", "ingredientsPictures", "recipeChanged"], [3, "recipe"], [1, "miam-recipe-details__action__container"], [1, "miam-recipe-details__price"], ["guestsText", "par personne", 3, "recipe", "serves", 4, "ngIf"], ["class", "miam-recipe-details__addbasket", 3, "ngClass", "click", 4, "ngIf"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/recipe-details/recipe-details-bookmark.svg"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/recipe-details/recipe-details-stamp.svg"], [1, "miam-recipe-details__title"], [3, "recipe", "showAddon"], [3, "src", "ngClass"], [3, "videoId", "width", "height"], [1, "miam-recipe-details__actions__icon", 3, "recipe", "width", "height"], [3, "recipe", "displayTags", "displayTagsIcons"], ["id", "miam-recipe-details__title", 1, "miam-recipe-details__title"], [1, "miam-recipe-details__content__description"], ["guestsText", "par personne", 3, "recipe", "serves"], [1, "miam-recipe-details__addbasket", 3, "ngClass", "click"], ["class", "miam-recipe-details__addbasket__cta", 4, "ngIf", "ngIfElse"], ["addLoader", ""], [1, "miam-recipe-details__addbasket__cta"], ["primaryColor", "#fff", 3, "width", "height", "iconName", 4, "ngIf"], ["primaryColor", "#fff", 3, "width", "height", "iconName"], [3, "recipe", "hideAddon"]], template: function RecipeDetailsComponent_Template(rf, ctx) { if (rf & 1) {
|
|
14075
|
+
} }, inputs: { recipe: "recipe", previewAllowed: "previewAllowed", ingredientsPictures: "ingredientsPictures", forceDisplayTags: "forceDisplayTags", displayTagsIcons: "displayTagsIcons", displayPricing: "displayPricing", displayAddedOnPicture: "displayAddedOnPicture" }, outputs: { recipeAdded: "recipeAdded", recipeChanged: "recipeChanged", recipeError: "recipeError" }, features: [ɵɵNgOnChangesFeature], decls: 3, vars: 2, consts: [["class", "miam-recipe-details", 4, "ngIf", "ngIfElse"], ["addon", ""], [1, "miam-recipe-details"], ["mainContainer", ""], [1, "miam-recipe-details__header"], [1, "miam-recipe-details__bookmark"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/recipe-details/recipe-details-bookmark.svg", 4, "ngIf", "ngIfElse"], ["stamp", ""], ["class", "miam-recipe-details__title", 4, "ngIf"], [1, "miam-recipe-details__header__link", 3, "href"], [1, "miam-recipe-details__container"], [1, "miam-recipe-details__summary"], [1, "miam-recipe-details__summary__container"], [1, "miam-recipe-details__sponsor"], [3, "recipe", "showAddon", 4, "ngIf"], [1, "miam-recipe-details__picture"], ["topContainerImg", ""], [3, "src", "ngClass", 4, "ngIf"], [3, "videoId", "width", "height", 4, "ngIf"], [1, "miam-recipe-details__actionbar"], [1, "miam-recipe-details__actionbar__group"], ["class", "miam-recipe-details__actions__icon like", 3, "recipe", "width", "height", 4, "ngIf"], ["primaryColor", "var(--m-color-primary)", 1, "miam-recipe-details__actions__icon", "print", 3, "width", "height", "iconName", "click"], ["primaryColor", "var(--m-color-grey02)", "secondaryColor", "var(--m-color-grey07)", 1, "miam-recipe-details__actions__icon", "help", 3, "width", "height", "iconName", "click"], [3, "recipe", "displayTags", "displayTagsIcons", 4, "ngIf"], ["id", "miam-recipe-details__content", 1, "miam-recipe-details__content"], ["class", "miam-recipe-details__title", "id", "miam-recipe-details__title", 4, "ngIf"], ["class", "miam-recipe-details__content__description", 4, "ngIf"], [3, "recipe", "ingredientsPictures", "recipeChanged"], [3, "recipe"], [1, "miam-recipe-details__action__container"], [1, "miam-recipe-details__price"], ["guestsText", "par personne", 3, "recipe", "serves", 4, "ngIf"], ["class", "miam-recipe-details__addbasket", 3, "ngClass", "click", 4, "ngIf"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/recipe-details/recipe-details-bookmark.svg"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/recipe-details/recipe-details-stamp.svg"], [1, "miam-recipe-details__title"], [3, "recipe", "showAddon"], [3, "src", "ngClass"], [3, "videoId", "width", "height"], [1, "miam-recipe-details__actions__icon", "like", 3, "recipe", "width", "height"], [3, "recipe", "displayTags", "displayTagsIcons"], ["id", "miam-recipe-details__title", 1, "miam-recipe-details__title"], [1, "miam-recipe-details__content__description"], ["guestsText", "par personne", 3, "recipe", "serves"], [1, "miam-recipe-details__addbasket", 3, "ngClass", "click"], ["class", "miam-recipe-details__addbasket__cta", 4, "ngIf", "ngIfElse"], ["addLoader", ""], [1, "miam-recipe-details__addbasket__cta"], ["primaryColor", "#fff", 3, "width", "height", "iconName", 4, "ngIf"], ["primaryColor", "#fff", 3, "width", "height", "iconName"], [3, "recipe", "hideAddon"]], template: function RecipeDetailsComponent_Template(rf, ctx) { if (rf & 1) {
|
|
13979
14076
|
ɵɵtemplate(0, RecipeDetailsComponent_div_0_Template, 38, 25, "div", 0);
|
|
13980
14077
|
ɵɵtemplate(1, RecipeDetailsComponent_ng_template_1_Template, 1, 1, "ng-template", null, 1, ɵɵtemplateRefExtractor);
|
|
13981
14078
|
} if (rf & 2) {
|
|
@@ -15294,60 +15391,118 @@ const ɵRecipeStepperComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFacto
|
|
|
15294
15391
|
}] }); })();
|
|
15295
15392
|
|
|
15296
15393
|
const _c0$y = ["tag"];
|
|
15297
|
-
function
|
|
15298
|
-
const
|
|
15299
|
-
ɵɵelementStart(0, "div",
|
|
15300
|
-
ɵɵelementStart(2, "ng-miam-icon",
|
|
15301
|
-
ɵɵlistener("click", function
|
|
15394
|
+
function RecipeTagsComponent_ng_container_0_div_1_div_2_Template(rf, ctx) { if (rf & 1) {
|
|
15395
|
+
const _r9 = ɵɵgetCurrentView();
|
|
15396
|
+
ɵɵelementStart(0, "div", 11, 12);
|
|
15397
|
+
ɵɵelementStart(2, "ng-miam-icon", 13);
|
|
15398
|
+
ɵɵlistener("click", function RecipeTagsComponent_ng_container_0_div_1_div_2_Template_ng_miam_icon_click_2_listener() { ɵɵrestoreView(_r9); const recipeLine_r5 = ctx.$implicit; const ctx_r8 = ɵɵnextContext(3); return ctx_r8.toggleRecipe(recipeLine_r5.id); });
|
|
15302
15399
|
ɵɵelementEnd();
|
|
15303
|
-
ɵɵelementStart(3, "span",
|
|
15304
|
-
ɵɵlistener("click", function
|
|
15400
|
+
ɵɵelementStart(3, "span", 14);
|
|
15401
|
+
ɵɵlistener("click", function RecipeTagsComponent_ng_container_0_div_1_div_2_Template_span_click_3_listener() { ɵɵrestoreView(_r9); const recipeLine_r5 = ctx.$implicit; const ctx_r10 = ɵɵnextContext(3); return ctx_r10.toggleRecipe(recipeLine_r5.id); });
|
|
15305
15402
|
ɵɵtext(4);
|
|
15306
15403
|
ɵɵpipe(5, "ellipsis");
|
|
15307
15404
|
ɵɵelementEnd();
|
|
15308
15405
|
ɵɵelementEnd();
|
|
15309
15406
|
} if (rf & 2) {
|
|
15310
|
-
const
|
|
15311
|
-
const
|
|
15407
|
+
const recipeLine_r5 = ctx.$implicit;
|
|
15408
|
+
const ctx_r4 = ɵɵnextContext(3);
|
|
15312
15409
|
ɵɵadvance(2);
|
|
15313
|
-
ɵɵproperty("iconName",
|
|
15410
|
+
ɵɵproperty("iconName", ctx_r4.icon.Meal);
|
|
15314
15411
|
ɵɵadvance(2);
|
|
15315
|
-
ɵɵtextInterpolate(ɵɵpipeBind2(5, 2,
|
|
15412
|
+
ɵɵtextInterpolate(ɵɵpipeBind2(5, 2, recipeLine_r5.title, 6));
|
|
15316
15413
|
} }
|
|
15317
15414
|
const _c1$h = function (a0) { return { "height.px": a0 }; };
|
|
15318
15415
|
const _c2$6 = function (a0) { return { "miam-recipe-tags__container__toggle__hidden": a0 }; };
|
|
15319
15416
|
const _c3$3 = function (a0) { return { "opacity": a0 }; };
|
|
15320
|
-
function
|
|
15321
|
-
const
|
|
15322
|
-
ɵɵelementStart(0, "div",
|
|
15323
|
-
ɵɵelementStart(1, "div",
|
|
15324
|
-
ɵɵtemplate(2,
|
|
15417
|
+
function RecipeTagsComponent_ng_container_0_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
15418
|
+
const _r12 = ɵɵgetCurrentView();
|
|
15419
|
+
ɵɵelementStart(0, "div", 3);
|
|
15420
|
+
ɵɵelementStart(1, "div", 4);
|
|
15421
|
+
ɵɵtemplate(2, RecipeTagsComponent_ng_container_0_div_1_div_2_Template, 6, 5, "div", 5);
|
|
15325
15422
|
ɵɵelementEnd();
|
|
15326
|
-
ɵɵelementStart(3, "div",
|
|
15327
|
-
ɵɵelementStart(4, "span",
|
|
15328
|
-
ɵɵlistener("click", function
|
|
15423
|
+
ɵɵelementStart(3, "div", 6);
|
|
15424
|
+
ɵɵelementStart(4, "span", 7);
|
|
15425
|
+
ɵɵlistener("click", function RecipeTagsComponent_ng_container_0_div_1_Template_span_click_4_listener() { ɵɵrestoreView(_r12); const ctx_r11 = ɵɵnextContext(2); return ctx_r11.toggleList(); });
|
|
15329
15426
|
ɵɵtext(5);
|
|
15330
15427
|
ɵɵelementEnd();
|
|
15331
|
-
ɵɵelement(6, "div",
|
|
15332
|
-
ɵɵelementStart(7, "span",
|
|
15333
|
-
ɵɵlistener("click", function
|
|
15334
|
-
ɵɵelement(8, "ng-miam-icon",
|
|
15428
|
+
ɵɵelement(6, "div", 8);
|
|
15429
|
+
ɵɵelementStart(7, "span", 9);
|
|
15430
|
+
ɵɵlistener("click", function RecipeTagsComponent_ng_container_0_div_1_Template_span_click_7_listener() { ɵɵrestoreView(_r12); const ctx_r13 = ɵɵnextContext(2); return ctx_r13.toggleList(); });
|
|
15431
|
+
ɵɵelement(8, "ng-miam-icon", 10);
|
|
15335
15432
|
ɵɵelementEnd();
|
|
15336
15433
|
ɵɵelementEnd();
|
|
15337
15434
|
ɵɵelementEnd();
|
|
15338
15435
|
} if (rf & 2) {
|
|
15339
|
-
const
|
|
15340
|
-
ɵɵproperty("ngStyle", ɵɵpureFunction1(6, _c1$h,
|
|
15436
|
+
const ctx_r3 = ɵɵnextContext(2);
|
|
15437
|
+
ɵɵproperty("ngStyle", ɵɵpureFunction1(6, _c1$h, ctx_r3.isListOpen ? 32 * ctx_r3.rowCount : 24));
|
|
15341
15438
|
ɵɵadvance(2);
|
|
15342
|
-
ɵɵproperty("ngForOf",
|
|
15439
|
+
ɵɵproperty("ngForOf", ctx_r3.recipePreviewLines);
|
|
15343
15440
|
ɵɵadvance(1);
|
|
15344
|
-
ɵɵproperty("ngClass", ɵɵpureFunction1(8, _c2$6, !
|
|
15441
|
+
ɵɵproperty("ngClass", ɵɵpureFunction1(8, _c2$6, !ctx_r3.rowCount || ctx_r3.wrappedItemsCount === 0));
|
|
15345
15442
|
ɵɵadvance(2);
|
|
15346
|
-
ɵɵtextInterpolate1(" ",
|
|
15443
|
+
ɵɵtextInterpolate1(" ", ctx_r3.isListOpen ? " " : "+" + ctx_r3.wrappedItemsCount, "");
|
|
15347
15444
|
ɵɵadvance(2);
|
|
15348
|
-
ɵɵproperty("ngStyle", ɵɵpureFunction1(10, _c3$3,
|
|
15445
|
+
ɵɵproperty("ngStyle", ɵɵpureFunction1(10, _c3$3, ctx_r3.isListOpen ? 1 : 0));
|
|
15349
15446
|
ɵɵadvance(1);
|
|
15350
|
-
ɵɵproperty("iconName",
|
|
15447
|
+
ɵɵproperty("iconName", ctx_r3.icon.ChevronDown);
|
|
15448
|
+
} }
|
|
15449
|
+
function RecipeTagsComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
|
|
15450
|
+
ɵɵelementContainerStart(0);
|
|
15451
|
+
ɵɵtemplate(1, RecipeTagsComponent_ng_container_0_div_1_Template, 9, 12, "div", 2);
|
|
15452
|
+
ɵɵelementContainerEnd();
|
|
15453
|
+
} if (rf & 2) {
|
|
15454
|
+
const ctx_r0 = ɵɵnextContext();
|
|
15455
|
+
ɵɵadvance(1);
|
|
15456
|
+
ɵɵproperty("ngIf", (ctx_r0.recipePreviewLines == null ? null : ctx_r0.recipePreviewLines.length) > 0);
|
|
15457
|
+
} }
|
|
15458
|
+
function RecipeTagsComponent_ng_template_1_div_0_Template(rf, ctx) { if (rf & 1) {
|
|
15459
|
+
const _r17 = ɵɵgetCurrentView();
|
|
15460
|
+
ɵɵelementStart(0, "div", 17);
|
|
15461
|
+
ɵɵlistener("click", function RecipeTagsComponent_ng_template_1_div_0_Template_div_click_0_listener() { ɵɵrestoreView(_r17); const ctx_r16 = ɵɵnextContext(2); return ctx_r16.toggleModal(); });
|
|
15462
|
+
ɵɵelementStart(1, "span");
|
|
15463
|
+
ɵɵtext(2);
|
|
15464
|
+
ɵɵelementEnd();
|
|
15465
|
+
ɵɵelementEnd();
|
|
15466
|
+
} if (rf & 2) {
|
|
15467
|
+
const ctx_r14 = ɵɵnextContext(2);
|
|
15468
|
+
ɵɵadvance(2);
|
|
15469
|
+
ɵɵtextInterpolate1("", ctx_r14.recipePreviewLines.length, " recettes");
|
|
15470
|
+
} }
|
|
15471
|
+
function RecipeTagsComponent_ng_template_1_div_3_Template(rf, ctx) { if (rf & 1) {
|
|
15472
|
+
const _r22 = ɵɵgetCurrentView();
|
|
15473
|
+
ɵɵelementStart(0, "div", 11, 12);
|
|
15474
|
+
ɵɵelementStart(2, "ng-miam-icon", 13);
|
|
15475
|
+
ɵɵlistener("click", function RecipeTagsComponent_ng_template_1_div_3_Template_ng_miam_icon_click_2_listener() { ɵɵrestoreView(_r22); const recipeLine_r18 = ctx.$implicit; const ctx_r21 = ɵɵnextContext(2); return ctx_r21.toggleRecipe(recipeLine_r18.id); });
|
|
15476
|
+
ɵɵelementEnd();
|
|
15477
|
+
ɵɵelementStart(3, "span", 14);
|
|
15478
|
+
ɵɵlistener("click", function RecipeTagsComponent_ng_template_1_div_3_Template_span_click_3_listener() { ɵɵrestoreView(_r22); const recipeLine_r18 = ctx.$implicit; const ctx_r23 = ɵɵnextContext(2); return ctx_r23.toggleRecipe(recipeLine_r18.id); });
|
|
15479
|
+
ɵɵtext(4);
|
|
15480
|
+
ɵɵelementEnd();
|
|
15481
|
+
ɵɵelementEnd();
|
|
15482
|
+
} if (rf & 2) {
|
|
15483
|
+
const recipeLine_r18 = ctx.$implicit;
|
|
15484
|
+
const ctx_r15 = ɵɵnextContext(2);
|
|
15485
|
+
ɵɵadvance(2);
|
|
15486
|
+
ɵɵproperty("iconName", ctx_r15.icon.Meal);
|
|
15487
|
+
ɵɵadvance(2);
|
|
15488
|
+
ɵɵtextInterpolate(recipeLine_r18.title);
|
|
15489
|
+
} }
|
|
15490
|
+
function RecipeTagsComponent_ng_template_1_Template(rf, ctx) { if (rf & 1) {
|
|
15491
|
+
const _r25 = ɵɵgetCurrentView();
|
|
15492
|
+
ɵɵtemplate(0, RecipeTagsComponent_ng_template_1_div_0_Template, 3, 1, "div", 15);
|
|
15493
|
+
ɵɵelementStart(1, "ng-miam-modal", 16);
|
|
15494
|
+
ɵɵlistener("close", function RecipeTagsComponent_ng_template_1_Template_ng_miam_modal_close_1_listener() { ɵɵrestoreView(_r25); const ctx_r24 = ɵɵnextContext(); return ctx_r24.toggleModal(); });
|
|
15495
|
+
ɵɵelementStart(2, "div", 4);
|
|
15496
|
+
ɵɵtemplate(3, RecipeTagsComponent_ng_template_1_div_3_Template, 5, 2, "div", 5);
|
|
15497
|
+
ɵɵelementEnd();
|
|
15498
|
+
ɵɵelementEnd();
|
|
15499
|
+
} if (rf & 2) {
|
|
15500
|
+
const ctx_r2 = ɵɵnextContext();
|
|
15501
|
+
ɵɵproperty("ngIf", (ctx_r2.recipePreviewLines == null ? null : ctx_r2.recipePreviewLines.length) > 0);
|
|
15502
|
+
ɵɵadvance(1);
|
|
15503
|
+
ɵɵproperty("isAngularComponent", true)("expanded", ctx_r2.modalIsOpened)("noHeaderMode", false)("title", ctx_r2.modalTitle);
|
|
15504
|
+
ɵɵadvance(2);
|
|
15505
|
+
ɵɵproperty("ngForOf", ctx_r2.recipePreviewLines);
|
|
15351
15506
|
} }
|
|
15352
15507
|
class RecipeTagsComponent {
|
|
15353
15508
|
constructor(cdr, basketService, contexteservice) {
|
|
@@ -15355,7 +15510,9 @@ class RecipeTagsComponent {
|
|
|
15355
15510
|
this.basketService = basketService;
|
|
15356
15511
|
this.contexteservice = contexteservice;
|
|
15357
15512
|
this.recipeDetailPreviewAllowed = true;
|
|
15513
|
+
this.reduce = false;
|
|
15358
15514
|
this.icon = Icon;
|
|
15515
|
+
this.modalIsOpened = false;
|
|
15359
15516
|
this.subscriptions = [];
|
|
15360
15517
|
}
|
|
15361
15518
|
ngOnChanges(simpleChanges) {
|
|
@@ -15410,6 +15567,13 @@ class RecipeTagsComponent {
|
|
|
15410
15567
|
this.isListOpen = !this.isListOpen;
|
|
15411
15568
|
this.cdr.detectChanges();
|
|
15412
15569
|
}
|
|
15570
|
+
toggleModal() {
|
|
15571
|
+
if (!this.modalIsOpened) {
|
|
15572
|
+
this.modalTitle = 'Utilisé dans ' + this.recipePreviewLines.length + ' recettes';
|
|
15573
|
+
}
|
|
15574
|
+
this.modalIsOpened = !this.modalIsOpened;
|
|
15575
|
+
this.cdr.detectChanges();
|
|
15576
|
+
}
|
|
15413
15577
|
}
|
|
15414
15578
|
RecipeTagsComponent.ɵfac = function RecipeTagsComponent_Factory(t) { return new (t || RecipeTagsComponent)(ɵɵdirectiveInject(ChangeDetectorRef), ɵɵdirectiveInject(BasketsService), ɵɵdirectiveInject(ContextService)); };
|
|
15415
15579
|
RecipeTagsComponent.ɵcmp = ɵɵdefineComponent({ type: RecipeTagsComponent, selectors: [["ng-miam-recipe-tags"]], viewQuery: function RecipeTagsComponent_Query(rf, ctx) { if (rf & 1) {
|
|
@@ -15417,11 +15581,13 @@ RecipeTagsComponent.ɵcmp = ɵɵdefineComponent({ type: RecipeTagsComponent, sel
|
|
|
15417
15581
|
} if (rf & 2) {
|
|
15418
15582
|
var _t;
|
|
15419
15583
|
ɵɵqueryRefresh(_t = ɵɵloadQuery()) && (ctx.tags = _t);
|
|
15420
|
-
} }, inputs: { extId: "extId", recipeDetailPreviewAllowed: "recipeDetailPreviewAllowed" }, features: [ɵɵNgOnChangesFeature], decls:
|
|
15421
|
-
ɵɵtemplate(0,
|
|
15584
|
+
} }, inputs: { extId: "extId", recipeDetailPreviewAllowed: "recipeDetailPreviewAllowed", reduce: "reduce" }, features: [ɵɵNgOnChangesFeature], decls: 3, vars: 2, consts: [[4, "ngIf", "ngIfElse"], ["reduced", ""], ["class", "miam-recipe-tags__container", 3, "ngStyle", 4, "ngIf"], [1, "miam-recipe-tags__container", 3, "ngStyle"], [1, "miam-recipe-tags__container__list"], ["class", "miam-recipe-tags__list__badge", 4, "ngFor", "ngForOf"], [1, "miam-recipe-tags__container__toggle", 3, "ngClass"], [1, "miam-recipe-tags__toggle__open", 3, "click"], [1, "miam-recipe-tags__toggle__ligne"], [1, "miam-recipe-tags__toggle__close", 3, "ngStyle", "click"], ["width", "24", "height", "24", "primaryColor", "var(--m-color-white)", 3, "iconName"], [1, "miam-recipe-tags__list__badge"], ["tag", ""], ["primaryColor", "var(--m-color-white)", 1, "miam-recipe-tags__badge__icon", 3, "iconName", "click"], [1, "miam-recipe-tag__badge__text", 3, "click"], ["class", "miam-recipe-tags__recipes", 3, "click", 4, "ngIf"], [1, "miam-recipe-tags__modal", 3, "isAngularComponent", "expanded", "noHeaderMode", "title", "close"], [1, "miam-recipe-tags__recipes", 3, "click"]], template: function RecipeTagsComponent_Template(rf, ctx) { if (rf & 1) {
|
|
15585
|
+
ɵɵtemplate(0, RecipeTagsComponent_ng_container_0_Template, 2, 1, "ng-container", 0);
|
|
15586
|
+
ɵɵtemplate(1, RecipeTagsComponent_ng_template_1_Template, 4, 6, "ng-template", null, 1, ɵɵtemplateRefExtractor);
|
|
15422
15587
|
} if (rf & 2) {
|
|
15423
|
-
|
|
15424
|
-
|
|
15588
|
+
const _r1 = ɵɵreference(2);
|
|
15589
|
+
ɵɵproperty("ngIf", !ctx.reduce)("ngIfElse", _r1);
|
|
15590
|
+
} }, directives: [NgIf, NgStyle, NgForOf, NgClass, IconComponent, ModalComponent], pipes: [EllipsisPipe], styles: [".miam-recipe-tags__container__list{display:flex;flex:1 1;flex-wrap:wrap;gap:8px}.miam-recipe-tags__container__list .miam-recipe-tags__list__badge{align-items:center;border:1px solid #e9e9e9;border-radius:100px;box-sizing:border-box;cursor:pointer;display:flex;height:24px;max-width:50vw;padding:0 8px 0 0;position:relative}.miam-recipe-tags__container__list .miam-recipe-tags__list__badge .miam-recipe-tags__badge__icon{background:var(--m-color-primary);border-radius:100px 0 0 100px;flex:none;flex-grow:0;order:0;padding:4px 8px}.miam-recipe-tags__container__list .miam-recipe-tags__list__badge .miam-recipe-tag__badge__text{color:#676767;flex:1;font-size:12px;line-height:16px;margin:0 8px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.miam-recipe-tags__container{display:flex;margin-top:16px;overflow:hidden;padding:0 8px;transition:height .25s cubic-bezier(0,0,.2,1)}.miam-recipe-tags__container .miam-recipe-tags__container__toggle{align-items:center;display:flex;flex-direction:column;visibility:visible;width:80px}.miam-recipe-tags__container .miam-recipe-tags__container__toggle.miam-recipe-tags__container__toggle__hidden{visibility:hidden}.miam-recipe-tags__container .miam-recipe-tags__container__toggle .miam-recipe-tags__toggle__open{background:#f6f6f6;border-radius:100px;cursor:pointer;display:flex;height:24px;justify-content:center;min-width:40px;padding:4px 8px}.miam-recipe-tags__container .miam-recipe-tags__container__toggle .miam-recipe-tags__toggle__ligne{background-color:var(--m-color-grey);flex:1;transform:height 1s linear;width:2px}.miam-recipe-tags__container .miam-recipe-tags__container__toggle .miam-recipe-tags__toggle__close{background:var(--m-color-primary);border-radius:100px;cursor:pointer;min-width:40px;transition:opacity .2s linear}.miam-recipe-tags__container .miam-recipe-tags__container__toggle .miam-recipe-tags__toggle__close ng-miam-icon .icon-container{transform:rotate(180deg)}.miam-recipe-tags__recipes{align-items:center;border:1px solid #e9e9e9;border-radius:100px;box-sizing:border-box;cursor:pointer;display:flex;height:24px;max-width:50vw;padding:0 8px 0 0;position:relative}.miam-recipe-tags__modal .miam-modal{-webkit-animation-name:none;animation-name:none;height:auto;right:50%;top:50%;transform:translate3d(50%,-50%,0)}.miam-recipe-tags__modal .miam-modal .miam-modal__container .miam-recipe-tags__container__list{display:flex;flex-flow:row wrap;max-width:480px;padding:24px}@media (max-width:1023px){.miam-recipe-tags__modal .miam-modal .miam-modal__container .miam-recipe-tags__container__list{flex-flow:column}}"], encapsulation: 2, changeDetection: 0 });
|
|
15425
15591
|
/*@__PURE__*/ (function () { ɵsetClassMetadata(RecipeTagsComponent, [{
|
|
15426
15592
|
type: Component,
|
|
15427
15593
|
args: [{
|
|
@@ -15435,6 +15601,8 @@ RecipeTagsComponent.ɵcmp = ɵɵdefineComponent({ type: RecipeTagsComponent, sel
|
|
|
15435
15601
|
type: Input
|
|
15436
15602
|
}], recipeDetailPreviewAllowed: [{
|
|
15437
15603
|
type: Input
|
|
15604
|
+
}], reduce: [{
|
|
15605
|
+
type: Input
|
|
15438
15606
|
}], tags: [{
|
|
15439
15607
|
type: ViewChildren,
|
|
15440
15608
|
args: ['tag']
|
|
@@ -15729,7 +15897,7 @@ function RecipeModalComponent_div_2_Template(rf, ctx) { if (rf & 1) {
|
|
|
15729
15897
|
const _r8 = ɵɵgetCurrentView();
|
|
15730
15898
|
ɵɵelementStart(0, "div", 5);
|
|
15731
15899
|
ɵɵelementStart(1, "ng-miam-basket-preview-block", 6);
|
|
15732
|
-
ɵɵlistener("guestCountChanged", function RecipeModalComponent_div_2_Template_ng_miam_basket_preview_block_guestCountChanged_1_listener($event) { ɵɵrestoreView(_r8); const ctx_r7 = ɵɵnextContext(); return ctx_r7.updateRecipeGuests($event); });
|
|
15900
|
+
ɵɵlistener("guestCountChanged", function RecipeModalComponent_div_2_Template_ng_miam_basket_preview_block_guestCountChanged_1_listener($event) { ɵɵrestoreView(_r8); const ctx_r7 = ɵɵnextContext(); return ctx_r7.updateRecipeGuests($event); })("loading", function RecipeModalComponent_div_2_Template_ng_miam_basket_preview_block_loading_1_listener($event) { ɵɵrestoreView(_r8); const ctx_r9 = ɵɵnextContext(); return ctx_r9.setModalClosable($event); });
|
|
15733
15901
|
ɵɵelementEnd();
|
|
15734
15902
|
ɵɵelementEnd();
|
|
15735
15903
|
} if (rf & 2) {
|
|
@@ -15738,14 +15906,20 @@ function RecipeModalComponent_div_2_Template(rf, ctx) { if (rf & 1) {
|
|
|
15738
15906
|
ɵɵproperty("recipeId", ctx_r1.recipe && ctx_r1.recipe.id);
|
|
15739
15907
|
} }
|
|
15740
15908
|
class RecipeModalComponent {
|
|
15741
|
-
constructor(cdr, recipesService, printService, elRef, groceriesListsService) {
|
|
15909
|
+
constructor(cdr, recipesService, printService, elRef, groceriesListsService, basketsService) {
|
|
15742
15910
|
this.cdr = cdr;
|
|
15743
15911
|
this.recipesService = recipesService;
|
|
15744
15912
|
this.printService = printService;
|
|
15745
15913
|
this.elRef = elRef;
|
|
15746
15914
|
this.groceriesListsService = groceriesListsService;
|
|
15915
|
+
this.basketsService = basketsService;
|
|
15747
15916
|
this.show = false;
|
|
15748
15917
|
this.previewMode = false;
|
|
15918
|
+
this.canCloseModal = true;
|
|
15919
|
+
this.removeIsLoading = false;
|
|
15920
|
+
this.basketChangedSinceOpened = false; // true if show = true and basket is different since last time show was false
|
|
15921
|
+
this.recipeWasAdded = false;
|
|
15922
|
+
this.hasChangesOnClose = new EventEmitter(false);
|
|
15749
15923
|
}
|
|
15750
15924
|
ngOnInit() {
|
|
15751
15925
|
this.recipesService.displayedRecipe$.subscribe(result => {
|
|
@@ -15755,6 +15929,7 @@ class RecipeModalComponent {
|
|
|
15755
15929
|
this.cdr.detectChanges();
|
|
15756
15930
|
}
|
|
15757
15931
|
else {
|
|
15932
|
+
this.recipeWasAdded = result.wasAdded;
|
|
15758
15933
|
this.recipe = result.recipe;
|
|
15759
15934
|
this.previewMode = result.previewMode;
|
|
15760
15935
|
this.previewAllowed = result.previewAllowed;
|
|
@@ -15767,21 +15942,38 @@ class RecipeModalComponent {
|
|
|
15767
15942
|
this.cdr.detectChanges();
|
|
15768
15943
|
}
|
|
15769
15944
|
});
|
|
15945
|
+
this.basketsService._basket$.subscribe(() => {
|
|
15946
|
+
if (this.show) {
|
|
15947
|
+
this.basketChangedSinceOpened = true;
|
|
15948
|
+
}
|
|
15949
|
+
});
|
|
15770
15950
|
}
|
|
15771
15951
|
hide() {
|
|
15772
|
-
this.
|
|
15773
|
-
|
|
15774
|
-
|
|
15775
|
-
|
|
15776
|
-
|
|
15952
|
+
if (this.canCloseModal) {
|
|
15953
|
+
this.show = false;
|
|
15954
|
+
this.previewMode = false;
|
|
15955
|
+
this.recipesService.hide();
|
|
15956
|
+
this.printService.dissmissPrinting();
|
|
15957
|
+
this.hasChangesOnClose.emit(this.basketChangedSinceOpened);
|
|
15958
|
+
this.basketChangedSinceOpened = false;
|
|
15959
|
+
this.cdr.detectChanges();
|
|
15960
|
+
}
|
|
15777
15961
|
}
|
|
15778
15962
|
togglePreviewMode() {
|
|
15779
15963
|
this.previewMode = !this.previewMode;
|
|
15780
15964
|
this.cdr.detectChanges();
|
|
15781
15965
|
}
|
|
15782
15966
|
removeRecipe() {
|
|
15783
|
-
|
|
15784
|
-
|
|
15967
|
+
if (this.canCloseModal) {
|
|
15968
|
+
this.removeIsLoading = true;
|
|
15969
|
+
this.cdr.detectChanges();
|
|
15970
|
+
this.groceriesListsService.removeRecipeFromList(this.recipe.id).subscribe(() => {
|
|
15971
|
+
// if remove and recipe was added, then no change was made to basket, and if removed and not added it's a change to the basket
|
|
15972
|
+
this.basketChangedSinceOpened = !this.recipeWasAdded;
|
|
15973
|
+
this.removeIsLoading = false;
|
|
15974
|
+
this.hide();
|
|
15975
|
+
});
|
|
15976
|
+
}
|
|
15785
15977
|
}
|
|
15786
15978
|
updateRecipeGuests(guests) {
|
|
15787
15979
|
this.recipe.modifiedGuests = guests;
|
|
@@ -15795,30 +15987,39 @@ class RecipeModalComponent {
|
|
|
15795
15987
|
});
|
|
15796
15988
|
this.recipesService.displayedRecipeChanged.emit();
|
|
15797
15989
|
}
|
|
15990
|
+
/**
|
|
15991
|
+
* If the preview is opened and loading, block the user from closing the modal
|
|
15992
|
+
*/
|
|
15993
|
+
setModalClosable(previewLoading) {
|
|
15994
|
+
this.canCloseModal = !(previewLoading && this.previewMode);
|
|
15995
|
+
}
|
|
15798
15996
|
}
|
|
15799
|
-
RecipeModalComponent.ɵfac = function RecipeModalComponent_Factory(t) { return new (t || RecipeModalComponent)(ɵɵdirectiveInject(ChangeDetectorRef), ɵɵdirectiveInject(RecipesService), ɵɵdirectiveInject(PrintService), ɵɵdirectiveInject(ElementRef), ɵɵdirectiveInject(GroceriesListsService)); };
|
|
15800
|
-
RecipeModalComponent.ɵcmp = ɵɵdefineComponent({ type: RecipeModalComponent, selectors: [["ng-miam-recipe-modal"]], decls: 3, vars:
|
|
15997
|
+
RecipeModalComponent.ɵfac = function RecipeModalComponent_Factory(t) { return new (t || RecipeModalComponent)(ɵɵdirectiveInject(ChangeDetectorRef), ɵɵdirectiveInject(RecipesService), ɵɵdirectiveInject(PrintService), ɵɵdirectiveInject(ElementRef), ɵɵdirectiveInject(GroceriesListsService), ɵɵdirectiveInject(BasketsService)); };
|
|
15998
|
+
RecipeModalComponent.ɵcmp = ɵɵdefineComponent({ type: RecipeModalComponent, selectors: [["ng-miam-recipe-modal"]], outputs: { hasChangesOnClose: "hasChangesOnClose" }, decls: 3, vars: 12, consts: [[3, "isAngularComponent", "noHeaderMode", "expanded", "title", "cancelButtonText", "confirmButtonText", "cancelButtonDisabled", "confirmButtonDisabled", "cancelButtonIsLoading", "expandedChange", "close", "cancel", "confirm"], [3, "recipe", "previewAllowed", "recipeAdded", "recipeChanged", "recipeError", 4, "ngIf"], ["class", "miam-wrapper-preview", 4, "ngIf"], [3, "recipe", "previewAllowed", "recipeAdded", "recipeChanged", "recipeError"], ["details", ""], [1, "miam-wrapper-preview"], [3, "recipeId", "guestCountChanged", "loading"]], template: function RecipeModalComponent_Template(rf, ctx) { if (rf & 1) {
|
|
15801
15999
|
ɵɵelementStart(0, "ng-miam-modal", 0);
|
|
15802
16000
|
ɵɵlistener("expandedChange", function RecipeModalComponent_Template_ng_miam_modal_expandedChange_0_listener($event) { return ctx.show = $event; })("close", function RecipeModalComponent_Template_ng_miam_modal_close_0_listener() { return ctx.hide(); })("cancel", function RecipeModalComponent_Template_ng_miam_modal_cancel_0_listener() { return ctx.removeRecipe(); })("confirm", function RecipeModalComponent_Template_ng_miam_modal_confirm_0_listener() { return ctx.hide(); });
|
|
15803
16001
|
ɵɵtemplate(1, RecipeModalComponent_ng_miam_recipe_details_1_Template, 2, 2, "ng-miam-recipe-details", 1);
|
|
15804
16002
|
ɵɵtemplate(2, RecipeModalComponent_div_2_Template, 2, 1, "div", 2);
|
|
15805
16003
|
ɵɵelementEnd();
|
|
15806
16004
|
} if (rf & 2) {
|
|
15807
|
-
ɵɵproperty("isAngularComponent", true)("noHeaderMode", true)("expanded", ctx.show)("noHeaderMode", !ctx.previewMode)("title", ctx.previewMode ? "1 repas ajout\u00E9 \u00E0 votre panier :" : "")("cancelButtonText", ctx.previewMode ? "Retirer le repas" : "")("confirmButtonText", ctx.previewMode ? "Ok, continuer mes courses" : "");
|
|
16005
|
+
ɵɵproperty("isAngularComponent", true)("noHeaderMode", true)("expanded", ctx.show)("noHeaderMode", !ctx.previewMode)("title", ctx.previewMode ? "1 repas ajout\u00E9 \u00E0 votre panier :" : "")("cancelButtonText", ctx.previewMode ? "Retirer le repas" : "")("confirmButtonText", ctx.previewMode ? "Ok, continuer mes courses" : "")("cancelButtonDisabled", !ctx.canCloseModal)("confirmButtonDisabled", !ctx.canCloseModal)("cancelButtonIsLoading", ctx.removeIsLoading);
|
|
15808
16006
|
ɵɵadvance(1);
|
|
15809
16007
|
ɵɵproperty("ngIf", ctx.recipe && !ctx.previewMode);
|
|
15810
16008
|
ɵɵadvance(1);
|
|
15811
16009
|
ɵɵproperty("ngIf", ctx.previewMode);
|
|
15812
|
-
} }, directives: [ModalComponent, NgIf, RecipeDetailsComponent, BasketPreviewBlockComponent], styles: [".miam-wrapper-preview
|
|
16010
|
+
} }, directives: [ModalComponent, NgIf, RecipeDetailsComponent, BasketPreviewBlockComponent], styles: [".miam-wrapper-preview{background-color:#fff;flex:1;overflow-y:auto;padding:20px}@media (max-width:1022px){.miam-wrapper-preview{padding-bottom:80px}}.miam-wrapper-preview::-webkit-scrollbar{cursor:-webkit-grab;height:7px;width:5px}.miam-wrapper-preview::-webkit-scrollbar-track{background:var(--m-color-grey)}.miam-wrapper-preview::-webkit-scrollbar-thumb{background:var(--m-color-primary);border-radius:5px}"], encapsulation: 2, changeDetection: 0 });
|
|
15813
16011
|
/*@__PURE__*/ (function () { ɵsetClassMetadata(RecipeModalComponent, [{
|
|
15814
16012
|
type: Component,
|
|
15815
16013
|
args: [{
|
|
15816
16014
|
selector: 'ng-miam-recipe-modal',
|
|
15817
16015
|
templateUrl: './recipe-modal.component.html',
|
|
15818
16016
|
styleUrls: ['./recipe-modal.component.scss'],
|
|
15819
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
16017
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
16018
|
+
encapsulation: ViewEncapsulation.None
|
|
15820
16019
|
}]
|
|
15821
|
-
}], function () { return [{ type: ChangeDetectorRef }, { type: RecipesService }, { type: PrintService }, { type: ElementRef }, { type: GroceriesListsService }]; },
|
|
16020
|
+
}], function () { return [{ type: ChangeDetectorRef }, { type: RecipesService }, { type: PrintService }, { type: ElementRef }, { type: GroceriesListsService }, { type: BasketsService }]; }, { hasChangesOnClose: [{
|
|
16021
|
+
type: Output
|
|
16022
|
+
}] }); })();
|
|
15822
16023
|
|
|
15823
16024
|
const _c0$A = ["recipeCard"];
|
|
15824
16025
|
function SuggestionCardComponent_ng_miam_recipe_card_0_Template(rf, ctx) { if (rf & 1) {
|