@huntsman-cancer-institute/dialog 12.11.9-SNAPSHOT
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/CHANGELOG.md +4 -0
- package/README.md +24 -0
- package/alert/alert-dialog.component.d.ts +31 -0
- package/bundles/huntsman-cancer-institute-dialog.umd.js +1049 -0
- package/bundles/huntsman-cancer-institute-dialog.umd.js.map +1 -0
- package/bundles/huntsman-cancer-institute-dialog.umd.min.js +2 -0
- package/bundles/huntsman-cancer-institute-dialog.umd.min.js.map +1 -0
- package/confirm/confirm-dialog.component.d.ts +18 -0
- package/custom/custom-dialog.component.d.ts +35 -0
- package/dialog.module.d.ts +27 -0
- package/esm2015/alert/alert-dialog.component.js +243 -0
- package/esm2015/confirm/confirm-dialog.component.js +130 -0
- package/esm2015/custom/custom-dialog.component.js +231 -0
- package/esm2015/dialog.module.js +157 -0
- package/esm2015/generic/generic-container-dialog.component.js +158 -0
- package/esm2015/huntsman-cancer-institute-dialog.js +5 -0
- package/esm2015/index.js +13 -0
- package/esm2015/model/base-generic-container-dialog.js +26 -0
- package/esm2015/model/confirm-type.model.js +12 -0
- package/esm2015/model/dialog-type.model.js +12 -0
- package/esm2015/model/generic-dialog-action.model.js +6 -0
- package/esm2015/save-footer/save-footer.component.js +135 -0
- package/esm2015/service/dialog.service.js +272 -0
- package/esm2015/spinner/spinner-dialog.component.js +69 -0
- package/esm5/alert/alert-dialog.component.js +105 -0
- package/esm5/confirm/confirm-dialog.component.js +101 -0
- package/esm5/custom/custom-dialog.component.js +118 -0
- package/esm5/dialog.module.js +161 -0
- package/esm5/generic/generic-container-dialog.component.js +128 -0
- package/esm5/huntsman-cancer-institute-dialog.js +5 -0
- package/esm5/index.js +13 -0
- package/esm5/model/base-generic-container-dialog.js +28 -0
- package/esm5/model/confirm-type.model.js +12 -0
- package/esm5/model/dialog-type.model.js +12 -0
- package/esm5/model/generic-dialog-action.model.js +6 -0
- package/esm5/save-footer/save-footer.component.js +86 -0
- package/esm5/service/dialog.service.js +307 -0
- package/esm5/spinner/spinner-dialog.component.js +47 -0
- package/fesm2015/huntsman-cancer-institute-dialog.js +1396 -0
- package/fesm2015/huntsman-cancer-institute-dialog.js.map +1 -0
- package/fesm5/huntsman-cancer-institute-dialog.js +1047 -0
- package/fesm5/huntsman-cancer-institute-dialog.js.map +1 -0
- package/generic/generic-container-dialog.component.d.ts +38 -0
- package/huntsman-cancer-institute-dialog.d.ts +5 -0
- package/index.d.ts +14 -0
- package/model/base-generic-container-dialog.d.ts +13 -0
- package/model/confirm-type.model.d.ts +10 -0
- package/model/dialog-type.model.d.ts +10 -0
- package/model/generic-dialog-action.model.d.ts +18 -0
- package/package.json +34 -0
- package/save-footer/save-footer.component.d.ts +24 -0
- package/service/dialog.service.d.ts +45 -0
- package/spinner/spinner-dialog.component.d.ts +12 -0
|
@@ -0,0 +1,1047 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { ɵɵngDeclareFactory, ChangeDetectorRef, ɵɵFactoryTarget, ɵɵngDeclareComponent, ɵɵngDeclareClassMetadata, Component, Inject, ViewChild, HostListener, Input, ViewContainerRef, HostBinding, ɵɵngDeclareInjectable, Injectable, EventEmitter, Output, ɵɵngDeclareNgModule, ɵɵngDeclareInjector, NgModule } from '@angular/core';
|
|
3
|
+
import { NgIf, NgForOf, NgClass, CommonModule } from '@angular/common';
|
|
4
|
+
import { FormsModule } from '@angular/forms';
|
|
5
|
+
import { MatDialogRef, MAT_DIALOG_DATA, MatDialogTitle, MatDialogContent, MatDialogActions, MatDialog, MatDialogConfig, MatDialogModule } from '@angular/material/dialog';
|
|
6
|
+
import { MatSpinner, MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
7
|
+
import { Router } from '@angular/router';
|
|
8
|
+
import { DynamicComponent, DynamicIoDirective, DynamicModule } from 'ng-dynamic-component';
|
|
9
|
+
import { MatExpansionPanel, MatExpansionPanelHeader, MatExpansionPanelTitle, MatExpansionModule } from '@angular/material/expansion';
|
|
10
|
+
import { MatButton, MatButtonModule } from '@angular/material/button';
|
|
11
|
+
|
|
12
|
+
var DialogType;
|
|
13
|
+
(function (DialogType) {
|
|
14
|
+
DialogType["ERROR"] = "Error";
|
|
15
|
+
DialogType["WARNING"] = "Warning";
|
|
16
|
+
DialogType["ALERT"] = "Alert";
|
|
17
|
+
DialogType["SUCCESS"] = "Succeed";
|
|
18
|
+
DialogType["FAILED"] = "Failed";
|
|
19
|
+
DialogType["CONFIRM"] = "Confirm";
|
|
20
|
+
DialogType["INFO"] = "Info";
|
|
21
|
+
DialogType["VALIDATION"] = "Validation Error";
|
|
22
|
+
})(DialogType || (DialogType = {}));
|
|
23
|
+
|
|
24
|
+
var ActionType;
|
|
25
|
+
(function (ActionType) {
|
|
26
|
+
ActionType["PRIMARY"] = "primary";
|
|
27
|
+
ActionType["SECONDARY"] = "accent";
|
|
28
|
+
})(ActionType || (ActionType = {}));
|
|
29
|
+
|
|
30
|
+
var AlertDialogComponent = /** @class */ (function () {
|
|
31
|
+
function AlertDialogComponent(dialogRef, data, changeDetector) {
|
|
32
|
+
this.dialogRef = dialogRef;
|
|
33
|
+
this.data = data;
|
|
34
|
+
this.changeDetector = changeDetector;
|
|
35
|
+
this.type = DialogType;
|
|
36
|
+
this.message = null;
|
|
37
|
+
this.title = '';
|
|
38
|
+
this.icon = '';
|
|
39
|
+
this.dialogType = '';
|
|
40
|
+
this.defaultTitle = '';
|
|
41
|
+
this.actionType = ActionType.SECONDARY;
|
|
42
|
+
this.originalXClick = 0;
|
|
43
|
+
this.originalYClick = 0;
|
|
44
|
+
this.positionX = 0;
|
|
45
|
+
this.positionY = 0;
|
|
46
|
+
this.movingDialog = false;
|
|
47
|
+
if (data) {
|
|
48
|
+
this.message = Array.isArray(data.message) ? data.message : [data.message];
|
|
49
|
+
this.title = data.title;
|
|
50
|
+
this.icon = data.icon;
|
|
51
|
+
this.dialogType = data.dialogType;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
AlertDialogComponent.prototype.ngOnInit = function () {
|
|
55
|
+
if (this.dialogType) {
|
|
56
|
+
this.defaultTitle = this.dialogType;
|
|
57
|
+
}
|
|
58
|
+
for (var i = 0; i < this.message.length; i++) {
|
|
59
|
+
this.message[i] = this.message[i].replace(/\n/g, '<br>') + '<br>';
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
AlertDialogComponent.prototype.onClickOk = function () {
|
|
63
|
+
this.dialogRef.close(true);
|
|
64
|
+
};
|
|
65
|
+
AlertDialogComponent.prototype.onClickYes = function () {
|
|
66
|
+
this.dialogRef.close(true);
|
|
67
|
+
};
|
|
68
|
+
AlertDialogComponent.prototype.onClickNo = function () {
|
|
69
|
+
this.dialogRef.close();
|
|
70
|
+
};
|
|
71
|
+
AlertDialogComponent.prototype.onMouseDownHeader = function (event) {
|
|
72
|
+
if (!event) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
this.positionX = this.topmostLeftmost.nativeElement.offsetLeft;
|
|
76
|
+
this.positionY = this.topmostLeftmost.nativeElement.offsetTop;
|
|
77
|
+
this.originalXClick = event.screenX;
|
|
78
|
+
this.originalYClick = event.screenY;
|
|
79
|
+
this.movingDialog = true;
|
|
80
|
+
this.changeDetector.detach();
|
|
81
|
+
};
|
|
82
|
+
AlertDialogComponent.prototype.onMouseMove = function (event) {
|
|
83
|
+
if (!event) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (this.movingDialog) {
|
|
87
|
+
this.positionX += event.screenX - this.originalXClick;
|
|
88
|
+
this.positionY += event.screenY - this.originalYClick;
|
|
89
|
+
this.originalXClick = event.screenX;
|
|
90
|
+
this.originalYClick = event.screenY;
|
|
91
|
+
var newDialogPosition = {
|
|
92
|
+
left: '' + this.positionX + 'px',
|
|
93
|
+
top: '' + this.positionY + 'px',
|
|
94
|
+
};
|
|
95
|
+
this.dialogRef.updatePosition(newDialogPosition);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
AlertDialogComponent.prototype.onMouseUp = function () {
|
|
99
|
+
this.movingDialog = false;
|
|
100
|
+
this.changeDetector.reattach();
|
|
101
|
+
};
|
|
102
|
+
AlertDialogComponent.ɵfac = ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AlertDialogComponent, deps: [{ token: MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: ChangeDetectorRef }], target: ɵɵFactoryTarget.Component });
|
|
103
|
+
AlertDialogComponent.ɵcmp = ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: AlertDialogComponent, selector: "hci-alert-dialog", host: { listeners: { "window:mousemove": "onMouseMove($event)", "window:mouseup": "onMouseUp($event)" } }, viewQueries: [{ propertyName: "topmostLeftmost", first: true, predicate: ["topmostLeftmost"], descendants: true }], ngImport: i0, template: "\n <div class=\"full-height full-width d-flex flex-column\">\n <div class=\"full-width dialog-header-colors no-margin no-padding\">\n <div #topmostLeftmost mat-dialog-title (mousedown)=\"onMouseDownHeader($event)\"\n class=\"force-flex-container-row align-center full-width padding {{ movingDialog ? 'grabbed' : 'grabbable' }}\">\n <div class=\"d-flex flex-row align-items-center padded\">\n <img *ngIf=\"icon\" class=\"icon\" [src]=\"this.icon\">\n <div *ngIf=\"!icon\">\n <i *ngIf=\"dialogType === type.ALERT\" class=\"fa fa-exclamation fa-2x i-margin i-color-blue\"></i>\n <i *ngIf=\"dialogType === type.SUCCESS\" class=\"fa fa-check-circle fa-2x i-margin i-color-blue\"></i>\n <i *ngIf=\"dialogType === type.FAILED || dialogType === type.ERROR\" class=\"fa fa-exclamation-triangle fa-2x i-margin i-color-red\"></i>\n <i *ngIf=\"dialogType === type.WARNING || dialogType === type.VALIDATION\" class=\"fa fa-exclamation-triangle fa-2x i-margin i-color-blue\"></i>\n <i *ngIf=\"dialogType === type.INFO\" class=\"fa fa-info-circle fa-2x i-margin i-color-blue\"></i>\n <i *ngIf=\"dialogType === type.CONFIRM\" class=\"fa fa-check fa-2x i-margin i-color-blue\"></i>\n </div>\n <h1 *ngIf=\"dialogType !== type.ERROR\"\n style=\"margin:0;\">{{this.title ? this.title : defaultTitle}}</h1>\n <h1 *ngIf=\"dialogType === type.ERROR\"\n style=\"margin:0; color: Red\">{{this.title ? this.title : defaultTitle}}</h1>\n </div>\n </div>\n </div>\n <mat-dialog-content class=\"flex-grow-1 no-margin no-padding\">\n <hr>\n <div class=\"flex-grow-1 full-width extra-padded message\">\n <div *ngFor=\"let line of message\" class=\"full-width\"\n [innerHTML]=\"line\" style=\"white-space: pre-line\">\n </div>\n </div>\n <br>\n </mat-dialog-content>\n <mat-dialog-actions class=\"d-flex justify-content-center no-margin no-padding\">\n <save-footer *ngIf=\"dialogType !== type.CONFIRM\" class=\"centered-text large-size\"\n (saveClicked)=\"onClickOk()\" name=\"Ok\"></save-footer>\n <save-footer *ngIf=\"dialogType === type.CONFIRM\" class=\"centered-text large-size\"\n (saveClicked)=\"onClickYes()\" name=\"Yes\"></save-footer>\n <save-footer *ngIf=\"dialogType === type.CONFIRM\" [actionType]=\"actionType\"\n class=\"centered-text large-size\" (saveClicked)=\"onClickNo()\"\n name=\"No\"></save-footer>\n </mat-dialog-actions>\n </div>\n ", isInline: true, styles: ["\n hr {\n width: 98%;\n }\n\n .i-margin {\n margin-left: 0.3em;\n margin-right: 0.3em;\n }\n .i-color-blue {\n color: #0077B3FF;\n }\n .i-color-red {\n color: red;\n }\n\n .centered-text { text-align: center; }\n\n .no-padding{\n padding:0;\n\n }\n\n .no-margin{\n margin: 0;\n }\n\n .grabbable {\n cursor: move;\n cursor: grab;\n cursor: -moz-grab;\n cursor: -webkit-grab;\n }\n .grabbed {\n cursor: move;\n cursor: grabbing;\n cursor: -moz-grabbing;\n cursor: -webkit-grabbing;\n }\n\n .force-flex-container-row{\n display:flex !important;\n }\n .extra-padded {\n padding: 0.6em 0.9em 0.6em 0.9em;\n }\n .large-size {\n font-size: large;\n }\n .primary-action {\n font-size: large;\n }\n .secondary-action {\n font-size: large;\n }\n .message {\n color: #0F244DFF;\n }\n "], directives: [{ type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }] });
|
|
104
|
+
return AlertDialogComponent;
|
|
105
|
+
}());
|
|
106
|
+
ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AlertDialogComponent, decorators: [{
|
|
107
|
+
type: Component,
|
|
108
|
+
args: [{
|
|
109
|
+
selector: 'hci-alert-dialog',
|
|
110
|
+
template: "\n <div class=\"full-height full-width d-flex flex-column\">\n <div class=\"full-width dialog-header-colors no-margin no-padding\">\n <div #topmostLeftmost mat-dialog-title (mousedown)=\"onMouseDownHeader($event)\"\n class=\"force-flex-container-row align-center full-width padding {{ movingDialog ? 'grabbed' : 'grabbable' }}\">\n <div class=\"d-flex flex-row align-items-center padded\">\n <img *ngIf=\"icon\" class=\"icon\" [src]=\"this.icon\">\n <div *ngIf=\"!icon\">\n <i *ngIf=\"dialogType === type.ALERT\" class=\"fa fa-exclamation fa-2x i-margin i-color-blue\"></i>\n <i *ngIf=\"dialogType === type.SUCCESS\" class=\"fa fa-check-circle fa-2x i-margin i-color-blue\"></i>\n <i *ngIf=\"dialogType === type.FAILED || dialogType === type.ERROR\" class=\"fa fa-exclamation-triangle fa-2x i-margin i-color-red\"></i>\n <i *ngIf=\"dialogType === type.WARNING || dialogType === type.VALIDATION\" class=\"fa fa-exclamation-triangle fa-2x i-margin i-color-blue\"></i>\n <i *ngIf=\"dialogType === type.INFO\" class=\"fa fa-info-circle fa-2x i-margin i-color-blue\"></i>\n <i *ngIf=\"dialogType === type.CONFIRM\" class=\"fa fa-check fa-2x i-margin i-color-blue\"></i>\n </div>\n <h1 *ngIf=\"dialogType !== type.ERROR\"\n style=\"margin:0;\">{{this.title ? this.title : defaultTitle}}</h1>\n <h1 *ngIf=\"dialogType === type.ERROR\"\n style=\"margin:0; color: Red\">{{this.title ? this.title : defaultTitle}}</h1>\n </div>\n </div>\n </div>\n <mat-dialog-content class=\"flex-grow-1 no-margin no-padding\">\n <hr>\n <div class=\"flex-grow-1 full-width extra-padded message\">\n <div *ngFor=\"let line of message\" class=\"full-width\"\n [innerHTML]=\"line\" style=\"white-space: pre-line\">\n </div>\n </div>\n <br>\n </mat-dialog-content>\n <mat-dialog-actions class=\"d-flex justify-content-center no-margin no-padding\">\n <save-footer *ngIf=\"dialogType !== type.CONFIRM\" class=\"centered-text large-size\"\n (saveClicked)=\"onClickOk()\" name=\"Ok\"></save-footer>\n <save-footer *ngIf=\"dialogType === type.CONFIRM\" class=\"centered-text large-size\"\n (saveClicked)=\"onClickYes()\" name=\"Yes\"></save-footer>\n <save-footer *ngIf=\"dialogType === type.CONFIRM\" [actionType]=\"actionType\"\n class=\"centered-text large-size\" (saveClicked)=\"onClickNo()\"\n name=\"No\"></save-footer>\n </mat-dialog-actions>\n </div>\n ",
|
|
111
|
+
styles: ["\n hr {\n width: 98%;\n }\n\n .i-margin {\n margin-left: 0.3em;\n margin-right: 0.3em;\n }\n .i-color-blue {\n color: #0077B3FF;\n }\n .i-color-red {\n color: red;\n }\n\n .centered-text { text-align: center; }\n\n .no-padding{\n padding:0;\n\n }\n\n .no-margin{\n margin: 0;\n }\n\n .grabbable {\n cursor: move;\n cursor: grab;\n cursor: -moz-grab;\n cursor: -webkit-grab;\n }\n .grabbed {\n cursor: move;\n cursor: grabbing;\n cursor: -moz-grabbing;\n cursor: -webkit-grabbing;\n }\n\n .force-flex-container-row{\n display:flex !important;\n }\n .extra-padded {\n padding: 0.6em 0.9em 0.6em 0.9em;\n }\n .large-size {\n font-size: large;\n }\n .primary-action {\n font-size: large;\n }\n .secondary-action {\n font-size: large;\n }\n .message {\n color: #0F244DFF;\n }\n "]
|
|
112
|
+
}]
|
|
113
|
+
}], ctorParameters: function () { return [{ type: MatDialogRef }, { type: undefined, decorators: [{
|
|
114
|
+
type: Inject,
|
|
115
|
+
args: [MAT_DIALOG_DATA]
|
|
116
|
+
}] }, { type: ChangeDetectorRef }]; }, propDecorators: { topmostLeftmost: [{
|
|
117
|
+
type: ViewChild,
|
|
118
|
+
args: ['topmostLeftmost', { static: false }]
|
|
119
|
+
}], onMouseMove: [{
|
|
120
|
+
type: HostListener,
|
|
121
|
+
args: ['window:mousemove', ['$event']]
|
|
122
|
+
}], onMouseUp: [{
|
|
123
|
+
type: HostListener,
|
|
124
|
+
args: ['window:mouseup', ['$event']]
|
|
125
|
+
}] } });
|
|
126
|
+
|
|
127
|
+
var SpinnerDialogComponent = /** @class */ (function () {
|
|
128
|
+
function SpinnerDialogComponent(dialogRef, data) {
|
|
129
|
+
this.dialogRef = dialogRef;
|
|
130
|
+
this.data = data;
|
|
131
|
+
this.strokeWidth = 3;
|
|
132
|
+
this.diameter = 30;
|
|
133
|
+
this.message = 'Loading...';
|
|
134
|
+
if (this.data) {
|
|
135
|
+
if (!!this.data.message) {
|
|
136
|
+
this.message = this.data.message;
|
|
137
|
+
}
|
|
138
|
+
if (!!this.data.diameter) {
|
|
139
|
+
this.diameter = this.data.diameter;
|
|
140
|
+
}
|
|
141
|
+
if (!!this.data.strokeWidth) {
|
|
142
|
+
this.strokeWidth = this.data.strokeWidth;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
SpinnerDialogComponent.ɵfac = ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SpinnerDialogComponent, deps: [{ token: MatDialogRef }, { token: MAT_DIALOG_DATA }], target: ɵɵFactoryTarget.Component });
|
|
147
|
+
SpinnerDialogComponent.ɵcmp = ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: SpinnerDialogComponent, selector: "hci-spinner-dialog", inputs: { strokeWidth: "strokeWidth", diameter: "diameter", message: "message" }, ngImport: i0, template: "<div mat-dialog-title class=\"not-rendered\">\r\n<!--<div mat-dialog-title>-->\r\n</div>\r\n<div mat-dialog-content class=\"full-height padded\">\r\n <div class=\"full-width full-height t\">\r\n <div class=\"tr\">\r\n <div class=\"td vertical-center\" [style.height.px]=\"diameter + 5\">\r\n <mat-spinner [hidden]=\"false\" strokeWidth=\"{{strokeWidth}}\" [diameter]=\"diameter\"></mat-spinner>\r\n </div>\r\n <div class=\"td vertical-center\">\r\n {{message}}\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n<div mat-dialog-actions class=\"not-rendered\">\r\n<!--<div mat-dialog-actions>-->\r\n</div>\r\n", styles: ["\n .t { display: table; }\n .tr { display: table-row; }\n .td { display: table-cell; }\n\n .full-height { height: 100%; }\n .full-width { width: 100%; }\n\n .vertical-center { vertical-align: middle; }\n\n .padded {\n padding-top: 0.4em;\n padding-bottom: 0.4em;\n }\n\n .not-rendered {\n padding: 0;\n margin: 0;\n\n min-height: 0;\n max-height: 0;\n height: 0;\n }\n\n "], components: [{ type: MatSpinner, selector: "mat-spinner", inputs: ["color"] }], directives: [{ type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }] });
|
|
148
|
+
return SpinnerDialogComponent;
|
|
149
|
+
}());
|
|
150
|
+
ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SpinnerDialogComponent, decorators: [{
|
|
151
|
+
type: Component,
|
|
152
|
+
args: [{
|
|
153
|
+
selector: 'hci-spinner-dialog',
|
|
154
|
+
templateUrl: 'spinner-dialog.component.html',
|
|
155
|
+
styles: ["\n .t { display: table; }\n .tr { display: table-row; }\n .td { display: table-cell; }\n\n .full-height { height: 100%; }\n .full-width { width: 100%; }\n\n .vertical-center { vertical-align: middle; }\n\n .padded {\n padding-top: 0.4em;\n padding-bottom: 0.4em;\n }\n\n .not-rendered {\n padding: 0;\n margin: 0;\n\n min-height: 0;\n max-height: 0;\n height: 0;\n }\n\n "]
|
|
156
|
+
}]
|
|
157
|
+
}], ctorParameters: function () { return [{ type: MatDialogRef }, { type: undefined, decorators: [{
|
|
158
|
+
type: Inject,
|
|
159
|
+
args: [MAT_DIALOG_DATA]
|
|
160
|
+
}] }]; }, propDecorators: { strokeWidth: [{
|
|
161
|
+
type: Input
|
|
162
|
+
}], diameter: [{
|
|
163
|
+
type: Input
|
|
164
|
+
}], message: [{
|
|
165
|
+
type: Input
|
|
166
|
+
}] } });
|
|
167
|
+
|
|
168
|
+
var CustomDialogComponent = /** @class */ (function () {
|
|
169
|
+
function CustomDialogComponent(dialogRef, data, changeDetector) {
|
|
170
|
+
this.dialogRef = dialogRef;
|
|
171
|
+
this.data = data;
|
|
172
|
+
this.changeDetector = changeDetector;
|
|
173
|
+
this.title = '';
|
|
174
|
+
this.icon = '';
|
|
175
|
+
this.actionType = ActionType;
|
|
176
|
+
this.originalXClick = 0;
|
|
177
|
+
this.originalYClick = 0;
|
|
178
|
+
this.movingDialog = false;
|
|
179
|
+
this.positionX = 0;
|
|
180
|
+
this.positionY = 0;
|
|
181
|
+
this.actions = [];
|
|
182
|
+
this.title = data.title;
|
|
183
|
+
this.tempRef = data.templateRef;
|
|
184
|
+
this.icon = data.icon;
|
|
185
|
+
this.context = data.context;
|
|
186
|
+
var actionConfig = data.actionConfig ? data.actionConfig : null;
|
|
187
|
+
this.actions = actionConfig ? actionConfig.actions : [];
|
|
188
|
+
this.form = actionConfig && actionConfig.formSource ? actionConfig.formSource : null;
|
|
189
|
+
}
|
|
190
|
+
Object.defineProperty(CustomDialogComponent.prototype, "primaryDisable", {
|
|
191
|
+
get: function () {
|
|
192
|
+
return this.form && this.form.invalid;
|
|
193
|
+
},
|
|
194
|
+
enumerable: false,
|
|
195
|
+
configurable: true
|
|
196
|
+
});
|
|
197
|
+
Object.defineProperty(CustomDialogComponent.prototype, "secondaryDisable", {
|
|
198
|
+
// todo need make this customizable
|
|
199
|
+
get: function () {
|
|
200
|
+
return false;
|
|
201
|
+
},
|
|
202
|
+
enumerable: false,
|
|
203
|
+
configurable: true
|
|
204
|
+
});
|
|
205
|
+
CustomDialogComponent.prototype.ngOnInit = function () {
|
|
206
|
+
this.context.dialog = this.dialogRef;
|
|
207
|
+
this.vcr.createEmbeddedView(this.tempRef, this.context);
|
|
208
|
+
};
|
|
209
|
+
CustomDialogComponent.prototype.onClose = function () {
|
|
210
|
+
this.dialogRef.close();
|
|
211
|
+
};
|
|
212
|
+
CustomDialogComponent.prototype.onMouseDownHeader = function (event) {
|
|
213
|
+
if (!event) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
this.positionX = this.topmostLeftmost.nativeElement.offsetLeft;
|
|
217
|
+
this.positionY = this.topmostLeftmost.nativeElement.offsetTop;
|
|
218
|
+
this.originalXClick = event.screenX;
|
|
219
|
+
this.originalYClick = event.screenY;
|
|
220
|
+
this.movingDialog = true;
|
|
221
|
+
this.changeDetector.detach();
|
|
222
|
+
};
|
|
223
|
+
CustomDialogComponent.prototype.onMouseMove = function (event) {
|
|
224
|
+
if (!event) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
if (this.movingDialog) {
|
|
228
|
+
this.positionX += event.screenX - this.originalXClick;
|
|
229
|
+
this.positionY += event.screenY - this.originalYClick;
|
|
230
|
+
this.originalXClick = event.screenX;
|
|
231
|
+
this.originalYClick = event.screenY;
|
|
232
|
+
var newDialogPosition = {
|
|
233
|
+
left: '' + this.positionX + 'px',
|
|
234
|
+
top: '' + this.positionY + 'px',
|
|
235
|
+
};
|
|
236
|
+
this.dialogRef.updatePosition(newDialogPosition);
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
CustomDialogComponent.prototype.onMouseUp = function () {
|
|
240
|
+
this.movingDialog = false;
|
|
241
|
+
this.changeDetector.reattach();
|
|
242
|
+
};
|
|
243
|
+
CustomDialogComponent.prototype.executeAction = function (action) {
|
|
244
|
+
if (action.externalAction) {
|
|
245
|
+
action.externalAction(this.dialogRef);
|
|
246
|
+
}
|
|
247
|
+
if (action.internalAction && action.internalAction === 'onClose') {
|
|
248
|
+
this.onClose();
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
CustomDialogComponent.ɵfac = ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomDialogComponent, deps: [{ token: MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: ChangeDetectorRef }], target: ɵɵFactoryTarget.Component });
|
|
252
|
+
CustomDialogComponent.ɵcmp = ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomDialogComponent, selector: "hci-custom-dialog", host: { listeners: { "window:mousemove": "onMouseMove($event)", "window:mouseup": "onMouseUp($event)" } }, viewQueries: [{ propertyName: "vcr", first: true, predicate: ["anchor"], descendants: true, read: ViewContainerRef, static: true }, { propertyName: "topmostLeftmost", first: true, predicate: ["topmostLeftmost"], descendants: true }], ngImport: i0, template: "\n <div class=\"d-flex full-height full-width flex-column\">\n <div *ngIf=\"this.title\" class=\"full-width generic-dialog-header-colors no-margin no-padding\">\n <div #topmostLeftmost mat-dialog-title (mousedown)=\"onMouseDownHeader($event)\"\n class=\"force-flex-container-row align-items-center full-width p-2 {{ movingDialog ? 'grabbed' : 'grabbable' }}\">\n <div class=\"-flex flex-row align-items-center padded\">\n <img *ngIf=\"icon\" class=\"icon\" [src]=\"this.icon\">\n <div *ngIf=\"icon && icon.substr(0, 2) === '<i'\" class=\"i-class\" [innerHTML]=\"icon\" ></div>\n <h3 style=\"margin:0;\">{{this.title}}</h3>\n </div>\n <div class=\"flex-grow-1\"></div>\n <div class=\"padded\" (click)=\"onClose()\">\n <i class=\"exit fas fa-times\"></i>\n </div>\n </div>\n </div>\n <mat-dialog-content class=\"flex-grow-1 full-width no-margin p-2\" style=\"min-height: 6em;\">\n <div #anchor></div>\n </mat-dialog-content>\n <mat-dialog-actions *ngIf=\"actions && actions.length > 0\"\n class=\"d-flex flex-row justify-content-end no-margin no-padding generic-dialog-footer-colors\">\n <div *ngFor=\"let action of actions\">\n <save-footer *ngIf=\"action.type === actionType.PRIMARY;else secondary\"\n [actionType]=\"action.type\"\n [icon]=\"action.icon\"\n [disableSave]=\"primaryDisable\"\n (saveClicked)=\"executeAction(action)\"\n [name]=\"action.name\">\n </save-footer>\n <!-- to avoid issue with multiple spinner or dirty notes-->\n <ng-template #secondary>\n <save-footer [actionType]=\"action.type\"\n (saveClicked)=\"executeAction(action)\"\n [icon]=\"action.icon\"\n [disableSave]=\"secondaryDisable\"\n [name]=\"action.name\">\n </save-footer>\n </ng-template>\n </div>\n </mat-dialog-actions>\n </div>\n ", isInline: true, styles: ["\n .centered-text { text-align: center; }\n\n .no-padding{\n padding:0;\n\n }\n\n .no-margin{\n margin: 0;\n }\n\n .grabbable {\n cursor: move;\n cursor: grab;\n cursor: -moz-grab;\n cursor: -webkit-grab;\n }\n .grabbed:active {\n cursor: grabbing;\n cursor: -moz-grabbing;\n cursor: -webkit-grabbing;\n }\n\n .force-flex-container-row{\n display:flex !important;\n }\n\n .exit{\n max-width: 20px;\n cursor: pointer;\n }\n\n .i-class {\n margin-left: 0.3em;\n margin-right: 0.3em;\n }\n mat-dialog-content {\n max-height: 100vh !important;\n max-width: 100vw !important ;\n }\n "], directives: [{ type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
253
|
+
return CustomDialogComponent;
|
|
254
|
+
}());
|
|
255
|
+
ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomDialogComponent, decorators: [{
|
|
256
|
+
type: Component,
|
|
257
|
+
args: [{
|
|
258
|
+
selector: 'hci-custom-dialog',
|
|
259
|
+
template: "\n <div class=\"d-flex full-height full-width flex-column\">\n <div *ngIf=\"this.title\" class=\"full-width generic-dialog-header-colors no-margin no-padding\">\n <div #topmostLeftmost mat-dialog-title (mousedown)=\"onMouseDownHeader($event)\"\n class=\"force-flex-container-row align-items-center full-width p-2 {{ movingDialog ? 'grabbed' : 'grabbable' }}\">\n <div class=\"-flex flex-row align-items-center padded\">\n <img *ngIf=\"icon\" class=\"icon\" [src]=\"this.icon\">\n <div *ngIf=\"icon && icon.substr(0, 2) === '<i'\" class=\"i-class\" [innerHTML]=\"icon\" ></div>\n <h3 style=\"margin:0;\">{{this.title}}</h3>\n </div>\n <div class=\"flex-grow-1\"></div>\n <div class=\"padded\" (click)=\"onClose()\">\n <i class=\"exit fas fa-times\"></i>\n </div>\n </div>\n </div>\n <mat-dialog-content class=\"flex-grow-1 full-width no-margin p-2\" style=\"min-height: 6em;\">\n <div #anchor></div>\n </mat-dialog-content>\n <mat-dialog-actions *ngIf=\"actions && actions.length > 0\"\n class=\"d-flex flex-row justify-content-end no-margin no-padding generic-dialog-footer-colors\">\n <div *ngFor=\"let action of actions\">\n <save-footer *ngIf=\"action.type === actionType.PRIMARY;else secondary\"\n [actionType]=\"action.type\"\n [icon]=\"action.icon\"\n [disableSave]=\"primaryDisable\"\n (saveClicked)=\"executeAction(action)\"\n [name]=\"action.name\">\n </save-footer>\n <!-- to avoid issue with multiple spinner or dirty notes-->\n <ng-template #secondary>\n <save-footer [actionType]=\"action.type\"\n (saveClicked)=\"executeAction(action)\"\n [icon]=\"action.icon\"\n [disableSave]=\"secondaryDisable\"\n [name]=\"action.name\">\n </save-footer>\n </ng-template>\n </div>\n </mat-dialog-actions>\n </div>\n ",
|
|
260
|
+
styles: ["\n .centered-text { text-align: center; }\n\n .no-padding{\n padding:0;\n\n }\n\n .no-margin{\n margin: 0;\n }\n\n .grabbable {\n cursor: move;\n cursor: grab;\n cursor: -moz-grab;\n cursor: -webkit-grab;\n }\n .grabbed:active {\n cursor: grabbing;\n cursor: -moz-grabbing;\n cursor: -webkit-grabbing;\n }\n\n .force-flex-container-row{\n display:flex !important;\n }\n\n .exit{\n max-width: 20px;\n cursor: pointer;\n }\n\n .i-class {\n margin-left: 0.3em;\n margin-right: 0.3em;\n }\n mat-dialog-content {\n max-height: 100vh !important;\n max-width: 100vw !important ;\n }\n "]
|
|
261
|
+
}]
|
|
262
|
+
}], ctorParameters: function () { return [{ type: MatDialogRef }, { type: undefined, decorators: [{
|
|
263
|
+
type: Inject,
|
|
264
|
+
args: [MAT_DIALOG_DATA]
|
|
265
|
+
}] }, { type: ChangeDetectorRef }]; }, propDecorators: { vcr: [{
|
|
266
|
+
type: ViewChild,
|
|
267
|
+
args: ['anchor', { read: ViewContainerRef, static: true }]
|
|
268
|
+
}], topmostLeftmost: [{
|
|
269
|
+
type: ViewChild,
|
|
270
|
+
args: ['topmostLeftmost', { static: false }]
|
|
271
|
+
}], onMouseMove: [{
|
|
272
|
+
type: HostListener,
|
|
273
|
+
args: ['window:mousemove', ['$event']]
|
|
274
|
+
}], onMouseUp: [{
|
|
275
|
+
type: HostListener,
|
|
276
|
+
args: ['window:mouseup', ['$event']]
|
|
277
|
+
}] } });
|
|
278
|
+
|
|
279
|
+
var GenericContainerDialogComponent = /** @class */ (function () {
|
|
280
|
+
function GenericContainerDialogComponent(dialog, router, changeDetector, dialogRef, data) {
|
|
281
|
+
this.dialog = dialog;
|
|
282
|
+
this.router = router;
|
|
283
|
+
this.changeDetector = changeDetector;
|
|
284
|
+
this.dialogRef = dialogRef;
|
|
285
|
+
this.data = data;
|
|
286
|
+
this.classList = 'd-flex flex-column flex-grow-1 flex-shrink-1';
|
|
287
|
+
this.type = ActionType;
|
|
288
|
+
this.actions = [];
|
|
289
|
+
this.originalXClick = 0;
|
|
290
|
+
this.originalYClick = 0;
|
|
291
|
+
this.positionX = 0;
|
|
292
|
+
this.positionY = 0;
|
|
293
|
+
this.movingDialog = false;
|
|
294
|
+
if (data) {
|
|
295
|
+
this.dialogContentBluePrint = data.dialogContent;
|
|
296
|
+
this.icon = data.icon;
|
|
297
|
+
this.title = data.title;
|
|
298
|
+
this.useSaveFooter = data.actionConfig ? data.actionConfig.useSaveFooter : false;
|
|
299
|
+
this.actions = data.actionConfig ? data.actionConfig.actions : [];
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
GenericContainerDialogComponent.prototype.ngOnInit = function () {
|
|
303
|
+
};
|
|
304
|
+
GenericContainerDialogComponent.prototype.createdComponent = function (event) {
|
|
305
|
+
this.dialogContent = event.instance;
|
|
306
|
+
};
|
|
307
|
+
GenericContainerDialogComponent.prototype.executeAction = function (action) {
|
|
308
|
+
if (action.externalAction) {
|
|
309
|
+
action.externalAction();
|
|
310
|
+
}
|
|
311
|
+
if (action.internalAction) {
|
|
312
|
+
var internalAction = action.internalAction;
|
|
313
|
+
if (action.internalAction === 'cancel' || action.internalAction === 'onClose') {
|
|
314
|
+
if (this.dialogContent[internalAction]) {
|
|
315
|
+
this.dialogContent[internalAction]();
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
this.onClose();
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
else {
|
|
322
|
+
if (typeof action.internalActionReturnValue !== 'undefined') {
|
|
323
|
+
if (action.internalActionReturnValue) {
|
|
324
|
+
this.dialogContent[internalAction](action.internalActionReturnValue);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
this.dialogContent[internalAction]();
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
GenericContainerDialogComponent.prototype.onMouseDownHeader = function (event) {
|
|
334
|
+
if (!event) {
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
this.positionX = this.topmostLeftmost.nativeElement.offsetLeft;
|
|
338
|
+
this.positionY = this.topmostLeftmost.nativeElement.offsetTop;
|
|
339
|
+
this.originalXClick = event.screenX;
|
|
340
|
+
this.originalYClick = event.screenY;
|
|
341
|
+
this.movingDialog = true;
|
|
342
|
+
this.changeDetector.detach();
|
|
343
|
+
};
|
|
344
|
+
GenericContainerDialogComponent.prototype.onMouseMove = function (event) {
|
|
345
|
+
if (!event) {
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
if (this.movingDialog) {
|
|
349
|
+
this.positionX += event.screenX - this.originalXClick;
|
|
350
|
+
this.positionY += event.screenY - this.originalYClick;
|
|
351
|
+
this.originalXClick = event.screenX;
|
|
352
|
+
this.originalYClick = event.screenY;
|
|
353
|
+
var newDialogPosition = {
|
|
354
|
+
left: '' + this.positionX + 'px',
|
|
355
|
+
top: '' + this.positionY + 'px',
|
|
356
|
+
};
|
|
357
|
+
this.dialogRef.updatePosition(newDialogPosition);
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
GenericContainerDialogComponent.prototype.onMouseUp = function () {
|
|
361
|
+
this.movingDialog = false;
|
|
362
|
+
this.changeDetector.reattach();
|
|
363
|
+
};
|
|
364
|
+
GenericContainerDialogComponent.prototype.onClose = function () {
|
|
365
|
+
this.dialogRef.close();
|
|
366
|
+
};
|
|
367
|
+
GenericContainerDialogComponent.prototype.ngOnDestroy = function () {
|
|
368
|
+
};
|
|
369
|
+
GenericContainerDialogComponent.ɵfac = ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GenericContainerDialogComponent, deps: [{ token: MatDialog }, { token: Router }, { token: ChangeDetectorRef }, { token: MatDialogRef }, { token: MAT_DIALOG_DATA }], target: ɵɵFactoryTarget.Component });
|
|
370
|
+
GenericContainerDialogComponent.ɵcmp = ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: GenericContainerDialogComponent, selector: "hci-generic-container-dialog", host: { listeners: { "window:mousemove": "onMouseMove($event)", "window:mouseup": "onMouseUp($event)" }, properties: { "class": "this.classList" } }, viewQueries: [{ propertyName: "topmostLeftmost", first: true, predicate: ["topmostLeftmost"], descendants: true }], ngImport: i0, template: "<div class=\"full-height full-width d-flex flex-column\" style=\"height: 100%;\">\r\n <div class=\"full-width generic-dialog-header-colors no-margin no-padding\">\r\n <div #topmostLeftmost mat-dialog-title (mousedown)=\"onMouseDownHeader($event)\"\r\n class=\"d-flex align-items-center full-width\" [ngClass]=\"{'grabbed':movingDialog, 'grabbable': !movingDialog}\">\r\n <div class=\"d-flex flex-row align-items-center p-2\">\r\n <img class=\"icon\" *ngIf=\"icon && icon.substr(0, 2) !== '<i'\" [src]=\"icon\">\r\n <div *ngIf=\"icon && icon.substr(0, 2) === '<i'\" class=\"i-class\" [innerHTML]=\"icon\" ></div>\r\n <h3 style=\"margin:0;\">{{this.title ? this.title : this.dialogContent.innerTitle}}</h3>\r\n </div>\r\n <div class=\"flex-grow-1\"></div>\r\n <div class=\"padded\" (click)=\"onClose()\">\r\n <i class=\"exit fas fa-times\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <mat-dialog-content class=\"flex-grow-1 no-margin no-padding\">\r\n <div class=\"flex-grow-1 full-height full-width padded\">\r\n <ndc-dynamic [ndcDynamicComponent]=\"this.dialogContentBluePrint\"\r\n [ndcDynamicInputs]=\"this.data\"\r\n (ndcDynamicCreated)=\"createdComponent($event)\">\r\n </ndc-dynamic>\r\n </div>\r\n </mat-dialog-content>\r\n <mat-dialog-actions *ngIf=\"actions && actions.length > 0\"\r\n class=\"d-flex flex-row justify-content-end no-margin no-padding generic-dialog-footer-colors\">\r\n <div *ngFor=\"let action of actions\">\r\n <save-footer *ngIf=\"action.type === type.PRIMARY;else secondary\"\r\n [actionType]=\"action.type\"\r\n [icon]=\"action.icon\"\r\n (saveClicked)=\"executeAction(action)\"\r\n [disableSave]=\"this.dialogContent.primaryDisable(action)\"\r\n [dirty]=\"this.dialogContent.dirty()\"\r\n [name]=\"action.name\"\r\n [showSpinner]=\"this.dialogContent.showSpinner\">\r\n </save-footer>\r\n <!-- to avoid issue with multiple spinner or dirty notes-->\r\n <ng-template #secondary>\r\n <save-footer [actionType]=\"action.type\"\r\n (saveClicked)=\"executeAction(action)\"\r\n [icon]=\"action.icon\"\r\n [disableSave]=\"this.dialogContent.secondaryDisable(action)\"\r\n [name]=\"action.name\">\r\n\r\n </save-footer>\r\n </ng-template>\r\n </div>\r\n </mat-dialog-actions>\r\n</div>\r\n", styles: ["\n\n .no-padding{\n padding:0;\n }\n .no-margin{\n margin: 0;\n }\n .grabbable {\n cursor: move;\n cursor: grab;\n cursor: -moz-grab;\n cursor: -webkit-grab;\n }\n .grabbed:active {\n cursor: move;\n cursor: grabbing;\n cursor: -moz-grabbing;\n cursor: -webkit-grabbing;\n }\n .exit{\n max-width: 20px;\n cursor: pointer;\n }\n .i-class {\n margin-left: 0.3em;\n margin-right: 0.3em;\n }\n mat-dialog-content {\n max-height: 100% !important;\n }\n\n "], components: [{ type: DynamicComponent, selector: "ndc-dynamic", inputs: ["ndcDynamicComponent", "ndcDynamicInjector", "ndcDynamicProviders", "ndcDynamicContent"], outputs: ["ndcDynamicCreated"] }], directives: [{ type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: DynamicIoDirective, selector: "[ndcDynamicInputs],[ndcDynamicOutputs],[ngComponentOutletNdcDynamicInputs],[ngComponentOutletNdcDynamicOutputs]", inputs: ["ndcDynamicInputs", "ngComponentOutletNdcDynamicInputs", "ndcDynamicOutputs", "ngComponentOutletNdcDynamicOutputs"] }, { type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }, { type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
371
|
+
return GenericContainerDialogComponent;
|
|
372
|
+
}());
|
|
373
|
+
ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GenericContainerDialogComponent, decorators: [{
|
|
374
|
+
type: Component,
|
|
375
|
+
args: [{
|
|
376
|
+
selector: 'hci-generic-container-dialog',
|
|
377
|
+
templateUrl: './generic-container-dialog.component.html',
|
|
378
|
+
styles: ["\n\n .no-padding{\n padding:0;\n }\n .no-margin{\n margin: 0;\n }\n .grabbable {\n cursor: move;\n cursor: grab;\n cursor: -moz-grab;\n cursor: -webkit-grab;\n }\n .grabbed:active {\n cursor: move;\n cursor: grabbing;\n cursor: -moz-grabbing;\n cursor: -webkit-grabbing;\n }\n .exit{\n max-width: 20px;\n cursor: pointer;\n }\n .i-class {\n margin-left: 0.3em;\n margin-right: 0.3em;\n }\n mat-dialog-content {\n max-height: 100% !important;\n }\n\n "]
|
|
379
|
+
}]
|
|
380
|
+
}], ctorParameters: function () { return [{ type: MatDialog }, { type: Router }, { type: ChangeDetectorRef }, { type: MatDialogRef }, { type: undefined, decorators: [{
|
|
381
|
+
type: Inject,
|
|
382
|
+
args: [MAT_DIALOG_DATA]
|
|
383
|
+
}] }]; }, propDecorators: { classList: [{
|
|
384
|
+
type: HostBinding,
|
|
385
|
+
args: ['class']
|
|
386
|
+
}], topmostLeftmost: [{
|
|
387
|
+
type: ViewChild,
|
|
388
|
+
args: ['topmostLeftmost', { static: false }]
|
|
389
|
+
}], onMouseMove: [{
|
|
390
|
+
type: HostListener,
|
|
391
|
+
args: ['window:mousemove', ['$event']]
|
|
392
|
+
}], onMouseUp: [{
|
|
393
|
+
type: HostListener,
|
|
394
|
+
args: ['window:mouseup', ['$event']]
|
|
395
|
+
}] } });
|
|
396
|
+
|
|
397
|
+
var ConfirmType;
|
|
398
|
+
(function (ConfirmType) {
|
|
399
|
+
ConfirmType["DELETE"] = "delete";
|
|
400
|
+
ConfirmType["DELETE_W_MESSAGE"] = "deleteMessage";
|
|
401
|
+
ConfirmType["DELETE_W_PROMPT"] = "deletePrompt";
|
|
402
|
+
ConfirmType["DISCARD"] = "discard";
|
|
403
|
+
ConfirmType["CONFIRM_AND_CLOSE"] = "confirmAndClose";
|
|
404
|
+
ConfirmType["ADD"] = "add";
|
|
405
|
+
ConfirmType["ALERT"] = "alert";
|
|
406
|
+
ConfirmType["GENERIC"] = "generic";
|
|
407
|
+
})(ConfirmType || (ConfirmType = {}));
|
|
408
|
+
|
|
409
|
+
var BaseGenericContainerDialog = /** @class */ (function () {
|
|
410
|
+
function BaseGenericContainerDialog() {
|
|
411
|
+
this.showSpinner = false;
|
|
412
|
+
this.innerTitle = '';
|
|
413
|
+
this.primaryDisable = function (action) {
|
|
414
|
+
return false;
|
|
415
|
+
};
|
|
416
|
+
this.secondaryDisable = function (action) {
|
|
417
|
+
return false;
|
|
418
|
+
};
|
|
419
|
+
this.dirty = function () { return false; };
|
|
420
|
+
}
|
|
421
|
+
BaseGenericContainerDialog.ɵfac = ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: BaseGenericContainerDialog, deps: [], target: ɵɵFactoryTarget.Component });
|
|
422
|
+
BaseGenericContainerDialog.ɵcmp = ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: BaseGenericContainerDialog, selector: "ng-component", inputs: { inputData: "inputData" }, ngImport: i0, template: '', isInline: true });
|
|
423
|
+
return BaseGenericContainerDialog;
|
|
424
|
+
}());
|
|
425
|
+
ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: BaseGenericContainerDialog, decorators: [{
|
|
426
|
+
type: Component,
|
|
427
|
+
args: [{
|
|
428
|
+
template: ''
|
|
429
|
+
}]
|
|
430
|
+
}], ctorParameters: function () { return []; }, propDecorators: { inputData: [{
|
|
431
|
+
type: Input
|
|
432
|
+
}] } });
|
|
433
|
+
|
|
434
|
+
var __extends = (this && this.__extends) || (function () {
|
|
435
|
+
var extendStatics = function (d, b) {
|
|
436
|
+
extendStatics = Object.setPrototypeOf ||
|
|
437
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
438
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
439
|
+
return extendStatics(d, b);
|
|
440
|
+
};
|
|
441
|
+
return function (d, b) {
|
|
442
|
+
if (typeof b !== "function" && b !== null)
|
|
443
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
444
|
+
extendStatics(d, b);
|
|
445
|
+
function __() { this.constructor = d; }
|
|
446
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
447
|
+
};
|
|
448
|
+
})();
|
|
449
|
+
var ConfirmDialogComponent = /** @class */ (function (_super) {
|
|
450
|
+
__extends(ConfirmDialogComponent, _super);
|
|
451
|
+
function ConfirmDialogComponent(dialogRef, data) {
|
|
452
|
+
var _this = _super.call(this) || this;
|
|
453
|
+
_this.dialogRef = dialogRef;
|
|
454
|
+
_this.data = data;
|
|
455
|
+
_this.ConfirmType = ConfirmType; // make enum available in template
|
|
456
|
+
_this.prompt = '';
|
|
457
|
+
_this.message1 = '';
|
|
458
|
+
_this.message2 = '';
|
|
459
|
+
_this.confirmType = ConfirmType.GENERIC;
|
|
460
|
+
var temp = data.confirmType ? data.confirmType : ConfirmType.GENERIC;
|
|
461
|
+
if (Object.values(ConfirmType).includes(temp)) {
|
|
462
|
+
_this.confirmType = temp;
|
|
463
|
+
}
|
|
464
|
+
_this.prompt = data.prompt ? data.prompt : '';
|
|
465
|
+
_this.message1 = data.message1 ? data.message1 : '';
|
|
466
|
+
_this.message2 = data.message2 ? data.message2 : '';
|
|
467
|
+
_this.setupMessagesByType();
|
|
468
|
+
return _this;
|
|
469
|
+
}
|
|
470
|
+
ConfirmDialogComponent.prototype.setupMessagesByType = function () {
|
|
471
|
+
// by enum type, setup the messages/prompt
|
|
472
|
+
switch (this.confirmType) {
|
|
473
|
+
case ConfirmType.DELETE:
|
|
474
|
+
this.prompt = 'The following will be deleted:';
|
|
475
|
+
this.message2 = 'Continue?';
|
|
476
|
+
break;
|
|
477
|
+
case ConfirmType.DELETE_W_MESSAGE:
|
|
478
|
+
this.prompt = 'The following will be deleted:';
|
|
479
|
+
break;
|
|
480
|
+
case ConfirmType.DELETE_W_PROMPT:
|
|
481
|
+
// noop, take all of what was passed in
|
|
482
|
+
break;
|
|
483
|
+
case ConfirmType.DISCARD:
|
|
484
|
+
this.prompt = '';
|
|
485
|
+
this.message2 = 'Continue?';
|
|
486
|
+
break;
|
|
487
|
+
case ConfirmType.CONFIRM_AND_CLOSE:
|
|
488
|
+
this.prompt = '';
|
|
489
|
+
this.message2 = '';
|
|
490
|
+
break;
|
|
491
|
+
case ConfirmType.ADD:
|
|
492
|
+
this.prompt = 'The following will be added:';
|
|
493
|
+
this.message2 = 'Continue?';
|
|
494
|
+
break;
|
|
495
|
+
case ConfirmType.ALERT:
|
|
496
|
+
// noop, will only use the message1 in a special template, and just ignore rest
|
|
497
|
+
break;
|
|
498
|
+
case ConfirmType.GENERIC:
|
|
499
|
+
// TODO: either only use message 1 or just take all passed in...
|
|
500
|
+
this.prompt = '';
|
|
501
|
+
this.message2 = '';
|
|
502
|
+
break;
|
|
503
|
+
default:
|
|
504
|
+
throw new Error('Confirm type doesn\'t exist');
|
|
505
|
+
}
|
|
506
|
+
};
|
|
507
|
+
ConfirmDialogComponent.prototype.onConfirmClick = function (value) {
|
|
508
|
+
this.dialogRef.close(value);
|
|
509
|
+
};
|
|
510
|
+
ConfirmDialogComponent.ɵfac = ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ConfirmDialogComponent, deps: [{ token: MatDialogRef }, { token: MAT_DIALOG_DATA }], target: ɵɵFactoryTarget.Component });
|
|
511
|
+
ConfirmDialogComponent.ɵcmp = ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ConfirmDialogComponent, selector: "hci-confirm-dialog", usesInheritance: true, ngImport: i0, template: "\n <div class=\"ri-confirm-body\">\n\n <div *ngIf=\"confirmType !== ConfirmType.ALERT; else alertBlock\">\n {{prompt}}\n <div class=\"ri-confirm-text-delete\">{{ message1 }}</div>\n {{message2}}\n </div>\n\n\n <div #alertBlock>\n <p>We are working to correct it. Contact CODE support if the error persists.</p>\n <mat-expansion-panel>\n <mat-expansion-panel-header>\n <mat-panel-title>\n <strong>Show details</strong>\n </mat-panel-title>\n </mat-expansion-panel-header>\n <div>{{ message1 }}</div>\n </mat-expansion-panel>\n </div>\n\n </div>\n ", isInline: true, styles: ["\n\n "], components: [{ type: MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { type: MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }], directives: [{ type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: MatExpansionPanelTitle, selector: "mat-panel-title" }] });
|
|
512
|
+
return ConfirmDialogComponent;
|
|
513
|
+
}(BaseGenericContainerDialog));
|
|
514
|
+
ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ConfirmDialogComponent, decorators: [{
|
|
515
|
+
type: Component,
|
|
516
|
+
args: [{
|
|
517
|
+
selector: 'hci-confirm-dialog',
|
|
518
|
+
template: "\n <div class=\"ri-confirm-body\">\n\n <div *ngIf=\"confirmType !== ConfirmType.ALERT; else alertBlock\">\n {{prompt}}\n <div class=\"ri-confirm-text-delete\">{{ message1 }}</div>\n {{message2}}\n </div>\n\n\n <div #alertBlock>\n <p>We are working to correct it. Contact CODE support if the error persists.</p>\n <mat-expansion-panel>\n <mat-expansion-panel-header>\n <mat-panel-title>\n <strong>Show details</strong>\n </mat-panel-title>\n </mat-expansion-panel-header>\n <div>{{ message1 }}</div>\n </mat-expansion-panel>\n </div>\n\n </div>\n ",
|
|
519
|
+
styles: ["\n\n "]
|
|
520
|
+
}]
|
|
521
|
+
}], ctorParameters: function () { return [{ type: MatDialogRef }, { type: undefined, decorators: [{
|
|
522
|
+
type: Inject,
|
|
523
|
+
args: [MAT_DIALOG_DATA]
|
|
524
|
+
}] }]; } });
|
|
525
|
+
|
|
526
|
+
var __values = (this && this.__values) || function(o) {
|
|
527
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
528
|
+
if (m) return m.call(o);
|
|
529
|
+
if (o && typeof o.length === "number") return {
|
|
530
|
+
next: function () {
|
|
531
|
+
if (o && i >= o.length) o = void 0;
|
|
532
|
+
return { value: o && o[i++], done: !o };
|
|
533
|
+
}
|
|
534
|
+
};
|
|
535
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
536
|
+
};
|
|
537
|
+
var DialogService = /** @class */ (function () {
|
|
538
|
+
function DialogService(dialog) {
|
|
539
|
+
this.dialog = dialog;
|
|
540
|
+
this._spinnerDialogIsOpen = false;
|
|
541
|
+
this.spinnerWorkItemCount = 0;
|
|
542
|
+
this.checkingSpinnerWorkItems = false;
|
|
543
|
+
this.spinnerDialogRefs = [];
|
|
544
|
+
}
|
|
545
|
+
Object.defineProperty(DialogService.prototype, "spinnerDialogIsOpen", {
|
|
546
|
+
get: function () {
|
|
547
|
+
return this._spinnerDialogIsOpen;
|
|
548
|
+
},
|
|
549
|
+
enumerable: false,
|
|
550
|
+
configurable: true
|
|
551
|
+
});
|
|
552
|
+
DialogService.prototype.alert = function (message, title, dialogType, icon, config) {
|
|
553
|
+
return this.openDialog(message, title, dialogType ? dialogType : DialogType.ALERT, icon, config);
|
|
554
|
+
};
|
|
555
|
+
DialogService.prototype.confirm = function (message, title, icon, config) {
|
|
556
|
+
return this.openDialog(message, title, DialogType.CONFIRM, icon, config);
|
|
557
|
+
};
|
|
558
|
+
/**
|
|
559
|
+
* Creates a ConfirmDialogComponent with different display depending on
|
|
560
|
+
* the ConfirmType.
|
|
561
|
+
* @param title defaults to 'Confirm'
|
|
562
|
+
* @param icon defaults to 'fa fa-info-circle'
|
|
563
|
+
* @param config config.data can contain a prompt, message1 and/or
|
|
564
|
+
* message2 according to the ConfirmType chosen
|
|
565
|
+
* @param actionConfig sets up the dialog buttons and actions if you want
|
|
566
|
+
* to override the defaults
|
|
567
|
+
*/
|
|
568
|
+
DialogService.prototype.confirmByType = function (confirmType, title, icon, config, actionConfig) {
|
|
569
|
+
if (!title) {
|
|
570
|
+
title = 'Confirm';
|
|
571
|
+
}
|
|
572
|
+
if (!icon) {
|
|
573
|
+
icon = 'fa fa-info-circle';
|
|
574
|
+
}
|
|
575
|
+
// set up a default if needed
|
|
576
|
+
if (!config) {
|
|
577
|
+
config = new MatDialogConfig();
|
|
578
|
+
config.width = '33vw';
|
|
579
|
+
config.minWidth = '300px';
|
|
580
|
+
config.disableClose = true;
|
|
581
|
+
}
|
|
582
|
+
if (config.data) {
|
|
583
|
+
config.data.confirmType = confirmType;
|
|
584
|
+
}
|
|
585
|
+
else {
|
|
586
|
+
config.data = {
|
|
587
|
+
confirmType: confirmType
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
// if no actions passed in, set up the defaults
|
|
591
|
+
if (!actionConfig) {
|
|
592
|
+
// default actions
|
|
593
|
+
var primary = { type: ActionType.PRIMARY, name: 'YES',
|
|
594
|
+
internalAction: 'onConfirmClick', internalActionReturnValue: true };
|
|
595
|
+
var secondary = { type: ActionType.SECONDARY, name: 'GO BACK',
|
|
596
|
+
internalAction: 'onClose' };
|
|
597
|
+
// by enum type, setup the messages/prompt
|
|
598
|
+
// only two need different defaults than generic defaults
|
|
599
|
+
switch (confirmType) {
|
|
600
|
+
case ConfirmType.CONFIRM_AND_CLOSE:
|
|
601
|
+
primary = { type: ActionType.PRIMARY, name: 'CONFIRM AND CLOSE',
|
|
602
|
+
internalAction: 'onConfirmClick', internalActionReturnValue: true };
|
|
603
|
+
break;
|
|
604
|
+
case ConfirmType.ALERT:
|
|
605
|
+
primary = undefined;
|
|
606
|
+
secondary = { type: ActionType.SECONDARY, name: 'CLOSE',
|
|
607
|
+
internalAction: 'onClose' };
|
|
608
|
+
break;
|
|
609
|
+
// case ConfirmType.DELETE:
|
|
610
|
+
// case ConfirmType.DELETE_W_MESSAGE:
|
|
611
|
+
// case ConfirmType.DELETE_W_PROMPT:
|
|
612
|
+
// case ConfirmType.DISCARD:
|
|
613
|
+
// case ConfirmType.ADD:
|
|
614
|
+
// case ConfirmType.GENERIC:
|
|
615
|
+
default:
|
|
616
|
+
throw new Error('Confirm type doesn\'t exist');
|
|
617
|
+
}
|
|
618
|
+
var actions = [];
|
|
619
|
+
if (primary) {
|
|
620
|
+
actions.push(primary);
|
|
621
|
+
}
|
|
622
|
+
if (secondary) {
|
|
623
|
+
actions.push(secondary);
|
|
624
|
+
}
|
|
625
|
+
actionConfig = {
|
|
626
|
+
actions: actions
|
|
627
|
+
};
|
|
628
|
+
}
|
|
629
|
+
return this.genericDialogContainer(ConfirmDialogComponent, title, icon, config, actionConfig);
|
|
630
|
+
};
|
|
631
|
+
DialogService.prototype.error = function (message, title, icon, config) {
|
|
632
|
+
return this.openDialog(message, title, DialogType.ERROR, icon, config);
|
|
633
|
+
};
|
|
634
|
+
DialogService.prototype.info = function (message, title, icon, config) {
|
|
635
|
+
return this.openDialog(message, title, DialogType.INFO, icon, config);
|
|
636
|
+
};
|
|
637
|
+
DialogService.prototype.createCustomDialog = function (tempRef, context, title, icon, config, actionConfig) {
|
|
638
|
+
var configuration = null;
|
|
639
|
+
if (!config) {
|
|
640
|
+
configuration = new MatDialogConfig();
|
|
641
|
+
}
|
|
642
|
+
else {
|
|
643
|
+
configuration = config;
|
|
644
|
+
}
|
|
645
|
+
configuration.data = configuration.data ? configuration.data : {};
|
|
646
|
+
configuration.data.templateRef = tempRef;
|
|
647
|
+
configuration.data.title = title ? title : '';
|
|
648
|
+
configuration.data.icon = icon ? icon : '';
|
|
649
|
+
configuration.data.context = context;
|
|
650
|
+
if (actionConfig) {
|
|
651
|
+
configuration.data.actionConfig = actionConfig;
|
|
652
|
+
}
|
|
653
|
+
configuration.minWidth = configuration.minWidth ? configuration.minWidth : '10em';
|
|
654
|
+
configuration.width = configuration.width ? configuration.width : '30em';
|
|
655
|
+
configuration.panelClass = ['mx-sized-dialog', 'no-padding'];
|
|
656
|
+
configuration.disableClose = true;
|
|
657
|
+
configuration.hasBackdrop = true;
|
|
658
|
+
var dialogRef = this.dialog.open(CustomDialogComponent, configuration);
|
|
659
|
+
return dialogRef;
|
|
660
|
+
};
|
|
661
|
+
DialogService.prototype.startDefaultSpinnerDialog = function () {
|
|
662
|
+
return this.startSpinnerDialog('Please wait...', 3, 30);
|
|
663
|
+
};
|
|
664
|
+
DialogService.prototype.startSpinnerDialog = function (message, strokeWidth, diameter) {
|
|
665
|
+
var _this = this;
|
|
666
|
+
if (this._spinnerDialogIsOpen) {
|
|
667
|
+
return null;
|
|
668
|
+
}
|
|
669
|
+
this._spinnerDialogIsOpen = true;
|
|
670
|
+
var configuration = new MatDialogConfig();
|
|
671
|
+
configuration.data = {
|
|
672
|
+
message: message,
|
|
673
|
+
strokeWidth: strokeWidth,
|
|
674
|
+
diameter: diameter
|
|
675
|
+
};
|
|
676
|
+
configuration.width = '13em';
|
|
677
|
+
configuration.disableClose = true;
|
|
678
|
+
var dialogRef = this.dialog.open(SpinnerDialogComponent, configuration);
|
|
679
|
+
dialogRef.afterClosed().subscribe(function () {
|
|
680
|
+
_this._spinnerDialogIsOpen = false;
|
|
681
|
+
});
|
|
682
|
+
this.spinnerDialogRefs.push(dialogRef);
|
|
683
|
+
return dialogRef;
|
|
684
|
+
};
|
|
685
|
+
DialogService.prototype.startNonModalSpinnerDialog = function (message, strokeWidth, diameter) {
|
|
686
|
+
var _this = this;
|
|
687
|
+
if (this._spinnerDialogIsOpen) {
|
|
688
|
+
return null;
|
|
689
|
+
}
|
|
690
|
+
this._spinnerDialogIsOpen = true;
|
|
691
|
+
var configuration = new MatDialogConfig();
|
|
692
|
+
configuration.data = {
|
|
693
|
+
message: message,
|
|
694
|
+
strokeWidth: strokeWidth,
|
|
695
|
+
diameter: diameter
|
|
696
|
+
};
|
|
697
|
+
configuration.width = '13em';
|
|
698
|
+
configuration.disableClose = true;
|
|
699
|
+
configuration.hasBackdrop = false;
|
|
700
|
+
var dialogRef = this.dialog.open(SpinnerDialogComponent, configuration);
|
|
701
|
+
dialogRef.afterClosed().subscribe(function () {
|
|
702
|
+
_this._spinnerDialogIsOpen = false;
|
|
703
|
+
});
|
|
704
|
+
this.spinnerDialogRefs.push(dialogRef);
|
|
705
|
+
return dialogRef;
|
|
706
|
+
};
|
|
707
|
+
// Let there be an alternative, global way to stop all active spinner dialogs.
|
|
708
|
+
DialogService.prototype.stopAllSpinnerDialogs = function () {
|
|
709
|
+
var e_1, _a;
|
|
710
|
+
this.spinnerWorkItemCount = 0;
|
|
711
|
+
var _loop_1 = function (dialogRef) {
|
|
712
|
+
setTimeout(function () {
|
|
713
|
+
dialogRef.close();
|
|
714
|
+
});
|
|
715
|
+
};
|
|
716
|
+
try {
|
|
717
|
+
for (var _b = __values(this.spinnerDialogRefs), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
718
|
+
var dialogRef = _c.value;
|
|
719
|
+
_loop_1(dialogRef);
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
723
|
+
finally {
|
|
724
|
+
try {
|
|
725
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
726
|
+
}
|
|
727
|
+
finally { if (e_1) throw e_1.error; }
|
|
728
|
+
}
|
|
729
|
+
this.spinnerDialogRefs = [];
|
|
730
|
+
};
|
|
731
|
+
DialogService.prototype.addSpinnerWorkItem = function () {
|
|
732
|
+
var _this = this;
|
|
733
|
+
this.spinnerWorkItemCount++;
|
|
734
|
+
if (!this.checkingSpinnerWorkItems) {
|
|
735
|
+
this.checkingSpinnerWorkItems = true;
|
|
736
|
+
setTimeout(function () {
|
|
737
|
+
_this.checkSpinnerWorkItems();
|
|
738
|
+
});
|
|
739
|
+
}
|
|
740
|
+
};
|
|
741
|
+
DialogService.prototype.removeSpinnerWorkItem = function () {
|
|
742
|
+
var _this = this;
|
|
743
|
+
this.spinnerWorkItemCount--;
|
|
744
|
+
if (this.spinnerWorkItemCount < 0) {
|
|
745
|
+
this.spinnerWorkItemCount = 0;
|
|
746
|
+
}
|
|
747
|
+
if (!this.checkingSpinnerWorkItems) {
|
|
748
|
+
this.checkingSpinnerWorkItems = true;
|
|
749
|
+
setTimeout(function () {
|
|
750
|
+
_this.checkSpinnerWorkItems();
|
|
751
|
+
});
|
|
752
|
+
}
|
|
753
|
+
};
|
|
754
|
+
DialogService.prototype.checkSpinnerWorkItems = function () {
|
|
755
|
+
this.checkingSpinnerWorkItems = false;
|
|
756
|
+
if (this.spinnerWorkItemCount) {
|
|
757
|
+
if (!this._spinnerDialogIsOpen) {
|
|
758
|
+
this.startDefaultSpinnerDialog();
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
else if (this._spinnerDialogIsOpen) {
|
|
762
|
+
this.stopAllSpinnerDialogs();
|
|
763
|
+
}
|
|
764
|
+
};
|
|
765
|
+
DialogService.prototype.genericDialogContainer = function (dialogContent, title, icon, config, actionConfig) {
|
|
766
|
+
var configuration = null;
|
|
767
|
+
if (!config) {
|
|
768
|
+
configuration = new MatDialogConfig();
|
|
769
|
+
}
|
|
770
|
+
else {
|
|
771
|
+
configuration = config;
|
|
772
|
+
}
|
|
773
|
+
configuration.data = configuration.data ? configuration.data : {};
|
|
774
|
+
configuration.data.dialogContent = dialogContent;
|
|
775
|
+
configuration.data.title = title;
|
|
776
|
+
if (icon) {
|
|
777
|
+
configuration.data.icon = icon;
|
|
778
|
+
}
|
|
779
|
+
if (actionConfig) {
|
|
780
|
+
configuration.data.actionConfig = actionConfig;
|
|
781
|
+
}
|
|
782
|
+
configuration.panelClass = ['mx-sized-dialog', 'no-padding'];
|
|
783
|
+
configuration.disableClose = true;
|
|
784
|
+
configuration.hasBackdrop = true;
|
|
785
|
+
var dialogRef = this.dialog.open(GenericContainerDialogComponent, configuration);
|
|
786
|
+
return dialogRef.afterClosed();
|
|
787
|
+
};
|
|
788
|
+
DialogService.prototype.openDialog = function (message, title, type, icon, config) {
|
|
789
|
+
var configuration = null;
|
|
790
|
+
if (!config) {
|
|
791
|
+
configuration = new MatDialogConfig();
|
|
792
|
+
}
|
|
793
|
+
else {
|
|
794
|
+
configuration = config;
|
|
795
|
+
}
|
|
796
|
+
configuration.data = configuration.data ? configuration.data : {};
|
|
797
|
+
configuration.data.message = message;
|
|
798
|
+
configuration.data.title = title ? title : '';
|
|
799
|
+
configuration.data.icon = icon ? icon : '';
|
|
800
|
+
configuration.data.dialogType = type ? type : '';
|
|
801
|
+
configuration.maxWidth = configuration.maxWidth ? configuration.maxWidth : '80vw';
|
|
802
|
+
configuration.maxHeight = configuration.maxHeight ? configuration.maxHeight : '80vh';
|
|
803
|
+
configuration.minWidth = configuration.minWidth ? configuration.minWidth : '30em';
|
|
804
|
+
configuration.panelClass = 'no-padding';
|
|
805
|
+
configuration.disableClose = true;
|
|
806
|
+
configuration.autoFocus = false;
|
|
807
|
+
configuration.hasBackdrop = false;
|
|
808
|
+
var dialogRef;
|
|
809
|
+
dialogRef = this.dialog.open(AlertDialogComponent, configuration);
|
|
810
|
+
return dialogRef.afterClosed();
|
|
811
|
+
};
|
|
812
|
+
DialogService.ɵfac = ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DialogService, deps: [{ token: MatDialog }], target: ɵɵFactoryTarget.Injectable });
|
|
813
|
+
DialogService.ɵprov = ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DialogService });
|
|
814
|
+
return DialogService;
|
|
815
|
+
}());
|
|
816
|
+
ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DialogService, decorators: [{
|
|
817
|
+
type: Injectable
|
|
818
|
+
}], ctorParameters: function () { return [{ type: MatDialog }]; } });
|
|
819
|
+
|
|
820
|
+
var SaveFooterComponent = /** @class */ (function () {
|
|
821
|
+
function SaveFooterComponent(dialogService) {
|
|
822
|
+
this.dialogService = dialogService;
|
|
823
|
+
this.actionType = ActionType.PRIMARY;
|
|
824
|
+
this.message = 'Your changes have not been saved';
|
|
825
|
+
this.name = 'Save';
|
|
826
|
+
this.disableSave = false;
|
|
827
|
+
this.saveClicked = new EventEmitter();
|
|
828
|
+
this.type = ActionType;
|
|
829
|
+
}
|
|
830
|
+
Object.defineProperty(SaveFooterComponent.prototype, "dirty", {
|
|
831
|
+
get: function () {
|
|
832
|
+
return this._dirty;
|
|
833
|
+
},
|
|
834
|
+
set: function (data) {
|
|
835
|
+
if (data) {
|
|
836
|
+
this._dirty = data;
|
|
837
|
+
}
|
|
838
|
+
else {
|
|
839
|
+
this._dirty = false;
|
|
840
|
+
}
|
|
841
|
+
},
|
|
842
|
+
enumerable: false,
|
|
843
|
+
configurable: true
|
|
844
|
+
});
|
|
845
|
+
Object.defineProperty(SaveFooterComponent.prototype, "showSpinner", {
|
|
846
|
+
set: function (showSpinner) {
|
|
847
|
+
var _this = this;
|
|
848
|
+
setTimeout(function () {
|
|
849
|
+
if (showSpinner) {
|
|
850
|
+
_this.dialogService.startDefaultSpinnerDialog();
|
|
851
|
+
}
|
|
852
|
+
else {
|
|
853
|
+
_this.dialogService.stopAllSpinnerDialogs();
|
|
854
|
+
}
|
|
855
|
+
});
|
|
856
|
+
},
|
|
857
|
+
enumerable: false,
|
|
858
|
+
configurable: true
|
|
859
|
+
});
|
|
860
|
+
SaveFooterComponent.prototype.ngOnInit = function () {
|
|
861
|
+
// console.log(this.disableSave);
|
|
862
|
+
};
|
|
863
|
+
SaveFooterComponent.prototype.notifySave = function () {
|
|
864
|
+
this.saveClicked.emit();
|
|
865
|
+
};
|
|
866
|
+
SaveFooterComponent.prototype.ngOnDestroy = function () {
|
|
867
|
+
this.saveClicked.unsubscribe();
|
|
868
|
+
};
|
|
869
|
+
SaveFooterComponent.ɵfac = ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SaveFooterComponent, deps: [{ token: DialogService }], target: ɵɵFactoryTarget.Component });
|
|
870
|
+
SaveFooterComponent.ɵcmp = ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: SaveFooterComponent, selector: "hci-save-footer", inputs: { actionType: "actionType", icon: "icon", message: "message", name: "name", dirty: "dirty", showSpinner: "showSpinner", disableSave: "disableSave" }, outputs: { saveClicked: "saveClicked" }, ngImport: i0, template: "\n <div class=\"full-height full-width\" style=\"margin-bottom: 8px;\">\n <div class=\"d-flex flex-row align-items-center right-align padded\">\n <div *ngIf=\"dirty\" class=\"warning-background padded\">\n {{ message }}\n </div>\n <div class=\"major-left-right-margin\">\n <button mat-raised-button [disabled]=\"disableSave\"\n [color]=\"actionType\" (click)=\"notifySave()\"\n [ngClass]=\"{'primary-action': actionType === type.PRIMARY,\n 'secondary-action': actionType === type.SECONDARY && !disableSave }\">\n <img *ngIf=\"icon\" [src]=\"icon\" alt=\"\">\n {{ name }}\n </button>\n </div>\n </div>\n </div>\n ", isInline: true, styles: ["\n .primary-action{\n background-color: #0077B3FF;\n font-weight: bolder;\n color: white;\n }\n .secondary-action{\n background-color: #DEF4FFFF;\n font-weight: bolder;\n color: #0077B3FF;\n border: #0077B3FF solid 1px;\n }\n\n .major-left-right-margin {\n margin-left: 0.5em;\n margin-right: 0.5em;\n }\n\n .right-align {\n text-align: right;\n justify-content: flex-end;\n }\n\n\n .warning-background { background:#feec89; }\n\n "], components: [{ type: MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
871
|
+
return SaveFooterComponent;
|
|
872
|
+
}());
|
|
873
|
+
ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: SaveFooterComponent, decorators: [{
|
|
874
|
+
type: Component,
|
|
875
|
+
args: [{
|
|
876
|
+
selector: 'hci-save-footer',
|
|
877
|
+
template: "\n <div class=\"full-height full-width\" style=\"margin-bottom: 8px;\">\n <div class=\"d-flex flex-row align-items-center right-align padded\">\n <div *ngIf=\"dirty\" class=\"warning-background padded\">\n {{ message }}\n </div>\n <div class=\"major-left-right-margin\">\n <button mat-raised-button [disabled]=\"disableSave\"\n [color]=\"actionType\" (click)=\"notifySave()\"\n [ngClass]=\"{'primary-action': actionType === type.PRIMARY,\n 'secondary-action': actionType === type.SECONDARY && !disableSave }\">\n <img *ngIf=\"icon\" [src]=\"icon\" alt=\"\">\n {{ name }}\n </button>\n </div>\n </div>\n </div>\n ",
|
|
878
|
+
styles: ["\n .primary-action{\n background-color: #0077B3FF;\n font-weight: bolder;\n color: white;\n }\n .secondary-action{\n background-color: #DEF4FFFF;\n font-weight: bolder;\n color: #0077B3FF;\n border: #0077B3FF solid 1px;\n }\n\n .major-left-right-margin {\n margin-left: 0.5em;\n margin-right: 0.5em;\n }\n\n .right-align {\n text-align: right;\n justify-content: flex-end;\n }\n\n\n .warning-background { background:#feec89; }\n\n "]
|
|
879
|
+
}]
|
|
880
|
+
}], ctorParameters: function () { return [{ type: DialogService }]; }, propDecorators: { actionType: [{
|
|
881
|
+
type: Input
|
|
882
|
+
}], icon: [{
|
|
883
|
+
type: Input
|
|
884
|
+
}], message: [{
|
|
885
|
+
type: Input
|
|
886
|
+
}], name: [{
|
|
887
|
+
type: Input
|
|
888
|
+
}], dirty: [{
|
|
889
|
+
type: Input
|
|
890
|
+
}], showSpinner: [{
|
|
891
|
+
type: Input
|
|
892
|
+
}], disableSave: [{
|
|
893
|
+
type: Input
|
|
894
|
+
}], saveClicked: [{
|
|
895
|
+
type: Output
|
|
896
|
+
}] } });
|
|
897
|
+
|
|
898
|
+
/*
|
|
899
|
+
* Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary
|
|
900
|
+
*/
|
|
901
|
+
// import {RouterModule} from "@angular/router";
|
|
902
|
+
// import {MatButtonToggleModule} from "@angular/material/button-toggle";
|
|
903
|
+
// import {MatInputModule} from "@angular/material/input";
|
|
904
|
+
// import {MatIconModule} from "@angular/material/icon";
|
|
905
|
+
// import {TreeModule} from "@circlon/angular-tree-component";
|
|
906
|
+
// import {MatDatepickerModule} from "@angular/material/datepicker";
|
|
907
|
+
// import {MatSelectModule} from "@angular/material/select";
|
|
908
|
+
// import {NgbModule, NgbNavModule} from "@ng-bootstrap/ng-bootstrap";
|
|
909
|
+
// import {MiscModule} from "@huntsman-cancer-institute/misc";
|
|
910
|
+
// import { MatNativeDateModule } from "@angular/material/core";
|
|
911
|
+
// import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
912
|
+
/**
|
|
913
|
+
* The main @huntsman-cancer-institute/dialog module. The module exports all components that an implementation might use
|
|
914
|
+
* and the forRoot() provides a global service for an implementing application.
|
|
915
|
+
*
|
|
916
|
+
* @since 1.0.0
|
|
917
|
+
*/
|
|
918
|
+
var DialogModule = /** @class */ (function () {
|
|
919
|
+
function DialogModule() {
|
|
920
|
+
}
|
|
921
|
+
DialogModule.forRoot = function () {
|
|
922
|
+
return {
|
|
923
|
+
providers: [
|
|
924
|
+
DialogService
|
|
925
|
+
],
|
|
926
|
+
ngModule: DialogModule
|
|
927
|
+
};
|
|
928
|
+
};
|
|
929
|
+
DialogModule.ɵfac = ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DialogModule, deps: [], target: ɵɵFactoryTarget.NgModule });
|
|
930
|
+
DialogModule.ɵmod = ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DialogModule, declarations: [AlertDialogComponent,
|
|
931
|
+
ConfirmDialogComponent,
|
|
932
|
+
CustomDialogComponent,
|
|
933
|
+
GenericContainerDialogComponent,
|
|
934
|
+
SaveFooterComponent,
|
|
935
|
+
SpinnerDialogComponent], imports: [CommonModule,
|
|
936
|
+
FormsModule,
|
|
937
|
+
DynamicModule,
|
|
938
|
+
MatButtonModule,
|
|
939
|
+
MatDialogModule,
|
|
940
|
+
MatExpansionModule,
|
|
941
|
+
MatProgressSpinnerModule
|
|
942
|
+
// RouterModule,
|
|
943
|
+
// MiscModule,
|
|
944
|
+
// NgbModule,
|
|
945
|
+
// MatButtonToggleModule,
|
|
946
|
+
// MatInputModule,
|
|
947
|
+
// MatIconModule,
|
|
948
|
+
// MatDatepickerModule,
|
|
949
|
+
// MatNativeDateModule,
|
|
950
|
+
// MatCheckboxModule,
|
|
951
|
+
// MatRadioModule,
|
|
952
|
+
// MatSelectModule,
|
|
953
|
+
// TreeModule,
|
|
954
|
+
// NgbNavModule
|
|
955
|
+
], exports: [AlertDialogComponent,
|
|
956
|
+
ConfirmDialogComponent,
|
|
957
|
+
CustomDialogComponent,
|
|
958
|
+
GenericContainerDialogComponent,
|
|
959
|
+
SaveFooterComponent,
|
|
960
|
+
SpinnerDialogComponent] });
|
|
961
|
+
DialogModule.ɵinj = ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DialogModule, providers: [
|
|
962
|
+
// MatDatepickerModule,
|
|
963
|
+
], imports: [[
|
|
964
|
+
CommonModule,
|
|
965
|
+
FormsModule,
|
|
966
|
+
DynamicModule,
|
|
967
|
+
MatButtonModule,
|
|
968
|
+
MatDialogModule,
|
|
969
|
+
MatExpansionModule,
|
|
970
|
+
MatProgressSpinnerModule
|
|
971
|
+
// RouterModule,
|
|
972
|
+
// MiscModule,
|
|
973
|
+
// NgbModule,
|
|
974
|
+
// MatButtonToggleModule,
|
|
975
|
+
// MatInputModule,
|
|
976
|
+
// MatIconModule,
|
|
977
|
+
// MatDatepickerModule,
|
|
978
|
+
// MatNativeDateModule,
|
|
979
|
+
// MatCheckboxModule,
|
|
980
|
+
// MatRadioModule,
|
|
981
|
+
// MatSelectModule,
|
|
982
|
+
// TreeModule,
|
|
983
|
+
// NgbNavModule
|
|
984
|
+
]] });
|
|
985
|
+
return DialogModule;
|
|
986
|
+
}());
|
|
987
|
+
ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: DialogModule, decorators: [{
|
|
988
|
+
type: NgModule,
|
|
989
|
+
args: [{
|
|
990
|
+
imports: [
|
|
991
|
+
CommonModule,
|
|
992
|
+
FormsModule,
|
|
993
|
+
DynamicModule,
|
|
994
|
+
MatButtonModule,
|
|
995
|
+
MatDialogModule,
|
|
996
|
+
MatExpansionModule,
|
|
997
|
+
MatProgressSpinnerModule
|
|
998
|
+
// RouterModule,
|
|
999
|
+
// MiscModule,
|
|
1000
|
+
// NgbModule,
|
|
1001
|
+
// MatButtonToggleModule,
|
|
1002
|
+
// MatInputModule,
|
|
1003
|
+
// MatIconModule,
|
|
1004
|
+
// MatDatepickerModule,
|
|
1005
|
+
// MatNativeDateModule,
|
|
1006
|
+
// MatCheckboxModule,
|
|
1007
|
+
// MatRadioModule,
|
|
1008
|
+
// MatSelectModule,
|
|
1009
|
+
// TreeModule,
|
|
1010
|
+
// NgbNavModule
|
|
1011
|
+
],
|
|
1012
|
+
providers: [
|
|
1013
|
+
// MatDatepickerModule,
|
|
1014
|
+
],
|
|
1015
|
+
declarations: [
|
|
1016
|
+
AlertDialogComponent,
|
|
1017
|
+
ConfirmDialogComponent,
|
|
1018
|
+
CustomDialogComponent,
|
|
1019
|
+
GenericContainerDialogComponent,
|
|
1020
|
+
SaveFooterComponent,
|
|
1021
|
+
SpinnerDialogComponent
|
|
1022
|
+
],
|
|
1023
|
+
entryComponents: [
|
|
1024
|
+
AlertDialogComponent,
|
|
1025
|
+
ConfirmDialogComponent,
|
|
1026
|
+
CustomDialogComponent,
|
|
1027
|
+
GenericContainerDialogComponent,
|
|
1028
|
+
SaveFooterComponent,
|
|
1029
|
+
SpinnerDialogComponent
|
|
1030
|
+
],
|
|
1031
|
+
exports: [
|
|
1032
|
+
AlertDialogComponent,
|
|
1033
|
+
ConfirmDialogComponent,
|
|
1034
|
+
CustomDialogComponent,
|
|
1035
|
+
GenericContainerDialogComponent,
|
|
1036
|
+
SaveFooterComponent,
|
|
1037
|
+
SpinnerDialogComponent
|
|
1038
|
+
]
|
|
1039
|
+
}]
|
|
1040
|
+
}] });
|
|
1041
|
+
|
|
1042
|
+
/**
|
|
1043
|
+
* Generated bundle index. Do not edit.
|
|
1044
|
+
*/
|
|
1045
|
+
|
|
1046
|
+
export { ActionType, AlertDialogComponent, BaseGenericContainerDialog, ConfirmDialogComponent, ConfirmType, CustomDialogComponent, DialogModule, DialogService, DialogType, GenericContainerDialogComponent, SaveFooterComponent, SpinnerDialogComponent };
|
|
1047
|
+
//# sourceMappingURL=huntsman-cancer-institute-dialog.js.map
|