ng-miam 9.0.9 → 9.0.10
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 +108 -41
- 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 +11 -5
- package/esm2015/lib/_services/basket-transfer.service.js +1 -5
- package/esm2015/lib/_services/baskets.service.js +18 -1
- package/esm2015/lib/_services/recipes.service.js +17 -5
- package/esm2015/lib/_services/store-locator.service.js +7 -2
- package/esm2015/lib/_web-components/preferences/preferences-search/preferences-search.component.js +5 -4
- package/esm2015/lib/_web-components/preferences/preferences.component.js +17 -9
- 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 +311 -249
- package/fesm2015/ng-miam.js.map +1 -1
- package/lib/_components/counter-input/counter-input.component.d.ts +4 -4
- package/lib/_components/counter-input/counter-input.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/preferences/preferences-search/preferences-search.component.d.ts.map +1 -1
- package/lib/_web-components/preferences/preferences.component.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('
|
|
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', '
|
|
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$1, global.rxjs, global.ng.platformBrowser, global.endOfWeek, global.isWithinInterval, global.startOfWeek, global.subDays, global.
|
|
5
|
-
})(this, (function (exports, i1, i1$1, localeFr, i0, animations$1, i2$1, rxjs, i2, endOfWeek, isWithinInterval, startOfWeek, subDays,
|
|
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('rxjs/operators'), require('@angular/platform-browser'), require('date-fns/endOfWeek'), require('date-fns/isWithinInterval'), require('date-fns/startOfWeek'), require('date-fns/subDays'), require('mealz-shared-analytics'), require('duration-fns'), require('lodash-es'), require('lodash-es/pullAt'), require('@angular/cdk/layout'), require('uuid'), 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', 'rxjs/operators', '@angular/platform-browser', 'date-fns/endOfWeek', 'date-fns/isWithinInterval', 'date-fns/startOfWeek', 'date-fns/subDays', 'mealz-shared-analytics', 'duration-fns', 'lodash-es', 'lodash-es/pullAt', '@angular/cdk/layout', 'uuid', '@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$1, global.rxjs, global.rxjs.operators, global.ng.platformBrowser, global.endOfWeek, global.isWithinInterval, global.startOfWeek, global.subDays, global.mealzSharedAnalytics, global.duration, global.lodashEs, global.pullAt, global.ng.cdk.layout, global.uuid, 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, i1, i1$1, localeFr, i0, animations$1, i2$1, rxjs, operators, i2, endOfWeek, isWithinInterval, startOfWeek, subDays, mealzSharedAnalytics, duration, lodashEs, pullAt, i7, uuid, 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
|
|
|
@@ -1225,7 +1225,7 @@
|
|
|
1225
1225
|
if (this.valueSubject) {
|
|
1226
1226
|
return;
|
|
1227
1227
|
}
|
|
1228
|
-
this.valueSubject = new rxjs.
|
|
1228
|
+
this.valueSubject = new rxjs.BehaviorSubject(this.value);
|
|
1229
1229
|
this.lastValue = this.value;
|
|
1230
1230
|
this.subscriptions.push(this.valueSubject
|
|
1231
1231
|
.pipe(operators.debounceTime(this.debounceTime))
|
|
@@ -1237,7 +1237,13 @@
|
|
|
1237
1237
|
_this.lastValue = _this.value;
|
|
1238
1238
|
}));
|
|
1239
1239
|
};
|
|
1240
|
-
CounterInputComponent.prototype.ngOnChanges = function () {
|
|
1240
|
+
CounterInputComponent.prototype.ngOnChanges = function (changes) {
|
|
1241
|
+
var _a;
|
|
1242
|
+
if (!((_a = changes.value) === null || _a === void 0 ? void 0 : _a.isFirstChange())) {
|
|
1243
|
+
if (this.value !== this.valueSubject.value) {
|
|
1244
|
+
this.valueSubject.next(this.value);
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1241
1247
|
this.cdr.detectChanges();
|
|
1242
1248
|
};
|
|
1243
1249
|
CounterInputComponent.prototype.ngOnDestroy = function () {
|
|
@@ -4764,6 +4770,7 @@
|
|
|
4764
4770
|
this.closeModalOnSelected = false;
|
|
4765
4771
|
this.showStoreLocatorWarning = new rxjs.BehaviorSubject(false);
|
|
4766
4772
|
this.showNoSupplierOnboarding = new rxjs.BehaviorSubject(false);
|
|
4773
|
+
this.changePosAfterWarnConfirm = true;
|
|
4767
4774
|
this.storeLocatorOpened$.subscribe(function (opened) {
|
|
4768
4775
|
if (opened && _this.storeLocatorOpenedTimestamp !== 0) {
|
|
4769
4776
|
_this.storeLocatorOpenedTimestamp = Date.now();
|
|
@@ -4780,7 +4787,8 @@
|
|
|
4780
4787
|
this.selectedSupplierName = e.detail.supplierName;
|
|
4781
4788
|
this.storeLocatorEventTrace = eventTrace;
|
|
4782
4789
|
// The following check is supposed to be temporary TODO remove
|
|
4783
|
-
if (
|
|
4790
|
+
if (this.isStoreLocatorWarningNeeded(e.detail.supplierId)) {
|
|
4791
|
+
this.changePosAfterWarnConfirm = true;
|
|
4784
4792
|
// Current device is a mobile device and the chosen supplier has not deactivated deep links
|
|
4785
4793
|
this.showStoreLocatorWarning.next(true);
|
|
4786
4794
|
}
|
|
@@ -4788,6 +4796,9 @@
|
|
|
4788
4796
|
this.changePos();
|
|
4789
4797
|
}
|
|
4790
4798
|
};
|
|
4799
|
+
StoreLocatorService.prototype.isStoreLocatorWarningNeeded = function (supplierId) {
|
|
4800
|
+
return /Mobi|Android|iPhone/i.test(navigator.userAgent) && supplierId === '7';
|
|
4801
|
+
};
|
|
4791
4802
|
StoreLocatorService.prototype.changePos = function () {
|
|
4792
4803
|
var _this = this;
|
|
4793
4804
|
this.subscriptions.push(this.posService.loadPos(this.selectedPosId).pipe(operators.skipWhile(function (pos) { return !pos || pos.id !== _this.selectedPosId; }), operators.switchMap(function (pos) {
|
|
@@ -5085,6 +5096,19 @@
|
|
|
5085
5096
|
return recipes.data;
|
|
5086
5097
|
}));
|
|
5087
5098
|
};
|
|
5099
|
+
RecipesService.prototype.searchRecipeByExtId = function (recipeExtId) {
|
|
5100
|
+
var _this = this;
|
|
5101
|
+
var url = MIAM_API_HOST$2 + "recipes/external/" + recipeExtId;
|
|
5102
|
+
return this.http.get(url).pipe(operators.map(function (response) {
|
|
5103
|
+
var _a;
|
|
5104
|
+
if (((_a = response.data) === null || _a === void 0 ? void 0 : _a.attributes['ext-id']) === recipeExtId) {
|
|
5105
|
+
var recipe = _this.new();
|
|
5106
|
+
recipe.fill(response);
|
|
5107
|
+
return recipe;
|
|
5108
|
+
}
|
|
5109
|
+
return null;
|
|
5110
|
+
}));
|
|
5111
|
+
};
|
|
5088
5112
|
RecipesService.prototype.getPricing = function (recipeId, posId, pricebookKey, serves) {
|
|
5089
5113
|
if (serves === void 0) { serves = null; }
|
|
5090
5114
|
if (!recipeId) {
|
|
@@ -5548,9 +5572,24 @@
|
|
|
5548
5572
|
localStorage.removeItem('_miam/authlessId');
|
|
5549
5573
|
}
|
|
5550
5574
|
_this.currentSubscription = basketObservable.subscribe();
|
|
5575
|
+
_this.checkIfIsAffiliated();
|
|
5551
5576
|
return _this._basket$;
|
|
5552
5577
|
}));
|
|
5553
5578
|
};
|
|
5579
|
+
BasketsService.prototype.checkIfIsAffiliated = function () {
|
|
5580
|
+
var getAffiliatedUrl = environment$1.miamAPI + "/api/v1/baskets/affiliated";
|
|
5581
|
+
this.http.get(getAffiliatedUrl).pipe(operators.take(1)).subscribe(function (response) {
|
|
5582
|
+
var affiliated = response === null || response === void 0 ? void 0 : response.affiliated;
|
|
5583
|
+
if (affiliated) {
|
|
5584
|
+
localStorage.setItem('_miam/affiliated', affiliated);
|
|
5585
|
+
mealzSharedAnalytics.setAffiliate(affiliated);
|
|
5586
|
+
}
|
|
5587
|
+
else {
|
|
5588
|
+
localStorage.removeItem('_miam/affiliated');
|
|
5589
|
+
mealzSharedAnalytics.setAffiliate(null);
|
|
5590
|
+
}
|
|
5591
|
+
});
|
|
5592
|
+
};
|
|
5554
5593
|
BasketsService.prototype.transferAuthlessBasket = function (posId, authlessId) {
|
|
5555
5594
|
var _this = this;
|
|
5556
5595
|
this.statesService.callAuthlessTransfer.next();
|
|
@@ -5574,6 +5613,7 @@
|
|
|
5574
5613
|
if (eventTrace === void 0) { eventTrace = { originPath: '', props: {} }; }
|
|
5575
5614
|
mealzDebug('[Mealz] resetting basket');
|
|
5576
5615
|
localStorage.removeItem('_miam/affiliate');
|
|
5616
|
+
mealzSharedAnalytics.setAffiliate(null);
|
|
5577
5617
|
this.ignoredBasketsService.resetIgnoredIngredients();
|
|
5578
5618
|
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.switchMap(function (basket) { return _this.updateLocalBasket(basket); })); })); }));
|
|
5579
5619
|
};
|
|
@@ -9046,12 +9086,8 @@
|
|
|
9046
9086
|
this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
|
|
9047
9087
|
};
|
|
9048
9088
|
BasketTransferService.prototype.setSessionData = function (params) {
|
|
9049
|
-
var _a;
|
|
9050
9089
|
sessionStorage.setItem('_miam/transferredBasketToken', params.basketToken);
|
|
9051
9090
|
sessionStorage.setItem('_miam/posOfSaleExtId', params.posExtId);
|
|
9052
|
-
if (((_a = params.affiliate) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
9053
|
-
localStorage.setItem('_miam/affiliate', params.affiliate);
|
|
9054
|
-
}
|
|
9055
9091
|
};
|
|
9056
9092
|
BasketTransferService.prototype.clearTransferSessionData = function () {
|
|
9057
9093
|
sessionStorage.removeItem('_miam/transferredBasketToken');
|
|
@@ -12263,9 +12299,8 @@
|
|
|
12263
12299
|
var _this = this;
|
|
12264
12300
|
var _a, _b;
|
|
12265
12301
|
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) {
|
|
12266
|
-
return this.recipesService.
|
|
12267
|
-
|
|
12268
|
-
_this.recipeId = ((_a = response.data[0]) === null || _a === void 0 ? void 0 : _a.attributes['ext-id']) === _this.recipeExtId ? response.data[0].id : null;
|
|
12302
|
+
return this.recipesService.searchRecipeByExtId(this.recipeExtId).pipe(operators.tap(function (response) {
|
|
12303
|
+
_this.recipeId = (response === null || response === void 0 ? void 0 : response.id) || null;
|
|
12269
12304
|
_this.cdr.detectChanges();
|
|
12270
12305
|
}));
|
|
12271
12306
|
}
|
|
@@ -19362,7 +19397,7 @@
|
|
|
19362
19397
|
}));
|
|
19363
19398
|
}
|
|
19364
19399
|
else if (!this.recipe && this.recipeExtId) {
|
|
19365
|
-
this.subscriptions.push(this.searchRecipeByExtId().subscribe(function (result) {
|
|
19400
|
+
this.subscriptions.push(this.recipeService.searchRecipeByExtId(this.recipeExtId).subscribe(function (result) {
|
|
19366
19401
|
_this.recipe = result;
|
|
19367
19402
|
if (!result) {
|
|
19368
19403
|
_this.hidden.emit();
|
|
@@ -19405,10 +19440,6 @@
|
|
|
19405
19440
|
// Until supplier ids are the same as the provider ids we use the origin to determine the provider on which we filter
|
|
19406
19441
|
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; })); }));
|
|
19407
19442
|
};
|
|
19408
|
-
RecipeCardCtaComponent.prototype.searchRecipeByExtId = function () {
|
|
19409
|
-
var _this = this;
|
|
19410
|
-
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; }));
|
|
19411
|
-
};
|
|
19412
19443
|
RecipeCardCtaComponent.prototype.currentPath = function () {
|
|
19413
19444
|
return '';
|
|
19414
19445
|
};
|
|
@@ -22951,9 +22982,10 @@
|
|
|
22951
22982
|
return rxjs.of([]);
|
|
22952
22983
|
}
|
|
22953
22984
|
})).subscribe(function (tags) {
|
|
22954
|
-
var _a;
|
|
22955
|
-
_this.suggestedTags = tags.data
|
|
22956
|
-
|
|
22985
|
+
var _a, _b;
|
|
22986
|
+
_this.suggestedTags = (_a = tags === null || tags === void 0 ? void 0 : tags.data) === null || _a === void 0 ? void 0 : _a.filter(function (tag) { return tag.attributes['tag-type-id'] === 'ingredient_category' ||
|
|
22987
|
+
tag.attributes['tag-type-id'] === 'ingredientsdefinition'; });
|
|
22988
|
+
_this.notFound = ((_b = _this.suggestedTags) === null || _b === void 0 ? void 0 : _b.length) === 0;
|
|
22957
22989
|
_this.cdr.detectChanges();
|
|
22958
22990
|
}));
|
|
22959
22991
|
};
|
|
@@ -23396,10 +23428,12 @@
|
|
|
23396
23428
|
this.preferencesService.updatePreferences();
|
|
23397
23429
|
this.preferencesChanged.emit();
|
|
23398
23430
|
if (this.contextService.isPreferencesSSR) {
|
|
23399
|
-
this.updateFiltersInCache();
|
|
23431
|
+
this.updateFiltersInCache(true);
|
|
23432
|
+
}
|
|
23433
|
+
else {
|
|
23434
|
+
this.contextService.preferencesChanged.emit();
|
|
23435
|
+
this.close();
|
|
23400
23436
|
}
|
|
23401
|
-
this.contextService.preferencesChanged.emit();
|
|
23402
|
-
this.close();
|
|
23403
23437
|
};
|
|
23404
23438
|
PreferencesComponent.prototype.close = function () {
|
|
23405
23439
|
this.isOpen = false;
|
|
@@ -23416,13 +23450,21 @@
|
|
|
23416
23450
|
PreferencesComponent.prototype.whitelistedTags = function (tags) {
|
|
23417
23451
|
return tags.filter(function (tag) { return environment$1.tagsWhitelist.includes(tag.id); });
|
|
23418
23452
|
};
|
|
23419
|
-
PreferencesComponent.prototype.updateFiltersInCache = function () {
|
|
23453
|
+
PreferencesComponent.prototype.updateFiltersInCache = function (closeModal) {
|
|
23454
|
+
var _this = this;
|
|
23455
|
+
if (closeModal === void 0) { closeModal = false; }
|
|
23420
23456
|
var filters = new RecipeFilters();
|
|
23421
23457
|
var allFilters = this.preferencesService.addPreferencesToRemoteFilters(filters, true);
|
|
23422
23458
|
var filtersToAdd = Object.assign({ exclude_tags: allFilters.exclude_tags, include_tags: allFilters.include_tags }, (this.preferencesService.guests !== 4 && { guests: this.preferencesService.guests }));
|
|
23423
|
-
|
|
23424
|
-
this.preferencesService.sendCacheRequest('set', 'preferences', filtersToAdd)
|
|
23425
|
-
|
|
23459
|
+
var sendRequest = Object.keys(filtersToAdd).length > 0
|
|
23460
|
+
? this.preferencesService.sendCacheRequest('set', 'preferences', filtersToAdd)
|
|
23461
|
+
: this.preferencesService.sendCacheRequest('remove', 'preferences');
|
|
23462
|
+
sendRequest.subscribe(function () {
|
|
23463
|
+
if (closeModal) {
|
|
23464
|
+
_this.contextService.preferencesChanged.emit();
|
|
23465
|
+
_this.close();
|
|
23466
|
+
}
|
|
23467
|
+
});
|
|
23426
23468
|
};
|
|
23427
23469
|
return PreferencesComponent;
|
|
23428
23470
|
}());
|
|
@@ -23500,7 +23542,7 @@
|
|
|
23500
23542
|
else {
|
|
23501
23543
|
i18n_16 = $localize(templateObject_9$1 || (templateObject_9$1 = __makeTemplateObject([":\u241Fd52eb7599c75829bf96401d33dfdad4f9857822b\u241F4160637687093543290:Appliquer"], [":\u241Fd52eb7599c75829bf96401d33dfdad4f9857822b\u241F4160637687093543290:Appliquer"])));
|
|
23502
23544
|
}
|
|
23503
|
-
return [["modalStyle", "right", 3, "noHeaderMode", "display", "close"], [1, "miam-preferences"], [1, "miam-preferences__header"], [4, "ngIf"], ["class", "miam-preferences_nav-and-title", 4, "ngIf"], [1, "miam-ds-button", "ghost", "square", "miam-preferences__back-button", 3, "click"], ["alt", "go back", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/arrow-right.svg", 1, "miam-preferences__back-image"], [1, "miam-ds-text", "size-l", "weight-xxl", "miam-preferences__title"], i18n_0, [1, "miam-ds-button", "ghost", "square", "miam-preferences__close-button", 3, "click"], ["alt", "close modal", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross_primary.svg", 1, "miam-preferences__close-image"], [1, "miam-preferences_nav-and-title"], [1, "miam-ds-button", "ghost", "square", "miam-preferences__search-back-button", 3, "click"], i18n_2, [1, "miam-preferences__guests"], [1, "miam-ds-text", "miam-preferences_guest-label"], i18n_4, [1, "miam-preferences_guest-counter", 3, "value", "valueChange"], [1, "miam-preferences__diet-section", 3, "isCollapsed", "isCollapsedChange"], [1, "miam-ds-text", "weight-xl"], i18n_6, [1, "miam-preferences__list"], ["class", "miam-preferences__list__item miam-ds-checkbox", 3, "click", 4, "ngFor", "ngForOf"], [1, "miam-preferences__dislikes-section", 3, "isCollapsed", "isCollapsedChange"], i18n_8, ["class", "miam-ds-badge miam-preferences__badge", 3, "ngClass", "click", 4, "ngFor", "ngForOf"], [1, "miam-ds-badge", "miam-preferences__badge", 3, "click"], [1, "miam-preferences__badge_label"], i18n_10, ["alt", "add dislikes", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/plus-neutral-black.svg"], [1, "miam-preferences__equipments-section", 3, "isCollapsed", "isCollapsedChange"], i18n_12, [1, "miam-preferences__footer"], [1, "miam-ds-button", "secondary", "miam-preferences__footer__reset", 3, "click"], i18n_14, [1, "miam-ds-button", "primary", "miam-preferences__footer__recipes", 3, "click"], i18n_16, [1, "miam-preferences__list__item", "miam-ds-checkbox", 3, "click"], [1, "miam-ds-text", "miam-preferences__list__item__name"], ["type", "checkbox", 3, "checked"], [1, "miam-ds-badge", "miam-preferences__badge", 3, "ngClass", "click"], ["class", "miam-preferences__remove-tag", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross.svg", 3, "alt", 4, "ngIf"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross.svg", 1, "miam-preferences__remove-tag", 3, "alt"], [1, "miam-preferences__list__item__name"], [3, "backAndReload"]];
|
|
23545
|
+
return [["modalStyle", "right", 1, "miam-preferences-modal", 3, "noHeaderMode", "display", "close"], [1, "miam-preferences"], [1, "miam-preferences__header"], [4, "ngIf"], ["class", "miam-preferences_nav-and-title", 4, "ngIf"], [1, "miam-ds-button", "ghost", "square", "miam-preferences__back-button", 3, "click"], ["alt", "go back", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/arrow-right.svg", 1, "miam-preferences__back-image"], [1, "miam-ds-text", "size-l", "weight-xxl", "miam-preferences__title"], i18n_0, [1, "miam-ds-button", "ghost", "square", "miam-preferences__close-button", 3, "click"], ["alt", "close modal", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross_primary.svg", 1, "miam-preferences__close-image"], [1, "miam-preferences_nav-and-title"], [1, "miam-ds-button", "ghost", "square", "miam-preferences__search-back-button", 3, "click"], i18n_2, [1, "miam-preferences__guests"], [1, "miam-ds-text", "miam-preferences_guest-label"], i18n_4, [1, "miam-preferences_guest-counter", 3, "value", "valueChange"], [1, "miam-preferences__diet-section", 3, "isCollapsed", "isCollapsedChange"], [1, "miam-ds-text", "weight-xl"], i18n_6, [1, "miam-preferences__list"], ["class", "miam-preferences__list__item miam-ds-checkbox", 3, "click", 4, "ngFor", "ngForOf"], [1, "miam-preferences__dislikes-section", 3, "isCollapsed", "isCollapsedChange"], i18n_8, ["class", "miam-ds-badge miam-preferences__badge", 3, "ngClass", "click", 4, "ngFor", "ngForOf"], [1, "miam-ds-badge", "miam-preferences__badge", 3, "click"], [1, "miam-preferences__badge_label"], i18n_10, ["alt", "add dislikes", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/plus-neutral-black.svg"], [1, "miam-preferences__equipments-section", 3, "isCollapsed", "isCollapsedChange"], i18n_12, [1, "miam-preferences__footer"], [1, "miam-ds-button", "secondary", "miam-preferences__footer__reset", 3, "click"], i18n_14, [1, "miam-ds-button", "primary", "miam-preferences__footer__recipes", 3, "click"], i18n_16, [1, "miam-preferences__list__item", "miam-ds-checkbox", 3, "click"], [1, "miam-ds-text", "miam-preferences__list__item__name"], ["type", "checkbox", 3, "checked"], [1, "miam-ds-badge", "miam-preferences__badge", 3, "ngClass", "click"], ["class", "miam-preferences__remove-tag", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross.svg", 3, "alt", 4, "ngIf"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Cross.svg", 1, "miam-preferences__remove-tag", 3, "alt"], [1, "miam-preferences__list__item__name"], [3, "backAndReload"]];
|
|
23504
23546
|
}, template: function PreferencesComponent_Template(rf, ctx) {
|
|
23505
23547
|
if (rf & 1) {
|
|
23506
23548
|
i0__namespace.ɵɵelementStart(0, "ng-miam-modal", 0);
|
|
@@ -23791,7 +23833,7 @@
|
|
|
23791
23833
|
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(); });
|
|
23792
23834
|
i0__namespace.ɵɵelementEnd();
|
|
23793
23835
|
i0__namespace.ɵɵelementStart(8, "ng-miam-preferences", 11);
|
|
23794
|
-
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(); });
|
|
23836
|
+
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(); });
|
|
23795
23837
|
i0__namespace.ɵɵelementEnd();
|
|
23796
23838
|
i0__namespace.ɵɵtemplate(9, RecipeCatalogComponent_div_2_ng_template_9_Template, 1, 1, "ng-template", null, 12, i0__namespace.ɵɵtemplateRefExtractor);
|
|
23797
23839
|
i0__namespace.ɵɵelementEnd();
|
|
@@ -23960,9 +24002,10 @@
|
|
|
23960
24002
|
this.filters.search = '';
|
|
23961
24003
|
this.filters.additionalFilters = null;
|
|
23962
24004
|
};
|
|
23963
|
-
RecipeCatalogComponent.prototype.updateFilters = function (filters) {
|
|
24005
|
+
RecipeCatalogComponent.prototype.updateFilters = function (filters, forceListView) {
|
|
24006
|
+
if (forceListView === void 0) { forceListView = true; }
|
|
23964
24007
|
this.filters = filters.copy(); // necessary to trigger child component change
|
|
23965
|
-
this.forceListView =
|
|
24008
|
+
this.forceListView = forceListView;
|
|
23966
24009
|
this.filterToRemove = undefined;
|
|
23967
24010
|
this.cdr.detectChanges();
|
|
23968
24011
|
this.setStickyObserver();
|
|
@@ -25082,25 +25125,36 @@
|
|
|
25082
25125
|
})();
|
|
25083
25126
|
var templateObject_1$8, templateObject_2$5;
|
|
25084
25127
|
|
|
25128
|
+
function StoreLocatorLinkComponent_div_0_span_1_img_1_Template(rf, ctx) {
|
|
25129
|
+
if (rf & 1) {
|
|
25130
|
+
var _r4_1 = i0__namespace.ɵɵgetCurrentView();
|
|
25131
|
+
i0__namespace.ɵɵelementStart(0, "img", 8);
|
|
25132
|
+
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(); });
|
|
25133
|
+
i0__namespace.ɵɵelementEnd();
|
|
25134
|
+
}
|
|
25135
|
+
}
|
|
25085
25136
|
function StoreLocatorLinkComponent_div_0_span_1_Template(rf, ctx) {
|
|
25086
25137
|
if (rf & 1) {
|
|
25087
25138
|
i0__namespace.ɵɵelementStart(0, "span", 6);
|
|
25088
|
-
i0__namespace.ɵɵ
|
|
25139
|
+
i0__namespace.ɵɵtemplate(1, StoreLocatorLinkComponent_div_0_span_1_img_1_Template, 1, 0, "img", 7);
|
|
25140
|
+
i0__namespace.ɵɵtext(2);
|
|
25089
25141
|
i0__namespace.ɵɵelementEnd();
|
|
25090
25142
|
}
|
|
25091
25143
|
if (rf & 2) {
|
|
25092
25144
|
var ctx_r1 = i0__namespace.ɵɵnextContext(2);
|
|
25093
25145
|
i0__namespace.ɵɵadvance(1);
|
|
25146
|
+
i0__namespace.ɵɵproperty("ngIf", ctx_r1.showIconTooltip);
|
|
25147
|
+
i0__namespace.ɵɵadvance(1);
|
|
25094
25148
|
i0__namespace.ɵɵtextInterpolate2(" ", ctx_r1.currentPos.relationships.supplier.data.attributes.name, " - ", ctx_r1.currentPos.attributes.name, " ");
|
|
25095
25149
|
}
|
|
25096
25150
|
}
|
|
25097
25151
|
function StoreLocatorLinkComponent_div_0_Template(rf, ctx) {
|
|
25098
25152
|
if (rf & 1) {
|
|
25099
|
-
var
|
|
25153
|
+
var _r6_1 = i0__namespace.ɵɵgetCurrentView();
|
|
25100
25154
|
i0__namespace.ɵɵelementStart(0, "div", 1);
|
|
25101
|
-
i0__namespace.ɵɵtemplate(1, StoreLocatorLinkComponent_div_0_span_1_Template,
|
|
25155
|
+
i0__namespace.ɵɵtemplate(1, StoreLocatorLinkComponent_div_0_span_1_Template, 3, 3, "span", 2);
|
|
25102
25156
|
i0__namespace.ɵɵelementStart(2, "button", 3);
|
|
25103
|
-
i0__namespace.ɵɵlistener("click", function StoreLocatorLinkComponent_div_0_Template_button_click_2_listener() { i0__namespace.ɵɵrestoreView(
|
|
25157
|
+
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(); });
|
|
25104
25158
|
i0__namespace.ɵɵelement(3, "img", 4);
|
|
25105
25159
|
i0__namespace.ɵɵelementStart(4, "span");
|
|
25106
25160
|
i0__namespace.ɵɵi18n(5, 5);
|
|
@@ -25121,11 +25175,13 @@
|
|
|
25121
25175
|
this.suppliersService = suppliersService;
|
|
25122
25176
|
this.cdr = cdr;
|
|
25123
25177
|
this.subscriptions = [];
|
|
25178
|
+
this.showIconTooltip = false;
|
|
25124
25179
|
}
|
|
25125
25180
|
StoreLocatorLinkComponent.prototype.ngOnInit = function () {
|
|
25126
25181
|
var _this = this;
|
|
25127
25182
|
this.subscriptions.push(this.posService.pos$.subscribe(function (pos) {
|
|
25128
25183
|
_this.currentPos = pos;
|
|
25184
|
+
_this.setTooltipVisibility();
|
|
25129
25185
|
_this.cdr.detectChanges();
|
|
25130
25186
|
}));
|
|
25131
25187
|
};
|
|
@@ -25133,6 +25189,15 @@
|
|
|
25133
25189
|
this.subscriptions.forEach(function (sub) { return sub.unsubscribe(); });
|
|
25134
25190
|
this.storeLocatorService.unsubscribe();
|
|
25135
25191
|
};
|
|
25192
|
+
StoreLocatorLinkComponent.prototype.setTooltipVisibility = function () {
|
|
25193
|
+
var _a;
|
|
25194
|
+
this.showIconTooltip = this.storeLocatorService.isStoreLocatorWarningNeeded((_a = this.currentPos) === null || _a === void 0 ? void 0 : _a.relationships.supplier.data.id);
|
|
25195
|
+
};
|
|
25196
|
+
StoreLocatorLinkComponent.prototype.showTooltip = function () {
|
|
25197
|
+
this.storeLocatorService.changePosAfterWarnConfirm = false;
|
|
25198
|
+
this.storeLocatorService.showStoreLocatorWarning.next(true);
|
|
25199
|
+
this.cdr.detectChanges();
|
|
25200
|
+
};
|
|
25136
25201
|
return StoreLocatorLinkComponent;
|
|
25137
25202
|
}());
|
|
25138
25203
|
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)); };
|
|
@@ -25145,7 +25210,7 @@
|
|
|
25145
25210
|
else {
|
|
25146
25211
|
i18n_0 = $localize(templateObject_1$7 || (templateObject_1$7 = __makeTemplateObject([":\u241Fc368921f313712ef19fa1f7d05697982582598ef\u241F9004334984468055592:Changer"], [":\u241Fc368921f313712ef19fa1f7d05697982582598ef\u241F9004334984468055592:Changer"])));
|
|
25147
25212
|
}
|
|
25148
|
-
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"]];
|
|
25213
|
+
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"]];
|
|
25149
25214
|
}, template: function StoreLocatorLinkComponent_Template(rf, ctx) {
|
|
25150
25215
|
if (rf & 1) {
|
|
25151
25216
|
i0__namespace.ɵɵtemplate(0, StoreLocatorLinkComponent_div_0_Template, 6, 1, "div", 0);
|
|
@@ -25154,7 +25219,7 @@
|
|
|
25154
25219
|
if (rf & 2) {
|
|
25155
25220
|
i0__namespace.ɵɵproperty("ngIf", i0__namespace.ɵɵpipeBind1(1, 1, ctx.posService.waitForPos));
|
|
25156
25221
|
}
|
|
25157
|
-
}, directives: [i1__namespace.NgIf], pipes: [i1__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 });
|
|
25222
|
+
}, directives: [i1__namespace.NgIf], pipes: [i1__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 });
|
|
25158
25223
|
(function () {
|
|
25159
25224
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(StoreLocatorLinkComponent, [{
|
|
25160
25225
|
type: i0.Component,
|
|
@@ -25741,7 +25806,7 @@
|
|
|
25741
25806
|
};
|
|
25742
25807
|
RecipeDetailsComponent.prototype.ngOnChanges = function (changes) {
|
|
25743
25808
|
var _a;
|
|
25744
|
-
if (changes.recipeId && ((_a = this.recipeId) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
25809
|
+
if (changes.recipeId && ((_a = this.recipeId) === null || _a === void 0 ? void 0 : _a.length) > 0 && !(!this.posService.pos$.getValue() && this.contextService.noSupplier)) {
|
|
25745
25810
|
this.recipeDetailsOpenTimestamp = Date.now();
|
|
25746
25811
|
this.fetchRecipe(this.recipeId);
|
|
25747
25812
|
this.cdr.detectChanges();
|
|
@@ -27718,7 +27783,9 @@
|
|
|
27718
27783
|
this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
|
|
27719
27784
|
};
|
|
27720
27785
|
WarningStoreLocatorComponent.prototype.onConfirm = function () {
|
|
27721
|
-
this.storeLocatoreService.
|
|
27786
|
+
if (this.storeLocatoreService.changePosAfterWarnConfirm) {
|
|
27787
|
+
this.storeLocatoreService.changePos();
|
|
27788
|
+
}
|
|
27722
27789
|
this.storeLocatoreService.showStoreLocatorWarning.next(false);
|
|
27723
27790
|
};
|
|
27724
27791
|
return WarningStoreLocatorComponent;
|