ng-miam 8.8.5 → 8.8.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 +90 -38
- 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/counter-input/counter-input.component.js +8 -2
- package/esm2015/lib/_components/product-card/product-card.component.js +3 -5
- package/esm2015/lib/_services/basket-transfer.service.js +1 -5
- package/esm2015/lib/_services/baskets.service.js +18 -2
- package/esm2015/lib/_services/interceptor.service.js +2 -2
- package/esm2015/lib/_services/recipes.service.js +16 -4
- package/esm2015/lib/_services/store-locator.service.js +7 -2
- package/esm2015/lib/_web-components/recipe-cards/recipe-card-cta/recipe-card-cta.component.js +2 -5
- package/esm2015/lib/_web-components/recipe-catalog/recipe-catalog.component.js +4 -4
- package/esm2015/lib/_web-components/recipe-details/recipe-details.component.js +2 -2
- package/esm2015/lib/_web-components/recipe-details/store-locator-link/store-locator-link.component.js +28 -8
- package/esm2015/lib/_web-components/recipe-pricing/recipe-pricing.component.js +5 -7
- package/esm2015/lib/_web-components/warning-store-locator/warning-store-locator.component.js +4 -2
- package/fesm2015/ng-miam.js +284 -234
- package/fesm2015/ng-miam.js.map +1 -1
- package/lib/_components/counter-input/counter-input.component.d.ts +2 -2
- package/lib/_components/counter-input/counter-input.component.d.ts.map +1 -1
- package/lib/_components/product-card/product-card.component.d.ts +2 -2
- package/lib/_components/product-card/product-card.component.d.ts.map +1 -1
- package/lib/_services/basket-transfer.service.d.ts.map +1 -1
- package/lib/_services/baskets.service.d.ts +1 -0
- package/lib/_services/baskets.service.d.ts.map +1 -1
- package/lib/_services/recipes.service.d.ts +4 -3
- package/lib/_services/recipes.service.d.ts.map +1 -1
- package/lib/_services/store-locator.service.d.ts +2 -0
- package/lib/_services/store-locator.service.d.ts.map +1 -1
- package/lib/_web-components/recipe-cards/recipe-card-cta/recipe-card-cta.component.d.ts +0 -1
- package/lib/_web-components/recipe-cards/recipe-card-cta/recipe-card-cta.component.d.ts.map +1 -1
- package/lib/_web-components/recipe-catalog/recipe-catalog.component.d.ts +1 -1
- package/lib/_web-components/recipe-catalog/recipe-catalog.component.d.ts.map +1 -1
- package/lib/_web-components/recipe-details/store-locator-link/store-locator-link.component.d.ts +3 -0
- package/lib/_web-components/recipe-details/store-locator-link/store-locator-link.component.d.ts.map +1 -1
- package/lib/_web-components/recipe-pricing/recipe-pricing.component.d.ts +1 -2
- package/lib/_web-components/recipe-pricing/recipe-pricing.component.d.ts.map +1 -1
- package/lib/_web-components/warning-store-locator/warning-store-locator.component.d.ts.map +1 -1
- package/package.json +1 -1
package/bundles/ng-miam.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/common/http'), require('@angular/common/locales/fr'), require('@angular/core'), require('@angular/platform-browser/animations'), require('miam-jsonapi'), require('rxjs'), require('@angular/platform-browser'), require('date-fns/endOfWeek'), require('date-fns/isWithinInterval'), require('date-fns/startOfWeek'), require('date-fns/subDays'), require('rxjs/operators'), require('duration-fns'), require('lodash-es'), require('lodash-es/pullAt'), require('@angular/cdk/layout'), require('@angular/forms'), require('@angular/cdk/drag-drop'), require('@angular/cdk/text-field'), require('@angular/elements'), require('lodash-es/remove'), require('@angular/animations'), require('@angular/youtube-player'), require('lodash-es/groupBy')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('ng-miam', ['exports', '@angular/common', '@angular/common/http', '@angular/common/locales/fr', '@angular/core', '@angular/platform-browser/animations', 'miam-jsonapi', 'rxjs', '@angular/platform-browser', 'date-fns/endOfWeek', 'date-fns/isWithinInterval', 'date-fns/startOfWeek', 'date-fns/subDays', 'rxjs/operators', 'duration-fns', 'lodash-es', 'lodash-es/pullAt', '@angular/cdk/layout', '@angular/forms', '@angular/cdk/drag-drop', '@angular/cdk/text-field', '@angular/elements', 'lodash-es/remove', '@angular/animations', '@angular/youtube-player', 'lodash-es/groupBy'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["ng-miam"] = {}, global.ng.common, global.ng.common.http, global.ng.common.locales.fr, global.ng.core, global.ng.platformBrowser.animations, global.i2$2, global.rxjs, global.ng.platformBrowser, global.endOfWeek, global.isWithinInterval, global.startOfWeek, global.subDays, global.rxjs.operators, global.duration, global.lodashEs, global.pullAt, global.ng.cdk.layout, global.ng.forms, global.ng.cdk.dragDrop, global.ng.cdk.textField, global.ng.elements, global.remove, global.ng.animations, global.ng.youtubePlayer, global.groupBy));
|
|
5
|
-
})(this, (function (exports, i2, i1, localeFr, i0, animations$1, i2$2, rxjs, i2$1, endOfWeek, isWithinInterval, startOfWeek, subDays, operators, duration, lodashEs, pullAt, i6, i3, dragDrop, textField, elements, remove, animations, i9, groupBy) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/common/http'), require('@angular/common/locales/fr'), require('@angular/core'), require('@angular/platform-browser/animations'), require('miam-jsonapi'), require('rxjs'), require('@angular/platform-browser'), require('date-fns/endOfWeek'), require('date-fns/isWithinInterval'), require('date-fns/startOfWeek'), require('date-fns/subDays'), require('rxjs/operators'), require('duration-fns'), require('lodash-es'), require('mealz-shared-analytics'), require('lodash-es/pullAt'), require('@angular/cdk/layout'), require('@angular/forms'), require('@angular/cdk/drag-drop'), require('@angular/cdk/text-field'), require('@angular/elements'), require('lodash-es/remove'), require('@angular/animations'), require('@angular/youtube-player'), require('lodash-es/groupBy')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('ng-miam', ['exports', '@angular/common', '@angular/common/http', '@angular/common/locales/fr', '@angular/core', '@angular/platform-browser/animations', 'miam-jsonapi', 'rxjs', '@angular/platform-browser', 'date-fns/endOfWeek', 'date-fns/isWithinInterval', 'date-fns/startOfWeek', 'date-fns/subDays', 'rxjs/operators', 'duration-fns', 'lodash-es', 'mealz-shared-analytics', 'lodash-es/pullAt', '@angular/cdk/layout', '@angular/forms', '@angular/cdk/drag-drop', '@angular/cdk/text-field', '@angular/elements', 'lodash-es/remove', '@angular/animations', '@angular/youtube-player', 'lodash-es/groupBy'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["ng-miam"] = {}, global.ng.common, global.ng.common.http, global.ng.common.locales.fr, global.ng.core, global.ng.platformBrowser.animations, global.i2$2, global.rxjs, global.ng.platformBrowser, global.endOfWeek, global.isWithinInterval, global.startOfWeek, global.subDays, global.rxjs.operators, global.duration, global.lodashEs, global.mealzSharedAnalytics, global.pullAt, global.ng.cdk.layout, global.ng.forms, global.ng.cdk.dragDrop, global.ng.cdk.textField, global.ng.elements, global.remove, global.ng.animations, global.ng.youtubePlayer, global.groupBy));
|
|
5
|
+
})(this, (function (exports, i2, i1, localeFr, i0, animations$1, i2$2, rxjs, i2$1, endOfWeek, isWithinInterval, startOfWeek, subDays, operators, duration, lodashEs, mealzSharedAnalytics, pullAt, i6, i3, dragDrop, textField, elements, remove, animations, i9, groupBy) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -1214,7 +1214,13 @@
|
|
|
1214
1214
|
_this.lastValue = _this.value;
|
|
1215
1215
|
}));
|
|
1216
1216
|
};
|
|
1217
|
-
CounterInputComponent.prototype.ngOnChanges = function () {
|
|
1217
|
+
CounterInputComponent.prototype.ngOnChanges = function (changes) {
|
|
1218
|
+
var _a;
|
|
1219
|
+
if (!((_a = changes.value) === null || _a === void 0 ? void 0 : _a.isFirstChange())) {
|
|
1220
|
+
if (this.value !== this.valueSubject.value) {
|
|
1221
|
+
this.valueSubject.next(this.value);
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1218
1224
|
this.cdr.detectChanges();
|
|
1219
1225
|
};
|
|
1220
1226
|
CounterInputComponent.prototype.ngOnDestroy = function () {
|
|
@@ -4529,6 +4535,7 @@
|
|
|
4529
4535
|
this.closeModalOnSelected = false;
|
|
4530
4536
|
this.showStoreLocatorWarning = new rxjs.BehaviorSubject(false);
|
|
4531
4537
|
this.showNoSupplierOnboarding = new rxjs.BehaviorSubject(false);
|
|
4538
|
+
this.changePosAfterWarnConfirm = true;
|
|
4532
4539
|
this.storeLocatorOpened$.subscribe(function (opened) {
|
|
4533
4540
|
if (opened && _this.storeLocatorOpenedTimestamp !== 0) {
|
|
4534
4541
|
_this.storeLocatorOpenedTimestamp = Date.now();
|
|
@@ -4546,7 +4553,8 @@
|
|
|
4546
4553
|
this.selectedSupplierName = e.detail.supplierName;
|
|
4547
4554
|
this.storeLocatorEventTrace = eventTrace;
|
|
4548
4555
|
// The following check is supposed to be temporary TODO remove
|
|
4549
|
-
if (
|
|
4556
|
+
if (this.isStoreLocatorWarningNeeded(e.detail.supplierId)) {
|
|
4557
|
+
this.changePosAfterWarnConfirm = true;
|
|
4550
4558
|
// Current device is a mobile device and the chosen supplier has not deactivated deep links
|
|
4551
4559
|
this.showStoreLocatorWarning.next(true);
|
|
4552
4560
|
}
|
|
@@ -4554,6 +4562,9 @@
|
|
|
4554
4562
|
this.changePos();
|
|
4555
4563
|
}
|
|
4556
4564
|
};
|
|
4565
|
+
StoreLocatorService.prototype.isStoreLocatorWarningNeeded = function (supplierId) {
|
|
4566
|
+
return /Mobi|Android|iPhone/i.test(navigator.userAgent) && supplierId === '7';
|
|
4567
|
+
};
|
|
4557
4568
|
StoreLocatorService.prototype.changePos = function () {
|
|
4558
4569
|
var _this = this;
|
|
4559
4570
|
this.subscriptions.push(this.posService.loadPos(this.selectedPosId).pipe(operators.skipWhile(function (pos) { return !pos || pos.id !== _this.selectedPosId; }), operators.switchMap(function (pos) {
|
|
@@ -4823,6 +4834,19 @@
|
|
|
4823
4834
|
return recipes.data;
|
|
4824
4835
|
}));
|
|
4825
4836
|
};
|
|
4837
|
+
RecipesService.prototype.searchRecipeByExtId = function (recipeExtId) {
|
|
4838
|
+
var _this = this;
|
|
4839
|
+
var url = MIAM_API_HOST$2 + "recipes/external/" + recipeExtId;
|
|
4840
|
+
return this.http.get(url).pipe(operators.map(function (response) {
|
|
4841
|
+
var _a;
|
|
4842
|
+
if (((_a = response.data) === null || _a === void 0 ? void 0 : _a.attributes['ext-id']) === recipeExtId) {
|
|
4843
|
+
var recipe = _this.new();
|
|
4844
|
+
recipe.fill(response);
|
|
4845
|
+
return recipe;
|
|
4846
|
+
}
|
|
4847
|
+
return null;
|
|
4848
|
+
}));
|
|
4849
|
+
};
|
|
4826
4850
|
RecipesService.prototype.getPricing = function (recipeId, posId, pricebookKey, serves) {
|
|
4827
4851
|
if (serves === void 0) { serves = null; }
|
|
4828
4852
|
if (!recipeId) {
|
|
@@ -5225,9 +5249,24 @@
|
|
|
5225
5249
|
localStorage.removeItem('_miam/authlessId');
|
|
5226
5250
|
}
|
|
5227
5251
|
_this.currentSubscription = basketObservable.subscribe();
|
|
5252
|
+
_this.checkIfIsAffiliated();
|
|
5228
5253
|
return _this._basket$;
|
|
5229
5254
|
}));
|
|
5230
5255
|
};
|
|
5256
|
+
BasketsService.prototype.checkIfIsAffiliated = function () {
|
|
5257
|
+
var getAffiliatedUrl = environment$1.miamAPI + "/api/v1/baskets/affiliated";
|
|
5258
|
+
this.http.get(getAffiliatedUrl).pipe(operators.take(1)).subscribe(function (response) {
|
|
5259
|
+
var affiliated = response === null || response === void 0 ? void 0 : response.affiliated;
|
|
5260
|
+
if (affiliated) {
|
|
5261
|
+
localStorage.setItem('_miam/affiliated', affiliated);
|
|
5262
|
+
mealzSharedAnalytics.setAffiliate(affiliated);
|
|
5263
|
+
}
|
|
5264
|
+
else {
|
|
5265
|
+
localStorage.removeItem('_miam/affiliated');
|
|
5266
|
+
mealzSharedAnalytics.setAffiliate(null);
|
|
5267
|
+
}
|
|
5268
|
+
});
|
|
5269
|
+
};
|
|
5231
5270
|
BasketsService.prototype.transferAuthlessBasket = function (posId, authlessId) {
|
|
5232
5271
|
var _this = this;
|
|
5233
5272
|
var transferAuthlessBasketUrl = environment$1.miamAPI + "/api/v1/baskets/transfer_authless?point_of_sale_id=" + posId + "&authless_user_id=" + authlessId;
|
|
@@ -5251,6 +5290,7 @@
|
|
|
5251
5290
|
console.debug('[Miam] resetting basket');
|
|
5252
5291
|
this.analyticsService.sendEventWhenReady(this.analyticsService.EVENT_RECIPE_RESET, eventTrace.originPath, eventTrace.props);
|
|
5253
5292
|
localStorage.removeItem('_miam/affiliate');
|
|
5293
|
+
mealzSharedAnalytics.setAffiliate(null);
|
|
5254
5294
|
this.ignoredBasketsService.resetIgnoredIngredients();
|
|
5255
5295
|
return this.posService.waitForPos.pipe(operators.take(1), operators.switchMap(function (pos) { return _this.waitForBasket.pipe(operators.tap(function (basket) { return _this.analyticsService.sendEventsOfResetBasket(basket, eventTrace); }), operators.switchMap(function () { return _this.get("reset?point_of_sale_id=" + pos.id + "&fields[baskets]=" + BASKET_SPARSE_FIELDS.baskets.join(',')).pipe(operators.skipWhile(function (basket) { return basket.is_loading; }), operators.switchMap(function (basket) { return _this.updateLocalBasket(basket); })); })); }));
|
|
5256
5296
|
};
|
|
@@ -5284,7 +5324,6 @@
|
|
|
5284
5324
|
if (!result) {
|
|
5285
5325
|
return rxjs.of(null);
|
|
5286
5326
|
}
|
|
5287
|
-
localStorage.removeItem('_miam/affiliate');
|
|
5288
5327
|
_this.analyticsService.sendEventWhenReady(_this.analyticsService.EVENT_BASKET_CONFIRMED, null, _this.eventProps(basket, totalPrice));
|
|
5289
5328
|
return _this.refreshCurrentBasket();
|
|
5290
5329
|
}), operators.take(1));
|
|
@@ -8165,12 +8204,8 @@
|
|
|
8165
8204
|
this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
|
|
8166
8205
|
};
|
|
8167
8206
|
BasketTransferService.prototype.setSessionData = function (params) {
|
|
8168
|
-
var _a;
|
|
8169
8207
|
sessionStorage.setItem('_miam/transferredBasketToken', params.basketToken);
|
|
8170
8208
|
sessionStorage.setItem('_miam/posOfSaleExtId', params.posExtId);
|
|
8171
|
-
if (((_a = params.affiliate) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
8172
|
-
localStorage.setItem('_miam/affiliate', params.affiliate);
|
|
8173
|
-
}
|
|
8174
8209
|
};
|
|
8175
8210
|
BasketTransferService.prototype.clearTransferSessionData = function () {
|
|
8176
8211
|
sessionStorage.removeItem('_miam/transferredBasketToken');
|
|
@@ -8493,7 +8528,7 @@
|
|
|
8493
8528
|
MiamInterceptor.prototype.setMiamHeaders = function (request) {
|
|
8494
8529
|
var headersToAdd = {
|
|
8495
8530
|
'miam-origin': this.context.origin.value,
|
|
8496
|
-
'miam-front-version': '8.8.
|
|
8531
|
+
'miam-front-version': '8.8.6',
|
|
8497
8532
|
'miam-front-type': 'web',
|
|
8498
8533
|
'miam-api-version': '4.7.0'
|
|
8499
8534
|
};
|
|
@@ -10952,9 +10987,8 @@
|
|
|
10952
10987
|
};
|
|
10953
10988
|
RecipePricingComponent.prototype.initPricing = function () {
|
|
10954
10989
|
var _this = this;
|
|
10955
|
-
this.subscriptions.push(this.initRecipeForExtId().subscribe(function () {
|
|
10956
|
-
|
|
10957
|
-
if (((_a = _this.recipeId) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
10990
|
+
this.subscriptions.push(this.initRecipeForExtId().subscribe(function (result) {
|
|
10991
|
+
if (result) {
|
|
10958
10992
|
_this.subscriptions.push(_this.initPricingFromBasketChanges().subscribe(), _this.initPricingFromGuestsAndViewPort());
|
|
10959
10993
|
}
|
|
10960
10994
|
}));
|
|
@@ -10963,9 +10997,8 @@
|
|
|
10963
10997
|
var _this = this;
|
|
10964
10998
|
var _a, _b;
|
|
10965
10999
|
if (!(((_a = this.recipeId) === null || _a === void 0 ? void 0 : _a.length) > 0) && ((_b = this.recipeExtId) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
10966
|
-
return this.recipesService.
|
|
10967
|
-
|
|
10968
|
-
_this.recipeId = ((_a = response.data[0]) === null || _a === void 0 ? void 0 : _a.attributes['ext-id']) === _this.recipeExtId ? response.data[0].id : null;
|
|
11000
|
+
return this.recipesService.searchRecipeByExtId(this.recipeExtId).pipe(operators.tap(function (response) {
|
|
11001
|
+
_this.recipeId = (response === null || response === void 0 ? void 0 : response.id) || null;
|
|
10969
11002
|
_this.cdr.detectChanges();
|
|
10970
11003
|
}));
|
|
10971
11004
|
}
|
|
@@ -12339,11 +12372,9 @@
|
|
|
12339
12372
|
var _this = this;
|
|
12340
12373
|
this.subscriptions.push(this.recipeDetailsService.productsByCategory$.subscribe(function () { return _this.isProductSponsored(); }), this.executeActionFromStorage(), this.loadOnRecipesActions(), this.loadOnIngredientsRemoval(), this.updateIngredientQuantityOnRecipeChange(), this.scrollBackOnProductReplaced());
|
|
12341
12374
|
};
|
|
12342
|
-
ProductCardComponent.prototype.ngOnChanges = function (
|
|
12375
|
+
ProductCardComponent.prototype.ngOnChanges = function () {
|
|
12343
12376
|
this.loadingAddToBasket = false;
|
|
12344
|
-
|
|
12345
|
-
this.modifiedIngQty = +this.product.ingredient.quantity;
|
|
12346
|
-
}
|
|
12377
|
+
this.modifiedIngQty = +this.product.ingredient.quantity;
|
|
12347
12378
|
this.cdr.detectChanges();
|
|
12348
12379
|
};
|
|
12349
12380
|
ProductCardComponent.prototype.ngOnDestroy = function () {
|
|
@@ -17669,7 +17700,7 @@
|
|
|
17669
17700
|
}));
|
|
17670
17701
|
}
|
|
17671
17702
|
else if (!this.recipe && this.recipeExtId) {
|
|
17672
|
-
this.subscriptions.push(this.searchRecipeByExtId().subscribe(function (result) {
|
|
17703
|
+
this.subscriptions.push(this.recipeService.searchRecipeByExtId(this.recipeExtId).subscribe(function (result) {
|
|
17673
17704
|
_this.recipe = result;
|
|
17674
17705
|
if (!result) {
|
|
17675
17706
|
_this.hidden.emit();
|
|
@@ -17712,10 +17743,6 @@
|
|
|
17712
17743
|
// Until supplier ids are the same as the provider ids we use the origin to determine the provider on which we filter
|
|
17713
17744
|
return this.contextService.origin.pipe(operators.skipWhile(function (origin) { return !origin; }), operators.take(1), operators.switchMap(function (origin) { return _this.recipeService.all({ remotefilter: { recipe_provider_id: origin, search: _this.recipeName } }).pipe(operators.map(function (response) { var _a; return ((_a = response.data[0]) === null || _a === void 0 ? void 0 : _a.attributes.title) === _this.recipeName ? response.data[0] : null; })); }));
|
|
17714
17745
|
};
|
|
17715
|
-
RecipeCardCtaComponent.prototype.searchRecipeByExtId = function () {
|
|
17716
|
-
var _this = this;
|
|
17717
|
-
return this.recipeService.all({ remotefilter: { 'ext-id': this.recipeExtId } }).pipe(operators.map(function (response) { var _a; return ((_a = response.data[0]) === null || _a === void 0 ? void 0 : _a.attributes['ext-id']) === _this.recipeExtId ? response.data[0] : null; }));
|
|
17718
|
-
};
|
|
17719
17746
|
RecipeCardCtaComponent.prototype.currentPath = function () {
|
|
17720
17747
|
return '';
|
|
17721
17748
|
};
|
|
@@ -22056,7 +22083,7 @@
|
|
|
22056
22083
|
i0__namespace.ɵɵlistener("filterChanged", function RecipeCatalogComponent_div_2_Template_ng_miam_recipe_filters_filterChanged_7_listener($event) { i0__namespace.ɵɵrestoreView(_r47_1); var ctx_r48 = i0__namespace.ɵɵnextContext(); return ctx_r48.updateFilters($event); })("filterCollapsed", function RecipeCatalogComponent_div_2_Template_ng_miam_recipe_filters_filterCollapsed_7_listener() { i0__namespace.ɵɵrestoreView(_r47_1); var ctx_r49 = i0__namespace.ɵɵnextContext(); return ctx_r49.onFilterCollapsed(); })("preferencesChanged", function RecipeCatalogComponent_div_2_Template_ng_miam_recipe_filters_preferencesChanged_7_listener() { i0__namespace.ɵɵrestoreView(_r47_1); var ctx_r50 = i0__namespace.ɵɵnextContext(); return ctx_r50.reloadPackages(); });
|
|
22057
22084
|
i0__namespace.ɵɵelementEnd();
|
|
22058
22085
|
i0__namespace.ɵɵelementStart(8, "ng-miam-preferences", 11);
|
|
22059
|
-
i0__namespace.ɵɵlistener("isOpenChange", function RecipeCatalogComponent_div_2_Template_ng_miam_preferences_isOpenChange_8_listener($event) { i0__namespace.ɵɵrestoreView(_r47_1); var ctx_r51 = i0__namespace.ɵɵnextContext(); return ctx_r51.isPreferenceModalOpen = $event; })("preferencesChanged", function RecipeCatalogComponent_div_2_Template_ng_miam_preferences_preferencesChanged_8_listener() { i0__namespace.ɵɵrestoreView(_r47_1); var ctx_r52 = i0__namespace.ɵɵnextContext(); ctx_r52.updateFilters(ctx_r52.filters); return ctx_r52.reloadPackages(); });
|
|
22086
|
+
i0__namespace.ɵɵlistener("isOpenChange", function RecipeCatalogComponent_div_2_Template_ng_miam_preferences_isOpenChange_8_listener($event) { i0__namespace.ɵɵrestoreView(_r47_1); var ctx_r51 = i0__namespace.ɵɵnextContext(); return ctx_r51.isPreferenceModalOpen = $event; })("preferencesChanged", function RecipeCatalogComponent_div_2_Template_ng_miam_preferences_preferencesChanged_8_listener() { i0__namespace.ɵɵrestoreView(_r47_1); var ctx_r52 = i0__namespace.ɵɵnextContext(); ctx_r52.updateFilters(ctx_r52.filters, false); return ctx_r52.reloadPackages(); });
|
|
22060
22087
|
i0__namespace.ɵɵelementEnd();
|
|
22061
22088
|
i0__namespace.ɵɵtemplate(9, RecipeCatalogComponent_div_2_ng_template_9_Template, 1, 1, "ng-template", null, 12, i0__namespace.ɵɵtemplateRefExtractor);
|
|
22062
22089
|
i0__namespace.ɵɵelementEnd();
|
|
@@ -22226,9 +22253,10 @@
|
|
|
22226
22253
|
this.filters.search = '';
|
|
22227
22254
|
this.filters.additionalFilters = null;
|
|
22228
22255
|
};
|
|
22229
|
-
RecipeCatalogComponent.prototype.updateFilters = function (filters) {
|
|
22256
|
+
RecipeCatalogComponent.prototype.updateFilters = function (filters, forceListView) {
|
|
22257
|
+
if (forceListView === void 0) { forceListView = true; }
|
|
22230
22258
|
this.filters = filters.copy(); // necessary to trigger child component change
|
|
22231
|
-
this.forceListView =
|
|
22259
|
+
this.forceListView = forceListView;
|
|
22232
22260
|
this.filterToRemove = undefined;
|
|
22233
22261
|
this.cdr.detectChanges();
|
|
22234
22262
|
this.setStickyObserver();
|
|
@@ -23335,25 +23363,36 @@
|
|
|
23335
23363
|
})();
|
|
23336
23364
|
var templateObject_1$8, templateObject_2$5;
|
|
23337
23365
|
|
|
23366
|
+
function StoreLocatorLinkComponent_div_0_span_1_img_1_Template(rf, ctx) {
|
|
23367
|
+
if (rf & 1) {
|
|
23368
|
+
var _r4_1 = i0__namespace.ɵɵgetCurrentView();
|
|
23369
|
+
i0__namespace.ɵɵelementStart(0, "img", 8);
|
|
23370
|
+
i0__namespace.ɵɵlistener("click", function StoreLocatorLinkComponent_div_0_span_1_img_1_Template_img_click_0_listener() { i0__namespace.ɵɵrestoreView(_r4_1); var ctx_r3 = i0__namespace.ɵɵnextContext(3); return ctx_r3.showTooltip(); });
|
|
23371
|
+
i0__namespace.ɵɵelementEnd();
|
|
23372
|
+
}
|
|
23373
|
+
}
|
|
23338
23374
|
function StoreLocatorLinkComponent_div_0_span_1_Template(rf, ctx) {
|
|
23339
23375
|
if (rf & 1) {
|
|
23340
23376
|
i0__namespace.ɵɵelementStart(0, "span", 6);
|
|
23341
|
-
i0__namespace.ɵɵ
|
|
23377
|
+
i0__namespace.ɵɵtemplate(1, StoreLocatorLinkComponent_div_0_span_1_img_1_Template, 1, 0, "img", 7);
|
|
23378
|
+
i0__namespace.ɵɵtext(2);
|
|
23342
23379
|
i0__namespace.ɵɵelementEnd();
|
|
23343
23380
|
}
|
|
23344
23381
|
if (rf & 2) {
|
|
23345
23382
|
var ctx_r1 = i0__namespace.ɵɵnextContext(2);
|
|
23346
23383
|
i0__namespace.ɵɵadvance(1);
|
|
23384
|
+
i0__namespace.ɵɵproperty("ngIf", ctx_r1.showIconTooltip);
|
|
23385
|
+
i0__namespace.ɵɵadvance(1);
|
|
23347
23386
|
i0__namespace.ɵɵtextInterpolate2(" ", ctx_r1.currentPos.relationships.supplier.data.attributes.name, " - ", ctx_r1.currentPos.attributes.name, " ");
|
|
23348
23387
|
}
|
|
23349
23388
|
}
|
|
23350
23389
|
function StoreLocatorLinkComponent_div_0_Template(rf, ctx) {
|
|
23351
23390
|
if (rf & 1) {
|
|
23352
|
-
var
|
|
23391
|
+
var _r6_1 = i0__namespace.ɵɵgetCurrentView();
|
|
23353
23392
|
i0__namespace.ɵɵelementStart(0, "div", 1);
|
|
23354
|
-
i0__namespace.ɵɵtemplate(1, StoreLocatorLinkComponent_div_0_span_1_Template,
|
|
23393
|
+
i0__namespace.ɵɵtemplate(1, StoreLocatorLinkComponent_div_0_span_1_Template, 3, 3, "span", 2);
|
|
23355
23394
|
i0__namespace.ɵɵelementStart(2, "button", 3);
|
|
23356
|
-
i0__namespace.ɵɵlistener("click", function StoreLocatorLinkComponent_div_0_Template_button_click_2_listener() { i0__namespace.ɵɵrestoreView(
|
|
23395
|
+
i0__namespace.ɵɵlistener("click", function StoreLocatorLinkComponent_div_0_Template_button_click_2_listener() { i0__namespace.ɵɵrestoreView(_r6_1); var ctx_r5 = i0__namespace.ɵɵnextContext(); return ctx_r5.storeLocatorService.openStoreLocator(); });
|
|
23357
23396
|
i0__namespace.ɵɵelement(3, "img", 4);
|
|
23358
23397
|
i0__namespace.ɵɵelementStart(4, "span");
|
|
23359
23398
|
i0__namespace.ɵɵi18n(5, 5);
|
|
@@ -23374,11 +23413,13 @@
|
|
|
23374
23413
|
this.suppliersService = suppliersService;
|
|
23375
23414
|
this.cdr = cdr;
|
|
23376
23415
|
this.subscriptions = [];
|
|
23416
|
+
this.showIconTooltip = false;
|
|
23377
23417
|
}
|
|
23378
23418
|
StoreLocatorLinkComponent.prototype.ngOnInit = function () {
|
|
23379
23419
|
var _this = this;
|
|
23380
23420
|
this.subscriptions.push(this.posService.pos$.subscribe(function (pos) {
|
|
23381
23421
|
_this.currentPos = pos;
|
|
23422
|
+
_this.setTooltipVisibility();
|
|
23382
23423
|
_this.cdr.detectChanges();
|
|
23383
23424
|
}));
|
|
23384
23425
|
};
|
|
@@ -23386,6 +23427,15 @@
|
|
|
23386
23427
|
this.subscriptions.forEach(function (sub) { return sub.unsubscribe(); });
|
|
23387
23428
|
this.storeLocatorService.unsubscribe();
|
|
23388
23429
|
};
|
|
23430
|
+
StoreLocatorLinkComponent.prototype.setTooltipVisibility = function () {
|
|
23431
|
+
var _a;
|
|
23432
|
+
this.showIconTooltip = this.storeLocatorService.isStoreLocatorWarningNeeded((_a = this.currentPos) === null || _a === void 0 ? void 0 : _a.relationships.supplier.data.id);
|
|
23433
|
+
};
|
|
23434
|
+
StoreLocatorLinkComponent.prototype.showTooltip = function () {
|
|
23435
|
+
this.storeLocatorService.changePosAfterWarnConfirm = false;
|
|
23436
|
+
this.storeLocatorService.showStoreLocatorWarning.next(true);
|
|
23437
|
+
this.cdr.detectChanges();
|
|
23438
|
+
};
|
|
23389
23439
|
return StoreLocatorLinkComponent;
|
|
23390
23440
|
}());
|
|
23391
23441
|
StoreLocatorLinkComponent.ɵfac = function StoreLocatorLinkComponent_Factory(t) { return new (t || StoreLocatorLinkComponent)(i0__namespace.ɵɵdirectiveInject(StoreLocatorService), i0__namespace.ɵɵdirectiveInject(PointOfSalesService), i0__namespace.ɵɵdirectiveInject(SuppliersService), i0__namespace.ɵɵdirectiveInject(i0__namespace.ChangeDetectorRef)); };
|
|
@@ -23398,7 +23448,7 @@
|
|
|
23398
23448
|
else {
|
|
23399
23449
|
i18n_0 = $localize(templateObject_1$7 || (templateObject_1$7 = __makeTemplateObject([":\u241Fc368921f313712ef19fa1f7d05697982582598ef\u241F9004334984468055592:Changer"], [":\u241Fc368921f313712ef19fa1f7d05697982582598ef\u241F9004334984468055592:Changer"])));
|
|
23400
23450
|
}
|
|
23401
|
-
return [["class", "miam-store-locator-link", 4, "ngIf"], [1, "miam-store-locator-link"], ["class", "miam-store-locator-link__store-name miam-ds-text weight-xl size-s", 4, "ngIf"], [1, "miam-store-locator-link__swap-pos-button", "miam-ds-button", "primary", "reverse", "small", 3, "click"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Swap.svg", "alt", "swap point of sale", 1, "miam-store-locator-link__swap-pos-icon"], i18n_0, [1, "miam-store-locator-link__store-name", "miam-ds-text", "weight-xl", "size-s"]];
|
|
23451
|
+
return [["class", "miam-store-locator-link", 4, "ngIf"], [1, "miam-store-locator-link"], ["class", "miam-store-locator-link__store-name miam-ds-text weight-xl size-s", 4, "ngIf"], [1, "miam-store-locator-link__swap-pos-button", "miam-ds-button", "primary", "reverse", "small", 3, "click"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Swap.svg", "alt", "swap point of sale", 1, "miam-store-locator-link__swap-pos-icon"], i18n_0, [1, "miam-store-locator-link__store-name", "miam-ds-text", "weight-xl", "size-s"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Infos_Primary.svg", "alt", "Info", 3, "click", 4, "ngIf"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Infos_Primary.svg", "alt", "Info", 3, "click"]];
|
|
23402
23452
|
}, template: function StoreLocatorLinkComponent_Template(rf, ctx) {
|
|
23403
23453
|
if (rf & 1) {
|
|
23404
23454
|
i0__namespace.ɵɵtemplate(0, StoreLocatorLinkComponent_div_0_Template, 6, 1, "div", 0);
|
|
@@ -23407,7 +23457,7 @@
|
|
|
23407
23457
|
if (rf & 2) {
|
|
23408
23458
|
i0__namespace.ɵɵproperty("ngIf", i0__namespace.ɵɵpipeBind1(1, 1, ctx.posService.waitForPos));
|
|
23409
23459
|
}
|
|
23410
|
-
}, directives: [i2__namespace.NgIf], pipes: [i2__namespace.AsyncPipe], styles: [".miam-store-locator-link{padding:8px 16px;display:flex;align-items:center;justify-content:space-between;background:var(--miam-ds-color-primary-100)}.miam-store-locator-link .miam-store-locator-link__swap-pos-button{border-radius:16px;display:flex;gap:8px}.miam-store-locator-link .miam-store-locator-link__swap-pos-button.miam-ds-button.primary.reverse.small{padding:8px 12px}.miam-store-locator-link .miam-store-locator-link__swap-pos-button.miam-ds-button.primary.reverse.small:hover{background-color:var(--miam-ds-color-primary-text);color:var(--miam-ds-color-primary)}"], encapsulation: 2, changeDetection: 0 });
|
|
23460
|
+
}, directives: [i2__namespace.NgIf], pipes: [i2__namespace.AsyncPipe], styles: [".miam-store-locator-link{padding:8px 16px;display:flex;align-items:center;justify-content:space-between;background:var(--miam-ds-color-primary-100)}.miam-store-locator-link .miam-store-locator-link__store-name{display:flex}.miam-store-locator-link .miam-store-locator-link__store-name img{margin-right:8px;cursor:pointer}.miam-store-locator-link .miam-store-locator-link__swap-pos-button{border-radius:16px;display:flex;gap:8px}.miam-store-locator-link .miam-store-locator-link__swap-pos-button.miam-ds-button.primary.reverse.small{padding:8px 12px}.miam-store-locator-link .miam-store-locator-link__swap-pos-button.miam-ds-button.primary.reverse.small:hover{background-color:var(--miam-ds-color-primary-text);color:var(--miam-ds-color-primary)}"], encapsulation: 2, changeDetection: 0 });
|
|
23411
23461
|
(function () {
|
|
23412
23462
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(StoreLocatorLinkComponent, [{
|
|
23413
23463
|
type: i0.Component,
|
|
@@ -23983,7 +24033,7 @@
|
|
|
23983
24033
|
};
|
|
23984
24034
|
RecipeDetailsComponent.prototype.ngOnChanges = function (changes) {
|
|
23985
24035
|
var _a;
|
|
23986
|
-
if (changes.recipeId && ((_a = this.recipeId) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
24036
|
+
if (changes.recipeId && ((_a = this.recipeId) === null || _a === void 0 ? void 0 : _a.length) > 0 && !(!this.posService.pos$.getValue() && this.contextService.noSupplier)) {
|
|
23987
24037
|
this.recipeDetailsOpenTimestamp = Date.now();
|
|
23988
24038
|
this.fetchRecipe(this.recipeId);
|
|
23989
24039
|
this.cdr.detectChanges();
|
|
@@ -25982,7 +26032,9 @@
|
|
|
25982
26032
|
this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
|
|
25983
26033
|
};
|
|
25984
26034
|
WarningStoreLocatorComponent.prototype.onConfirm = function () {
|
|
25985
|
-
this.storeLocatoreService.
|
|
26035
|
+
if (this.storeLocatoreService.changePosAfterWarnConfirm) {
|
|
26036
|
+
this.storeLocatoreService.changePos();
|
|
26037
|
+
}
|
|
25986
26038
|
this.storeLocatoreService.showStoreLocatorWarning.next(false);
|
|
25987
26039
|
};
|
|
25988
26040
|
return WarningStoreLocatorComponent;
|