@covalent/core 8.12.3 → 8.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dialogs/README.md +32 -24
- package/dialogs/_dialog-theme.scss +7 -1
- package/dialogs/dialog.component.d.ts +6 -1
- package/dialogs/dialogs.module.d.ts +10 -9
- package/dialogs/public_api.d.ts +1 -0
- package/dialogs/services/dialog.service.d.ts +22 -0
- package/dialogs/status-dialog/status-dialog.component.d.ts +23 -0
- package/esm2022/dialogs/dialog.component.mjs +18 -3
- package/esm2022/dialogs/dialogs.module.mjs +11 -4
- package/esm2022/dialogs/public_api.mjs +2 -1
- package/esm2022/dialogs/services/dialog.service.mjs +37 -1
- package/esm2022/dialogs/status-dialog/status-dialog.component.mjs +55 -0
- package/fesm2022/covalent-core-dialogs.mjs +110 -7
- package/fesm2022/covalent-core-dialogs.mjs.map +1 -1
- package/package.json +2 -2
- package/theming/_teradata-theme.scss +12 -0
@@ -0,0 +1,55 @@
|
|
1
|
+
import { Component } from '@angular/core';
|
2
|
+
import { MatDialogRef } from '@angular/material/dialog';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
import * as i1 from "@angular/material/dialog";
|
5
|
+
import * as i2 from "@angular/common";
|
6
|
+
import * as i3 from "@angular/material/button";
|
7
|
+
import * as i4 from "@angular/material/icon";
|
8
|
+
import * as i5 from "../dialog.component";
|
9
|
+
export class TdStatusDialogComponent {
|
10
|
+
_dialogRef;
|
11
|
+
// Label of the close button in the footer
|
12
|
+
closeButton = 'CLOSE';
|
13
|
+
// Message to be displayed in the dialog
|
14
|
+
message;
|
15
|
+
// State of the status dialog
|
16
|
+
state = 'error';
|
17
|
+
// Title of the status dialog
|
18
|
+
title;
|
19
|
+
// Additional details to be displayed after the dialog message
|
20
|
+
details;
|
21
|
+
// Toggles the additional details section
|
22
|
+
showDetails = false;
|
23
|
+
// Labels for the toggle details link
|
24
|
+
detailsLabels = {
|
25
|
+
showDetailsLabel: 'Show details',
|
26
|
+
hideDetailsLabel: 'Hide details',
|
27
|
+
};
|
28
|
+
constructor(_dialogRef) {
|
29
|
+
this._dialogRef = _dialogRef;
|
30
|
+
}
|
31
|
+
close() {
|
32
|
+
this._dialogRef.close();
|
33
|
+
}
|
34
|
+
getStatusIcon() {
|
35
|
+
switch (this.state) {
|
36
|
+
case 'positive':
|
37
|
+
return 'check';
|
38
|
+
case 'error':
|
39
|
+
case 'warning':
|
40
|
+
return this.state;
|
41
|
+
default:
|
42
|
+
return 'error';
|
43
|
+
}
|
44
|
+
}
|
45
|
+
toggleDetails() {
|
46
|
+
this.showDetails = !this.showDetails;
|
47
|
+
}
|
48
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: TdStatusDialogComponent, deps: [{ token: i1.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
|
49
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: TdStatusDialogComponent, selector: "td-status-dialog", ngImport: i0, template: "<td-dialog class=\"td-status-dialog\">\n <!-- Displays the icon and background color according to the state -->\n <div tdDialogStatus class=\"td-status-dialog-state\" [ngClass]=\"state\">\n <mat-icon>\n {{ getStatusIcon() }}\n </mat-icon>\n </div>\n <!-- Dialog title and the close icon -->\n <ng-container tdDialogTitle>\n <div class=\"td-status-dialog-title\">\n <span *ngIf=\"title\" class=\"\">{{ title }}</span>\n <button\n mat-icon-button\n class=\"td-status-dialog__icon-button\"\n (click)=\"close()\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </div>\n </ng-container>\n <!-- Dialog content with additonal information -->\n <ng-container tdDialogContent>\n <span class=\"td-dialog-message\">\n {{ message }}\n <div\n class=\"td-status-dialog__toggle-details\"\n role=\"button\"\n tabindex=\"0\"\n *ngIf=\"details\"\n (click)=\"toggleDetails()\"\n (keydown.enter)=\"toggleDetails()\"\n >\n {{\n showDetails\n ? detailsLabels?.hideDetailsLabel\n : detailsLabels?.showDetailsLabel\n }}\n <mat-icon\n [ngClass]=\"{\n 'td-status-dialog__arrow-icon': true,\n close: !showDetails,\n open: showDetails\n }\"\n >arrow_drop_down</mat-icon\n >\n </div>\n <div *ngIf=\"showDetails\">{{ details }}</div>\n </span>\n </ng-container>\n <ng-container tdDialogActions>\n <button\n mat-raised-button\n color=\"primary\"\n class=\"td-status-dialog___button\"\n (click)=\"close()\"\n >\n {{ closeButton }}\n </button>\n </ng-container>\n</td-dialog>\n", styles: ["::ng-deep .mat-mdc-dialog-container .mdc-dialog__surface{background-color:var(--cv-theme-surface-container-lowest);border-radius:12px}::ng-deep .td-status-dialog-title{align-items:flex-start;display:inline-flex;justify-content:space-between;width:100%;-webkit-font-smoothing:antialiased}::ng-deep .td-status-dialog-title :first-child{padding-right:40px}::ng-deep [mat-icon-button].td-status-dialog__icon-button{--mdc-icon-button-state-layer-size: 40px;padding:8px;position:absolute;right:8px;top:10px}::ng-deep .td-status-dialog___button{border-radius:8px}::ng-deep .mat-mdc-dialog-container .mdc-dialog__title{padding:18px 16px;line-height:var(--mdc-dialog-supporting-text-line-height)}::ng-deep .mat-mdc-dialog-container .mdc-dialog__title:before{display:none}::ng-deep .mat-mdc-icon-button .mat-mdc-button-base{padding:8px}::ng-deep .mdc-dialog .mdc-dialog__content{padding:0 16px;-webkit-font-smoothing:antialiased}::ng-deep .mdc-dialog__actions{padding:16px}.td-status-dialog{width:auto}.td-status-dialog:before{padding:14px 16px 0}.td-status-dialog .td-dialog-message{font-feature-settings:\"clig\" off,\"liga\" off;color:var(--cv-theme-on-surface-variant);line-height:var(--mdc-dialog-supporting-text-line-height)}.td-status-dialog-state{padding:14px 16px 0}.td-status-dialog-state .mat-icon{font-size:var(--mat-toolbar-title-text-line-height);height:var(--mat-toolbar-title-text-line-height);width:var(--mat-toolbar-title-text-line-height);font-variation-settings:\"FILL\" 1}.td-status-dialog-state.error{background-color:var(--cv-theme-negative-8)}.td-status-dialog-state.error .mat-icon{color:var(--cv-theme-negative)}.td-status-dialog-state.positive{background-color:var(--cv-theme-positive-8)}.td-status-dialog-state.positive .mat-icon{color:var(--cv-theme-positive)}.td-status-dialog-state.warning{background-color:var(--cv-theme-caution-8)}.td-status-dialog-state.warning .mat-icon{color:var(--cv-theme-caution)}.td-status-dialog__toggle-details{align-items:center;color:var(--cv-theme-primary);cursor:pointer;display:flex;font-size:var(--mat-expansion-container-text-size);letter-spacing:.25px;line-height:var(--mat-expansion-container-text-line-height);padding:16px 0}.td-status-dialog__arrow-icon{margin-top:2px}.td-status-dialog__arrow-icon.open{transform:rotate(0);transition:transform .25s ease-out}.td-status-dialog__arrow-icon.close{transform:rotate(180deg);transition:transform .25s ease-in}@media screen and (max-width: 480px){:host .td-status-dialog-state{padding:4px}:host .td-status-dialog-state .mat-icon{display:none}:host .td-status-dialog-state.error{background-color:var(--cv-theme-negative)}:host .td-status-dialog-state.positive{background-color:var(--cv-theme-positive)}:host .td-status-dialog-state.warning{background-color:var(--cv-theme-caution)}}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i5.TdDialogComponent, selector: "td-dialog" }, { kind: "directive", type: i5.TdDialogStatusDirective, selector: "[tdDialogStatus]" }, { kind: "directive", type: i5.TdDialogTitleDirective, selector: "[tdDialogTitle]" }, { kind: "directive", type: i5.TdDialogActionsDirective, selector: "[tdDialogActions]" }, { kind: "directive", type: i5.TdDialogContentDirective, selector: "[tdDialogContent]" }] });
|
50
|
+
}
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: TdStatusDialogComponent, decorators: [{
|
52
|
+
type: Component,
|
53
|
+
args: [{ selector: 'td-status-dialog', template: "<td-dialog class=\"td-status-dialog\">\n <!-- Displays the icon and background color according to the state -->\n <div tdDialogStatus class=\"td-status-dialog-state\" [ngClass]=\"state\">\n <mat-icon>\n {{ getStatusIcon() }}\n </mat-icon>\n </div>\n <!-- Dialog title and the close icon -->\n <ng-container tdDialogTitle>\n <div class=\"td-status-dialog-title\">\n <span *ngIf=\"title\" class=\"\">{{ title }}</span>\n <button\n mat-icon-button\n class=\"td-status-dialog__icon-button\"\n (click)=\"close()\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </div>\n </ng-container>\n <!-- Dialog content with additonal information -->\n <ng-container tdDialogContent>\n <span class=\"td-dialog-message\">\n {{ message }}\n <div\n class=\"td-status-dialog__toggle-details\"\n role=\"button\"\n tabindex=\"0\"\n *ngIf=\"details\"\n (click)=\"toggleDetails()\"\n (keydown.enter)=\"toggleDetails()\"\n >\n {{\n showDetails\n ? detailsLabels?.hideDetailsLabel\n : detailsLabels?.showDetailsLabel\n }}\n <mat-icon\n [ngClass]=\"{\n 'td-status-dialog__arrow-icon': true,\n close: !showDetails,\n open: showDetails\n }\"\n >arrow_drop_down</mat-icon\n >\n </div>\n <div *ngIf=\"showDetails\">{{ details }}</div>\n </span>\n </ng-container>\n <ng-container tdDialogActions>\n <button\n mat-raised-button\n color=\"primary\"\n class=\"td-status-dialog___button\"\n (click)=\"close()\"\n >\n {{ closeButton }}\n </button>\n </ng-container>\n</td-dialog>\n", styles: ["::ng-deep .mat-mdc-dialog-container .mdc-dialog__surface{background-color:var(--cv-theme-surface-container-lowest);border-radius:12px}::ng-deep .td-status-dialog-title{align-items:flex-start;display:inline-flex;justify-content:space-between;width:100%;-webkit-font-smoothing:antialiased}::ng-deep .td-status-dialog-title :first-child{padding-right:40px}::ng-deep [mat-icon-button].td-status-dialog__icon-button{--mdc-icon-button-state-layer-size: 40px;padding:8px;position:absolute;right:8px;top:10px}::ng-deep .td-status-dialog___button{border-radius:8px}::ng-deep .mat-mdc-dialog-container .mdc-dialog__title{padding:18px 16px;line-height:var(--mdc-dialog-supporting-text-line-height)}::ng-deep .mat-mdc-dialog-container .mdc-dialog__title:before{display:none}::ng-deep .mat-mdc-icon-button .mat-mdc-button-base{padding:8px}::ng-deep .mdc-dialog .mdc-dialog__content{padding:0 16px;-webkit-font-smoothing:antialiased}::ng-deep .mdc-dialog__actions{padding:16px}.td-status-dialog{width:auto}.td-status-dialog:before{padding:14px 16px 0}.td-status-dialog .td-dialog-message{font-feature-settings:\"clig\" off,\"liga\" off;color:var(--cv-theme-on-surface-variant);line-height:var(--mdc-dialog-supporting-text-line-height)}.td-status-dialog-state{padding:14px 16px 0}.td-status-dialog-state .mat-icon{font-size:var(--mat-toolbar-title-text-line-height);height:var(--mat-toolbar-title-text-line-height);width:var(--mat-toolbar-title-text-line-height);font-variation-settings:\"FILL\" 1}.td-status-dialog-state.error{background-color:var(--cv-theme-negative-8)}.td-status-dialog-state.error .mat-icon{color:var(--cv-theme-negative)}.td-status-dialog-state.positive{background-color:var(--cv-theme-positive-8)}.td-status-dialog-state.positive .mat-icon{color:var(--cv-theme-positive)}.td-status-dialog-state.warning{background-color:var(--cv-theme-caution-8)}.td-status-dialog-state.warning .mat-icon{color:var(--cv-theme-caution)}.td-status-dialog__toggle-details{align-items:center;color:var(--cv-theme-primary);cursor:pointer;display:flex;font-size:var(--mat-expansion-container-text-size);letter-spacing:.25px;line-height:var(--mat-expansion-container-text-line-height);padding:16px 0}.td-status-dialog__arrow-icon{margin-top:2px}.td-status-dialog__arrow-icon.open{transform:rotate(0);transition:transform .25s ease-out}.td-status-dialog__arrow-icon.close{transform:rotate(180deg);transition:transform .25s ease-in}@media screen and (max-width: 480px){:host .td-status-dialog-state{padding:4px}:host .td-status-dialog-state .mat-icon{display:none}:host .td-status-dialog-state.error{background-color:var(--cv-theme-negative)}:host .td-status-dialog-state.positive{background-color:var(--cv-theme-positive)}:host .td-status-dialog-state.warning{background-color:var(--cv-theme-caution)}}\n"] }]
|
54
|
+
}], ctorParameters: () => [{ type: i1.MatDialogRef }] });
|
55
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RhdHVzLWRpYWxvZy5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2FuZ3VsYXIvZGlhbG9ncy9zcmMvc3RhdHVzLWRpYWxvZy9zdGF0dXMtZGlhbG9nLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvYW5ndWxhci9kaWFsb2dzL3NyYy9zdGF0dXMtZGlhbG9nL3N0YXR1cy1kaWFsb2cuY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUMxQyxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sMEJBQTBCLENBQUM7Ozs7Ozs7QUFjeEQsTUFBTSxPQUFPLHVCQUF1QjtJQW1CZDtJQWxCcEIsMENBQTBDO0lBQzFDLFdBQVcsR0FBWSxPQUFPLENBQUM7SUFDL0Isd0NBQXdDO0lBQ3hDLE9BQU8sQ0FBVTtJQUNqQiw2QkFBNkI7SUFDN0IsS0FBSyxHQUEwQixPQUFPLENBQUM7SUFDdkMsNkJBQTZCO0lBQzdCLEtBQUssQ0FBVTtJQUNmLDhEQUE4RDtJQUM5RCxPQUFPLENBQVU7SUFDakIseUNBQXlDO0lBQ3pDLFdBQVcsR0FBSSxLQUFLLENBQUM7SUFDckIscUNBQXFDO0lBQ3JDLGFBQWEsR0FBaUM7UUFDNUMsZ0JBQWdCLEVBQUUsY0FB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xtYXQtaWNvblxuICAgICAgICAgIFtuZ0NsYXNzXT1cIntcbiAgICAgICAgICAgICd0ZC1zdGF0dXMtZGlhbG9nX19hcnJvdy1pY29uJzogdHJ1ZSxcbiAgICAgICAgICAgIGNsb3NlOiAhc2hvd0RldGFpbHMsXG4gICAgICAgICAgICBvcGVuOiBzaG93RGV0YWlsc1xuICAgICAgICAgIH1cIlxuICAgICAgICAgID5hcnJvd19kcm9wX2Rvd248L21hdC1pY29uXG4gICAgICAgID5cbiAgICAgIDwvZGl2PlxuICAgICAgPGRpdiAqbmdJZj1cInNob3dEZXRhaWxzXCI+e3sgZGV0YWlscyB9fTwvZGl2PlxuICAgIDwvc3Bhbj5cbiAgPC9uZy1jb250YWluZXI+XG4gIDxuZy1jb250YWluZXIgdGREaWFsb2dBY3Rpb25zPlxuICAgIDxidXR0b25cbiAgICAgIG1hdC1yYWlzZWQtYnV0dG9uXG4gICAgICBjb2xvcj1cInByaW1hcnlcIlxuICAgICAgY2xhc3M9XCJ0ZC1zdGF0dXMtZGlhbG9nX19fYnV0dG9uXCJcbiAgICAgIChjbGljayk9XCJjbG9zZSgpXCJcbiAgICA+XG4gICAgICB7eyBjbG9zZUJ1dHRvbiB9fVxuICAgIDwvYnV0dG9uPlxuICA8L25nLWNvbnRhaW5lcj5cbjwvdGQtZGlhbG9nPlxuIl19
|
@@ -13,13 +13,13 @@ import { MatButtonModule } from '@angular/material/button';
|
|
13
13
|
import { RIGHT_ARROW, LEFT_ARROW } from '@angular/cdk/keycodes';
|
14
14
|
import { Subject, fromEvent, takeUntil, merge } from 'rxjs';
|
15
15
|
import * as i5 from '@angular/material/form-field';
|
16
|
+
import * as i4$1 from '@angular/material/icon';
|
17
|
+
import { MatIconModule } from '@angular/material/icon';
|
16
18
|
import * as i2$2 from '@angular/cdk/drag-drop';
|
17
19
|
import * as i2$3 from '@angular/material/toolbar';
|
18
20
|
import { MatToolbarModule } from '@angular/material/toolbar';
|
19
21
|
import * as i3$1 from '@angular/material/tooltip';
|
20
22
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
21
|
-
import * as i4$1 from '@angular/material/icon';
|
22
|
-
import { MatIconModule } from '@angular/material/icon';
|
23
23
|
|
24
24
|
class TdDialogTitleDirective {
|
25
25
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: TdDialogTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
@@ -45,10 +45,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
45
45
|
type: Directive,
|
46
46
|
args: [{ selector: '[tdDialogActions]' }]
|
47
47
|
}] });
|
48
|
+
class TdDialogStatusDirective {
|
49
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: TdDialogStatusDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
50
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.2", type: TdDialogStatusDirective, selector: "[tdDialogStatus]", ngImport: i0 });
|
51
|
+
}
|
52
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: TdDialogStatusDirective, decorators: [{
|
53
|
+
type: Directive,
|
54
|
+
args: [{ selector: '[tdDialogStatus]' }]
|
55
|
+
}] });
|
48
56
|
class TdDialogComponent {
|
49
57
|
dialogTitle;
|
50
58
|
dialogContent;
|
51
59
|
dialogActions;
|
60
|
+
dialogStatus;
|
52
61
|
ngAfterContentInit() {
|
53
62
|
if (this.dialogTitle.length > 1) {
|
54
63
|
throw new Error('Duplicate td-dialog-title component at in td-dialog.');
|
@@ -59,13 +68,16 @@ class TdDialogComponent {
|
|
59
68
|
if (this.dialogActions.length > 1) {
|
60
69
|
throw new Error('Duplicate td-dialog-actions component at in td-dialog.');
|
61
70
|
}
|
71
|
+
if (this.dialogStatus.length > 1) {
|
72
|
+
throw new Error('Duplicate td-dialog-status component at in td-dialog.');
|
73
|
+
}
|
62
74
|
}
|
63
75
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: TdDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
64
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: TdDialogComponent, selector: "td-dialog", queries: [{ propertyName: "dialogTitle", predicate: TdDialogTitleDirective, descendants: true }, { propertyName: "dialogContent", predicate: TdDialogContentDirective, descendants: true }, { propertyName: "dialogActions", predicate: TdDialogActionsDirective, descendants: true }], ngImport: i0, template: "<div mat-dialog-title *ngIf=\"dialogTitle.length > 0\">\n
|
76
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: TdDialogComponent, selector: "td-dialog", queries: [{ propertyName: "dialogTitle", predicate: TdDialogTitleDirective, descendants: true }, { propertyName: "dialogContent", predicate: TdDialogContentDirective, descendants: true }, { propertyName: "dialogActions", predicate: TdDialogActionsDirective, descendants: true }, { propertyName: "dialogStatus", predicate: TdDialogStatusDirective, descendants: true }], ngImport: i0, template: "<div class=\"td-dialog-wrapper\">\n <ng-content\n *ngIf=\"dialogStatus.length > 0\"\n select=\"[tdDialogStatus]\"\n ></ng-content>\n <section class=\"td-dialog\">\n <div mat-dialog-title *ngIf=\"dialogTitle.length > 0\">\n <ng-content select=\"[tdDialogTitle]\"></ng-content>\n </div>\n <mat-dialog-content\n class=\"td-dialog-content\"\n *ngIf=\"dialogContent.length > 0\"\n >\n <ng-content select=\"[tdDialogContent]\"></ng-content>\n </mat-dialog-content>\n <mat-dialog-actions\n class=\"td-dialog-actions\"\n *ngIf=\"dialogActions.length > 0\"\n >\n <span class=\"td-dialog-spacer\"></span>\n <ng-content select=\"[tdDialogActions]\"></ng-content>\n </mat-dialog-actions>\n </section>\n</div>\n", styles: [".td-dialog{width:100%}.td-dialog-wrapper{display:flex}.td-dialog-actions{flex-direction:row;box-sizing:border-box;display:flex}.td-dialog-actions .td-dialog-spacer{flex:1}.td-dialog-actions ::ng-deep button{text-transform:uppercase;margin-left:8px;padding-left:8px;padding-right:8px;min-width:64px}[dir=rtl] .td-dialog-actions ::ng-deep button{margin-right:8px;margin-left:inherit}.td-dialog-actions ::ng-deep .td-status-dialog___button{padding:9px 16px}@media screen and (max-width: 480px){.td-dialog-wrapper{flex-direction:column}}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }] });
|
65
77
|
}
|
66
78
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: TdDialogComponent, decorators: [{
|
67
79
|
type: Component,
|
68
|
-
args: [{ selector: 'td-dialog', template: "<div mat-dialog-title *ngIf=\"dialogTitle.length > 0\">\n
|
80
|
+
args: [{ selector: 'td-dialog', template: "<div class=\"td-dialog-wrapper\">\n <ng-content\n *ngIf=\"dialogStatus.length > 0\"\n select=\"[tdDialogStatus]\"\n ></ng-content>\n <section class=\"td-dialog\">\n <div mat-dialog-title *ngIf=\"dialogTitle.length > 0\">\n <ng-content select=\"[tdDialogTitle]\"></ng-content>\n </div>\n <mat-dialog-content\n class=\"td-dialog-content\"\n *ngIf=\"dialogContent.length > 0\"\n >\n <ng-content select=\"[tdDialogContent]\"></ng-content>\n </mat-dialog-content>\n <mat-dialog-actions\n class=\"td-dialog-actions\"\n *ngIf=\"dialogActions.length > 0\"\n >\n <span class=\"td-dialog-spacer\"></span>\n <ng-content select=\"[tdDialogActions]\"></ng-content>\n </mat-dialog-actions>\n </section>\n</div>\n", styles: [".td-dialog{width:100%}.td-dialog-wrapper{display:flex}.td-dialog-actions{flex-direction:row;box-sizing:border-box;display:flex}.td-dialog-actions .td-dialog-spacer{flex:1}.td-dialog-actions ::ng-deep button{text-transform:uppercase;margin-left:8px;padding-left:8px;padding-right:8px;min-width:64px}[dir=rtl] .td-dialog-actions ::ng-deep button{margin-right:8px;margin-left:inherit}.td-dialog-actions ::ng-deep .td-status-dialog___button{padding:9px 16px}@media screen and (max-width: 480px){.td-dialog-wrapper{flex-direction:column}}\n"] }]
|
69
81
|
}], propDecorators: { dialogTitle: [{
|
70
82
|
type: ContentChildren,
|
71
83
|
args: [TdDialogTitleDirective, { descendants: true }]
|
@@ -75,6 +87,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
75
87
|
}], dialogActions: [{
|
76
88
|
type: ContentChildren,
|
77
89
|
args: [TdDialogActionsDirective, { descendants: true }]
|
90
|
+
}], dialogStatus: [{
|
91
|
+
type: ContentChildren,
|
92
|
+
args: [TdDialogStatusDirective, { descendants: true }]
|
78
93
|
}] } });
|
79
94
|
|
80
95
|
class TdAlertDialogComponent {
|
@@ -192,6 +207,53 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImpor
|
|
192
207
|
args: ['acceptBtn', { static: true, read: ElementRef }]
|
193
208
|
}] } });
|
194
209
|
|
210
|
+
class TdStatusDialogComponent {
|
211
|
+
_dialogRef;
|
212
|
+
// Label of the close button in the footer
|
213
|
+
closeButton = 'CLOSE';
|
214
|
+
// Message to be displayed in the dialog
|
215
|
+
message;
|
216
|
+
// State of the status dialog
|
217
|
+
state = 'error';
|
218
|
+
// Title of the status dialog
|
219
|
+
title;
|
220
|
+
// Additional details to be displayed after the dialog message
|
221
|
+
details;
|
222
|
+
// Toggles the additional details section
|
223
|
+
showDetails = false;
|
224
|
+
// Labels for the toggle details link
|
225
|
+
detailsLabels = {
|
226
|
+
showDetailsLabel: 'Show details',
|
227
|
+
hideDetailsLabel: 'Hide details',
|
228
|
+
};
|
229
|
+
constructor(_dialogRef) {
|
230
|
+
this._dialogRef = _dialogRef;
|
231
|
+
}
|
232
|
+
close() {
|
233
|
+
this._dialogRef.close();
|
234
|
+
}
|
235
|
+
getStatusIcon() {
|
236
|
+
switch (this.state) {
|
237
|
+
case 'positive':
|
238
|
+
return 'check';
|
239
|
+
case 'error':
|
240
|
+
case 'warning':
|
241
|
+
return this.state;
|
242
|
+
default:
|
243
|
+
return 'error';
|
244
|
+
}
|
245
|
+
}
|
246
|
+
toggleDetails() {
|
247
|
+
this.showDetails = !this.showDetails;
|
248
|
+
}
|
249
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: TdStatusDialogComponent, deps: [{ token: i1.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
|
250
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: TdStatusDialogComponent, selector: "td-status-dialog", ngImport: i0, template: "<td-dialog class=\"td-status-dialog\">\n <!-- Displays the icon and background color according to the state -->\n <div tdDialogStatus class=\"td-status-dialog-state\" [ngClass]=\"state\">\n <mat-icon>\n {{ getStatusIcon() }}\n </mat-icon>\n </div>\n <!-- Dialog title and the close icon -->\n <ng-container tdDialogTitle>\n <div class=\"td-status-dialog-title\">\n <span *ngIf=\"title\" class=\"\">{{ title }}</span>\n <button\n mat-icon-button\n class=\"td-status-dialog__icon-button\"\n (click)=\"close()\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </div>\n </ng-container>\n <!-- Dialog content with additonal information -->\n <ng-container tdDialogContent>\n <span class=\"td-dialog-message\">\n {{ message }}\n <div\n class=\"td-status-dialog__toggle-details\"\n role=\"button\"\n tabindex=\"0\"\n *ngIf=\"details\"\n (click)=\"toggleDetails()\"\n (keydown.enter)=\"toggleDetails()\"\n >\n {{\n showDetails\n ? detailsLabels?.hideDetailsLabel\n : detailsLabels?.showDetailsLabel\n }}\n <mat-icon\n [ngClass]=\"{\n 'td-status-dialog__arrow-icon': true,\n close: !showDetails,\n open: showDetails\n }\"\n >arrow_drop_down</mat-icon\n >\n </div>\n <div *ngIf=\"showDetails\">{{ details }}</div>\n </span>\n </ng-container>\n <ng-container tdDialogActions>\n <button\n mat-raised-button\n color=\"primary\"\n class=\"td-status-dialog___button\"\n (click)=\"close()\"\n >\n {{ closeButton }}\n </button>\n </ng-container>\n</td-dialog>\n", styles: ["::ng-deep .mat-mdc-dialog-container .mdc-dialog__surface{background-color:var(--cv-theme-surface-container-lowest);border-radius:12px}::ng-deep .td-status-dialog-title{align-items:flex-start;display:inline-flex;justify-content:space-between;width:100%;-webkit-font-smoothing:antialiased}::ng-deep .td-status-dialog-title :first-child{padding-right:40px}::ng-deep [mat-icon-button].td-status-dialog__icon-button{--mdc-icon-button-state-layer-size: 40px;padding:8px;position:absolute;right:8px;top:10px}::ng-deep .td-status-dialog___button{border-radius:8px}::ng-deep .mat-mdc-dialog-container .mdc-dialog__title{padding:18px 16px;line-height:var(--mdc-dialog-supporting-text-line-height)}::ng-deep .mat-mdc-dialog-container .mdc-dialog__title:before{display:none}::ng-deep .mat-mdc-icon-button .mat-mdc-button-base{padding:8px}::ng-deep .mdc-dialog .mdc-dialog__content{padding:0 16px;-webkit-font-smoothing:antialiased}::ng-deep .mdc-dialog__actions{padding:16px}.td-status-dialog{width:auto}.td-status-dialog:before{padding:14px 16px 0}.td-status-dialog .td-dialog-message{font-feature-settings:\"clig\" off,\"liga\" off;color:var(--cv-theme-on-surface-variant);line-height:var(--mdc-dialog-supporting-text-line-height)}.td-status-dialog-state{padding:14px 16px 0}.td-status-dialog-state .mat-icon{font-size:var(--mat-toolbar-title-text-line-height);height:var(--mat-toolbar-title-text-line-height);width:var(--mat-toolbar-title-text-line-height);font-variation-settings:\"FILL\" 1}.td-status-dialog-state.error{background-color:var(--cv-theme-negative-8)}.td-status-dialog-state.error .mat-icon{color:var(--cv-theme-negative)}.td-status-dialog-state.positive{background-color:var(--cv-theme-positive-8)}.td-status-dialog-state.positive .mat-icon{color:var(--cv-theme-positive)}.td-status-dialog-state.warning{background-color:var(--cv-theme-caution-8)}.td-status-dialog-state.warning .mat-icon{color:var(--cv-theme-caution)}.td-status-dialog__toggle-details{align-items:center;color:var(--cv-theme-primary);cursor:pointer;display:flex;font-size:var(--mat-expansion-container-text-size);letter-spacing:.25px;line-height:var(--mat-expansion-container-text-line-height);padding:16px 0}.td-status-dialog__arrow-icon{margin-top:2px}.td-status-dialog__arrow-icon.open{transform:rotate(0);transition:transform .25s ease-out}.td-status-dialog__arrow-icon.close{transform:rotate(180deg);transition:transform .25s ease-in}@media screen and (max-width: 480px){:host .td-status-dialog-state{padding:4px}:host .td-status-dialog-state .mat-icon{display:none}:host .td-status-dialog-state.error{background-color:var(--cv-theme-negative)}:host .td-status-dialog-state.positive{background-color:var(--cv-theme-positive)}:host .td-status-dialog-state.warning{background-color:var(--cv-theme-caution)}}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i4$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: TdDialogComponent, selector: "td-dialog" }, { kind: "directive", type: TdDialogStatusDirective, selector: "[tdDialogStatus]" }, { kind: "directive", type: TdDialogTitleDirective, selector: "[tdDialogTitle]" }, { kind: "directive", type: TdDialogActionsDirective, selector: "[tdDialogActions]" }, { kind: "directive", type: TdDialogContentDirective, selector: "[tdDialogContent]" }] });
|
251
|
+
}
|
252
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: TdStatusDialogComponent, decorators: [{
|
253
|
+
type: Component,
|
254
|
+
args: [{ selector: 'td-status-dialog', template: "<td-dialog class=\"td-status-dialog\">\n <!-- Displays the icon and background color according to the state -->\n <div tdDialogStatus class=\"td-status-dialog-state\" [ngClass]=\"state\">\n <mat-icon>\n {{ getStatusIcon() }}\n </mat-icon>\n </div>\n <!-- Dialog title and the close icon -->\n <ng-container tdDialogTitle>\n <div class=\"td-status-dialog-title\">\n <span *ngIf=\"title\" class=\"\">{{ title }}</span>\n <button\n mat-icon-button\n class=\"td-status-dialog__icon-button\"\n (click)=\"close()\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </div>\n </ng-container>\n <!-- Dialog content with additonal information -->\n <ng-container tdDialogContent>\n <span class=\"td-dialog-message\">\n {{ message }}\n <div\n class=\"td-status-dialog__toggle-details\"\n role=\"button\"\n tabindex=\"0\"\n *ngIf=\"details\"\n (click)=\"toggleDetails()\"\n (keydown.enter)=\"toggleDetails()\"\n >\n {{\n showDetails\n ? detailsLabels?.hideDetailsLabel\n : detailsLabels?.showDetailsLabel\n }}\n <mat-icon\n [ngClass]=\"{\n 'td-status-dialog__arrow-icon': true,\n close: !showDetails,\n open: showDetails\n }\"\n >arrow_drop_down</mat-icon\n >\n </div>\n <div *ngIf=\"showDetails\">{{ details }}</div>\n </span>\n </ng-container>\n <ng-container tdDialogActions>\n <button\n mat-raised-button\n color=\"primary\"\n class=\"td-status-dialog___button\"\n (click)=\"close()\"\n >\n {{ closeButton }}\n </button>\n </ng-container>\n</td-dialog>\n", styles: ["::ng-deep .mat-mdc-dialog-container .mdc-dialog__surface{background-color:var(--cv-theme-surface-container-lowest);border-radius:12px}::ng-deep .td-status-dialog-title{align-items:flex-start;display:inline-flex;justify-content:space-between;width:100%;-webkit-font-smoothing:antialiased}::ng-deep .td-status-dialog-title :first-child{padding-right:40px}::ng-deep [mat-icon-button].td-status-dialog__icon-button{--mdc-icon-button-state-layer-size: 40px;padding:8px;position:absolute;right:8px;top:10px}::ng-deep .td-status-dialog___button{border-radius:8px}::ng-deep .mat-mdc-dialog-container .mdc-dialog__title{padding:18px 16px;line-height:var(--mdc-dialog-supporting-text-line-height)}::ng-deep .mat-mdc-dialog-container .mdc-dialog__title:before{display:none}::ng-deep .mat-mdc-icon-button .mat-mdc-button-base{padding:8px}::ng-deep .mdc-dialog .mdc-dialog__content{padding:0 16px;-webkit-font-smoothing:antialiased}::ng-deep .mdc-dialog__actions{padding:16px}.td-status-dialog{width:auto}.td-status-dialog:before{padding:14px 16px 0}.td-status-dialog .td-dialog-message{font-feature-settings:\"clig\" off,\"liga\" off;color:var(--cv-theme-on-surface-variant);line-height:var(--mdc-dialog-supporting-text-line-height)}.td-status-dialog-state{padding:14px 16px 0}.td-status-dialog-state .mat-icon{font-size:var(--mat-toolbar-title-text-line-height);height:var(--mat-toolbar-title-text-line-height);width:var(--mat-toolbar-title-text-line-height);font-variation-settings:\"FILL\" 1}.td-status-dialog-state.error{background-color:var(--cv-theme-negative-8)}.td-status-dialog-state.error .mat-icon{color:var(--cv-theme-negative)}.td-status-dialog-state.positive{background-color:var(--cv-theme-positive-8)}.td-status-dialog-state.positive .mat-icon{color:var(--cv-theme-positive)}.td-status-dialog-state.warning{background-color:var(--cv-theme-caution-8)}.td-status-dialog-state.warning .mat-icon{color:var(--cv-theme-caution)}.td-status-dialog__toggle-details{align-items:center;color:var(--cv-theme-primary);cursor:pointer;display:flex;font-size:var(--mat-expansion-container-text-size);letter-spacing:.25px;line-height:var(--mat-expansion-container-text-line-height);padding:16px 0}.td-status-dialog__arrow-icon{margin-top:2px}.td-status-dialog__arrow-icon.open{transform:rotate(0);transition:transform .25s ease-out}.td-status-dialog__arrow-icon.close{transform:rotate(180deg);transition:transform .25s ease-in}@media screen and (max-width: 480px){:host .td-status-dialog-state{padding:4px}:host .td-status-dialog-state .mat-icon{display:none}:host .td-status-dialog-state.error{background-color:var(--cv-theme-negative)}:host .td-status-dialog-state.positive{background-color:var(--cv-theme-positive)}:host .td-status-dialog-state.warning{background-color:var(--cv-theme-caution)}}\n"] }]
|
255
|
+
}], ctorParameters: () => [{ type: i1.MatDialogRef }] });
|
256
|
+
|
195
257
|
class TdDialogService {
|
196
258
|
_document;
|
197
259
|
_dialogService;
|
@@ -350,6 +412,41 @@ class TdDialogService {
|
|
350
412
|
Object.assign(dialogConfig, config);
|
351
413
|
return dialogConfig;
|
352
414
|
}
|
415
|
+
/**
|
416
|
+
* params:
|
417
|
+
* - config: IStatusConfig {
|
418
|
+
* closeButton?: string;
|
419
|
+
* details?: string;
|
420
|
+
* detailsLabels?: TdStatusDialogDetailsLabels;
|
421
|
+
* message: string;
|
422
|
+
* state?: 'error' | 'positive' | 'warning'
|
423
|
+
* title?: string;
|
424
|
+
* viewContainerRef?: ViewContainerRef;
|
425
|
+
* }
|
426
|
+
*
|
427
|
+
* Opens a status dialog with the provided config.
|
428
|
+
* Returns an MatDialogRef<TdStatusDialogComponent> object.
|
429
|
+
*/
|
430
|
+
openStatus(config) {
|
431
|
+
config.panelClass = 'td-status-dialog';
|
432
|
+
config.autoFocus = false;
|
433
|
+
config.width = '575px';
|
434
|
+
config.maxWidth = '96vw';
|
435
|
+
const dialogConfig = this._createConfig(config);
|
436
|
+
const dialogRef = this._dialogService.open(TdStatusDialogComponent, dialogConfig);
|
437
|
+
const statusDialogComponent = dialogRef.componentInstance;
|
438
|
+
statusDialogComponent.title = config.title;
|
439
|
+
statusDialogComponent.message = config.message;
|
440
|
+
statusDialogComponent.state = config.state;
|
441
|
+
statusDialogComponent.details = config.details;
|
442
|
+
if (config.detailsLabels) {
|
443
|
+
statusDialogComponent.detailsLabels = config.detailsLabels;
|
444
|
+
}
|
445
|
+
if (config.closeButton) {
|
446
|
+
statusDialogComponent.closeButton = config.closeButton;
|
447
|
+
}
|
448
|
+
return dialogRef;
|
449
|
+
}
|
353
450
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: TdDialogService, deps: [{ token: DOCUMENT }, { token: i1.MatDialog }, { token: i2$2.DragDrop }, { token: i0.RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable });
|
354
451
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: TdDialogService });
|
355
452
|
}
|
@@ -399,6 +496,7 @@ const TD_DIALOGS = [
|
|
399
496
|
TdConfirmDialogComponent,
|
400
497
|
TdPromptDialogComponent,
|
401
498
|
TdDialogComponent,
|
499
|
+
TdDialogStatusDirective,
|
402
500
|
TdDialogTitleDirective,
|
403
501
|
TdDialogActionsDirective,
|
404
502
|
TdDialogContentDirective,
|
@@ -406,6 +504,7 @@ const TD_DIALOGS = [
|
|
406
504
|
TdAlertDialogComponent,
|
407
505
|
TdConfirmDialogComponent,
|
408
506
|
TdPromptDialogComponent,
|
507
|
+
TdStatusDialogComponent,
|
409
508
|
];
|
410
509
|
class CovalentDialogsModule {
|
411
510
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: CovalentDialogsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
@@ -413,13 +512,15 @@ class CovalentDialogsModule {
|
|
413
512
|
TdConfirmDialogComponent,
|
414
513
|
TdPromptDialogComponent,
|
415
514
|
TdDialogComponent,
|
515
|
+
TdDialogStatusDirective,
|
416
516
|
TdDialogTitleDirective,
|
417
517
|
TdDialogActionsDirective,
|
418
518
|
TdDialogContentDirective,
|
419
519
|
TdWindowDialogComponent,
|
420
520
|
TdAlertDialogComponent,
|
421
521
|
TdConfirmDialogComponent,
|
422
|
-
TdPromptDialogComponent
|
522
|
+
TdPromptDialogComponent,
|
523
|
+
TdStatusDialogComponent], imports: [FormsModule,
|
423
524
|
CommonModule,
|
424
525
|
MatDialogModule,
|
425
526
|
MatInputModule,
|
@@ -430,13 +531,15 @@ class CovalentDialogsModule {
|
|
430
531
|
TdConfirmDialogComponent,
|
431
532
|
TdPromptDialogComponent,
|
432
533
|
TdDialogComponent,
|
534
|
+
TdDialogStatusDirective,
|
433
535
|
TdDialogTitleDirective,
|
434
536
|
TdDialogActionsDirective,
|
435
537
|
TdDialogContentDirective,
|
436
538
|
TdWindowDialogComponent,
|
437
539
|
TdAlertDialogComponent,
|
438
540
|
TdConfirmDialogComponent,
|
439
|
-
TdPromptDialogComponent
|
541
|
+
TdPromptDialogComponent,
|
542
|
+
TdStatusDialogComponent] });
|
440
543
|
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: CovalentDialogsModule, providers: [TdDialogService], imports: [FormsModule,
|
441
544
|
CommonModule,
|
442
545
|
MatDialogModule,
|
@@ -690,5 +793,5 @@ class ResizableDraggableDialog {
|
|
690
793
|
* Generated bundle index. Do not edit.
|
691
794
|
*/
|
692
795
|
|
693
|
-
export { CovalentDialogsModule, ResizableDraggableDialog, TdAlertDialogComponent, TdConfirmDialogComponent, TdDialogActionsDirective, TdDialogComponent, TdDialogContentDirective, TdDialogService, TdDialogTitleDirective, TdPromptDialogComponent, TdWindowDialogComponent };
|
796
|
+
export { CovalentDialogsModule, ResizableDraggableDialog, TdAlertDialogComponent, TdConfirmDialogComponent, TdDialogActionsDirective, TdDialogComponent, TdDialogContentDirective, TdDialogService, TdDialogStatusDirective, TdDialogTitleDirective, TdPromptDialogComponent, TdStatusDialogComponent, TdWindowDialogComponent };
|
694
797
|
//# sourceMappingURL=covalent-core-dialogs.mjs.map
|