structra-ui 0.1.5 → 0.1.7
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 +12 -52
- package/app/_utils/scroll/body-scroll-lock.util.d.ts +17 -0
- package/app/dialogs/app-dialog/app-dialog.component.d.ts +11 -5
- package/app/form-layout/validation-summary/validation-summary.component.d.ts +9 -15
- package/app/menus/drawer/drawer.component.d.ts +3 -2
- package/esm2022/app/_utils/scroll/body-scroll-lock.util.mjs +28 -1
- package/esm2022/app/dialogs/app-dialog/app-dialog.component.mjs +22 -16
- package/esm2022/app/form-layout/validation-summary/validation-summary.component.mjs +13 -62
- package/esm2022/app/menus/drawer/drawer.component.mjs +8 -6
- package/fesm2022/structra-ui.mjs +67 -80
- package/fesm2022/structra-ui.mjs.map +1 -1
- package/package.json +1 -1
package/fesm2022/structra-ui.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { booleanAttribute, HostBinding, Input, ChangeDetectionStrategy, Componen
|
|
|
3
3
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
4
|
import * as i1 from '@angular/forms';
|
|
5
5
|
import { Validators, FormGroupDirective, NgForm, NgControl, NG_VALUE_ACCESSOR, FormsModule, FormGroup, FormArray, FormControl } from '@angular/forms';
|
|
6
|
-
import { NgClass, NgTemplateOutlet,
|
|
6
|
+
import { NgClass, NgTemplateOutlet, NgStyle } from '@angular/common';
|
|
7
7
|
import { CdkConnectedOverlay, CdkOverlayOrigin, Overlay } from '@angular/cdk/overlay';
|
|
8
8
|
import { merge, distinctUntilChanged, fromEvent, timer, firstValueFrom } from 'rxjs';
|
|
9
9
|
import * as i2 from '@angular/material/datepicker';
|
|
@@ -5704,14 +5704,6 @@ class ValidationSummaryComponent {
|
|
|
5704
5704
|
this.cdr = inject(ChangeDetectorRef);
|
|
5705
5705
|
this.injector = inject(Injector);
|
|
5706
5706
|
this.hostRef = inject((ElementRef));
|
|
5707
|
-
this.document = inject(DOCUMENT);
|
|
5708
|
-
/**
|
|
5709
|
-
* Com `pinned`, o host passa para `document.body` para o `z-index` competir com a shell (ex.: drawer
|
|
5710
|
-
* da doc no iPhone). Antes de mover, guardamos o `form` mais próximo — `closest('form')` no body falharia.
|
|
5711
|
-
*/
|
|
5712
|
-
this.nearestForm = null;
|
|
5713
|
-
this.pinnedPortalOriginalParent = null;
|
|
5714
|
-
this.pinnedPortalOriginalNext = null;
|
|
5715
5707
|
/** `id` único para `aria-labelledby` quando há vários resumos na página. */
|
|
5716
5708
|
this.titleElementId = `validation-summary-title-${++ValidationSummaryComponent.nextTitleUid}`;
|
|
5717
5709
|
/** `id` da região da lista (acessibilidade do botão recolher / expandir). */
|
|
@@ -5720,7 +5712,12 @@ class ValidationSummaryComponent {
|
|
|
5720
5712
|
this.messages = null;
|
|
5721
5713
|
/** Lista rica com `fieldId` opcional para navegação até o controle. */
|
|
5722
5714
|
this.items = null;
|
|
5723
|
-
|
|
5715
|
+
/**
|
|
5716
|
+
* Título do cabeçalho (`title="…"` no template).
|
|
5717
|
+
* Não usar a propriedade `title` na classe: colide com `HTMLElement.title` no host e o
|
|
5718
|
+
* browser pode desenhar tooltip nativo / comportamentos estranhos.
|
|
5719
|
+
*/
|
|
5720
|
+
this.summaryHeading = '';
|
|
5724
5721
|
this.visible = true;
|
|
5725
5722
|
/**
|
|
5726
5723
|
* `false` (padrão): fluxo em documento (ex.: no topo do formulário) — o consumidor pode fazer scroll até o painel.
|
|
@@ -5770,7 +5767,6 @@ class ValidationSummaryComponent {
|
|
|
5770
5767
|
return parts.join(' ');
|
|
5771
5768
|
}
|
|
5772
5769
|
ngOnChanges(_changes) {
|
|
5773
|
-
this.syncPinnedHostToBody();
|
|
5774
5770
|
const shown = this.isShown;
|
|
5775
5771
|
if (this.pinned && shown && !this.wasShown) {
|
|
5776
5772
|
this.pinnedOpen = false;
|
|
@@ -5788,9 +5784,6 @@ class ValidationSummaryComponent {
|
|
|
5788
5784
|
}
|
|
5789
5785
|
this.wasShown = shown;
|
|
5790
5786
|
}
|
|
5791
|
-
ngOnDestroy() {
|
|
5792
|
-
this.detachPinnedHostFromBody();
|
|
5793
|
-
}
|
|
5794
5787
|
get hostHidden() {
|
|
5795
5788
|
return this.isShown ? null : true;
|
|
5796
5789
|
}
|
|
@@ -5941,7 +5934,7 @@ class ValidationSummaryComponent {
|
|
|
5941
5934
|
* Ordem do DOM (pais antes dos filhos) alinha a expansão de grupos aninhados.
|
|
5942
5935
|
*/
|
|
5943
5936
|
expandCollapsedFormGroupsInNearestForm() {
|
|
5944
|
-
const form = this.
|
|
5937
|
+
const form = this.hostRef.nativeElement.closest('form');
|
|
5945
5938
|
if (!(form instanceof HTMLFormElement)) {
|
|
5946
5939
|
return;
|
|
5947
5940
|
}
|
|
@@ -5992,60 +5985,19 @@ class ValidationSummaryComponent {
|
|
|
5992
5985
|
const tab = el.getAttribute('tabindex');
|
|
5993
5986
|
return tab != null && tab !== '-1';
|
|
5994
5987
|
}
|
|
5995
|
-
syncPinnedHostToBody() {
|
|
5996
|
-
const host = this.hostRef.nativeElement;
|
|
5997
|
-
const shouldPortal = this.pinned && this.isShown;
|
|
5998
|
-
if (shouldPortal) {
|
|
5999
|
-
if (host.parentElement === this.document.body) {
|
|
6000
|
-
return;
|
|
6001
|
-
}
|
|
6002
|
-
this.nearestForm = host.closest('form');
|
|
6003
|
-
this.pinnedPortalOriginalParent = host.parentElement;
|
|
6004
|
-
this.pinnedPortalOriginalNext = host.nextSibling;
|
|
6005
|
-
if (this.pinnedPortalOriginalParent) {
|
|
6006
|
-
this.document.body.appendChild(host);
|
|
6007
|
-
}
|
|
6008
|
-
return;
|
|
6009
|
-
}
|
|
6010
|
-
this.detachPinnedHostFromBody();
|
|
6011
|
-
}
|
|
6012
|
-
detachPinnedHostFromBody() {
|
|
6013
|
-
const host = this.hostRef.nativeElement;
|
|
6014
|
-
if (host.parentElement !== this.document.body || !this.pinnedPortalOriginalParent) {
|
|
6015
|
-
this.nearestForm = null;
|
|
6016
|
-
this.pinnedPortalOriginalParent = null;
|
|
6017
|
-
this.pinnedPortalOriginalNext = null;
|
|
6018
|
-
return;
|
|
6019
|
-
}
|
|
6020
|
-
const parent = this.pinnedPortalOriginalParent;
|
|
6021
|
-
const next = this.pinnedPortalOriginalNext;
|
|
6022
|
-
try {
|
|
6023
|
-
if (next?.parentNode === parent) {
|
|
6024
|
-
parent.insertBefore(host, next);
|
|
6025
|
-
}
|
|
6026
|
-
else {
|
|
6027
|
-
parent.appendChild(host);
|
|
6028
|
-
}
|
|
6029
|
-
}
|
|
6030
|
-
catch {
|
|
6031
|
-
parent.appendChild(host);
|
|
6032
|
-
}
|
|
6033
|
-
this.nearestForm = null;
|
|
6034
|
-
this.pinnedPortalOriginalParent = null;
|
|
6035
|
-
this.pinnedPortalOriginalNext = null;
|
|
6036
|
-
}
|
|
6037
5988
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ValidationSummaryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
6038
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: ValidationSummaryComponent, isStandalone: true, selector: "app-validation-summary", inputs: { messages: "messages", items: "items",
|
|
5989
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: ValidationSummaryComponent, isStandalone: true, selector: "app-validation-summary", inputs: { messages: "messages", items: "items", summaryHeading: ["title", "summaryHeading"], visible: ["visible", "visible", booleanAttribute], pinned: ["pinned", "pinned", booleanAttribute], variant: "variant", compact: ["compact", "compact", booleanAttribute], panelMaxHeight: "panelMaxHeight", scrollBehavior: "scrollBehavior", beforeItemActivate: "beforeItemActivate", showCloseButton: ["showCloseButton", "showCloseButton", booleanAttribute], showListCollapseToggle: ["showListCollapseToggle", "showListCollapseToggle", booleanAttribute], closeButtonLabel: "closeButtonLabel", fieldNavigateHint: "fieldNavigateHint" }, outputs: { panelClose: "panelClose" }, host: { properties: { "class": "this.hostClass", "attr.hidden": "this.hostHidden" } }, usesOnChanges: true, ngImport: i0, template: "@if (isShown) {\r\n<div class=\"validation-summary__panel\" role=\"region\"\r\n [attr.aria-labelledby]=\"summaryHeading.trim() ? titleElementId : null\"\r\n [attr.aria-label]=\"summaryHeading.trim() ? null : 'Resumo de valida\u00E7\u00E3o'\"\r\n [class.validation-summary__panel--pinned]=\"pinned\"\r\n [class.validation-summary__panel--pinned-open]=\"pinned && pinnedOpen\"\r\n [class.validation-summary__panel--list-collapsed]=\"!panelBodyExpanded\">\r\n <div class=\"validation-summary__head\">\r\n @if (showListCollapseToggle) {\r\n <button type=\"button\" class=\"validation-summary__collapse-toggle\" (click)=\"toggleListBody()\"\r\n [attr.aria-expanded]=\"panelBodyExpanded\" [attr.aria-controls]=\"listRegionId\"\r\n [attr.aria-label]=\"panelBodyExpanded ? 'Recolher lista de erros' : 'Expandir lista de erros'\">\r\n <i class=\"fa-solid\" aria-hidden=\"true\" [class.fa-chevron-up]=\"panelBodyExpanded\"\r\n [class.fa-chevron-down]=\"!panelBodyExpanded\"></i>\r\n </button>\r\n }\r\n @if (summaryHeading.trim()) {\r\n <h3 class=\"validation-summary__title\" [id]=\"titleElementId\">\r\n {{ summaryHeading }}\r\n </h3>\r\n }\r\n @if (showCloseButton) {\r\n <button type=\"button\" class=\"validation-summary__close\" (click)=\"onCloseClick()\">\r\n {{ closeButtonLabel }}\r\n </button>\r\n }\r\n </div>\r\n <div class=\"validation-summary__list-wrap\" [id]=\"listRegionId\"\r\n [class.validation-summary__list-wrap--scrollable]=\"!!panelMaxHeight && panelBodyExpanded\"\r\n [class.validation-summary__list-wrap--collapsed]=\"!panelBodyExpanded\"\r\n [style.max-height]=\"panelBodyExpanded ? (panelMaxHeight || null) : null\" [attr.title]=\"fieldNavigateHint\">\r\n <ul class=\"validation-summary__list\" role=\"list\">\r\n @for (row of resolvedItems; track itemTrackKey(row, $index)) {\r\n <li class=\"validation-summary__item\" role=\"listitem\" (click)=\"onSummaryLinkActivate($event, row)\">\r\n @if (row.fieldId) {\r\n <button type=\"button\" class=\"validation-summary__link\" [attr.title]=\"fieldNavigateHint\">\r\n {{ row.message }}\r\n </button>\r\n } @else {\r\n <span class=\"validation-summary__text\">{{ row.message }}</span>\r\n }\r\n </li>\r\n }\r\n </ul>\r\n </div>\r\n</div>\r\n}", styles: ["@charset \"UTF-8\";:host{display:block;width:100%;max-width:100%;min-width:0;box-sizing:border-box;flex:0 0 auto;align-self:stretch}:host.validation-summary--pinned-host{position:static;display:block;box-sizing:border-box;flex:0 0 auto!important;width:100%;max-width:100%;height:0!important;min-height:0!important;margin:0!important;padding:0!important;overflow:visible;pointer-events:none}.validation-summary__panel.validation-summary__panel--pinned{position:fixed;z-index:var(--app-z-validation-summary-pinned, 1400);top:max(.65rem,env(safe-area-inset-top,0px));left:1rem;right:1rem;width:auto;max-width:min(100%,52rem);margin-left:auto;margin-right:auto;box-sizing:border-box;pointer-events:auto;box-shadow:0 4px 6px -1px #00000014,0 10px 24px -6px #0000001f;transform:none;opacity:0;transition:opacity .2s ease-out}.validation-summary__panel.validation-summary__panel--pinned.validation-summary__panel--pinned-open{opacity:1}.validation-summary__panel{width:100%;border-radius:10px;padding:.85rem 1rem;box-sizing:border-box;border:1px solid transparent}.validation-summary__head{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start;gap:.45rem .75rem;margin-bottom:.55rem}.validation-summary__panel--list-collapsed .validation-summary__head{margin-bottom:0}.validation-summary__collapse-toggle{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;margin:0;padding:0;border:1px solid rgba(183,28,28,.35);border-radius:8px;background:#ffffffbf;color:var(--ui-validation-summary-title-error, #b71c1c);font-size:.8rem;line-height:1;cursor:pointer;user-select:none;-webkit-user-select:none;transition:background .15s ease,border-color .15s ease}.validation-summary__collapse-toggle:hover{background:#fff;border-color:#b71c1c8c}.validation-summary__collapse-toggle:focus-visible{outline:2px solid var(--app-color-validation-focus-ring, rgba(185, 28, 28, .45));outline-offset:2px}.validation-summary__title{margin:0;flex:1 1 auto;min-width:0;font-size:1rem;font-weight:600;line-height:1.35;user-select:none;-webkit-user-select:none}.validation-summary__close{flex-shrink:0;margin:0 0 0 auto;padding:.3rem .7rem;border:1px solid rgba(183,28,28,.35);border-radius:8px;background:#ffffffbf;color:var(--ui-validation-summary-title-error, #b71c1c);font-size:.85rem;font-weight:500;font-family:inherit;line-height:1.3;cursor:pointer;user-select:none;-webkit-user-select:none;transition:background .15s ease,border-color .15s ease}.validation-summary__close:hover{background:#fff;border-color:#b71c1c8c}.validation-summary__close:focus-visible{outline:2px solid var(--app-color-validation-focus-ring, rgba(185, 28, 28, .45));outline-offset:2px}.validation-summary__list-wrap{min-width:0;user-select:none;-webkit-user-select:none;overflow:hidden;transition:max-height .28s ease,opacity .22s ease,margin .2s ease}.validation-summary__list-wrap--collapsed{max-height:0!important;opacity:0;margin:0;padding:0;pointer-events:none}.validation-summary__list-wrap--scrollable{overflow-y:auto;overflow-x:hidden;padding-right:.15rem;scrollbar-gutter:stable}.validation-summary__list{margin:0;padding:0;list-style:none}.validation-summary__item{display:flex;align-items:flex-start;gap:.4rem;margin:.2rem 0;padding:0;line-height:1.45;color:var(--ui-validation-summary-text, #1a1a1a);user-select:none;-webkit-user-select:none}.validation-summary__item:before{content:\"\\2022\";flex-shrink:0;line-height:inherit;color:var(--ui-validation-summary-text, #1a1a1a)}.validation-summary__text{display:inline;font:inherit;user-select:none;-webkit-user-select:none}.validation-summary__link{flex:1;min-width:0;display:block;margin:0;padding:0;border:none;background:none;font:inherit;color:inherit;text-align:left;text-decoration:underline;text-underline-offset:.12em;cursor:pointer;user-select:none;-webkit-user-select:none}.validation-summary__link:hover{color:var(--ui-validation-summary-link-hover, #0d47a1)}.validation-summary__link:focus-visible{outline:2px solid var(--app-color-validation-focus-ring, rgba(185, 28, 28, .45));outline-offset:2px;border-radius:4px}:host.validation-summary--error .validation-summary__link:hover{color:var(--app-color-error, #b91c1c)}:host.validation-summary--error .validation-summary__panel{background:var(--ui-validation-summary-bg-error, #ffebee);border-color:var(--ui-validation-summary-border-error, #ffcdd2)}:host.validation-summary--error .validation-summary__title{color:var(--ui-validation-summary-title-error, #b71c1c)}:host.validation-summary--warning .validation-summary__panel{background:var(--ui-validation-summary-bg-warning, #fff8e1);border-color:var(--ui-validation-summary-border-warning, #ffe082)}:host.validation-summary--warning .validation-summary__title{color:var(--ui-validation-summary-title-warning, #e65100)}:host.validation-summary--warning .validation-summary__close{color:var(--ui-validation-summary-title-warning, #e65100);border-color:#e6510059}:host.validation-summary--warning .validation-summary__collapse-toggle{color:var(--ui-validation-summary-title-warning, #e65100);border-color:#e6510059}:host.validation-summary--warning .validation-summary__collapse-toggle:hover{border-color:#e651008c}:host.validation-summary--info .validation-summary__panel{background:var(--ui-validation-summary-bg-info, #e3f2fd);border-color:var(--ui-validation-summary-border-info, #90caf9)}:host.validation-summary--info .validation-summary__title{color:var(--ui-validation-summary-title-info, #0d47a1)}:host.validation-summary--info .validation-summary__close{color:var(--ui-validation-summary-title-info, #0d47a1);border-color:#0d47a159}:host.validation-summary--info .validation-summary__collapse-toggle{color:var(--ui-validation-summary-title-info, #0d47a1);border-color:#0d47a159}:host.validation-summary--info .validation-summary__collapse-toggle:hover{border-color:#0d47a18c}:host.validation-summary--compact .validation-summary__panel{padding:.55rem .7rem}:host.validation-summary--compact .validation-summary__head{margin-bottom:.35rem}:host.validation-summary--compact .validation-summary__title{font-size:.92rem}:host.validation-summary--compact .validation-summary__list{padding-left:0}:host.validation-summary--compact .validation-summary__item{font-size:.88rem;margin:.12rem 0}:host.validation-summary--compact .validation-summary__collapse-toggle{width:1.75rem;height:1.75rem;font-size:.72rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
6039
5990
|
}
|
|
6040
5991
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ValidationSummaryComponent, decorators: [{
|
|
6041
5992
|
type: Component,
|
|
6042
|
-
args: [{ selector: 'app-validation-summary', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (isShown) {\r\n<div class=\"validation-summary__panel\" role=\"region\"
|
|
5993
|
+
args: [{ selector: 'app-validation-summary', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (isShown) {\r\n<div class=\"validation-summary__panel\" role=\"region\"\r\n [attr.aria-labelledby]=\"summaryHeading.trim() ? titleElementId : null\"\r\n [attr.aria-label]=\"summaryHeading.trim() ? null : 'Resumo de valida\u00E7\u00E3o'\"\r\n [class.validation-summary__panel--pinned]=\"pinned\"\r\n [class.validation-summary__panel--pinned-open]=\"pinned && pinnedOpen\"\r\n [class.validation-summary__panel--list-collapsed]=\"!panelBodyExpanded\">\r\n <div class=\"validation-summary__head\">\r\n @if (showListCollapseToggle) {\r\n <button type=\"button\" class=\"validation-summary__collapse-toggle\" (click)=\"toggleListBody()\"\r\n [attr.aria-expanded]=\"panelBodyExpanded\" [attr.aria-controls]=\"listRegionId\"\r\n [attr.aria-label]=\"panelBodyExpanded ? 'Recolher lista de erros' : 'Expandir lista de erros'\">\r\n <i class=\"fa-solid\" aria-hidden=\"true\" [class.fa-chevron-up]=\"panelBodyExpanded\"\r\n [class.fa-chevron-down]=\"!panelBodyExpanded\"></i>\r\n </button>\r\n }\r\n @if (summaryHeading.trim()) {\r\n <h3 class=\"validation-summary__title\" [id]=\"titleElementId\">\r\n {{ summaryHeading }}\r\n </h3>\r\n }\r\n @if (showCloseButton) {\r\n <button type=\"button\" class=\"validation-summary__close\" (click)=\"onCloseClick()\">\r\n {{ closeButtonLabel }}\r\n </button>\r\n }\r\n </div>\r\n <div class=\"validation-summary__list-wrap\" [id]=\"listRegionId\"\r\n [class.validation-summary__list-wrap--scrollable]=\"!!panelMaxHeight && panelBodyExpanded\"\r\n [class.validation-summary__list-wrap--collapsed]=\"!panelBodyExpanded\"\r\n [style.max-height]=\"panelBodyExpanded ? (panelMaxHeight || null) : null\" [attr.title]=\"fieldNavigateHint\">\r\n <ul class=\"validation-summary__list\" role=\"list\">\r\n @for (row of resolvedItems; track itemTrackKey(row, $index)) {\r\n <li class=\"validation-summary__item\" role=\"listitem\" (click)=\"onSummaryLinkActivate($event, row)\">\r\n @if (row.fieldId) {\r\n <button type=\"button\" class=\"validation-summary__link\" [attr.title]=\"fieldNavigateHint\">\r\n {{ row.message }}\r\n </button>\r\n } @else {\r\n <span class=\"validation-summary__text\">{{ row.message }}</span>\r\n }\r\n </li>\r\n }\r\n </ul>\r\n </div>\r\n</div>\r\n}", styles: ["@charset \"UTF-8\";:host{display:block;width:100%;max-width:100%;min-width:0;box-sizing:border-box;flex:0 0 auto;align-self:stretch}:host.validation-summary--pinned-host{position:static;display:block;box-sizing:border-box;flex:0 0 auto!important;width:100%;max-width:100%;height:0!important;min-height:0!important;margin:0!important;padding:0!important;overflow:visible;pointer-events:none}.validation-summary__panel.validation-summary__panel--pinned{position:fixed;z-index:var(--app-z-validation-summary-pinned, 1400);top:max(.65rem,env(safe-area-inset-top,0px));left:1rem;right:1rem;width:auto;max-width:min(100%,52rem);margin-left:auto;margin-right:auto;box-sizing:border-box;pointer-events:auto;box-shadow:0 4px 6px -1px #00000014,0 10px 24px -6px #0000001f;transform:none;opacity:0;transition:opacity .2s ease-out}.validation-summary__panel.validation-summary__panel--pinned.validation-summary__panel--pinned-open{opacity:1}.validation-summary__panel{width:100%;border-radius:10px;padding:.85rem 1rem;box-sizing:border-box;border:1px solid transparent}.validation-summary__head{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start;gap:.45rem .75rem;margin-bottom:.55rem}.validation-summary__panel--list-collapsed .validation-summary__head{margin-bottom:0}.validation-summary__collapse-toggle{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;margin:0;padding:0;border:1px solid rgba(183,28,28,.35);border-radius:8px;background:#ffffffbf;color:var(--ui-validation-summary-title-error, #b71c1c);font-size:.8rem;line-height:1;cursor:pointer;user-select:none;-webkit-user-select:none;transition:background .15s ease,border-color .15s ease}.validation-summary__collapse-toggle:hover{background:#fff;border-color:#b71c1c8c}.validation-summary__collapse-toggle:focus-visible{outline:2px solid var(--app-color-validation-focus-ring, rgba(185, 28, 28, .45));outline-offset:2px}.validation-summary__title{margin:0;flex:1 1 auto;min-width:0;font-size:1rem;font-weight:600;line-height:1.35;user-select:none;-webkit-user-select:none}.validation-summary__close{flex-shrink:0;margin:0 0 0 auto;padding:.3rem .7rem;border:1px solid rgba(183,28,28,.35);border-radius:8px;background:#ffffffbf;color:var(--ui-validation-summary-title-error, #b71c1c);font-size:.85rem;font-weight:500;font-family:inherit;line-height:1.3;cursor:pointer;user-select:none;-webkit-user-select:none;transition:background .15s ease,border-color .15s ease}.validation-summary__close:hover{background:#fff;border-color:#b71c1c8c}.validation-summary__close:focus-visible{outline:2px solid var(--app-color-validation-focus-ring, rgba(185, 28, 28, .45));outline-offset:2px}.validation-summary__list-wrap{min-width:0;user-select:none;-webkit-user-select:none;overflow:hidden;transition:max-height .28s ease,opacity .22s ease,margin .2s ease}.validation-summary__list-wrap--collapsed{max-height:0!important;opacity:0;margin:0;padding:0;pointer-events:none}.validation-summary__list-wrap--scrollable{overflow-y:auto;overflow-x:hidden;padding-right:.15rem;scrollbar-gutter:stable}.validation-summary__list{margin:0;padding:0;list-style:none}.validation-summary__item{display:flex;align-items:flex-start;gap:.4rem;margin:.2rem 0;padding:0;line-height:1.45;color:var(--ui-validation-summary-text, #1a1a1a);user-select:none;-webkit-user-select:none}.validation-summary__item:before{content:\"\\2022\";flex-shrink:0;line-height:inherit;color:var(--ui-validation-summary-text, #1a1a1a)}.validation-summary__text{display:inline;font:inherit;user-select:none;-webkit-user-select:none}.validation-summary__link{flex:1;min-width:0;display:block;margin:0;padding:0;border:none;background:none;font:inherit;color:inherit;text-align:left;text-decoration:underline;text-underline-offset:.12em;cursor:pointer;user-select:none;-webkit-user-select:none}.validation-summary__link:hover{color:var(--ui-validation-summary-link-hover, #0d47a1)}.validation-summary__link:focus-visible{outline:2px solid var(--app-color-validation-focus-ring, rgba(185, 28, 28, .45));outline-offset:2px;border-radius:4px}:host.validation-summary--error .validation-summary__link:hover{color:var(--app-color-error, #b91c1c)}:host.validation-summary--error .validation-summary__panel{background:var(--ui-validation-summary-bg-error, #ffebee);border-color:var(--ui-validation-summary-border-error, #ffcdd2)}:host.validation-summary--error .validation-summary__title{color:var(--ui-validation-summary-title-error, #b71c1c)}:host.validation-summary--warning .validation-summary__panel{background:var(--ui-validation-summary-bg-warning, #fff8e1);border-color:var(--ui-validation-summary-border-warning, #ffe082)}:host.validation-summary--warning .validation-summary__title{color:var(--ui-validation-summary-title-warning, #e65100)}:host.validation-summary--warning .validation-summary__close{color:var(--ui-validation-summary-title-warning, #e65100);border-color:#e6510059}:host.validation-summary--warning .validation-summary__collapse-toggle{color:var(--ui-validation-summary-title-warning, #e65100);border-color:#e6510059}:host.validation-summary--warning .validation-summary__collapse-toggle:hover{border-color:#e651008c}:host.validation-summary--info .validation-summary__panel{background:var(--ui-validation-summary-bg-info, #e3f2fd);border-color:var(--ui-validation-summary-border-info, #90caf9)}:host.validation-summary--info .validation-summary__title{color:var(--ui-validation-summary-title-info, #0d47a1)}:host.validation-summary--info .validation-summary__close{color:var(--ui-validation-summary-title-info, #0d47a1);border-color:#0d47a159}:host.validation-summary--info .validation-summary__collapse-toggle{color:var(--ui-validation-summary-title-info, #0d47a1);border-color:#0d47a159}:host.validation-summary--info .validation-summary__collapse-toggle:hover{border-color:#0d47a18c}:host.validation-summary--compact .validation-summary__panel{padding:.55rem .7rem}:host.validation-summary--compact .validation-summary__head{margin-bottom:.35rem}:host.validation-summary--compact .validation-summary__title{font-size:.92rem}:host.validation-summary--compact .validation-summary__list{padding-left:0}:host.validation-summary--compact .validation-summary__item{font-size:.88rem;margin:.12rem 0}:host.validation-summary--compact .validation-summary__collapse-toggle{width:1.75rem;height:1.75rem;font-size:.72rem}\n"] }]
|
|
6043
5994
|
}], propDecorators: { messages: [{
|
|
6044
5995
|
type: Input
|
|
6045
5996
|
}], items: [{
|
|
6046
5997
|
type: Input
|
|
6047
|
-
}],
|
|
6048
|
-
type: Input
|
|
5998
|
+
}], summaryHeading: [{
|
|
5999
|
+
type: Input,
|
|
6000
|
+
args: ['title']
|
|
6049
6001
|
}], visible: [{
|
|
6050
6002
|
type: Input,
|
|
6051
6003
|
args: [{ transform: booleanAttribute }]
|
|
@@ -7331,6 +7283,33 @@ function unlockPageScrollCdkStyle(s) {
|
|
|
7331
7283
|
body.style.touchAction = s.bodyTouchAction;
|
|
7332
7284
|
window.scroll(s.scrollX, s.scrollY);
|
|
7333
7285
|
}
|
|
7286
|
+
function lockPageScrollAppDialog() {
|
|
7287
|
+
const html = document.documentElement;
|
|
7288
|
+
const body = document.body;
|
|
7289
|
+
const scrollX = window.scrollX ?? html.scrollLeft;
|
|
7290
|
+
const scrollY = window.scrollY ?? html.scrollTop;
|
|
7291
|
+
const snapshot = {
|
|
7292
|
+
scrollX,
|
|
7293
|
+
scrollY,
|
|
7294
|
+
htmlOverflow: html.style.overflow,
|
|
7295
|
+
bodyOverflow: body.style.overflow,
|
|
7296
|
+
bodyTouchAction: body.style.touchAction,
|
|
7297
|
+
};
|
|
7298
|
+
html.classList.add('app-dialog-scroll-lock');
|
|
7299
|
+
html.style.overflow = 'hidden';
|
|
7300
|
+
body.style.overflow = 'hidden';
|
|
7301
|
+
body.style.touchAction = 'none';
|
|
7302
|
+
return snapshot;
|
|
7303
|
+
}
|
|
7304
|
+
function unlockPageScrollAppDialog(s) {
|
|
7305
|
+
const html = document.documentElement;
|
|
7306
|
+
const body = document.body;
|
|
7307
|
+
html.classList.remove('app-dialog-scroll-lock');
|
|
7308
|
+
html.style.overflow = s.htmlOverflow;
|
|
7309
|
+
body.style.overflow = s.bodyOverflow;
|
|
7310
|
+
body.style.touchAction = s.bodyTouchAction;
|
|
7311
|
+
window.scroll(s.scrollX, s.scrollY);
|
|
7312
|
+
}
|
|
7334
7313
|
|
|
7335
7314
|
/** Largura máxima do painel `app-dialog` (conteúdo responsivo). */
|
|
7336
7315
|
var LibDialogSize;
|
|
@@ -7343,19 +7322,25 @@ var LibDialogSize;
|
|
|
7343
7322
|
let appDialogSeq = 0;
|
|
7344
7323
|
/**
|
|
7345
7324
|
* Diálogo modal declarativo com `[(open)]`, projeção de corpo e rodapé opcional (`[appDialogFooter]`).
|
|
7346
|
-
* Bloqueio de scroll
|
|
7325
|
+
* Bloqueio de scroll com {@link lockPageScrollAppDialog} (sem deslocar o `html` como o CDK),
|
|
7326
|
+
* para o scrim `position: fixed` alinhar ao viewport em páginas com scroll no `body`.
|
|
7347
7327
|
*/
|
|
7348
7328
|
class AppDialogComponent {
|
|
7349
7329
|
constructor() {
|
|
7350
7330
|
this.hostEl = inject((ElementRef));
|
|
7351
7331
|
this.open = false;
|
|
7352
7332
|
this.openChange = new EventEmitter();
|
|
7353
|
-
|
|
7333
|
+
/**
|
|
7334
|
+
* Título do cabeçalho (`<app-dialog title="…">`).
|
|
7335
|
+
* O nome da propriedade **não** pode ser `title`: no host DOM isso colide com
|
|
7336
|
+
* `HTMLElement.title` e o browser desenha o tooltip nativo por cima do overlay.
|
|
7337
|
+
*/
|
|
7338
|
+
this.dialogHeading = '';
|
|
7354
7339
|
/** Texto de apoio abaixo do título (opcional); liga `aria-describedby` no painel. */
|
|
7355
7340
|
this.description = '';
|
|
7356
7341
|
/**
|
|
7357
|
-
* Rótulo acessível quando não há
|
|
7358
|
-
* Ignorado se `
|
|
7342
|
+
* Rótulo acessível quando não há título (evita diálogo sem nome).
|
|
7343
|
+
* Ignorado se `dialogHeading` tiver texto.
|
|
7359
7344
|
*/
|
|
7360
7345
|
this.ariaLabel = 'Diálogo';
|
|
7361
7346
|
this.size = LibDialogSize.Md;
|
|
@@ -7377,8 +7362,7 @@ class AppDialogComponent {
|
|
|
7377
7362
|
this.bodyRestoreNext = null;
|
|
7378
7363
|
this.previousActive = null;
|
|
7379
7364
|
this.scrollLock = {
|
|
7380
|
-
|
|
7381
|
-
htmlTop: '',
|
|
7365
|
+
htmlOverflow: '',
|
|
7382
7366
|
scrollX: 0,
|
|
7383
7367
|
scrollY: 0,
|
|
7384
7368
|
bodyOverflow: '',
|
|
@@ -7393,10 +7377,10 @@ class AppDialogComponent {
|
|
|
7393
7377
|
if (a instanceof HTMLElement && a !== document.body) {
|
|
7394
7378
|
this.previousActive = a;
|
|
7395
7379
|
}
|
|
7396
|
-
this.scrollLock =
|
|
7380
|
+
this.scrollLock = lockPageScrollAppDialog();
|
|
7397
7381
|
}
|
|
7398
7382
|
else {
|
|
7399
|
-
|
|
7383
|
+
unlockPageScrollAppDialog(this.scrollLock);
|
|
7400
7384
|
this.detachHostFromBody();
|
|
7401
7385
|
this.restoreFocus();
|
|
7402
7386
|
}
|
|
@@ -7404,7 +7388,7 @@ class AppDialogComponent {
|
|
|
7404
7388
|
}
|
|
7405
7389
|
ngOnDestroy() {
|
|
7406
7390
|
if (this.open) {
|
|
7407
|
-
|
|
7391
|
+
unlockPageScrollAppDialog(this.scrollLock);
|
|
7408
7392
|
}
|
|
7409
7393
|
this.detachHostFromBody();
|
|
7410
7394
|
}
|
|
@@ -7460,7 +7444,7 @@ class AppDialogComponent {
|
|
|
7460
7444
|
}
|
|
7461
7445
|
this.open = false;
|
|
7462
7446
|
this.openChange.emit(false);
|
|
7463
|
-
|
|
7447
|
+
unlockPageScrollAppDialog(this.scrollLock);
|
|
7464
7448
|
this.restoreFocus();
|
|
7465
7449
|
}
|
|
7466
7450
|
restoreFocus() {
|
|
@@ -7470,18 +7454,19 @@ class AppDialogComponent {
|
|
|
7470
7454
|
this.previousActive = null;
|
|
7471
7455
|
}
|
|
7472
7456
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AppDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7473
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: AppDialogComponent, isStandalone: true, selector: "app-dialog", inputs: { open: ["open", "open", booleanAttribute],
|
|
7457
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: AppDialogComponent, isStandalone: true, selector: "app-dialog", inputs: { open: ["open", "open", booleanAttribute], dialogHeading: ["title", "dialogHeading"], description: "description", ariaLabel: "ariaLabel", size: "size", allowOverlayDismiss: ["allowOverlayDismiss", "allowOverlayDismiss", booleanAttribute], showCloseButton: ["showCloseButton", "showCloseButton", booleanAttribute] }, outputs: { openChange: "openChange" }, host: { listeners: { "document:keydown": "onDocumentKeydown($event)" } }, usesOnChanges: true, ngImport: i0, template: "@if (open) {\r\n <div\r\n class=\"app-dialog-backdrop\"\r\n role=\"presentation\"\r\n tabindex=\"-1\"\r\n (click)=\"onBackdropClick()\"\r\n ></div>\r\n <div class=\"app-dialog-stage\" aria-hidden=\"false\">\r\n <div\r\n class=\"app-dialog-panel\"\r\n [class.app-dialog-panel--sm]=\"size === LibDialogSize.Sm\"\r\n [class.app-dialog-panel--md]=\"size === LibDialogSize.Md\"\r\n [class.app-dialog-panel--lg]=\"size === LibDialogSize.Lg\"\r\n role=\"dialog\"\r\n aria-modal=\"true\"\r\n [attr.aria-labelledby]=\"\r\n dialogHeading.trim() ? titleId : description.trim() ? descriptionId : null\r\n \"\r\n [attr.aria-label]=\"!dialogHeading.trim() && !description.trim() ? ariaLabel : null\"\r\n [attr.aria-describedby]=\"\r\n dialogHeading.trim() && description.trim() ? descriptionId : null\r\n \"\r\n cdkTrapFocus\r\n [cdkTrapFocusAutoCapture]=\"true\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n @if (dialogHeading.trim()) {\r\n <header class=\"app-dialog-header\">\r\n <h2 class=\"app-dialog-title\" [id]=\"titleId\">{{ dialogHeading }}</h2>\r\n @if (showCloseButton) {\r\n <button\r\n type=\"button\"\r\n class=\"app-dialog-close\"\r\n aria-label=\"Fechar di\u00E1logo\"\r\n (click)=\"requestClose()\"\r\n >\r\n <span aria-hidden=\"true\">×</span>\r\n </button>\r\n }\r\n </header>\r\n }\r\n @if (description.trim()) {\r\n <p class=\"app-dialog-description\" [id]=\"descriptionId\">{{ description }}</p>\r\n }\r\n <div class=\"app-dialog-body\">\r\n <ng-content />\r\n </div>\r\n <footer class=\"app-dialog-footer\">\r\n <ng-content select=\"[appDialogFooter]\" />\r\n </footer>\r\n </div>\r\n </div>\r\n}\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.app-dialog-backdrop{position:fixed;inset:0;z-index:var(--app-z-dialog, 1200);background:#1a2f456b;backdrop-filter:blur(10px) saturate(1.05);-webkit-backdrop-filter:blur(10px) saturate(1.05);pointer-events:auto}.app-dialog-stage{position:fixed;inset:0;z-index:calc(var(--app-z-dialog, 1200) + 1);display:flex;align-items:center;justify-content:center;padding:min(1.5rem,4vw);box-sizing:border-box;pointer-events:none;background:transparent}.app-dialog-panel{position:relative;z-index:0;display:flex;flex-direction:column;max-height:min(88vh,40rem);width:100%;pointer-events:auto;overflow:hidden;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;box-sizing:border-box;border-radius:10px;border:1px solid var(--app-color-border-subtle, rgba(26, 47, 69, .12));background:var(--app-color-surface, #fff);box-shadow:0 4px 6px -1px #00000014,0 12px 28px -8px #1a2f452e;outline:none;animation:app-lib-dialog-panel-in .28s cubic-bezier(.22,1,.36,1) both}.app-dialog-panel--sm{max-width:min(28rem,94vw)}.app-dialog-panel--md{max-width:min(40rem,94vw)}.app-dialog-panel--lg{max-width:min(56rem,96vw)}@media (prefers-reduced-motion: reduce){.app-dialog-panel{animation:none}}.app-dialog-header{display:flex;align-items:flex-start;justify-content:space-between;gap:.75rem;padding:1rem 1rem .65rem;border-bottom:1px solid var(--app-color-border-subtle, rgba(26, 47, 69, .09));flex:0 0 auto}.app-dialog-title{margin:0;font-size:1.05rem;font-weight:600;line-height:1.3;color:var(--app-color-text-primary, #1a2f45)}.app-dialog-description{margin:0;padding:.65rem 1rem;font-size:.88rem;line-height:1.45;color:var(--app-color-text-secondary, #5a7fa3);flex:0 0 auto}.app-dialog-close{flex:0 0 auto;width:2rem;height:2rem;margin:0;padding:0;border:1px solid var(--app-color-border, #d4d4d4);border-radius:6px;background:var(--app-color-surface-alt, #fff);color:var(--app-color-text-secondary, #5a7fa3);font-size:1.35rem;line-height:1;cursor:pointer}.app-dialog-close:hover{background:var(--app-color-hover-bg, rgba(43, 127, 217, .08))}.app-dialog-close:focus-visible{outline:2px solid var(--app-color-focus-ring-strong, rgba(43, 127, 217, .45));outline-offset:2px}.app-dialog-body{padding:1rem;flex:1 1 auto;min-height:0;overflow-x:hidden;overflow-y:auto;font-size:.9rem;line-height:1.5;color:var(--app-color-text-primary, #1a2f45)}.app-dialog-footer{flex:0 0 auto;padding:.65rem 1rem 1rem;border-top:1px solid var(--app-color-border-subtle, rgba(26, 47, 69, .09));display:flex;flex-wrap:wrap;gap:.5rem;justify-content:flex-end}.app-dialog-footer:empty{display:none;padding:0;border:none}\n"], dependencies: [{ kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
7474
7458
|
}
|
|
7475
7459
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AppDialogComponent, decorators: [{
|
|
7476
7460
|
type: Component,
|
|
7477
|
-
args: [{ selector: 'app-dialog', standalone: true, imports: [CdkTrapFocus], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (open) {\r\n <div\r\n class=\"app-dialog-backdrop\"\r\n role=\"presentation\"\r\n tabindex=\"-1\"\r\n (click)=\"onBackdropClick()\"\r\n ></div>\r\n <div class=\"app-dialog-stage\" aria-hidden=\"false\">\r\n <div\r\n class=\"app-dialog-panel\"\r\n [class.app-dialog-panel--sm]=\"size === LibDialogSize.Sm\"\r\n [class.app-dialog-panel--md]=\"size === LibDialogSize.Md\"\r\n [class.app-dialog-panel--lg]=\"size === LibDialogSize.Lg\"\r\n role=\"dialog\"\r\n aria-modal=\"true\"\r\n [attr.aria-labelledby]=\"\r\n
|
|
7461
|
+
args: [{ selector: 'app-dialog', standalone: true, imports: [CdkTrapFocus], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (open) {\r\n <div\r\n class=\"app-dialog-backdrop\"\r\n role=\"presentation\"\r\n tabindex=\"-1\"\r\n (click)=\"onBackdropClick()\"\r\n ></div>\r\n <div class=\"app-dialog-stage\" aria-hidden=\"false\">\r\n <div\r\n class=\"app-dialog-panel\"\r\n [class.app-dialog-panel--sm]=\"size === LibDialogSize.Sm\"\r\n [class.app-dialog-panel--md]=\"size === LibDialogSize.Md\"\r\n [class.app-dialog-panel--lg]=\"size === LibDialogSize.Lg\"\r\n role=\"dialog\"\r\n aria-modal=\"true\"\r\n [attr.aria-labelledby]=\"\r\n dialogHeading.trim() ? titleId : description.trim() ? descriptionId : null\r\n \"\r\n [attr.aria-label]=\"!dialogHeading.trim() && !description.trim() ? ariaLabel : null\"\r\n [attr.aria-describedby]=\"\r\n dialogHeading.trim() && description.trim() ? descriptionId : null\r\n \"\r\n cdkTrapFocus\r\n [cdkTrapFocusAutoCapture]=\"true\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n @if (dialogHeading.trim()) {\r\n <header class=\"app-dialog-header\">\r\n <h2 class=\"app-dialog-title\" [id]=\"titleId\">{{ dialogHeading }}</h2>\r\n @if (showCloseButton) {\r\n <button\r\n type=\"button\"\r\n class=\"app-dialog-close\"\r\n aria-label=\"Fechar di\u00E1logo\"\r\n (click)=\"requestClose()\"\r\n >\r\n <span aria-hidden=\"true\">×</span>\r\n </button>\r\n }\r\n </header>\r\n }\r\n @if (description.trim()) {\r\n <p class=\"app-dialog-description\" [id]=\"descriptionId\">{{ description }}</p>\r\n }\r\n <div class=\"app-dialog-body\">\r\n <ng-content />\r\n </div>\r\n <footer class=\"app-dialog-footer\">\r\n <ng-content select=\"[appDialogFooter]\" />\r\n </footer>\r\n </div>\r\n </div>\r\n}\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.app-dialog-backdrop{position:fixed;inset:0;z-index:var(--app-z-dialog, 1200);background:#1a2f456b;backdrop-filter:blur(10px) saturate(1.05);-webkit-backdrop-filter:blur(10px) saturate(1.05);pointer-events:auto}.app-dialog-stage{position:fixed;inset:0;z-index:calc(var(--app-z-dialog, 1200) + 1);display:flex;align-items:center;justify-content:center;padding:min(1.5rem,4vw);box-sizing:border-box;pointer-events:none;background:transparent}.app-dialog-panel{position:relative;z-index:0;display:flex;flex-direction:column;max-height:min(88vh,40rem);width:100%;pointer-events:auto;overflow:hidden;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;box-sizing:border-box;border-radius:10px;border:1px solid var(--app-color-border-subtle, rgba(26, 47, 69, .12));background:var(--app-color-surface, #fff);box-shadow:0 4px 6px -1px #00000014,0 12px 28px -8px #1a2f452e;outline:none;animation:app-lib-dialog-panel-in .28s cubic-bezier(.22,1,.36,1) both}.app-dialog-panel--sm{max-width:min(28rem,94vw)}.app-dialog-panel--md{max-width:min(40rem,94vw)}.app-dialog-panel--lg{max-width:min(56rem,96vw)}@media (prefers-reduced-motion: reduce){.app-dialog-panel{animation:none}}.app-dialog-header{display:flex;align-items:flex-start;justify-content:space-between;gap:.75rem;padding:1rem 1rem .65rem;border-bottom:1px solid var(--app-color-border-subtle, rgba(26, 47, 69, .09));flex:0 0 auto}.app-dialog-title{margin:0;font-size:1.05rem;font-weight:600;line-height:1.3;color:var(--app-color-text-primary, #1a2f45)}.app-dialog-description{margin:0;padding:.65rem 1rem;font-size:.88rem;line-height:1.45;color:var(--app-color-text-secondary, #5a7fa3);flex:0 0 auto}.app-dialog-close{flex:0 0 auto;width:2rem;height:2rem;margin:0;padding:0;border:1px solid var(--app-color-border, #d4d4d4);border-radius:6px;background:var(--app-color-surface-alt, #fff);color:var(--app-color-text-secondary, #5a7fa3);font-size:1.35rem;line-height:1;cursor:pointer}.app-dialog-close:hover{background:var(--app-color-hover-bg, rgba(43, 127, 217, .08))}.app-dialog-close:focus-visible{outline:2px solid var(--app-color-focus-ring-strong, rgba(43, 127, 217, .45));outline-offset:2px}.app-dialog-body{padding:1rem;flex:1 1 auto;min-height:0;overflow-x:hidden;overflow-y:auto;font-size:.9rem;line-height:1.5;color:var(--app-color-text-primary, #1a2f45)}.app-dialog-footer{flex:0 0 auto;padding:.65rem 1rem 1rem;border-top:1px solid var(--app-color-border-subtle, rgba(26, 47, 69, .09));display:flex;flex-wrap:wrap;gap:.5rem;justify-content:flex-end}.app-dialog-footer:empty{display:none;padding:0;border:none}\n"] }]
|
|
7478
7462
|
}], propDecorators: { open: [{
|
|
7479
7463
|
type: Input,
|
|
7480
7464
|
args: [{ transform: booleanAttribute }]
|
|
7481
7465
|
}], openChange: [{
|
|
7482
7466
|
type: Output
|
|
7483
|
-
}],
|
|
7484
|
-
type: Input
|
|
7467
|
+
}], dialogHeading: [{
|
|
7468
|
+
type: Input,
|
|
7469
|
+
args: ['title']
|
|
7485
7470
|
}], description: [{
|
|
7486
7471
|
type: Input
|
|
7487
7472
|
}], ariaLabel: [{
|
|
@@ -7894,7 +7879,8 @@ class DrawerComponent {
|
|
|
7894
7879
|
this.open = false;
|
|
7895
7880
|
this.side = DrawerSide.Right;
|
|
7896
7881
|
this.size = DrawerSize.Md;
|
|
7897
|
-
|
|
7882
|
+
/** `title="…"` no template — evita colisão com `HTMLElement.title` no host. */
|
|
7883
|
+
this.drawerHeading = '';
|
|
7898
7884
|
this.showCloseButton = true;
|
|
7899
7885
|
this.openChange = new EventEmitter();
|
|
7900
7886
|
this.DrawerSide = DrawerSide;
|
|
@@ -7993,14 +7979,14 @@ class DrawerComponent {
|
|
|
7993
7979
|
this.focusPreOpen = null;
|
|
7994
7980
|
}
|
|
7995
7981
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DrawerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7996
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: DrawerComponent, isStandalone: true, selector: "app-drawer", inputs: { open: ["open", "open", booleanAttribute], side: "side", size: "size",
|
|
7982
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: DrawerComponent, isStandalone: true, selector: "app-drawer", inputs: { open: ["open", "open", booleanAttribute], side: "side", size: "size", drawerHeading: ["title", "drawerHeading"], showCloseButton: ["showCloseButton", "showCloseButton", booleanAttribute] }, outputs: { openChange: "openChange" }, host: { properties: { "class.app-drawer-host--open": "open" }, classAttribute: "app-drawer-host" }, viewQueries: [{ propertyName: "panelRef", first: true, predicate: ["panelRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "@if (open) {\r\n <div\r\n class=\"app-drawer__backdrop\"\r\n role=\"presentation\"\r\n tabindex=\"-1\"\r\n (click)=\"onBackdropClick()\"\r\n ></div>\r\n\r\n <aside\r\n #panelRef\r\n class=\"app-drawer__panel\"\r\n [ngClass]=\"panelClasses\"\r\n role=\"dialog\"\r\n aria-modal=\"true\"\r\n [attr.aria-labelledby]=\"drawerHeading.trim() ? titleId : null\"\r\n tabindex=\"-1\"\r\n (keydown)=\"onPanelKeydown($event)\"\r\n >\r\n <header class=\"app-drawer__header\">\r\n @if (drawerHeading.trim()) {\r\n <h2 class=\"app-drawer__title\" [id]=\"titleId\">{{ drawerHeading }}</h2>\r\n }\r\n @if (showCloseButton) {\r\n <button\r\n type=\"button\"\r\n class=\"app-drawer__close\"\r\n aria-label=\"Fechar painel\"\r\n (click)=\"onCloseClick()\"\r\n >\r\n <span class=\"app-drawer__close-x\" aria-hidden=\"true\">×</span>\r\n </button>\r\n }\r\n </header>\r\n\r\n <div class=\"app-drawer__body\">\r\n <ng-content />\r\n </div>\r\n\r\n <footer class=\"app-drawer__footer\">\r\n <ng-content select=\"[appDrawerFooter]\" />\r\n </footer>\r\n </aside>\r\n}\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.app-drawer__backdrop{position:fixed;inset:0;z-index:var(--app-z-drawer-backdrop, 1100);background:#1a2f456b;backdrop-filter:blur(10px) saturate(1.05);-webkit-backdrop-filter:blur(10px) saturate(1.05);animation:app-drawer-backdrop-in .22s ease-out both}@keyframes app-drawer-backdrop-in{0%{backdrop-filter:blur(0);-webkit-backdrop-filter:blur(0)}to{backdrop-filter:blur(10px) saturate(1.05);-webkit-backdrop-filter:blur(10px) saturate(1.05)}}.app-drawer__panel{position:fixed;z-index:var(--app-z-drawer-panel, 1101);display:flex;flex-direction:column;max-width:100vw;max-height:100vh;box-sizing:border-box;background:var(--app-color-surface, #fff);border:1px solid var(--app-color-border-subtle, rgba(26, 47, 69, .09));box-shadow:-4px 0 24px var(--app-color-elevated-shadow, rgba(43, 127, 217, .07));outline:none}.app-drawer__panel--side-right{top:0;right:0;bottom:0;animation:app-drawer-slide-in-right .24s ease-out}.app-drawer__panel--side-left{top:0;left:0;bottom:0;animation:app-drawer-slide-in-left .24s ease-out;box-shadow:4px 0 24px var(--app-color-elevated-shadow, rgba(43, 127, 217, .07))}.app-drawer__panel--side-bottom{inset:auto 0 0;max-height:min(88vh,32rem);border-radius:8px 8px 0 0;animation:app-drawer-slide-in-bottom .24s ease-out}.app-drawer__panel--side-right.app-drawer__panel--size-sm,.app-drawer__panel--side-left.app-drawer__panel--size-sm{width:min(18rem,90vw)}.app-drawer__panel--side-right.app-drawer__panel--size-md,.app-drawer__panel--side-left.app-drawer__panel--size-md{width:min(24rem,90vw)}.app-drawer__panel--side-right.app-drawer__panel--size-lg,.app-drawer__panel--side-left.app-drawer__panel--size-lg{width:min(32rem,90vw)}.app-drawer__panel--side-bottom.app-drawer__panel--size-sm{min-height:12rem}.app-drawer__panel--side-bottom.app-drawer__panel--size-md{min-height:16rem}.app-drawer__panel--side-bottom.app-drawer__panel--size-lg{min-height:22rem}@keyframes app-drawer-slide-in-right{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes app-drawer-slide-in-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes app-drawer-slide-in-bottom{0%{transform:translateY(100%)}to{transform:translateY(0)}}.app-drawer__header{display:flex;align-items:flex-start;justify-content:space-between;gap:.75rem;padding:1rem 1rem .75rem;border-bottom:1px solid var(--app-color-border-subtle, rgba(26, 47, 69, .09));flex:0 0 auto}.app-drawer__title{margin:0;font-size:1.05rem;font-weight:600;color:var(--app-color-text-primary, #1a2f45);line-height:1.3;flex:1;min-width:0}.app-drawer__close{flex:0 0 auto;width:2rem;height:2rem;display:inline-flex;align-items:center;justify-content:center;border-radius:4px;border:1px solid var(--app-color-border, #d4d4d4);background:var(--app-color-surface-alt, #fff);color:var(--app-color-text-secondary, #5a7fa3);cursor:pointer;margin:0;padding:0}.app-drawer__close:hover{background:var(--app-color-hover-bg, rgba(43, 127, 217, .08))}.app-drawer__close:focus-visible{outline:2px solid var(--app-color-focus-ring-strong, rgba(43, 127, 217, .45));outline-offset:2px}.app-drawer__close-x{font-size:1.35rem;line-height:1}.app-drawer__body{flex:1 1 auto;min-height:0;overflow:auto;padding:1rem;color:var(--app-color-text-primary, #1a2f45);font-size:.9rem;line-height:1.5}.app-drawer__footer{flex:0 0 auto;padding:.75rem 1rem 1rem;border-top:1px solid var(--app-color-border-subtle, rgba(26, 47, 69, .09));display:flex;flex-wrap:wrap;gap:.5rem;justify-content:flex-end}.app-drawer__footer:empty{display:none;padding:0;border:none}@media (prefers-reduced-motion: reduce){.app-drawer__backdrop{animation:none}}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
7997
7983
|
}
|
|
7998
7984
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DrawerComponent, decorators: [{
|
|
7999
7985
|
type: Component,
|
|
8000
7986
|
args: [{ selector: 'app-drawer', standalone: true, imports: [NgClass], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
8001
7987
|
class: 'app-drawer-host',
|
|
8002
7988
|
'[class.app-drawer-host--open]': 'open',
|
|
8003
|
-
}, template: "@if (open) {\r\n <div\r\n class=\"app-drawer__backdrop\"\r\n role=\"presentation\"\r\n tabindex=\"-1\"\r\n (click)=\"onBackdropClick()\"\r\n ></div>\r\n\r\n <aside\r\n #panelRef\r\n class=\"app-drawer__panel\"\r\n [ngClass]=\"panelClasses\"\r\n role=\"dialog\"\r\n aria-modal=\"true\"\r\n [attr.aria-labelledby]=\"
|
|
7989
|
+
}, template: "@if (open) {\r\n <div\r\n class=\"app-drawer__backdrop\"\r\n role=\"presentation\"\r\n tabindex=\"-1\"\r\n (click)=\"onBackdropClick()\"\r\n ></div>\r\n\r\n <aside\r\n #panelRef\r\n class=\"app-drawer__panel\"\r\n [ngClass]=\"panelClasses\"\r\n role=\"dialog\"\r\n aria-modal=\"true\"\r\n [attr.aria-labelledby]=\"drawerHeading.trim() ? titleId : null\"\r\n tabindex=\"-1\"\r\n (keydown)=\"onPanelKeydown($event)\"\r\n >\r\n <header class=\"app-drawer__header\">\r\n @if (drawerHeading.trim()) {\r\n <h2 class=\"app-drawer__title\" [id]=\"titleId\">{{ drawerHeading }}</h2>\r\n }\r\n @if (showCloseButton) {\r\n <button\r\n type=\"button\"\r\n class=\"app-drawer__close\"\r\n aria-label=\"Fechar painel\"\r\n (click)=\"onCloseClick()\"\r\n >\r\n <span class=\"app-drawer__close-x\" aria-hidden=\"true\">×</span>\r\n </button>\r\n }\r\n </header>\r\n\r\n <div class=\"app-drawer__body\">\r\n <ng-content />\r\n </div>\r\n\r\n <footer class=\"app-drawer__footer\">\r\n <ng-content select=\"[appDrawerFooter]\" />\r\n </footer>\r\n </aside>\r\n}\r\n", styles: ["@charset \"UTF-8\";:host{display:block}.app-drawer__backdrop{position:fixed;inset:0;z-index:var(--app-z-drawer-backdrop, 1100);background:#1a2f456b;backdrop-filter:blur(10px) saturate(1.05);-webkit-backdrop-filter:blur(10px) saturate(1.05);animation:app-drawer-backdrop-in .22s ease-out both}@keyframes app-drawer-backdrop-in{0%{backdrop-filter:blur(0);-webkit-backdrop-filter:blur(0)}to{backdrop-filter:blur(10px) saturate(1.05);-webkit-backdrop-filter:blur(10px) saturate(1.05)}}.app-drawer__panel{position:fixed;z-index:var(--app-z-drawer-panel, 1101);display:flex;flex-direction:column;max-width:100vw;max-height:100vh;box-sizing:border-box;background:var(--app-color-surface, #fff);border:1px solid var(--app-color-border-subtle, rgba(26, 47, 69, .09));box-shadow:-4px 0 24px var(--app-color-elevated-shadow, rgba(43, 127, 217, .07));outline:none}.app-drawer__panel--side-right{top:0;right:0;bottom:0;animation:app-drawer-slide-in-right .24s ease-out}.app-drawer__panel--side-left{top:0;left:0;bottom:0;animation:app-drawer-slide-in-left .24s ease-out;box-shadow:4px 0 24px var(--app-color-elevated-shadow, rgba(43, 127, 217, .07))}.app-drawer__panel--side-bottom{inset:auto 0 0;max-height:min(88vh,32rem);border-radius:8px 8px 0 0;animation:app-drawer-slide-in-bottom .24s ease-out}.app-drawer__panel--side-right.app-drawer__panel--size-sm,.app-drawer__panel--side-left.app-drawer__panel--size-sm{width:min(18rem,90vw)}.app-drawer__panel--side-right.app-drawer__panel--size-md,.app-drawer__panel--side-left.app-drawer__panel--size-md{width:min(24rem,90vw)}.app-drawer__panel--side-right.app-drawer__panel--size-lg,.app-drawer__panel--side-left.app-drawer__panel--size-lg{width:min(32rem,90vw)}.app-drawer__panel--side-bottom.app-drawer__panel--size-sm{min-height:12rem}.app-drawer__panel--side-bottom.app-drawer__panel--size-md{min-height:16rem}.app-drawer__panel--side-bottom.app-drawer__panel--size-lg{min-height:22rem}@keyframes app-drawer-slide-in-right{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes app-drawer-slide-in-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes app-drawer-slide-in-bottom{0%{transform:translateY(100%)}to{transform:translateY(0)}}.app-drawer__header{display:flex;align-items:flex-start;justify-content:space-between;gap:.75rem;padding:1rem 1rem .75rem;border-bottom:1px solid var(--app-color-border-subtle, rgba(26, 47, 69, .09));flex:0 0 auto}.app-drawer__title{margin:0;font-size:1.05rem;font-weight:600;color:var(--app-color-text-primary, #1a2f45);line-height:1.3;flex:1;min-width:0}.app-drawer__close{flex:0 0 auto;width:2rem;height:2rem;display:inline-flex;align-items:center;justify-content:center;border-radius:4px;border:1px solid var(--app-color-border, #d4d4d4);background:var(--app-color-surface-alt, #fff);color:var(--app-color-text-secondary, #5a7fa3);cursor:pointer;margin:0;padding:0}.app-drawer__close:hover{background:var(--app-color-hover-bg, rgba(43, 127, 217, .08))}.app-drawer__close:focus-visible{outline:2px solid var(--app-color-focus-ring-strong, rgba(43, 127, 217, .45));outline-offset:2px}.app-drawer__close-x{font-size:1.35rem;line-height:1}.app-drawer__body{flex:1 1 auto;min-height:0;overflow:auto;padding:1rem;color:var(--app-color-text-primary, #1a2f45);font-size:.9rem;line-height:1.5}.app-drawer__footer{flex:0 0 auto;padding:.75rem 1rem 1rem;border-top:1px solid var(--app-color-border-subtle, rgba(26, 47, 69, .09));display:flex;flex-wrap:wrap;gap:.5rem;justify-content:flex-end}.app-drawer__footer:empty{display:none;padding:0;border:none}@media (prefers-reduced-motion: reduce){.app-drawer__backdrop{animation:none}}\n"] }]
|
|
8004
7990
|
}], propDecorators: { open: [{
|
|
8005
7991
|
type: Input,
|
|
8006
7992
|
args: [{ transform: booleanAttribute }]
|
|
@@ -8008,8 +7994,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
8008
7994
|
type: Input
|
|
8009
7995
|
}], size: [{
|
|
8010
7996
|
type: Input
|
|
8011
|
-
}],
|
|
8012
|
-
type: Input
|
|
7997
|
+
}], drawerHeading: [{
|
|
7998
|
+
type: Input,
|
|
7999
|
+
args: ['title']
|
|
8013
8000
|
}], showCloseButton: [{
|
|
8014
8001
|
type: Input,
|
|
8015
8002
|
args: [{ transform: booleanAttribute }]
|