ng-miam 6.3.6 → 6.3.8
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 +23 -12
- 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/recipe-filters/recipe-filters.component.js +9 -3
- package/esm2015/lib/_services/groceries-lists.service.js +2 -2
- package/esm2015/lib/_services/interceptor.service.js +2 -2
- package/esm2015/lib/_services/recipes.service.js +7 -5
- package/esm2015/lib/_web-components/meals-planner/meals-planner-catalog/meals-planner-catalog.component.js +6 -5
- package/fesm2015/ng-miam.js +21 -12
- package/fesm2015/ng-miam.js.map +1 -1
- package/lib/_components/recipe-filters/recipe-filters.component.d.ts +3 -1
- package/lib/_services/recipes.service.d.ts +1 -1
- package/package.json +1 -1
package/bundles/ng-miam.umd.js
CHANGED
|
@@ -785,7 +785,7 @@
|
|
|
785
785
|
// Observe the fetching of the recipe so calls to list$ are delayed instead of calling refreshCurrentList dozens of times
|
|
786
786
|
_this.listIsFetching = false;
|
|
787
787
|
_this.register();
|
|
788
|
-
_this.recipesToRemove.pipe(operators.skipWhile(function (toRemove) { return toRemove.length === 0; }), operators.debounceTime(
|
|
788
|
+
_this.recipesToRemove.pipe(operators.skipWhile(function (toRemove) { return toRemove.length === 0; }), operators.debounceTime(1000), operators.switchMap(function () { return _this.emptyRecipesToRemove(); })).subscribe();
|
|
789
789
|
return _this;
|
|
790
790
|
}
|
|
791
791
|
Object.defineProperty(GroceriesListsService.prototype, "list$", {
|
|
@@ -3429,12 +3429,16 @@
|
|
|
3429
3429
|
}), operators.map(function () { return recipes; }));
|
|
3430
3430
|
};
|
|
3431
3431
|
// Fetches recipes corresponding to filters, and return total recipes count
|
|
3432
|
-
RecipesService.prototype.filterCount = function (filters) {
|
|
3433
|
-
|
|
3434
|
-
|
|
3432
|
+
RecipesService.prototype.filterCount = function (filters, guests, excludedRecipesIds) {
|
|
3433
|
+
if (guests === void 0) { guests = null; }
|
|
3434
|
+
if (excludedRecipesIds === void 0) { excludedRecipesIds = []; }
|
|
3435
|
+
var f = Object.assign({}, this.buildRemoteFilters(filters, guests));
|
|
3436
|
+
return this.all({ remotefilter: f, page: { number: 1, size: 30 }, fields: { recipes: ['title'] } }).pipe(operators.skipWhile(function (result) { return result.is_loading; }), operators.map(function (result) {
|
|
3435
3437
|
var _a;
|
|
3436
3438
|
// Apparently total_resource = 1 even if no result was found so we have to check
|
|
3437
|
-
|
|
3439
|
+
var recipesNumber = result.data.length > 30 ? (_a = result === null || result === void 0 ? void 0 : result.meta) === null || _a === void 0 ? void 0 : _a.total_resources : result.data.length;
|
|
3440
|
+
recipesNumber -= result.data.filter(function (r) { return excludedRecipesIds.includes(r.id); }).length;
|
|
3441
|
+
return recipesNumber;
|
|
3438
3442
|
}));
|
|
3439
3443
|
};
|
|
3440
3444
|
RecipesService.prototype.difficultyLabel = function (value) {
|
|
@@ -10111,6 +10115,8 @@
|
|
|
10111
10115
|
_this.analyticsService = analyticsService;
|
|
10112
10116
|
_this.isFilterCollapsed = true;
|
|
10113
10117
|
_this.position = 'left';
|
|
10118
|
+
_this.modifiedGuests = null;
|
|
10119
|
+
_this.excludedRecipesIds = [];
|
|
10114
10120
|
_this.filterChanged = new i0.EventEmitter();
|
|
10115
10121
|
_this.filterCollapsed = new i0.EventEmitter();
|
|
10116
10122
|
_this.preferencesChanged = new i0.EventEmitter();
|
|
@@ -10238,7 +10244,7 @@
|
|
|
10238
10244
|
};
|
|
10239
10245
|
RecipeFiltersComponent.prototype.recalculateRecipesCount = function () {
|
|
10240
10246
|
var _this = this;
|
|
10241
|
-
this.subscriptions.push(this.recipesService.filterCount(this.filters).pipe(operators.tap(function (result) {
|
|
10247
|
+
this.subscriptions.push(this.recipesService.filterCount(this.filters, this.modifiedGuests, this.excludedRecipesIds).pipe(operators.tap(function (result) {
|
|
10242
10248
|
_this.recipesCount = result;
|
|
10243
10249
|
_this.cdr.detectChanges();
|
|
10244
10250
|
})).subscribe());
|
|
@@ -10246,7 +10252,7 @@
|
|
|
10246
10252
|
return RecipeFiltersComponent;
|
|
10247
10253
|
}(EventTracerComponent));
|
|
10248
10254
|
RecipeFiltersComponent.ɵfac = function RecipeFiltersComponent_Factory(t) { return new (t || RecipeFiltersComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i2.MediaMatcher), i0.ɵɵdirectiveInject(UserService), i0.ɵɵdirectiveInject(ContextService), i0.ɵɵdirectiveInject(RecipesService), i0.ɵɵdirectiveInject(AnalyticsService)); };
|
|
10249
|
-
RecipeFiltersComponent.ɵcmp = i0.ɵɵdefineComponent({ type: RecipeFiltersComponent, selectors: [["ng-miam-recipe-filters"]], inputs: { filters: "filters", filterToRemove: "filterToRemove", isFilterCollapsed: "isFilterCollapsed", position: "position" }, outputs: { filterChanged: "filterChanged", filterCollapsed: "filterCollapsed", preferencesChanged: "preferencesChanged" }, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 26, vars: 22, consts: function () {
|
|
10255
|
+
RecipeFiltersComponent.ɵcmp = i0.ɵɵdefineComponent({ type: RecipeFiltersComponent, selectors: [["ng-miam-recipe-filters"]], inputs: { filters: "filters", filterToRemove: "filterToRemove", isFilterCollapsed: "isFilterCollapsed", position: "position", modifiedGuests: "modifiedGuests", excludedRecipesIds: "excludedRecipesIds" }, outputs: { filterChanged: "filterChanged", filterCollapsed: "filterCollapsed", preferencesChanged: "preferencesChanged" }, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 26, vars: 22, consts: function () {
|
|
10250
10256
|
var i18n_0;
|
|
10251
10257
|
if (typeof ngI18nClosureMode !== "undefined" && ngI18nClosureMode) {
|
|
10252
10258
|
var MSG_EXTERNAL_5449168122747319631$$LIB__COMPONENTS_RECIPE_FILTERS_RECIPE_FILTERS_COMPONENT_TS_1 = goog.getMsg("Affiner ma s\u00E9lection");
|
|
@@ -10495,6 +10501,10 @@
|
|
|
10495
10501
|
type: i0.Input
|
|
10496
10502
|
}], position: [{
|
|
10497
10503
|
type: i0.Input
|
|
10504
|
+
}], modifiedGuests: [{
|
|
10505
|
+
type: i0.Input
|
|
10506
|
+
}], excludedRecipesIds: [{
|
|
10507
|
+
type: i0.Input
|
|
10498
10508
|
}], filterChanged: [{
|
|
10499
10509
|
type: i0.Output
|
|
10500
10510
|
}], filterCollapsed: [{
|
|
@@ -26488,7 +26498,8 @@
|
|
|
26488
26498
|
this.filters.additionalFilters = {
|
|
26489
26499
|
filters: {
|
|
26490
26500
|
recipe_type_id: 'main-dish',
|
|
26491
|
-
price: "0," + this.maxCost
|
|
26501
|
+
price: "0," + this.maxCost,
|
|
26502
|
+
in_basket: false
|
|
26492
26503
|
},
|
|
26493
26504
|
title: ''
|
|
26494
26505
|
};
|
|
@@ -26520,7 +26531,7 @@
|
|
|
26520
26531
|
return MealsPlannerCatalogComponent;
|
|
26521
26532
|
}(EventTracerComponent));
|
|
26522
26533
|
MealsPlannerCatalogComponent.ɵfac = function MealsPlannerCatalogComponent_Factory(t) { return new (t || MealsPlannerCatalogComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(RecipesService), i0.ɵɵdirectiveInject(AnalyticsService)); };
|
|
26523
|
-
MealsPlannerCatalogComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MealsPlannerCatalogComponent, selectors: [["ng-miam-meals-planner-catalog"]], inputs: { modifiedGuests: "modifiedGuests", remainingBudget: "remainingBudget", remainingRecipesNumber: "remainingRecipesNumber", excludedRecipesIds: "excludedRecipesIds" }, outputs: { canceled: "canceled", editRecipe: "editRecipe" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 17, vars:
|
|
26534
|
+
MealsPlannerCatalogComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MealsPlannerCatalogComponent, selectors: [["ng-miam-meals-planner-catalog"]], inputs: { modifiedGuests: "modifiedGuests", remainingBudget: "remainingBudget", remainingRecipesNumber: "remainingRecipesNumber", excludedRecipesIds: "excludedRecipesIds" }, outputs: { canceled: "canceled", editRecipe: "editRecipe" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 17, vars: 18, consts: function () {
|
|
26524
26535
|
var i18n_0;
|
|
26525
26536
|
if (typeof ngI18nClosureMode !== "undefined" && ngI18nClosureMode) {
|
|
26526
26537
|
var MSG_EXTERNAL_2741573127118604046$$LIB__WEB_COMPONENTS_MEALS_PLANNER_MEALS_PLANNER_CATALOG_MEALS_PLANNER_CATALOG_COMPONENT_TS_1 = goog.getMsg("Notre catalogue");
|
|
@@ -26537,7 +26548,7 @@
|
|
|
26537
26548
|
else {
|
|
26538
26549
|
i18n_2 = $localize(templateObject_2$C || (templateObject_2$C = __makeTemplateObject([":\u241F43a5be6775550e305fdcc873e3fe93fe756b2340\u241F673430564078029527:Filtrer"], [":\u241F43a5be6775550e305fdcc873e3fe93fe756b2340\u241F673430564078029527:Filtrer"])));
|
|
26539
26550
|
}
|
|
26540
|
-
return [[1, "miam-meals-planner-catalog"], [1, "miam-meals-planner-catalog__title", 3, "click"], ["width", "24", "height", "24", 3, "iconName"], i18n_0, [1, "miam-meals-planner-catalog__search-and-filters"], [1, "miam-meals-planner-catalog__searchbar"], ["type", "text", "placeholder", "Rechercher un ingr\u00E9dient, un repas...", 1, "miam-meals-planner-catalog__searchbar__input", 3, "ngModel", "ngModelChange", "keydown.enter", "blur"], [1, "miam-meals-planner-catalog__searchbar__button", "m-button-primary"], ["width", "20", "height", "20", 3, "iconName", "click"], [1, "miam-meals-planner-catalog__controls__filter", "m-button-primary", 3, "click"], ["width", "18", "height", "18", 3, "iconName"], i18n_2, ["class", "miam-meals-planner-catalog__controls__filter-badge", 4, "ngIf"], [3, "filters", "isFilterCollapsed", "position", "filterChanged", "filterCollapsed"], [3, "displayPricing", "addRecipeMode", "modifiedGuests", "originTrace", "filters", "displayGuests", "helpButtonAllowed", "excludedRecipesIds", "addToMealsPlanner"], [1, "miam-meals-planner-catalog__controls__filter-badge"]];
|
|
26551
|
+
return [[1, "miam-meals-planner-catalog"], [1, "miam-meals-planner-catalog__title", 3, "click"], ["width", "24", "height", "24", 3, "iconName"], i18n_0, [1, "miam-meals-planner-catalog__search-and-filters"], [1, "miam-meals-planner-catalog__searchbar"], ["type", "text", "placeholder", "Rechercher un ingr\u00E9dient, un repas...", 1, "miam-meals-planner-catalog__searchbar__input", 3, "ngModel", "ngModelChange", "keydown.enter", "blur"], [1, "miam-meals-planner-catalog__searchbar__button", "m-button-primary"], ["width", "20", "height", "20", 3, "iconName", "click"], [1, "miam-meals-planner-catalog__controls__filter", "m-button-primary", 3, "click"], ["width", "18", "height", "18", 3, "iconName"], i18n_2, ["class", "miam-meals-planner-catalog__controls__filter-badge", 4, "ngIf"], [3, "filters", "isFilterCollapsed", "modifiedGuests", "position", "excludedRecipesIds", "filterChanged", "filterCollapsed"], [3, "displayPricing", "addRecipeMode", "modifiedGuests", "originTrace", "filters", "displayGuests", "helpButtonAllowed", "excludedRecipesIds", "addToMealsPlanner"], [1, "miam-meals-planner-catalog__controls__filter-badge"]];
|
|
26541
26552
|
}, template: function MealsPlannerCatalogComponent_Template(rf, ctx) {
|
|
26542
26553
|
if (rf & 1) {
|
|
26543
26554
|
i0.ɵɵelementStart(0, "div", 0);
|
|
@@ -26588,7 +26599,7 @@
|
|
|
26588
26599
|
i0.ɵɵadvance(3);
|
|
26589
26600
|
i0.ɵɵproperty("ngIf", ctx.filterBadgeCount && ctx.filterBadgeCount > 0);
|
|
26590
26601
|
i0.ɵɵadvance(1);
|
|
26591
|
-
i0.ɵɵproperty("filters", ctx.filters)("isFilterCollapsed", ctx.isFilterCollapsed)("position", "right");
|
|
26602
|
+
i0.ɵɵproperty("filters", ctx.filters)("isFilterCollapsed", ctx.isFilterCollapsed)("modifiedGuests", ctx.modifiedGuests)("position", "right")("excludedRecipesIds", ctx.excludedRecipesIds);
|
|
26592
26603
|
i0.ɵɵadvance(1);
|
|
26593
26604
|
i0.ɵɵproperty("displayPricing", true)("addRecipeMode", true)("modifiedGuests", ctx.modifiedGuests)("originTrace", ctx.eventTrace())("filters", ctx.filters)("displayGuests", false)("helpButtonAllowed", false)("excludedRecipesIds", ctx.excludedRecipesIds);
|
|
26594
26605
|
}
|
|
@@ -27458,7 +27469,7 @@
|
|
|
27458
27469
|
request = request.clone({
|
|
27459
27470
|
setHeaders: {
|
|
27460
27471
|
'miam-origin': context.origin,
|
|
27461
|
-
'miam-front-version': '6.3.
|
|
27472
|
+
'miam-front-version': '6.3.8',
|
|
27462
27473
|
'miam-front-type': 'web',
|
|
27463
27474
|
'miam-api-version': '4.7.0'
|
|
27464
27475
|
}
|