ngx-opalbytes-components 1.23.0 → 1.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -253,7 +253,8 @@ src/
253
253
  ├── base-table/
254
254
  ├── base-table-paginated/
255
255
  ├── base-dialog/
256
- └── base-alert/
256
+ ├── base-alert/
257
+ └── base-widget/
257
258
 
258
259
  ```
259
260
 
@@ -583,6 +584,144 @@ Para personalizar a aparência ou o comportamento dos dialogos, você pode esten
583
584
  ```
584
585
  ---
585
586
 
587
+ ### `BaseWidget` e `CaoWidgetService`
588
+
589
+ Um painel lateral (drawer) para formulários e fluxos que precisam de mais espaço, aberto via `Overlay` do `@angular/cdk`. O componente fornece o backdrop, o header e a área de conteúdo com scroll; o `CaoWidgetService` é responsável por abrir o widget e integrá-lo ao histórico do navegador.
590
+
591
+ **Seletor:** `<cao-base-widget>`
592
+
593
+ **Classe genérica:** `CaoBaseWidgetComponent<TData>` — a forma recomendada de uso é **estender** o componente para criar widgets concretos e tipar o `widgetData`.
594
+
595
+ **Atributos (Inputs)**
596
+
597
+ | Atributo | Tipo | Padrão | Descrição |
598
+ | --- | --- | --- | --- |
599
+ | `title` | `string` | `'Titulo'` | Título exibido no header do widget. |
600
+ | `subtitle` | `string` | `''` | Subtítulo exibido abaixo do título. |
601
+ | `widgetIcon` | `string` | `''` | Ícone do widget (disponível para classes derivadas). |
602
+ | `widgetData` | `TData \| undefined` | `undefined` | Dados genéricos passados ao conteúdo do widget. |
603
+ | `cancelTextButton` | `string` | `'Cancelar'` | Texto do botão de cancelamento (disponível para classes derivadas). |
604
+ | `saveTextButton` | `string` | `'Gerar'` | Texto do botão de ação principal (disponível para classes derivadas). |
605
+ | `displayActionButton` | `boolean` | `true` | Exibe o botão principal (disponível para classes derivadas). |
606
+ | `displaySaveButton` | `boolean` | `true` | Exibe o botão de salvar (disponível para classes derivadas). |
607
+ | `displayCancelButton` | `boolean` | `true` | Exibe o botão de cancelar (disponível para classes derivadas). |
608
+ | `shouldCloseWhenCancel` | `boolean` | `true` | Define se o cancelamento deve fechar o widget (disponível para classes derivadas). |
609
+ | `typeCancel` | `'cancel' \| 'back'` | `'cancel'` | Tipo do botão de cancelamento (disponível para classes derivadas). |
610
+ | `saveDisabled` | `boolean` | `false` | Desabilita a ação de salvar (disponível para classes derivadas). |
611
+ | `saveIcon` | `string` | `'arrow-right'` | Ícone do botão de salvar (disponível para classes derivadas). |
612
+ | `saveIconPosition` | `'leading' \| 'trailing'` | `'trailing'` | Posição do ícone do botão de salvar (disponível para classes derivadas). |
613
+ | `closeOnClickOutside` | `boolean` | `true` | Fecha o widget ao clicar no backdrop. |
614
+ | `confirmOnClose` | `boolean` | `false` | Exige confirmação antes de fechar (disponível para classes derivadas). |
615
+
616
+ > **Nota:** o template base atual renderiza o header (`title`/`subtitle` + projeção `widget-title`) e a área de conteúdo com scroll. `widgetIcon`, os textos e os controles de ação (`display*`, `saveIcon`, `saveIconPosition`, `saveDisabled`, `typeCancel`, `shouldCloseWhenCancel`, `confirmOnClose`) ficam disponíveis na classe para que componentes derivados montem sua própria barra de ações.
617
+
618
+ **Eventos (Outputs)**
619
+
620
+ | Evento | Tipo | Descrição |
621
+ | --- | --- | --- |
622
+ | `save` | `output<void>` | Emitido quando a ação de salvar é acionada. |
623
+ | `deleted` | `output<void>` | Emitido quando a ação de exclusão é acionada. |
624
+ | `cancelEvent` | `output<void>` | Emitido quando o usuário cancela. |
625
+ | `closeRequest` | `output<void>` | Emitido ao final da animação de fechamento. |
626
+
627
+ **Métodos**
628
+
629
+ | Método | Descrição |
630
+ | --- | --- |
631
+ | `closeWidget()` | Inicia o fechamento com animação e emite `closeRequest` ao final. Chamadas repetidas são ignoradas. |
632
+ | `saveWidget()` | Emite o evento `save`. |
633
+ | `cancelWidget()` | Emite o evento `cancelEvent`. |
634
+ | `deletedWidget()` | Emite o evento `deleted`. |
635
+ | `onEscapeKey()` | Fecha o widget ao pressionar `ESC`. |
636
+ | `onBackdropMouseDown(event)` / `onBackdropMouseUp(event)` | Controlam o fechamento por clique no backdrop, ignorando arrastes que começam no backdrop e terminam no painel. |
637
+ | `forwardCloseRequest()` | Repassa o evento `closeRequest` (útil em classes derivadas). |
638
+
639
+ **Projeção de conteúdo**
640
+
641
+ - Slot padrão (`<ng-content />`): conteúdo do widget, renderizado dentro da área com scroll.
642
+ - Slot nomeado `<widget-title>`: conteúdo adicional no header, ao lado do título.
643
+
644
+ **Interface `ICaoWidgetOptions<TData>`**
645
+
646
+ | Propriedade | Tipo | Descrição |
647
+ | --- | --- | --- |
648
+ | `inputs` | `Partial<Record<string, unknown>>` | Inputs aplicados ao componente no momento da abertura. |
649
+ | `data` | `TData` | Atalho para o input `widgetData`. |
650
+ | `onSave` | `() => void` | Callback executado quando o widget emite `save`. |
651
+ | `onDelete` | `() => void` | Callback executado quando o widget emite `deleted`. |
652
+ | `onClose` | `() => void` | Callback executado ao fechar o widget. |
653
+
654
+ **`CaoWidgetService`**
655
+
656
+ | Método | Descrição |
657
+ | --- | --- |
658
+ | `open<TComponent>(component, options?)` | Abre o componente informado em um overlay. Apenas um widget fica aberto por vez: se já houver um, ele é descartado antes de abrir o novo. |
659
+ | `close()` | Fecha o widget aberto programaticamente. |
660
+
661
+ **Comportamentos importantes**
662
+
663
+ - O overlay é criado **sem backdrop próprio** e com scroll bloqueado; o backdrop visual e as animações vêm do `BaseWidget`.
664
+ - Ao abrir, o serviço registra um estado no histórico do navegador. O botão **voltar** fecha o widget, e o fechamento pelo componente também retorna o histórico.
665
+ - Os eventos `save`, `deleted` e `closeRequest` são conectados automaticamente aos callbacks `onSave`, `onDelete` e `onClose`.
666
+ - O serviço depende de `window`/`history`, portanto requer ambiente de browser (atenção em SSR).
667
+
668
+ **CSS Custom Properties**
669
+
670
+ | Propriedade | Padrão | Descrição |
671
+ | --- | --- | --- |
672
+ | `--widget-animation-duration` | `250ms` | Duração das animações de entrada e saída do widget. |
673
+
674
+ **Exemplo de uso — criando um widget**
675
+
676
+ ```typescript
677
+ // gerar-exames.widget.ts
678
+ import { Component } from '@angular/core';
679
+ import { CaoBaseWidgetComponent } from 'ngx-opalbytes-components';
680
+
681
+ @Component({
682
+ selector: 'app-gerar-exames-widget',
683
+ imports: [CaoBaseWidgetComponent],
684
+ template: `
685
+ <cao-base-widget
686
+ title="Gerar exames"
687
+ subtitle="Selecione as sessões"
688
+ [widgetData]="widgetData()"
689
+ (save)="saveWidget()"
690
+ (closeRequest)="forwardCloseRequest()">
691
+ <p>Total de sessões: {{ widgetData()?.total }}</p>
692
+ </cao-base-widget>
693
+ `,
694
+ })
695
+ export class GerarExamesWidget extends CaoBaseWidgetComponent<{ total: number }> {}
696
+ ```
697
+
698
+ **Exemplo de uso — abrindo via serviço**
699
+
700
+ ```typescript
701
+ import { Component, inject } from '@angular/core';
702
+ import { CaoWidgetService } from 'ngx-opalbytes-components';
703
+ import { GerarExamesWidget } from './gerar-exames.widget';
704
+
705
+ @Component({ /* ... */ })
706
+ export class MinhaPaginaComponent {
707
+ private readonly widgetService = inject(CaoWidgetService);
708
+
709
+ abrirWidget(): void {
710
+ this.widgetService.open(GerarExamesWidget, {
711
+ inputs: { subtitle: 'Sessões de hoje' },
712
+ data: { total: 42 },
713
+ onSave: () => console.log('salvar'),
714
+ onDelete: () => console.log('excluir'),
715
+ onClose: () => console.log('fechado'),
716
+ });
717
+ }
718
+ }
719
+ ```
720
+
721
+ > Os três símbolos (`CaoBaseWidgetComponent`, `CaoWidgetService` e `ICaoWidgetOptions`) são exportados pela API pública da biblioteca.
722
+
723
+ ---
724
+
586
725
  ### `FeatureBaseModal`
