@filip.mazev/modal 0.0.2 → 0.0.5

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.
Files changed (36) hide show
  1. package/fesm2022/filip.mazev-modal.mjs +96 -60
  2. package/fesm2022/filip.mazev-modal.mjs.map +1 -1
  3. package/package.json +4 -5
  4. package/src/assets/default-theme.css +1 -1
  5. package/types/filip.mazev-modal.d.ts +510 -0
  6. package/index.d.ts +0 -5
  7. package/lib/classes/generic-modal-config.d.ts +0 -26
  8. package/lib/classes/generic-modal-ref.d.ts +0 -52
  9. package/lib/classes/generic-modal-style.config.d.ts +0 -17
  10. package/lib/classes/generic-modal.d.ts +0 -19
  11. package/lib/components/generic-modal.d.ts +0 -60
  12. package/lib/components/views/backdrop/modal-backdrop.d.ts +0 -8
  13. package/lib/components/views/banner/modal-banner.d.ts +0 -9
  14. package/lib/components/views/centered/modal-centered.d.ts +0 -23
  15. package/lib/components/views/side/modal-side.d.ts +0 -26
  16. package/lib/components/views/swipeable/modal-swipeable.d.ts +0 -32
  17. package/lib/constants/generic-modal-animation.constants.d.ts +0 -4
  18. package/lib/constants/generic-modal-common.constants.d.ts +0 -1
  19. package/lib/constants/generic-modal-swipe.constants.d.ts +0 -3
  20. package/lib/constants/generic-modal-text.constants.d.ts +0 -4
  21. package/lib/enums/generic-modal-errors.enum.d.ts +0 -6
  22. package/lib/enums/generic-modal-state.enum.d.ts +0 -6
  23. package/lib/enums/generic-modal-warnings.enum.d.ts +0 -7
  24. package/lib/interfaces/igeneric-close-result.interface.d.ts +0 -5
  25. package/lib/interfaces/igeneric-confirm-close.interface.d.ts +0 -24
  26. package/lib/interfaces/igeneric-modal-component.interface.d.ts +0 -28
  27. package/lib/interfaces/igeneric-modal-config.interface.d.ts +0 -45
  28. package/lib/interfaces/igeneric-modal-ref.interface.d.ts +0 -25
  29. package/lib/interfaces/igeneric-modal-service.interface.d.ts +0 -22
  30. package/lib/interfaces/igeneric-modal-style-config.interface.d.ts +0 -28
  31. package/lib/interfaces/igeneric-modal-view.interface.d.ts +0 -18
  32. package/lib/interfaces/igeneric-swipeable-modal-config.d.ts +0 -5
  33. package/lib/services/generic-modal.service.d.ts +0 -40
  34. package/lib/tokens/generic-modal-data.token.d.ts +0 -2
  35. package/lib/types/modal.types.d.ts +0 -2
  36. package/public-api.d.ts +0 -29
