@filip.mazev/modal 0.1.26 → 0.1.28

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,39 +1,227 @@
1
1
  import * as _filip_mazev_blocks_core from '@filip.mazev/blocks-core';
2
+ import { BREAKPOINTS } from '@filip.mazev/blocks-core';
2
3
  import * as _angular_core from '@angular/core';
3
- import { Type, ComponentRef, ViewContainerRef, Renderer2, Injector, OnDestroy, OnInit, Signal, TemplateRef, ElementRef, InputSignal, OutputEmitterRef, QueryList, InjectionToken } from '@angular/core';
4
- import { Observable, Subject } from 'rxjs';
4
+ import { Type, ComponentRef, OnInit, OnDestroy, Signal, TemplateRef, ElementRef, InputSignal, OutputEmitterRef, QueryList, ViewContainerRef, InjectionToken } from '@angular/core';
5
+ import { Observable } from 'rxjs';
5
6
  import { ComponentType } from '@angular/cdk/portal';
6
- import * as _filip_mazev_modal from '@filip.mazev/modal';
7
+
8
+ declare enum ModalState {
9
+ OPEN = "open",
10
+ OPENING = "opening",
11
+ CLOSED = "closed",
12
+ CLOSING = "closing"
13
+ }
7
14
 
8
15
  type ModalCloseMode = "cancel" | "confirm";
9
- type ModalPoistion = "center" | "right" | "left";
16
+ type ModalLayout = "center" | "right" | "left" | "bottom-sheet";
17
+ type BreakpointKey = keyof typeof BREAKPOINTS;
18
+
19
+ /**
20
+ * Interface for the Modal Close Result
21
+ * @param R data (optional) The result data returned when the modal is closed
22
+ * @param {ModalCloseMode} state (required) The state of the modal close (e.g., 'confirm', 'cancel')
23
+ */
24
+ interface IModalCloseResult<R> {
25
+ data?: R;
26
+ state: ModalCloseMode;
27
+ }
28
+
29
+ /**
30
+ * Interface for Modal
31
+ * @param D The type of data passed to the modal
32
+ * @param R The type of result returned from the modal
33
+ */
34
+ interface IModal<D, R> {
35
+ data: D;
36
+ modal: ModalRef<D, R>;
37
+ onModalInit(): void;
38
+ close(result?: R): void;
39
+ }
40
+
41
+ /**
42
+ * Interface for the Modal Reference
43
+ * @param D The type of data passed to the modal
44
+ * @param R The type of result returned from the modal
45
+ * @param C The type of the modal component, will default to IModal<D, R>
46
+ * @param {Type<ModalCore<D, R, C>>} modalContainer The type of the modal container component
47
+ * @param {ComponentRef<ModalCore<D, R, C>>} modalContainerRef The component reference of the modal container
48
+ * @param {HTMLElement} modalContainerElement The HTML element of the modal container
49
+ * @param {HTMLElement | undefined} parentElement (optional) The parent HTML element where the modal is attached
50
+ * @param {ComponentRef<C>} componentRef The component reference of the modal content
51
+ * @param {Observable<ModalState>} modalState$ Observable that emits the current state of the modal
52
+ * @param {ModalConfig<D> | undefined} modalConfig (optional) The configuration of the modal
53
+ * @param {Observable<IModalCloseResult<R>>} afterClosed Observable that emits when the modal has been closed
54
+ * @param {Observable<MouseEvent>} backdropClick Observable that emits when the backdrop is clicked
55
+ * @param {Function} open Function to open the modal
56
+ * @param {Function} close Function to close the modal with specified parameters
57
+ */
58
+ interface IModalRef<D, R, C extends IModal<D, R> = IModal<D, R>> {
59
+ modalContainer: Type<ModalCore<D, R, C>>;
60
+ modalContainerRef: ComponentRef<ModalCore<D, R, C>>;
61
+ modalContainerElement: HTMLElement;
62
+ parentElement?: HTMLElement;
63
+ componentRef: ComponentRef<C>;
64
+ modalState$(): Observable<ModalState>;
65
+ modalConfig?: ModalConfig<D>;
66
+ afterClosed(): Observable<IModalCloseResult<R>>;
67
+ backdropClick(): Observable<MouseEvent>;
68
+ open(): void;
69
+ close: (state: "confirm" | "cancel", result: R | undefined, forceClose: boolean, fromSelf: boolean, from: {
70
+ constructor: Function;
71
+ } | undefined) => void;
72
+ }
73
+
74
+ declare class ModalRef<D = unknown, R = any, C extends IModal<D, R> = IModal<D, R>> implements IModalRef<D, R, C> {
75
+ componentType: ComponentType<C>;
76
+ private modalService;
77
+ private _modalContainer;
78
+ private set modalContainer(value);
79
+ get modalContainer(): Type<ModalCore<D, R, C>>;
80
+ private _modalContainerRef;
81
+ private set modalContainerRef(value);
82
+ get modalContainerRef(): ComponentRef<ModalCore<D, R, C>>;
83
+ private _modalContainerElement;
84
+ private set modalContainerElement(value);
85
+ get modalContainerElement(): HTMLElement;
86
+ private _parentElement;
87
+ private set parentElement(value);
88
+ get parentElement(): HTMLElement | undefined;
89
+ private _componentRef;
90
+ private set componentRef(value);
91
+ get componentRef(): ComponentRef<C>;
92
+ private _modalState;
93
+ private modalState;
94
+ modalState$(): Observable<ModalState>;
95
+ private getStatus;
96
+ private _modalConfig?;
97
+ private set modalConfig(value);
98
+ get modalConfig(): ModalConfig<D> | undefined;
99
+ private backdropClickSubject;
100
+ backdropClick(): Observable<MouseEvent>;
101
+ private backdropClicked;
102
+ private afterCloseSubject;
103
+ /**
104
+ * Observable that emits when the modal has been closed.
105
+ * @returns An Observable that emits an IModalCloseResult<R> when the modal is closed.
106
+ */
107
+ afterClosed(): Observable<IModalCloseResult<R>>;
108
+ private afterClose;
109
+ constructor(componentRef: ComponentRef<C>, componentType: ComponentType<C>, modalContainerRef: ComponentRef<ModalCore<D, R, C>>, modalService: ModalService, modalConfig?: ModalConfig<D>);
110
+ open(): Promise<void>;
111
+ close(state?: ModalCloseMode, result?: R | undefined, forceClose?: boolean): void;
112
+ private handleClose;
113
+ }
114
+
115
+ /**
116
+ * Interface for Modal Service
117
+ * @param {Function} open Function to open a modal with specified component and configuration
118
+ * @param {Function} close Function to close a specific modal
119
+ * @param {Function} unregister Function to unregister a specific modal
120
+ * @param {Function} closeAll Function to close all open modals
121
+ * @param {Function} modalsCount Function to get the count of currently open modals
122
+ * @param {Function} find Function to check if a modal with a specific component type is open
123
+ */
124
+ interface IModalService {
125
+ open<D, R, C extends IModal<D, R> = IModal<D, R>>(component: ComponentType<C>, config?: IModalConfig<D>): ModalRef<D, R, C>;
126
+ close<D, R, C extends IModal<D, R> = IModal<D, R>>(modal: ModalRef<D, R, C>): void;
127
+ unregister<D, R, C extends IModal<D, R> = IModal<D, R>>(modal: ModalRef<D, R, C>): void;
128
+ closeAll(): void;
129
+ modalsCount(): number;
130
+ find<D, R>(componentType: Type<IModal<D, R>>): boolean;
131
+ }
132
+
133
+ declare class ModalService implements IModalService {
134
+ private router;
135
+ private injector;
136
+ private appRef;
137
+ private environmentInjector;
138
+ private rendererFactory;
139
+ private renderer;
140
+ private document;
141
+ private modals;
142
+ private modalsSubject;
143
+ constructor();
144
+ private createSubscriptions;
145
+ /**
146
+ * Opens a modal with the specified component and configuration.
147
+ * @param component The component to be displayed in the modal.
148
+ * @param config Optional configuration for the modal.
149
+ * @returns A ModalRef instance representing the opened modal.
150
+ */
151
+ open<D, R, C extends IModal<D, R> = IModal<D, R>>(component: ComponentType<C>, config?: IModalConfig<D>): ModalRef<D, R, C>;
152
+ /**
153
+ * Closes the specified modal.
154
+ * @param modal The ModalRef instance representing the modal to be closed.
155
+ */
156
+ close<D, R, C extends IModal<D, R> = IModal<D, R>>(modal: ModalRef<D, R, C>): void;
157
+ /**
158
+ * Unregisters the specified modal from the service.
159
+ * @param modal The ModalRef instance representing the modal to be unregistered.
160
+ */
161
+ unregister<D, R, C extends IModal<D, R> = IModal<D, R>>(modal: ModalRef<D, R, C>): void;
162
+ /**
163
+ * Closes all open modals.
164
+ * @param onNavigate Indicates if the closeAll is triggered by navigation event.
165
+ */
166
+ closeAll(onNavigate?: boolean): void;
167
+ /**
168
+ * Finds if a modal with the specified component type is currently open.
169
+ * @param componentType The component type to search for.
170
+ * @returns True if a modal with the specified component type is open, false otherwise.
171
+ */
172
+ find<D, R>(componentType: Type<IModal<D, R>>): boolean;
173
+ /**
174
+ * Gets the count of currently open modals.
175
+ * @returns The number of open modals.
176
+ */
177
+ modalsCount(): number;
178
+ private isIModal;
179
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ModalService, never>;
180
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<ModalService>;
181
+ }
182
+
183
+ /**
184
+ * Abstract class representing a modal close guard.
185
+ */
186
+ declare abstract class ModalCloseGuard {
187
+ /**
188
+ * Determines whether the modal can be closed.
189
+ */
190
+ abstract canClose(modalService: ModalService): Observable<boolean> | Promise<boolean> | boolean;
191
+ }
10
192
 