587
726
  Um componente de modal genérico que pode ser customizado.
588
727
 
@@ -1,7 +1,7 @@
1
1
  import * as i1 from '@angular/common';
2
2
  import { CommonModule, isPlatformBrowser, NgTemplateOutlet, NgOptimizedImage } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { EventEmitter, Input, Output, Component, ViewChild, inject, ElementRef, ChangeDetectorRef, Renderer2, ViewContainerRef, forwardRef, HostListener, ChangeDetectionStrategy, ViewEncapsulation, NgModule, ContentChildren, Directive, TemplateRef, ContentChild, signal, PLATFORM_ID, ViewChildren, HostBinding, input, computed, Injectable } from '@angular/core';
4
+ import { EventEmitter, Input, Output, Component, ViewChild, inject, ElementRef, ChangeDetectorRef, Renderer2, ViewContainerRef, forwardRef, HostListener, ChangeDetectionStrategy, ViewEncapsulation, NgModule, ContentChildren, Directive, TemplateRef, ContentChild, signal, PLATFORM_ID, ViewChildren, HostBinding, input, computed, Injectable, output, DestroyRef } from '@angular/core';
5
5
  import * as i3 from '@angular/material/tooltip';
6
6
  import { MatTooltipModule, MatTooltip } from '@angular/material/tooltip';
