ng-miam 6.4.2 → 6.4.3

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.
@@ -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('ngx-jsonapi'), require('@angular/cdk/drag-drop'), require('@angular/cdk/text-field'), require('@angular/forms'), require('uuid'), require('rxjs'), require('rxjs/operators'), require('lodash-es'), require('duration-fns'), require('lodash-es/pullAt'), require('@angular/cdk/layout'), require('@angular/platform-browser'), require('date-fns/endOfWeek'), require('date-fns/isWithinInterval'), require('date-fns/startOfWeek'), require('date-fns/subDays'), require('@angular/elements'), require('lodash-es/remove'), require('lodash-es/pick'), require('angular-draggable-droppable'), require('angular-calendar'), require('@angular/youtube-player'), require('lodash-es/groupBy'), require('angular-calendar/date-adapters/date-fns')) :
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', 'ngx-jsonapi', '@angular/cdk/drag-drop', '@angular/cdk/text-field', '@angular/forms', 'uuid', 'rxjs', 'rxjs/operators', 'lodash-es', 'duration-fns', 'lodash-es/pullAt', '@angular/cdk/layout', '@angular/platform-browser', 'date-fns/endOfWeek', 'date-fns/isWithinInterval', 'date-fns/startOfWeek', 'date-fns/subDays', '@angular/elements', 'lodash-es/remove', 'lodash-es/pick', 'angular-draggable-droppable', 'angular-calendar', '@angular/youtube-player', 'lodash-es/groupBy', 'angular-calendar/date-adapters/date-fns'], 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['ngx-jsonapi'], global.ng.cdk.dragDrop, global.ng.cdk.textField, global.ng.forms, global.uuid, global.rxjs, global.rxjs.operators, global.lodashEs, global.durationFns, global.pullAt, global.ng.cdk.layout, global.ng.platformBrowser, global.endOfWeek, global.isWithinInterval, global.startOfWeek, global.subDays, global.ng.elements, global.remove, global.pick, global.i8, global.i3$1, global.ng.youtubePlayer, global.groupBy, global.dateFns));
5
- }(this, (function (exports, i2, i1$1, localeFr, i0, animations, i1, i4, i6, i3, uuid, rxjs, operators, lodashEs, durationFns, pullAt, i1$2, i1$3, endOfWeek, isWithinInterval, startOfWeek, subDays, elements, remove, pick, i8, i3$1, i9, groupBy, dateFns) { '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('ngx-jsonapi'), require('@angular/cdk/drag-drop'), require('@angular/cdk/text-field'), require('@angular/forms'), require('uuid'), require('rxjs'), require('rxjs/operators'), require('lodash-es'), require('duration-fns'), require('lodash-es/pullAt'), require('@angular/cdk/layout'), require('@angular/platform-browser'), require('date-fns/endOfWeek'), require('date-fns/isWithinInterval'), require('date-fns/startOfWeek'), require('date-fns/subDays'), require('@angular/elements'), require('lodash-es/remove'), require('angular-draggable-droppable'), require('angular-calendar'), require('@angular/youtube-player'), require('lodash-es/groupBy'), require('angular-calendar/date-adapters/date-fns')) :
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', 'ngx-jsonapi', '@angular/cdk/drag-drop', '@angular/cdk/text-field', '@angular/forms', 'uuid', 'rxjs', 'rxjs/operators', 'lodash-es', 'duration-fns', 'lodash-es/pullAt', '@angular/cdk/layout', '@angular/platform-browser', 'date-fns/endOfWeek', 'date-fns/isWithinInterval', 'date-fns/startOfWeek', 'date-fns/subDays', '@angular/elements', 'lodash-es/remove', 'angular-draggable-droppable', 'angular-calendar', '@angular/youtube-player', 'lodash-es/groupBy', 'angular-calendar/date-adapters/date-fns'], 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['ngx-jsonapi'], global.ng.cdk.dragDrop, global.ng.cdk.textField, global.ng.forms, global.uuid, global.rxjs, global.rxjs.operators, global.lodashEs, global.durationFns, global.pullAt, global.ng.cdk.layout, global.ng.platformBrowser, global.endOfWeek, global.isWithinInterval, global.startOfWeek, global.subDays, global.ng.elements, global.remove, global.i8, global.i3$1, global.ng.youtubePlayer, global.groupBy, global.dateFns));
5
+ }(this, (function (exports, i2, i1$1, localeFr, i0, animations, i1, i4, i6, i3, uuid, rxjs, operators, lodashEs, durationFns, pullAt, i1$2, i1$3, endOfWeek, isWithinInterval, startOfWeek, subDays, elements, remove, i8, i3$1, i9, groupBy, dateFns) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -13,7 +13,6 @@
13
13
  var startOfWeek__default = /*#__PURE__*/_interopDefaultLegacy(startOfWeek);
14
14
  var subDays__default = /*#__PURE__*/_interopDefaultLegacy(subDays);
15
15
  var remove__default = /*#__PURE__*/_interopDefaultLegacy(remove);
16
- var pick__default = /*#__PURE__*/_interopDefaultLegacy(pick);
17
16
  var groupBy__default = /*#__PURE__*/_interopDefaultLegacy(groupBy);
18
17
 
19
18
  (function (Icon) {
@@ -12169,7 +12168,7 @@
12169
12168
  request = request.clone({
12170
12169
  setHeaders: {
12171
12170
  'miam-origin': context.origin.value,
12172
- 'miam-front-version': '6.4.2',
12171
+ 'miam-front-version': '6.4.3',
12173
12172
  'miam-front-type': 'web',
12174
12173
  'miam-api-version': '4.7.0'
12175
12174
  }
@@ -19239,10 +19238,8 @@
19239
19238
  if (!this.context.articlesInCatalogEnabled || this.noMoreArticles || !this.filters.additionalFilters.filters.packages) {
19240
19239
  return rxjs.of([]);
19241
19240
  }
19242
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
19243
- var requestFilters = pick__default['default'](this.filters, 'packages', 'search');
19244
19241
  return this.articlesService.all({
19245
- remotefilter: requestFilters,
19242
+ remotefilter: Object.assign({ packages: this.filters.additionalFilters.filters.packages }, this.filters.search ? { search: this.filters.search } : {}),
19246
19243
  page: { size: 20, number: page },
19247
19244
  sort: ['-date']
19248
19245
  }).pipe(operators.map(function (result) {
@@ -20388,70 +20385,41 @@
20388
20385
  var _c1$c = ["categoryCards"];
20389
20386
  function CatalogCategoryComponent_div_0_div_15_Template(rf, ctx) {
20390
20387
  if (rf & 1) {
20391
- i0.ɵɵelementStart(0, "div", 19);
20388
+ i0.ɵɵelementStart(0, "div", 17);
20392
20389
  i0.ɵɵelement(1, "ng-miam-loader");
20393
20390
  i0.ɵɵelementStart(2, "div");
20394
- i0.ɵɵi18n(3, 20);
20391
+ i0.ɵɵi18n(3, 18);
20395
20392
  i0.ɵɵelementEnd();
20396
20393
  i0.ɵɵelementEnd();
20397
20394
  }
20398
20395
  }
20399
20396
  function CatalogCategoryComponent_div_0_ng_miam_catalog_recipe_card_17_Template(rf, ctx) {
20400
20397
  if (rf & 1) {
20401
- i0.ɵɵelement(0, "ng-miam-catalog-recipe-card", 21);
20398
+ i0.ɵɵelement(0, "ng-miam-catalog-recipe-card", 19);
20402
20399
  }
20403
20400
  if (rf & 2) {
20404
- var recipe_r8 = ctx.$implicit;
20401
+ var recipe_r6 = ctx.$implicit;
20405
20402
  var ctx_r4 = i0.ɵɵnextContext(2);
20406
- i0.ɵɵproperty("recipe", recipe_r8)("displayPricing", ctx_r4.displayPricing)("originTrace", ctx_r4.eventTrace());
20403
+ i0.ɵɵproperty("recipe", recipe_r6)("displayPricing", ctx_r4.displayPricing)("originTrace", ctx_r4.eventTrace());
20407
20404
  }
20408
20405
  }
20409
20406
  function CatalogCategoryComponent_div_0_ng_miam_catalog_article_card_18_Template(rf, ctx) {
20410
20407
  if (rf & 1) {
20411
- i0.ɵɵelement(0, "ng-miam-catalog-article-card", 22);
20412
- }
20413
- if (rf & 2) {
20414
- var article_r9 = ctx.$implicit;
20415
- i0.ɵɵproperty("article", article_r9);
20416
- }
20417
- }
20418
- function CatalogCategoryComponent_div_0_div_19_Template(rf, ctx) {
20419
- if (rf & 1) {
20420
- var _r11_1 = i0.ɵɵgetCurrentView();
20421
- i0.ɵɵelementStart(0, "div", 23);
20422
- i0.ɵɵlistener("click", function CatalogCategoryComponent_div_0_div_19_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r11_1); var ctx_r10 = i0.ɵɵnextContext(2); return ctx_r10.slideLeft(); });
20423
- i0.ɵɵelement(1, "ng-miam-icon", 24);
20424
- i0.ɵɵelementEnd();
20425
- }
20426
- if (rf & 2) {
20427
- var ctx_r6 = i0.ɵɵnextContext(2);
20428
- i0.ɵɵadvance(1);
20429
- i0.ɵɵproperty("iconName", ctx_r6.icon.ChevronDown);
20430
- }
20431
- }
20432
- function CatalogCategoryComponent_div_0_div_20_Template(rf, ctx) {
20433
- if (rf & 1) {
20434
- var _r13_1 = i0.ɵɵgetCurrentView();
20435
- i0.ɵɵelementStart(0, "div", 25);
20436
- i0.ɵɵlistener("click", function CatalogCategoryComponent_div_0_div_20_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r13_1); var ctx_r12 = i0.ɵɵnextContext(2); return ctx_r12.slideRight(); });
20437
- i0.ɵɵelement(1, "ng-miam-icon", 24);
20438
- i0.ɵɵelementEnd();
20408
+ i0.ɵɵelement(0, "ng-miam-catalog-article-card", 20);
20439
20409
  }
20440
20410
  if (rf & 2) {
20441
- var ctx_r7 = i0.ɵɵnextContext(2);
20442
- i0.ɵɵadvance(1);
20443
- i0.ɵɵproperty("iconName", ctx_r7.icon.ChevronDown);
20411
+ var article_r7 = ctx.$implicit;
20412
+ i0.ɵɵproperty("article", article_r7);
20444
20413
  }
20445
20414
  }
20446
- var _c6$2 = function (a0) { return { "transform": a0 }; };
20447
20415
  function CatalogCategoryComponent_div_0_Template(rf, ctx) {
20448
20416
  if (rf & 1) {
20449
- var _r15_1 = i0.ɵɵgetCurrentView();
20417
+ var _r9_1 = i0.ɵɵgetCurrentView();
20450
20418
  i0.ɵɵelementStart(0, "div", 1);
20451
20419
  i0.ɵɵelementStart(1, "div", 2);
20452
20420
  i0.ɵɵelementStart(2, "div", 3);
20453
20421
  i0.ɵɵelementStart(3, "div", 4);
20454
- i0.ɵɵlistener("click", function CatalogCategoryComponent_div_0_Template_div_click_3_listener() { i0.ɵɵrestoreView(_r15_1); var ctx_r14 = i0.ɵɵnextContext(); return ctx_r14.displayListMode(); });
20422
+ i0.ɵɵlistener("click", function CatalogCategoryComponent_div_0_Template_div_click_3_listener() { i0.ɵɵrestoreView(_r9_1); var ctx_r8 = i0.ɵɵnextContext(); return ctx_r8.displayListMode(); });
20455
20423
  i0.ɵɵtext(4);
20456
20424
  i0.ɵɵelementEnd();
20457
20425
  i0.ɵɵelementStart(5, "div", 5);
@@ -20460,11 +20428,11 @@
20460
20428
  i0.ɵɵelementEnd();
20461
20429
  i0.ɵɵelementStart(7, "div", 6);
20462
20430
  i0.ɵɵelementStart(8, "div", 7);
20463
- i0.ɵɵlistener("click", function CatalogCategoryComponent_div_0_Template_div_click_8_listener() { i0.ɵɵrestoreView(_r15_1); var ctx_r16 = i0.ɵɵnextContext(); return ctx_r16.displayListMode(); });
20431
+ i0.ɵɵlistener("click", function CatalogCategoryComponent_div_0_Template_div_click_8_listener() { i0.ɵɵrestoreView(_r9_1); var ctx_r10 = i0.ɵɵnextContext(); return ctx_r10.displayListMode(); });
20464
20432
  i0.ɵɵi18n(9, 8);
20465
20433
  i0.ɵɵelementEnd();
20466
20434
  i0.ɵɵelementStart(10, "ng-miam-icon", 9);
20467
- i0.ɵɵlistener("click", function CatalogCategoryComponent_div_0_Template_ng_miam_icon_click_10_listener() { i0.ɵɵrestoreView(_r15_1); var ctx_r17 = i0.ɵɵnextContext(); return ctx_r17.displayListMode(); });
20435
+ i0.ɵɵlistener("click", function CatalogCategoryComponent_div_0_Template_ng_miam_icon_click_10_listener() { i0.ɵɵrestoreView(_r9_1); var ctx_r11 = i0.ɵɵnextContext(); return ctx_r11.displayListMode(); });
20468
20436
  i0.ɵɵelementEnd();
20469
20437
  i0.ɵɵelementEnd();
20470
20438
  i0.ɵɵelementEnd();
@@ -20475,8 +20443,6 @@
20475
20443
  i0.ɵɵtemplate(17, CatalogCategoryComponent_div_0_ng_miam_catalog_recipe_card_17_Template, 1, 3, "ng-miam-catalog-recipe-card", 15);
20476
20444
  i0.ɵɵtemplate(18, CatalogCategoryComponent_div_0_ng_miam_catalog_article_card_18_Template, 1, 1, "ng-miam-catalog-article-card", 16);
20477
20445
  i0.ɵɵelementEnd();
20478
- i0.ɵɵtemplate(19, CatalogCategoryComponent_div_0_div_19_Template, 2, 1, "div", 17);
20479
- i0.ɵɵtemplate(20, CatalogCategoryComponent_div_0_div_20_Template, 2, 1, "div", 18);
20480
20446
  i0.ɵɵelementEnd();
20481
20447
  i0.ɵɵelementEnd();
20482
20448
  }
@@ -20488,25 +20454,14 @@
20488
20454
  i0.ɵɵtextInterpolate(ctx_r0.subtitle);
20489
20455
  i0.ɵɵadvance(4);
20490
20456
  i0.ɵɵproperty("iconName", ctx_r0.icon.ChevronDown);
20491
- i0.ɵɵadvance(3);
20492
- i0.ɵɵproperty("ngStyle", i0.ɵɵpureFunction1(11, _c6$2, "translateX(-" + ctx_r0.xTranslation() + "px)"));
20493
- i0.ɵɵadvance(2);
20494
- i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(16, 9, ctx_r0.loading));
20457
+ i0.ɵɵadvance(5);
20458
+ i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(16, 6, ctx_r0.loading));
20495
20459
  i0.ɵɵadvance(2);
20496
20460
  i0.ɵɵproperty("ngForOf", ctx_r0.recipes);
20497
20461
  i0.ɵɵadvance(1);
20498
20462
  i0.ɵɵproperty("ngForOf", ctx_r0.articles);
20499
- i0.ɵɵadvance(1);
20500
- i0.ɵɵproperty("ngIf", ctx_r0.numberOfSections > 1 && ctx_r0.currentSection != 0);
20501
- i0.ɵɵadvance(1);
20502
- i0.ɵɵproperty("ngIf", ctx_r0.numberOfSections > 1 && ctx_r0.currentSection != ctx_r0.numberOfSections - 1);
20503
20463
  }
20504
20464
  }
20505
- // miam-catalog-recipe-card : width = 330px + miam-catalog-category__card : margin : 16px
20506
- // we include a margin in the card to get a space this is the card width + the margin
20507
- var CARD_WIDTH = 346;
20508
- var SPACE_BETWEEN_CARD = 16;
20509
- var SLIDER_WIDTH = 48;
20510
20465
  var recipeIncludes$4 = ['recipe-provider', 'sponsors'];
20511
20466
  var recipeSparseFields$4 = (_c$1 = {
20512
20467
  recipes: __spread(['title', 'number-of-guests', 'media-url', 'video-id', 'filigrane-logo-url', 'difficulty', 'preparation-time', 'cooking-time',
@@ -20531,12 +20486,6 @@
20531
20486
  _this.articles = [];
20532
20487
  _this.hide = false;
20533
20488
  _this.icon = exports.Icon;
20534
- _this.cardsTotalSize = 0; // native size of the card contain including overflow
20535
- _this.numberOfSections = 1; // number of card group that fit in cardsTotalSize
20536
- _this.currentSection = 0; // index of the section show on screen
20537
- _this.nbCardsInAnExtremeSection = 0; // nb of card that can fit in screen with one scroll button
20538
- _this.nbCardsInAMiddleSection = 0; // nb of card that can fit in screen with two scroll buttons
20539
- _this.categoryBandWidth = 0; // native size of visible card container scroll button
20540
20489
  _this.displayList = new i0.EventEmitter();
20541
20490
  _this.subscriptions = [];
20542
20491
  _this.recipes = [];
@@ -20545,7 +20494,7 @@
20545
20494
  CatalogCategoryComponent.prototype.ngOnInit = function () {
20546
20495
  this.sendEvent(this.analyticsService.EVENT_CATEGORY_SHOW);
20547
20496
  };
20548
- CatalogCategoryComponent.prototype.ngOnChanges = function (changes) {
20497
+ CatalogCategoryComponent.prototype.ngOnChanges = function () {
20549
20498
  var _this = this;
20550
20499
  this.subscriptions.push(rxjs.forkJoin([this.loadRecipes(), this.loadArticles()]).pipe(operators.finalize(function () {
20551
20500
  if (_this.recipes.length === 0 && _this.articles.length === 0) {
@@ -20553,7 +20502,6 @@
20553
20502
  }
20554
20503
  else {
20555
20504
  _this.hide = false;
20556
- _this.createSections();
20557
20505
  }
20558
20506
  _this.loading.emit(false);
20559
20507
  _this.cdr.detectChanges();
@@ -20579,110 +20527,18 @@
20579
20527
  };
20580
20528
  CatalogCategoryComponent.prototype.loadArticles = function () {
20581
20529
  var _this = this;
20582
- var _a;
20583
20530
  // TODO: all contents (recipes, articles...) should be related to packages, to which filters could be attached
20584
- if (!((_a = this.filters) === null || _a === void 0 ? void 0 : _a.packages) || !this.context.articlesInCatalogEnabled) {
20531
+ if (!this.filters.additionalFilters.filters.packages || !this.context.articlesInCatalogEnabled) {
20585
20532
  return rxjs.of([]);
20586
20533
  }
20587
- return this.articlesService.all({ remotefilter: this.filters, sort: ['-date'] }).pipe(operators.map(function (result) {
20534
+ return this.articlesService.all({
20535
+ remotefilter: { packages: this.filters.additionalFilters.filters.packages },
20536
+ sort: ['-date']
20537
+ }).pipe(operators.map(function (result) {
20588
20538
  _this.articles = result.data;
20589
20539
  return _this.articles;
20590
20540
  }));
20591
20541
  };
20592
- // TODO: deprecated?
20593
- CatalogCategoryComponent.prototype.createSections = function () {
20594
- this.cdr.detectChanges();
20595
- this.cardsTotalSize = this.categoryCards.nativeElement.scrollWidth; // approx number of recipes * CARD_WIDTH
20596
- this.recalculateSections();
20597
- this.cdr.detectChanges();
20598
- };
20599
- // TODO: deprecated?
20600
- CatalogCategoryComponent.prototype.recalculateSections = function () {
20601
- // the size of the window in which we put recipes and sliders
20602
- this.categoryBandWidth = this.categoryContent.nativeElement.clientWidth;
20603
- // at start we have only one slider, two in the midle so we may not be able to fit same number of cards
20604
- this.nbCardsInAnExtremeSection = Math.floor((this.categoryBandWidth - SLIDER_WIDTH) / CARD_WIDTH);
20605
- this.nbCardsInAMiddleSection = Math.floor((this.categoryBandWidth - 2 * SLIDER_WIDTH) / CARD_WIDTH);
20606
- var totalWidthOfCardsInAnExtremeSection = this.nbCardsInAnExtremeSection * CARD_WIDTH;
20607
- var totalWidthOfCardsmiddleSection = this.nbCardsInAMiddleSection * CARD_WIDTH;
20608
- var onlyOneSection = this.categoryBandWidth >= this.cardsTotalSize;
20609
- var twoSections = totalWidthOfCardsInAnExtremeSection * 2 >= this.cardsTotalSize;
20610
- if (onlyOneSection) {
20611
- this.numberOfSections = 1;
20612
- }
20613
- else if (twoSections) {
20614
- this.numberOfSections = 2;
20615
- }
20616
- else {
20617
- // in the case we have at least the starting section the ending section and one or more middle section
20618
- // 2 * cardsInAnExtremSections => nb cards in extrem section
20619
- // this.cardsTotalSize - 2 * cardsInAnExtremSections => nb card in middle section
20620
- this.numberOfSections = 2 + (this.cardsTotalSize - 2 * totalWidthOfCardsInAnExtremeSection) / totalWidthOfCardsmiddleSection;
20621
- }
20622
- };
20623
- // TODO: deprecated?
20624
- CatalogCategoryComponent.prototype.xTranslation = function () {
20625
- if (this.currentSection === 0) {
20626
- return 0;
20627
- }
20628
- else if (this.currentSection === (this.numberOfSections - 1)) {
20629
- // the card contain a space of SPACE_BETWEEN_CARD on the LEFT, we a a space at the end for display purpose
20630
- return this.cardsTotalSize - this.categoryBandWidth + SPACE_BETWEEN_CARD;
20631
- }
20632
- // we are in the middle
20633
- var firstexternSectionWidth = this.nbCardsInAnExtremeSection * CARD_WIDTH;
20634
- var middleSectionWidth = (this.currentSection - 1) * this.nbCardsInAMiddleSection * CARD_WIDTH;
20635
- return firstexternSectionWidth + middleSectionWidth - SLIDER_WIDTH;
20636
- };
20637
- // TODO: deprecated?
20638
- CatalogCategoryComponent.prototype.slideLeft = function () {
20639
- // current section can be a float if screen is resized
20640
- this.currentSection = Math.max(this.currentSection - 1, 0);
20641
- this.cdr.detectChanges();
20642
- this.sendEvents();
20643
- };
20644
- // TODO: deprecated?
20645
- CatalogCategoryComponent.prototype.slideRight = function () {
20646
- // current section can be a float if screen is resized
20647
- this.currentSection = Math.min(this.currentSection + 1, this.numberOfSections - 1);
20648
- this.cdr.detectChanges();
20649
- this.sendEvents();
20650
- };
20651
- // TODO: deprecated?
20652
- CatalogCategoryComponent.prototype.sendEvents = function () {
20653
- var _this = this;
20654
- // set a debounce to let the view update and recipe to be in viewport
20655
- setTimeout(function () {
20656
- // the send show event check if card is in view
20657
- _this.recipeCards.forEach(function (recipeCard) {
20658
- recipeCard.sendShowEvent();
20659
- recipeCard.displayPrice();
20660
- });
20661
- }, 1000);
20662
- };
20663
- /**
20664
- * to call when component resized
20665
- */
20666
- CatalogCategoryComponent.prototype.updateWidth = function () {
20667
- var oldNbOfCardsInAnExtremSection = this.nbCardsInAnExtremeSection;
20668
- var oldNbCardsInAMiddleSection = this.nbCardsInAMiddleSection;
20669
- var currentSectionWasFirst = this.currentSection === 0;
20670
- var currentSectionWasLast = this.currentSection === this.numberOfSections - 1;
20671
- this.recalculateSections();
20672
- if (currentSectionWasFirst) {
20673
- this.currentSection = 0;
20674
- }
20675
- else if (currentSectionWasLast) {
20676
- this.currentSection = this.numberOfSections - 1;
20677
- }
20678
- else {
20679
- // we want oldCardsForFirstSection + oldCardsBySection * currentSection = cardsForFirstSection + cardsBtSection * new_currentSection
20680
- // our goal is to keep the same card at the start of our visible div
20681
- var firstSectionDelta = oldNbOfCardsInAnExtremSection - this.nbCardsInAnExtremeSection;
20682
- this.currentSection = (firstSectionDelta + this.currentSection * oldNbCardsInAMiddleSection) / this.nbCardsInAMiddleSection;
20683
- }
20684
- this.cdr.detectChanges();
20685
- };
20686
20542
  CatalogCategoryComponent.prototype.displayListMode = function () {
20687
20543
  this.displayList.emit({ title: this.title, filters: this.filters.additionalFilters.filters });
20688
20544
  };
@@ -20721,15 +20577,15 @@
20721
20577
  else {
20722
20578
  i18n_4 = $localize(templateObject_2$s || (templateObject_2$s = __makeTemplateObject([":\u241F8f2c8f66fed7cbda7649b4ba2320375ff7526dbb\u241F5011068305185462335: Chargement des r\u00E9sultats... "], [":\u241F8f2c8f66fed7cbda7649b4ba2320375ff7526dbb\u241F5011068305185462335: Chargement des r\u00E9sultats... "])));
20723
20579
  }
20724
- return [["class", "miam-catalog-category", 4, "ngIf"], [1, "miam-catalog-category"], [1, "miam-catalog-category__header"], [1, "miam-catalog-category__left"], [1, "miam-catalog-category__title", 3, "click"], [1, "miam-catalog-category__subtitle"], [1, "miam-catalog-category__right"], [1, "miam-catalog-category__link", 3, "click"], i18n_2, ["height", "20", "width", "20", "primaryColor", "var(--m-color-primary)", 3, "iconName", "click"], [1, "miam-catalog-category__content"], ["categoryContent", ""], [1, "miam-catalog-category__cards", 3, "ngStyle"], ["categoryCards", ""], ["class", "miam-catalog-category__loader", 4, "ngIf"], [3, "recipe", "displayPricing", "originTrace", 4, "ngFor", "ngForOf"], [3, "article", 4, "ngFor", "ngForOf"], ["class", "miam-catalog-category__slider__left", 3, "click", 4, "ngIf"], ["class", "miam-catalog-category__slider__right", 3, "click", 4, "ngIf"], [1, "miam-catalog-category__loader"], i18n_4, [3, "recipe", "displayPricing", "originTrace"], [3, "article"], [1, "miam-catalog-category__slider__left", 3, "click"], ["height", "56", "width", "56", "primaryColor", "var(--m-color-white)", 3, "iconName"], [1, "miam-catalog-category__slider__right", 3, "click"]];
20580
+ return [["class", "miam-catalog-category", 4, "ngIf"], [1, "miam-catalog-category"], [1, "miam-catalog-category__header"], [1, "miam-catalog-category__left"], [1, "miam-catalog-category__title", 3, "click"], [1, "miam-catalog-category__subtitle"], [1, "miam-catalog-category__right"], [1, "miam-catalog-category__link", 3, "click"], i18n_2, ["height", "20", "width", "20", "primaryColor", "var(--m-color-primary)", 3, "iconName", "click"], [1, "miam-catalog-category__content"], ["categoryContent", ""], [1, "miam-catalog-category__cards"], ["categoryCards", ""], ["class", "miam-catalog-category__loader", 4, "ngIf"], [3, "recipe", "displayPricing", "originTrace", 4, "ngFor", "ngForOf"], [3, "article", 4, "ngFor", "ngForOf"], [1, "miam-catalog-category__loader"], i18n_4, [3, "recipe", "displayPricing", "originTrace"], [3, "article"]];
20725
20581
  }, template: function CatalogCategoryComponent_Template(rf, ctx) {
20726
20582
  if (rf & 1) {
20727
- i0.ɵɵtemplate(0, CatalogCategoryComponent_div_0_Template, 21, 13, "div", 0);
20583
+ i0.ɵɵtemplate(0, CatalogCategoryComponent_div_0_Template, 19, 8, "div", 0);
20728
20584
  }
20729
20585
  if (rf & 2) {
20730
20586
  i0.ɵɵproperty("ngIf", !ctx.hide);
20731
20587
  }
20732
- }, directives: [i2.NgIf, IconComponent, i2.NgStyle, i2.NgForOf, LoaderComponent, CatalogRecipeCardComponent, CatalogArticleCardComponent], pipes: [i2.AsyncPipe], styles: [".miam-catalog-category__slider{-webkit-backdrop-filter:blur(12px);align-items:center;backdrop-filter:blur(12px);background-color:rgba(32,32,32,.3);cursor:pointer;display:flex;height:calc(100% - 28px);justify-content:center;margin:12px 0 16px;position:absolute;top:0;width:48px}@media (max-width:1022px){.miam-catalog-category__slider{display:none}}.miam-catalog-category{display:flex;flex-direction:column;margin-bottom:40px}.miam-catalog-category .miam-catalog-category__header{align-items:flex-end;display:flex;flex-direction:row;margin-bottom:16px}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__left{flex:1}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__left .miam-catalog-category__title{-webkit-tap-highlight-color:transparent;color:var(--m-color-black);cursor:pointer;font-size:24px;font-weight:700;line-height:34px;margin-bottom:4px;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}@media (min-width:1022px){.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__left .miam-catalog-category__title:hover{text-decoration:underline}}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__left .miam-catalog-category__subtitle{color:var(--m-color-black);font-size:14px;line-height:22px}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__right{align-items:center;display:flex}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__right .miam-catalog-category__link{-webkit-tap-highlight-color:transparent;color:var(--m-color-primary);cursor:pointer;font-size:16px;line-height:24px}@media (min-width:1022px){.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__right .miam-catalog-category__link:hover{text-decoration:underline}}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__right ng-miam-icon{margin-top:3px}.miam-catalog-category .miam-catalog-category__header .icon-container{cursor:pointer;margin-bottom:3px;transform:rotate(-90deg)}.miam-catalog-category .miam-catalog-category__content{height:calc(var(--m-catalog-card-height) + var(--m-catalog-cards-spacing));margin:calc(0px - var(--m-catalog-cards-spacing)/2);overflow:hidden;padding:0;position:relative;width:calc(100% + var(--m-catalog-cards-spacing))}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__cards{display:flex;flex-direction:row;flex-wrap:wrap;transition-duration:.5s}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__cards .miam-catalog-category__loader{color:var(--m-color-grey-text);font-size:20px;font-weight:700;text-align:center;width:100%}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__cards .miam-catalog-category__loader .miam-loader{height:80px;margin-bottom:16px;margin-left:calc(50% - 40px);margin-top:80px;width:80px}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__slider__left,.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__slider__right{display:none}@media (max-width:1095px){.miam-catalog-category .miam-catalog-category__content{overflow-x:auto}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__cards{flex-wrap:nowrap}}@media (max-width:607px){.miam-catalog-category .miam-catalog-category__header{align-items:flex-start;flex-direction:column;margin-bottom:8px}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__left{margin-bottom:4px}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__left .miam-catalog-category__title{margin-bottom:0}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__right{align-self:flex-end}}"], encapsulation: 2, changeDetection: 0 });
20588
+ }, directives: [i2.NgIf, IconComponent, i2.NgForOf, LoaderComponent, CatalogRecipeCardComponent, CatalogArticleCardComponent], pipes: [i2.AsyncPipe], styles: [".miam-catalog-category__slider{-webkit-backdrop-filter:blur(12px);align-items:center;backdrop-filter:blur(12px);background-color:rgba(32,32,32,.3);cursor:pointer;display:flex;height:calc(100% - 28px);justify-content:center;margin:12px 0 16px;position:absolute;top:0;width:48px}@media (max-width:1022px){.miam-catalog-category__slider{display:none}}.miam-catalog-category{display:flex;flex-direction:column;margin-bottom:40px}.miam-catalog-category .miam-catalog-category__header{align-items:flex-end;display:flex;flex-direction:row;margin-bottom:16px}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__left{flex:1}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__left .miam-catalog-category__title{-webkit-tap-highlight-color:transparent;color:var(--m-color-black);cursor:pointer;font-size:24px;font-weight:700;line-height:34px;margin-bottom:4px;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}@media (min-width:1022px){.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__left .miam-catalog-category__title:hover{text-decoration:underline}}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__left .miam-catalog-category__subtitle{color:var(--m-color-black);font-size:14px;line-height:22px}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__right{align-items:center;display:flex}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__right .miam-catalog-category__link{-webkit-tap-highlight-color:transparent;color:var(--m-color-primary);cursor:pointer;font-size:16px;line-height:24px}@media (min-width:1022px){.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__right .miam-catalog-category__link:hover{text-decoration:underline}}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__right ng-miam-icon{margin-top:3px}.miam-catalog-category .miam-catalog-category__header .icon-container{cursor:pointer;margin-bottom:3px;transform:rotate(-90deg)}.miam-catalog-category .miam-catalog-category__content{height:calc(var(--m-catalog-card-height) + var(--m-catalog-cards-spacing));margin:calc(0px - var(--m-catalog-cards-spacing)/2);overflow:hidden;padding:0;position:relative;width:calc(100% + var(--m-catalog-cards-spacing))}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__cards{display:flex;flex-direction:row;flex-wrap:wrap;transition-duration:.5s}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__cards .miam-catalog-category__loader{color:var(--m-color-grey-text);font-size:20px;font-weight:700;text-align:center;width:100%}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__cards .miam-catalog-category__loader .miam-loader{height:80px;margin-bottom:16px;margin-left:calc(50% - 40px);margin-top:80px;width:80px}@media (max-width:1095px){.miam-catalog-category .miam-catalog-category__content{overflow-x:auto}.miam-catalog-category .miam-catalog-category__content .miam-catalog-category__cards{flex-wrap:nowrap}}@media (max-width:607px){.miam-catalog-category .miam-catalog-category__header{align-items:flex-start;flex-direction:column;margin-bottom:8px}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__left{margin-bottom:4px}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__left .miam-catalog-category__title{margin-bottom:0}.miam-catalog-category .miam-catalog-category__header .miam-catalog-category__right{align-self:flex-end}}"], encapsulation: 2, changeDetection: 0 });
20733
20589
  /*@__PURE__*/ (function () {
20734
20590
  i0.ɵsetClassMetadata(CatalogCategoryComponent, [{
20735
20591
  type: i0.Component,
@@ -23509,10 +23365,6 @@
23509
23365
  RecipeCatalogComponent.prototype.onFilterCollapsed = function () {
23510
23366
  this.isFilterCollapsed = !this.isFilterCollapsed;
23511
23367
  this.cdr.detectChanges();
23512
- // to trigger after the detectChanges because we need to alread have the display change to update cards
23513
- this.categoriesComp.forEach(function (cat) {
23514
- cat.updateWidth();
23515
- });
23516
23368
  };
23517
23369
  RecipeCatalogComponent.prototype.goToCreatePage = function (recipe) {
23518
23370
  if (recipe === void 0) { recipe = null; }
@@ -26490,7 +26342,7 @@
26490
26342
  i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(2, 1, line_r8));
26491
26343
  }
26492
26344
  }
26493
- var _c6$3 = function (a0) { return { rotate: a0 }; };
26345
+ var _c6$2 = function (a0) { return { rotate: a0 }; };
26494
26346
  var _c7$1 = function (a0) { return { wrap: a0 }; };
26495
26347
  function RecipesHistoryComponent_div_6_Template(rf, ctx) {
26496
26348
  if (rf & 1) {
@@ -26517,7 +26369,7 @@
26517
26369
  i0.ɵɵadvance(3);
26518
26370
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(4, 5, group_r6.date));
26519
26371
  i0.ɵɵadvance(2);
26520
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(7, _c6$3, !group_r6.show));
26372
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(7, _c6$2, !group_r6.show));
26521
26373
  i0.ɵɵadvance(1);
26522
26374
  i0.ɵɵproperty("iconName", ctx_r2.icon.ChevronDown);
26523
26375
  i0.ɵɵadvance(1);