@filip.mazev/modal 0.1.50 → 0.1.51
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/README.md +4 -4
- package/fesm2022/filip.mazev-modal.mjs +198 -227
- package/fesm2022/filip.mazev-modal.mjs.map +1 -1
- package/package.json +1 -1
- package/types/filip.mazev-modal.d.ts +149 -148
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken, inject, Injector, ApplicationRef, EnvironmentInjector, RendererFactory2, createComponent, Injectable, input, output, Component, signal, computed, ViewChild, ViewChildren, effect, ViewContainerRef, TemplateRef, Directive } from '@angular/core';
|
|
3
|
-
import { BehaviorSubject, Subject, filter, skip,
|
|
3
|
+
import { BehaviorSubject, Subject, filter, skip, Observable, from, of, take, fromEvent, map } from 'rxjs';
|
|
4
4
|
import { DOCUMENT, NgClass, NgTemplateOutlet } from '@angular/common';
|
|
5
5
|
import { Router, NavigationEnd } from '@angular/router';
|
|
6
6
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
7
|
-
import {
|
|
7
|
+
import { ScrollLockService, WindowDimensionsService, uuidv4 } from '@filip.mazev/blocks-core';
|
|
8
8
|
|
|
9
9
|
class ModalStyleConfig {
|
|
10
10
|
layout;
|
|
@@ -19,7 +19,7 @@ class ModalStyleConfig {
|
|
|
19
19
|
wrapperStyles;
|
|
20
20
|
overrideFullHeight;
|
|
21
21
|
constructor(config) {
|
|
22
|
-
this.layout = config?.layout ??
|
|
22
|
+
this.layout = config?.layout ?? 'center';
|
|
23
23
|
this.breakpoints = config?.breakpoints;
|
|
24
24
|
this.animate = config?.animate ?? true;
|
|
25
25
|
this.hasBackdrop = config?.hasBackdrop ?? true;
|
|
@@ -27,8 +27,8 @@ class ModalStyleConfig {
|
|
|
27
27
|
this.showCloseButton = config?.showCloseButton ?? true;
|
|
28
28
|
this.mobileConfig = config?.mobileConfig ?? {};
|
|
29
29
|
this.contentWrapper = config?.contentWrapper ?? true;
|
|
30
|
-
this.wrapperClasses = config?.wrapperClasses ??
|
|
31
|
-
this.wrapperStyles = config?.wrapperStyles ??
|
|
30
|
+
this.wrapperClasses = config?.wrapperClasses ?? '';
|
|
31
|
+
this.wrapperStyles = config?.wrapperStyles ?? '';
|
|
32
32
|
this.overrideFullHeight = config?.overrideFullHeight ?? false;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -59,9 +59,9 @@ class ModalConfig {
|
|
|
59
59
|
this.disableCloseOnNavigation = config?.disableCloseOnNavigation ?? false;
|
|
60
60
|
this.data = config?.data ?? null;
|
|
61
61
|
this.style = new ModalStyleConfig(config?.style);
|
|
62
|
-
this.bannerText = config?.bannerText ??
|
|
63
|
-
this.contentClasses = config?.contentClasses ??
|
|
64
|
-
this.contentStyles = config?.contentStyles ??
|
|
62
|
+
this.bannerText = config?.bannerText ?? '';
|
|
63
|
+
this.contentClasses = config?.contentClasses ?? '';
|
|
64
|
+
this.contentStyles = config?.contentStyles ?? '';
|
|
65
65
|
this.disableConsoleWarnings = config?.disableConsoleWarnings ?? false;
|
|
66
66
|
this.disableConsoleInfo = config?.disableConsoleInfo ?? false;
|
|
67
67
|
this.id = config?.id;
|
|
@@ -76,93 +76,85 @@ var ModalState;
|
|
|
76
76
|
ModalState["CLOSING"] = "closing";
|
|
77
77
|
})(ModalState || (ModalState = {}));
|
|
78
78
|
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
79
80
|
class ModalRef {
|
|
80
81
|
componentType;
|
|
81
82
|
modalService;
|
|
82
83
|
//#region Modal Container
|
|
83
84
|
_modalContainer = {};
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
_modalContainerRef = {};
|
|
86
|
+
_modalContainerElement = {};
|
|
87
|
+
_parentElement = undefined;
|
|
88
|
+
//#region Component
|
|
89
|
+
_componentRef = {};
|
|
90
|
+
//#region Self
|
|
91
|
+
_modalState = ModalState.CLOSED;
|
|
92
|
+
//#endregion
|
|
93
|
+
modalState = new BehaviorSubject(this.getStatus());
|
|
94
|
+
_modalConfig = undefined;
|
|
95
|
+
//#region Observables
|
|
96
|
+
backdropClickSubject = new Subject();
|
|
97
|
+
//#endregion
|
|
98
|
+
afterCloseSubject = new Subject();
|
|
99
|
+
//#endregion
|
|
100
|
+
constructor(componentRef, componentType, modalContainerRef, modalService, modalConfig) {
|
|
101
|
+
this.componentType = componentType;
|
|
102
|
+
this.modalService = modalService;
|
|
103
|
+
this.modalConfig = modalConfig;
|
|
104
|
+
this.modalContainerRef = modalContainerRef;
|
|
105
|
+
this.modalContainerElement = modalContainerRef.location.nativeElement;
|
|
106
|
+
this.componentRef = componentRef;
|
|
86
107
|
}
|
|
87
108
|
get modalContainer() {
|
|
88
109
|
return this._modalContainer;
|
|
89
110
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
this._modalContainerRef = modalContainerRef;
|
|
111
|
+
set modalContainer(modalContainer) {
|
|
112
|
+
this._modalContainer = modalContainer;
|
|
93
113
|
}
|
|
94
114
|
get modalContainerRef() {
|
|
95
115
|
return this._modalContainerRef;
|
|
96
116
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
this._modalContainerElement = modalContainerElement;
|
|
117
|
+
set modalContainerRef(modalContainerRef) {
|
|
118
|
+
this._modalContainerRef = modalContainerRef;
|
|
100
119
|
}
|
|
101
120
|
get modalContainerElement() {
|
|
102
121
|
return this._modalContainerElement;
|
|
103
122
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
this._parentElement = parentElement;
|
|
123
|
+
set modalContainerElement(modalContainerElement) {
|
|
124
|
+
this._modalContainerElement = modalContainerElement;
|
|
107
125
|
}
|
|
108
126
|
get parentElement() {
|
|
109
127
|
return this._parentElement;
|
|
110
128
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
_componentRef = {};
|
|
114
|
-
set componentRef(componentRef) {
|
|
115
|
-
this._componentRef = componentRef;
|
|
129
|
+
set parentElement(parentElement) {
|
|
130
|
+
this._parentElement = parentElement;
|
|
116
131
|
}
|
|
132
|
+
//#endregion
|
|
117
133
|
get componentRef() {
|
|
118
134
|
return this._componentRef;
|
|
119
135
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
_modalState = ModalState.CLOSED;
|
|
123
|
-
modalState = new BehaviorSubject(this.getStatus());
|
|
124
|
-
modalState$() {
|
|
125
|
-
return this.modalState.asObservable();
|
|
136
|
+
set componentRef(componentRef) {
|
|
137
|
+
this._componentRef = componentRef;
|
|
126
138
|
}
|
|
127
|
-
|
|
128
|
-
return this.
|
|
139
|
+
get modalConfig() {
|
|
140
|
+
return this._modalConfig;
|
|
129
141
|
}
|
|
130
|
-
_modalConfig = undefined;
|
|
131
142
|
set modalConfig(modalConfig) {
|
|
132
143
|
this._modalConfig = modalConfig;
|
|
133
144
|
}
|
|
134
|
-
get modalConfig() {
|
|
135
|
-
return this._modalConfig;
|
|
136
|
-
}
|
|
137
|
-
//#endregion
|
|
138
|
-
//#region Observables
|
|
139
|
-
backdropClickSubject = new Subject();
|
|
140
145
|
backdropClick() {
|
|
141
146
|
return this.backdropClickSubject.asObservable();
|
|
142
147
|
}
|
|
143
|
-
|
|
144
|
-
this.
|
|
148
|
+
modalState$() {
|
|
149
|
+
return this.modalState.asObservable();
|
|
145
150
|
}
|
|
146
|
-
afterCloseSubject = new Subject();
|
|
147
151
|
/**
|
|
148
152
|
* Observable that emits when the modal has been closed.
|
|
149
|
-
* @returns An Observable that emits an IModalCloseResult<R> when the modal is closed.
|
|
153
|
+
* @returns An Observable that emits an IModalCloseResult<R | undefined> when the modal is closed.
|
|
150
154
|
*/
|
|
151
155
|
afterClosed() {
|
|
152
156
|
return this.afterCloseSubject.asObservable();
|
|
153
157
|
}
|
|
154
|
-
afterClose(result) {
|
|
155
|
-
this.afterCloseSubject.next(result);
|
|
156
|
-
}
|
|
157
|
-
//#endregion
|
|
158
|
-
constructor(componentRef, componentType, modalContainerRef, modalService, modalConfig) {
|
|
159
|
-
this.componentType = componentType;
|
|
160
|
-
this.modalService = modalService;
|
|
161
|
-
this.modalConfig = modalConfig;
|
|
162
|
-
this.modalContainerRef = modalContainerRef;
|
|
163
|
-
this.modalContainerElement = modalContainerRef.location.nativeElement;
|
|
164
|
-
this.componentRef = componentRef;
|
|
165
|
-
}
|
|
166
158
|
//#region Public Methods
|
|
167
159
|
async open() {
|
|
168
160
|
this._modalState = ModalState.OPENING;
|
|
@@ -178,9 +170,18 @@ class ModalRef {
|
|
|
178
170
|
this._modalState = ModalState.OPEN;
|
|
179
171
|
this.modalState.next(ModalState.OPEN);
|
|
180
172
|
}
|
|
181
|
-
close(state =
|
|
173
|
+
close(state = 'cancel', result = undefined, forceClose = false) {
|
|
182
174
|
this.modalContainerRef.instance.close(state, result, false, forceClose);
|
|
183
175
|
}
|
|
176
|
+
getStatus() {
|
|
177
|
+
return this._modalState;
|
|
178
|
+
}
|
|
179
|
+
backdropClicked(event) {
|
|
180
|
+
this.backdropClickSubject.next(event);
|
|
181
|
+
}
|
|
182
|
+
afterClose(result) {
|
|
183
|
+
this.afterCloseSubject.next(result);
|
|
184
|
+
}
|
|
184
185
|
//#endregion
|
|
185
186
|
//#region Private Methods
|
|
186
187
|
handleClose(result) {
|
|
@@ -199,7 +200,8 @@ class ModalRef {
|
|
|
199
200
|
}
|
|
200
201
|
}
|
|
201
202
|
|
|
202
|
-
|
|
203
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
204
|
+
const MODAL_DATA = new InjectionToken('MODAL_DATA');
|
|
203
205
|
|
|
204
206
|
class ModalService {
|
|
205
207
|
router = inject(Router);
|
|
@@ -238,17 +240,15 @@ class ModalService {
|
|
|
238
240
|
open(component, config) {
|
|
239
241
|
const dataInjector = Injector.create({
|
|
240
242
|
providers: [{ provide: MODAL_DATA, useValue: config?.data }],
|
|
241
|
-
parent: this.injector
|
|
243
|
+
parent: this.injector
|
|
242
244
|
});
|
|
243
245
|
const wrapperRef = createComponent((ModalCore), {
|
|
244
246
|
environmentInjector: this.environmentInjector,
|
|
245
247
|
elementInjector: dataInjector
|
|
246
248
|
});
|
|
247
249
|
const contentInjector = Injector.create({
|
|
248
|
-
providers: [
|
|
249
|
-
|
|
250
|
-
],
|
|
251
|
-
parent: wrapperRef.injector,
|
|
250
|
+
providers: [{ provide: ModalCore, useValue: wrapperRef.instance }],
|
|
251
|
+
parent: wrapperRef.injector
|
|
252
252
|
});
|
|
253
253
|
const contentRef = createComponent(component, {
|
|
254
254
|
environmentInjector: this.environmentInjector,
|
|
@@ -295,11 +295,11 @@ class ModalService {
|
|
|
295
295
|
/**
|
|
296
296
|
* Closes all open modals.
|
|
297
297
|
* @param onNavigate Indicates if the closeAll is triggered by navigation event.
|
|
298
|
-
|
|
298
|
+
*/
|
|
299
299
|
closeAll(onNavigate = false) {
|
|
300
300
|
this.modals.forEach((modal) => {
|
|
301
301
|
if (modal.modalConfig?.disableCloseOnNavigation !== true || !onNavigate) {
|
|
302
|
-
modal.close(
|
|
302
|
+
modal.close('cancel', undefined, true);
|
|
303
303
|
}
|
|
304
304
|
});
|
|
305
305
|
}
|
|
@@ -319,25 +319,22 @@ class ModalService {
|
|
|
319
319
|
/**
|
|
320
320
|
* Gets the count of currently open modals.
|
|
321
321
|
* @returns The number of open modals.
|
|
322
|
-
|
|
322
|
+
*/
|
|
323
323
|
modalsCount() {
|
|
324
324
|
return this.modals.size;
|
|
325
325
|
}
|
|
326
326
|
//#endregion
|
|
327
327
|
//#region Helper Methods
|
|
328
328
|
isIModal(component) {
|
|
329
|
-
return
|
|
330
|
-
component !== null &&
|
|
331
|
-
'onModalInit' in component &&
|
|
332
|
-
typeof component.onModalInit === 'function');
|
|
329
|
+
return typeof component === 'object' && component !== null && 'onModalInit' in component && typeof component.onModalInit === 'function';
|
|
333
330
|
}
|
|
334
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.
|
|
335
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.
|
|
331
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ModalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
332
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ModalService, providedIn: 'root' });
|
|
336
333
|
}
|
|
337
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.
|
|
334
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ModalService, decorators: [{
|
|
338
335
|
type: Injectable,
|
|
339
336
|
args: [{
|
|
340
|
-
providedIn:
|
|
337
|
+
providedIn: 'root'
|
|
341
338
|
}]
|
|
342
339
|
}], ctorParameters: () => [] });
|
|
343
340
|
|
|
@@ -345,36 +342,34 @@ class ModalBackdrop {
|
|
|
345
342
|
isAnimated = input(false, ...(ngDevMode ? [{ debugName: "isAnimated" }] : []));
|
|
346
343
|
isOpen = input(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
|
|
347
344
|
click = output();
|
|
348
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.
|
|
349
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.
|
|
345
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ModalBackdrop, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
346
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.4", type: ModalBackdrop, isStandalone: true, selector: "app-modal-backdrop", inputs: { isAnimated: { classPropertyName: "isAnimated", publicName: "isAnimated", isSignal: true, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { click: "click" }, ngImport: i0, template: "<div class=\"modal-backdrop\" [class.backdrop-fade-in]=\"isAnimated() && isOpen()\"\n [class.backdrop-fade-out]=\"isAnimated() && !isOpen()\" (click)=\"click.emit($event)\">\n</div>", styles: [".modal-backdrop{position:fixed;inset:0;z-index:3;pointer-events:auto;-webkit-tap-highlight-color:transparent;background:#00000040;backface-visibility:hidden;-webkit-font-smoothing:subpixel-antialiased;-webkit-transform-style:preserve-3d;-moz-transform-style:preserve-3d;transform-style:preserve-3d;transform-origin:center}\n"] });
|
|
350
347
|
}
|
|
351
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.
|
|
348
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ModalBackdrop, decorators: [{
|
|
352
349
|
type: Component,
|
|
353
|
-
args: [{ selector: 'modal-backdrop', imports: [], template: "<div class=\"modal-backdrop\" [class.backdrop-fade-in]=\"isAnimated() && isOpen()\"\n [class.backdrop-fade-out]=\"isAnimated() && !isOpen()\" (click)=\"click.emit($event)\">\n</div>", styles: [".modal-backdrop{position:fixed;inset:0;z-index:3;pointer-events:auto;-webkit-tap-highlight-color:transparent;background:#00000040;backface-visibility:hidden;-webkit-font-smoothing:subpixel-antialiased;-webkit-transform-style:preserve-3d;-moz-transform-style:preserve-3d;transform-style:preserve-3d;transform-origin:center}\n"] }]
|
|
350
|
+
args: [{ selector: 'app-modal-backdrop', imports: [], template: "<div class=\"modal-backdrop\" [class.backdrop-fade-in]=\"isAnimated() && isOpen()\"\n [class.backdrop-fade-out]=\"isAnimated() && !isOpen()\" (click)=\"click.emit($event)\">\n</div>", styles: [".modal-backdrop{position:fixed;inset:0;z-index:3;pointer-events:auto;-webkit-tap-highlight-color:transparent;background:#00000040;backface-visibility:hidden;-webkit-font-smoothing:subpixel-antialiased;-webkit-transform-style:preserve-3d;-moz-transform-style:preserve-3d;transform-style:preserve-3d;transform-origin:center}\n"] }]
|
|
354
351
|
}], propDecorators: { isAnimated: [{ type: i0.Input, args: [{ isSignal: true, alias: "isAnimated", required: false }] }], isOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpen", required: false }] }], click: [{ type: i0.Output, args: ["click"] }] } });
|
|
355
352
|
|
|
356
353
|
class ModalDefaultCloseButton {
|
|
357
354
|
config = input.required(...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
358
355
|
close = output();
|
|
359
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.
|
|
360
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.
|
|
356
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ModalDefaultCloseButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
357
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.4", type: ModalDefaultCloseButton, isStandalone: true, selector: "app-modal-default-close-button", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { close: "close" }, ngImport: i0, template: " @if (config()?.disableClose !== true && config()?.style?.showCloseButton !== false) {\n <svg (click)=\"close.emit('cancel')\" aria-label=\"Close\" class=\"default-close-button\" viewBox=\"0 0 24 24\"\n fill=\"#ffffff\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M2.4 24L0 21.6L9.6 12L0 2.4L2.4 0L12 9.6L21.6 0L24 2.4L14.4 12L24 21.6L21.6 24L12 14.4L2.4 24Z\"\n fill=\"#ffffff\" />\n </svg>\n }", styles: [".default-close-button{-webkit-user-select:none;user-select:none;background-repeat:no-repeat;display:inline-block;fill:currentColor;height:1.35rem;width:1.35rem;overflow:hidden;cursor:pointer;pointer-events:fill}.default-close-button path{transition:all .3s ease-in-out}.default-close-button path{fill:var(--modal-text, #000000)}\n"] });
|
|
361
358
|
}
|
|
362
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.
|
|
359
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ModalDefaultCloseButton, decorators: [{
|
|
363
360
|
type: Component,
|
|
364
|
-
args: [{ selector: 'modal-default-close-button', imports: [], template: " @if (config()?.disableClose !== true && config()?.style?.showCloseButton !== false) {\n <svg (click)=\"close.emit('cancel')\" aria-label=\"Close\" class=\"default-close-button\" viewBox=\"0 0 24 24\"\n fill=\"#ffffff\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M2.4 24L0 21.6L9.6 12L0 2.4L2.4 0L12 9.6L21.6 0L24 2.4L14.4 12L24 21.6L21.6 24L12 14.4L2.4 24Z\"\n fill=\"#ffffff\" />\n </svg>\n }", styles: [".default-close-button{-webkit-user-select:none;user-select:none;background-repeat:no-repeat;display:inline-block;fill:currentColor;height:1.35rem;width:1.35rem;overflow:hidden;cursor:pointer;pointer-events:fill}.default-close-button path{transition:all .3s ease-in-out}.default-close-button path{fill:var(--modal-text, #000000)}\n"] }]
|
|
361
|
+
args: [{ selector: 'app-modal-default-close-button', imports: [], template: " @if (config()?.disableClose !== true && config()?.style?.showCloseButton !== false) {\n <svg (click)=\"close.emit('cancel')\" aria-label=\"Close\" class=\"default-close-button\" viewBox=\"0 0 24 24\"\n fill=\"#ffffff\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M2.4 24L0 21.6L9.6 12L0 2.4L2.4 0L12 9.6L21.6 0L24 2.4L14.4 12L24 21.6L21.6 24L12 14.4L2.4 24Z\"\n fill=\"#ffffff\" />\n </svg>\n }", styles: [".default-close-button{-webkit-user-select:none;user-select:none;background-repeat:no-repeat;display:inline-block;fill:currentColor;height:1.35rem;width:1.35rem;overflow:hidden;cursor:pointer;pointer-events:fill}.default-close-button path{transition:all .3s ease-in-out}.default-close-button path{fill:var(--modal-text, #000000)}\n"] }]
|
|
365
362
|
}], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], close: [{ type: i0.Output, args: ["close"] }] } });
|
|
366
363
|
|
|
367
364
|
class ModalBanner {
|
|
368
365
|
config = input.required(...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
369
366
|
close = output();
|
|
370
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.
|
|
371
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.
|
|
367
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ModalBanner, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
368
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.4", type: ModalBanner, isStandalone: true, selector: "app-modal-banner", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { close: "close" }, ngImport: i0, template: "<div class=\"modal-top-banner-container\">\n <div class=\"modal-top-banner-title-container\">\n @if (config() && config()?.bannerText && (config() && config()!.bannerText.length > 0)) {\n {{ config()?.bannerText }}\n }\n </div>\n\n <app-modal-default-close-button [config]=\"config()\" (close)=\"close.emit('cancel')\"></app-modal-default-close-button>\n</div>", styles: [".modal-top-banner-container{display:flex;flex-direction:row;gap:2rem;justify-content:space-between;align-items:center;color:var(--modal-text, #000000);top:0;min-height:2rem;border-top-left-radius:.75rem;border-top-right-radius:.75rem}.modal-top-banner-title-container{display:flex;flex-direction:row;justify-content:flex-start;gap:1.5rem;align-items:center;width:100%}@keyframes banner-display{0%{opacity:0;height:0}to{opacity:1;height:auto}}@-webkit-keyframes banner-display{0%{opacity:0;height:0}to{opacity:1;height:auto}}@-moz-keyframes banner-display{0%{opacity:0;height:0}to{opacity:1;height:auto}}\n"], dependencies: [{ kind: "component", type: ModalDefaultCloseButton, selector: "app-modal-default-close-button", inputs: ["config"], outputs: ["close"] }] });
|
|
372
369
|
}
|
|
373
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.
|
|
370
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ModalBanner, decorators: [{
|
|
374
371
|
type: Component,
|
|
375
|
-
args: [{ selector: 'modal-banner', imports: [
|
|
376
|
-
ModalDefaultCloseButton
|
|
377
|
-
], template: "<div class=\"modal-top-banner-container\">\n <div class=\"modal-top-banner-title-container\">\n @if (config() && config()?.bannerText && (config() && config()!.bannerText.length > 0)) {\n {{ config()?.bannerText }}\n }\n </div>\n \n <modal-default-close-button [config]=\"config()\" (close)=\"close.emit('cancel')\"></modal-default-close-button>\n</div>", styles: [".modal-top-banner-container{display:flex;flex-direction:row;gap:2rem;justify-content:space-between;align-items:center;color:var(--modal-text, #000000);top:0;min-height:2rem;border-top-left-radius:.75rem;border-top-right-radius:.75rem}.modal-top-banner-title-container{display:flex;flex-direction:row;justify-content:flex-start;gap:1.5rem;align-items:center;width:100%}@keyframes banner-display{0%{opacity:0;height:0}to{opacity:1;height:auto}}@-webkit-keyframes banner-display{0%{opacity:0;height:0}to{opacity:1;height:auto}}@-moz-keyframes banner-display{0%{opacity:0;height:0}to{opacity:1;height:auto}}\n"] }]
|
|
372
|
+
args: [{ selector: 'app-modal-banner', imports: [ModalDefaultCloseButton], template: "<div class=\"modal-top-banner-container\">\n <div class=\"modal-top-banner-title-container\">\n @if (config() && config()?.bannerText && (config() && config()!.bannerText.length > 0)) {\n {{ config()?.bannerText }}\n }\n </div>\n\n <app-modal-default-close-button [config]=\"config()\" (close)=\"close.emit('cancel')\"></app-modal-default-close-button>\n</div>", styles: [".modal-top-banner-container{display:flex;flex-direction:row;gap:2rem;justify-content:space-between;align-items:center;color:var(--modal-text, #000000);top:0;min-height:2rem;border-top-left-radius:.75rem;border-top-right-radius:.75rem}.modal-top-banner-title-container{display:flex;flex-direction:row;justify-content:flex-start;gap:1.5rem;align-items:center;width:100%}@keyframes banner-display{0%{opacity:0;height:0}to{opacity:1;height:auto}}@-webkit-keyframes banner-display{0%{opacity:0;height:0}to{opacity:1;height:auto}}@-moz-keyframes banner-display{0%{opacity:0;height:0}to{opacity:1;height:auto}}\n"] }]
|
|
378
373
|
}], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], close: [{ type: i0.Output, args: ["close"] }] } });
|
|
379
374
|
|
|
380
375
|
const MODAL_DOWN_SWIPE_LIMIT = 3;
|
|
@@ -392,6 +387,8 @@ class ModalBottomSheet {
|
|
|
392
387
|
currentTranslateY = signal(0, ...(ngDevMode ? [{ debugName: "currentTranslateY" }] : []));
|
|
393
388
|
isSwipingVerticallyFinished = signal(false, ...(ngDevMode ? [{ debugName: "isSwipingVerticallyFinished" }] : []));
|
|
394
389
|
isSwipingVertically = signal(false, ...(ngDevMode ? [{ debugName: "isSwipingVertically" }] : []));
|
|
390
|
+
verticalSwipeTarget;
|
|
391
|
+
elementRef;
|
|
395
392
|
modalTransform = computed(() => {
|
|
396
393
|
if (this.isSwipingVerticallyFinished()) {
|
|
397
394
|
return 'translateY(100%)';
|
|
@@ -405,8 +402,6 @@ class ModalBottomSheet {
|
|
|
405
402
|
bottomSheetInitiated = false;
|
|
406
403
|
cleanupListeners = null;
|
|
407
404
|
globalResizeCleanup = null;
|
|
408
|
-
verticalSwipeTarget;
|
|
409
|
-
elementRef;
|
|
410
405
|
ngOnInit() {
|
|
411
406
|
this.startVerticalSwipeDetection();
|
|
412
407
|
this.monitorInputType();
|
|
@@ -492,9 +487,7 @@ class ModalBottomSheet {
|
|
|
492
487
|
this.bottomSheetInitiated = true;
|
|
493
488
|
const config = this.config();
|
|
494
489
|
const style = config?.style?.mobileConfig;
|
|
495
|
-
this.downSwipeLimit = style?.downSwipeLimit && style.downSwipeLimit > 0
|
|
496
|
-
? style.downSwipeLimit
|
|
497
|
-
: MODAL_DOWN_SWIPE_LIMIT;
|
|
490
|
+
this.downSwipeLimit = style?.downSwipeLimit && style.downSwipeLimit > 0 ? style.downSwipeLimit : MODAL_DOWN_SWIPE_LIMIT;
|
|
498
491
|
}
|
|
499
492
|
monitorInputType() {
|
|
500
493
|
if (this.globalResizeCleanup)
|
|
@@ -513,21 +506,18 @@ class ModalBottomSheet {
|
|
|
513
506
|
window.addEventListener('pointerdown', handler);
|
|
514
507
|
this.globalResizeCleanup = () => window.removeEventListener('pointerdown', handler);
|
|
515
508
|
}
|
|
516
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.
|
|
517
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.
|
|
509
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ModalBottomSheet, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
510
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.4", type: ModalBottomSheet, isStandalone: true, selector: "app-modal-bottom-sheet", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, headerTemplate: { classPropertyName: "headerTemplate", publicName: "headerTemplate", isSignal: true, isRequired: true, transformFunction: null }, footerTemplate: { classPropertyName: "footerTemplate", publicName: "footerTemplate", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: true, transformFunction: null }, isAnimated: { classPropertyName: "isAnimated", publicName: "isAnimated", isSignal: true, isRequired: true, transformFunction: null }, animationDuration: { classPropertyName: "animationDuration", publicName: "animationDuration", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { close: "close" }, viewQueries: [{ propertyName: "verticalSwipeTarget", first: true, predicate: ["verticalSwipeTarget"], descendants: true, static: true }, { propertyName: "elementRef", first: true, predicate: ["elementRef"], descendants: true, static: true }], ngImport: i0, template: "<div (click)=\"$event.stopPropagation()\" \n [id]=\"id() ?? ''\"\n [class]=\"config()?.style?.wrapperClasses ?? ''\"\n [style]=\"config()?.style?.wrapperStyles ?? ''\"\n [style.max-height]=\"config()?.style?.mobileConfig?.customHeight ?? ''\"\n [style.transform]=\"modalTransform()\"\n [style.transition]=\"isAnimated() && !isSwipingVertically() ? 'transform 300ms ease-in-out' : ''\" \n [ngClass]=\"{\n 'opened-bottom-sheet-modal': isAnimated()\n }\" \n #elementRef\n class=\"bottom-sheet-modal-style\">\n \n <div #verticalSwipeTarget \n class=\"touch-hitbox bottom-sheet-modal-top-bar\"\n (click)=\"isTrackingSwipe ? null : close.emit('cancel')\">\n <div class=\"swipe-line\"></div>\n </div>\n\n <div class=\"bottom-sheet-modal-inner-content-container\">\n <div class=\"bottom-sheet-modal-top-group\">\n @if (headerTemplate()) {\n <div class=\"bottom-sheet-modal-header\">\n <ng-container *ngTemplateOutlet=\"headerTemplate()\"></ng-container>\n </div>\n }\n\n <div class=\"bottom-sheet-modal-main-content-container\"\n [style.animationDuration]=\"isAnimated() ? animationDuration() + 'ms' : '0ms'\">\n <ng-content></ng-content>\n </div>\n </div>\n\n @if (footerTemplate()) {\n <div class=\"bottom-sheet-modal-footer\">\n <ng-container *ngTemplateOutlet=\"footerTemplate()\"></ng-container>\n </div>\n }\n </div>\n</div>", styles: [".bottom-sheet-modal-style{position:fixed;z-index:3;min-height:60vh;min-height:60dvh;max-height:98vh;max-height:98dvh;width:100vw;width:100dvw;min-width:100vw;max-width:100dvw;bottom:0;left:0;margin:0 auto;border-radius:30px 30px 0 0;background-color:var(--modal-bg, #ffffff);color:var(--modal-text, #000000);display:flex;flex-direction:column}.touch-hitbox{display:flex;flex-direction:row;width:100%;height:3.5rem;justify-content:center;align-items:center;padding-bottom:.5rem;margin-top:-1.5rem;flex-shrink:0}.swipe-line{width:7rem;height:.33rem;background-color:var(--modal-mobile-swipe-line-color, #000000);border-radius:200rem;margin-top:1.5rem;opacity:.215;cursor:pointer}.bottom-sheet-modal-inner-content-container{display:flex;flex-direction:column;flex:1;min-height:0;padding:0 1.25rem 1.75rem;gap:1.5rem;box-sizing:border-box;overflow:hidden}.bottom-sheet-modal-top-group{display:flex;flex-direction:column;gap:1rem;flex-grow:1;min-height:0}.bottom-sheet-modal-main-content-container{flex-grow:1;overflow-y:auto;min-height:0;display:flex;flex-direction:column;padding:0}.opened-bottom-sheet-modal{animation:opened-bottom-sheet-modal-anim .35s}.bottom-sheet-modal-top-bar{display:flex;justify-content:center}.bottom-sheet-modal-header{flex-shrink:0;width:100%;display:flex;justify-content:flex-start;padding-top:.5rem;gap:.5rem}.bottom-sheet-modal-footer{flex-shrink:0;width:100%;display:flex;justify-content:center;gap:.5rem}@-moz-keyframes opened-bottom-sheet-modal-anim{0%{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes opened-bottom-sheet-modal-anim{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes opened-bottom-sheet-modal-anim{0%{transform:translateY(100%)}to{transform:translateY(0)}}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
518
511
|
}
|
|
519
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.
|
|
512
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ModalBottomSheet, decorators: [{
|
|
520
513
|
type: Component,
|
|
521
|
-
args: [{ selector: 'modal-bottom-sheet', imports: [
|
|
522
|
-
NgClass,
|
|
523
|
-
NgTemplateOutlet
|
|
524
|
-
], template: "<div (click)=\"$event.stopPropagation()\" \n [id]=\"id() ?? ''\"\n [class]=\"config()?.style?.wrapperClasses ?? ''\"\n [style]=\"config()?.style?.wrapperStyles ?? ''\"\n [style.max-height]=\"config()?.style?.mobileConfig?.customHeight ?? ''\"\n [style.transform]=\"modalTransform()\"\n [style.transition]=\"isAnimated() && !isSwipingVertically() ? 'transform 300ms ease-in-out' : ''\" \n [ngClass]=\"{\n 'opened-bottom-sheet-modal': isAnimated()\n }\" \n #elementRef\n class=\"bottom-sheet-modal-style\">\n \n <div #verticalSwipeTarget \n class=\"touch-hitbox bottom-sheet-modal-top-bar\"\n (click)=\"isTrackingSwipe ? null : close.emit('cancel')\">\n <div class=\"swipe-line\"></div>\n </div>\n\n <div class=\"bottom-sheet-modal-inner-content-container\">\n <div class=\"bottom-sheet-modal-top-group\">\n @if (headerTemplate()) {\n <div class=\"bottom-sheet-modal-header\">\n <ng-container *ngTemplateOutlet=\"headerTemplate()\"></ng-container>\n </div>\n }\n\n <div class=\"bottom-sheet-modal-main-content-container\"\n [style.animationDuration]=\"isAnimated() ? animationDuration() + 'ms' : '0ms'\">\n <ng-content></ng-content>\n </div>\n </div>\n\n @if (footerTemplate()) {\n <div class=\"bottom-sheet-modal-footer\">\n <ng-container *ngTemplateOutlet=\"footerTemplate()\"></ng-container>\n </div>\n }\n </div>\n</div>", styles: [".bottom-sheet-modal-style{position:fixed;z-index:3;min-height:60vh;min-height:60dvh;max-height:98vh;max-height:98dvh;width:100vw;width:100dvw;min-width:100vw;max-width:100dvw;bottom:0;left:0;margin:0 auto;border-radius:30px 30px 0 0;background-color:var(--modal-bg, #ffffff);color:var(--modal-text, #000000);display:flex;flex-direction:column}.touch-hitbox{display:flex;flex-direction:row;width:100%;height:3.5rem;justify-content:center;align-items:center;padding-bottom:.5rem;margin-top:-1.5rem;flex-shrink:0}.swipe-line{width:7rem;height:.33rem;background-color:var(--modal-mobile-swipe-line-color, #000000);border-radius:200rem;margin-top:1.5rem;opacity:.215;cursor:pointer}.bottom-sheet-modal-inner-content-container{display:flex;flex-direction:column;flex:1;min-height:0;padding:0 1.25rem 1.75rem;gap:1.5rem;box-sizing:border-box;overflow:hidden}.bottom-sheet-modal-top-group{display:flex;flex-direction:column;gap:1rem;flex-grow:1;min-height:0}.bottom-sheet-modal-main-content-container{flex-grow:1;overflow-y:auto;min-height:0;display:flex;flex-direction:column;padding:0}.opened-bottom-sheet-modal{animation:opened-bottom-sheet-modal-anim .35s}.bottom-sheet-modal-top-bar{display:flex;justify-content:center}.bottom-sheet-modal-header{flex-shrink:0;width:100%;display:flex;justify-content:flex-start;padding-top:.5rem;gap:.5rem}.bottom-sheet-modal-footer{flex-shrink:0;width:100%;display:flex;justify-content:center;gap:.5rem}@-moz-keyframes opened-bottom-sheet-modal-anim{0%{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes opened-bottom-sheet-modal-anim{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes opened-bottom-sheet-modal-anim{0%{transform:translateY(100%)}to{transform:translateY(0)}}\n"] }]
|
|
514
|
+
args: [{ selector: 'app-modal-bottom-sheet', imports: [NgClass, NgTemplateOutlet], template: "<div (click)=\"$event.stopPropagation()\" \n [id]=\"id() ?? ''\"\n [class]=\"config()?.style?.wrapperClasses ?? ''\"\n [style]=\"config()?.style?.wrapperStyles ?? ''\"\n [style.max-height]=\"config()?.style?.mobileConfig?.customHeight ?? ''\"\n [style.transform]=\"modalTransform()\"\n [style.transition]=\"isAnimated() && !isSwipingVertically() ? 'transform 300ms ease-in-out' : ''\" \n [ngClass]=\"{\n 'opened-bottom-sheet-modal': isAnimated()\n }\" \n #elementRef\n class=\"bottom-sheet-modal-style\">\n \n <div #verticalSwipeTarget \n class=\"touch-hitbox bottom-sheet-modal-top-bar\"\n (click)=\"isTrackingSwipe ? null : close.emit('cancel')\">\n <div class=\"swipe-line\"></div>\n </div>\n\n <div class=\"bottom-sheet-modal-inner-content-container\">\n <div class=\"bottom-sheet-modal-top-group\">\n @if (headerTemplate()) {\n <div class=\"bottom-sheet-modal-header\">\n <ng-container *ngTemplateOutlet=\"headerTemplate()\"></ng-container>\n </div>\n }\n\n <div class=\"bottom-sheet-modal-main-content-container\"\n [style.animationDuration]=\"isAnimated() ? animationDuration() + 'ms' : '0ms'\">\n <ng-content></ng-content>\n </div>\n </div>\n\n @if (footerTemplate()) {\n <div class=\"bottom-sheet-modal-footer\">\n <ng-container *ngTemplateOutlet=\"footerTemplate()\"></ng-container>\n </div>\n }\n </div>\n</div>", styles: [".bottom-sheet-modal-style{position:fixed;z-index:3;min-height:60vh;min-height:60dvh;max-height:98vh;max-height:98dvh;width:100vw;width:100dvw;min-width:100vw;max-width:100dvw;bottom:0;left:0;margin:0 auto;border-radius:30px 30px 0 0;background-color:var(--modal-bg, #ffffff);color:var(--modal-text, #000000);display:flex;flex-direction:column}.touch-hitbox{display:flex;flex-direction:row;width:100%;height:3.5rem;justify-content:center;align-items:center;padding-bottom:.5rem;margin-top:-1.5rem;flex-shrink:0}.swipe-line{width:7rem;height:.33rem;background-color:var(--modal-mobile-swipe-line-color, #000000);border-radius:200rem;margin-top:1.5rem;opacity:.215;cursor:pointer}.bottom-sheet-modal-inner-content-container{display:flex;flex-direction:column;flex:1;min-height:0;padding:0 1.25rem 1.75rem;gap:1.5rem;box-sizing:border-box;overflow:hidden}.bottom-sheet-modal-top-group{display:flex;flex-direction:column;gap:1rem;flex-grow:1;min-height:0}.bottom-sheet-modal-main-content-container{flex-grow:1;overflow-y:auto;min-height:0;display:flex;flex-direction:column;padding:0}.opened-bottom-sheet-modal{animation:opened-bottom-sheet-modal-anim .35s}.bottom-sheet-modal-top-bar{display:flex;justify-content:center}.bottom-sheet-modal-header{flex-shrink:0;width:100%;display:flex;justify-content:flex-start;padding-top:.5rem;gap:.5rem}.bottom-sheet-modal-footer{flex-shrink:0;width:100%;display:flex;justify-content:center;gap:.5rem}@-moz-keyframes opened-bottom-sheet-modal-anim{0%{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes opened-bottom-sheet-modal-anim{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes opened-bottom-sheet-modal-anim{0%{transform:translateY(100%)}to{transform:translateY(0)}}\n"] }]
|
|
525
515
|
}], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], headerTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerTemplate", required: true }] }], footerTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "footerTemplate", required: true }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], isOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpen", required: true }] }], isAnimated: [{ type: i0.Input, args: [{ isSignal: true, alias: "isAnimated", required: true }] }], animationDuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "animationDuration", required: true }] }], close: [{ type: i0.Output, args: ["close"] }], verticalSwipeTarget: [{
|
|
526
516
|
type: ViewChild,
|
|
527
|
-
args: [
|
|
517
|
+
args: ['verticalSwipeTarget', { static: true }]
|
|
528
518
|
}], elementRef: [{
|
|
529
519
|
type: ViewChild,
|
|
530
|
-
args: [
|
|
520
|
+
args: ['elementRef', { static: true }]
|
|
531
521
|
}] } });
|
|
532
522
|
|
|
533
523
|
class ModalCentered {
|
|
@@ -549,21 +539,15 @@ class ModalCentered {
|
|
|
549
539
|
'centered-modal-content-wrapper': true,
|
|
550
540
|
'centered-modal-default-style': this.hasDefaultContentWrapperClass() || this.hasBanner(),
|
|
551
541
|
'centered-modal-animate-in': this.isAnimated() && this.isOpen(),
|
|
552
|
-
'centered-modal-animate-out': this.isAnimated() && !this.isOpen()
|
|
542
|
+
'centered-modal-animate-out': this.isAnimated() && !this.isOpen()
|
|
553
543
|
};
|
|
554
544
|
}, ...(ngDevMode ? [{ debugName: "modalClasses" }] : []));
|
|
555
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.
|
|
556
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.
|
|
545
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ModalCentered, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
546
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.4", type: ModalCentered, isStandalone: true, selector: "app-modal-centered", inputs: { headerTemplate: { classPropertyName: "headerTemplate", publicName: "headerTemplate", isSignal: true, isRequired: true, transformFunction: null }, footerTemplate: { classPropertyName: "footerTemplate", publicName: "footerTemplate", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: true, transformFunction: null }, isAnimated: { classPropertyName: "isAnimated", publicName: "isAnimated", isSignal: true, isRequired: true, transformFunction: null }, isBottomSheetModalActive: { classPropertyName: "isBottomSheetModalActive", publicName: "isBottomSheetModalActive", isSignal: true, isRequired: true, transformFunction: null }, animationDuration: { classPropertyName: "animationDuration", publicName: "animationDuration", isSignal: true, isRequired: true, transformFunction: null }, hasDefaultContentWrapperClass: { classPropertyName: "hasDefaultContentWrapperClass", publicName: "hasDefaultContentWrapperClass", isSignal: true, isRequired: true, transformFunction: null }, hasBanner: { classPropertyName: "hasBanner", publicName: "hasBanner", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { close: "close", onBackdropClick: "onBackdropClick" }, viewQueries: [{ propertyName: "bottomSheet", predicate: ModalBottomSheet, descendants: true }], ngImport: i0, template: "@if(!isBottomSheetModalActive()) {\n<div class=\"modal-overlay\" [ngClass]=\"{'modal-backdrop': config()?.style?.hasBackdrop}\" [id]=\"id() ?? ''\"\n (click)=\"config()?.style?.hasBackdrop ? onBackdropClick.emit($event) : null\">\n <div class=\"modal-overlay-wrapper\">\n <div [ngClass]=\"modalClasses()\" (click)=\"$event.stopPropagation()\">\n <div class=\"centered-modal-inner-content-container\" [class]=\"config()?.style?.wrapperClasses ?? ''\"\n [style]=\"config()?.style?.wrapperStyles ?? ''\">\n\n <div class=\"centered-modal-top-group\">\n @if (hasBanner()) {\n <app-modal-banner [config]=\"config()\" (close)=\"close.emit('cancel')\"></app-modal-banner>\n }\n @if (headerTemplate()) {\n <div class=\"centered-modal-header\">\n <ng-container *ngTemplateOutlet=\"headerTemplate()\"></ng-container>\n @if(!hasBanner()) {\n <app-modal-default-close-button [config]=\"config()\"\n (close)=\"close.emit('cancel')\"></app-modal-default-close-button>\n }\n </div>\n }\n <div class=\"centered-modal-main-content-container\">\n <ng-container [ngTemplateOutlet]=\"contentTemplate\"> </ng-container>\n </div>\n </div>\n\n @if (footerTemplate()) {\n <div class=\"centered-modal-footer\">\n <ng-container *ngTemplateOutlet=\"footerTemplate()\"></ng-container>\n </div>\n }\n </div>\n </div>\n </div>\n</div>\n} @else {\n<app-modal-bottom-sheet [headerTemplate]=\"headerTemplate()\" [footerTemplate]=\"footerTemplate()\" [config]=\"config()\"\n [id]=\"id()\" [isOpen]=\"isOpen()\" [isAnimated]=\"isAnimated()\" [animationDuration]=\"animationDuration()\"\n (close)=\"close.emit('cancel')\">\n <ng-container [ngTemplateOutlet]=\"contentTemplate\"> </ng-container>\n</app-modal-bottom-sheet>\n}\n\n<ng-template #contentTemplate>\n <ng-content></ng-content>\n</ng-template>", styles: [".modal-overlay-wrapper{display:flex;position:absolute;z-index:3;justify-content:center;align-items:center;width:100%;height:100%}.modal-overlay{position:absolute;inset:0;z-index:2}.modal-backdrop{position:fixed;inset:0;z-index:3;pointer-events:auto;-webkit-tap-highlight-color:transparent;background:#00000040;backface-visibility:hidden;-webkit-font-smoothing:subpixel-antialiased;-webkit-transform-style:preserve-3d;-moz-transform-style:preserve-3d;transform-style:preserve-3d;transform-origin:center}.centered-modal-content-wrapper{display:flex;flex-direction:column;max-width:90vw;max-width:90dvw;max-height:95vh;max-height:95dvh;overflow:hidden}.centered-modal-default-style{border-radius:.75rem;box-shadow:0 8px 20px #0000001f;color:var(--modal-text, #000000);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border:1px solid transparent;background-color:var(--modal-bg, #ffffff)}.centered-modal-default-content-container{padding:1rem 1.5rem;max-height:85vh;max-height:85dvh;overflow-y:auto}.centered-modal-inner-content-container{display:flex;flex-direction:column;height:100%;padding:1rem 1.5rem;gap:1.5rem;box-sizing:border-box}.centered-modal-top-group{display:flex;flex-direction:column;gap:1rem;flex-grow:1;min-height:0}.centered-modal-main-content-container{flex-grow:1;overflow-y:auto;min-height:0}.centered-modal-header{flex-shrink:0;width:100%;display:flex;justify-content:space-between;gap:.5rem}.centered-modal-footer{flex-shrink:0;width:100%;display:flex;justify-content:center;gap:.5rem}.centered-modal-animate-in{scale:0;animation:centered-modal-animate-in .15s ease-in-out forwards}.centered-modal-animate-out{animation:centered-modal-animate-out .15s ease-in-out forwards}@keyframes centered-modal-animate-in{0%{scale:0}to{scale:1}}@-webkit-keyframes centered-modal-animate-in{0%{scale:0}to{scale:1}}@-moz-keyframes centered-modal-animate-in{0%{scale:0}to{scale:1}}@keyframes centered-modal-animate-out{0%{scale:1}to{scale:0}}@-webkit-keyframes centered-modal-animate-out{0%{scale:1}to{scale:0}}@-moz-keyframes centered-modal-animate-out{0%{scale:1}to{scale:0}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ModalBottomSheet, selector: "app-modal-bottom-sheet", inputs: ["id", "headerTemplate", "footerTemplate", "config", "isOpen", "isAnimated", "animationDuration"], outputs: ["close"] }, { kind: "component", type: ModalBanner, selector: "app-modal-banner", inputs: ["config"], outputs: ["close"] }, { kind: "component", type: ModalDefaultCloseButton, selector: "app-modal-default-close-button", inputs: ["config"], outputs: ["close"] }] });
|
|
557
547
|
}
|
|
558
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.
|
|
548
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ModalCentered, decorators: [{
|
|
559
549
|
type: Component,
|
|
560
|
-
args: [{ selector: 'modal-centered', imports: [
|
|
561
|
-
NgTemplateOutlet,
|
|
562
|
-
NgClass,
|
|
563
|
-
ModalBottomSheet,
|
|
564
|
-
ModalBanner,
|
|
565
|
-
ModalDefaultCloseButton
|
|
566
|
-
], template: "@if(!isBottomSheetModalActive()) {\n<div class=\"modal-overlay\" [ngClass]=\"{'modal-backdrop': config()?.style?.hasBackdrop}\" [id]=\"id() ?? ''\"\n (click)=\"config()?.style?.hasBackdrop ? onBackdropClick.emit($event) : null\">\n <div class=\"modal-overlay-wrapper\">\n <div [ngClass]=\"modalClasses()\" (click)=\"$event.stopPropagation()\">\n <div class=\"centered-modal-inner-content-container\" [class]=\"config()?.style?.wrapperClasses ?? ''\"\n [style]=\"config()?.style?.wrapperStyles ?? ''\">\n\n <div class=\"centered-modal-top-group\">\n @if (hasBanner()) {\n <modal-banner [config]=\"config()\" (close)=\"close.emit('cancel')\"></modal-banner>\n }\n @if (headerTemplate()) {\n <div class=\"centered-modal-header\">\n <ng-container *ngTemplateOutlet=\"headerTemplate()\"></ng-container>\n @if(!hasBanner()) {\n <modal-default-close-button [config]=\"config()\"\n (close)=\"close.emit('cancel')\"></modal-default-close-button>\n }\n </div>\n }\n <div class=\"centered-modal-main-content-container\">\n <ng-container [ngTemplateOutlet]=\"contentTemplate\"> </ng-container>\n </div>\n </div>\n\n @if (footerTemplate()) {\n <div class=\"centered-modal-footer\">\n <ng-container *ngTemplateOutlet=\"footerTemplate()\"></ng-container>\n </div>\n }\n </div>\n </div>\n </div>\n</div>\n} @else {\n<modal-bottom-sheet [headerTemplate]=\"headerTemplate()\" [footerTemplate]=\"footerTemplate()\" [config]=\"config()\"\n [id]=\"id()\" [isOpen]=\"isOpen()\" [isAnimated]=\"isAnimated()\" [animationDuration]=\"animationDuration()\"\n (close)=\"close.emit('cancel')\">\n <ng-container [ngTemplateOutlet]=\"contentTemplate\"> </ng-container>\n</modal-bottom-sheet>\n}\n\n<ng-template #contentTemplate>\n <ng-content></ng-content>\n</ng-template>", styles: [".modal-overlay-wrapper{display:flex;position:absolute;z-index:3;justify-content:center;align-items:center;width:100%;height:100%}.modal-overlay{position:absolute;inset:0;z-index:2}.modal-backdrop{position:fixed;inset:0;z-index:3;pointer-events:auto;-webkit-tap-highlight-color:transparent;background:#00000040;backface-visibility:hidden;-webkit-font-smoothing:subpixel-antialiased;-webkit-transform-style:preserve-3d;-moz-transform-style:preserve-3d;transform-style:preserve-3d;transform-origin:center}.centered-modal-content-wrapper{display:flex;flex-direction:column;max-width:90vw;max-width:90dvw;max-height:95vh;max-height:95dvh;overflow:hidden}.centered-modal-default-style{border-radius:.75rem;box-shadow:0 8px 20px #0000001f;color:var(--modal-text, #000000);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border:1px solid transparent;background-color:var(--modal-bg, #ffffff)}.centered-modal-default-content-container{padding:1rem 1.5rem;max-height:85vh;max-height:85dvh;overflow-y:auto}.centered-modal-inner-content-container{display:flex;flex-direction:column;height:100%;padding:1rem 1.5rem;gap:1.5rem;box-sizing:border-box}.centered-modal-top-group{display:flex;flex-direction:column;gap:1rem;flex-grow:1;min-height:0}.centered-modal-main-content-container{flex-grow:1;overflow-y:auto;min-height:0}.centered-modal-header{flex-shrink:0;width:100%;display:flex;justify-content:space-between;gap:.5rem}.centered-modal-footer{flex-shrink:0;width:100%;display:flex;justify-content:center;gap:.5rem}.centered-modal-animate-in{scale:0;animation:centered-modal-animate-in .15s ease-in-out forwards}.centered-modal-animate-out{animation:centered-modal-animate-out .15s ease-in-out forwards}@keyframes centered-modal-animate-in{0%{scale:0}to{scale:1}}@-webkit-keyframes centered-modal-animate-in{0%{scale:0}to{scale:1}}@-moz-keyframes centered-modal-animate-in{0%{scale:0}to{scale:1}}@keyframes centered-modal-animate-out{0%{scale:1}to{scale:0}}@-webkit-keyframes centered-modal-animate-out{0%{scale:1}to{scale:0}}@-moz-keyframes centered-modal-animate-out{0%{scale:1}to{scale:0}}\n"] }]
|
|
550
|
+
args: [{ selector: 'app-modal-centered', imports: [NgTemplateOutlet, NgClass, ModalBottomSheet, ModalBanner, ModalDefaultCloseButton], template: "@if(!isBottomSheetModalActive()) {\n<div class=\"modal-overlay\" [ngClass]=\"{'modal-backdrop': config()?.style?.hasBackdrop}\" [id]=\"id() ?? ''\"\n (click)=\"config()?.style?.hasBackdrop ? onBackdropClick.emit($event) : null\">\n <div class=\"modal-overlay-wrapper\">\n <div [ngClass]=\"modalClasses()\" (click)=\"$event.stopPropagation()\">\n <div class=\"centered-modal-inner-content-container\" [class]=\"config()?.style?.wrapperClasses ?? ''\"\n [style]=\"config()?.style?.wrapperStyles ?? ''\">\n\n <div class=\"centered-modal-top-group\">\n @if (hasBanner()) {\n <app-modal-banner [config]=\"config()\" (close)=\"close.emit('cancel')\"></app-modal-banner>\n }\n @if (headerTemplate()) {\n <div class=\"centered-modal-header\">\n <ng-container *ngTemplateOutlet=\"headerTemplate()\"></ng-container>\n @if(!hasBanner()) {\n <app-modal-default-close-button [config]=\"config()\"\n (close)=\"close.emit('cancel')\"></app-modal-default-close-button>\n }\n </div>\n }\n <div class=\"centered-modal-main-content-container\">\n <ng-container [ngTemplateOutlet]=\"contentTemplate\"> </ng-container>\n </div>\n </div>\n\n @if (footerTemplate()) {\n <div class=\"centered-modal-footer\">\n <ng-container *ngTemplateOutlet=\"footerTemplate()\"></ng-container>\n </div>\n }\n </div>\n </div>\n </div>\n</div>\n} @else {\n<app-modal-bottom-sheet [headerTemplate]=\"headerTemplate()\" [footerTemplate]=\"footerTemplate()\" [config]=\"config()\"\n [id]=\"id()\" [isOpen]=\"isOpen()\" [isAnimated]=\"isAnimated()\" [animationDuration]=\"animationDuration()\"\n (close)=\"close.emit('cancel')\">\n <ng-container [ngTemplateOutlet]=\"contentTemplate\"> </ng-container>\n</app-modal-bottom-sheet>\n}\n\n<ng-template #contentTemplate>\n <ng-content></ng-content>\n</ng-template>", styles: [".modal-overlay-wrapper{display:flex;position:absolute;z-index:3;justify-content:center;align-items:center;width:100%;height:100%}.modal-overlay{position:absolute;inset:0;z-index:2}.modal-backdrop{position:fixed;inset:0;z-index:3;pointer-events:auto;-webkit-tap-highlight-color:transparent;background:#00000040;backface-visibility:hidden;-webkit-font-smoothing:subpixel-antialiased;-webkit-transform-style:preserve-3d;-moz-transform-style:preserve-3d;transform-style:preserve-3d;transform-origin:center}.centered-modal-content-wrapper{display:flex;flex-direction:column;max-width:90vw;max-width:90dvw;max-height:95vh;max-height:95dvh;overflow:hidden}.centered-modal-default-style{border-radius:.75rem;box-shadow:0 8px 20px #0000001f;color:var(--modal-text, #000000);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border:1px solid transparent;background-color:var(--modal-bg, #ffffff)}.centered-modal-default-content-container{padding:1rem 1.5rem;max-height:85vh;max-height:85dvh;overflow-y:auto}.centered-modal-inner-content-container{display:flex;flex-direction:column;height:100%;padding:1rem 1.5rem;gap:1.5rem;box-sizing:border-box}.centered-modal-top-group{display:flex;flex-direction:column;gap:1rem;flex-grow:1;min-height:0}.centered-modal-main-content-container{flex-grow:1;overflow-y:auto;min-height:0}.centered-modal-header{flex-shrink:0;width:100%;display:flex;justify-content:space-between;gap:.5rem}.centered-modal-footer{flex-shrink:0;width:100%;display:flex;justify-content:center;gap:.5rem}.centered-modal-animate-in{scale:0;animation:centered-modal-animate-in .15s ease-in-out forwards}.centered-modal-animate-out{animation:centered-modal-animate-out .15s ease-in-out forwards}@keyframes centered-modal-animate-in{0%{scale:0}to{scale:1}}@-webkit-keyframes centered-modal-animate-in{0%{scale:0}to{scale:1}}@-moz-keyframes centered-modal-animate-in{0%{scale:0}to{scale:1}}@keyframes centered-modal-animate-out{0%{scale:1}to{scale:0}}@-webkit-keyframes centered-modal-animate-out{0%{scale:1}to{scale:0}}@-moz-keyframes centered-modal-animate-out{0%{scale:1}to{scale:0}}\n"] }]
|
|
567
551
|
}], propDecorators: { headerTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerTemplate", required: true }] }], footerTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "footerTemplate", required: true }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], isOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpen", required: true }] }], isAnimated: [{ type: i0.Input, args: [{ isSignal: true, alias: "isAnimated", required: true }] }], isBottomSheetModalActive: [{ type: i0.Input, args: [{ isSignal: true, alias: "isBottomSheetModalActive", required: true }] }], animationDuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "animationDuration", required: true }] }], hasDefaultContentWrapperClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasDefaultContentWrapperClass", required: true }] }], hasBanner: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasBanner", required: true }] }], close: [{ type: i0.Output, args: ["close"] }], onBackdropClick: [{ type: i0.Output, args: ["onBackdropClick"] }], bottomSheet: [{
|
|
568
552
|
type: ViewChildren,
|
|
569
553
|
args: [ModalBottomSheet]
|
|
@@ -583,7 +567,6 @@ class ModalSide {
|
|
|
583
567
|
hasBanner = input.required(...(ngDevMode ? [{ debugName: "hasBanner" }] : []));
|
|
584
568
|
close = output();
|
|
585
569
|
bottomSheet;
|
|
586
|
-
renderOpenClass = signal(false, ...(ngDevMode ? [{ debugName: "renderOpenClass" }] : []));
|
|
587
570
|
modalClasses = computed(() => {
|
|
588
571
|
const positionLeft = this.layout() === 'left';
|
|
589
572
|
const positionRight = this.layout() === 'right';
|
|
@@ -593,12 +576,13 @@ class ModalSide {
|
|
|
593
576
|
'side-modal-content-wrapper': true,
|
|
594
577
|
'side-modal-default-style': this.hasDefaultContentWrapperClass() || this.hasBanner(),
|
|
595
578
|
'with-footer': this.footerTemplate() !== null,
|
|
596
|
-
|
|
597
|
-
|
|
579
|
+
left: positionLeft,
|
|
580
|
+
right: positionRight,
|
|
598
581
|
'side-modal-animate-in': shouldAnimate ? isRenderedOpen : true,
|
|
599
|
-
'side-modal-animate-out': shouldAnimate ? !isRenderedOpen : false
|
|
582
|
+
'side-modal-animate-out': shouldAnimate ? !isRenderedOpen : false
|
|
600
583
|
};
|
|
601
584
|
}, ...(ngDevMode ? [{ debugName: "modalClasses" }] : []));
|
|
585
|
+
renderOpenClass = signal(false, ...(ngDevMode ? [{ debugName: "renderOpenClass" }] : []));
|
|
602
586
|
constructor() {
|
|
603
587
|
effect(() => {
|
|
604
588
|
const isOpen = this.isOpen();
|
|
@@ -613,18 +597,12 @@ class ModalSide {
|
|
|
613
597
|
}
|
|
614
598
|
});
|
|
615
599
|
}
|
|
616
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.
|
|
617
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.
|
|
600
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ModalSide, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
601
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.4", type: ModalSide, isStandalone: true, selector: "app-modal-side", inputs: { layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: true, transformFunction: null }, headerTemplate: { classPropertyName: "headerTemplate", publicName: "headerTemplate", isSignal: true, isRequired: true, transformFunction: null }, footerTemplate: { classPropertyName: "footerTemplate", publicName: "footerTemplate", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: true, isRequired: true, transformFunction: null }, isAnimated: { classPropertyName: "isAnimated", publicName: "isAnimated", isSignal: true, isRequired: true, transformFunction: null }, isBottomSheetModalActive: { classPropertyName: "isBottomSheetModalActive", publicName: "isBottomSheetModalActive", isSignal: true, isRequired: true, transformFunction: null }, animationDuration: { classPropertyName: "animationDuration", publicName: "animationDuration", isSignal: true, isRequired: true, transformFunction: null }, hasDefaultContentWrapperClass: { classPropertyName: "hasDefaultContentWrapperClass", publicName: "hasDefaultContentWrapperClass", isSignal: true, isRequired: true, transformFunction: null }, hasBanner: { classPropertyName: "hasBanner", publicName: "hasBanner", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { close: "close" }, viewQueries: [{ propertyName: "bottomSheet", predicate: ModalBottomSheet, descendants: true }], ngImport: i0, template: "@if(!isBottomSheetModalActive()) {\n<div [ngClass]=\"modalClasses()\" (click)=\"$event.stopPropagation()\" [id]=\"id() ?? ''\"\n [style.--anim-duration.ms]=\"animationDuration()\">\n <div class=\"side-modal-inner-content-container\"\n [class]=\"config() && config()?.style?.wrapperClasses ? config()?.style?.wrapperClasses : ''\"\n [style]=\"config() && config()?.style?.wrapperStyles ? config()?.style?.wrapperStyles : ''\">\n @if (hasBanner()) {\n <app-modal-banner [config]=\"config()\" (close)=\"close.emit('cancel')\"></app-modal-banner>\n }\n @if (headerTemplate()) {\n <div class=\"side-modal-header\">\n <ng-container *ngTemplateOutlet=\"headerTemplate()\"></ng-container>\n @if(!hasBanner()) {\n <app-modal-default-close-button [config]=\"config()\"\n (close)=\"close.emit('cancel')\"></app-modal-default-close-button>\n }\n </div>\n }\n <div class=\"side-modal-main-content-container\">\n <ng-container [ngTemplateOutlet]=\"contentTemplate\"> </ng-container>\n </div>\n </div>\n\n @if (footerTemplate()) {\n <div class=\"side-modal-footer\">\n <ng-container *ngTemplateOutlet=\"footerTemplate()\"></ng-container>\n </div>\n }\n</div>\n} @else {\n<app-modal-bottom-sheet [headerTemplate]=\"headerTemplate()\" [footerTemplate]=\"footerTemplate()\" [config]=\"config()\"\n [id]=\"id()\" [isOpen]=\"isOpen()\" [isAnimated]=\"isAnimated()\" [animationDuration]=\"animationDuration()\"\n (close)=\"close.emit('cancel')\">\n <ng-container [ngTemplateOutlet]=\"contentTemplate\"> </ng-container>\n</app-modal-bottom-sheet>\n}\n\n<ng-template #contentTemplate>\n <ng-content></ng-content>\n</ng-template>", styles: [".side-modal-content-wrapper{position:fixed;top:0;height:100vh;height:100dvh;z-index:3;display:flex;flex-direction:column;padding:1rem;gap:1rem;box-sizing:border-box;overflow:hidden;transition:transform var(--anim-duration, 175ms) ease-in-out}.side-modal-content-wrapper.left{left:0}.side-modal-content-wrapper.right{right:0}.side-modal-content-wrapper.side-modal-animate-in{transform:translate(0)!important}.side-modal-content-wrapper.side-modal-animate-out.left{transform:translate(-100%)}.side-modal-content-wrapper.side-modal-animate-out.right{transform:translate(100%)}.side-modal-content-wrapper.with-footer{justify-content:space-between}.side-modal-content-wrapper .side-modal-inner-content-container{flex-grow:1;display:flex;flex-direction:column;gap:1rem;min-height:0}@media(max-width:768px){.side-modal-content-wrapper{max-width:90vw;max-width:95dvw}}.side-modal-default-style{background:var(--modal-bg, #ffffff);color:var(--modal-text, #000000);box-shadow:0 0 15px #0000004d;max-width:85vw;max-width:85dvw}.side-modal-main-content-container{flex-grow:1;overflow-y:auto;min-height:0;max-height:none}.side-modal-header{flex-shrink:0;width:100%;display:flex;justify-content:space-between;gap:.5rem;padding-top:.75rem}.side-modal-footer{flex-shrink:0;width:100%;display:flex;justify-content:flex-end;gap:.5rem;padding-bottom:.75rem}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ModalBottomSheet, selector: "app-modal-bottom-sheet", inputs: ["id", "headerTemplate", "footerTemplate", "config", "isOpen", "isAnimated", "animationDuration"], outputs: ["close"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ModalBanner, selector: "app-modal-banner", inputs: ["config"], outputs: ["close"] }, { kind: "component", type: ModalDefaultCloseButton, selector: "app-modal-default-close-button", inputs: ["config"], outputs: ["close"] }] });
|
|
618
602
|
}
|
|
619
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.
|
|
603
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ModalSide, decorators: [{
|
|
620
604
|
type: Component,
|
|
621
|
-
args: [{ selector: 'modal-side', imports: [
|
|
622
|
-
NgTemplateOutlet,
|
|
623
|
-
ModalBottomSheet,
|
|
624
|
-
NgClass,
|
|
625
|
-
ModalBanner,
|
|
626
|
-
ModalDefaultCloseButton
|
|
627
|
-
], template: "@if(!isBottomSheetModalActive()) {\n<div [ngClass]=\"modalClasses()\" (click)=\"$event.stopPropagation()\" [id]=\"id() ?? ''\"\n [style.--anim-duration.ms]=\"animationDuration()\">\n <div class=\"side-modal-inner-content-container\"\n [class]=\"config() && config()?.style?.wrapperClasses ? config()?.style?.wrapperClasses : ''\"\n [style]=\"config() && config()?.style?.wrapperStyles ? config()?.style?.wrapperStyles : ''\">\n @if (hasBanner()) {\n <modal-banner [config]=\"config()\" (close)=\"close.emit('cancel')\"></modal-banner>\n }\n @if (headerTemplate()) {\n <div class=\"side-modal-header\">\n <ng-container *ngTemplateOutlet=\"headerTemplate()\"></ng-container>\n @if(!hasBanner()) {\n <modal-default-close-button [config]=\"config()\" (close)=\"close.emit('cancel')\"></modal-default-close-button>\n }\n </div>\n }\n <div class=\"side-modal-main-content-container\">\n <ng-container [ngTemplateOutlet]=\"contentTemplate\"> </ng-container>\n </div>\n </div>\n\n @if (footerTemplate()) {\n <div class=\"side-modal-footer\">\n <ng-container *ngTemplateOutlet=\"footerTemplate()\"></ng-container>\n </div>\n }\n</div>\n} @else {\n<modal-bottom-sheet [headerTemplate]=\"headerTemplate()\" [footerTemplate]=\"footerTemplate()\" [config]=\"config()\"\n [id]=\"id()\" [isOpen]=\"isOpen()\" [isAnimated]=\"isAnimated()\" [animationDuration]=\"animationDuration()\"\n (close)=\"close.emit('cancel')\">\n <ng-container [ngTemplateOutlet]=\"contentTemplate\"> </ng-container>\n</modal-bottom-sheet>\n}\n\n<ng-template #contentTemplate>\n <ng-content></ng-content>\n</ng-template>", styles: [".side-modal-content-wrapper{position:fixed;top:0;height:100vh;height:100dvh;z-index:3;display:flex;flex-direction:column;padding:1rem;gap:1rem;box-sizing:border-box;overflow:hidden;transition:transform var(--anim-duration, 175ms) ease-in-out}.side-modal-content-wrapper.left{left:0}.side-modal-content-wrapper.right{right:0}.side-modal-content-wrapper.side-modal-animate-in{transform:translate(0)!important}.side-modal-content-wrapper.side-modal-animate-out.left{transform:translate(-100%)}.side-modal-content-wrapper.side-modal-animate-out.right{transform:translate(100%)}.side-modal-content-wrapper.with-footer{justify-content:space-between}.side-modal-content-wrapper .side-modal-inner-content-container{flex-grow:1;display:flex;flex-direction:column;gap:1rem;min-height:0}@media(max-width:768px){.side-modal-content-wrapper{max-width:90vw;max-width:95dvw}}.side-modal-default-style{background:var(--modal-bg, #ffffff);color:var(--modal-text, #000000);box-shadow:0 0 15px #0000004d;max-width:85vw;max-width:85dvw}.side-modal-main-content-container{flex-grow:1;overflow-y:auto;min-height:0;max-height:none}.side-modal-header{flex-shrink:0;width:100%;display:flex;justify-content:space-between;gap:.5rem;padding-top:.75rem}.side-modal-footer{flex-shrink:0;width:100%;display:flex;justify-content:flex-end;gap:.5rem;padding-bottom:.75rem}\n"] }]
|
|
605
|
+
args: [{ selector: 'app-modal-side', imports: [NgTemplateOutlet, ModalBottomSheet, NgClass, ModalBanner, ModalDefaultCloseButton], template: "@if(!isBottomSheetModalActive()) {\n<div [ngClass]=\"modalClasses()\" (click)=\"$event.stopPropagation()\" [id]=\"id() ?? ''\"\n [style.--anim-duration.ms]=\"animationDuration()\">\n <div class=\"side-modal-inner-content-container\"\n [class]=\"config() && config()?.style?.wrapperClasses ? config()?.style?.wrapperClasses : ''\"\n [style]=\"config() && config()?.style?.wrapperStyles ? config()?.style?.wrapperStyles : ''\">\n @if (hasBanner()) {\n <app-modal-banner [config]=\"config()\" (close)=\"close.emit('cancel')\"></app-modal-banner>\n }\n @if (headerTemplate()) {\n <div class=\"side-modal-header\">\n <ng-container *ngTemplateOutlet=\"headerTemplate()\"></ng-container>\n @if(!hasBanner()) {\n <app-modal-default-close-button [config]=\"config()\"\n (close)=\"close.emit('cancel')\"></app-modal-default-close-button>\n }\n </div>\n }\n <div class=\"side-modal-main-content-container\">\n <ng-container [ngTemplateOutlet]=\"contentTemplate\"> </ng-container>\n </div>\n </div>\n\n @if (footerTemplate()) {\n <div class=\"side-modal-footer\">\n <ng-container *ngTemplateOutlet=\"footerTemplate()\"></ng-container>\n </div>\n }\n</div>\n} @else {\n<app-modal-bottom-sheet [headerTemplate]=\"headerTemplate()\" [footerTemplate]=\"footerTemplate()\" [config]=\"config()\"\n [id]=\"id()\" [isOpen]=\"isOpen()\" [isAnimated]=\"isAnimated()\" [animationDuration]=\"animationDuration()\"\n (close)=\"close.emit('cancel')\">\n <ng-container [ngTemplateOutlet]=\"contentTemplate\"> </ng-container>\n</app-modal-bottom-sheet>\n}\n\n<ng-template #contentTemplate>\n <ng-content></ng-content>\n</ng-template>", styles: [".side-modal-content-wrapper{position:fixed;top:0;height:100vh;height:100dvh;z-index:3;display:flex;flex-direction:column;padding:1rem;gap:1rem;box-sizing:border-box;overflow:hidden;transition:transform var(--anim-duration, 175ms) ease-in-out}.side-modal-content-wrapper.left{left:0}.side-modal-content-wrapper.right{right:0}.side-modal-content-wrapper.side-modal-animate-in{transform:translate(0)!important}.side-modal-content-wrapper.side-modal-animate-out.left{transform:translate(-100%)}.side-modal-content-wrapper.side-modal-animate-out.right{transform:translate(100%)}.side-modal-content-wrapper.with-footer{justify-content:space-between}.side-modal-content-wrapper .side-modal-inner-content-container{flex-grow:1;display:flex;flex-direction:column;gap:1rem;min-height:0}@media(max-width:768px){.side-modal-content-wrapper{max-width:90vw;max-width:95dvw}}.side-modal-default-style{background:var(--modal-bg, #ffffff);color:var(--modal-text, #000000);box-shadow:0 0 15px #0000004d;max-width:85vw;max-width:85dvw}.side-modal-main-content-container{flex-grow:1;overflow-y:auto;min-height:0;max-height:none}.side-modal-header{flex-shrink:0;width:100%;display:flex;justify-content:space-between;gap:.5rem;padding-top:.75rem}.side-modal-footer{flex-shrink:0;width:100%;display:flex;justify-content:flex-end;gap:.5rem;padding-bottom:.75rem}\n"] }]
|
|
628
606
|
}], ctorParameters: () => [], propDecorators: { layout: [{ type: i0.Input, args: [{ isSignal: true, alias: "layout", required: true }] }], headerTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerTemplate", required: true }] }], footerTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "footerTemplate", required: true }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], isOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOpen", required: true }] }], isAnimated: [{ type: i0.Input, args: [{ isSignal: true, alias: "isAnimated", required: true }] }], isBottomSheetModalActive: [{ type: i0.Input, args: [{ isSignal: true, alias: "isBottomSheetModalActive", required: true }] }], animationDuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "animationDuration", required: true }] }], hasDefaultContentWrapperClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasDefaultContentWrapperClass", required: true }] }], hasBanner: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasBanner", required: true }] }], close: [{ type: i0.Output, args: ["close"] }], bottomSheet: [{
|
|
629
607
|
type: ViewChildren,
|
|
630
608
|
args: [ModalBottomSheet]
|
|
@@ -636,11 +614,6 @@ const MODAL_DEFAULT_ANIM_DURATION_MULTIPLIER_SMALL = 0.65;
|
|
|
636
614
|
const MODAL_DEFAULT_ANIM_DURATION_MULTIPLIER_LARGE = 0.85;
|
|
637
615
|
|
|
638
616
|
class ModalCore {
|
|
639
|
-
modalService = inject(ModalService);
|
|
640
|
-
windowDimensionsService = inject(WindowDimensionsService);
|
|
641
|
-
scrollLockService = inject(ScrollLockService);
|
|
642
|
-
afterClose = output();
|
|
643
|
-
animationDuration = MODAL_DEFAULT_ANIM_DURATION;
|
|
644
617
|
componentRef = {};
|
|
645
618
|
config;
|
|
646
619
|
closeFunction;
|
|
@@ -650,28 +623,26 @@ class ModalCore {
|
|
|
650
623
|
effectiveLayout = signal('center', ...(ngDevMode ? [{ debugName: "effectiveLayout" }] : []));
|
|
651
624
|
isCentered = signal(false, ...(ngDevMode ? [{ debugName: "isCentered" }] : []));
|
|
652
625
|
isSide = signal(false, ...(ngDevMode ? [{ debugName: "isSide" }] : []));
|
|
626
|
+
isAnimated = false;
|
|
627
|
+
animationDuration = MODAL_DEFAULT_ANIM_DURATION;
|
|
653
628
|
headerTemplate = signal(null, ...(ngDevMode ? [{ debugName: "headerTemplate" }] : []));
|
|
654
629
|
footerTemplate = signal(null, ...(ngDevMode ? [{ debugName: "footerTemplate" }] : []));
|
|
655
630
|
id = signal(null, ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
656
631
|
isBottomSheetModalActive = signal(false, ...(ngDevMode ? [{ debugName: "isBottomSheetModalActive" }] : []));
|
|
657
|
-
isAnimated = false;
|
|
658
632
|
hasBanner = false;
|
|
659
633
|
hasDefaultContentWrapperClass = false;
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
634
|
+
modalService = inject(ModalService);
|
|
635
|
+
scrollLockService = inject(ScrollLockService);
|
|
636
|
+
windowDimensionsService = inject(WindowDimensionsService);
|
|
663
637
|
windowDimensions = this.windowDimensionsService.dimensions;
|
|
664
|
-
_currentVcr = null;
|
|
665
|
-
set dynamicContainer(vcr) {
|
|
666
|
-
if (vcr && this.componentRef) {
|
|
667
|
-
this._currentVcr = vcr;
|
|
668
|
-
vcr.insert(this.componentRef.hostView);
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
638
|
modalContainer;
|
|
672
639
|
contentTemplate;
|
|
673
640
|
sideModalComponents;
|
|
674
641
|
centeredModalComponents;
|
|
642
|
+
isConfirmCloseModalOpen = false;
|
|
643
|
+
scrollLockId = uuidv4();
|
|
644
|
+
_sortedBreakpoints = [];
|
|
645
|
+
_currentVcr = null;
|
|
675
646
|
constructor() {
|
|
676
647
|
this.initKeyboardSubscription();
|
|
677
648
|
effect(() => {
|
|
@@ -685,7 +656,7 @@ class ModalCore {
|
|
|
685
656
|
this.scrollLockService.disableScroll(this.scrollLockId, {
|
|
686
657
|
animationDuration: this.animationDuration,
|
|
687
658
|
handleTouchInput: true,
|
|
688
|
-
mobileOnlyTouchPrevention: true
|
|
659
|
+
mobileOnlyTouchPrevention: true
|
|
689
660
|
});
|
|
690
661
|
}
|
|
691
662
|
ngAfterViewInit() {
|
|
@@ -700,63 +671,27 @@ class ModalCore {
|
|
|
700
671
|
this.dynamicContainer?.clear();
|
|
701
672
|
this.scrollLockService.enableScroll(this.scrollLockId);
|
|
702
673
|
}
|
|
703
|
-
//#region Subscription Methods
|
|
704
|
-
initKeyboardSubscription() {
|
|
705
|
-
fromEvent(document, "keydown")
|
|
706
|
-
.pipe(filter((event) => event.key === "Escape"), takeUntilDestroyed())
|
|
707
|
-
.subscribe(() => {
|
|
708
|
-
if (!this.isConfirmCloseModalOpen) {
|
|
709
|
-
this.close("cancel", undefined, true);
|
|
710
|
-
}
|
|
711
|
-
});
|
|
712
|
-
}
|
|
713
|
-
//#endregion
|
|
714
|
-
//#region Initialization Methods
|
|
715
|
-
initParamsFromConfig() {
|
|
716
|
-
this.id.set(this.config?.id ?? this.scrollLockId);
|
|
717
|
-
this.hasBanner =
|
|
718
|
-
this.config !== undefined &&
|
|
719
|
-
((this.config.bannerText !== undefined && this.config.bannerText.length > 0) ||
|
|
720
|
-
(this.config.disableClose !== true && this.config.style.showCloseButton !== false && this.headerTemplate() === null));
|
|
721
|
-
this.hasDefaultContentWrapperClass = this.config?.style.contentWrapper !== false;
|
|
722
|
-
this.isAnimated = this.config?.style.animate === true;
|
|
723
|
-
}
|
|
724
|
-
initBreakpointCache() {
|
|
725
|
-
const definedBreakpoints = this.config?.style?.breakpoints;
|
|
726
|
-
if (definedBreakpoints && Object.keys(definedBreakpoints).length > 0) {
|
|
727
|
-
const serviceBreakpoints = this.windowDimensionsService.breakpoints;
|
|
728
|
-
this._sortedBreakpoints = Object.keys(definedBreakpoints)
|
|
729
|
-
.map(key => ({
|
|
730
|
-
width: serviceBreakpoints[key],
|
|
731
|
-
layout: definedBreakpoints[key]
|
|
732
|
-
}))
|
|
733
|
-
.sort((a, b) => a.width - b.width);
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
//#endregion
|
|
737
674
|
//#region Public Template Methods
|
|
738
675
|
setHeaderTemplate(template) {
|
|
739
676
|
this.headerTemplate.set(template);
|
|
740
677
|
}
|
|
678
|
+
//#endregion
|
|
741
679
|
setFooterTemplate(template) {
|
|
742
680
|
this.footerTemplate.set(template);
|
|
743
681
|
}
|
|
744
|
-
//#endregion
|
|
745
682
|
//#region Closing Methods
|
|
746
|
-
close(state =
|
|
683
|
+
close(state = 'cancel', result = undefined, fromInsideInteraction = false, forceClose = false) {
|
|
747
684
|
if (forceClose) {
|
|
748
685
|
this.handleClose(state, result);
|
|
749
686
|
return;
|
|
750
687
|
}
|
|
751
|
-
if (
|
|
688
|
+
if (this.config?.disableClose === true && fromInsideInteraction) {
|
|
752
689
|
return;
|
|
753
690
|
}
|
|
754
|
-
const shouldCheckCloseGuard = this.config?.closeGuardOnlyOnCancel !== true || state !==
|
|
691
|
+
const shouldCheckCloseGuard = this.config?.closeGuardOnlyOnCancel !== true || state !== 'confirm';
|
|
755
692
|
if (shouldCheckCloseGuard && this.config?.closeGuard) {
|
|
756
693
|
const guardResult = this.config.closeGuard.canClose(this.modalService);
|
|
757
|
-
const canClose$ = guardResult instanceof Observable ? guardResult :
|
|
758
|
-
guardResult instanceof Promise ? from(guardResult) :
|
|
759
|
-
of(guardResult);
|
|
694
|
+
const canClose$ = guardResult instanceof Observable ? guardResult : guardResult instanceof Promise ? from(guardResult) : of(guardResult);
|
|
760
695
|
if (this.isBottomSheetModalActive()) {
|
|
761
696
|
this.resetBottomSheetModalLayout();
|
|
762
697
|
}
|
|
@@ -769,17 +704,7 @@ class ModalCore {
|
|
|
769
704
|
}
|
|
770
705
|
this.handleClose(state, result);
|
|
771
706
|
}
|
|
772
|
-
|
|
773
|
-
this.isOpen.set(false);
|
|
774
|
-
this.setBottomSheetModalFinishedState(true);
|
|
775
|
-
const returnResult = {
|
|
776
|
-
data: result,
|
|
777
|
-
state: state,
|
|
778
|
-
};
|
|
779
|
-
if (this.closeFunction) {
|
|
780
|
-
this.closeFunction(returnResult);
|
|
781
|
-
}
|
|
782
|
-
}
|
|
707
|
+
//#endregion
|
|
783
708
|
onBackdropClick(event) {
|
|
784
709
|
event.preventDefault();
|
|
785
710
|
event.stopPropagation();
|
|
@@ -788,7 +713,59 @@ class ModalCore {
|
|
|
788
713
|
}
|
|
789
714
|
this.backdropClickSubject.next(event);
|
|
790
715
|
if (this.config?.style?.hasBackdrop && this.config?.disableCloseOnBackdropClick !== true) {
|
|
791
|
-
this.close(
|
|
716
|
+
this.close('cancel', undefined, true);
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
set dynamicContainer(vcr) {
|
|
720
|
+
if (vcr && this.componentRef) {
|
|
721
|
+
this._currentVcr = vcr;
|
|
722
|
+
vcr.insert(this.componentRef.hostView);
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
//#region Subscription Methods
|
|
726
|
+
initKeyboardSubscription() {
|
|
727
|
+
fromEvent(document, 'keydown')
|
|
728
|
+
.pipe(filter((event) => event.key === 'Escape'), takeUntilDestroyed())
|
|
729
|
+
.subscribe(() => {
|
|
730
|
+
if (!this.isConfirmCloseModalOpen) {
|
|
731
|
+
this.close('cancel', undefined, true);
|
|
732
|
+
}
|
|
733
|
+
});
|
|
734
|
+
}
|
|
735
|
+
//#endregion
|
|
736
|
+
//#region Initialization Methods
|
|
737
|
+
initParamsFromConfig() {
|
|
738
|
+
this.id.set(this.config?.id ?? this.scrollLockId);
|
|
739
|
+
this.hasBanner =
|
|
740
|
+
this.config !== undefined &&
|
|
741
|
+
((this.config.bannerText !== undefined && this.config.bannerText.length > 0) ||
|
|
742
|
+
(this.config.disableClose !== true && this.config.style.showCloseButton !== false && this.headerTemplate() === null));
|
|
743
|
+
this.hasDefaultContentWrapperClass = this.config?.style.contentWrapper !== false;
|
|
744
|
+
this.isAnimated = this.config?.style.animate === true;
|
|
745
|
+
}
|
|
746
|
+
initBreakpointCache() {
|
|
747
|
+
// eslint-disable-next-line no-debugger
|
|
748
|
+
debugger;
|
|
749
|
+
const definedBreakpoints = this.config?.style?.breakpoints;
|
|
750
|
+
if (definedBreakpoints && Object.keys(definedBreakpoints).length > 0) {
|
|
751
|
+
const serviceBreakpoints = this.windowDimensionsService.breakpoints;
|
|
752
|
+
this._sortedBreakpoints = Object.keys(definedBreakpoints)
|
|
753
|
+
.map((key) => ({
|
|
754
|
+
width: serviceBreakpoints[key],
|
|
755
|
+
layout: definedBreakpoints[key] ?? this.config?.style.layout ?? 'center'
|
|
756
|
+
}))
|
|
757
|
+
.sort((a, b) => a.width - b.width);
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
async handleClose(state, result) {
|
|
761
|
+
this.isOpen.set(false);
|
|
762
|
+
this.setBottomSheetModalFinishedState(true);
|
|
763
|
+
const returnResult = {
|
|
764
|
+
data: result,
|
|
765
|
+
state: state
|
|
766
|
+
};
|
|
767
|
+
if (this.closeFunction) {
|
|
768
|
+
this.closeFunction(returnResult);
|
|
792
769
|
}
|
|
793
770
|
}
|
|
794
771
|
//#endregion
|
|
@@ -825,8 +802,7 @@ class ModalCore {
|
|
|
825
802
|
}
|
|
826
803
|
}
|
|
827
804
|
getBottomSheetModal() {
|
|
828
|
-
return this.sideModalComponents?.first?.bottomSheet?.first
|
|
829
|
-
?? this.centeredModalComponents?.first?.bottomSheet?.first;
|
|
805
|
+
return this.sideModalComponents?.first?.bottomSheet?.first ?? this.centeredModalComponents?.first?.bottomSheet?.first;
|
|
830
806
|
}
|
|
831
807
|
resetBottomSheetModalLayout() {
|
|
832
808
|
const bottomSheet = this.getBottomSheetModal();
|
|
@@ -841,32 +817,27 @@ class ModalCore {
|
|
|
841
817
|
}
|
|
842
818
|
this.isBottomSheetModalActive.set(false);
|
|
843
819
|
}
|
|
844
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.
|
|
845
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.
|
|
820
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ModalCore, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
821
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.4", type: ModalCore, isStandalone: true, selector: "app-modal", viewQueries: [{ propertyName: "modalContainer", first: true, predicate: ["modalContainer"], descendants: true }, { propertyName: "contentTemplate", first: true, predicate: ["contentTemplate"], descendants: true }, { propertyName: "dynamicContainer", first: true, predicate: ["dynamicContainer"], descendants: true, read: ViewContainerRef }, { propertyName: "sideModalComponents", predicate: ModalSide, descendants: true }, { propertyName: "centeredModalComponents", predicate: ModalCentered, descendants: true }], ngImport: i0, template: "@if (config?.style?.hasBackdrop && (isSide() || isBottomSheetModalActive())) {\n<app-modal-backdrop [isAnimated]=\"isAnimated\" [isOpen]=\"isOpen()\" (click)=\"onBackdropClick($event)\">\n</app-modal-backdrop>\n}\n\n<ng-container #modalContainer>\n @switch (true) {\n @case (isSide()) {\n <app-modal-side [layout]=\"effectiveLayout()\" [headerTemplate]=\"headerTemplate()\" [footerTemplate]=\"footerTemplate()\"\n [config]=\"config\" [id]=\"id()\" [isOpen]=\"isOpen()\" [isAnimated]=\"isAnimated\"\n [isBottomSheetModalActive]=\"isBottomSheetModalActive()\" [animationDuration]=\"animationDuration\"\n [hasDefaultContentWrapperClass]=\"hasDefaultContentWrapperClass\" [hasBanner]=\"hasBanner\" (close)=\"close($event)\">\n <ng-container [ngTemplateOutlet]=\"contentTemplate\"></ng-container>\n </app-modal-side>\n }\n @case (isCentered()) {\n <app-modal-centered [headerTemplate]=\"headerTemplate()\" [footerTemplate]=\"footerTemplate()\" [config]=\"config\"\n [id]=\"id()\" [isOpen]=\"isOpen()\" [isAnimated]=\"isAnimated\"\n [isBottomSheetModalActive]=\"isBottomSheetModalActive()\" [animationDuration]=\"animationDuration\"\n [hasDefaultContentWrapperClass]=\"hasDefaultContentWrapperClass\" [hasBanner]=\"hasBanner\" (close)=\"close($event)\"\n (onBackdropClick)=\"onBackdropClick($event)\">\n <ng-container [ngTemplateOutlet]=\"contentTemplate\"></ng-container>\n </app-modal-centered>\n }\n }\n</ng-container>\n\n<ng-template #contentTemplate>\n <ng-container #dynamicContainer></ng-container>\n</ng-template>", styles: [""], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ModalCentered, selector: "app-modal-centered", inputs: ["headerTemplate", "footerTemplate", "config", "id", "isOpen", "isAnimated", "isBottomSheetModalActive", "animationDuration", "hasDefaultContentWrapperClass", "hasBanner"], outputs: ["close", "onBackdropClick"] }, { kind: "component", type: ModalSide, selector: "app-modal-side", inputs: ["layout", "headerTemplate", "footerTemplate", "config", "id", "isOpen", "isAnimated", "isBottomSheetModalActive", "animationDuration", "hasDefaultContentWrapperClass", "hasBanner"], outputs: ["close"] }, { kind: "component", type: ModalBackdrop, selector: "app-modal-backdrop", inputs: ["isAnimated", "isOpen"], outputs: ["click"] }] });
|
|
846
822
|
}
|
|
847
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.
|
|
823
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ModalCore, decorators: [{
|
|
848
824
|
type: Component,
|
|
849
|
-
args: [{ selector: 'modal', imports: [
|
|
850
|
-
|
|
851
|
-
ModalCentered,
|
|
852
|
-
ModalSide,
|
|
853
|
-
ModalBackdrop
|
|
854
|
-
], template: "@if (config?.style?.hasBackdrop && (isSide() || isBottomSheetModalActive())) {\n<modal-backdrop [isAnimated]=\"isAnimated\" [isOpen]=\"isOpen()\" (click)=\"onBackdropClick($event)\">\n</modal-backdrop>\n}\n\n<ng-container #modalContainer>\n @switch (true) {\n @case (isSide()) {\n <modal-side \n [layout]=\"effectiveLayout()\"\n [headerTemplate]=\"headerTemplate()\" \n [footerTemplate]=\"footerTemplate()\" \n [config]=\"config\" \n [id]=\"id()\"\n [isOpen]=\"isOpen()\" \n [isAnimated]=\"isAnimated\"\n [isBottomSheetModalActive]=\"isBottomSheetModalActive()\" \n [animationDuration]=\"animationDuration\"\n [hasDefaultContentWrapperClass]=\"hasDefaultContentWrapperClass\" \n [hasBanner]=\"hasBanner\" \n (close)=\"close($event)\">\n <ng-container [ngTemplateOutlet]=\"contentTemplate\"></ng-container>\n </modal-side>\n } \n @case (isCentered()) {\n <modal-centered \n [headerTemplate]=\"headerTemplate()\" \n [footerTemplate]=\"footerTemplate()\" \n [config]=\"config\" \n [id]=\"id()\"\n [isOpen]=\"isOpen()\" \n [isAnimated]=\"isAnimated\"\n [isBottomSheetModalActive]=\"isBottomSheetModalActive()\" \n [animationDuration]=\"animationDuration\"\n [hasDefaultContentWrapperClass]=\"hasDefaultContentWrapperClass\" \n [hasBanner]=\"hasBanner\" \n (close)=\"close($event)\"\n (onBackdropClick)=\"onBackdropClick($event)\">\n <ng-container [ngTemplateOutlet]=\"contentTemplate\"></ng-container>\n </modal-centered>\n }\n }\n</ng-container>\n\n<ng-template #contentTemplate>\n <ng-container #dynamicContainer></ng-container>\n</ng-template>" }]
|
|
855
|
-
}], ctorParameters: () => [], propDecorators: { afterClose: [{ type: i0.Output, args: ["afterClose"] }], dynamicContainer: [{
|
|
856
|
-
type: ViewChild,
|
|
857
|
-
args: ["dynamicContainer", { read: ViewContainerRef }]
|
|
858
|
-
}], modalContainer: [{
|
|
825
|
+
args: [{ selector: 'app-modal', imports: [NgTemplateOutlet, ModalCentered, ModalSide, ModalBackdrop], template: "@if (config?.style?.hasBackdrop && (isSide() || isBottomSheetModalActive())) {\n<app-modal-backdrop [isAnimated]=\"isAnimated\" [isOpen]=\"isOpen()\" (click)=\"onBackdropClick($event)\">\n</app-modal-backdrop>\n}\n\n<ng-container #modalContainer>\n @switch (true) {\n @case (isSide()) {\n <app-modal-side [layout]=\"effectiveLayout()\" [headerTemplate]=\"headerTemplate()\" [footerTemplate]=\"footerTemplate()\"\n [config]=\"config\" [id]=\"id()\" [isOpen]=\"isOpen()\" [isAnimated]=\"isAnimated\"\n [isBottomSheetModalActive]=\"isBottomSheetModalActive()\" [animationDuration]=\"animationDuration\"\n [hasDefaultContentWrapperClass]=\"hasDefaultContentWrapperClass\" [hasBanner]=\"hasBanner\" (close)=\"close($event)\">\n <ng-container [ngTemplateOutlet]=\"contentTemplate\"></ng-container>\n </app-modal-side>\n }\n @case (isCentered()) {\n <app-modal-centered [headerTemplate]=\"headerTemplate()\" [footerTemplate]=\"footerTemplate()\" [config]=\"config\"\n [id]=\"id()\" [isOpen]=\"isOpen()\" [isAnimated]=\"isAnimated\"\n [isBottomSheetModalActive]=\"isBottomSheetModalActive()\" [animationDuration]=\"animationDuration\"\n [hasDefaultContentWrapperClass]=\"hasDefaultContentWrapperClass\" [hasBanner]=\"hasBanner\" (close)=\"close($event)\"\n (onBackdropClick)=\"onBackdropClick($event)\">\n <ng-container [ngTemplateOutlet]=\"contentTemplate\"></ng-container>\n </app-modal-centered>\n }\n }\n</ng-container>\n\n<ng-template #contentTemplate>\n <ng-container #dynamicContainer></ng-container>\n</ng-template>" }]
|
|
826
|
+
}], ctorParameters: () => [], propDecorators: { modalContainer: [{
|
|
859
827
|
type: ViewChild,
|
|
860
|
-
args: [
|
|
828
|
+
args: ['modalContainer', { static: false }]
|
|
861
829
|
}], contentTemplate: [{
|
|
862
830
|
type: ViewChild,
|
|
863
|
-
args: [
|
|
831
|
+
args: ['contentTemplate']
|
|
864
832
|
}], sideModalComponents: [{
|
|
865
833
|
type: ViewChildren,
|
|
866
834
|
args: [ModalSide]
|
|
867
835
|
}], centeredModalComponents: [{
|
|
868
836
|
type: ViewChildren,
|
|
869
837
|
args: [ModalCentered]
|
|
838
|
+
}], dynamicContainer: [{
|
|
839
|
+
type: ViewChild,
|
|
840
|
+
args: ['dynamicContainer', { read: ViewContainerRef }]
|
|
870
841
|
}] } });
|
|
871
842
|
|
|
872
843
|
class Modal {
|
|
@@ -880,19 +851,19 @@ class Modal {
|
|
|
880
851
|
modal;
|
|
881
852
|
/**
|
|
882
853
|
* Called when the modal is initialized.
|
|
883
|
-
|
|
854
|
+
*/
|
|
884
855
|
onModalInit() { }
|
|
885
856
|
/**
|
|
886
857
|
* Closes the modal (with "cancel" reason) with an optional result.
|
|
887
858
|
* @param result The result to be passed when closing the modal.
|
|
888
|
-
|
|
859
|
+
*/
|
|
889
860
|
close(result) {
|
|
890
861
|
this.modal?.close('cancel', result);
|
|
891
862
|
}
|
|
892
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.
|
|
893
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.
|
|
863
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: Modal, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
864
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: Modal });
|
|
894
865
|
}
|
|
895
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.
|
|
866
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: Modal, decorators: [{
|
|
896
867
|
type: Injectable
|
|
897
868
|
}] });
|
|
898
869
|
|
|
@@ -915,13 +886,13 @@ class ModalHeaderDirective {
|
|
|
915
886
|
console.warn(ModalWarnings.HEADER_DIRECTIVE_OUTSIDE_MODAL);
|
|
916
887
|
}
|
|
917
888
|
}
|
|
918
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.
|
|
919
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.
|
|
889
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ModalHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
890
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.4", type: ModalHeaderDirective, isStandalone: true, selector: "[appModalHeader]", ngImport: i0 });
|
|
920
891
|
}
|
|
921
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.
|
|
892
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ModalHeaderDirective, decorators: [{
|
|
922
893
|
type: Directive,
|
|
923
894
|
args: [{
|
|
924
|
-
selector: '[
|
|
895
|
+
selector: '[appModalHeader]',
|
|
925
896
|
standalone: true
|
|
926
897
|
}]
|
|
927
898
|
}], ctorParameters: () => [] });
|
|
@@ -937,13 +908,13 @@ class ModalFooterDirective {
|
|
|
937
908
|
console.warn(ModalWarnings.FOOTER_DIRECTIVE_OUTSIDE_MODAL);
|
|
938
909
|
}
|
|
939
910
|
}
|
|
940
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.
|
|
941
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.
|
|
911
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ModalFooterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
912
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.4", type: ModalFooterDirective, isStandalone: true, selector: "[appModalFooter]", ngImport: i0 });
|
|
942
913
|
}
|
|
943
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.
|
|
914
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ModalFooterDirective, decorators: [{
|
|
944
915
|
type: Directive,
|
|
945
916
|
args: [{
|
|
946
|
-
selector: '[
|
|
917
|
+
selector: '[appModalFooter]',
|
|
947
918
|
standalone: true
|
|
948
919
|
}]
|
|
949
920
|
}], ctorParameters: () => [] });
|
|
@@ -969,7 +940,7 @@ class ModalConfirmCloseGuard extends ModalCloseGuard {
|
|
|
969
940
|
}
|
|
970
941
|
canClose(modalService) {
|
|
971
942
|
const ref = modalService.open(this.component, this.config);
|
|
972
|
-
return ref.afterClosed().pipe(map(result => result.state === 'confirm'));
|
|
943
|
+
return ref.afterClosed().pipe(map((result) => result.state === 'confirm'));
|
|
973
944
|
}
|
|
974
945
|
}
|
|
975
946
|
|