@praxisui/dialog 10.0.0-rc.7 → 10.0.0-rc.70
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 +4 -2
- package/ai/component-registry.json +134 -8
- package/fesm2022/praxisui-dialog.mjs +1586 -44
- package/package.json +2 -2
- package/types/praxisui-dialog.d.ts +128 -19
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, Directive, EventEmitter, inject, HostBinding, ContentChild, ViewChild, Output, Input, ViewEncapsulation, ChangeDetectionStrategy, Component, Injectable, Injector, ApplicationRef, TemplateRef, ENVIRONMENT_INITIALIZER } from '@angular/core';
|
|
2
|
+
import { InjectionToken, Directive, EventEmitter, inject, ChangeDetectorRef, HostListener, HostBinding, ContentChild, ViewChild, Output, Input, ViewEncapsulation, ChangeDetectionStrategy, Component, Injectable, Injector, ApplicationRef, TemplateRef, signal, computed, ENVIRONMENT_INITIALIZER } from '@angular/core';
|
|
3
3
|
import { Subject, firstValueFrom } from 'rxjs';
|
|
4
4
|
import * as i1 from '@angular/common';
|
|
5
5
|
import { CommonModule } from '@angular/common';
|
|
@@ -9,7 +9,7 @@ import * as i3 from '@angular/cdk/a11y';
|
|
|
9
9
|
import { A11yModule } from '@angular/cdk/a11y';
|
|
10
10
|
import * as i4 from '@angular/material/icon';
|
|
11
11
|
import { MatIconModule } from '@angular/material/icon';
|
|
12
|
-
import { PraxisIconDirective, PraxisLayerScaleStyleService, GlobalConfigService, GLOBAL_DIALOG_SERVICE, ComponentMetadataRegistry, markGlobalActionProviderOperational, GLOBAL_SURFACE_SERVICE, SurfaceOpenMaterializerService, LoggerService, SURFACE_DRAWER_BRIDGE, PraxisSurfaceHostComponent, SurfaceNavigationError } from '@praxisui/core';
|
|
12
|
+
import { resolveSidePanelViewportWidth, PraxisIconDirective, PraxisLayerScaleStyleService, SURFACE_DRAWER_REF, SURFACE_DRAWER_CONTENT_DATA, GlobalConfigService, GLOBAL_DIALOG_SERVICE, ComponentMetadataRegistry, markGlobalActionProviderOperational, resolveSidePanelPresetWidth, GLOBAL_SURFACE_SERVICE, SurfaceOpenMaterializerService, LoggerService, SURFACE_DRAWER_BRIDGE, PraxisSurfaceHostComponent, SurfaceNavigationError, PraxisI18nService, PraxisOperationalAssistantLaunchService, PraxisResourceIdentityComponent, isResourceQuickViewAnchorValid, PRAXIS_QUICK_VIEW_PRESENTER } from '@praxisui/core';
|
|
13
13
|
import { Overlay, OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
|
|
14
14
|
import * as i1$1 from '@angular/forms';
|
|
15
15
|
import { FormsModule } from '@angular/forms';
|
|
@@ -18,6 +18,8 @@ import * as i2$1 from '@angular/material/form-field';
|
|
|
18
18
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
19
19
|
import * as i3$1 from '@angular/material/input';
|
|
20
20
|
import { MatInputModule } from '@angular/material/input';
|
|
21
|
+
import * as i3$2 from '@angular/material/tooltip';
|
|
22
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
21
23
|
|
|
22
24
|
const PRAXIS_DIALOG_DATA = new InjectionToken('PRAXIS_DIALOG_DATA');
|
|
23
25
|
const PRAXIS_DIALOG_I18N = new InjectionToken('PRAXIS_DIALOG_I18N', {
|
|
@@ -28,6 +30,8 @@ const PRAXIS_DIALOG_I18N = new InjectionToken('PRAXIS_DIALOG_I18N', {
|
|
|
28
30
|
yes: 'Sim',
|
|
29
31
|
no: 'Não',
|
|
30
32
|
close: 'Fechar',
|
|
33
|
+
maximize: 'Expandir',
|
|
34
|
+
restore: 'Restaurar',
|
|
31
35
|
}),
|
|
32
36
|
});
|
|
33
37
|
const PRAXIS_DIALOG_DEFAULTS = new InjectionToken('PRAXIS_DIALOG_DEFAULTS', {
|
|
@@ -116,6 +120,7 @@ class PraxisDialogRef {
|
|
|
116
120
|
width: coerceCssUnit$1(width),
|
|
117
121
|
height: coerceCssUnit$1(height),
|
|
118
122
|
});
|
|
123
|
+
this.containerInstance?.syncOverlaySize?.(width, height);
|
|
119
124
|
return this;
|
|
120
125
|
}
|
|
121
126
|
updatePosition(position) {
|
|
@@ -211,10 +216,12 @@ class PraxisDialogComponent {
|
|
|
211
216
|
ariaDescribedBy;
|
|
212
217
|
styles;
|
|
213
218
|
titleIcon;
|
|
219
|
+
canMaximize = false;
|
|
214
220
|
action = new EventEmitter();
|
|
215
221
|
close = new EventEmitter();
|
|
216
222
|
opened = new EventEmitter();
|
|
217
223
|
afterClosed = new EventEmitter();
|
|
224
|
+
maximizeChange = new EventEmitter();
|
|
218
225
|
contentHost;
|
|
219
226
|
panelEl;
|
|
220
227
|
titleTpl;
|
|
@@ -224,19 +231,92 @@ class PraxisDialogComponent {
|
|
|
224
231
|
tabindex = '-1';
|
|
225
232
|
data = inject(PRAXIS_DIALOG_DATA, { optional: true });
|
|
226
233
|
i18n = inject(PRAXIS_DIALOG_I18N);
|
|
234
|
+
cdr = inject(ChangeDetectorRef);
|
|
235
|
+
isMaximized = false;
|
|
236
|
+
viewportWidth = resolveSidePanelViewportWidth();
|
|
237
|
+
unmaximizedBounds = null;
|
|
227
238
|
get titleId() {
|
|
228
239
|
return (this.id ?? 'praxis-dialog') + '-title';
|
|
229
240
|
}
|
|
241
|
+
get hasFooterActions() {
|
|
242
|
+
return (this.actions?.length ?? 0) > 0 || !!this.actionsTpl?.templateRef;
|
|
243
|
+
}
|
|
244
|
+
get displaysMaximizeButton() {
|
|
245
|
+
return (this.canMaximize &&
|
|
246
|
+
this.ariaRole === 'dialog' &&
|
|
247
|
+
(this.isMaximized || this.viewportWidth > 640));
|
|
248
|
+
}
|
|
249
|
+
get maximizeButtonLabel() {
|
|
250
|
+
return this.isMaximized
|
|
251
|
+
? (this.i18n.restore ?? 'Restaurar')
|
|
252
|
+
: (this.i18n.maximize ?? 'Expandir');
|
|
253
|
+
}
|
|
230
254
|
get displaysCloseButton() {
|
|
231
255
|
return this.ariaRole === 'dialog' && !this.disableClose;
|
|
232
256
|
}
|
|
233
257
|
get closeButtonLabel() {
|
|
234
258
|
return this.i18n.close ?? this.i18n.cancel;
|
|
235
259
|
}
|
|
260
|
+
toggleMaximize() {
|
|
261
|
+
if (!this.displaysMaximizeButton) {
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
if (!this.isMaximized) {
|
|
265
|
+
this.unmaximizedBounds = {
|
|
266
|
+
width: this.width,
|
|
267
|
+
height: this.height,
|
|
268
|
+
minWidth: this.minWidth,
|
|
269
|
+
maxWidth: this.maxWidth,
|
|
270
|
+
minHeight: this.minHeight,
|
|
271
|
+
maxHeight: this.maxHeight,
|
|
272
|
+
};
|
|
273
|
+
this.isMaximized = true;
|
|
274
|
+
this.width = '96vw';
|
|
275
|
+
this.height = '92vh';
|
|
276
|
+
this.minWidth = '96vw';
|
|
277
|
+
this.maxWidth = '96vw';
|
|
278
|
+
this.minHeight = '92vh';
|
|
279
|
+
this.maxHeight = '92vh';
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
const bounds = this.unmaximizedBounds;
|
|
283
|
+
this.isMaximized = false;
|
|
284
|
+
this.width = bounds?.width;
|
|
285
|
+
this.height = bounds?.height;
|
|
286
|
+
this.minWidth = bounds?.minWidth;
|
|
287
|
+
this.maxWidth = bounds?.maxWidth;
|
|
288
|
+
this.minHeight = bounds?.minHeight;
|
|
289
|
+
this.maxHeight = bounds?.maxHeight;
|
|
290
|
+
this.unmaximizedBounds = null;
|
|
291
|
+
}
|
|
292
|
+
this.maximizeChange.emit(this.isMaximized);
|
|
293
|
+
this.cdr.markForCheck();
|
|
294
|
+
}
|
|
295
|
+
syncOverlaySize(width, height) {
|
|
296
|
+
if (this.isMaximized) {
|
|
297
|
+
this.unmaximizedBounds = {
|
|
298
|
+
...(this.unmaximizedBounds ?? {}),
|
|
299
|
+
...(width !== undefined ? { width } : {}),
|
|
300
|
+
...(height !== undefined ? { height } : {}),
|
|
301
|
+
};
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
if (width !== undefined) {
|
|
305
|
+
this.width = width;
|
|
306
|
+
}
|
|
307
|
+
if (height !== undefined) {
|
|
308
|
+
this.height = height;
|
|
309
|
+
}
|
|
310
|
+
this.cdr.markForCheck();
|
|
311
|
+
}
|
|
236
312
|
requestClose() {
|
|
237
313
|
if (!this.disableClose)
|
|
238
314
|
this.close.emit();
|
|
239
315
|
}
|
|
316
|
+
onWindowResize() {
|
|
317
|
+
this.viewportWidth = resolveSidePanelViewportWidth();
|
|
318
|
+
this.cdr.markForCheck();
|
|
319
|
+
}
|
|
240
320
|
isDisplayed = false; // controls DOM visibility for animation in tag mode
|
|
241
321
|
ngOnInit() {
|
|
242
322
|
if (this.open) {
|
|
@@ -267,6 +347,9 @@ class PraxisDialogComponent {
|
|
|
267
347
|
}
|
|
268
348
|
ngOnChanges(changes) {
|
|
269
349
|
if (changes['open'] && this.open) {
|
|
350
|
+
if (!this.overlayMode) {
|
|
351
|
+
this.resetMaximizedState();
|
|
352
|
+
}
|
|
270
353
|
this.isDisplayed = true;
|
|
271
354
|
this.applyAnimationVars();
|
|
272
355
|
this.applyStyleVars();
|
|
@@ -282,7 +365,11 @@ class PraxisDialogComponent {
|
|
|
282
365
|
this.isDisplayed) {
|
|
283
366
|
// animate close then hide
|
|
284
367
|
this.beginCloseAnimation().then(() => {
|
|
368
|
+
if (this.open) {
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
285
371
|
this.isDisplayed = false;
|
|
372
|
+
this.resetMaximizedState();
|
|
286
373
|
this.afterClosed.emit();
|
|
287
374
|
if (this.restoreFocus &&
|
|
288
375
|
this._previouslyFocused &&
|
|
@@ -301,6 +388,21 @@ class PraxisDialogComponent {
|
|
|
301
388
|
this.applyStyleVars();
|
|
302
389
|
}
|
|
303
390
|
}
|
|
391
|
+
resetMaximizedState() {
|
|
392
|
+
if (!this.isMaximized && !this.unmaximizedBounds) {
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
const bounds = this.unmaximizedBounds;
|
|
396
|
+
this.isMaximized = false;
|
|
397
|
+
this.width = bounds?.width;
|
|
398
|
+
this.height = bounds?.height;
|
|
399
|
+
this.minWidth = bounds?.minWidth;
|
|
400
|
+
this.maxWidth = bounds?.maxWidth;
|
|
401
|
+
this.minHeight = bounds?.minHeight;
|
|
402
|
+
this.maxHeight = bounds?.maxHeight;
|
|
403
|
+
this.unmaximizedBounds = null;
|
|
404
|
+
this.cdr.markForCheck();
|
|
405
|
+
}
|
|
304
406
|
onKeydown(ev) {
|
|
305
407
|
if (ev.key === 'Escape' && !this.disableClose) {
|
|
306
408
|
ev.stopPropagation();
|
|
@@ -549,7 +651,7 @@ class PraxisDialogComponent {
|
|
|
549
651
|
}
|
|
550
652
|
}
|
|
551
653
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PraxisDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
552
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PraxisDialogComponent, isStandalone: true, selector: "praxis-dialog", inputs: { title: "title", actions: "actions", actionsLayout: "actionsLayout", animation: "animation", open: "open", width: "width", height: "height", minWidth: "minWidth", maxWidth: "maxWidth", minHeight: "minHeight", maxHeight: "maxHeight", themeColor: "themeColor", disableClose: "disableClose", hasBackdrop: "hasBackdrop", closeOnBackdropClick: "closeOnBackdropClick", overlayMode: "overlayMode", zIndex: "zIndex", panelClass: "panelClass", backdropClass: "backdropClass", position: "position", autoFocusedElement: "autoFocusedElement", autoFocus: "autoFocus", restoreFocus: "restoreFocus", id: "id", ariaRole: "ariaRole", ariaLabel: "ariaLabel", ariaLabelledBy: "ariaLabelledBy", ariaDescribedBy: "ariaDescribedBy", styles: "styles", titleIcon: "titleIcon" }, outputs: { action: "action", close: "close", opened: "opened", afterClosed: "afterClosed" }, host: { properties: { "class": "this.hostClass", "attr.tabindex": "this.tabindex" } }, queries: [{ propertyName: "titleTpl", first: true, predicate: PraxisDialogTitleDirective, descendants: true, read: PraxisDialogTitleDirective }, { propertyName: "actionsTpl", first: true, predicate: PraxisDialogActionsDirective, descendants: true, read: PraxisDialogActionsDirective }, { propertyName: "contentTpl", first: true, predicate: PraxisDialogContentDirective, descendants: true, read: PraxisDialogContentDirective }], viewQueries: [{ propertyName: "contentHost", first: true, predicate: CdkPortalOutlet, descendants: true }, { propertyName: "panelEl", first: true, predicate: ["panel"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "@let _titleId = (id ?? \"praxis-dialog\") + \"-title\";\n\n<ng-template #panelHeader>\n @if (titleTpl?.templateRef || title || titleIcon || displaysCloseButton) {\n <div class=\"pdx-dialog__title\">\n <div class=\"pdx-dialog__title-row\">\n @if (titleTpl?.templateRef) {\n <div class=\"pdx-dialog__title-custom\">\n <ng-container\n [ngTemplateOutlet]=\"titleTpl!.templateRef\"\n ></ng-container>\n </div>\n } @else {\n @if (titleIcon) {\n <mat-icon\n class=\"pdx-dialog__title-icon\"\n [praxisIcon]=\"titleIcon\"\n aria-hidden=\"true\"\n ></mat-icon>\n }\n @if (title) {\n <h2 class=\"pdx-dialog__title-text\" [attr.id]=\"_titleId\">\n {{ title }}\n </h2>\n }\n }\n @if (displaysCloseButton) {\n <button\n type=\"button\"\n class=\"pdx-dialog__close-btn\"\n [attr.aria-label]=\"closeButtonLabel\"\n [attr.title]=\"closeButtonLabel\"\n data-testid=\"dialog-close\"\n (click)=\"requestClose()\"\n >\n <mat-icon praxisIcon=\"close\" aria-hidden=\"true\"></mat-icon>\n </button>\n }\n </div>\n </div>\n }\n</ng-template>\n\n<ng-template #panelActions>\n <div\n class=\"pdx-dialog__actions\"\n [class.is-stretched]=\"actionsLayout === 'stretched'\"\n >\n @if (actionsTpl?.templateRef) {\n <ng-container [ngTemplateOutlet]=\"actionsTpl!.templateRef\"></ng-container>\n } @else {\n @for (a of actions; track a?.id ?? a) {\n <button\n type=\"button\"\n class=\"pdx-dialog__action-btn\"\n [attr.data-testid]=\"a.id || null\"\n [attr.data-role]=\"a.role || null\"\n [attr.data-theme]=\"a.themeColor || null\"\n [attr.data-fill]=\"a.fillMode || null\"\n [ngClass]=\"a.cssClass\"\n (click)=\"onActionClick(a)\"\n [attr.cdkFocusInitial]=\"\n a.role === 'primary' && ariaRole === 'alertdialog' ? '' : null\n \"\n >\n @if (a.icon) {\n <mat-icon [praxisIcon]=\"a.icon\"></mat-icon>\n } @else if (a.svgIcon) {\n <mat-icon [svgIcon]=\"a.svgIcon\"></mat-icon>\n }\n {{ a.text }}\n </button>\n }\n }\n </div>\n</ng-template>\n\n@if (overlayMode) {\n <div\n #panel\n class=\"pdx-dialog pdx-dialog--{{ themeColor }} pdx-dialog--layout-{{\n actionsLayout\n }}\"\n [attr.role]=\"ariaRole\"\n [attr.id]=\"id || null\"\n [attr.aria-modal]=\"true\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy || (title ? _titleId : null)\"\n [attr.aria-describedby]=\"ariaDescribedBy || null\"\n (keydown)=\"onKeydown($event)\"\n cdkTrapFocus\n [ngClass]=\"panelNgClass\"\n [style.width]=\"width\"\n [style.height]=\"height\"\n [style.min-width]=\"minWidth\"\n [style.max-width]=\"maxWidth\"\n [style.min-height]=\"minHeight\"\n [style.max-height]=\"maxHeight\"\n [class.has-actions]=\"(actions.length || 0) > 0 || !!actionsTpl?.templateRef\"\n >\n <ng-container [ngTemplateOutlet]=\"panelHeader\"></ng-container>\n <div class=\"pdx-dialog__content\" tabindex=\"0\">\n @if (contentTpl?.templateRef) {\n <ng-container\n [ngTemplateOutlet]=\"contentTpl!.templateRef\"\n ></ng-container>\n } @else {\n <ng-template cdkPortalOutlet></ng-template>\n }\n </div>\n <ng-container [ngTemplateOutlet]=\"panelActions\"></ng-container>\n </div>\n} @else {\n <div\n class=\"pdx-dialog-overlay\"\n [class.has-backdrop]=\"hasBackdrop\"\n [hidden]=\"!isDisplayed\"\n (click)=\"onBackdrop($event)\"\n [ngClass]=\"backdropClass\"\n [style.z-index]=\"zIndex\"\n >\n <div class=\"pdx-dialog-shell\" (click)=\"$event.stopPropagation()\">\n <div\n #panel\n class=\"pdx-dialog pdx-dialog--{{ themeColor }} pdx-dialog--layout-{{\n actionsLayout\n }}\"\n [attr.role]=\"ariaRole\"\n [attr.id]=\"id || null\"\n [attr.aria-modal]=\"true\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy || (title ? _titleId : null)\"\n [attr.aria-describedby]=\"ariaDescribedBy || null\"\n (keydown)=\"onKeydown($event)\"\n cdkTrapFocus\n [ngClass]=\"panelNgClass\"\n [style.width]=\"width\"\n [style.height]=\"height\"\n [style.min-width]=\"minWidth\"\n [style.max-width]=\"maxWidth\"\n [style.min-height]=\"minHeight\"\n [style.max-height]=\"maxHeight\"\n [style.top]=\"position?.top || null\"\n [style.bottom]=\"position?.bottom || null\"\n [style.left]=\"position?.left || null\"\n [style.right]=\"position?.right || null\"\n [class.pdx-has-position]=\"position\"\n [class.has-actions]=\"\n (actions.length || 0) > 0 || !!actionsTpl?.templateRef\n \"\n >\n <ng-container [ngTemplateOutlet]=\"panelHeader\"></ng-container>\n <div class=\"pdx-dialog__content\" tabindex=\"0\">\n @if (contentTpl?.templateRef) {\n <ng-container\n [ngTemplateOutlet]=\"contentTpl!.templateRef\"\n ></ng-container>\n } @else {\n <ng-template cdkPortalOutlet></ng-template>\n }\n </div>\n <ng-container [ngTemplateOutlet]=\"panelActions\"></ng-container>\n </div>\n </div>\n </div>\n}\n", styles: ["@charset \"UTF-8\";.pdx-dialog-host{--pdx-dialog-bg: var(--praxis-theme-surface, var(--md-sys-color-surface));--pdx-dialog-surface: var( --praxis-theme-surface-overlay, var(--md-sys-color-surface-container-high) );--pdx-dialog-border: var( --praxis-theme-outline, var(--md-sys-color-outline-variant) );--pdx-dialog-title-fg: var( --praxis-theme-on-surface, var(--md-sys-color-on-surface) );--pdx-dialog-elevation: var( --praxis-theme-elevation, var(--mat-elevation-level4) )}.pdx-dialog-overlay{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;z-index:var(--praxis-layer-dialog, 1300);background:transparent}.pdx-dialog-overlay.has-backdrop{background:var(--pdx-dialog-backdrop, rgba(0, 0, 0, .6))}.pdx-dialog-shell{display:contents}.pdx-dialog.pdx-has-position{position:absolute}.pdx-dialog{box-sizing:border-box;background:var(--pdx-dialog-container-color, var(--pdx-dialog-surface));color:var(--praxis-theme-on-surface, var(--md-sys-color-on-surface, #111));border:1px solid var(--pdx-dialog-border);border-radius:var(--pdx-dialog-shape, 16px);box-shadow:var(--pdx-dialog-elevation-shadow, var(--pdx-dialog-elevation));max-width:var(--pdx-dialog-max-width, 90vw);max-height:var(--pdx-dialog-max-height, 80vh);display:flex;flex-direction:column;min-width:var(--pdx-dialog-min-width, 280px);outline:0}.pdx-dialog__title{padding:var(--pdx-dialog-headline-padding, 12px 24px 10px);border-bottom:1px solid var(--pdx-dialog-border);color:var(--pdx-dialog-subhead-color, var(--pdx-dialog-title-fg));background:var(--pdx-dialog-title-bg, transparent);flex:0 0 auto}.pdx-dialog__title-row{display:flex;align-items:center;gap:10px;min-height:40px}.pdx-dialog__title-custom,.pdx-dialog__title-text{min-width:0;flex:1 1 auto}.pdx-dialog__title-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex:0 0 24px;font-size:20px;line-height:1;opacity:.87}.pdx-dialog__title-text{margin:0;font-family:var(--pdx-dialog-subhead-font, inherit);font-size:var(--pdx-dialog-subhead-size, 16px);letter-spacing:var(--pdx-dialog-subhead-tracking, normal);font-weight:var(--pdx-dialog-subhead-weight, 600);line-height:1.2}.pdx-dialog__close-btn{appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:0 0 40px;width:40px;height:40px;margin:-4px -8px -4px 8px;padding:0;border:0;border-radius:999px;color:inherit;background:transparent;cursor:pointer;transition:background-color .16s ease,color .16s ease}.pdx-dialog__close-btn:hover{background:color-mix(in srgb,currentColor 10%,transparent)}.pdx-dialog__close-btn:focus-visible{outline:2px solid var(--praxis-theme-focus-outline, var(--md-sys-color-primary));outline-offset:2px}.pdx-dialog__close-btn .mat-icon{width:22px;height:22px;font-size:22px;line-height:1}.pdx-dialog__content{padding:var(--pdx-dialog-content-padding, 16px);overflow:auto;flex:1 1 auto;min-height:0;color:var(--pdx-dialog-supporting-text-color, inherit);font-family:var(--pdx-dialog-supporting-text-font, inherit);line-height:var(--pdx-dialog-supporting-text-line-height, 1.4);font-size:var(--pdx-dialog-supporting-text-size, 14px);letter-spacing:var(--pdx-dialog-supporting-text-tracking, normal);font-weight:var(--pdx-dialog-supporting-text-weight, 400)}.pdx-dialog.has-actions .pdx-dialog__content{padding-bottom:var(--pdx-dialog-with-actions-content-padding, var(--pdx-dialog-content-padding, 16px))}.pdx-dialog__actions{display:flex;gap:8px;padding:var(--pdx-dialog-actions-padding, 12px 24px 16px);border-top:1px solid var(--pdx-dialog-border);justify-content:flex-end;align-items:center;background:var(--pdx-dialog-actions-bg, transparent);flex:0 0 auto}.pdx-dialog__actions.is-stretched{justify-content:stretch}.pdx-dialog__actions.is-stretched .pdx-dialog__action-btn{flex:1 1 0;justify-content:center}.pdx-dialog__action-btn{appearance:none;border:1px solid var(--pdx-dialog-border);background:var(--praxis-theme-surface, var(--md-sys-color-surface-container-low));color:var(--praxis-theme-on-surface, var(--md-sys-color-on-surface));border-radius:var(--pdx-dialog-action-radius, 8px);padding:var(--pdx-dialog-action-padding, 0 14px);min-height:var(--pdx-dialog-action-min-height, 36px);cursor:pointer;display:inline-flex;align-items:center;gap:8px;line-height:1;transition:background-color .18s ease,border-color .18s ease,color .18s ease}.pdx-dialog__action-btn:hover{background:var(--praxis-theme-surface-raised, var(--md-sys-color-surface-container))}.pdx-dialog__action-btn:focus-visible{outline:2px solid var(--praxis-theme-focus-outline, var(--md-sys-color-primary));outline-offset:2px}.pdx-dialog__action-btn:disabled{opacity:.6;cursor:not-allowed}.pdx-dialog__action-btn[data-role=primary]:not([data-fill]),.pdx-dialog__action-btn[data-fill=solid]{background:var(--md-sys-color-primary);border-color:var(--md-sys-color-primary);color:var(--md-sys-color-on-primary)}.pdx-dialog__action-btn[data-role=primary]:not([data-fill]):hover,.pdx-dialog__action-btn[data-fill=solid]:hover{background:var(--md-sys-color-primary-container);color:var(--md-sys-color-on-primary-container);border-color:var(--md-sys-color-primary-container)}.pdx-dialog__action-btn[data-role=danger]:not([data-fill]),.pdx-dialog__action-btn[data-fill=solid][data-theme=warn],.pdx-dialog__action-btn[data-theme=warn][data-fill=solid]{background:var(--md-sys-color-error);border-color:var(--md-sys-color-error);color:var(--md-sys-color-on-error)}.pdx-dialog__action-btn[data-role=danger]:not([data-fill]):hover,.pdx-dialog__action-btn[data-fill=solid][data-theme=warn]:hover,.pdx-dialog__action-btn[data-theme=warn][data-fill=solid]:hover{background:var(--md-sys-color-error-container);color:var(--md-sys-color-on-error-container);border-color:var(--md-sys-color-error-container)}.pdx-dialog__action-btn[data-fill=solid][data-theme=accent],.pdx-dialog__action-btn[data-theme=accent][data-fill=solid]{background:var(--md-sys-color-secondary);border-color:var(--md-sys-color-secondary);color:var(--md-sys-color-on-secondary)}.pdx-dialog__action-btn[data-fill=solid][data-theme=accent]:hover,.pdx-dialog__action-btn[data-theme=accent][data-fill=solid]:hover{background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container);border-color:var(--md-sys-color-secondary-container)}.pdx-dialog__action-btn[data-fill=outline]{background:transparent;color:var(--praxis-theme-on-surface, var(--md-sys-color-on-surface))}.pdx-dialog__action-btn[data-fill=outline][data-theme=primary],.pdx-dialog__action-btn[data-fill=flat][data-theme=primary]{color:var(--md-sys-color-primary);border-color:var(--md-sys-color-primary)}.pdx-dialog__action-btn[data-fill=outline][data-theme=accent],.pdx-dialog__action-btn[data-fill=flat][data-theme=accent]{color:var(--md-sys-color-secondary);border-color:var(--md-sys-color-secondary)}.pdx-dialog__action-btn[data-fill=outline][data-theme=warn],.pdx-dialog__action-btn[data-fill=flat][data-theme=warn]{color:var(--md-sys-color-error);border-color:var(--md-sys-color-error)}.pdx-dialog__action-btn[data-fill=flat]{background:transparent;border-color:transparent;color:var(--md-sys-color-primary)}.pdx-dialog__action-btn .mat-icon{font-size:20px;width:20px;height:20px;line-height:1;display:inline-flex;align-items:center;justify-content:center}.pdx-dialog--primary .pdx-dialog__title{background:var(--md-sys-color-primary-container);color:var(--md-sys-color-on-primary-container);border-bottom-color:var(--praxis-theme-outline, var(--md-sys-color-outline-variant))}.pdx-dialog--dark{background:var(--praxis-theme-surface-raised, var(--md-sys-color-surface-container));color:var(--praxis-theme-on-surface, var(--md-sys-color-on-surface))}.pdx-dialog{transform-origin:center;transition-property:transform,opacity;transition-duration:var(--pdx-dialog-anim-duration, .3s);transition-timing-function:var(--pdx-dialog-anim-ease, cubic-bezier(.2, 0, 0, 1))}.pdx-dialog.pdx-anim-fade{opacity:1}.pdx-dialog.pdx-anim-zoom{transform:scale(1)}.pdx-dialog.pdx-anim-translate-up,.pdx-dialog.pdx-anim-translate-down{transform:translateY(0)}.pdx-dialog.pdx-anim-translate-left,.pdx-dialog.pdx-anim-translate-right{transform:translate(0)}.pdx-dialog.pdx-state-opening.pdx-anim-fade{opacity:0}.pdx-dialog.pdx-state-opening.pdx-anim-zoom{transform:scale(.96);opacity:0}.pdx-dialog.pdx-state-opening.pdx-anim-translate-up{transform:translateY(-16px);opacity:0}.pdx-dialog.pdx-state-opening.pdx-anim-translate-down{transform:translateY(16px);opacity:0}.pdx-dialog.pdx-state-opening.pdx-anim-translate-left{transform:translate(-16px);opacity:0}.pdx-dialog.pdx-state-opening.pdx-anim-translate-right{transform:translate(16px);opacity:0}.pdx-dialog.pdx-state-closing.pdx-anim-fade{opacity:0}.pdx-dialog.pdx-state-closing.pdx-anim-zoom{transform:scale(.96);opacity:0}.pdx-dialog.pdx-state-closing.pdx-anim-translate-up{transform:translateY(-16px);opacity:0}.pdx-dialog.pdx-state-closing.pdx-anim-translate-down{transform:translateY(16px);opacity:0}.pdx-dialog.pdx-state-closing.pdx-anim-translate-left{transform:translate(-16px);opacity:0}.pdx-dialog.pdx-state-closing.pdx-anim-translate-right{transform:translate(16px);opacity:0}@media(prefers-reduced-motion:reduce){.pdx-dialog{transition:none!important}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i2.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i3.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: PraxisIconDirective, selector: "mat-icon[praxisIcon]", inputs: ["praxisIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
654
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PraxisDialogComponent, isStandalone: true, selector: "praxis-dialog", inputs: { title: "title", actions: "actions", actionsLayout: "actionsLayout", animation: "animation", open: "open", width: "width", height: "height", minWidth: "minWidth", maxWidth: "maxWidth", minHeight: "minHeight", maxHeight: "maxHeight", themeColor: "themeColor", disableClose: "disableClose", hasBackdrop: "hasBackdrop", closeOnBackdropClick: "closeOnBackdropClick", overlayMode: "overlayMode", zIndex: "zIndex", panelClass: "panelClass", backdropClass: "backdropClass", position: "position", autoFocusedElement: "autoFocusedElement", autoFocus: "autoFocus", restoreFocus: "restoreFocus", id: "id", ariaRole: "ariaRole", ariaLabel: "ariaLabel", ariaLabelledBy: "ariaLabelledBy", ariaDescribedBy: "ariaDescribedBy", styles: "styles", titleIcon: "titleIcon", canMaximize: "canMaximize" }, outputs: { action: "action", close: "close", opened: "opened", afterClosed: "afterClosed", maximizeChange: "maximizeChange" }, host: { listeners: { "window:resize": "onWindowResize()" }, properties: { "class": "this.hostClass", "attr.tabindex": "this.tabindex" } }, queries: [{ propertyName: "titleTpl", first: true, predicate: PraxisDialogTitleDirective, descendants: true, read: PraxisDialogTitleDirective }, { propertyName: "actionsTpl", first: true, predicate: PraxisDialogActionsDirective, descendants: true, read: PraxisDialogActionsDirective }, { propertyName: "contentTpl", first: true, predicate: PraxisDialogContentDirective, descendants: true, read: PraxisDialogContentDirective }], viewQueries: [{ propertyName: "contentHost", first: true, predicate: CdkPortalOutlet, descendants: true }, { propertyName: "panelEl", first: true, predicate: ["panel"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "@let _titleId = (id ?? \"praxis-dialog\") + \"-title\";\n\n<ng-template #panelHeader>\n @if (titleTpl?.templateRef || title || titleIcon || displaysMaximizeButton || displaysCloseButton) {\n <div class=\"pdx-dialog__title\">\n <div class=\"pdx-dialog__title-row\">\n @if (titleTpl?.templateRef) {\n <div class=\"pdx-dialog__title-custom\">\n <ng-container\n [ngTemplateOutlet]=\"titleTpl!.templateRef\"\n ></ng-container>\n </div>\n } @else {\n @if (titleIcon) {\n <mat-icon\n class=\"pdx-dialog__title-icon\"\n [praxisIcon]=\"titleIcon\"\n aria-hidden=\"true\"\n ></mat-icon>\n }\n @if (title) {\n <h2 class=\"pdx-dialog__title-text\" [attr.id]=\"_titleId\">\n {{ title }}\n </h2>\n }\n }\n @if (displaysMaximizeButton || displaysCloseButton) {\n <div class=\"pdx-dialog__header-actions\">\n @if (displaysMaximizeButton) {\n <button\n type=\"button\"\n class=\"pdx-dialog__maximize-btn\"\n [attr.aria-label]=\"maximizeButtonLabel\"\n [attr.aria-pressed]=\"isMaximized\"\n [attr.title]=\"maximizeButtonLabel\"\n data-testid=\"dialog-maximize\"\n (click)=\"toggleMaximize()\"\n >\n <mat-icon\n [praxisIcon]=\"isMaximized ? 'close_fullscreen' : 'open_in_full'\"\n aria-hidden=\"true\"\n ></mat-icon>\n </button>\n }\n @if (displaysCloseButton) {\n <button\n type=\"button\"\n class=\"pdx-dialog__close-btn\"\n [attr.aria-label]=\"closeButtonLabel\"\n [attr.title]=\"closeButtonLabel\"\n data-testid=\"dialog-close\"\n (click)=\"requestClose()\"\n >\n <mat-icon praxisIcon=\"close\" aria-hidden=\"true\"></mat-icon>\n </button>\n }\n </div>\n }\n </div>\n </div>\n }\n</ng-template>\n\n<ng-template #panelActions>\n <div\n class=\"pdx-dialog__actions\"\n [class.is-stretched]=\"actionsLayout === 'stretched'\"\n >\n @if (actionsTpl?.templateRef) {\n <ng-container [ngTemplateOutlet]=\"actionsTpl!.templateRef\"></ng-container>\n } @else {\n @for (a of actions; track a?.id ?? a) {\n <button\n type=\"button\"\n class=\"pdx-dialog__action-btn\"\n [attr.data-testid]=\"a.id || null\"\n [attr.data-role]=\"a.role || null\"\n [attr.data-theme]=\"a.themeColor || null\"\n [attr.data-fill]=\"a.fillMode || null\"\n [ngClass]=\"a.cssClass\"\n (click)=\"onActionClick(a)\"\n [attr.cdkFocusInitial]=\"\n a.role === 'primary' && ariaRole === 'alertdialog' ? '' : null\n \"\n >\n @if (a.icon) {\n <mat-icon [praxisIcon]=\"a.icon\"></mat-icon>\n } @else if (a.svgIcon) {\n <mat-icon [svgIcon]=\"a.svgIcon\"></mat-icon>\n }\n {{ a.text }}\n </button>\n }\n }\n </div>\n</ng-template>\n\n@if (overlayMode) {\n <div\n #panel\n class=\"pdx-dialog pdx-dialog--{{ themeColor }} pdx-dialog--layout-{{\n actionsLayout\n }}\"\n [attr.role]=\"ariaRole\"\n [attr.id]=\"id || null\"\n [attr.aria-modal]=\"true\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy || (title ? _titleId : null)\"\n [attr.aria-describedby]=\"ariaDescribedBy || null\"\n (keydown)=\"onKeydown($event)\"\n cdkTrapFocus\n [ngClass]=\"panelNgClass\"\n [style.width]=\"width\"\n [style.height]=\"height\"\n [style.min-width]=\"minWidth\"\n [style.max-width]=\"maxWidth\"\n [style.min-height]=\"minHeight\"\n [style.max-height]=\"maxHeight\"\n [class.pdx-dialog--maximized]=\"isMaximized\"\n [class.has-actions]=\"hasFooterActions\"\n >\n <ng-container [ngTemplateOutlet]=\"panelHeader\"></ng-container>\n <div class=\"pdx-dialog__content\" tabindex=\"0\">\n @if (contentTpl?.templateRef) {\n <ng-container\n [ngTemplateOutlet]=\"contentTpl!.templateRef\"\n ></ng-container>\n } @else {\n <ng-template cdkPortalOutlet></ng-template>\n }\n </div>\n @if (hasFooterActions) {\n <ng-container [ngTemplateOutlet]=\"panelActions\"></ng-container>\n }\n </div>\n} @else {\n <div\n class=\"pdx-dialog-overlay\"\n [class.has-backdrop]=\"hasBackdrop\"\n [hidden]=\"!isDisplayed\"\n (click)=\"onBackdrop($event)\"\n [ngClass]=\"backdropClass\"\n [style.z-index]=\"zIndex\"\n >\n <div class=\"pdx-dialog-shell\" (click)=\"$event.stopPropagation()\">\n <div\n #panel\n class=\"pdx-dialog pdx-dialog--{{ themeColor }} pdx-dialog--layout-{{\n actionsLayout\n }}\"\n [attr.role]=\"ariaRole\"\n [attr.id]=\"id || null\"\n [attr.aria-modal]=\"true\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy || (title ? _titleId : null)\"\n [attr.aria-describedby]=\"ariaDescribedBy || null\"\n (keydown)=\"onKeydown($event)\"\n cdkTrapFocus\n [ngClass]=\"panelNgClass\"\n [style.width]=\"width\"\n [style.height]=\"height\"\n [style.min-width]=\"minWidth\"\n [style.max-width]=\"maxWidth\"\n [style.min-height]=\"minHeight\"\n [style.max-height]=\"maxHeight\"\n [style.top]=\"position?.top || null\"\n [style.bottom]=\"position?.bottom || null\"\n [style.left]=\"position?.left || null\"\n [style.right]=\"position?.right || null\"\n [class.pdx-has-position]=\"position\"\n [class.pdx-dialog--maximized]=\"isMaximized\"\n [class.has-actions]=\"hasFooterActions\"\n >\n <ng-container [ngTemplateOutlet]=\"panelHeader\"></ng-container>\n <div class=\"pdx-dialog__content\" tabindex=\"0\">\n @if (contentTpl?.templateRef) {\n <ng-container\n [ngTemplateOutlet]=\"contentTpl!.templateRef\"\n ></ng-container>\n } @else {\n <ng-template cdkPortalOutlet></ng-template>\n }\n </div>\n @if (hasFooterActions) {\n <ng-container [ngTemplateOutlet]=\"panelActions\"></ng-container>\n }\n </div>\n </div>\n </div>\n}\n", styles: ["@charset \"UTF-8\";.pdx-dialog-host{--pdx-dialog-bg: var(--praxis-theme-surface, var(--md-sys-color-surface));--pdx-dialog-surface: var( --praxis-theme-surface-overlay, var(--md-sys-color-surface-container-high) );--pdx-dialog-border: var( --praxis-theme-outline, var(--md-sys-color-outline-variant) );--pdx-dialog-title-fg: var( --praxis-theme-on-surface, var(--md-sys-color-on-surface) );--pdx-dialog-elevation: var( --praxis-theme-elevation, var(--mat-elevation-level4) )}.pdx-dialog-overlay{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;z-index:var(--praxis-layer-dialog, 1300);background:transparent}.pdx-dialog-overlay.has-backdrop{background:var(--pdx-dialog-backdrop, rgba(0, 0, 0, .6))}.pdx-dialog-shell{display:contents}.pdx-dialog.pdx-has-position{position:absolute}.pdx-dialog{box-sizing:border-box;background:var(--pdx-dialog-container-color, var(--pdx-dialog-surface));color:var(--praxis-theme-on-surface, var(--md-sys-color-on-surface, #111));border:1px solid var(--pdx-dialog-border);border-radius:var(--pdx-dialog-shape, 16px);box-shadow:var(--pdx-dialog-elevation-shadow, var(--pdx-dialog-elevation));max-width:var(--pdx-dialog-max-width, 90vw);max-height:var(--pdx-dialog-max-height, 80vh);display:flex;flex-direction:column;min-width:var(--pdx-dialog-min-width, 280px);outline:0}.pdx-dialog.pdx-dialog--maximized{border-radius:var(--pdx-dialog-maximized-shape, 12px)}.pdx-dialog__title{padding:var(--pdx-dialog-headline-padding, 12px 24px 10px);border-bottom:1px solid var(--pdx-dialog-border);color:var(--pdx-dialog-subhead-color, var(--pdx-dialog-title-fg));background:var(--pdx-dialog-title-bg, transparent);flex:0 0 auto}.pdx-dialog__title-row{display:flex;align-items:center;gap:10px;min-height:40px}.pdx-dialog__title-custom,.pdx-dialog__title-text{min-width:0;flex:1 1 auto}.pdx-dialog__title-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex:0 0 24px;font-size:20px;line-height:1;opacity:.87}.pdx-dialog__title-text{margin:0;font-family:var(--pdx-dialog-subhead-font, inherit);font-size:var(--pdx-dialog-subhead-size, 16px);letter-spacing:var(--pdx-dialog-subhead-tracking, normal);font-weight:var(--pdx-dialog-subhead-weight, 600);line-height:1.2}.pdx-dialog__header-actions{display:inline-flex;align-items:center;gap:4px;flex:0 0 auto;margin:-4px -8px -4px 8px}.pdx-dialog__maximize-btn,.pdx-dialog__close-btn{appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:0 0 40px;width:40px;height:40px;margin:0;padding:0;border:0;border-radius:999px;color:inherit;background:transparent;cursor:pointer;transition:background-color .16s ease,color .16s ease}.pdx-dialog__maximize-btn:hover,.pdx-dialog__close-btn:hover{background:color-mix(in srgb,currentColor 10%,transparent)}.pdx-dialog__maximize-btn:focus-visible,.pdx-dialog__close-btn:focus-visible{outline:2px solid var(--praxis-theme-focus-outline, var(--md-sys-color-primary));outline-offset:2px}.pdx-dialog__maximize-btn .mat-icon,.pdx-dialog__close-btn .mat-icon{width:22px;height:22px;font-size:22px;line-height:1}.pdx-dialog__content{padding:var(--pdx-dialog-content-padding, 16px);overflow:auto;flex:1 1 auto;min-height:0;color:var(--pdx-dialog-supporting-text-color, inherit);font-family:var(--pdx-dialog-supporting-text-font, inherit);line-height:var(--pdx-dialog-supporting-text-line-height, 1.4);font-size:var(--pdx-dialog-supporting-text-size, 14px);letter-spacing:var(--pdx-dialog-supporting-text-tracking, normal);font-weight:var(--pdx-dialog-supporting-text-weight, 400)}.pdx-dialog.has-actions .pdx-dialog__content{padding-bottom:var(--pdx-dialog-with-actions-content-padding, var(--pdx-dialog-content-padding, 16px))}.pdx-dialog__actions{display:flex;gap:8px;padding:var(--pdx-dialog-actions-padding, 12px 24px 16px);border-top:1px solid var(--pdx-dialog-border);justify-content:flex-end;align-items:center;background:var(--pdx-dialog-actions-bg, transparent);flex:0 0 auto}.pdx-dialog__actions.is-stretched{justify-content:stretch}.pdx-dialog__actions.is-stretched .pdx-dialog__action-btn{flex:1 1 0;justify-content:center}.pdx-dialog__action-btn{appearance:none;border:1px solid var(--pdx-dialog-border);background:var(--praxis-theme-surface, var(--md-sys-color-surface-container-low));color:var(--praxis-theme-on-surface, var(--md-sys-color-on-surface));border-radius:var(--pdx-dialog-action-radius, 8px);padding:var(--pdx-dialog-action-padding, 0 14px);min-height:var(--pdx-dialog-action-min-height, 36px);cursor:pointer;display:inline-flex;align-items:center;gap:8px;line-height:1;transition:background-color .18s ease,border-color .18s ease,color .18s ease}.pdx-dialog__action-btn:hover{background:var(--praxis-theme-surface-raised, var(--md-sys-color-surface-container))}.pdx-dialog__action-btn:focus-visible{outline:2px solid var(--praxis-theme-focus-outline, var(--md-sys-color-primary));outline-offset:2px}.pdx-dialog__action-btn:disabled{opacity:.6;cursor:not-allowed}.pdx-dialog__action-btn[data-role=primary]:not([data-fill]),.pdx-dialog__action-btn[data-fill=solid]{background:var(--md-sys-color-primary);border-color:var(--md-sys-color-primary);color:var(--md-sys-color-on-primary)}.pdx-dialog__action-btn[data-role=primary]:not([data-fill]):hover,.pdx-dialog__action-btn[data-fill=solid]:hover{background:var(--md-sys-color-primary-container);color:var(--md-sys-color-on-primary-container);border-color:var(--md-sys-color-primary-container)}.pdx-dialog__action-btn[data-role=danger]:not([data-fill]),.pdx-dialog__action-btn[data-fill=solid][data-theme=warn],.pdx-dialog__action-btn[data-theme=warn][data-fill=solid]{background:var(--md-sys-color-error);border-color:var(--md-sys-color-error);color:var(--md-sys-color-on-error)}.pdx-dialog__action-btn[data-role=danger]:not([data-fill]):hover,.pdx-dialog__action-btn[data-fill=solid][data-theme=warn]:hover,.pdx-dialog__action-btn[data-theme=warn][data-fill=solid]:hover{background:var(--md-sys-color-error-container);color:var(--md-sys-color-on-error-container);border-color:var(--md-sys-color-error-container)}.pdx-dialog__action-btn[data-fill=solid][data-theme=accent],.pdx-dialog__action-btn[data-theme=accent][data-fill=solid]{background:var(--md-sys-color-secondary);border-color:var(--md-sys-color-secondary);color:var(--md-sys-color-on-secondary)}.pdx-dialog__action-btn[data-fill=solid][data-theme=accent]:hover,.pdx-dialog__action-btn[data-theme=accent][data-fill=solid]:hover{background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container);border-color:var(--md-sys-color-secondary-container)}.pdx-dialog__action-btn[data-fill=outline]{background:transparent;color:var(--praxis-theme-on-surface, var(--md-sys-color-on-surface))}.pdx-dialog__action-btn[data-fill=outline][data-theme=primary],.pdx-dialog__action-btn[data-fill=flat][data-theme=primary]{color:var(--md-sys-color-primary);border-color:var(--md-sys-color-primary)}.pdx-dialog__action-btn[data-fill=outline][data-theme=accent],.pdx-dialog__action-btn[data-fill=flat][data-theme=accent]{color:var(--md-sys-color-secondary);border-color:var(--md-sys-color-secondary)}.pdx-dialog__action-btn[data-fill=outline][data-theme=warn],.pdx-dialog__action-btn[data-fill=flat][data-theme=warn]{color:var(--md-sys-color-error);border-color:var(--md-sys-color-error)}.pdx-dialog__action-btn[data-fill=flat]{background:transparent;border-color:transparent;color:var(--md-sys-color-primary)}.pdx-dialog__action-btn .mat-icon{font-size:20px;width:20px;height:20px;line-height:1;display:inline-flex;align-items:center;justify-content:center}.pdx-dialog--primary .pdx-dialog__title{background:var(--md-sys-color-primary-container);color:var(--md-sys-color-on-primary-container);border-bottom-color:var(--praxis-theme-outline, var(--md-sys-color-outline-variant))}.pdx-dialog--dark{background:var(--praxis-theme-surface-raised, var(--md-sys-color-surface-container));color:var(--praxis-theme-on-surface, var(--md-sys-color-on-surface))}.pdx-dialog{transform-origin:center;transition-property:transform,opacity;transition-duration:var(--pdx-dialog-anim-duration, .3s);transition-timing-function:var(--pdx-dialog-anim-ease, cubic-bezier(.2, 0, 0, 1))}.pdx-dialog.pdx-anim-fade{opacity:1}.pdx-dialog.pdx-anim-zoom{transform:scale(1)}.pdx-dialog.pdx-anim-translate-up,.pdx-dialog.pdx-anim-translate-down{transform:translateY(0)}.pdx-dialog.pdx-anim-translate-left,.pdx-dialog.pdx-anim-translate-right{transform:translate(0)}.pdx-dialog.pdx-state-opening.pdx-anim-fade{opacity:0}.pdx-dialog.pdx-state-opening.pdx-anim-zoom{transform:scale(.96);opacity:0}.pdx-dialog.pdx-state-opening.pdx-anim-translate-up{transform:translateY(-16px);opacity:0}.pdx-dialog.pdx-state-opening.pdx-anim-translate-down{transform:translateY(16px);opacity:0}.pdx-dialog.pdx-state-opening.pdx-anim-translate-left{transform:translate(-16px);opacity:0}.pdx-dialog.pdx-state-opening.pdx-anim-translate-right{transform:translate(16px);opacity:0}.pdx-dialog.pdx-state-closing.pdx-anim-fade{opacity:0}.pdx-dialog.pdx-state-closing.pdx-anim-zoom{transform:scale(.96);opacity:0}.pdx-dialog.pdx-state-closing.pdx-anim-translate-up{transform:translateY(-16px);opacity:0}.pdx-dialog.pdx-state-closing.pdx-anim-translate-down{transform:translateY(16px);opacity:0}.pdx-dialog.pdx-state-closing.pdx-anim-translate-left{transform:translate(-16px);opacity:0}.pdx-dialog.pdx-state-closing.pdx-anim-translate-right{transform:translate(16px);opacity:0}@media(prefers-reduced-motion:reduce){.pdx-dialog{transition:none!important}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i2.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i3.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: PraxisIconDirective, selector: "mat-icon[praxisIcon]", inputs: ["praxisIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
553
655
|
}
|
|
554
656
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PraxisDialogComponent, decorators: [{
|
|
555
657
|
type: Component,
|
|
@@ -559,7 +661,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
559
661
|
A11yModule,
|
|
560
662
|
MatIconModule,
|
|
561
663
|
PraxisIconDirective,
|
|
562
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "@let _titleId = (id ?? \"praxis-dialog\") + \"-title\";\n\n<ng-template #panelHeader>\n @if (titleTpl?.templateRef || title || titleIcon || displaysCloseButton) {\n <div class=\"pdx-dialog__title\">\n <div class=\"pdx-dialog__title-row\">\n @if (titleTpl?.templateRef) {\n <div class=\"pdx-dialog__title-custom\">\n <ng-container\n [ngTemplateOutlet]=\"titleTpl!.templateRef\"\n ></ng-container>\n </div>\n } @else {\n @if (titleIcon) {\n <mat-icon\n class=\"pdx-dialog__title-icon\"\n [praxisIcon]=\"titleIcon\"\n aria-hidden=\"true\"\n ></mat-icon>\n }\n @if (title) {\n <h2 class=\"pdx-dialog__title-text\" [attr.id]=\"_titleId\">\n {{ title }}\n </h2>\n }\n }\n @if (displaysCloseButton) {\n <button\n type=\"button\"\n class=\"pdx-dialog__close-btn\"\n [attr.aria-label]=\"closeButtonLabel\"\n [attr.title]=\"closeButtonLabel\"\n data-testid=\"dialog-close\"\n (click)=\"requestClose()\"\n >\n <mat-icon praxisIcon=\"close\" aria-hidden=\"true\"></mat-icon>\n </button>\n }\n </div>\n </div>\n }\n</ng-template>\n\n<ng-template #panelActions>\n <div\n class=\"pdx-dialog__actions\"\n [class.is-stretched]=\"actionsLayout === 'stretched'\"\n >\n @if (actionsTpl?.templateRef) {\n <ng-container [ngTemplateOutlet]=\"actionsTpl!.templateRef\"></ng-container>\n } @else {\n @for (a of actions; track a?.id ?? a) {\n <button\n type=\"button\"\n class=\"pdx-dialog__action-btn\"\n [attr.data-testid]=\"a.id || null\"\n [attr.data-role]=\"a.role || null\"\n [attr.data-theme]=\"a.themeColor || null\"\n [attr.data-fill]=\"a.fillMode || null\"\n [ngClass]=\"a.cssClass\"\n (click)=\"onActionClick(a)\"\n [attr.cdkFocusInitial]=\"\n a.role === 'primary' && ariaRole === 'alertdialog' ? '' : null\n \"\n >\n @if (a.icon) {\n <mat-icon [praxisIcon]=\"a.icon\"></mat-icon>\n } @else if (a.svgIcon) {\n <mat-icon [svgIcon]=\"a.svgIcon\"></mat-icon>\n }\n {{ a.text }}\n </button>\n }\n }\n </div>\n</ng-template>\n\n@if (overlayMode) {\n <div\n #panel\n class=\"pdx-dialog pdx-dialog--{{ themeColor }} pdx-dialog--layout-{{\n actionsLayout\n }}\"\n [attr.role]=\"ariaRole\"\n [attr.id]=\"id || null\"\n [attr.aria-modal]=\"true\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy || (title ? _titleId : null)\"\n [attr.aria-describedby]=\"ariaDescribedBy || null\"\n (keydown)=\"onKeydown($event)\"\n cdkTrapFocus\n [ngClass]=\"panelNgClass\"\n [style.width]=\"width\"\n [style.height]=\"height\"\n [style.min-width]=\"minWidth\"\n [style.max-width]=\"maxWidth\"\n [style.min-height]=\"minHeight\"\n [style.max-height]=\"maxHeight\"\n [class.has-actions]=\"(actions.length || 0) > 0 || !!actionsTpl?.templateRef\"\n >\n <ng-container [ngTemplateOutlet]=\"panelHeader\"></ng-container>\n <div class=\"pdx-dialog__content\" tabindex=\"0\">\n @if (contentTpl?.templateRef) {\n <ng-container\n [ngTemplateOutlet]=\"contentTpl!.templateRef\"\n ></ng-container>\n } @else {\n <ng-template cdkPortalOutlet></ng-template>\n }\n </div>\n <ng-container [ngTemplateOutlet]=\"panelActions\"></ng-container>\n </div>\n} @else {\n <div\n class=\"pdx-dialog-overlay\"\n [class.has-backdrop]=\"hasBackdrop\"\n [hidden]=\"!isDisplayed\"\n (click)=\"onBackdrop($event)\"\n [ngClass]=\"backdropClass\"\n [style.z-index]=\"zIndex\"\n >\n <div class=\"pdx-dialog-shell\" (click)=\"$event.stopPropagation()\">\n <div\n #panel\n class=\"pdx-dialog pdx-dialog--{{ themeColor }} pdx-dialog--layout-{{\n actionsLayout\n }}\"\n [attr.role]=\"ariaRole\"\n [attr.id]=\"id || null\"\n [attr.aria-modal]=\"true\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy || (title ? _titleId : null)\"\n [attr.aria-describedby]=\"ariaDescribedBy || null\"\n (keydown)=\"onKeydown($event)\"\n cdkTrapFocus\n [ngClass]=\"panelNgClass\"\n [style.width]=\"width\"\n [style.height]=\"height\"\n [style.min-width]=\"minWidth\"\n [style.max-width]=\"maxWidth\"\n [style.min-height]=\"minHeight\"\n [style.max-height]=\"maxHeight\"\n [style.top]=\"position?.top || null\"\n [style.bottom]=\"position?.bottom || null\"\n [style.left]=\"position?.left || null\"\n [style.right]=\"position?.right || null\"\n [class.pdx-has-position]=\"position\"\n [class.has-actions]=\"\n (actions.length || 0) > 0 || !!actionsTpl?.templateRef\n \"\n >\n <ng-container [ngTemplateOutlet]=\"panelHeader\"></ng-container>\n <div class=\"pdx-dialog__content\" tabindex=\"0\">\n @if (contentTpl?.templateRef) {\n <ng-container\n [ngTemplateOutlet]=\"contentTpl!.templateRef\"\n ></ng-container>\n } @else {\n <ng-template cdkPortalOutlet></ng-template>\n }\n </div>\n <ng-container [ngTemplateOutlet]=\"panelActions\"></ng-container>\n </div>\n </div>\n </div>\n}\n", styles: ["@charset \"UTF-8\";.pdx-dialog-host{--pdx-dialog-bg: var(--praxis-theme-surface, var(--md-sys-color-surface));--pdx-dialog-surface: var( --praxis-theme-surface-overlay, var(--md-sys-color-surface-container-high) );--pdx-dialog-border: var( --praxis-theme-outline, var(--md-sys-color-outline-variant) );--pdx-dialog-title-fg: var( --praxis-theme-on-surface, var(--md-sys-color-on-surface) );--pdx-dialog-elevation: var( --praxis-theme-elevation, var(--mat-elevation-level4) )}.pdx-dialog-overlay{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;z-index:var(--praxis-layer-dialog, 1300);background:transparent}.pdx-dialog-overlay.has-backdrop{background:var(--pdx-dialog-backdrop, rgba(0, 0, 0, .6))}.pdx-dialog-shell{display:contents}.pdx-dialog.pdx-has-position{position:absolute}.pdx-dialog{box-sizing:border-box;background:var(--pdx-dialog-container-color, var(--pdx-dialog-surface));color:var(--praxis-theme-on-surface, var(--md-sys-color-on-surface, #111));border:1px solid var(--pdx-dialog-border);border-radius:var(--pdx-dialog-shape, 16px);box-shadow:var(--pdx-dialog-elevation-shadow, var(--pdx-dialog-elevation));max-width:var(--pdx-dialog-max-width, 90vw);max-height:var(--pdx-dialog-max-height, 80vh);display:flex;flex-direction:column;min-width:var(--pdx-dialog-min-width, 280px);outline:0}.pdx-dialog__title{padding:var(--pdx-dialog-headline-padding, 12px 24px 10px);border-bottom:1px solid var(--pdx-dialog-border);color:var(--pdx-dialog-subhead-color, var(--pdx-dialog-title-fg));background:var(--pdx-dialog-title-bg, transparent);flex:0 0 auto}.pdx-dialog__title-row{display:flex;align-items:center;gap:10px;min-height:40px}.pdx-dialog__title-custom,.pdx-dialog__title-text{min-width:0;flex:1 1 auto}.pdx-dialog__title-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex:0 0 24px;font-size:20px;line-height:1;opacity:.87}.pdx-dialog__title-text{margin:0;font-family:var(--pdx-dialog-subhead-font, inherit);font-size:var(--pdx-dialog-subhead-size, 16px);letter-spacing:var(--pdx-dialog-subhead-tracking, normal);font-weight:var(--pdx-dialog-subhead-weight, 600);line-height:1.2}.pdx-dialog__close-btn{appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:0 0 40px;width:40px;height:40px;margin:-4px -8px -4px 8px;padding:0;border:0;border-radius:999px;color:inherit;background:transparent;cursor:pointer;transition:background-color .16s ease,color .16s ease}.pdx-dialog__close-btn:hover{background:color-mix(in srgb,currentColor 10%,transparent)}.pdx-dialog__close-btn:focus-visible{outline:2px solid var(--praxis-theme-focus-outline, var(--md-sys-color-primary));outline-offset:2px}.pdx-dialog__close-btn .mat-icon{width:22px;height:22px;font-size:22px;line-height:1}.pdx-dialog__content{padding:var(--pdx-dialog-content-padding, 16px);overflow:auto;flex:1 1 auto;min-height:0;color:var(--pdx-dialog-supporting-text-color, inherit);font-family:var(--pdx-dialog-supporting-text-font, inherit);line-height:var(--pdx-dialog-supporting-text-line-height, 1.4);font-size:var(--pdx-dialog-supporting-text-size, 14px);letter-spacing:var(--pdx-dialog-supporting-text-tracking, normal);font-weight:var(--pdx-dialog-supporting-text-weight, 400)}.pdx-dialog.has-actions .pdx-dialog__content{padding-bottom:var(--pdx-dialog-with-actions-content-padding, var(--pdx-dialog-content-padding, 16px))}.pdx-dialog__actions{display:flex;gap:8px;padding:var(--pdx-dialog-actions-padding, 12px 24px 16px);border-top:1px solid var(--pdx-dialog-border);justify-content:flex-end;align-items:center;background:var(--pdx-dialog-actions-bg, transparent);flex:0 0 auto}.pdx-dialog__actions.is-stretched{justify-content:stretch}.pdx-dialog__actions.is-stretched .pdx-dialog__action-btn{flex:1 1 0;justify-content:center}.pdx-dialog__action-btn{appearance:none;border:1px solid var(--pdx-dialog-border);background:var(--praxis-theme-surface, var(--md-sys-color-surface-container-low));color:var(--praxis-theme-on-surface, var(--md-sys-color-on-surface));border-radius:var(--pdx-dialog-action-radius, 8px);padding:var(--pdx-dialog-action-padding, 0 14px);min-height:var(--pdx-dialog-action-min-height, 36px);cursor:pointer;display:inline-flex;align-items:center;gap:8px;line-height:1;transition:background-color .18s ease,border-color .18s ease,color .18s ease}.pdx-dialog__action-btn:hover{background:var(--praxis-theme-surface-raised, var(--md-sys-color-surface-container))}.pdx-dialog__action-btn:focus-visible{outline:2px solid var(--praxis-theme-focus-outline, var(--md-sys-color-primary));outline-offset:2px}.pdx-dialog__action-btn:disabled{opacity:.6;cursor:not-allowed}.pdx-dialog__action-btn[data-role=primary]:not([data-fill]),.pdx-dialog__action-btn[data-fill=solid]{background:var(--md-sys-color-primary);border-color:var(--md-sys-color-primary);color:var(--md-sys-color-on-primary)}.pdx-dialog__action-btn[data-role=primary]:not([data-fill]):hover,.pdx-dialog__action-btn[data-fill=solid]:hover{background:var(--md-sys-color-primary-container);color:var(--md-sys-color-on-primary-container);border-color:var(--md-sys-color-primary-container)}.pdx-dialog__action-btn[data-role=danger]:not([data-fill]),.pdx-dialog__action-btn[data-fill=solid][data-theme=warn],.pdx-dialog__action-btn[data-theme=warn][data-fill=solid]{background:var(--md-sys-color-error);border-color:var(--md-sys-color-error);color:var(--md-sys-color-on-error)}.pdx-dialog__action-btn[data-role=danger]:not([data-fill]):hover,.pdx-dialog__action-btn[data-fill=solid][data-theme=warn]:hover,.pdx-dialog__action-btn[data-theme=warn][data-fill=solid]:hover{background:var(--md-sys-color-error-container);color:var(--md-sys-color-on-error-container);border-color:var(--md-sys-color-error-container)}.pdx-dialog__action-btn[data-fill=solid][data-theme=accent],.pdx-dialog__action-btn[data-theme=accent][data-fill=solid]{background:var(--md-sys-color-secondary);border-color:var(--md-sys-color-secondary);color:var(--md-sys-color-on-secondary)}.pdx-dialog__action-btn[data-fill=solid][data-theme=accent]:hover,.pdx-dialog__action-btn[data-theme=accent][data-fill=solid]:hover{background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container);border-color:var(--md-sys-color-secondary-container)}.pdx-dialog__action-btn[data-fill=outline]{background:transparent;color:var(--praxis-theme-on-surface, var(--md-sys-color-on-surface))}.pdx-dialog__action-btn[data-fill=outline][data-theme=primary],.pdx-dialog__action-btn[data-fill=flat][data-theme=primary]{color:var(--md-sys-color-primary);border-color:var(--md-sys-color-primary)}.pdx-dialog__action-btn[data-fill=outline][data-theme=accent],.pdx-dialog__action-btn[data-fill=flat][data-theme=accent]{color:var(--md-sys-color-secondary);border-color:var(--md-sys-color-secondary)}.pdx-dialog__action-btn[data-fill=outline][data-theme=warn],.pdx-dialog__action-btn[data-fill=flat][data-theme=warn]{color:var(--md-sys-color-error);border-color:var(--md-sys-color-error)}.pdx-dialog__action-btn[data-fill=flat]{background:transparent;border-color:transparent;color:var(--md-sys-color-primary)}.pdx-dialog__action-btn .mat-icon{font-size:20px;width:20px;height:20px;line-height:1;display:inline-flex;align-items:center;justify-content:center}.pdx-dialog--primary .pdx-dialog__title{background:var(--md-sys-color-primary-container);color:var(--md-sys-color-on-primary-container);border-bottom-color:var(--praxis-theme-outline, var(--md-sys-color-outline-variant))}.pdx-dialog--dark{background:var(--praxis-theme-surface-raised, var(--md-sys-color-surface-container));color:var(--praxis-theme-on-surface, var(--md-sys-color-on-surface))}.pdx-dialog{transform-origin:center;transition-property:transform,opacity;transition-duration:var(--pdx-dialog-anim-duration, .3s);transition-timing-function:var(--pdx-dialog-anim-ease, cubic-bezier(.2, 0, 0, 1))}.pdx-dialog.pdx-anim-fade{opacity:1}.pdx-dialog.pdx-anim-zoom{transform:scale(1)}.pdx-dialog.pdx-anim-translate-up,.pdx-dialog.pdx-anim-translate-down{transform:translateY(0)}.pdx-dialog.pdx-anim-translate-left,.pdx-dialog.pdx-anim-translate-right{transform:translate(0)}.pdx-dialog.pdx-state-opening.pdx-anim-fade{opacity:0}.pdx-dialog.pdx-state-opening.pdx-anim-zoom{transform:scale(.96);opacity:0}.pdx-dialog.pdx-state-opening.pdx-anim-translate-up{transform:translateY(-16px);opacity:0}.pdx-dialog.pdx-state-opening.pdx-anim-translate-down{transform:translateY(16px);opacity:0}.pdx-dialog.pdx-state-opening.pdx-anim-translate-left{transform:translate(-16px);opacity:0}.pdx-dialog.pdx-state-opening.pdx-anim-translate-right{transform:translate(16px);opacity:0}.pdx-dialog.pdx-state-closing.pdx-anim-fade{opacity:0}.pdx-dialog.pdx-state-closing.pdx-anim-zoom{transform:scale(.96);opacity:0}.pdx-dialog.pdx-state-closing.pdx-anim-translate-up{transform:translateY(-16px);opacity:0}.pdx-dialog.pdx-state-closing.pdx-anim-translate-down{transform:translateY(16px);opacity:0}.pdx-dialog.pdx-state-closing.pdx-anim-translate-left{transform:translate(-16px);opacity:0}.pdx-dialog.pdx-state-closing.pdx-anim-translate-right{transform:translate(16px);opacity:0}@media(prefers-reduced-motion:reduce){.pdx-dialog{transition:none!important}}\n"] }]
|
|
664
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "@let _titleId = (id ?? \"praxis-dialog\") + \"-title\";\n\n<ng-template #panelHeader>\n @if (titleTpl?.templateRef || title || titleIcon || displaysMaximizeButton || displaysCloseButton) {\n <div class=\"pdx-dialog__title\">\n <div class=\"pdx-dialog__title-row\">\n @if (titleTpl?.templateRef) {\n <div class=\"pdx-dialog__title-custom\">\n <ng-container\n [ngTemplateOutlet]=\"titleTpl!.templateRef\"\n ></ng-container>\n </div>\n } @else {\n @if (titleIcon) {\n <mat-icon\n class=\"pdx-dialog__title-icon\"\n [praxisIcon]=\"titleIcon\"\n aria-hidden=\"true\"\n ></mat-icon>\n }\n @if (title) {\n <h2 class=\"pdx-dialog__title-text\" [attr.id]=\"_titleId\">\n {{ title }}\n </h2>\n }\n }\n @if (displaysMaximizeButton || displaysCloseButton) {\n <div class=\"pdx-dialog__header-actions\">\n @if (displaysMaximizeButton) {\n <button\n type=\"button\"\n class=\"pdx-dialog__maximize-btn\"\n [attr.aria-label]=\"maximizeButtonLabel\"\n [attr.aria-pressed]=\"isMaximized\"\n [attr.title]=\"maximizeButtonLabel\"\n data-testid=\"dialog-maximize\"\n (click)=\"toggleMaximize()\"\n >\n <mat-icon\n [praxisIcon]=\"isMaximized ? 'close_fullscreen' : 'open_in_full'\"\n aria-hidden=\"true\"\n ></mat-icon>\n </button>\n }\n @if (displaysCloseButton) {\n <button\n type=\"button\"\n class=\"pdx-dialog__close-btn\"\n [attr.aria-label]=\"closeButtonLabel\"\n [attr.title]=\"closeButtonLabel\"\n data-testid=\"dialog-close\"\n (click)=\"requestClose()\"\n >\n <mat-icon praxisIcon=\"close\" aria-hidden=\"true\"></mat-icon>\n </button>\n }\n </div>\n }\n </div>\n </div>\n }\n</ng-template>\n\n<ng-template #panelActions>\n <div\n class=\"pdx-dialog__actions\"\n [class.is-stretched]=\"actionsLayout === 'stretched'\"\n >\n @if (actionsTpl?.templateRef) {\n <ng-container [ngTemplateOutlet]=\"actionsTpl!.templateRef\"></ng-container>\n } @else {\n @for (a of actions; track a?.id ?? a) {\n <button\n type=\"button\"\n class=\"pdx-dialog__action-btn\"\n [attr.data-testid]=\"a.id || null\"\n [attr.data-role]=\"a.role || null\"\n [attr.data-theme]=\"a.themeColor || null\"\n [attr.data-fill]=\"a.fillMode || null\"\n [ngClass]=\"a.cssClass\"\n (click)=\"onActionClick(a)\"\n [attr.cdkFocusInitial]=\"\n a.role === 'primary' && ariaRole === 'alertdialog' ? '' : null\n \"\n >\n @if (a.icon) {\n <mat-icon [praxisIcon]=\"a.icon\"></mat-icon>\n } @else if (a.svgIcon) {\n <mat-icon [svgIcon]=\"a.svgIcon\"></mat-icon>\n }\n {{ a.text }}\n </button>\n }\n }\n </div>\n</ng-template>\n\n@if (overlayMode) {\n <div\n #panel\n class=\"pdx-dialog pdx-dialog--{{ themeColor }} pdx-dialog--layout-{{\n actionsLayout\n }}\"\n [attr.role]=\"ariaRole\"\n [attr.id]=\"id || null\"\n [attr.aria-modal]=\"true\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy || (title ? _titleId : null)\"\n [attr.aria-describedby]=\"ariaDescribedBy || null\"\n (keydown)=\"onKeydown($event)\"\n cdkTrapFocus\n [ngClass]=\"panelNgClass\"\n [style.width]=\"width\"\n [style.height]=\"height\"\n [style.min-width]=\"minWidth\"\n [style.max-width]=\"maxWidth\"\n [style.min-height]=\"minHeight\"\n [style.max-height]=\"maxHeight\"\n [class.pdx-dialog--maximized]=\"isMaximized\"\n [class.has-actions]=\"hasFooterActions\"\n >\n <ng-container [ngTemplateOutlet]=\"panelHeader\"></ng-container>\n <div class=\"pdx-dialog__content\" tabindex=\"0\">\n @if (contentTpl?.templateRef) {\n <ng-container\n [ngTemplateOutlet]=\"contentTpl!.templateRef\"\n ></ng-container>\n } @else {\n <ng-template cdkPortalOutlet></ng-template>\n }\n </div>\n @if (hasFooterActions) {\n <ng-container [ngTemplateOutlet]=\"panelActions\"></ng-container>\n }\n </div>\n} @else {\n <div\n class=\"pdx-dialog-overlay\"\n [class.has-backdrop]=\"hasBackdrop\"\n [hidden]=\"!isDisplayed\"\n (click)=\"onBackdrop($event)\"\n [ngClass]=\"backdropClass\"\n [style.z-index]=\"zIndex\"\n >\n <div class=\"pdx-dialog-shell\" (click)=\"$event.stopPropagation()\">\n <div\n #panel\n class=\"pdx-dialog pdx-dialog--{{ themeColor }} pdx-dialog--layout-{{\n actionsLayout\n }}\"\n [attr.role]=\"ariaRole\"\n [attr.id]=\"id || null\"\n [attr.aria-modal]=\"true\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy || (title ? _titleId : null)\"\n [attr.aria-describedby]=\"ariaDescribedBy || null\"\n (keydown)=\"onKeydown($event)\"\n cdkTrapFocus\n [ngClass]=\"panelNgClass\"\n [style.width]=\"width\"\n [style.height]=\"height\"\n [style.min-width]=\"minWidth\"\n [style.max-width]=\"maxWidth\"\n [style.min-height]=\"minHeight\"\n [style.max-height]=\"maxHeight\"\n [style.top]=\"position?.top || null\"\n [style.bottom]=\"position?.bottom || null\"\n [style.left]=\"position?.left || null\"\n [style.right]=\"position?.right || null\"\n [class.pdx-has-position]=\"position\"\n [class.pdx-dialog--maximized]=\"isMaximized\"\n [class.has-actions]=\"hasFooterActions\"\n >\n <ng-container [ngTemplateOutlet]=\"panelHeader\"></ng-container>\n <div class=\"pdx-dialog__content\" tabindex=\"0\">\n @if (contentTpl?.templateRef) {\n <ng-container\n [ngTemplateOutlet]=\"contentTpl!.templateRef\"\n ></ng-container>\n } @else {\n <ng-template cdkPortalOutlet></ng-template>\n }\n </div>\n @if (hasFooterActions) {\n <ng-container [ngTemplateOutlet]=\"panelActions\"></ng-container>\n }\n </div>\n </div>\n </div>\n}\n", styles: ["@charset \"UTF-8\";.pdx-dialog-host{--pdx-dialog-bg: var(--praxis-theme-surface, var(--md-sys-color-surface));--pdx-dialog-surface: var( --praxis-theme-surface-overlay, var(--md-sys-color-surface-container-high) );--pdx-dialog-border: var( --praxis-theme-outline, var(--md-sys-color-outline-variant) );--pdx-dialog-title-fg: var( --praxis-theme-on-surface, var(--md-sys-color-on-surface) );--pdx-dialog-elevation: var( --praxis-theme-elevation, var(--mat-elevation-level4) )}.pdx-dialog-overlay{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;z-index:var(--praxis-layer-dialog, 1300);background:transparent}.pdx-dialog-overlay.has-backdrop{background:var(--pdx-dialog-backdrop, rgba(0, 0, 0, .6))}.pdx-dialog-shell{display:contents}.pdx-dialog.pdx-has-position{position:absolute}.pdx-dialog{box-sizing:border-box;background:var(--pdx-dialog-container-color, var(--pdx-dialog-surface));color:var(--praxis-theme-on-surface, var(--md-sys-color-on-surface, #111));border:1px solid var(--pdx-dialog-border);border-radius:var(--pdx-dialog-shape, 16px);box-shadow:var(--pdx-dialog-elevation-shadow, var(--pdx-dialog-elevation));max-width:var(--pdx-dialog-max-width, 90vw);max-height:var(--pdx-dialog-max-height, 80vh);display:flex;flex-direction:column;min-width:var(--pdx-dialog-min-width, 280px);outline:0}.pdx-dialog.pdx-dialog--maximized{border-radius:var(--pdx-dialog-maximized-shape, 12px)}.pdx-dialog__title{padding:var(--pdx-dialog-headline-padding, 12px 24px 10px);border-bottom:1px solid var(--pdx-dialog-border);color:var(--pdx-dialog-subhead-color, var(--pdx-dialog-title-fg));background:var(--pdx-dialog-title-bg, transparent);flex:0 0 auto}.pdx-dialog__title-row{display:flex;align-items:center;gap:10px;min-height:40px}.pdx-dialog__title-custom,.pdx-dialog__title-text{min-width:0;flex:1 1 auto}.pdx-dialog__title-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex:0 0 24px;font-size:20px;line-height:1;opacity:.87}.pdx-dialog__title-text{margin:0;font-family:var(--pdx-dialog-subhead-font, inherit);font-size:var(--pdx-dialog-subhead-size, 16px);letter-spacing:var(--pdx-dialog-subhead-tracking, normal);font-weight:var(--pdx-dialog-subhead-weight, 600);line-height:1.2}.pdx-dialog__header-actions{display:inline-flex;align-items:center;gap:4px;flex:0 0 auto;margin:-4px -8px -4px 8px}.pdx-dialog__maximize-btn,.pdx-dialog__close-btn{appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:0 0 40px;width:40px;height:40px;margin:0;padding:0;border:0;border-radius:999px;color:inherit;background:transparent;cursor:pointer;transition:background-color .16s ease,color .16s ease}.pdx-dialog__maximize-btn:hover,.pdx-dialog__close-btn:hover{background:color-mix(in srgb,currentColor 10%,transparent)}.pdx-dialog__maximize-btn:focus-visible,.pdx-dialog__close-btn:focus-visible{outline:2px solid var(--praxis-theme-focus-outline, var(--md-sys-color-primary));outline-offset:2px}.pdx-dialog__maximize-btn .mat-icon,.pdx-dialog__close-btn .mat-icon{width:22px;height:22px;font-size:22px;line-height:1}.pdx-dialog__content{padding:var(--pdx-dialog-content-padding, 16px);overflow:auto;flex:1 1 auto;min-height:0;color:var(--pdx-dialog-supporting-text-color, inherit);font-family:var(--pdx-dialog-supporting-text-font, inherit);line-height:var(--pdx-dialog-supporting-text-line-height, 1.4);font-size:var(--pdx-dialog-supporting-text-size, 14px);letter-spacing:var(--pdx-dialog-supporting-text-tracking, normal);font-weight:var(--pdx-dialog-supporting-text-weight, 400)}.pdx-dialog.has-actions .pdx-dialog__content{padding-bottom:var(--pdx-dialog-with-actions-content-padding, var(--pdx-dialog-content-padding, 16px))}.pdx-dialog__actions{display:flex;gap:8px;padding:var(--pdx-dialog-actions-padding, 12px 24px 16px);border-top:1px solid var(--pdx-dialog-border);justify-content:flex-end;align-items:center;background:var(--pdx-dialog-actions-bg, transparent);flex:0 0 auto}.pdx-dialog__actions.is-stretched{justify-content:stretch}.pdx-dialog__actions.is-stretched .pdx-dialog__action-btn{flex:1 1 0;justify-content:center}.pdx-dialog__action-btn{appearance:none;border:1px solid var(--pdx-dialog-border);background:var(--praxis-theme-surface, var(--md-sys-color-surface-container-low));color:var(--praxis-theme-on-surface, var(--md-sys-color-on-surface));border-radius:var(--pdx-dialog-action-radius, 8px);padding:var(--pdx-dialog-action-padding, 0 14px);min-height:var(--pdx-dialog-action-min-height, 36px);cursor:pointer;display:inline-flex;align-items:center;gap:8px;line-height:1;transition:background-color .18s ease,border-color .18s ease,color .18s ease}.pdx-dialog__action-btn:hover{background:var(--praxis-theme-surface-raised, var(--md-sys-color-surface-container))}.pdx-dialog__action-btn:focus-visible{outline:2px solid var(--praxis-theme-focus-outline, var(--md-sys-color-primary));outline-offset:2px}.pdx-dialog__action-btn:disabled{opacity:.6;cursor:not-allowed}.pdx-dialog__action-btn[data-role=primary]:not([data-fill]),.pdx-dialog__action-btn[data-fill=solid]{background:var(--md-sys-color-primary);border-color:var(--md-sys-color-primary);color:var(--md-sys-color-on-primary)}.pdx-dialog__action-btn[data-role=primary]:not([data-fill]):hover,.pdx-dialog__action-btn[data-fill=solid]:hover{background:var(--md-sys-color-primary-container);color:var(--md-sys-color-on-primary-container);border-color:var(--md-sys-color-primary-container)}.pdx-dialog__action-btn[data-role=danger]:not([data-fill]),.pdx-dialog__action-btn[data-fill=solid][data-theme=warn],.pdx-dialog__action-btn[data-theme=warn][data-fill=solid]{background:var(--md-sys-color-error);border-color:var(--md-sys-color-error);color:var(--md-sys-color-on-error)}.pdx-dialog__action-btn[data-role=danger]:not([data-fill]):hover,.pdx-dialog__action-btn[data-fill=solid][data-theme=warn]:hover,.pdx-dialog__action-btn[data-theme=warn][data-fill=solid]:hover{background:var(--md-sys-color-error-container);color:var(--md-sys-color-on-error-container);border-color:var(--md-sys-color-error-container)}.pdx-dialog__action-btn[data-fill=solid][data-theme=accent],.pdx-dialog__action-btn[data-theme=accent][data-fill=solid]{background:var(--md-sys-color-secondary);border-color:var(--md-sys-color-secondary);color:var(--md-sys-color-on-secondary)}.pdx-dialog__action-btn[data-fill=solid][data-theme=accent]:hover,.pdx-dialog__action-btn[data-theme=accent][data-fill=solid]:hover{background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container);border-color:var(--md-sys-color-secondary-container)}.pdx-dialog__action-btn[data-fill=outline]{background:transparent;color:var(--praxis-theme-on-surface, var(--md-sys-color-on-surface))}.pdx-dialog__action-btn[data-fill=outline][data-theme=primary],.pdx-dialog__action-btn[data-fill=flat][data-theme=primary]{color:var(--md-sys-color-primary);border-color:var(--md-sys-color-primary)}.pdx-dialog__action-btn[data-fill=outline][data-theme=accent],.pdx-dialog__action-btn[data-fill=flat][data-theme=accent]{color:var(--md-sys-color-secondary);border-color:var(--md-sys-color-secondary)}.pdx-dialog__action-btn[data-fill=outline][data-theme=warn],.pdx-dialog__action-btn[data-fill=flat][data-theme=warn]{color:var(--md-sys-color-error);border-color:var(--md-sys-color-error)}.pdx-dialog__action-btn[data-fill=flat]{background:transparent;border-color:transparent;color:var(--md-sys-color-primary)}.pdx-dialog__action-btn .mat-icon{font-size:20px;width:20px;height:20px;line-height:1;display:inline-flex;align-items:center;justify-content:center}.pdx-dialog--primary .pdx-dialog__title{background:var(--md-sys-color-primary-container);color:var(--md-sys-color-on-primary-container);border-bottom-color:var(--praxis-theme-outline, var(--md-sys-color-outline-variant))}.pdx-dialog--dark{background:var(--praxis-theme-surface-raised, var(--md-sys-color-surface-container));color:var(--praxis-theme-on-surface, var(--md-sys-color-on-surface))}.pdx-dialog{transform-origin:center;transition-property:transform,opacity;transition-duration:var(--pdx-dialog-anim-duration, .3s);transition-timing-function:var(--pdx-dialog-anim-ease, cubic-bezier(.2, 0, 0, 1))}.pdx-dialog.pdx-anim-fade{opacity:1}.pdx-dialog.pdx-anim-zoom{transform:scale(1)}.pdx-dialog.pdx-anim-translate-up,.pdx-dialog.pdx-anim-translate-down{transform:translateY(0)}.pdx-dialog.pdx-anim-translate-left,.pdx-dialog.pdx-anim-translate-right{transform:translate(0)}.pdx-dialog.pdx-state-opening.pdx-anim-fade{opacity:0}.pdx-dialog.pdx-state-opening.pdx-anim-zoom{transform:scale(.96);opacity:0}.pdx-dialog.pdx-state-opening.pdx-anim-translate-up{transform:translateY(-16px);opacity:0}.pdx-dialog.pdx-state-opening.pdx-anim-translate-down{transform:translateY(16px);opacity:0}.pdx-dialog.pdx-state-opening.pdx-anim-translate-left{transform:translate(-16px);opacity:0}.pdx-dialog.pdx-state-opening.pdx-anim-translate-right{transform:translate(16px);opacity:0}.pdx-dialog.pdx-state-closing.pdx-anim-fade{opacity:0}.pdx-dialog.pdx-state-closing.pdx-anim-zoom{transform:scale(.96);opacity:0}.pdx-dialog.pdx-state-closing.pdx-anim-translate-up{transform:translateY(-16px);opacity:0}.pdx-dialog.pdx-state-closing.pdx-anim-translate-down{transform:translateY(16px);opacity:0}.pdx-dialog.pdx-state-closing.pdx-anim-translate-left{transform:translate(-16px);opacity:0}.pdx-dialog.pdx-state-closing.pdx-anim-translate-right{transform:translate(16px);opacity:0}@media(prefers-reduced-motion:reduce){.pdx-dialog{transition:none!important}}\n"] }]
|
|
563
665
|
}], propDecorators: { title: [{
|
|
564
666
|
type: Input
|
|
565
667
|
}], actions: [{
|
|
@@ -620,6 +722,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
620
722
|
type: Input
|
|
621
723
|
}], titleIcon: [{
|
|
622
724
|
type: Input
|
|
725
|
+
}], canMaximize: [{
|
|
726
|
+
type: Input
|
|
623
727
|
}], action: [{
|
|
624
728
|
type: Output
|
|
625
729
|
}], close: [{
|
|
@@ -628,6 +732,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
628
732
|
type: Output
|
|
629
733
|
}], afterClosed: [{
|
|
630
734
|
type: Output
|
|
735
|
+
}], maximizeChange: [{
|
|
736
|
+
type: Output
|
|
631
737
|
}], contentHost: [{
|
|
632
738
|
type: ViewChild,
|
|
633
739
|
args: [CdkPortalOutlet, { static: false }]
|
|
@@ -655,6 +761,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
655
761
|
}], tabindex: [{
|
|
656
762
|
type: HostBinding,
|
|
657
763
|
args: ['attr.tabindex']
|
|
764
|
+
}], onWindowResize: [{
|
|
765
|
+
type: HostListener,
|
|
766
|
+
args: ['window:resize']
|
|
658
767
|
}] } });
|
|
659
768
|
const PraxisDialogDirectives = [];
|
|
660
769
|
|
|
@@ -755,12 +864,17 @@ class PraxisDialog {
|
|
|
755
864
|
open(content, config) {
|
|
756
865
|
this.layerScale.ensureInstalled();
|
|
757
866
|
const effectiveInjector = config?.injector ?? config?.viewContainerRef?.injector ?? this.injector;
|
|
867
|
+
const overlayRef = this.overlay.createOverlay(config ?? {});
|
|
868
|
+
const ref = new PraxisDialogRef(overlayRef);
|
|
758
869
|
const injector = Injector.create({
|
|
759
|
-
providers: [
|
|
870
|
+
providers: [
|
|
871
|
+
{ provide: PRAXIS_DIALOG_DATA, useValue: config?.data },
|
|
872
|
+
{ provide: PraxisDialogRef, useValue: ref },
|
|
873
|
+
{ provide: SURFACE_DRAWER_REF, useValue: null },
|
|
874
|
+
{ provide: SURFACE_DRAWER_CONTENT_DATA, useValue: null },
|
|
875
|
+
],
|
|
760
876
|
parent: effectiveInjector,
|
|
761
877
|
});
|
|
762
|
-
const overlayRef = this.overlay.createOverlay(config ?? {});
|
|
763
|
-
const ref = new PraxisDialogRef(overlayRef);
|
|
764
878
|
// Auto-id fallback if not provided
|
|
765
879
|
let assignedId = config?.id ?? `praxis-dialog-${++this._seq}`;
|
|
766
880
|
while (this.getDialogById(assignedId)) {
|
|
@@ -788,6 +902,7 @@ class PraxisDialog {
|
|
|
788
902
|
container.maxWidth = config?.maxWidth ?? this.defaults.maxWidth;
|
|
789
903
|
container.minHeight = config?.minHeight;
|
|
790
904
|
container.maxHeight = config?.maxHeight ?? this.defaults.maxHeight;
|
|
905
|
+
container.canMaximize = !!config?.canMaximize;
|
|
791
906
|
container.themeColor = config?.themeColor ?? 'light';
|
|
792
907
|
container.styles = config?.styles;
|
|
793
908
|
container.disableClose = !!config?.disableClose;
|
|
@@ -834,6 +949,30 @@ class PraxisDialog {
|
|
|
834
949
|
ref.close(result);
|
|
835
950
|
}
|
|
836
951
|
});
|
|
952
|
+
const toCssSize = (v) => v == null ? '' : typeof v === 'number' ? `${v}px` : v;
|
|
953
|
+
const subMaximize = container.maximizeChange.subscribe((maximized) => {
|
|
954
|
+
if (maximized) {
|
|
955
|
+
overlayRef.updateSize({
|
|
956
|
+
width: '96vw',
|
|
957
|
+
height: '92vh',
|
|
958
|
+
minWidth: '96vw',
|
|
959
|
+
maxWidth: '96vw',
|
|
960
|
+
minHeight: '92vh',
|
|
961
|
+
maxHeight: '92vh',
|
|
962
|
+
});
|
|
963
|
+
}
|
|
964
|
+
else {
|
|
965
|
+
overlayRef.updateSize({
|
|
966
|
+
width: toCssSize(container.width),
|
|
967
|
+
height: toCssSize(container.height),
|
|
968
|
+
minWidth: toCssSize(container.minWidth),
|
|
969
|
+
maxWidth: toCssSize(container.maxWidth ?? this.defaults.maxWidth),
|
|
970
|
+
minHeight: toCssSize(container.minHeight),
|
|
971
|
+
maxHeight: toCssSize(container.maxHeight ?? this.defaults.maxHeight),
|
|
972
|
+
});
|
|
973
|
+
}
|
|
974
|
+
overlayRef.updatePosition();
|
|
975
|
+
});
|
|
837
976
|
const backdropSub = overlayRef.backdropClick().subscribe((ev) => {
|
|
838
977
|
ref.notifyBackdropClick(ev);
|
|
839
978
|
if (!config?.disableClose && (config?.closeOnBackdropClick ?? true)) {
|
|
@@ -889,6 +1028,7 @@ class PraxisDialog {
|
|
|
889
1028
|
overlayRef.detachments().subscribe(() => {
|
|
890
1029
|
subAction.unsubscribe();
|
|
891
1030
|
subClose.unsubscribe();
|
|
1031
|
+
subMaximize.unsubscribe();
|
|
892
1032
|
backdropSub.unsubscribe();
|
|
893
1033
|
keydownSub.unsubscribe();
|
|
894
1034
|
});
|
|
@@ -1252,16 +1392,43 @@ function providePraxisDialogGlobalActions() {
|
|
|
1252
1392
|
};
|
|
1253
1393
|
}
|
|
1254
1394
|
|
|
1395
|
+
function resolveSurfaceArchetype(payload) {
|
|
1396
|
+
const widgetId = String(payload.widget?.id ?? '').trim();
|
|
1397
|
+
if (widgetId === 'praxis-table' ||
|
|
1398
|
+
widgetId === 'praxis-list' ||
|
|
1399
|
+
widgetId === 'praxis-crud') {
|
|
1400
|
+
return 'collection';
|
|
1401
|
+
}
|
|
1402
|
+
const surfaceKind = String(payload.context?.['surface']?.['kind'] ?? '')
|
|
1403
|
+
.trim()
|
|
1404
|
+
.toUpperCase();
|
|
1405
|
+
const mode = String(payload.widget?.inputs?.['mode'] ?? '')
|
|
1406
|
+
.trim()
|
|
1407
|
+
.toLowerCase();
|
|
1408
|
+
if (surfaceKind === 'FORM' ||
|
|
1409
|
+
surfaceKind === 'PARTIAL_FORM' ||
|
|
1410
|
+
mode === 'create' ||
|
|
1411
|
+
mode === 'edit' ||
|
|
1412
|
+
Boolean(payload.widget?.inputs?.['submitUrl'])) {
|
|
1413
|
+
return 'form';
|
|
1414
|
+
}
|
|
1415
|
+
return 'detail';
|
|
1416
|
+
}
|
|
1255
1417
|
function buildDialogConfig(payload, injector) {
|
|
1418
|
+
const archetype = resolveSurfaceArchetype(payload);
|
|
1419
|
+
const hasExplicitWidth = payload.size?.width != null;
|
|
1420
|
+
const fallbackWidth = archetype === 'collection' ? 'min(960px, 94vw)' : 'min(760px, 92vw)';
|
|
1421
|
+
const fallbackMinWidth = archetype === 'collection' ? 'min(640px, 94vw)' : 'min(540px, 92vw)';
|
|
1256
1422
|
return {
|
|
1257
1423
|
title: payload.title,
|
|
1258
1424
|
titleIcon: payload.icon,
|
|
1259
|
-
width: payload.size?.width,
|
|
1425
|
+
width: payload.size?.width ?? fallbackWidth,
|
|
1260
1426
|
height: payload.size?.height,
|
|
1261
|
-
minWidth: payload.size?.minWidth,
|
|
1262
|
-
maxWidth: payload.size?.maxWidth,
|
|
1427
|
+
minWidth: payload.size?.minWidth ?? (hasExplicitWidth ? undefined : fallbackMinWidth),
|
|
1428
|
+
maxWidth: payload.size?.maxWidth ?? '96vw',
|
|
1263
1429
|
minHeight: payload.size?.minHeight,
|
|
1264
1430
|
maxHeight: payload.size?.maxHeight,
|
|
1431
|
+
canMaximize: payload.size?.expandable ?? true,
|
|
1265
1432
|
injector,
|
|
1266
1433
|
};
|
|
1267
1434
|
}
|
|
@@ -1306,21 +1473,31 @@ function buildDialogSurfaceRuntime(ref, resultSubject, complete) {
|
|
|
1306
1473
|
ref.updateSize(width);
|
|
1307
1474
|
}
|
|
1308
1475
|
},
|
|
1476
|
+
setExpanded: (expanded) => {
|
|
1477
|
+
const container = ref.containerInstance;
|
|
1478
|
+
if (container &&
|
|
1479
|
+
typeof container.toggleMaximize === 'function' &&
|
|
1480
|
+
Boolean(container.isMaximized) !== expanded) {
|
|
1481
|
+
container.toggleMaximize();
|
|
1482
|
+
}
|
|
1483
|
+
},
|
|
1484
|
+
toggleExpanded: () => {
|
|
1485
|
+
ref.containerInstance?.toggleMaximize?.();
|
|
1486
|
+
},
|
|
1309
1487
|
};
|
|
1310
1488
|
}
|
|
1311
1489
|
function resolveDialogWidth(preset) {
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
case 'default':
|
|
1316
|
-
return '720px';
|
|
1317
|
-
case 'wide':
|
|
1318
|
-
return '960px';
|
|
1319
|
-
case 'full':
|
|
1320
|
-
return '100vw';
|
|
1321
|
-
default:
|
|
1322
|
-
return preset || undefined;
|
|
1490
|
+
const trimmed = String(preset ?? '').trim();
|
|
1491
|
+
if (!trimmed) {
|
|
1492
|
+
return undefined;
|
|
1323
1493
|
}
|
|
1494
|
+
if (trimmed === 'narrow' ||
|
|
1495
|
+
trimmed === 'default' ||
|
|
1496
|
+
trimmed === 'wide' ||
|
|
1497
|
+
trimmed === 'full') {
|
|
1498
|
+
return resolveSidePanelPresetWidth(trimmed);
|
|
1499
|
+
}
|
|
1500
|
+
return trimmed;
|
|
1324
1501
|
}
|
|
1325
1502
|
function applySurfaceHostInputs(ref, hostInputs, afterApply) {
|
|
1326
1503
|
const apply = () => {
|
|
@@ -1368,13 +1545,20 @@ function toSurfaceSelectionResult(output, payload) {
|
|
|
1368
1545
|
payload,
|
|
1369
1546
|
};
|
|
1370
1547
|
}
|
|
1371
|
-
function resolveParentSurfaceRuntime(context) {
|
|
1548
|
+
function resolveParentSurfaceRuntime(context, runtimeInjector) {
|
|
1372
1549
|
const runtime = context?.runtime?.state?.surfaceRuntime ||
|
|
1373
1550
|
context?.payload?.surfaceContext?.surfaceRuntime ||
|
|
1374
1551
|
context?.pageContext?.surfaceRuntime;
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1552
|
+
if (runtime && typeof runtime === 'object') {
|
|
1553
|
+
return runtime;
|
|
1554
|
+
}
|
|
1555
|
+
if (runtimeInjector && !runtimeInjector.get(PraxisDialogRef, null)) {
|
|
1556
|
+
const injectedRuntime = runtimeInjector.get(SURFACE_DRAWER_REF, null);
|
|
1557
|
+
if (injectedRuntime && typeof injectedRuntime === 'object') {
|
|
1558
|
+
return injectedRuntime;
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1561
|
+
return null;
|
|
1378
1562
|
}
|
|
1379
1563
|
/**
|
|
1380
1564
|
* The action origin is runtime-only: persisted surface payloads remain JSON
|
|
@@ -1472,11 +1656,35 @@ function providePraxisSurfaceGlobalActions() {
|
|
|
1472
1656
|
});
|
|
1473
1657
|
throw new Error('Drawer surface service not available');
|
|
1474
1658
|
}
|
|
1659
|
+
const archetype = resolveSurfaceArchetype(materializedPayload);
|
|
1660
|
+
const drawerDefaults = archetype === 'collection'
|
|
1661
|
+
? {
|
|
1662
|
+
widthPreset: 'wide',
|
|
1663
|
+
minWidth: '520px',
|
|
1664
|
+
persistSizeKey: 'surface.collection',
|
|
1665
|
+
}
|
|
1666
|
+
: archetype === 'form'
|
|
1667
|
+
? {
|
|
1668
|
+
widthPreset: 'default',
|
|
1669
|
+
minWidth: '420px',
|
|
1670
|
+
persistSizeKey: 'surface.form',
|
|
1671
|
+
}
|
|
1672
|
+
: {
|
|
1673
|
+
widthPreset: 'default',
|
|
1674
|
+
minWidth: '420px',
|
|
1675
|
+
persistSizeKey: 'surface.detail',
|
|
1676
|
+
};
|
|
1677
|
+
const resolvedWidthPreset = materializedPayload.size?.widthPreset ??
|
|
1678
|
+
drawerDefaults.widthPreset;
|
|
1475
1679
|
const frame = {
|
|
1476
1680
|
id: `surface:${materializedPayload.widget.id}`,
|
|
1477
1681
|
title: materializedPayload.title || materializedPayload.widget.id,
|
|
1478
1682
|
titleIcon: materializedPayload.icon,
|
|
1479
1683
|
subtitle: materializedPayload.subtitle,
|
|
1684
|
+
widthPreset: resolvedWidthPreset,
|
|
1685
|
+
...(materializedPayload.size?.width
|
|
1686
|
+
? { width: materializedPayload.size.width }
|
|
1687
|
+
: {}),
|
|
1480
1688
|
...(focusOrigin ? { returnFocusTo: focusOrigin } : {}),
|
|
1481
1689
|
content: {
|
|
1482
1690
|
component: PraxisSurfaceHostComponent,
|
|
@@ -1485,7 +1693,7 @@ function providePraxisSurfaceGlobalActions() {
|
|
|
1485
1693
|
}),
|
|
1486
1694
|
},
|
|
1487
1695
|
};
|
|
1488
|
-
const parentRuntime = resolveParentSurfaceRuntime(context);
|
|
1696
|
+
const parentRuntime = resolveParentSurfaceRuntime(context, runtimeInjector);
|
|
1489
1697
|
if (typeof parentRuntime?.['push'] === 'function') {
|
|
1490
1698
|
const frameRef = await parentRuntime['push'](frame);
|
|
1491
1699
|
if (!frameRef) {
|
|
@@ -1511,11 +1719,18 @@ function providePraxisSurfaceGlobalActions() {
|
|
|
1511
1719
|
}
|
|
1512
1720
|
return frameRef;
|
|
1513
1721
|
}
|
|
1722
|
+
const hasExplicitDrawerWidth = materializedPayload.size?.width != null;
|
|
1514
1723
|
const ref = surfaceDrawer.open({
|
|
1515
1724
|
...frame,
|
|
1725
|
+
widthPreset: resolvedWidthPreset,
|
|
1516
1726
|
width: materializedPayload.size?.width,
|
|
1517
|
-
minWidth: materializedPayload.size?.minWidth
|
|
1518
|
-
|
|
1727
|
+
minWidth: materializedPayload.size?.minWidth ??
|
|
1728
|
+
(hasExplicitDrawerWidth ? undefined : drawerDefaults.minWidth),
|
|
1729
|
+
maxWidth: materializedPayload.size?.maxWidth ?? 'min(1440px, 96vw)',
|
|
1730
|
+
resizable: materializedPayload.size?.resizable ?? true,
|
|
1731
|
+
expandable: materializedPayload.size?.expandable ?? true,
|
|
1732
|
+
persistSizeKey: materializedPayload.size?.persistSizeKey ??
|
|
1733
|
+
drawerDefaults.persistSizeKey,
|
|
1519
1734
|
height: materializedPayload.size?.height,
|
|
1520
1735
|
minHeight: materializedPayload.size?.minHeight,
|
|
1521
1736
|
maxHeight: materializedPayload.size?.maxHeight,
|
|
@@ -1562,6 +1777,1313 @@ function providePraxisSurfaceGlobalActions() {
|
|
|
1562
1777
|
};
|
|
1563
1778
|
}
|
|
1564
1779
|
|
|
1780
|
+
class PraxisQuickViewOverlayComponent {
|
|
1781
|
+
i18n = inject(PraxisI18nService, { optional: true });
|
|
1782
|
+
assistantLaunch = inject(PraxisOperationalAssistantLaunchService, {
|
|
1783
|
+
optional: true,
|
|
1784
|
+
});
|
|
1785
|
+
resolution = signal(null, ...(ngDevMode ? [{ debugName: "resolution" }] : /* istanbul ignore next */ []));
|
|
1786
|
+
bodyRenderer = signal(null, ...(ngDevMode ? [{ debugName: "bodyRenderer" }] : /* istanbul ignore next */ []));
|
|
1787
|
+
narrowModalMode = signal(false, ...(ngDevMode ? [{ debugName: "narrowModalMode" }] : /* istanbul ignore next */ []));
|
|
1788
|
+
copiedField = signal(null, ...(ngDevMode ? [{ debugName: "copiedField" }] : /* istanbul ignore next */ []));
|
|
1789
|
+
failedAvatarUrl = signal(null, ...(ngDevMode ? [{ debugName: "failedAvatarUrl" }] : /* istanbul ignore next */ []));
|
|
1790
|
+
copiedFeedbackTimer = null;
|
|
1791
|
+
pointerEnter = new EventEmitter();
|
|
1792
|
+
pointerLeave = new EventEmitter();
|
|
1793
|
+
openDetail = new EventEmitter();
|
|
1794
|
+
openSurface = new EventEmitter();
|
|
1795
|
+
copyValue = new EventEmitter();
|
|
1796
|
+
dismiss = new EventEmitter();
|
|
1797
|
+
dialogSurface;
|
|
1798
|
+
ctaButton;
|
|
1799
|
+
closeButton;
|
|
1800
|
+
summaryItems = computed(() => this.resolution()?.summaryItems ?? [], ...(ngDevMode ? [{ debugName: "summaryItems" }] : /* istanbul ignore next */ []));
|
|
1801
|
+
contextualActions = computed(() => this.resolution()?.contextualActions ?? [], ...(ngDevMode ? [{ debugName: "contextualActions" }] : /* istanbul ignore next */ []));
|
|
1802
|
+
headerKeyPart = computed(() => this.resolution()?.identity?.key ?? null, ...(ngDevMode ? [{ debugName: "headerKeyPart" }] : /* istanbul ignore next */ []));
|
|
1803
|
+
headerKeyBadgeText = computed(() => {
|
|
1804
|
+
const key = this.headerKeyPart();
|
|
1805
|
+
if (!key || key.value === null || key.value === undefined) {
|
|
1806
|
+
return null;
|
|
1807
|
+
}
|
|
1808
|
+
const raw = String(key.value).trim();
|
|
1809
|
+
if (!raw) {
|
|
1810
|
+
return null;
|
|
1811
|
+
}
|
|
1812
|
+
const res = this.resolution();
|
|
1813
|
+
const mainTitle = String(res?.identity?.title?.value ?? res?.title ?? '').trim();
|
|
1814
|
+
if (mainTitle && raw.toLowerCase() === mainTitle.toLowerCase()) {
|
|
1815
|
+
return null;
|
|
1816
|
+
}
|
|
1817
|
+
const prefix = key.presentation?.prefix ?? '';
|
|
1818
|
+
const suffix = key.presentation?.suffix ?? '';
|
|
1819
|
+
if (prefix || suffix) {
|
|
1820
|
+
return `${prefix}${raw}${suffix}`;
|
|
1821
|
+
}
|
|
1822
|
+
return /^\d+$/.test(raw) ? `#${raw}` : raw;
|
|
1823
|
+
}, ...(ngDevMode ? [{ debugName: "headerKeyBadgeText" }] : /* istanbul ignore next */ []));
|
|
1824
|
+
headerKeyTooltip = computed(() => {
|
|
1825
|
+
const key = this.headerKeyPart();
|
|
1826
|
+
const badge = this.headerKeyBadgeText();
|
|
1827
|
+
if (!key || !badge) {
|
|
1828
|
+
return null;
|
|
1829
|
+
}
|
|
1830
|
+
const label = typeof key.label === 'string' ? key.label.trim() : '';
|
|
1831
|
+
return label ? `${label}: ${badge}` : badge;
|
|
1832
|
+
}, ...(ngDevMode ? [{ debugName: "headerKeyTooltip" }] : /* istanbul ignore next */ []));
|
|
1833
|
+
headerIdentity = computed(() => {
|
|
1834
|
+
const identity = this.resolution()?.identity ?? null;
|
|
1835
|
+
if (!identity) {
|
|
1836
|
+
return null;
|
|
1837
|
+
}
|
|
1838
|
+
if (this.shouldUseCustomBodyRenderer() || this.summaryItems().length > 0) {
|
|
1839
|
+
return {
|
|
1840
|
+
...identity,
|
|
1841
|
+
metadata: [],
|
|
1842
|
+
};
|
|
1843
|
+
}
|
|
1844
|
+
return identity;
|
|
1845
|
+
}, ...(ngDevMode ? [{ debugName: "headerIdentity" }] : /* istanbul ignore next */ []));
|
|
1846
|
+
contextLabel = computed(() => {
|
|
1847
|
+
const res = this.resolution();
|
|
1848
|
+
const surfaceTitle = String(res?.surface?.title ?? '').trim();
|
|
1849
|
+
if (!surfaceTitle) {
|
|
1850
|
+
return null;
|
|
1851
|
+
}
|
|
1852
|
+
const mainTitle = String(res?.title ?? '').trim();
|
|
1853
|
+
return surfaceTitle.toLowerCase() === mainTitle.toLowerCase()
|
|
1854
|
+
? null
|
|
1855
|
+
: surfaceTitle;
|
|
1856
|
+
}, ...(ngDevMode ? [{ debugName: "contextLabel" }] : /* istanbul ignore next */ []));
|
|
1857
|
+
hasContextEyebrow = computed(() => {
|
|
1858
|
+
const res = this.resolution();
|
|
1859
|
+
return Boolean((res?.icon && res.icon.trim().length > 0) ||
|
|
1860
|
+
this.contextLabel() ||
|
|
1861
|
+
this.headerKeyBadgeText());
|
|
1862
|
+
}, ...(ngDevMode ? [{ debugName: "hasContextEyebrow" }] : /* istanbul ignore next */ []));
|
|
1863
|
+
safeAvatarUrl = computed(() => {
|
|
1864
|
+
const res = this.resolution();
|
|
1865
|
+
const rawCandidate = res?.avatarUrl ??
|
|
1866
|
+
(typeof res?.identity?.avatar?.value === 'string'
|
|
1867
|
+
? res.identity.avatar.value
|
|
1868
|
+
: null);
|
|
1869
|
+
if (typeof rawCandidate !== 'string') {
|
|
1870
|
+
return null;
|
|
1871
|
+
}
|
|
1872
|
+
const candidate = rawCandidate.trim();
|
|
1873
|
+
if (!candidate || this.failedAvatarUrl() === candidate) {
|
|
1874
|
+
return null;
|
|
1875
|
+
}
|
|
1876
|
+
if (candidate.startsWith('https://') ||
|
|
1877
|
+
candidate.startsWith('http://') ||
|
|
1878
|
+
(candidate.startsWith('/') && !candidate.startsWith('//'))) {
|
|
1879
|
+
return candidate;
|
|
1880
|
+
}
|
|
1881
|
+
return null;
|
|
1882
|
+
}, ...(ngDevMode ? [{ debugName: "safeAvatarUrl" }] : /* istanbul ignore next */ []));
|
|
1883
|
+
onAvatarError(failedUrl) {
|
|
1884
|
+
this.failedAvatarUrl.set(failedUrl);
|
|
1885
|
+
}
|
|
1886
|
+
closeAriaLabel = computed(() => this.translate('quickView.closeAriaLabel', 'Fechar visualização rápida'), ...(ngDevMode ? [{ debugName: "closeAriaLabel" }] : /* istanbul ignore next */ []));
|
|
1887
|
+
copyButtonLabel = computed(() => this.translate('quickView.copyAction', 'Copiar'), ...(ngDevMode ? [{ debugName: "copyButtonLabel" }] : /* istanbul ignore next */ []));
|
|
1888
|
+
copiedLabel = computed(() => this.translate('quickView.copiedFeedback', 'Copiado'), ...(ngDevMode ? [{ debugName: "copiedLabel" }] : /* istanbul ignore next */ []));
|
|
1889
|
+
copySummaryLabel = computed(() => this.translate('quickView.copySummaryAction', 'Copiar resumo'), ...(ngDevMode ? [{ debugName: "copySummaryLabel" }] : /* istanbul ignore next */ []));
|
|
1890
|
+
summaryCopiedLabel = computed(() => this.translate('quickView.summaryCopiedFeedback', 'Resumo copiado'), ...(ngDevMode ? [{ debugName: "summaryCopiedLabel" }] : /* istanbul ignore next */ []));
|
|
1891
|
+
emptyStateLabel = computed(() => this.translate('quickView.emptyAttributes', 'Nenhum atributo resumido está disponível para este registro.'), ...(ngDevMode ? [{ debugName: "emptyStateLabel" }] : /* istanbul ignore next */ []));
|
|
1892
|
+
unavailableStateLabel = computed(() => this.translate('quickView.unavailableContext', 'Este resumo não está disponível para o seu contexto atual.'), ...(ngDevMode ? [{ debugName: "unavailableStateLabel" }] : /* istanbul ignore next */ []));
|
|
1893
|
+
errorStateLabel = computed(() => this.translate('quickView.loadError', 'Não foi possível carregar o resumo deste registro.'), ...(ngDevMode ? [{ debugName: "errorStateLabel" }] : /* istanbul ignore next */ []));
|
|
1894
|
+
defaultCtaLabel = computed(() => this.translate('quickView.openDetail', 'Abrir detalhe'), ...(ngDevMode ? [{ debugName: "defaultCtaLabel" }] : /* istanbul ignore next */ []));
|
|
1895
|
+
contextualActionsAriaLabel = computed(() => this.translate('quickView.contextualActionsAriaLabel', 'Ações rápidas do registro'), ...(ngDevMode ? [{ debugName: "contextualActionsAriaLabel" }] : /* istanbul ignore next */ []));
|
|
1896
|
+
maskedBadgeLabel = computed(() => this.translate('quickView.maskedBadge', 'LGPD'), ...(ngDevMode ? [{ debugName: "maskedBadgeLabel" }] : /* istanbul ignore next */ []));
|
|
1897
|
+
maskedFieldReasonLabel = computed(() => this.translate('quickView.maskedFieldReason', 'Dado protegido por política de governança / LGPD'), ...(ngDevMode ? [{ debugName: "maskedFieldReasonLabel" }] : /* istanbul ignore next */ []));
|
|
1898
|
+
accessibleLabel = computed(() => {
|
|
1899
|
+
const res = this.resolution();
|
|
1900
|
+
const identityTitle = String(res?.identity?.title?.value ?? res?.identity?.displayLabel ?? '').trim();
|
|
1901
|
+
return (identityTitle ||
|
|
1902
|
+
res?.title ||
|
|
1903
|
+
this.translate('quickView.dialogAriaLabel', 'Visualização rápida do registro'));
|
|
1904
|
+
}, ...(ngDevMode ? [{ debugName: "accessibleLabel" }] : /* istanbul ignore next */ []));
|
|
1905
|
+
translate(key, fallback) {
|
|
1906
|
+
if (!this.i18n) {
|
|
1907
|
+
return fallback;
|
|
1908
|
+
}
|
|
1909
|
+
const translated = this.i18n.t(key, undefined, fallback);
|
|
1910
|
+
return typeof translated === 'string' && translated.trim().length > 0
|
|
1911
|
+
? translated
|
|
1912
|
+
: fallback;
|
|
1913
|
+
}
|
|
1914
|
+
shouldUseCustomBodyRenderer = computed(() => {
|
|
1915
|
+
const res = this.resolution();
|
|
1916
|
+
const renderer = this.bodyRenderer();
|
|
1917
|
+
return Boolean(res?.state === 'ready' && renderer && res.binding.contentRef);
|
|
1918
|
+
}, ...(ngDevMode ? [{ debugName: "shouldUseCustomBodyRenderer" }] : /* istanbul ignore next */ []));
|
|
1919
|
+
customBodyInputs = computed(() => {
|
|
1920
|
+
const res = this.resolution();
|
|
1921
|
+
const renderer = this.bodyRenderer();
|
|
1922
|
+
if (!res || !renderer) {
|
|
1923
|
+
return {};
|
|
1924
|
+
}
|
|
1925
|
+
return renderer.buildInputs({
|
|
1926
|
+
resolution: res,
|
|
1927
|
+
onOpenDetail: () => this.openDetail.emit(),
|
|
1928
|
+
onOpenSurface: (surfaceId) => this.openSurface.emit(surfaceId),
|
|
1929
|
+
onCopyValue: (value, field) => this.copyValue.emit({ value, field }),
|
|
1930
|
+
onDismiss: () => this.dismiss.emit('programmatic'),
|
|
1931
|
+
});
|
|
1932
|
+
}, ...(ngDevMode ? [{ debugName: "customBodyInputs" }] : /* istanbul ignore next */ []));
|
|
1933
|
+
unmaskedCopyableItems = computed(() => this.summaryItems().filter((item) => Boolean(item.copyable && !item.masked && item.formattedValue?.trim())), ...(ngDevMode ? [{ debugName: "unmaskedCopyableItems" }] : /* istanbul ignore next */ []));
|
|
1934
|
+
canCopySummary = computed(() => !this.shouldUseCustomBodyRenderer() &&
|
|
1935
|
+
this.unmaskedCopyableItems().length > 0, ...(ngDevMode ? [{ debugName: "canCopySummary" }] : /* istanbul ignore next */ []));
|
|
1936
|
+
canAskAssistant = computed(() => Boolean(this.assistantLaunch?.isAvailable() && this.resolution()?.state === 'ready'), ...(ngDevMode ? [{ debugName: "canAskAssistant" }] : /* istanbul ignore next */ []));
|
|
1937
|
+
askAssistantLabel = computed(() => {
|
|
1938
|
+
const isEn = this.i18n?.getLocale?.()?.toLowerCase().startsWith('en') ?? false;
|
|
1939
|
+
return this.translate('quickView.askAssistantAction', isEn ? 'Ask Assistant' : 'Perguntar ao Assistente');
|
|
1940
|
+
}, ...(ngDevMode ? [{ debugName: "askAssistantLabel" }] : /* istanbul ignore next */ []));
|
|
1941
|
+
summaryClipboardText = computed(() => {
|
|
1942
|
+
const res = this.resolution();
|
|
1943
|
+
const items = this.unmaskedCopyableItems();
|
|
1944
|
+
if (!res || items.length === 0) {
|
|
1945
|
+
return '';
|
|
1946
|
+
}
|
|
1947
|
+
const lines = [];
|
|
1948
|
+
const context = this.contextLabel();
|
|
1949
|
+
const rawKey = String(res.identity?.key?.value ?? '').trim();
|
|
1950
|
+
const rawTitle = String(res.identity?.title?.value ?? res.title ?? '').trim();
|
|
1951
|
+
const isTitleMasked = rawTitle.includes('••') || rawTitle.includes('**');
|
|
1952
|
+
const safeTitle = isTitleMasked ? '' : rawTitle;
|
|
1953
|
+
const isKeyMasked = rawKey.includes('••') || rawKey.includes('**');
|
|
1954
|
+
const safeKey = isKeyMasked ? '' : rawKey;
|
|
1955
|
+
let headerLine = safeTitle;
|
|
1956
|
+
if (safeKey && safeTitle && safeKey !== safeTitle) {
|
|
1957
|
+
headerLine = `${safeTitle} (#${safeKey})`;
|
|
1958
|
+
}
|
|
1959
|
+
else if (safeKey && !safeTitle) {
|
|
1960
|
+
headerLine = `#${safeKey}`;
|
|
1961
|
+
}
|
|
1962
|
+
if (context && headerLine) {
|
|
1963
|
+
headerLine = `[${context}] ${headerLine}`;
|
|
1964
|
+
}
|
|
1965
|
+
else if (context) {
|
|
1966
|
+
headerLine = `[${context}]`;
|
|
1967
|
+
}
|
|
1968
|
+
if (headerLine) {
|
|
1969
|
+
lines.push(headerLine);
|
|
1970
|
+
}
|
|
1971
|
+
const subtitle = String(res.subtitle ?? '').trim();
|
|
1972
|
+
if (subtitle &&
|
|
1973
|
+
subtitle !== safeTitle &&
|
|
1974
|
+
!subtitle.includes('••') &&
|
|
1975
|
+
!subtitle.includes('**')) {
|
|
1976
|
+
lines.push(subtitle);
|
|
1977
|
+
}
|
|
1978
|
+
for (const item of items) {
|
|
1979
|
+
lines.push(`• ${item.label}: ${item.formattedValue}`);
|
|
1980
|
+
}
|
|
1981
|
+
return lines.join('\n');
|
|
1982
|
+
}, ...(ngDevMode ? [{ debugName: "summaryClipboardText" }] : /* istanbul ignore next */ []));
|
|
1983
|
+
focusInteractiveEntry() {
|
|
1984
|
+
const target = this.ctaButton?.nativeElement ??
|
|
1985
|
+
this.closeButton?.nativeElement ??
|
|
1986
|
+
this.dialogSurface?.nativeElement;
|
|
1987
|
+
if (target && typeof target.focus === 'function') {
|
|
1988
|
+
try {
|
|
1989
|
+
target.focus({ preventScroll: true });
|
|
1990
|
+
}
|
|
1991
|
+
catch {
|
|
1992
|
+
try {
|
|
1993
|
+
target.focus();
|
|
1994
|
+
}
|
|
1995
|
+
catch { }
|
|
1996
|
+
}
|
|
1997
|
+
}
|
|
1998
|
+
}
|
|
1999
|
+
isBadgeOrChip(item) {
|
|
2000
|
+
if (item.masked) {
|
|
2001
|
+
return false;
|
|
2002
|
+
}
|
|
2003
|
+
const presenter = item.presentation?.presenter;
|
|
2004
|
+
return (presenter === 'badge' ||
|
|
2005
|
+
presenter === 'chip' ||
|
|
2006
|
+
presenter === 'status' ||
|
|
2007
|
+
Boolean(item.tone && item.tone !== 'neutral'));
|
|
2008
|
+
}
|
|
2009
|
+
summaryItemTooltip(item) {
|
|
2010
|
+
if (item.masked) {
|
|
2011
|
+
return item.maskReason || this.maskedFieldReasonLabel() || null;
|
|
2012
|
+
}
|
|
2013
|
+
return item.tooltip || null;
|
|
2014
|
+
}
|
|
2015
|
+
onCopyItem(item) {
|
|
2016
|
+
if (!item.formattedValue || item.masked) {
|
|
2017
|
+
return;
|
|
2018
|
+
}
|
|
2019
|
+
this.markCopiedField(item.field);
|
|
2020
|
+
this.copyValue.emit({
|
|
2021
|
+
value: item.formattedValue,
|
|
2022
|
+
field: item.field,
|
|
2023
|
+
});
|
|
2024
|
+
}
|
|
2025
|
+
onCopySummary() {
|
|
2026
|
+
const summaryText = this.summaryClipboardText();
|
|
2027
|
+
if (!summaryText) {
|
|
2028
|
+
return;
|
|
2029
|
+
}
|
|
2030
|
+
this.markCopiedField('__summary__');
|
|
2031
|
+
this.copyValue.emit({
|
|
2032
|
+
value: summaryText,
|
|
2033
|
+
field: '__summary__',
|
|
2034
|
+
});
|
|
2035
|
+
}
|
|
2036
|
+
onAskAssistant() {
|
|
2037
|
+
const res = this.resolution();
|
|
2038
|
+
if (!res || !this.assistantLaunch?.isAvailable()) {
|
|
2039
|
+
return;
|
|
2040
|
+
}
|
|
2041
|
+
const isEn = this.i18n?.getLocale?.()?.toLowerCase().startsWith('en') ?? false;
|
|
2042
|
+
const entityIdRaw = res.identity?.key?.value;
|
|
2043
|
+
const entityId = entityIdRaw !== null && entityIdRaw !== undefined ? String(entityIdRaw).trim() : undefined;
|
|
2044
|
+
const title = String(res.identity?.title?.value ?? res.title ?? '').trim() || undefined;
|
|
2045
|
+
const resourceKey = res.surface?.resourceKey || res.binding?.recordOpen?.target?.resourceKey || undefined;
|
|
2046
|
+
const resourcePath = res.surface?.contextualReadPath || res.surface?.path || undefined;
|
|
2047
|
+
this.assistantLaunch.ask({
|
|
2048
|
+
prompt: isEn
|
|
2049
|
+
? `Analyze rules, restrictions, and history for ${title || resourceKey || 'this record'}${entityId ? ` (${entityId})` : ''}`
|
|
2050
|
+
: `Analise regras, restrições e histórico de ${title || resourceKey || 'este registro'}${entityId ? ` (${entityId})` : ''}`,
|
|
2051
|
+
resourceKey,
|
|
2052
|
+
resourcePath,
|
|
2053
|
+
entityId,
|
|
2054
|
+
recordTitle: title,
|
|
2055
|
+
});
|
|
2056
|
+
this.dismiss.emit('cta');
|
|
2057
|
+
}
|
|
2058
|
+
markCopiedField(field) {
|
|
2059
|
+
this.copiedField.set(field);
|
|
2060
|
+
if (this.copiedFeedbackTimer !== null) {
|
|
2061
|
+
clearTimeout(this.copiedFeedbackTimer);
|
|
2062
|
+
}
|
|
2063
|
+
this.copiedFeedbackTimer = setTimeout(() => {
|
|
2064
|
+
if (this.copiedField() === field) {
|
|
2065
|
+
this.copiedField.set(null);
|
|
2066
|
+
}
|
|
2067
|
+
this.copiedFeedbackTimer = null;
|
|
2068
|
+
}, 1800);
|
|
2069
|
+
}
|
|
2070
|
+
ngOnDestroy() {
|
|
2071
|
+
if (this.copiedFeedbackTimer !== null) {
|
|
2072
|
+
clearTimeout(this.copiedFeedbackTimer);
|
|
2073
|
+
this.copiedFeedbackTimer = null;
|
|
2074
|
+
}
|
|
2075
|
+
}
|
|
2076
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PraxisQuickViewOverlayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2077
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PraxisQuickViewOverlayComponent, isStandalone: true, selector: "praxis-quick-view-overlay", outputs: { pointerEnter: "pointerEnter", pointerLeave: "pointerLeave", openDetail: "openDetail", openSurface: "openSurface", copyValue: "copyValue", dismiss: "dismiss" }, viewQueries: [{ propertyName: "dialogSurface", first: true, predicate: ["dialogSurface"], descendants: true }, { propertyName: "ctaButton", first: true, predicate: ["ctaButton"], descendants: true }, { propertyName: "closeButton", first: true, predicate: ["closeButton"], descendants: true }], ngImport: i0, template: `
|
|
2078
|
+
<section
|
|
2079
|
+
#dialogSurface
|
|
2080
|
+
class="pdx-quick-view"
|
|
2081
|
+
[class.pdx-quick-view--narrow]="narrowModalMode()"
|
|
2082
|
+
role="dialog"
|
|
2083
|
+
[attr.aria-modal]="narrowModalMode() ? 'true' : null"
|
|
2084
|
+
[attr.aria-label]="accessibleLabel()"
|
|
2085
|
+
[attr.aria-busy]="resolution()?.state === 'loading' ? 'true' : null"
|
|
2086
|
+
[attr.data-quick-view-state]="resolution()?.state || 'idle'"
|
|
2087
|
+
tabindex="-1"
|
|
2088
|
+
(mouseenter)="pointerEnter.emit()"
|
|
2089
|
+
(mouseleave)="pointerLeave.emit()"
|
|
2090
|
+
>
|
|
2091
|
+
<header class="pdx-quick-view__header">
|
|
2092
|
+
@if (safeAvatarUrl(); as avatarSrc) {
|
|
2093
|
+
<div class="pdx-quick-view__avatar-wrap" data-testid="quick-view-avatar">
|
|
2094
|
+
<img
|
|
2095
|
+
class="pdx-quick-view__avatar-img"
|
|
2096
|
+
[src]="avatarSrc"
|
|
2097
|
+
alt=""
|
|
2098
|
+
loading="lazy"
|
|
2099
|
+
(error)="onAvatarError(avatarSrc)"
|
|
2100
|
+
/>
|
|
2101
|
+
</div>
|
|
2102
|
+
}
|
|
2103
|
+
<div class="pdx-quick-view__heading">
|
|
2104
|
+
@if (hasContextEyebrow()) {
|
|
2105
|
+
<div class="pdx-quick-view__context" data-testid="quick-view-context">
|
|
2106
|
+
@if (resolution()?.icon; as iconName) {
|
|
2107
|
+
<span class="pdx-quick-view__context-icon-badge" aria-hidden="true">
|
|
2108
|
+
<mat-icon
|
|
2109
|
+
class="pdx-quick-view__context-icon"
|
|
2110
|
+
[praxisIcon]="iconName"
|
|
2111
|
+
></mat-icon>
|
|
2112
|
+
</span>
|
|
2113
|
+
}
|
|
2114
|
+
@if (contextLabel(); as label) {
|
|
2115
|
+
<span class="pdx-quick-view__context-label">{{ label }}</span>
|
|
2116
|
+
}
|
|
2117
|
+
@if (headerKeyBadgeText(); as keyBadge) {
|
|
2118
|
+
<span
|
|
2119
|
+
class="pdx-quick-view__context-key"
|
|
2120
|
+
data-testid="quick-view-key-badge"
|
|
2121
|
+
[attr.title]="headerKeyTooltip()"
|
|
2122
|
+
>
|
|
2123
|
+
{{ keyBadge }}
|
|
2124
|
+
</span>
|
|
2125
|
+
}
|
|
2126
|
+
</div>
|
|
2127
|
+
}
|
|
2128
|
+
@if (headerIdentity(); as identity) {
|
|
2129
|
+
<praxis-resource-identity
|
|
2130
|
+
[identity]="identity"
|
|
2131
|
+
[emptyTitle]="resolution()?.title || ''"
|
|
2132
|
+
density="compact"
|
|
2133
|
+
[showKey]="false"
|
|
2134
|
+
[showMetadataLabels]="false"
|
|
2135
|
+
/>
|
|
2136
|
+
} @else {
|
|
2137
|
+
<h2 class="pdx-quick-view__title">{{ resolution()?.title }}</h2>
|
|
2138
|
+
}
|
|
2139
|
+
@if (resolution()?.subtitle; as subtitle) {
|
|
2140
|
+
<p class="pdx-quick-view__subtitle">{{ subtitle }}</p>
|
|
2141
|
+
}
|
|
2142
|
+
</div>
|
|
2143
|
+
<button
|
|
2144
|
+
#closeButton
|
|
2145
|
+
type="button"
|
|
2146
|
+
class="pdx-quick-view__close"
|
|
2147
|
+
[attr.aria-label]="closeAriaLabel()"
|
|
2148
|
+
(click)="dismiss.emit('programmatic')"
|
|
2149
|
+
>
|
|
2150
|
+
×
|
|
2151
|
+
</button>
|
|
2152
|
+
</header>
|
|
2153
|
+
|
|
2154
|
+
<div class="pdx-quick-view__body">
|
|
2155
|
+
@switch (resolution()?.state) {
|
|
2156
|
+
@case ('loading') {
|
|
2157
|
+
<div class="pdx-quick-view__skeleton" data-testid="quick-view-loading">
|
|
2158
|
+
<div class="pdx-quick-view__skeleton-line pdx-quick-view__skeleton-line--wide"></div>
|
|
2159
|
+
<div class="pdx-quick-view__skeleton-line"></div>
|
|
2160
|
+
<div class="pdx-quick-view__skeleton-line pdx-quick-view__skeleton-line--short"></div>
|
|
2161
|
+
</div>
|
|
2162
|
+
}
|
|
2163
|
+
@case ('ready') {
|
|
2164
|
+
@if (shouldUseCustomBodyRenderer()) {
|
|
2165
|
+
<ng-container
|
|
2166
|
+
*ngComponentOutlet="
|
|
2167
|
+
bodyRenderer()!.component;
|
|
2168
|
+
inputs: customBodyInputs()
|
|
2169
|
+
"
|
|
2170
|
+
/>
|
|
2171
|
+
} @else {
|
|
2172
|
+
@if (summaryItems().length > 0) {
|
|
2173
|
+
<dl class="pdx-quick-view__summary-list" data-testid="quick-view-summary-list">
|
|
2174
|
+
@for (item of summaryItems(); track item.field) {
|
|
2175
|
+
<div class="pdx-quick-view__summary-item">
|
|
2176
|
+
<dt class="pdx-quick-view__summary-label">
|
|
2177
|
+
@if (item.icon; as itemIcon) {
|
|
2178
|
+
<mat-icon
|
|
2179
|
+
class="pdx-quick-view__summary-label-icon"
|
|
2180
|
+
data-testid="quick-view-summary-item-icon"
|
|
2181
|
+
[praxisIcon]="itemIcon"
|
|
2182
|
+
aria-hidden="true"
|
|
2183
|
+
></mat-icon>
|
|
2184
|
+
}
|
|
2185
|
+
<span class="pdx-quick-view__summary-label-text">{{ item.label }}</span>
|
|
2186
|
+
</dt>
|
|
2187
|
+
<dd class="pdx-quick-view__summary-value-wrap">
|
|
2188
|
+
<span
|
|
2189
|
+
class="pdx-quick-view__summary-value"
|
|
2190
|
+
[class.pdx-quick-view__summary-value--badge]="isBadgeOrChip(item)"
|
|
2191
|
+
[class.pdx-quick-view__summary-value--masked]="item.masked"
|
|
2192
|
+
[attr.data-tone]="item.tone || null"
|
|
2193
|
+
[attr.data-has-tooltip]="!item.masked && item.tooltip ? 'true' : null"
|
|
2194
|
+
[attr.tabindex]="!item.masked && item.tooltip ? '0' : null"
|
|
2195
|
+
[matTooltip]="summaryItemTooltip(item) || ''"
|
|
2196
|
+
[matTooltipDisabled]="!summaryItemTooltip(item)"
|
|
2197
|
+
matTooltipPosition="above"
|
|
2198
|
+
[attr.title]="summaryItemTooltip(item) ? null : (item.formattedValue || null)"
|
|
2199
|
+
>
|
|
2200
|
+
{{ item.formattedValue }}
|
|
2201
|
+
</span>
|
|
2202
|
+
@if (item.masked) {
|
|
2203
|
+
<span
|
|
2204
|
+
class="pdx-quick-view__masked-badge"
|
|
2205
|
+
data-testid="quick-view-masked-indicator"
|
|
2206
|
+
role="note"
|
|
2207
|
+
[attr.title]="item.maskReason || maskedFieldReasonLabel()"
|
|
2208
|
+
[attr.aria-label]="item.maskReason || maskedFieldReasonLabel()"
|
|
2209
|
+
>
|
|
2210
|
+
<svg
|
|
2211
|
+
class="pdx-quick-view__masked-icon"
|
|
2212
|
+
viewBox="0 0 16 16"
|
|
2213
|
+
fill="none"
|
|
2214
|
+
stroke="currentColor"
|
|
2215
|
+
stroke-width="1.5"
|
|
2216
|
+
aria-hidden="true"
|
|
2217
|
+
>
|
|
2218
|
+
<rect x="3.5" y="7" width="9" height="6.5" rx="1.5" />
|
|
2219
|
+
<path d="M5.5 7V5a2.5 2.5 0 0 1 5 0v2" />
|
|
2220
|
+
</svg>
|
|
2221
|
+
<span>{{ maskedBadgeLabel() }}</span>
|
|
2222
|
+
</span>
|
|
2223
|
+
}
|
|
2224
|
+
@if (item.copyable && !item.masked && item.formattedValue) {
|
|
2225
|
+
<button
|
|
2226
|
+
type="button"
|
|
2227
|
+
class="pdx-quick-view__copy-btn"
|
|
2228
|
+
[attr.data-copied]="copiedField() === item.field ? 'true' : null"
|
|
2229
|
+
[attr.title]="(copiedField() === item.field ? copiedLabel() : copyButtonLabel()) + ' ' + item.label"
|
|
2230
|
+
[attr.aria-label]="copyButtonLabel() + ' ' + item.label"
|
|
2231
|
+
(click)="onCopyItem(item)"
|
|
2232
|
+
>
|
|
2233
|
+
@if (copiedField() === item.field) {
|
|
2234
|
+
<svg
|
|
2235
|
+
class="pdx-quick-view__copy-icon"
|
|
2236
|
+
viewBox="0 0 16 16"
|
|
2237
|
+
fill="none"
|
|
2238
|
+
stroke="currentColor"
|
|
2239
|
+
stroke-width="1.8"
|
|
2240
|
+
stroke-linecap="round"
|
|
2241
|
+
stroke-linejoin="round"
|
|
2242
|
+
aria-hidden="true"
|
|
2243
|
+
>
|
|
2244
|
+
<path d="M3.5 8.5L6.5 11.5L12.5 4.5" />
|
|
2245
|
+
</svg>
|
|
2246
|
+
} @else {
|
|
2247
|
+
<svg
|
|
2248
|
+
class="pdx-quick-view__copy-icon"
|
|
2249
|
+
viewBox="0 0 16 16"
|
|
2250
|
+
fill="none"
|
|
2251
|
+
stroke="currentColor"
|
|
2252
|
+
stroke-width="1.5"
|
|
2253
|
+
stroke-linecap="round"
|
|
2254
|
+
stroke-linejoin="round"
|
|
2255
|
+
aria-hidden="true"
|
|
2256
|
+
>
|
|
2257
|
+
<rect x="5.5" y="5.5" width="8" height="8" rx="1.5" />
|
|
2258
|
+
<path d="M3.5 10.5H3a1.5 1.5 0 0 1-1.5-1.5V3A1.5 1.5 0 0 1 3 1.5h6A1.5 1.5 0 0 1 10.5 3v.5" />
|
|
2259
|
+
</svg>
|
|
2260
|
+
}
|
|
2261
|
+
<span class="pdx-quick-view__sr-only">
|
|
2262
|
+
{{ copiedField() === item.field ? copiedLabel() : copyButtonLabel() }}
|
|
2263
|
+
</span>
|
|
2264
|
+
</button>
|
|
2265
|
+
}
|
|
2266
|
+
</dd>
|
|
2267
|
+
</div>
|
|
2268
|
+
}
|
|
2269
|
+
</dl>
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2273
|
+
@case ('empty') {
|
|
2274
|
+
<p class="pdx-quick-view__feedback pdx-quick-view__feedback--empty" data-testid="quick-view-empty">
|
|
2275
|
+
{{ resolution()?.failureReason || emptyStateLabel() }}
|
|
2276
|
+
</p>
|
|
2277
|
+
}
|
|
2278
|
+
@case ('unavailable') {
|
|
2279
|
+
<p class="pdx-quick-view__feedback pdx-quick-view__feedback--unavailable" data-testid="quick-view-unavailable">
|
|
2280
|
+
{{ resolution()?.failureReason || unavailableStateLabel() }}
|
|
2281
|
+
</p>
|
|
2282
|
+
}
|
|
2283
|
+
@case ('error') {
|
|
2284
|
+
<p class="pdx-quick-view__feedback pdx-quick-view__feedback--error" data-testid="quick-view-error">
|
|
2285
|
+
{{ resolution()?.failureReason || errorStateLabel() }}
|
|
2286
|
+
</p>
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
</div>
|
|
2290
|
+
|
|
2291
|
+
@if (resolution()?.state === 'ready' && contextualActions().length > 0) {
|
|
2292
|
+
<div
|
|
2293
|
+
class="pdx-quick-view__contextual-actions"
|
|
2294
|
+
data-testid="quick-view-contextual-actions"
|
|
2295
|
+
role="group"
|
|
2296
|
+
[attr.aria-label]="contextualActionsAriaLabel()"
|
|
2297
|
+
>
|
|
2298
|
+
@for (action of contextualActions(); track action.surfaceId) {
|
|
2299
|
+
<button
|
|
2300
|
+
type="button"
|
|
2301
|
+
class="pdx-quick-view__contextual-btn"
|
|
2302
|
+
[attr.data-surface-id]="action.surfaceId"
|
|
2303
|
+
[attr.data-surface-kind]="action.kind || null"
|
|
2304
|
+
[attr.title]="action.description || action.title"
|
|
2305
|
+
(click)="openSurface.emit(action.surfaceId)"
|
|
2306
|
+
>
|
|
2307
|
+
@if (action.icon; as actionIcon) {
|
|
2308
|
+
<mat-icon
|
|
2309
|
+
class="pdx-quick-view__contextual-icon"
|
|
2310
|
+
[praxisIcon]="actionIcon"
|
|
2311
|
+
aria-hidden="true"
|
|
2312
|
+
></mat-icon>
|
|
2313
|
+
}
|
|
2314
|
+
<span class="pdx-quick-view__contextual-label">{{ action.title }}</span>
|
|
2315
|
+
</button>
|
|
2316
|
+
}
|
|
2317
|
+
</div>
|
|
2318
|
+
}
|
|
2319
|
+
|
|
2320
|
+
@if (resolution()?.state === 'ready' && (resolution()?.ctaAvailable || canCopySummary() || canAskAssistant())) {
|
|
2321
|
+
<footer class="pdx-quick-view__footer">
|
|
2322
|
+
@if (canCopySummary()) {
|
|
2323
|
+
<button
|
|
2324
|
+
type="button"
|
|
2325
|
+
class="pdx-quick-view__copy-summary-btn"
|
|
2326
|
+
data-testid="quick-view-copy-summary"
|
|
2327
|
+
[attr.data-copied]="copiedField() === '__summary__' ? 'true' : null"
|
|
2328
|
+
[attr.aria-label]="copiedField() === '__summary__' ? summaryCopiedLabel() : copySummaryLabel()"
|
|
2329
|
+
(click)="onCopySummary()"
|
|
2330
|
+
>
|
|
2331
|
+
@if (copiedField() === '__summary__') {
|
|
2332
|
+
<svg
|
|
2333
|
+
class="pdx-quick-view__copy-icon"
|
|
2334
|
+
viewBox="0 0 16 16"
|
|
2335
|
+
fill="none"
|
|
2336
|
+
stroke="currentColor"
|
|
2337
|
+
stroke-width="1.8"
|
|
2338
|
+
stroke-linecap="round"
|
|
2339
|
+
stroke-linejoin="round"
|
|
2340
|
+
aria-hidden="true"
|
|
2341
|
+
>
|
|
2342
|
+
<path d="M3.5 8.5L6.5 11.5L12.5 4.5" />
|
|
2343
|
+
</svg>
|
|
2344
|
+
} @else {
|
|
2345
|
+
<svg
|
|
2346
|
+
class="pdx-quick-view__copy-icon"
|
|
2347
|
+
viewBox="0 0 16 16"
|
|
2348
|
+
fill="none"
|
|
2349
|
+
stroke="currentColor"
|
|
2350
|
+
stroke-width="1.5"
|
|
2351
|
+
stroke-linecap="round"
|
|
2352
|
+
stroke-linejoin="round"
|
|
2353
|
+
aria-hidden="true"
|
|
2354
|
+
>
|
|
2355
|
+
<rect x="5.5" y="5.5" width="8" height="8" rx="1.5" />
|
|
2356
|
+
<path d="M3.5 10.5H3a1.5 1.5 0 0 1-1.5-1.5V3A1.5 1.5 0 0 1 3 1.5h6A1.5 1.5 0 0 1 10.5 3v.5" />
|
|
2357
|
+
</svg>
|
|
2358
|
+
}
|
|
2359
|
+
<span>{{ copiedField() === '__summary__' ? summaryCopiedLabel() : copySummaryLabel() }}</span>
|
|
2360
|
+
</button>
|
|
2361
|
+
}
|
|
2362
|
+
@if (canAskAssistant()) {
|
|
2363
|
+
<button
|
|
2364
|
+
type="button"
|
|
2365
|
+
class="pdx-quick-view__copy-summary-btn pdx-quick-view__ask-ai-btn"
|
|
2366
|
+
data-testid="quick-view-ask-ai"
|
|
2367
|
+
[attr.aria-label]="askAssistantLabel()"
|
|
2368
|
+
(click)="onAskAssistant()"
|
|
2369
|
+
>
|
|
2370
|
+
<mat-icon class="pdx-quick-view__copy-icon" aria-hidden="true">auto_awesome</mat-icon>
|
|
2371
|
+
<span>{{ askAssistantLabel() }}</span>
|
|
2372
|
+
</button>
|
|
2373
|
+
}
|
|
2374
|
+
@if (resolution()?.ctaAvailable) {
|
|
2375
|
+
<button
|
|
2376
|
+
#ctaButton
|
|
2377
|
+
type="button"
|
|
2378
|
+
class="pdx-quick-view__cta"
|
|
2379
|
+
data-testid="quick-view-open-detail"
|
|
2380
|
+
(click)="openDetail.emit()"
|
|
2381
|
+
>
|
|
2382
|
+
{{ resolution()?.ctaLabel || defaultCtaLabel() }}
|
|
2383
|
+
</button>
|
|
2384
|
+
}
|
|
2385
|
+
</footer>
|
|
2386
|
+
}
|
|
2387
|
+
</section>
|
|
2388
|
+
`, isInline: true, styles: [":host{display:block;max-width:min(26rem,calc(100vw - 1.5rem));min-width:min(20rem,calc(100vw - 1.5rem));box-sizing:border-box}.pdx-quick-view{box-sizing:border-box;display:grid;grid-template-columns:minmax(0,1fr);gap:.625rem;padding:.875rem 1rem;border-radius:var(--pdx-quick-view-radius, .75rem);background:var( --pdx-quick-view-bg, var(--md-sys-color-surface-container-high, var(--mat-sys-surface-container-high)) );color:var(--md-sys-color-on-surface, var(--mat-sys-on-surface));border:1px solid color-mix(in srgb,var(--md-sys-color-outline, var(--mat-sys-outline)) 36%,var(--md-sys-color-outline-variant, var(--mat-sys-outline-variant)));box-shadow:var( --pdx-quick-view-shadow, 0 18px 38px -6px color-mix(in srgb, var(--md-sys-color-shadow, #000000) 32%, transparent), 0 6px 16px -4px color-mix(in srgb, var(--md-sys-color-shadow, #000000) 18%, transparent) );outline:none;overflow:hidden}.pdx-quick-view--narrow{width:calc(100vw - 1.5rem);max-width:28rem;border-radius:var(--pdx-quick-view-narrow-radius, 1rem);padding:.75rem 1rem 1rem}.pdx-quick-view--narrow:before{content:\"\";display:block;width:2.25rem;height:.25rem;margin:0 auto .25rem;border-radius:999px;background:color-mix(in srgb,var(--md-sys-color-on-surface-variant, var(--mat-sys-on-surface-variant)) 32%,transparent)}.pdx-quick-view__header{display:flex;align-items:flex-start;justify-content:space-between;gap:.75rem;min-width:0;padding-bottom:.5rem;border-bottom:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, var(--mat-sys-outline-variant)) 55%,transparent)}.pdx-quick-view__avatar-wrap{flex:0 0 auto;width:2.5rem;height:2.5rem;border-radius:999px;overflow:hidden;background:color-mix(in srgb,var(--md-sys-color-primary, var(--mat-sys-primary)) 12%,transparent);border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, var(--mat-sys-outline-variant)) 60%,transparent);display:inline-flex;align-items:center;justify-content:center}.pdx-quick-view__avatar-img{width:100%;height:100%;object-fit:cover;display:block}.pdx-quick-view__heading{min-width:0;flex:1 1 auto;display:grid;gap:.1875rem}.pdx-quick-view__heading praxis-resource-identity{--pdx-resource-identity-title-font: 700 1.03125rem/1.32 var(--md-sys-typescale-title-medium-font-family, inherit);--pdx-resource-identity-title-wrap: normal}.pdx-quick-view__context{display:inline-flex;align-items:center;flex-wrap:wrap;gap:.375rem;min-width:0;margin-bottom:.125rem}.pdx-quick-view__context-icon-badge{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;border-radius:.3125rem;background:color-mix(in srgb,var(--md-sys-color-primary, var(--mat-sys-primary)) 14%,transparent);color:var(--md-sys-color-primary, var(--mat-sys-primary))}.pdx-quick-view__context-icon{width:.875rem;height:.875rem;font-size:.875rem;line-height:1}.pdx-quick-view__context-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.6875rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--md-sys-color-primary, var(--mat-sys-primary))}.pdx-quick-view__context-key{flex:0 0 auto;display:inline-flex;align-items:center;padding:.0625rem .4375rem;border-radius:999px;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:.6875rem;font-weight:700;line-height:1.25;letter-spacing:.02em;background:color-mix(in srgb,var(--md-sys-color-primary, var(--mat-sys-primary)) 12%,transparent);color:var(--md-sys-color-primary, var(--mat-sys-primary));border:1px solid color-mix(in srgb,var(--md-sys-color-primary, var(--mat-sys-primary)) 26%,transparent)}.pdx-quick-view__title{margin:0;font-size:1.03125rem;font-weight:700;line-height:1.32;color:var(--md-sys-color-on-surface, var(--mat-sys-on-surface));overflow-wrap:anywhere}.pdx-quick-view__subtitle{margin:.0625rem 0 0;font-size:.8125rem;font-weight:500;line-height:1.35;color:var(--md-sys-color-on-surface-variant, var(--mat-sys-on-surface-variant))}.pdx-quick-view__close{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;border:none;border-radius:.375rem;background:transparent;color:var(--md-sys-color-on-surface-variant, var(--mat-sys-on-surface-variant));font-size:1.125rem;line-height:1;cursor:pointer;transition:background-color .14s ease,color .14s ease}.pdx-quick-view__close:hover{background:color-mix(in srgb,var(--md-sys-color-on-surface, var(--mat-sys-on-surface)) 8%,transparent);color:var(--md-sys-color-on-surface, var(--mat-sys-on-surface))}.pdx-quick-view__close:focus-visible{outline:2px solid var(--md-sys-color-primary, var(--mat-sys-primary));outline-offset:2px;background:color-mix(in srgb,var(--md-sys-color-on-surface, var(--mat-sys-on-surface)) 8%,transparent);color:var(--md-sys-color-on-surface, var(--mat-sys-on-surface))}.pdx-quick-view__body{min-width:0}.pdx-quick-view__summary-list{margin:0;display:grid;grid-template-columns:minmax(0,1fr);gap:.4375rem;min-width:0}.pdx-quick-view__summary-item{display:flex;align-items:center;justify-content:space-between;gap:.625rem;min-width:0;font-size:.8125rem;line-height:1.35}.pdx-quick-view__summary-label{color:var(--md-sys-color-on-surface-variant, var(--mat-sys-on-surface-variant));font-weight:500;flex:0 0 auto;max-width:44%;display:inline-flex;align-items:center;gap:.3125rem;overflow-wrap:anywhere}.pdx-quick-view__summary-label-icon{flex:0 0 auto;width:.875rem;height:.875rem;font-size:.875rem;line-height:1;opacity:.78}.pdx-quick-view__summary-label-text{min-width:0}.pdx-quick-view__summary-value-wrap{margin:0;flex:1 1 auto;display:inline-flex;align-items:center;justify-content:flex-end;gap:.375rem;min-width:0;text-align:right}.pdx-quick-view__summary-value{min-width:0;color:var(--md-sys-color-on-surface, var(--mat-sys-on-surface));font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pdx-quick-view__summary-value[data-tone=neutral]{color:var(--md-sys-color-on-surface-variant, var(--mat-sys-on-surface-variant));font-weight:500}.pdx-quick-view__summary-value[data-has-tooltip=true]{cursor:help;text-decoration:underline dotted color-mix(in srgb,currentColor 38%,transparent);text-underline-offset:.2em}.pdx-quick-view__summary-value[data-has-tooltip=true]:focus-visible{outline:2px solid var(--md-sys-color-primary, var(--mat-sys-primary));outline-offset:2px;border-radius:.25rem}.pdx-quick-view__summary-value--badge{padding:.125rem .5rem;border-radius:999px;background:color-mix(in srgb,var(--md-sys-color-primary, var(--mat-sys-primary)) 14%,transparent);color:var(--md-sys-color-primary, var(--mat-sys-primary));font-size:.75rem;font-weight:600}.pdx-quick-view__summary-value--badge[data-tone=secondary]{background:color-mix(in srgb,var(--md-sys-color-secondary, var(--mat-sys-secondary, #475569)) 14%,transparent);color:var(--md-sys-color-secondary, var(--mat-sys-secondary, #475569))}.pdx-quick-view__summary-value--badge[data-tone=info]{background:color-mix(in srgb,var(--praxis-info, var(--md-sys-color-tertiary, #0369a1)) 14%,transparent);color:var(--praxis-info, var(--md-sys-color-tertiary, #0369a1))}.pdx-quick-view__summary-value--badge[data-tone=success]{background:var(--p-table-state-success-bg, color-mix(in srgb, var(--praxis-success, #16a34a) 16%, transparent));color:var(--p-table-state-success-fg, var(--praxis-success, #15803d))}.pdx-quick-view__summary-value--badge[data-tone=warning]{background:var(--p-table-state-warning-bg, color-mix(in srgb, var(--praxis-warning, #92400e) 16%, transparent));color:var(--p-table-state-warning-fg, var(--praxis-warning, #92400e))}.pdx-quick-view__summary-value--badge[data-tone=danger],.pdx-quick-view__summary-value--badge[data-tone=error]{background:color-mix(in srgb,var(--md-sys-color-error, var(--mat-sys-error, #dc2626)) 15%,transparent);color:var(--md-sys-color-error, var(--mat-sys-error, #dc2626))}.pdx-quick-view__summary-value--masked{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;letter-spacing:.04em;color:var(--md-sys-color-on-surface-variant, var(--mat-sys-on-surface-variant))}.pdx-quick-view__masked-badge{display:inline-flex;align-items:center;gap:.25rem;flex:0 0 auto;padding:.0625rem .375rem;border-radius:999px;border:1px solid color-mix(in srgb,var(--praxis-warning, var(--md-sys-color-tertiary, var(--mat-sys-tertiary, #92400e))) 42%,transparent);background:color-mix(in srgb,var(--praxis-warning, var(--md-sys-color-tertiary, var(--mat-sys-tertiary, #92400e))) 12%,transparent);color:var(--praxis-warning, var(--md-sys-color-tertiary, var(--mat-sys-tertiary, #92400e)));font-size:.6875rem;font-weight:600;line-height:1.2}.pdx-quick-view__masked-icon{width:.75rem;height:.75rem;flex:0 0 auto}.pdx-quick-view__copy-btn{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;padding:0;border:1px solid transparent;background:transparent;color:var(--md-sys-color-on-surface-variant, var(--mat-sys-on-surface-variant));border-radius:.3125rem;opacity:0;cursor:pointer;transition:opacity .14s ease,background-color .14s ease,color .14s ease,border-color .14s ease}.pdx-quick-view--narrow .pdx-quick-view__copy-btn,.pdx-quick-view__summary-item:hover .pdx-quick-view__copy-btn,.pdx-quick-view__summary-item:focus-within .pdx-quick-view__copy-btn,.pdx-quick-view__copy-btn:focus-visible,.pdx-quick-view__copy-btn[data-copied=true]{opacity:1}.pdx-quick-view__copy-btn:hover{background:color-mix(in srgb,var(--md-sys-color-primary, var(--mat-sys-primary)) 12%,transparent);color:var(--md-sys-color-primary, var(--mat-sys-primary));border-color:color-mix(in srgb,var(--md-sys-color-primary, var(--mat-sys-primary)) 35%,transparent)}.pdx-quick-view__copy-btn[data-copied=true]{background:color-mix(in srgb,#16a34a 15%,transparent);color:#15803d;border-color:color-mix(in srgb,#16a34a 38%,transparent)}.pdx-quick-view__copy-btn:focus-visible{outline:2px solid var(--md-sys-color-primary, var(--mat-sys-primary));outline-offset:2px}.pdx-quick-view__copy-icon{width:.875rem;height:.875rem;flex:0 0 auto}.pdx-quick-view__sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.pdx-quick-view__feedback{margin:0;font-size:.8125rem;line-height:1.4;color:var(--md-sys-color-on-surface-variant, var(--mat-sys-on-surface-variant))}.pdx-quick-view__feedback--error{color:var(--md-sys-color-error, var(--mat-sys-error))}.pdx-quick-view__skeleton{display:grid;gap:.4375rem;padding:.125rem 0}.pdx-quick-view__skeleton-line{height:.75rem;border-radius:.25rem;background:color-mix(in srgb,var(--md-sys-color-on-surface, var(--mat-sys-on-surface)) 12%,transparent);width:75%}.pdx-quick-view__skeleton-line--wide{width:92%}.pdx-quick-view__skeleton-line--short{width:52%}.pdx-quick-view__contextual-actions{display:flex;align-items:center;flex-wrap:wrap;gap:.375rem;padding-top:.4375rem;border-top:1px dashed color-mix(in srgb,var(--md-sys-color-outline-variant, var(--mat-sys-outline-variant)) 60%,transparent)}.pdx-quick-view__contextual-btn{display:inline-flex;align-items:center;gap:.25rem;min-width:0;max-width:100%;padding:.25rem .5625rem;border-radius:999px;border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, var(--mat-sys-outline-variant)) 85%,transparent);background:color-mix(in srgb,var(--md-sys-color-surface-container, var(--mat-sys-surface-container)) 78%,transparent);color:var(--md-sys-color-on-surface, var(--mat-sys-on-surface));font-size:.71875rem;font-weight:600;line-height:1.25;cursor:pointer;transition:background-color .14s ease,color .14s ease,border-color .14s ease}.pdx-quick-view__contextual-btn:hover{background:color-mix(in srgb,var(--md-sys-color-primary, var(--mat-sys-primary)) 12%,transparent);color:var(--md-sys-color-primary, var(--mat-sys-primary));border-color:color-mix(in srgb,var(--md-sys-color-primary, var(--mat-sys-primary)) 40%,transparent)}.pdx-quick-view__contextual-btn:focus-visible{outline:2px solid var(--md-sys-color-primary, var(--mat-sys-primary));outline-offset:2px}.pdx-quick-view__contextual-icon{flex:0 0 auto;width:.8125rem;height:.8125rem;font-size:.8125rem;line-height:1}.pdx-quick-view__contextual-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pdx-quick-view__footer{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding-top:.5rem;border-top:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, var(--mat-sys-outline-variant)) 65%,transparent)}.pdx-quick-view__copy-summary-btn{display:inline-flex;align-items:center;justify-content:center;gap:.375rem;padding:.3125rem .625rem;border-radius:.375rem;border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, var(--mat-sys-outline-variant)) 80%,transparent);background:color-mix(in srgb,var(--md-sys-color-surface-container, var(--mat-sys-surface-container)) 70%,transparent);color:var(--md-sys-color-on-surface-variant, var(--mat-sys-on-surface-variant));font-size:.75rem;font-weight:600;cursor:pointer;transition:background-color .14s ease,color .14s ease,border-color .14s ease}.pdx-quick-view__copy-summary-btn:hover{background:color-mix(in srgb,var(--md-sys-color-primary, var(--mat-sys-primary)) 10%,transparent);color:var(--md-sys-color-primary, var(--mat-sys-primary));border-color:color-mix(in srgb,var(--md-sys-color-primary, var(--mat-sys-primary)) 40%,transparent)}.pdx-quick-view__copy-summary-btn[data-copied=true]{background:color-mix(in srgb,#16a34a 15%,transparent);color:#15803d;border-color:color-mix(in srgb,#16a34a 38%,transparent)}.pdx-quick-view__copy-summary-btn:focus-visible{outline:2px solid var(--md-sys-color-primary, var(--mat-sys-primary));outline-offset:2px}.pdx-quick-view__cta{margin-left:auto;display:inline-flex;align-items:center;justify-content:center;gap:.375rem;padding:.375rem .8125rem;border-radius:.375rem;border:none;background:var(--md-sys-color-primary, var(--mat-sys-primary));color:var(--md-sys-color-on-primary, var(--mat-sys-on-primary));font-size:.8125rem;font-weight:600;cursor:pointer;transition:filter .14s ease,box-shadow .14s ease}.pdx-quick-view__cta:hover{filter:brightness(1.06)}.pdx-quick-view__cta:focus-visible{outline:2px solid var(--md-sys-color-primary, var(--mat-sys-primary));outline-offset:2px}.pdx-quick-view--narrow .pdx-quick-view__footer{flex-wrap:wrap}.pdx-quick-view--narrow .pdx-quick-view__copy-summary-btn,.pdx-quick-view--narrow .pdx-quick-view__cta{flex:1 1 auto;padding:.5rem .875rem}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3$2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: PraxisIconDirective, selector: "mat-icon[praxisIcon]", inputs: ["praxisIcon"] }, { kind: "component", type: PraxisResourceIdentityComponent, selector: "praxis-resource-identity", inputs: ["identity", "emptyTitle", "density", "showMetadataLabels", "showKey", "showKeyLabel", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2389
|
+
}
|
|
2390
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PraxisQuickViewOverlayComponent, decorators: [{
|
|
2391
|
+
type: Component,
|
|
2392
|
+
args: [{ selector: 'praxis-quick-view-overlay', standalone: true, imports: [
|
|
2393
|
+
CommonModule,
|
|
2394
|
+
MatIconModule,
|
|
2395
|
+
MatTooltipModule,
|
|
2396
|
+
PraxisIconDirective,
|
|
2397
|
+
PraxisResourceIdentityComponent,
|
|
2398
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
2399
|
+
<section
|
|
2400
|
+
#dialogSurface
|
|
2401
|
+
class="pdx-quick-view"
|
|
2402
|
+
[class.pdx-quick-view--narrow]="narrowModalMode()"
|
|
2403
|
+
role="dialog"
|
|
2404
|
+
[attr.aria-modal]="narrowModalMode() ? 'true' : null"
|
|
2405
|
+
[attr.aria-label]="accessibleLabel()"
|
|
2406
|
+
[attr.aria-busy]="resolution()?.state === 'loading' ? 'true' : null"
|
|
2407
|
+
[attr.data-quick-view-state]="resolution()?.state || 'idle'"
|
|
2408
|
+
tabindex="-1"
|
|
2409
|
+
(mouseenter)="pointerEnter.emit()"
|
|
2410
|
+
(mouseleave)="pointerLeave.emit()"
|
|
2411
|
+
>
|
|
2412
|
+
<header class="pdx-quick-view__header">
|
|
2413
|
+
@if (safeAvatarUrl(); as avatarSrc) {
|
|
2414
|
+
<div class="pdx-quick-view__avatar-wrap" data-testid="quick-view-avatar">
|
|
2415
|
+
<img
|
|
2416
|
+
class="pdx-quick-view__avatar-img"
|
|
2417
|
+
[src]="avatarSrc"
|
|
2418
|
+
alt=""
|
|
2419
|
+
loading="lazy"
|
|
2420
|
+
(error)="onAvatarError(avatarSrc)"
|
|
2421
|
+
/>
|
|
2422
|
+
</div>
|
|
2423
|
+
}
|
|
2424
|
+
<div class="pdx-quick-view__heading">
|
|
2425
|
+
@if (hasContextEyebrow()) {
|
|
2426
|
+
<div class="pdx-quick-view__context" data-testid="quick-view-context">
|
|
2427
|
+
@if (resolution()?.icon; as iconName) {
|
|
2428
|
+
<span class="pdx-quick-view__context-icon-badge" aria-hidden="true">
|
|
2429
|
+
<mat-icon
|
|
2430
|
+
class="pdx-quick-view__context-icon"
|
|
2431
|
+
[praxisIcon]="iconName"
|
|
2432
|
+
></mat-icon>
|
|
2433
|
+
</span>
|
|
2434
|
+
}
|
|
2435
|
+
@if (contextLabel(); as label) {
|
|
2436
|
+
<span class="pdx-quick-view__context-label">{{ label }}</span>
|
|
2437
|
+
}
|
|
2438
|
+
@if (headerKeyBadgeText(); as keyBadge) {
|
|
2439
|
+
<span
|
|
2440
|
+
class="pdx-quick-view__context-key"
|
|
2441
|
+
data-testid="quick-view-key-badge"
|
|
2442
|
+
[attr.title]="headerKeyTooltip()"
|
|
2443
|
+
>
|
|
2444
|
+
{{ keyBadge }}
|
|
2445
|
+
</span>
|
|
2446
|
+
}
|
|
2447
|
+
</div>
|
|
2448
|
+
}
|
|
2449
|
+
@if (headerIdentity(); as identity) {
|
|
2450
|
+
<praxis-resource-identity
|
|
2451
|
+
[identity]="identity"
|
|
2452
|
+
[emptyTitle]="resolution()?.title || ''"
|
|
2453
|
+
density="compact"
|
|
2454
|
+
[showKey]="false"
|
|
2455
|
+
[showMetadataLabels]="false"
|
|
2456
|
+
/>
|
|
2457
|
+
} @else {
|
|
2458
|
+
<h2 class="pdx-quick-view__title">{{ resolution()?.title }}</h2>
|
|
2459
|
+
}
|
|
2460
|
+
@if (resolution()?.subtitle; as subtitle) {
|
|
2461
|
+
<p class="pdx-quick-view__subtitle">{{ subtitle }}</p>
|
|
2462
|
+
}
|
|
2463
|
+
</div>
|
|
2464
|
+
<button
|
|
2465
|
+
#closeButton
|
|
2466
|
+
type="button"
|
|
2467
|
+
class="pdx-quick-view__close"
|
|
2468
|
+
[attr.aria-label]="closeAriaLabel()"
|
|
2469
|
+
(click)="dismiss.emit('programmatic')"
|
|
2470
|
+
>
|
|
2471
|
+
×
|
|
2472
|
+
</button>
|
|
2473
|
+
</header>
|
|
2474
|
+
|
|
2475
|
+
<div class="pdx-quick-view__body">
|
|
2476
|
+
@switch (resolution()?.state) {
|
|
2477
|
+
@case ('loading') {
|
|
2478
|
+
<div class="pdx-quick-view__skeleton" data-testid="quick-view-loading">
|
|
2479
|
+
<div class="pdx-quick-view__skeleton-line pdx-quick-view__skeleton-line--wide"></div>
|
|
2480
|
+
<div class="pdx-quick-view__skeleton-line"></div>
|
|
2481
|
+
<div class="pdx-quick-view__skeleton-line pdx-quick-view__skeleton-line--short"></div>
|
|
2482
|
+
</div>
|
|
2483
|
+
}
|
|
2484
|
+
@case ('ready') {
|
|
2485
|
+
@if (shouldUseCustomBodyRenderer()) {
|
|
2486
|
+
<ng-container
|
|
2487
|
+
*ngComponentOutlet="
|
|
2488
|
+
bodyRenderer()!.component;
|
|
2489
|
+
inputs: customBodyInputs()
|
|
2490
|
+
"
|
|
2491
|
+
/>
|
|
2492
|
+
} @else {
|
|
2493
|
+
@if (summaryItems().length > 0) {
|
|
2494
|
+
<dl class="pdx-quick-view__summary-list" data-testid="quick-view-summary-list">
|
|
2495
|
+
@for (item of summaryItems(); track item.field) {
|
|
2496
|
+
<div class="pdx-quick-view__summary-item">
|
|
2497
|
+
<dt class="pdx-quick-view__summary-label">
|
|
2498
|
+
@if (item.icon; as itemIcon) {
|
|
2499
|
+
<mat-icon
|
|
2500
|
+
class="pdx-quick-view__summary-label-icon"
|
|
2501
|
+
data-testid="quick-view-summary-item-icon"
|
|
2502
|
+
[praxisIcon]="itemIcon"
|
|
2503
|
+
aria-hidden="true"
|
|
2504
|
+
></mat-icon>
|
|
2505
|
+
}
|
|
2506
|
+
<span class="pdx-quick-view__summary-label-text">{{ item.label }}</span>
|
|
2507
|
+
</dt>
|
|
2508
|
+
<dd class="pdx-quick-view__summary-value-wrap">
|
|
2509
|
+
<span
|
|
2510
|
+
class="pdx-quick-view__summary-value"
|
|
2511
|
+
[class.pdx-quick-view__summary-value--badge]="isBadgeOrChip(item)"
|
|
2512
|
+
[class.pdx-quick-view__summary-value--masked]="item.masked"
|
|
2513
|
+
[attr.data-tone]="item.tone || null"
|
|
2514
|
+
[attr.data-has-tooltip]="!item.masked && item.tooltip ? 'true' : null"
|
|
2515
|
+
[attr.tabindex]="!item.masked && item.tooltip ? '0' : null"
|
|
2516
|
+
[matTooltip]="summaryItemTooltip(item) || ''"
|
|
2517
|
+
[matTooltipDisabled]="!summaryItemTooltip(item)"
|
|
2518
|
+
matTooltipPosition="above"
|
|
2519
|
+
[attr.title]="summaryItemTooltip(item) ? null : (item.formattedValue || null)"
|
|
2520
|
+
>
|
|
2521
|
+
{{ item.formattedValue }}
|
|
2522
|
+
</span>
|
|
2523
|
+
@if (item.masked) {
|
|
2524
|
+
<span
|
|
2525
|
+
class="pdx-quick-view__masked-badge"
|
|
2526
|
+
data-testid="quick-view-masked-indicator"
|
|
2527
|
+
role="note"
|
|
2528
|
+
[attr.title]="item.maskReason || maskedFieldReasonLabel()"
|
|
2529
|
+
[attr.aria-label]="item.maskReason || maskedFieldReasonLabel()"
|
|
2530
|
+
>
|
|
2531
|
+
<svg
|
|
2532
|
+
class="pdx-quick-view__masked-icon"
|
|
2533
|
+
viewBox="0 0 16 16"
|
|
2534
|
+
fill="none"
|
|
2535
|
+
stroke="currentColor"
|
|
2536
|
+
stroke-width="1.5"
|
|
2537
|
+
aria-hidden="true"
|
|
2538
|
+
>
|
|
2539
|
+
<rect x="3.5" y="7" width="9" height="6.5" rx="1.5" />
|
|
2540
|
+
<path d="M5.5 7V5a2.5 2.5 0 0 1 5 0v2" />
|
|
2541
|
+
</svg>
|
|
2542
|
+
<span>{{ maskedBadgeLabel() }}</span>
|
|
2543
|
+
</span>
|
|
2544
|
+
}
|
|
2545
|
+
@if (item.copyable && !item.masked && item.formattedValue) {
|
|
2546
|
+
<button
|
|
2547
|
+
type="button"
|
|
2548
|
+
class="pdx-quick-view__copy-btn"
|
|
2549
|
+
[attr.data-copied]="copiedField() === item.field ? 'true' : null"
|
|
2550
|
+
[attr.title]="(copiedField() === item.field ? copiedLabel() : copyButtonLabel()) + ' ' + item.label"
|
|
2551
|
+
[attr.aria-label]="copyButtonLabel() + ' ' + item.label"
|
|
2552
|
+
(click)="onCopyItem(item)"
|
|
2553
|
+
>
|
|
2554
|
+
@if (copiedField() === item.field) {
|
|
2555
|
+
<svg
|
|
2556
|
+
class="pdx-quick-view__copy-icon"
|
|
2557
|
+
viewBox="0 0 16 16"
|
|
2558
|
+
fill="none"
|
|
2559
|
+
stroke="currentColor"
|
|
2560
|
+
stroke-width="1.8"
|
|
2561
|
+
stroke-linecap="round"
|
|
2562
|
+
stroke-linejoin="round"
|
|
2563
|
+
aria-hidden="true"
|
|
2564
|
+
>
|
|
2565
|
+
<path d="M3.5 8.5L6.5 11.5L12.5 4.5" />
|
|
2566
|
+
</svg>
|
|
2567
|
+
} @else {
|
|
2568
|
+
<svg
|
|
2569
|
+
class="pdx-quick-view__copy-icon"
|
|
2570
|
+
viewBox="0 0 16 16"
|
|
2571
|
+
fill="none"
|
|
2572
|
+
stroke="currentColor"
|
|
2573
|
+
stroke-width="1.5"
|
|
2574
|
+
stroke-linecap="round"
|
|
2575
|
+
stroke-linejoin="round"
|
|
2576
|
+
aria-hidden="true"
|
|
2577
|
+
>
|
|
2578
|
+
<rect x="5.5" y="5.5" width="8" height="8" rx="1.5" />
|
|
2579
|
+
<path d="M3.5 10.5H3a1.5 1.5 0 0 1-1.5-1.5V3A1.5 1.5 0 0 1 3 1.5h6A1.5 1.5 0 0 1 10.5 3v.5" />
|
|
2580
|
+
</svg>
|
|
2581
|
+
}
|
|
2582
|
+
<span class="pdx-quick-view__sr-only">
|
|
2583
|
+
{{ copiedField() === item.field ? copiedLabel() : copyButtonLabel() }}
|
|
2584
|
+
</span>
|
|
2585
|
+
</button>
|
|
2586
|
+
}
|
|
2587
|
+
</dd>
|
|
2588
|
+
</div>
|
|
2589
|
+
}
|
|
2590
|
+
</dl>
|
|
2591
|
+
}
|
|
2592
|
+
}
|
|
2593
|
+
}
|
|
2594
|
+
@case ('empty') {
|
|
2595
|
+
<p class="pdx-quick-view__feedback pdx-quick-view__feedback--empty" data-testid="quick-view-empty">
|
|
2596
|
+
{{ resolution()?.failureReason || emptyStateLabel() }}
|
|
2597
|
+
</p>
|
|
2598
|
+
}
|
|
2599
|
+
@case ('unavailable') {
|
|
2600
|
+
<p class="pdx-quick-view__feedback pdx-quick-view__feedback--unavailable" data-testid="quick-view-unavailable">
|
|
2601
|
+
{{ resolution()?.failureReason || unavailableStateLabel() }}
|
|
2602
|
+
</p>
|
|
2603
|
+
}
|
|
2604
|
+
@case ('error') {
|
|
2605
|
+
<p class="pdx-quick-view__feedback pdx-quick-view__feedback--error" data-testid="quick-view-error">
|
|
2606
|
+
{{ resolution()?.failureReason || errorStateLabel() }}
|
|
2607
|
+
</p>
|
|
2608
|
+
}
|
|
2609
|
+
}
|
|
2610
|
+
</div>
|
|
2611
|
+
|
|
2612
|
+
@if (resolution()?.state === 'ready' && contextualActions().length > 0) {
|
|
2613
|
+
<div
|
|
2614
|
+
class="pdx-quick-view__contextual-actions"
|
|
2615
|
+
data-testid="quick-view-contextual-actions"
|
|
2616
|
+
role="group"
|
|
2617
|
+
[attr.aria-label]="contextualActionsAriaLabel()"
|
|
2618
|
+
>
|
|
2619
|
+
@for (action of contextualActions(); track action.surfaceId) {
|
|
2620
|
+
<button
|
|
2621
|
+
type="button"
|
|
2622
|
+
class="pdx-quick-view__contextual-btn"
|
|
2623
|
+
[attr.data-surface-id]="action.surfaceId"
|
|
2624
|
+
[attr.data-surface-kind]="action.kind || null"
|
|
2625
|
+
[attr.title]="action.description || action.title"
|
|
2626
|
+
(click)="openSurface.emit(action.surfaceId)"
|
|
2627
|
+
>
|
|
2628
|
+
@if (action.icon; as actionIcon) {
|
|
2629
|
+
<mat-icon
|
|
2630
|
+
class="pdx-quick-view__contextual-icon"
|
|
2631
|
+
[praxisIcon]="actionIcon"
|
|
2632
|
+
aria-hidden="true"
|
|
2633
|
+
></mat-icon>
|
|
2634
|
+
}
|
|
2635
|
+
<span class="pdx-quick-view__contextual-label">{{ action.title }}</span>
|
|
2636
|
+
</button>
|
|
2637
|
+
}
|
|
2638
|
+
</div>
|
|
2639
|
+
}
|
|
2640
|
+
|
|
2641
|
+
@if (resolution()?.state === 'ready' && (resolution()?.ctaAvailable || canCopySummary() || canAskAssistant())) {
|
|
2642
|
+
<footer class="pdx-quick-view__footer">
|
|
2643
|
+
@if (canCopySummary()) {
|
|
2644
|
+
<button
|
|
2645
|
+
type="button"
|
|
2646
|
+
class="pdx-quick-view__copy-summary-btn"
|
|
2647
|
+
data-testid="quick-view-copy-summary"
|
|
2648
|
+
[attr.data-copied]="copiedField() === '__summary__' ? 'true' : null"
|
|
2649
|
+
[attr.aria-label]="copiedField() === '__summary__' ? summaryCopiedLabel() : copySummaryLabel()"
|
|
2650
|
+
(click)="onCopySummary()"
|
|
2651
|
+
>
|
|
2652
|
+
@if (copiedField() === '__summary__') {
|
|
2653
|
+
<svg
|
|
2654
|
+
class="pdx-quick-view__copy-icon"
|
|
2655
|
+
viewBox="0 0 16 16"
|
|
2656
|
+
fill="none"
|
|
2657
|
+
stroke="currentColor"
|
|
2658
|
+
stroke-width="1.8"
|
|
2659
|
+
stroke-linecap="round"
|
|
2660
|
+
stroke-linejoin="round"
|
|
2661
|
+
aria-hidden="true"
|
|
2662
|
+
>
|
|
2663
|
+
<path d="M3.5 8.5L6.5 11.5L12.5 4.5" />
|
|
2664
|
+
</svg>
|
|
2665
|
+
} @else {
|
|
2666
|
+
<svg
|
|
2667
|
+
class="pdx-quick-view__copy-icon"
|
|
2668
|
+
viewBox="0 0 16 16"
|
|
2669
|
+
fill="none"
|
|
2670
|
+
stroke="currentColor"
|
|
2671
|
+
stroke-width="1.5"
|
|
2672
|
+
stroke-linecap="round"
|
|
2673
|
+
stroke-linejoin="round"
|
|
2674
|
+
aria-hidden="true"
|
|
2675
|
+
>
|
|
2676
|
+
<rect x="5.5" y="5.5" width="8" height="8" rx="1.5" />
|
|
2677
|
+
<path d="M3.5 10.5H3a1.5 1.5 0 0 1-1.5-1.5V3A1.5 1.5 0 0 1 3 1.5h6A1.5 1.5 0 0 1 10.5 3v.5" />
|
|
2678
|
+
</svg>
|
|
2679
|
+
}
|
|
2680
|
+
<span>{{ copiedField() === '__summary__' ? summaryCopiedLabel() : copySummaryLabel() }}</span>
|
|
2681
|
+
</button>
|
|
2682
|
+
}
|
|
2683
|
+
@if (canAskAssistant()) {
|
|
2684
|
+
<button
|
|
2685
|
+
type="button"
|
|
2686
|
+
class="pdx-quick-view__copy-summary-btn pdx-quick-view__ask-ai-btn"
|
|
2687
|
+
data-testid="quick-view-ask-ai"
|
|
2688
|
+
[attr.aria-label]="askAssistantLabel()"
|
|
2689
|
+
(click)="onAskAssistant()"
|
|
2690
|
+
>
|
|
2691
|
+
<mat-icon class="pdx-quick-view__copy-icon" aria-hidden="true">auto_awesome</mat-icon>
|
|
2692
|
+
<span>{{ askAssistantLabel() }}</span>
|
|
2693
|
+
</button>
|
|
2694
|
+
}
|
|
2695
|
+
@if (resolution()?.ctaAvailable) {
|
|
2696
|
+
<button
|
|
2697
|
+
#ctaButton
|
|
2698
|
+
type="button"
|
|
2699
|
+
class="pdx-quick-view__cta"
|
|
2700
|
+
data-testid="quick-view-open-detail"
|
|
2701
|
+
(click)="openDetail.emit()"
|
|
2702
|
+
>
|
|
2703
|
+
{{ resolution()?.ctaLabel || defaultCtaLabel() }}
|
|
2704
|
+
</button>
|
|
2705
|
+
}
|
|
2706
|
+
</footer>
|
|
2707
|
+
}
|
|
2708
|
+
</section>
|
|
2709
|
+
`, styles: [":host{display:block;max-width:min(26rem,calc(100vw - 1.5rem));min-width:min(20rem,calc(100vw - 1.5rem));box-sizing:border-box}.pdx-quick-view{box-sizing:border-box;display:grid;grid-template-columns:minmax(0,1fr);gap:.625rem;padding:.875rem 1rem;border-radius:var(--pdx-quick-view-radius, .75rem);background:var( --pdx-quick-view-bg, var(--md-sys-color-surface-container-high, var(--mat-sys-surface-container-high)) );color:var(--md-sys-color-on-surface, var(--mat-sys-on-surface));border:1px solid color-mix(in srgb,var(--md-sys-color-outline, var(--mat-sys-outline)) 36%,var(--md-sys-color-outline-variant, var(--mat-sys-outline-variant)));box-shadow:var( --pdx-quick-view-shadow, 0 18px 38px -6px color-mix(in srgb, var(--md-sys-color-shadow, #000000) 32%, transparent), 0 6px 16px -4px color-mix(in srgb, var(--md-sys-color-shadow, #000000) 18%, transparent) );outline:none;overflow:hidden}.pdx-quick-view--narrow{width:calc(100vw - 1.5rem);max-width:28rem;border-radius:var(--pdx-quick-view-narrow-radius, 1rem);padding:.75rem 1rem 1rem}.pdx-quick-view--narrow:before{content:\"\";display:block;width:2.25rem;height:.25rem;margin:0 auto .25rem;border-radius:999px;background:color-mix(in srgb,var(--md-sys-color-on-surface-variant, var(--mat-sys-on-surface-variant)) 32%,transparent)}.pdx-quick-view__header{display:flex;align-items:flex-start;justify-content:space-between;gap:.75rem;min-width:0;padding-bottom:.5rem;border-bottom:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, var(--mat-sys-outline-variant)) 55%,transparent)}.pdx-quick-view__avatar-wrap{flex:0 0 auto;width:2.5rem;height:2.5rem;border-radius:999px;overflow:hidden;background:color-mix(in srgb,var(--md-sys-color-primary, var(--mat-sys-primary)) 12%,transparent);border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, var(--mat-sys-outline-variant)) 60%,transparent);display:inline-flex;align-items:center;justify-content:center}.pdx-quick-view__avatar-img{width:100%;height:100%;object-fit:cover;display:block}.pdx-quick-view__heading{min-width:0;flex:1 1 auto;display:grid;gap:.1875rem}.pdx-quick-view__heading praxis-resource-identity{--pdx-resource-identity-title-font: 700 1.03125rem/1.32 var(--md-sys-typescale-title-medium-font-family, inherit);--pdx-resource-identity-title-wrap: normal}.pdx-quick-view__context{display:inline-flex;align-items:center;flex-wrap:wrap;gap:.375rem;min-width:0;margin-bottom:.125rem}.pdx-quick-view__context-icon-badge{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;border-radius:.3125rem;background:color-mix(in srgb,var(--md-sys-color-primary, var(--mat-sys-primary)) 14%,transparent);color:var(--md-sys-color-primary, var(--mat-sys-primary))}.pdx-quick-view__context-icon{width:.875rem;height:.875rem;font-size:.875rem;line-height:1}.pdx-quick-view__context-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.6875rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--md-sys-color-primary, var(--mat-sys-primary))}.pdx-quick-view__context-key{flex:0 0 auto;display:inline-flex;align-items:center;padding:.0625rem .4375rem;border-radius:999px;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:.6875rem;font-weight:700;line-height:1.25;letter-spacing:.02em;background:color-mix(in srgb,var(--md-sys-color-primary, var(--mat-sys-primary)) 12%,transparent);color:var(--md-sys-color-primary, var(--mat-sys-primary));border:1px solid color-mix(in srgb,var(--md-sys-color-primary, var(--mat-sys-primary)) 26%,transparent)}.pdx-quick-view__title{margin:0;font-size:1.03125rem;font-weight:700;line-height:1.32;color:var(--md-sys-color-on-surface, var(--mat-sys-on-surface));overflow-wrap:anywhere}.pdx-quick-view__subtitle{margin:.0625rem 0 0;font-size:.8125rem;font-weight:500;line-height:1.35;color:var(--md-sys-color-on-surface-variant, var(--mat-sys-on-surface-variant))}.pdx-quick-view__close{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;border:none;border-radius:.375rem;background:transparent;color:var(--md-sys-color-on-surface-variant, var(--mat-sys-on-surface-variant));font-size:1.125rem;line-height:1;cursor:pointer;transition:background-color .14s ease,color .14s ease}.pdx-quick-view__close:hover{background:color-mix(in srgb,var(--md-sys-color-on-surface, var(--mat-sys-on-surface)) 8%,transparent);color:var(--md-sys-color-on-surface, var(--mat-sys-on-surface))}.pdx-quick-view__close:focus-visible{outline:2px solid var(--md-sys-color-primary, var(--mat-sys-primary));outline-offset:2px;background:color-mix(in srgb,var(--md-sys-color-on-surface, var(--mat-sys-on-surface)) 8%,transparent);color:var(--md-sys-color-on-surface, var(--mat-sys-on-surface))}.pdx-quick-view__body{min-width:0}.pdx-quick-view__summary-list{margin:0;display:grid;grid-template-columns:minmax(0,1fr);gap:.4375rem;min-width:0}.pdx-quick-view__summary-item{display:flex;align-items:center;justify-content:space-between;gap:.625rem;min-width:0;font-size:.8125rem;line-height:1.35}.pdx-quick-view__summary-label{color:var(--md-sys-color-on-surface-variant, var(--mat-sys-on-surface-variant));font-weight:500;flex:0 0 auto;max-width:44%;display:inline-flex;align-items:center;gap:.3125rem;overflow-wrap:anywhere}.pdx-quick-view__summary-label-icon{flex:0 0 auto;width:.875rem;height:.875rem;font-size:.875rem;line-height:1;opacity:.78}.pdx-quick-view__summary-label-text{min-width:0}.pdx-quick-view__summary-value-wrap{margin:0;flex:1 1 auto;display:inline-flex;align-items:center;justify-content:flex-end;gap:.375rem;min-width:0;text-align:right}.pdx-quick-view__summary-value{min-width:0;color:var(--md-sys-color-on-surface, var(--mat-sys-on-surface));font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pdx-quick-view__summary-value[data-tone=neutral]{color:var(--md-sys-color-on-surface-variant, var(--mat-sys-on-surface-variant));font-weight:500}.pdx-quick-view__summary-value[data-has-tooltip=true]{cursor:help;text-decoration:underline dotted color-mix(in srgb,currentColor 38%,transparent);text-underline-offset:.2em}.pdx-quick-view__summary-value[data-has-tooltip=true]:focus-visible{outline:2px solid var(--md-sys-color-primary, var(--mat-sys-primary));outline-offset:2px;border-radius:.25rem}.pdx-quick-view__summary-value--badge{padding:.125rem .5rem;border-radius:999px;background:color-mix(in srgb,var(--md-sys-color-primary, var(--mat-sys-primary)) 14%,transparent);color:var(--md-sys-color-primary, var(--mat-sys-primary));font-size:.75rem;font-weight:600}.pdx-quick-view__summary-value--badge[data-tone=secondary]{background:color-mix(in srgb,var(--md-sys-color-secondary, var(--mat-sys-secondary, #475569)) 14%,transparent);color:var(--md-sys-color-secondary, var(--mat-sys-secondary, #475569))}.pdx-quick-view__summary-value--badge[data-tone=info]{background:color-mix(in srgb,var(--praxis-info, var(--md-sys-color-tertiary, #0369a1)) 14%,transparent);color:var(--praxis-info, var(--md-sys-color-tertiary, #0369a1))}.pdx-quick-view__summary-value--badge[data-tone=success]{background:var(--p-table-state-success-bg, color-mix(in srgb, var(--praxis-success, #16a34a) 16%, transparent));color:var(--p-table-state-success-fg, var(--praxis-success, #15803d))}.pdx-quick-view__summary-value--badge[data-tone=warning]{background:var(--p-table-state-warning-bg, color-mix(in srgb, var(--praxis-warning, #92400e) 16%, transparent));color:var(--p-table-state-warning-fg, var(--praxis-warning, #92400e))}.pdx-quick-view__summary-value--badge[data-tone=danger],.pdx-quick-view__summary-value--badge[data-tone=error]{background:color-mix(in srgb,var(--md-sys-color-error, var(--mat-sys-error, #dc2626)) 15%,transparent);color:var(--md-sys-color-error, var(--mat-sys-error, #dc2626))}.pdx-quick-view__summary-value--masked{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;letter-spacing:.04em;color:var(--md-sys-color-on-surface-variant, var(--mat-sys-on-surface-variant))}.pdx-quick-view__masked-badge{display:inline-flex;align-items:center;gap:.25rem;flex:0 0 auto;padding:.0625rem .375rem;border-radius:999px;border:1px solid color-mix(in srgb,var(--praxis-warning, var(--md-sys-color-tertiary, var(--mat-sys-tertiary, #92400e))) 42%,transparent);background:color-mix(in srgb,var(--praxis-warning, var(--md-sys-color-tertiary, var(--mat-sys-tertiary, #92400e))) 12%,transparent);color:var(--praxis-warning, var(--md-sys-color-tertiary, var(--mat-sys-tertiary, #92400e)));font-size:.6875rem;font-weight:600;line-height:1.2}.pdx-quick-view__masked-icon{width:.75rem;height:.75rem;flex:0 0 auto}.pdx-quick-view__copy-btn{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;padding:0;border:1px solid transparent;background:transparent;color:var(--md-sys-color-on-surface-variant, var(--mat-sys-on-surface-variant));border-radius:.3125rem;opacity:0;cursor:pointer;transition:opacity .14s ease,background-color .14s ease,color .14s ease,border-color .14s ease}.pdx-quick-view--narrow .pdx-quick-view__copy-btn,.pdx-quick-view__summary-item:hover .pdx-quick-view__copy-btn,.pdx-quick-view__summary-item:focus-within .pdx-quick-view__copy-btn,.pdx-quick-view__copy-btn:focus-visible,.pdx-quick-view__copy-btn[data-copied=true]{opacity:1}.pdx-quick-view__copy-btn:hover{background:color-mix(in srgb,var(--md-sys-color-primary, var(--mat-sys-primary)) 12%,transparent);color:var(--md-sys-color-primary, var(--mat-sys-primary));border-color:color-mix(in srgb,var(--md-sys-color-primary, var(--mat-sys-primary)) 35%,transparent)}.pdx-quick-view__copy-btn[data-copied=true]{background:color-mix(in srgb,#16a34a 15%,transparent);color:#15803d;border-color:color-mix(in srgb,#16a34a 38%,transparent)}.pdx-quick-view__copy-btn:focus-visible{outline:2px solid var(--md-sys-color-primary, var(--mat-sys-primary));outline-offset:2px}.pdx-quick-view__copy-icon{width:.875rem;height:.875rem;flex:0 0 auto}.pdx-quick-view__sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.pdx-quick-view__feedback{margin:0;font-size:.8125rem;line-height:1.4;color:var(--md-sys-color-on-surface-variant, var(--mat-sys-on-surface-variant))}.pdx-quick-view__feedback--error{color:var(--md-sys-color-error, var(--mat-sys-error))}.pdx-quick-view__skeleton{display:grid;gap:.4375rem;padding:.125rem 0}.pdx-quick-view__skeleton-line{height:.75rem;border-radius:.25rem;background:color-mix(in srgb,var(--md-sys-color-on-surface, var(--mat-sys-on-surface)) 12%,transparent);width:75%}.pdx-quick-view__skeleton-line--wide{width:92%}.pdx-quick-view__skeleton-line--short{width:52%}.pdx-quick-view__contextual-actions{display:flex;align-items:center;flex-wrap:wrap;gap:.375rem;padding-top:.4375rem;border-top:1px dashed color-mix(in srgb,var(--md-sys-color-outline-variant, var(--mat-sys-outline-variant)) 60%,transparent)}.pdx-quick-view__contextual-btn{display:inline-flex;align-items:center;gap:.25rem;min-width:0;max-width:100%;padding:.25rem .5625rem;border-radius:999px;border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, var(--mat-sys-outline-variant)) 85%,transparent);background:color-mix(in srgb,var(--md-sys-color-surface-container, var(--mat-sys-surface-container)) 78%,transparent);color:var(--md-sys-color-on-surface, var(--mat-sys-on-surface));font-size:.71875rem;font-weight:600;line-height:1.25;cursor:pointer;transition:background-color .14s ease,color .14s ease,border-color .14s ease}.pdx-quick-view__contextual-btn:hover{background:color-mix(in srgb,var(--md-sys-color-primary, var(--mat-sys-primary)) 12%,transparent);color:var(--md-sys-color-primary, var(--mat-sys-primary));border-color:color-mix(in srgb,var(--md-sys-color-primary, var(--mat-sys-primary)) 40%,transparent)}.pdx-quick-view__contextual-btn:focus-visible{outline:2px solid var(--md-sys-color-primary, var(--mat-sys-primary));outline-offset:2px}.pdx-quick-view__contextual-icon{flex:0 0 auto;width:.8125rem;height:.8125rem;font-size:.8125rem;line-height:1}.pdx-quick-view__contextual-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pdx-quick-view__footer{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding-top:.5rem;border-top:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, var(--mat-sys-outline-variant)) 65%,transparent)}.pdx-quick-view__copy-summary-btn{display:inline-flex;align-items:center;justify-content:center;gap:.375rem;padding:.3125rem .625rem;border-radius:.375rem;border:1px solid color-mix(in srgb,var(--md-sys-color-outline-variant, var(--mat-sys-outline-variant)) 80%,transparent);background:color-mix(in srgb,var(--md-sys-color-surface-container, var(--mat-sys-surface-container)) 70%,transparent);color:var(--md-sys-color-on-surface-variant, var(--mat-sys-on-surface-variant));font-size:.75rem;font-weight:600;cursor:pointer;transition:background-color .14s ease,color .14s ease,border-color .14s ease}.pdx-quick-view__copy-summary-btn:hover{background:color-mix(in srgb,var(--md-sys-color-primary, var(--mat-sys-primary)) 10%,transparent);color:var(--md-sys-color-primary, var(--mat-sys-primary));border-color:color-mix(in srgb,var(--md-sys-color-primary, var(--mat-sys-primary)) 40%,transparent)}.pdx-quick-view__copy-summary-btn[data-copied=true]{background:color-mix(in srgb,#16a34a 15%,transparent);color:#15803d;border-color:color-mix(in srgb,#16a34a 38%,transparent)}.pdx-quick-view__copy-summary-btn:focus-visible{outline:2px solid var(--md-sys-color-primary, var(--mat-sys-primary));outline-offset:2px}.pdx-quick-view__cta{margin-left:auto;display:inline-flex;align-items:center;justify-content:center;gap:.375rem;padding:.375rem .8125rem;border-radius:.375rem;border:none;background:var(--md-sys-color-primary, var(--mat-sys-primary));color:var(--md-sys-color-on-primary, var(--mat-sys-on-primary));font-size:.8125rem;font-weight:600;cursor:pointer;transition:filter .14s ease,box-shadow .14s ease}.pdx-quick-view__cta:hover{filter:brightness(1.06)}.pdx-quick-view__cta:focus-visible{outline:2px solid var(--md-sys-color-primary, var(--mat-sys-primary));outline-offset:2px}.pdx-quick-view--narrow .pdx-quick-view__footer{flex-wrap:wrap}.pdx-quick-view--narrow .pdx-quick-view__copy-summary-btn,.pdx-quick-view--narrow .pdx-quick-view__cta{flex:1 1 auto;padding:.5rem .875rem}\n"] }]
|
|
2710
|
+
}], propDecorators: { pointerEnter: [{
|
|
2711
|
+
type: Output
|
|
2712
|
+
}], pointerLeave: [{
|
|
2713
|
+
type: Output
|
|
2714
|
+
}], openDetail: [{
|
|
2715
|
+
type: Output
|
|
2716
|
+
}], openSurface: [{
|
|
2717
|
+
type: Output
|
|
2718
|
+
}], copyValue: [{
|
|
2719
|
+
type: Output
|
|
2720
|
+
}], dismiss: [{
|
|
2721
|
+
type: Output
|
|
2722
|
+
}], dialogSurface: [{
|
|
2723
|
+
type: ViewChild,
|
|
2724
|
+
args: ['dialogSurface']
|
|
2725
|
+
}], ctaButton: [{
|
|
2726
|
+
type: ViewChild,
|
|
2727
|
+
args: ['ctaButton']
|
|
2728
|
+
}], closeButton: [{
|
|
2729
|
+
type: ViewChild,
|
|
2730
|
+
args: ['closeButton']
|
|
2731
|
+
}] } });
|
|
2732
|
+
|
|
2733
|
+
const QUICK_VIEW_CONNECTED_POSITIONS = [
|
|
2734
|
+
{
|
|
2735
|
+
originX: 'start',
|
|
2736
|
+
originY: 'bottom',
|
|
2737
|
+
overlayX: 'start',
|
|
2738
|
+
overlayY: 'top',
|
|
2739
|
+
offsetY: 4,
|
|
2740
|
+
},
|
|
2741
|
+
{
|
|
2742
|
+
originX: 'end',
|
|
2743
|
+
originY: 'bottom',
|
|
2744
|
+
overlayX: 'end',
|
|
2745
|
+
overlayY: 'top',
|
|
2746
|
+
offsetY: 4,
|
|
2747
|
+
},
|
|
2748
|
+
{
|
|
2749
|
+
originX: 'start',
|
|
2750
|
+
originY: 'top',
|
|
2751
|
+
overlayX: 'start',
|
|
2752
|
+
overlayY: 'bottom',
|
|
2753
|
+
offsetY: -4,
|
|
2754
|
+
},
|
|
2755
|
+
{
|
|
2756
|
+
originX: 'end',
|
|
2757
|
+
originY: 'top',
|
|
2758
|
+
overlayX: 'end',
|
|
2759
|
+
overlayY: 'bottom',
|
|
2760
|
+
offsetY: -4,
|
|
2761
|
+
},
|
|
2762
|
+
{
|
|
2763
|
+
originX: 'end',
|
|
2764
|
+
originY: 'center',
|
|
2765
|
+
overlayX: 'start',
|
|
2766
|
+
overlayY: 'center',
|
|
2767
|
+
offsetX: 6,
|
|
2768
|
+
},
|
|
2769
|
+
{
|
|
2770
|
+
originX: 'start',
|
|
2771
|
+
originY: 'center',
|
|
2772
|
+
overlayX: 'end',
|
|
2773
|
+
overlayY: 'center',
|
|
2774
|
+
offsetX: -6,
|
|
2775
|
+
},
|
|
2776
|
+
];
|
|
2777
|
+
/**
|
|
2778
|
+
* Apresentador conectado não-modal para Quick View em `@praxisui/dialog`.
|
|
2779
|
+
*
|
|
2780
|
+
* Regras arquiteturais:
|
|
2781
|
+
* - Em desktop (`hover`, `focus-shortcut`, `explicit-button`), utiliza `flexibleConnectedTo`
|
|
2782
|
+
* sem `aria-modal="true"` e sem trap global de foco;
|
|
2783
|
+
* - Em `narrow-tap` (ou viewport compacta <= 640px sob ativação explícita), utiliza folha compacta
|
|
2784
|
+
* inferior com backdrop e semântica modal real;
|
|
2785
|
+
* - Reposiciona em scroll/resize enquanto a âncora permanecer válida e fecha imediatamente
|
|
2786
|
+
* quando a âncora sai do DOM ou se torna inválida;
|
|
2787
|
+
* - Restaura o foco ao gatilho original quando o usuário fecha por `Escape` ou botão Fechar
|
|
2788
|
+
* estando com o foco dentro do card.
|
|
2789
|
+
*/
|
|
2790
|
+
class QuickViewDialogPresenterService {
|
|
2791
|
+
overlay = inject(Overlay);
|
|
2792
|
+
injector = inject(Injector);
|
|
2793
|
+
layerScale = inject(PraxisLayerScaleStyleService);
|
|
2794
|
+
activeSession = null;
|
|
2795
|
+
present(options) {
|
|
2796
|
+
this.closeAll();
|
|
2797
|
+
this.layerScale.ensureInstalled();
|
|
2798
|
+
const narrowModalMode = this.shouldUseNarrowModalFallback(options);
|
|
2799
|
+
const overlayRef = this.overlay.create(this.buildOverlayConfig(options.anchor, narrowModalMode));
|
|
2800
|
+
const portal = new ComponentPortal(PraxisQuickViewOverlayComponent, null, this.injector);
|
|
2801
|
+
const compRef = overlayRef.attach(portal);
|
|
2802
|
+
compRef.instance.narrowModalMode.set(narrowModalMode);
|
|
2803
|
+
compRef.instance.bodyRenderer.set(options.bodyRenderer ?? null);
|
|
2804
|
+
compRef.instance.resolution.set(options.resolution);
|
|
2805
|
+
try {
|
|
2806
|
+
compRef.changeDetectorRef.detectChanges();
|
|
2807
|
+
}
|
|
2808
|
+
catch { }
|
|
2809
|
+
overlayRef.updatePosition();
|
|
2810
|
+
const session = new ActiveOverlaySession(overlayRef, compRef, options, narrowModalMode, (anchor) => this.resolveConnectedOrigin(anchor), () => {
|
|
2811
|
+
if (this.activeSession === session) {
|
|
2812
|
+
this.activeSession = null;
|
|
2813
|
+
}
|
|
2814
|
+
});
|
|
2815
|
+
this.activeSession = session;
|
|
2816
|
+
if (narrowModalMode ||
|
|
2817
|
+
options.trigger === 'explicit-button' ||
|
|
2818
|
+
options.trigger === 'focus-shortcut' ||
|
|
2819
|
+
options.trigger === 'narrow-tap') {
|
|
2820
|
+
queueMicrotask(() => {
|
|
2821
|
+
compRef.instance.focusInteractiveEntry();
|
|
2822
|
+
});
|
|
2823
|
+
}
|
|
2824
|
+
return session;
|
|
2825
|
+
}
|
|
2826
|
+
closeAll() {
|
|
2827
|
+
if (this.activeSession) {
|
|
2828
|
+
const current = this.activeSession;
|
|
2829
|
+
this.activeSession = null;
|
|
2830
|
+
current.close('programmatic');
|
|
2831
|
+
}
|
|
2832
|
+
}
|
|
2833
|
+
shouldUseNarrowModalFallback(options) {
|
|
2834
|
+
if (options.trigger === 'narrow-tap') {
|
|
2835
|
+
return true;
|
|
2836
|
+
}
|
|
2837
|
+
if (options.trigger === 'hover') {
|
|
2838
|
+
return false;
|
|
2839
|
+
}
|
|
2840
|
+
const width = typeof window !== 'undefined' && Number.isFinite(window.innerWidth)
|
|
2841
|
+
? window.innerWidth
|
|
2842
|
+
: 1280;
|
|
2843
|
+
return (width <= 640 &&
|
|
2844
|
+
(options.trigger === 'explicit-button' ||
|
|
2845
|
+
options.trigger === 'focus-shortcut'));
|
|
2846
|
+
}
|
|
2847
|
+
buildOverlayConfig(anchor, narrowModalMode) {
|
|
2848
|
+
if (narrowModalMode) {
|
|
2849
|
+
const positionStrategy = this.overlay
|
|
2850
|
+
.position()
|
|
2851
|
+
.global()
|
|
2852
|
+
.centerHorizontally()
|
|
2853
|
+
.bottom('12px');
|
|
2854
|
+
return new OverlayConfig({
|
|
2855
|
+
hasBackdrop: true,
|
|
2856
|
+
panelClass: ['pdx-quick-view-overlay-pane', 'pdx-quick-view-overlay-pane--narrow'],
|
|
2857
|
+
backdropClass: 'pdx-quick-view-backdrop',
|
|
2858
|
+
positionStrategy,
|
|
2859
|
+
scrollStrategy: this.overlay.scrollStrategies.block(),
|
|
2860
|
+
});
|
|
2861
|
+
}
|
|
2862
|
+
const origin = this.resolveConnectedOrigin(anchor);
|
|
2863
|
+
const positionStrategy = this.overlay
|
|
2864
|
+
.position()
|
|
2865
|
+
.flexibleConnectedTo(origin)
|
|
2866
|
+
.withPositions(QUICK_VIEW_CONNECTED_POSITIONS)
|
|
2867
|
+
.withViewportMargin(12)
|
|
2868
|
+
.withPush(true)
|
|
2869
|
+
.withFlexibleDimensions(false);
|
|
2870
|
+
return new OverlayConfig({
|
|
2871
|
+
hasBackdrop: false,
|
|
2872
|
+
panelClass: 'pdx-quick-view-overlay-pane',
|
|
2873
|
+
positionStrategy,
|
|
2874
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
2875
|
+
});
|
|
2876
|
+
}
|
|
2877
|
+
resolveConnectedOrigin(anchor) {
|
|
2878
|
+
if (anchor.kind === 'element') {
|
|
2879
|
+
return anchor.element;
|
|
2880
|
+
}
|
|
2881
|
+
const rect = anchor.getViewportRect() ?? {
|
|
2882
|
+
x: 0,
|
|
2883
|
+
y: 0,
|
|
2884
|
+
width: 0,
|
|
2885
|
+
height: 0,
|
|
2886
|
+
};
|
|
2887
|
+
return {
|
|
2888
|
+
x: rect.x,
|
|
2889
|
+
y: rect.y,
|
|
2890
|
+
width: rect.width,
|
|
2891
|
+
height: rect.height,
|
|
2892
|
+
};
|
|
2893
|
+
}
|
|
2894
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: QuickViewDialogPresenterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2895
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: QuickViewDialogPresenterService, providedIn: 'root' });
|
|
2896
|
+
}
|
|
2897
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: QuickViewDialogPresenterService, decorators: [{
|
|
2898
|
+
type: Injectable,
|
|
2899
|
+
args: [{ providedIn: 'root' }]
|
|
2900
|
+
}] });
|
|
2901
|
+
class ActiveOverlaySession {
|
|
2902
|
+
overlayRef;
|
|
2903
|
+
compRef;
|
|
2904
|
+
options;
|
|
2905
|
+
narrowModalMode;
|
|
2906
|
+
resolveOrigin;
|
|
2907
|
+
onDisposed;
|
|
2908
|
+
closedSubject = new Subject();
|
|
2909
|
+
pointerEnterSubject = new Subject();
|
|
2910
|
+
pointerLeaveSubject = new Subject();
|
|
2911
|
+
subs = [];
|
|
2912
|
+
cleanupDomListeners = [];
|
|
2913
|
+
isClosed = false;
|
|
2914
|
+
closed$ = this.closedSubject.asObservable();
|
|
2915
|
+
pointerEnteredCard$ = this.pointerEnterSubject.asObservable();
|
|
2916
|
+
pointerLeftCard$ = this.pointerLeaveSubject.asObservable();
|
|
2917
|
+
constructor(overlayRef, compRef, options, narrowModalMode, resolveOrigin, onDisposed) {
|
|
2918
|
+
this.overlayRef = overlayRef;
|
|
2919
|
+
this.compRef = compRef;
|
|
2920
|
+
this.options = options;
|
|
2921
|
+
this.narrowModalMode = narrowModalMode;
|
|
2922
|
+
this.resolveOrigin = resolveOrigin;
|
|
2923
|
+
this.onDisposed = onDisposed;
|
|
2924
|
+
const inst = compRef.instance;
|
|
2925
|
+
this.subs.push(inst.pointerEnter.subscribe(() => this.pointerEnterSubject.next()), inst.pointerLeave.subscribe(() => this.pointerLeaveSubject.next()), inst.openDetail.subscribe(() => this.options.onOpenDetail()), inst.openSurface.subscribe((surfaceId) => this.options.onOpenSurface?.(surfaceId)), inst.copyValue.subscribe(({ value, field }) => this.options.onCopyValue?.(value, field)), inst.dismiss.subscribe((reason) => this.close(reason)));
|
|
2926
|
+
if (narrowModalMode) {
|
|
2927
|
+
this.subs.push(overlayRef.backdropClick().subscribe(() => {
|
|
2928
|
+
this.close('outside-pointer');
|
|
2929
|
+
}));
|
|
2930
|
+
}
|
|
2931
|
+
this.installDomListeners();
|
|
2932
|
+
}
|
|
2933
|
+
update(resolution) {
|
|
2934
|
+
if (this.isClosed) {
|
|
2935
|
+
return;
|
|
2936
|
+
}
|
|
2937
|
+
const previousState = this.compRef.instance.resolution()?.state;
|
|
2938
|
+
const focusWasInside = this.wasFocusInsideOverlay();
|
|
2939
|
+
this.compRef.instance.resolution.set(resolution);
|
|
2940
|
+
try {
|
|
2941
|
+
this.compRef.changeDetectorRef.detectChanges();
|
|
2942
|
+
}
|
|
2943
|
+
catch { }
|
|
2944
|
+
this.updatePosition();
|
|
2945
|
+
if (previousState === 'loading' &&
|
|
2946
|
+
resolution.state === 'ready' &&
|
|
2947
|
+
(focusWasInside ||
|
|
2948
|
+
this.narrowModalMode ||
|
|
2949
|
+
this.options.trigger === 'explicit-button' ||
|
|
2950
|
+
this.options.trigger === 'focus-shortcut' ||
|
|
2951
|
+
this.options.trigger === 'narrow-tap')) {
|
|
2952
|
+
queueMicrotask(() => {
|
|
2953
|
+
if (!this.isClosed) {
|
|
2954
|
+
this.compRef.instance.focusInteractiveEntry();
|
|
2955
|
+
}
|
|
2956
|
+
});
|
|
2957
|
+
}
|
|
2958
|
+
}
|
|
2959
|
+
updatePosition() {
|
|
2960
|
+
if (this.isClosed) {
|
|
2961
|
+
return;
|
|
2962
|
+
}
|
|
2963
|
+
if (!isResourceQuickViewAnchorValid(this.options.anchor)) {
|
|
2964
|
+
this.close('anchor-invalid');
|
|
2965
|
+
return;
|
|
2966
|
+
}
|
|
2967
|
+
if (!this.narrowModalMode && this.options.anchor.kind === 'virtual-rect') {
|
|
2968
|
+
const strategy = this.overlayRef.getConfig().positionStrategy;
|
|
2969
|
+
strategy?.setOrigin?.(this.resolveOrigin(this.options.anchor));
|
|
2970
|
+
}
|
|
2971
|
+
this.overlayRef.updatePosition();
|
|
2972
|
+
}
|
|
2973
|
+
close(reason = 'programmatic') {
|
|
2974
|
+
if (this.isClosed) {
|
|
2975
|
+
return;
|
|
2976
|
+
}
|
|
2977
|
+
this.isClosed = true;
|
|
2978
|
+
const focusInside = this.wasFocusInsideOverlay();
|
|
2979
|
+
const isInteractiveTrigger = this.narrowModalMode ||
|
|
2980
|
+
this.options.trigger === 'explicit-button' ||
|
|
2981
|
+
this.options.trigger === 'focus-shortcut' ||
|
|
2982
|
+
this.options.trigger === 'narrow-tap';
|
|
2983
|
+
const shouldRestoreFocus = focusInside ||
|
|
2984
|
+
(isInteractiveTrigger &&
|
|
2985
|
+
(reason === 'escape' ||
|
|
2986
|
+
reason === 'programmatic' ||
|
|
2987
|
+
this.narrowModalMode));
|
|
2988
|
+
for (const cleanup of this.cleanupDomListeners) {
|
|
2989
|
+
cleanup();
|
|
2990
|
+
}
|
|
2991
|
+
this.cleanupDomListeners.length = 0;
|
|
2992
|
+
for (const sub of this.subs) {
|
|
2993
|
+
sub.unsubscribe();
|
|
2994
|
+
}
|
|
2995
|
+
this.subs.length = 0;
|
|
2996
|
+
try {
|
|
2997
|
+
this.overlayRef.dispose();
|
|
2998
|
+
}
|
|
2999
|
+
catch { }
|
|
3000
|
+
if (shouldRestoreFocus && reason !== 'cta') {
|
|
3001
|
+
this.restoreFocusToOrigin();
|
|
3002
|
+
}
|
|
3003
|
+
this.closedSubject.next(reason);
|
|
3004
|
+
this.closedSubject.complete();
|
|
3005
|
+
this.pointerEnterSubject.complete();
|
|
3006
|
+
this.pointerLeaveSubject.complete();
|
|
3007
|
+
this.onDisposed();
|
|
3008
|
+
this.options.onDismiss(reason);
|
|
3009
|
+
}
|
|
3010
|
+
installDomListeners() {
|
|
3011
|
+
if (typeof document !== 'undefined') {
|
|
3012
|
+
const onKeydown = (event) => {
|
|
3013
|
+
if (event.key === 'Escape') {
|
|
3014
|
+
event.preventDefault();
|
|
3015
|
+
event.stopPropagation();
|
|
3016
|
+
event.stopImmediatePropagation();
|
|
3017
|
+
this.close('escape');
|
|
3018
|
+
}
|
|
3019
|
+
};
|
|
3020
|
+
document.addEventListener('keydown', onKeydown, true);
|
|
3021
|
+
this.cleanupDomListeners.push(() => document.removeEventListener('keydown', onKeydown, true));
|
|
3022
|
+
if (!this.narrowModalMode) {
|
|
3023
|
+
const onPointerDown = (event) => {
|
|
3024
|
+
const target = event.target;
|
|
3025
|
+
if (!target) {
|
|
3026
|
+
return;
|
|
3027
|
+
}
|
|
3028
|
+
if (this.overlayRef.overlayElement?.contains(target)) {
|
|
3029
|
+
return;
|
|
3030
|
+
}
|
|
3031
|
+
const anchorEl = this.options.anchor.kind === 'element'
|
|
3032
|
+
? this.options.anchor.element
|
|
3033
|
+
: this.options.anchor.hostElement;
|
|
3034
|
+
if (anchorEl && anchorEl.contains(target)) {
|
|
3035
|
+
return;
|
|
3036
|
+
}
|
|
3037
|
+
this.close('outside-pointer');
|
|
3038
|
+
};
|
|
3039
|
+
document.addEventListener('pointerdown', onPointerDown, true);
|
|
3040
|
+
this.cleanupDomListeners.push(() => document.removeEventListener('pointerdown', onPointerDown, true));
|
|
3041
|
+
}
|
|
3042
|
+
}
|
|
3043
|
+
if (typeof window !== 'undefined') {
|
|
3044
|
+
const onViewportChange = () => {
|
|
3045
|
+
this.updatePosition();
|
|
3046
|
+
};
|
|
3047
|
+
window.addEventListener('scroll', onViewportChange, true);
|
|
3048
|
+
window.addEventListener('resize', onViewportChange, { passive: true });
|
|
3049
|
+
this.cleanupDomListeners.push(() => {
|
|
3050
|
+
window.removeEventListener('scroll', onViewportChange, true);
|
|
3051
|
+
window.removeEventListener('resize', onViewportChange);
|
|
3052
|
+
});
|
|
3053
|
+
}
|
|
3054
|
+
}
|
|
3055
|
+
wasFocusInsideOverlay() {
|
|
3056
|
+
if (typeof document === 'undefined' || !document.activeElement) {
|
|
3057
|
+
return false;
|
|
3058
|
+
}
|
|
3059
|
+
return Boolean(this.overlayRef.overlayElement?.contains(document.activeElement));
|
|
3060
|
+
}
|
|
3061
|
+
restoreFocusToOrigin() {
|
|
3062
|
+
const anchor = this.options.anchor;
|
|
3063
|
+
const candidate = anchor.focusOrigin ??
|
|
3064
|
+
(anchor.kind === 'element' ? anchor.element : anchor.hostElement);
|
|
3065
|
+
if (candidate &&
|
|
3066
|
+
candidate.isConnected !== false &&
|
|
3067
|
+
typeof candidate.focus === 'function') {
|
|
3068
|
+
try {
|
|
3069
|
+
candidate.focus({ preventScroll: true });
|
|
3070
|
+
}
|
|
3071
|
+
catch {
|
|
3072
|
+
try {
|
|
3073
|
+
candidate.focus();
|
|
3074
|
+
}
|
|
3075
|
+
catch { }
|
|
3076
|
+
}
|
|
3077
|
+
}
|
|
3078
|
+
}
|
|
3079
|
+
}
|
|
3080
|
+
function providePraxisQuickViewDialogPresenter() {
|
|
3081
|
+
return {
|
|
3082
|
+
provide: PRAXIS_QUICK_VIEW_PRESENTER,
|
|
3083
|
+
useExisting: QuickViewDialogPresenterService,
|
|
3084
|
+
};
|
|
3085
|
+
}
|
|
3086
|
+
|
|
1565
3087
|
class LongContentDialogExampleComponent {
|
|
1566
3088
|
items = Array.from({ length: 40 }, (_, idx) => `Example line ${idx + 1}`);
|
|
1567
3089
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: LongContentDialogExampleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -1731,6 +3253,26 @@ function providePraxisDialogMetadata() {
|
|
|
1731
3253
|
};
|
|
1732
3254
|
}
|
|
1733
3255
|
|
|
3256
|
+
const dialogConfigRootResolutionSpec = {
|
|
3257
|
+
strategy: 'root-path',
|
|
3258
|
+
paths: ['config', ''],
|
|
3259
|
+
allowIndex: false,
|
|
3260
|
+
};
|
|
3261
|
+
const dialogPositionResolutionSpec = {
|
|
3262
|
+
strategy: 'root-path',
|
|
3263
|
+
paths: ['config.position', 'position'],
|
|
3264
|
+
allowIndex: false,
|
|
3265
|
+
};
|
|
3266
|
+
const dialogPresetResolutionSpec = {
|
|
3267
|
+
strategy: 'root-path',
|
|
3268
|
+
paths: ['variant', 'config'],
|
|
3269
|
+
allowIndex: false,
|
|
3270
|
+
};
|
|
3271
|
+
const dialogChildHostResolutionSpec = {
|
|
3272
|
+
strategy: 'root-path',
|
|
3273
|
+
paths: ['content', 'componentId', 'inputs', 'data'],
|
|
3274
|
+
allowIndex: false,
|
|
3275
|
+
};
|
|
1734
3276
|
const sizeFieldSchema = {
|
|
1735
3277
|
type: 'object',
|
|
1736
3278
|
minProperties: 1,
|
|
@@ -1791,13 +3333,13 @@ const PRAXIS_DIALOG_AUTHORING_MANIFEST = {
|
|
|
1791
3333
|
{ name: 'inputs', type: 'Record<string, unknown>', description: 'Inputs applied to the child component after opening the dialog.' },
|
|
1792
3334
|
],
|
|
1793
3335
|
editableTargets: [
|
|
1794
|
-
{ kind: 'dialogShell', resolver: 'praxis-dialog-config-root', description: 'Top-level PraxisDialogConfig shell fields such as title, role, actions and theme.' },
|
|
1795
|
-
{ kind: 'size', resolver: 'praxis-dialog-size-fields', description: 'Width, height, min/max size fields on PraxisDialogConfig.' },
|
|
1796
|
-
{ kind: 'position', resolver: 'praxis-dialog-position-fields', description: 'Overlay position fields top, bottom, left and right.' },
|
|
1797
|
-
{ kind: 'backdrop', resolver: 'praxis-dialog-backdrop-fields', description: 'Backdrop enablement and backdrop class semantics.' },
|
|
1798
|
-
{ kind: 'closePolicy', resolver: 'praxis-dialog-close-policy-fields', description: 'disableClose, closeOnBackdropClick, closeOnNavigation, restoreFocus and autofocus behavior.' },
|
|
1799
|
-
{ kind: 'preset', resolver: 'praxis-dialog-global-preset-by-type-variant', description: 'Type and variant presets merged through PRAXIS_DIALOG_GLOBAL_PRESETS.' },
|
|
1800
|
-
{ kind: 'childHost', resolver: 'praxis-dialog-child-component-or-template-host', description: 'Component/template registry child host and input/data envelope.' },
|
|
3336
|
+
{ kind: 'dialogShell', resolver: 'praxis-dialog-config-root', resolutionSpec: dialogConfigRootResolutionSpec, description: 'Top-level PraxisDialogConfig shell fields such as title, role, actions and theme.' },
|
|
3337
|
+
{ kind: 'size', resolver: 'praxis-dialog-size-fields', resolutionSpec: dialogConfigRootResolutionSpec, description: 'Width, height, min/max size fields on PraxisDialogConfig.' },
|
|
3338
|
+
{ kind: 'position', resolver: 'praxis-dialog-position-fields', resolutionSpec: dialogPositionResolutionSpec, description: 'Overlay position fields top, bottom, left and right.' },
|
|
3339
|
+
{ kind: 'backdrop', resolver: 'praxis-dialog-backdrop-fields', resolutionSpec: dialogConfigRootResolutionSpec, description: 'Backdrop enablement and backdrop class semantics.' },
|
|
3340
|
+
{ kind: 'closePolicy', resolver: 'praxis-dialog-close-policy-fields', resolutionSpec: dialogConfigRootResolutionSpec, description: 'disableClose, closeOnBackdropClick, closeOnNavigation, restoreFocus and autofocus behavior.' },
|
|
3341
|
+
{ kind: 'preset', resolver: 'praxis-dialog-global-preset-by-type-variant', resolutionSpec: dialogPresetResolutionSpec, description: 'Type and variant presets merged through PRAXIS_DIALOG_GLOBAL_PRESETS.' },
|
|
3342
|
+
{ kind: 'childHost', resolver: 'praxis-dialog-child-component-or-template-host', resolutionSpec: dialogChildHostResolutionSpec, description: 'Component/template registry child host and input/data envelope.' },
|
|
1801
3343
|
],
|
|
1802
3344
|
operations: [
|
|
1803
3345
|
{
|
|
@@ -1805,7 +3347,7 @@ const PRAXIS_DIALOG_AUTHORING_MANIFEST = {
|
|
|
1805
3347
|
title: 'Set dialog shell fields',
|
|
1806
3348
|
scope: 'global',
|
|
1807
3349
|
targetKind: 'dialogShell',
|
|
1808
|
-
target: { kind: 'dialogShell', resolver: 'praxis-dialog-config-root', ambiguityPolicy: 'fail', required: false },
|
|
3350
|
+
target: { kind: 'dialogShell', resolver: 'praxis-dialog-config-root', resolutionSpec: dialogConfigRootResolutionSpec, ambiguityPolicy: 'fail', required: false },
|
|
1809
3351
|
inputSchema: {
|
|
1810
3352
|
type: 'object',
|
|
1811
3353
|
minProperties: 1,
|
|
@@ -1833,7 +3375,7 @@ const PRAXIS_DIALOG_AUTHORING_MANIFEST = {
|
|
|
1833
3375
|
title: 'Set dialog size',
|
|
1834
3376
|
scope: 'layout',
|
|
1835
3377
|
targetKind: 'size',
|
|
1836
|
-
target: { kind: 'size', resolver: 'praxis-dialog-size-fields', ambiguityPolicy: 'fail', required: false },
|
|
3378
|
+
target: { kind: 'size', resolver: 'praxis-dialog-size-fields', resolutionSpec: dialogConfigRootResolutionSpec, ambiguityPolicy: 'fail', required: false },
|
|
1837
3379
|
inputSchema: sizeFieldSchema,
|
|
1838
3380
|
effects: [{ kind: 'merge-object', path: 'config' }],
|
|
1839
3381
|
destructive: false,
|
|
@@ -1848,7 +3390,7 @@ const PRAXIS_DIALOG_AUTHORING_MANIFEST = {
|
|
|
1848
3390
|
title: 'Set dialog position',
|
|
1849
3391
|
scope: 'layout',
|
|
1850
3392
|
targetKind: 'position',
|
|
1851
|
-
target: { kind: 'position', resolver: 'praxis-dialog-position-fields', ambiguityPolicy: 'fail', required: false },
|
|
3393
|
+
target: { kind: 'position', resolver: 'praxis-dialog-position-fields', resolutionSpec: dialogPositionResolutionSpec, ambiguityPolicy: 'fail', required: false },
|
|
1852
3394
|
inputSchema: positionSchema,
|
|
1853
3395
|
effects: [{ kind: 'set-value', path: 'config.position' }],
|
|
1854
3396
|
destructive: false,
|
|
@@ -1863,7 +3405,7 @@ const PRAXIS_DIALOG_AUTHORING_MANIFEST = {
|
|
|
1863
3405
|
title: 'Set dialog backdrop',
|
|
1864
3406
|
scope: 'skin',
|
|
1865
3407
|
targetKind: 'backdrop',
|
|
1866
|
-
target: { kind: 'backdrop', resolver: 'praxis-dialog-backdrop-fields', ambiguityPolicy: 'fail', required: false },
|
|
3408
|
+
target: { kind: 'backdrop', resolver: 'praxis-dialog-backdrop-fields', resolutionSpec: dialogConfigRootResolutionSpec, ambiguityPolicy: 'fail', required: false },
|
|
1867
3409
|
inputSchema: {
|
|
1868
3410
|
type: 'object',
|
|
1869
3411
|
minProperties: 1,
|
|
@@ -1885,7 +3427,7 @@ const PRAXIS_DIALOG_AUTHORING_MANIFEST = {
|
|
|
1885
3427
|
title: 'Set dialog close policy',
|
|
1886
3428
|
scope: 'accessibility',
|
|
1887
3429
|
targetKind: 'closePolicy',
|
|
1888
|
-
target: { kind: 'closePolicy', resolver: 'praxis-dialog-close-policy-fields', ambiguityPolicy: 'fail', required: false },
|
|
3430
|
+
target: { kind: 'closePolicy', resolver: 'praxis-dialog-close-policy-fields', resolutionSpec: dialogConfigRootResolutionSpec, ambiguityPolicy: 'fail', required: false },
|
|
1889
3431
|
inputSchema: closePolicySchema,
|
|
1890
3432
|
effects: [{ kind: 'merge-object', path: 'config' }],
|
|
1891
3433
|
destructive: true,
|
|
@@ -1900,7 +3442,7 @@ const PRAXIS_DIALOG_AUTHORING_MANIFEST = {
|
|
|
1900
3442
|
title: 'Apply dialog preset',
|
|
1901
3443
|
scope: 'global',
|
|
1902
3444
|
targetKind: 'preset',
|
|
1903
|
-
target: { kind: 'preset', resolver: 'praxis-dialog-global-preset-by-type-variant', ambiguityPolicy: 'fail', required: false },
|
|
3445
|
+
target: { kind: 'preset', resolver: 'praxis-dialog-global-preset-by-type-variant', resolutionSpec: dialogPresetResolutionSpec, ambiguityPolicy: 'fail', required: false },
|
|
1904
3446
|
inputSchema: {
|
|
1905
3447
|
type: 'object',
|
|
1906
3448
|
required: ['dialogType'],
|
|
@@ -1930,7 +3472,7 @@ const PRAXIS_DIALOG_AUTHORING_MANIFEST = {
|
|
|
1930
3472
|
title: 'Configure dialog child host',
|
|
1931
3473
|
scope: 'templating',
|
|
1932
3474
|
targetKind: 'childHost',
|
|
1933
|
-
target: { kind: 'childHost', resolver: 'praxis-dialog-child-component-or-template-host', ambiguityPolicy: 'fail', required: false },
|
|
3475
|
+
target: { kind: 'childHost', resolver: 'praxis-dialog-child-component-or-template-host', resolutionSpec: dialogChildHostResolutionSpec, ambiguityPolicy: 'fail', required: false },
|
|
1934
3476
|
inputSchema: childHostSchema,
|
|
1935
3477
|
effects: [{ kind: 'compile-domain-patch', handler: 'dialog-child-host-configure', handlerContract: {
|
|
1936
3478
|
reads: ['ComponentMetadataRegistry', 'PRAXIS_DIALOG_CONTENT_REGISTRY', 'PRAXIS_DIALOG_TEMPLATE_REGISTRY', 'content', 'componentId', 'inputs', 'data'],
|
|
@@ -1952,7 +3494,7 @@ const PRAXIS_DIALOG_AUTHORING_MANIFEST = {
|
|
|
1952
3494
|
title: 'Delegate operation to child manifest',
|
|
1953
3495
|
scope: 'templating',
|
|
1954
3496
|
targetKind: 'childHost',
|
|
1955
|
-
target: { kind: 'childHost', resolver: 'praxis-dialog-child-component-or-template-host', ambiguityPolicy: 'fail', required: true },
|
|
3497
|
+
target: { kind: 'childHost', resolver: 'praxis-dialog-child-component-or-template-host', resolutionSpec: dialogChildHostResolutionSpec, ambiguityPolicy: 'fail', required: true },
|
|
1956
3498
|
inputSchema: {
|
|
1957
3499
|
type: 'object',
|
|
1958
3500
|
required: ['childManifestComponentId', 'operationId', 'params'],
|
|
@@ -2028,4 +3570,4 @@ const PRAXIS_DIALOG_AUTHORING_MANIFEST = {
|
|
|
2028
3570
|
* Generated bundle index. Do not edit.
|
|
2029
3571
|
*/
|
|
2030
3572
|
|
|
2031
|
-
export { LongContentDialogExampleComponent, PRAXIS_DIALOG_AUTHORING_MANIFEST, PRAXIS_DIALOG_COMPONENT_METADATA, PRAXIS_DIALOG_CONTENT_REGISTRY, PRAXIS_DIALOG_DATA, PRAXIS_DIALOG_DEFAULTS, PRAXIS_DIALOG_EXAMPLE_LONG_CONTENT, PRAXIS_DIALOG_GLOBAL_PRESETS, PRAXIS_DIALOG_I18N, PRAXIS_DIALOG_TEMPLATE_REGISTRY, PraxisDialog, PraxisDialogActionsDirective, PraxisDialogComponent, PraxisDialogContentDirective, PraxisDialogDirectives, PraxisDialogRef, PraxisDialogTitleDirective, provideDialogGlobalPresetsFromGlobalConfig, providePraxisDialogExamples, providePraxisDialogGlobalActions, providePraxisDialogMetadata, providePraxisSurfaceGlobalActions };
|
|
3573
|
+
export { LongContentDialogExampleComponent, PRAXIS_DIALOG_AUTHORING_MANIFEST, PRAXIS_DIALOG_COMPONENT_METADATA, PRAXIS_DIALOG_CONTENT_REGISTRY, PRAXIS_DIALOG_DATA, PRAXIS_DIALOG_DEFAULTS, PRAXIS_DIALOG_EXAMPLE_LONG_CONTENT, PRAXIS_DIALOG_GLOBAL_PRESETS, PRAXIS_DIALOG_I18N, PRAXIS_DIALOG_TEMPLATE_REGISTRY, PraxisDialog, PraxisDialogActionsDirective, PraxisDialogComponent, PraxisDialogContentDirective, PraxisDialogDirectives, PraxisDialogRef, PraxisDialogTitleDirective, PraxisQuickViewOverlayComponent, QuickViewDialogPresenterService, provideDialogGlobalPresetsFromGlobalConfig, providePraxisDialogExamples, providePraxisDialogGlobalActions, providePraxisDialogMetadata, providePraxisQuickViewDialogPresenter, providePraxisSurfaceGlobalActions };
|