@osumi/angular-tools 1.2.3 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -17,18 +17,20 @@ NOTA: Los diálogos incluyen una serie de estilos por defecto. Para poder usarlo
|
|
|
17
17
|
"styles": [
|
|
18
18
|
"@angular/material/prebuilt-themes/azure-blue.css",
|
|
19
19
|
"src/styles.scss",
|
|
20
|
-
"@osumi/angular-tools/
|
|
20
|
+
"@osumi/angular-tools/styles/dialogs.scss"
|
|
21
21
|
],
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
Estos estilos por defecto luego se pueden sobrescribir usando variables CSS:
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Estos estilos por defecto luego se pueden sobrescribir usando variables CSS:
|
|
25
25
|
|
|
26
26
|
```css
|
|
27
27
|
:root {
|
|
28
28
|
--oat-dialogs-color-warn: #ba1a1a;
|
|
29
29
|
--oat-dialogs-color-white: #fff;
|
|
30
|
-
}
|
|
31
|
-
```
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Los dos últimos parámetros opcionales de `open` permiten indicar desde qué elemento se abre el modal (`from`) y la duración de la animación en milisegundos (`animationDuration`).
|
|
32
34
|
|
|
33
35
|
**alert**
|
|
34
36
|
|
|
@@ -36,14 +38,22 @@ Muestra un diálogo con un título (`title`) y un texto (`content`) personalizad
|
|
|
36
38
|
|
|
37
39
|
```typescript
|
|
38
40
|
dialog: DialogService = inject(DialogService);
|
|
41
|
+
button: Signal<ElementRef> = viewChild.required('button');
|
|
39
42
|
|
|
40
43
|
this.dialog.alert({
|
|
41
|
-
title:
|
|
42
|
-
content:
|
|
43
|
-
|
|
44
|
+
title: 'Datos guardados',
|
|
45
|
+
content:
|
|
46
|
+
'Los datos del cliente "' +
|
|
47
|
+
this.selectedClient.nombreApellidos +
|
|
48
|
+
'" han sido correctamente guardados.',
|
|
49
|
+
ok: 'Continuar',
|
|
50
|
+
from: this.button().nativeElement,
|
|
51
|
+
animationDuration: 350,
|
|
44
52
|
});
|
|
45
53
|
```
|
|
46
54
|
|
|
55
|
+
El campo opcional `from` permite indicar desde qué elemento se abre el diálogo. Si se informa, el diálogo se anima desde ese elemento al abrirse y vuelve al mismo punto al cerrarse. También se puede usar `animationDuration` para indicar la duración de la animación en milisegundos.
|
|
56
|
+
|
|
47
57
|
**confirm**
|
|
48
58
|
|
|
49
59
|
Muestra un diálogo con un título (`title`) y texto (`content`) personalizables. Permite personalizar el texto de los botones "Continuar" (`ok`) y "Cancelar" (`cancel`).
|
|
@@ -53,10 +63,11 @@ dialog: DialogService = inject(DialogService);
|
|
|
53
63
|
|
|
54
64
|
this.dialog
|
|
55
65
|
.confirm({
|
|
56
|
-
title:
|
|
57
|
-
content:
|
|
58
|
-
|
|
59
|
-
|
|
66
|
+
title: 'Confirmar',
|
|
67
|
+
content:
|
|
68
|
+
'¿Estás seguro de querer borrar el cliente "' + this.selectedClient.nombreApellidos + '"?',
|
|
69
|
+
ok: 'Continuar',
|
|
70
|
+
cancel: 'Cancelar',
|
|
60
71
|
})
|
|
61
72
|
.subscribe((result) => {
|
|
62
73
|
if (result === true) {
|
|
@@ -74,11 +85,11 @@ dialog: DialogService = inject(DialogService);
|
|
|
74
85
|
|
|
75
86
|
this.dialog
|
|
76
87
|
.form({
|
|
77
|
-
title:
|
|
78
|
-
content:
|
|
79
|
-
ok:
|
|
80
|
-
cancel:
|
|
81
|
-
fields: [{ title:
|
|
88
|
+
title: 'Introducir email',
|
|
89
|
+
content: 'Introduce el email del cliente',
|
|
90
|
+
ok: 'Continuar',
|
|
91
|
+
cancel: 'Cancelar',
|
|
92
|
+
fields: [{ title: 'Email', type: 'email', value: null }],
|
|
82
93
|
})
|
|
83
94
|
.subscribe((result: DialogOptions): void => {
|
|
84
95
|
if (result !== undefined) {
|
|
@@ -97,20 +108,28 @@ export interface BuscadorModal extends Modal {
|
|
|
97
108
|
key: string;
|
|
98
109
|
}
|
|
99
110
|
|
|
100
|
-
os: OverlayService = inject(OverlayService);
|
|
111
|
+
os: OverlayService = inject(OverlayService);
|
|
112
|
+
button: Signal<ElementRef> = viewChild.required('button');
|
|
101
113
|
|
|
102
114
|
const modalBuscadorData: BuscadorModal = {
|
|
103
|
-
modalTitle:
|
|
104
|
-
modalColor:
|
|
105
|
-
css:
|
|
115
|
+
modalTitle: 'Buscador',
|
|
116
|
+
modalColor: 'blue',
|
|
117
|
+
css: 'modal-wide',
|
|
106
118
|
key: ev.key,
|
|
107
119
|
};
|
|
108
|
-
const dialog = this.os.open(
|
|
120
|
+
const dialog = this.os.open(
|
|
121
|
+
BuscadorModalComponent,
|
|
122
|
+
modalBuscadorData,
|
|
123
|
+
[],
|
|
124
|
+
true,
|
|
125
|
+
this.button().nativeElement,
|
|
126
|
+
350
|
|
127
|
+
); // BuscadorModalComponent sería el componente a mostrar en el modal
|
|
109
128
|
dialog.afterClosed$.subscribe((data): void => {
|
|
110
129
|
if (data.data !== null) {
|
|
111
130
|
console.log(data.data); // Resultado obtenido del modal
|
|
112
131
|
} else {
|
|
113
|
-
console.log(
|
|
132
|
+
console.log('El modal se ha cerrado sin devolver datos.');
|
|
114
133
|
}
|
|
115
134
|
});
|
|
116
135
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, signal, Component, ViewEncapsulation, Renderer2, ElementRef, output, Directive, Injectable, Injector } from '@angular/core';
|
|
2
|
+
import { inject, signal, Component, ViewEncapsulation, Renderer2, viewChild, ElementRef, output, Directive, PLATFORM_ID, Injectable, Injector } from '@angular/core';
|
|
3
3
|
import { MatButton, MatIconButton } from '@angular/material/button';
|
|
4
|
-
import { MatDialogRef, MatDialogTitle, MatDialogContent, MatDialogActions,
|
|
5
|
-
import { NgClass, NgComponentOutlet } from '@angular/common';
|
|
4
|
+
import { MatDialogRef, MatDialogTitle, MatDialogContent, MatDialogActions, MatDialog } from '@angular/material/dialog';
|
|
5
|
+
import { NgClass, NgComponentOutlet, DOCUMENT, isPlatformBrowser } from '@angular/common';
|
|
6
6
|
import * as i1 from '@angular/forms';
|
|
7
7
|
import { FormsModule } from '@angular/forms';
|
|
8
8
|
import { MatFormField, MatLabel, MatHint } from '@angular/material/form-field';
|
|
@@ -21,15 +21,21 @@ import { ComponentPortal } from '@angular/cdk/portal';
|
|
|
21
21
|
*/
|
|
22
22
|
class AlertDialogComponent {
|
|
23
23
|
dialogRef = inject(MatDialogRef);
|
|
24
|
-
title = signal('', ...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
25
|
-
content = signal('', ...(ngDevMode ? [{ debugName: "content" }] : []));
|
|
26
|
-
ok = signal('Continuar', ...(ngDevMode ? [{ debugName: "ok" }] : []));
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
title = signal('', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
25
|
+
content = signal('', ...(ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []));
|
|
26
|
+
ok = signal('Continuar', ...(ngDevMode ? [{ debugName: "ok" }] : /* istanbul ignore next */ []));
|
|
27
|
+
closeDialog = (result) => {
|
|
28
|
+
this.dialogRef.close(result);
|
|
29
|
+
};
|
|
30
|
+
close(result) {
|
|
31
|
+
this.closeDialog(result);
|
|
32
|
+
}
|
|
33
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: AlertDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
34
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.13", type: AlertDialogComponent, isStandalone: true, selector: "oat-alert-dialog", ngImport: i0, template: "<h1 mat-dialog-title>{{ title() }}</h1>\r\n<div mat-dialog-content>\r\n\t<p>{{ content() }}</p>\r\n</div>\r\n<div mat-dialog-actions\r\n\t align=\"end\">\r\n\t<button type=\"button\"\n\t\t\tmat-flat-button\n\t\t\tcolor=\"primary\"\n\t\t\t(click)=\"close(true)\">{{ ok() }}</button>\n</div>\n", dependencies: [{ kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }] });
|
|
29
35
|
}
|
|
30
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
36
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: AlertDialogComponent, decorators: [{
|
|
31
37
|
type: Component,
|
|
32
|
-
args: [{ selector: 'oat-alert-dialog', imports: [MatDialogTitle, MatDialogContent, MatDialogActions, MatButton], template: "<h1 mat-dialog-title>{{ title() }}</h1>\r\n<div mat-dialog-content>\r\n\t<p>{{ content() }}</p>\r\n</div>\r\n<div mat-dialog-actions\r\n\t align=\"end\">\r\n\t<button type=\"button\"\
|
|
38
|
+
args: [{ selector: 'oat-alert-dialog', imports: [MatDialogTitle, MatDialogContent, MatDialogActions, MatButton], template: "<h1 mat-dialog-title>{{ title() }}</h1>\r\n<div mat-dialog-content>\r\n\t<p>{{ content() }}</p>\r\n</div>\r\n<div mat-dialog-actions\r\n\t align=\"end\">\r\n\t<button type=\"button\"\n\t\t\tmat-flat-button\n\t\t\tcolor=\"primary\"\n\t\t\t(click)=\"close(true)\">{{ ok() }}</button>\n</div>\n" }]
|
|
33
39
|
}] });
|
|
34
40
|
|
|
35
41
|
/**
|
|
@@ -41,15 +47,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImpor
|
|
|
41
47
|
*/
|
|
42
48
|
class ConfirmDialogComponent {
|
|
43
49
|
dialogRef = inject(MatDialogRef);
|
|
44
|
-
title = signal('', ...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
45
|
-
content = signal('', ...(ngDevMode ? [{ debugName: "content" }] : []));
|
|
46
|
-
warn = signal(false, ...(ngDevMode ? [{ debugName: "warn" }] : []));
|
|
47
|
-
ok = signal('Continuar', ...(ngDevMode ? [{ debugName: "ok" }] : []));
|
|
48
|
-
cancel = signal('Cancelar', ...(ngDevMode ? [{ debugName: "cancel" }] : []));
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
title = signal('', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
51
|
+
content = signal('', ...(ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []));
|
|
52
|
+
warn = signal(false, ...(ngDevMode ? [{ debugName: "warn" }] : /* istanbul ignore next */ []));
|
|
53
|
+
ok = signal('Continuar', ...(ngDevMode ? [{ debugName: "ok" }] : /* istanbul ignore next */ []));
|
|
54
|
+
cancel = signal('Cancelar', ...(ngDevMode ? [{ debugName: "cancel" }] : /* istanbul ignore next */ []));
|
|
55
|
+
closeDialog = (result) => {
|
|
56
|
+
this.dialogRef.close(result);
|
|
57
|
+
};
|
|
58
|
+
close(result) {
|
|
59
|
+
this.closeDialog(result);
|
|
60
|
+
}
|
|
61
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: ConfirmDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
62
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.13", type: ConfirmDialogComponent, isStandalone: true, selector: "oat-confirm-dialog", ngImport: i0, template: "<h1 mat-dialog-title>{{ title() }}</h1>\r\n<div mat-dialog-content>\r\n\t<p>{{ content() }}</p>\r\n</div>\r\n<div mat-dialog-actions\r\n\t align=\"end\">\r\n\t<button type=\"button\"\n\t\t\tmat-button\n\t\t\t(click)=\"close(false)\">{{ cancel() }}</button>\n\t<button type=\"button\"\n\t\t\tmat-flat-button\n\t\t\t[ngClass]=\"{'dialogs-warn': warn()}\"\n\t\t\t(click)=\"close(true)\">{{ ok() }}</button>\n</div>\n", styles: [".dialogs-warn{background-color:var(--oat-dialogs-color-warn)!important;color:var(--oat-dialogs-color-white)!important}\n"], dependencies: [{ kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
51
63
|
}
|
|
52
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: ConfirmDialogComponent, decorators: [{
|
|
53
65
|
type: Component,
|
|
54
66
|
args: [{ selector: 'oat-confirm-dialog', imports: [
|
|
55
67
|
MatDialogTitle,
|
|
@@ -57,7 +69,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImpor
|
|
|
57
69
|
MatDialogActions,
|
|
58
70
|
MatButton,
|
|
59
71
|
NgClass,
|
|
60
|
-
], encapsulation: ViewEncapsulation.None, template: "<h1 mat-dialog-title>{{ title() }}</h1>\r\n<div mat-dialog-content>\r\n\t<p>{{ content() }}</p>\r\n</div>\r\n<div mat-dialog-actions\r\n\t align=\"end\">\r\n\t<button type=\"button\"\
|
|
72
|
+
], encapsulation: ViewEncapsulation.None, template: "<h1 mat-dialog-title>{{ title() }}</h1>\r\n<div mat-dialog-content>\r\n\t<p>{{ content() }}</p>\r\n</div>\r\n<div mat-dialog-actions\r\n\t align=\"end\">\r\n\t<button type=\"button\"\n\t\t\tmat-button\n\t\t\t(click)=\"close(false)\">{{ cancel() }}</button>\n\t<button type=\"button\"\n\t\t\tmat-flat-button\n\t\t\t[ngClass]=\"{'dialogs-warn': warn()}\"\n\t\t\t(click)=\"close(true)\">{{ ok() }}</button>\n</div>\n", styles: [".dialogs-warn{background-color:var(--oat-dialogs-color-warn)!important;color:var(--oat-dialogs-color-white)!important}\n"] }]
|
|
61
73
|
}] });
|
|
62
74
|
|
|
63
75
|
/**
|
|
@@ -69,11 +81,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImpor
|
|
|
69
81
|
*/
|
|
70
82
|
class FormDialogComponent {
|
|
71
83
|
dialogRef = inject(MatDialogRef);
|
|
72
|
-
title = signal('', ...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
73
|
-
content = signal('', ...(ngDevMode ? [{ debugName: "content" }] : []));
|
|
74
|
-
fields = signal([], ...(ngDevMode ? [{ debugName: "fields" }] : []));
|
|
75
|
-
ok = signal('Continuar', ...(ngDevMode ? [{ debugName: "ok" }] : []));
|
|
76
|
-
cancel = signal('Cancelar', ...(ngDevMode ? [{ debugName: "cancel" }] : []));
|
|
84
|
+
title = signal('', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
85
|
+
content = signal('', ...(ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []));
|
|
86
|
+
fields = signal([], ...(ngDevMode ? [{ debugName: "fields" }] : /* istanbul ignore next */ []));
|
|
87
|
+
ok = signal('Continuar', ...(ngDevMode ? [{ debugName: "ok" }] : /* istanbul ignore next */ []));
|
|
88
|
+
cancel = signal('Cancelar', ...(ngDevMode ? [{ debugName: "cancel" }] : /* istanbul ignore next */ []));
|
|
89
|
+
closeDialog = (result) => {
|
|
90
|
+
this.dialogRef.close(result);
|
|
91
|
+
};
|
|
77
92
|
/**
|
|
78
93
|
* Método para validar el formulario.
|
|
79
94
|
* Comprueba si todos los campos requeridos tienen un valor no vacío.
|
|
@@ -84,23 +99,25 @@ class FormDialogComponent {
|
|
|
84
99
|
return (!field.required || Boolean(field.value && field.value.trim() !== ''));
|
|
85
100
|
});
|
|
86
101
|
}
|
|
87
|
-
|
|
88
|
-
|
|
102
|
+
close(result) {
|
|
103
|
+
this.closeDialog(result);
|
|
104
|
+
}
|
|
105
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: FormDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
106
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.13", type: FormDialogComponent, isStandalone: true, selector: "oat-form-dialog", ngImport: i0, template: "<h1 mat-dialog-title>{{ title() }}</h1>\r\n<div mat-dialog-content>\r\n\t<p>{{ content() }}</p>\r\n\t@for (field of fields(); track field.title) {\r\n\t<p>\r\n\t\t<mat-form-field class=\"dialogs-full-width\">\r\n\t\t\t<mat-label>{{field.title}}</mat-label>\r\n\t\t\t<input matInput\r\n\t\t\t\t [type]=\"field.type\"\r\n\t\t\t\t [(ngModel)]=\"field.value\"\r\n\t\t\t\t [required]=\"field.required || false\">\r\n\t\t\t@if (field.hint) {\r\n\t\t\t<mat-hint>{{field.hint}}</mat-hint>\r\n\t\t\t}\r\n\t\t</mat-form-field>\r\n\t</p>\r\n\t}\r\n</div>\r\n<div mat-dialog-actions\r\n\t align=\"end\">\r\n\t<button type=\"button\"\n\t\t\tmat-button\n\t\t\t(click)=\"close()\">{{ cancel() }}</button>\n\t<button type=\"button\"\n\t\t\tmat-flat-button\n\t\t\tcolor=\"primary\"\n\t\t\t[disabled]=\"!isFormValid()\"\n\t\t\t(click)=\"close(fields())\">{{ ok() }}</button>\n</div>\n", styles: [".dialogs-full-width{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "component", type: MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
89
107
|
}
|
|
90
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
108
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: FormDialogComponent, decorators: [{
|
|
91
109
|
type: Component,
|
|
92
110
|
args: [{ selector: 'oat-form-dialog', imports: [
|
|
93
111
|
FormsModule,
|
|
94
112
|
MatDialogTitle,
|
|
95
113
|
MatDialogContent,
|
|
96
114
|
MatDialogActions,
|
|
97
|
-
MatDialogClose,
|
|
98
115
|
MatFormField,
|
|
99
116
|
MatLabel,
|
|
100
117
|
MatInput,
|
|
101
118
|
MatHint,
|
|
102
119
|
MatButton,
|
|
103
|
-
], encapsulation: ViewEncapsulation.None, template: "<h1 mat-dialog-title>{{ title() }}</h1>\r\n<div mat-dialog-content>\r\n\t<p>{{ content() }}</p>\r\n\t@for (field of fields(); track field.title) {\r\n\t<p>\r\n\t\t<mat-form-field class=\"dialogs-full-width\">\r\n\t\t\t<mat-label>{{field.title}}</mat-label>\r\n\t\t\t<input matInput\r\n\t\t\t\t [type]=\"field.type\"\r\n\t\t\t\t [(ngModel)]=\"field.value\"\r\n\t\t\t\t [required]=\"field.required || false\">\r\n\t\t\t@if (field.hint) {\r\n\t\t\t<mat-hint>{{field.hint}}</mat-hint>\r\n\t\t\t}\r\n\t\t</mat-form-field>\r\n\t</p>\r\n\t}\r\n</div>\r\n<div mat-dialog-actions\r\n\t align=\"end\">\r\n\t<button type=\"button\"\
|
|
120
|
+
], encapsulation: ViewEncapsulation.None, template: "<h1 mat-dialog-title>{{ title() }}</h1>\r\n<div mat-dialog-content>\r\n\t<p>{{ content() }}</p>\r\n\t@for (field of fields(); track field.title) {\r\n\t<p>\r\n\t\t<mat-form-field class=\"dialogs-full-width\">\r\n\t\t\t<mat-label>{{field.title}}</mat-label>\r\n\t\t\t<input matInput\r\n\t\t\t\t [type]=\"field.type\"\r\n\t\t\t\t [(ngModel)]=\"field.value\"\r\n\t\t\t\t [required]=\"field.required || false\">\r\n\t\t\t@if (field.hint) {\r\n\t\t\t<mat-hint>{{field.hint}}</mat-hint>\r\n\t\t\t}\r\n\t\t</mat-form-field>\r\n\t</p>\r\n\t}\r\n</div>\r\n<div mat-dialog-actions\r\n\t align=\"end\">\r\n\t<button type=\"button\"\n\t\t\tmat-button\n\t\t\t(click)=\"close()\">{{ cancel() }}</button>\n\t<button type=\"button\"\n\t\t\tmat-flat-button\n\t\t\tcolor=\"primary\"\n\t\t\t[disabled]=\"!isFormValid()\"\n\t\t\t(click)=\"close(fields())\">{{ ok() }}</button>\n</div>\n", styles: [".dialogs-full-width{width:100%}\n"] }]
|
|
104
121
|
}] });
|
|
105
122
|
|
|
106
123
|
/**
|
|
@@ -116,24 +133,40 @@ class CustomOverlayRef {
|
|
|
116
133
|
content;
|
|
117
134
|
data;
|
|
118
135
|
closeOnBackdropCLick;
|
|
136
|
+
from;
|
|
137
|
+
animationDuration;
|
|
119
138
|
afterClosed$ = new Subject();
|
|
120
|
-
|
|
139
|
+
closeAnimation;
|
|
140
|
+
closing = false;
|
|
141
|
+
constructor(overlay, content, data, closeOnBackdropCLick = true, from, animationDuration) {
|
|
121
142
|
this.overlay = overlay;
|
|
122
143
|
this.content = content;
|
|
123
144
|
this.data = data;
|
|
124
145
|
this.closeOnBackdropCLick = closeOnBackdropCLick;
|
|
146
|
+
this.from = from;
|
|
147
|
+
this.animationDuration = animationDuration;
|
|
125
148
|
if (closeOnBackdropCLick) {
|
|
126
149
|
overlay.backdropClick().subscribe({
|
|
127
150
|
next: () => {
|
|
128
|
-
this._close('backdropClick', null);
|
|
151
|
+
void this._close('backdropClick', null);
|
|
129
152
|
},
|
|
130
153
|
});
|
|
131
154
|
}
|
|
132
155
|
}
|
|
133
156
|
close(data) {
|
|
134
|
-
this._close('close', data);
|
|
157
|
+
void this._close('close', data ?? null);
|
|
158
|
+
}
|
|
159
|
+
registerCloseAnimation(closeAnimation) {
|
|
160
|
+
this.closeAnimation = closeAnimation;
|
|
135
161
|
}
|
|
136
|
-
_close(type, data) {
|
|
162
|
+
async _close(type, data) {
|
|
163
|
+
if (this.closing) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
this.closing = true;
|
|
167
|
+
if (this.closeAnimation !== undefined) {
|
|
168
|
+
await this.closeAnimation();
|
|
169
|
+
}
|
|
137
170
|
this.overlay.dispose();
|
|
138
171
|
this.afterClosed$.next({
|
|
139
172
|
type,
|
|
@@ -143,6 +176,7 @@ class CustomOverlayRef {
|
|
|
143
176
|
}
|
|
144
177
|
}
|
|
145
178
|
|
|
179
|
+
const DEFAULT_OVERLAY_ANIMATION_DURATION = 220;
|
|
146
180
|
/**
|
|
147
181
|
* Componente para mostrar un componente personalizado en una ventana modal.
|
|
148
182
|
*
|
|
@@ -151,12 +185,19 @@ class CustomOverlayRef {
|
|
|
151
185
|
class OverlayComponent {
|
|
152
186
|
customOverlayRef = inject(CustomOverlayRef);
|
|
153
187
|
renderer = inject(Renderer2);
|
|
188
|
+
modal = viewChild.required('modal');
|
|
154
189
|
content = this.customOverlayRef.content;
|
|
155
190
|
inputData = { modalTitle: '', modalColor: 'blue' };
|
|
156
191
|
ngOnInit() {
|
|
157
192
|
this.listenToEscKey();
|
|
158
193
|
this.inputData = this.customOverlayRef.data;
|
|
159
194
|
}
|
|
195
|
+
ngAfterViewInit() {
|
|
196
|
+
this.customOverlayRef.registerCloseAnimation(() => {
|
|
197
|
+
return this.animateClose();
|
|
198
|
+
});
|
|
199
|
+
this.animateOpen();
|
|
200
|
+
}
|
|
160
201
|
listenToEscKey() {
|
|
161
202
|
this.renderer.listen('window', 'keyup', (event) => {
|
|
162
203
|
if (event.key === 'Escape') {
|
|
@@ -167,13 +208,104 @@ class OverlayComponent {
|
|
|
167
208
|
close() {
|
|
168
209
|
this.customOverlayRef.close(null);
|
|
169
210
|
}
|
|
170
|
-
|
|
171
|
-
|
|
211
|
+
animateOpen() {
|
|
212
|
+
const modal = this.modal().nativeElement;
|
|
213
|
+
const animationStart = this.getOriginKeyframe(modal);
|
|
214
|
+
if (animationStart === null) {
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
modal.animate([
|
|
218
|
+
{
|
|
219
|
+
...animationStart,
|
|
220
|
+
opacity: 0,
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
transform: 'translate(0, 0) scale(1)',
|
|
224
|
+
opacity: 1,
|
|
225
|
+
},
|
|
226
|
+
], {
|
|
227
|
+
duration: this.getAnimationDuration(),
|
|
228
|
+
easing: 'cubic-bezier(0.2, 0, 0, 1)',
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
animateClose() {
|
|
232
|
+
const modal = this.modal().nativeElement;
|
|
233
|
+
const animationEnd = this.getOriginKeyframe(modal);
|
|
234
|
+
if (animationEnd === null) {
|
|
235
|
+
return Promise.resolve();
|
|
236
|
+
}
|
|
237
|
+
modal.style.pointerEvents = 'none';
|
|
238
|
+
const animation = modal.animate([
|
|
239
|
+
{
|
|
240
|
+
transform: 'translate(0, 0) scale(1)',
|
|
241
|
+
opacity: 1,
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
...animationEnd,
|
|
245
|
+
opacity: 0,
|
|
246
|
+
},
|
|
247
|
+
], {
|
|
248
|
+
duration: this.getCloseAnimationDuration(),
|
|
249
|
+
easing: 'cubic-bezier(0.4, 0, 1, 1)',
|
|
250
|
+
fill: 'forwards',
|
|
251
|
+
});
|
|
252
|
+
return new Promise((resolve) => {
|
|
253
|
+
animation.onfinish = () => {
|
|
254
|
+
resolve();
|
|
255
|
+
};
|
|
256
|
+
animation.oncancel = () => {
|
|
257
|
+
resolve();
|
|
258
|
+
};
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
getOriginKeyframe(modal) {
|
|
262
|
+
const from = this.customOverlayRef.from;
|
|
263
|
+
if (from === undefined ||
|
|
264
|
+
!from.isConnected ||
|
|
265
|
+
this.prefersReducedMotion() ||
|
|
266
|
+
typeof modal.animate !== 'function') {
|
|
267
|
+
return null;
|
|
268
|
+
}
|
|
269
|
+
const fromRect = from.getBoundingClientRect();
|
|
270
|
+
const modalRect = modal.getBoundingClientRect();
|
|
271
|
+
if (fromRect.width === 0 ||
|
|
272
|
+
fromRect.height === 0 ||
|
|
273
|
+
modalRect.width === 0 ||
|
|
274
|
+
modalRect.height === 0) {
|
|
275
|
+
return null;
|
|
276
|
+
}
|
|
277
|
+
const fromCenterX = fromRect.left + fromRect.width / 2;
|
|
278
|
+
const fromCenterY = fromRect.top + fromRect.height / 2;
|
|
279
|
+
const modalCenterX = modalRect.left + modalRect.width / 2;
|
|
280
|
+
const modalCenterY = modalRect.top + modalRect.height / 2;
|
|
281
|
+
const translateX = fromCenterX - modalCenterX;
|
|
282
|
+
const translateY = fromCenterY - modalCenterY;
|
|
283
|
+
const scale = this.clamp(Math.min(fromRect.width / modalRect.width, fromRect.height / modalRect.height), 0.12, 0.45);
|
|
284
|
+
return {
|
|
285
|
+
transform: `translate(${translateX}px, ${translateY}px) scale(${scale})`,
|
|
286
|
+
transformOrigin: 'center center',
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
getAnimationDuration() {
|
|
290
|
+
return this.clamp(this.customOverlayRef.animationDuration ??
|
|
291
|
+
DEFAULT_OVERLAY_ANIMATION_DURATION, 0, 5000);
|
|
292
|
+
}
|
|
293
|
+
getCloseAnimationDuration() {
|
|
294
|
+
return Math.round(this.getAnimationDuration() * 0.82);
|
|
295
|
+
}
|
|
296
|
+
prefersReducedMotion() {
|
|
297
|
+
return window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
298
|
+
}
|
|
299
|
+
clamp(value, min, max) {
|
|
300
|
+
return Math.min(Math.max(value, min), max);
|
|
301
|
+
}
|
|
302
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: OverlayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
303
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.13", type: OverlayComponent, isStandalone: true, selector: "oat-overlay", viewQueries: [{ propertyName: "modal", first: true, predicate: ["modal"], descendants: true, isSignal: true }], ngImport: i0, template: "<div #modal\n\t [class]=\"'modal ' + (inputData.css ? inputData.css : '')\">\n\t<div [class]=\"'modal__header modal__header--' + inputData.modalColor\">\r\n\t\t<div class=\"title\">{{ inputData.modalTitle }}</div>\r\n\t\t@if (!inputData.hideCloseBtn) {\r\n\t\t<button mat-icon-button\r\n\t\t\t\tclass=\"btn-close\"\r\n\t\t\t\t(click)=\"close()\">\r\n\t\t\t<mat-icon>close</mat-icon>\r\n\t\t</button>\r\n\t\t}\r\n\t</div>\r\n\r\n\t<div [class]=\"'modal__content ' + inputData.contentCss\">\r\n\t\t<ng-container *ngComponentOutlet=\"content\"></ng-container>\r\n\t</div>\r\n</div>\n", styles: [":host{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.modal{border-radius:6px;box-shadow:4px 4px 5px 0 var(--oat-modals-bg-color)}.modal__header{border-top-left-radius:6px;border-top-right-radius:6px;display:flex;justify-content:space-between;align-items:center;padding:0 20px;height:48px;font-size:24px;background-color:var(--oat-modals-main-color)}.modal__header .title{color:var(--oat-modals-color-white)}.modal__header .btn-close{cursor:pointer;color:var(--oat-modals-color-white)}.modal__header--blue{background-color:var(--oat-modals-color-blue)}.modal__header--yellow{background-color:var(--oat-modals-color-yellow);color:var(--oat-modals-color-black)}.modal__header--yellow>.btn-close{color:var(--oat-modals-color-black)}.modal__header--red{background-color:var(--oat-modals-color-red)}.modal__content{padding:20px;border-bottom-left-radius:6px;background-color:var(--oat-modals-color-white);border-bottom-right-radius:6px;height:calc(100% - 48px);overflow-y:auto;box-sizing:border-box}\n"], dependencies: [{ kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }] });
|
|
172
304
|
}
|
|
173
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
305
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: OverlayComponent, decorators: [{
|
|
174
306
|
type: Component,
|
|
175
|
-
args: [{ selector: 'oat-overlay', imports: [MatIcon, MatIconButton, NgComponentOutlet], template: "<div [class]=\"'modal ' + (inputData.css ? inputData.css : '')\">\
|
|
176
|
-
}] });
|
|
307
|
+
args: [{ selector: 'oat-overlay', imports: [MatIcon, MatIconButton, NgComponentOutlet], template: "<div #modal\n\t [class]=\"'modal ' + (inputData.css ? inputData.css : '')\">\n\t<div [class]=\"'modal__header modal__header--' + inputData.modalColor\">\r\n\t\t<div class=\"title\">{{ inputData.modalTitle }}</div>\r\n\t\t@if (!inputData.hideCloseBtn) {\r\n\t\t<button mat-icon-button\r\n\t\t\t\tclass=\"btn-close\"\r\n\t\t\t\t(click)=\"close()\">\r\n\t\t\t<mat-icon>close</mat-icon>\r\n\t\t</button>\r\n\t\t}\r\n\t</div>\r\n\r\n\t<div [class]=\"'modal__content ' + inputData.contentCss\">\r\n\t\t<ng-container *ngComponentOutlet=\"content\"></ng-container>\r\n\t</div>\r\n</div>\n", styles: [":host{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.modal{border-radius:6px;box-shadow:4px 4px 5px 0 var(--oat-modals-bg-color)}.modal__header{border-top-left-radius:6px;border-top-right-radius:6px;display:flex;justify-content:space-between;align-items:center;padding:0 20px;height:48px;font-size:24px;background-color:var(--oat-modals-main-color)}.modal__header .title{color:var(--oat-modals-color-white)}.modal__header .btn-close{cursor:pointer;color:var(--oat-modals-color-white)}.modal__header--blue{background-color:var(--oat-modals-color-blue)}.modal__header--yellow{background-color:var(--oat-modals-color-yellow);color:var(--oat-modals-color-black)}.modal__header--yellow>.btn-close{color:var(--oat-modals-color-black)}.modal__header--red{background-color:var(--oat-modals-color-red)}.modal__content{padding:20px;border-bottom-left-radius:6px;background-color:var(--oat-modals-color-white);border-bottom-right-radius:6px;height:calc(100% - 48px);overflow-y:auto;box-sizing:border-box}\n"] }]
|
|
308
|
+
}], propDecorators: { modal: [{ type: i0.ViewChild, args: ['modal', { isSignal: true }] }] } });
|
|
177
309
|
|
|
178
310
|
/**
|
|
179
311
|
* Directiva para detectar gestos de deslizamiento (swipe) en un elemento.
|
|
@@ -226,10 +358,10 @@ class SwipeDirective {
|
|
|
226
358
|
this.mouseDownListener();
|
|
227
359
|
this.mouseUpListener();
|
|
228
360
|
}
|
|
229
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
230
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
361
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: SwipeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
362
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.13", type: SwipeDirective, isStandalone: true, selector: "[oatSwipe]", outputs: { swipeEnd: "swipeEnd" }, host: { listeners: { "touchstart": "onTouchStart($event)", "touchend": "onTouchEnd($event)", "mousedown": "onMouseDown($event)", "mouseup": "onMouseUp($event)" } }, ngImport: i0 });
|
|
231
363
|
}
|
|
232
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
364
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: SwipeDirective, decorators: [{
|
|
233
365
|
type: Directive,
|
|
234
366
|
args: [{
|
|
235
367
|
selector: '[oatSwipe]',
|
|
@@ -241,8 +373,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImpor
|
|
|
241
373
|
'(mouseup)': 'onMouseUp($event)',
|
|
242
374
|
},
|
|
243
375
|
}]
|
|
244
|
-
}], ctorParameters: () => [] });
|
|
376
|
+
}], ctorParameters: () => [], propDecorators: { swipeEnd: [{ type: i0.Output, args: ["swipeEnd"] }] } });
|
|
245
377
|
|
|
378
|
+
const DEFAULT_DIALOG_ANIMATION_DURATION = 220;
|
|
246
379
|
/**
|
|
247
380
|
* Servicio para manejar diálogos en la aplicación.
|
|
248
381
|
*
|
|
@@ -252,13 +385,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.0", ngImpor
|
|
|
252
385
|
*/
|
|
253
386
|
class DialogService {
|
|
254
387
|
dialog = inject(MatDialog);
|
|
388
|
+
document = inject(DOCUMENT);
|
|
389
|
+
platformId = inject(PLATFORM_ID);
|
|
390
|
+
static dialogId = 0;
|
|
255
391
|
/**
|
|
256
392
|
* Método para mostrar un diálogo de alerta.
|
|
257
393
|
* @param options Datos a mostrar en el diálogo, incluyendo título, contenido y texto del botón de confirmación (opcional).
|
|
258
394
|
* @returns Devuelve un observable para notificar el cierre del diálogo.
|
|
259
395
|
*/
|
|
260
396
|
alert(options) {
|
|
261
|
-
const dialogRef = this.
|
|
397
|
+
const dialogRef = this.openDialog(AlertDialogComponent, options);
|
|
262
398
|
dialogRef.componentInstance.title.set(options.title);
|
|
263
399
|
dialogRef.componentInstance.content.set(options.content);
|
|
264
400
|
if (options.ok !== undefined) {
|
|
@@ -272,7 +408,7 @@ class DialogService {
|
|
|
272
408
|
* @returns Devuelve un observable para notificar el cierre del diálogo con el valor true para diálogo aceptado y false para diálogo cancelado.
|
|
273
409
|
*/
|
|
274
410
|
confirm(options) {
|
|
275
|
-
const dialogRef = this.
|
|
411
|
+
const dialogRef = this.openDialog(ConfirmDialogComponent, options);
|
|
276
412
|
dialogRef.componentInstance.title.set(options.title);
|
|
277
413
|
dialogRef.componentInstance.content.set(options.content);
|
|
278
414
|
if (options.warn !== undefined) {
|
|
@@ -292,7 +428,7 @@ class DialogService {
|
|
|
292
428
|
* @returns Devuelve un observable para notificar el cierre del diálogo con los valores introducidos en el formulario.
|
|
293
429
|
*/
|
|
294
430
|
form(options) {
|
|
295
|
-
const dialogRef = this.
|
|
431
|
+
const dialogRef = this.openDialog(FormDialogComponent, options);
|
|
296
432
|
dialogRef.componentInstance.title.set(options.title);
|
|
297
433
|
dialogRef.componentInstance.content.set(options.content);
|
|
298
434
|
if (options.ok !== undefined) {
|
|
@@ -306,10 +442,196 @@ class DialogService {
|
|
|
306
442
|
}
|
|
307
443
|
return dialogRef.afterClosed();
|
|
308
444
|
}
|
|
309
|
-
|
|
310
|
-
|
|
445
|
+
openDialog(component, options) {
|
|
446
|
+
const panelClass = options.from !== undefined ? this.getPanelClass() : undefined;
|
|
447
|
+
const dialogConfig = {};
|
|
448
|
+
if (panelClass !== undefined) {
|
|
449
|
+
dialogConfig.panelClass = panelClass;
|
|
450
|
+
dialogConfig.disableClose = true;
|
|
451
|
+
dialogConfig.enterAnimationDuration = '0ms';
|
|
452
|
+
dialogConfig.exitAnimationDuration = '0ms';
|
|
453
|
+
}
|
|
454
|
+
const dialogRef = this.dialog.open(component, dialogConfig);
|
|
455
|
+
const animationDuration = this.getAnimationDuration(options);
|
|
456
|
+
this.configureDialogClose(dialogRef, panelClass, options.from, animationDuration);
|
|
457
|
+
if (panelClass !== undefined && options.from !== undefined) {
|
|
458
|
+
this.prepareDialogOpen(panelClass);
|
|
459
|
+
this.animateDialogOpen(panelClass, options.from, animationDuration);
|
|
460
|
+
}
|
|
461
|
+
return dialogRef;
|
|
462
|
+
}
|
|
463
|
+
configureDialogClose(dialogRef, panelClass, from, animationDuration) {
|
|
464
|
+
let closing = false;
|
|
465
|
+
const closeDialog = (result) => {
|
|
466
|
+
if (closing) {
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
closing = true;
|
|
470
|
+
void this.closeDialog(dialogRef, panelClass, from, animationDuration, result);
|
|
471
|
+
};
|
|
472
|
+
dialogRef.componentInstance.closeDialog = closeDialog;
|
|
473
|
+
if (panelClass === undefined || from === undefined) {
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
dialogRef.backdropClick().subscribe({
|
|
477
|
+
next: () => {
|
|
478
|
+
closeDialog();
|
|
479
|
+
},
|
|
480
|
+
});
|
|
481
|
+
dialogRef.keydownEvents().subscribe({
|
|
482
|
+
next: (event) => {
|
|
483
|
+
if (event.key === 'Escape') {
|
|
484
|
+
closeDialog();
|
|
485
|
+
}
|
|
486
|
+
},
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
getPanelClass() {
|
|
490
|
+
DialogService.dialogId++;
|
|
491
|
+
return `oat-dialog-from-${DialogService.dialogId}`;
|
|
492
|
+
}
|
|
493
|
+
animateDialogOpen(panelClass, from, animationDuration) {
|
|
494
|
+
this.runAfterRender(() => {
|
|
495
|
+
const panel = this.getPanel(panelClass);
|
|
496
|
+
const animationStart = this.getOriginKeyframe(panel, from);
|
|
497
|
+
if (panel === null || animationStart === null) {
|
|
498
|
+
if (panel !== null) {
|
|
499
|
+
panel.style.opacity = '';
|
|
500
|
+
}
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
const animation = panel.animate([
|
|
504
|
+
{
|
|
505
|
+
...animationStart,
|
|
506
|
+
opacity: 0,
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
transform: 'translate(0, 0) scale(1)',
|
|
510
|
+
opacity: 1,
|
|
511
|
+
},
|
|
512
|
+
], {
|
|
513
|
+
duration: animationDuration,
|
|
514
|
+
easing: 'cubic-bezier(0.2, 0, 0, 1)',
|
|
515
|
+
});
|
|
516
|
+
animation.onfinish = () => {
|
|
517
|
+
panel.style.opacity = '';
|
|
518
|
+
};
|
|
519
|
+
animation.oncancel = () => {
|
|
520
|
+
panel.style.opacity = '';
|
|
521
|
+
};
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
prepareDialogOpen(panelClass) {
|
|
525
|
+
if (!this.canAnimate()) {
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
const panel = this.getPanel(panelClass);
|
|
529
|
+
if (panel !== null) {
|
|
530
|
+
panel.style.opacity = '0';
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
async closeDialog(dialogRef, panelClass, from, animationDuration, result) {
|
|
534
|
+
if (panelClass === undefined || from === undefined) {
|
|
535
|
+
dialogRef.close(result);
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
538
|
+
const panel = this.getPanel(panelClass);
|
|
539
|
+
const animationEnd = this.getOriginKeyframe(panel, from);
|
|
540
|
+
if (panel === null || animationEnd === null) {
|
|
541
|
+
dialogRef.close(result);
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
544
|
+
await this.animatePanelClose(panel, animationEnd, this.getCloseAnimationDuration(animationDuration));
|
|
545
|
+
dialogRef.close(result);
|
|
546
|
+
}
|
|
547
|
+
animatePanelClose(panel, animationEnd, animationDuration) {
|
|
548
|
+
panel.style.pointerEvents = 'none';
|
|
549
|
+
const animation = panel.animate([
|
|
550
|
+
{
|
|
551
|
+
transform: 'translate(0, 0) scale(1)',
|
|
552
|
+
opacity: 1,
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
...animationEnd,
|
|
556
|
+
opacity: 0,
|
|
557
|
+
},
|
|
558
|
+
], {
|
|
559
|
+
duration: animationDuration,
|
|
560
|
+
easing: 'cubic-bezier(0.4, 0, 1, 1)',
|
|
561
|
+
fill: 'forwards',
|
|
562
|
+
});
|
|
563
|
+
return new Promise((resolve) => {
|
|
564
|
+
animation.onfinish = () => {
|
|
565
|
+
resolve();
|
|
566
|
+
};
|
|
567
|
+
animation.oncancel = () => {
|
|
568
|
+
resolve();
|
|
569
|
+
};
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
getOriginKeyframe(panel, from) {
|
|
573
|
+
if (panel === null ||
|
|
574
|
+
!this.canAnimate() ||
|
|
575
|
+
!from.isConnected ||
|
|
576
|
+
typeof panel.animate !== 'function') {
|
|
577
|
+
return null;
|
|
578
|
+
}
|
|
579
|
+
const fromRect = from.getBoundingClientRect();
|
|
580
|
+
const panelRect = panel.getBoundingClientRect();
|
|
581
|
+
if (fromRect.width === 0 ||
|
|
582
|
+
fromRect.height === 0 ||
|
|
583
|
+
panelRect.width === 0 ||
|
|
584
|
+
panelRect.height === 0) {
|
|
585
|
+
return null;
|
|
586
|
+
}
|
|
587
|
+
const fromCenterX = fromRect.left + fromRect.width / 2;
|
|
588
|
+
const fromCenterY = fromRect.top + fromRect.height / 2;
|
|
589
|
+
const panelCenterX = panelRect.left + panelRect.width / 2;
|
|
590
|
+
const panelCenterY = panelRect.top + panelRect.height / 2;
|
|
591
|
+
const translateX = fromCenterX - panelCenterX;
|
|
592
|
+
const translateY = fromCenterY - panelCenterY;
|
|
593
|
+
const scale = this.clamp(Math.min(fromRect.width / panelRect.width, fromRect.height / panelRect.height), 0.12, 0.45);
|
|
594
|
+
return {
|
|
595
|
+
transform: `translate(${translateX}px, ${translateY}px) scale(${scale})`,
|
|
596
|
+
transformOrigin: 'center center',
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
getPanel(panelClass) {
|
|
600
|
+
if (!isPlatformBrowser(this.platformId)) {
|
|
601
|
+
return null;
|
|
602
|
+
}
|
|
603
|
+
return this.document.querySelector(`.${panelClass}`);
|
|
604
|
+
}
|
|
605
|
+
canAnimate() {
|
|
606
|
+
if (!isPlatformBrowser(this.platformId)) {
|
|
607
|
+
return false;
|
|
608
|
+
}
|
|
609
|
+
const defaultView = this.document.defaultView;
|
|
610
|
+
return (defaultView !== null && !defaultView.matchMedia('(prefers-reduced-motion: reduce)').matches);
|
|
611
|
+
}
|
|
612
|
+
runAfterRender(callback) {
|
|
613
|
+
const defaultView = this.document.defaultView;
|
|
614
|
+
if (!isPlatformBrowser(this.platformId) || defaultView === null) {
|
|
615
|
+
callback();
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
618
|
+
defaultView.requestAnimationFrame(() => {
|
|
619
|
+
defaultView.requestAnimationFrame(callback);
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
clamp(value, min, max) {
|
|
623
|
+
return Math.min(Math.max(value, min), max);
|
|
624
|
+
}
|
|
625
|
+
getAnimationDuration(options) {
|
|
626
|
+
return this.clamp(options.animationDuration ?? DEFAULT_DIALOG_ANIMATION_DURATION, 0, 5000);
|
|
627
|
+
}
|
|
628
|
+
getCloseAnimationDuration(animationDuration) {
|
|
629
|
+
return Math.round(animationDuration * 0.82);
|
|
630
|
+
}
|
|
631
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: DialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
632
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: DialogService, providedIn: 'root' });
|
|
311
633
|
}
|
|
312
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
634
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: DialogService, decorators: [{
|
|
313
635
|
type: Injectable,
|
|
314
636
|
args: [{ providedIn: 'root' }]
|
|
315
637
|
}] });
|
|
@@ -326,9 +648,11 @@ class OverlayService {
|
|
|
326
648
|
* @param data Datos a pasar al componente del overlay.
|
|
327
649
|
* @param panelCssClasses Clases CSS adicionales para el panel del overlay (opcional).
|
|
328
650
|
* @param closeOnBackdropCLick Indica si el overlay se cierra al hacer clic en el fondo (opcional, por defecto true).
|
|
651
|
+
* @param from Elemento desde el que se anima la apertura y cierre del overlay (opcional).
|
|
652
|
+
* @param animationDuration Duración de la animación en milisegundos (opcional).
|
|
329
653
|
* @returns Devuelve una referencia personalizada del overlay.
|
|
330
654
|
*/
|
|
331
|
-
open(content, data, panelCssClasses = [], closeOnBackdropCLick = true) {
|
|
655
|
+
open(content, data, panelCssClasses = [], closeOnBackdropCLick = true, from, animationDuration) {
|
|
332
656
|
const _panelCssClasses = ['modals-panel'].concat(panelCssClasses);
|
|
333
657
|
const config = new OverlayConfig({
|
|
334
658
|
hasBackdrop: true,
|
|
@@ -338,7 +662,7 @@ class OverlayService {
|
|
|
338
662
|
height: '100%',
|
|
339
663
|
});
|
|
340
664
|
const overlayRef = this.overlay.create(config);
|
|
341
|
-
const customOverlayRef = new CustomOverlayRef(overlayRef, content, data, closeOnBackdropCLick);
|
|
665
|
+
const customOverlayRef = new CustomOverlayRef(overlayRef, content, data, closeOnBackdropCLick, from, animationDuration);
|
|
342
666
|
const injector = this.createInjector(customOverlayRef, this.injector);
|
|
343
667
|
overlayRef.attach(new ComponentPortal(OverlayComponent, null, injector));
|
|
344
668
|
return customOverlayRef;
|
|
@@ -349,10 +673,10 @@ class OverlayService {
|
|
|
349
673
|
parent: inj,
|
|
350
674
|
});
|
|
351
675
|
}
|
|
352
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
353
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
676
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: OverlayService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
677
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: OverlayService, providedIn: 'root' });
|
|
354
678
|
}
|
|
355
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
679
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: OverlayService, decorators: [{
|
|
356
680
|
type: Injectable,
|
|
357
681
|
args: [{ providedIn: 'root' }]
|
|
358
682
|
}] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"osumi-angular-tools.mjs","sources":["../../../projects/osumi-angular-tools/src/lib/components/dialogs/alert-dialog/alert-dialog.component.ts","../../../projects/osumi-angular-tools/src/lib/components/dialogs/alert-dialog/alert-dialog.component.html","../../../projects/osumi-angular-tools/src/lib/components/dialogs/confirm-dialog/confirm-dialog.component.ts","../../../projects/osumi-angular-tools/src/lib/components/dialogs/confirm-dialog/confirm-dialog.component.html","../../../projects/osumi-angular-tools/src/lib/components/dialogs/form-dialog/form-dialog.component.ts","../../../projects/osumi-angular-tools/src/lib/components/dialogs/form-dialog/form-dialog.component.html","../../../projects/osumi-angular-tools/src/lib/model/custom-overlay-ref.model.ts","../../../projects/osumi-angular-tools/src/lib/components/overlay/overlay.component.ts","../../../projects/osumi-angular-tools/src/lib/components/overlay/overlay.component.html","../../../projects/osumi-angular-tools/src/lib/directives/swipe.directive.ts","../../../projects/osumi-angular-tools/src/lib/services/dialog.service.ts","../../../projects/osumi-angular-tools/src/lib/services/overlay.service.ts","../../../projects/osumi-angular-tools/src/public-api.ts","../../../projects/osumi-angular-tools/src/osumi-angular-tools.ts"],"sourcesContent":["import { Component, inject, signal, WritableSignal } from '@angular/core';\r\nimport { MatButton } from '@angular/material/button';\r\nimport {\r\n MatDialogActions,\r\n MatDialogContent,\r\n MatDialogRef,\r\n MatDialogTitle,\r\n} from '@angular/material/dialog';\r\n\r\n/**\r\n * Componente para mostrar un diálogo de alerta.\r\n *\r\n * Permite mostrar un mensaje de alerta con un título, contenido y un botón de confirmación personalizables.\r\n *\r\n * @returns Devuelve mediante un observable la notificación de cierre del diálogo.\r\n */\r\n@Component({\r\n selector: 'oat-alert-dialog',\r\n templateUrl: './alert-dialog.component.html',\r\n imports: [MatDialogTitle, MatDialogContent, MatDialogActions, MatButton],\r\n})\r\nexport class AlertDialogComponent {\r\n public dialogRef: MatDialogRef<AlertDialogComponent> = inject(MatDialogRef);\r\n\r\n public title: WritableSignal<string> = signal<string>('');\r\n public content: WritableSignal<string> = signal<string>('');\r\n public ok: WritableSignal<string> = signal<string>('Continuar');\r\n}\r\n","<h1 mat-dialog-title>{{ title() }}</h1>\r\n<div mat-dialog-content>\r\n\t<p>{{ content() }}</p>\r\n</div>\r\n<div mat-dialog-actions\r\n\t align=\"end\">\r\n\t<button type=\"button\"\r\n\t\t\tmat-flat-button\r\n\t\t\tcolor=\"primary\"\r\n\t\t\t(click)=\"dialogRef.close(true)\">{{ ok() }}</button>\r\n</div>","import { NgClass } from '@angular/common';\r\nimport {\r\n Component,\r\n inject,\r\n signal,\r\n ViewEncapsulation,\r\n WritableSignal,\r\n} from '@angular/core';\r\nimport { MatButton } from '@angular/material/button';\r\nimport {\r\n MatDialogActions,\r\n MatDialogContent,\r\n MatDialogRef,\r\n MatDialogTitle,\r\n} from '@angular/material/dialog';\r\n\r\n/**\r\n * Componente para mostrar un diálogo de confirmación.\r\n *\r\n * Permite mostrar un mensaje de confirmación con un título, contenido y botones de confirmación y cancelar personalizables.\r\n *\r\n * @returns Devuelve mediante un observable la notificación de cierre del diálogo indicando si se ha confirmado o cancelado la acción.\r\n */\r\n@Component({\r\n selector: 'oat-confirm-dialog',\r\n templateUrl: './confirm-dialog.component.html',\r\n styleUrl: './confirm-dialog.component.scss',\r\n imports: [\r\n MatDialogTitle,\r\n MatDialogContent,\r\n MatDialogActions,\r\n MatButton,\r\n NgClass,\r\n ],\r\n encapsulation: ViewEncapsulation.None,\r\n})\r\nexport class ConfirmDialogComponent {\r\n public dialogRef: MatDialogRef<ConfirmDialogComponent> = inject(MatDialogRef);\r\n\r\n public title: WritableSignal<string> = signal<string>('');\r\n public content: WritableSignal<string> = signal<string>('');\r\n public warn: WritableSignal<boolean> = signal<boolean>(false);\r\n public ok: WritableSignal<string> = signal<string>('Continuar');\r\n public cancel: WritableSignal<string> = signal<string>('Cancelar');\r\n}\r\n","<h1 mat-dialog-title>{{ title() }}</h1>\r\n<div mat-dialog-content>\r\n\t<p>{{ content() }}</p>\r\n</div>\r\n<div mat-dialog-actions\r\n\t align=\"end\">\r\n\t<button type=\"button\"\r\n\t\t\tmat-button\r\n\t\t\t(click)=\"dialogRef.close(false)\">{{ cancel() }}</button>\r\n\t<button type=\"button\"\r\n\t\t\tmat-flat-button\r\n\t\t\t[ngClass]=\"{'dialogs-warn': warn()}\"\r\n\t\t\t(click)=\"dialogRef.close(true)\">{{ ok() }}</button>\r\n</div>","import {\r\n Component,\r\n inject,\r\n signal,\r\n ViewEncapsulation,\r\n WritableSignal,\r\n} from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { MatButton } from '@angular/material/button';\r\nimport {\r\n MatDialogActions,\r\n MatDialogClose,\r\n MatDialogContent,\r\n MatDialogRef,\r\n MatDialogTitle,\r\n} from '@angular/material/dialog';\r\nimport { MatFormField, MatHint, MatLabel } from '@angular/material/form-field';\r\nimport { MatInput } from '@angular/material/input';\r\nimport { DialogField } from '../../../interfaces/dialogs.interface';\r\n\r\n/**\r\n * Componente para mostrar un diálogo con un formulario.\r\n *\r\n * Permite mostrar un mensaje de confirmación con un título, contenido y y un formulario personalizable.\r\n *\r\n * @returns Devuelve mediante un observable la notificación de cierre del diálogo con los datos del formulario.\r\n */\r\n@Component({\r\n selector: 'oat-form-dialog',\r\n templateUrl: './form-dialog.component.html',\r\n styleUrl: './form-dialog.component.scss',\r\n imports: [\r\n FormsModule,\r\n MatDialogTitle,\r\n MatDialogContent,\r\n MatDialogActions,\r\n MatDialogClose,\r\n MatFormField,\r\n MatLabel,\r\n MatInput,\r\n MatHint,\r\n MatButton,\r\n ],\r\n encapsulation: ViewEncapsulation.None,\r\n})\r\nexport class FormDialogComponent {\r\n public dialogRef: MatDialogRef<FormDialogComponent> = inject(MatDialogRef);\r\n\r\n public title: WritableSignal<string> = signal<string>('');\r\n public content: WritableSignal<string> = signal<string>('');\r\n public fields: WritableSignal<DialogField[]> = signal<DialogField[]>([]);\r\n public ok: WritableSignal<string> = signal<string>('Continuar');\r\n public cancel: WritableSignal<string> = signal<string>('Cancelar');\r\n\r\n /**\r\n * Método para validar el formulario.\r\n * Comprueba si todos los campos requeridos tienen un valor no vacío.\r\n * @returns Devuelve true si el formulario es válido, false en caso contrario.\r\n */\r\n isFormValid(): boolean {\r\n return this.fields().every((field: DialogField): boolean => {\r\n return (\r\n !field.required || Boolean(field.value && field.value.trim() !== '')\r\n );\r\n });\r\n }\r\n}\r\n","<h1 mat-dialog-title>{{ title() }}</h1>\r\n<div mat-dialog-content>\r\n\t<p>{{ content() }}</p>\r\n\t@for (field of fields(); track field.title) {\r\n\t<p>\r\n\t\t<mat-form-field class=\"dialogs-full-width\">\r\n\t\t\t<mat-label>{{field.title}}</mat-label>\r\n\t\t\t<input matInput\r\n\t\t\t\t [type]=\"field.type\"\r\n\t\t\t\t [(ngModel)]=\"field.value\"\r\n\t\t\t\t [required]=\"field.required || false\">\r\n\t\t\t@if (field.hint) {\r\n\t\t\t<mat-hint>{{field.hint}}</mat-hint>\r\n\t\t\t}\r\n\t\t</mat-form-field>\r\n\t</p>\r\n\t}\r\n</div>\r\n<div mat-dialog-actions\r\n\t align=\"end\">\r\n\t<button type=\"button\"\r\n\t\t\tmat-button\r\n\t\t\t(click)=\"dialogRef.close()\">{{ cancel() }}</button>\r\n\t<button type=\"button\"\r\n\t\t\tmat-flat-button\r\n\t\t\tcolor=\"primary\"\r\n\t\t\t[mat-dialog-close]=\"fields()\"\r\n\t\t\t[disabled]=\"!isFormValid()\">{{ ok() }}</button>\r\n</div>","import { OverlayRef } from '@angular/cdk/overlay';\r\nimport { Type } from '@angular/core';\r\nimport { Subject } from 'rxjs';\r\nimport { OverlayCloseEvent } from '../interfaces/modals.interface';\r\n\r\n/**\r\n * Clase que representa una referencia a un overlay personalizado.\r\n *\r\n * Permite cerrar el overlay y notificar a los suscriptores sobre el evento de cierre.\r\n *\r\n * @template R Tipo de dato de respuesta.\r\n * @template T Tipo de dato pasado al modal.\r\n */\r\nexport class CustomOverlayRef<R = any, T = any> {\r\n afterClosed$ = new Subject<OverlayCloseEvent<R | null>>();\r\n\r\n constructor(\r\n public overlay: OverlayRef,\r\n public content: Type<any>,\r\n public data: T,\r\n public closeOnBackdropCLick: boolean = true\r\n ) {\r\n if (closeOnBackdropCLick) {\r\n overlay.backdropClick().subscribe({\r\n next: () => {\r\n this._close('backdropClick', null);\r\n },\r\n });\r\n }\r\n }\r\n\r\n close(data?: any): void {\r\n this._close('close', data!);\r\n }\r\n\r\n private _close(type: 'backdropClick' | 'close', data: R | null): void {\r\n this.overlay.dispose();\r\n this.afterClosed$.next({\r\n type,\r\n data,\r\n });\r\n\r\n this.afterClosed$.complete();\r\n }\r\n}\r\n","import { NgComponentOutlet } from '@angular/common';\r\nimport { Component, inject, OnInit, Renderer2, Type } from '@angular/core';\r\nimport { MatIconButton } from '@angular/material/button';\r\nimport { MatIcon } from '@angular/material/icon';\r\nimport { Modal } from '../../interfaces/modals.interface';\r\nimport { CustomOverlayRef } from '../../model/custom-overlay-ref.model';\r\n\r\n/**\r\n * Componente para mostrar un componente personalizado en una ventana modal.\r\n *\r\n * @returns Devuelve mediante un observable la notificación de cierre del modal.\r\n */\r\n@Component({\r\n selector: 'oat-overlay',\r\n templateUrl: './overlay.component.html',\r\n styleUrls: ['./overlay.component.scss'],\r\n imports: [MatIcon, MatIconButton, NgComponentOutlet],\r\n})\r\nexport class OverlayComponent implements OnInit {\r\n private customOverlayRef: CustomOverlayRef<any, Modal> =\r\n inject(CustomOverlayRef);\r\n private renderer: Renderer2 = inject(Renderer2);\r\n\r\n content: Type<any> = this.customOverlayRef.content;\r\n inputData: Modal = { modalTitle: '', modalColor: 'blue' };\r\n\r\n ngOnInit(): void {\r\n this.listenToEscKey();\r\n this.inputData = this.customOverlayRef.data;\r\n }\r\n\r\n private listenToEscKey(): void {\r\n this.renderer.listen('window', 'keyup', (event: KeyboardEvent): void => {\r\n if (event.key === 'Escape') {\r\n this.close();\r\n }\r\n });\r\n }\r\n\r\n close(): void {\r\n this.customOverlayRef.close(null);\r\n }\r\n}\r\n","<div [class]=\"'modal ' + (inputData.css ? inputData.css : '')\">\r\n\t<div [class]=\"'modal__header modal__header--' + inputData.modalColor\">\r\n\t\t<div class=\"title\">{{ inputData.modalTitle }}</div>\r\n\t\t@if (!inputData.hideCloseBtn) {\r\n\t\t<button mat-icon-button\r\n\t\t\t\tclass=\"btn-close\"\r\n\t\t\t\t(click)=\"close()\">\r\n\t\t\t<mat-icon>close</mat-icon>\r\n\t\t</button>\r\n\t\t}\r\n\t</div>\r\n\r\n\t<div [class]=\"'modal__content ' + inputData.contentCss\">\r\n\t\t<ng-container *ngComponentOutlet=\"content\"></ng-container>\r\n\t</div>\r\n</div>","import {\r\n Directive,\r\n ElementRef,\r\n inject,\r\n OnDestroy,\r\n output,\r\n OutputEmitterRef,\r\n Renderer2,\r\n} from '@angular/core';\r\nimport { SwipeData } from '../interfaces/swipe.interface';\r\n\r\n/**\r\n * Directiva para detectar gestos de deslizamiento (swipe) en un elemento.\r\n *\r\n * Permite detectar deslizamientos tanto en dispositivos táctiles como con ratón.\r\n *\r\n * @returns Devuelve un observable que emite los datos del deslizamiento (deltaX y deltaY).\r\n */\r\n@Directive({\r\n selector: '[oatSwipe]',\r\n standalone: true,\r\n host: {\r\n '(touchstart)': 'onTouchStart($event)',\r\n '(touchend)': 'onTouchEnd($event)',\r\n '(mousedown)': 'onMouseDown($event)',\r\n '(mouseup)': 'onMouseUp($event)',\r\n },\r\n})\r\nexport class SwipeDirective implements OnDestroy {\r\n private el: ElementRef = inject(ElementRef);\r\n private renderer: Renderer2 = inject(Renderer2);\r\n swipeEnd: OutputEmitterRef<SwipeData> = output<SwipeData>();\r\n\r\n private startX: number = 0;\r\n private startY: number = 0;\r\n\r\n private touchStartListener: () => void;\r\n private touchEndListener: () => void;\r\n private mouseDownListener: () => void;\r\n private mouseUpListener: () => void;\r\n\r\n constructor() {\r\n this.touchStartListener = this.renderer.listen(\r\n this.el.nativeElement,\r\n 'touchstart',\r\n (event: TouchEvent): void => this.onTouchStart(event)\r\n );\r\n this.touchEndListener = this.renderer.listen(\r\n this.el.nativeElement,\r\n 'touchend',\r\n (event: TouchEvent): void => this.onTouchEnd(event)\r\n );\r\n this.mouseDownListener = this.renderer.listen(\r\n this.el.nativeElement,\r\n 'mousedown',\r\n (event: MouseEvent): void => this.onMouseDown(event)\r\n );\r\n this.mouseUpListener = this.renderer.listen(\r\n this.el.nativeElement,\r\n 'mouseup',\r\n (event: MouseEvent): void => this.onMouseUp(event)\r\n );\r\n }\r\n\r\n onTouchStart(event: TouchEvent): void {\r\n this.startX = event.touches[0].clientX;\r\n this.startY = event.touches[0].clientY;\r\n }\r\n\r\n onTouchEnd(event: TouchEvent): void {\r\n const endX: number = event.changedTouches[0].clientX;\r\n const endY: number = event.changedTouches[0].clientY;\r\n const deltaX: number = endX - this.startX;\r\n const deltaY: number = endY - this.startY;\r\n\r\n this.swipeEnd.emit({ x: deltaX, y: deltaY });\r\n }\r\n\r\n onMouseDown(event: MouseEvent): void {\r\n this.startX = event.clientX;\r\n this.startY = event.clientY;\r\n }\r\n\r\n onMouseUp(event: MouseEvent): void {\r\n const endX: number = event.clientX;\r\n const endY: number = event.clientY;\r\n const deltaX: number = endX - this.startX;\r\n const deltaY: number = endY - this.startY;\r\n\r\n this.swipeEnd.emit({ x: deltaX, y: deltaY });\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.touchStartListener();\r\n this.touchEndListener();\r\n this.mouseDownListener();\r\n this.mouseUpListener();\r\n }\r\n}\r\n","import { inject, Injectable } from '@angular/core';\r\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\r\nimport { Observable } from 'rxjs';\r\nimport { AlertDialogComponent } from '../components/dialogs/alert-dialog/alert-dialog.component';\r\nimport { ConfirmDialogComponent } from '../components/dialogs/confirm-dialog/confirm-dialog.component';\r\nimport { FormDialogComponent } from '../components/dialogs/form-dialog/form-dialog.component';\r\nimport { DialogField, DialogOptions } from '../interfaces/dialogs.interface';\r\n\r\n/**\r\n * Servicio para manejar diálogos en la aplicación.\r\n *\r\n * Permite abrir diálogos de alerta, confirmación y formularios personalizados.\r\n *\r\n * Cada método devuelve un observable que emite el resultado del diálogo al cerrarse.\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class DialogService {\r\n private dialog: MatDialog = inject(MatDialog);\r\n\r\n /**\r\n * Método para mostrar un diálogo de alerta.\r\n * @param options Datos a mostrar en el diálogo, incluyendo título, contenido y texto del botón de confirmación (opcional).\r\n * @returns Devuelve un observable para notificar el cierre del diálogo.\r\n */\r\n public alert(options: DialogOptions): Observable<boolean> {\r\n const dialogRef: MatDialogRef<AlertDialogComponent> =\r\n this.dialog.open(AlertDialogComponent);\r\n\r\n dialogRef.componentInstance.title.set(options.title);\r\n dialogRef.componentInstance.content.set(options.content);\r\n if (options.ok !== undefined) {\r\n dialogRef.componentInstance.ok.set(options.ok);\r\n }\r\n\r\n return dialogRef.afterClosed();\r\n }\r\n\r\n /**\r\n * Método para mostrar un diálogo de confirmación.\r\n * @param options Datos a mostrar en el diálogo, incluyendo título, contenido, si es una advertencia (opcional) y textos para los botones de acción (opcionales).\r\n * @returns Devuelve un observable para notificar el cierre del diálogo con el valor true para diálogo aceptado y false para diálogo cancelado.\r\n */\r\n public confirm(options: DialogOptions): Observable<boolean> {\r\n const dialogRef: MatDialogRef<ConfirmDialogComponent> = this.dialog.open(\r\n ConfirmDialogComponent\r\n );\r\n\r\n dialogRef.componentInstance.title.set(options.title);\r\n dialogRef.componentInstance.content.set(options.content);\r\n if (options.warn !== undefined) {\r\n dialogRef.componentInstance.warn.set(options.warn);\r\n }\r\n if (options.ok !== undefined) {\r\n dialogRef.componentInstance.ok.set(options.ok);\r\n }\r\n if (options.cancel !== undefined) {\r\n dialogRef.componentInstance.cancel.set(options.cancel);\r\n }\r\n\r\n return dialogRef.afterClosed();\r\n }\r\n\r\n /**\r\n * Método para mostrar un diálogo con un formulario personalizado.\r\n * @param options Datos a mostrar en el diálogo, incluyendo título, campos a rellenar y textos para los botones de acción (opcionales).\r\n * @returns Devuelve un observable para notificar el cierre del diálogo con los valores introducidos en el formulario.\r\n */\r\n public form(options: DialogOptions): Observable<DialogField[]> {\r\n const dialogRef: MatDialogRef<FormDialogComponent> =\r\n this.dialog.open(FormDialogComponent);\r\n\r\n dialogRef.componentInstance.title.set(options.title);\r\n dialogRef.componentInstance.content.set(options.content);\r\n if (options.ok !== undefined) {\r\n dialogRef.componentInstance.ok.set(options.ok);\r\n }\r\n if (options.cancel !== undefined) {\r\n dialogRef.componentInstance.cancel.set(options.cancel);\r\n }\r\n if (options.fields !== undefined) {\r\n dialogRef.componentInstance.fields.set(options.fields);\r\n }\r\n\r\n return dialogRef.afterClosed();\r\n }\r\n}\r\n","import { Overlay, OverlayConfig } from '@angular/cdk/overlay';\r\nimport { ComponentPortal } from '@angular/cdk/portal';\r\nimport { inject, Injectable, Injector, Type } from '@angular/core';\r\nimport { OverlayComponent } from '../components/overlay/overlay.component';\r\nimport { Modal } from '../interfaces/modals.interface';\r\nimport { CustomOverlayRef } from '../model/custom-overlay-ref.model';\r\n\r\n/**\r\n * Servicio para manejar modales personalizados en la aplicación.\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class OverlayService {\r\n private overlay: Overlay = inject(Overlay);\r\n private injector: Injector = inject(Injector);\r\n\r\n /**\r\n * Método para abrir un componente personalizado en un modal.\r\n * @param content Componente a mostrar en el overlay.\r\n * @param data Datos a pasar al componente del overlay.\r\n * @param panelCssClasses Clases CSS adicionales para el panel del overlay (opcional).\r\n * @param closeOnBackdropCLick Indica si el overlay se cierra al hacer clic en el fondo (opcional, por defecto true).\r\n * @returns Devuelve una referencia personalizada del overlay.\r\n */\r\n open<R = any>(\r\n content: Type<any>,\r\n data: Modal,\r\n panelCssClasses: string[] = [],\r\n closeOnBackdropCLick: boolean = true\r\n ): CustomOverlayRef<R> {\r\n const _panelCssClasses: string[] = ['modals-panel'].concat(panelCssClasses);\r\n const config = new OverlayConfig({\r\n hasBackdrop: true,\r\n panelClass: _panelCssClasses,\r\n backdropClass: 'modals-background',\r\n width: '100%',\r\n height: '100%',\r\n });\r\n\r\n const overlayRef = this.overlay.create(config);\r\n\r\n const customOverlayRef = new CustomOverlayRef(\r\n overlayRef,\r\n content,\r\n data,\r\n closeOnBackdropCLick\r\n );\r\n const injector = this.createInjector(customOverlayRef, this.injector);\r\n overlayRef.attach(new ComponentPortal(OverlayComponent, null, injector));\r\n\r\n return customOverlayRef;\r\n }\r\n\r\n private createInjector(ref: CustomOverlayRef, inj: Injector): Injector {\r\n return Injector.create({\r\n providers: [{ provide: CustomOverlayRef, useValue: ref }],\r\n parent: inj,\r\n });\r\n }\r\n}\r\n","/*\r\n * Public API Surface of osumi-angular-tools\r\n */\r\nexport * from './lib/components/dialogs/alert-dialog/alert-dialog.component';\r\nexport * from './lib/components/dialogs/confirm-dialog/confirm-dialog.component';\r\nexport * from './lib/components/dialogs/form-dialog/form-dialog.component';\r\nexport * from './lib/components/overlay/overlay.component';\r\nexport * from './lib/directives/swipe.directive';\r\nexport * from './lib/interfaces/dialogs.interface';\r\nexport * from './lib/interfaces/modals.interface';\r\nexport * from './lib/interfaces/swipe.interface';\r\nexport * from './lib/model/custom-overlay-ref.model';\r\nexport * from './lib/services/dialog.service';\r\nexport * from './lib/services/overlay.service';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AASA;;;;;;AAMG;MAMU,oBAAoB,CAAA;AACxB,IAAA,SAAS,GAAuC,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AM,EAAA,CAAA;;2FACnB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACVlC;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"osumi-angular-tools.mjs","sources":["../../../projects/osumi-angular-tools/src/lib/components/dialogs/alert-dialog/alert-dialog.component.ts","../../../projects/osumi-angular-tools/src/lib/components/dialogs/alert-dialog/alert-dialog.component.html","../../../projects/osumi-angular-tools/src/lib/components/dialogs/confirm-dialog/confirm-dialog.component.ts","../../../projects/osumi-angular-tools/src/lib/components/dialogs/confirm-dialog/confirm-dialog.component.html","../../../projects/osumi-angular-tools/src/lib/components/dialogs/form-dialog/form-dialog.component.ts","../../../projects/osumi-angular-tools/src/lib/components/dialogs/form-dialog/form-dialog.component.html","../../../projects/osumi-angular-tools/src/lib/model/custom-overlay-ref.model.ts","../../../projects/osumi-angular-tools/src/lib/components/overlay/overlay.component.ts","../../../projects/osumi-angular-tools/src/lib/components/overlay/overlay.component.html","../../../projects/osumi-angular-tools/src/lib/directives/swipe.directive.ts","../../../projects/osumi-angular-tools/src/lib/services/dialog.service.ts","../../../projects/osumi-angular-tools/src/lib/services/overlay.service.ts","../../../projects/osumi-angular-tools/src/public-api.ts","../../../projects/osumi-angular-tools/src/osumi-angular-tools.ts"],"sourcesContent":["import { Component, inject, signal, WritableSignal } from '@angular/core';\r\nimport { MatButton } from '@angular/material/button';\r\nimport {\r\n MatDialogActions,\r\n MatDialogContent,\r\n MatDialogRef,\r\n MatDialogTitle,\r\n} from '@angular/material/dialog';\r\n\r\n/**\r\n * Componente para mostrar un diálogo de alerta.\r\n *\r\n * Permite mostrar un mensaje de alerta con un título, contenido y un botón de confirmación personalizables.\r\n *\r\n * @returns Devuelve mediante un observable la notificación de cierre del diálogo.\r\n */\r\n@Component({\r\n selector: 'oat-alert-dialog',\r\n templateUrl: './alert-dialog.component.html',\r\n imports: [MatDialogTitle, MatDialogContent, MatDialogActions, MatButton],\r\n})\r\nexport class AlertDialogComponent {\n public dialogRef: MatDialogRef<AlertDialogComponent> = inject(MatDialogRef);\n\n public title: WritableSignal<string> = signal<string>('');\n public content: WritableSignal<string> = signal<string>('');\n public ok: WritableSignal<string> = signal<string>('Continuar');\n\n public closeDialog: (result: boolean) => void = (result: boolean): void => {\n this.dialogRef.close(result);\n };\n\n close(result: boolean): void {\n this.closeDialog(result);\n }\n}\n","<h1 mat-dialog-title>{{ title() }}</h1>\r\n<div mat-dialog-content>\r\n\t<p>{{ content() }}</p>\r\n</div>\r\n<div mat-dialog-actions\r\n\t align=\"end\">\r\n\t<button type=\"button\"\n\t\t\tmat-flat-button\n\t\t\tcolor=\"primary\"\n\t\t\t(click)=\"close(true)\">{{ ok() }}</button>\n</div>\n","import { NgClass } from '@angular/common';\r\nimport {\r\n Component,\r\n inject,\r\n signal,\r\n ViewEncapsulation,\r\n WritableSignal,\r\n} from '@angular/core';\r\nimport { MatButton } from '@angular/material/button';\r\nimport {\r\n MatDialogActions,\r\n MatDialogContent,\r\n MatDialogRef,\r\n MatDialogTitle,\r\n} from '@angular/material/dialog';\r\n\r\n/**\r\n * Componente para mostrar un diálogo de confirmación.\r\n *\r\n * Permite mostrar un mensaje de confirmación con un título, contenido y botones de confirmación y cancelar personalizables.\r\n *\r\n * @returns Devuelve mediante un observable la notificación de cierre del diálogo indicando si se ha confirmado o cancelado la acción.\r\n */\r\n@Component({\r\n selector: 'oat-confirm-dialog',\r\n templateUrl: './confirm-dialog.component.html',\r\n styleUrl: './confirm-dialog.component.scss',\r\n imports: [\r\n MatDialogTitle,\r\n MatDialogContent,\r\n MatDialogActions,\r\n MatButton,\r\n NgClass,\r\n ],\r\n encapsulation: ViewEncapsulation.None,\r\n})\r\nexport class ConfirmDialogComponent {\n public dialogRef: MatDialogRef<ConfirmDialogComponent> = inject(MatDialogRef);\n\n public title: WritableSignal<string> = signal<string>('');\n public content: WritableSignal<string> = signal<string>('');\n public warn: WritableSignal<boolean> = signal<boolean>(false);\n public ok: WritableSignal<string> = signal<string>('Continuar');\n public cancel: WritableSignal<string> = signal<string>('Cancelar');\n\n public closeDialog: (result: boolean) => void = (result: boolean): void => {\n this.dialogRef.close(result);\n };\n\n close(result: boolean): void {\n this.closeDialog(result);\n }\n}\n","<h1 mat-dialog-title>{{ title() }}</h1>\r\n<div mat-dialog-content>\r\n\t<p>{{ content() }}</p>\r\n</div>\r\n<div mat-dialog-actions\r\n\t align=\"end\">\r\n\t<button type=\"button\"\n\t\t\tmat-button\n\t\t\t(click)=\"close(false)\">{{ cancel() }}</button>\n\t<button type=\"button\"\n\t\t\tmat-flat-button\n\t\t\t[ngClass]=\"{'dialogs-warn': warn()}\"\n\t\t\t(click)=\"close(true)\">{{ ok() }}</button>\n</div>\n","import {\r\n Component,\r\n inject,\r\n signal,\r\n ViewEncapsulation,\r\n WritableSignal,\r\n} from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { MatButton } from '@angular/material/button';\r\nimport {\r\n MatDialogActions,\n MatDialogContent,\n MatDialogRef,\n MatDialogTitle,\n} from '@angular/material/dialog';\nimport { MatFormField, MatHint, MatLabel } from '@angular/material/form-field';\r\nimport { MatInput } from '@angular/material/input';\r\nimport { DialogField } from '../../../interfaces/dialogs.interface';\r\n\r\n/**\r\n * Componente para mostrar un diálogo con un formulario.\r\n *\r\n * Permite mostrar un mensaje de confirmación con un título, contenido y y un formulario personalizable.\r\n *\r\n * @returns Devuelve mediante un observable la notificación de cierre del diálogo con los datos del formulario.\r\n */\r\n@Component({\r\n selector: 'oat-form-dialog',\r\n templateUrl: './form-dialog.component.html',\r\n styleUrl: './form-dialog.component.scss',\r\n imports: [\r\n FormsModule,\r\n MatDialogTitle,\n MatDialogContent,\n MatDialogActions,\n MatFormField,\n MatLabel,\r\n MatInput,\r\n MatHint,\r\n MatButton,\r\n ],\r\n encapsulation: ViewEncapsulation.None,\r\n})\r\nexport class FormDialogComponent {\n public dialogRef: MatDialogRef<FormDialogComponent> = inject(MatDialogRef);\n\n public title: WritableSignal<string> = signal<string>('');\n public content: WritableSignal<string> = signal<string>('');\n public fields: WritableSignal<DialogField[]> = signal<DialogField[]>([]);\n public ok: WritableSignal<string> = signal<string>('Continuar');\n public cancel: WritableSignal<string> = signal<string>('Cancelar');\n\n public closeDialog: (result?: DialogField[]) => void = (\n result?: DialogField[]\n ): void => {\n this.dialogRef.close(result);\n };\n\r\n /**\r\n * Método para validar el formulario.\r\n * Comprueba si todos los campos requeridos tienen un valor no vacío.\r\n * @returns Devuelve true si el formulario es válido, false en caso contrario.\r\n */\r\n isFormValid(): boolean {\n return this.fields().every((field: DialogField): boolean => {\n return (\n !field.required || Boolean(field.value && field.value.trim() !== '')\n );\n });\n }\n\n close(result?: DialogField[]): void {\n this.closeDialog(result);\n }\n}\n","<h1 mat-dialog-title>{{ title() }}</h1>\r\n<div mat-dialog-content>\r\n\t<p>{{ content() }}</p>\r\n\t@for (field of fields(); track field.title) {\r\n\t<p>\r\n\t\t<mat-form-field class=\"dialogs-full-width\">\r\n\t\t\t<mat-label>{{field.title}}</mat-label>\r\n\t\t\t<input matInput\r\n\t\t\t\t [type]=\"field.type\"\r\n\t\t\t\t [(ngModel)]=\"field.value\"\r\n\t\t\t\t [required]=\"field.required || false\">\r\n\t\t\t@if (field.hint) {\r\n\t\t\t<mat-hint>{{field.hint}}</mat-hint>\r\n\t\t\t}\r\n\t\t</mat-form-field>\r\n\t</p>\r\n\t}\r\n</div>\r\n<div mat-dialog-actions\r\n\t align=\"end\">\r\n\t<button type=\"button\"\n\t\t\tmat-button\n\t\t\t(click)=\"close()\">{{ cancel() }}</button>\n\t<button type=\"button\"\n\t\t\tmat-flat-button\n\t\t\tcolor=\"primary\"\n\t\t\t[disabled]=\"!isFormValid()\"\n\t\t\t(click)=\"close(fields())\">{{ ok() }}</button>\n</div>\n","import { OverlayRef } from '@angular/cdk/overlay';\nimport { Type } from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { OverlayCloseEvent } from '../interfaces/modals.interface';\n\ntype OverlayCloseAnimation = () => Promise<void>;\n\n/**\n * Clase que representa una referencia a un overlay personalizado.\n *\r\n * Permite cerrar el overlay y notificar a los suscriptores sobre el evento de cierre.\r\n *\r\n * @template R Tipo de dato de respuesta.\n * @template T Tipo de dato pasado al modal.\n */\nexport class CustomOverlayRef<R = unknown, T = unknown> {\n afterClosed$ = new Subject<OverlayCloseEvent<R | null>>();\n private closeAnimation: OverlayCloseAnimation | undefined;\n private closing: boolean = false;\n\n constructor(\n public overlay: OverlayRef,\n public content: Type<unknown>,\n public data: T,\n public closeOnBackdropCLick: boolean = true,\n public from?: HTMLElement,\n public animationDuration?: number\n ) {\n if (closeOnBackdropCLick) {\n overlay.backdropClick().subscribe({\n next: () => {\n void this._close('backdropClick', null);\n },\n });\n }\n }\n\n close(data?: R): void {\n void this._close('close', data ?? null);\n }\n\n registerCloseAnimation(closeAnimation: OverlayCloseAnimation): void {\n this.closeAnimation = closeAnimation;\n }\n\n private async _close(\n type: 'backdropClick' | 'close',\n data: R | null\n ): Promise<void> {\n if (this.closing) {\n return;\n }\n\n this.closing = true;\n\n if (this.closeAnimation !== undefined) {\n await this.closeAnimation();\n }\n\n this.overlay.dispose();\n this.afterClosed$.next({\n type,\n data,\r\n });\r\n\r\n this.afterClosed$.complete();\r\n }\r\n}\r\n","import { NgComponentOutlet } from '@angular/common';\nimport {\n AfterViewInit,\n Component,\n ElementRef,\n inject,\n OnInit,\n Renderer2,\n Signal,\n Type,\n viewChild,\n} from '@angular/core';\nimport { MatIconButton } from '@angular/material/button';\nimport { MatIcon } from '@angular/material/icon';\nimport { Modal } from '../../interfaces/modals.interface';\nimport { CustomOverlayRef } from '../../model/custom-overlay-ref.model';\n\nconst DEFAULT_OVERLAY_ANIMATION_DURATION: number = 220;\n\n/**\n * Componente para mostrar un componente personalizado en una ventana modal.\n *\n * @returns Devuelve mediante un observable la notificación de cierre del modal.\n */\n@Component({\n selector: 'oat-overlay',\n templateUrl: './overlay.component.html',\n styleUrls: ['./overlay.component.scss'],\n imports: [MatIcon, MatIconButton, NgComponentOutlet],\n})\nexport class OverlayComponent implements OnInit, AfterViewInit {\n private customOverlayRef: CustomOverlayRef<unknown, Modal> =\n inject(CustomOverlayRef);\n private renderer: Renderer2 = inject(Renderer2);\n private modal: Signal<ElementRef<HTMLElement>> = viewChild.required('modal');\n\n content: Type<unknown> = this.customOverlayRef.content;\n inputData: Modal = { modalTitle: '', modalColor: 'blue' };\n\n ngOnInit(): void {\n this.listenToEscKey();\n this.inputData = this.customOverlayRef.data;\n }\n\n ngAfterViewInit(): void {\n this.customOverlayRef.registerCloseAnimation((): Promise<void> => {\n return this.animateClose();\n });\n\n this.animateOpen();\n }\n\n private listenToEscKey(): void {\n this.renderer.listen('window', 'keyup', (event: KeyboardEvent): void => {\n if (event.key === 'Escape') {\n this.close();\n }\n });\n }\n\n close(): void {\n this.customOverlayRef.close(null);\n }\n\n private animateOpen(): void {\n const modal: HTMLElement = this.modal().nativeElement;\n const animationStart: Keyframe | null = this.getOriginKeyframe(modal);\n\n if (animationStart === null) {\n return;\n }\n\n modal.animate(\n [\n {\n ...animationStart,\n opacity: 0,\n },\n {\n transform: 'translate(0, 0) scale(1)',\n opacity: 1,\n },\n ],\n {\n duration: this.getAnimationDuration(),\n easing: 'cubic-bezier(0.2, 0, 0, 1)',\n }\n );\n }\n\n private animateClose(): Promise<void> {\n const modal: HTMLElement = this.modal().nativeElement;\n const animationEnd: Keyframe | null = this.getOriginKeyframe(modal);\n\n if (animationEnd === null) {\n return Promise.resolve();\n }\n\n modal.style.pointerEvents = 'none';\n\n const animation: Animation = modal.animate(\n [\n {\n transform: 'translate(0, 0) scale(1)',\n opacity: 1,\n },\n {\n ...animationEnd,\n opacity: 0,\n },\n ],\n {\n duration: this.getCloseAnimationDuration(),\n easing: 'cubic-bezier(0.4, 0, 1, 1)',\n fill: 'forwards',\n }\n );\n\n return new Promise((resolve: () => void): void => {\n animation.onfinish = (): void => {\n resolve();\n };\n animation.oncancel = (): void => {\n resolve();\n };\n });\n }\n\n private getOriginKeyframe(modal: HTMLElement): Keyframe | null {\n const from: HTMLElement | undefined = this.customOverlayRef.from;\n\n if (\n from === undefined ||\n !from.isConnected ||\n this.prefersReducedMotion() ||\n typeof modal.animate !== 'function'\n ) {\n return null;\n }\n\n const fromRect: DOMRect = from.getBoundingClientRect();\n const modalRect: DOMRect = modal.getBoundingClientRect();\n\n if (\n fromRect.width === 0 ||\n fromRect.height === 0 ||\n modalRect.width === 0 ||\n modalRect.height === 0\n ) {\n return null;\n }\n\n const fromCenterX: number = fromRect.left + fromRect.width / 2;\n const fromCenterY: number = fromRect.top + fromRect.height / 2;\n const modalCenterX: number = modalRect.left + modalRect.width / 2;\n const modalCenterY: number = modalRect.top + modalRect.height / 2;\n const translateX: number = fromCenterX - modalCenterX;\n const translateY: number = fromCenterY - modalCenterY;\n const scale: number = this.clamp(\n Math.min(\n fromRect.width / modalRect.width,\n fromRect.height / modalRect.height\n ),\n 0.12,\n 0.45\n );\n\n return {\n transform: `translate(${translateX}px, ${translateY}px) scale(${scale})`,\n transformOrigin: 'center center',\n };\n }\n\n private getAnimationDuration(): number {\n return this.clamp(\n this.customOverlayRef.animationDuration ??\n DEFAULT_OVERLAY_ANIMATION_DURATION,\n 0,\n 5000\n );\n }\n\n private getCloseAnimationDuration(): number {\n return Math.round(this.getAnimationDuration() * 0.82);\n }\n\n private prefersReducedMotion(): boolean {\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n }\n\n private clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n }\n}\n","<div #modal\n\t [class]=\"'modal ' + (inputData.css ? inputData.css : '')\">\n\t<div [class]=\"'modal__header modal__header--' + inputData.modalColor\">\r\n\t\t<div class=\"title\">{{ inputData.modalTitle }}</div>\r\n\t\t@if (!inputData.hideCloseBtn) {\r\n\t\t<button mat-icon-button\r\n\t\t\t\tclass=\"btn-close\"\r\n\t\t\t\t(click)=\"close()\">\r\n\t\t\t<mat-icon>close</mat-icon>\r\n\t\t</button>\r\n\t\t}\r\n\t</div>\r\n\r\n\t<div [class]=\"'modal__content ' + inputData.contentCss\">\r\n\t\t<ng-container *ngComponentOutlet=\"content\"></ng-container>\r\n\t</div>\r\n</div>\n","import {\r\n Directive,\r\n ElementRef,\r\n inject,\r\n OnDestroy,\r\n output,\r\n OutputEmitterRef,\r\n Renderer2,\r\n} from '@angular/core';\r\nimport { SwipeData } from '../interfaces/swipe.interface';\r\n\r\n/**\r\n * Directiva para detectar gestos de deslizamiento (swipe) en un elemento.\r\n *\r\n * Permite detectar deslizamientos tanto en dispositivos táctiles como con ratón.\r\n *\r\n * @returns Devuelve un observable que emite los datos del deslizamiento (deltaX y deltaY).\r\n */\r\n@Directive({\r\n selector: '[oatSwipe]',\r\n standalone: true,\r\n host: {\r\n '(touchstart)': 'onTouchStart($event)',\r\n '(touchend)': 'onTouchEnd($event)',\r\n '(mousedown)': 'onMouseDown($event)',\r\n '(mouseup)': 'onMouseUp($event)',\r\n },\r\n})\r\nexport class SwipeDirective implements OnDestroy {\r\n private el: ElementRef = inject(ElementRef);\r\n private renderer: Renderer2 = inject(Renderer2);\r\n swipeEnd: OutputEmitterRef<SwipeData> = output<SwipeData>();\r\n\r\n private startX: number = 0;\r\n private startY: number = 0;\r\n\r\n private touchStartListener: () => void;\r\n private touchEndListener: () => void;\r\n private mouseDownListener: () => void;\r\n private mouseUpListener: () => void;\r\n\r\n constructor() {\r\n this.touchStartListener = this.renderer.listen(\r\n this.el.nativeElement,\r\n 'touchstart',\r\n (event: TouchEvent): void => this.onTouchStart(event)\r\n );\r\n this.touchEndListener = this.renderer.listen(\r\n this.el.nativeElement,\r\n 'touchend',\r\n (event: TouchEvent): void => this.onTouchEnd(event)\r\n );\r\n this.mouseDownListener = this.renderer.listen(\r\n this.el.nativeElement,\r\n 'mousedown',\r\n (event: MouseEvent): void => this.onMouseDown(event)\r\n );\r\n this.mouseUpListener = this.renderer.listen(\r\n this.el.nativeElement,\r\n 'mouseup',\r\n (event: MouseEvent): void => this.onMouseUp(event)\r\n );\r\n }\r\n\r\n onTouchStart(event: TouchEvent): void {\r\n this.startX = event.touches[0].clientX;\r\n this.startY = event.touches[0].clientY;\r\n }\r\n\r\n onTouchEnd(event: TouchEvent): void {\r\n const endX: number = event.changedTouches[0].clientX;\r\n const endY: number = event.changedTouches[0].clientY;\r\n const deltaX: number = endX - this.startX;\r\n const deltaY: number = endY - this.startY;\r\n\r\n this.swipeEnd.emit({ x: deltaX, y: deltaY });\r\n }\r\n\r\n onMouseDown(event: MouseEvent): void {\r\n this.startX = event.clientX;\r\n this.startY = event.clientY;\r\n }\r\n\r\n onMouseUp(event: MouseEvent): void {\r\n const endX: number = event.clientX;\r\n const endY: number = event.clientY;\r\n const deltaX: number = endX - this.startX;\r\n const deltaY: number = endY - this.startY;\r\n\r\n this.swipeEnd.emit({ x: deltaX, y: deltaY });\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.touchStartListener();\r\n this.touchEndListener();\r\n this.mouseDownListener();\r\n this.mouseUpListener();\r\n }\r\n}\r\n","import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { inject, Injectable, PLATFORM_ID, Type } from '@angular/core';\nimport { MatDialog, MatDialogConfig, MatDialogRef } from '@angular/material/dialog';\nimport { Observable } from 'rxjs';\nimport { AlertDialogComponent } from '../components/dialogs/alert-dialog/alert-dialog.component';\nimport { ConfirmDialogComponent } from '../components/dialogs/confirm-dialog/confirm-dialog.component';\nimport { FormDialogComponent } from '../components/dialogs/form-dialog/form-dialog.component';\nimport { DialogField, DialogOptions } from '../interfaces/dialogs.interface';\n\ntype DialogResult = boolean | DialogField[] | undefined;\nconst DEFAULT_DIALOG_ANIMATION_DURATION: number = 220;\n\n/**\n * Servicio para manejar diálogos en la aplicación.\n *\n * Permite abrir diálogos de alerta, confirmación y formularios personalizados.\n *\n * Cada método devuelve un observable que emite el resultado del diálogo al cerrarse.\n */\n@Injectable({ providedIn: 'root' })\nexport class DialogService {\n private dialog: MatDialog = inject(MatDialog);\n private document: Document = inject(DOCUMENT);\n private platformId: object = inject(PLATFORM_ID);\n\n private static dialogId: number = 0;\n\n /**\n * Método para mostrar un diálogo de alerta.\n * @param options Datos a mostrar en el diálogo, incluyendo título, contenido y texto del botón de confirmación (opcional).\n * @returns Devuelve un observable para notificar el cierre del diálogo.\n */\n public alert(options: DialogOptions): Observable<boolean> {\n const dialogRef: MatDialogRef<AlertDialogComponent> = this.openDialog(\n AlertDialogComponent,\n options,\n );\n\n dialogRef.componentInstance.title.set(options.title);\n dialogRef.componentInstance.content.set(options.content);\n if (options.ok !== undefined) {\n dialogRef.componentInstance.ok.set(options.ok);\n }\n\n return dialogRef.afterClosed();\n }\n\n /**\n * Método para mostrar un diálogo de confirmación.\n * @param options Datos a mostrar en el diálogo, incluyendo título, contenido, si es una advertencia (opcional) y textos para los botones de acción (opcionales).\n * @returns Devuelve un observable para notificar el cierre del diálogo con el valor true para diálogo aceptado y false para diálogo cancelado.\n */\n public confirm(options: DialogOptions): Observable<boolean> {\n const dialogRef: MatDialogRef<ConfirmDialogComponent> = this.openDialog(\n ConfirmDialogComponent,\n options,\n );\n\n dialogRef.componentInstance.title.set(options.title);\n dialogRef.componentInstance.content.set(options.content);\n if (options.warn !== undefined) {\n dialogRef.componentInstance.warn.set(options.warn);\n }\n if (options.ok !== undefined) {\n dialogRef.componentInstance.ok.set(options.ok);\n }\n if (options.cancel !== undefined) {\n dialogRef.componentInstance.cancel.set(options.cancel);\n }\n\n return dialogRef.afterClosed();\n }\n\n /**\n * Método para mostrar un diálogo con un formulario personalizado.\n * @param options Datos a mostrar en el diálogo, incluyendo título, campos a rellenar y textos para los botones de acción (opcionales).\n * @returns Devuelve un observable para notificar el cierre del diálogo con los valores introducidos en el formulario.\n */\n public form(options: DialogOptions): Observable<DialogField[]> {\n const dialogRef: MatDialogRef<FormDialogComponent> = this.openDialog(\n FormDialogComponent,\n options,\n );\n\n dialogRef.componentInstance.title.set(options.title);\n dialogRef.componentInstance.content.set(options.content);\n if (options.ok !== undefined) {\n dialogRef.componentInstance.ok.set(options.ok);\n }\n if (options.cancel !== undefined) {\n dialogRef.componentInstance.cancel.set(options.cancel);\n }\n if (options.fields !== undefined) {\n dialogRef.componentInstance.fields.set(options.fields);\n }\n\n return dialogRef.afterClosed();\n }\n\n private openDialog<TComponent>(\n component: Type<TComponent>,\n options: DialogOptions,\n ): MatDialogRef<TComponent> {\n const panelClass: string | undefined =\n options.from !== undefined ? this.getPanelClass() : undefined;\n const dialogConfig: MatDialogConfig = {};\n\n if (panelClass !== undefined) {\n dialogConfig.panelClass = panelClass;\n dialogConfig.disableClose = true;\n dialogConfig.enterAnimationDuration = '0ms';\n dialogConfig.exitAnimationDuration = '0ms';\n }\n\n const dialogRef: MatDialogRef<TComponent> = this.dialog.open(component, dialogConfig);\n\n const animationDuration: number = this.getAnimationDuration(options);\n\n this.configureDialogClose(dialogRef, panelClass, options.from, animationDuration);\n\n if (panelClass !== undefined && options.from !== undefined) {\n this.prepareDialogOpen(panelClass);\n this.animateDialogOpen(panelClass, options.from, animationDuration);\n }\n\n return dialogRef;\n }\n\n private configureDialogClose<TComponent>(\n dialogRef: MatDialogRef<TComponent>,\n panelClass: string | undefined,\n from: HTMLElement | undefined,\n animationDuration: number,\n ): void {\n let closing: boolean = false;\n const closeDialog = (result?: DialogResult): void => {\n if (closing) {\n return;\n }\n\n closing = true;\n void this.closeDialog(dialogRef, panelClass, from, animationDuration, result);\n };\n\n (\n dialogRef.componentInstance as TComponent & {\n closeDialog?: (result?: DialogResult) => void;\n }\n ).closeDialog = closeDialog;\n\n if (panelClass === undefined || from === undefined) {\n return;\n }\n\n dialogRef.backdropClick().subscribe({\n next: (): void => {\n closeDialog();\n },\n });\n\n dialogRef.keydownEvents().subscribe({\n next: (event: KeyboardEvent): void => {\n if (event.key === 'Escape') {\n closeDialog();\n }\n },\n });\n }\n\n private getPanelClass(): string {\n DialogService.dialogId++;\n return `oat-dialog-from-${DialogService.dialogId}`;\n }\n\n private animateDialogOpen(\n panelClass: string,\n from: HTMLElement,\n animationDuration: number,\n ): void {\n this.runAfterRender((): void => {\n const panel: HTMLElement | null = this.getPanel(panelClass);\n const animationStart: Keyframe | null = this.getOriginKeyframe(panel, from);\n\n if (panel === null || animationStart === null) {\n if (panel !== null) {\n panel.style.opacity = '';\n }\n return;\n }\n\n const animation: Animation = panel.animate(\n [\n {\n ...animationStart,\n opacity: 0,\n },\n {\n transform: 'translate(0, 0) scale(1)',\n opacity: 1,\n },\n ],\n {\n duration: animationDuration,\n easing: 'cubic-bezier(0.2, 0, 0, 1)',\n },\n );\n\n animation.onfinish = (): void => {\n panel.style.opacity = '';\n };\n animation.oncancel = (): void => {\n panel.style.opacity = '';\n };\n });\n }\n\n private prepareDialogOpen(panelClass: string): void {\n if (!this.canAnimate()) {\n return;\n }\n\n const panel: HTMLElement | null = this.getPanel(panelClass);\n\n if (panel !== null) {\n panel.style.opacity = '0';\n }\n }\n\n private async closeDialog<TComponent>(\n dialogRef: MatDialogRef<TComponent>,\n panelClass: string | undefined,\n from: HTMLElement | undefined,\n animationDuration: number,\n result?: DialogResult,\n ): Promise<void> {\n if (panelClass === undefined || from === undefined) {\n dialogRef.close(result);\n return;\n }\n\n const panel: HTMLElement | null = this.getPanel(panelClass);\n const animationEnd: Keyframe | null = this.getOriginKeyframe(panel, from);\n\n if (panel === null || animationEnd === null) {\n dialogRef.close(result);\n return;\n }\n\n await this.animatePanelClose(\n panel,\n animationEnd,\n this.getCloseAnimationDuration(animationDuration),\n );\n dialogRef.close(result);\n }\n\n private animatePanelClose(\n panel: HTMLElement,\n animationEnd: Keyframe,\n animationDuration: number,\n ): Promise<void> {\n panel.style.pointerEvents = 'none';\n\n const animation: Animation = panel.animate(\n [\n {\n transform: 'translate(0, 0) scale(1)',\n opacity: 1,\n },\n {\n ...animationEnd,\n opacity: 0,\n },\n ],\n {\n duration: animationDuration,\n easing: 'cubic-bezier(0.4, 0, 1, 1)',\n fill: 'forwards',\n },\n );\n\n return new Promise((resolve: () => void): void => {\n animation.onfinish = (): void => {\n resolve();\n };\n animation.oncancel = (): void => {\n resolve();\n };\n });\n }\n\n private getOriginKeyframe(panel: HTMLElement | null, from: HTMLElement): Keyframe | null {\n if (\n panel === null ||\n !this.canAnimate() ||\n !from.isConnected ||\n typeof panel.animate !== 'function'\n ) {\n return null;\n }\n\n const fromRect: DOMRect = from.getBoundingClientRect();\n const panelRect: DOMRect = panel.getBoundingClientRect();\n\n if (\n fromRect.width === 0 ||\n fromRect.height === 0 ||\n panelRect.width === 0 ||\n panelRect.height === 0\n ) {\n return null;\n }\n\n const fromCenterX: number = fromRect.left + fromRect.width / 2;\n const fromCenterY: number = fromRect.top + fromRect.height / 2;\n const panelCenterX: number = panelRect.left + panelRect.width / 2;\n const panelCenterY: number = panelRect.top + panelRect.height / 2;\n const translateX: number = fromCenterX - panelCenterX;\n const translateY: number = fromCenterY - panelCenterY;\n const scale: number = this.clamp(\n Math.min(fromRect.width / panelRect.width, fromRect.height / panelRect.height),\n 0.12,\n 0.45,\n );\n\n return {\n transform: `translate(${translateX}px, ${translateY}px) scale(${scale})`,\n transformOrigin: 'center center',\n };\n }\n\n private getPanel(panelClass: string): HTMLElement | null {\n if (!isPlatformBrowser(this.platformId)) {\n return null;\n }\n\n return this.document.querySelector<HTMLElement>(`.${panelClass}`);\n }\n\n private canAnimate(): boolean {\n if (!isPlatformBrowser(this.platformId)) {\n return false;\n }\n\n const defaultView: Window | null = this.document.defaultView;\n\n return (\n defaultView !== null && !defaultView.matchMedia('(prefers-reduced-motion: reduce)').matches\n );\n }\n\n private runAfterRender(callback: () => void): void {\n const defaultView: Window | null = this.document.defaultView;\n\n if (!isPlatformBrowser(this.platformId) || defaultView === null) {\n callback();\n return;\n }\n\n defaultView.requestAnimationFrame((): void => {\n defaultView.requestAnimationFrame(callback);\n });\n }\n\n private clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n }\n\n private getAnimationDuration(options: DialogOptions): number {\n return this.clamp(\n options.animationDuration ?? DEFAULT_DIALOG_ANIMATION_DURATION,\n 0,\n 5000,\n );\n }\n\n private getCloseAnimationDuration(animationDuration: number): number {\n return Math.round(animationDuration * 0.82);\n }\n}\n","import { Overlay, OverlayConfig } from '@angular/cdk/overlay';\r\nimport { ComponentPortal } from '@angular/cdk/portal';\r\nimport { inject, Injectable, Injector, Type } from '@angular/core';\r\nimport { OverlayComponent } from '../components/overlay/overlay.component';\r\nimport { Modal } from '../interfaces/modals.interface';\r\nimport { CustomOverlayRef } from '../model/custom-overlay-ref.model';\r\n\r\n/**\r\n * Servicio para manejar modales personalizados en la aplicación.\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class OverlayService {\n private overlay: Overlay = inject(Overlay);\n private injector: Injector = inject(Injector);\n\r\n /**\r\n * Método para abrir un componente personalizado en un modal.\r\n * @param content Componente a mostrar en el overlay.\r\n * @param data Datos a pasar al componente del overlay.\n * @param panelCssClasses Clases CSS adicionales para el panel del overlay (opcional).\n * @param closeOnBackdropCLick Indica si el overlay se cierra al hacer clic en el fondo (opcional, por defecto true).\n * @param from Elemento desde el que se anima la apertura y cierre del overlay (opcional).\n * @param animationDuration Duración de la animación en milisegundos (opcional).\n * @returns Devuelve una referencia personalizada del overlay.\n */\n open<R = unknown>(\n content: Type<unknown>,\n data: Modal,\n panelCssClasses: string[] = [],\n closeOnBackdropCLick: boolean = true,\n from?: HTMLElement,\n animationDuration?: number\n ): CustomOverlayRef<R> {\n const _panelCssClasses: string[] = ['modals-panel'].concat(panelCssClasses);\r\n const config = new OverlayConfig({\r\n hasBackdrop: true,\r\n panelClass: _panelCssClasses,\r\n backdropClass: 'modals-background',\r\n width: '100%',\r\n height: '100%',\r\n });\r\n\r\n const overlayRef = this.overlay.create(config);\r\n\r\n const customOverlayRef = new CustomOverlayRef<R, Modal>(\n overlayRef,\n content,\n data,\n closeOnBackdropCLick,\n from,\n animationDuration\n );\n const injector = this.createInjector(customOverlayRef, this.injector);\r\n overlayRef.attach(new ComponentPortal(OverlayComponent, null, injector));\r\n\r\n return customOverlayRef;\r\n }\r\n\r\n private createInjector<R>(\n ref: CustomOverlayRef<R, Modal>,\n inj: Injector\n ): Injector {\n return Injector.create({\r\n providers: [{ provide: CustomOverlayRef, useValue: ref }],\r\n parent: inj,\r\n });\r\n }\r\n}\r\n","/*\r\n * Public API Surface of osumi-angular-tools\r\n */\r\nexport * from './lib/components/dialogs/alert-dialog/alert-dialog.component';\r\nexport * from './lib/components/dialogs/confirm-dialog/confirm-dialog.component';\r\nexport * from './lib/components/dialogs/form-dialog/form-dialog.component';\r\nexport * from './lib/components/overlay/overlay.component';\r\nexport * from './lib/directives/swipe.directive';\r\nexport * from './lib/interfaces/dialogs.interface';\r\nexport * from './lib/interfaces/modals.interface';\r\nexport * from './lib/interfaces/swipe.interface';\r\nexport * from './lib/model/custom-overlay-ref.model';\r\nexport * from './lib/services/dialog.service';\r\nexport * from './lib/services/overlay.service';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AASA;;;;;;AAMG;MAMU,oBAAoB,CAAA;AACxB,IAAA,SAAS,GAAuC,MAAM,CAAC,YAAY,CAAC;AAEpE,IAAA,KAAK,GAA2B,MAAM,CAAS,EAAE,4EAAC;AAClD,IAAA,OAAO,GAA2B,MAAM,CAAS,EAAE,8EAAC;AACpD,IAAA,EAAE,GAA2B,MAAM,CAAS,WAAW,yEAAC;AAExD,IAAA,WAAW,GAA8B,CAAC,MAAe,KAAU;AACxE,QAAA,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC;AAC9B,IAAA,CAAC;AAED,IAAA,KAAK,CAAC,MAAe,EAAA;AACnB,QAAA,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC;IAC1B;wGAbW,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,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MAAM,CAAC,MAAM,CAAC;AAE9C,QAAA,MAAM,gBAAgB,GAAG,IAAI,gBAAgB,CAC3C,UAAU,EACV,OAAO,EACP,IAAI,EACJ,oBAAoB,EACpB,IAAI,EACJ,iBAAiB,CAClB;AACD,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,gBAAgB,EAAE,IAAI,CAAC,QAAQ,CAAC;AACrE,QAAA,UAAU,CAAC,MAAM,CAAC,IAAI,eAAe,CAAC,gBAAgB,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;AAExE,QAAA,OAAO,gBAAgB;IACzB;IAEQ,cAAc,CACpB,GAA+B,EAC/B,GAAa,EAAA;QAEb,OAAO,QAAQ,CAAC,MAAM,CAAC;YACrB,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;AACzD,YAAA,MAAM,EAAE,GAAG;AACZ,SAAA,CAAC;IACJ;wGAvDW,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAd,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,cADD,MAAM,EAAA,CAAA;;4FACnB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACVlC;;AAEG;;ACFH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osumi/angular-tools",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Tools to be used on Angular projects.",
|
|
5
5
|
"author": "Iñigo Gorosabel",
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
"module": "fesm2022/osumi-angular-tools.mjs",
|
|
13
13
|
"types": "index.d.ts",
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@angular/common": "^
|
|
16
|
-
"@angular/core": "^
|
|
17
|
-
"@angular/forms": "^
|
|
18
|
-
"@angular/material": "^
|
|
19
|
-
"@angular/cdk": "^
|
|
20
|
-
"@angular-devkit/schematics": "^
|
|
15
|
+
"@angular/common": "^21.0.0",
|
|
16
|
+
"@angular/core": "^21.0.0",
|
|
17
|
+
"@angular/forms": "^21.0.0",
|
|
18
|
+
"@angular/material": "^21.0.0",
|
|
19
|
+
"@angular/cdk": "^21.0.0",
|
|
20
|
+
"@angular-devkit/schematics": "^21.0.0",
|
|
21
21
|
"rxjs": "~7.8.2"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
@@ -32,14 +32,35 @@
|
|
|
32
32
|
"ng-update": {
|
|
33
33
|
"migrations": "./schematics/migrations/migrations.json"
|
|
34
34
|
},
|
|
35
|
-
"typings": "index.d.ts",
|
|
36
35
|
"exports": {
|
|
36
|
+
"./styles/dialogs.scss": {
|
|
37
|
+
"sass": "./styles/dialogs.scss",
|
|
38
|
+
"style": "./styles/dialogs.scss",
|
|
39
|
+
"default": "./styles/dialogs.scss"
|
|
40
|
+
},
|
|
41
|
+
"./styles/modals.scss": {
|
|
42
|
+
"sass": "./styles/modals.scss",
|
|
43
|
+
"style": "./styles/modals.scss",
|
|
44
|
+
"default": "./styles/modals.scss"
|
|
45
|
+
},
|
|
46
|
+
"./lib/styles/dialogs.scss": {
|
|
47
|
+
"sass": "./styles/dialogs.scss",
|
|
48
|
+
"style": "./styles/dialogs.scss",
|
|
49
|
+
"default": "./styles/dialogs.scss"
|
|
50
|
+
},
|
|
51
|
+
"./lib/styles/modals.scss": {
|
|
52
|
+
"sass": "./styles/modals.scss",
|
|
53
|
+
"style": "./styles/modals.scss",
|
|
54
|
+
"default": "./styles/modals.scss"
|
|
55
|
+
},
|
|
37
56
|
"./package.json": {
|
|
38
57
|
"default": "./package.json"
|
|
39
58
|
},
|
|
40
59
|
".": {
|
|
41
|
-
"types": "./
|
|
60
|
+
"types": "./types/osumi-angular-tools.d.ts",
|
|
42
61
|
"default": "./fesm2022/osumi-angular-tools.mjs"
|
|
43
62
|
}
|
|
44
|
-
}
|
|
63
|
+
},
|
|
64
|
+
"typings": "types/osumi-angular-tools.d.ts",
|
|
65
|
+
"type": "module"
|
|
45
66
|
}
|
|
@@ -65,6 +65,16 @@
|
|
|
65
65
|
"description": "Corrección en diálogos de tipo formulario",
|
|
66
66
|
"version": "1.2.3",
|
|
67
67
|
"factory": "./noop/index#noop"
|
|
68
|
+
},
|
|
69
|
+
"osumi-angular-tools-1-3-0": {
|
|
70
|
+
"description": "Actualización a Angular 21",
|
|
71
|
+
"version": "1.3.0",
|
|
72
|
+
"factory": "./noop/index#noop"
|
|
73
|
+
},
|
|
74
|
+
"osumi-angular-tools-1-4-0": {
|
|
75
|
+
"description": "Animaciones en diálogos",
|
|
76
|
+
"version": "1.4.0",
|
|
77
|
+
"factory": "./noop/index#noop"
|
|
68
78
|
}
|
|
69
79
|
}
|
|
70
80
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { WritableSignal, OnInit, Type, OnDestroy, OutputEmitterRef } from '@angular/core';
|
|
2
|
+
import { WritableSignal, OnInit, AfterViewInit, Type, OnDestroy, OutputEmitterRef } from '@angular/core';
|
|
3
3
|
import { MatDialogRef } from '@angular/material/dialog';
|
|
4
4
|
import { OverlayRef } from '@angular/cdk/overlay';
|
|
5
5
|
import { Subject, Observable } from 'rxjs';
|
|
@@ -16,6 +16,8 @@ declare class AlertDialogComponent {
|
|
|
16
16
|
title: WritableSignal<string>;
|
|
17
17
|
content: WritableSignal<string>;
|
|
18
18
|
ok: WritableSignal<string>;
|
|
19
|
+
closeDialog: (result: boolean) => void;
|
|
20
|
+
close(result: boolean): void;
|
|
19
21
|
static ɵfac: i0.ɵɵFactoryDeclaration<AlertDialogComponent, never>;
|
|
20
22
|
static ɵcmp: i0.ɵɵComponentDeclaration<AlertDialogComponent, "oat-alert-dialog", never, {}, {}, never, never, true, never>;
|
|
21
23
|
}
|
|
@@ -34,6 +36,8 @@ declare class ConfirmDialogComponent {
|
|
|
34
36
|
warn: WritableSignal<boolean>;
|
|
35
37
|
ok: WritableSignal<string>;
|
|
36
38
|
cancel: WritableSignal<string>;
|
|
39
|
+
closeDialog: (result: boolean) => void;
|
|
40
|
+
close(result: boolean): void;
|
|
37
41
|
static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmDialogComponent, never>;
|
|
38
42
|
static ɵcmp: i0.ɵɵComponentDeclaration<ConfirmDialogComponent, "oat-confirm-dialog", never, {}, {}, never, never, true, never>;
|
|
39
43
|
}
|
|
@@ -62,6 +66,8 @@ interface DialogOptions {
|
|
|
62
66
|
fields?: DialogField[] | undefined;
|
|
63
67
|
ok?: string | undefined;
|
|
64
68
|
cancel?: string | undefined;
|
|
69
|
+
from?: HTMLElement | undefined;
|
|
70
|
+
animationDuration?: number | undefined;
|
|
65
71
|
}
|
|
66
72
|
|
|
67
73
|
/**
|
|
@@ -78,12 +84,14 @@ declare class FormDialogComponent {
|
|
|
78
84
|
fields: WritableSignal<DialogField[]>;
|
|
79
85
|
ok: WritableSignal<string>;
|
|
80
86
|
cancel: WritableSignal<string>;
|
|
87
|
+
closeDialog: (result?: DialogField[]) => void;
|
|
81
88
|
/**
|
|
82
89
|
* Método para validar el formulario.
|
|
83
90
|
* Comprueba si todos los campos requeridos tienen un valor no vacío.
|
|
84
91
|
* @returns Devuelve true si el formulario es válido, false en caso contrario.
|
|
85
92
|
*/
|
|
86
93
|
isFormValid(): boolean;
|
|
94
|
+
close(result?: DialogField[]): void;
|
|
87
95
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormDialogComponent, never>;
|
|
88
96
|
static ɵcmp: i0.ɵɵComponentDeclaration<FormDialogComponent, "oat-form-dialog", never, {}, {}, never, never, true, never>;
|
|
89
97
|
}
|
|
@@ -115,14 +123,23 @@ interface OverlayCloseEvent<R> {
|
|
|
115
123
|
*
|
|
116
124
|
* @returns Devuelve mediante un observable la notificación de cierre del modal.
|
|
117
125
|
*/
|
|
118
|
-
declare class OverlayComponent implements OnInit {
|
|
126
|
+
declare class OverlayComponent implements OnInit, AfterViewInit {
|
|
119
127
|
private customOverlayRef;
|
|
120
128
|
private renderer;
|
|
121
|
-
|
|
129
|
+
private modal;
|
|
130
|
+
content: Type<unknown>;
|
|
122
131
|
inputData: Modal;
|
|
123
132
|
ngOnInit(): void;
|
|
133
|
+
ngAfterViewInit(): void;
|
|
124
134
|
private listenToEscKey;
|
|
125
135
|
close(): void;
|
|
136
|
+
private animateOpen;
|
|
137
|
+
private animateClose;
|
|
138
|
+
private getOriginKeyframe;
|
|
139
|
+
private getAnimationDuration;
|
|
140
|
+
private getCloseAnimationDuration;
|
|
141
|
+
private prefersReducedMotion;
|
|
142
|
+
private clamp;
|
|
126
143
|
static ɵfac: i0.ɵɵFactoryDeclaration<OverlayComponent, never>;
|
|
127
144
|
static ɵcmp: i0.ɵɵComponentDeclaration<OverlayComponent, "oat-overlay", never, {}, {}, never, never, true, never>;
|
|
128
145
|
}
|
|
@@ -162,6 +179,7 @@ declare class SwipeDirective implements OnDestroy {
|
|
|
162
179
|
static ɵdir: i0.ɵɵDirectiveDeclaration<SwipeDirective, "[oatSwipe]", never, {}, { "swipeEnd": "swipeEnd"; }, never, never, true, never>;
|
|
163
180
|
}
|
|
164
181
|
|
|
182
|
+
type OverlayCloseAnimation = () => Promise<void>;
|
|
165
183
|
/**
|
|
166
184
|
* Clase que representa una referencia a un overlay personalizado.
|
|
167
185
|
*
|
|
@@ -170,14 +188,19 @@ declare class SwipeDirective implements OnDestroy {
|
|
|
170
188
|
* @template R Tipo de dato de respuesta.
|
|
171
189
|
* @template T Tipo de dato pasado al modal.
|
|
172
190
|
*/
|
|
173
|
-
declare class CustomOverlayRef<R =
|
|
191
|
+
declare class CustomOverlayRef<R = unknown, T = unknown> {
|
|
174
192
|
overlay: OverlayRef;
|
|
175
|
-
content: Type<
|
|
193
|
+
content: Type<unknown>;
|
|
176
194
|
data: T;
|
|
177
195
|
closeOnBackdropCLick: boolean;
|
|
196
|
+
from?: HTMLElement | undefined;
|
|
197
|
+
animationDuration?: number | undefined;
|
|
178
198
|
afterClosed$: Subject<OverlayCloseEvent<R | null>>;
|
|
179
|
-
|
|
180
|
-
|
|
199
|
+
private closeAnimation;
|
|
200
|
+
private closing;
|
|
201
|
+
constructor(overlay: OverlayRef, content: Type<unknown>, data: T, closeOnBackdropCLick?: boolean, from?: HTMLElement | undefined, animationDuration?: number | undefined);
|
|
202
|
+
close(data?: R): void;
|
|
203
|
+
registerCloseAnimation(closeAnimation: OverlayCloseAnimation): void;
|
|
181
204
|
private _close;
|
|
182
205
|
}
|
|
183
206
|
|
|
@@ -190,6 +213,9 @@ declare class CustomOverlayRef<R = any, T = any> {
|
|
|
190
213
|
*/
|
|
191
214
|
declare class DialogService {
|
|
192
215
|
private dialog;
|
|
216
|
+
private document;
|
|
217
|
+
private platformId;
|
|
218
|
+
private static dialogId;
|
|
193
219
|
/**
|
|
194
220
|
* Método para mostrar un diálogo de alerta.
|
|
195
221
|
* @param options Datos a mostrar en el diálogo, incluyendo título, contenido y texto del botón de confirmación (opcional).
|
|
@@ -208,6 +234,20 @@ declare class DialogService {
|
|
|
208
234
|
* @returns Devuelve un observable para notificar el cierre del diálogo con los valores introducidos en el formulario.
|
|
209
235
|
*/
|
|
210
236
|
form(options: DialogOptions): Observable<DialogField[]>;
|
|
237
|
+
private openDialog;
|
|
238
|
+
private configureDialogClose;
|
|
239
|
+
private getPanelClass;
|
|
240
|
+
private animateDialogOpen;
|
|
241
|
+
private prepareDialogOpen;
|
|
242
|
+
private closeDialog;
|
|
243
|
+
private animatePanelClose;
|
|
244
|
+
private getOriginKeyframe;
|
|
245
|
+
private getPanel;
|
|
246
|
+
private canAnimate;
|
|
247
|
+
private runAfterRender;
|
|
248
|
+
private clamp;
|
|
249
|
+
private getAnimationDuration;
|
|
250
|
+
private getCloseAnimationDuration;
|
|
211
251
|
static ɵfac: i0.ɵɵFactoryDeclaration<DialogService, never>;
|
|
212
252
|
static ɵprov: i0.ɵɵInjectableDeclaration<DialogService>;
|
|
213
253
|
}
|
|
@@ -224,9 +264,11 @@ declare class OverlayService {
|
|
|
224
264
|
* @param data Datos a pasar al componente del overlay.
|
|
225
265
|
* @param panelCssClasses Clases CSS adicionales para el panel del overlay (opcional).
|
|
226
266
|
* @param closeOnBackdropCLick Indica si el overlay se cierra al hacer clic en el fondo (opcional, por defecto true).
|
|
267
|
+
* @param from Elemento desde el que se anima la apertura y cierre del overlay (opcional).
|
|
268
|
+
* @param animationDuration Duración de la animación en milisegundos (opcional).
|
|
227
269
|
* @returns Devuelve una referencia personalizada del overlay.
|
|
228
270
|
*/
|
|
229
|
-
open<R =
|
|
271
|
+
open<R = unknown>(content: Type<unknown>, data: Modal, panelCssClasses?: string[], closeOnBackdropCLick?: boolean, from?: HTMLElement, animationDuration?: number): CustomOverlayRef<R>;
|
|
230
272
|
private createInjector;
|
|
231
273
|
static ɵfac: i0.ɵɵFactoryDeclaration<OverlayService, never>;
|
|
232
274
|
static ɵprov: i0.ɵɵInjectableDeclaration<OverlayService>;
|