@acontplus/ng-components 2.1.12 → 2.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, booleanAttribute, output, ViewEncapsulation, Component, inject, viewChild, ViewContainerRef, ChangeDetectionStrategy, effect,
|
|
2
|
+
import { input, booleanAttribute, output, ViewEncapsulation, Component, Injectable, inject, viewChild, ViewContainerRef, ChangeDetectionStrategy, effect, computed, PLATFORM_ID, signal, Input, TemplateRef, Pipe, Directive, ViewChild, KeyValueDiffers, ChangeDetectorRef, InjectionToken, ANIMATION_MODULE_TYPE, HostListener, ContentChildren, model, forwardRef, EventEmitter, ApplicationRef, Injector, DOCUMENT, ElementRef, NgZone, ContentChild, Output, Renderer2, createComponent, EnvironmentInjector } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/material/card';
|
|
4
4
|
import { MatCardModule } from '@angular/material/card';
|
|
5
5
|
import * as i2 from '@angular/material/button';
|
|
6
6
|
import { MatButtonModule, MatButton, MatMiniFabButton, MatIconButton, MatFabButton } from '@angular/material/button';
|
|
7
7
|
import * as i3 from '@angular/material/icon';
|
|
8
8
|
import { MatIconModule, MatIcon } from '@angular/material/icon';
|
|
9
|
-
import
|
|
9
|
+
import * as i7 from '@angular/cdk/drag-drop';
|
|
10
|
+
import { CdkDrag, CdkDragHandle, DragDropModule } from '@angular/cdk/drag-drop';
|
|
10
11
|
import * as i2$1 from '@angular/material/dialog';
|
|
11
12
|
import { MatDialogRef, MAT_DIALOG_DATA, MatDialogModule, MatDialog, MatDialogConfig } from '@angular/material/dialog';
|
|
12
13
|
import { NgClass, NgTemplateOutlet, isPlatformBrowser, AsyncPipe, DecimalPipe, CurrencyPipe, PercentPipe, DatePipe } from '@angular/common';
|
|
@@ -29,9 +30,9 @@ import * as i1$2 from '@angular/cdk/overlay';
|
|
|
29
30
|
import { Overlay, OverlayModule, OverlayConfig } from '@angular/cdk/overlay';
|
|
30
31
|
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
|
31
32
|
import { ComponentPortal, CdkPortalOutlet, TemplatePortal, DomPortalOutlet } from '@angular/cdk/portal';
|
|
32
|
-
import * as
|
|
33
|
+
import * as i5 from '@angular/material/input';
|
|
33
34
|
import { MatInputModule } from '@angular/material/input';
|
|
34
|
-
import * as
|
|
35
|
+
import * as i6 from '@angular/material/progress-bar';
|
|
35
36
|
import { MatProgressBarModule, MatProgressBar } from '@angular/material/progress-bar';
|
|
36
37
|
import * as i2$3 from '@angular/material/tooltip';
|
|
37
38
|
import { MatTooltip, MatTooltipModule } from '@angular/material/tooltip';
|
|
@@ -340,6 +341,81 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
340
341
|
], encapsulation: ViewEncapsulation.None, template: "@switch (matStyle()) { @case ('text') {\n<button\n matButton\n [ngClass]=\"getButtonClasses()\"\n [disabled]=\"disabled()\"\n [type]=\"type()\"\n [title]=\"getTitle()\"\n [attr.aria-label]=\"ariaLabel() || getTitle()\"\n [attr.name]=\"name()\"\n [attr.id]=\"id()\"\n [attr.form]=\"form()\"\n [attr.tabindex]=\"tabIndex()\"\n [attr.data-testid]=\"testId()\"\n (click)=\"handleClick.emit($event)\"\n>\n <ng-container [ngTemplateOutlet]=\"buttonContent\" />\n</button>\n} @case ('elevated') {\n<button\n matButton=\"elevated\"\n [ngClass]=\"getButtonClasses()\"\n [disabled]=\"disabled()\"\n [type]=\"type()\"\n [title]=\"getTitle()\"\n [attr.aria-label]=\"ariaLabel() || getTitle()\"\n [attr.name]=\"name()\"\n [attr.id]=\"id()\"\n [attr.form]=\"form()\"\n [attr.tabindex]=\"tabIndex()\"\n [attr.data-testid]=\"testId()\"\n (click)=\"handleClick.emit($event)\"\n>\n <ng-container [ngTemplateOutlet]=\"buttonContent\" />\n</button>\n} @case ('outlined') {\n<button\n matButton=\"outlined\"\n [ngClass]=\"getButtonClasses()\"\n [disabled]=\"disabled()\"\n [type]=\"type()\"\n [title]=\"getTitle()\"\n [attr.aria-label]=\"ariaLabel() || getTitle()\"\n [attr.name]=\"name()\"\n [attr.id]=\"id()\"\n [attr.form]=\"form()\"\n [attr.tabindex]=\"tabIndex()\"\n [attr.data-testid]=\"testId()\"\n (click)=\"handleClick.emit($event)\"\n>\n <ng-container [ngTemplateOutlet]=\"buttonContent\" />\n</button>\n} @case ('tonal') {\n<button\n matButton=\"tonal\"\n [ngClass]=\"getButtonClasses()\"\n [disabled]=\"disabled()\"\n [type]=\"type()\"\n [title]=\"getTitle()\"\n [attr.aria-label]=\"ariaLabel() || getTitle()\"\n [attr.name]=\"name()\"\n [attr.id]=\"id()\"\n [attr.form]=\"form()\"\n [attr.tabindex]=\"tabIndex()\"\n [attr.data-testid]=\"testId()\"\n (click)=\"handleClick.emit($event)\"\n>\n <ng-container [ngTemplateOutlet]=\"buttonContent\" />\n</button>\n} @case ('icon') {\n<button\n matIconButton\n [ngClass]=\"getButtonClasses()\"\n [disabled]=\"disabled()\"\n [type]=\"type()\"\n [title]=\"getTitle()\"\n [attr.aria-label]=\"ariaLabel() || getTitle()\"\n [attr.name]=\"name()\"\n [attr.id]=\"id()\"\n [attr.form]=\"form()\"\n [attr.tabindex]=\"tabIndex()\"\n [attr.data-testid]=\"testId()\"\n (click)=\"handleClick.emit($event)\"\n>\n <ng-container [ngTemplateOutlet]=\"buttonContent\" />\n</button>\n} @case ('fab') {\n<button\n matFab\n [ngClass]=\"getButtonClasses()\"\n [disabled]=\"disabled()\"\n [type]=\"type()\"\n [title]=\"getTitle()\"\n [attr.aria-label]=\"ariaLabel() || getTitle()\"\n [attr.name]=\"name()\"\n [attr.id]=\"id()\"\n [attr.form]=\"form()\"\n [attr.tabindex]=\"tabIndex()\"\n [attr.data-testid]=\"testId()\"\n (click)=\"handleClick.emit($event)\"\n>\n <ng-container [ngTemplateOutlet]=\"buttonContent\" />\n</button>\n} @case ('mini-fab') {\n<button\n matMiniFab\n [ngClass]=\"getButtonClasses()\"\n [disabled]=\"disabled()\"\n [type]=\"type()\"\n [title]=\"getTitle()\"\n [attr.aria-label]=\"ariaLabel() || getTitle()\"\n [attr.name]=\"name()\"\n [attr.id]=\"id()\"\n [attr.form]=\"form()\"\n [attr.tabindex]=\"tabIndex()\"\n [attr.data-testid]=\"testId()\"\n (click)=\"handleClick.emit($event)\"\n>\n <ng-container [ngTemplateOutlet]=\"buttonContent\" />\n</button>\n} @case ('extended-fab') {\n<button\n matFab\n extended\n [ngClass]=\"getButtonClasses()\"\n [disabled]=\"disabled()\"\n [type]=\"type()\"\n [title]=\"getTitle()\"\n [attr.aria-label]=\"ariaLabel() || getTitle()\"\n [attr.name]=\"name()\"\n [attr.id]=\"id()\"\n [attr.form]=\"form()\"\n [attr.tabindex]=\"tabIndex()\"\n [attr.data-testid]=\"testId()\"\n (click)=\"handleClick.emit($event)\"\n>\n <ng-container [ngTemplateOutlet]=\"buttonContent\" />\n</button>\n} @default {\n<button\n matButton=\"filled\"\n [ngClass]=\"getButtonClasses()\"\n [disabled]=\"disabled()\"\n [type]=\"type()\"\n [title]=\"getTitle()\"\n [attr.aria-label]=\"ariaLabel() || getTitle()\"\n [attr.name]=\"name()\"\n [attr.id]=\"id()\"\n [attr.form]=\"form()\"\n [attr.tabindex]=\"tabIndex()\"\n [attr.data-testid]=\"testId()\"\n (click)=\"handleClick.emit($event)\"\n>\n <ng-container [ngTemplateOutlet]=\"buttonContent\" />\n</button>\n} }\n\n<ng-template #buttonContent>\n @if (getIcon()) {\n <mat-icon>{{ getIcon() }}</mat-icon>\n } @if (getDisplayText()) { {{ getDisplayText() }} }\n\n <ng-content />\n</ng-template>\n", styles: [":root{--acp-secondary: #e0e0e0;--acp-secondary-on: #000000;--acp-success: #4caf50;--acp-success-on: #ffffff;--acp-danger: #ba1a1a;--acp-danger-on: #ffffff;--acp-warning: #ff9800;--acp-warning-on: #000000;--acp-info: #2196f3;--acp-info-on: #ffffff;--acp-dark: #212121;--acp-dark-on: #ffffff}.dark-theme{--acp-secondary: #424242;--acp-secondary-on: #ffffff;--acp-success: #81c784;--acp-success-on: #1b5e20;--acp-danger: #ef5350;--acp-danger-on: #b71c1c;--acp-warning: #ffb74d;--acp-warning-on: #e65100;--acp-info: #64b5f6;--acp-info-on: #0d47a1;--acp-dark: #616161;--acp-dark-on: #ffffff}acp-button{display:inline-block}.mat-mdc-button .mdc-button__label,.mat-mdc-unelevated-button .mdc-button__label,.mat-mdc-raised-button .mdc-button__label,.mat-mdc-outlined-button .mdc-button__label,button[matbutton=tonal] .mdc-button__label,.mat-mdc-fab.mdc-fab--extended .mdc-button__label{display:flex;align-items:center;gap:8px}.mat-mdc-button.mat-btn-secondary,.mat-mdc-unelevated-button.mat-btn-secondary{background-color:var(--acp-secondary)!important;color:var(--acp-secondary-on)!important}.mat-mdc-button.mat-btn-secondary:hover,.mat-mdc-unelevated-button.mat-btn-secondary:hover{background-color:color-mix(in srgb,var(--acp-secondary) 80%,black)!important}.mat-mdc-button.mat-btn-success,.mat-mdc-unelevated-button.mat-btn-success{background-color:var(--acp-success)!important;color:var(--acp-success-on)!important}.mat-mdc-button.mat-btn-danger,.mat-mdc-unelevated-button.mat-btn-danger{background-color:var(--acp-danger)!important;color:var(--acp-danger-on)!important}.mat-mdc-button.mat-btn-warning,.mat-mdc-unelevated-button.mat-btn-warning{background-color:var(--acp-warning)!important;color:var(--acp-warning-on)!important}.mat-mdc-button.mat-btn-info,.mat-mdc-unelevated-button.mat-btn-info{background-color:var(--acp-info)!important;color:var(--acp-info-on)!important}.mat-mdc-button.mat-btn-dark,.mat-mdc-unelevated-button.mat-btn-dark{background-color:var(--acp-dark)!important;color:var(--acp-dark-on)!important}button[matbutton=tonal].mat-btn-success{background-color:color-mix(in srgb,var(--acp-success) 12%,transparent)!important;color:var(--acp-success)!important}button[matbutton=tonal].mat-btn-danger{background-color:color-mix(in srgb,var(--acp-danger) 12%,transparent)!important;color:var(--acp-danger)!important}button[matbutton=tonal].mat-btn-warning{background-color:color-mix(in srgb,var(--acp-warning) 12%,transparent)!important;color:var(--acp-warning)!important}button[matbutton=tonal].mat-btn-info{background-color:color-mix(in srgb,var(--acp-info) 12%,transparent)!important;color:var(--acp-info)!important}button[matbutton=tonal].mat-btn-dark{background-color:color-mix(in srgb,var(--acp-dark) 12%,transparent)!important;color:var(--acp-dark)!important}.mat-mdc-button:not(.mat-mdc-unelevated-button):not(.mat-mdc-raised-button):not(.mat-mdc-outlined-button).mat-btn-secondary{color:var(--mat-sys-on-surface)!important}.mat-mdc-button:not(.mat-mdc-unelevated-button):not(.mat-mdc-raised-button):not(.mat-mdc-outlined-button).mat-btn-success{color:var(--acp-success)!important}.mat-mdc-button:not(.mat-mdc-unelevated-button):not(.mat-mdc-raised-button):not(.mat-mdc-outlined-button).mat-btn-danger{color:var(--acp-danger)!important}.mat-mdc-button:not(.mat-mdc-unelevated-button):not(.mat-mdc-raised-button):not(.mat-mdc-outlined-button).mat-btn-warning{color:var(--acp-warning)!important}.mat-mdc-button:not(.mat-mdc-unelevated-button):not(.mat-mdc-raised-button):not(.mat-mdc-outlined-button).mat-btn-info{color:var(--acp-info)!important}.mat-mdc-button:not(.mat-mdc-unelevated-button):not(.mat-mdc-raised-button):not(.mat-mdc-outlined-button).mat-btn-dark{color:var(--acp-dark)!important}.mat-mdc-raised-button.mat-btn-secondary{background-color:var(--mat-sys-surface-container-low)!important;color:var(--mat-sys-on-surface)!important}.mat-mdc-raised-button.mat-btn-success{background-color:var(--mat-sys-surface-container-low)!important;color:var(--acp-success)!important}.mat-mdc-raised-button.mat-btn-success:hover{background-color:color-mix(in srgb,var(--acp-success) 12%,transparent)!important}.mat-mdc-raised-button.mat-btn-danger{background-color:var(--mat-sys-surface-container-low)!important;color:var(--acp-danger)!important}.mat-mdc-raised-button.mat-btn-danger:hover{background-color:color-mix(in srgb,var(--acp-danger) 12%,transparent)!important}.mat-mdc-raised-button.mat-btn-warning{background-color:var(--mat-sys-surface-container-low)!important;color:var(--acp-warning)!important}.mat-mdc-raised-button.mat-btn-warning:hover{background-color:color-mix(in srgb,var(--acp-warning) 12%,transparent)!important}.mat-mdc-raised-button.mat-btn-info{background-color:var(--mat-sys-surface-container-low)!important;color:var(--acp-info)!important}.mat-mdc-raised-button.mat-btn-info:hover{background-color:color-mix(in srgb,var(--acp-info) 12%,transparent)!important}.mat-mdc-raised-button.mat-btn-dark{background-color:var(--mat-sys-surface-container-low)!important;color:var(--acp-dark)!important}.mat-mdc-raised-button.mat-btn-dark:hover{background-color:color-mix(in srgb,var(--acp-dark) 12%,transparent)!important}.mat-mdc-outlined-button.mat-btn-secondary{border-color:var(--mat-sys-outline)!important;color:var(--mat-sys-on-surface)!important}.mat-mdc-outlined-button.mat-btn-success{border-color:var(--acp-success)!important;color:var(--acp-success)!important}.mat-mdc-outlined-button.mat-btn-danger{border-color:var(--acp-danger)!important;color:var(--acp-danger)!important}.mat-mdc-outlined-button.mat-btn-warning{border-color:var(--acp-warning)!important;color:var(--acp-warning)!important}.mat-mdc-outlined-button.mat-btn-info{border-color:var(--acp-info)!important;color:var(--acp-info)!important}.mat-mdc-outlined-button.mat-btn-dark{border-color:var(--acp-dark)!important;color:var(--acp-dark)!important}.mat-mdc-fab.mat-btn-secondary,.mat-mdc-mini-fab.mat-btn-secondary{background-color:var(--acp-secondary)!important;color:var(--acp-secondary-on)!important}.mat-mdc-fab.mat-btn-success,.mat-mdc-mini-fab.mat-btn-success{background-color:var(--acp-success)!important;color:var(--acp-success-on)!important}.mat-mdc-fab.mat-btn-danger,.mat-mdc-mini-fab.mat-btn-danger{background-color:var(--acp-danger)!important;color:var(--acp-danger-on)!important}.mat-mdc-fab.mat-btn-warning,.mat-mdc-mini-fab.mat-btn-warning{background-color:var(--acp-warning)!important;color:var(--acp-warning-on)!important}.mat-mdc-fab.mat-btn-info,.mat-mdc-mini-fab.mat-btn-info{background-color:var(--acp-info)!important;color:var(--acp-info-on)!important}.mat-mdc-fab.mat-btn-dark,.mat-mdc-mini-fab.mat-btn-dark{background-color:var(--acp-dark)!important;color:var(--acp-dark-on)!important}.mat-mdc-icon-button.mat-btn-secondary{color:var(--mat-sys-on-surface)!important}.mat-mdc-icon-button.mat-btn-success{color:var(--acp-success)!important}.mat-mdc-icon-button.mat-btn-danger{color:var(--acp-danger)!important}.mat-mdc-icon-button.mat-btn-warning{color:var(--acp-warning)!important}.mat-mdc-icon-button.mat-btn-info{color:var(--acp-info)!important}.mat-mdc-icon-button.mat-btn-dark{color:var(--acp-dark)!important}\n"] }]
|
|
341
342
|
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], matStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "matStyle", required: false }] }], customClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "customClass", required: false }] }], reportFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "reportFormat", required: false }] }], extended: [{ type: i0.Input, args: [{ isSignal: true, alias: "extended", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: false }] }], tabIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabIndex", required: false }] }], testId: [{ type: i0.Input, args: [{ isSignal: true, alias: "testId", required: false }] }], handleClick: [{ type: i0.Output, args: ["handleClick"] }] } });
|
|
342
343
|
|
|
344
|
+
/**
|
|
345
|
+
* Servicio centralizado para manejar z-index de todos los diálogos
|
|
346
|
+
* Asegura que los diálogos siempre aparezcan en el orden correcto
|
|
347
|
+
*/
|
|
348
|
+
class DialogZIndexService {
|
|
349
|
+
static currentZIndex = 1000;
|
|
350
|
+
static Z_INDEX_INCREMENT = 10;
|
|
351
|
+
/**
|
|
352
|
+
* Obtiene el siguiente z-index disponible
|
|
353
|
+
* @returns El próximo z-index a usar
|
|
354
|
+
*/
|
|
355
|
+
getNextZIndex() {
|
|
356
|
+
DialogZIndexService.currentZIndex += DialogZIndexService.Z_INDEX_INCREMENT;
|
|
357
|
+
return DialogZIndexService.currentZIndex;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Obtiene el z-index actual más alto
|
|
361
|
+
* @returns El z-index más alto actualmente en uso
|
|
362
|
+
*/
|
|
363
|
+
getCurrentZIndex() {
|
|
364
|
+
return DialogZIndexService.currentZIndex;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Resetea el contador de z-index (útil para testing)
|
|
368
|
+
*/
|
|
369
|
+
reset() {
|
|
370
|
+
DialogZIndexService.currentZIndex = 1000;
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Aplica z-index a un diálogo específico
|
|
374
|
+
* @param dialogRef Referencia al diálogo
|
|
375
|
+
* @param zIndex Z-index a aplicar (opcional, si no se proporciona usa getNextZIndex())
|
|
376
|
+
*/
|
|
377
|
+
applyZIndex(dialogRef, zIndex) {
|
|
378
|
+
const targetZIndex = zIndex || this.getNextZIndex();
|
|
379
|
+
setTimeout(() => {
|
|
380
|
+
const overlayRef = dialogRef._overlayRef;
|
|
381
|
+
if (overlayRef) {
|
|
382
|
+
const pane = overlayRef.overlayElement;
|
|
383
|
+
const backdrop = overlayRef.backdropElement;
|
|
384
|
+
if (pane) {
|
|
385
|
+
pane.style.zIndex = (targetZIndex + 2).toString();
|
|
386
|
+
}
|
|
387
|
+
if (backdrop) {
|
|
388
|
+
backdrop.style.zIndex = (targetZIndex + 1).toString();
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}, 0);
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Trae un diálogo al frente (usado por drag functionality)
|
|
395
|
+
* @param element Elemento del diálogo a traer al frente
|
|
396
|
+
*/
|
|
397
|
+
bringToFront(element) {
|
|
398
|
+
const pane = element.closest('.cdk-overlay-pane');
|
|
399
|
+
if (pane) {
|
|
400
|
+
const newZIndex = this.getNextZIndex();
|
|
401
|
+
pane.style.zIndex = (newZIndex + 2).toString();
|
|
402
|
+
// También actualizar el backdrop si existe
|
|
403
|
+
const backdrop = pane.parentElement?.querySelector('.cdk-overlay-backdrop');
|
|
404
|
+
if (backdrop) {
|
|
405
|
+
backdrop.style.zIndex = (newZIndex + 1).toString();
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DialogZIndexService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
410
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DialogZIndexService, providedIn: 'root' });
|
|
411
|
+
}
|
|
412
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DialogZIndexService, decorators: [{
|
|
413
|
+
type: Injectable,
|
|
414
|
+
args: [{
|
|
415
|
+
providedIn: 'root',
|
|
416
|
+
}]
|
|
417
|
+
}] });
|
|
418
|
+
|
|
343
419
|
/**
|
|
344
420
|
* A wrapper component for Angular Material dialogs that provides a consistent look and feel,
|
|
345
421
|
* including a draggable header and the ability to dynamically create components inside the dialog.
|
|
@@ -349,21 +425,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
349
425
|
class DialogWrapper {
|
|
350
426
|
dialogRef = inject(MatDialogRef);
|
|
351
427
|
config = inject(MAT_DIALOG_DATA);
|
|
428
|
+
zIndexService = inject(DialogZIndexService);
|
|
352
429
|
/**
|
|
353
430
|
* A template reference that acts as an anchor for dynamic content.
|
|
354
431
|
* This is where the component specified in the config will be rendered.
|
|
355
432
|
*/
|
|
356
|
-
contentHost = viewChild.required('contentHost', {
|
|
433
|
+
contentHost = viewChild.required('contentHost', {
|
|
434
|
+
read: ViewContainerRef,
|
|
435
|
+
});
|
|
357
436
|
/**
|
|
358
437
|
* A reference to the header element for the z-index focus logic.
|
|
359
438
|
* Used to bring the dialog to the front when clicked.
|
|
360
439
|
*/
|
|
361
440
|
header = viewChild('dialogHeader', ...(ngDevMode ? [{ debugName: "header" }] : []));
|
|
362
|
-
/**
|
|
363
|
-
* Static counter to track the highest z-index for multiple dialogs.
|
|
364
|
-
* Ensures that the most recently clicked dialog appears on top.
|
|
365
|
-
*/
|
|
366
|
-
static lastZIndex = 1000;
|
|
367
441
|
/**
|
|
368
442
|
* Timeout ID for debouncing z-index updates to prevent excessive DOM manipulations.
|
|
369
443
|
*/
|
|
@@ -409,22 +483,14 @@ class DialogWrapper {
|
|
|
409
483
|
}
|
|
410
484
|
/**
|
|
411
485
|
* Brings the dialog to the front by adjusting its z-index.
|
|
412
|
-
* Uses
|
|
486
|
+
* Uses the centralized DialogZIndexService for consistent z-index management.
|
|
413
487
|
* Called when the dialog header is clicked.
|
|
414
488
|
*/
|
|
415
489
|
bringToFront() {
|
|
416
|
-
|
|
417
|
-
if (
|
|
418
|
-
|
|
490
|
+
const headerElement = this.header()?.nativeElement;
|
|
491
|
+
if (headerElement) {
|
|
492
|
+
this.zIndexService.bringToFront(headerElement);
|
|
419
493
|
}
|
|
420
|
-
// Schedule the z-index update for the next animation frame
|
|
421
|
-
this.bringToFrontTimeoutId = requestAnimationFrame(() => {
|
|
422
|
-
const pane = this.header()?.nativeElement.closest('.cdk-overlay-pane');
|
|
423
|
-
if (pane) {
|
|
424
|
-
pane.style.zIndex = (++DialogWrapper.lastZIndex).toString();
|
|
425
|
-
}
|
|
426
|
-
this.bringToFrontTimeoutId = null;
|
|
427
|
-
});
|
|
428
494
|
}
|
|
429
495
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DialogWrapper, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
430
496
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: DialogWrapper, isStandalone: true, selector: "acp-dialog-wrapper", viewQueries: [{ propertyName: "contentHost", first: true, predicate: ["contentHost"], descendants: true, read: ViewContainerRef, isSignal: true }, { propertyName: "header", first: true, predicate: ["dialogHeader"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (!config.hideHeader) {\n<div\n class=\"acp-dialog-header\"\n cdkDrag\n cdkDragRootElement=\".cdk-overlay-pane\"\n cdkDragHandle\n #dialogHeader\n (mousedown)=\"bringToFront()\"\n>\n <h6 mat-dialog-title class=\"acp-dialog-title\">\n @if (config.icon) {\n <mat-icon class=\"acp-dialog-title-icon\" aria-hidden=\"true\">{{ config.icon }}</mat-icon>\n }\n <span>{{ config.title }}</span>\n @if (config.showCloseButton !== false) {\n <acp-button\n [customClass]=\"'acp-dialog-close-btn'\"\n matStyle=\"icon\"\n icon=\"close\"\n (handleClick)=\"onClose()\"\n ariaLabel=\"Close Dialog\"\n />\n }\n </h6>\n</div>\n}\n\n<ng-template #contentHost />\n", styles: [".acp-dialog-header{cursor:move;border-bottom:1px solid var(--mat-sys-outline-variant, #dee2e6);color:var(--mat-sys-on-surface, #212529);position:relative}h6[mat-dialog-title].acp-dialog-title{display:flex;align-items:center;font-size:1.2rem;font-weight:500;margin:0;width:100%;padding-right:48px}.acp-dialog-title-icon{margin-right:12px;vertical-align:middle}h6[mat-dialog-title].acp-dialog-title span{flex-grow:1}mat-dialog-content{padding:24px}.acp-dialog-close-btn{position:absolute;top:8px;right:16px}\n"], dependencies: [{ kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i2$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: Button, selector: "acp-button", inputs: ["variant", "text", "icon", "disabled", "type", "matStyle", "customClass", "reportFormat", "extended", "title", "ariaLabel", "name", "id", "form", "tabIndex", "testId"], outputs: ["handleClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
@@ -432,7 +498,9 @@ class DialogWrapper {
|
|
|
432
498
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DialogWrapper, decorators: [{
|
|
433
499
|
type: Component,
|
|
434
500
|
args: [{ selector: 'acp-dialog-wrapper', standalone: true, imports: [CdkDrag, CdkDragHandle, MatDialogModule, MatIconModule, Button], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "@if (!config.hideHeader) {\n<div\n class=\"acp-dialog-header\"\n cdkDrag\n cdkDragRootElement=\".cdk-overlay-pane\"\n cdkDragHandle\n #dialogHeader\n (mousedown)=\"bringToFront()\"\n>\n <h6 mat-dialog-title class=\"acp-dialog-title\">\n @if (config.icon) {\n <mat-icon class=\"acp-dialog-title-icon\" aria-hidden=\"true\">{{ config.icon }}</mat-icon>\n }\n <span>{{ config.title }}</span>\n @if (config.showCloseButton !== false) {\n <acp-button\n [customClass]=\"'acp-dialog-close-btn'\"\n matStyle=\"icon\"\n icon=\"close\"\n (handleClick)=\"onClose()\"\n ariaLabel=\"Close Dialog\"\n />\n }\n </h6>\n</div>\n}\n\n<ng-template #contentHost />\n", styles: [".acp-dialog-header{cursor:move;border-bottom:1px solid var(--mat-sys-outline-variant, #dee2e6);color:var(--mat-sys-on-surface, #212529);position:relative}h6[mat-dialog-title].acp-dialog-title{display:flex;align-items:center;font-size:1.2rem;font-weight:500;margin:0;width:100%;padding-right:48px}.acp-dialog-title-icon{margin-right:12px;vertical-align:middle}h6[mat-dialog-title].acp-dialog-title span{flex-grow:1}mat-dialog-content{padding:24px}.acp-dialog-close-btn{position:absolute;top:8px;right:16px}\n"] }]
|
|
435
|
-
}], ctorParameters: () => [], propDecorators: { contentHost: [{ type: i0.ViewChild, args: ['contentHost', { ...{
|
|
501
|
+
}], ctorParameters: () => [], propDecorators: { contentHost: [{ type: i0.ViewChild, args: ['contentHost', { ...{
|
|
502
|
+
read: ViewContainerRef,
|
|
503
|
+
}, isSignal: true }] }], header: [{ type: i0.ViewChild, args: ['dialogHeader', { isSignal: true }] }] } });
|
|
436
504
|
|
|
437
505
|
class DynamicSelect {
|
|
438
506
|
// Basic inputs
|
|
@@ -997,6 +1065,7 @@ class AdvancedDialogService {
|
|
|
997
1065
|
dialog = inject(MatDialog);
|
|
998
1066
|
overlay = inject(Overlay);
|
|
999
1067
|
breakpointObserver = inject(BreakpointObserver);
|
|
1068
|
+
zIndexService = inject(DialogZIndexService);
|
|
1000
1069
|
// An observable that emits true if the viewport matches mobile dimensions.
|
|
1001
1070
|
isMobile$ = this.breakpointObserver
|
|
1002
1071
|
.observe([Breakpoints.HandsetPortrait, Breakpoints.HandsetLandscape])
|
|
@@ -1010,7 +1079,10 @@ class AdvancedDialogService {
|
|
|
1010
1079
|
*/
|
|
1011
1080
|
async open(component, config = {}) {
|
|
1012
1081
|
const dialogConfig = await this.buildDialogConfig(config);
|
|
1013
|
-
|
|
1082
|
+
const dialogRef = this.dialog.open(component, dialogConfig);
|
|
1083
|
+
// Aplicar z-index centralizado
|
|
1084
|
+
this.zIndexService.applyZIndex(dialogRef);
|
|
1085
|
+
return dialogRef;
|
|
1014
1086
|
}
|
|
1015
1087
|
/**
|
|
1016
1088
|
* A powerful helper to open a component inside our standard, branded "wrapper".
|
|
@@ -1026,7 +1098,10 @@ class AdvancedDialogService {
|
|
|
1026
1098
|
data: wrapperConfig,
|
|
1027
1099
|
};
|
|
1028
1100
|
const dialogConfig = await this.buildDialogConfig(configWithWrapperData);
|
|
1029
|
-
|
|
1101
|
+
const dialogRef = this.dialog.open(DialogWrapper, dialogConfig);
|
|
1102
|
+
// Aplicar z-index centralizado
|
|
1103
|
+
this.zIndexService.applyZIndex(dialogRef);
|
|
1104
|
+
return dialogRef;
|
|
1030
1105
|
}
|
|
1031
1106
|
/**
|
|
1032
1107
|
* Helper to open a dialog and only get an observable of the result.
|
|
@@ -1623,6 +1698,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
1623
1698
|
|
|
1624
1699
|
class AlertDialogService {
|
|
1625
1700
|
dialog = inject(MatDialog);
|
|
1701
|
+
zIndexService = inject(DialogZIndexService);
|
|
1626
1702
|
defaultOptions = {
|
|
1627
1703
|
width: '400px',
|
|
1628
1704
|
showConfirmButton: true,
|
|
@@ -1639,7 +1715,21 @@ class AlertDialogService {
|
|
|
1639
1715
|
reverseButtons: false,
|
|
1640
1716
|
focusConfirm: true,
|
|
1641
1717
|
scrollbarPadding: true,
|
|
1642
|
-
position: 'center'
|
|
1718
|
+
position: 'center',
|
|
1719
|
+
draggable: false,
|
|
1720
|
+
allowMultiple: false, // Por defecto no permitir múltiples alerts
|
|
1721
|
+
// Nuevas opciones por defecto
|
|
1722
|
+
layout: 'modern',
|
|
1723
|
+
iconPosition: 'left',
|
|
1724
|
+
contentAlignment: 'left',
|
|
1725
|
+
showCloseButton: true,
|
|
1726
|
+
closeButtonPosition: 'top-right',
|
|
1727
|
+
animation: 'fade',
|
|
1728
|
+
animationDuration: 300,
|
|
1729
|
+
toastMode: false,
|
|
1730
|
+
toastPosition: 'top-right',
|
|
1731
|
+
autoClose: true,
|
|
1732
|
+
progressBar: true,
|
|
1643
1733
|
};
|
|
1644
1734
|
/**
|
|
1645
1735
|
* Configurar opciones por defecto para todos los diálogos
|
|
@@ -1673,7 +1763,9 @@ class AlertDialogService {
|
|
|
1673
1763
|
reverseButtons: false,
|
|
1674
1764
|
focusConfirm: true,
|
|
1675
1765
|
scrollbarPadding: true,
|
|
1676
|
-
position: 'center'
|
|
1766
|
+
position: 'center',
|
|
1767
|
+
draggable: false,
|
|
1768
|
+
allowMultiple: false,
|
|
1677
1769
|
};
|
|
1678
1770
|
}
|
|
1679
1771
|
/**
|
|
@@ -1681,8 +1773,24 @@ class AlertDialogService {
|
|
|
1681
1773
|
*/
|
|
1682
1774
|
fire(options) {
|
|
1683
1775
|
const mergedOptions = { ...this.defaultOptions, ...options };
|
|
1776
|
+
// Si allowMultiple es false (por defecto), cerrar todos los diálogos existentes
|
|
1777
|
+
if (!mergedOptions.allowMultiple) {
|
|
1778
|
+
this.closeAll();
|
|
1779
|
+
}
|
|
1780
|
+
// Configuración especial para modo toast
|
|
1781
|
+
if (mergedOptions.toastMode) {
|
|
1782
|
+
mergedOptions.width = mergedOptions.width || '350px';
|
|
1783
|
+
mergedOptions.showConfirmButton = mergedOptions.showConfirmButton ?? false;
|
|
1784
|
+
mergedOptions.timer = mergedOptions.timer || 4000;
|
|
1785
|
+
mergedOptions.timerProgressBar = mergedOptions.progressBar ?? true;
|
|
1786
|
+
mergedOptions.position = this.getToastPosition(mergedOptions.toastPosition || 'top-right');
|
|
1787
|
+
mergedOptions.disableClose = false;
|
|
1788
|
+
mergedOptions.animation = mergedOptions.animation || 'slide';
|
|
1789
|
+
}
|
|
1684
1790
|
// Calcular posición del diálogo
|
|
1685
|
-
const position =
|
|
1791
|
+
const position = mergedOptions.toastMode
|
|
1792
|
+
? this.getToastDialogPosition(mergedOptions.toastPosition || 'top-right')
|
|
1793
|
+
: this.getDialogPosition(mergedOptions.position || 'center');
|
|
1686
1794
|
const dialogRef = this.dialog.open(AlertDialog, {
|
|
1687
1795
|
width: mergedOptions.width,
|
|
1688
1796
|
minWidth: mergedOptions.minWidth,
|
|
@@ -1696,8 +1804,10 @@ class AlertDialogService {
|
|
|
1696
1804
|
closeOnNavigation: true,
|
|
1697
1805
|
autoFocus: mergedOptions.focusConfirm !== false,
|
|
1698
1806
|
restoreFocus: true,
|
|
1699
|
-
hasBackdrop:
|
|
1807
|
+
hasBackdrop: !mergedOptions.toastMode,
|
|
1700
1808
|
});
|
|
1809
|
+
// Aplicar z-index dinámico usando el servicio centralizado
|
|
1810
|
+
this.zIndexService.applyZIndex(dialogRef);
|
|
1701
1811
|
// Callbacks de ciclo de vida
|
|
1702
1812
|
if (mergedOptions.willOpen) {
|
|
1703
1813
|
mergedOptions.willOpen();
|
|
@@ -1714,7 +1824,7 @@ class AlertDialogService {
|
|
|
1714
1824
|
isConfirmed: true,
|
|
1715
1825
|
isDismissed: false,
|
|
1716
1826
|
isDenied: false,
|
|
1717
|
-
dismiss: 'timer'
|
|
1827
|
+
dismiss: 'timer',
|
|
1718
1828
|
});
|
|
1719
1829
|
}
|
|
1720
1830
|
}, mergedOptions.timer);
|
|
@@ -1800,7 +1910,7 @@ class AlertDialogService {
|
|
|
1800
1910
|
type: 'question',
|
|
1801
1911
|
showCancelButton: true,
|
|
1802
1912
|
confirmText: opts.confirmText || 'Sí',
|
|
1803
|
-
cancelText: opts.cancelText || 'No'
|
|
1913
|
+
cancelText: opts.cancelText || 'No',
|
|
1804
1914
|
});
|
|
1805
1915
|
}
|
|
1806
1916
|
/**
|
|
@@ -1811,23 +1921,37 @@ class AlertDialogService {
|
|
|
1811
1921
|
type: 'question',
|
|
1812
1922
|
showCancelButton: true,
|
|
1813
1923
|
...options,
|
|
1814
|
-
input: options.input || 'text'
|
|
1924
|
+
input: options.input || 'text',
|
|
1925
|
+
});
|
|
1926
|
+
}
|
|
1927
|
+
/**
|
|
1928
|
+
* Diálogo de confirmación para eliminar
|
|
1929
|
+
*/
|
|
1930
|
+
delete(options) {
|
|
1931
|
+
const opts = typeof options === 'string'
|
|
1932
|
+
? { message: options, title: '¿Eliminar elemento?' }
|
|
1933
|
+
: { title: '¿Eliminar elemento?', ...options };
|
|
1934
|
+
return this.fire({
|
|
1935
|
+
...opts,
|
|
1936
|
+
type: 'delete',
|
|
1937
|
+
showCancelButton: true,
|
|
1938
|
+
confirmText: opts.confirmText || 'Eliminar',
|
|
1939
|
+
cancelText: opts.cancelText || 'Cancelar',
|
|
1940
|
+
confirmButtonVariant: 'danger',
|
|
1815
1941
|
});
|
|
1816
1942
|
}
|
|
1817
1943
|
/**
|
|
1818
1944
|
* Toast notification (auto-cierre, posición personalizada)
|
|
1819
1945
|
*/
|
|
1820
1946
|
toast(options) {
|
|
1821
|
-
const opts = typeof options === 'string'
|
|
1822
|
-
? { message: options }
|
|
1823
|
-
: options;
|
|
1947
|
+
const opts = typeof options === 'string' ? { message: options } : options;
|
|
1824
1948
|
return this.fire({
|
|
1825
1949
|
timer: 3000,
|
|
1826
1950
|
timerProgressBar: true,
|
|
1827
1951
|
showConfirmButton: false,
|
|
1828
1952
|
position: 'top-end',
|
|
1829
1953
|
width: '350px',
|
|
1830
|
-
...opts
|
|
1954
|
+
...opts,
|
|
1831
1955
|
});
|
|
1832
1956
|
}
|
|
1833
1957
|
/**
|
|
@@ -1838,15 +1962,15 @@ class AlertDialogService {
|
|
|
1838
1962
|
}
|
|
1839
1963
|
getDialogPosition(position) {
|
|
1840
1964
|
const positions = {
|
|
1841
|
-
|
|
1965
|
+
top: { top: '20px' },
|
|
1842
1966
|
'top-start': { top: '20px', left: '20px' },
|
|
1843
1967
|
'top-end': { top: '20px', right: '20px' },
|
|
1844
|
-
|
|
1968
|
+
center: {},
|
|
1845
1969
|
'center-start': { left: '20px' },
|
|
1846
1970
|
'center-end': { right: '20px' },
|
|
1847
|
-
|
|
1971
|
+
bottom: { bottom: '20px' },
|
|
1848
1972
|
'bottom-start': { bottom: '20px', left: '20px' },
|
|
1849
|
-
'bottom-end': { bottom: '20px', right: '20px' }
|
|
1973
|
+
'bottom-end': { bottom: '20px', right: '20px' },
|
|
1850
1974
|
};
|
|
1851
1975
|
return positions[position] || {};
|
|
1852
1976
|
}
|
|
@@ -1855,6 +1979,29 @@ class AlertDialogService {
|
|
|
1855
1979
|
if (options.customClass) {
|
|
1856
1980
|
classes.push(options.customClass);
|
|
1857
1981
|
}
|
|
1982
|
+
if (options.draggable) {
|
|
1983
|
+
classes.push('draggable-dialog');
|
|
1984
|
+
}
|
|
1985
|
+
// Agregar clases para layout
|
|
1986
|
+
if (options.layout) {
|
|
1987
|
+
classes.push(`layout-${options.layout}`);
|
|
1988
|
+
}
|
|
1989
|
+
// Agregar clases para posición de icono
|
|
1990
|
+
if (options.iconPosition) {
|
|
1991
|
+
classes.push(`icon-${options.iconPosition}`);
|
|
1992
|
+
}
|
|
1993
|
+
// Agregar clases para alineación de contenido
|
|
1994
|
+
if (options.contentAlignment) {
|
|
1995
|
+
classes.push(`content-${options.contentAlignment}`);
|
|
1996
|
+
}
|
|
1997
|
+
// Agregar clase para modo toast
|
|
1998
|
+
if (options.toastMode) {
|
|
1999
|
+
classes.push('toast-mode');
|
|
2000
|
+
}
|
|
2001
|
+
// Agregar clase para animación
|
|
2002
|
+
if (options.animation) {
|
|
2003
|
+
classes.push(`animation-${options.animation}`);
|
|
2004
|
+
}
|
|
1858
2005
|
if (options.panelClass) {
|
|
1859
2006
|
if (Array.isArray(options.panelClass)) {
|
|
1860
2007
|
classes.push(...options.panelClass);
|
|
@@ -1865,13 +2012,35 @@ class AlertDialogService {
|
|
|
1865
2012
|
}
|
|
1866
2013
|
return classes;
|
|
1867
2014
|
}
|
|
2015
|
+
getToastPosition(position) {
|
|
2016
|
+
const positionMap = {
|
|
2017
|
+
'top-right': 'top-end',
|
|
2018
|
+
'top-left': 'top-start',
|
|
2019
|
+
'bottom-right': 'bottom-end',
|
|
2020
|
+
'bottom-left': 'bottom-start',
|
|
2021
|
+
'top-center': 'top',
|
|
2022
|
+
'bottom-center': 'bottom',
|
|
2023
|
+
};
|
|
2024
|
+
return positionMap[position] || 'top-end';
|
|
2025
|
+
}
|
|
2026
|
+
getToastDialogPosition(position) {
|
|
2027
|
+
const positions = {
|
|
2028
|
+
'top-right': { top: '20px', right: '20px' },
|
|
2029
|
+
'top-left': { top: '20px', left: '20px' },
|
|
2030
|
+
'bottom-right': { bottom: '20px', right: '20px' },
|
|
2031
|
+
'bottom-left': { bottom: '20px', left: '20px' },
|
|
2032
|
+
'top-center': { top: '20px' },
|
|
2033
|
+
'bottom-center': { bottom: '20px' },
|
|
2034
|
+
};
|
|
2035
|
+
return positions[position] || positions['top-right'];
|
|
2036
|
+
}
|
|
1868
2037
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AlertDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1869
2038
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AlertDialogService, providedIn: 'root' });
|
|
1870
2039
|
}
|
|
1871
2040
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AlertDialogService, decorators: [{
|
|
1872
2041
|
type: Injectable,
|
|
1873
2042
|
args: [{
|
|
1874
|
-
providedIn: 'root'
|
|
2043
|
+
providedIn: 'root',
|
|
1875
2044
|
}]
|
|
1876
2045
|
}] });
|
|
1877
2046
|
|
|
@@ -5624,18 +5793,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
5624
5793
|
|
|
5625
5794
|
class AlertDialog {
|
|
5626
5795
|
inputField;
|
|
5796
|
+
dialogTitle;
|
|
5627
5797
|
container;
|
|
5628
5798
|
componentRef = null;
|
|
5799
|
+
timerInterval;
|
|
5629
5800
|
inputValue = '';
|
|
5630
5801
|
validationError = null;
|
|
5631
5802
|
timerProgress = 100;
|
|
5632
|
-
timerInterval;
|
|
5633
5803
|
sanitizedHtml;
|
|
5634
5804
|
sanitizedFooter = null;
|
|
5635
5805
|
dialogRef = inject((MatDialogRef));
|
|
5636
5806
|
data = inject(MAT_DIALOG_DATA);
|
|
5637
5807
|
sanitizer = inject(DomSanitizer);
|
|
5638
|
-
|
|
5808
|
+
renderer = inject(Renderer2);
|
|
5809
|
+
elementRef = inject(ElementRef);
|
|
5810
|
+
cdr = inject(ChangeDetectorRef);
|
|
5811
|
+
zIndexService = inject(DialogZIndexService);
|
|
5639
5812
|
constructor() {
|
|
5640
5813
|
this.sanitizedHtml = this.sanitizer.bypassSecurityTrustHtml(this.data.html || '');
|
|
5641
5814
|
}
|
|
@@ -5651,13 +5824,18 @@ class AlertDialog {
|
|
|
5651
5824
|
startTimer() {
|
|
5652
5825
|
if (!this.data.timer)
|
|
5653
5826
|
return;
|
|
5827
|
+
console.log('Starting timer with duration:', this.data.timer);
|
|
5654
5828
|
const startTime = Date.now();
|
|
5655
5829
|
const endTime = startTime + this.data.timer;
|
|
5830
|
+
this.timerProgress = 100;
|
|
5656
5831
|
this.timerInterval = setInterval(() => {
|
|
5657
5832
|
const now = Date.now();
|
|
5658
5833
|
const remaining = endTime - now;
|
|
5659
5834
|
if (remaining <= 0) {
|
|
5660
5835
|
clearInterval(this.timerInterval);
|
|
5836
|
+
this.timerProgress = 0;
|
|
5837
|
+
this.cdr.detectChanges();
|
|
5838
|
+
console.log('Timer finished, closing dialog');
|
|
5661
5839
|
this.dialogRef.close({
|
|
5662
5840
|
isConfirmed: false,
|
|
5663
5841
|
isDismissed: true,
|
|
@@ -5666,7 +5844,11 @@ class AlertDialog {
|
|
|
5666
5844
|
});
|
|
5667
5845
|
return;
|
|
5668
5846
|
}
|
|
5669
|
-
|
|
5847
|
+
const newProgress = (remaining / this.data.timer) * 100;
|
|
5848
|
+
if (Math.abs(this.timerProgress - newProgress) > 0.5) {
|
|
5849
|
+
this.timerProgress = newProgress;
|
|
5850
|
+
this.cdr.detectChanges();
|
|
5851
|
+
}
|
|
5670
5852
|
}, 50);
|
|
5671
5853
|
}
|
|
5672
5854
|
// Load dynamic component
|
|
@@ -5691,12 +5873,16 @@ class AlertDialog {
|
|
|
5691
5873
|
if (this.data.component) {
|
|
5692
5874
|
this.loadComponent();
|
|
5693
5875
|
}
|
|
5694
|
-
if (this.data.timer) {
|
|
5695
|
-
this.startTimer();
|
|
5696
|
-
}
|
|
5697
5876
|
if (this.data.footerHtml) {
|
|
5698
5877
|
this.sanitizedFooter = this.sanitizer.bypassSecurityTrustHtml(this.data.footerHtml);
|
|
5699
5878
|
}
|
|
5879
|
+
// Inicializar timer después de que el componente esté listo
|
|
5880
|
+
if (this.data.timer) {
|
|
5881
|
+
// Usar setTimeout para asegurar que el componente esté completamente inicializado
|
|
5882
|
+
setTimeout(() => {
|
|
5883
|
+
this.startTimer();
|
|
5884
|
+
}, 100);
|
|
5885
|
+
}
|
|
5700
5886
|
}
|
|
5701
5887
|
getIconName() {
|
|
5702
5888
|
if (this.data.icon) {
|
|
@@ -5713,10 +5899,20 @@ class AlertDialog {
|
|
|
5713
5899
|
return 'info';
|
|
5714
5900
|
case 'question':
|
|
5715
5901
|
return 'help';
|
|
5902
|
+
case 'delete':
|
|
5903
|
+
return 'delete_forever';
|
|
5716
5904
|
default:
|
|
5717
5905
|
return '';
|
|
5718
5906
|
}
|
|
5719
5907
|
}
|
|
5908
|
+
onClose() {
|
|
5909
|
+
this.dialogRef.close({
|
|
5910
|
+
isConfirmed: false,
|
|
5911
|
+
isDismissed: true,
|
|
5912
|
+
isDenied: false,
|
|
5913
|
+
dismiss: 'close',
|
|
5914
|
+
});
|
|
5915
|
+
}
|
|
5720
5916
|
getButtonVariant(buttonType) {
|
|
5721
5917
|
const variant = this.data[`${buttonType}ButtonVariant`];
|
|
5722
5918
|
if (variant)
|
|
@@ -5734,6 +5930,8 @@ class AlertDialog {
|
|
|
5734
5930
|
return 'info';
|
|
5735
5931
|
case 'question':
|
|
5736
5932
|
return 'primary';
|
|
5933
|
+
case 'delete':
|
|
5934
|
+
return 'danger';
|
|
5737
5935
|
default:
|
|
5738
5936
|
return 'primary';
|
|
5739
5937
|
}
|
|
@@ -5766,6 +5964,18 @@ class AlertDialog {
|
|
|
5766
5964
|
const style = this.data[`${buttonType}ButtonStyle`];
|
|
5767
5965
|
return style || 'elevated';
|
|
5768
5966
|
}
|
|
5967
|
+
getActionsAlignment() {
|
|
5968
|
+
switch (this.data.contentAlignment) {
|
|
5969
|
+
case 'left':
|
|
5970
|
+
return 'start';
|
|
5971
|
+
case 'center':
|
|
5972
|
+
return 'center';
|
|
5973
|
+
case 'right':
|
|
5974
|
+
return 'end';
|
|
5975
|
+
default:
|
|
5976
|
+
return 'end'; // Default alignment
|
|
5977
|
+
}
|
|
5978
|
+
}
|
|
5769
5979
|
async onConfirm() {
|
|
5770
5980
|
if (this.data.input && this.data.inputValidator) {
|
|
5771
5981
|
const error = await Promise.resolve(this.data.inputValidator(this.inputValue));
|
|
@@ -5850,9 +6060,6 @@ class AlertDialog {
|
|
|
5850
6060
|
this.onConfirm();
|
|
5851
6061
|
}
|
|
5852
6062
|
}
|
|
5853
|
-
closeWithResult(result) {
|
|
5854
|
-
this.dialogRef.close(result);
|
|
5855
|
-
}
|
|
5856
6063
|
getConfirmColor() {
|
|
5857
6064
|
if (!this.data.confirmButtonColor)
|
|
5858
6065
|
return 'primary';
|
|
@@ -5901,8 +6108,17 @@ class AlertDialog {
|
|
|
5901
6108
|
}
|
|
5902
6109
|
return this.data.denyButtonColor;
|
|
5903
6110
|
}
|
|
6111
|
+
// ===== CDK DRAG FUNCTIONALITY =====
|
|
6112
|
+
/**
|
|
6113
|
+
* Brings the dialog to the front by adjusting its z-index.
|
|
6114
|
+
* Uses the centralized DialogZIndexService for consistent z-index management.
|
|
6115
|
+
* Called when the dialog header is clicked.
|
|
6116
|
+
*/
|
|
6117
|
+
bringToFront() {
|
|
6118
|
+
this.zIndexService.bringToFront(this.elementRef.nativeElement);
|
|
6119
|
+
}
|
|
5904
6120
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AlertDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5905
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: AlertDialog, isStandalone: true, selector: "acp-alert-dialog", viewQueries: [{ propertyName: "inputField", first: true, predicate: ["inputField"], descendants: true }, { propertyName: "container", first: true, predicate: ["dynamicComponentContainer"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<div\n class=\"alert-dialog\"\n [attr.aria-label]=\"data.ariaLabel\"\n [attr.aria-describedby]=\"data.ariaDescribedBy\"\n>\n <!-- Timer Progress Bar -->\n @if (data.timer && data.timerProgressBar) {\n <mat-progress-bar mode=\"determinate\" [value]=\"timerProgress\" class=\"timer-progress\">\n </mat-progress-bar>\n }\n\n <!-- Image -->\n @if (data.imageUrl) {\n <div class=\"alert-dialog-image\">\n <img\n [src]=\"data.imageUrl\"\n [alt]=\"data.imageAlt || 'Alert image'\"\n [style.width]=\"data.imageWidth || 'auto'\"\n [style.height]=\"data.imageHeight || 'auto'\"\n [style.max-width]=\"data.imageWidth || '100%'\"\n />\n </div>\n }\n\n <!-- Icon -->\n @if (data.type || data.icon) {\n <div class=\"alert-dialog-icon\" [ngClass]=\"'icon-' + (data.type || 'custom')\">\n <mat-icon class=\"icon-large\" [style.color]=\"data.iconColor\"> {{ getIconName() }} </mat-icon>\n </div>\n }\n\n <!-- Title -->\n @if (data.title) {\n <h2 mat-dialog-title class=\"alert-dialog-title\">{{ data.title }}</h2>\n }\n\n <!-- Content -->\n <mat-dialog-content class=\"alert-dialog-content\">\n <!-- Dynamic Component -->\n @if (data.component) {\n <div #dynamicComponentContainer></div>\n } @if (data.html) {\n <div [innerHTML]=\"sanitizedHtml\"></div>\n } @else if (data.message) {\n <p class=\"alert-message\">{{ data.message }}</p>\n }\n\n <!-- Input Field -->\n @if (data.input) {\n <mat-form-field appearance=\"outline\" class=\"alert-input-field\">\n @if (data.inputLabel) {\n <mat-label>{{ data.inputLabel }}</mat-label>\n } @if (data.input === 'textarea') {\n <textarea\n matInput\n #inputField\n [(ngModel)]=\"inputValue\"\n [placeholder]=\"data.inputPlaceholder || ''\"\n [type]=\"data.input\"\n rows=\"4\"\n (keyup.enter)=\"onInputEnter()\"\n [attr.aria-invalid]=\"!!validationError\"\n >\n </textarea>\n } @else {\n <input\n matInput\n #inputField\n [(ngModel)]=\"inputValue\"\n [placeholder]=\"data.inputPlaceholder || ''\"\n [type]=\"data.input\"\n (keyup.enter)=\"onInputEnter()\"\n [attr.aria-invalid]=\"!!validationError\"\n />\n } @if (validationError) {\n <mat-error>{{ validationError }}</mat-error>\n }\n </mat-form-field>\n }\n </mat-dialog-content>\n\n <!-- Actions -->\n <mat-dialog-actions\n class=\"alert-dialog-actions\"\n [class.reverse-buttons]=\"data.reverseButtons\"\n [class.vertical-buttons]=\"data.verticalButtons\"\n align=\"center\"\n >\n @if (data.showDenyButton) {\n <acp-button\n type=\"button\"\n [matStyle]=\"getButtonStyle('deny')\"\n [variant]=\"getButtonVariant('deny')\"\n [icon]=\"getButtonIcon('deny')\"\n (handleClick)=\"onDeny()\"\n [text]=\"data.denyText || 'No'\"\n [disabled]=\"data.disableDenyButton?? false\"\n [class.spinning]=\"data.processing && data.processingButton === 'deny'\"\n [class.full-width]=\"data.fullWidthButtons\"\n />\n } @if (data.showCancelButton) {\n <acp-button\n type=\"button\"\n [matStyle]=\"getButtonStyle('cancel')\"\n [variant]=\"getButtonVariant('cancel')\"\n [icon]=\"getButtonIcon('cancel')\"\n (handleClick)=\"onCancel()\"\n [text]=\"data.cancelText || 'Cancel'\"\n [disabled]=\"data.disableCancelButton??false\"\n [class.spinning]=\"data.processing && data.processingButton === 'cancel'\"\n [class.full-width]=\"data.fullWidthButtons\"\n />\n } @if (data.showConfirmButton !== false) {\n <acp-button\n type=\"button\"\n [matStyle]=\"getButtonStyle('confirm')\"\n [variant]=\"getButtonVariant('confirm')\"\n [icon]=\"getButtonIcon('confirm')\"\n (handleClick)=\"onConfirm()\"\n [text]=\"data.confirmText || 'OK'\"\n [disabled]=\"data.disableConfirmButton?? false\"\n [class.spinning]=\"data.processing && data.processingButton === 'confirm'\"\n [class.full-width]=\"data.fullWidthButtons\"\n [autofocus]=\"data.focusConfirm\"\n />\n }\n </mat-dialog-actions>\n\n <!-- Footer -->\n @if (data.footer || data.footerHtml) {\n <div class=\"alert-dialog-footer\">\n @if (data.footerHtml) {\n <div [innerHTML]=\"sanitizedFooter\"></div>\n } @else { {{ data.footer }} }\n </div>\n }\n</div>\n", styles: [".alert-dialog{text-align:center;padding:1rem;position:relative;overflow:hidden}.timer-progress{position:absolute;top:0;left:0;right:0;height:4px}.alert-dialog-image{margin:1rem auto;display:flex;justify-content:center;align-items:center}.alert-dialog-image img{max-width:100%;border-radius:8px}.alert-dialog-icon{margin:1rem auto;display:flex;justify-content:center;align-items:center}.icon-large{font-size:80px;width:80px;height:80px}.icon-success mat-icon{color:#10b981}.icon-error mat-icon{color:#ef4444}.icon-warning mat-icon{color:#f59e0b}.icon-info mat-icon{color:#3b82f6}.icon-question mat-icon{color:#8b5cf6}.alert-dialog-title{font-size:1.5rem;font-weight:600;text-align:center}.alert-dialog-content{color:#666;font-size:1rem;min-height:50px}.alert-input-field{width:100%;margin-top:1rem}.alert-dialog-actions{gap:.75rem;padding:1rem 0 .5rem;display:flex;justify-content:center}.alert-dialog-actions.reverse-buttons{flex-direction:row-reverse}.confirm-button,.cancel-button,.deny-button{min-width:100px}.cancel-button{color:#333}.alert-dialog-footer{margin-top:1rem;padding-top:1rem;border-top:1px solid #e0e0e0;font-size:.875rem;color:#666}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$2.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: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i2$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i2$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i2$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.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: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i5.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: Button, selector: "acp-button", inputs: ["variant", "text", "icon", "disabled", "type", "matStyle", "customClass", "reportFormat", "extended", "title", "ariaLabel", "name", "id", "form", "tabIndex", "testId"], outputs: ["handleClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6121
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: AlertDialog, isStandalone: true, selector: "acp-alert-dialog", viewQueries: [{ propertyName: "inputField", first: true, predicate: ["inputField"], descendants: true }, { propertyName: "dialogTitle", first: true, predicate: ["dialogTitle"], descendants: true }, { propertyName: "container", first: true, predicate: ["dynamicComponentContainer"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<div\n class=\"alert-dialog\"\n [class.modern-layout]=\"data.layout === 'modern'\"\n [class.toast-layout]=\"data.layout === 'toast' || data.toastMode\"\n [class.icon-left]=\"data.iconPosition === 'left'\"\n [class.icon-center]=\"data.iconPosition === 'center'\"\n [class.icon-top]=\"data.iconPosition === 'top'\"\n [class.content-left]=\"data.contentAlignment === 'left'\"\n [class.content-center]=\"data.contentAlignment === 'center'\"\n [class.content-right]=\"data.contentAlignment === 'right'\"\n [attr.aria-label]=\"data.ariaLabel\"\n [attr.aria-describedby]=\"data.ariaDescribedBy\"\n>\n <!-- Timer Progress Bar -->\n @if (data.timer && (data.timerProgressBar || data.progressBar || data.toastMode)) {\n <mat-progress-bar\n mode=\"determinate\"\n [value]=\"timerProgress\"\n class=\"timer-progress\"\n [class.toast-progress]=\"data.toastMode\"\n >\n </mat-progress-bar>\n }\n\n <!-- Alert Header -->\n @if (data.draggable) {\n <div\n class=\"acp-alert-header\"\n cdkDrag\n cdkDragRootElement=\".cdk-overlay-pane\"\n cdkDragHandle\n (mousedown)=\"bringToFront()\"\n >\n <!-- Icon -->\n @if (data.type || data.icon) {\n <div class=\"alert-dialog-icon\" [ngClass]=\"'icon-' + (data.type || 'custom')\">\n <mat-icon class=\"icon-large\" [style.color]=\"data.iconColor\"> {{ getIconName() }} </mat-icon>\n </div>\n }\n\n <!-- Toast Content (solo para modo toast) -->\n @if (data.toastMode || data.layout === 'toast') {\n <!-- Title y Message en l\u00EDnea para toast -->\n <div class=\"toast-content\">\n @if (data.title) {\n <span class=\"toast-title\" #dialogTitle>{{ data.title }}</span>\n } @if (data.message) {\n <span class=\"toast-message\">{{ data.message }}</span>\n }\n </div>\n }\n\n <!-- Close Button -->\n @if (data.showCloseButton) {\n <button\n mat-icon-button\n class=\"close-button\"\n [class.top-right]=\"data.closeButtonPosition === 'top-right'\"\n [class.top-left]=\"data.closeButtonPosition === 'top-left'\"\n (click)=\"onClose()\"\n aria-label=\"Cerrar\"\n >\n <mat-icon>close</mat-icon>\n </button>\n }\n </div>\n } @else {\n <div class=\"acp-alert-header\">\n <!-- Icon -->\n @if (data.type || data.icon) {\n <div class=\"alert-dialog-icon\" [ngClass]=\"'icon-' + (data.type || 'custom')\">\n <mat-icon class=\"icon-large\" [style.color]=\"data.iconColor\"> {{ getIconName() }} </mat-icon>\n </div>\n }\n\n <!-- Toast Content (solo para modo toast) -->\n @if (data.toastMode || data.layout === 'toast') {\n <!-- Title y Message en l\u00EDnea para toast -->\n <div class=\"toast-content\">\n @if (data.title) {\n <span class=\"toast-title\" #dialogTitle>{{ data.title }}</span>\n } @if (data.message) {\n <span class=\"toast-message\">{{ data.message }}</span>\n }\n </div>\n }\n\n <!-- Close Button -->\n @if (data.showCloseButton) {\n <button\n mat-icon-button\n class=\"close-button\"\n [class.top-right]=\"data.closeButtonPosition === 'top-right'\"\n [class.top-left]=\"data.closeButtonPosition === 'top-left'\"\n (click)=\"onClose()\"\n aria-label=\"Cerrar\"\n >\n <mat-icon>close</mat-icon>\n </button>\n }\n </div>\n }\n\n <!-- Content (solo para modo normal, no toast) -->\n @if (!(data.toastMode || data.layout === 'toast')) {\n <mat-dialog-content class=\"alert-dialog-content\">\n <!-- Title -->\n @if (data.title) {\n <h2 class=\"alert-dialog-title\" #dialogTitle>{{ data.title }}</h2>\n }\n <!-- Image -->\n @if (data.imageUrl) {\n <div class=\"alert-dialog-image\">\n <img\n [src]=\"data.imageUrl\"\n [alt]=\"data.imageAlt || 'Alert image'\"\n [style.width]=\"data.imageWidth || 'auto'\"\n [style.height]=\"data.imageHeight || 'auto'\"\n [style.max-width]=\"data.imageWidth || '100%'\"\n />\n </div>\n }\n\n <!-- Dynamic Component -->\n @if (data.component) {\n <div #dynamicComponentContainer></div>\n } @if (data.html) {\n <div [innerHTML]=\"sanitizedHtml\"></div>\n } @else if (data.message) {\n <p class=\"alert-message\">{{ data.message }}</p>\n }\n\n <!-- Input Field -->\n @if (data.input) {\n <mat-form-field appearance=\"outline\" class=\"alert-input-field\">\n @if (data.inputLabel) {\n <mat-label>{{ data.inputLabel }}</mat-label>\n } @if (data.input === 'textarea') {\n <textarea\n matInput\n #inputField\n [(ngModel)]=\"inputValue\"\n [placeholder]=\"data.inputPlaceholder || ''\"\n [type]=\"data.input\"\n rows=\"4\"\n (keyup.enter)=\"onInputEnter()\"\n [attr.aria-invalid]=\"!!validationError\"\n >\n </textarea>\n } @else {\n <input\n matInput\n #inputField\n [(ngModel)]=\"inputValue\"\n [placeholder]=\"data.inputPlaceholder || ''\"\n [type]=\"data.input\"\n (keyup.enter)=\"onInputEnter()\"\n [attr.aria-invalid]=\"!!validationError\"\n />\n } @if (validationError) {\n <mat-error>{{ validationError }}</mat-error>\n }\n </mat-form-field>\n }\n </mat-dialog-content>\n }\n\n <!-- Actions (solo para modo normal, no toast) -->\n @if (!(data.toastMode || data.layout === 'toast') && (data.showConfirmButton !== false ||\n data.showCancelButton || data.showDenyButton)) {\n <mat-dialog-actions\n class=\"alert-dialog-actions\"\n [class.reverse-buttons]=\"data.reverseButtons\"\n [class.vertical-buttons]=\"data.verticalButtons\"\n [align]=\"getActionsAlignment()\"\n >\n @if (data.showDenyButton) {\n <acp-button\n type=\"button\"\n [matStyle]=\"getButtonStyle('deny')\"\n [variant]=\"getButtonVariant('deny')\"\n [icon]=\"getButtonIcon('deny')\"\n (handleClick)=\"onDeny()\"\n [text]=\"data.denyText || 'No'\"\n [disabled]=\"data.disableDenyButton?? false\"\n [class.spinning]=\"data.processing && data.processingButton === 'deny'\"\n [class.full-width]=\"data.fullWidthButtons\"\n />\n } @if (data.showCancelButton) {\n <acp-button\n type=\"button\"\n [matStyle]=\"getButtonStyle('cancel')\"\n [variant]=\"getButtonVariant('cancel')\"\n [icon]=\"getButtonIcon('cancel')\"\n (handleClick)=\"onCancel()\"\n [text]=\"data.cancelText || 'Cancel'\"\n [disabled]=\"data.disableCancelButton??false\"\n [class.spinning]=\"data.processing && data.processingButton === 'cancel'\"\n [class.full-width]=\"data.fullWidthButtons\"\n />\n } @if (data.showConfirmButton !== false) {\n <acp-button\n type=\"button\"\n [matStyle]=\"getButtonStyle('confirm')\"\n [variant]=\"getButtonVariant('confirm')\"\n [icon]=\"getButtonIcon('confirm')\"\n (handleClick)=\"onConfirm()\"\n [text]=\"data.confirmText || 'OK'\"\n [disabled]=\"data.disableConfirmButton?? false\"\n [class.spinning]=\"data.processing && data.processingButton === 'confirm'\"\n [class.full-width]=\"data.fullWidthButtons\"\n [autofocus]=\"data.focusConfirm\"\n />\n }\n </mat-dialog-actions>\n }\n\n <!-- Footer -->\n @if (data.footer || data.footerHtml) {\n <div class=\"alert-dialog-footer\">\n @if (data.footerHtml) {\n <div [innerHTML]=\"sanitizedFooter\"></div>\n } @else { {{ data.footer }} }\n </div>\n }\n</div>\n", styles: [".alert-dialog{position:relative;overflow:hidden;padding:0;display:flex;flex-direction:column;border-radius:16px}.acp-alert-header{display:flex;align-items:flex-start;justify-content:space-between;padding:24px 24px 0;position:relative}.acp-alert-header .alert-dialog-icon{margin:4px 0 0;flex-shrink:0}.alert-dialog-title{margin:0 0 12px;font-size:20px;font-weight:600;line-height:1.2;color:#1a1a1a;text-align:left}.alert-dialog-content{text-align:left}.alert-dialog-content .alert-message{margin:0;font-size:16px;line-height:1.4;color:#666}.alert-dialog-actions{margin:24px;padding:0;gap:12px}.close-button{position:relative;z-index:10;width:40px;height:40px;margin:0;background-color:#0000000d;border-radius:50%}.close-button mat-icon{font-size:20px;width:20px;height:20px;color:#0009}.close-button:hover{background-color:#0000001a}.alert-dialog.modern-layout .acp-alert-header{padding:24px 24px 0}.alert-dialog.modern-layout .acp-alert-header .alert-dialog-icon{margin-right:16px}.alert-dialog.modern-layout .acp-alert-header .alert-dialog-icon .icon-large{font-size:48px;width:48px;height:48px}.alert-dialog.toast-layout{border-radius:8px}.alert-dialog.toast-layout .acp-alert-header{padding:16px;align-items:center;gap:12px}.alert-dialog.toast-layout .acp-alert-header .alert-dialog-icon{margin:0;flex-shrink:0}.alert-dialog.toast-layout .acp-alert-header .alert-dialog-icon .icon-large{font-size:24px;width:24px;height:24px}.alert-dialog.toast-layout .acp-alert-header .toast-content{flex:1;display:flex;flex-direction:column;gap:2px;min-width:0}.alert-dialog.toast-layout .acp-alert-header .toast-content .toast-title{font-size:14px;font-weight:600;line-height:1.2;color:#1a1a1a;margin:0}.alert-dialog.toast-layout .acp-alert-header .toast-content .toast-message{font-size:13px;line-height:1.3;color:#666;margin:0}.alert-dialog.toast-layout .acp-alert-header .close-button{margin:0;flex-shrink:0}.alert-dialog.toast-layout .alert-dialog-content,.alert-dialog.toast-layout .alert-dialog-actions{display:none}.alert-dialog.icon-center .acp-alert-header{flex-direction:column;text-align:center;align-items:center;padding:24px 24px 16px}.alert-dialog.icon-center .acp-alert-header .alert-dialog-icon{margin:0 0 16px}.alert-dialog.icon-center .acp-alert-header .close-button{position:absolute;top:16px;right:16px}.alert-dialog.icon-center .alert-dialog-title,.alert-dialog.icon-center .alert-dialog-content{text-align:center}.alert-dialog.icon-top .acp-alert-header{flex-direction:column;align-items:flex-start;padding:24px 24px 16px}.alert-dialog.icon-top .acp-alert-header .alert-dialog-icon{margin:0 0 16px}.alert-dialog.icon-top .acp-alert-header .close-button{position:absolute;top:16px;right:16px}.alert-dialog.content-left .alert-dialog-title,.alert-dialog.content-left .alert-dialog-content{text-align:left}.alert-dialog.content-center .acp-alert-header{justify-content:center}.alert-dialog.content-center .alert-dialog-title,.alert-dialog.content-center .alert-dialog-content{text-align:center}.alert-dialog.content-right .alert-dialog-title,.alert-dialog.content-right .alert-dialog-content{text-align:right}.timer-progress{position:absolute;top:0;left:0;right:0;height:4px;z-index:5;border-radius:0}.timer-progress.toast-progress{height:3px;border-radius:0}:host ::ng-deep .timer-progress .mdc-linear-progress__bar{transition:transform 50ms linear}:host ::ng-deep .timer-progress .mdc-linear-progress__buffer{background-color:#0000001a}.icon-success mat-icon{color:#10b981}.icon-error mat-icon{color:#ef4444}.icon-warning mat-icon{color:#f59e0b}.icon-info mat-icon{color:#3b82f6}.icon-question mat-icon{color:#8b5cf6}.icon-delete mat-icon{color:#ef4444}.alert-dialog-image{margin:1rem auto;display:flex;justify-content:center;align-items:center}.alert-dialog-image img{max-width:100%;border-radius:8px}.alert-input-field{width:100%;margin-top:1rem}.confirm-button,.cancel-button,.deny-button{min-width:100px}.cancel-button{color:#333}.alert-dialog-footer{margin:0 24px 24px;padding-top:1rem;border-top:1px solid #e0e0e0;font-size:.875rem;color:#666}.acp-alert-header[cdkDrag]{cursor:move;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.acp-alert-header[cdkDrag]:hover{background-color:#00000005}.cdk-drag-dragging{user-select:none!important;-webkit-user-select:none!important;-moz-user-select:none!important;-ms-user-select:none!important}:host ::ng-deep .animation-fade .mat-mdc-dialog-container{animation:fadeIn .3s ease-out}:host ::ng-deep .animation-slide .mat-mdc-dialog-container{animation:slideIn .3s ease-out}:host ::ng-deep .animation-bounce .mat-mdc-dialog-container{animation:bounceIn .5s ease-out}:host ::ng-deep .animation-zoom .mat-mdc-dialog-container{animation:zoomIn .3s ease-out}:host ::ng-deep .toast-mode .mat-mdc-dialog-container{border-radius:8px;box-shadow:0 4px 12px #00000026;max-width:400px;animation:slideInRight .3s ease-out}:host ::ng-deep .layout-toast .mat-mdc-dialog-container{border-radius:8px;box-shadow:0 4px 12px #00000026;max-width:400px}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes slideIn{0%{transform:translateY(-20px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes slideInRight{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}@keyframes bounceIn{0%{transform:scale(.3);opacity:0}50%{transform:scale(1.05)}70%{transform:scale(.9)}to{transform:scale(1);opacity:1}}@keyframes zoomIn{0%{transform:scale(.8);opacity:0}to{transform:scale(1);opacity:1}}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$2.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: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i2$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i2$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i5.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: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i6.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i7.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i7.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: Button, selector: "acp-button", inputs: ["variant", "text", "icon", "disabled", "type", "matStyle", "customClass", "reportFormat", "extended", "title", "ariaLabel", "name", "id", "form", "tabIndex", "testId"], outputs: ["handleClick"] }], changeDetection: i0.ChangeDetectionStrategy.Default });
|
|
5906
6122
|
}
|
|
5907
6123
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AlertDialog, decorators: [{
|
|
5908
6124
|
type: Component,
|
|
@@ -5914,12 +6130,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
5914
6130
|
MatInputModule,
|
|
5915
6131
|
MatFormFieldModule,
|
|
5916
6132
|
MatProgressBarModule,
|
|
6133
|
+
DragDropModule,
|
|
5917
6134
|
NgClass,
|
|
5918
6135
|
Button,
|
|
5919
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"alert-dialog\"\n [attr.aria-label]=\"data.ariaLabel\"\n [attr.aria-describedby]=\"data.ariaDescribedBy\"\n>\n <!-- Timer Progress Bar -->\n @if (data.timer && data.timerProgressBar) {\n <mat-progress-bar mode=\"determinate\" [value]=\"timerProgress\" class=\"timer-progress\">\n </mat-progress-bar>\n }\n\n <!-- Image -->\n @if (data.imageUrl) {\n <div class=\"alert-dialog-image\">\n <img\n [src]=\"data.imageUrl\"\n [alt]=\"data.imageAlt || 'Alert image'\"\n [style.width]=\"data.imageWidth || 'auto'\"\n [style.height]=\"data.imageHeight || 'auto'\"\n [style.max-width]=\"data.imageWidth || '100%'\"\n />\n </div>\n }\n\n <!-- Icon -->\n @if (data.type || data.icon) {\n <div class=\"alert-dialog-icon\" [ngClass]=\"'icon-' + (data.type || 'custom')\">\n <mat-icon class=\"icon-large\" [style.color]=\"data.iconColor\"> {{ getIconName() }} </mat-icon>\n </div>\n }\n\n <!-- Title -->\n @if (data.title) {\n <h2 mat-dialog-title class=\"alert-dialog-title\">{{ data.title }}</h2>\n }\n\n <!-- Content -->\n <mat-dialog-content class=\"alert-dialog-content\">\n <!-- Dynamic Component -->\n @if (data.component) {\n <div #dynamicComponentContainer></div>\n } @if (data.html) {\n <div [innerHTML]=\"sanitizedHtml\"></div>\n } @else if (data.message) {\n <p class=\"alert-message\">{{ data.message }}</p>\n }\n\n <!-- Input Field -->\n @if (data.input) {\n <mat-form-field appearance=\"outline\" class=\"alert-input-field\">\n @if (data.inputLabel) {\n <mat-label>{{ data.inputLabel }}</mat-label>\n } @if (data.input === 'textarea') {\n <textarea\n matInput\n #inputField\n [(ngModel)]=\"inputValue\"\n [placeholder]=\"data.inputPlaceholder || ''\"\n [type]=\"data.input\"\n rows=\"4\"\n (keyup.enter)=\"onInputEnter()\"\n [attr.aria-invalid]=\"!!validationError\"\n >\n </textarea>\n } @else {\n <input\n matInput\n #inputField\n [(ngModel)]=\"inputValue\"\n [placeholder]=\"data.inputPlaceholder || ''\"\n [type]=\"data.input\"\n (keyup.enter)=\"onInputEnter()\"\n [attr.aria-invalid]=\"!!validationError\"\n />\n } @if (validationError) {\n <mat-error>{{ validationError }}</mat-error>\n }\n </mat-form-field>\n }\n </mat-dialog-content>\n\n <!-- Actions -->\n <mat-dialog-actions\n class=\"alert-dialog-actions\"\n [class.reverse-buttons]=\"data.reverseButtons\"\n [class.vertical-buttons]=\"data.verticalButtons\"\n align=\"center\"\n >\n @if (data.showDenyButton) {\n <acp-button\n type=\"button\"\n [matStyle]=\"getButtonStyle('deny')\"\n [variant]=\"getButtonVariant('deny')\"\n [icon]=\"getButtonIcon('deny')\"\n (handleClick)=\"onDeny()\"\n [text]=\"data.denyText || 'No'\"\n [disabled]=\"data.disableDenyButton?? false\"\n [class.spinning]=\"data.processing && data.processingButton === 'deny'\"\n [class.full-width]=\"data.fullWidthButtons\"\n />\n } @if (data.showCancelButton) {\n <acp-button\n type=\"button\"\n [matStyle]=\"getButtonStyle('cancel')\"\n [variant]=\"getButtonVariant('cancel')\"\n [icon]=\"getButtonIcon('cancel')\"\n (handleClick)=\"onCancel()\"\n [text]=\"data.cancelText || 'Cancel'\"\n [disabled]=\"data.disableCancelButton??false\"\n [class.spinning]=\"data.processing && data.processingButton === 'cancel'\"\n [class.full-width]=\"data.fullWidthButtons\"\n />\n } @if (data.showConfirmButton !== false) {\n <acp-button\n type=\"button\"\n [matStyle]=\"getButtonStyle('confirm')\"\n [variant]=\"getButtonVariant('confirm')\"\n [icon]=\"getButtonIcon('confirm')\"\n (handleClick)=\"onConfirm()\"\n [text]=\"data.confirmText || 'OK'\"\n [disabled]=\"data.disableConfirmButton?? false\"\n [class.spinning]=\"data.processing && data.processingButton === 'confirm'\"\n [class.full-width]=\"data.fullWidthButtons\"\n [autofocus]=\"data.focusConfirm\"\n />\n }\n </mat-dialog-actions>\n\n <!-- Footer -->\n @if (data.footer || data.footerHtml) {\n <div class=\"alert-dialog-footer\">\n @if (data.footerHtml) {\n <div [innerHTML]=\"sanitizedFooter\"></div>\n } @else { {{ data.footer }} }\n </div>\n }\n</div>\n", styles: [".alert-dialog{text-align:center;padding:1rem;position:relative;overflow:hidden}.timer-progress{position:absolute;top:0;left:0;right:0;height:4px}.alert-dialog-image{margin:1rem auto;display:flex;justify-content:center;align-items:center}.alert-dialog-image img{max-width:100%;border-radius:8px}.alert-dialog-icon{margin:1rem auto;display:flex;justify-content:center;align-items:center}.icon-large{font-size:80px;width:80px;height:80px}.icon-success mat-icon{color:#10b981}.icon-error mat-icon{color:#ef4444}.icon-warning mat-icon{color:#f59e0b}.icon-info mat-icon{color:#3b82f6}.icon-question mat-icon{color:#8b5cf6}.alert-dialog-title{font-size:1.5rem;font-weight:600;text-align:center}.alert-dialog-content{color:#666;font-size:1rem;min-height:50px}.alert-input-field{width:100%;margin-top:1rem}.alert-dialog-actions{gap:.75rem;padding:1rem 0 .5rem;display:flex;justify-content:center}.alert-dialog-actions.reverse-buttons{flex-direction:row-reverse}.confirm-button,.cancel-button,.deny-button{min-width:100px}.cancel-button{color:#333}.alert-dialog-footer{margin-top:1rem;padding-top:1rem;border-top:1px solid #e0e0e0;font-size:.875rem;color:#666}\n"] }]
|
|
6136
|
+
], changeDetection: ChangeDetectionStrategy.Default, template: "<div\n class=\"alert-dialog\"\n [class.modern-layout]=\"data.layout === 'modern'\"\n [class.toast-layout]=\"data.layout === 'toast' || data.toastMode\"\n [class.icon-left]=\"data.iconPosition === 'left'\"\n [class.icon-center]=\"data.iconPosition === 'center'\"\n [class.icon-top]=\"data.iconPosition === 'top'\"\n [class.content-left]=\"data.contentAlignment === 'left'\"\n [class.content-center]=\"data.contentAlignment === 'center'\"\n [class.content-right]=\"data.contentAlignment === 'right'\"\n [attr.aria-label]=\"data.ariaLabel\"\n [attr.aria-describedby]=\"data.ariaDescribedBy\"\n>\n <!-- Timer Progress Bar -->\n @if (data.timer && (data.timerProgressBar || data.progressBar || data.toastMode)) {\n <mat-progress-bar\n mode=\"determinate\"\n [value]=\"timerProgress\"\n class=\"timer-progress\"\n [class.toast-progress]=\"data.toastMode\"\n >\n </mat-progress-bar>\n }\n\n <!-- Alert Header -->\n @if (data.draggable) {\n <div\n class=\"acp-alert-header\"\n cdkDrag\n cdkDragRootElement=\".cdk-overlay-pane\"\n cdkDragHandle\n (mousedown)=\"bringToFront()\"\n >\n <!-- Icon -->\n @if (data.type || data.icon) {\n <div class=\"alert-dialog-icon\" [ngClass]=\"'icon-' + (data.type || 'custom')\">\n <mat-icon class=\"icon-large\" [style.color]=\"data.iconColor\"> {{ getIconName() }} </mat-icon>\n </div>\n }\n\n <!-- Toast Content (solo para modo toast) -->\n @if (data.toastMode || data.layout === 'toast') {\n <!-- Title y Message en l\u00EDnea para toast -->\n <div class=\"toast-content\">\n @if (data.title) {\n <span class=\"toast-title\" #dialogTitle>{{ data.title }}</span>\n } @if (data.message) {\n <span class=\"toast-message\">{{ data.message }}</span>\n }\n </div>\n }\n\n <!-- Close Button -->\n @if (data.showCloseButton) {\n <button\n mat-icon-button\n class=\"close-button\"\n [class.top-right]=\"data.closeButtonPosition === 'top-right'\"\n [class.top-left]=\"data.closeButtonPosition === 'top-left'\"\n (click)=\"onClose()\"\n aria-label=\"Cerrar\"\n >\n <mat-icon>close</mat-icon>\n </button>\n }\n </div>\n } @else {\n <div class=\"acp-alert-header\">\n <!-- Icon -->\n @if (data.type || data.icon) {\n <div class=\"alert-dialog-icon\" [ngClass]=\"'icon-' + (data.type || 'custom')\">\n <mat-icon class=\"icon-large\" [style.color]=\"data.iconColor\"> {{ getIconName() }} </mat-icon>\n </div>\n }\n\n <!-- Toast Content (solo para modo toast) -->\n @if (data.toastMode || data.layout === 'toast') {\n <!-- Title y Message en l\u00EDnea para toast -->\n <div class=\"toast-content\">\n @if (data.title) {\n <span class=\"toast-title\" #dialogTitle>{{ data.title }}</span>\n } @if (data.message) {\n <span class=\"toast-message\">{{ data.message }}</span>\n }\n </div>\n }\n\n <!-- Close Button -->\n @if (data.showCloseButton) {\n <button\n mat-icon-button\n class=\"close-button\"\n [class.top-right]=\"data.closeButtonPosition === 'top-right'\"\n [class.top-left]=\"data.closeButtonPosition === 'top-left'\"\n (click)=\"onClose()\"\n aria-label=\"Cerrar\"\n >\n <mat-icon>close</mat-icon>\n </button>\n }\n </div>\n }\n\n <!-- Content (solo para modo normal, no toast) -->\n @if (!(data.toastMode || data.layout === 'toast')) {\n <mat-dialog-content class=\"alert-dialog-content\">\n <!-- Title -->\n @if (data.title) {\n <h2 class=\"alert-dialog-title\" #dialogTitle>{{ data.title }}</h2>\n }\n <!-- Image -->\n @if (data.imageUrl) {\n <div class=\"alert-dialog-image\">\n <img\n [src]=\"data.imageUrl\"\n [alt]=\"data.imageAlt || 'Alert image'\"\n [style.width]=\"data.imageWidth || 'auto'\"\n [style.height]=\"data.imageHeight || 'auto'\"\n [style.max-width]=\"data.imageWidth || '100%'\"\n />\n </div>\n }\n\n <!-- Dynamic Component -->\n @if (data.component) {\n <div #dynamicComponentContainer></div>\n } @if (data.html) {\n <div [innerHTML]=\"sanitizedHtml\"></div>\n } @else if (data.message) {\n <p class=\"alert-message\">{{ data.message }}</p>\n }\n\n <!-- Input Field -->\n @if (data.input) {\n <mat-form-field appearance=\"outline\" class=\"alert-input-field\">\n @if (data.inputLabel) {\n <mat-label>{{ data.inputLabel }}</mat-label>\n } @if (data.input === 'textarea') {\n <textarea\n matInput\n #inputField\n [(ngModel)]=\"inputValue\"\n [placeholder]=\"data.inputPlaceholder || ''\"\n [type]=\"data.input\"\n rows=\"4\"\n (keyup.enter)=\"onInputEnter()\"\n [attr.aria-invalid]=\"!!validationError\"\n >\n </textarea>\n } @else {\n <input\n matInput\n #inputField\n [(ngModel)]=\"inputValue\"\n [placeholder]=\"data.inputPlaceholder || ''\"\n [type]=\"data.input\"\n (keyup.enter)=\"onInputEnter()\"\n [attr.aria-invalid]=\"!!validationError\"\n />\n } @if (validationError) {\n <mat-error>{{ validationError }}</mat-error>\n }\n </mat-form-field>\n }\n </mat-dialog-content>\n }\n\n <!-- Actions (solo para modo normal, no toast) -->\n @if (!(data.toastMode || data.layout === 'toast') && (data.showConfirmButton !== false ||\n data.showCancelButton || data.showDenyButton)) {\n <mat-dialog-actions\n class=\"alert-dialog-actions\"\n [class.reverse-buttons]=\"data.reverseButtons\"\n [class.vertical-buttons]=\"data.verticalButtons\"\n [align]=\"getActionsAlignment()\"\n >\n @if (data.showDenyButton) {\n <acp-button\n type=\"button\"\n [matStyle]=\"getButtonStyle('deny')\"\n [variant]=\"getButtonVariant('deny')\"\n [icon]=\"getButtonIcon('deny')\"\n (handleClick)=\"onDeny()\"\n [text]=\"data.denyText || 'No'\"\n [disabled]=\"data.disableDenyButton?? false\"\n [class.spinning]=\"data.processing && data.processingButton === 'deny'\"\n [class.full-width]=\"data.fullWidthButtons\"\n />\n } @if (data.showCancelButton) {\n <acp-button\n type=\"button\"\n [matStyle]=\"getButtonStyle('cancel')\"\n [variant]=\"getButtonVariant('cancel')\"\n [icon]=\"getButtonIcon('cancel')\"\n (handleClick)=\"onCancel()\"\n [text]=\"data.cancelText || 'Cancel'\"\n [disabled]=\"data.disableCancelButton??false\"\n [class.spinning]=\"data.processing && data.processingButton === 'cancel'\"\n [class.full-width]=\"data.fullWidthButtons\"\n />\n } @if (data.showConfirmButton !== false) {\n <acp-button\n type=\"button\"\n [matStyle]=\"getButtonStyle('confirm')\"\n [variant]=\"getButtonVariant('confirm')\"\n [icon]=\"getButtonIcon('confirm')\"\n (handleClick)=\"onConfirm()\"\n [text]=\"data.confirmText || 'OK'\"\n [disabled]=\"data.disableConfirmButton?? false\"\n [class.spinning]=\"data.processing && data.processingButton === 'confirm'\"\n [class.full-width]=\"data.fullWidthButtons\"\n [autofocus]=\"data.focusConfirm\"\n />\n }\n </mat-dialog-actions>\n }\n\n <!-- Footer -->\n @if (data.footer || data.footerHtml) {\n <div class=\"alert-dialog-footer\">\n @if (data.footerHtml) {\n <div [innerHTML]=\"sanitizedFooter\"></div>\n } @else { {{ data.footer }} }\n </div>\n }\n</div>\n", styles: [".alert-dialog{position:relative;overflow:hidden;padding:0;display:flex;flex-direction:column;border-radius:16px}.acp-alert-header{display:flex;align-items:flex-start;justify-content:space-between;padding:24px 24px 0;position:relative}.acp-alert-header .alert-dialog-icon{margin:4px 0 0;flex-shrink:0}.alert-dialog-title{margin:0 0 12px;font-size:20px;font-weight:600;line-height:1.2;color:#1a1a1a;text-align:left}.alert-dialog-content{text-align:left}.alert-dialog-content .alert-message{margin:0;font-size:16px;line-height:1.4;color:#666}.alert-dialog-actions{margin:24px;padding:0;gap:12px}.close-button{position:relative;z-index:10;width:40px;height:40px;margin:0;background-color:#0000000d;border-radius:50%}.close-button mat-icon{font-size:20px;width:20px;height:20px;color:#0009}.close-button:hover{background-color:#0000001a}.alert-dialog.modern-layout .acp-alert-header{padding:24px 24px 0}.alert-dialog.modern-layout .acp-alert-header .alert-dialog-icon{margin-right:16px}.alert-dialog.modern-layout .acp-alert-header .alert-dialog-icon .icon-large{font-size:48px;width:48px;height:48px}.alert-dialog.toast-layout{border-radius:8px}.alert-dialog.toast-layout .acp-alert-header{padding:16px;align-items:center;gap:12px}.alert-dialog.toast-layout .acp-alert-header .alert-dialog-icon{margin:0;flex-shrink:0}.alert-dialog.toast-layout .acp-alert-header .alert-dialog-icon .icon-large{font-size:24px;width:24px;height:24px}.alert-dialog.toast-layout .acp-alert-header .toast-content{flex:1;display:flex;flex-direction:column;gap:2px;min-width:0}.alert-dialog.toast-layout .acp-alert-header .toast-content .toast-title{font-size:14px;font-weight:600;line-height:1.2;color:#1a1a1a;margin:0}.alert-dialog.toast-layout .acp-alert-header .toast-content .toast-message{font-size:13px;line-height:1.3;color:#666;margin:0}.alert-dialog.toast-layout .acp-alert-header .close-button{margin:0;flex-shrink:0}.alert-dialog.toast-layout .alert-dialog-content,.alert-dialog.toast-layout .alert-dialog-actions{display:none}.alert-dialog.icon-center .acp-alert-header{flex-direction:column;text-align:center;align-items:center;padding:24px 24px 16px}.alert-dialog.icon-center .acp-alert-header .alert-dialog-icon{margin:0 0 16px}.alert-dialog.icon-center .acp-alert-header .close-button{position:absolute;top:16px;right:16px}.alert-dialog.icon-center .alert-dialog-title,.alert-dialog.icon-center .alert-dialog-content{text-align:center}.alert-dialog.icon-top .acp-alert-header{flex-direction:column;align-items:flex-start;padding:24px 24px 16px}.alert-dialog.icon-top .acp-alert-header .alert-dialog-icon{margin:0 0 16px}.alert-dialog.icon-top .acp-alert-header .close-button{position:absolute;top:16px;right:16px}.alert-dialog.content-left .alert-dialog-title,.alert-dialog.content-left .alert-dialog-content{text-align:left}.alert-dialog.content-center .acp-alert-header{justify-content:center}.alert-dialog.content-center .alert-dialog-title,.alert-dialog.content-center .alert-dialog-content{text-align:center}.alert-dialog.content-right .alert-dialog-title,.alert-dialog.content-right .alert-dialog-content{text-align:right}.timer-progress{position:absolute;top:0;left:0;right:0;height:4px;z-index:5;border-radius:0}.timer-progress.toast-progress{height:3px;border-radius:0}:host ::ng-deep .timer-progress .mdc-linear-progress__bar{transition:transform 50ms linear}:host ::ng-deep .timer-progress .mdc-linear-progress__buffer{background-color:#0000001a}.icon-success mat-icon{color:#10b981}.icon-error mat-icon{color:#ef4444}.icon-warning mat-icon{color:#f59e0b}.icon-info mat-icon{color:#3b82f6}.icon-question mat-icon{color:#8b5cf6}.icon-delete mat-icon{color:#ef4444}.alert-dialog-image{margin:1rem auto;display:flex;justify-content:center;align-items:center}.alert-dialog-image img{max-width:100%;border-radius:8px}.alert-input-field{width:100%;margin-top:1rem}.confirm-button,.cancel-button,.deny-button{min-width:100px}.cancel-button{color:#333}.alert-dialog-footer{margin:0 24px 24px;padding-top:1rem;border-top:1px solid #e0e0e0;font-size:.875rem;color:#666}.acp-alert-header[cdkDrag]{cursor:move;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.acp-alert-header[cdkDrag]:hover{background-color:#00000005}.cdk-drag-dragging{user-select:none!important;-webkit-user-select:none!important;-moz-user-select:none!important;-ms-user-select:none!important}:host ::ng-deep .animation-fade .mat-mdc-dialog-container{animation:fadeIn .3s ease-out}:host ::ng-deep .animation-slide .mat-mdc-dialog-container{animation:slideIn .3s ease-out}:host ::ng-deep .animation-bounce .mat-mdc-dialog-container{animation:bounceIn .5s ease-out}:host ::ng-deep .animation-zoom .mat-mdc-dialog-container{animation:zoomIn .3s ease-out}:host ::ng-deep .toast-mode .mat-mdc-dialog-container{border-radius:8px;box-shadow:0 4px 12px #00000026;max-width:400px;animation:slideInRight .3s ease-out}:host ::ng-deep .layout-toast .mat-mdc-dialog-container{border-radius:8px;box-shadow:0 4px 12px #00000026;max-width:400px}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes slideIn{0%{transform:translateY(-20px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes slideInRight{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}@keyframes bounceIn{0%{transform:scale(.3);opacity:0}50%{transform:scale(1.05)}70%{transform:scale(.9)}to{transform:scale(1);opacity:1}}@keyframes zoomIn{0%{transform:scale(.8);opacity:0}to{transform:scale(1);opacity:1}}\n"] }]
|
|
5920
6137
|
}], ctorParameters: () => [], propDecorators: { inputField: [{
|
|
5921
6138
|
type: ViewChild,
|
|
5922
6139
|
args: ['inputField']
|
|
6140
|
+
}], dialogTitle: [{
|
|
6141
|
+
type: ViewChild,
|
|
6142
|
+
args: ['dialogTitle']
|
|
5923
6143
|
}], container: [{
|
|
5924
6144
|
type: ViewChild,
|
|
5925
6145
|
args: ['dynamicComponentContainer', { read: ViewContainerRef, static: true }]
|
|
@@ -6062,5 +6282,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
6062
6282
|
* Generated bundle index. Do not edit.
|
|
6063
6283
|
*/
|
|
6064
6284
|
|
|
6065
|
-
export { ACP_DRAWER_DATA, ACP_DRAWER_DEFAULT_OPTIONS, ACP_POPOVER_CONTENT, ACP_POPOVER_DEFAULT_OPTIONS, ACP_POPOVER_SCROLL_STRATEGY, AUTOCOMPLETE_WRAPPER_CUSTOMER_CONFIG, AUTOCOMPLETE_WRAPPER_DEFAULT_CONFIG, AUTOCOMPLETE_WRAPPER_LOCAL_CONFIG, AUTOCOMPLETE_WRAPPER_PAGINATED_CONFIG, AUTOCOMPLETE_WRAPPER_PRODUCT_CONFIG, AUTOCOMPLETE_WRAPPER_SIMPLE_CONFIG, AcpDrawer, AcpDrawerConfig, AcpDrawerContainer, AcpDrawerRef, AcpPopover, AcpPopoverContent, AcpPopoverTarget, AcpPopoverTrigger, AdvancedDialogService, AlertDialog, AlertDialogService, AutocompleteWrapperService, Button, DATA_GRID_DEFAULT_OPTIONS, DataGrid, DateRangePicker, DialogWrapper, DynamicCard, DynamicSelect, GetTotalPipe, IconRegistryService, InputChip, KeyboardNavigationService, OverlayService, Pagination, ReusableAutocompleteComponent, Spinner, StatusDisplayPipe, SvgIcon, TabulatorTable, ThemeSwitcher, ThemeToggle, ToUpperCase, UserIcon, _AcpPopoverContentBase, createAutocompleteWrapperConfig, throwAcpPopoverInvalidPositionEnd, throwAcpPopoverInvalidPositionStart, throwAcpPopoverMissingError };
|
|
6285
|
+
export { ACP_DRAWER_DATA, ACP_DRAWER_DEFAULT_OPTIONS, ACP_POPOVER_CONTENT, ACP_POPOVER_DEFAULT_OPTIONS, ACP_POPOVER_SCROLL_STRATEGY, AUTOCOMPLETE_WRAPPER_CUSTOMER_CONFIG, AUTOCOMPLETE_WRAPPER_DEFAULT_CONFIG, AUTOCOMPLETE_WRAPPER_LOCAL_CONFIG, AUTOCOMPLETE_WRAPPER_PAGINATED_CONFIG, AUTOCOMPLETE_WRAPPER_PRODUCT_CONFIG, AUTOCOMPLETE_WRAPPER_SIMPLE_CONFIG, AcpDrawer, AcpDrawerConfig, AcpDrawerContainer, AcpDrawerRef, AcpPopover, AcpPopoverContent, AcpPopoverTarget, AcpPopoverTrigger, AdvancedDialogService, AlertDialog, AlertDialogService, AutocompleteWrapperService, Button, DATA_GRID_DEFAULT_OPTIONS, DataGrid, DateRangePicker, DialogWrapper, DialogZIndexService, DynamicCard, DynamicSelect, GetTotalPipe, IconRegistryService, InputChip, KeyboardNavigationService, OverlayService, Pagination, ReusableAutocompleteComponent, Spinner, StatusDisplayPipe, SvgIcon, TabulatorTable, ThemeSwitcher, ThemeToggle, ToUpperCase, UserIcon, _AcpPopoverContentBase, createAutocompleteWrapperConfig, throwAcpPopoverInvalidPositionEnd, throwAcpPopoverInvalidPositionStart, throwAcpPopoverMissingError };
|
|
6066
6286
|
//# sourceMappingURL=acontplus-ng-components.mjs.map
|