turbogui-angular 20.5.0 → 20.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -711,6 +711,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImpor
|
|
|
711
711
|
args: [MAT_DIALOG_DATA]
|
|
712
712
|
}] }] });
|
|
713
713
|
|
|
714
|
+
/**
|
|
715
|
+
* TurboGUI is A library that helps with the most common and generic UI elements and functionalities
|
|
716
|
+
*
|
|
717
|
+
* Website : -> http://www.turbogui.org
|
|
718
|
+
* License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
|
|
719
|
+
* License Url : -> http://www.apache.org/licenses/LICENSE-2.0
|
|
720
|
+
* CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
|
|
721
|
+
*/
|
|
722
|
+
/**
|
|
723
|
+
* A dialog component with a single option button, to be used with dialog service
|
|
724
|
+
*/
|
|
725
|
+
class DialogSingleOptionComponent extends DialogBaseComponent {
|
|
726
|
+
static { this.DIALOG_CLASS_NAME = 'DialogSingleOptionComponent'; }
|
|
727
|
+
constructor(elementRef, dialogRef, data) {
|
|
728
|
+
super(elementRef, dialogRef);
|
|
729
|
+
this.elementRef = elementRef;
|
|
730
|
+
this.dialogRef = dialogRef;
|
|
731
|
+
this.data = data;
|
|
732
|
+
if (data.texts.length < 1) {
|
|
733
|
+
throw new Error('DialogSingleOptionComponent expects 2 texts: The title and optionally a description');
|
|
734
|
+
}
|
|
735
|
+
if (data.options.length !== 1) {
|
|
736
|
+
throw new Error('DialogSingleOptionComponent expects only one option');
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: DialogSingleOptionComponent, deps: [{ token: i0.ElementRef }, { token: i1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
740
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: DialogSingleOptionComponent, isStandalone: true, selector: "tg-dialog-single-option", providers: [], usesInheritance: true, ngImport: i0, template: "<h3>\r\n {{data.texts[0]}}\r\n</h3>\r\n\r\n<p *ngIf=\"data.texts.length > 1\">\r\n {{data.texts[1]}}\r\n</p>\r\n\r\n<button mat-raised-button color=\"primary\"\r\n (click)=\"closeDialog(0)\">\r\n \r\n {{data.options[0]}}\r\n \r\n</button>", styles: [":host{min-height:300px}h3{margin-bottom:25px}p{margin-bottom:52px}button{float:right}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }] }); }
|
|
741
|
+
}
|
|
742
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: DialogSingleOptionComponent, decorators: [{
|
|
743
|
+
type: Component,
|
|
744
|
+
args: [{ selector: 'tg-dialog-single-option', imports: [CommonModule, MatButtonModule], providers: [], template: "<h3>\r\n {{data.texts[0]}}\r\n</h3>\r\n\r\n<p *ngIf=\"data.texts.length > 1\">\r\n {{data.texts[1]}}\r\n</p>\r\n\r\n<button mat-raised-button color=\"primary\"\r\n (click)=\"closeDialog(0)\">\r\n \r\n {{data.options[0]}}\r\n \r\n</button>", styles: [":host{min-height:300px}h3{margin-bottom:25px}p{margin-bottom:52px}button{float:right}\n"] }]
|
|
745
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.MatDialogRef }, { type: undefined, decorators: [{
|
|
746
|
+
type: Inject,
|
|
747
|
+
args: [MAT_DIALOG_DATA]
|
|
748
|
+
}] }] });
|
|
749
|
+
|
|
714
750
|
/**
|
|
715
751
|
* TurboGUI is A library that helps with the most common and generic UI elements and functionalities
|
|
716
752
|
*
|
|
@@ -1062,8 +1098,8 @@ class DialogService extends SingletoneStrictClass {
|
|
|
1062
1098
|
id: properties.id ?? undefined,
|
|
1063
1099
|
data: properties.url,
|
|
1064
1100
|
texts: properties.title ? [properties.title] : undefined,
|
|
1065
|
-
width: properties.width ?? "
|
|
1066
|
-
maxWidth: properties.maxWidth ?? "
|
|
1101
|
+
width: properties.width ?? "85vw",
|
|
1102
|
+
maxWidth: properties.maxWidth ?? "1200px",
|
|
1067
1103
|
height: properties.height ?? "98vh",
|
|
1068
1104
|
maxHeight: properties.maxHeight ?? "3000px",
|
|
1069
1105
|
modal: properties.modal ?? false
|
|
@@ -1095,8 +1131,8 @@ class DialogService extends SingletoneStrictClass {
|
|
|
1095
1131
|
id: properties.id ?? undefined,
|
|
1096
1132
|
data: { blob: properties.blob, mimeType: 'application/pdf' },
|
|
1097
1133
|
texts: properties.title ? [properties.title] : undefined,
|
|
1098
|
-
width: properties.width ?? "
|
|
1099
|
-
maxWidth: properties.maxWidth ?? "
|
|
1134
|
+
width: properties.width ?? "85vw",
|
|
1135
|
+
maxWidth: properties.maxWidth ?? "1200px",
|
|
1100
1136
|
height: properties.height ?? "98vh",
|
|
1101
1137
|
maxHeight: properties.maxHeight ?? "3000px",
|
|
1102
1138
|
modal: properties.modal ?? false
|
|
@@ -1150,7 +1186,8 @@ class DialogService extends SingletoneStrictClass {
|
|
|
1150
1186
|
* - height: see addDialog() docs
|
|
1151
1187
|
* - maxHeight: see addDialog() docs
|
|
1152
1188
|
* - modal: see addDialog() docs
|
|
1153
|
-
* -
|
|
1189
|
+
* - dialogClass: A custom component class to use instead of the default DialogErrorComponent.
|
|
1190
|
+
* This custom class must extend DialogErrorComponent
|
|
1154
1191
|
*
|
|
1155
1192
|
* @returns A Promise that resolves once the user selects the button with the option caption
|
|
1156
1193
|
*/
|
|
@@ -1160,7 +1197,7 @@ class DialogService extends SingletoneStrictClass {
|
|
|
1160
1197
|
if (properties.description && properties.description !== undefined) {
|
|
1161
1198
|
texts.push(properties.description);
|
|
1162
1199
|
}
|
|
1163
|
-
await this.addDialog(properties.
|
|
1200
|
+
await this.addDialog(properties.dialogClass ?? DialogErrorComponent, {
|
|
1164
1201
|
id: properties.id ?? undefined,
|
|
1165
1202
|
width: properties.width ?? "70%",
|
|
1166
1203
|
maxWidth: properties.maxWidth ?? "500px",
|
|
@@ -1173,6 +1210,30 @@ class DialogService extends SingletoneStrictClass {
|
|
|
1173
1210
|
}
|
|
1174
1211
|
return null;
|
|
1175
1212
|
}
|
|
1213
|
+
/**
|
|
1214
|
+
* Show a dialog with a message and a single option button to close it.
|
|
1215
|
+
*
|
|
1216
|
+
* This method is a shortcut for addDialog() method using DialogSingleOptionComponent as the dialog component class
|
|
1217
|
+
*
|
|
1218
|
+
* @param properties An object containing the different visual and textual options that this dialog allows:
|
|
1219
|
+
* - title (mandatory): The dialog title
|
|
1220
|
+
* - option (mandatory): The text to place on the single option button
|
|
1221
|
+
* - description: An optional description text to show below the title
|
|
1222
|
+
* - id: see addDialog() docs
|
|
1223
|
+
* - width: see addDialog() docs
|
|
1224
|
+
* - maxWidth: see addDialog() docs
|
|
1225
|
+
* - height: see addDialog() docs
|
|
1226
|
+
* - maxHeight: see addDialog() docs
|
|
1227
|
+
* - modal: see addDialog() docs
|
|
1228
|
+
* - dialogClass: A custom component class to use instead of the default DialogSingleOptionComponent.
|
|
1229
|
+
* This custom class must extend DialogSingleOptionComponent
|
|
1230
|
+
*
|
|
1231
|
+
* @returns A Promise that resolves once the user selects the button with the option caption
|
|
1232
|
+
*/
|
|
1233
|
+
async addMessageDialog(properties) {
|
|
1234
|
+
properties.dialogClass ??= DialogSingleOptionComponent;
|
|
1235
|
+
return this.addErrorDialog(properties);
|
|
1236
|
+
}
|
|
1176
1237
|
/**
|
|
1177
1238
|
* Force the removal of all the dialogs that are currently visible.
|
|
1178
1239
|
*
|
|
@@ -2512,42 +2573,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImpor
|
|
|
2512
2573
|
}]
|
|
2513
2574
|
}] });
|
|
2514
2575
|
|
|
2515
|
-
/**
|
|
2516
|
-
* TurboGUI is A library that helps with the most common and generic UI elements and functionalities
|
|
2517
|
-
*
|
|
2518
|
-
* Website : -> http://www.turbogui.org
|
|
2519
|
-
* License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
|
|
2520
|
-
* License Url : -> http://www.apache.org/licenses/LICENSE-2.0
|
|
2521
|
-
* CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
|
|
2522
|
-
*/
|
|
2523
|
-
/**
|
|
2524
|
-
* A dialog component with a single option button, to be used with dialog service
|
|
2525
|
-
*/
|
|
2526
|
-
class DialogSingleOptionComponent extends DialogBaseComponent {
|
|
2527
|
-
static { this.DIALOG_CLASS_NAME = 'DialogSingleOptionComponent'; }
|
|
2528
|
-
constructor(elementRef, dialogRef, data) {
|
|
2529
|
-
super(elementRef, dialogRef);
|
|
2530
|
-
this.elementRef = elementRef;
|
|
2531
|
-
this.dialogRef = dialogRef;
|
|
2532
|
-
this.data = data;
|
|
2533
|
-
if (data.texts.length < 1) {
|
|
2534
|
-
throw new Error('DialogSingleOptionComponent expects 2 texts: The title and optionally a description');
|
|
2535
|
-
}
|
|
2536
|
-
if (data.options.length !== 1) {
|
|
2537
|
-
throw new Error('DialogSingleOptionComponent expects only one option');
|
|
2538
|
-
}
|
|
2539
|
-
}
|
|
2540
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: DialogSingleOptionComponent, deps: [{ token: i0.ElementRef }, { token: i1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2541
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: DialogSingleOptionComponent, isStandalone: true, selector: "tg-dialog-single-option", providers: [], usesInheritance: true, ngImport: i0, template: "<h3>\r\n {{data.texts[0]}}\r\n</h3>\r\n\r\n<p *ngIf=\"data.texts.length > 1\">\r\n {{data.texts[1]}}\r\n</p>\r\n\r\n<button mat-raised-button color=\"primary\"\r\n (click)=\"closeDialog(0)\">\r\n \r\n {{data.options[0]}}\r\n \r\n</button>", styles: [":host{min-height:300px}h3{margin-bottom:25px}p{margin-bottom:52px}button{float:right}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }] }); }
|
|
2542
|
-
}
|
|
2543
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: DialogSingleOptionComponent, decorators: [{
|
|
2544
|
-
type: Component,
|
|
2545
|
-
args: [{ selector: 'tg-dialog-single-option', imports: [CommonModule, MatButtonModule], providers: [], template: "<h3>\r\n {{data.texts[0]}}\r\n</h3>\r\n\r\n<p *ngIf=\"data.texts.length > 1\">\r\n {{data.texts[1]}}\r\n</p>\r\n\r\n<button mat-raised-button color=\"primary\"\r\n (click)=\"closeDialog(0)\">\r\n \r\n {{data.options[0]}}\r\n \r\n</button>", styles: [":host{min-height:300px}h3{margin-bottom:25px}p{margin-bottom:52px}button{float:right}\n"] }]
|
|
2546
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.MatDialogRef }, { type: undefined, decorators: [{
|
|
2547
|
-
type: Inject,
|
|
2548
|
-
args: [MAT_DIALOG_DATA]
|
|
2549
|
-
}] }] });
|
|
2550
|
-
|
|
2551
2576
|
/**
|
|
2552
2577
|
* TurboGUI is A library that helps with the most common and generic UI elements and functionalities
|
|
2553
2578
|
*
|