7
7
  import { LucideDynamicIcon } from '@lucide/angular';
@@ -3443,9 +3443,184 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
3443
3443
  }]
3444
3444
  }], ctorParameters: () => [{ type: i1$5.Overlay }] });
3445
3445
 
3446
+ class CaoWidgetService {
3447
+ overlay = inject(Overlay);
3448
+ overlayRef = null;
3449
+ open(component, options = {}) {
3450
+ const substituindoWidget = !!this.overlayRef;
3451
+ if (this.overlayRef) {
3452
+ this.close();
3453
+ }
3454
+ const overlayRef = this.overlay.create({
3455
+ hasBackdrop: false,
3456
+ positionStrategy: this.overlay.position().global(),
3457
+ scrollStrategy: this.overlay.scrollStrategies.block(),
3458
+ });
3459
+ this.overlayRef = overlayRef;
3460
+ const ref = overlayRef.attach(new ComponentPortal(component));
3461
+ const instance = ref.instance;
3462
+ for (const [key, value] of Object.entries(options.inputs ?? {})) {
3463
+ ref.setInput(key, value);
3464
+ }
3465
+ if (options.data !== undefined) {
3466
+ ref.setInput("widgetData", options.data);
3467
+ }
3468
+ const subscriptions = new Subscription();
3469
+ let disposed = false;
3470
+ if (!(substituindoWidget && history.state?.widget)) {
3471
+ history.pushState({ widget: true }, "");
3472
+ }
3473
+ const onPopState = () => {
3474
+ dispose();
3475
+ options.onClose?.();
3476
+ };
3477
+ window.addEventListener("popstate", onPopState);
3478
+ const dispose = () => {
3479
+ if (disposed) {
3480
+ return;
3481
+ }
3482
+ disposed = true;
3483
+ window.removeEventListener("popstate", onPopState);
3484
+ subscriptions.unsubscribe();
3485
+ overlayRef.dispose();
3486
+ if (this.overlayRef === overlayRef) {
3487
+ this.overlayRef = null;
3488
+ }
3489
+ };
3490
+ subscriptions.add(instance.save.subscribe(() => options.onSave?.()));
3491
+ subscriptions.add(instance.deleted.subscribe(() => options.onDelete?.()));
3492
+ subscriptions.add(instance.closeRequest.subscribe(() => {
3493
+ if (history.state?.widget) {
3494
+ history.back();
3495
+ }
3496
+ else {
3497
+ dispose();
3498
+ }
3499
+ options.onClose?.();
3500
+ }));
3501
+ overlayRef.detachments().subscribe(() => {
3502
+ disposed = true;
3503
+ window.removeEventListener("popstate", onPopState);
3504
+ subscriptions.unsubscribe();
3505
+ if (this.overlayRef === overlayRef) {
3506
+ this.overlayRef = null;
3507
+ }
3508
+ });
3509
+ ref.changeDetectorRef.detectChanges();
3510
+ }
3511
+ close() {
3512
+ this.overlayRef?.dispose();
3513
+ this.overlayRef = null;
3514
+ }
3515
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CaoWidgetService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3516
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CaoWidgetService, providedIn: "root" });
3517
+ }
3518
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CaoWidgetService, decorators: [{
3519
+ type: Injectable,
3520
+ args: [{ providedIn: "root" }]
3521
+ }] });
3522
+
3523
+ class CaoBaseWidgetComponent {
3524
+ static CLOSE_ANIMATION_MS = 250;
3525
+ title = input("Titulo", ...(ngDevMode ? [{ debugName: "title" }] : []));
3526
+ subtitle = input("", ...(ngDevMode ? [{ debugName: "subtitle" }] : []));
3527
+ widgetIcon = input("", ...(ngDevMode ? [{ debugName: "widgetIcon" }] : []));
3528
+ cancelTextButton = input("Cancelar", ...(ngDevMode ? [{ debugName: "cancelTextButton" }] : []));
3529
+ saveTextButton = input("Gerar", ...(ngDevMode ? [{ debugName: "saveTextButton" }] : []));
3530
+ displayActionButton = input(true, ...(ngDevMode ? [{ debugName: "displayActionButton" }] : []));
3531
+ displaySaveButton = input(true, ...(ngDevMode ? [{ debugName: "displaySaveButton" }] : []));
3532
+ displayCancelButton = input(true, ...(ngDevMode ? [{ debugName: "displayCancelButton" }] : []));
3533
+ shouldCloseWhenCancel = input(true, ...(ngDevMode ? [{ debugName: "shouldCloseWhenCancel" }] : []));
3534
+ typeCancel = input("cancel", ...(ngDevMode ? [{ debugName: "typeCancel" }] : []));
3535
+ saveDisabled = input(false, ...(ngDevMode ? [{ debugName: "saveDisabled" }] : []));
3536
+ saveIcon = input("arrow-right", ...(ngDevMode ? [{ debugName: "saveIcon" }] : []));
3537
+ saveIconPosition = input("trailing", ...(ngDevMode ? [{ debugName: "saveIconPosition" }] : []));
3538
+ closeOnClickOutside = input(true, ...(ngDevMode ? [{ debugName: "closeOnClickOutside" }] : []));
3539
+ confirmOnClose = input(false, ...(ngDevMode ? [{ debugName: "confirmOnClose" }] : []));
3540
+ widgetData = input(undefined, ...(ngDevMode ? [{ debugName: "widgetData" }] : []));
3541
+ save = output();
3542
+ deleted = output();
3543
+ cancelEvent = output();
3544
+ closeRequest = output();
3545
+ closing = signal(false, ...(ngDevMode ? [{ debugName: "closing" }] : []));
3546
+ mouseDownOnBackdrop = false;
3547
+ closeStarted = false;
3548
+ closeEmitted = false;
3549
+ closeConfirmationOpen = false;
3550
+ destroyRef = inject(DestroyRef);
3551
+ widgetService = inject(CaoWidgetService);
3552
+ closeWidget() {
3553
+ if (this.closeStarted) {
3554
+ return;
3555
+ }
3556
+ this.startClose();
3557
+ }
3558
+ saveWidget() {
3559
+ this.save.emit();
3560
+ }
3561
+ cancelWidget() {
3562
+ this.cancelEvent.emit();
3563
+ }
3564
+ deletedWidget() {
3565
+ this.deleted.emit();
3566
+ }
3567
+ onAnimationEnd(event) {
3568
+ if (!this.closing() || event.target !== event.currentTarget) {
3569
+ return;
3570
+ }
3571
+ this.emitCloseRequest();
3572
+ }
3573
+ onEscapeKey() {
3574
+ if (this.closeConfirmationOpen) {
3575
+ this.closeConfirmationOpen = false;
3576
+ return;
3577
+ }
3578
+ this.closeWidget();
3579
+ }
3580
+ forwardCloseRequest() {
3581
+ this.closeRequest.emit();
3582
+ }
3583
+ onBackdropMouseDown(event) {
3584
+ this.mouseDownOnBackdrop = event.target === event.currentTarget;
3585
+ }
3586
+ onBackdropMouseUp(event) {
3587
+ const closeRequested = this.mouseDownOnBackdrop &&
3588
+ event.target === event.currentTarget &&
3589
+ this.closeOnClickOutside();
3590
+ this.mouseDownOnBackdrop = false;
3591
+ if (closeRequested) {
3592
+ this.closeWidget();
3593
+ }
3594
+ }
3595
+ startClose() {
3596
+ if (this.closeStarted) {
3597
+ return;
3598
+ }
3599
+ this.closeStarted = true;
3600
+ this.closing.set(true);
3601
+ setTimeout(() => this.emitCloseRequest(), CaoBaseWidgetComponent.CLOSE_ANIMATION_MS);
3602
+ }
3603
+ emitCloseRequest() {
3604
+ if (this.closeEmitted) {
3605
+ return;
3606
+ }
3607
+ this.closeEmitted = true;
3608
+ this.closeRequest.emit();
3609
+ }
3610
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CaoBaseWidgetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3611
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: CaoBaseWidgetComponent, isStandalone: true, selector: "cao-base-widget", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, widgetIcon: { classPropertyName: "widgetIcon", publicName: "widgetIcon", isSignal: true, isRequired: false, transformFunction: null }, cancelTextButton: { classPropertyName: "cancelTextButton", publicName: "cancelTextButton", isSignal: true, isRequired: false, transformFunction: null }, saveTextButton: { classPropertyName: "saveTextButton", publicName: "saveTextButton", isSignal: true, isRequired: false, transformFunction: null }, displayActionButton: { classPropertyName: "displayActionButton", publicName: "displayActionButton", isSignal: true, isRequired: false, transformFunction: null }, displaySaveButton: { classPropertyName: "displaySaveButton", publicName: "displaySaveButton", isSignal: true, isRequired: false, transformFunction: null }, displayCancelButton: { classPropertyName: "displayCancelButton", publicName: "displayCancelButton", isSignal: true, isRequired: false, transformFunction: null }, shouldCloseWhenCancel: { classPropertyName: "shouldCloseWhenCancel", publicName: "shouldCloseWhenCancel", isSignal: true, isRequired: false, transformFunction: null }, typeCancel: { classPropertyName: "typeCancel", publicName: "typeCancel", isSignal: true, isRequired: false, transformFunction: null }, saveDisabled: { classPropertyName: "saveDisabled", publicName: "saveDisabled", isSignal: true, isRequired: false, transformFunction: null }, saveIcon: { classPropertyName: "saveIcon", publicName: "saveIcon", isSignal: true, isRequired: false, transformFunction: null }, saveIconPosition: { classPropertyName: "saveIconPosition", publicName: "saveIconPosition", isSignal: true, isRequired: false, transformFunction: null }, closeOnClickOutside: { classPropertyName: "closeOnClickOutside", publicName: "closeOnClickOutside", isSignal: true, isRequired: false, transformFunction: null }, confirmOnClose: { classPropertyName: "confirmOnClose", publicName: "confirmOnClose", isSignal: true, isRequired: false, transformFunction: null }, widgetData: { classPropertyName: "widgetData", publicName: "widgetData", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { save: "save", deleted: "deleted", cancelEvent: "cancelEvent", closeRequest: "closeRequest" }, host: { listeners: { "document:keydown.escape": "onEscapeKey()" } }, ngImport: i0, template: "<div\n class=\"widget-backdrop\"\n role=\"presentation\"\n tabindex=\"-1\"\n [class.widget-backdrop--closing]=\"closing()\"\n (mousedown)=\"onBackdropMouseDown($event)\"\n (mouseup)=\"onBackdropMouseUp($event)\"\n (animationend)=\"onAnimationEnd($event)\">\n <div\n class=\"widget-panel\"\n [class.widget-panel--closing]=\"closing()\"\n (mousedown)=\"$event.stopPropagation()\"\n (mouseup)=\"$event.stopPropagation()\">\n <div class=\"widget-body\">\n <div class=\"widget-header\">\n <div class=\"widget-title\">\n <h1>{{ title() }}</h1>\n <h2>{{ subtitle() }}</h2>\n </div>\n <ng-content select=\"widget-title\" />\n </div>\n <div class=\"widget-scroll\">\n <ng-content />\n </div>\n </div>\n </div>\n</div>\n", styles: [":host{--widget-animation-duration: .25s;display:block}.widget-backdrop{position:fixed;inset:0;z-index:50;display:flex;justify-content:flex-end;background-color:#0006;animation:widget-fade-in var(--widget-animation-duration) ease-out}.widget-backdrop--closing{pointer-events:none;animation:widget-fade-out var(--widget-animation-duration) ease-out forwards}.widget-panel{position:relative;box-sizing:border-box;height:100%;width:90vh;max-width:520px;padding:20px;border-radius:.5rem 0 0 .5rem;background-color:var(--color-white, var(--white, #ffffff));box-shadow:0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a;animation:widget-slide-in-right var(--widget-animation-duration) ease-out}.widget-panel--closing{animation:widget-slide-out-right var(--widget-animation-duration) ease-out forwards}.widget-body{display:flex;flex-direction:column;justify-content:space-between;height:100%}.widget-header{display:flex;justify-content:space-between;align-items:start;flex-shrink:0}.widget-title{display:flex;flex-direction:column}.widget-scroll{display:flex;flex:1 1 0;flex-direction:column;min-height:0;overflow-y:auto;scrollbar-width:thin}@keyframes widget-fade-in{0%{opacity:0}to{opacity:1}}@keyframes widget-fade-out{0%{opacity:1}to{opacity:0}}@keyframes widget-slide-in-right{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes widget-slide-out-right{0%{transform:translate(0)}to{transform:translate(100%)}}\n"] });
3612
+ }
3613
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CaoBaseWidgetComponent, decorators: [{
3614
+ type: Component,
3615
+ args: [{ selector: "cao-base-widget", imports: [], template: "<div\n class=\"widget-backdrop\"\n role=\"presentation\"\n tabindex=\"-1\"\n [class.widget-backdrop--closing]=\"closing()\"\n (mousedown)=\"onBackdropMouseDown($event)\"\n (mouseup)=\"onBackdropMouseUp($event)\"\n (animationend)=\"onAnimationEnd($event)\">\n <div\n class=\"widget-panel\"\n [class.widget-panel--closing]=\"closing()\"\n (mousedown)=\"$event.stopPropagation()\"\n (mouseup)=\"$event.stopPropagation()\">\n <div class=\"widget-body\">\n <div class=\"widget-header\">\n <div class=\"widget-title\">\n <h1>{{ title() }}</h1>\n <h2>{{ subtitle() }}</h2>\n </div>\n <ng-content select=\"widget-title\" />\n </div>\n <div class=\"widget-scroll\">\n <ng-content />\n </div>\n </div>\n </div>\n</div>\n", styles: [":host{--widget-animation-duration: .25s;display:block}.widget-backdrop{position:fixed;inset:0;z-index:50;display:flex;justify-content:flex-end;background-color:#0006;animation:widget-fade-in var(--widget-animation-duration) ease-out}.widget-backdrop--closing{pointer-events:none;animation:widget-fade-out var(--widget-animation-duration) ease-out forwards}.widget-panel{position:relative;box-sizing:border-box;height:100%;width:90vh;max-width:520px;padding:20px;border-radius:.5rem 0 0 .5rem;background-color:var(--color-white, var(--white, #ffffff));box-shadow:0 20px 25px -5px #0000001a,0 8px 10px -6px #0000001a;animation:widget-slide-in-right var(--widget-animation-duration) ease-out}.widget-panel--closing{animation:widget-slide-out-right var(--widget-animation-duration) ease-out forwards}.widget-body{display:flex;flex-direction:column;justify-content:space-between;height:100%}.widget-header{display:flex;justify-content:space-between;align-items:start;flex-shrink:0}.widget-title{display:flex;flex-direction:column}.widget-scroll{display:flex;flex:1 1 0;flex-direction:column;min-height:0;overflow-y:auto;scrollbar-width:thin}@keyframes widget-fade-in{0%{opacity:0}to{opacity:1}}@keyframes widget-fade-out{0%{opacity:1}to{opacity:0}}@keyframes widget-slide-in-right{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes widget-slide-out-right{0%{transform:translate(0)}to{transform:translate(100%)}}\n"] }]
3616
+ }], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], subtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitle", required: false }] }], widgetIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "widgetIcon", required: false }] }], cancelTextButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelTextButton", required: false }] }], saveTextButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "saveTextButton", required: false }] }], displayActionButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayActionButton", required: false }] }], displaySaveButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "displaySaveButton", required: false }] }], displayCancelButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayCancelButton", required: false }] }], shouldCloseWhenCancel: [{ type: i0.Input, args: [{ isSignal: true, alias: "shouldCloseWhenCancel", required: false }] }], typeCancel: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeCancel", required: false }] }], saveDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "saveDisabled", required: false }] }], saveIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "saveIcon", required: false }] }], saveIconPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "saveIconPosition", required: false }] }], closeOnClickOutside: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnClickOutside", required: false }] }], confirmOnClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "confirmOnClose", required: false }] }], widgetData: [{ type: i0.Input, args: [{ isSignal: true, alias: "widgetData", required: false }] }], save: [{ type: i0.Output, args: ["save"] }], deleted: [{ type: i0.Output, args: ["deleted"] }], cancelEvent: [{ type: i0.Output, args: ["cancelEvent"] }], closeRequest: [{ type: i0.Output, args: ["closeRequest"] }], onEscapeKey: [{
3617
+ type: HostListener,
3618
+ args: ['document:keydown.escape']
3619
+ }] } });
3620
+
3446
3621
  /**
3447
3622
  * Generated bundle index. Do not edit.
3448
3623
  */
