ng-miam 4.1.2 → 4.2.0
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 +324 -97
- 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/abstracts/abstract-recipe-card.component.js +4 -3
- package/esm2015/lib/_services/context.service.js +12 -2
- package/esm2015/lib/_services/groceries-lists.service.js +25 -3
- package/esm2015/lib/_services/recipes.service.js +3 -3
- package/esm2015/lib/_utils/synchro-basket/basket-handler.js +4 -1
- package/esm2015/lib/_utils/synchro-basket/basket-handling/baskets-comparator.js +4 -1
- package/esm2015/lib/_utils/synchro-basket/basket-handling/comparison-map.js +7 -1
- package/esm2015/lib/_web-components/basket-preview/basket-preview-block/basket-preview-block.component.js +14 -5
- package/esm2015/lib/_web-components/catalog-category/catalog-category.component.js +1 -1
- package/esm2015/lib/_web-components/catalog-header/catalog-header.component.js +20 -20
- package/esm2015/lib/_web-components/list-scan/files-inputs/files-inputs.component.js +2 -2
- package/esm2015/lib/_web-components/modal/modal.component.js +57 -16
- package/esm2015/lib/_web-components/modal/modal.module.js +6 -2
- package/esm2015/lib/_web-components/recipe-details/recipe-details.component.js +2 -2
- package/esm2015/lib/_web-components/recipe-modal/recipe-modal.component.js +51 -18
- package/esm2015/lib/_web-components/recipe-tags/recipe-tags.component.js +108 -36
- package/fesm2015/ng-miam.js +299 -98
- package/fesm2015/ng-miam.js.map +1 -1
- package/lib/_services/context.service.d.ts +3 -0
- package/lib/_services/groceries-lists.service.d.ts +11 -0
- package/lib/_services/recipes.service.d.ts +3 -1
- package/lib/_utils/synchro-basket/basket-handler.d.ts +1 -0
- package/lib/_utils/synchro-basket/basket-handling/baskets-comparator.d.ts +1 -0
- package/lib/_utils/synchro-basket/basket-handling/comparison-map.d.ts +1 -0
- package/lib/_web-components/basket-preview/basket-preview-block/basket-preview-block.component.d.ts +3 -2
- package/lib/_web-components/modal/modal.component.d.ts +5 -1
- package/lib/_web-components/modal/modal.module.d.ts +2 -1
- package/lib/_web-components/recipe-modal/recipe-modal.component.d.ts +14 -4
- package/lib/_web-components/recipe-tags/recipe-tags.component.d.ts +5 -1
- package/package.json +1 -1
|
@@ -55,6 +55,7 @@ export declare class ContextService {
|
|
|
55
55
|
qty: number;
|
|
56
56
|
}[]) => Observable<any>;
|
|
57
57
|
initBasketSynchro: () => void;
|
|
58
|
+
setAllProductsAsRetailers: () => void;
|
|
58
59
|
};
|
|
59
60
|
basketMapper: {
|
|
60
61
|
hasPayment: (callback: () => boolean) => () => boolean;
|
|
@@ -77,6 +78,8 @@ export declare class ContextService {
|
|
|
77
78
|
reset: () => import("rxjs").Subscription;
|
|
78
79
|
addRecipe: (recipeId: any, guests: any) => Observable<object>;
|
|
79
80
|
hasRecipe: (recipeId: any) => Observable<boolean>;
|
|
81
|
+
createTemporaryList: () => void;
|
|
82
|
+
refresh: () => BehaviorSubject<import("../_models/groceries-list").GroceriesList>;
|
|
80
83
|
};
|
|
81
84
|
pos: {
|
|
82
85
|
load: (posId: any) => void;
|
|
@@ -39,6 +39,17 @@ export declare class GroceriesListsService extends Service<GroceriesList> {
|
|
|
39
39
|
updateRecipeGuests(recipeId: string, guests: number): Observable<GroceriesList>;
|
|
40
40
|
removeRecipesFromList(): Observable<GroceriesList>;
|
|
41
41
|
addEntriesFromPicture(file: File, include?: any[], disableIngredientsMatching?: boolean): Observable<GroceriesList>;
|
|
42
|
+
/**
|
|
43
|
+
* Will create a temporary list and set it in _list$. The list won't be marked as current and thus
|
|
44
|
+
* will not be reused
|
|
45
|
+
*/
|
|
46
|
+
createTemporaryList(): void;
|
|
47
|
+
/**
|
|
48
|
+
* save() returns an object that isn't a resource so methods aren't attached, so we have to do a little trick
|
|
49
|
+
* @param res result of the save
|
|
50
|
+
* @returns correct GroceriesList with the right attributes & methods
|
|
51
|
+
*/
|
|
52
|
+
private afterSave;
|
|
42
53
|
private saveList;
|
|
43
54
|
private assignList;
|
|
44
55
|
static ɵfac: i0.ɵɵFactoryDef<GroceriesListsService, never>;
|
|
@@ -24,6 +24,7 @@ interface RecipeDisplay {
|
|
|
24
24
|
previewAllowed: boolean;
|
|
25
25
|
recipe: Recipe;
|
|
26
26
|
previewMode: boolean;
|
|
27
|
+
wasAdded: boolean;
|
|
27
28
|
}
|
|
28
29
|
export declare class RecipesService extends Service<Recipe> {
|
|
29
30
|
private http;
|
|
@@ -73,10 +74,11 @@ export declare class RecipesService extends Service<Recipe> {
|
|
|
73
74
|
guests?: any;
|
|
74
75
|
previewMode?: boolean;
|
|
75
76
|
}): void;
|
|
76
|
-
displayObject(recipe: Recipe, { previewAllowed, guests, previewMode }: {
|
|
77
|
+
displayObject(recipe: Recipe, { previewAllowed, guests, previewMode, wasAdded }: {
|
|
77
78
|
previewAllowed?: boolean;
|
|
78
79
|
guests?: any;
|
|
79
80
|
previewMode?: boolean;
|
|
81
|
+
wasAdded?: boolean;
|
|
80
82
|
}): void;
|
|
81
83
|
toggleHelper(): void;
|
|
82
84
|
hide(): void;
|
|
@@ -12,6 +12,7 @@ export declare class BasketHandler {
|
|
|
12
12
|
comparator: BasketsComparator;
|
|
13
13
|
basketWrapper: BasketWrapper;
|
|
14
14
|
constructor(wrapper: BasketWrapper);
|
|
15
|
+
setAllProductsAsRetailers(): void;
|
|
15
16
|
/**
|
|
16
17
|
* Handle payment first if necessary then start basket synchronization
|
|
17
18
|
*/
|
|
@@ -13,6 +13,7 @@ export declare class BasketsComparator {
|
|
|
13
13
|
* @param {*} comparisonMapClass
|
|
14
14
|
*/
|
|
15
15
|
constructor(basketWrapper: any, existingRetailerBasket: any, firstMiamBasket: any, comparisonMapClass?: typeof ComparisonMap);
|
|
16
|
+
setAllProductsAsRetailers(): void;
|
|
16
17
|
/**
|
|
17
18
|
*
|
|
18
19
|
* @param {*} basket
|
package/lib/_web-components/basket-preview/basket-preview-block/basket-preview-block.component.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OnInit, OnDestroy, ChangeDetectorRef, EventEmitter } from '@angular/core';
|
|
1
|
+
import { OnInit, OnDestroy, ChangeDetectorRef, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { BehaviorSubject } from 'rxjs';
|
|
3
3
|
import { GroceriesListsService } from '../../../_services/groceries-lists.service';
|
|
4
4
|
import { BasketsService, BasketStats } from '../../../_services/baskets.service';
|
|
@@ -9,7 +9,7 @@ import { ContextService } from '../../../_services/context.service';
|
|
|
9
9
|
import { Icon } from '../../../_types/icon.enum';
|
|
10
10
|
import { MediaMatcher } from '@angular/cdk/layout';
|
|
11
11
|
import * as i0 from "@angular/core";
|
|
12
|
-
export declare class BasketPreviewBlockComponent implements OnInit, OnDestroy {
|
|
12
|
+
export declare class BasketPreviewBlockComponent implements OnInit, OnDestroy, OnChanges {
|
|
13
13
|
private cdr;
|
|
14
14
|
listsService: GroceriesListsService;
|
|
15
15
|
posService: PointOfSalesService;
|
|
@@ -39,6 +39,7 @@ export declare class BasketPreviewBlockComponent implements OnInit, OnDestroy {
|
|
|
39
39
|
private linesHashes;
|
|
40
40
|
constructor(cdr: ChangeDetectorRef, listsService: GroceriesListsService, posService: PointOfSalesService, contextService: ContextService, basketsService: BasketsService, mediaMatcher: MediaMatcher);
|
|
41
41
|
ngOnInit(): void;
|
|
42
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
42
43
|
ngOnDestroy(): void;
|
|
43
44
|
toggleLines(): void;
|
|
44
45
|
removeRecipe(line: BasketPreviewLine): void;
|
|
@@ -12,6 +12,10 @@ export declare class ModalComponent implements OnChanges {
|
|
|
12
12
|
confirmButtonText: string;
|
|
13
13
|
cancelButtonText: string;
|
|
14
14
|
isAngularComponent: boolean;
|
|
15
|
+
confirmButtonIsLoading: boolean;
|
|
16
|
+
cancelButtonIsLoading: boolean;
|
|
17
|
+
confirmButtonDisabled: boolean;
|
|
18
|
+
cancelButtonDisabled: boolean;
|
|
15
19
|
noHeaderMode: boolean;
|
|
16
20
|
containerElement: HTMLElement;
|
|
17
21
|
expandedChange: EventEmitter<boolean>;
|
|
@@ -30,5 +34,5 @@ export declare class ModalComponent implements OnChanges {
|
|
|
30
34
|
private handlePageScroll;
|
|
31
35
|
private handleContainerScroll;
|
|
32
36
|
static ɵfac: i0.ɵɵFactoryDef<ModalComponent, never>;
|
|
33
|
-
static ɵcmp: i0.ɵɵComponentDefWithMeta<ModalComponent, "ng-miam-modal", never, { "title": "title"; "expanded": "expanded"; "confirmButtonText": "confirmButtonText"; "cancelButtonText": "cancelButtonText"; "isAngularComponent": "isAngularComponent"; "noHeaderMode": "noHeaderMode"; "containerElement": "containerElement"; }, { "expandedChange": "expandedChange"; "close": "close"; "cancel": "cancel"; "confirm": "confirm"; }, never, ["*"]>;
|
|
37
|
+
static ɵcmp: i0.ɵɵComponentDefWithMeta<ModalComponent, "ng-miam-modal", never, { "title": "title"; "expanded": "expanded"; "confirmButtonText": "confirmButtonText"; "cancelButtonText": "cancelButtonText"; "isAngularComponent": "isAngularComponent"; "confirmButtonIsLoading": "confirmButtonIsLoading"; "cancelButtonIsLoading": "cancelButtonIsLoading"; "confirmButtonDisabled": "confirmButtonDisabled"; "cancelButtonDisabled": "cancelButtonDisabled"; "noHeaderMode": "noHeaderMode"; "containerElement": "containerElement"; }, { "expandedChange": "expandedChange"; "close": "close"; "cancel": "cancel"; "confirm": "confirm"; }, never, ["*"]>;
|
|
34
38
|
}
|
|
@@ -4,8 +4,9 @@ import * as i1 from "./modal.component";
|
|
|
4
4
|
import * as i2 from "@angular/common";
|
|
5
5
|
import * as i3 from "@angular/forms";
|
|
6
6
|
import * as i4 from "../../_components/components.module";
|
|
7
|
+
import * as i5 from "../loader/loader.module";
|
|
7
8
|
export declare class ModalModule {
|
|
8
9
|
constructor(injector: Injector);
|
|
9
|
-
static ɵmod: i0.ɵɵNgModuleDefWithMeta<ModalModule, [typeof i1.ModalComponent], [typeof i2.CommonModule, typeof i3.FormsModule, typeof i4.ComponentsModule], [typeof i1.ModalComponent]>;
|
|
10
|
+
static ɵmod: i0.ɵɵNgModuleDefWithMeta<ModalModule, [typeof i1.ModalComponent], [typeof i2.CommonModule, typeof i3.FormsModule, typeof i4.ComponentsModule, typeof i5.LoaderModule], [typeof i1.ModalComponent]>;
|
|
10
11
|
static ɵinj: i0.ɵɵInjectorDef<ModalModule>;
|
|
11
12
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ChangeDetectorRef, ElementRef, OnInit } from '@angular/core';
|
|
1
|
+
import { ChangeDetectorRef, ElementRef, EventEmitter, OnInit } from '@angular/core';
|
|
2
2
|
import { Recipe } from '../../_models';
|
|
3
|
-
import { GroceriesListsService, RecipesService } from '../../_services';
|
|
3
|
+
import { BasketsService, GroceriesListsService, RecipesService } from '../../_services';
|
|
4
4
|
import { PrintService } from '../../_services/print.service';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export declare class RecipeModalComponent implements OnInit {
|
|
@@ -9,18 +9,28 @@ export declare class RecipeModalComponent implements OnInit {
|
|
|
9
9
|
private printService;
|
|
10
10
|
private elRef;
|
|
11
11
|
private groceriesListsService;
|
|
12
|
+
private basketsService;
|
|
12
13
|
recipe: Recipe;
|
|
13
14
|
show: boolean;
|
|
14
15
|
previewMode: boolean;
|
|
15
16
|
previewAllowed: boolean;
|
|
17
|
+
canCloseModal: boolean;
|
|
18
|
+
removeIsLoading: boolean;
|
|
19
|
+
basketChangedSinceOpened: boolean;
|
|
20
|
+
recipeWasAdded: boolean;
|
|
21
|
+
hasChangesOnClose: EventEmitter<boolean>;
|
|
16
22
|
private detailsComponent;
|
|
17
|
-
constructor(cdr: ChangeDetectorRef, recipesService: RecipesService, printService: PrintService, elRef: ElementRef, groceriesListsService: GroceriesListsService);
|
|
23
|
+
constructor(cdr: ChangeDetectorRef, recipesService: RecipesService, printService: PrintService, elRef: ElementRef, groceriesListsService: GroceriesListsService, basketsService: BasketsService);
|
|
18
24
|
ngOnInit(): void;
|
|
19
25
|
hide(): void;
|
|
20
26
|
togglePreviewMode(): void;
|
|
21
27
|
removeRecipe(): void;
|
|
22
28
|
updateRecipeGuests(guests: number): void;
|
|
23
29
|
recipeChanged(): void;
|
|
30
|
+
/**
|
|
31
|
+
* If the preview is opened and loading, block the user from closing the modal
|
|
32
|
+
*/
|
|
33
|
+
setModalClosable(previewLoading: boolean): void;
|
|
24
34
|
static ɵfac: i0.ɵɵFactoryDef<RecipeModalComponent, never>;
|
|
25
|
-
static ɵcmp: i0.ɵɵComponentDefWithMeta<RecipeModalComponent, "ng-miam-recipe-modal", never, {}, {}, never, never>;
|
|
35
|
+
static ɵcmp: i0.ɵɵComponentDefWithMeta<RecipeModalComponent, "ng-miam-recipe-modal", never, {}, { "hasChangesOnClose": "hasChangesOnClose"; }, never, never>;
|
|
26
36
|
}
|
|
@@ -11,6 +11,7 @@ export declare class RecipeTagsComponent implements OnChanges, AfterViewInit, On
|
|
|
11
11
|
private contexteservice;
|
|
12
12
|
extId: string;
|
|
13
13
|
recipeDetailPreviewAllowed: boolean;
|
|
14
|
+
reduce: boolean;
|
|
14
15
|
tags: QueryList<ElementRef>;
|
|
15
16
|
icon: typeof Icon;
|
|
16
17
|
recipePreviewLines: BasketPreviewLine[];
|
|
@@ -18,6 +19,8 @@ export declare class RecipeTagsComponent implements OnChanges, AfterViewInit, On
|
|
|
18
19
|
rowCount: number;
|
|
19
20
|
lastItemIndexOfFirstRow: number;
|
|
20
21
|
isListOpen: boolean;
|
|
22
|
+
modalTitle: string;
|
|
23
|
+
modalIsOpened: boolean;
|
|
21
24
|
protected subscriptions: Subscription[];
|
|
22
25
|
constructor(cdr: ChangeDetectorRef, basketService: BasketsService, contexteservice: ContextService);
|
|
23
26
|
ngOnChanges(simpleChanges: SimpleChanges): void;
|
|
@@ -33,6 +36,7 @@ export declare class RecipeTagsComponent implements OnChanges, AfterViewInit, On
|
|
|
33
36
|
detectWrappedTags(tags: QueryList<ElementRef>): void;
|
|
34
37
|
toggleRecipe(id: string): void;
|
|
35
38
|
toggleList(): void;
|
|
39
|
+
toggleModal(): void;
|
|
36
40
|
static ɵfac: i0.ɵɵFactoryDef<RecipeTagsComponent, never>;
|
|
37
|
-
static ɵcmp: i0.ɵɵComponentDefWithMeta<RecipeTagsComponent, "ng-miam-recipe-tags", never, { "extId": "extId"; "recipeDetailPreviewAllowed": "recipeDetailPreviewAllowed"; }, {}, never, never>;
|
|
41
|
+
static ɵcmp: i0.ɵɵComponentDefWithMeta<RecipeTagsComponent, "ng-miam-recipe-tags", never, { "extId": "extId"; "recipeDetailPreviewAllowed": "recipeDetailPreviewAllowed"; "reduce": "reduce"; }, {}, never, never>;
|
|
38
42
|
}
|