ng-miam 10.5.9 → 10.5.11
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 +56 -11
- 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/_services/context.service.js +41 -2
- package/esm2015/lib/_services/http-utils.service.js +5 -3
- package/esm2015/lib/_services/user.service.js +3 -1
- package/esm2015/lib/_types/builded/mealz-internal-interface.js +1 -1
- package/esm2015/lib/_web-components/recipe-pricing/recipe-pricing.component.js +7 -6
- package/esm2015/lib/environments/version.js +2 -2
- package/fesm2015/ng-miam.js +52 -8
- package/fesm2015/ng-miam.js.map +1 -1
- package/lib/_services/context.service.d.ts +5 -0
- package/lib/_services/context.service.d.ts.map +1 -1
- package/lib/_services/http-utils.service.d.ts.map +1 -1
- package/lib/_services/user.service.d.ts +1 -0
- package/lib/_services/user.service.d.ts.map +1 -1
- package/lib/_types/builded/mealz-internal-interface.d.ts +6 -0
- package/lib/_types/builded/mealz-internal-interface.d.ts.map +1 -1
- package/lib/_web-components/recipe-pricing/recipe-pricing.component.d.ts +3 -2
- package/lib/_web-components/recipe-pricing/recipe-pricing.component.d.ts.map +1 -1
- package/lib/environments/version.d.ts +1 -1
- package/lib/environments/version.d.ts.map +1 -1
- package/package.json +1 -1
package/bundles/ng-miam.umd.js
CHANGED
|
@@ -3452,7 +3452,7 @@
|
|
|
3452
3452
|
EventJourney["EMPTY"] = "";
|
|
3453
3453
|
})(EventJourney || (EventJourney = {}));
|
|
3454
3454
|
|
|
3455
|
-
var VERSION = "10.5.
|
|
3455
|
+
var VERSION = "10.5.11"; // TODO: replace by ##VERSION## and update it in the CI/CD
|
|
3456
3456
|
|
|
3457
3457
|
var ContextRegistryService = /** @class */ (function () {
|
|
3458
3458
|
function ContextRegistryService() {
|
|
@@ -3930,6 +3930,7 @@
|
|
|
3930
3930
|
this.toasterService = toasterService;
|
|
3931
3931
|
this.ignoredBasketsService = ignoredBasketsService;
|
|
3932
3932
|
this.language$ = new rxjs.BehaviorSubject(null);
|
|
3933
|
+
this.authenticationId$ = new rxjs.BehaviorSubject(localStorage.getItem('_miam/userId') || localStorage.getItem('_miam/authlessId'));
|
|
3933
3934
|
this.isLogged$ = new rxjs.BehaviorSubject(false);
|
|
3934
3935
|
this.preferencesActivated$ = new rxjs.BehaviorSubject(false);
|
|
3935
3936
|
this.generatingAuthlessId$ = new rxjs.BehaviorSubject(false);
|
|
@@ -4012,6 +4013,7 @@
|
|
|
4012
4013
|
this.generatingAuthlessId$.next(true);
|
|
4013
4014
|
return this.http.post(url, {}).pipe(operators.map(function (result) { return result['authless_id']; }), operators.tap(function (anonymousUserId) {
|
|
4014
4015
|
localStorage.setItem('_miam/authlessId', anonymousUserId);
|
|
4016
|
+
_this.authenticationId$.next(anonymousUserId);
|
|
4015
4017
|
_this.generatingAuthlessId$.next(false);
|
|
4016
4018
|
}));
|
|
4017
4019
|
};
|
|
@@ -4476,10 +4478,12 @@
|
|
|
4476
4478
|
var _this = this;
|
|
4477
4479
|
return rxjs.combineLatest([
|
|
4478
4480
|
this.suppliersService.token$,
|
|
4479
|
-
this.userService.language
|
|
4481
|
+
this.userService.language$,
|
|
4482
|
+
this.userService.authenticationId$,
|
|
4483
|
+
this.userService.generatingAuthlessId$
|
|
4480
4484
|
]).pipe(operators.filter(function (_a) {
|
|
4481
|
-
var _b = __read(_a,
|
|
4482
|
-
return !!supplierToken && !!languageId;
|
|
4485
|
+
var _b = __read(_a, 4), supplierToken = _b[0], languageId = _b[1], authenticationId = _b[2], generatingAuthlessId = _b[3];
|
|
4486
|
+
return !!supplierToken && !!languageId && !!authenticationId && !generatingAuthlessId;
|
|
4483
4487
|
}), operators.take(1), operators.map(function () { return _this.buildHeaders(); }));
|
|
4484
4488
|
};
|
|
4485
4489
|
return HttpUtilsService;
|
|
@@ -11167,6 +11171,7 @@
|
|
|
11167
11171
|
this.orderHistoryEnabled = false;
|
|
11168
11172
|
this.enableMealsPlanner$ = new rxjs.BehaviorSubject(false);
|
|
11169
11173
|
this.displaySupplierSelector$ = new rxjs.BehaviorSubject(false);
|
|
11174
|
+
this.pricingPosSelectionInProgress = false;
|
|
11170
11175
|
this.noSupplier$ = new rxjs.ReplaySubject(1);
|
|
11171
11176
|
this.preferencesChanged = new i0.EventEmitter();
|
|
11172
11177
|
this.mealz = {
|
|
@@ -11387,6 +11392,7 @@
|
|
|
11387
11392
|
_this.contextRegistryService.forbidProfiling = forbidProfiling;
|
|
11388
11393
|
localStorage.setItem('_miam/authlessId', id);
|
|
11389
11394
|
localStorage.setItem('_miam/authless-forbid-profiling', '' + forbidProfiling);
|
|
11395
|
+
_this.userService.authenticationId$.next(id);
|
|
11390
11396
|
},
|
|
11391
11397
|
loadWithExternalId: function (id, forbidProfiling, initBasket) {
|
|
11392
11398
|
if (forbidProfiling === void 0) { forbidProfiling = false; }
|
|
@@ -11395,6 +11401,7 @@
|
|
|
11395
11401
|
_this.loggedOnSession = true;
|
|
11396
11402
|
localStorage.setItem('_miam/userId', id);
|
|
11397
11403
|
localStorage.removeItem('_miam/userToken');
|
|
11404
|
+
_this.userService.authenticationId$.next(id);
|
|
11398
11405
|
_this.basketHandler.resetMealz();
|
|
11399
11406
|
return _this.logUser(id, forbidProfiling, initBasket);
|
|
11400
11407
|
},
|
|
@@ -11405,6 +11412,7 @@
|
|
|
11405
11412
|
_this.loggedOnSession = false;
|
|
11406
11413
|
localStorage.removeItem('_miam/userToken');
|
|
11407
11414
|
localStorage.removeItem('_miam/userId');
|
|
11415
|
+
_this.userService.authenticationId$.next(localStorage.getItem('_miam/authlessId'));
|
|
11408
11416
|
_this.userService.toggleIsLogged(false);
|
|
11409
11417
|
_this.generateAuthlessIdIfNecessary().pipe(operators.take(1), operators.switchMap(function (id) {
|
|
11410
11418
|
if (id) {
|
|
@@ -11540,6 +11548,7 @@
|
|
|
11540
11548
|
updateIngredientFromBasketLoading$: this.newRecipeDetailsService.updateIngredientFromBasketLoading,
|
|
11541
11549
|
productsLoading$: this.newRecipeDetailsService.productsLoading,
|
|
11542
11550
|
displayedRecipe$: this.recipesService.displayedRecipe$,
|
|
11551
|
+
recipeDetailsTabIndex$: this.recipesService.recipeDetailsTabIndex$,
|
|
11543
11552
|
productsByCategory$: this.recipeDetailsProductsService.productsByCategory$,
|
|
11544
11553
|
productsPlannerByCategory$: this.recipeDetailsProductsPlannerService.productsPlannerByCategory$,
|
|
11545
11554
|
noPosDisplay$: this.newRecipeDetailsService.noPosDisplay$,
|
|
@@ -11690,8 +11699,8 @@
|
|
|
11690
11699
|
: needPos === false
|
|
11691
11700
|
? rxjs.of(true)
|
|
11692
11701
|
: _this.posService.posWasInitialized()
|
|
11693
|
-
]).pipe(operators.take(1), operators.switchMap(function (
|
|
11694
|
-
var
|
|
11702
|
+
]).pipe(operators.take(1), operators.switchMap(function (_b) {
|
|
11703
|
+
var _c = __read(_b, 2), isLogged = _c[0], posId = _c[1];
|
|
11695
11704
|
return rxjs.of(_this.contextRegistryService.hookCallback(isLogged, posId));
|
|
11696
11705
|
})); }
|
|
11697
11706
|
},
|
|
@@ -11711,7 +11720,9 @@
|
|
|
11711
11720
|
}
|
|
11712
11721
|
return rxjs.of(void 0);
|
|
11713
11722
|
},
|
|
11714
|
-
displaySupplierSelector$: this.displaySupplierSelector
|
|
11723
|
+
displaySupplierSelector$: this.displaySupplierSelector$,
|
|
11724
|
+
openStoreLocatorForPricing: function () { return _this.openStoreLocatorForPricing(); },
|
|
11725
|
+
cancelPricingPosSelection: function () { return _this.cancelPricingPosSelection(); }
|
|
11715
11726
|
}
|
|
11716
11727
|
};
|
|
11717
11728
|
this.defaultScrollElementGetter = function () { return document.body; };
|
|
@@ -11822,6 +11833,39 @@
|
|
|
11822
11833
|
}
|
|
11823
11834
|
});
|
|
11824
11835
|
};
|
|
11836
|
+
ContextService.prototype.openStoreLocatorForPricing = function () {
|
|
11837
|
+
var _this = this;
|
|
11838
|
+
var _a;
|
|
11839
|
+
(_a = this.pricingPosSelectionSub) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
11840
|
+
this.pricingPosSelectionInProgress = true;
|
|
11841
|
+
this.storeLocatorService.closeModalOnSelected = true;
|
|
11842
|
+
this.displaySupplierSelector$.next(true);
|
|
11843
|
+
this.pricingPosSelectionSub = this.storeLocatorService.newStoreSelected$.pipe(operators.take(1)).subscribe(function () {
|
|
11844
|
+
if (!_this.pricingPosSelectionInProgress) {
|
|
11845
|
+
return;
|
|
11846
|
+
}
|
|
11847
|
+
_this.completePricingPosSelection();
|
|
11848
|
+
});
|
|
11849
|
+
};
|
|
11850
|
+
ContextService.prototype.cancelPricingPosSelection = function () {
|
|
11851
|
+
var _a;
|
|
11852
|
+
if (!this.pricingPosSelectionInProgress) {
|
|
11853
|
+
return;
|
|
11854
|
+
}
|
|
11855
|
+
this.pricingPosSelectionInProgress = false;
|
|
11856
|
+
this.storeLocatorService.closeModalOnSelected = false;
|
|
11857
|
+
(_a = this.pricingPosSelectionSub) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
11858
|
+
this.pricingPosSelectionSub = undefined;
|
|
11859
|
+
};
|
|
11860
|
+
ContextService.prototype.completePricingPosSelection = function () {
|
|
11861
|
+
var _a;
|
|
11862
|
+
this.pricingPosSelectionInProgress = false;
|
|
11863
|
+
this.storeLocatorService.closeModalOnSelected = false;
|
|
11864
|
+
this.displaySupplierSelector$.next(false);
|
|
11865
|
+
this.recipesService.hide();
|
|
11866
|
+
(_a = this.pricingPosSelectionSub) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
11867
|
+
this.pricingPosSelectionSub = undefined;
|
|
11868
|
+
};
|
|
11825
11869
|
ContextService.prototype.addAllIngredientsFromRecipeId = function (recipeId, guests) {
|
|
11826
11870
|
var _this = this;
|
|
11827
11871
|
var eventTrace = { originPath: '/locator', props: { recipe_id: recipeId } };
|
|
@@ -15041,8 +15085,9 @@
|
|
|
15041
15085
|
}
|
|
15042
15086
|
}
|
|
15043
15087
|
var RecipePricingComponent = /** @class */ (function () {
|
|
15044
|
-
function RecipePricingComponent(recipesService, posService, cdr, priceService, basketsService, element, currencyService) {
|
|
15088
|
+
function RecipePricingComponent(recipesService, contextService, posService, cdr, priceService, basketsService, element, currencyService) {
|
|
15045
15089
|
this.recipesService = recipesService;
|
|
15090
|
+
this.contextService = contextService;
|
|
15046
15091
|
this.posService = posService;
|
|
15047
15092
|
this.cdr = cdr;
|
|
15048
15093
|
this.priceService = priceService;
|
|
@@ -15105,7 +15150,7 @@
|
|
|
15105
15150
|
};
|
|
15106
15151
|
RecipePricingComponent.prototype.openStoreLocator = function (e) {
|
|
15107
15152
|
e.stopPropagation();
|
|
15108
|
-
this.
|
|
15153
|
+
this.contextService.openStoreLocatorForPricing();
|
|
15109
15154
|
};
|
|
15110
15155
|
RecipePricingComponent.prototype.updateRecipeGuests = function () {
|
|
15111
15156
|
this.basketsService.updateRecipesInBasket([this.recipeId], this.guests$.value, { originPath: '', props: { recipe_id: this.recipeId } });
|
|
@@ -15185,7 +15230,7 @@
|
|
|
15185
15230
|
};
|
|
15186
15231
|
return RecipePricingComponent;
|
|
15187
15232
|
}());
|
|
15188
|
-
RecipePricingComponent.ɵfac = function RecipePricingComponent_Factory(t) { return new (t || RecipePricingComponent)(i0__namespace.ɵɵdirectiveInject(RecipesService), i0__namespace.ɵɵdirectiveInject(PointOfSalesService), i0__namespace.ɵɵdirectiveInject(i0__namespace.ChangeDetectorRef), i0__namespace.ɵɵdirectiveInject(PriceService), i0__namespace.ɵɵdirectiveInject(BasketsService), i0__namespace.ɵɵdirectiveInject(i0__namespace.ElementRef), i0__namespace.ɵɵdirectiveInject(CurrencyService)); };
|
|
15233
|
+
RecipePricingComponent.ɵfac = function RecipePricingComponent_Factory(t) { return new (t || RecipePricingComponent)(i0__namespace.ɵɵdirectiveInject(RecipesService), i0__namespace.ɵɵdirectiveInject(ContextService), i0__namespace.ɵɵdirectiveInject(PointOfSalesService), i0__namespace.ɵɵdirectiveInject(i0__namespace.ChangeDetectorRef), i0__namespace.ɵɵdirectiveInject(PriceService), i0__namespace.ɵɵdirectiveInject(BasketsService), i0__namespace.ɵɵdirectiveInject(i0__namespace.ElementRef), i0__namespace.ɵɵdirectiveInject(CurrencyService)); };
|
|
15189
15234
|
RecipePricingComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: RecipePricingComponent, selectors: [["ng-miam-recipe-pricing"]], inputs: { recipeId: "recipeId", recipeExtId: "recipeExtId", serves: "serves", guestsText: "guestsText", fetchPricingOnScroll: "fetchPricingOnScroll", inViewport: "inViewport" }, outputs: { priceSet: "priceSet" }, features: [i0__namespace.ɵɵNgOnChangesFeature], decls: 1, vars: 1, consts: function () {
|
|
15190
15235
|
var i18n_0;
|
|
15191
15236
|
if (typeof ngI18nClosureMode !== "undefined" && ngI18nClosureMode) {
|
|
@@ -15238,7 +15283,7 @@
|
|
|
15238
15283
|
encapsulation: i0.ViewEncapsulation.None,
|
|
15239
15284
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
15240
15285
|
}]
|
|
15241
|
-
}], function () { return [{ type: RecipesService }, { type: PointOfSalesService }, { type: i0__namespace.ChangeDetectorRef }, { type: PriceService }, { type: BasketsService }, { type: i0__namespace.ElementRef }, { type: CurrencyService }]; }, { recipeId: [{
|
|
15286
|
+
}], function () { return [{ type: RecipesService }, { type: ContextService }, { type: PointOfSalesService }, { type: i0__namespace.ChangeDetectorRef }, { type: PriceService }, { type: BasketsService }, { type: i0__namespace.ElementRef }, { type: CurrencyService }]; }, { recipeId: [{
|
|
15242
15287
|
type: i0.Input
|
|
15243
15288
|
}], recipeExtId: [{
|
|
15244
15289
|
type: i0.Input
|