ng-miam 8.2.5 → 8.2.6
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 +81 -63
- 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/event-tracer.component.js +6 -1
- package/esm2015/lib/_components/product-card/product-card.component.js +7 -10
- package/esm2015/lib/_services/package.service.js +3 -2
- package/esm2015/lib/_services/preferences.service.js +11 -3
- package/esm2015/lib/_web-components/basket-preview/basket-preview-block/basket-preview-block.component.js +2 -1
- package/esm2015/lib/_web-components/preferences/preferences.component.js +3 -1
- package/esm2015/lib/_web-components/recipe-catalog/recipe-catalog.component.js +8 -2
- package/esm2015/lib/_web-components/recipe-details/recipe-details.component.js +6 -3
- package/esm2015/lib/_web-components/recipe-modal/recipe-modal.component.js +44 -51
- package/fesm2015/ng-miam.js +76 -60
- package/fesm2015/ng-miam.js.map +1 -1
- package/lib/_components/abstracts/event-tracer.component.d.ts +1 -0
- package/lib/_components/abstracts/event-tracer.component.d.ts.map +1 -1
- package/lib/_components/product-card/product-card.component.d.ts +2 -4
- package/lib/_components/product-card/product-card.component.d.ts.map +1 -1
- package/lib/_services/package.service.d.ts +1 -1
- package/lib/_services/package.service.d.ts.map +1 -1
- package/lib/_services/preferences.service.d.ts +2 -0
- package/lib/_services/preferences.service.d.ts.map +1 -1
- package/lib/_web-components/basket-preview/basket-preview-block/basket-preview-block.component.d.ts.map +1 -1
- package/lib/_web-components/preferences/preferences.component.d.ts.map +1 -1
- package/lib/_web-components/recipe-catalog/recipe-catalog.component.d.ts +1 -0
- package/lib/_web-components/recipe-catalog/recipe-catalog.component.d.ts.map +1 -1
- package/lib/_web-components/recipe-details/recipe-details.component.d.ts.map +1 -1
- package/lib/_web-components/recipe-modal/recipe-modal.component.d.ts +1 -1
- package/lib/_web-components/recipe-modal/recipe-modal.component.d.ts.map +1 -1
- package/package.json +1 -1
package/bundles/ng-miam.umd.js
CHANGED
|
@@ -2784,8 +2784,11 @@
|
|
|
2784
2784
|
_this.register();
|
|
2785
2785
|
return _this;
|
|
2786
2786
|
}
|
|
2787
|
-
PackageService.prototype.categories_for = function (suppliersIds) {
|
|
2787
|
+
PackageService.prototype.categories_for = function (suppliersIds, pageSize, pageNumber) {
|
|
2788
|
+
if (pageSize === void 0) { pageSize = 30; }
|
|
2789
|
+
if (pageNumber === void 0) { pageNumber = 1; }
|
|
2788
2790
|
return this.all({
|
|
2791
|
+
page: { size: pageSize, number: pageNumber },
|
|
2789
2792
|
remotefilter: {
|
|
2790
2793
|
category_for: suppliersIds.join(','),
|
|
2791
2794
|
status: 'validated',
|
|
@@ -3221,14 +3224,16 @@
|
|
|
3221
3224
|
this.tagsToAdd = [];
|
|
3222
3225
|
this.tagsToRemove = [];
|
|
3223
3226
|
this.currentPreferencesNumber = new rxjs.BehaviorSubject(0);
|
|
3227
|
+
this.guests$ = new rxjs.BehaviorSubject(0);
|
|
3228
|
+
this.initGuests();
|
|
3224
3229
|
this.updatePreferencesCount();
|
|
3225
3230
|
}
|
|
3226
3231
|
Object.defineProperty(PreferencesService.prototype, "guests", {
|
|
3227
3232
|
get: function () {
|
|
3228
|
-
return
|
|
3233
|
+
return this.guests$.value;
|
|
3229
3234
|
},
|
|
3230
3235
|
set: function (newNumber) {
|
|
3231
|
-
|
|
3236
|
+
this.guests$.next(newNumber);
|
|
3232
3237
|
},
|
|
3233
3238
|
enumerable: false,
|
|
3234
3239
|
configurable: true
|
|
@@ -3243,6 +3248,9 @@
|
|
|
3243
3248
|
enumerable: false,
|
|
3244
3249
|
configurable: true
|
|
3245
3250
|
});
|
|
3251
|
+
PreferencesService.prototype.initGuests = function () {
|
|
3252
|
+
this.guests$.next(+localStorage.getItem('_miam/preferences/guests') || 4);
|
|
3253
|
+
};
|
|
3246
3254
|
PreferencesService.prototype.tagIsInStorage = function (tag, without) {
|
|
3247
3255
|
var preferences = this.preferencesInStorage;
|
|
3248
3256
|
if (!preferences || !preferences.with || !preferences.without) {
|
|
@@ -3262,7 +3270,9 @@
|
|
|
3262
3270
|
return (this.tagIsInStorage(tag, without) && !this.tagWasAlreadyRemoved(tag)) || this.tagWasAlreadyAdded(tag);
|
|
3263
3271
|
};
|
|
3264
3272
|
PreferencesService.prototype.resetPreferences = function () {
|
|
3273
|
+
localStorage.setItem('_miam/preferences/guests', '4');
|
|
3265
3274
|
localStorage.setItem('_miam/preferences', JSON.stringify({ with: [], without: [] }));
|
|
3275
|
+
this.guests$.next(+localStorage.getItem('_miam/preferences/guests') || 4);
|
|
3266
3276
|
this.resetTagsActions();
|
|
3267
3277
|
};
|
|
3268
3278
|
PreferencesService.prototype.resetTagsActions = function () {
|
|
@@ -3338,6 +3348,7 @@
|
|
|
3338
3348
|
this.tagsToRemove.forEach(function (tag) {
|
|
3339
3349
|
_this.removeTagFromPreferences(tag);
|
|
3340
3350
|
});
|
|
3351
|
+
localStorage.setItem('_miam/preferences/guests', this.guests.toString());
|
|
3341
3352
|
this.updatePreferencesCount();
|
|
3342
3353
|
this.resetTagsActions();
|
|
3343
3354
|
};
|
|
@@ -7762,6 +7773,11 @@
|
|
|
7762
7773
|
}
|
|
7763
7774
|
return this.originTrace.originPath;
|
|
7764
7775
|
};
|
|
7776
|
+
EventTracerComponent.prototype.removeFromOriginPath = function (partToReplace) {
|
|
7777
|
+
if (this.originTrace.originPath.includes(partToReplace)) {
|
|
7778
|
+
this.originTrace.originPath = this.originTrace.originPath.replace(partToReplace, '');
|
|
7779
|
+
}
|
|
7780
|
+
};
|
|
7765
7781
|
EventTracerComponent.prototype.sendEvent = function (eventType) {
|
|
7766
7782
|
this.analyticsService.sendEventWhenReady(eventType, this.path(), this.props());
|
|
7767
7783
|
};
|
|
@@ -12923,7 +12939,7 @@
|
|
|
12923
12939
|
if (rf & 2) {
|
|
12924
12940
|
var ctx_r4 = i0__namespace.ɵɵnextContext(2);
|
|
12925
12941
|
i0__namespace.ɵɵadvance(5);
|
|
12926
|
-
i0__namespace.ɵɵtextInterpolate(ctx_r4.
|
|
12942
|
+
i0__namespace.ɵɵtextInterpolate(ctx_r4.isInXRecipes());
|
|
12927
12943
|
}
|
|
12928
12944
|
}
|
|
12929
12945
|
var _c16 = function (a0, a1) { return { "added": a0, "disabled": a1 }; };
|
|
@@ -12974,24 +12990,22 @@
|
|
|
12974
12990
|
i0__namespace.ɵɵadvance(1);
|
|
12975
12991
|
i0__namespace.ɵɵproperty("ngIf", ctx_r0.product.basketEntry.status === "initial" || ctx_r0.product.basketEntry.status === "active")("ngIfElse", _r2);
|
|
12976
12992
|
i0__namespace.ɵɵadvance(3);
|
|
12977
|
-
i0__namespace.ɵɵproperty("ngIf", ctx_r0.
|
|
12993
|
+
i0__namespace.ɵɵproperty("ngIf", ctx_r0.isInXRecipes() > 1 && ctx_r0.product.basketEntry.status === "active");
|
|
12978
12994
|
}
|
|
12979
12995
|
}
|
|
12980
12996
|
var ProductCardComponent = /** @class */ (function (_super) {
|
|
12981
12997
|
__extends(ProductCardComponent, _super);
|
|
12982
|
-
function ProductCardComponent(cdr, basketsService, recipeDetailsService, recipesService, analyticsService,
|
|
12998
|
+
function ProductCardComponent(cdr, basketsService, recipeDetailsService, recipesService, analyticsService, ignoredBasketsService, basketActionsService, elementRef) {
|
|
12983
12999
|
var _this = _super.call(this, analyticsService) || this;
|
|
12984
13000
|
_this.cdr = cdr;
|
|
12985
13001
|
_this.basketsService = basketsService;
|
|
12986
13002
|
_this.recipeDetailsService = recipeDetailsService;
|
|
12987
13003
|
_this.recipesService = recipesService;
|
|
12988
13004
|
_this.analyticsService = analyticsService;
|
|
12989
|
-
_this.itemsService = itemsService;
|
|
12990
13005
|
_this.ignoredBasketsService = ignoredBasketsService;
|
|
12991
13006
|
_this.basketActionsService = basketActionsService;
|
|
12992
13007
|
_this.elementRef = elementRef;
|
|
12993
13008
|
_this.subscriptions = [];
|
|
12994
|
-
_this.recipesIncludingIngredient = 0;
|
|
12995
13009
|
_this.loading = false;
|
|
12996
13010
|
_this.loadingAddToBasket = false;
|
|
12997
13011
|
_this.counterMinusLoading = false;
|
|
@@ -13006,7 +13020,6 @@
|
|
|
13006
13020
|
this.subscriptions.push(this.recipeDetailsService.productsByCategory$.subscribe(function () { return _this.isProductSponsored(); }), this.executeActionFromStorage(), this.loadOnRecipesActions(), this.loadOnIngredientsRemoval(), this.updateIngredientQuantityOnRecipeChange());
|
|
13007
13021
|
};
|
|
13008
13022
|
ProductCardComponent.prototype.ngOnChanges = function (changes) {
|
|
13009
|
-
this.recipesIncludingIngredient = this.isInXRecipes();
|
|
13010
13023
|
this.loadingAddToBasket = false;
|
|
13011
13024
|
if (changes.ingredient) {
|
|
13012
13025
|
this.modifiedIngQty = +this.product.ingredient.quantity;
|
|
@@ -13126,7 +13139,7 @@
|
|
|
13126
13139
|
};
|
|
13127
13140
|
return ProductCardComponent;
|
|
13128
13141
|
}(EventTracerComponent));
|
|
13129
|
-
ProductCardComponent.ɵfac = function ProductCardComponent_Factory(t) { return new (t || ProductCardComponent)(i0__namespace.ɵɵdirectiveInject(i0__namespace.ChangeDetectorRef), i0__namespace.ɵɵdirectiveInject(BasketsService), i0__namespace.ɵɵdirectiveInject(RecipeDetailsService), i0__namespace.ɵɵdirectiveInject(RecipesService), i0__namespace.ɵɵdirectiveInject(AnalyticsService), i0__namespace.ɵɵdirectiveInject(
|
|
13142
|
+
ProductCardComponent.ɵfac = function ProductCardComponent_Factory(t) { return new (t || ProductCardComponent)(i0__namespace.ɵɵdirectiveInject(i0__namespace.ChangeDetectorRef), i0__namespace.ɵɵdirectiveInject(BasketsService), i0__namespace.ɵɵdirectiveInject(RecipeDetailsService), i0__namespace.ɵɵdirectiveInject(RecipesService), i0__namespace.ɵɵdirectiveInject(AnalyticsService), i0__namespace.ɵɵdirectiveInject(IgnoredIngredientsService), i0__namespace.ɵɵdirectiveInject(BasketActionsService), i0__namespace.ɵɵdirectiveInject(i0__namespace.ElementRef)); };
|
|
13130
13143
|
ProductCardComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: ProductCardComponent, selectors: [["ng-miam-product-card"]], inputs: { product: "product" }, features: [i0__namespace.ɵɵInheritDefinitionFeature, i0__namespace.ɵɵNgOnChangesFeature], decls: 1, vars: 1, consts: function () {
|
|
13131
13144
|
var i18n_0;
|
|
13132
13145
|
if (typeof ngI18nClosureMode !== "undefined" && ngI18nClosureMode) {
|
|
@@ -13211,7 +13224,7 @@
|
|
|
13211
13224
|
encapsulation: i0.ViewEncapsulation.None,
|
|
13212
13225
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
13213
13226
|
}]
|
|
13214
|
-
}], function () { return [{ type: i0__namespace.ChangeDetectorRef }, { type: BasketsService }, { type: RecipeDetailsService }, { type: RecipesService }, { type: AnalyticsService }, { type:
|
|
13227
|
+
}], function () { return [{ type: i0__namespace.ChangeDetectorRef }, { type: BasketsService }, { type: RecipeDetailsService }, { type: RecipesService }, { type: AnalyticsService }, { type: IgnoredIngredientsService }, { type: BasketActionsService }, { type: i0__namespace.ElementRef }]; }, { product: [{
|
|
13215
13228
|
type: i0.Input
|
|
13216
13229
|
}] });
|
|
13217
13230
|
})();
|
|
@@ -15713,6 +15726,7 @@
|
|
|
15713
15726
|
this.loading.next(true);
|
|
15714
15727
|
}
|
|
15715
15728
|
this.pageview();
|
|
15729
|
+
this.removeFromOriginPath('/basket-preview/detail');
|
|
15716
15730
|
};
|
|
15717
15731
|
BasketPreviewBlockComponent.prototype.ngAfterViewInit = function () {
|
|
15718
15732
|
var _this = this;
|
|
@@ -21767,6 +21781,8 @@
|
|
|
21767
21781
|
configurable: true
|
|
21768
21782
|
});
|
|
21769
21783
|
PreferencesComponent.prototype.ngOnInit = function () {
|
|
21784
|
+
var _this = this;
|
|
21785
|
+
this.subscriptions.push(this.preferencesService.guests$.subscribe(function () { return _this.cdr.detectChanges(); }));
|
|
21770
21786
|
this.fetchTags();
|
|
21771
21787
|
};
|
|
21772
21788
|
PreferencesComponent.prototype.ngAfterViewInit = function () {
|
|
@@ -21855,6 +21871,7 @@
|
|
|
21855
21871
|
this.ingredients.splice(this.ingredients.findIndex(function (i) { return i.tag.id === tag.tag.id; }), 1);
|
|
21856
21872
|
}
|
|
21857
21873
|
}
|
|
21874
|
+
this.cdr.detectChanges();
|
|
21858
21875
|
};
|
|
21859
21876
|
PreferencesComponent.prototype.updateAndBack = function () {
|
|
21860
21877
|
this.preferencesService.updatePreferences();
|
|
@@ -24221,8 +24238,12 @@
|
|
|
24221
24238
|
})).subscribe());
|
|
24222
24239
|
}
|
|
24223
24240
|
};
|
|
24241
|
+
RecipeCatalogComponent.prototype.deepCloneAndResetValues = function (filters) {
|
|
24242
|
+
return filters.map(function (filter) { return (Object.assign(Object.assign({}, filter), { value: false })); });
|
|
24243
|
+
};
|
|
24224
24244
|
// Used on load to build the filters attribute, and on click on the link to reset the filters
|
|
24225
24245
|
RecipeCatalogComponent.prototype.initFilters = function () {
|
|
24246
|
+
var _this = this;
|
|
24226
24247
|
this.filters = new RecipeFilters({
|
|
24227
24248
|
difficulty: this.recipesService.difficultyLevels.map(function (f) { return ({ name: f.value.toString(), text: f.label, value: false }); }),
|
|
24228
24249
|
cost: [
|
|
@@ -24239,7 +24260,9 @@
|
|
|
24239
24260
|
]
|
|
24240
24261
|
});
|
|
24241
24262
|
if (this.customFilters) {
|
|
24242
|
-
Object.
|
|
24263
|
+
Object.keys(this.customFilters).forEach(function (key) {
|
|
24264
|
+
_this.filters[key] = _this.deepCloneAndResetValues(_this.customFilters[key]);
|
|
24265
|
+
});
|
|
24243
24266
|
}
|
|
24244
24267
|
if (this.catalogToolbar) {
|
|
24245
24268
|
this.catalogToolbar.resetSearchString();
|
|
@@ -24384,6 +24407,7 @@
|
|
|
24384
24407
|
}
|
|
24385
24408
|
};
|
|
24386
24409
|
RecipeCatalogComponent.prototype.reloadPackages = function () {
|
|
24410
|
+
this.guests = +localStorage.getItem('_miam/preferences/guests');
|
|
24387
24411
|
this.subscriptions.push(this.loadPackages().subscribe());
|
|
24388
24412
|
};
|
|
24389
24413
|
RecipeCatalogComponent.prototype.isSearchPage = function () {
|
|
@@ -26122,14 +26146,17 @@
|
|
|
26122
26146
|
};
|
|
26123
26147
|
RecipeDetailsComponent.prototype.onClose = function () {
|
|
26124
26148
|
this.recipeDetailsService.displayEventWasSent = false;
|
|
26149
|
+
this.removeFromOriginPath('/detail/basket-preview');
|
|
26125
26150
|
var originPath = this.eventTrace().originPath;
|
|
26126
26151
|
this.closeDetails.emit();
|
|
26127
|
-
this.recipesService.hide();
|
|
26128
26152
|
this.cdr.detectChanges();
|
|
26129
26153
|
this.activeTabIndex = 0;
|
|
26130
|
-
if (originPath
|
|
26154
|
+
if (originPath.includes('/basket-preview/detail')) {
|
|
26131
26155
|
this.recipesService.openBasket(this.eventTrace());
|
|
26132
26156
|
}
|
|
26157
|
+
else if (originPath !== '/miam/recipes/basket-preview') {
|
|
26158
|
+
this.recipesService.hide();
|
|
26159
|
+
}
|
|
26133
26160
|
};
|
|
26134
26161
|
RecipeDetailsComponent.prototype.print = function () {
|
|
26135
26162
|
this.sendEvent(this.analyticsService.EVENT_RECIPE_PRINT);
|
|
@@ -27198,56 +27225,33 @@
|
|
|
27198
27225
|
}], function () { return []; }, null);
|
|
27199
27226
|
})();
|
|
27200
27227
|
|
|
27201
|
-
function
|
|
27228
|
+
function RecipeModalComponent_ng_miam_store_locator_link_3_Template(rf, ctx) {
|
|
27202
27229
|
if (rf & 1) {
|
|
27203
|
-
i0__namespace.ɵɵelement(0, "ng-miam-store-locator-link",
|
|
27230
|
+
i0__namespace.ɵɵelement(0, "ng-miam-store-locator-link", 4);
|
|
27204
27231
|
}
|
|
27205
27232
|
}
|
|
27206
|
-
function
|
|
27233
|
+
function RecipeModalComponent_div_4_Template(rf, ctx) {
|
|
27207
27234
|
if (rf & 1) {
|
|
27208
|
-
|
|
27209
|
-
i0__namespace.ɵɵ
|
|
27210
|
-
i0__namespace.ɵɵlistener("displayChange", function RecipeModalComponent_ng_miam_modal_0_Template_ng_miam_modal_displayChange_0_listener($event) { i0__namespace.ɵɵrestoreView(_r4_1); var ctx_r3 = i0__namespace.ɵɵnextContext(); return ctx_r3.show = $event; })("close", function RecipeModalComponent_ng_miam_modal_0_Template_ng_miam_modal_close_0_listener() { i0__namespace.ɵɵrestoreView(_r4_1); var ctx_r5 = i0__namespace.ɵɵnextContext(); return ctx_r5.hide(); })("cancel", function RecipeModalComponent_ng_miam_modal_0_Template_ng_miam_modal_cancel_0_listener() { i0__namespace.ɵɵrestoreView(_r4_1); var ctx_r6 = i0__namespace.ɵɵnextContext(); return ctx_r6.removeRecipe(); })("confirm", function RecipeModalComponent_ng_miam_modal_0_Template_ng_miam_modal_confirm_0_listener() { i0__namespace.ɵɵrestoreView(_r4_1); var ctx_r7 = i0__namespace.ɵɵnextContext(); return ctx_r7.hide(); });
|
|
27211
|
-
i0__namespace.ɵɵtemplate(1, RecipeModalComponent_ng_miam_modal_0_ng_miam_store_locator_link_1_Template, 1, 0, "ng-miam-store-locator-link", 3);
|
|
27212
|
-
i0__namespace.ɵɵelementStart(2, "div", 4);
|
|
27213
|
-
i0__namespace.ɵɵelement(3, "ng-miam-basket-preview-block", 5);
|
|
27214
|
-
i0__namespace.ɵɵelementEnd();
|
|
27235
|
+
i0__namespace.ɵɵelementStart(0, "div", 5);
|
|
27236
|
+
i0__namespace.ɵɵelement(1, "ng-miam-basket-preview-block", 6);
|
|
27215
27237
|
i0__namespace.ɵɵelementEnd();
|
|
27216
27238
|
}
|
|
27217
27239
|
if (rf & 2) {
|
|
27218
|
-
var
|
|
27219
|
-
i0__namespace.ɵɵproperty("display", ctx_r0.show)("noHeaderMode", false)("confirmButtonDisabled", !ctx_r0.canCloseModal)("cancelButtonIsLoading", ctx_r0.removeIsLoading);
|
|
27240
|
+
var ctx_r1 = i0__namespace.ɵɵnextContext();
|
|
27220
27241
|
i0__namespace.ɵɵadvance(1);
|
|
27221
|
-
i0__namespace.ɵɵproperty("
|
|
27222
|
-
i0__namespace.ɵɵadvance(2);
|
|
27223
|
-
i0__namespace.ɵɵproperty("recipeId", ctx_r0.recipe == null ? null : ctx_r0.recipe.id)("displayItemsUnitaryPrice", true)("originTrace", ctx_r0.eventTrace);
|
|
27242
|
+
i0__namespace.ɵɵproperty("recipeId", ctx_r1.recipe == null ? null : ctx_r1.recipe.id)("displayItemsUnitaryPrice", true)("originTrace", ctx_r1.eventTrace);
|
|
27224
27243
|
}
|
|
27225
27244
|
}
|
|
27226
|
-
function
|
|
27245
|
+
function RecipeModalComponent_ng_miam_recipe_details_6_Template(rf, ctx) {
|
|
27227
27246
|
if (rf & 1) {
|
|
27228
|
-
var
|
|
27229
|
-
i0__namespace.ɵɵelementStart(0, "ng-miam-recipe-details",
|
|
27230
|
-
i0__namespace.ɵɵlistener("recipeAdded", function
|
|
27231
|
-
i0__namespace.ɵɵelementEnd();
|
|
27232
|
-
}
|
|
27233
|
-
if (rf & 2) {
|
|
27234
|
-
var ctx_r8 = i0__namespace.ɵɵnextContext(2);
|
|
27235
|
-
i0__namespace.ɵɵproperty("recipeId", ctx_r8.recipe.id)("guestNumber", ctx_r8.recipe.modifiedGuests)("previewAllowed", ctx_r8.previewAllowed)("originTrace", ctx_r8.eventTrace)("stepsOnLeftSide", ctx_r8.detailsStepsOnLeftSide)("moreRecipesImageURL", ctx_r8.detailsMoreRecipesImageURL)("pricingGuestsText", ctx_r8.detailsPricingGuestsText)("displayGuests", ctx_r8.displayGuestsInDetails)("helpButtonAllowed", ctx_r8.helpButtonAllowedInDetails);
|
|
27236
|
-
}
|
|
27237
|
-
}
|
|
27238
|
-
function RecipeModalComponent_ng_miam_modal_2_Template(rf, ctx) {
|
|
27239
|
-
if (rf & 1) {
|
|
27240
|
-
var _r15_1 = i0__namespace.ɵɵgetCurrentView();
|
|
27241
|
-
i0__namespace.ɵɵelementStart(0, "ng-miam-modal", 7);
|
|
27242
|
-
i0__namespace.ɵɵlistener("displayChange", function RecipeModalComponent_ng_miam_modal_2_Template_ng_miam_modal_displayChange_0_listener($event) { i0__namespace.ɵɵrestoreView(_r15_1); var ctx_r14 = i0__namespace.ɵɵnextContext(); return ctx_r14.show = $event; })("close", function RecipeModalComponent_ng_miam_modal_2_Template_ng_miam_modal_close_0_listener() { i0__namespace.ɵɵrestoreView(_r15_1); var ctx_r16 = i0__namespace.ɵɵnextContext(); return ctx_r16.hide(); })("cancel", function RecipeModalComponent_ng_miam_modal_2_Template_ng_miam_modal_cancel_0_listener() { i0__namespace.ɵɵrestoreView(_r15_1); var ctx_r17 = i0__namespace.ɵɵnextContext(); return ctx_r17.removeRecipe(); })("confirm", function RecipeModalComponent_ng_miam_modal_2_Template_ng_miam_modal_confirm_0_listener() { i0__namespace.ɵɵrestoreView(_r15_1); var ctx_r18 = i0__namespace.ɵɵnextContext(); return ctx_r18.hide(); });
|
|
27243
|
-
i0__namespace.ɵɵtemplate(1, RecipeModalComponent_ng_miam_modal_2_ng_miam_recipe_details_1_Template, 2, 9, "ng-miam-recipe-details", 8);
|
|
27247
|
+
var _r5_1 = i0__namespace.ɵɵgetCurrentView();
|
|
27248
|
+
i0__namespace.ɵɵelementStart(0, "ng-miam-recipe-details", 7, 8);
|
|
27249
|
+
i0__namespace.ɵɵlistener("recipeAdded", function RecipeModalComponent_ng_miam_recipe_details_6_Template_ng_miam_recipe_details_recipeAdded_0_listener() { i0__namespace.ɵɵrestoreView(_r5_1); var ctx_r4 = i0__namespace.ɵɵnextContext(); return ctx_r4.togglePreviewMode(); })("recipeError", function RecipeModalComponent_ng_miam_recipe_details_6_Template_ng_miam_recipe_details_recipeError_0_listener() { i0__namespace.ɵɵrestoreView(_r5_1); var ctx_r6 = i0__namespace.ɵɵnextContext(); return ctx_r6.hide(true); })("closeDetails", function RecipeModalComponent_ng_miam_recipe_details_6_Template_ng_miam_recipe_details_closeDetails_0_listener() { i0__namespace.ɵɵrestoreView(_r5_1); var ctx_r7 = i0__namespace.ɵɵnextContext(); return ctx_r7.hide(true); });
|
|
27244
27250
|
i0__namespace.ɵɵelementEnd();
|
|
27245
27251
|
}
|
|
27246
27252
|
if (rf & 2) {
|
|
27247
|
-
var
|
|
27248
|
-
i0__namespace.ɵɵproperty("
|
|
27249
|
-
i0__namespace.ɵɵadvance(1);
|
|
27250
|
-
i0__namespace.ɵɵproperty("ngIf", ctx_r1.recipe && true);
|
|
27253
|
+
var ctx_r2 = i0__namespace.ɵɵnextContext();
|
|
27254
|
+
i0__namespace.ɵɵproperty("recipeId", ctx_r2.recipe.id)("guestNumber", ctx_r2.recipe.modifiedGuests)("previewAllowed", ctx_r2.previewAllowed)("originTrace", ctx_r2.eventTrace)("stepsOnLeftSide", ctx_r2.detailsStepsOnLeftSide)("moreRecipesImageURL", ctx_r2.detailsMoreRecipesImageURL)("pricingGuestsText", ctx_r2.detailsPricingGuestsText)("displayGuests", ctx_r2.displayGuestsInDetails)("helpButtonAllowed", ctx_r2.helpButtonAllowedInDetails);
|
|
27251
27255
|
}
|
|
27252
27256
|
}
|
|
27253
27257
|
var RecipeModalComponent = /** @class */ (function () {
|
|
@@ -27294,7 +27298,7 @@
|
|
|
27294
27298
|
var _a;
|
|
27295
27299
|
_this.registerTrace(result === null || result === void 0 ? void 0 : result.eventTrace);
|
|
27296
27300
|
if (!(result === null || result === void 0 ? void 0 : result.recipe)) {
|
|
27297
|
-
if (result === null || result === void 0 ? void 0 : result.force) {
|
|
27301
|
+
if ((result === null || result === void 0 ? void 0 : result.force) && Object.keys(result === null || result === void 0 ? void 0 : result.eventTrace.props).length === 0) {
|
|
27298
27302
|
_this.previewMode.next(result.previewMode);
|
|
27299
27303
|
_this.previewAllowed = result.previewAllowed;
|
|
27300
27304
|
_this.show = true;
|
|
@@ -27332,13 +27336,16 @@
|
|
|
27332
27336
|
this.eventTrace = { originPath: '', props: {} };
|
|
27333
27337
|
}
|
|
27334
27338
|
};
|
|
27335
|
-
RecipeModalComponent.prototype.hide = function () {
|
|
27339
|
+
RecipeModalComponent.prototype.hide = function (isDetail) {
|
|
27340
|
+
if (isDetail === void 0) { isDetail = false; }
|
|
27336
27341
|
if (this.canCloseModal) {
|
|
27337
27342
|
this.recipeDetailsService.displayEventWasSent = false;
|
|
27338
|
-
this.show = false;
|
|
27339
27343
|
this.recipe = null; // trigger again a change on recipe if we re-open the view
|
|
27340
|
-
this.previewMode.next(
|
|
27341
|
-
|
|
27344
|
+
this.previewMode.next(isDetail);
|
|
27345
|
+
if (!isDetail) {
|
|
27346
|
+
this.show = false;
|
|
27347
|
+
this.recipesService.hide();
|
|
27348
|
+
}
|
|
27342
27349
|
// Put back if/when printing is reimplemented
|
|
27343
27350
|
// this.printService.dismissPrinting();
|
|
27344
27351
|
this.hasChangesOnClose.emit(this.basketChangedSinceOpened);
|
|
@@ -27385,7 +27392,7 @@
|
|
|
27385
27392
|
return RecipeModalComponent;
|
|
27386
27393
|
}());
|
|
27387
27394
|
RecipeModalComponent.ɵfac = function RecipeModalComponent_Factory(t) { return new (t || RecipeModalComponent)(i0__namespace.ɵɵdirectiveInject(i0__namespace.ChangeDetectorRef), i0__namespace.ɵɵdirectiveInject(RecipesService), i0__namespace.ɵɵdirectiveInject(ContextService), i0__namespace.ɵɵdirectiveInject(PrintService), i0__namespace.ɵɵdirectiveInject(i0__namespace.ElementRef), i0__namespace.ɵɵdirectiveInject(BasketsService), i0__namespace.ɵɵdirectiveInject(RecipeDetailsService), i0__namespace.ɵɵdirectiveInject(BasketTransferService)); };
|
|
27388
|
-
RecipeModalComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: RecipeModalComponent, selectors: [["ng-miam-recipe-modal"]], inputs: { detailsStepsOnLeftSide: "detailsStepsOnLeftSide", detailsMoreRecipesImageURL: "detailsMoreRecipesImageURL", detailsPricingGuestsText: "detailsPricingGuestsText" }, outputs: { hasChangesOnClose: "hasChangesOnClose" }, decls:
|
|
27395
|
+
RecipeModalComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: RecipeModalComponent, selectors: [["ng-miam-recipe-modal"]], inputs: { detailsStepsOnLeftSide: "detailsStepsOnLeftSide", detailsMoreRecipesImageURL: "detailsMoreRecipesImageURL", detailsPricingGuestsText: "detailsPricingGuestsText" }, outputs: { hasChangesOnClose: "hasChangesOnClose" }, decls: 8, vars: 17, consts: function () {
|
|
27389
27396
|
var i18n_0;
|
|
27390
27397
|
if (typeof ngI18nClosureMode !== "undefined" && ngI18nClosureMode) {
|
|
27391
27398
|
var MSG_EXTERNAL_171150506213829263$$LIB__WEB_COMPONENTS_RECIPE_MODAL_RECIPE_MODAL_COMPONENT_TS_1 = goog.getMsg("Mes repas");
|
|
@@ -27394,20 +27401,31 @@
|
|
|
27394
27401
|
else {
|
|
27395
27402
|
i18n_0 = $localize(templateObject_1 || (templateObject_1 = __makeTemplateObject([":\u241Fd0309cdf7a6522949c4f145db5e71f70c9d9d66c\u241F171150506213829263:Mes repas"], [":\u241Fd0309cdf7a6522949c4f145db5e71f70c9d9d66c\u241F171150506213829263:Mes repas"])));
|
|
27396
27403
|
}
|
|
27397
|
-
return [["title", i18n_0, "modalStyle", "right",
|
|
27404
|
+
return [["title", i18n_0, "modalStyle", "right", 3, "display", "noHeaderMode", "confirmButtonDisabled", "cancelButtonIsLoading", "displayChange", "close", "cancel", "confirm"], ["header", "", 4, "ngIf"], ["class", "miam-wrapper-preview", 4, "ngIf"], [3, "recipeId", "guestNumber", "previewAllowed", "originTrace", "stepsOnLeftSide", "moreRecipesImageURL", "pricingGuestsText", "displayGuests", "helpButtonAllowed", "recipeAdded", "recipeError", "closeDetails", 4, "ngIf"], ["header", ""], [1, "miam-wrapper-preview"], [3, "recipeId", "displayItemsUnitaryPrice", "originTrace"], [3, "recipeId", "guestNumber", "previewAllowed", "originTrace", "stepsOnLeftSide", "moreRecipesImageURL", "pricingGuestsText", "displayGuests", "helpButtonAllowed", "recipeAdded", "recipeError", "closeDetails"], ["details", ""]];
|
|
27398
27405
|
}, template: function RecipeModalComponent_Template(rf, ctx) {
|
|
27399
27406
|
if (rf & 1) {
|
|
27400
|
-
i0__namespace.ɵɵ
|
|
27407
|
+
i0__namespace.ɵɵelementStart(0, "ng-miam-modal", 0);
|
|
27408
|
+
i0__namespace.ɵɵlistener("displayChange", function RecipeModalComponent_Template_ng_miam_modal_displayChange_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(); });
|
|
27401
27409
|
i0__namespace.ɵɵpipe(1, "async");
|
|
27402
|
-
i0__namespace.ɵɵ
|
|
27403
|
-
i0__namespace.ɵɵ
|
|
27410
|
+
i0__namespace.ɵɵpipe(2, "async");
|
|
27411
|
+
i0__namespace.ɵɵtemplate(3, RecipeModalComponent_ng_miam_store_locator_link_3_Template, 1, 0, "ng-miam-store-locator-link", 1);
|
|
27412
|
+
i0__namespace.ɵɵtemplate(4, RecipeModalComponent_div_4_Template, 2, 3, "div", 2);
|
|
27413
|
+
i0__namespace.ɵɵpipe(5, "async");
|
|
27414
|
+
i0__namespace.ɵɵtemplate(6, RecipeModalComponent_ng_miam_recipe_details_6_Template, 2, 9, "ng-miam-recipe-details", 3);
|
|
27415
|
+
i0__namespace.ɵɵpipe(7, "async");
|
|
27416
|
+
i0__namespace.ɵɵelementEnd();
|
|
27404
27417
|
}
|
|
27405
27418
|
if (rf & 2) {
|
|
27406
|
-
i0__namespace.ɵɵ
|
|
27419
|
+
i0__namespace.ɵɵclassProp("miam-recipe-modal__basket-preview-modal", i0__namespace.ɵɵpipeBind1(1, 9, ctx.previewMode));
|
|
27420
|
+
i0__namespace.ɵɵproperty("display", ctx.show)("noHeaderMode", !i0__namespace.ɵɵpipeBind1(2, 11, ctx.previewMode))("confirmButtonDisabled", !ctx.canCloseModal)("cancelButtonIsLoading", ctx.removeIsLoading);
|
|
27421
|
+
i0__namespace.ɵɵadvance(3);
|
|
27422
|
+
i0__namespace.ɵɵproperty("ngIf", ctx.contextService.noSupplier);
|
|
27423
|
+
i0__namespace.ɵɵadvance(1);
|
|
27424
|
+
i0__namespace.ɵɵproperty("ngIf", i0__namespace.ɵɵpipeBind1(5, 13, ctx.previewMode));
|
|
27407
27425
|
i0__namespace.ɵɵadvance(2);
|
|
27408
|
-
i0__namespace.ɵɵproperty("ngIf", !i0__namespace.ɵɵpipeBind1(
|
|
27426
|
+
i0__namespace.ɵɵproperty("ngIf", !i0__namespace.ɵɵpipeBind1(7, 15, ctx.previewMode) && ctx.recipe);
|
|
27409
27427
|
}
|
|
27410
|
-
}, directives: [i2__namespace$1.NgIf,
|
|
27428
|
+
}, directives: [ModalComponent, i2__namespace$1.NgIf, StoreLocatorLinkComponent, BasketPreviewBlockComponent, RecipeDetailsComponent], pipes: [i2__namespace$1.AsyncPipe], styles: [".miam-modal.without-header .miam-modal__header .miam-modal__close-icon{display:none}.miam-recipe-modal__basket-preview-modal .miam-modal__container.right .miam-modal{width:480px}@media (max-width:600px){.miam-recipe-modal__basket-preview-modal .miam-modal__container.right .miam-modal{width:100%}}.miam-recipe-modal__basket-preview-modal .miam-modal__container.right .miam-modal .miam-modal__content-container .miam-modal__content{padding:16px}@media (min-width:1023px) and (max-height:1000px){ng-miam-recipe-modal .miam-modal__container.left .miam-modal,ng-miam-recipe-modal .miam-modal__container.right .miam-modal,webc-miam-recipe-modal .miam-modal__container.left .miam-modal,webc-miam-recipe-modal .miam-modal__container.right .miam-modal{width:650px}}@media (min-width:1023px) and (max-height:800px){ng-miam-recipe-modal .miam-modal__container.left .miam-modal,ng-miam-recipe-modal .miam-modal__container.right .miam-modal,webc-miam-recipe-modal .miam-modal__container.left .miam-modal,webc-miam-recipe-modal .miam-modal__container.right .miam-modal{width:450px}}"], encapsulation: 2, changeDetection: 0 });
|
|
27411
27429
|
(function () {
|
|
27412
27430
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(RecipeModalComponent, [{
|
|
27413
27431
|
type: i0.Component,
|