ng-miam 4.0.5 → 4.0.6

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.
@@ -13625,7 +13625,12 @@
13625
13625
  this.isMobile = this.mediaMatcher.matchMedia('(max-width: 1023px)').matches;
13626
13626
  }
13627
13627
  ModalComponent.prototype.ngOnChanges = function () {
13628
- this.handlePageScroll();
13628
+ if (this.containerElement) {
13629
+ this.handleContainerScroll();
13630
+ }
13631
+ else {
13632
+ this.handlePageScroll();
13633
+ }
13629
13634
  };
13630
13635
  ModalComponent.prototype.onClose = function () {
13631
13636
  this.hide();
@@ -13667,10 +13672,34 @@
13667
13672
  }
13668
13673
  this.context.globalScrollableElement.style.overflow = 'initial';
13669
13674
  };
13675
+ ModalComponent.prototype.handleContainerScroll = function () {
13676
+ if (this.isMobile) {
13677
+ if (this.expanded) {
13678
+ this.containerElement.style.overflow = 'hidden';
13679
+ this.scrollPosition = window.scrollY;
13680
+ this.containerElement.style.position = 'fixed';
13681
+ this.containerElement.style.top = -this.scrollPosition + "px";
13682
+ }
13683
+ else {
13684
+ if (this.scrollPosition !== null) {
13685
+ this.containerElement.style.overflow = 'initial';
13686
+ this.containerElement.style.position = 'initial';
13687
+ window.scrollTo(0, this.scrollPosition);
13688
+ this.scrollPosition = null;
13689
+ }
13690
+ }
13691
+ return;
13692
+ }
13693
+ if (this.expanded) {
13694
+ this.containerElement.style.overflow = 'hidden';
13695
+ return;
13696
+ }
13697
+ this.containerElement.style.overflow = 'initial';
13698
+ };
13670
13699
  return ModalComponent;
13671
13700
  }());
13672
13701
  ModalComponent.ɵfac = function ModalComponent_Factory(t) { return new (t || ModalComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i1$2.MediaMatcher), i0.ɵɵdirectiveInject(ContextService)); };
