ng-miam 3.5.8 → 3.5.9

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.
@@ -11574,7 +11574,7 @@
11574
11574
  i0.ɵɵadvance(1);
11575
11575
  i0.ɵɵproperty("ngIf", ctx_r8.blockStates == null ? null : ctx_r8.blockStates.value == null ? null : ctx_r8.blockStates.value.overlayOpen);
11576
11576
  i0.ɵɵadvance(1);
11577
- i0.ɵɵproperty("ngIf", !i0.ɵɵpipeBind1(4, 3, ctx_r8.loading) && (!ctx_r8.lines || ctx_r8.lines.length === 0));
11577
+ i0.ɵɵproperty("ngIf", !i0.ɵɵpipeBind1(4, 3, ctx_r8.isLoading) && (!ctx_r8.lines || ctx_r8.lines.length === 0));
11578
11578
  }
11579
11579
  }
11580
11580
  function BasketPreviewBlockComponent_div_0_ng_container_2_div_3_Template(rf, ctx) {
@@ -11603,7 +11603,7 @@
11603
11603
  i0.ɵɵadvance(1);
11604
11604
  i0.ɵɵproperty("ngIf", ctx_r6.showLines);
11605
11605
  i0.ɵɵadvance(1);
11606
- i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(4, 3, ctx_r6.loading));
11606
+ i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(4, 3, ctx_r6.isLoading));
11607
11607
  }
11608
11608
  }
11609
11609
  function BasketPreviewBlockComponent_div_0_Template(rf, ctx) {
@@ -11652,17 +11652,19 @@
11652
11652
  this.displayItemsUnitaryPrice = false;
11653
11653
  this.statsUpdated = new i0.EventEmitter();
11654
11654
  this.guestCountChanged = new i0.EventEmitter();
11655
- this.loading = new i0.EventEmitter(false);
11655
+ this.loading = new i0.EventEmitter(true);
11656
11656
  this.showLines = true;
11657
11657
  this.corsIssues = false;
11658
11658
  this.icon = exports.Icon;
11659
11659
  this.isMobile = false;
11660
+ this.isLoading = new rxjs.BehaviorSubject(true);
11660
11661
  this.subscriptions = [];
11661
11662
  this.linesHashes = {};
11662
11663
  this.isMobile = this.mediaMatcher.matchMedia('(max-width: 1023px)').matches;
11663
11664
  }
11664
11665
  BasketPreviewBlockComponent.prototype.ngOnInit = function () {
11665
11666
  var _this = this;
11667
+ this.emitLoading();
11666
11668
  this.blockStates = new rxjs.BehaviorSubject({ currentOpenLine: null, overlayOpen: false, lineComponent: null });
11667
11669
  this.subscriptions = [
11668
11670
  this.contextService.getCORSIssuesState().subscribe(function (res) {
@@ -11672,11 +11674,11 @@
11672
11674
  this.blockStates.subscribe(function (newState) { return _this.handelblockState(newState); }),
11673
11675
  rxjs.combineLatest([this.listsService.list$, this.posService.pos$]).pipe(operators.skipWhile(function (results) { return !results[0] || !results[1]; }), operators.tap(function (results) {
11674
11676
  var list = results[0];
11675
- _this.loading.emit(list.attributes['recipes-infos'] && list.attributes['recipes-infos'].length > 0);
11677
+ _this.isLoading.next(list.attributes['recipes-infos'] && list.attributes['recipes-infos'].length > 0);
11676
11678
  _this.cdr.detectChanges();
11677
11679
  })).subscribe(),
11678
11680
  this.basketsService.basketPreview$.pipe(operators.map(function (preview) { return (preview && _this.recipeId) ? preview.filter(function (line) { return line.id === _this.recipeId; }) : preview; }), operators.skipWhile(function (preview) { var _a; return !preview || preview.length === 0 || preview.length !== ((_a = _this.listsService.list$.value) === null || _a === void 0 ? void 0 : _a.recipeInfos.length); }), operators.tap(function (preview) { return _this.refreshPreview(preview); })).subscribe(function () {
11679
- _this.loading.emit(false);
11681
+ _this.isLoading.next(false);
11680
11682
  _this.cdr.detectChanges();
11681
11683
  }),
11682
11684
  this.basketsService.basketStats$.pipe(operators.tap(function (stats) { return _this.statsUpdated.emit(stats); })).subscribe()
@@ -11685,6 +11687,12 @@
11685
11687
  BasketPreviewBlockComponent.prototype.ngOnDestroy = function () {
11686
11688
  this.subscriptions.forEach(function (sub) { return sub.unsubscribe(); });
11687
11689
  };
11690
+ BasketPreviewBlockComponent.prototype.emitLoading = function () {
11691
+ var _this = this;
11692
+ this.isLoading.subscribe(function (l) {
11693
+ _this.loading.emit(l);
11694
+ });
11695
+ };
11688
11696
  BasketPreviewBlockComponent.prototype.toggleLines = function () {
11689
11697
  this.showLines = !this.showLines;
11690
11698
  this.cdr.detectChanges();