11
- interface IGenericSwipeableModalConfig {
193
+ /**
194
+ * Interface for Bottom Sheet Modal Configuration
195
+ * @param {number} downSwipeLimit (optional) The limit for down swipe to close the modal
196
+ * @param {number} customHeight (optional) Custom height for the bottom sheet modal
197
+ */
198
+ interface IBottomSheetModalConfig {
12
199
  downSwipeLimit?: number;
13
200
  customHeight?: number;
14
201
  }
15
202
 
16
203
  /**
17
- * IGenericModalStyleConfig
18
- * @param {center' | 'left' | 'right'} position (optional) The position of the modal (can be center, left, or right), will default to center
19
- * @param {boolean} handleMobile (optional) Whether the modal should open in a mobile configuration when going to a certain screen size
204
+ * IModalStyleConfig
205
+ * @param {center' | 'left' | 'right'} layout (optional) The layout of the modal (can be center, left, or right), will default to center
206
+ * @param {Partial<Record<BreakpointKey, ModalLayout>>} breakpoints (optional) The breakpoints for responsive layouts, will default to undefined
20
207
  * @param {boolean} animate (optional) Whether the modal should have animations or not, will default to true
21
208
  * @param {boolean} hasBackdrop (optional) Whether the modal should have a backdrop or not, will default to true
22
- * @param {number} closeDelay (optional) The delay in milliseconds before the modal closes, will default to GENERIC_MODAL_DEFAULT_ANIM_DURATION (175)
23
- * @param {IGenericSwipeableModalConfig} mobileConfig (optional) The configuration for the swipeable modal, will default to an empty object
209
+ * @param {number} closeDelay (optional) The delay in milliseconds before the modal closes, will default to MODAL_DEFAULT_ANIM_DURATION (175)
210
+ * @param {boolean} showCloseButton (optional) Whether to show the close button on the modal or not, will default to true
211
+ * @param {IBottomSheetModalConfig} mobileConfig (optional) The configuration for the bottom-sheet modal, will default to an empty object
24
212
  * @param {boolean} contentWrapper (optional) Whether the content should be wrapped in a default-styled div or not, will default to true
25
213
  * @param {string} wrapperClasses (optional) The classes to apply to the wrapper of the modal
26
214
  * @param {string} wrapperStyles (optional) The styles to apply to the wrapper of the modal
27
215
  * @param {boolean} overrideFullHeight (optional) Whether the modal should override the full height of the modal or not, will default to false
28
216
  */
29
- interface IGenericModalStyleConfig {
30
- position?: ModalPoistion;
31
- handleMobile?: boolean;
217
+ interface IModalStyleConfig {
218
+ layout?: ModalLayout;
219
+ breakpoints?: Partial<Record<BreakpointKey, ModalLayout>>;
32
220
  animate?: boolean;
33
221
  hasBackdrop?: boolean;
34
222
  closeDelay?: number;
35
223
  showCloseButton?: boolean;
36
- mobileConfig?: IGenericSwipeableModalConfig;
224
+ mobileConfig?: IBottomSheetModalConfig;
37
225
  contentWrapper?: boolean;
38
226
  wrapperClasses?: string;
39
227
  wrapperStyles?: string;
@@ -41,54 +229,37 @@ interface IGenericModalStyleConfig {
41
229
  }
42
230
 
43
231
  /**
44
- * Interface for the Generic Confirm Close Modal
45
- * @param {ComponentType<any>} confirmModalComponent The component to use for the confirm modal
46
- * @param {boolean} confirmClose (required) Whether the modal should confirm close or not
47
- * @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')
48
- * @param {IGenericModalStyleConfig} style (optional) The style configuration for the modal
49
- * @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
50
- * @param {string} bannerText (optional) The text to display in the banner of the modal
51
- * @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)
52
- */
53
- interface IGenericConfirmCloseConfig<ConfirmComponentData = any, ConfirmComponent extends GenericModal<ConfirmComponentData, undefined> = GenericModal<ConfirmComponentData, undefined>> {
54
- confirmModalComponent: ComponentType<ConfirmComponent>;
55
- confirmClose: boolean;
56
- confirmOnSubmit?: boolean;
57
- style?: IGenericModalStyleConfig;
58
- data?: ConfirmComponentData | null;
59
- bannerText?: string;
60
- bypassSelfCheck?: boolean;
61
- }
62
-
63
- /**
64
- * IGenericModalConfig<D>, the configuration for the generic modal
232
+ * IModalConfig<D>, the configuration for the modal
233
+ * @param D The type of data passed to the modal
65
234
  * @param {boolean} open (optional) Whether the modal should be open or not, will default to true
66
235
  * @param {Function} afterClose (optional) The function to run after the modal closes
67
- * @param {IGenericConfirmCloseConfig<ConfirmComponent, ConfirmComponentData>} confirmCloseConfig (optional) The configuration for the confirm close modal, will default to { confirmClose: false }
236
+ * @param {ModalCloseGuard} closeGuard (optional) The guard that will determine whether the modal can be closed or not
237
+ * @param {boolean} closeGuardOnlyOnCancel (optional) Whether the close guard should only be checked on cancel actions, will default to true
68
238
  * @param {boolean} disableClose (optional) Whether the modal should be closable or not, will default to false (this applies to the close button and backdrop)
69
239
  * @param {boolean} disableCloseOnBackdropClick (optional) Whether the modal shouldn't be closable when the user clicks on the backdrop, will default to false
70
240
  * @param {boolean} disableCloseOnNavigation (optional) Whether the modal should be closable or not when the user navigates away from the page, will default to false
71
241
  * @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
72
242
  * @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
73
- * @param {D | null} data (optional) The data to pass to the component of the modal. The component needs to use the @Inject(GENERIC_MODAL_DATA) or `data = inject<string>(GENERIC_MODAL_DATA);` (modern syntax) decorator to receive this.
74
- * @param {IGenericModalStyleConfig} style (optional) The style configuration for the modal, will default to an empty object
243
+ * @param {D | null} data (optional) The data to pass to the component of the modal. The component needs to use the @Inject(MODAL_DATA) or `data = inject<string>(MODAL_DATA);` (modern syntax) decorator to receive this.
244
+ * @param {IModalStyleConfig} style (optional) The style configuration for the modal, will default to an empty object
75
245
  * @param {boolean} showCloseButton (optional) Whether the modal should show a close button or not, will default to true
76
246
  * @param {string} bannerText (optional) The text to display in the banner of the modal
77
247
  * @param {string} contentClasses (optional) The classes to apply to the content of the modal
78
248
  * @param {string} contentStyles (optional) The styles to apply to the content of the modal
79
249
  * @param {string} id (optional) The id of the modal (set at the top level of the modal), will default to a random string
80
250
  */
81
- interface IGenericModalConfig<D = undefined, ConfirmComponentData = any, ConfirmComponent extends GenericModal<ConfirmComponentData, undefined> = GenericModal<ConfirmComponentData, undefined>> {
251
+ interface IModalConfig<D> {
82
252
  open?: boolean;
83
253
  afterClose?: Function;
84
- confirmCloseConfig?: IGenericConfirmCloseConfig<ConfirmComponentData, ConfirmComponent>;
254
+ closeGuard?: ModalCloseGuard;
255
+ closeGuardOnlyOnCancel?: boolean;
85
256
  disableClose?: boolean;
86
257
  disableCloseOnBackdropClick?: boolean;
87
258
  disableCloseOnNavigation?: boolean;
88
259
  enableExtremeOverflowHandling?: boolean;
89
260
  webkitOnlyOverflowMobileHandling?: boolean;
90
261
  data?: D | null;
91
- style?: IGenericModalStyleConfig;
262
+ style?: IModalStyleConfig;
92
263
  bannerText?: string;
93
264
  contentClasses?: string;
94
265
  contentStyles?: string;
@@ -97,194 +268,65 @@ interface IGenericModalConfig<D = undefined, ConfirmComponentData = any, Confirm
97
268
  id?: string;
98
269
  }
99
270
 
100
- declare class GenericModalConfig<D = unknown, ConfirmComponentData = any, ConfirmComponent extends GenericModal<ConfirmComponentData, undefined> = GenericModal<ConfirmComponentData, undefined>> {
271
+ declare class ModalStyleConfig implements IModalStyleConfig {
272
+ layout: ModalLayout;
273
+ breakpoints?: Partial<Record<BreakpointKey, ModalLayout>>;
274
+ animate: boolean;
275
+ hasBackdrop: boolean;
276
+ closeDelay?: number;
277
+ showCloseButton?: boolean;
278
+ mobileConfig: IBottomSheetModalConfig;
279
+ contentWrapper: boolean;
280
+ wrapperClasses: string;
281
+ wrapperStyles: string;
282
+ overrideFullHeight: boolean;
283
+ constructor(config?: IModalStyleConfig);
284
+ }
285
+
286
+ declare class ModalConfig<D = unknown> {
101
287
  open: boolean;
102
288
  afterClose?: Function;
103
- confirmCloseConfig?: IGenericConfirmCloseConfig<ConfirmComponentData, ConfirmComponent>;
289
+ closeGuard?: ModalCloseGuard;
290
+ closeGuardOnlyOnCancel?: boolean;
104
291
  disableClose: boolean;
105
292
  disableCloseOnBackdropClick: boolean;
106
293
  disableCloseOnNavigation: boolean;
107
294
  enableExtremeOverflowHandling?: boolean;
108
295
  webkitOnlyOverflowMobileHandling?: boolean;
109
296
  data: D | null;
110
- style: IGenericModalStyleConfig;
297
+ style: ModalStyleConfig;
111
298
  bannerText: string;
112
299
  contentClasses: string;
113
300
  contentStyles: string;
114
301
  disableConsoleWarnings: boolean;
115
302
  disableConsoleInfo: boolean;
116
303
  id: string;
117
- constructor(config?: IGenericModalConfig<D, ConfirmComponentData, ConfirmComponent>);
118
- }
119
-
120
- declare enum GenericModalState {
121
- OPEN = "open",
122
- OPENING = "opening",
123
- CLOSED = "closed",
124
- CLOSING = "closing"
125
- }
126
-
127
- interface IGenericCloseResult<R = any> {
128
- data?: R;
129
- state: ModalCloseMode;
130
- }
131
-
132
- interface IGenericModalRef<D = any, R = any, C extends GenericModal<D, R> = GenericModal<D, R>> {
133
- modalContainer: Type<ModalCore<D, R, C>>;
134
- modalContainerRef: ComponentRef<ModalCore<D, R, C>>;
135
- modalContainerElement: HTMLElement;
136
- parentElement?: HTMLElement;
137
- componentRef: ComponentRef<C>;
138
- modalState$(): Observable<GenericModalState>;
139
- selfIdentifier: {
140
- constructor: Function;
141
- };
142
- modalConfig?: GenericModalConfig<D>;
143
- afterClosed(): Observable<IGenericCloseResult<R>>;
144
- backdropClick(): Observable<MouseEvent>;
145
- open(): void;
146
- close: (state: "confirm" | "cancel", result: R | undefined, forceClose: boolean, fromSelf: boolean, from: {
147
- constructor: Function;
148
- } | undefined) => void;
149
- }
150
-
151
- interface IGenericModalService {
152
- viewContainer?: ViewContainerRef;
153
- register: (viewContainer: ViewContainerRef, renderer: Renderer2) => void;
154
- open: (component: ComponentType<any>, config?: IGenericModalConfig<any>) => GenericModalRef<any, any, any>;
155
- close: (self: {
156
- constructor: Function;
157
- }, fromCloseFunction: boolean | undefined) => void;
158
- closeAll: () => void;
159
- get: (self: {
160
- constructor: Function;
161
- }) => GenericModalRef<any, any, any> | ModalCore<any, any, any> | undefined;
162
- getSubscribe(self: {
163
- constructor: Function;
164
- }): Observable<GenericModalRef<any, any, any> | ModalCore<any, any, any> | undefined>;
165
- modalsCount: () => number;
166
- }
167
-
168
- declare class GenericModalService implements IGenericModalService {
169
- private router;
170
- protected injector: Injector;
171
- private modals;
172
- private modalsSubject;
173
- viewContainer?: ViewContainerRef;
174
- renderer?: Renderer2;
175
- constructor();
176
- private createSubscriptions;
177
- register(viewContainer: ViewContainerRef, renderer: Renderer2): void;
178
- open<D, R, C extends GenericModal<D, R> = GenericModal<D, R>>(component: ComponentType<C>, config?: IGenericModalConfig<D>): GenericModalRef<D, R, C>;
179
- close(self: {
180
- constructor: Function;
181
- }, fromCloseFunction?: boolean | undefined): void;
182
- closeAll(onNavigate?: boolean): void;
183
- get<D, R, C extends GenericModal<D, R> = GenericModal<D, R>>(self: {
184
- constructor: Function;
185
- }): GenericModalRef<D, R, C> | ModalCore<D, R, C> | undefined;
186
- getSubscribe<D, R, C extends GenericModal<D, R> = GenericModal<D, R>>(self: {
187
- constructor: Function;
188
- }): Observable<GenericModalRef<D, R, C> | ModalCore<D, R, C> | undefined>;
189
- modalsCount(): number;
190
- find(self: {
191
- constructor: Function;
192
- }): boolean;
193
- modalRequestedTypeCheck(modal: GenericModalRef | ModalCore | undefined): boolean;
194
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<GenericModalService, never>;
195
- static ɵprov: _angular_core.ɵɵInjectableDeclaration<GenericModalService>;
196
- }
197
-
198
- declare class GenericModalRef<D = unknown, R = any, C extends GenericModal<D, R> = GenericModal<D, R>> implements IGenericModalRef<D, R, C> {
199
- private modalService;
200
- private _modalContainer;
201
- private set modalContainer(value);
202
- get modalContainer(): Type<ModalCore<D, R, C>>;
203
- private _modalContainerRef;
204
- private set modalContainerRef(value);
205
- get modalContainerRef(): ComponentRef<ModalCore<D, R, C>>;
206
- private _modalContainerElement;
207
- private set modalContainerElement(value);
208
- get modalContainerElement(): HTMLElement;
209
- private _parentElement;
210
- private set parentElement(value);
211
- get parentElement(): HTMLElement | undefined;
212
- private _componentRef;
213
- private set componentRef(value);
214
- get componentRef(): ComponentRef<C>;
215
- private _modalState;
216
- private modalState;
217
- modalState$(): Observable<GenericModalState>;
218
- private getStatus;
219
- private _selfIdentifier;
220
- private set selfIdentifier(value);
221
- get selfIdentifier(): {
222
- constructor: Function;
223
- };
224
- private _modalConfig?;
225
- private set modalConfig(value);
226
- get modalConfig(): GenericModalConfig<D> | undefined;
227
- private backdropClickSubject;
228
- backdropClick(): Observable<MouseEvent>;
229
- private backdropClicked;
230
- private afterCloseSubject;
231
- afterClosed(): Observable<IGenericCloseResult<R>>;
232
- private afterClose;
233
- constructor(componentRef: ComponentRef<C>, selfIdentifier: {
234
- constructor: Function;
235
- }, modalContainerRef: ComponentRef<ModalCore<D, R, C>>, modalService: GenericModalService, modalConfig?: GenericModalConfig<D>);
236
- open(): Promise<void>;
237
- close(state?: ModalCloseMode, result?: R | undefined, forceClose?: boolean): void;
238
- private handleClose;
239
- }
240
-
241
- declare abstract class GenericModal<D, R> implements OnDestroy {
242
- protected genericModalService: GenericModalService;
243
- modal?: GenericModalRef<D, R>;
244
- protected modalGetSubscription$: Subject<void>;
245
- constructor();
246
- ngOnDestroy(): void;
247
- protected createModalSubscription(): void;
248
- protected unsubscribeModalGet(): void;
249
- abstract afterModalGet(): void;
250
- abstract onDestroy(): void;
251
- close(): void;
252
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<GenericModal<any, any>, never>;
253
- static ɵprov: _angular_core.ɵɵInjectableDeclaration<GenericModal<any, any>>;
304
+ constructor(config?: IModalConfig<D>);
254
305
  }
255
306
 
256
307
  /**
257
- * Interface for the Generic Modal Component
258
- * @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)
259
- * @param {GenericModalConfig} config (optional) The configuration for the modal, will default to default values for the configuration
308
+ * Interface for the Modal Component
309
+ * @param D The type of data passed to the modal
310
+ * @param R The type of result returned from the modal
311
+ * @param C The type of the modal component, will default to IModal<D, R>
312
+ * @param {ComponentRef<C>} componentRef (optional) The component reference (the component that is being displayed in the modal), will default to undefined (for non-dynamic modals)
313
+ * @param {ModalConfig} config (optional) The configuration for the modal, will default to default values for the configuration
260
314
  * @param {boolean} isOpen (required) Whether the modal is open or not
261
- * @param {boolean} isSwipeableModalActive (required) Whether the swipeable modal is active (open) or not
262
- * @param {number} animationDuration (required) The duration of the animation (in milliseconds)
263
- * @param {Subject<MouseEvent>} backdropClickSubject (required) The subject for the backdrop click event, will be used to listen for backdrop clicks
264
315
  * @param {Observable<MouseEvent>} backdropClick (required) The observable for the backdrop click event, will be used to listen for backdrop clicks (subscribed to the backdropClickSubject)
265
- * @param {Function} closeFunction (optional) The outside function to run when the modal closes (received from the config)
266
316
  * @param {Function} close (required) The function to run when the modal closes, will return the result of the modal
267
- * @param {Function} setHeaderTemplate (required) The function to set the header template of the modal
268
- * @param {Function} setFooterTemplate (required) The function to set the footer template of the modal
269
317
  */
270
- interface IGenericModalComponenet<D = any, R = any, C extends GenericModal<D, R> = GenericModal<D, R>> extends OnInit, OnDestroy {
318
+ interface IModalComponenet<D, R, C extends IModal<D, R> = IModal<D, R>> extends OnInit, OnDestroy {
271
319
  componentRef?: ComponentRef<C>;
272
- config?: GenericModalConfig<D>;
320
+ config?: ModalConfig<D>;
273
321
  isOpen: Signal<boolean>;
274
- isSwipeableModalActive: Signal<boolean>;
275
- animationDuration: number;
276
- backdropClickSubject: Subject<MouseEvent>;
277
322
  backdropClick: Observable<MouseEvent>;
278
- closeFunction?: Function;
279
323
  close: (state: ModalCloseMode, result: R | undefined, fromInsideInteraction: boolean, forceClose: boolean) => void;
280
- setHeaderTemplate: (template: TemplateRef<any>) => void;
281
- setFooterTemplate: (template: TemplateRef<any>) => void;
282
324
  }
283
325
 
284
- declare class ModalSwipeable implements OnInit, OnDestroy {
326
+ declare class ModalBottomSheet implements OnInit, OnDestroy {
285
327
  readonly headerTemplate: _angular_core.InputSignal<TemplateRef<any> | null>;
286
328
  readonly footerTemplate: _angular_core.InputSignal<TemplateRef<any> | null>;
287
- readonly config: _angular_core.InputSignal<GenericModalConfig<any, any, _filip_mazev_modal.GenericModal<any, undefined>> | undefined>;
329
+ readonly config: _angular_core.InputSignal<ModalConfig<unknown> | undefined>;
288
330
  readonly isOpen: _angular_core.InputSignal<boolean>;
289
331
  readonly isAnimated: _angular_core.InputSignal<boolean>;
290
332
  readonly animationDuration: _angular_core.InputSignal<number>;
@@ -296,7 +338,7 @@ declare class ModalSwipeable implements OnInit, OnDestroy {
296
338
  protected downSwipeLimit: number;
297
339
  protected isTrackingSwipe: boolean;
298
340
  private isTouchActive;
299
- private swipeableModalInitiated;
341
+ private bottomSheetInitiated;
300
342
  private cleanupListeners;
301
343
  private globalResizeCleanup;
302
344
  verticalSwipeTarget?: ElementRef;
@@ -304,42 +346,58 @@ declare class ModalSwipeable implements OnInit, OnDestroy {
304
346
  ngOnDestroy(): void;
305
347
  private startVerticalSwipeDetection;
306
348
  private stopVerticalSwipeDetection;
307
- private initSwipeableModalParams;
349
+ private initBottomSheetModalParams;
308
350
  private monitorInputType;
309
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<ModalSwipeable, never>;
310
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ModalSwipeable, "modal-swipeable", never, { "headerTemplate": { "alias": "headerTemplate"; "required": true; "isSignal": true; }; "footerTemplate": { "alias": "footerTemplate"; "required": true; "isSignal": true; }; "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>;
351
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ModalBottomSheet, never>;
352
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ModalBottomSheet, "modal-bottom-sheet", never, { "headerTemplate": { "alias": "headerTemplate"; "required": true; "isSignal": true; }; "footerTemplate": { "alias": "footerTemplate"; "required": true; "isSignal": true; }; "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>;
311
353
  }
312
354
 
313
- interface IGenericModalView<D = unknown> {
355
+ /**
356
+ * Interface for the Modal View
357
+ * @param D The type of data passed to the modal
358
+ * @param {InputSignal<TemplateRef<any> | null>} headerTemplate The input signal for the header template of the modal
359
+ * @param {InputSignal<TemplateRef<any> | null>} footerTemplate The input signal for the footer template of the modal
360
+ * @param {InputSignal<ModalConfig<D> | undefined>} config The input signal for the modal configuration
361
+ * @param {InputSignal<boolean>} isOpen The input signal indicating whether the modal is open
362
+ * @param {InputSignal<boolean>} isAnimated The input signal indicating whether the modal has animations enabled
363
+ * @param {InputSignal<boolean>} isBottomSheetModalActive The input signal indicating whether the bottom sheet modal is active
364
+ * @param {InputSignal<number>} animationDuration The input signal for the animation duration of the modal
365
+ * @param {InputSignal<boolean>} hasDefaultContentWrapperClass The input signal indicating whether the modal has default content wrapper class
366
+ * @param {InputSignal<boolean>} hasBanner The input signal indicating whether the modal has a banner
367
+ * @param {OutputEmitterRef<ModalCloseMode | undefined>} close The output emitter reference for the close event of the modal
368
+ * @param {QueryList<ModalBottomSheet>} bottomSheet The query list of bottom sheet modals
369
+ * @param {Signal<{ [key: string]: boolean }>} modalClasses The signal for the modal CSS classes
370
+ */
371
+ interface IModalView<D> {
314
372
  headerTemplate: InputSignal<TemplateRef<any> | null>;
315
373
  footerTemplate: InputSignal<TemplateRef<any> | null>;
316
- config: InputSignal<GenericModalConfig<D> | undefined>;
374
+ config: InputSignal<ModalConfig<D> | undefined>;
317
375
  isOpen: InputSignal<boolean>;
318
376
  isAnimated: InputSignal<boolean>;
319
- isSwipeableModalActive: InputSignal<boolean>;
377
+ isBottomSheetModalActive: InputSignal<boolean>;
320
378
  animationDuration: InputSignal<number>;
321
379
  hasDefaultContentWrapperClass: InputSignal<boolean>;
322
380
  hasBanner: InputSignal<boolean>;
323
381
  close: OutputEmitterRef<ModalCloseMode | undefined>;
324
- swipeableComponents: QueryList<ModalSwipeable>;
382
+ bottomSheet: QueryList<ModalBottomSheet>;
325
383
  modalClasses: Signal<{
326
384
  [key: string]: boolean;
327
385
  }>;
328
386
  }
329
387
 
330
- declare class ModalCentered<D = unknown> implements IGenericModalView<D> {
388
+ declare class ModalCentered<D = unknown> implements IModalView<D> {
331
389
  readonly headerTemplate: _angular_core.InputSignal<TemplateRef<any> | null>;
332
390
  readonly footerTemplate: _angular_core.InputSignal<TemplateRef<any> | null>;
333
- readonly config: _angular_core.InputSignal<GenericModalConfig<D, any, _filip_mazev_modal.GenericModal<any, undefined>> | undefined>;
391
+ readonly config: _angular_core.InputSignal<ModalConfig<D> | undefined>;
334
392
  readonly isOpen: _angular_core.InputSignal<boolean>;
335
393
  readonly isAnimated: _angular_core.InputSignal<boolean>;
336
- readonly isSwipeableModalActive: _angular_core.InputSignal<boolean>;
394
+ readonly isBottomSheetModalActive: _angular_core.InputSignal<boolean>;
337
395
  readonly animationDuration: _angular_core.InputSignal<number>;
338
396
  readonly hasDefaultContentWrapperClass: _angular_core.InputSignal<boolean>;
339
397
  readonly hasBanner: _angular_core.InputSignal<boolean>;
340
398
  readonly close: _angular_core.OutputEmitterRef<ModalCloseMode | undefined>;
341
399
  readonly onBackdropClick: _angular_core.OutputEmitterRef<MouseEvent>;
342
- swipeableComponents: QueryList<ModalSwipeable>;
400
+ bottomSheet: QueryList<ModalBottomSheet>;
343
401
  modalClasses: _angular_core.Signal<{
344
402
  'centered-modal-content-wrapper': boolean;
345
403
  'centered-modal-default-style': boolean;
@@ -347,21 +405,22 @@ declare class ModalCentered<D = unknown> implements IGenericModalView<D> {
347
405
  'centered-modal-animate-out': boolean;
348
406
  }>;
349
407
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ModalCentered<any>, never>;
350
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ModalCentered<any>, "modal-centered", never, { "headerTemplate": { "alias": "headerTemplate"; "required": true; "isSignal": true; }; "footerTemplate": { "alias": "footerTemplate"; "required": true; "isSignal": true; }; "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>;
408
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ModalCentered<any>, "modal-centered", never, { "headerTemplate": { "alias": "headerTemplate"; "required": true; "isSignal": true; }; "footerTemplate": { "alias": "footerTemplate"; "required": true; "isSignal": true; }; "config": { "alias": "config"; "required": true; "isSignal": true; }; "isOpen": { "alias": "isOpen"; "required": true; "isSignal": true; }; "isAnimated": { "alias": "isAnimated"; "required": true; "isSignal": true; }; "isBottomSheetModalActive": { "alias": "isBottomSheetModalActive"; "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>;
351
409
  }
352
410
 
353
- declare class ModalSide<D = unknown> implements IGenericModalView<D> {
411
+ declare class ModalSide<D = unknown> implements IModalView<D> {
412
+ readonly layout: _angular_core.InputSignal<ModalLayout>;
354
413
  readonly headerTemplate: _angular_core.InputSignal<TemplateRef<any> | null>;
355
414
  readonly footerTemplate: _angular_core.InputSignal<TemplateRef<any> | null>;
356
- readonly config: _angular_core.InputSignal<GenericModalConfig<D, any, _filip_mazev_modal.GenericModal<any, undefined>> | undefined>;
415
+ readonly config: _angular_core.InputSignal<ModalConfig<D> | undefined>;
357
416
  readonly isOpen: _angular_core.InputSignal<boolean>;
358
417
  readonly isAnimated: _angular_core.InputSignal<boolean>;
359
- readonly isSwipeableModalActive: _angular_core.InputSignal<boolean>;
418
+ readonly isBottomSheetModalActive: _angular_core.InputSignal<boolean>;
360
419
  readonly animationDuration: _angular_core.InputSignal<number>;
361
420
  readonly hasDefaultContentWrapperClass: _angular_core.InputSignal<boolean>;
362
421
  readonly hasBanner: _angular_core.InputSignal<boolean>;
363
422
  readonly close: _angular_core.OutputEmitterRef<ModalCloseMode | undefined>;
364
- swipeableComponents: QueryList<ModalSwipeable>;
423
+ bottomSheet: QueryList<ModalBottomSheet>;
365
424
  protected renderOpenClass: _angular_core.WritableSignal<boolean>;
366
425
  modalClasses: _angular_core.Signal<{
367
426
  'side-modal-content-wrapper': boolean;
@@ -374,58 +433,69 @@ declare class ModalSide<D = unknown> implements IGenericModalView<D> {
374
433
  }>;
375
434
  constructor();
376
435
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ModalSide<any>, never>;
377
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ModalSide<any>, "modal-side", never, { "headerTemplate": { "alias": "headerTemplate"; "required": true; "isSignal": true; }; "footerTemplate": { "alias": "footerTemplate"; "required": true; "isSignal": true; }; "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>;
436
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ModalSide<any>, "modal-side", never, { "layout": { "alias": "layout"; "required": true; "isSignal": true; }; "headerTemplate": { "alias": "headerTemplate"; "required": true; "isSignal": true; }; "footerTemplate": { "alias": "footerTemplate"; "required": true; "isSignal": true; }; "config": { "alias": "config"; "required": true; "isSignal": true; }; "isOpen": { "alias": "isOpen"; "required": true; "isSignal": true; }; "isAnimated": { "alias": "isAnimated"; "required": true; "isSignal": true; }; "isBottomSheetModalActive": { "alias": "isBottomSheetModalActive"; "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>;
378
437
  }
379
438
 
380
- declare class ModalCore<D = unknown, R = any, C extends GenericModal<D, R> = GenericModal<D, R>> implements IGenericModalComponenet<D, R, C> {
439
+ declare class ModalCore<D, R, C extends IModal<D, R> = IModal<D, R>> implements IModalComponenet<D, R, C> {
381
440
  private modalService;
382
441
  private windowDimensionsService;
383
442
  private scrollLockService;
384
443
  private deviceTypeService;
385
444
  readonly afterClose: _angular_core.OutputEmitterRef<void>;
386
445
  readonly animationDuration: number;
446
+ /** The component reference (the component that is being displayed in the modal) */
387
447
  componentRef: ComponentRef<C>;
388
- config?: GenericModalConfig<D>;
448
+ /** The configuration for the modal */
449
+ config?: ModalConfig<D>;
389
450
  closeFunction?: Function;
390
- backdropClickSubject: Subject<MouseEvent>;
451
+ private backdropClickSubject;
391
452
  backdropClick: Observable<MouseEvent>;
392
453
  isOpen: _angular_core.WritableSignal<boolean>;
393
- isSwipeableModalActive: _angular_core.WritableSignal<boolean>;
454
+ effectiveLayout: _angular_core.WritableSignal<ModalLayout>;
455
+ isCentered: _angular_core.WritableSignal<boolean>;
456
+ isSide: _angular_core.WritableSignal<boolean>;
394
457
  protected headerTemplate: _angular_core.WritableSignal<TemplateRef<any> | null>;
395
458
  protected footerTemplate: _angular_core.WritableSignal<TemplateRef<any> | null>;
459
+ protected isBottomSheetModalActive: _angular_core.WritableSignal<boolean>;
396
460
  isAnimated: boolean;
397
- isCentered: boolean;
398
- isSide: boolean;
399
461
  protected hasBanner: boolean;
400
462
  protected hasDefaultContentWrapperClass: boolean;
401
463
  private isConfirmCloseModalOpen;
402
- private isSpecialMobileOverflowHandlingEnabled;
464
+ private isScrollHandlingEnabled;
403
465
  private isScrollDisabled;
466
+ private _sortedBreakpoints;
404
467
  protected windowDimensions: _angular_core.Signal<_filip_mazev_blocks_core.WindowDimensions>;
468
+ private _currentVcr;
469
+ set dynamicContainer(vcr: ViewContainerRef | undefined);
405
470
  modalContainer?: ElementRef;
471
+ contentTemplate?: TemplateRef<HTMLElement>;
406
472
  sideModalComponents?: QueryList<ModalSide>;
407
473
  centeredModalComponents?: QueryList<ModalCentered>;
408
- contentTemplate?: TemplateRef<HTMLElement>;
409
- dynamicContainer?: ViewContainerRef;
410
474
  constructor();
411
475
  ngOnInit(): void;
412
476
  ngAfterViewInit(): void;
413
477
  ngOnDestroy(): void;
414
478
  private initKeyboardSubscription;
415
479
  private initParamsFromConfig;
480
+ private initBreakpointCache;
416
481
  setHeaderTemplate(template: TemplateRef<any>): void;
417
482
  setFooterTemplate(template: TemplateRef<any>): void;
483
+ /**
484
+ * Closes the modal with the specified state and result.
485
+ * @param {ModalCloseMode} state The state of the modal close (e.g., 'confirm', 'cancel').
486
+ * @param {R | undefined} result The result to be returned when the modal closes.
487
+ * @param {boolean} fromInsideInteraction Whether the close was triggered from inside the modal interaction.
488
+ * @param {boolean} forceClose Whether to force close the modal, bypassing the close guards.
489
+ */
418
490
  close(state?: ModalCloseMode, result?: R | undefined, fromInsideInteraction?: boolean, forceClose?: boolean): void;
419
491
  private handleClose;
420
492
  protected onBackdropClick(event: MouseEvent): void;
421
- private shouldOpenConfirmCloseModal;
422
- private shouldOpenConfirmCloseModalSelfCheck;
423
- private handleWindowDimensionChange;
424
- private handleSwipeableModalOpened;
425
- private handleSwipeableModalClosed;
426
- private getSwipeableModal;
427
- private resetSwipeableModalPosition;
428
- private setSwipeableModalFinishedState;
493
+ private handleLayout;
494
+ private handleBottomSheetModalOpened;
495
+ private handleBottomSheetModalClosed;
496
+ private getBottomSheetModal;
497
+ private resetBottomSheetModalLayout;
498
+ private setBottomSheetModalFinishedState;
429
499
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ModalCore<any, any, any>, never>;
430
500
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<ModalCore<any, any, any>, "modal-core", never, {}, { "afterClose": "afterClose"; }, never, never, true, never>;
431
501
  }
@@ -439,58 +509,45 @@ declare class ModalBackdrop {
439
509
  }
440
510
 
441
511
  declare class ModalBanner<D = unknown> {
442
- readonly config: _angular_core.InputSignal<GenericModalConfig<D, any, _filip_mazev_modal.GenericModal<any, undefined>> | undefined>;
512
+ readonly config: _angular_core.InputSignal<ModalConfig<D> | undefined>;
443
513
  readonly close: _angular_core.OutputEmitterRef<ModalCloseMode | undefined>;
444
514
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ModalBanner<any>, never>;
445
515
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<ModalBanner<any>, "modal-banner", never, { "config": { "alias": "config"; "required": true; "isSignal": true; }; }, { "close": "close"; }, never, never, true, never>;
446
516
  }
447
517
 
448
- declare class GenericModalStyleConfig implements IGenericModalStyleConfig {
449
- position: ModalPoistion;
450
- handleMobile: boolean;
451
- animate: boolean;
452
- hasBackdrop: boolean;
453
- closeDelay?: number;
454
- showCloseButton?: boolean;
455
- mobileConfig: IGenericSwipeableModalConfig;
456
- contentWrapper: boolean;
457
- wrapperClasses: string;
458
- wrapperStyles: string;
459
- overrideFullHeight: boolean;
460
- constructor(config?: IGenericModalStyleConfig);
518
+ declare class Modal<D, R> implements IModal<D, R> {
519
+ /**
520
+ * Data injected into the modal component.
521
+ */
522
+ data: D;
523
+ /**
524
+ * Reference to the ModalRef instance associated with this modal.
525
+ */
526
+ modal: ModalRef<D, R>;
527
+ /**
528
+ * Called when the modal is initialized.
529
+ */
530
+ onModalInit(): void;
531
+ /**
532
+ * Closes the modal (with "cancel" reason) with an optional result.
533
+ * @param result The result to be passed when closing the modal.
534
+ */
535
+ close(result?: R): void;
536
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<Modal<any, any>, never>;
537
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<Modal<any, any>>;
461
538
  }
462
539
 
463
- declare const GENERIC_MODAL_DEFAULT_ANIM_DURATION = 175;
464
- declare const GENERIC_MODAL_DEFAULT_INTERNAL_ANIM_DURATION = 350;
465
- declare const GENERIC_MODAL_DEFAULT_ANIM_DURATION_MULTIPLIER_SMALL = 0.65;
466
- declare const GENERIC_MODAL_DEFAULT_ANIM_DURATION_MULTIPLIER_LARGE = 0.85;
467
-
468
- declare const EMPTY_STRING = "";
540
+ declare const MODAL_DEFAULT_ANIM_DURATION = 175;
541
+ declare const MODAL_DEFAULT_INTERNAL_ANIM_DURATION = 350;
542
+ declare const MODAL_DEFAULT_ANIM_DURATION_MULTIPLIER_SMALL = 0.65;
543
+ declare const MODAL_DEFAULT_ANIM_DURATION_MULTIPLIER_LARGE = 0.85;
469
544
 
470
- declare const GENERIC_MODAL_DOWN_SWIPE_LIMIT = 2;
471
- declare const GENERIC_MODAL_SWIPE_VELOCITY_THRESHOLD = 80;
472
-
473
- declare const LOWEST_CHARACTER_CAP = 23;
474
- declare const LOWER_CHARACTER_CAP = 33;
475
- declare const MID_CHARACTER_CAP = 49;
476
- declare const UPPER_CHARACTER_CAP = 60;
477
-
478
- declare enum GenericModalErrors {
479
- MODAL_DOESNT_MATCH_THE_REQUESTED_TYPES = "The modal doesn't match the requested types.",
480
- GENERIC_MODAL_SERVICE_RENDERER_NOT_SET = "ViewContainer and Renderer not set, please set the view container in the constructor of app.module.ts / app.ts (by calling register), before opening a modal",
481
- PARENT_MODAL_CANT_BE_THE_SAME_AS_CHILD = "Parent modal cannot be the same as the child modal",
482
- PARENT_MODAL_NOT_FOUND = "Parent modal does not exist",
483
- PARENT_MODAL_NOT_PROVIDED = "No parent modal provided for multilevel modal"
484
- }
545
+ declare const MODAL_DOWN_SWIPE_LIMIT = 2;
546
+ declare const MODAL_SWIPE_VELOCITY_THRESHOLD = 80;
485
547
 
486
- declare enum GenericModalWarnings {
487
- NO_PARENT_PROVIDED = "No parent modal provided for multilevel modal. Please provide a parent modal or set openAsMultilevel to false.",
488
- 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.",
489
- 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.",
490
- PARENT_MODAL_NOT_SET = "Error setting parent modal. Opening modal as normal modal",
491
- 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.",
492
- FOOTER_DIRECTIVE_OUTSIDE_MODAL = "[ModalFooter] Directive used outside of a GenericModalComponent.",
493
- HEADER_DIRECTIVE_OUTSIDE_MODAL = "[ModalHeader] Directive used outside of a GenericModalComponent."
548
+ declare enum ModalWarnings {
549
+ FOOTER_DIRECTIVE_OUTSIDE_MODAL = "[ModalFooter] Directive used outside of a ModalComponent.",
550
+ HEADER_DIRECTIVE_OUTSIDE_MODAL = "[ModalHeader] Directive used outside of a ModalComponent."
494
551
  }
495
552
 
496
553
  declare class ModalFooterDirective {
@@ -501,7 +558,7 @@ declare class ModalFooterDirective {
501
558
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ModalFooterDirective, "[modalFooter]", never, {}, {}, never, never, true, never>;
502
559
  }
503
560
 
504
- declare const GENERIC_MODAL_DATA: InjectionToken<any>;
561
+ declare const MODAL_DATA: InjectionToken<any>;
505
562
 
506
- export { EMPTY_STRING, GENERIC_MODAL_DATA, GENERIC_MODAL_DEFAULT_ANIM_DURATION, GENERIC_MODAL_DEFAULT_ANIM_DURATION_MULTIPLIER_LARGE, GENERIC_MODAL_DEFAULT_ANIM_DURATION_MULTIPLIER_SMALL, GENERIC_MODAL_DEFAULT_INTERNAL_ANIM_DURATION, GENERIC_MODAL_DOWN_SWIPE_LIMIT, GENERIC_MODAL_SWIPE_VELOCITY_THRESHOLD, GenericModal, GenericModalConfig, GenericModalErrors, GenericModalRef, GenericModalService, GenericModalState, GenericModalStyleConfig, GenericModalWarnings, LOWER_CHARACTER_CAP, LOWEST_CHARACTER_CAP, MID_CHARACTER_CAP, ModalBackdrop, ModalBanner, ModalCentered, ModalCore, ModalFooterDirective, ModalSide, ModalSwipeable, UPPER_CHARACTER_CAP };
507
- export type { IGenericCloseResult, IGenericConfirmCloseConfig, IGenericModalComponenet, IGenericModalConfig, IGenericModalRef, IGenericModalService, IGenericModalStyleConfig, IGenericModalView, IGenericSwipeableModalConfig, ModalCloseMode, ModalPoistion };
563
+ export { MODAL_DATA, MODAL_DEFAULT_ANIM_DURATION, MODAL_DEFAULT_ANIM_DURATION_MULTIPLIER_LARGE, MODAL_DEFAULT_ANIM_DURATION_MULTIPLIER_SMALL, MODAL_DEFAULT_INTERNAL_ANIM_DURATION, MODAL_DOWN_SWIPE_LIMIT, MODAL_SWIPE_VELOCITY_THRESHOLD, Modal, ModalBackdrop, ModalBanner, ModalBottomSheet, ModalCentered, ModalConfig, ModalCore, ModalFooterDirective, ModalRef, ModalService, ModalSide, ModalState, ModalStyleConfig, ModalWarnings };
564
+ export type { BreakpointKey, IBottomSheetModalConfig, IModalCloseResult, IModalComponenet, IModalConfig, IModalRef, IModalService, IModalStyleConfig, IModalView, ModalCloseMode, ModalLayout };