13673
- ModalComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ModalComponent, selectors: [["ng-miam-modal"]], inputs: { title: "title", expanded: "expanded", confirmButtonText: "confirmButtonText", cancelButtonText: "cancelButtonText", isAngularComponent: "isAngularComponent", noHeaderMode: "noHeaderMode" }, outputs: { expandedChange: "expandedChange", close: "close", cancel: "cancel", confirm: "confirm" }, features: [i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c1$c, decls: 1, vars: 1, consts: [[4, "ngIf"], [1, "miam-shadow-overlay", 3, "click"], [1, "miam-modal", 3, "ngClass"], [1, "miam-modal__container"], [1, "miam-modal__header"], [1, "miam-modal__title"], ["primaryColor", "var(--m-color-grey-text-dark)", 1, "miam-modal__close__icon", 3, "width", "height", "iconName", "click"], [4, "ngIf", "ngIfElse"], ["isWebC", ""], [1, "miam-modal__actions"], ["class", "m-button-secondary", 3, "click", 4, "ngIf"], ["class", "m-button-primary", 3, "click", 4, "ngIf"], ["name", "modal-content"], [1, "m-button-secondary", 3, "click"], [1, "m-button-primary", 3, "click"]], template: function ModalComponent_Template(rf, ctx) {
13702
+ ModalComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ModalComponent, selectors: [["ng-miam-modal"]], inputs: { title: "title", expanded: "expanded", confirmButtonText: "confirmButtonText", cancelButtonText: "cancelButtonText", isAngularComponent: "isAngularComponent", noHeaderMode: "noHeaderMode", containerElement: "containerElement" }, outputs: { expandedChange: "expandedChange", close: "close", cancel: "cancel", confirm: "confirm" }, features: [i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c1$c, decls: 1, vars: 1, consts: [[4, "ngIf"], [1, "miam-shadow-overlay", 3, "click"], [1, "miam-modal", 3, "ngClass"], [1, "miam-modal__container"], [1, "miam-modal__header"], [1, "miam-modal__title"], ["primaryColor", "var(--m-color-grey-text-dark)", 1, "miam-modal__close__icon", 3, "width", "height", "iconName", "click"], [4, "ngIf", "ngIfElse"], ["isWebC", ""], [1, "miam-modal__actions"], ["class", "m-button-secondary", 3, "click", 4, "ngIf"], ["class", "m-button-primary", 3, "click", 4, "ngIf"], ["name", "modal-content"], [1, "m-button-secondary", 3, "click"], [1, "m-button-primary", 3, "click"]], template: function ModalComponent_Template(rf, ctx) {
13674
13703
  if (rf & 1) {
13675
13704
  i0.ɵɵprojectionDef();
13676
13705
  i0.ɵɵtemplate(0, ModalComponent_ng_container_0_Template, 14, 12, "ng-container", 0);
@@ -13678,7 +13707,7 @@
13678
13707
  if (rf & 2) {
13679
13708
  i0.ɵɵproperty("ngIf", ctx.expanded);
13680
13709
  }
13681
- }, directives: [i3.NgIf, i3.NgClass, IconComponent], styles: [".miam-shadow-overlay{-webkit-animation-duration:.3s;-webkit-animation-name:show;-webkit-animation-timing-function:ease-in-out;-webkit-tap-highlight-color:transparent;animation-duration:.3s;animation-name:show;animation-timing-function:ease-in-out;background:var(--m-color-black);height:100vh;left:0;opacity:.6;position:fixed;top:0;width:100vw;z-index:var(--m-z-index-modal-overlay)}.miam-modal{-webkit-animation-duration:.5s;-webkit-animation-name:open;-webkit-animation-timing-function:cubic-bezier(.75,0,.2,1);animation-duration:.5s;animation-name:open;animation-timing-function:cubic-bezier(.75,0,.2,1);background-color:var(--m-color-white);height:100%;max-width:1200px;overflow-x:hidden;overflow-y:auto;position:fixed;right:0;top:0;width:80%;z-index:var(--m-z-index-modal)}@media print{.miam-modal{height:unset!important;overflow-y:unset!important;position:unset!important}}@-webkit-keyframes open{0%{right:-1200px}to{right:0}}@keyframes open{0%{right:-1200px}to{right:0}}.miam-modal.with-header .miam-modal__header{background-color:var(--m-color-grey);color:var(--m-color-grey-text-dark);display:flex;flex-direction:row;justify-content:space-between}.miam-modal.with-header .miam-modal__title{color:var(--m-color-grey-text-dark);font-size:var(--m-font-size-large);font-weight:700;overflow:hidden;padding:20px;text-overflow:ellipsis}.miam-modal.with-header .miam-modal__title:first-letter{color:var(--m-color-primary);font-size:130%}.miam-modal.with-header .miam-modal__close__icon{-webkit-tap-highlight-color:transparent;height:40px}.miam-modal.without-header .miam-modal__close__icon{border-radius:var(--m-border-radius-circle);display:flex;height:60px;justify-items:center;position:absolute;right:0;top:0;z-index:var(--m-z-index-position-absolute-high)}.miam-modal .miam-modal__container{display:flex;flex-direction:column;height:100%;position:relative}.miam-modal .miam-modal__container .miam-modal__close__icon{cursor:pointer;margin:10px;transition-duration:.5s}@media print{.miam-modal .miam-modal__container .miam-modal__close__icon{display:none}}@media (min-width:1022px){.miam-modal .miam-modal__container .miam-modal__close__icon:hover{transform:rotate(180deg)}}.miam-modal .miam-modal__container .miam-modal__actions{align-items:center;display:flex;justify-content:space-evenly;margin:20px}@-webkit-keyframes show{0%{opacity:0}to{opacity:.6}}@keyframes show{0%{opacity:0}to{opacity:.6}}@media (max-width:1022px){.miam-modal{-webkit-animation-duration:.5s;-webkit-animation-name:openBottomSheet;-webkit-animation-timing-function:cubic-bezier(.075,.82,.165,1);animation-duration:.5s;animation-name:openBottomSheet;animation-timing-function:cubic-bezier(.075,.82,.165,1);background-color:var(--m-color-white);bottom:0;left:0;max-width:100vw;overflow-x:hidden;overflow-y:hidden;position:fixed;right:0;top:100vh;top:unset;width:100vw;z-index:var(--m-z-index-modal)}.miam-modal.with-header .miam-modal__header{align-items:center;background-color:unset}.miam-modal.with-header .miam-modal__title{padding:0 0 0 16px}.miam-modal.with-header ng-miam-icon.miam-modal__close__icon .icon-container{align-items:center;border:1px solid var(--m-color-light-slate);border-radius:36px;display:grid}.miam-modal.with-header ng-miam-icon.miam-modal__close__icon .icon-container svg{fill:var(--m-color-white);height:24px!important;width:24px!important}.miam-modal.without-header .miam-modal__close__icon{height:28px;z-index:8}.miam-modal .miam-modal__actions{background-color:var(--m-color-white);bottom:0;left:0;margin:0!important;position:fixed;right:0;z-index:8}.miam-modal .miam-modal__actions button{font-size:12px;height:44px;margin:16px 5px 5px 0;padding:5px}.miam-modal .miam-modal__actions button:first-of-type{margin:16px 5px 5px}@-webkit-keyframes openBottomSheet{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes openBottomSheet{0%{transform:translateY(100%)}to{transform:translateY(0)}}}"], encapsulation: 2, changeDetection: 0 });
13710
+ }, directives: [i3.NgIf, i3.NgClass, IconComponent], styles: [".miam-shadow-overlay{-webkit-animation-duration:.3s;-webkit-animation-name:show;-webkit-animation-timing-function:ease-in-out;-webkit-tap-highlight-color:transparent;animation-duration:.3s;animation-name:show;animation-timing-function:ease-in-out;background:var(--m-color-black);height:100vh;left:0;opacity:.6;position:fixed;top:0;width:100vw;z-index:var(--m-z-index-modal-overlay)}.miam-modal{-webkit-animation-duration:.5s;-webkit-animation-name:open;-webkit-animation-timing-function:cubic-bezier(.75,0,.2,1);animation-duration:.5s;animation-name:open;animation-timing-function:cubic-bezier(.75,0,.2,1);background-color:var(--m-color-white);height:100%;max-width:1200px;overflow-x:hidden;overflow-y:auto;position:fixed;right:0;top:0;width:80%;z-index:var(--m-z-index-modal)}@media print{.miam-modal{height:unset!important;overflow-y:unset!important;position:unset!important}}@-webkit-keyframes open{0%{right:-1200px}to{right:0}}@keyframes open{0%{right:-1200px}to{right:0}}.miam-modal.with-header .miam-modal__header{background-color:var(--m-color-grey);color:var(--m-color-grey-text-dark);display:flex;flex-direction:row;justify-content:space-between}.miam-modal.with-header .miam-modal__title{color:var(--m-color-grey-text-dark);font-size:var(--m-font-size-large);font-weight:700;overflow:hidden;padding:20px;text-overflow:ellipsis}.miam-modal.with-header .miam-modal__close__icon{-webkit-tap-highlight-color:transparent;height:40px}.miam-modal.without-header .miam-modal__close__icon{border-radius:var(--m-border-radius-circle);display:flex;height:60px;justify-items:center;position:absolute;right:0;top:0;z-index:var(--m-z-index-position-absolute-high)}.miam-modal .miam-modal__container{display:flex;flex-direction:column;height:100%;position:relative}.miam-modal .miam-modal__container .miam-modal__close__icon{cursor:pointer;margin:10px}@media print{.miam-modal .miam-modal__container .miam-modal__close__icon{display:none}}.miam-modal .miam-modal__container .miam-modal__actions{align-items:center;display:flex;justify-content:space-evenly;margin:20px}@-webkit-keyframes show{0%{opacity:0}to{opacity:.6}}@keyframes show{0%{opacity:0}to{opacity:.6}}@media (max-width:1022px){.miam-modal{-webkit-animation-duration:.5s;-webkit-animation-name:openBottomSheet;-webkit-animation-timing-function:cubic-bezier(.075,.82,.165,1);animation-duration:.5s;animation-name:openBottomSheet;animation-timing-function:cubic-bezier(.075,.82,.165,1);background-color:var(--m-color-white);bottom:0;left:0;max-width:100vw;overflow-x:hidden;overflow-y:hidden;position:fixed;right:0;top:100vh;top:unset;width:100vw;z-index:var(--m-z-index-modal)}.miam-modal.with-header .miam-modal__header{align-items:center;background-color:unset}.miam-modal.with-header .miam-modal__title{padding:0 0 0 16px}.miam-modal.with-header ng-miam-icon.miam-modal__close__icon .icon-container{align-items:center;border:1px solid var(--m-color-light-slate);border-radius:36px;display:grid}.miam-modal.with-header ng-miam-icon.miam-modal__close__icon .icon-container svg{fill:var(--m-color-white);height:24px!important;width:24px!important}.miam-modal.without-header .miam-modal__close__icon{height:28px;z-index:8}.miam-modal .miam-modal__actions{background-color:var(--m-color-white);bottom:0;left:0;margin:0!important;position:fixed;right:0;z-index:8}.miam-modal .miam-modal__actions button{font-size:12px;height:44px;margin:16px 5px 5px 0;padding:5px}.miam-modal .miam-modal__actions button:first-of-type{margin:16px 5px 5px}@-webkit-keyframes openBottomSheet{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes openBottomSheet{0%{transform:translateY(100%)}to{transform:translateY(0)}}}"], encapsulation: 2, changeDetection: 0 });
13682
13711
  /*@__PURE__*/ (function () {
13683
13712
  i0.ɵsetClassMetadata(ModalComponent, [{
13684
13713
  type: i0.Component,
@@ -13701,6 +13730,8 @@
13701
13730
  type: i0.Input
13702
13731
  }], noHeaderMode: [{
13703
13732
  type: i0.Input
13733
+ }], containerElement: [{
13734
+ type: i0.Input
13704
13735
  }], expandedChange: [{
13705
13736
  type: i0.Output
13706
13737
  }], close: [{
@@ -13867,7 +13898,7 @@
13867
13898
  i0.ɵɵadvance(1);
13868
13899
  i0.ɵɵproperty("ngIf", ctx.isMobile == true)("ngIfElse", _r1);
13869
13900
  }
13870
- }, directives: [i3.NgClass, i3.NgIf, IconComponent, LoaderComponent], styles: [".miam-list-scan__files-inputs{display:inline-block;position:relative}.miam-list-scan__files-inputs.overlay{bottom:20px;position:fixed;right:20px}.miam-list-scan__files-inputs .inputfile{height:.1px;opacity:0;overflow:hidden;position:absolute;width:.1px;z-index:-1}.miam-list-scan__files-inputs .miam-list-scan__files-inputs__label,.miam-list-scan__files-inputs .miam-list-scan__files-inputs__label__file,.miam-list-scan__files-inputs .miam-list-scan__files-inputs__label__photo{font-size:14px;font-style:normal;font-weight:600;line-height:16px;max-height:50px;min-width:0}.miam-list-scan__files-inputs .miam-list-scan__files-inputs__label__file ng-miam-icon,.miam-list-scan__files-inputs .miam-list-scan__files-inputs__label__photo ng-miam-icon,.miam-list-scan__files-inputs .miam-list-scan__files-inputs__label ng-miam-icon{margin:0}.miam-list-scan__files-inputs .miam-list-scan__files-inputs__label .button-label,.miam-list-scan__files-inputs .miam-list-scan__files-inputs__label__file .button-label,.miam-list-scan__files-inputs .miam-list-scan__files-inputs__label__photo .button-label{margin-left:10px}.miam-list-scan__files-inputs .miam-list-scan__files-inputs__label__file{background-color:var(--m-color-white);color:var(--m-color-black)}.miam-list-scan__files-inputs .miam-list-scan__files-inputs__label__file ng-miam-icon svg path{fill:var(--m-color-black)}"], encapsulation: 2, changeDetection: 0 });
13901
+ }, directives: [i3.NgClass, i3.NgIf, IconComponent, LoaderComponent], styles: [".miam-list-scan__files-inputs{display:inline-block;position:relative}.miam-list-scan__files-inputs.overlay{bottom:20px;position:fixed;right:20px}.miam-list-scan__files-inputs .inputfile{height:.1px;opacity:0;overflow:hidden;position:absolute;width:.1px;z-index:-1}.miam-list-scan__files-inputs .miam-list-scan__files-inputs__label,.miam-list-scan__files-inputs .miam-list-scan__files-inputs__label__file,.miam-list-scan__files-inputs .miam-list-scan__files-inputs__label__photo{font-size:14px;font-style:normal;font-weight:600;line-height:16px;max-height:50px;min-width:0}.miam-list-scan__files-inputs .miam-list-scan__files-inputs__label__file ng-miam-icon,.miam-list-scan__files-inputs .miam-list-scan__files-inputs__label__photo ng-miam-icon,.miam-list-scan__files-inputs .miam-list-scan__files-inputs__label ng-miam-icon{margin:0}.miam-list-scan__files-inputs .miam-list-scan__files-inputs__label .button-label,.miam-list-scan__files-inputs .miam-list-scan__files-inputs__label__file .button-label,.miam-list-scan__files-inputs .miam-list-scan__files-inputs__label__photo .button-label{margin-left:10px}.miam-list-scan__files-inputs .miam-list-scan__files-inputs__label__photo .loader{border-top-color:var(--m-color-primary)}.miam-list-scan__files-inputs .miam-list-scan__files-inputs__label__file{background-color:var(--m-color-white);color:var(--m-color-black)}.miam-list-scan__files-inputs .miam-list-scan__files-inputs__label__file ng-miam-icon svg path{fill:var(--m-color-black)}"], encapsulation: 2, changeDetection: 0 });
13871
13902
  /*@__PURE__*/ (function () {
13872
13903
  i0.ɵsetClassMetadata(ListScanFilesInputsComponent, [{
13873
13904
  type: i0.Component,
@@ -14055,6 +14086,7 @@
14055
14086
  this.basketsService = basketsService;
14056
14087
  this.entries = [];
14057
14088
  this.closed = new i0.EventEmitter();
14089
+ this.cancelled = new i0.EventEmitter();
14058
14090
  this.confirmed = new i0.EventEmitter();
14059
14091
  this.icon = exports.Icon;
14060
14092
  this.subscriptions = [];
@@ -14068,13 +14100,7 @@
14068
14100
  e.delete();
14069
14101
  };
14070
14102
  ListScanIngredientsListComponent.prototype.cancel = function () {
14071
- var _this = this;
14072
- if (this.entries.length === 0) {
14073
- return this.closed.emit();
14074
- }
14075
- this.subscriptions.push(rxjs.forkJoin(this.entries.map(function (e) { return e.delete(); })).pipe(
14076
- // Reload the basket to make sure the injector receives the update
14077
- operators.switchMap(function () { return _this.basketsService.reloadBasket(); })).subscribe(function () { return _this.closed.emit(); }));
14103
+ this.cancelled.emit();
14078
14104
  };
14079
14105
  // Save modified entries, reload basket, and move to next step
14080
14106
  ListScanIngredientsListComponent.prototype.confirm = function () {
@@ -14090,7 +14116,7 @@
14090
14116
  return ListScanIngredientsListComponent;
14091
14117
  }());
14092
14118
  ListScanIngredientsListComponent.ɵfac = function ListScanIngredientsListComponent_Factory(t) { return new (t || ListScanIngredientsListComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(BasketsService)); };
14093
- ListScanIngredientsListComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ListScanIngredientsListComponent, selectors: [["ng-miam-list-scan-ingredients-list"]], inputs: { entries: "entries", title: "title" }, outputs: { closed: "closed", confirmed: "confirmed" }, decls: 14, vars: 4, consts: [[1, "miam-list-scan__ingredients-list"], [1, "miam-list-scan__ingredients-list__header"], ["width", "24", "height", "24", 3, "iconName", "click"], [1, "miam-list-scan__ingredients-list__content"], ["class", "miam-list-scan__ingredients-list__entry", 4, "ngFor", "ngForOf"], [1, "miam-list-scan__ingredients-list__controls"], [1, "m-button-grey", 3, "click"], [1, "m-button-primary", 3, "click"], ["width", "24", "height", "24", 3, "iconName"], [1, "miam-list-scan__ingredients-list__entry"], [1, "miam-list-scan__ingredients-list__entry__delete", 3, "click"], ["primaryColor", "var(--m-color-grey-text)", 3, "iconName"], [1, "miam-list-scan__ingredients-list__entry__name"], [1, "entry-label"], ["type", "text", 3, "ngModel", "ngModelChange"], [1, "miam-list-scan__ingredients-list__entry__quantity"], ["type", "number", 3, "ngModel", "ngModelChange"], [1, "miam-list-scan__ingredients-list__entry__unit"]], template: function ListScanIngredientsListComponent_Template(rf, ctx) {
14119
+ ListScanIngredientsListComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ListScanIngredientsListComponent, selectors: [["ng-miam-list-scan-ingredients-list"]], inputs: { entries: "entries", title: "title" }, outputs: { closed: "closed", cancelled: "cancelled", confirmed: "confirmed" }, decls: 14, vars: 4, consts: [[1, "miam-list-scan__ingredients-list"], [1, "miam-list-scan__ingredients-list__header"], ["width", "24", "height", "24", 3, "iconName", "click"], [1, "miam-list-scan__ingredients-list__content"], ["class", "miam-list-scan__ingredients-list__entry", 4, "ngFor", "ngForOf"], [1, "miam-list-scan__ingredients-list__controls"], [1, "m-button-grey", 3, "click"], [1, "m-button-primary", 3, "click"], ["width", "24", "height", "24", 3, "iconName"], [1, "miam-list-scan__ingredients-list__entry"], [1, "miam-list-scan__ingredients-list__entry__delete", 3, "click"], ["primaryColor", "var(--m-color-grey-text)", 3, "iconName"], [1, "miam-list-scan__ingredients-list__entry__name"], [1, "entry-label"], ["type", "text", 3, "ngModel", "ngModelChange"], [1, "miam-list-scan__ingredients-list__entry__quantity"], ["type", "number", 3, "ngModel", "ngModelChange"], [1, "miam-list-scan__ingredients-list__entry__unit"]], template: function ListScanIngredientsListComponent_Template(rf, ctx) {
14094
14120
  if (rf & 1) {
14095
14121
  i0.ɵɵelementStart(0, "div", 0);
14096
14122
  i0.ɵɵelementStart(1, "div", 1);
@@ -14146,6 +14172,8 @@
14146
14172
  type: i0.Input
14147
14173
  }], closed: [{
14148
14174
  type: i0.Output
14175
+ }], cancelled: [{
14176
+ type: i0.Output
14149
14177
  }], confirmed: [{
14150
14178
  type: i0.Output
14151
14179
  }] });
@@ -14362,7 +14390,7 @@
14362
14390
  function ListScanComponent_ng_miam_list_scan_files_inputs_1_Template(rf, ctx) {
14363
14391
  if (rf & 1) {
14364
14392
  var _r5_1 = i0.ɵɵgetCurrentView();
14365
- i0.ɵɵelementStart(0, "ng-miam-list-scan-files-inputs", 6);
14393
+ i0.ɵɵelementStart(0, "ng-miam-list-scan-files-inputs", 7);
14366
14394
  i0.ɵɵlistener("entriesAdded", function ListScanComponent_ng_miam_list_scan_files_inputs_1_Template_ng_miam_list_scan_files_inputs_entriesAdded_0_listener($event) { i0.ɵɵrestoreView(_r5_1); var ctx_r4 = i0.ɵɵnextContext(); return ctx_r4.showIngredients($event); });
14367
14395
  i0.ɵɵelementEnd();
14368
14396
  }
@@ -14374,7 +14402,7 @@
14374
14402
  function ListScanComponent_ng_miam_list_scan_overlay_button_2_Template(rf, ctx) {
14375
14403
  if (rf & 1) {
14376
14404
  var _r7_1 = i0.ɵɵgetCurrentView();
14377
- i0.ɵɵelementStart(0, "ng-miam-list-scan-overlay-button", 7);
14405
+ i0.ɵɵelementStart(0, "ng-miam-list-scan-overlay-button", 8);
14378
14406
  i0.ɵɵlistener("entriesAdded", function ListScanComponent_ng_miam_list_scan_overlay_button_2_Template_ng_miam_list_scan_overlay_button_entriesAdded_0_listener($event) { i0.ɵɵrestoreView(_r7_1); var ctx_r6 = i0.ɵɵnextContext(); return ctx_r6.showIngredients($event); });
14379
14407
  i0.ɵɵelementEnd();
14380
14408
  }
@@ -14386,8 +14414,8 @@
14386
14414
  function ListScanComponent_ng_miam_list_scan_ingredients_list_4_Template(rf, ctx) {
14387
14415
  if (rf & 1) {
14388
14416
  var _r9_1 = i0.ɵɵgetCurrentView();
14389
- i0.ɵɵelementStart(0, "ng-miam-list-scan-ingredients-list", 8);
14390
- i0.ɵɵlistener("closed", function ListScanComponent_ng_miam_list_scan_ingredients_list_4_Template_ng_miam_list_scan_ingredients_list_closed_0_listener() { i0.ɵɵrestoreView(_r9_1); var ctx_r8 = i0.ɵɵnextContext(); return ctx_r8.hideIngredients(); })("confirmed", function ListScanComponent_ng_miam_list_scan_ingredients_list_4_Template_ng_miam_list_scan_ingredients_list_confirmed_0_listener() { i0.ɵɵrestoreView(_r9_1); var ctx_r10 = i0.ɵɵnextContext(); return ctx_r10.showBasketPreview(); });
14417
+ i0.ɵɵelementStart(0, "ng-miam-list-scan-ingredients-list", 9);
14418
+ i0.ɵɵlistener("closed", function ListScanComponent_ng_miam_list_scan_ingredients_list_4_Template_ng_miam_list_scan_ingredients_list_closed_0_listener() { i0.ɵɵrestoreView(_r9_1); var ctx_r8 = i0.ɵɵnextContext(); return ctx_r8.hideIngredients(); })("cancelled", function ListScanComponent_ng_miam_list_scan_ingredients_list_4_Template_ng_miam_list_scan_ingredients_list_cancelled_0_listener() { i0.ɵɵrestoreView(_r9_1); var ctx_r10 = i0.ɵɵnextContext(); return ctx_r10.cancel(); })("confirmed", function ListScanComponent_ng_miam_list_scan_ingredients_list_4_Template_ng_miam_list_scan_ingredients_list_confirmed_0_listener() { i0.ɵɵrestoreView(_r9_1); var ctx_r11 = i0.ɵɵnextContext(); return ctx_r11.showBasketPreview(); });
14391
14419
  i0.ɵɵelementEnd();
14392
14420
  }
14393
14421
  if (rf & 2) {
@@ -14397,9 +14425,9 @@
14397
14425
  }
14398
14426
  function ListScanComponent_ng_miam_list_scan_basket_preview_5_Template(rf, ctx) {
14399
14427
  if (rf & 1) {
14400
- var _r12_1 = i0.ɵɵgetCurrentView();
14401
- i0.ɵɵelementStart(0, "ng-miam-list-scan-basket-preview", 9);
14402
- i0.ɵɵlistener("closed", function ListScanComponent_ng_miam_list_scan_basket_preview_5_Template_ng_miam_list_scan_basket_preview_closed_0_listener() { i0.ɵɵrestoreView(_r12_1); var ctx_r11 = i0.ɵɵnextContext(); return ctx_r11.hideBasketPreview(true); })("cancelled", function ListScanComponent_ng_miam_list_scan_basket_preview_5_Template_ng_miam_list_scan_basket_preview_cancelled_0_listener() { i0.ɵɵrestoreView(_r12_1); var ctx_r13 = i0.ɵɵnextContext(); return ctx_r13.returnToIngredients(); })("removedEntries", function ListScanComponent_ng_miam_list_scan_basket_preview_5_Template_ng_miam_list_scan_basket_preview_removedEntries_0_listener() { i0.ɵɵrestoreView(_r12_1); var ctx_r14 = i0.ɵɵnextContext(); return ctx_r14.hideBasketPreview(false); });
14428
+ var _r13_1 = i0.ɵɵgetCurrentView();
14429
+ i0.ɵɵelementStart(0, "ng-miam-list-scan-basket-preview", 10);
14430
+ i0.ɵɵlistener("closed", function ListScanComponent_ng_miam_list_scan_basket_preview_5_Template_ng_miam_list_scan_basket_preview_closed_0_listener() { i0.ɵɵrestoreView(_r13_1); var ctx_r12 = i0.ɵɵnextContext(); return ctx_r12.hideBasketPreview(true); })("cancelled", function ListScanComponent_ng_miam_list_scan_basket_preview_5_Template_ng_miam_list_scan_basket_preview_cancelled_0_listener() { i0.ɵɵrestoreView(_r13_1); var ctx_r14 = i0.ɵɵnextContext(); return ctx_r14.returnToIngredients(); })("removedEntries", function ListScanComponent_ng_miam_list_scan_basket_preview_5_Template_ng_miam_list_scan_basket_preview_removedEntries_0_listener() { i0.ɵɵrestoreView(_r13_1); var ctx_r15 = i0.ɵɵnextContext(); return ctx_r15.hideBasketPreview(false); });
14403
14431
  i0.ɵɵelementEnd();
14404
14432
  }
14405
14433
  if (rf & 2) {
@@ -14423,6 +14451,7 @@
14423
14451
  this.entries = [];
14424
14452
  this.ingredientsShown = false;
14425
14453
  this.basketPreviewShown = false;
14454
+ this.cancelConfirmationShown = false;
14426
14455
  this.subscriptions = [];
14427
14456
  }
14428
14457
  ListScanComponent.prototype.ngOnDestroy = function () {
@@ -14454,10 +14483,19 @@
14454
14483
  this.confirmed.emit();
14455
14484
  }
14456
14485
  };
14486
+ ListScanComponent.prototype.cancel = function () {
14487
+ this.elementToStopScrolling = document.getElementsByClassName('miam-list-scan__content')[0];
14488
+ this.cancelConfirmationShown = true;
14489
+ this.cdr.detectChanges();
14490
+ };
14491
+ ListScanComponent.prototype.closeCancelConfirmationModal = function () {
14492
+ this.cancelConfirmationShown = false;
14493
+ this.cdr.detectChanges();
14494
+ };
14457
14495
  /**
14458
14496
  * Cancel scan by removing all entries from basket & close modal
14459
14497
  */
14460
- ListScanComponent.prototype.cancel = function () {
14498
+ ListScanComponent.prototype.cancelAndRemove = function () {
14461
14499
  var _this = this;
14462
14500
  if (this.entries.length === 0) {
14463
14501
  this.ingredientsShown = false;
@@ -14476,7 +14514,7 @@
14476
14514
  return ListScanComponent;
14477
14515
  }());
14478
14516
  ListScanComponent.ɵfac = function ListScanComponent_Factory(t) { return new (t || ListScanComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(BasketsService)); };
14479
- ListScanComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ListScanComponent, selectors: [["ng-miam-list-scan"]], inputs: { floatingButton: "floatingButton", overlay: "overlay", disableIngredientsMatching: "disableIngredientsMatching", productMatchingTitle: "productMatchingTitle", replaceItemTitle: "replaceItemTitle", ctaDesktopText: "ctaDesktopText", ctaMobileText: "ctaMobileText", scanResultsTitle: "scanResultsTitle" }, outputs: { confirmed: "confirmed" }, decls: 6, vars: 8, consts: [[1, "miam-list-scan"], [3, "disableIngredientsMatching", "desktopText", "mobileText", "entriesAdded", 4, "ngIf"], [3, "overlay", "entriesAdded", 4, "ngIf"], [3, "isAngularComponent", "noHeaderMode", "expanded", "expandedChange", "close"], ["class", "miam-list-scan__content", 3, "entries", "title", "closed", "confirmed", 4, "ngIf"], ["class", "miam-list-scan__content", 3, "entries", "title", "replaceItemTitle", "closed", "cancelled", "removedEntries", 4, "ngIf"], [3, "disableIngredientsMatching", "desktopText", "mobileText", "entriesAdded"], [3, "overlay", "entriesAdded"], [1, "miam-list-scan__content", 3, "entries", "title", "closed", "confirmed"], [1, "miam-list-scan__content", 3, "entries", "title", "replaceItemTitle", "closed", "cancelled", "removedEntries"]], template: function ListScanComponent_Template(rf, ctx) {
14517
+ ListScanComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ListScanComponent, selectors: [["ng-miam-list-scan"]], inputs: { floatingButton: "floatingButton", overlay: "overlay", disableIngredientsMatching: "disableIngredientsMatching", productMatchingTitle: "productMatchingTitle", replaceItemTitle: "replaceItemTitle", ctaDesktopText: "ctaDesktopText", ctaMobileText: "ctaMobileText", scanResultsTitle: "scanResultsTitle" }, outputs: { confirmed: "confirmed" }, decls: 7, vars: 12, consts: [[1, "miam-list-scan"], [3, "disableIngredientsMatching", "desktopText", "mobileText", "entriesAdded", 4, "ngIf"], [3, "overlay", "entriesAdded", 4, "ngIf"], [1, "miam-list-scan__result", 3, "isAngularComponent", "noHeaderMode", "expanded", "expandedChange", "close"], ["class", "miam-list-scan__content", 3, "entries", "title", "closed", "cancelled", "confirmed", 4, "ngIf"], ["class", "miam-list-scan__content", 3, "entries", "title", "replaceItemTitle", "closed", "cancelled", "removedEntries", 4, "ngIf"], ["title", "Souhaitez-vous vraiment abandonner votre liste ?", "cancelButtonText", "Annuler", "confirmButtonText", "Abandonner", 1, "miam-list-scan__confirmation", 3, "isAngularComponent", "expanded", "noHeaderMode", "containerElement", "expandedChange", "close", "cancel", "confirm"], [3, "disableIngredientsMatching", "desktopText", "mobileText", "entriesAdded"], [3, "overlay", "entriesAdded"], [1, "miam-list-scan__content", 3, "entries", "title", "closed", "cancelled", "confirmed"], [1, "miam-list-scan__content", 3, "entries", "title", "replaceItemTitle", "closed", "cancelled", "removedEntries"]], template: function ListScanComponent_Template(rf, ctx) {
14480
14518
  if (rf & 1) {
14481
14519
  i0.ɵɵelementStart(0, "div", 0);
14482
14520
  i0.ɵɵtemplate(1, ListScanComponent_ng_miam_list_scan_files_inputs_1_Template, 1, 3, "ng-miam-list-scan-files-inputs", 1);
@@ -14486,6 +14524,9 @@
14486
14524
  i0.ɵɵtemplate(4, ListScanComponent_ng_miam_list_scan_ingredients_list_4_Template, 1, 2, "ng-miam-list-scan-ingredients-list", 4);
14487
14525
  i0.ɵɵtemplate(5, ListScanComponent_ng_miam_list_scan_basket_preview_5_Template, 1, 3, "ng-miam-list-scan-basket-preview", 5);
14488
14526
  i0.ɵɵelementEnd();
14527
+ i0.ɵɵelementStart(6, "ng-miam-modal", 6);
14528
+ i0.ɵɵlistener("expandedChange", function ListScanComponent_Template_ng_miam_modal_expandedChange_6_listener($event) { return ctx.cancelConfirmationShown = $event; })("close", function ListScanComponent_Template_ng_miam_modal_close_6_listener() { return ctx.closeCancelConfirmationModal(); })("cancel", function ListScanComponent_Template_ng_miam_modal_cancel_6_listener() { return ctx.closeCancelConfirmationModal(); })("confirm", function ListScanComponent_Template_ng_miam_modal_confirm_6_listener() { return ctx.cancelAndRemove(); });
14529
+ i0.ɵɵelementEnd();
14489
14530
  i0.ɵɵelementEnd();
14490
14531
  }
14491
14532
  if (rf & 2) {
@@ -14499,8 +14540,10 @@
14499
14540
  i0.ɵɵproperty("ngIf", ctx.ingredientsShown);
14500
14541
  i0.ɵɵadvance(1);
14501
14542
  i0.ɵɵproperty("ngIf", ctx.basketPreviewShown);
14543
+ i0.ɵɵadvance(1);
14544
+ i0.ɵɵproperty("isAngularComponent", true)("expanded", ctx.cancelConfirmationShown)("noHeaderMode", false)("containerElement", ctx.elementToStopScrolling);
14502
14545
  }
14503
- }, directives: [i3.NgIf, ModalComponent, ListScanFilesInputsComponent, ListScanOverlayButtonComponent, ListScanIngredientsListComponent, ListScanBasketPreviewComponent], styles: [".miam-list-scan .miam-list-scan__content{height:100%}.miam-modal{max-width:600px}.miam-modal .miam-modal__container .miam-modal__actions{display:none}"], encapsulation: 2, changeDetection: 0 });
14546
+ }, directives: [i3.NgIf, ModalComponent, ListScanFilesInputsComponent, ListScanOverlayButtonComponent, ListScanIngredientsListComponent, ListScanBasketPreviewComponent], styles: [".miam-list-scan .miam-list-scan__content{height:100%}.miam-list-scan__result .miam-modal{max-width:600px}.miam-list-scan__result .miam-modal .miam-modal__container .miam-modal__actions{display:none}.miam-list-scan__confirmation .miam-shadow-overlay{z-index:var(--m-z-index-modal)}.miam-list-scan__confirmation .miam-modal{-webkit-animation-name:unset;animation-name:unset;height:auto;right:50%;top:50%;transform:translateX(50%) translateY(-50%);width:auto}.miam-list-scan__confirmation .miam-modal .miam-modal__title{color:var(--m-color-black)}@media (max-width:1023px){.miam-list-scan__confirmation .miam-modal{-webkit-animation-name:unset;animation-name:unset;height:132px;transform:translateY(-50%);width:100%}}"], encapsulation: 2, changeDetection: 0 });
14504
14547
  /*@__PURE__*/ (function () {
14505
14548
  i0.ɵsetClassMetadata(ListScanComponent, [{
14506
14549
  type: i0.Component,