3449
3624
 
3450
- export { BaseAlert, BaseAlertService, BaseDialog, BaseDialogService, BaseFilterTablePaginatedService, BaseFilterTableService, BaseModal, BaseModalService, BasePaginationService, BaseTable, BaseTablePaginated, BaseTableService, BaseTimeRange, CaoAutocompleteComponent, CaoBaseButtonComponent, CaoBaseIcon, CaoBaseInput, CaoBaseToggleComponent, CaoCardComponent, CaoDropDownComponent, CaoError, CaoFormField, CaoHint, CaoKpi, CaoSkeletonComponent, CaoTabGroup, CaoTabPanel, DEFAULT_ERROR_STATE_MATCHER, ErrorStateMatcher, Footer, LinksButton, Paginator, ShowOnDirtyErrorStateMatcher, StepComponent, StepperComponent, TablePaginatedService, TimePicker, getPtBrPaginatorIntlBasePaginated, getPtBrPaginatorIntlBaseTable };
3625
+ export { BaseAlert, BaseAlertService, BaseDialog, BaseDialogService, BaseFilterTablePaginatedService, BaseFilterTableService, BaseModal, BaseModalService, BasePaginationService, BaseTable, BaseTablePaginated, BaseTableService, BaseTimeRange, CaoAutocompleteComponent, CaoBaseButtonComponent, CaoBaseIcon, CaoBaseInput, CaoBaseToggleComponent, CaoBaseWidgetComponent, CaoCardComponent, CaoDropDownComponent, CaoError, CaoFormField, CaoHint, CaoKpi, CaoSkeletonComponent, CaoTabGroup, CaoTabPanel, CaoWidgetService, DEFAULT_ERROR_STATE_MATCHER, ErrorStateMatcher, Footer, LinksButton, Paginator, ShowOnDirtyErrorStateMatcher, StepComponent, StepperComponent, TablePaginatedService, TimePicker, getPtBrPaginatorIntlBasePaginated, getPtBrPaginatorIntlBaseTable };
3451
3626
  //# sourceMappingURL=ngx-opalbytes-components.mjs.map