ng-miam 8.8.5 → 8.8.7
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 +88 -35
- 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 +3 -4
- package/esm2015/lib/_web-components/warning-store-locator/warning-store-locator.component.js +4 -2
- package/fesm2015/ng-miam.js +282 -231
- 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.7',
|
|
8497
8532
|
'miam-front-type': 'web',
|
|
8498
8533
|
'miam-api-version': '4.7.0'
|
|
8499
8534
|
};
|
|
@@ -10963,9 +10998,8 @@
|
|
|
10963
10998
|
var _this = this;
|
|
10964
10999
|
var _a, _b;
|
|
10965
11000
|
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;
|
|
11001
|
+
return this.recipesService.searchRecipeByExtId(this.recipeExtId).pipe(operators.tap(function (response) {
|
|
11002
|
+
_this.recipeId = (response === null || response === void 0 ? void 0 : response.id) || null;
|
|
10969
11003
|
_this.cdr.detectChanges();
|
|
10970
11004
|
}));
|
|
10971
11005
|
}
|
|
@@ -12339,11 +12373,9 @@
|
|
|
12339
12373
|
var _this = this;
|
|
12340
12374
|
this.subscriptions.push(this.recipeDetailsService.productsByCategory$.subscribe(function () { return _this.isProductSponsored(); }), this.executeActionFromStorage(), this.loadOnRecipesActions(), this.loadOnIngredientsRemoval(), this.updateIngredientQuantityOnRecipeChange(), this.scrollBackOnProductReplaced());
|
|
12341
12375
|
};
|
|
12342
|
-
ProductCardComponent.prototype.ngOnChanges = function (
|
|
12376
|
+
ProductCardComponent.prototype.ngOnChanges = function () {
|
|
12343
12377
|
this.loadingAddToBasket = false;
|
|
12344
|
-
|
|
12345
|
-
this.modifiedIngQty = +this.product.ingredient.quantity;
|
|
12346
|
-
}
|
|
12378
|
+
this.modifiedIngQty = +this.product.ingredient.quantity;
|
|
12347
12379
|
this.cdr.detectChanges();
|
|
12348
12380
|
};
|
|
12349
12381
|
ProductCardComponent.prototype.ngOnDestroy = function () {
|
|
@@ -17669,7 +17701,7 @@
|
|
|
17669
17701
|
}));
|
|
17670
17702
|
}
|
|
17671
17703
|
else if (!this.recipe && this.recipeExtId) {
|
|
17672
|
-
this.subscriptions.push(this.searchRecipeByExtId().subscribe(function (result) {
|
|
17704
|
+
this.subscriptions.push(this.recipeService.searchRecipeByExtId(this.recipeExtId).subscribe(function (result) {
|
|
17673
17705
|
_this.recipe = result;
|
|
17674
17706
|
if (!result) {
|
|
17675
17707
|
_this.hidden.emit();
|
|
@@ -17712,10 +17744,6 @@
|
|
|
17712
17744
|
// Until supplier ids are the same as the provider ids we use the origin to determine the provider on which we filter
|
|
17713
17745
|
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
17746
|
};
|
|
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
17747
|
RecipeCardCtaComponent.prototype.currentPath = function () {
|
|
17720
17748
|
return '';
|
|
17721
17749
|
};
|
|
@@ -22056,7 +22084,7 @@
|
|
|
22056
22084
|
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
22085
|
i0__namespace.ɵɵelementEnd();
|
|
22058
22086
|
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(); });
|
|
22087
|
+
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
22088
|
i0__namespace.ɵɵelementEnd();
|
|
22061
22089
|
i0__namespace.ɵɵtemplate(9, RecipeCatalogComponent_div_2_ng_template_9_Template, 1, 1, "ng-template", null, 12, i0__namespace.ɵɵtemplateRefExtractor);
|
|
22062
22090
|
i0__namespace.ɵɵelementEnd();
|
|
@@ -22226,9 +22254,10 @@
|
|
|
22226
22254
|
this.filters.search = '';
|
|
22227
22255
|
this.filters.additionalFilters = null;
|
|
22228
22256
|
};
|
|
22229
|
-
RecipeCatalogComponent.prototype.updateFilters = function (filters) {
|
|
22257
|
+
RecipeCatalogComponent.prototype.updateFilters = function (filters, forceListView) {
|
|
22258
|
+
if (forceListView === void 0) { forceListView = true; }
|
|
22230
22259
|
this.filters = filters.copy(); // necessary to trigger child component change
|
|
22231
|
-
this.forceListView =
|
|
22260
|
+
this.forceListView = forceListView;
|
|
22232
22261
|
this.filterToRemove = undefined;
|
|
22233
22262
|
this.cdr.detectChanges();
|
|
22234
22263
|
this.setStickyObserver();
|
|
@@ -23335,25 +23364,36 @@
|
|
|
23335
23364
|
})();
|
|
23336
23365
|
var templateObject_1$8, templateObject_2$5;
|
|
23337
23366
|
|
|
23367
|
+
function StoreLocatorLinkComponent_div_0_span_1_img_1_Template(rf, ctx) {
|
|
23368
|
+
if (rf & 1) {
|
|
23369
|
+
var _r4_1 = i0__namespace.ɵɵgetCurrentView();
|
|
23370
|
+
i0__namespace.ɵɵelementStart(0, "img", 8);
|
|
23371
|
+
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(); });
|
|
23372
|
+
i0__namespace.ɵɵelementEnd();
|
|
23373
|
+
}
|
|
23374
|
+
}
|
|
23338
23375
|
function StoreLocatorLinkComponent_div_0_span_1_Template(rf, ctx) {
|
|
23339
23376
|
if (rf & 1) {
|
|
23340
23377
|
i0__namespace.ɵɵelementStart(0, "span", 6);
|
|
23341
|
-
i0__namespace.ɵɵ
|
|
23378
|
+
i0__namespace.ɵɵtemplate(1, StoreLocatorLinkComponent_div_0_span_1_img_1_Template, 1, 0, "img", 7);
|
|
23379
|
+
i0__namespace.ɵɵtext(2);
|
|
23342
23380
|
i0__namespace.ɵɵelementEnd();
|
|
23343
23381
|
}
|
|
23344
23382
|
if (rf & 2) {
|
|
23345
23383
|
var ctx_r1 = i0__namespace.ɵɵnextContext(2);
|
|
23346
23384
|
i0__namespace.ɵɵadvance(1);
|
|
23385
|
+
i0__namespace.ɵɵproperty("ngIf", ctx_r1.showIconTooltip);
|
|
23386
|
+
i0__namespace.ɵɵadvance(1);
|
|
23347
23387
|
i0__namespace.ɵɵtextInterpolate2(" ", ctx_r1.currentPos.relationships.supplier.data.attributes.name, " - ", ctx_r1.currentPos.attributes.name, " ");
|
|
23348
23388
|
}
|
|
23349
23389
|
}
|
|
23350
23390
|
function StoreLocatorLinkComponent_div_0_Template(rf, ctx) {
|
|
23351
23391
|
if (rf & 1) {
|
|
23352
|
-
var
|
|
23392
|
+
var _r6_1 = i0__namespace.ɵɵgetCurrentView();
|
|
23353
23393
|
i0__namespace.ɵɵelementStart(0, "div", 1);
|
|
23354
|
-
i0__namespace.ɵɵtemplate(1, StoreLocatorLinkComponent_div_0_span_1_Template,
|
|
23394
|
+
i0__namespace.ɵɵtemplate(1, StoreLocatorLinkComponent_div_0_span_1_Template, 3, 3, "span", 2);
|
|
23355
23395
|
i0__namespace.ɵɵelementStart(2, "button", 3);
|
|
23356
|
-
i0__namespace.ɵɵlistener("click", function StoreLocatorLinkComponent_div_0_Template_button_click_2_listener() { i0__namespace.ɵɵrestoreView(
|
|
23396
|
+
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
23397
|
i0__namespace.ɵɵelement(3, "img", 4);
|
|
23358
23398
|
i0__namespace.ɵɵelementStart(4, "span");
|
|
23359
23399
|
i0__namespace.ɵɵi18n(5, 5);
|
|
@@ -23374,11 +23414,13 @@
|
|
|
23374
23414
|
this.suppliersService = suppliersService;
|
|
23375
23415
|
this.cdr = cdr;
|
|
23376
23416
|
this.subscriptions = [];
|
|
23417
|
+
this.showIconTooltip = false;
|
|
23377
23418
|
}
|
|
23378
23419
|
StoreLocatorLinkComponent.prototype.ngOnInit = function () {
|
|
23379
23420
|
var _this = this;
|
|
23380
23421
|
this.subscriptions.push(this.posService.pos$.subscribe(function (pos) {
|
|
23381
23422
|
_this.currentPos = pos;
|
|
23423
|
+
_this.setTooltipVisibility();
|
|
23382
23424
|
_this.cdr.detectChanges();
|
|
23383
23425
|
}));
|
|
23384
23426
|
};
|
|
@@ -23386,6 +23428,15 @@
|
|
|
23386
23428
|
this.subscriptions.forEach(function (sub) { return sub.unsubscribe(); });
|
|
23387
23429
|
this.storeLocatorService.unsubscribe();
|
|
23388
23430
|
};
|
|
23431
|
+
StoreLocatorLinkComponent.prototype.setTooltipVisibility = function () {
|
|
23432
|
+
var _a;
|
|
23433
|
+
this.showIconTooltip = this.storeLocatorService.isStoreLocatorWarningNeeded((_a = this.currentPos) === null || _a === void 0 ? void 0 : _a.relationships.supplier.data.id);
|
|
23434
|
+
};
|
|
23435
|
+
StoreLocatorLinkComponent.prototype.showTooltip = function () {
|
|
23436
|
+
this.storeLocatorService.changePosAfterWarnConfirm = false;
|
|
23437
|
+
this.storeLocatorService.showStoreLocatorWarning.next(true);
|
|
23438
|
+
this.cdr.detectChanges();
|
|
23439
|
+
};
|
|
23389
23440
|
return StoreLocatorLinkComponent;
|
|
23390
23441
|
}());
|
|
23391
23442
|
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 +23449,7 @@
|
|
|
23398
23449
|
else {
|
|
23399
23450
|
i18n_0 = $localize(templateObject_1$7 || (templateObject_1$7 = __makeTemplateObject([":\u241Fc368921f313712ef19fa1f7d05697982582598ef\u241F9004334984468055592:Changer"], [":\u241Fc368921f313712ef19fa1f7d05697982582598ef\u241F9004334984468055592:Changer"])));
|
|
23400
23451
|
}
|
|
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"]];
|
|
23452
|
+
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
23453
|
}, template: function StoreLocatorLinkComponent_Template(rf, ctx) {
|
|
23403
23454
|
if (rf & 1) {
|
|
23404
23455
|
i0__namespace.ɵɵtemplate(0, StoreLocatorLinkComponent_div_0_Template, 6, 1, "div", 0);
|
|
@@ -23407,7 +23458,7 @@
|
|
|
23407
23458
|
if (rf & 2) {
|
|
23408
23459
|
i0__namespace.ɵɵproperty("ngIf", i0__namespace.ɵɵpipeBind1(1, 1, ctx.posService.waitForPos));
|
|
23409
23460
|
}
|
|
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 });
|
|
23461
|
+
}, 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
23462
|
(function () {
|
|
23412
23463
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(StoreLocatorLinkComponent, [{
|
|
23413
23464
|
type: i0.Component,
|
|
@@ -23983,7 +24034,7 @@
|
|
|
23983
24034
|
};
|
|
23984
24035
|
RecipeDetailsComponent.prototype.ngOnChanges = function (changes) {
|
|
23985
24036
|
var _a;
|
|
23986
|
-
if (changes.recipeId && ((_a = this.recipeId) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
24037
|
+
if (changes.recipeId && ((_a = this.recipeId) === null || _a === void 0 ? void 0 : _a.length) > 0 && !(!this.posService.pos$.getValue() && this.contextService.noSupplier)) {
|
|
23987
24038
|
this.recipeDetailsOpenTimestamp = Date.now();
|
|
23988
24039
|
this.fetchRecipe(this.recipeId);
|
|
23989
24040
|
this.cdr.detectChanges();
|
|
@@ -25982,7 +26033,9 @@
|
|
|
25982
26033
|
this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
|
|
25983
26034
|
};
|
|
25984
26035
|
WarningStoreLocatorComponent.prototype.onConfirm = function () {
|
|
25985
|
-
this.storeLocatoreService.
|
|
26036
|
+
if (this.storeLocatoreService.changePosAfterWarnConfirm) {
|
|
26037
|
+
this.storeLocatoreService.changePos();
|
|
26038
|
+
}
|
|
25986
26039
|
this.storeLocatoreService.showStoreLocatorWarning.next(false);
|
|
25987
26040
|
};
|
|
25988
26041
|
return WarningStoreLocatorComponent;
|