@@ -1,60 +0,0 @@
1
- import { ChangeDetectorRef, ComponentRef, ElementRef, QueryList, TemplateRef, ViewContainerRef } from "@angular/core";
2
- import { Subject, Observable } from "rxjs";
3
- import { GenericModal } from "../classes/generic-modal";
4
- import { GenericModalConfig } from "../classes/generic-modal-config";
5
- import { IGenericModalComponenet } from "../interfaces/igeneric-modal-component.interface";
6
- import { ModalCentered } from "./views/centered/modal-centered";
7
- import { ModalSide } from "./views/side/modal-side";
8
- import { ModalCloseMode } from "../types/modal.types";
9
- import { WindowDimensions } from "common-parts";
10
- import * as i0 from "@angular/core";
11
- export declare class GenericModalComponent<D = unknown, R = any, C extends GenericModal<D, R> = GenericModal<D, R>> implements IGenericModalComponenet<D, R, C> {
12
- private modalService;
13
- private windowDimensionService;
14
- private scrollLockService;
15
- private deviceTypeService;
16
- cdr: ChangeDetectorRef;
17
- readonly afterClose: import("@angular/core").OutputEmitterRef<void>;
18
- readonly animationDuration: number;
19
- componentRef: ComponentRef<C>;
20
- config?: GenericModalConfig<D>;
21
- closeFunction?: Function;
22
- backdropClickSubject: Subject<MouseEvent>;
23
- backdropClick: Observable<MouseEvent>;
24
- private _isOpen;
25
- get isOpen(): boolean;
26
- private set isOpen(value);
27
- isSwipeableModalActive: boolean;
28
- isAnimated: boolean;
29
- isCentered: boolean;
30
- isSide: boolean;
31
- protected hasBanner: boolean;
32
- protected hasDefaultContentWrapperClass: boolean;
33
- private isConfirmCloseModalOpen;
34
- private isSpecialMobileOverflowHandlingEnabled;
35
- private isScrollDisabled;
36
- protected windowDimensions: WindowDimensions;
37
- private unsubscribe$;
38
- modalContainer?: ElementRef;
39
- sideModalComponents?: QueryList<ModalSide>;
40
- centeredModalComponents?: QueryList<ModalCentered>;
41
- contentTemplate?: TemplateRef<HTMLElement>;
42
- dynamicContainer?: ViewContainerRef;
43
- constructor();
44
- ngOnInit(): void;
45
- ngAfterViewInit(): void;
46
- ngOnDestroy(): void;
47
- private createSubscriptions;
48
- private handleWindowDimensionChange;
49
- private initParamsFromConfig;
50
- close(state?: ModalCloseMode, result?: R | undefined, fromInsideInteraction?: boolean, forceClose?: boolean): void;
51
- private handleClose;
52
- protected onBackdropClick(event: MouseEvent): void;
53
- private shouldOpenConfirmCloseModal;
54
- private shouldOpenConfirmCloseModalSelfCheck;
55
- private getSwipeableModal;
56
- private resetSwipeableModalPosition;
57
- private setSwipeableModalFinishedState;
58
- static ɵfac: i0.ɵɵFactoryDeclaration<GenericModalComponent<any, any, any>, never>;
59
- static ɵcmp: i0.ɵɵComponentDeclaration<GenericModalComponent<any, any, any>, "generic-modal", never, {}, { "afterClose": "afterClose"; }, never, never, true, never>;
60
- }
@@ -1,8 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- export declare class ModalBackdrop {
3
- readonly isAnimated: import("@angular/core").InputSignal<boolean>;
4
- readonly isOpen: import("@angular/core").InputSignal<boolean>;
5
- readonly click: import("@angular/core").OutputEmitterRef<MouseEvent>;
6
- static ɵfac: i0.ɵɵFactoryDeclaration<ModalBackdrop, never>;
7
- static ɵcmp: i0.ɵɵComponentDeclaration<ModalBackdrop, "modal-backdrop", never, { "isAnimated": { "alias": "isAnimated"; "required": false; "isSignal": true; }; "isOpen": { "alias": "isOpen"; "required": false; "isSignal": true; }; }, { "click": "click"; }, never, never, true, never>;
8
- }
@@ -1,9 +0,0 @@
1
- import { GenericModalConfig } from "../../../classes/generic-modal-config";
2
- import { ModalCloseMode } from "../../../types/modal.types";
3
- import * as i0 from "@angular/core";
4
- export declare class ModalBanner<D = unknown> {
5
- readonly config: import("@angular/core").InputSignal<GenericModalConfig<D, any, import("@filip.mazev/modal").GenericModal<any, undefined>> | undefined>;
6
- readonly close: import("@angular/core").OutputEmitterRef<ModalCloseMode | undefined>;
7
- static ɵfac: i0.ɵɵFactoryDeclaration<ModalBanner<any>, never>;
8
- static ɵcmp: i0.ɵɵComponentDeclaration<ModalBanner<any>, "modal-banner", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; }, { "close": "close"; }, never, never, true, never>;
9
- }
@@ -1,23 +0,0 @@
1
- import { QueryList } from "@angular/core";
2
- import { GenericModalConfig } from "../../../classes/generic-modal-config";
3
- import { IGenericModalView } from "../../../interfaces/igeneric-modal-view.interface";
4
- import { ModalCloseMode } from "../../../types/modal.types";
5
- import { ModalSwipeable } from "../swipeable/modal-swipeable";
6
- import * as i0 from "@angular/core";
7
- export declare class ModalCentered<D = unknown> implements IGenericModalView<D> {
8
- readonly config: import("@angular/core").InputSignal<GenericModalConfig<D, any, import("@filip.mazev/modal").GenericModal<any, undefined>> | undefined>;
9
- readonly isOpen: import("@angular/core").InputSignal<boolean>;
10
- readonly isAnimated: import("@angular/core").InputSignal<boolean>;
11
- readonly isSwipeableModalActive: import("@angular/core").InputSignal<boolean>;
12
- readonly animationDuration: import("@angular/core").InputSignal<number>;
13
- readonly hasDefaultContentWrapperClass: import("@angular/core").InputSignal<boolean>;
14
- readonly hasBanner: import("@angular/core").InputSignal<boolean>;
15
- readonly close: import("@angular/core").OutputEmitterRef<ModalCloseMode | undefined>;
16
- readonly onBackdropClick: import("@angular/core").OutputEmitterRef<MouseEvent>;
17
- swipeableComponents: QueryList<ModalSwipeable>;
18
- get modalClasses(): {
19
- [key: string]: boolean;
20
- };
21
- static ɵfac: i0.ɵɵFactoryDeclaration<ModalCentered<any>, never>;
22
- static ɵcmp: i0.ɵɵComponentDeclaration<ModalCentered<any>, "modal-centered", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; "isOpen": { "alias": "isOpen"; "required": true; "isSignal": true; }; "isAnimated": { "alias": "isAnimated"; "required": true; "isSignal": true; }; "isSwipeableModalActive": { "alias": "isSwipeableModalActive"; "required": true; "isSignal": true; }; "animationDuration": { "alias": "animationDuration"; "required": true; "isSignal": true; }; "hasDefaultContentWrapperClass": { "alias": "hasDefaultContentWrapperClass"; "required": true; "isSignal": true; }; "hasBanner": { "alias": "hasBanner"; "required": true; "isSignal": true; }; }, { "close": "close"; "onBackdropClick": "onBackdropClick"; }, never, ["*"], true, never>;
23
- }
@@ -1,26 +0,0 @@
1
- import { QueryList } from '@angular/core';
2
- import { GenericModalConfig } from '../../../classes/generic-modal-config';
3
- import { IGenericModalView } from '../../../interfaces/igeneric-modal-view.interface';
4
- import { ModalCloseMode } from '../../../types/modal.types';
5
- import { ModalSwipeable } from '../swipeable/modal-swipeable';
6
- import * as i0 from "@angular/core";
7
- export declare class ModalSide<D = unknown> implements IGenericModalView<D> {
8
- readonly config: import("@angular/core").InputSignal<GenericModalConfig<D, any, import("@filip.mazev/modal").GenericModal<any, undefined>> | undefined>;
9
- readonly isOpen: import("@angular/core").InputSignal<boolean>;
10
- private _innerIsOpen;
11
- set innerIsOpen(value: boolean);
12
- get innerIsOpen(): boolean;
13
- readonly isAnimated: import("@angular/core").InputSignal<boolean>;
14
- readonly isSwipeableModalActive: import("@angular/core").InputSignal<boolean>;
15
- readonly animationDuration: import("@angular/core").InputSignal<number>;
16
- readonly hasDefaultContentWrapperClass: import("@angular/core").InputSignal<boolean>;
17
- readonly hasBanner: import("@angular/core").InputSignal<boolean>;
18
- readonly close: import("@angular/core").OutputEmitterRef<ModalCloseMode | undefined>;
19
- swipeableComponents: QueryList<ModalSwipeable>;
20
- constructor();
21
- get modalClasses(): {
22
- [key: string]: boolean;
23
- };
24
- static ɵfac: i0.ɵɵFactoryDeclaration<ModalSide<any>, never>;
25
- static ɵcmp: i0.ɵɵComponentDeclaration<ModalSide<any>, "modal-side", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; "isOpen": { "alias": "isOpen"; "required": true; "isSignal": true; }; "isAnimated": { "alias": "isAnimated"; "required": true; "isSignal": true; }; "isSwipeableModalActive": { "alias": "isSwipeableModalActive"; "required": true; "isSignal": true; }; "animationDuration": { "alias": "animationDuration"; "required": true; "isSignal": true; }; "hasDefaultContentWrapperClass": { "alias": "hasDefaultContentWrapperClass"; "required": true; "isSignal": true; }; "hasBanner": { "alias": "hasBanner"; "required": true; "isSignal": true; }; }, { "close": "close"; }, never, ["*"], true, never>;
26
- }
@@ -1,32 +0,0 @@
1
- import { ElementRef, OnDestroy, OnInit } from '@angular/core';
2
- import { GenericModalConfig } from '../../../classes/generic-modal-config';
3
- import { ModalCloseMode } from '../../../types/modal.types';
4
- import * as i0 from "@angular/core";
5
- export declare class ModalSwipeable implements OnInit, OnDestroy {
6
- readonly config: import("@angular/core").InputSignal<GenericModalConfig<any, any, import("@filip.mazev/modal").GenericModal<any, undefined>> | undefined>;
7
- readonly isOpen: import("@angular/core").InputSignal<boolean>;
8
- readonly isAnimated: import("@angular/core").InputSignal<boolean>;
9
- readonly animationDuration: import("@angular/core").InputSignal<number>;
10
- readonly close: import("@angular/core").OutputEmitterRef<ModalCloseMode | undefined>;
11
- currentTranslateY: number;
12
- isSwipingVerticallyFinished: boolean;
13
- protected isSwipingVertically: boolean;
14
- protected downSwipeLimit: number;
15
- protected upSwipeLimit: number;
16
- protected windowInnerHeight: number;
17
- protected isTrackingSwipe: boolean;
18
- private isTouchActive;
19
- private swipeableModalInitiated;
20
- private globalPointerListenerAdded;
21
- private touchDetectionUnsubscribe$;
22
- verticalSwipeTarget?: ElementRef;
23
- modalContent?: ElementRef;
24
- ngOnInit(): void;
25
- ngOnDestroy(): void;
26
- private startVerticalSwipeDetection;
27
- private stopVerticalSwipeDetection;
28
- private initSwipeableModalParams;
29
- private monitorInputType;
30
- static ɵfac: i0.ɵɵFactoryDeclaration<ModalSwipeable, never>;
31
- static ɵcmp: i0.ɵɵComponentDeclaration<ModalSwipeable, "modal-swipeable", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; "isOpen": { "alias": "isOpen"; "required": true; "isSignal": true; }; "isAnimated": { "alias": "isAnimated"; "required": true; "isSignal": true; }; "animationDuration": { "alias": "animationDuration"; "required": true; "isSignal": true; }; }, { "close": "close"; }, never, ["*"], true, never>;
32
- }
@@ -1,4 +0,0 @@
1
- export declare const GENERIC_MODAL_DEFAULT_ANIM_DURATION = 175;
2
- export declare const GENERIC_MODAL_DEFAULT_INTERNAL_ANIM_DURATION = 350;
3
- export declare const GENERIC_MODAL_DEFAULT_ANIM_DURATION_MULTIPLIER_SMALL = 0.65;
4
- export declare const GENERIC_MODAL_DEFAULT_ANIM_DURATION_MULTIPLIER_LARGE = 0.85;
@@ -1 +0,0 @@
1
- export declare const EMPTY_STRING = "";
@@ -1,3 +0,0 @@
1
- export declare const GENERIC_MODAL_DOWN_SWIPE_LIMIT = 2;
2
- export declare const GENERIC_MODAL_UP_SWIPE_LIMIT = 1;
3
- export declare const GENERIC_MODAL_SWIPE_VELOCITY_THRESHOLD = 80;
@@ -1,4 +0,0 @@
1
- export declare const LOWEST_CHARACTER_CAP = 23;
2
- export declare const LOWER_CHARACTER_CAP = 33;
3
- export declare const MID_CHARACTER_CAP = 49;
4
- export declare const UPPER_CHARACTER_CAP = 60;
@@ -1,6 +0,0 @@
1
- export declare enum GenericModalErrors {
2
- MODAL_DOESNT_MATCH_THE_REQUESTED_TYPES = "The modal doesn't match the requested types.",
3
- PARENT_MODAL_CANT_BE_THE_SAME_AS_CHILD = "Parent modal cannot be the same as the child modal",
4
- PARENT_MODAL_NOT_FOUND = "Parent modal does not exist",
5
- PARENT_MODAL_NOT_PROVIDED = "No parent modal provided for multilevel modal"
6
- }
@@ -1,6 +0,0 @@
1
- export declare enum GenericModalState {
2
- OPEN = "open",
3
- OPENING = "opening",
4
- CLOSED = "closed",
5
- CLOSING = "closing"
6
- }
@@ -1,7 +0,0 @@
1
- export declare enum GenericModalWarnings {
2
- NO_PARENT_PROVIDED = "No parent modal provided for multilevel modal. Please provide a parent modal or set openAsMultilevel to false.",
3
- MULTILEVEL_INLINE_NOT_SUPPORTED = "As of this version, opening a multi-level modal from inline HTML is not possible. Please set openAsMultilevel to false or open your modal through the GenericModalService! Opening modal as normal modal.",
4
- MULTILEVEL_NO_PARENT = "Cannot open a multilevel modal with only one modal open. Please open another modal before opening a multilevel modal or set openAsMultilevel to false.",
5
- PARENT_MODAL_NOT_SET = "Error setting parent modal. Opening modal as normal modal",
6
- CONFIRM_MODAL_NESTING_NOT_SUPPORTED = "Cannot open a confirm modal from within a confirm modal. If you want to allow this behaviour, set bypassSelfCheck to true in the confirmCloseConfig."
7
- }
@@ -1,5 +0,0 @@
1
- import { ModalCloseMode } from "../types/modal.types";
2
- export interface IGenericCloseResult<R = any> {
3
- data?: R;
4
- state: ModalCloseMode;
5
- }
@@ -1,24 +0,0 @@
1
- import { ComponentType } from "@angular/cdk/portal";
2
- import { IGenericModalStyleConfig } from "./igeneric-modal-style-config.interface";
3
- import { GenericModal } from "../classes/generic-modal";
4
- /**
5
- * Interface for the Generic Confirm Close Modal
6
- * @param {ComponentType<any>} confirmModalComponent The component to use for the confirm modal
7
- * @param {boolean} confirmClose (required) Whether the modal should confirm close or not
8
- * @param {boolean} confirmOnSubmit (optional) Whether the modal should confirm on submit or not, will default to false (if false, will only need to confirm when close state is 'cancel')
9
- * @param {IGenericModalStyleConfig} style (optional) The style configuration for the modal
10
- * @param {D | null} data (optional) The data to pass to the component of the modal, the component needs to have the @Inject(GENERIC_MODAL_DATA) data: any; decorator to receive this data
11
- * @param {string} bannerText (optional) The text to display in the banner of the modal
12
- * @param {string[]} bannerIcons (optional) The icons to display in the banner of the modal
13
- * @param {boolean} bypassSelfCheck (optional) Whether the modal should bypass the self check or not, will default to false (if true, will not check if the modal is the same as the one that opened it)
14
- */
15
- export interface IGenericConfirmCloseConfig<ConfirmComponentData = any, ConfirmComponent extends GenericModal<ConfirmComponentData, undefined> = GenericModal<ConfirmComponentData, undefined>> {
16
- confirmModalComponent: ComponentType<ConfirmComponent>;
17
- confirmClose: boolean;
18
- confirmOnSubmit?: boolean;
19
- style?: IGenericModalStyleConfig;
20
- data?: ConfirmComponentData | null;
21
- bannerText?: string;
22
- bannerIcons?: string[];
23
- bypassSelfCheck?: boolean;
24
- }
@@ -1,28 +0,0 @@
1
- import { ComponentRef, OnDestroy, OnInit } from "@angular/core";
2
- import { Subject, Observable } from "rxjs";
3
- import { GenericModal } from "../classes/generic-modal";
4
- import { GenericModalConfig } from "../classes/generic-modal-config";
5
- import { ModalCloseMode } from "../types/modal.types";
6
- /**
7
- * Interface for the Generic Modal Component
8
- * @param {ComponentRef<any>} componentRef (optional) The component reference (the component that is being displayed in the modal), will default to undefined (for non-dynamic modals)
9
- * @param {GenericModalConfig} config (optional) The configuration for the modal, will default to default values for the configuration
10
- * @param {boolean} isOpen (required) Whether the modal is open or not
11
- * @param {number} animationDuration (required) The duration of the animation (in milliseconds)
12
- * @param {boolean} isSwipeableModalActive (required) Whether the swipeable modal is active (open) or not
13
- * @param {Subject<MouseEvent>} backdropClickSubject (required) The subject for the backdrop click event, will be used to listen for backdrop clicks
14
- * @param {Observable<MouseEvent>} backdropClick (required) The observable for the backdrop click event, will be used to listen for backdrop clicks (subscribed to the backdropClickSubject)
15
- * @param {Function} closeFunction (optional) The outside function to run when the modal closes (received from the config)
16
- * @param {Function} close (required) The function to run when the modal closes, will return the result of the modal
17
- */
18
- export interface IGenericModalComponenet<D = any, R = any, C extends GenericModal<D, R> = GenericModal<D, R>> extends OnInit, OnDestroy {
19
- componentRef?: ComponentRef<C>;
20
- config?: GenericModalConfig<D>;
21
- isOpen: boolean;
22
- animationDuration: number;
23
- isSwipeableModalActive: boolean;
24
- backdropClickSubject: Subject<MouseEvent>;
25
- backdropClick: Observable<MouseEvent>;
26
- closeFunction?: Function;
27
- close: (state: ModalCloseMode, result: R | undefined, fromInsideInteraction: boolean, forceClose: boolean) => void;
28
- }
@@ -1,45 +0,0 @@
1
- import { GenericModal } from "../classes/generic-modal";
2
- import { IGenericConfirmCloseConfig } from "./igeneric-confirm-close.interface";
3
- import { IGenericModalStyleConfig } from "./igeneric-modal-style-config.interface";
4
- /**
5
- * IGenericModalConfig<D>, the configuration for the generic modal
6
- * @param {boolean} open (optional) Whether the modal should be open or not, will default to true
7
- * @param {Function} afterClose (optional) The function to run after the modal closes
8
- * @param {IGenericConfirmCloseConfig<ConfirmComponent, ConfirmComponentData>} confirmCloseConfig (optional) The configuration for the confirm close modal, will default to { confirmClose: false }
9
- * @param {boolean} disableClose (optional) Whether the modal should be closable or not, will default to false (this applies to the close button and backdrop)
10
- * @param {boolean} disableCloseOnBackdropClick (optional) Whether the modal shouldn't be closable when the user clicks on the backdrop, will default to false
11
- * @param {boolean} disableCloseOnNavigation (optional) Whether the modal should be closable or not when the user navigates away from the page, will default to false
12
- * @param {boolean} enableExtremeOverflowHandling (optional) Whether the modal should enable the extreme overflow handling (may cause issues with keypress registration) or not, will default to false
13
- * @param {boolean} webkitOnlyOverflowMobileHandling (optional) Whether the modal should only handle overflow for webkit browsers on mobile or should it handle it for all browsers, will default to true
14
- * @param {boolean} closeOnSwipeBack (optional) Whether the modal should close when swiped back on mobile devices, will default to false
15
- * @param {D | null} data (optional) The data to pass to the component of the modal, the component needs to have the @Inject(GENERIC_MODAL_DATA) data: any; decorator to receive this data
16
- * @param {IGenericModalStyleConfig} style (optional) The style configuration for the modal, will default to an empty object
17
- * @param {boolean} showCloseButton (optional) Whether the modal should show a close button or not, will default to true
18
- * @param {string} bannerText (optional) The text to display in the banner of the modal
19
- * @param {string} bannerTextAnnotatedString (optional) The annotated string (in bold style, in addition to some text) to display in the banner of the modal, will default to an empty string
20
- * @param {string[]} bannerIcons (optional) The icons to display in the banner of the modal
21
- * @param {string} contentClasses (optional) The classes to apply to the content of the modal
22
- * @param {string} contentStyles (optional) The styles to apply to the content of the modal
23
- * @param {string} id (optional) The id of the modal (set at the top level of the modal), will default to a random string
24
- */
25
- export interface IGenericModalConfig<D = undefined, ConfirmComponentData = any, ConfirmComponent extends GenericModal<ConfirmComponentData, undefined> = GenericModal<ConfirmComponentData, undefined>> {
26
- open?: boolean;
27
- afterClose?: Function;
28
- confirmCloseConfig?: IGenericConfirmCloseConfig<ConfirmComponentData, ConfirmComponent>;
29
- disableClose?: boolean;
30
- disableCloseOnBackdropClick?: boolean;
31
- disableCloseOnNavigation?: boolean;
32
- enableExtremeOverflowHandling?: boolean;
33
- webkitOnlyOverflowMobileHandling?: boolean;
34
- closeOnSwipeBack?: boolean;
35
- data?: D | null;
36
- style?: IGenericModalStyleConfig;
37
- bannerText?: string;
38
- bannerTextAnnotatedString?: string;
39
- bannerIcons?: string[];
40
- contentClasses?: string;
41
- contentStyles?: string;
42
- disableConsoleWarnings?: boolean;
43
- disableConsoleInfo?: boolean;
44
- id?: string;
45
- }
@@ -1,25 +0,0 @@
1
- import { Observable } from "rxjs";
2
- import { ComponentRef, Type } from "@angular/core";
3
- import { GenericModal } from "../classes/generic-modal";
4
- import { GenericModalConfig } from "../classes/generic-modal-config";
5
- import { GenericModalComponent } from "../components/generic-modal";
6
- import { GenericModalState } from "../enums/generic-modal-state.enum";
7
- import { IGenericCloseResult } from "./igeneric-close-result.interface";
8
- export interface IGenericModalRef<D = any, R = any, C extends GenericModal<D, R> = GenericModal<D, R>> {
9
- modalContainer: Type<GenericModalComponent<D, R, C>>;
10
- modalContainerRef: ComponentRef<GenericModalComponent<D, R, C>>;
11
- modalContainerElement: HTMLElement;
12
- parentElement?: HTMLElement;
13
- componentRef: ComponentRef<C>;
14
- modalState$(): Observable<GenericModalState>;
15
- selfIdentifier: {
16
- constructor: Function;
17
- };
18
- modalConfig?: GenericModalConfig<D>;
19
- afterClosed(): Observable<IGenericCloseResult<R>>;
20
- backdropClick(): Observable<MouseEvent>;
21
- open(): void;
22
- close: (state: "confirm" | "cancel", result: R | undefined, forceClose: boolean, fromSelf: boolean, from: {
23
- constructor: Function;
24
- } | undefined) => void;
25
- }
@@ -1,22 +0,0 @@
1
- import { OnDestroy, Renderer2, ViewContainerRef } from "@angular/core";
2
- import { ComponentType } from "@angular/cdk/portal";
3
- import { IGenericModalConfig } from "./igeneric-modal-config.interface";
4
- import { Observable } from "rxjs";
5
- import { GenericModalRef } from "../classes/generic-modal-ref";
6
- import { GenericModalComponent } from "../components/generic-modal";
7
- export interface IGenericModalService extends OnDestroy {
8
- viewContainer?: ViewContainerRef;
9
- register: (viewContainer: ViewContainerRef, renderer: Renderer2) => void;
10
- open: (component: ComponentType<any>, config?: IGenericModalConfig<any>) => GenericModalRef<any, any, any>;
11
- close: (self: {
12
- constructor: Function;
13
- }, fromCloseFunction: boolean | undefined) => void;
14
- closeAll: () => void;
15
- get: (self: {
16
- constructor: Function;
17
- }) => GenericModalRef<any, any, any> | GenericModalComponent<any, any, any> | undefined;
18
- getSubscribe(self: {
19
- constructor: Function;
20
- }): Observable<GenericModalRef<any, any, any> | GenericModalComponent<any, any, any> | undefined>;
21
- modalsCount: () => number;
22
- }
@@ -1,28 +0,0 @@
1
- import { ModalPoistion } from "../types/modal.types";
2
- import { IGenericSwipeableModalConfig } from "./igeneric-swipeable-modal-config";
3
- /**
4
- * IGenericModalStyleConfig
5
- * @param {center' | 'left' | 'right'} position (optional) The position of the modal (can be center, left, or right), will default to center
6
- * @param {boolean} handleMobile (optional) Whether the modal should open in a mobile configuration when going to a certain screen size
7
- * @param {boolean} animate (optional) Whether the modal should have animations or not, will default to true
8
- * @param {boolean} hasBackdrop (optional) Whether the modal should have a backdrop or not, will default to true
9
- * @param {number} closeDelay (optional) The delay in milliseconds before the modal closes, will default to GENERIC_MODAL_DEFAULT_ANIM_DURATION (175)
10
- * @param {IGenericSwipeableModalConfig} mobileConfig (optional) The configuration for the swipeable modal, will default to an empty object
11
- * @param {boolean} contentWrapper (optional) Whether the content should be wrapped in a default-styled div or not, will default to true
12
- * @param {string} wrapperClasses (optional) The classes to apply to the wrapper of the modal
13
- * @param {string} wrapperStyles (optional) The styles to apply to the wrapper of the modal
14
- * @param {boolean} overrideFullHeight (optional) Whether the modal should override the full height of the modal or not, will default to false
15
- */
16
- export interface IGenericModalStyleConfig {
17
- position?: ModalPoistion;
18
- handleMobile?: boolean;
19
- animate?: boolean;
20
- hasBackdrop?: boolean;
21
- closeDelay?: number;
22
- showCloseButton?: boolean;
23
- mobileConfig?: IGenericSwipeableModalConfig;
24
- contentWrapper?: boolean;
25
- wrapperClasses?: string;
26
- wrapperStyles?: string;
27
- overrideFullHeight?: boolean;
28
- }
@@ -1,18 +0,0 @@
1
- import { InputSignal, OutputEmitterRef, QueryList } from "@angular/core";
2
- import { GenericModalConfig } from "../classes/generic-modal-config";
3
- import { ModalSwipeable } from "../components/views/swipeable/modal-swipeable";
4
- import { ModalCloseMode } from "../types/modal.types";
5
- export interface IGenericModalView<D = unknown> {
6
- config: InputSignal<GenericModalConfig<D> | undefined>;
7
- isOpen: InputSignal<boolean>;
8
- isAnimated: InputSignal<boolean>;
9
- isSwipeableModalActive: InputSignal<boolean>;
10
- animationDuration: InputSignal<number>;
11
- hasDefaultContentWrapperClass: InputSignal<boolean>;
12
- hasBanner: InputSignal<boolean>;
13
- close: OutputEmitterRef<ModalCloseMode | undefined>;
14
- swipeableComponents: QueryList<ModalSwipeable>;
15
- get modalClasses(): {
16
- [key: string]: boolean;
17
- };
18
- }
@@ -1,5 +0,0 @@
1
- export interface IGenericSwipeableModalConfig {
2
- upSwipeLimit?: number;
3
- downSwipeLimit?: number;
4
- customHeight?: number;
5
- }
@@ -1,40 +0,0 @@
1
- import { Injector, ViewContainerRef, Renderer2 } from "@angular/core";
2
- import { Observable } from "rxjs";
3
- import { GenericModal } from "../classes/generic-modal";
4
- import { GenericModalRef } from "../classes/generic-modal-ref";
5
- import { GenericModalComponent } from "../components/generic-modal";
6
- import { IGenericModalConfig } from "../interfaces/igeneric-modal-config.interface";
7
- import { IGenericModalService } from "../interfaces/igeneric-modal-service.interface";
8
- import { ComponentType } from "@angular/cdk/portal";
9
- import * as i0 from "@angular/core";
10
- export declare class GenericModalService implements IGenericModalService {
11
- private router;
12
- protected injector: Injector;
13
- private modals;
14
- private modalsSubject;
15
- viewContainer?: ViewContainerRef;
16
- renderer?: Renderer2;
17
- private unsubscribe$;
18
- constructor();
19
- ngOnDestroy(): void;
20
- private createSubscriptions;
21
- register(viewContainer: ViewContainerRef, renderer: Renderer2): void;
22
- open<D, R, C extends GenericModal<D, R> = GenericModal<D, R>>(component: ComponentType<C>, config?: IGenericModalConfig<D>): GenericModalRef<D, R, C>;
23
- close(self: {
24
- constructor: Function;
25
- }, fromCloseFunction?: boolean | undefined): void;
26
- closeAll(onNavigate?: boolean): void;
27
- get<D, R, C extends GenericModal<D, R> = GenericModal<D, R>>(self: {
28
- constructor: Function;
29
- }): GenericModalRef<D, R, C> | GenericModalComponent<D, R, C> | undefined;
30
- getSubscribe<D, R, C extends GenericModal<D, R> = GenericModal<D, R>>(self: {
31
- constructor: Function;
32
- }): Observable<GenericModalRef<D, R, C> | GenericModalComponent<D, R, C> | undefined>;
33
- modalsCount(): number;
34
- find(self: {
35
- constructor: Function;
36
- }): boolean;
37
- modalRequestedTypeCheck(modal: GenericModalRef | GenericModalComponent | undefined): boolean;
38
- static ɵfac: i0.ɵɵFactoryDeclaration<GenericModalService, never>;
39
- static ɵprov: i0.ɵɵInjectableDeclaration<GenericModalService>;
40
- }
@@ -1,2 +0,0 @@
1
- import { InjectionToken } from "@angular/core";
2
- export declare const GENERIC_MODAL_DATA: InjectionToken<any>;
@@ -1,2 +0,0 @@
1
- export type ModalCloseMode = "cancel" | "confirm";
2
- export type ModalPoistion = "center" | "right" | "left";
package/public-api.d.ts DELETED
@@ -1,29 +0,0 @@
1
- export * from './lib/components/generic-modal';
2
- export * from './lib/components/views/swipeable/modal-swipeable';
3
- export * from './lib/components/views/side/modal-side';
4
- export * from './lib/components/views/centered/modal-centered';
5
- export * from './lib/components/views/backdrop/modal-backdrop';
6
- export * from './lib/components/views/banner/modal-banner';
7
- export * from './lib/services/generic-modal.service';
8
- export * from './lib/classes/generic-modal';
9
- export * from './lib/classes/generic-modal-config';
10
- export * from './lib/classes/generic-modal-ref';
11
- export * from './lib/classes/generic-modal-style.config';
12
- export * from './lib/interfaces/igeneric-close-result.interface';
13
- export * from './lib/interfaces/igeneric-confirm-close.interface';
14
- export * from './lib/interfaces/igeneric-modal-component.interface';
15
- export * from './lib/interfaces/igeneric-modal-config.interface';
16
- export * from './lib/interfaces/igeneric-modal-ref.interface';
17
- export * from './lib/interfaces/igeneric-modal-service.interface';
18
- export * from './lib/interfaces/igeneric-modal-style-config.interface';
19
- export * from './lib/interfaces/igeneric-modal-view.interface';
20
- export * from './lib/interfaces/igeneric-swipeable-modal-config';
21
- export * from './lib/constants/generic-modal-animation.constants';
22
- export * from './lib/constants/generic-modal-common.constants';
23
- export * from './lib/constants/generic-modal-swipe.constants';
24
- export * from './lib/constants/generic-modal-text.constants';
25
- export * from './lib/enums/generic-modal-errors.enum';
26
- export * from './lib/enums/generic-modal-warnings.enum';
27
- export * from './lib/enums/generic-modal-state.enum';
28
- export * from './lib/tokens/generic-modal-data.token';
29
- export * from './lib/types/modal.types';