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