@osumi/angular-tools 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +115 -0
- package/esm2022/lib/components/dialogs/alert-dialog/alert-dialog.component.mjs +17 -0
- package/esm2022/lib/components/dialogs/confirm-dialog/confirm-dialog.component.mjs +18 -0
- package/esm2022/lib/components/dialogs/form-dialog/form-dialog.component.mjs +34 -0
- package/esm2022/lib/components/overlay/overlay.component.mjs +32 -0
- package/esm2022/lib/interfaces/dialogs.interface.mjs +2 -0
- package/esm2022/lib/interfaces/modals.interface.mjs +2 -0
- package/esm2022/lib/model/custom-overlay-ref.model.mjs +34 -0
- package/esm2022/lib/services/dialog.service.mjs +45 -0
- package/esm2022/lib/services/overlay.service.mjs +40 -0
- package/esm2022/osumi-angular-tools.mjs +5 -0
- package/esm2022/public-api.mjs +13 -0
- package/fesm2022/osumi-angular-tools.mjs +208 -0
- package/fesm2022/osumi-angular-tools.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/dialogs/alert-dialog/alert-dialog.component.d.ts +11 -0
- package/lib/components/dialogs/confirm-dialog/confirm-dialog.component.d.ts +12 -0
- package/lib/components/dialogs/form-dialog/form-dialog.component.d.ts +14 -0
- package/lib/components/overlay/overlay.component.d.ts +14 -0
- package/lib/interfaces/dialogs.interface.d.ts +13 -0
- package/lib/interfaces/modals.interface.d.ts +10 -0
- package/lib/model/custom-overlay-ref.model.d.ts +14 -0
- package/lib/services/dialog.service.d.ts +11 -0
- package/lib/services/overlay.service.d.ts +12 -0
- package/package.json +42 -0
- package/public-api.d.ts +9 -0
package/README.md
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
# Osumi Angular Tools
|
2
|
+
|
3
|
+
Librería de componentes y servicios reutilizables. En esta librería se incluyen las siguientes funcionalidades:
|
4
|
+
|
5
|
+
* `dialog`: Servicio para crear ventanas de diálogo (`alert`, `confirm` y `form`).
|
6
|
+
* `overlay`: Servicio para crear ventanas modales en las que cargar componentes personalizados.
|
7
|
+
|
8
|
+
NOTA: Para poder usar estos servicios es necesario usar `Angular 18.2+`, `Angular Material 18.2+`, `Angular CDK 18.2+` y `rxjs 7.8+`
|
9
|
+
|
10
|
+
**dialog**
|
11
|
+
|
12
|
+
Permite mostrar diálogos con mensajes personalizados:
|
13
|
+
|
14
|
+
**alert**
|
15
|
+
|
16
|
+
Muestra un diálogo con un título (`title`) y un texto (`content`) personalizado. También permite personalizar el texto del botón "Continuar" (`ok`).
|
17
|
+
|
18
|
+
```typescript
|
19
|
+
dialog: DialogService = inject(DialogService);
|
20
|
+
|
21
|
+
this.dialog.alert({
|
22
|
+
title: 'Datos guardados',
|
23
|
+
content:
|
24
|
+
'Los datos del cliente "' +
|
25
|
+
this.selectedClient.nombreApellidos +
|
26
|
+
'" han sido correctamente guardados.',
|
27
|
+
ok: 'Continuar',
|
28
|
+
});
|
29
|
+
```
|
30
|
+
|
31
|
+
**confirm**
|
32
|
+
|
33
|
+
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`).
|
34
|
+
|
35
|
+
```typescript
|
36
|
+
dialog: DialogService = inject(DialogService);
|
37
|
+
|
38
|
+
this.dialog.confirm({
|
39
|
+
title: 'Confirmar',
|
40
|
+
content:
|
41
|
+
'¿Estás seguro de querer borrar el cliente "' +
|
42
|
+
this.selectedClient.nombreApellidos +
|
43
|
+
'"?',
|
44
|
+
ok: 'Continuar',
|
45
|
+
cancel: 'Cancelar',
|
46
|
+
})
|
47
|
+
.subscribe((result) => {
|
48
|
+
if (result === true) {
|
49
|
+
this.confirmDeleteCliente();
|
50
|
+
}
|
51
|
+
});
|
52
|
+
```
|
53
|
+
|
54
|
+
**form**
|
55
|
+
|
56
|
+
Permite mostrar un diálogo con una serie de campos (`fields`), un pequeño formulario. Como en los casos anteriores se puede personalizar el título (`title`), el texto (`content`) y los botones "Continuar" (`ok`) y "Cancelar" (`cancel`).
|
57
|
+
|
58
|
+
```typescript
|
59
|
+
dialog: DialogService = inject(DialogService);
|
60
|
+
|
61
|
+
this.dialog.form({
|
62
|
+
title: 'Introducir email',
|
63
|
+
content: 'Introduce el email del cliente',
|
64
|
+
ok: 'Continuar',
|
65
|
+
cancel: 'Cancelar',
|
66
|
+
fields: [{ title: 'Email', type: 'email', value: null }],
|
67
|
+
})
|
68
|
+
.subscribe((result: DialogOptions): void => {
|
69
|
+
if (result !== undefined) {
|
70
|
+
this.sendTicket(this.historicoVentasSelected.id, result[0].value);
|
71
|
+
}
|
72
|
+
});
|
73
|
+
```
|
74
|
+
|
75
|
+
**overlay**
|
76
|
+
|
77
|
+
Permite mostrar ventanas modales con componentes personalizados. Estos componentes luego pueden pasar datos de vuelta. Se incluye la interfaz `Modal` que se puede extender con campos personalizados para pasar información al modal que se muestra.
|
78
|
+
|
79
|
+
```typescript
|
80
|
+
// Componente que abre un modal
|
81
|
+
export interface BuscadorModal extends Modal {
|
82
|
+
key: string;
|
83
|
+
}
|
84
|
+
|
85
|
+
os: OverlayService = inject(OverlayService);
|
86
|
+
|
87
|
+
const modalBuscadorData: BuscadorModal = {
|
88
|
+
modalTitle: 'Buscador',
|
89
|
+
modalColor: 'blue',
|
90
|
+
css: 'modal-wide',
|
91
|
+
key: ev.key,
|
92
|
+
};
|
93
|
+
const dialog = this.os.open(BuscadorModalComponent, modalBuscadorData); // BuscadorModalComponent sería el componente a mostrar en el modal
|
94
|
+
dialog.afterClosed$.subscribe((data): void => {
|
95
|
+
if (data.data !== null) {
|
96
|
+
console.log(data.data); // Resultado obtenido del modal
|
97
|
+
} else {
|
98
|
+
console.log('El modal se ha cerrado sin devolver datos.');
|
99
|
+
}
|
100
|
+
});
|
101
|
+
|
102
|
+
// Componente BuscadorModalComponent abierto en el modal
|
103
|
+
export default class BuscadorModalComponent implements OnInit {
|
104
|
+
private customOverlayRef: CustomOverlayRef<null, { key: string }> =
|
105
|
+
inject(CustomOverlayRef); // Referencia de la que obtener los datos pasados al modal y para pasarle datos de vuelta
|
106
|
+
|
107
|
+
ngOnInit(): void {
|
108
|
+
this.searchName = this.customOverlayRef.data.key; // Propiedad pasada al modal
|
109
|
+
}
|
110
|
+
|
111
|
+
selectBuscadorResultadosRow(row: ArticuloBuscador): void {
|
112
|
+
this.customOverlayRef.close(row.localizador); // Cerrar el modal devolviendo datos al componente padre
|
113
|
+
}
|
114
|
+
}
|
115
|
+
```
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { Component, inject, signal } from '@angular/core';
|
2
|
+
import { MatButton } from '@angular/material/button';
|
3
|
+
import { MatDialogActions, MatDialogContent, MatDialogRef, MatDialogTitle, } from '@angular/material/dialog';
|
4
|
+
import * as i0 from "@angular/core";
|
5
|
+
export default class AlertDialogComponent {
|
6
|
+
dialogRef = inject(MatDialogRef);
|
7
|
+
title = signal('');
|
8
|
+
content = signal('');
|
9
|
+
ok = signal('');
|
10
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: AlertDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
11
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.12", type: AlertDialogComponent, isStandalone: true, selector: "o-alert-dialog", ngImport: i0, template: "<h1 mat-dialog-title>{{ title() }}</h1>\n<div mat-dialog-content>\n\t<p [innerHtml]=\"content()\"></p>\n</div>\n<div mat-dialog-actions\n\t align=\"end\">\n\t<button type=\"button\"\n\t\t\tmat-flat-button\n\t\t\tcolor=\"primary\"\n\t\t\t(click)=\"dialogRef.close(true)\"\n\t\t\tcdkFocusInitial>{{ 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[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }] });
|
12
|
+
}
|
13
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: AlertDialogComponent, decorators: [{
|
14
|
+
type: Component,
|
15
|
+
args: [{ standalone: true, selector: 'o-alert-dialog', imports: [MatDialogTitle, MatDialogContent, MatDialogActions, MatButton], template: "<h1 mat-dialog-title>{{ title() }}</h1>\n<div mat-dialog-content>\n\t<p [innerHtml]=\"content()\"></p>\n</div>\n<div mat-dialog-actions\n\t align=\"end\">\n\t<button type=\"button\"\n\t\t\tmat-flat-button\n\t\t\tcolor=\"primary\"\n\t\t\t(click)=\"dialogRef.close(true)\"\n\t\t\tcdkFocusInitial>{{ ok() }}</button>\n</div>\n" }]
|
16
|
+
}] });
|
17
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWxlcnQtZGlhbG9nLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL29zdW1pLWFuZ3VsYXItdG9vbHMvc3JjL2xpYi9jb21wb25lbnRzL2RpYWxvZ3MvYWxlcnQtZGlhbG9nL2FsZXJ0LWRpYWxvZy5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9vc3VtaS1hbmd1bGFyLXRvb2xzL3NyYy9saWIvY29tcG9uZW50cy9kaWFsb2dzL2FsZXJ0LWRpYWxvZy9hbGVydC1kaWFsb2cuY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLEVBQUUsTUFBTSxFQUFrQixNQUFNLGVBQWUsQ0FBQztBQUMxRSxPQUFPLEVBQUUsU0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TwvYnV0dG9uPlxuPC9kaXY+XG4iXX0=
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { Component, inject, signal } from '@angular/core';
|
2
|
+
import { MatButton } from '@angular/material/button';
|
3
|
+
import { MatDialogActions, MatDialogContent, MatDialogRef, MatDialogTitle, } from '@angular/material/dialog';
|
4
|
+
import * as i0 from "@angular/core";
|
5
|
+
export default class ConfirmDialogComponent {
|
6
|
+
dialogRef = inject(MatDialogRef);
|
7
|
+
title = signal('');
|
8
|
+
content = signal('');
|
9
|
+
ok = signal('');
|
10
|
+
cancel = signal('');
|
11
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: ConfirmDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
12
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: ConfirmDialogComponent, isStandalone: true, selector: "o-confirm-dialog", ngImport: i0, template: "<h1 mat-dialog-title>{{ title() }}</h1>\n<div mat-dialog-content>\n\t<p>{{ content() }}</p>\n</div>\n<div mat-dialog-actions\n\t align=\"end\">\n\t@if (cancel() !== '') {\n\t<button type=\"button\"\n\t\t\tmat-button\n\t\t\t(click)=\"dialogRef.close()\">{{ cancel() }}</button>\n\t}\n\t<button type=\"button\"\n\t\t\tmat-flat-button\n\t\t\tcolor=\"primary\"\n\t\t\t(click)=\"dialogRef.close(true)\"\n\t\t\tcdkFocusInitial>{{ 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[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }] });
|
13
|
+
}
|
14
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: ConfirmDialogComponent, decorators: [{
|
15
|
+
type: Component,
|
16
|
+
args: [{ standalone: true, selector: 'o-confirm-dialog', imports: [MatDialogTitle, MatDialogContent, MatDialogActions, MatButton], template: "<h1 mat-dialog-title>{{ title() }}</h1>\n<div mat-dialog-content>\n\t<p>{{ content() }}</p>\n</div>\n<div mat-dialog-actions\n\t align=\"end\">\n\t@if (cancel() !== '') {\n\t<button type=\"button\"\n\t\t\tmat-button\n\t\t\t(click)=\"dialogRef.close()\">{{ cancel() }}</button>\n\t}\n\t<button type=\"button\"\n\t\t\tmat-flat-button\n\t\t\tcolor=\"primary\"\n\t\t\t(click)=\"dialogRef.close(true)\"\n\t\t\tcdkFocusInitial>{{ ok() }}</button>\n</div>\n" }]
|
17
|
+
}] });
|
18
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlybS1kaWFsb2cuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvb3N1bWktYW5ndWxhci10b29scy9zcmMvbGliL2NvbXBvbmVudHMvZGlhbG9ncy9jb25maXJtLWRpYWxvZy9jb25maXJtLWRpYWxvZy5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9vc3VtaS1hbmd1bGFyLXRvb2xzL3NyYy9saWIvY29tcG9uZW50cy9kaWFsb2dzL2NvbmZpcm0tZGlhbG9nL2NvbmZpcm0tZGlhbG9nLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxFQUFFLE1BQU0sRUFBa0IsTUFBTSxlQUFlLENBQU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kgIT09ICcnKSB7XG5cdDxidXR0b24gdHlwZT1cImJ1dHRvblwiXG5cdFx0XHRtYXQtYnV0dG9uXG5cdFx0XHQoY2xpY2spPVwiZGlhbG9nUmVmLmNsb3NlKClcIj57eyBjYW5jZWwoKSB9fTwvYnV0dG9uPlxuXHR9XG5cdDxidXR0b24gdHlwZT1cImJ1dHRvblwiXG5cdFx0XHRtYXQtZmxhdC1idXR0b25cblx0XHRcdGNvbG9yPVwicHJpbWFyeVwiXG5cdFx0XHQoY2xpY2spPVwiZGlhbG9nUmVmLmNsb3NlKHRydWUpXCJcblx0XHRcdGNka0ZvY3VzSW5pdGlhbD57eyBvaygpIH19PC9idXR0b24+XG48L2Rpdj5cbiJdfQ==
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { Component, inject, signal } from '@angular/core';
|
2
|
+
import { FormsModule } from '@angular/forms';
|
3
|
+
import { MatButton } from '@angular/material/button';
|
4
|
+
import { MatDialogActions, MatDialogClose, MatDialogContent, MatDialogRef, MatDialogTitle, } from '@angular/material/dialog';
|
5
|
+
import { MatFormField, MatHint, MatLabel } from '@angular/material/form-field';
|
6
|
+
import { MatInput } from '@angular/material/input';
|
7
|
+
import * as i0 from "@angular/core";
|
8
|
+
import * as i1 from "@angular/forms";
|
9
|
+
export default class FormDialogComponent {
|
10
|
+
dialogRef = inject(MatDialogRef);
|
11
|
+
title = signal('');
|
12
|
+
content = signal('');
|
13
|
+
fields = signal([]);
|
14
|
+
ok = signal('');
|
15
|
+
cancel = signal('');
|
16
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: FormDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
17
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: FormDialogComponent, isStandalone: true, selector: "o-form-dialog", ngImport: i0, template: "<h1 mat-dialog-title>{{ title() }}</h1>\n<div mat-dialog-content>\n\t<p class=\"margin-bottom\">{{ content() }}</p>\n\t@for (field of fields(); track field.title) {\n\t<div class=\"form-field margin-right\">\n\t\t<mat-form-field class=\"max-width\">\n\t\t\t<mat-label>{{field.title}}</mat-label>\n\t\t\t<input matInput\n\t\t\t\t [type]=\"field.type\"\n\t\t\t\t [(ngModel)]=\"field.value\">\n\t\t\t@if (field.hint) {\n\t\t\t<mat-hint>{{field.hint}}</mat-hint>\n\t\t\t}\n\t\t</mat-form-field>\n\t</div>\n\t}\n</div>\n<div mat-dialog-actions\n\t align=\"end\">\n\t@if (cancel() !== '') {\n\t<button type=\"button\"\n\t\t\tmat-button\n\t\t\t(click)=\"dialogRef.close()\">{{ cancel() }}</button>\n\t}\n\t<button type=\"button\"\n\t\t\tmat-flat-button\n\t\t\tcolor=\"primary\"\n\t\t\t[mat-dialog-close]=\"fields()\"\n\t\t\tcdkFocusInitial>{{ ok() }}</button>\n</div>\n", styles: [".margin-bottom{margin-bottom:16px}\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.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: "directive", type: MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { 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: MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { 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"], exportAs: ["matInput"] }, { kind: "component", type: MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }] });
|
18
|
+
}
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: FormDialogComponent, decorators: [{
|
20
|
+
type: Component,
|
21
|
+
args: [{ standalone: true, selector: 'o-form-dialog', imports: [
|
22
|
+
FormsModule,
|
23
|
+
MatDialogTitle,
|
24
|
+
MatDialogContent,
|
25
|
+
MatDialogActions,
|
26
|
+
MatDialogClose,
|
27
|
+
MatFormField,
|
28
|
+
MatLabel,
|
29
|
+
MatHint,
|
30
|
+
MatInput,
|
31
|
+
MatButton,
|
32
|
+
], template: "<h1 mat-dialog-title>{{ title() }}</h1>\n<div mat-dialog-content>\n\t<p class=\"margin-bottom\">{{ content() }}</p>\n\t@for (field of fields(); track field.title) {\n\t<div class=\"form-field margin-right\">\n\t\t<mat-form-field class=\"max-width\">\n\t\t\t<mat-label>{{field.title}}</mat-label>\n\t\t\t<input matInput\n\t\t\t\t [type]=\"field.type\"\n\t\t\t\t [(ngModel)]=\"field.value\">\n\t\t\t@if (field.hint) {\n\t\t\t<mat-hint>{{field.hint}}</mat-hint>\n\t\t\t}\n\t\t</mat-form-field>\n\t</div>\n\t}\n</div>\n<div mat-dialog-actions\n\t align=\"end\">\n\t@if (cancel() !== '') {\n\t<button type=\"button\"\n\t\t\tmat-button\n\t\t\t(click)=\"dialogRef.close()\">{{ cancel() }}</button>\n\t}\n\t<button type=\"button\"\n\t\t\tmat-flat-button\n\t\t\tcolor=\"primary\"\n\t\t\t[mat-dialog-close]=\"fields()\"\n\t\t\tcdkFocusInitial>{{ ok() }}</button>\n</div>\n", styles: [".margin-bottom{margin-bottom:16px}\n"] }]
|
33
|
+
}] });
|
34
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybS1kaWFsb2cuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvb3N1bWktYW5ndWxhci10b29scy9zcmMvbGliL2NvbXBvbmVudHMvZGlhbG9ncy9mb3JtLWRpYWxvZy9mb3JtLWRpYWxvZy5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9vc3VtaS1hbmd1bGFyLXRvb2xzL3NyYy9saWIvY29tcG9uZW50cy9kaWFsb2dzL2Zvcm0tZGlhbG9nL2Zvcm0tZGlhbG9nLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxFQUFFLE1BQU0sRUFBa0IsTUFBTSxlQUFlLENBQUM7QUFDMUUsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQzdDLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUNyRCxPQUFPLEVBQ0wsZ0JBQWdCLEVBQ2hCLGNBQWMsRUFDZCxnQkFBZ0IsRUFDaEIsWUFBWSxFQUNaLGNBQWMsR0FDZixNQUFNLDBCQUEwQixDQUFDO0FBQ2xDLE9BQU8sRUFBRSxZQUFZ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LWxhYmVsPlxuXHRcdFx0PGlucHV0IG1hdElucHV0XG5cdFx0XHRcdCAgIFt0eXBlXT1cImZpZWxkLnR5cGVcIlxuXHRcdFx0XHQgICBbKG5nTW9kZWwpXT1cImZpZWxkLnZhbHVlXCI+XG5cdFx0XHRAaWYgKGZpZWxkLmhpbnQpIHtcblx0XHRcdDxtYXQtaGludD57e2ZpZWxkLmhpbnR9fTwvbWF0LWhpbnQ+XG5cdFx0XHR9XG5cdFx0PC9tYXQtZm9ybS1maWVsZD5cblx0PC9kaXY+XG5cdH1cbjwvZGl2PlxuPGRpdiBtYXQtZGlhbG9nLWFjdGlvbnNcblx0IGFsaWduPVwiZW5kXCI+XG5cdEBpZiAoY2FuY2VsKCkgIT09ICcnKSB7XG5cdDxidXR0b24gdHlwZT1cImJ1dHRvblwiXG5cdFx0XHRtYXQtYnV0dG9uXG5cdFx0XHQoY2xpY2spPVwiZGlhbG9nUmVmLmNsb3NlKClcIj57eyBjYW5jZWwoKSB9fTwvYnV0dG9uPlxuXHR9XG5cdDxidXR0b24gdHlwZT1cImJ1dHRvblwiXG5cdFx0XHRtYXQtZmxhdC1idXR0b25cblx0XHRcdGNvbG9yPVwicHJpbWFyeVwiXG5cdFx0XHRbbWF0LWRpYWxvZy1jbG9zZV09XCJmaWVsZHMoKVwiXG5cdFx0XHRjZGtGb2N1c0luaXRpYWw+e3sgb2soKSB9fTwvYnV0dG9uPlxuPC9kaXY+XG4iXX0=
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { NgComponentOutlet } from '@angular/common';
|
2
|
+
import { Component, inject, Renderer2 } from '@angular/core';
|
3
|
+
import { MatIcon } from '@angular/material/icon';
|
4
|
+
import CustomOverlayRef from '../../model/custom-overlay-ref.model';
|
5
|
+
import * as i0 from "@angular/core";
|
6
|
+
export default class OverlayComponent {
|
7
|
+
customOverlayRef = inject(CustomOverlayRef);
|
8
|
+
renderer = inject(Renderer2);
|
9
|
+
content = this.customOverlayRef.content;
|
10
|
+
inputData = { modalTitle: '', modalColor: 'blue' };
|
11
|
+
ngOnInit() {
|
12
|
+
this.listenToEscKey();
|
13
|
+
this.inputData = this.customOverlayRef.data;
|
14
|
+
}
|
15
|
+
listenToEscKey() {
|
16
|
+
this.renderer.listen('window', 'keyup', (event) => {
|
17
|
+
if (event.key === 'Escape') {
|
18
|
+
this.close();
|
19
|
+
}
|
20
|
+
});
|
21
|
+
}
|
22
|
+
close() {
|
23
|
+
this.customOverlayRef.close(null);
|
24
|
+
}
|
25
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: OverlayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
26
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: OverlayComponent, isStandalone: true, selector: "o-overlay", ngImport: i0, template: "<div [class]=\"'modal ' + (inputData.css ? inputData.css : '')\">\n\t<div [class]=\"'modal__header modal__header--' + inputData.modalColor\">\n\t\t<div class=\"title\">{{ inputData.modalTitle }}</div>\n\t\t@if (!inputData.hideCloseBtn) {\n\t\t<div class=\"btn-close\"\n\t\t\t (click)=\"close()\">\n\t\t\t<mat-icon>close</mat-icon>\n\t\t</div>\n\t\t}\n\t</div>\n\n\t<div class=\"modal__content\">\n\t\t<ng-container *ngComponentOutlet=\"content\"></ng-container>\n\t</div>\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(--modal-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(--color-blue);color:#fff}.modal__header .btn-close{cursor:pointer}.modal__header--blue{background-color:var(--main-color)}.modal__header--yellow{background-color:var(--color-yellow);color:var(--color-black)}.modal__header--yellow>.btn-close{color:var(--color-black)}.modal__header--red{background-color:var(--color-red)}.modal__content{padding:20px;border-bottom-left-radius:6px;background-color:var(--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: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }] });
|
27
|
+
}
|
28
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: OverlayComponent, decorators: [{
|
29
|
+
type: Component,
|
30
|
+
args: [{ standalone: true, selector: 'o-overlay', imports: [MatIcon, NgComponentOutlet], template: "<div [class]=\"'modal ' + (inputData.css ? inputData.css : '')\">\n\t<div [class]=\"'modal__header modal__header--' + inputData.modalColor\">\n\t\t<div class=\"title\">{{ inputData.modalTitle }}</div>\n\t\t@if (!inputData.hideCloseBtn) {\n\t\t<div class=\"btn-close\"\n\t\t\t (click)=\"close()\">\n\t\t\t<mat-icon>close</mat-icon>\n\t\t</div>\n\t\t}\n\t</div>\n\n\t<div class=\"modal__content\">\n\t\t<ng-container *ngComponentOutlet=\"content\"></ng-container>\n\t</div>\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(--modal-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(--color-blue);color:#fff}.modal__header .btn-close{cursor:pointer}.modal__header--blue{background-color:var(--main-color)}.modal__header--yellow{background-color:var(--color-yellow);color:var(--color-black)}.modal__header--yellow>.btn-close{color:var(--color-black)}.modal__header--red{background-color:var(--color-red)}.modal__content{padding:20px;border-bottom-left-radius:6px;background-color:var(--color-white);border-bottom-right-radius:6px;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JmYWNlcy9kaWFsb2dzLmludGVyZmFjZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGludGVyZmFjZSBEaWFsb2dGaWVsZCB7XG4gIHRpdGxlOiBzdHJpbmc7XG4gIHR5cGU6IHN0cmluZztcbiAgdmFsdWU6IHN0cmluZztcbiAgaGludD86IHN0cmluZztcbn1cblxuZXhwb3J0IGludGVyZmFjZSBEaWFsb2dPcHRpb25zIHtcbiAgdGl0bGU6IHN0cmluZztcbiAgY29udGVudDogc3RyaW5nO1xuICBmaWVsZHM/OiBEaWFsb2dGaWVsZFtdO1xuICBvazogc3RyaW5nO1xuICBjYW5jZWw/OiBzdHJpbmc7XG59XG4iXX0=
|
@@ -0,0 +1,2 @@
|
|
1
|
+
export {};
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9kYWxzLmludGVyZmFjZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL29zdW1pLWFuZ3VsYXItdG9vbHMvc3JjL2xpYi9pbnRlcmZhY2VzL21vZGFscy5pbnRlcmZhY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBpbnRlcmZhY2UgTW9kYWwge1xuICBtb2RhbENvbG9yOiAnYmx1ZScgfCAneWVsbG93JyB8ICdyZWQnO1xuICBtb2RhbFRpdGxlOiBzdHJpbmc7XG4gIGNzcz86IHN0cmluZztcbiAgaGlkZUNsb3NlQnRuPzogYm9vbGVhbjtcbn1cblxuZXhwb3J0IGludGVyZmFjZSBPdmVybGF5Q2xvc2VFdmVudDxSPiB7XG4gIHR5cGU6IFwiYmFja2Ryb3BDbGlja1wiIHwgXCJjbG9zZVwiO1xuICBkYXRhOiBSO1xufVxuIl19
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { Subject } from "rxjs";
|
2
|
+
// R = Response Data Type, T = Data passed to Modal Type
|
3
|
+
export default class CustomOverlayRef {
|
4
|
+
overlay;
|
5
|
+
content;
|
6
|
+
data;
|
7
|
+
closeOnBackdropCLick;
|
8
|
+
afterClosed$ = new Subject();
|
9
|
+
constructor(overlay, content, data, closeOnBackdropCLick = true) {
|
10
|
+
this.overlay = overlay;
|
11
|
+
this.content = content;
|
12
|
+
this.data = data;
|
13
|
+
this.closeOnBackdropCLick = closeOnBackdropCLick;
|
14
|
+
if (closeOnBackdropCLick) {
|
15
|
+
overlay.backdropClick().subscribe({
|
16
|
+
next: () => {
|
17
|
+
this._close("backdropClick", null);
|
18
|
+
},
|
19
|
+
});
|
20
|
+
}
|
21
|
+
}
|
22
|
+
close(data) {
|
23
|
+
this._close("close", data);
|
24
|
+
}
|
25
|
+
_close(type, data) {
|
26
|
+
this.overlay.dispose();
|
27
|
+
this.afterClosed$.next({
|
28
|
+
type,
|
29
|
+
data,
|
30
|
+
});
|
31
|
+
this.afterClosed$.complete();
|
32
|
+
}
|
33
|
+
}
|
34
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3VzdG9tLW92ZXJsYXktcmVmLm1vZGVsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvb3N1bWktYW5ndWxhci10b29scy9zcmMvbGliL21vZGVsL2N1c3RvbS1vdmVybGF5LXJlZi5tb2RlbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSxPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0sTUFBTSxDQUFDO0FBRy9CLHdEQUF3RDtBQUN4RCxNQUFNLENBQUMsT0FBTyxPQUFPLGdCQUFnQjtJQUkxQjtJQUNBO0lBQ0E7SUFDQTtJQU5ULFlBQVksR0FBRyxJQUFJLE9BQU8sRUFBK0IsQ0F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QubmV4dCh7XG4gICAgICB0eXBlLFxuICAgICAgZGF0YSxcbiAgICB9KTtcblxuICAgIHRoaXMuYWZ0ZXJDbG9zZWQkLmNvbXBsZXRlKCk7XG4gIH1cbn1cbiJdfQ==
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import { inject, Injectable } from '@angular/core';
|
2
|
+
import { MatDialog } from '@angular/material/dialog';
|
3
|
+
import AlertDialogComponent from '../components/dialogs/alert-dialog/alert-dialog.component';
|
4
|
+
import ConfirmDialogComponent from '../components/dialogs/confirm-dialog/confirm-dialog.component';
|
5
|
+
import FormDialogComponent from '../components/dialogs/form-dialog/form-dialog.component';
|
6
|
+
import * as i0 from "@angular/core";
|
7
|
+
export default class DialogService {
|
8
|
+
dialog = inject(MatDialog);
|
9
|
+
confirm(options) {
|
10
|
+
const dialogRef = this.dialog.open(ConfirmDialogComponent);
|
11
|
+
dialogRef.componentInstance.title.set(options.title);
|
12
|
+
dialogRef.componentInstance.content.set(options.content);
|
13
|
+
dialogRef.componentInstance.ok.set(options.ok);
|
14
|
+
if (options.cancel !== undefined) {
|
15
|
+
dialogRef.componentInstance.cancel.set(options.cancel);
|
16
|
+
}
|
17
|
+
return dialogRef.afterClosed();
|
18
|
+
}
|
19
|
+
alert(options) {
|
20
|
+
const dialogRef = this.dialog.open(AlertDialogComponent);
|
21
|
+
dialogRef.componentInstance.title.set(options.title);
|
22
|
+
dialogRef.componentInstance.content.set(options.content);
|
23
|
+
dialogRef.componentInstance.ok.set(options.ok);
|
24
|
+
return dialogRef.afterClosed();
|
25
|
+
}
|
26
|
+
form(options) {
|
27
|
+
const dialogRef = this.dialog.open(FormDialogComponent);
|
28
|
+
dialogRef.componentInstance.title.set(options.title);
|
29
|
+
dialogRef.componentInstance.content.set(options.content);
|
30
|
+
dialogRef.componentInstance.ok.set(options.ok);
|
31
|
+
if (options.cancel !== undefined) {
|
32
|
+
dialogRef.componentInstance.cancel.set(options.cancel);
|
33
|
+
}
|
34
|
+
if (options.fields !== undefined) {
|
35
|
+
dialogRef.componentInstance.fields.set(options.fields);
|
36
|
+
}
|
37
|
+
return dialogRef.afterClosed();
|
38
|
+
}
|
39
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: DialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
40
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: DialogService });
|
41
|
+
}
|
42
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: DialogService, decorators: [{
|
43
|
+
type: Injectable
|
44
|
+
}] });
|
45
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGlhbG9nLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9vc3VtaS1hbmd1bGFyLXRvb2xzL3NyYy9saWIvc2VydmljZXMvZGlhbG9nLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE1BQU0sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDbkQsT0FBTyxFQUFFLFNBQVMsRUFBZ0IsTUFBTSwwQkFBMEIsQ0FBQztBQUVuRSxPQUFPLG9CQUFvQixNQUFNLDJEQUEyRCxDQUFDO0FBQzdGLE9BQU8sc0JBQXNCLE1BQU0sK0RBQStELENBQUM7QUFDbkcsT0FBTyxtQkFBbUIsTUFBTSx5REFBeUQsQ0FBQzs7QUFJMUYsTUFBTSxDQUFDLE9BQU8sT0FBTyxhQUFhO0lBQ3hCLE1BQU0sR0FBYyxNQUFNLENBQUMsU0FBUyxDQUFDLENBQUM7SUFFdkMsT0FBTyxDQUFDLE9BQXNCO1FBQ25DLE1BQU0sU0FBUyxHQUF5QyxJQUFJL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c3RhbmNlLnRpdGxlLnNldChvcHRpb25zLnRpdGxlKTtcbiAgICBkaWFsb2dSZWYuY29tcG9uZW50SW5zdGFuY2UuY29udGVudC5zZXQob3B0aW9ucy5jb250ZW50KTtcbiAgICBkaWFsb2dSZWYuY29tcG9uZW50SW5zdGFuY2Uub2suc2V0KG9wdGlvbnMub2spO1xuICAgIGlmIChvcHRpb25zLmNhbmNlbCAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICBkaWFsb2dSZWYuY29tcG9uZW50SW5zdGFuY2UuY2FuY2VsLnNldChvcHRpb25zLmNhbmNlbCk7XG4gICAgfVxuICAgIGlmIChvcHRpb25zLmZpZWxkcyAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICBkaWFsb2dSZWYuY29tcG9uZW50SW5zdGFuY2UuZmllbGRzLnNldChvcHRpb25zLmZpZWxkcyk7XG4gICAgfVxuXG4gICAgcmV0dXJuIGRpYWxvZ1JlZi5hZnRlckNsb3NlZCgpO1xuICB9XG59XG4iXX0=
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import { Overlay, OverlayConfig } from '@angular/cdk/overlay';
|
2
|
+
import { ComponentPortal } from '@angular/cdk/portal';
|
3
|
+
import { inject, Injectable, Injector } from '@angular/core';
|
4
|
+
import CustomOverlayRef from '../model/custom-overlay-ref.model';
|
5
|
+
import OverlayComponent from '../components/overlay/overlay.component';
|
6
|
+
import * as i0 from "@angular/core";
|
7
|
+
export default class OverlayService {
|
8
|
+
overlay = inject(Overlay);
|
9
|
+
injector = inject(Injector);
|
10
|
+
open(content, data, panelCssClasses = [], closeOnBackdropCLick = true) {
|
11
|
+
const _panelCssClasses = ['modal-panel', 'is-active'].concat(panelCssClasses);
|
12
|
+
const config = new OverlayConfig({
|
13
|
+
hasBackdrop: true,
|
14
|
+
panelClass: _panelCssClasses,
|
15
|
+
backdropClass: 'modal-background',
|
16
|
+
width: '100%',
|
17
|
+
height: '100%',
|
18
|
+
});
|
19
|
+
const overlayRef = this.overlay.create(config);
|
20
|
+
const customOverlayRef = new CustomOverlayRef(overlayRef, content, data, closeOnBackdropCLick);
|
21
|
+
const injector = this.createInjector(customOverlayRef, this.injector);
|
22
|
+
overlayRef.attach(new ComponentPortal(OverlayComponent, null, injector));
|
23
|
+
return customOverlayRef;
|
24
|
+
}
|
25
|
+
createInjector(ref, inj) {
|
26
|
+
return Injector.create({
|
27
|
+
providers: [{ provide: CustomOverlayRef, useValue: ref }],
|
28
|
+
parent: inj,
|
29
|
+
});
|
30
|
+
}
|
31
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: OverlayService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
32
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: OverlayService, providedIn: 'root' });
|
33
|
+
}
|
34
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: OverlayService, decorators: [{
|
35
|
+
type: Injectable,
|
36
|
+
args: [{
|
37
|
+
providedIn: 'root',
|
38
|
+
}]
|
39
|
+
}] });
|
40
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3ZlcmxheS5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvb3N1bWktYW5ndWxhci10b29scy9zcmMvbGliL3NlcnZpY2VzL292ZXJsYXkuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQzlELE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUN0RCxPQUFPLEVBQUUsTUFBTSxFQUFFLFVBQVUsRUFBRSxRQUFRLEVB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ICBjb25zdCBpbmplY3RvciA9IHRoaXMuY3JlYXRlSW5qZWN0b3IoY3VzdG9tT3ZlcmxheVJlZiwgdGhpcy5pbmplY3Rvcik7XG4gICAgb3ZlcmxheVJlZi5hdHRhY2gobmV3IENvbXBvbmVudFBvcnRhbChPdmVybGF5Q29tcG9uZW50LCBudWxsLCBpbmplY3RvcikpO1xuXG4gICAgcmV0dXJuIGN1c3RvbU92ZXJsYXlSZWY7XG4gIH1cblxuICBwcml2YXRlIGNyZWF0ZUluamVjdG9yKHJlZjogQ3VzdG9tT3ZlcmxheVJlZiwgaW5qOiBJbmplY3Rvcik6IEluamVjdG9yIHtcbiAgICByZXR1cm4gSW5qZWN0b3IuY3JlYXRlKHtcbiAgICAgIHByb3ZpZGVyczogW3sgcHJvdmlkZTogQ3VzdG9tT3ZlcmxheVJlZiwgdXNlVmFsdWU6IHJlZiB9XSxcbiAgICAgIHBhcmVudDogaW5qLFxuICAgIH0pO1xuICB9XG59XG4iXX0=
|
@@ -0,0 +1,5 @@
|
|
1
|
+
/**
|
2
|
+
* Generated bundle index. Do not edit.
|
3
|
+
*/
|
4
|
+
export * from './public-api';
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3N1bWktYW5ndWxhci10b29scy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL29zdW1pLWFuZ3VsYXItdG9vbHMvc3JjL29zdW1pLWFuZ3VsYXItdG9vbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ==
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/*
|
2
|
+
* Public API Surface of osumi-angular-tools
|
3
|
+
*/
|
4
|
+
export * from './lib/interfaces/dialogs.interface';
|
5
|
+
export * from './lib/interfaces/modals.interface';
|
6
|
+
export * from './lib/components/dialogs/alert-dialog/alert-dialog.component';
|
7
|
+
export * from './lib/components/dialogs/confirm-dialog/confirm-dialog.component';
|
8
|
+
export * from './lib/components/dialogs/form-dialog/form-dialog.component';
|
9
|
+
export * from './lib/components/overlay/overlay.component';
|
10
|
+
export * from './lib/model/custom-overlay-ref.model';
|
11
|
+
export * from './lib/services/dialog.service';
|
12
|
+
export * from './lib/services/overlay.service';
|
13
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL29zdW1pLWFuZ3VsYXItdG9vbHMvc3JjL3B1YmxpYy1hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFDSCxjQUFjLG9DQUFvQyxDQUFDO0FBQ25ELGNBQWMsbUNBQW1DLENBQUM7QUFDbEQsY0FBYyw4REFBOEQsQ0FBQztBQUM3RSxjQUFjLGtFQUFrRSxDQUFDO0FBQ2pGLGNBQWMsNERBQTRELENBQUM7QUFDM0UsY0FBYyw0Q0FBNEMsQ0FBQztBQUMzRCxjQUFjLHNDQUFzQyxDQUFDO0FBQ3JELGNBQWMsK0JBQStCLENBQUM7QUFDOUMsY0FBYyxnQ0FBZ0MsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gKiBQdWJsaWMgQVBJIFN1cmZhY2Ugb2Ygb3N1bWktYW5ndWxhci10b29sc1xuICovXG5leHBvcnQgKiBmcm9tICcuL2xpYi9pbnRlcmZhY2VzL2RpYWxvZ3MuaW50ZXJmYWNlJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL2ludGVyZmFjZXMvbW9kYWxzLmludGVyZmFjZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9jb21wb25lbnRzL2RpYWxvZ3MvYWxlcnQtZGlhbG9nL2FsZXJ0LWRpYWxvZy5jb21wb25lbnQnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvY29tcG9uZW50cy9kaWFsb2dzL2NvbmZpcm0tZGlhbG9nL2NvbmZpcm0tZGlhbG9nLmNvbXBvbmVudCc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9jb21wb25lbnRzL2RpYWxvZ3MvZm9ybS1kaWFsb2cvZm9ybS1kaWFsb2cuY29tcG9uZW50JztcbmV4cG9ydCAqIGZyb20gJy4vbGliL2NvbXBvbmVudHMvb3ZlcmxheS9vdmVybGF5LmNvbXBvbmVudCc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9tb2RlbC9jdXN0b20tb3ZlcmxheS1yZWYubW9kZWwnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvc2VydmljZXMvZGlhbG9nLnNlcnZpY2UnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvc2VydmljZXMvb3ZlcmxheS5zZXJ2aWNlJztcbiJdfQ==
|
@@ -0,0 +1,208 @@
|
|
1
|
+
import * as i0 from '@angular/core';
|
2
|
+
import { inject, signal, Component, Renderer2, Injectable, Injector } from '@angular/core';
|
3
|
+
import { MatButton } from '@angular/material/button';
|
4
|
+
import { MatDialogRef, MatDialogTitle, MatDialogContent, MatDialogActions, MatDialogClose, MatDialog } from '@angular/material/dialog';
|
5
|
+
import * as i1 from '@angular/forms';
|
6
|
+
import { FormsModule } from '@angular/forms';
|
7
|
+
import { MatFormField, MatLabel, MatHint } from '@angular/material/form-field';
|
8
|
+
import { MatInput } from '@angular/material/input';
|
9
|
+
import { NgComponentOutlet } from '@angular/common';
|
10
|
+
import { MatIcon } from '@angular/material/icon';
|
11
|
+
import { Subject } from 'rxjs';
|
12
|
+
import { Overlay, OverlayConfig } from '@angular/cdk/overlay';
|
13
|
+
import { ComponentPortal } from '@angular/cdk/portal';
|
14
|
+
|
15
|
+
class AlertDialogComponent {
|
16
|
+
dialogRef = inject(MatDialogRef);
|
17
|
+
title = signal('');
|
18
|
+
content = signal('');
|
19
|
+
ok = signal('');
|
20
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: AlertDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
21
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.12", type: AlertDialogComponent, isStandalone: true, selector: "o-alert-dialog", ngImport: i0, template: "<h1 mat-dialog-title>{{ title() }}</h1>\n<div mat-dialog-content>\n\t<p [innerHtml]=\"content()\"></p>\n</div>\n<div mat-dialog-actions\n\t align=\"end\">\n\t<button type=\"button\"\n\t\t\tmat-flat-button\n\t\t\tcolor=\"primary\"\n\t\t\t(click)=\"dialogRef.close(true)\"\n\t\t\tcdkFocusInitial>{{ 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[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }] });
|
22
|
+
}
|
23
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: AlertDialogComponent, decorators: [{
|
24
|
+
type: Component,
|
25
|
+
args: [{ standalone: true, selector: 'o-alert-dialog', imports: [MatDialogTitle, MatDialogContent, MatDialogActions, MatButton], template: "<h1 mat-dialog-title>{{ title() }}</h1>\n<div mat-dialog-content>\n\t<p [innerHtml]=\"content()\"></p>\n</div>\n<div mat-dialog-actions\n\t align=\"end\">\n\t<button type=\"button\"\n\t\t\tmat-flat-button\n\t\t\tcolor=\"primary\"\n\t\t\t(click)=\"dialogRef.close(true)\"\n\t\t\tcdkFocusInitial>{{ ok() }}</button>\n</div>\n" }]
|
26
|
+
}] });
|
27
|
+
|
28
|
+
class ConfirmDialogComponent {
|
29
|
+
dialogRef = inject(MatDialogRef);
|
30
|
+
title = signal('');
|
31
|
+
content = signal('');
|
32
|
+
ok = signal('');
|
33
|
+
cancel = signal('');
|
34
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: ConfirmDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
35
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: ConfirmDialogComponent, isStandalone: true, selector: "o-confirm-dialog", ngImport: i0, template: "<h1 mat-dialog-title>{{ title() }}</h1>\n<div mat-dialog-content>\n\t<p>{{ content() }}</p>\n</div>\n<div mat-dialog-actions\n\t align=\"end\">\n\t@if (cancel() !== '') {\n\t<button type=\"button\"\n\t\t\tmat-button\n\t\t\t(click)=\"dialogRef.close()\">{{ cancel() }}</button>\n\t}\n\t<button type=\"button\"\n\t\t\tmat-flat-button\n\t\t\tcolor=\"primary\"\n\t\t\t(click)=\"dialogRef.close(true)\"\n\t\t\tcdkFocusInitial>{{ 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[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }] });
|
36
|
+
}
|
37
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: ConfirmDialogComponent, decorators: [{
|
38
|
+
type: Component,
|
39
|
+
args: [{ standalone: true, selector: 'o-confirm-dialog', imports: [MatDialogTitle, MatDialogContent, MatDialogActions, MatButton], template: "<h1 mat-dialog-title>{{ title() }}</h1>\n<div mat-dialog-content>\n\t<p>{{ content() }}</p>\n</div>\n<div mat-dialog-actions\n\t align=\"end\">\n\t@if (cancel() !== '') {\n\t<button type=\"button\"\n\t\t\tmat-button\n\t\t\t(click)=\"dialogRef.close()\">{{ cancel() }}</button>\n\t}\n\t<button type=\"button\"\n\t\t\tmat-flat-button\n\t\t\tcolor=\"primary\"\n\t\t\t(click)=\"dialogRef.close(true)\"\n\t\t\tcdkFocusInitial>{{ ok() }}</button>\n</div>\n" }]
|
40
|
+
}] });
|
41
|
+
|
42
|
+
class FormDialogComponent {
|
43
|
+
dialogRef = inject(MatDialogRef);
|
44
|
+
title = signal('');
|
45
|
+
content = signal('');
|
46
|
+
fields = signal([]);
|
47
|
+
ok = signal('');
|
48
|
+
cancel = signal('');
|
49
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: FormDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
50
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: FormDialogComponent, isStandalone: true, selector: "o-form-dialog", ngImport: i0, template: "<h1 mat-dialog-title>{{ title() }}</h1>\n<div mat-dialog-content>\n\t<p class=\"margin-bottom\">{{ content() }}</p>\n\t@for (field of fields(); track field.title) {\n\t<div class=\"form-field margin-right\">\n\t\t<mat-form-field class=\"max-width\">\n\t\t\t<mat-label>{{field.title}}</mat-label>\n\t\t\t<input matInput\n\t\t\t\t [type]=\"field.type\"\n\t\t\t\t [(ngModel)]=\"field.value\">\n\t\t\t@if (field.hint) {\n\t\t\t<mat-hint>{{field.hint}}</mat-hint>\n\t\t\t}\n\t\t</mat-form-field>\n\t</div>\n\t}\n</div>\n<div mat-dialog-actions\n\t align=\"end\">\n\t@if (cancel() !== '') {\n\t<button type=\"button\"\n\t\t\tmat-button\n\t\t\t(click)=\"dialogRef.close()\">{{ cancel() }}</button>\n\t}\n\t<button type=\"button\"\n\t\t\tmat-flat-button\n\t\t\tcolor=\"primary\"\n\t\t\t[mat-dialog-close]=\"fields()\"\n\t\t\tcdkFocusInitial>{{ ok() }}</button>\n</div>\n", styles: [".margin-bottom{margin-bottom:16px}\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.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: "directive", type: MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { 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: MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { 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"], exportAs: ["matInput"] }, { kind: "component", type: MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }] });
|
51
|
+
}
|
52
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: FormDialogComponent, decorators: [{
|
53
|
+
type: Component,
|
54
|
+
args: [{ standalone: true, selector: 'o-form-dialog', imports: [
|
55
|
+
FormsModule,
|
56
|
+
MatDialogTitle,
|
57
|
+
MatDialogContent,
|
58
|
+
MatDialogActions,
|
59
|
+
MatDialogClose,
|
60
|
+
MatFormField,
|
61
|
+
MatLabel,
|
62
|
+
MatHint,
|
63
|
+
MatInput,
|
64
|
+
MatButton,
|
65
|
+
], template: "<h1 mat-dialog-title>{{ title() }}</h1>\n<div mat-dialog-content>\n\t<p class=\"margin-bottom\">{{ content() }}</p>\n\t@for (field of fields(); track field.title) {\n\t<div class=\"form-field margin-right\">\n\t\t<mat-form-field class=\"max-width\">\n\t\t\t<mat-label>{{field.title}}</mat-label>\n\t\t\t<input matInput\n\t\t\t\t [type]=\"field.type\"\n\t\t\t\t [(ngModel)]=\"field.value\">\n\t\t\t@if (field.hint) {\n\t\t\t<mat-hint>{{field.hint}}</mat-hint>\n\t\t\t}\n\t\t</mat-form-field>\n\t</div>\n\t}\n</div>\n<div mat-dialog-actions\n\t align=\"end\">\n\t@if (cancel() !== '') {\n\t<button type=\"button\"\n\t\t\tmat-button\n\t\t\t(click)=\"dialogRef.close()\">{{ cancel() }}</button>\n\t}\n\t<button type=\"button\"\n\t\t\tmat-flat-button\n\t\t\tcolor=\"primary\"\n\t\t\t[mat-dialog-close]=\"fields()\"\n\t\t\tcdkFocusInitial>{{ ok() }}</button>\n</div>\n", styles: [".margin-bottom{margin-bottom:16px}\n"] }]
|
66
|
+
}] });
|
67
|
+
|
68
|
+
// R = Response Data Type, T = Data passed to Modal Type
|
69
|
+
class CustomOverlayRef {
|
70
|
+
overlay;
|
71
|
+
content;
|
72
|
+
data;
|
73
|
+
closeOnBackdropCLick;
|
74
|
+
afterClosed$ = new Subject();
|
75
|
+
constructor(overlay, content, data, closeOnBackdropCLick = true) {
|
76
|
+
this.overlay = overlay;
|
77
|
+
this.content = content;
|
78
|
+
this.data = data;
|
79
|
+
this.closeOnBackdropCLick = closeOnBackdropCLick;
|
80
|
+
if (closeOnBackdropCLick) {
|
81
|
+
overlay.backdropClick().subscribe({
|
82
|
+
next: () => {
|
83
|
+
this._close("backdropClick", null);
|
84
|
+
},
|
85
|
+
});
|
86
|
+
}
|
87
|
+
}
|
88
|
+
close(data) {
|
89
|
+
this._close("close", data);
|
90
|
+
}
|
91
|
+
_close(type, data) {
|
92
|
+
this.overlay.dispose();
|
93
|
+
this.afterClosed$.next({
|
94
|
+
type,
|
95
|
+
data,
|
96
|
+
});
|
97
|
+
this.afterClosed$.complete();
|
98
|
+
}
|
99
|
+
}
|
100
|
+
|
101
|
+
class OverlayComponent {
|
102
|
+
customOverlayRef = inject(CustomOverlayRef);
|
103
|
+
renderer = inject(Renderer2);
|
104
|
+
content = this.customOverlayRef.content;
|
105
|
+
inputData = { modalTitle: '', modalColor: 'blue' };
|
106
|
+
ngOnInit() {
|
107
|
+
this.listenToEscKey();
|
108
|
+
this.inputData = this.customOverlayRef.data;
|
109
|
+
}
|
110
|
+
listenToEscKey() {
|
111
|
+
this.renderer.listen('window', 'keyup', (event) => {
|
112
|
+
if (event.key === 'Escape') {
|
113
|
+
this.close();
|
114
|
+
}
|
115
|
+
});
|
116
|
+
}
|
117
|
+
close() {
|
118
|
+
this.customOverlayRef.close(null);
|
119
|
+
}
|
120
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: OverlayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
121
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: OverlayComponent, isStandalone: true, selector: "o-overlay", ngImport: i0, template: "<div [class]=\"'modal ' + (inputData.css ? inputData.css : '')\">\n\t<div [class]=\"'modal__header modal__header--' + inputData.modalColor\">\n\t\t<div class=\"title\">{{ inputData.modalTitle }}</div>\n\t\t@if (!inputData.hideCloseBtn) {\n\t\t<div class=\"btn-close\"\n\t\t\t (click)=\"close()\">\n\t\t\t<mat-icon>close</mat-icon>\n\t\t</div>\n\t\t}\n\t</div>\n\n\t<div class=\"modal__content\">\n\t\t<ng-container *ngComponentOutlet=\"content\"></ng-container>\n\t</div>\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(--modal-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(--color-blue);color:#fff}.modal__header .btn-close{cursor:pointer}.modal__header--blue{background-color:var(--main-color)}.modal__header--yellow{background-color:var(--color-yellow);color:var(--color-black)}.modal__header--yellow>.btn-close{color:var(--color-black)}.modal__header--red{background-color:var(--color-red)}.modal__content{padding:20px;border-bottom-left-radius:6px;background-color:var(--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: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"] }] });
|
122
|
+
}
|
123
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: OverlayComponent, decorators: [{
|
124
|
+
type: Component,
|
125
|
+
args: [{ standalone: true, selector: 'o-overlay', imports: [MatIcon, NgComponentOutlet], template: "<div [class]=\"'modal ' + (inputData.css ? inputData.css : '')\">\n\t<div [class]=\"'modal__header modal__header--' + inputData.modalColor\">\n\t\t<div class=\"title\">{{ inputData.modalTitle }}</div>\n\t\t@if (!inputData.hideCloseBtn) {\n\t\t<div class=\"btn-close\"\n\t\t\t (click)=\"close()\">\n\t\t\t<mat-icon>close</mat-icon>\n\t\t</div>\n\t\t}\n\t</div>\n\n\t<div class=\"modal__content\">\n\t\t<ng-container *ngComponentOutlet=\"content\"></ng-container>\n\t</div>\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(--modal-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(--color-blue);color:#fff}.modal__header .btn-close{cursor:pointer}.modal__header--blue{background-color:var(--main-color)}.modal__header--yellow{background-color:var(--color-yellow);color:var(--color-black)}.modal__header--yellow>.btn-close{color:var(--color-black)}.modal__header--red{background-color:var(--color-red)}.modal__content{padding:20px;border-bottom-left-radius:6px;background-color:var(--color-white);border-bottom-right-radius:6px;height:calc(100% - 48px);overflow-y:auto;box-sizing:border-box}\n"] }]
|
126
|
+
}] });
|
127
|
+
|
128
|
+
class DialogService {
|
129
|
+
dialog = inject(MatDialog);
|
130
|
+
confirm(options) {
|
131
|
+
const dialogRef = this.dialog.open(ConfirmDialogComponent);
|
132
|
+
dialogRef.componentInstance.title.set(options.title);
|
133
|
+
dialogRef.componentInstance.content.set(options.content);
|
134
|
+
dialogRef.componentInstance.ok.set(options.ok);
|
135
|
+
if (options.cancel !== undefined) {
|
136
|
+
dialogRef.componentInstance.cancel.set(options.cancel);
|
137
|
+
}
|
138
|
+
return dialogRef.afterClosed();
|
139
|
+
}
|
140
|
+
alert(options) {
|
141
|
+
const dialogRef = this.dialog.open(AlertDialogComponent);
|
142
|
+
dialogRef.componentInstance.title.set(options.title);
|
143
|
+
dialogRef.componentInstance.content.set(options.content);
|
144
|
+
dialogRef.componentInstance.ok.set(options.ok);
|
145
|
+
return dialogRef.afterClosed();
|
146
|
+
}
|
147
|
+
form(options) {
|
148
|
+
const dialogRef = this.dialog.open(FormDialogComponent);
|
149
|
+
dialogRef.componentInstance.title.set(options.title);
|
150
|
+
dialogRef.componentInstance.content.set(options.content);
|
151
|
+
dialogRef.componentInstance.ok.set(options.ok);
|
152
|
+
if (options.cancel !== undefined) {
|
153
|
+
dialogRef.componentInstance.cancel.set(options.cancel);
|
154
|
+
}
|
155
|
+
if (options.fields !== undefined) {
|
156
|
+
dialogRef.componentInstance.fields.set(options.fields);
|
157
|
+
}
|
158
|
+
return dialogRef.afterClosed();
|
159
|
+
}
|
160
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: DialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
161
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: DialogService });
|
162
|
+
}
|
163
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: DialogService, decorators: [{
|
164
|
+
type: Injectable
|
165
|
+
}] });
|
166
|
+
|
167
|
+
class OverlayService {
|
168
|
+
overlay = inject(Overlay);
|
169
|
+
injector = inject(Injector);
|
170
|
+
open(content, data, panelCssClasses = [], closeOnBackdropCLick = true) {
|
171
|
+
const _panelCssClasses = ['modal-panel', 'is-active'].concat(panelCssClasses);
|
172
|
+
const config = new OverlayConfig({
|
173
|
+
hasBackdrop: true,
|
174
|
+
panelClass: _panelCssClasses,
|
175
|
+
backdropClass: 'modal-background',
|
176
|
+
width: '100%',
|
177
|
+
height: '100%',
|
178
|
+
});
|
179
|
+
const overlayRef = this.overlay.create(config);
|
180
|
+
const customOverlayRef = new CustomOverlayRef(overlayRef, content, data, closeOnBackdropCLick);
|
181
|
+
const injector = this.createInjector(customOverlayRef, this.injector);
|
182
|
+
overlayRef.attach(new ComponentPortal(OverlayComponent, null, injector));
|
183
|
+
return customOverlayRef;
|
184
|
+
}
|
185
|
+
createInjector(ref, inj) {
|
186
|
+
return Injector.create({
|
187
|
+
providers: [{ provide: CustomOverlayRef, useValue: ref }],
|
188
|
+
parent: inj,
|
189
|
+
});
|
190
|
+
}
|
191
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: OverlayService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
192
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: OverlayService, providedIn: 'root' });
|
193
|
+
}
|
194
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: OverlayService, decorators: [{
|
195
|
+
type: Injectable,
|
196
|
+
args: [{
|
197
|
+
providedIn: 'root',
|
198
|
+
}]
|
199
|
+
}] });
|
200
|
+
|
201
|
+
/*
|
202
|
+
* Public API Surface of osumi-angular-tools
|
203
|
+
*/
|
204
|
+
|
205
|
+
/**
|
206
|
+
* Generated bundle index. Do not edit.
|
207
|
+
*/
|
208
|
+
//# sourceMappingURL=osumi-angular-tools.mjs.map
|
@@ -0,0 +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/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';\nimport { MatButton } from '@angular/material/button';\nimport {\n MatDialogActions,\n MatDialogContent,\n MatDialogRef,\n MatDialogTitle,\n} from '@angular/material/dialog';\n\n@Component({\n standalone: true,\n selector: 'o-alert-dialog',\n templateUrl: './alert-dialog.component.html',\n imports: [MatDialogTitle, MatDialogContent, MatDialogActions, MatButton],\n})\nexport default 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>('');\n}\n","<h1 mat-dialog-title>{{ title() }}</h1>\n<div mat-dialog-content>\n\t<p [innerHtml]=\"content()\"></p>\n</div>\n<div mat-dialog-actions\n\t align=\"end\">\n\t<button type=\"button\"\n\t\t\tmat-flat-button\n\t\t\tcolor=\"primary\"\n\t\t\t(click)=\"dialogRef.close(true)\"\n\t\t\tcdkFocusInitial>{{ ok() }}</button>\n</div>\n","import { Component, inject, signal, WritableSignal } from '@angular/core';\nimport { MatButton } from '@angular/material/button';\nimport {\n MatDialogActions,\n MatDialogContent,\n MatDialogRef,\n MatDialogTitle,\n} from '@angular/material/dialog';\n\n@Component({\n standalone: true,\n selector: 'o-confirm-dialog',\n templateUrl: './confirm-dialog.component.html',\n imports: [MatDialogTitle, MatDialogContent, MatDialogActions, MatButton],\n})\nexport default 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 ok: WritableSignal<string> = signal<string>('');\n public cancel: WritableSignal<string> = signal<string>('');\n}\n","<h1 mat-dialog-title>{{ title() }}</h1>\n<div mat-dialog-content>\n\t<p>{{ content() }}</p>\n</div>\n<div mat-dialog-actions\n\t align=\"end\">\n\t@if (cancel() !== '') {\n\t<button type=\"button\"\n\t\t\tmat-button\n\t\t\t(click)=\"dialogRef.close()\">{{ cancel() }}</button>\n\t}\n\t<button type=\"button\"\n\t\t\tmat-flat-button\n\t\t\tcolor=\"primary\"\n\t\t\t(click)=\"dialogRef.close(true)\"\n\t\t\tcdkFocusInitial>{{ ok() }}</button>\n</div>\n","import { Component, inject, signal, WritableSignal } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { MatButton } from '@angular/material/button';\nimport {\n MatDialogActions,\n MatDialogClose,\n MatDialogContent,\n MatDialogRef,\n MatDialogTitle,\n} from '@angular/material/dialog';\nimport { MatFormField, MatHint, MatLabel } from '@angular/material/form-field';\nimport { MatInput } from '@angular/material/input';\nimport { DialogField } from '../../../interfaces/dialogs.interface';\n\n@Component({\n standalone: true,\n selector: 'o-form-dialog',\n templateUrl: './form-dialog.component.html',\n styleUrls: ['./form-dialog.component.scss'],\n imports: [\n FormsModule,\n MatDialogTitle,\n MatDialogContent,\n MatDialogActions,\n MatDialogClose,\n MatFormField,\n MatLabel,\n MatHint,\n MatInput,\n MatButton,\n ],\n})\nexport default 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>('');\n public cancel: WritableSignal<string> = signal<string>('');\n}\n","<h1 mat-dialog-title>{{ title() }}</h1>\n<div mat-dialog-content>\n\t<p class=\"margin-bottom\">{{ content() }}</p>\n\t@for (field of fields(); track field.title) {\n\t<div class=\"form-field margin-right\">\n\t\t<mat-form-field class=\"max-width\">\n\t\t\t<mat-label>{{field.title}}</mat-label>\n\t\t\t<input matInput\n\t\t\t\t [type]=\"field.type\"\n\t\t\t\t [(ngModel)]=\"field.value\">\n\t\t\t@if (field.hint) {\n\t\t\t<mat-hint>{{field.hint}}</mat-hint>\n\t\t\t}\n\t\t</mat-form-field>\n\t</div>\n\t}\n</div>\n<div mat-dialog-actions\n\t align=\"end\">\n\t@if (cancel() !== '') {\n\t<button type=\"button\"\n\t\t\tmat-button\n\t\t\t(click)=\"dialogRef.close()\">{{ cancel() }}</button>\n\t}\n\t<button type=\"button\"\n\t\t\tmat-flat-button\n\t\t\tcolor=\"primary\"\n\t\t\t[mat-dialog-close]=\"fields()\"\n\t\t\tcdkFocusInitial>{{ 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\n// R = Response Data Type, T = Data passed to Modal Type\nexport default class CustomOverlayRef<R = any, T = any> {\n afterClosed$ = new Subject<OverlayCloseEvent<R | null>>();\n\n constructor(\n public overlay: OverlayRef,\n public content: Type<any>,\n public data: T,\n public closeOnBackdropCLick: boolean = true\n ) {\n if (closeOnBackdropCLick) {\n overlay.backdropClick().subscribe({\n next: () => {\n this._close(\"backdropClick\", null);\n },\n });\n }\n }\n\n close(data?: any): void {\n this._close(\"close\", data!);\n }\n\n private _close(type: \"backdropClick\" | \"close\", data: R | null): void {\n this.overlay.dispose();\n this.afterClosed$.next({\n type,\n data,\n });\n\n this.afterClosed$.complete();\n }\n}\n","import { NgComponentOutlet } from '@angular/common';\nimport { Component, inject, OnInit, Renderer2, Type } from '@angular/core';\nimport { MatIcon } from '@angular/material/icon';\nimport { Modal } from '../../interfaces/modals.interface';\nimport CustomOverlayRef from '../../model/custom-overlay-ref.model';\n\n@Component({\n standalone: true,\n selector: 'o-overlay',\n templateUrl: './overlay.component.html',\n styleUrls: ['./overlay.component.scss'],\n imports: [MatIcon, NgComponentOutlet],\n})\nexport default class OverlayComponent implements OnInit {\n private customOverlayRef: CustomOverlayRef<any, Modal> =\n inject(CustomOverlayRef);\n private renderer: Renderer2 = inject(Renderer2);\n\n content: Type<any> = 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 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","<div [class]=\"'modal ' + (inputData.css ? inputData.css : '')\">\n\t<div [class]=\"'modal__header modal__header--' + inputData.modalColor\">\n\t\t<div class=\"title\">{{ inputData.modalTitle }}</div>\n\t\t@if (!inputData.hideCloseBtn) {\n\t\t<div class=\"btn-close\"\n\t\t\t (click)=\"close()\">\n\t\t\t<mat-icon>close</mat-icon>\n\t\t</div>\n\t\t}\n\t</div>\n\n\t<div class=\"modal__content\">\n\t\t<ng-container *ngComponentOutlet=\"content\"></ng-container>\n\t</div>\n</div>\n","import { inject, Injectable } from '@angular/core';\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport { DialogOptions } from '../interfaces/dialogs.interface';\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 { Observable } from 'rxjs';\n\n@Injectable()\nexport default class DialogService {\n private dialog: MatDialog = inject(MatDialog);\n\n public confirm(options: DialogOptions): Observable<boolean> {\n const dialogRef: MatDialogRef<ConfirmDialogComponent> = this.dialog.open(\n ConfirmDialogComponent\n );\n\n dialogRef.componentInstance.title.set(options.title);\n dialogRef.componentInstance.content.set(options.content);\n dialogRef.componentInstance.ok.set(options.ok);\n if (options.cancel !== undefined) {\n dialogRef.componentInstance.cancel.set(options.cancel);\n }\n\n return dialogRef.afterClosed();\n }\n\n public alert(options: DialogOptions): Observable<boolean> {\n const dialogRef: MatDialogRef<AlertDialogComponent> =\n this.dialog.open(AlertDialogComponent);\n\n dialogRef.componentInstance.title.set(options.title);\n dialogRef.componentInstance.content.set(options.content);\n dialogRef.componentInstance.ok.set(options.ok);\n\n return dialogRef.afterClosed();\n }\n\n public form(options: DialogOptions): Observable<DialogOptions> {\n const dialogRef: MatDialogRef<FormDialogComponent> =\n this.dialog.open(FormDialogComponent);\n\n dialogRef.componentInstance.title.set(options.title);\n dialogRef.componentInstance.content.set(options.content);\n dialogRef.componentInstance.ok.set(options.ok);\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","import { Overlay, OverlayConfig } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { inject, Injectable, Injector, Type } from '@angular/core';\nimport { Modal } from '../interfaces/modals.interface';\nimport CustomOverlayRef from '../model/custom-overlay-ref.model';\nimport OverlayComponent from '../components/overlay/overlay.component';\n\n@Injectable({\n providedIn: 'root',\n})\nexport default class OverlayService {\n private overlay: Overlay = inject(Overlay);\n private injector: Injector = inject(Injector);\n\n open<R = any>(\n content: Type<any>,\n data: Modal,\n panelCssClasses: string[] = [],\n closeOnBackdropCLick: boolean = true\n ): CustomOverlayRef<R> {\n const _panelCssClasses: string[] = ['modal-panel', 'is-active'].concat(\n panelCssClasses\n );\n const config = new OverlayConfig({\n hasBackdrop: true,\n panelClass: _panelCssClasses,\n backdropClass: 'modal-background',\n width: '100%',\n height: '100%',\n });\n\n const overlayRef = this.overlay.create(config);\n\n const customOverlayRef = new CustomOverlayRef(\n overlayRef,\n content,\n data,\n closeOnBackdropCLick\n );\n const injector = this.createInjector(customOverlayRef, this.injector);\n overlayRef.attach(new ComponentPortal(OverlayComponent, null, injector));\n\n return customOverlayRef;\n }\n\n private createInjector(ref: CustomOverlayRef, inj: Injector): Injector {\n return Injector.create({\n providers: [{ provide: CustomOverlayRef, useValue: ref }],\n parent: inj,\n });\n }\n}\n","/*\n * Public API Surface of osumi-angular-tools\n */\nexport * from './lib/interfaces/dialogs.interface';\nexport * from './lib/interfaces/modals.interface';\nexport * from './lib/components/dialogs/alert-dialog/alert-dialog.component';\nexport * from './lib/components/dialogs/confirm-dialog/confirm-dialog.component';\nexport * from './lib/components/dialogs/form-dialog/form-dialog.component';\nexport * from './lib/components/overlay/overlay.component';\nexport * from './lib/model/custom-overlay-ref.model';\nexport * from './lib/services/dialog.service';\nexport * from './lib/services/overlay.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAec,MAAO,oBAAoB,CAAA;AAChC,IAAA,SAAS,GAAuC,MAAM,CAAC,YAAY,CAAC,CAAC;AAErE,IAAA,KAAK,GAA2B,MAAM,CAAS,EAAE,CAAC,CAAC;AACnD,IAAA,OAAO,GAA2B,MAAM,CAAS,EAAE,CAAC,CAAC;AACrD,IAAA,EAAE,GAA2B,MAAM,CAAS,EAAE,CAAC,CAAC;wGALpC,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;4FAApB,oBAAoB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECfzC,qUAYA,EDCY,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,cAAc,+HAA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OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,cAFrB,MAAM,EAAA,CAAA,CAAA;;4FAEC,cAAc,EAAA,UAAA,EAAA,CAAA;kBAHlC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;ACTD;;AAEG;;ACFH;;AAEG"}
|
package/index.d.ts
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
import { WritableSignal } from '@angular/core';
|
2
|
+
import { MatDialogRef } from '@angular/material/dialog';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
export default class AlertDialogComponent {
|
5
|
+
dialogRef: MatDialogRef<AlertDialogComponent>;
|
6
|
+
title: WritableSignal<string>;
|
7
|
+
content: WritableSignal<string>;
|
8
|
+
ok: WritableSignal<string>;
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AlertDialogComponent, never>;
|
10
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AlertDialogComponent, "o-alert-dialog", never, {}, {}, never, never, true, never>;
|
11
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { WritableSignal } from '@angular/core';
|
2
|
+
import { MatDialogRef } from '@angular/material/dialog';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
export default class ConfirmDialogComponent {
|
5
|
+
dialogRef: MatDialogRef<ConfirmDialogComponent>;
|
6
|
+
title: WritableSignal<string>;
|
7
|
+
content: WritableSignal<string>;
|
8
|
+
ok: WritableSignal<string>;
|
9
|
+
cancel: WritableSignal<string>;
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmDialogComponent, never>;
|
11
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ConfirmDialogComponent, "o-confirm-dialog", never, {}, {}, never, never, true, never>;
|
12
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { WritableSignal } from '@angular/core';
|
2
|
+
import { MatDialogRef } from '@angular/material/dialog';
|
3
|
+
import { DialogField } from '../../../interfaces/dialogs.interface';
|
4
|
+
import * as i0 from "@angular/core";
|
5
|
+
export default class FormDialogComponent {
|
6
|
+
dialogRef: MatDialogRef<FormDialogComponent>;
|
7
|
+
title: WritableSignal<string>;
|
8
|
+
content: WritableSignal<string>;
|
9
|
+
fields: WritableSignal<DialogField[]>;
|
10
|
+
ok: WritableSignal<string>;
|
11
|
+
cancel: WritableSignal<string>;
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormDialogComponent, never>;
|
13
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormDialogComponent, "o-form-dialog", never, {}, {}, never, never, true, never>;
|
14
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { OnInit, Type } from '@angular/core';
|
2
|
+
import { Modal } from '../../interfaces/modals.interface';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
export default class OverlayComponent implements OnInit {
|
5
|
+
private customOverlayRef;
|
6
|
+
private renderer;
|
7
|
+
content: Type<any>;
|
8
|
+
inputData: Modal;
|
9
|
+
ngOnInit(): void;
|
10
|
+
private listenToEscKey;
|
11
|
+
close(): void;
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<OverlayComponent, never>;
|
13
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<OverlayComponent, "o-overlay", never, {}, {}, never, never, true, never>;
|
14
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { OverlayRef } from "@angular/cdk/overlay";
|
2
|
+
import { Type } from "@angular/core";
|
3
|
+
import { Subject } from "rxjs";
|
4
|
+
import { OverlayCloseEvent } from '../interfaces/modals.interface';
|
5
|
+
export default class CustomOverlayRef<R = any, T = any> {
|
6
|
+
overlay: OverlayRef;
|
7
|
+
content: Type<any>;
|
8
|
+
data: T;
|
9
|
+
closeOnBackdropCLick: boolean;
|
10
|
+
afterClosed$: Subject<OverlayCloseEvent<R | null>>;
|
11
|
+
constructor(overlay: OverlayRef, content: Type<any>, data: T, closeOnBackdropCLick?: boolean);
|
12
|
+
close(data?: any): void;
|
13
|
+
private _close;
|
14
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { DialogOptions } from '../interfaces/dialogs.interface';
|
2
|
+
import { Observable } from 'rxjs';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
export default class DialogService {
|
5
|
+
private dialog;
|
6
|
+
confirm(options: DialogOptions): Observable<boolean>;
|
7
|
+
alert(options: DialogOptions): Observable<boolean>;
|
8
|
+
form(options: DialogOptions): Observable<DialogOptions>;
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DialogService, never>;
|
10
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DialogService>;
|
11
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { Type } from '@angular/core';
|
2
|
+
import { Modal } from '../interfaces/modals.interface';
|
3
|
+
import CustomOverlayRef from '../model/custom-overlay-ref.model';
|
4
|
+
import * as i0 from "@angular/core";
|
5
|
+
export default class OverlayService {
|
6
|
+
private overlay;
|
7
|
+
private injector;
|
8
|
+
open<R = any>(content: Type<any>, data: Modal, panelCssClasses?: string[], closeOnBackdropCLick?: boolean): CustomOverlayRef<R>;
|
9
|
+
private createInjector;
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<OverlayService, never>;
|
11
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<OverlayService>;
|
12
|
+
}
|
package/package.json
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
{
|
2
|
+
"name": "@osumi/angular-tools",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "Tools to be used on Angular projects.",
|
5
|
+
"author": "Iñigo Gorosabel",
|
6
|
+
"license": "MIT",
|
7
|
+
"bugs": {
|
8
|
+
"url": "https://github.com/osumionline/Osumi-Angular-Tools/issues"
|
9
|
+
},
|
10
|
+
"homepage": "https://github.com/osumionline/Osumi-Angular-Tools#readme",
|
11
|
+
"main": "fesm2022/osumi-angular-tools.mjs",
|
12
|
+
"module": "fesm2022/osumi-angular-tools.mjs",
|
13
|
+
"types": "index.d.ts",
|
14
|
+
"peerDependencies": {
|
15
|
+
"@angular/common": "^18.2.0",
|
16
|
+
"@angular/core": "^18.2.0",
|
17
|
+
"@angular/forms": "^18.2.0",
|
18
|
+
"@angular/material": "^18.2.0",
|
19
|
+
"@angular/cdk": "^18.2.0",
|
20
|
+
"rxjs": "~7.8.0"
|
21
|
+
},
|
22
|
+
"dependencies": {
|
23
|
+
"tslib": "^2.3.0"
|
24
|
+
},
|
25
|
+
"sideEffects": false,
|
26
|
+
"private": false,
|
27
|
+
"publishConfig": {
|
28
|
+
"access": "public"
|
29
|
+
},
|
30
|
+
"typings": "index.d.ts",
|
31
|
+
"exports": {
|
32
|
+
"./package.json": {
|
33
|
+
"default": "./package.json"
|
34
|
+
},
|
35
|
+
".": {
|
36
|
+
"types": "./index.d.ts",
|
37
|
+
"esm2022": "./esm2022/osumi-angular-tools.mjs",
|
38
|
+
"esm": "./esm2022/osumi-angular-tools.mjs",
|
39
|
+
"default": "./fesm2022/osumi-angular-tools.mjs"
|
40
|
+
}
|
41
|
+
}
|
42
|
+
}
|
package/public-api.d.ts
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
export * from './lib/interfaces/dialogs.interface';
|
2
|
+
export * from './lib/interfaces/modals.interface';
|
3
|
+
export * from './lib/components/dialogs/alert-dialog/alert-dialog.component';
|
4
|
+
export * from './lib/components/dialogs/confirm-dialog/confirm-dialog.component';
|
5
|
+
export * from './lib/components/dialogs/form-dialog/form-dialog.component';
|
6
|
+
export * from './lib/components/overlay/overlay.component';
|
7
|
+
export * from './lib/model/custom-overlay-ref.model';
|
8
|
+
export * from './lib/services/dialog.service';
|
9
|
+
export * from './lib/services/overlay.service';
|