turbogui-angular 11.0.2 → 12.0.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.
Files changed (73) hide show
  1. package/esm2022/main/controller/browser.service.mjs +48 -48
  2. package/esm2022/main/controller/dialog.service.mjs +324 -324
  3. package/esm2022/main/controller/globalerror.service.mjs +68 -68
  4. package/esm2022/main/controller/http.service.mjs +70 -70
  5. package/esm2022/main/controller/httpservice/HTTPServiceGetRequest.mjs +14 -14
  6. package/esm2022/main/controller/httpservice/HTTPServicePostRequest.mjs +14 -14
  7. package/esm2022/main/controller/localization.service.mjs +22 -22
  8. package/esm2022/main/controller/notification.service.mjs +56 -56
  9. package/esm2022/main/controller/user.service.mjs +124 -124
  10. package/esm2022/main/controller/views.service.mjs +113 -113
  11. package/esm2022/main/managers/DelayedMethodCallManager.mjs +69 -69
  12. package/esm2022/main/model/classes/GUINotification.mjs +31 -31
  13. package/esm2022/main/model/classes/View.mjs +33 -33
  14. package/esm2022/main/model/classes/ViewModel.mjs +13 -13
  15. package/esm2022/main/model/classes/ViewService.mjs +27 -27
  16. package/esm2022/main/model/modules/turbogui-angular.module.mjs +140 -140
  17. package/esm2022/main/view/animations/fade.animation.mjs +35 -35
  18. package/esm2022/main/view/components/busy-state-base/busy-state-base.component.mjs +38 -38
  19. package/esm2022/main/view/components/button-base/button-base.component.mjs +180 -180
  20. package/esm2022/main/view/components/button-container/button-container.component.mjs +34 -34
  21. package/esm2022/main/view/components/button-image/button-image.component.mjs +47 -47
  22. package/esm2022/main/view/components/dialog-base/dialog-base.component.mjs +13 -13
  23. package/esm2022/main/view/components/dialog-error/dialog-error.component.mjs +41 -41
  24. package/esm2022/main/view/components/dialog-multiple-option/dialog-multiple-option.component.mjs +38 -38
  25. package/esm2022/main/view/components/dialog-options-base/dialog-options-base.component.mjs +14 -14
  26. package/esm2022/main/view/components/dialog-single-option/dialog-single-option.component.mjs +41 -41
  27. package/esm2022/main/view/components/dialog-single-selection-list/dialog-single-selection-list.component.mjs +112 -112
  28. package/esm2022/main/view/components/dialog-two-option/dialog-two-option.component.mjs +42 -42
  29. package/esm2022/main/view/components/views-container/views-container.component.mjs +70 -70
  30. package/esm2022/main/view/directives/AutoFocusOnDisplayDirective.mjs +39 -39
  31. package/esm2022/main/view/directives/AutoSelectTextOnFocusDirective.mjs +39 -39
  32. package/esm2022/main/view/directives/ElementCreatedDirective.mjs +42 -42
  33. package/esm2022/main/view/directives/ElementDestroyedDirective.mjs +42 -42
  34. package/esm2022/public_api.mjs +43 -43
  35. package/esm2022/turbogui-angular.mjs +4 -4
  36. package/fesm2022/turbogui-angular.mjs +1862 -1862
  37. package/fesm2022/turbogui-angular.mjs.map +1 -1
  38. package/index.d.ts +5 -5
  39. package/main/controller/browser.service.d.ts +29 -29
  40. package/main/controller/dialog.service.d.ts +184 -184
  41. package/main/controller/globalerror.service.d.ts +54 -54
  42. package/main/controller/http.service.d.ts +37 -37
  43. package/main/controller/httpservice/HTTPServiceGetRequest.d.ts +14 -14
  44. package/main/controller/httpservice/HTTPServicePostRequest.d.ts +14 -14
  45. package/main/controller/localization.service.d.ts +9 -9
  46. package/main/controller/notification.service.d.ts +36 -36
  47. package/main/controller/user.service.d.ts +57 -57
  48. package/main/controller/views.service.d.ts +71 -71
  49. package/main/managers/DelayedMethodCallManager.d.ts +51 -51
  50. package/main/model/classes/GUINotification.d.ts +27 -27
  51. package/main/model/classes/View.d.ts +39 -39
  52. package/main/model/classes/ViewModel.d.ts +13 -13
  53. package/main/model/classes/ViewService.d.ts +26 -26
  54. package/main/model/modules/turbogui-angular.module.d.ts +28 -28
  55. package/main/view/animations/fade.animation.d.ts +16 -16
  56. package/main/view/components/busy-state-base/busy-state-base.component.d.ts +18 -18
  57. package/main/view/components/button-base/button-base.component.d.ts +94 -94
  58. package/main/view/components/button-container/button-container.component.d.ts +13 -13
  59. package/main/view/components/button-image/button-image.component.d.ts +31 -31
  60. package/main/view/components/dialog-base/dialog-base.component.d.ts +13 -13
  61. package/main/view/components/dialog-error/dialog-error.component.d.ts +13 -13
  62. package/main/view/components/dialog-multiple-option/dialog-multiple-option.component.d.ts +13 -13
  63. package/main/view/components/dialog-options-base/dialog-options-base.component.d.ts +14 -14
  64. package/main/view/components/dialog-single-option/dialog-single-option.component.d.ts +13 -13
  65. package/main/view/components/dialog-single-selection-list/dialog-single-selection-list.component.d.ts +62 -62
  66. package/main/view/components/dialog-two-option/dialog-two-option.component.d.ts +14 -14
  67. package/main/view/components/views-container/views-container.component.d.ts +45 -45
  68. package/main/view/directives/AutoFocusOnDisplayDirective.d.ts +20 -20
  69. package/main/view/directives/AutoSelectTextOnFocusDirective.d.ts +19 -19
  70. package/main/view/directives/ElementCreatedDirective.d.ts +23 -23
  71. package/main/view/directives/ElementDestroyedDirective.d.ts +23 -23
  72. package/package.json +6 -6
  73. package/public_api.d.ts +40 -40
@@ -11,1930 +11,1930 @@ import { MatButtonModule } from '@angular/material/button';
11
11
  import * as i4 from '@angular/material/form-field';
12
12
  import { MatFormFieldModule } from '@angular/material/form-field';
13
13
  import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
14
- import { trigger, transition, style, animate } from '@angular/animations';
14
+ import { style, animate, transition, trigger } from '@angular/animations';
15
15
  import { ArrayUtils, NumericUtils, LocalizationManager, HTTPManager, StringUtils, HTTPManagerPostRequest, ConversionUtils, BrowserManager, HTTPManagerGetRequest } from 'turbocommons-ts';
16
16
  import { ComponentPortal, DomPortalOutlet } from '@angular/cdk/portal';
17
17
  import * as i3 from '@angular/common';
18
18
  import { Subject } from 'rxjs';
19
19
 
20
- /**
21
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
22
- *
23
- * Website : -> http://www.turbogui.org
24
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
25
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
26
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
27
- */
28
- /**
29
- * Fade animations
30
- */
31
- class FadeAnimationClass {
32
- /**
33
- * Get a custom trigger to create fade animations when components are added or removed from the application
34
- *
35
- * @param triggerName The name for the trigger we want to create
36
- * @param enter The time and easing that we want to use for the enter state
37
- * @param leave The time and easing that we want to use for the leave state
38
- */
39
- static getTrigger(triggerName, enter = '1s ease', leave = '0s ease') {
40
- return trigger(triggerName, [
41
- transition(':enter', [style({ opacity: 0 }), animate(enter)]),
42
- transition(':leave', [style({ opacity: 1 }), animate(leave, style({ opacity: 0 }))])
43
- ]);
44
- }
45
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FadeAnimationClass, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
46
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FadeAnimationClass }); }
47
- }
48
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FadeAnimationClass, decorators: [{
49
- type: Injectable
20
+ /**
21
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
22
+ *
23
+ * Website : -> http://www.turbogui.org
24
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
25
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
26
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
27
+ */
28
+ /**
29
+ * Fade animations
30
+ */
31
+ class FadeAnimationClass {
32
+ /**
33
+ * Get a custom trigger to create fade animations when components are added or removed from the application
34
+ *
35
+ * @param triggerName The name for the trigger we want to create
36
+ * @param enter The time and easing that we want to use for the enter state
37
+ * @param leave The time and easing that we want to use for the leave state
38
+ */
39
+ static getTrigger(triggerName, enter = '1s ease', leave = '0s ease') {
40
+ return trigger(triggerName, [
41
+ transition(':enter', [style({ opacity: 0 }), animate(enter)]),
42
+ transition(':leave', [style({ opacity: 1 }), animate(leave, style({ opacity: 0 }))])
43
+ ]);
44
+ }
45
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: FadeAnimationClass, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
46
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: FadeAnimationClass }); }
47
+ }
48
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: FadeAnimationClass, decorators: [{
49
+ type: Injectable
50
50
  }] });
51
51
 
52
- /**
53
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
54
- *
55
- * Website : -> http://www.turbogui.org
56
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
57
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
58
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
59
- */
60
- /**
61
- * This component is used by turboGUI angular library to show the busy state to the user.
62
- * It is used to block all the user input and progressively shows a busy cursor to notify that the application
63
- * is waiting for something.
64
- *
65
- * We can (should) override this component with our own one to adapt its visual appearance to our application.
66
- * We can then set dialogService.busyStateComponentClass to our component class at the application start to to
67
- * override the default one.
68
- */
69
- class BusyStateBaseComponent {
70
- constructor() {
71
- /**
72
- * This is used to attach the fade animation directly to this component so it fades in and out when created and removed from the app
73
- */
74
- this.busyStateBaseFade = true;
75
- }
76
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BusyStateBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
77
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: BusyStateBaseComponent, selector: "tg-busy-state-base", host: { properties: { "@busyStateBaseFade": "this.busyStateBaseFade" } }, ngImport: i0, template: "<div class=\"darkBg\">\r\n\r\n</div>\r\n\r\n<svg width=\"38\" height=\"38\" viewBox=\"0 0 38 38\" xmlns=\"http://www.w3.org/2000/svg\" stroke=\"#fff\">\r\n <g fill=\"none\" fill-rule=\"evenodd\">\r\n <g transform=\"translate(1 1)\" stroke-width=\"1\">\r\n <circle stroke-opacity=\".2\" cx=\"18\" cy=\"18\" r=\"18\"/>\r\n <path d=\"M36 18c0-9.94-8.06-18-18-18\">\r\n <animateTransform\r\n attributeName=\"transform\"\r\n type=\"rotate\"\r\n from=\"0 18 18\"\r\n to=\"360 18 18\"\r\n dur=\"1s\"\r\n repeatCount=\"indefinite\"/>\r\n </path>\r\n </g>\r\n </g>\r\n</svg>\r\n", styles: [":host{position:fixed;inset:0;display:flex;justify-content:center;align-items:center;z-index:999999999}.darkBg{position:absolute;cursor:progress;width:100%;height:100%;display:flex;justify-content:center;align-items:center;background-color:#00000096;animation-name:bgfadein;animation-duration:30s;animation-timing-function:ease}svg{z-index:5000;width:40%;height:40%;max-width:130px;max-height:130px;animation-name:loadingfadein;animation-duration:3s;animation-timing-function:ease-in}@keyframes loadingfadein{0%{opacity:0}25%{opacity:0}to{opacity:1}}@keyframes bgfadein{0%{opacity:0}4%{opacity:0}14%{opacity:.2}35%{opacity:.5}to{opacity:1}}\n"], animations: [FadeAnimationClass.getTrigger('busyStateBaseFade', '1s ease', '400ms ease')] }); }
78
- }
79
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BusyStateBaseComponent, decorators: [{
80
- type: Component,
81
- args: [{ selector: 'tg-busy-state-base', animations: [FadeAnimationClass.getTrigger('busyStateBaseFade', '1s ease', '400ms ease')], template: "<div class=\"darkBg\">\r\n\r\n</div>\r\n\r\n<svg width=\"38\" height=\"38\" viewBox=\"0 0 38 38\" xmlns=\"http://www.w3.org/2000/svg\" stroke=\"#fff\">\r\n <g fill=\"none\" fill-rule=\"evenodd\">\r\n <g transform=\"translate(1 1)\" stroke-width=\"1\">\r\n <circle stroke-opacity=\".2\" cx=\"18\" cy=\"18\" r=\"18\"/>\r\n <path d=\"M36 18c0-9.94-8.06-18-18-18\">\r\n <animateTransform\r\n attributeName=\"transform\"\r\n type=\"rotate\"\r\n from=\"0 18 18\"\r\n to=\"360 18 18\"\r\n dur=\"1s\"\r\n repeatCount=\"indefinite\"/>\r\n </path>\r\n </g>\r\n </g>\r\n</svg>\r\n", styles: [":host{position:fixed;inset:0;display:flex;justify-content:center;align-items:center;z-index:999999999}.darkBg{position:absolute;cursor:progress;width:100%;height:100%;display:flex;justify-content:center;align-items:center;background-color:#00000096;animation-name:bgfadein;animation-duration:30s;animation-timing-function:ease}svg{z-index:5000;width:40%;height:40%;max-width:130px;max-height:130px;animation-name:loadingfadein;animation-duration:3s;animation-timing-function:ease-in}@keyframes loadingfadein{0%{opacity:0}25%{opacity:0}to{opacity:1}}@keyframes bgfadein{0%{opacity:0}4%{opacity:0}14%{opacity:.2}35%{opacity:.5}to{opacity:1}}\n"] }]
82
- }], propDecorators: { busyStateBaseFade: [{
83
- type: HostBinding,
84
- args: ['@busyStateBaseFade']
52
+ /**
53
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
54
+ *
55
+ * Website : -> http://www.turbogui.org
56
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
57
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
58
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
59
+ */
60
+ /**
61
+ * This component is used by turboGUI angular library to show the busy state to the user.
62
+ * It is used to block all the user input and progressively shows a busy cursor to notify that the application
63
+ * is waiting for something.
64
+ *
65
+ * We can (should) override this component with our own one to adapt its visual appearance to our application.
66
+ * We can then set dialogService.busyStateComponentClass to our component class at the application start to to
67
+ * override the default one.
68
+ */
69
+ class BusyStateBaseComponent {
70
+ constructor() {
71
+ /**
72
+ * This is used to attach the fade animation directly to this component so it fades in and out when created and removed from the app
73
+ */
74
+ this.busyStateBaseFade = true;
75
+ }
76
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: BusyStateBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
77
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: BusyStateBaseComponent, selector: "tg-busy-state-base", host: { properties: { "@busyStateBaseFade": "this.busyStateBaseFade" } }, ngImport: i0, template: "<div class=\"darkBg\">\r\n\r\n</div>\r\n\r\n<svg width=\"38\" height=\"38\" viewBox=\"0 0 38 38\" xmlns=\"http://www.w3.org/2000/svg\" stroke=\"#fff\">\r\n <g fill=\"none\" fill-rule=\"evenodd\">\r\n <g transform=\"translate(1 1)\" stroke-width=\"1\">\r\n <circle stroke-opacity=\".2\" cx=\"18\" cy=\"18\" r=\"18\"/>\r\n <path d=\"M36 18c0-9.94-8.06-18-18-18\">\r\n <animateTransform\r\n attributeName=\"transform\"\r\n type=\"rotate\"\r\n from=\"0 18 18\"\r\n to=\"360 18 18\"\r\n dur=\"1s\"\r\n repeatCount=\"indefinite\"/>\r\n </path>\r\n </g>\r\n </g>\r\n</svg>\r\n", styles: [":host{position:fixed;inset:0;display:flex;justify-content:center;align-items:center;z-index:999999999}.darkBg{position:absolute;cursor:progress;width:100%;height:100%;display:flex;justify-content:center;align-items:center;background-color:#00000096;animation-name:bgfadein;animation-duration:30s;animation-timing-function:ease}svg{z-index:5000;width:40%;height:40%;max-width:130px;max-height:130px;animation-name:loadingfadein;animation-duration:3s;animation-timing-function:ease-in}@keyframes loadingfadein{0%{opacity:0}25%{opacity:0}to{opacity:1}}@keyframes bgfadein{0%{opacity:0}4%{opacity:0}14%{opacity:.2}35%{opacity:.5}to{opacity:1}}\n"], animations: [FadeAnimationClass.getTrigger('busyStateBaseFade', '1s ease', '400ms ease')] }); }
78
+ }
79
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: BusyStateBaseComponent, decorators: [{
80
+ type: Component,
81
+ args: [{ selector: 'tg-busy-state-base', animations: [FadeAnimationClass.getTrigger('busyStateBaseFade', '1s ease', '400ms ease')], template: "<div class=\"darkBg\">\r\n\r\n</div>\r\n\r\n<svg width=\"38\" height=\"38\" viewBox=\"0 0 38 38\" xmlns=\"http://www.w3.org/2000/svg\" stroke=\"#fff\">\r\n <g fill=\"none\" fill-rule=\"evenodd\">\r\n <g transform=\"translate(1 1)\" stroke-width=\"1\">\r\n <circle stroke-opacity=\".2\" cx=\"18\" cy=\"18\" r=\"18\"/>\r\n <path d=\"M36 18c0-9.94-8.06-18-18-18\">\r\n <animateTransform\r\n attributeName=\"transform\"\r\n type=\"rotate\"\r\n from=\"0 18 18\"\r\n to=\"360 18 18\"\r\n dur=\"1s\"\r\n repeatCount=\"indefinite\"/>\r\n </path>\r\n </g>\r\n </g>\r\n</svg>\r\n", styles: [":host{position:fixed;inset:0;display:flex;justify-content:center;align-items:center;z-index:999999999}.darkBg{position:absolute;cursor:progress;width:100%;height:100%;display:flex;justify-content:center;align-items:center;background-color:#00000096;animation-name:bgfadein;animation-duration:30s;animation-timing-function:ease}svg{z-index:5000;width:40%;height:40%;max-width:130px;max-height:130px;animation-name:loadingfadein;animation-duration:3s;animation-timing-function:ease-in}@keyframes loadingfadein{0%{opacity:0}25%{opacity:0}to{opacity:1}}@keyframes bgfadein{0%{opacity:0}4%{opacity:0}14%{opacity:.2}35%{opacity:.5}to{opacity:1}}\n"] }]
82
+ }], propDecorators: { busyStateBaseFade: [{
83
+ type: HostBinding,
84
+ args: ['@busyStateBaseFade']
85
85
  }] } });
86
86
 
87
- /**
88
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
89
- *
90
- * Website : -> http://www.turbogui.org
91
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
92
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
93
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
94
- */
95
- /**
96
- * Manages the application modal and non modal floating elements
97
- */
98
- class DialogService {
99
- constructor(rendererFactory, matSnackBar, matDialog, injector, applicationRef, componentFactoryResolver) {
100
- this.matSnackBar = matSnackBar;
101
- this.matDialog = matDialog;
102
- this.injector = injector;
103
- this.applicationRef = applicationRef;
104
- this.componentFactoryResolver = componentFactoryResolver;
105
- /**
106
- * Used to modify the busy state component that is shown by default by the addModalBusyState() method.
107
- *
108
- * @see this.addModalBusyState()
109
- */
110
- this.customBusyStateComponentClass = BusyStateBaseComponent;
111
- /**
112
- * Check public getter for docs
113
- */
114
- this._isEnabled = true;
115
- /**
116
- * Tells if the main application is currently showing a busy state that blocks all user interaction
117
- */
118
- this._isShowingBusyState = false;
119
- /**
120
- * A reference to the modal busy state component that is initialized only the first time it is called.
121
- *
122
- * (To append the busy state dynamically, we use the Portal concept from the angular material library)
123
- */
124
- this._componentPortal = null;
125
- /**
126
- * A reference to the modal busy state container where the component will be added
127
- */
128
- this._modalBusyStateHost = null;
129
- /**
130
- * Tells if the manager is currently showing a snackbar element or not
131
- */
132
- this._isShowingSnackBar = false;
133
- /**
134
- * Contains a list of the dialogs that are currently visible to the user.
135
- * Each item in this list is a hash that is computed when dialog is created to uniquely identify it.
136
- *
137
- * Empty list means no dialogs are currently visible
138
- */
139
- this._activeDialogs = [];
140
- /**
141
- * Contains a list with all the MatDialog instances that are currently visible to the user.
142
- * The list uses the same order as the list of _activeDialogs hash values
143
- */
144
- this._activeDialogInstances = [];
145
- /**
146
- * Method that is used to delete the window beforeunload event listener once not used anymore
147
- */
148
- this._windowBeforeUnloadUnListen = null;
149
- /**
150
- * Method that is used to delete the document keydown event listener once not used anymore
151
- */
152
- this._documentKeydownUnlisten = null;
153
- /**
154
- * Method that is used to delete the document mousedown event listener once not used anymore
155
- */
156
- this._documentMousedownUnlisten = null;
157
- /**
158
- * Method that is used to delete the document pointerdown event listener once not used anymore
159
- */
160
- this._documentPointerdownUnlisten = null;
161
- this._renderer = rendererFactory.createRenderer(null, null);
162
- }
163
- /**
164
- * Tells if this dialog service is enabled or not. If dialog service is disabled, none of it's features will work
165
- * This is used to block all dialog features normally when shutting down the application
166
- *
167
- * Use with caution. When this is set to false, dialog service stops working.
168
- */
169
- set isEnabled(v) {
170
- if (v === this._isEnabled) {
171
- return;
172
- }
173
- this._isEnabled = v;
174
- }
175
- /**
176
- * Enables a warning that will be shown to the user when he/she tries to close the application.
177
- * This warning will prompt the user to continue with the exit process or cancel it.
178
- * The specific texts of this message are a generic ones and cannot be changed.
179
- *
180
- * IMPORTANT: This method must be called after the main application has been initialized in order to work,
181
- * otherwise it will do nothing.
182
- */
183
- addCloseApplicationWarning() {
184
- if (this._windowBeforeUnloadUnListen === null) {
185
- this._windowBeforeUnloadUnListen = this._renderer.listen('window', 'beforeunload', (event) => event.returnValue = true);
186
- }
187
- }
188
- /**
189
- * Remove the close application warning message if previously assigned
190
- */
191
- removeCloseApplicationWarning() {
192
- if (this._windowBeforeUnloadUnListen !== null) {
193
- this._windowBeforeUnloadUnListen();
194
- this._windowBeforeUnloadUnListen = null;
195
- }
196
- }
197
- /**
198
- * Change the application visual appearance so the user perceives that the application is
199
- * currently busy. While modal busy state is enabled, no user input is possible neither via
200
- * keyboard, mouse or touch. Use this state when performing server requests or operations that
201
- * must block the user interaction with the application.
202
- *
203
- * Note: We can modify the busy state component that is shown by this method. To do it, we must
204
- * set this.customBusyStateComponentClass property with our own custom busy state component class. (We can do it at
205
- * our main application component constructor for example). Our custom component must extend the
206
- * BusyStateBaseComponent one to add its own visual appearance.
207
- *
208
- * @see this.customBusyStateComponentClass
209
- */
210
- addModalBusyState() {
211
- if (!this._isEnabled || this._isShowingBusyState) {
212
- return;
213
- }
214
- this._disableUserInteraction();
215
- // Dynamically create the busy state component reference if this is the first time
216
- if (this._componentPortal === null) {
217
- this._componentPortal = new ComponentPortal(this.customBusyStateComponentClass);
218
- // Create a PortalHost with document.body as its anchor element
219
- this._modalBusyStateHost = new DomPortalOutlet(document.body, this.componentFactoryResolver, this.applicationRef, this.injector);
220
- }
221
- this._modalBusyStateHost.attach(this._componentPortal);
222
- this._isShowingBusyState = true;
223
- }
224
- /**
225
- * Tells if the application is currently locked in a modal busy state (caused by an addModalBusyState() call)
226
- */
227
- get isShowingBusyState() {
228
- return this._isShowingBusyState;
229
- }
230
- /**
231
- * Remove the application busy state and restore it back to normal user interaction
232
- */
233
- removeModalBusyState() {
234
- if (!this._isEnabled || !this._isShowingBusyState) {
235
- return;
236
- }
237
- if (this._componentPortal !== null) {
238
- this._modalBusyStateHost.detach();
239
- }
240
- this._enableUserInteraction();
241
- this._isShowingBusyState = false;
242
- }
243
- /**
244
- * TODO - adapt from TS version
245
- */
246
- addToolTip() {
247
- // TODO - adapt from TS version
248
- }
249
- /**
250
- * Show a non modal snackbar notification to the user (Only one snack-bar can ever be opened at the same time).
251
- *
252
- * Snackbars inform users of a process that an app has performed or will perform. They appear temporarily, towards the bottom or top of the screen.
253
- * They shouldn’t interrupt the user experience, and they don’t require user input to disappear.
254
- *
255
- * @param config A MatSnackBarConfig instance with the customizations we want for this snackbar
256
- * @param message The message to show on the snackbar
257
- * @param action If not empty, the text to place on the snackbar confirmation button
258
- * @param actionCallback A method to execute once the user clicks into the action button.
259
- *
260
- * @return void
261
- */
262
- addSnackBar(config, message, action = '', actionCallback = null) {
263
- if (!this._isEnabled) {
264
- return;
265
- }
266
- if (this._isShowingSnackBar) {
267
- throw new Error('Trying to show a snackbar while another one is still visible');
268
- }
269
- this._isShowingSnackBar = true;
270
- const snackBarRef = this.matSnackBar.open(message, action === '' ? undefined : action, config);
271
- if (actionCallback !== null) {
272
- snackBarRef.onAction().subscribe(() => {
273
- actionCallback();
274
- });
275
- }
276
- }
277
- /**
278
- * Tells if the application is currently showing a snackbar or not
279
- */
280
- get isShowingSnackBar() {
281
- return this._isShowingSnackBar;
282
- }
283
- /**
284
- * Force the removal of the snack bar dialog if it exists.
285
- *
286
- * If no snackbar is currently visible, this method will do nothing
287
- */
288
- removeSnackBar() {
289
- if (!this._isEnabled || !this._isShowingSnackBar) {
290
- return;
291
- }
292
- this.matSnackBar.dismiss();
293
- this._isShowingSnackBar = false;
294
- }
295
- /**
296
- * Show a dialog with one or more options that can be used to close it. We can use any of the predefined dialog types that are bundled with
297
- * this library or extend DialogOptionsBaseComponent to create our own custom ones.
298
- *
299
- * @param width Specify the css value for the maximum width the dialog will have. As the dialog is responsive, the value will be automatically
300
- reduced if the available screen is not enough, and will reach the desired value otherwise. Note that height will be adapted to the contents
301
- of the dialog and cannot be specified here. We can set a pixels, % or any other css accepted value. For example: '400px', '50%', etc.
302
- * @param texts A list with strings containing the dialog texts, sorted by importance. When dialog has a title, this should
303
- * be placed first, subtitle second and so (Each dialog may accept different kind of texts).
304
- * @param options A list of strings that will be used as button captions for each one of the accepted dialog options
305
- * @param dialogComponentClass A class for a component that extends DialogOptionsBaseComponent, which will be the
306
- * dialog visual element that is shown to the user.
307
- * @param callback A function that will be called after the dialog is closed and will receive an object with the numeric index and value for
308
- * the option that's been selected by the user.
309
- * @param modal True (default) if selecting an option is mandatory to close the dialog, false if the dialog can be closed
310
- * by the user by clicking outside it
311
- */
312
- addDialog(width, texts, options, dialogComponentClass, callback = null, modal = true) {
313
- if (!this._isEnabled) {
314
- return;
315
- }
316
- // Generate a string to uniquely identify this dialog on the list of active dialogs
317
- const dialogHash = texts.join('') + options.join('') + dialogComponentClass.name;
318
- // identical dialogs won't be allowed at the same time
319
- if (this._activeDialogs.includes(dialogHash)) {
320
- return;
321
- }
322
- const dialogRef = this.matDialog.open(dialogComponentClass, {
323
- width: width,
324
- disableClose: modal,
325
- autoFocus: false,
326
- closeOnNavigation: !modal,
327
- data: { texts: texts, options: options }
328
- });
329
- this._activeDialogs.push(dialogHash);
330
- this._activeDialogInstances.push(dialogRef);
331
- dialogRef.beforeClosed().subscribe((selectedOptionIndex) => {
332
- this._activeDialogs = ArrayUtils.removeElement(this._activeDialogs, dialogHash);
333
- this._activeDialogInstances = ArrayUtils.removeElement(this._activeDialogInstances, dialogRef);
334
- if (!NumericUtils.isInteger(selectedOptionIndex)) {
335
- if (modal) {
336
- throw new Error(`dialogRef.close() expects int value`);
337
- }
338
- else {
339
- selectedOptionIndex = -1;
340
- }
341
- }
342
- if (callback !== null) {
343
- let selectedOption = { index: selectedOptionIndex, value: '' };
344
- if (selectedOptionIndex >= 0) {
345
- selectedOption.value = options[selectedOptionIndex];
346
- }
347
- callback(selectedOption);
348
- }
349
- });
350
- }
351
- /**
352
- * Force the removal of all the dialogs that are currently visible.
353
- *
354
- * If no dialogs are currently visible, this method will do nothing
355
- */
356
- removeAllDialogs() {
357
- if (!this._isEnabled) {
358
- return;
359
- }
360
- for (const dialogRef of this._activeDialogInstances) {
361
- dialogRef.close(-1);
362
- }
363
- this._activeDialogs = [];
364
- this._activeDialogInstances = [];
365
- }
366
- /**
367
- * Block all the user interactions with the application (keyboard, touch, mouse, ...)
368
- */
369
- _disableUserInteraction() {
370
- if (this._documentKeydownUnlisten === null) {
371
- this._documentKeydownUnlisten = this._renderer.listen('document', 'keydown', (event) => event.preventDefault());
372
- }
373
- if (this._documentMousedownUnlisten === null) {
374
- this._documentMousedownUnlisten = this._renderer.listen('document', 'mousedown', (event) => event.preventDefault());
375
- }
376
- if (this._documentPointerdownUnlisten === null) {
377
- this._documentPointerdownUnlisten = this._renderer.listen('document', 'pointerdown', (event) => event.preventDefault());
378
- }
379
- }
380
- /**
381
- * Restore the user interactions that were previously disabled with _disableUserInteraction method
382
- */
383
- _enableUserInteraction() {
384
- if (this._documentKeydownUnlisten !== null) {
385
- this._documentKeydownUnlisten();
386
- this._documentKeydownUnlisten = null;
387
- }
388
- if (this._documentMousedownUnlisten !== null) {
389
- this._documentMousedownUnlisten();
390
- this._documentMousedownUnlisten = null;
391
- }
392
- if (this._documentPointerdownUnlisten !== null) {
393
- this._documentPointerdownUnlisten();
394
- this._documentMousedownUnlisten = null;
395
- }
396
- }
397
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DialogService, deps: [{ token: i0.RendererFactory2 }, { token: i1.MatSnackBar }, { token: i1$1.MatDialog }, { token: i0.Injector }, { token: i0.ApplicationRef }, { token: i0.ComponentFactoryResolver }], target: i0.ɵɵFactoryTarget.Injectable }); }
398
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DialogService }); }
399
- }
400
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DialogService, decorators: [{
401
- type: Injectable
402
- }], ctorParameters: function () { return [{ type: i0.RendererFactory2 }, { type: i1.MatSnackBar }, { type: i1$1.MatDialog }, { type: i0.Injector }, { type: i0.ApplicationRef }, { type: i0.ComponentFactoryResolver }]; } });
87
+ /**
88
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
89
+ *
90
+ * Website : -> http://www.turbogui.org
91
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
92
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
93
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
94
+ */
95
+ /**
96
+ * Manages the application modal and non modal floating elements
97
+ */
98
+ class DialogService {
99
+ constructor(rendererFactory, matSnackBar, matDialog, injector, applicationRef, componentFactoryResolver) {
100
+ this.matSnackBar = matSnackBar;
101
+ this.matDialog = matDialog;
102
+ this.injector = injector;
103
+ this.applicationRef = applicationRef;
104
+ this.componentFactoryResolver = componentFactoryResolver;
105
+ /**
106
+ * Used to modify the busy state component that is shown by default by the addModalBusyState() method.
107
+ *
108
+ * @see this.addModalBusyState()
109
+ */
110
+ this.customBusyStateComponentClass = BusyStateBaseComponent;
111
+ /**
112
+ * Check public getter for docs
113
+ */
114
+ this._isEnabled = true;
115
+ /**
116
+ * Tells if the main application is currently showing a busy state that blocks all user interaction
117
+ */
118
+ this._isShowingBusyState = false;
119
+ /**
120
+ * A reference to the modal busy state component that is initialized only the first time it is called.
121
+ *
122
+ * (To append the busy state dynamically, we use the Portal concept from the angular material library)
123
+ */
124
+ this._componentPortal = null;
125
+ /**
126
+ * A reference to the modal busy state container where the component will be added
127
+ */
128
+ this._modalBusyStateHost = null;
129
+ /**
130
+ * Tells if the manager is currently showing a snackbar element or not
131
+ */
132
+ this._isShowingSnackBar = false;
133
+ /**
134
+ * Contains a list of the dialogs that are currently visible to the user.
135
+ * Each item in this list is a hash that is computed when dialog is created to uniquely identify it.
136
+ *
137
+ * Empty list means no dialogs are currently visible
138
+ */
139
+ this._activeDialogs = [];
140
+ /**
141
+ * Contains a list with all the MatDialog instances that are currently visible to the user.
142
+ * The list uses the same order as the list of _activeDialogs hash values
143
+ */
144
+ this._activeDialogInstances = [];
145
+ /**
146
+ * Method that is used to delete the window beforeunload event listener once not used anymore
147
+ */
148
+ this._windowBeforeUnloadUnListen = null;
149
+ /**
150
+ * Method that is used to delete the document keydown event listener once not used anymore
151
+ */
152
+ this._documentKeydownUnlisten = null;
153
+ /**
154
+ * Method that is used to delete the document mousedown event listener once not used anymore
155
+ */
156
+ this._documentMousedownUnlisten = null;
157
+ /**
158
+ * Method that is used to delete the document pointerdown event listener once not used anymore
159
+ */
160
+ this._documentPointerdownUnlisten = null;
161
+ this._renderer = rendererFactory.createRenderer(null, null);
162
+ }
163
+ /**
164
+ * Tells if this dialog service is enabled or not. If dialog service is disabled, none of it's features will work
165
+ * This is used to block all dialog features normally when shutting down the application
166
+ *
167
+ * Use with caution. When this is set to false, dialog service stops working.
168
+ */
169
+ set isEnabled(v) {
170
+ if (v === this._isEnabled) {
171
+ return;
172
+ }
173
+ this._isEnabled = v;
174
+ }
175
+ /**
176
+ * Enables a warning that will be shown to the user when he/she tries to close the application.
177
+ * This warning will prompt the user to continue with the exit process or cancel it.
178
+ * The specific texts of this message are a generic ones and cannot be changed.
179
+ *
180
+ * IMPORTANT: This method must be called after the main application has been initialized in order to work,
181
+ * otherwise it will do nothing.
182
+ */
183
+ addCloseApplicationWarning() {
184
+ if (this._windowBeforeUnloadUnListen === null) {
185
+ this._windowBeforeUnloadUnListen = this._renderer.listen('window', 'beforeunload', (event) => event.returnValue = true);
186
+ }
187
+ }
188
+ /**
189
+ * Remove the close application warning message if previously assigned
190
+ */
191
+ removeCloseApplicationWarning() {
192
+ if (this._windowBeforeUnloadUnListen !== null) {
193
+ this._windowBeforeUnloadUnListen();
194
+ this._windowBeforeUnloadUnListen = null;
195
+ }
196
+ }
197
+ /**
198
+ * Change the application visual appearance so the user perceives that the application is
199
+ * currently busy. While modal busy state is enabled, no user input is possible neither via
200
+ * keyboard, mouse or touch. Use this state when performing server requests or operations that
201
+ * must block the user interaction with the application.
202
+ *
203
+ * Note: We can modify the busy state component that is shown by this method. To do it, we must
204
+ * set this.customBusyStateComponentClass property with our own custom busy state component class. (We can do it at
205
+ * our main application component constructor for example). Our custom component must extend the
206
+ * BusyStateBaseComponent one to add its own visual appearance.
207
+ *
208
+ * @see this.customBusyStateComponentClass
209
+ */
210
+ addModalBusyState() {
211
+ if (!this._isEnabled || this._isShowingBusyState) {
212
+ return;
213
+ }
214
+ this._disableUserInteraction();
215
+ // Dynamically create the busy state component reference if this is the first time
216
+ if (this._componentPortal === null) {
217
+ this._componentPortal = new ComponentPortal(this.customBusyStateComponentClass);
218
+ // Create a PortalHost with document.body as its anchor element
219
+ this._modalBusyStateHost = new DomPortalOutlet(document.body, this.componentFactoryResolver, this.applicationRef, this.injector);
220
+ }
221
+ this._modalBusyStateHost.attach(this._componentPortal);
222
+ this._isShowingBusyState = true;
223
+ }
224
+ /**
225
+ * Tells if the application is currently locked in a modal busy state (caused by an addModalBusyState() call)
226
+ */
227
+ get isShowingBusyState() {
228
+ return this._isShowingBusyState;
229
+ }
230
+ /**
231
+ * Remove the application busy state and restore it back to normal user interaction
232
+ */
233
+ removeModalBusyState() {
234
+ if (!this._isEnabled || !this._isShowingBusyState) {
235
+ return;
236
+ }
237
+ if (this._componentPortal !== null) {
238
+ this._modalBusyStateHost.detach();
239
+ }
240
+ this._enableUserInteraction();
241
+ this._isShowingBusyState = false;
242
+ }
243
+ /**
244
+ * TODO - adapt from TS version
245
+ */
246
+ addToolTip() {
247
+ // TODO - adapt from TS version
248
+ }
249
+ /**
250
+ * Show a non modal snackbar notification to the user (Only one snack-bar can ever be opened at the same time).
251
+ *
252
+ * Snackbars inform users of a process that an app has performed or will perform. They appear temporarily, towards the bottom or top of the screen.
253
+ * They shouldn’t interrupt the user experience, and they don’t require user input to disappear.
254
+ *
255
+ * @param config A MatSnackBarConfig instance with the customizations we want for this snackbar
256
+ * @param message The message to show on the snackbar
257
+ * @param action If not empty, the text to place on the snackbar confirmation button
258
+ * @param actionCallback A method to execute once the user clicks into the action button.
259
+ *
260
+ * @return void
261
+ */
262
+ addSnackBar(config, message, action = '', actionCallback = null) {
263
+ if (!this._isEnabled) {
264
+ return;
265
+ }
266
+ if (this._isShowingSnackBar) {
267
+ throw new Error('Trying to show a snackbar while another one is still visible');
268
+ }
269
+ this._isShowingSnackBar = true;
270
+ const snackBarRef = this.matSnackBar.open(message, action === '' ? undefined : action, config);
271
+ if (actionCallback !== null) {
272
+ snackBarRef.onAction().subscribe(() => {
273
+ actionCallback();
274
+ });
275
+ }
276
+ }
277
+ /**
278
+ * Tells if the application is currently showing a snackbar or not
279
+ */
280
+ get isShowingSnackBar() {
281
+ return this._isShowingSnackBar;
282
+ }
283
+ /**
284
+ * Force the removal of the snack bar dialog if it exists.
285
+ *
286
+ * If no snackbar is currently visible, this method will do nothing
287
+ */
288
+ removeSnackBar() {
289
+ if (!this._isEnabled || !this._isShowingSnackBar) {
290
+ return;
291
+ }
292
+ this.matSnackBar.dismiss();
293
+ this._isShowingSnackBar = false;
294
+ }
295
+ /**
296
+ * Show a dialog with one or more options that can be used to close it. We can use any of the predefined dialog types that are bundled with
297
+ * this library or extend DialogOptionsBaseComponent to create our own custom ones.
298
+ *
299
+ * @param width Specify the css value for the maximum width the dialog will have. As the dialog is responsive, the value will be automatically
300
+ reduced if the available screen is not enough, and will reach the desired value otherwise. Note that height will be adapted to the contents
301
+ of the dialog and cannot be specified here. We can set a pixels, % or any other css accepted value. For example: '400px', '50%', etc.
302
+ * @param texts A list with strings containing the dialog texts, sorted by importance. When dialog has a title, this should
303
+ * be placed first, subtitle second and so (Each dialog may accept different kind of texts).
304
+ * @param options A list of strings that will be used as button captions for each one of the accepted dialog options
305
+ * @param dialogComponentClass A class for a component that extends DialogOptionsBaseComponent, which will be the
306
+ * dialog visual element that is shown to the user.
307
+ * @param callback A function that will be called after the dialog is closed and will receive an object with the numeric index and value for
308
+ * the option that's been selected by the user.
309
+ * @param modal True (default) if selecting an option is mandatory to close the dialog, false if the dialog can be closed
310
+ * by the user by clicking outside it
311
+ */
312
+ addDialog(width, texts, options, dialogComponentClass, callback = null, modal = true) {
313
+ if (!this._isEnabled) {
314
+ return;
315
+ }
316
+ // Generate a string to uniquely identify this dialog on the list of active dialogs
317
+ const dialogHash = texts.join('') + options.join('') + dialogComponentClass.name;
318
+ // identical dialogs won't be allowed at the same time
319
+ if (this._activeDialogs.includes(dialogHash)) {
320
+ return;
321
+ }
322
+ const dialogRef = this.matDialog.open(dialogComponentClass, {
323
+ width: width,
324
+ disableClose: modal,
325
+ autoFocus: false,
326
+ closeOnNavigation: !modal,
327
+ data: { texts: texts, options: options }
328
+ });
329
+ this._activeDialogs.push(dialogHash);
330
+ this._activeDialogInstances.push(dialogRef);
331
+ dialogRef.beforeClosed().subscribe((selectedOptionIndex) => {
332
+ this._activeDialogs = ArrayUtils.removeElement(this._activeDialogs, dialogHash);
333
+ this._activeDialogInstances = ArrayUtils.removeElement(this._activeDialogInstances, dialogRef);
334
+ if (!NumericUtils.isInteger(selectedOptionIndex)) {
335
+ if (modal) {
336
+ throw new Error(`dialogRef.close() expects int value`);
337
+ }
338
+ else {
339
+ selectedOptionIndex = -1;
340
+ }
341
+ }
342
+ if (callback !== null) {
343
+ let selectedOption = { index: selectedOptionIndex, value: '' };
344
+ if (selectedOptionIndex >= 0) {
345
+ selectedOption.value = options[selectedOptionIndex];
346
+ }
347
+ callback(selectedOption);
348
+ }
349
+ });
350
+ }
351
+ /**
352
+ * Force the removal of all the dialogs that are currently visible.
353
+ *
354
+ * If no dialogs are currently visible, this method will do nothing
355
+ */
356
+ removeAllDialogs() {
357
+ if (!this._isEnabled) {
358
+ return;
359
+ }
360
+ for (const dialogRef of this._activeDialogInstances) {
361
+ dialogRef.close(-1);
362
+ }
363
+ this._activeDialogs = [];
364
+ this._activeDialogInstances = [];
365
+ }
366
+ /**
367
+ * Block all the user interactions with the application (keyboard, touch, mouse, ...)
368
+ */
369
+ _disableUserInteraction() {
370
+ if (this._documentKeydownUnlisten === null) {
371
+ this._documentKeydownUnlisten = this._renderer.listen('document', 'keydown', (event) => event.preventDefault());
372
+ }
373
+ if (this._documentMousedownUnlisten === null) {
374
+ this._documentMousedownUnlisten = this._renderer.listen('document', 'mousedown', (event) => event.preventDefault());
375
+ }
376
+ if (this._documentPointerdownUnlisten === null) {
377
+ this._documentPointerdownUnlisten = this._renderer.listen('document', 'pointerdown', (event) => event.preventDefault());
378
+ }
379
+ }
380
+ /**
381
+ * Restore the user interactions that were previously disabled with _disableUserInteraction method
382
+ */
383
+ _enableUserInteraction() {
384
+ if (this._documentKeydownUnlisten !== null) {
385
+ this._documentKeydownUnlisten();
386
+ this._documentKeydownUnlisten = null;
387
+ }
388
+ if (this._documentMousedownUnlisten !== null) {
389
+ this._documentMousedownUnlisten();
390
+ this._documentMousedownUnlisten = null;
391
+ }
392
+ if (this._documentPointerdownUnlisten !== null) {
393
+ this._documentPointerdownUnlisten();
394
+ this._documentMousedownUnlisten = null;
395
+ }
396
+ }
397
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: DialogService, deps: [{ token: i0.RendererFactory2 }, { token: i1.MatSnackBar }, { token: i1$1.MatDialog }, { token: i0.Injector }, { token: i0.ApplicationRef }, { token: i0.ComponentFactoryResolver }], target: i0.ɵɵFactoryTarget.Injectable }); }
398
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: DialogService }); }
399
+ }
400
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: DialogService, decorators: [{
401
+ type: Injectable
402
+ }], ctorParameters: () => [{ type: i0.RendererFactory2 }, { type: i1.MatSnackBar }, { type: i1$1.MatDialog }, { type: i0.Injector }, { type: i0.ApplicationRef }, { type: i0.ComponentFactoryResolver }] });
403
403
 
404
- /**
405
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
406
- *
407
- * Website : -> http://www.turbogui.org
408
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
409
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
410
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
411
- */
412
- /**
413
- * Manages application text translations and languages
414
- */
415
- class LocalizationService extends LocalizationManager {
416
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LocalizationService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
417
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LocalizationService }); }
418
- }
419
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LocalizationService, decorators: [{
420
- type: Injectable
404
+ /**
405
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
406
+ *
407
+ * Website : -> http://www.turbogui.org
408
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
409
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
410
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
411
+ */
412
+ /**
413
+ * Manages application text translations and languages
414
+ */
415
+ class LocalizationService extends LocalizationManager {
416
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: LocalizationService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
417
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: LocalizationService }); }
418
+ }
419
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: LocalizationService, decorators: [{
420
+ type: Injectable
421
421
  }] });
422
422
 
423
- /**
424
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
425
- *
426
- * Website : -> http://www.turbogui.org
427
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
428
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
429
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
430
- */
431
- /**
432
- * This is the base class for all the dialog components that can be loaded by the dialog service class
433
- */
434
- class DialogBaseComponent {
423
+ /**
424
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
425
+ *
426
+ * Website : -> http://www.turbogui.org
427
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
428
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
429
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
430
+ */
431
+ /**
432
+ * This is the base class for all the dialog components that can be loaded by the dialog service class
433
+ */
434
+ class DialogBaseComponent {
435
435
  }
436
436
 
437
- /**
438
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
439
- *
440
- * Website : -> http://www.turbogui.org
441
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
442
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
443
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
444
- */
445
- /**
446
- * This is the base class for all the dialog components that show one or more options for the user to select
447
- */
448
- class DialogOptionsBaseComponent extends DialogBaseComponent {
437
+ /**
438
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
439
+ *
440
+ * Website : -> http://www.turbogui.org
441
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
442
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
443
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
444
+ */
445
+ /**
446
+ * This is the base class for all the dialog components that show one or more options for the user to select
447
+ */
448
+ class DialogOptionsBaseComponent extends DialogBaseComponent {
449
449
  }
450
450
 
451
- /**
452
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
453
- *
454
- * Website : -> http://www.turbogui.org
455
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
456
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
457
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
458
- */
459
- /**
460
- * A dialog component with a single option button, to be used for error notifications
461
- */
462
- class DialogErrorComponent extends DialogOptionsBaseComponent {
463
- constructor(dialogRef, data) {
464
- super();
465
- this.dialogRef = dialogRef;
466
- this.data = data;
467
- if (data.texts.length < 1) {
468
- throw new Error('DialogErrorComponent expects 2 texts: The title and optionally a description');
469
- }
470
- if (data.options.length !== 1) {
471
- throw new Error('DialogErrorComponent expects only one option');
472
- }
473
- }
474
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DialogErrorComponent, deps: [{ token: i1$1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
475
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DialogErrorComponent, selector: "tg-dialog-error", usesInheritance: true, ngImport: i0, template: "<div class=\"titleAndIconContainer\">\r\n <h3>\r\n {{data.texts[0]}}\r\n </h3>\r\n \r\n <!-- error icon -->\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\">\r\n <path d=\"M0 0h24v24H0z\" fill=\"none\"/>\r\n <path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z\" fill=\"#ff0000\" />\r\n </svg>\r\n \r\n</div>\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=\"warn\"\r\n (click)=\"dialogRef.close(0)\">\r\n \r\n {{data.options[0]}}\r\n \r\n</button>", styles: [":host{position:relative;min-height:300px}.titleAndIconContainer{display:flex;flex-direction:row;align-items:center}h3{margin-top:0;margin-bottom:25px;width:82%}svg{width:18%;height:auto}p{margin-bottom:52px}button{float:right;width:50%;min-width:50px}\n"], dependencies: [{ kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
476
- }
477
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DialogErrorComponent, decorators: [{
478
- type: Component,
479
- args: [{ selector: 'tg-dialog-error', template: "<div class=\"titleAndIconContainer\">\r\n <h3>\r\n {{data.texts[0]}}\r\n </h3>\r\n \r\n <!-- error icon -->\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\">\r\n <path d=\"M0 0h24v24H0z\" fill=\"none\"/>\r\n <path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z\" fill=\"#ff0000\" />\r\n </svg>\r\n \r\n</div>\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=\"warn\"\r\n (click)=\"dialogRef.close(0)\">\r\n \r\n {{data.options[0]}}\r\n \r\n</button>", styles: [":host{position:relative;min-height:300px}.titleAndIconContainer{display:flex;flex-direction:row;align-items:center}h3{margin-top:0;margin-bottom:25px;width:82%}svg{width:18%;height:auto}p{margin-bottom:52px}button{float:right;width:50%;min-width:50px}\n"] }]
480
- }], ctorParameters: function () { return [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
481
- type: Inject,
482
- args: [MAT_DIALOG_DATA]
483
- }] }]; } });
451
+ /**
452
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
453
+ *
454
+ * Website : -> http://www.turbogui.org
455
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
456
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
457
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
458
+ */
459
+ /**
460
+ * A dialog component with a single option button, to be used for error notifications
461
+ */
462
+ class DialogErrorComponent extends DialogOptionsBaseComponent {
463
+ constructor(dialogRef, data) {
464
+ super();
465
+ this.dialogRef = dialogRef;
466
+ this.data = data;
467
+ if (data.texts.length < 1) {
468
+ throw new Error('DialogErrorComponent expects 2 texts: The title and optionally a description');
469
+ }
470
+ if (data.options.length !== 1) {
471
+ throw new Error('DialogErrorComponent expects only one option');
472
+ }
473
+ }
474
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: DialogErrorComponent, deps: [{ token: i1$1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
475
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: DialogErrorComponent, selector: "tg-dialog-error", usesInheritance: true, ngImport: i0, template: "<div class=\"titleAndIconContainer\">\r\n <h3>\r\n {{data.texts[0]}}\r\n </h3>\r\n \r\n <!-- error icon -->\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\">\r\n <path d=\"M0 0h24v24H0z\" fill=\"none\"/>\r\n <path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z\" fill=\"#ff0000\" />\r\n </svg>\r\n \r\n</div>\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=\"warn\"\r\n (click)=\"dialogRef.close(0)\">\r\n \r\n {{data.options[0]}}\r\n \r\n</button>", styles: [":host{position:relative;min-height:300px}.titleAndIconContainer{display:flex;flex-direction:row;align-items:center}h3{margin-top:0;margin-bottom:25px;width:82%}svg{width:18%;height:auto}p{margin-bottom:52px}button{float:right;width:50%;min-width:50px}\n"], dependencies: [{ kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
476
+ }
477
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: DialogErrorComponent, decorators: [{
478
+ type: Component,
479
+ args: [{ selector: 'tg-dialog-error', template: "<div class=\"titleAndIconContainer\">\r\n <h3>\r\n {{data.texts[0]}}\r\n </h3>\r\n \r\n <!-- error icon -->\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\">\r\n <path d=\"M0 0h24v24H0z\" fill=\"none\"/>\r\n <path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z\" fill=\"#ff0000\" />\r\n </svg>\r\n \r\n</div>\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=\"warn\"\r\n (click)=\"dialogRef.close(0)\">\r\n \r\n {{data.options[0]}}\r\n \r\n</button>", styles: [":host{position:relative;min-height:300px}.titleAndIconContainer{display:flex;flex-direction:row;align-items:center}h3{margin-top:0;margin-bottom:25px;width:82%}svg{width:18%;height:auto}p{margin-bottom:52px}button{float:right;width:50%;min-width:50px}\n"] }]
480
+ }], ctorParameters: () => [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
481
+ type: Inject,
482
+ args: [MAT_DIALOG_DATA]
483
+ }] }] });
484
484
 
485
- /**
486
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
487
- *
488
- * Website : -> http://www.turbogui.org
489
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
490
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
491
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
492
- */
493
- /**
494
- * Manages application http communications
495
- */
496
- class HTTPService extends HTTPManager {
497
- /**
498
- * execute() method option that tells the service to avoid blocking the user interface with a modal busy state while the requests that are
499
- * launched by the execute method are running.
500
- */
501
- static { this.NO_MODAL_BUSY_STATE = 'NO_MODAL_BUSY_STATE'; }
502
- /**
503
- * execute() method option that tells the service to skip showing an error dialog when a request fails. We normally use this to handle the
504
- * errors by ourselves or if we want to hide the error dialog for a specific request.
505
- */
506
- static { this.DISABLE_ERROR_HANDLING = 'DISABLE_ERROR_HANDLING'; }
507
- constructor(dialogService) {
508
- super(true);
509
- this.dialogService = dialogService;
510
- }
511
- /**
512
- * The same method as HTTPManager.execute but with the ability to enable several options which are specific to this service:
513
- *
514
- * - HTTPService.NO_MODAL_BUSY_STATE To prevent the default behaviour of locking the UI while the request is running
515
- * - HTTPService.DISABLE_ERROR_HANDLING To prevent the default behaviour of showing a detailed error dialog when a request fails
516
- *
517
- * @see HTTPManager.execute()
518
- */
519
- execute(requests, finishedCallback = null, progressCallback = null, options = []) {
520
- if (options.indexOf(HTTPService.NO_MODAL_BUSY_STATE) < 0) {
521
- this.dialogService.addModalBusyState();
522
- }
523
- super.execute(requests, (results, anyError) => {
524
- if (options.indexOf(HTTPService.NO_MODAL_BUSY_STATE) < 0) {
525
- this.dialogService.removeModalBusyState();
526
- }
527
- if ((options.indexOf(HTTPService.DISABLE_ERROR_HANDLING) < 0) && anyError) {
528
- for (let result of results) {
529
- if (result.isError) {
530
- let errorMsg = result.errorMsg + '\n\n' + result.response;
531
- if (StringUtils.isEmpty(errorMsg)) {
532
- errorMsg = 'Unknown error. Make sure Internet connection is available';
533
- }
534
- this.dialogService.addDialog('600px', ['Error: ' + result.code, errorMsg], ['Ok'], DialogErrorComponent);
535
- }
536
- }
537
- }
538
- if (finishedCallback !== null) {
539
- finishedCallback(results, anyError);
540
- }
541
- }, progressCallback);
542
- }
543
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: HTTPService, deps: [{ token: DialogService }], target: i0.ɵɵFactoryTarget.Injectable }); }
544
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: HTTPService }); }
545
- }
546
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: HTTPService, decorators: [{
547
- type: Injectable
548
- }], ctorParameters: function () { return [{ type: DialogService }]; } });
485
+ /**
486
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
487
+ *
488
+ * Website : -> http://www.turbogui.org
489
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
490
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
491
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
492
+ */
493
+ /**
494
+ * Manages application http communications
495
+ */
496
+ class HTTPService extends HTTPManager {
497
+ /**
498
+ * execute() method option that tells the service to avoid blocking the user interface with a modal busy state while the requests that are
499
+ * launched by the execute method are running.
500
+ */
501
+ static { this.NO_MODAL_BUSY_STATE = 'NO_MODAL_BUSY_STATE'; }
502
+ /**
503
+ * execute() method option that tells the service to skip showing an error dialog when a request fails. We normally use this to handle the
504
+ * errors by ourselves or if we want to hide the error dialog for a specific request.
505
+ */
506
+ static { this.DISABLE_ERROR_HANDLING = 'DISABLE_ERROR_HANDLING'; }
507
+ constructor(dialogService) {
508
+ super(true);
509
+ this.dialogService = dialogService;
510
+ }
511
+ /**
512
+ * The same method as HTTPManager.execute but with the ability to enable several options which are specific to this service:
513
+ *
514
+ * - HTTPService.NO_MODAL_BUSY_STATE To prevent the default behaviour of locking the UI while the request is running
515
+ * - HTTPService.DISABLE_ERROR_HANDLING To prevent the default behaviour of showing a detailed error dialog when a request fails
516
+ *
517
+ * @see HTTPManager.execute()
518
+ */
519
+ execute(requests, finishedCallback = null, progressCallback = null, options = []) {
520
+ if (options.indexOf(HTTPService.NO_MODAL_BUSY_STATE) < 0) {
521
+ this.dialogService.addModalBusyState();
522
+ }
523
+ super.execute(requests, (results, anyError) => {
524
+ if (options.indexOf(HTTPService.NO_MODAL_BUSY_STATE) < 0) {
525
+ this.dialogService.removeModalBusyState();
526
+ }
527
+ if ((options.indexOf(HTTPService.DISABLE_ERROR_HANDLING) < 0) && anyError) {
528
+ for (let result of results) {
529
+ if (result.isError) {
530
+ let errorMsg = result.errorMsg + '\n\n' + result.response;
531
+ if (StringUtils.isEmpty(errorMsg)) {
532
+ errorMsg = 'Unknown error. Make sure Internet connection is available';
533
+ }
534
+ this.dialogService.addDialog('600px', ['Error: ' + result.code, errorMsg], ['Ok'], DialogErrorComponent);
535
+ }
536
+ }
537
+ }
538
+ if (finishedCallback !== null) {
539
+ finishedCallback(results, anyError);
540
+ }
541
+ }, progressCallback);
542
+ }
543
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: HTTPService, deps: [{ token: DialogService }], target: i0.ɵɵFactoryTarget.Injectable }); }
544
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: HTTPService }); }
545
+ }
546
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: HTTPService, decorators: [{
547
+ type: Injectable
548
+ }], ctorParameters: () => [{ type: DialogService }] });
549
549
 
550
- /**
551
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
552
- *
553
- * Website : -> http://www.turbogui.org
554
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
555
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
556
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
557
- */
558
- /**
559
- * This is the main application event bus.
560
- * All global events that happen on the application are broadcasted by this service, and
561
- * can be listened by any application element who previously subscribed
562
- */
563
- class NotificationService {
564
- constructor() {
565
- /**
566
- * The Observable instance that handles subscriptions and notifications
567
- */
568
- this._notifications = new Subject();
569
- }
570
- /**
571
- * used by other services or components to subscribe to all notifications that are generated by this service
572
- *
573
- * @param notificationHandler A method that will be used to receive each notification as a GUINotification instance
574
- *
575
- * @returns The new subscription object. Make sure to unsubscribe when not required anymore
576
- */
577
- subscribe(notificationHandler) {
578
- return this._notifications.subscribe(notificationHandler);
579
- }
580
- /**
581
- * Launch a notification to anyone who may be listening
582
- *
583
- * @param notification A notification instance to launch
584
- */
585
- send(notification) {
586
- this._notifications.next(notification);
587
- }
588
- /**
589
- * End a previously initiated subscription
590
- *
591
- * @param subscription A previously created subscription instance from which we want to unsubscribe
592
- */
593
- unsubscribe(subscription) {
594
- return subscription.unsubscribe();
595
- }
596
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NotificationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
597
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NotificationService }); }
598
- }
599
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NotificationService, decorators: [{
600
- type: Injectable
550
+ /**
551
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
552
+ *
553
+ * Website : -> http://www.turbogui.org
554
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
555
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
556
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
557
+ */
558
+ /**
559
+ * This is the main application event bus.
560
+ * All global events that happen on the application are broadcasted by this service, and
561
+ * can be listened by any application element who previously subscribed
562
+ */
563
+ class NotificationService {
564
+ constructor() {
565
+ /**
566
+ * The Observable instance that handles subscriptions and notifications
567
+ */
568
+ this._notifications = new Subject();
569
+ }
570
+ /**
571
+ * used by other services or components to subscribe to all notifications that are generated by this service
572
+ *
573
+ * @param notificationHandler A method that will be used to receive each notification as a GUINotification instance
574
+ *
575
+ * @returns The new subscription object. Make sure to unsubscribe when not required anymore
576
+ */
577
+ subscribe(notificationHandler) {
578
+ return this._notifications.subscribe(notificationHandler);
579
+ }
580
+ /**
581
+ * Launch a notification to anyone who may be listening
582
+ *
583
+ * @param notification A notification instance to launch
584
+ */
585
+ send(notification) {
586
+ this._notifications.next(notification);
587
+ }
588
+ /**
589
+ * End a previously initiated subscription
590
+ *
591
+ * @param subscription A previously created subscription instance from which we want to unsubscribe
592
+ */
593
+ unsubscribe(subscription) {
594
+ return subscription.unsubscribe();
595
+ }
596
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NotificationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
597
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NotificationService }); }
598
+ }
599
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NotificationService, decorators: [{
600
+ type: Injectable
601
601
  }] });
602
602
 
603
- /**
604
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
605
- *
606
- * Website : -> http://www.turbogui.org
607
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
608
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
609
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
610
- */
611
- /**
612
- * Class that defines a POST http request, to be used by HttpService
613
- */
614
- class HTTPServicePostRequest extends HTTPManagerPostRequest {
603
+ /**
604
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
605
+ *
606
+ * Website : -> http://www.turbogui.org
607
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
608
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
609
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
610
+ */
611
+ /**
612
+ * Class that defines a POST http request, to be used by HttpService
613
+ */
614
+ class HTTPServicePostRequest extends HTTPManagerPostRequest {
615
615
  }
616
616
 
617
- /**
618
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
619
- *
620
- * Website : -> http://www.turbogui.org
621
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
622
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
623
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
624
- */
625
- /**
626
- * Manages the users model and commands
627
- */
628
- class UserService {
629
- constructor(httpService, ls) {
630
- this.httpService = httpService;
631
- this.ls = ls;
632
- /**
633
- * Path to the web service that performs the user login
634
- */
635
- this.loginWebService = 'users/login';
636
- /**
637
- * The username that is currently defined and will be used by the login methods
638
- */
639
- this.userName = '';
640
- /**
641
- * The password for the user that is currently defined and will be used by the login methods
642
- */
643
- this.password = '';
644
- /**
645
- * Check public getter for docs
646
- */
647
- this._isLogged = false;
648
- /**
649
- * @see token() getter for more info
650
- */
651
- this._token = '';
652
- }
653
- /**
654
- * Tells if the services contains a non empty username and password specified
655
- */
656
- get isUserAndPswDefined() {
657
- return !StringUtils.isEmpty(this.userName) && !StringUtils.isEmpty(this.password);
658
- }
659
- /**
660
- * Tells if exists a user that is currently logged or not
661
- */
662
- get isLogged() {
663
- return this._isLogged;
664
- }
665
- /**
666
- * Gives the value for the currently active user authentication token or an empty string if no user logged
667
- */
668
- get token() {
669
- return this._token;
670
- }
671
- /**
672
- * Perform a user login against the configured login webservice
673
- *
674
- * @param loginOkCallback Method to be executed once the login finishes chorrectly. An object with all the service response data will be passed to this method
675
- * @param loginFailCallback Method to be executed once the login finishes incorrectly.
676
- */
677
- login(loginOkCallback = null, loginFailCallback = null) {
678
- const request = new HTTPServicePostRequest(this.loginWebService);
679
- request.ignoreGlobalPostParams = true;
680
- const encodedCredentials = ConversionUtils.stringToBase64(ConversionUtils.stringToBase64(this.userName) + ',' + ConversionUtils.stringToBase64(this.password));
681
- request.parameters = {
682
- data: encodedCredentials
683
- };
684
- request.successCallback = (response) => {
685
- if (response !== '') {
686
- response = JSON.parse(response);
687
- this._isLogged = true;
688
- this._token = response.token;
689
- this.httpService.setGlobalPostParam('token', response.token);
690
- if (loginOkCallback !== null) {
691
- loginOkCallback(response);
692
- }
693
- }
694
- else {
695
- this._clearUserAndToken();
696
- if (loginFailCallback !== null) {
697
- loginFailCallback();
698
- }
699
- }
700
- };
701
- this.httpService.execute(request);
702
- }
703
- /**
704
- * Perform the logout for the currently logged user
705
- */
706
- logout(logoutOkCallback = null) {
707
- const request = new HTTPServicePostRequest('users/logout');
708
- request.parameters = {
709
- token: this._token
710
- };
711
- request.successCallback = () => {
712
- this._clearUserAndToken();
713
- if (logoutOkCallback !== null) {
714
- logoutOkCallback();
715
- }
716
- };
717
- this.httpService.execute(request);
718
- }
719
- _clearUserAndToken() {
720
- this.userName = '';
721
- this.password = '';
722
- this._isLogged = false;
723
- this._token = '';
724
- if (this.httpService.isGlobalPostParam('token')) {
725
- this.httpService.deleteGlobalPostParam('token');
726
- }
727
- }
728
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UserService, deps: [{ token: HTTPService }, { token: LocalizationService }], target: i0.ɵɵFactoryTarget.Injectable }); }
729
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UserService }); }
730
- }
731
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UserService, decorators: [{
732
- type: Injectable
733
- }], ctorParameters: function () { return [{ type: HTTPService }, { type: LocalizationService }]; } });
617
+ /**
618
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
619
+ *
620
+ * Website : -> http://www.turbogui.org
621
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
622
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
623
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
624
+ */
625
+ /**
626
+ * Manages the users model and commands
627
+ */
628
+ class UserService {
629
+ constructor(httpService, ls) {
630
+ this.httpService = httpService;
631
+ this.ls = ls;
632
+ /**
633
+ * Path to the web service that performs the user login
634
+ */
635
+ this.loginWebService = 'users/login';
636
+ /**
637
+ * The username that is currently defined and will be used by the login methods
638
+ */
639
+ this.userName = '';
640
+ /**
641
+ * The password for the user that is currently defined and will be used by the login methods
642
+ */
643
+ this.password = '';
644
+ /**
645
+ * Check public getter for docs
646
+ */
647
+ this._isLogged = false;
648
+ /**
649
+ * @see token() getter for more info
650
+ */
651
+ this._token = '';
652
+ }
653
+ /**
654
+ * Tells if the services contains a non empty username and password specified
655
+ */
656
+ get isUserAndPswDefined() {
657
+ return !StringUtils.isEmpty(this.userName) && !StringUtils.isEmpty(this.password);
658
+ }
659
+ /**
660
+ * Tells if exists a user that is currently logged or not
661
+ */
662
+ get isLogged() {
663
+ return this._isLogged;
664
+ }
665
+ /**
666
+ * Gives the value for the currently active user authentication token or an empty string if no user logged
667
+ */
668
+ get token() {
669
+ return this._token;
670
+ }
671
+ /**
672
+ * Perform a user login against the configured login webservice
673
+ *
674
+ * @param loginOkCallback Method to be executed once the login finishes chorrectly. An object with all the service response data will be passed to this method
675
+ * @param loginFailCallback Method to be executed once the login finishes incorrectly.
676
+ */
677
+ login(loginOkCallback = null, loginFailCallback = null) {
678
+ const request = new HTTPServicePostRequest(this.loginWebService);
679
+ request.ignoreGlobalPostParams = true;
680
+ const encodedCredentials = ConversionUtils.stringToBase64(ConversionUtils.stringToBase64(this.userName) + ',' + ConversionUtils.stringToBase64(this.password));
681
+ request.parameters = {
682
+ data: encodedCredentials
683
+ };
684
+ request.successCallback = (response) => {
685
+ if (response !== '') {
686
+ response = JSON.parse(response);
687
+ this._isLogged = true;
688
+ this._token = response.token;
689
+ this.httpService.setGlobalPostParam('token', response.token);
690
+ if (loginOkCallback !== null) {
691
+ loginOkCallback(response);
692
+ }
693
+ }
694
+ else {
695
+ this._clearUserAndToken();
696
+ if (loginFailCallback !== null) {
697
+ loginFailCallback();
698
+ }
699
+ }
700
+ };
701
+ this.httpService.execute(request);
702
+ }
703
+ /**
704
+ * Perform the logout for the currently logged user
705
+ */
706
+ logout(logoutOkCallback = null) {
707
+ const request = new HTTPServicePostRequest('users/logout');
708
+ request.parameters = {
709
+ token: this._token
710
+ };
711
+ request.successCallback = () => {
712
+ this._clearUserAndToken();
713
+ if (logoutOkCallback !== null) {
714
+ logoutOkCallback();
715
+ }
716
+ };
717
+ this.httpService.execute(request);
718
+ }
719
+ _clearUserAndToken() {
720
+ this.userName = '';
721
+ this.password = '';
722
+ this._isLogged = false;
723
+ this._token = '';
724
+ if (this.httpService.isGlobalPostParam('token')) {
725
+ this.httpService.deleteGlobalPostParam('token');
726
+ }
727
+ }
728
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: UserService, deps: [{ token: HTTPService }, { token: LocalizationService }], target: i0.ɵɵFactoryTarget.Injectable }); }
729
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: UserService }); }
730
+ }
731
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: UserService, decorators: [{
732
+ type: Injectable
733
+ }], ctorParameters: () => [{ type: HTTPService }, { type: LocalizationService }] });
734
734
 
735
- /**
736
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
737
- *
738
- * Website : -> http://www.turbogui.org
739
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
740
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
741
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
742
- */
743
- /**
744
- * Manages adding, removing and manipulating the application views
745
- */
746
- class ViewsService {
747
- constructor(componentFactoryResolver) {
748
- this.componentFactoryResolver = componentFactoryResolver;
749
- /**
750
- * See getter method for docs
751
- */
752
- this._loadedViewClass = null;
753
- /**
754
- * An instance of the model that is assigned to the currently loaded view
755
- */
756
- this._loadedViewModel = null;
757
- /**
758
- * See setter method for docs
759
- */
760
- this._viewContainerRef = null;
761
- }
762
- /**
763
- * Tells if there's any view currently loaded on the application views container
764
- */
765
- get isViewLoaded() {
766
- return this._loadedViewClass !== null;
767
- }
768
- /**
769
- * Stores a reference to the visual element that will be used as the container for all the views.
770
- * This is automatically assigned by the tg-views-container component once it is created.
771
- *
772
- * @see ViewsContainerComponent for more information
773
- */
774
- set viewContainerRef(ref) {
775
- if (ref !== null && this._viewContainerRef !== null) {
776
- throw new Error('Views container already defined. Only one views container element can exist on an application');
777
- }
778
- this._viewContainerRef = ref;
779
- }
780
- /**
781
- * Create a new view instance with the specified type and add it to the current application views container. Any currently loaded
782
- * view will be removed
783
- *
784
- * Make sure this method is called when all the visual components of the application have been created (ngAfterViewInit)
785
- *
786
- * @param view The classname for the view that we want to create and add to the views container (must extend View base class).
787
- *
788
- * @return The instance of the newly added and created view.
789
- */
790
- pushView(view) {
791
- // If a view is already loaded, we will unload it first
792
- if (this._loadedViewClass !== null) {
793
- // If the loaded view is the same as the specified one, we will do nothing
794
- if (this._loadedViewClass === view) {
795
- return;
796
- }
797
- this.popView();
798
- }
799
- this.verifyViewsContainerExist();
800
- const factory = this.componentFactoryResolver.resolveComponentFactory(view);
801
- const componentRef = this._viewContainerRef.createComponent(factory);
802
- this._loadedViewModel = componentRef.instance.modelClass !== null ? new componentRef.instance.modelClass() : null;
803
- componentRef.changeDetectorRef.detectChanges();
804
- this._loadedViewClass = view;
805
- return componentRef;
806
- }
807
- /**
808
- * Get the model that is instantiated for the currently active view. (A view model only lives while its view is active)
809
- * If no view model is assigned to the current view or no view is loaded, an exception will be thrown.
810
- *
811
- * @return The current view model instance, which must be casted to the appropiate ViewModel extended class
812
- */
813
- get model() {
814
- if (this._loadedViewModel === null) {
815
- throw new Error('No active model. Make sure a view is loaded with an assigned model. Do not access the model until view is initialized (for example on ngAfterViewInit)');
816
- }
817
- return this._loadedViewModel;
818
- }
819
- /**
820
- * Delete the currently loaded view from the views container, and leave it empty.
821
- * If no view is currently loaded, this method will do nothing
822
- */
823
- popView() {
824
- this.verifyViewsContainerExist();
825
- if (this._loadedViewClass !== null) {
826
- this._viewContainerRef.clear();
827
- }
828
- this._loadedViewClass = null;
829
- this._loadedViewModel = null;
830
- }
831
- /**
832
- * Auxiliary method to test if the views container instance is available on the application
833
- */
834
- verifyViewsContainerExist() {
835
- if (this._viewContainerRef === null) {
836
- throw new Error('Views container not defined. Please declare a <views-container> element in your application');
837
- }
838
- }
839
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ViewsService, deps: [{ token: i0.ComponentFactoryResolver }], target: i0.ɵɵFactoryTarget.Injectable }); }
840
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ViewsService }); }
841
- }
842
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ViewsService, decorators: [{
843
- type: Injectable
844
- }], ctorParameters: function () { return [{ type: i0.ComponentFactoryResolver }]; } });
735
+ /**
736
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
737
+ *
738
+ * Website : -> http://www.turbogui.org
739
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
740
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
741
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
742
+ */
743
+ /**
744
+ * Manages adding, removing and manipulating the application views
745
+ */
746
+ class ViewsService {
747
+ constructor(componentFactoryResolver) {
748
+ this.componentFactoryResolver = componentFactoryResolver;
749
+ /**
750
+ * See getter method for docs
751
+ */
752
+ this._loadedViewClass = null;
753
+ /**
754
+ * An instance of the model that is assigned to the currently loaded view
755
+ */
756
+ this._loadedViewModel = null;
757
+ /**
758
+ * See setter method for docs
759
+ */
760
+ this._viewContainerRef = null;
761
+ }
762
+ /**
763
+ * Tells if there's any view currently loaded on the application views container
764
+ */
765
+ get isViewLoaded() {
766
+ return this._loadedViewClass !== null;
767
+ }
768
+ /**
769
+ * Stores a reference to the visual element that will be used as the container for all the views.
770
+ * This is automatically assigned by the tg-views-container component once it is created.
771
+ *
772
+ * @see ViewsContainerComponent for more information
773
+ */
774
+ set viewContainerRef(ref) {
775
+ if (ref !== null && this._viewContainerRef !== null) {
776
+ throw new Error('Views container already defined. Only one views container element can exist on an application');
777
+ }
778
+ this._viewContainerRef = ref;
779
+ }
780
+ /**
781
+ * Create a new view instance with the specified type and add it to the current application views container. Any currently loaded
782
+ * view will be removed
783
+ *
784
+ * Make sure this method is called when all the visual components of the application have been created (ngAfterViewInit)
785
+ *
786
+ * @param view The classname for the view that we want to create and add to the views container (must extend View base class).
787
+ *
788
+ * @return The instance of the newly added and created view.
789
+ */
790
+ pushView(view) {
791
+ // If a view is already loaded, we will unload it first
792
+ if (this._loadedViewClass !== null) {
793
+ // If the loaded view is the same as the specified one, we will do nothing
794
+ if (this._loadedViewClass === view) {
795
+ return;
796
+ }
797
+ this.popView();
798
+ }
799
+ this.verifyViewsContainerExist();
800
+ const factory = this.componentFactoryResolver.resolveComponentFactory(view);
801
+ const componentRef = this._viewContainerRef.createComponent(factory);
802
+ this._loadedViewModel = componentRef.instance.modelClass !== null ? new componentRef.instance.modelClass() : null;
803
+ componentRef.changeDetectorRef.detectChanges();
804
+ this._loadedViewClass = view;
805
+ return componentRef;
806
+ }
807
+ /**
808
+ * Get the model that is instantiated for the currently active view. (A view model only lives while its view is active)
809
+ * If no view model is assigned to the current view or no view is loaded, an exception will be thrown.
810
+ *
811
+ * @return The current view model instance, which must be casted to the appropiate ViewModel extended class
812
+ */
813
+ get model() {
814
+ if (this._loadedViewModel === null) {
815
+ throw new Error('No active model. Make sure a view is loaded with an assigned model. Do not access the model until view is initialized (for example on ngAfterViewInit)');
816
+ }
817
+ return this._loadedViewModel;
818
+ }
819
+ /**
820
+ * Delete the currently loaded view from the views container, and leave it empty.
821
+ * If no view is currently loaded, this method will do nothing
822
+ */
823
+ popView() {
824
+ this.verifyViewsContainerExist();
825
+ if (this._loadedViewClass !== null) {
826
+ this._viewContainerRef.clear();
827
+ }
828
+ this._loadedViewClass = null;
829
+ this._loadedViewModel = null;
830
+ }
831
+ /**
832
+ * Auxiliary method to test if the views container instance is available on the application
833
+ */
834
+ verifyViewsContainerExist() {
835
+ if (this._viewContainerRef === null) {
836
+ throw new Error('Views container not defined. Please declare a <views-container> element in your application');
837
+ }
838
+ }
839
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ViewsService, deps: [{ token: i0.ComponentFactoryResolver }], target: i0.ɵɵFactoryTarget.Injectable }); }
840
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ViewsService }); }
841
+ }
842
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ViewsService, decorators: [{
843
+ type: Injectable
844
+ }], ctorParameters: () => [{ type: i0.ComponentFactoryResolver }] });
845
845
 
846
- /**
847
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
848
- *
849
- * Website : -> http://www.turbogui.org
850
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
851
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
852
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
853
- */
854
- /**
855
- * Component that is used as a container for application views.
856
- * We must create only one views container in our application and pass to it a reference to our main
857
- * viewsService instance. For example:
858
- *
859
- * <tg-views-container [viewsService]="viewsService" [initialView]="HomeViewComponent"></tg-views-container>
860
- */
861
- class ViewsContainerComponent {
862
- constructor() {
863
- /**
864
- * If we want to load a view by default when this component is loaded for the first time, we can
865
- * set here the respective class view and it will be automatically added.
866
- */
867
- this.initialView = null;
868
- /**
869
- * A reference to the views service that is used to operate with this views container.
870
- * This must be specified when this component is added to the application
871
- */
872
- this.viewsService = null;
873
- }
874
- /**
875
- * Check that the service reference has been correctly passed
876
- */
877
- ngOnInit() {
878
- if (!(this.viewsService instanceof ViewsService)) {
879
- throw new Error('ViewService instance must be referenced on a views container');
880
- }
881
- else {
882
- this.viewsService.viewContainerRef = this.viewContainerRef;
883
- }
884
- // Set the initial view if defined
885
- if (this.initialView !== null) {
886
- this.viewsService.pushView(this.initialView);
887
- }
888
- }
889
- /**
890
- * Clear the current view from the service when this component is deleted
891
- */
892
- ngOnDestroy() {
893
- if (this.viewsService instanceof ViewsService) {
894
- this.viewsService.popView();
895
- this.viewsService.viewContainerRef = null;
896
- }
897
- }
898
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ViewsContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
899
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ViewsContainerComponent, selector: "tg-views-container", inputs: { initialView: "initialView", viewsService: "viewsService" }, viewQueries: [{ propertyName: "viewContainerRef", first: true, predicate: ["viewContainerRef"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<!--\r\n This is a dummy template component that will be used as the anchor point where the views will be loaded\r\n-->\r\n<ng-template #viewContainerRef></ng-template>", styles: [""] }); }
900
- }
901
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ViewsContainerComponent, decorators: [{
902
- type: Component,
903
- args: [{ selector: 'tg-views-container', template: "<!--\r\n This is a dummy template component that will be used as the anchor point where the views will be loaded\r\n-->\r\n<ng-template #viewContainerRef></ng-template>" }]
904
- }], propDecorators: { initialView: [{
905
- type: Input
906
- }], viewsService: [{
907
- type: Input
908
- }], viewContainerRef: [{
909
- type: ViewChild,
910
- args: ['viewContainerRef', { read: ViewContainerRef, static: true }]
846
+ /**
847
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
848
+ *
849
+ * Website : -> http://www.turbogui.org
850
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
851
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
852
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
853
+ */
854
+ /**
855
+ * Component that is used as a container for application views.
856
+ * We must create only one views container in our application and pass to it a reference to our main
857
+ * viewsService instance. For example:
858
+ *
859
+ * <tg-views-container [viewsService]="viewsService" [initialView]="HomeViewComponent"></tg-views-container>
860
+ */
861
+ class ViewsContainerComponent {
862
+ constructor() {
863
+ /**
864
+ * If we want to load a view by default when this component is loaded for the first time, we can
865
+ * set here the respective class view and it will be automatically added.
866
+ */
867
+ this.initialView = null;
868
+ /**
869
+ * A reference to the views service that is used to operate with this views container.
870
+ * This must be specified when this component is added to the application
871
+ */
872
+ this.viewsService = null;
873
+ }
874
+ /**
875
+ * Check that the service reference has been correctly passed
876
+ */
877
+ ngOnInit() {
878
+ if (!(this.viewsService instanceof ViewsService)) {
879
+ throw new Error('ViewService instance must be referenced on a views container');
880
+ }
881
+ else {
882
+ this.viewsService.viewContainerRef = this.viewContainerRef;
883
+ }
884
+ // Set the initial view if defined
885
+ if (this.initialView !== null) {
886
+ this.viewsService.pushView(this.initialView);
887
+ }
888
+ }
889
+ /**
890
+ * Clear the current view from the service when this component is deleted
891
+ */
892
+ ngOnDestroy() {
893
+ if (this.viewsService instanceof ViewsService) {
894
+ this.viewsService.popView();
895
+ this.viewsService.viewContainerRef = null;
896
+ }
897
+ }
898
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ViewsContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
899
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: ViewsContainerComponent, selector: "tg-views-container", inputs: { initialView: "initialView", viewsService: "viewsService" }, viewQueries: [{ propertyName: "viewContainerRef", first: true, predicate: ["viewContainerRef"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<!--\r\n This is a dummy template component that will be used as the anchor point where the views will be loaded\r\n-->\r\n<ng-template #viewContainerRef></ng-template>", styles: [""] }); }
900
+ }
901
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ViewsContainerComponent, decorators: [{
902
+ type: Component,
903
+ args: [{ selector: 'tg-views-container', template: "<!--\r\n This is a dummy template component that will be used as the anchor point where the views will be loaded\r\n-->\r\n<ng-template #viewContainerRef></ng-template>" }]
904
+ }], propDecorators: { initialView: [{
905
+ type: Input
906
+ }], viewsService: [{
907
+ type: Input
908
+ }], viewContainerRef: [{
909
+ type: ViewChild,
910
+ args: ['viewContainerRef', { read: ViewContainerRef, static: true }]
911
911
  }] } });
912
912
 
913
- /**
914
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
915
- *
916
- * Website : -> http://www.turbogui.org
917
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
918
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
919
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
920
- */
921
- /**
922
- * This is the base class for all button components
923
- */
924
- class ButtonBaseComponent {
925
- constructor() {
926
- /**
927
- * Defines the actual opacity that is binded on the html part
928
- */
929
- this.currentOpacity = .7;
930
- /**
931
- * Defines the actual scale that is binded on the html part
932
- */
933
- this.currentScale = 'scale(1)';
934
- /**
935
- * Defines if the button can be clicked or not
936
- */
937
- this.pointerEvents = 'initial';
938
- /**
939
- * Specifies if the button animations must rollback when the user releases the mouse or pointer after pressing it
940
- */
941
- this.releaseOnMouseUp = true;
942
- /**
943
- * Specifies the amount of milliseconds that the button will vibrate when it gets clicked (only on compatible devices and browsers)
944
- * Set it to 0 to disable click vibration
945
- */
946
- this.vibrateOnClick = 25;
947
- /**
948
- * Defines the button opacity when it is not clicked
949
- */
950
- this.defaultOpacity = .7;
951
- /**
952
- * Defines the image scale when it is not clicked
953
- */
954
- this.defaultScale = 1;
955
- /**
956
- * Defines the button opacity when it is hovered
957
- */
958
- this.hoverOpacity = .8;
959
- /**
960
- * Defines the image scale when it is hovered
961
- */
962
- this.hoverScale = 1;
963
- /**
964
- * Defines the button opacity when it is clicked
965
- */
966
- this.clickOpacity = 1;
967
- /**
968
- * Defines the image scale when it is clicked
969
- */
970
- this.clickScale = 1;
971
- /**
972
- * Defines the button opacity when it is disabled
973
- */
974
- this.disabledOpacity = .2;
975
- /**
976
- * Stores the value that tells if the button is enabled or disabled
977
- */
978
- this._enabled = true;
979
- }
980
- /**
981
- * Specifies if the button is enabled or disabled
982
- */
983
- set enabled(v) {
984
- this._enabled = v;
985
- this.currentOpacity = v ? this.defaultOpacity : this.disabledOpacity;
986
- this.pointerEvents = v ? 'initial' : 'none';
987
- }
988
- ;
989
- /**
990
- * Set button default values
991
- */
992
- ngOnInit() {
993
- this.currentOpacity = this._enabled ? this.defaultOpacity : this.disabledOpacity;
994
- this.currentScale = 'scale(1)';
995
- }
996
- /**
997
- * Listens for the mouse over the button component
998
- */
999
- onMouseOver() {
1000
- if (this._enabled) {
1001
- this.currentOpacity = this.hoverOpacity;
1002
- this.currentScale = 'scale(' + this.hoverScale + ')';
1003
- }
1004
- }
1005
- /**
1006
- * Listens for the mouse out of the button component
1007
- */
1008
- onMouseOut() {
1009
- if (this._enabled) {
1010
- this.currentOpacity = this.defaultOpacity;
1011
- this.currentScale = 'scale(' + this.defaultScale + ')';
1012
- }
1013
- }
1014
- /**
1015
- * Listens for the mouse down on the button component
1016
- */
1017
- onMouseDown() {
1018
- if (this._enabled) {
1019
- this.currentOpacity = this.clickOpacity;
1020
- this.currentScale = 'scale(' + this.clickScale + ')';
1021
- }
1022
- }
1023
- /**
1024
- * Listens for the mouse up of the button component
1025
- */
1026
- onMouseUp() {
1027
- if (this._enabled) {
1028
- if (this.vibrateOnClick > 0 && window.navigator && window.navigator.vibrate) {
1029
- window.navigator.vibrate(this.vibrateOnClick);
1030
- }
1031
- if (this.releaseOnMouseUp) {
1032
- this.currentOpacity = this.defaultOpacity;
1033
- this.currentScale = 'scale(' + this.defaultScale + ')';
1034
- }
1035
- }
1036
- }
1037
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ButtonBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1038
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: ButtonBaseComponent, inputs: { releaseOnMouseUp: "releaseOnMouseUp", vibrateOnClick: "vibrateOnClick", defaultOpacity: "defaultOpacity", defaultScale: "defaultScale", hoverOpacity: "hoverOpacity", hoverScale: "hoverScale", clickOpacity: "clickOpacity", clickScale: "clickScale", disabledOpacity: "disabledOpacity", enabled: "enabled" }, host: { listeners: { "mouseover": "onMouseOver()", "mouseout": "onMouseOut()", "pointerout": "onMouseOut()", "pointerleave": "onMouseOut()", "pointerdown": "onMouseDown()", "pointerup": "onMouseUp()" }, properties: { "style.opacity": "this.currentOpacity", "style.transform": "this.currentScale", "style.pointer-events": "this.pointerEvents" } }, ngImport: i0 }); }
1039
- }
1040
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ButtonBaseComponent, decorators: [{
1041
- type: Directive
1042
- }], propDecorators: { currentOpacity: [{
1043
- type: HostBinding,
1044
- args: ['style.opacity']
1045
- }], currentScale: [{
1046
- type: HostBinding,
1047
- args: ['style.transform']
1048
- }], pointerEvents: [{
1049
- type: HostBinding,
1050
- args: ['style.pointer-events']
1051
- }], releaseOnMouseUp: [{
1052
- type: Input
1053
- }], vibrateOnClick: [{
1054
- type: Input
1055
- }], defaultOpacity: [{
1056
- type: Input
1057
- }], defaultScale: [{
1058
- type: Input
1059
- }], hoverOpacity: [{
1060
- type: Input
1061
- }], hoverScale: [{
1062
- type: Input
1063
- }], clickOpacity: [{
1064
- type: Input
1065
- }], clickScale: [{
1066
- type: Input
1067
- }], disabledOpacity: [{
1068
- type: Input
1069
- }], enabled: [{
1070
- type: Input
1071
- }], onMouseOver: [{
1072
- type: HostListener,
1073
- args: ['mouseover']
1074
- }], onMouseOut: [{
1075
- type: HostListener,
1076
- args: ['mouseout']
1077
- }, {
1078
- type: HostListener,
1079
- args: ['pointerout']
1080
- }, {
1081
- type: HostListener,
1082
- args: ['pointerleave']
1083
- }], onMouseDown: [{
1084
- type: HostListener,
1085
- args: ['pointerdown']
1086
- }], onMouseUp: [{
1087
- type: HostListener,
1088
- args: ['pointerup']
913
+ /**
914
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
915
+ *
916
+ * Website : -> http://www.turbogui.org
917
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
918
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
919
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
920
+ */
921
+ /**
922
+ * This is the base class for all button components
923
+ */
924
+ class ButtonBaseComponent {
925
+ constructor() {
926
+ /**
927
+ * Defines the actual opacity that is binded on the html part
928
+ */
929
+ this.currentOpacity = .7;
930
+ /**
931
+ * Defines the actual scale that is binded on the html part
932
+ */
933
+ this.currentScale = 'scale(1)';
934
+ /**
935
+ * Defines if the button can be clicked or not
936
+ */
937
+ this.pointerEvents = 'initial';
938
+ /**
939
+ * Specifies if the button animations must rollback when the user releases the mouse or pointer after pressing it
940
+ */
941
+ this.releaseOnMouseUp = true;
942
+ /**
943
+ * Specifies the amount of milliseconds that the button will vibrate when it gets clicked (only on compatible devices and browsers)
944
+ * Set it to 0 to disable click vibration
945
+ */
946
+ this.vibrateOnClick = 25;
947
+ /**
948
+ * Defines the button opacity when it is not clicked
949
+ */
950
+ this.defaultOpacity = .7;
951
+ /**
952
+ * Defines the image scale when it is not clicked
953
+ */
954
+ this.defaultScale = 1;
955
+ /**
956
+ * Defines the button opacity when it is hovered
957
+ */
958
+ this.hoverOpacity = .8;
959
+ /**
960
+ * Defines the image scale when it is hovered
961
+ */
962
+ this.hoverScale = 1;
963
+ /**
964
+ * Defines the button opacity when it is clicked
965
+ */
966
+ this.clickOpacity = 1;
967
+ /**
968
+ * Defines the image scale when it is clicked
969
+ */
970
+ this.clickScale = 1;
971
+ /**
972
+ * Defines the button opacity when it is disabled
973
+ */
974
+ this.disabledOpacity = .2;
975
+ /**
976
+ * Stores the value that tells if the button is enabled or disabled
977
+ */
978
+ this._enabled = true;
979
+ }
980
+ /**
981
+ * Specifies if the button is enabled or disabled
982
+ */
983
+ set enabled(v) {
984
+ this._enabled = v;
985
+ this.currentOpacity = v ? this.defaultOpacity : this.disabledOpacity;
986
+ this.pointerEvents = v ? 'initial' : 'none';
987
+ }
988
+ ;
989
+ /**
990
+ * Set button default values
991
+ */
992
+ ngOnInit() {
993
+ this.currentOpacity = this._enabled ? this.defaultOpacity : this.disabledOpacity;
994
+ this.currentScale = 'scale(1)';
995
+ }
996
+ /**
997
+ * Listens for the mouse over the button component
998
+ */
999
+ onMouseOver() {
1000
+ if (this._enabled) {
1001
+ this.currentOpacity = this.hoverOpacity;
1002
+ this.currentScale = 'scale(' + this.hoverScale + ')';
1003
+ }
1004
+ }
1005
+ /**
1006
+ * Listens for the mouse out of the button component
1007
+ */
1008
+ onMouseOut() {
1009
+ if (this._enabled) {
1010
+ this.currentOpacity = this.defaultOpacity;
1011
+ this.currentScale = 'scale(' + this.defaultScale + ')';
1012
+ }
1013
+ }
1014
+ /**
1015
+ * Listens for the mouse down on the button component
1016
+ */
1017
+ onMouseDown() {
1018
+ if (this._enabled) {
1019
+ this.currentOpacity = this.clickOpacity;
1020
+ this.currentScale = 'scale(' + this.clickScale + ')';
1021
+ }
1022
+ }
1023
+ /**
1024
+ * Listens for the mouse up of the button component
1025
+ */
1026
+ onMouseUp() {
1027
+ if (this._enabled) {
1028
+ if (this.vibrateOnClick > 0 && window.navigator && window.navigator.vibrate) {
1029
+ window.navigator.vibrate(this.vibrateOnClick);
1030
+ }
1031
+ if (this.releaseOnMouseUp) {
1032
+ this.currentOpacity = this.defaultOpacity;
1033
+ this.currentScale = 'scale(' + this.defaultScale + ')';
1034
+ }
1035
+ }
1036
+ }
1037
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ButtonBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1038
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.8", type: ButtonBaseComponent, inputs: { releaseOnMouseUp: "releaseOnMouseUp", vibrateOnClick: "vibrateOnClick", defaultOpacity: "defaultOpacity", defaultScale: "defaultScale", hoverOpacity: "hoverOpacity", hoverScale: "hoverScale", clickOpacity: "clickOpacity", clickScale: "clickScale", disabledOpacity: "disabledOpacity", enabled: "enabled" }, host: { listeners: { "mouseover": "onMouseOver()", "mouseout": "onMouseOut()", "pointerout": "onMouseOut()", "pointerleave": "onMouseOut()", "pointerdown": "onMouseDown()", "pointerup": "onMouseUp()" }, properties: { "style.opacity": "this.currentOpacity", "style.transform": "this.currentScale", "style.pointer-events": "this.pointerEvents" } }, ngImport: i0 }); }
1039
+ }
1040
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ButtonBaseComponent, decorators: [{
1041
+ type: Directive
1042
+ }], propDecorators: { currentOpacity: [{
1043
+ type: HostBinding,
1044
+ args: ['style.opacity']
1045
+ }], currentScale: [{
1046
+ type: HostBinding,
1047
+ args: ['style.transform']
1048
+ }], pointerEvents: [{
1049
+ type: HostBinding,
1050
+ args: ['style.pointer-events']
1051
+ }], releaseOnMouseUp: [{
1052
+ type: Input
1053
+ }], vibrateOnClick: [{
1054
+ type: Input
1055
+ }], defaultOpacity: [{
1056
+ type: Input
1057
+ }], defaultScale: [{
1058
+ type: Input
1059
+ }], hoverOpacity: [{
1060
+ type: Input
1061
+ }], hoverScale: [{
1062
+ type: Input
1063
+ }], clickOpacity: [{
1064
+ type: Input
1065
+ }], clickScale: [{
1066
+ type: Input
1067
+ }], disabledOpacity: [{
1068
+ type: Input
1069
+ }], enabled: [{
1070
+ type: Input
1071
+ }], onMouseOver: [{
1072
+ type: HostListener,
1073
+ args: ['mouseover']
1074
+ }], onMouseOut: [{
1075
+ type: HostListener,
1076
+ args: ['mouseout']
1077
+ }, {
1078
+ type: HostListener,
1079
+ args: ['pointerout']
1080
+ }, {
1081
+ type: HostListener,
1082
+ args: ['pointerleave']
1083
+ }], onMouseDown: [{
1084
+ type: HostListener,
1085
+ args: ['pointerdown']
1086
+ }], onMouseUp: [{
1087
+ type: HostListener,
1088
+ args: ['pointerup']
1089
1089
  }] } });
1090
1090
 
1091
- /**
1092
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1093
- *
1094
- * Website : -> http://www.turbogui.org
1095
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1096
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1097
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1098
- */
1099
- /**
1100
- * This component is a basic button that uses an image as its visual appearance
1101
- */
1102
- class ButtonImageComponent extends ButtonBaseComponent {
1103
- constructor() {
1104
- super(...arguments);
1105
- /**
1106
- * This is used to attach the fade animation directly to this component so it fades in and out when created and removed from the app
1107
- */
1108
- this.buttonFade = true;
1109
- /**
1110
- * Defines the path to the image that is shown by this button
1111
- */
1112
- this.src = '';
1113
- /**
1114
- * Defines the percentual size of the image based on the button size. 100 means the image will fill the whole button,
1115
- * 50 only half, etc..
1116
- */
1117
- this.percentSize = 100;
1118
- }
1119
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ButtonImageComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1120
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ButtonImageComponent, selector: "tg-button-image", inputs: { src: "src", percentSize: "percentSize" }, host: { properties: { "@buttonFade": "this.buttonFade" } }, usesInheritance: true, ngImport: i0, template: "<img src=\"{{src}}\"\r\n [style.width]=\"percentSize + '%'\"\r\n [style.height]=\"percentSize + '%'\" />", styles: [":host{-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:opacity .3s ease,transform .2s cubic-bezier(.04,.62,.58,1);display:flex;justify-content:center;align-items:center}img{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}\n"], animations: [FadeAnimationClass.getTrigger('buttonFade', '300ms ease', '300ms ease')] }); }
1121
- }
1122
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ButtonImageComponent, decorators: [{
1123
- type: Component,
1124
- args: [{ selector: 'tg-button-image', animations: [FadeAnimationClass.getTrigger('buttonFade', '300ms ease', '300ms ease')], template: "<img src=\"{{src}}\"\r\n [style.width]=\"percentSize + '%'\"\r\n [style.height]=\"percentSize + '%'\" />", styles: [":host{-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:opacity .3s ease,transform .2s cubic-bezier(.04,.62,.58,1);display:flex;justify-content:center;align-items:center}img{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}\n"] }]
1125
- }], propDecorators: { buttonFade: [{
1126
- type: HostBinding,
1127
- args: ['@buttonFade']
1128
- }], src: [{
1129
- type: Input
1130
- }], percentSize: [{
1131
- type: Input
1091
+ /**
1092
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1093
+ *
1094
+ * Website : -> http://www.turbogui.org
1095
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1096
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1097
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1098
+ */
1099
+ /**
1100
+ * This component is a basic button that uses an image as its visual appearance
1101
+ */
1102
+ class ButtonImageComponent extends ButtonBaseComponent {
1103
+ constructor() {
1104
+ super(...arguments);
1105
+ /**
1106
+ * This is used to attach the fade animation directly to this component so it fades in and out when created and removed from the app
1107
+ */
1108
+ this.buttonFade = true;
1109
+ /**
1110
+ * Defines the path to the image that is shown by this button
1111
+ */
1112
+ this.src = '';
1113
+ /**
1114
+ * Defines the percentual size of the image based on the button size. 100 means the image will fill the whole button,
1115
+ * 50 only half, etc..
1116
+ */
1117
+ this.percentSize = 100;
1118
+ }
1119
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ButtonImageComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1120
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: ButtonImageComponent, selector: "tg-button-image", inputs: { src: "src", percentSize: "percentSize" }, host: { properties: { "@buttonFade": "this.buttonFade" } }, usesInheritance: true, ngImport: i0, template: "<img src=\"{{src}}\"\r\n [style.width]=\"percentSize + '%'\"\r\n [style.height]=\"percentSize + '%'\" />", styles: [":host{-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:opacity .3s ease,transform .2s cubic-bezier(.04,.62,.58,1);display:flex;justify-content:center;align-items:center}img{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}\n"], animations: [FadeAnimationClass.getTrigger('buttonFade', '300ms ease', '300ms ease')] }); }
1121
+ }
1122
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ButtonImageComponent, decorators: [{
1123
+ type: Component,
1124
+ args: [{ selector: 'tg-button-image', animations: [FadeAnimationClass.getTrigger('buttonFade', '300ms ease', '300ms ease')], template: "<img src=\"{{src}}\"\r\n [style.width]=\"percentSize + '%'\"\r\n [style.height]=\"percentSize + '%'\" />", styles: [":host{-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:opacity .3s ease,transform .2s cubic-bezier(.04,.62,.58,1);display:flex;justify-content:center;align-items:center}img{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}\n"] }]
1125
+ }], propDecorators: { buttonFade: [{
1126
+ type: HostBinding,
1127
+ args: ['@buttonFade']
1128
+ }], src: [{
1129
+ type: Input
1130
+ }], percentSize: [{
1131
+ type: Input
1132
1132
  }] } });
1133
1133
 
1134
- /**
1135
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1136
- *
1137
- * Website : -> http://www.turbogui.org
1138
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1139
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1140
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1141
- */
1142
- /**
1143
- * This component is a basic button without visual appearance, that is used as a container to load any content.
1144
- */
1145
- class ButtonContainerComponent extends ButtonBaseComponent {
1146
- constructor() {
1147
- super(...arguments);
1148
- /**
1149
- * This is used to attach the fade animation directly to this component so it fades in and out when created and removed from the app
1150
- */
1151
- this.buttonFade = true;
1152
- }
1153
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ButtonContainerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1154
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ButtonContainerComponent, selector: "tg-button-container", host: { properties: { "@buttonFade": "this.buttonFade" } }, usesInheritance: true, ngImport: i0, template: "<ng-content></ng-content>", styles: [":host{-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:opacity .3s ease,transform .2s cubic-bezier(.04,.62,.58,1);display:flex;justify-content:center;align-items:center}\n"], animations: [FadeAnimationClass.getTrigger('buttonFade', '300ms ease', '300ms ease')] }); }
1155
- }
1156
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ButtonContainerComponent, decorators: [{
1157
- type: Component,
1158
- args: [{ selector: 'tg-button-container', animations: [FadeAnimationClass.getTrigger('buttonFade', '300ms ease', '300ms ease')], template: "<ng-content></ng-content>", styles: [":host{-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:opacity .3s ease,transform .2s cubic-bezier(.04,.62,.58,1);display:flex;justify-content:center;align-items:center}\n"] }]
1159
- }], propDecorators: { buttonFade: [{
1160
- type: HostBinding,
1161
- args: ['@buttonFade']
1134
+ /**
1135
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1136
+ *
1137
+ * Website : -> http://www.turbogui.org
1138
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1139
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1140
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1141
+ */
1142
+ /**
1143
+ * This component is a basic button without visual appearance, that is used as a container to load any content.
1144
+ */
1145
+ class ButtonContainerComponent extends ButtonBaseComponent {
1146
+ constructor() {
1147
+ super(...arguments);
1148
+ /**
1149
+ * This is used to attach the fade animation directly to this component so it fades in and out when created and removed from the app
1150
+ */
1151
+ this.buttonFade = true;
1152
+ }
1153
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ButtonContainerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1154
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: ButtonContainerComponent, selector: "tg-button-container", host: { properties: { "@buttonFade": "this.buttonFade" } }, usesInheritance: true, ngImport: i0, template: "<ng-content></ng-content>", styles: [":host{-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:opacity .3s ease,transform .2s cubic-bezier(.04,.62,.58,1);display:flex;justify-content:center;align-items:center}\n"], animations: [FadeAnimationClass.getTrigger('buttonFade', '300ms ease', '300ms ease')] }); }
1155
+ }
1156
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ButtonContainerComponent, decorators: [{
1157
+ type: Component,
1158
+ args: [{ selector: 'tg-button-container', animations: [FadeAnimationClass.getTrigger('buttonFade', '300ms ease', '300ms ease')], template: "<ng-content></ng-content>", styles: [":host{-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:opacity .3s ease,transform .2s cubic-bezier(.04,.62,.58,1);display:flex;justify-content:center;align-items:center}\n"] }]
1159
+ }], propDecorators: { buttonFade: [{
1160
+ type: HostBinding,
1161
+ args: ['@buttonFade']
1162
1162
  }] } });
1163
1163
 
1164
- /**
1165
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1166
- *
1167
- * Website : -> http://www.turbogui.org
1168
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1169
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1170
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1171
- */
1172
- /**
1173
- * A dialog component with a single option button, to be used with dialog service
1174
- */
1175
- class DialogSingleOptionComponent extends DialogOptionsBaseComponent {
1176
- constructor(dialogRef, data) {
1177
- super();
1178
- this.dialogRef = dialogRef;
1179
- this.data = data;
1180
- if (data.texts.length < 1) {
1181
- throw new Error('DialogSingleOptionComponent expects 2 texts: The title and optionally a description');
1182
- }
1183
- if (data.options.length !== 1) {
1184
- throw new Error('DialogSingleOptionComponent expects only one option');
1185
- }
1186
- }
1187
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DialogSingleOptionComponent, deps: [{ token: i1$1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
1188
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DialogSingleOptionComponent, selector: "tg-dialog-single-option", 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)=\"dialogRef.close(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: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
1189
- }
1190
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DialogSingleOptionComponent, decorators: [{
1191
- type: Component,
1192
- args: [{ selector: 'tg-dialog-single-option', 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)=\"dialogRef.close(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"] }]
1193
- }], ctorParameters: function () { return [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
1194
- type: Inject,
1195
- args: [MAT_DIALOG_DATA]
1196
- }] }]; } });
1164
+ /**
1165
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1166
+ *
1167
+ * Website : -> http://www.turbogui.org
1168
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1169
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1170
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1171
+ */
1172
+ /**
1173
+ * A dialog component with a single option button, to be used with dialog service
1174
+ */
1175
+ class DialogSingleOptionComponent extends DialogOptionsBaseComponent {
1176
+ constructor(dialogRef, data) {
1177
+ super();
1178
+ this.dialogRef = dialogRef;
1179
+ this.data = data;
1180
+ if (data.texts.length < 1) {
1181
+ throw new Error('DialogSingleOptionComponent expects 2 texts: The title and optionally a description');
1182
+ }
1183
+ if (data.options.length !== 1) {
1184
+ throw new Error('DialogSingleOptionComponent expects only one option');
1185
+ }
1186
+ }
1187
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: DialogSingleOptionComponent, deps: [{ token: i1$1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
1188
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: DialogSingleOptionComponent, selector: "tg-dialog-single-option", 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)=\"dialogRef.close(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: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
1189
+ }
1190
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: DialogSingleOptionComponent, decorators: [{
1191
+ type: Component,
1192
+ args: [{ selector: 'tg-dialog-single-option', 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)=\"dialogRef.close(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"] }]
1193
+ }], ctorParameters: () => [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
1194
+ type: Inject,
1195
+ args: [MAT_DIALOG_DATA]
1196
+ }] }] });
1197
1197
 
1198
- /**
1199
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1200
- *
1201
- * Website : -> http://www.turbogui.org
1202
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1203
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1204
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1205
- */
1206
- /**
1207
- * A dialog component with two option buttons, to be used with dialog service.
1208
- * The first of the options is considered to be the primary one and will therefore have more visual accent
1209
- */
1210
- class DialogTwoOptionComponent extends DialogOptionsBaseComponent {
1211
- constructor(dialogRef, data) {
1212
- super();
1213
- this.dialogRef = dialogRef;
1214
- this.data = data;
1215
- if (data.texts.length < 1) {
1216
- throw new Error('DialogTwoOptionComponent expects 2 texts: The title and optionally a description');
1217
- }
1218
- if (data.options.length !== 2) {
1219
- throw new Error('DialogTwoOptionComponent expects only two options');
1220
- }
1221
- }
1222
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DialogTwoOptionComponent, deps: [{ token: i1$1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
1223
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DialogTwoOptionComponent, selector: "tg-dialog-two-option", 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<div class=\"buttonsContainer\">\r\n\r\n <button mat-raised-button color=\"primary\" class=\"primaryButton\"\r\n (click)=\"dialogRef.close(0)\">\r\n \r\n {{data.options[0]}}\r\n \r\n </button>\r\n \r\n <button mat-button\r\n (click)=\"dialogRef.close(1)\">\r\n \r\n {{data.options[1]}}\r\n \r\n </button>\r\n \r\n</div>\r\n", styles: [":host{min-height:300px}h3{margin-bottom:25px}p{margin-bottom:52px}.buttonsContainer{width:100%;max-width:530px;display:flex;flex-direction:row-reverse;float:right}button{width:50%;padding:0}.primaryButton{margin-left:2%}\n"], dependencies: [{ kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
1224
- }
1225
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DialogTwoOptionComponent, decorators: [{
1226
- type: Component,
1227
- args: [{ selector: 'tg-dialog-two-option', 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<div class=\"buttonsContainer\">\r\n\r\n <button mat-raised-button color=\"primary\" class=\"primaryButton\"\r\n (click)=\"dialogRef.close(0)\">\r\n \r\n {{data.options[0]}}\r\n \r\n </button>\r\n \r\n <button mat-button\r\n (click)=\"dialogRef.close(1)\">\r\n \r\n {{data.options[1]}}\r\n \r\n </button>\r\n \r\n</div>\r\n", styles: [":host{min-height:300px}h3{margin-bottom:25px}p{margin-bottom:52px}.buttonsContainer{width:100%;max-width:530px;display:flex;flex-direction:row-reverse;float:right}button{width:50%;padding:0}.primaryButton{margin-left:2%}\n"] }]
1228
- }], ctorParameters: function () { return [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
1229
- type: Inject,
1230
- args: [MAT_DIALOG_DATA]
1231
- }] }]; } });
1198
+ /**
1199
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1200
+ *
1201
+ * Website : -> http://www.turbogui.org
1202
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1203
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1204
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1205
+ */
1206
+ /**
1207
+ * A dialog component with two option buttons, to be used with dialog service.
1208
+ * The first of the options is considered to be the primary one and will therefore have more visual accent
1209
+ */
1210
+ class DialogTwoOptionComponent extends DialogOptionsBaseComponent {
1211
+ constructor(dialogRef, data) {
1212
+ super();
1213
+ this.dialogRef = dialogRef;
1214
+ this.data = data;
1215
+ if (data.texts.length < 1) {
1216
+ throw new Error('DialogTwoOptionComponent expects 2 texts: The title and optionally a description');
1217
+ }
1218
+ if (data.options.length !== 2) {
1219
+ throw new Error('DialogTwoOptionComponent expects only two options');
1220
+ }
1221
+ }
1222
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: DialogTwoOptionComponent, deps: [{ token: i1$1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
1223
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: DialogTwoOptionComponent, selector: "tg-dialog-two-option", 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<div class=\"buttonsContainer\">\r\n\r\n <button mat-raised-button color=\"primary\" class=\"primaryButton\"\r\n (click)=\"dialogRef.close(0)\">\r\n \r\n {{data.options[0]}}\r\n \r\n </button>\r\n \r\n <button mat-button\r\n (click)=\"dialogRef.close(1)\">\r\n \r\n {{data.options[1]}}\r\n \r\n </button>\r\n \r\n</div>\r\n", styles: [":host{min-height:300px}h3{margin-bottom:25px}p{margin-bottom:52px}.buttonsContainer{width:100%;max-width:530px;display:flex;flex-direction:row-reverse;float:right}button{width:50%;padding:0}.primaryButton{margin-left:2%}\n"], dependencies: [{ kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
1224
+ }
1225
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: DialogTwoOptionComponent, decorators: [{
1226
+ type: Component,
1227
+ args: [{ selector: 'tg-dialog-two-option', 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<div class=\"buttonsContainer\">\r\n\r\n <button mat-raised-button color=\"primary\" class=\"primaryButton\"\r\n (click)=\"dialogRef.close(0)\">\r\n \r\n {{data.options[0]}}\r\n \r\n </button>\r\n \r\n <button mat-button\r\n (click)=\"dialogRef.close(1)\">\r\n \r\n {{data.options[1]}}\r\n \r\n </button>\r\n \r\n</div>\r\n", styles: [":host{min-height:300px}h3{margin-bottom:25px}p{margin-bottom:52px}.buttonsContainer{width:100%;max-width:530px;display:flex;flex-direction:row-reverse;float:right}button{width:50%;padding:0}.primaryButton{margin-left:2%}\n"] }]
1228
+ }], ctorParameters: () => [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
1229
+ type: Inject,
1230
+ args: [MAT_DIALOG_DATA]
1231
+ }] }] });
1232
1232
 
1233
- /**
1234
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1235
- *
1236
- * Website : -> http://www.turbogui.org
1237
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1238
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1239
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1240
- */
1241
- /**
1242
- * An abstraction of the browser entity an all its related operations and properties
1243
- */
1244
- class BrowserService extends BrowserManager {
1245
- constructor(location) {
1246
- super();
1247
- this.location = location;
1248
- }
1249
- /**
1250
- * Modify the current browser URI without reloading the current page document
1251
- *
1252
- * @param path The uri value we want to set
1253
- * @param query The query url parameters part we want to specify if any
1254
- *
1255
- * @returns void
1256
- */
1257
- setURI(path, query) {
1258
- this.location.go(path, query);
1259
- }
1260
- /**
1261
- * Obtain a subscription to get notified on any changes at the browser url
1262
- *
1263
- * @param onNext A method to be executed every time the url changes on the browser. The url will be available inside the value parameter
1264
- *
1265
- * @returns Subscribed events. Make sure to unsubscribe when not needed
1266
- */
1267
- subscribeToUrlChange(onNext) {
1268
- return this.location.subscribe(onNext);
1269
- }
1270
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BrowserService, deps: [{ token: i3.Location }], target: i0.ɵɵFactoryTarget.Injectable }); }
1271
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BrowserService }); }
1272
- }
1273
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BrowserService, decorators: [{
1274
- type: Injectable
1275
- }], ctorParameters: function () { return [{ type: i3.Location }]; } });
1233
+ /**
1234
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1235
+ *
1236
+ * Website : -> http://www.turbogui.org
1237
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1238
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1239
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1240
+ */
1241
+ /**
1242
+ * An abstraction of the browser entity an all its related operations and properties
1243
+ */
1244
+ class BrowserService extends BrowserManager {
1245
+ constructor(location) {
1246
+ super();
1247
+ this.location = location;
1248
+ }
1249
+ /**
1250
+ * Modify the current browser URI without reloading the current page document
1251
+ *
1252
+ * @param path The uri value we want to set
1253
+ * @param query The query url parameters part we want to specify if any
1254
+ *
1255
+ * @returns void
1256
+ */
1257
+ setURI(path, query) {
1258
+ this.location.go(path, query);
1259
+ }
1260
+ /**
1261
+ * Obtain a subscription to get notified on any changes at the browser url
1262
+ *
1263
+ * @param onNext A method to be executed every time the url changes on the browser. The url will be available inside the value parameter
1264
+ *
1265
+ * @returns Subscribed events. Make sure to unsubscribe when not needed
1266
+ */
1267
+ subscribeToUrlChange(onNext) {
1268
+ return this.location.subscribe(onNext);
1269
+ }
1270
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: BrowserService, deps: [{ token: i3.Location }], target: i0.ɵɵFactoryTarget.Injectable }); }
1271
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: BrowserService }); }
1272
+ }
1273
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: BrowserService, decorators: [{
1274
+ type: Injectable
1275
+ }], ctorParameters: () => [{ type: i3.Location }] });
1276
1276
 
1277
- /**
1278
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1279
- *
1280
- * Website : -> http://www.turbogui.org
1281
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1282
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1283
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1284
- */
1285
- /** This directive is used to perform an autofocus on an element every time it is displayed */
1286
- /**
1287
- * This directive is used to perform an autofocus on an element every time it is displayed
1288
- * If we set the autoFocusOnDisplay tag to the html element, it will be automatically focused after it is shown.
1289
- */
1290
- class AutoFocusOnDisplayDirective {
1291
- constructor(el, zone, renderer) {
1292
- this.el = el;
1293
- this.zone = zone;
1294
- this.renderer = renderer;
1295
- if (!el.nativeElement['focus']) {
1296
- throw new Error('Element does not accept focus');
1297
- }
1298
- }
1299
- ngAfterContentInit() {
1300
- this.zone.runOutsideAngular(() => setTimeout(() => {
1301
- this.renderer.selectRootElement(this.el.nativeElement).focus();
1302
- }, 0));
1303
- }
1304
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AutoFocusOnDisplayDirective, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
1305
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: AutoFocusOnDisplayDirective, selector: "[autoFocusOnDisplay]", ngImport: i0 }); }
1306
- }
1307
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AutoFocusOnDisplayDirective, decorators: [{
1308
- type: Directive,
1309
- args: [{
1310
- selector: '[autoFocusOnDisplay]'
1311
- }]
1312
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: i0.Renderer2 }]; } });
1277
+ /**
1278
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1279
+ *
1280
+ * Website : -> http://www.turbogui.org
1281
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1282
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1283
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1284
+ */
1285
+ /** This directive is used to perform an autofocus on an element every time it is displayed */
1286
+ /**
1287
+ * This directive is used to perform an autofocus on an element every time it is displayed
1288
+ * If we set the autoFocusOnDisplay tag to the html element, it will be automatically focused after it is shown.
1289
+ */
1290
+ class AutoFocusOnDisplayDirective {
1291
+ constructor(el, zone, renderer) {
1292
+ this.el = el;
1293
+ this.zone = zone;
1294
+ this.renderer = renderer;
1295
+ if (!el.nativeElement['focus']) {
1296
+ throw new Error('Element does not accept focus');
1297
+ }
1298
+ }
1299
+ ngAfterContentInit() {
1300
+ this.zone.runOutsideAngular(() => setTimeout(() => {
1301
+ this.renderer.selectRootElement(this.el.nativeElement).focus();
1302
+ }, 0));
1303
+ }
1304
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AutoFocusOnDisplayDirective, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
1305
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.8", type: AutoFocusOnDisplayDirective, selector: "[autoFocusOnDisplay]", ngImport: i0 }); }
1306
+ }
1307
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AutoFocusOnDisplayDirective, decorators: [{
1308
+ type: Directive,
1309
+ args: [{
1310
+ selector: '[autoFocusOnDisplay]'
1311
+ }]
1312
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: i0.Renderer2 }] });
1313
1313
 
1314
- /**
1315
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1316
- *
1317
- * Website : -> http://www.turbogui.org
1318
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1319
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1320
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1321
- */
1322
- /**
1323
- * A dialog component which allows us to select one single item from a list. The elements on that list are displayed on a table
1324
- * which may show a scroll if necessary when there are many elements on the list.
1325
- *
1326
- * It also allows us to filter inside the list with a custom text that we can type into a search input, which is optional.
1327
- *
1328
- * texts parameter must contain the title, the description (optional), the filter input title (optional), and the submit button caption.
1329
- * If that caption is not provided, the selection will be automatically performed once user clicks on an element on the list. Otherwise,
1330
- * the element will be selected on the list and the selection will be performed once the user clicks on the submit button.
1331
- *
1332
- * options parameter must contain the list of elements that will be displayed to the user
1333
- */
1334
- class DialogSingleSelectionListComponent extends DialogOptionsBaseComponent {
1335
- constructor(dialogRef, browserService, data) {
1336
- super();
1337
- this.dialogRef = dialogRef;
1338
- this.browserService = browserService;
1339
- this.data = data;
1340
- /**
1341
- * Declare a reference to the string utils class so it can be used on the html part
1342
- */
1343
- this.stringUtils = StringUtils;
1344
- /**
1345
- * Contains the list of elements that will be directly shown to the user at the component list.
1346
- * It may be filtered or not depending on this component setup and the user input
1347
- */
1348
- this.filteredOptions = [];
1349
- /**
1350
- * Contains the original list of elements that are provided to be listed on this component before
1351
- * being possibly filtered. It is only used as a backup, not shown to the user
1352
- */
1353
- this.originalOptions = [];
1354
- /**
1355
- * The same list as the originally provided but processed for a better text search.
1356
- * It will be used to perform the search, but not shown to the user.
1357
- */
1358
- this.originalOptionsFullTextSearch = [];
1359
- /**
1360
- * Stores the index for the element that's been selected by the user
1361
- */
1362
- this.selectedItemIndex = -1;
1363
- /**
1364
- * This method is used to greatly improve ngFor performance with arrays of primitive values. It tells the refresh
1365
- * function to work by index instead of by value. The change in performance when refreshing the list is massive.
1366
- */
1367
- this.trackByFn = (index, _value) => index;
1368
- if (data.texts.length < 1) {
1369
- throw new Error('DialogSingleSelectionListComponent expects 4 texts: The title, the description (optional), the filter input title (optional), and the submit button caption');
1370
- }
1371
- if (data.options.length < 1) {
1372
- throw new Error('DialogSingleSelectionListComponent expects one or more options');
1373
- }
1374
- this.originalOptions = data.options;
1375
- for (let option of this.originalOptions) {
1376
- this.filteredOptions.push(option);
1377
- this.originalOptionsFullTextSearch.push(StringUtils.formatForFullTextSearch(option));
1378
- }
1379
- }
1380
- /**
1381
- * Method to calculate the max possible height that the list items container is allowed to have
1382
- */
1383
- getListItemsContainerMaxheight() {
1384
- return (this.browserService.getWindowHeight() * 0.6) + 'px';
1385
- }
1386
- /**
1387
- * When the user types a value on the input element to filter the list, this method will perform
1388
- * that filtering and refresh the list
1389
- */
1390
- onSearchChange(input) {
1391
- this.selectedItemIndex = -1;
1392
- let inputValue = StringUtils.formatForFullTextSearch(input.value);
1393
- for (let i = 0; i < this.originalOptionsFullTextSearch.length; i++) {
1394
- if (inputValue === '' ||
1395
- this.originalOptionsFullTextSearch[i].indexOf(inputValue) >= 0) {
1396
- this.filteredOptions[i] = this.originalOptions[i];
1397
- }
1398
- else {
1399
- this.filteredOptions[i] = '';
1400
- }
1401
- }
1402
- }
1403
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DialogSingleSelectionListComponent, deps: [{ token: i1$1.MatDialogRef }, { token: BrowserService }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
1404
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DialogSingleSelectionListComponent, selector: "tg-dialog-single-selection-list", usesInheritance: true, ngImport: i0, template: "<h3>\r\n {{data.texts[0]}}\r\n</h3>\r\n\r\n<p *ngIf=\"data.texts.length > 1 &amp;&amp; !stringUtils.isEmpty(data.texts[1])\">\r\n {{data.texts[1]}}\r\n</p>\r\n\r\n<mat-form-field *ngIf=\"data.texts.length > 2 &amp;&amp; !stringUtils.isEmpty(data.texts[2])\"\r\n class=\"searchItemInputContainer\">\r\n \r\n <mat-label>{{data.texts[2]}}</mat-label>\r\n <input matInput autoFocusOnDisplay\r\n (input)=\"onSearchChange($event.target)\">\r\n \r\n</mat-form-field>\r\n\r\n<div class=\"listItemsContainer\"\r\n [style.max-height]=\"getListItemsContainerMaxheight()\">\r\n\r\n <div class=\"listItemContainer\"\r\n [style.background-color]=\"selectedItemIndex === i ? '#90d1ffad' : (i % 2 === 0 ? 'initial' : '#00000009')\"\r\n *ngFor=\"let item of filteredOptions; let i = index; trackBy: trackByFn\"\r\n (click)=\"data.texts.length < 4 ? dialogRef.close(i) : selectedItemIndex = i\">\r\n \r\n <p *ngIf=\"item !== ''\">\r\n {{item}}\r\n </p>\r\n \r\n </div>\r\n\r\n</div>\r\n\r\n<button mat-raised-button color=\"primary\"\r\n [disabled]=\"selectedItemIndex < 0\"\r\n (click)=\"dialogRef.close(selectedItemIndex)\"\r\n *ngIf=\"data.texts.length > 3\">\r\n\r\n {{data.texts[3]}}\r\n \r\n</button>", styles: [":host{min-height:300px}h3{margin-top:0;margin-bottom:10px}p{margin-top:0;margin-bottom:5px}.searchItemInputContainer{width:100%;margin-top:0;margin-bottom:0}.listItemsContainer{overflow-y:auto;border:1px solid rgba(0,0,0,.2);border-radius:4px;margin-bottom:5px}.listItemContainer p{line-height:36px;width:calc(100% - 12px);margin:0 0 0 6px}button{float:right}\n"], dependencies: [{ kind: "directive", type: i3$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: AutoFocusOnDisplayDirective, selector: "[autoFocusOnDisplay]" }] }); }
1405
- }
1406
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DialogSingleSelectionListComponent, decorators: [{
1407
- type: Component,
1408
- args: [{ selector: 'tg-dialog-single-selection-list', template: "<h3>\r\n {{data.texts[0]}}\r\n</h3>\r\n\r\n<p *ngIf=\"data.texts.length > 1 &amp;&amp; !stringUtils.isEmpty(data.texts[1])\">\r\n {{data.texts[1]}}\r\n</p>\r\n\r\n<mat-form-field *ngIf=\"data.texts.length > 2 &amp;&amp; !stringUtils.isEmpty(data.texts[2])\"\r\n class=\"searchItemInputContainer\">\r\n \r\n <mat-label>{{data.texts[2]}}</mat-label>\r\n <input matInput autoFocusOnDisplay\r\n (input)=\"onSearchChange($event.target)\">\r\n \r\n</mat-form-field>\r\n\r\n<div class=\"listItemsContainer\"\r\n [style.max-height]=\"getListItemsContainerMaxheight()\">\r\n\r\n <div class=\"listItemContainer\"\r\n [style.background-color]=\"selectedItemIndex === i ? '#90d1ffad' : (i % 2 === 0 ? 'initial' : '#00000009')\"\r\n *ngFor=\"let item of filteredOptions; let i = index; trackBy: trackByFn\"\r\n (click)=\"data.texts.length < 4 ? dialogRef.close(i) : selectedItemIndex = i\">\r\n \r\n <p *ngIf=\"item !== ''\">\r\n {{item}}\r\n </p>\r\n \r\n </div>\r\n\r\n</div>\r\n\r\n<button mat-raised-button color=\"primary\"\r\n [disabled]=\"selectedItemIndex < 0\"\r\n (click)=\"dialogRef.close(selectedItemIndex)\"\r\n *ngIf=\"data.texts.length > 3\">\r\n\r\n {{data.texts[3]}}\r\n \r\n</button>", styles: [":host{min-height:300px}h3{margin-top:0;margin-bottom:10px}p{margin-top:0;margin-bottom:5px}.searchItemInputContainer{width:100%;margin-top:0;margin-bottom:0}.listItemsContainer{overflow-y:auto;border:1px solid rgba(0,0,0,.2);border-radius:4px;margin-bottom:5px}.listItemContainer p{line-height:36px;width:calc(100% - 12px);margin:0 0 0 6px}button{float:right}\n"] }]
1409
- }], ctorParameters: function () { return [{ type: i1$1.MatDialogRef }, { type: BrowserService }, { type: undefined, decorators: [{
1410
- type: Inject,
1411
- args: [MAT_DIALOG_DATA]
1412
- }] }]; } });
1314
+ /**
1315
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1316
+ *
1317
+ * Website : -> http://www.turbogui.org
1318
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1319
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1320
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1321
+ */
1322
+ /**
1323
+ * A dialog component which allows us to select one single item from a list. The elements on that list are displayed on a table
1324
+ * which may show a scroll if necessary when there are many elements on the list.
1325
+ *
1326
+ * It also allows us to filter inside the list with a custom text that we can type into a search input, which is optional.
1327
+ *
1328
+ * texts parameter must contain the title, the description (optional), the filter input title (optional), and the submit button caption.
1329
+ * If that caption is not provided, the selection will be automatically performed once user clicks on an element on the list. Otherwise,
1330
+ * the element will be selected on the list and the selection will be performed once the user clicks on the submit button.
1331
+ *
1332
+ * options parameter must contain the list of elements that will be displayed to the user
1333
+ */
1334
+ class DialogSingleSelectionListComponent extends DialogOptionsBaseComponent {
1335
+ constructor(dialogRef, browserService, data) {
1336
+ super();
1337
+ this.dialogRef = dialogRef;
1338
+ this.browserService = browserService;
1339
+ this.data = data;
1340
+ /**
1341
+ * Declare a reference to the string utils class so it can be used on the html part
1342
+ */
1343
+ this.stringUtils = StringUtils;
1344
+ /**
1345
+ * Contains the list of elements that will be directly shown to the user at the component list.
1346
+ * It may be filtered or not depending on this component setup and the user input
1347
+ */
1348
+ this.filteredOptions = [];
1349
+ /**
1350
+ * Contains the original list of elements that are provided to be listed on this component before
1351
+ * being possibly filtered. It is only used as a backup, not shown to the user
1352
+ */
1353
+ this.originalOptions = [];
1354
+ /**
1355
+ * The same list as the originally provided but processed for a better text search.
1356
+ * It will be used to perform the search, but not shown to the user.
1357
+ */
1358
+ this.originalOptionsFullTextSearch = [];
1359
+ /**
1360
+ * Stores the index for the element that's been selected by the user
1361
+ */
1362
+ this.selectedItemIndex = -1;
1363
+ /**
1364
+ * This method is used to greatly improve ngFor performance with arrays of primitive values. It tells the refresh
1365
+ * function to work by index instead of by value. The change in performance when refreshing the list is massive.
1366
+ */
1367
+ this.trackByFn = (index, _value) => index;
1368
+ if (data.texts.length < 1) {
1369
+ throw new Error('DialogSingleSelectionListComponent expects 4 texts: The title, the description (optional), the filter input title (optional), and the submit button caption');
1370
+ }
1371
+ if (data.options.length < 1) {
1372
+ throw new Error('DialogSingleSelectionListComponent expects one or more options');
1373
+ }
1374
+ this.originalOptions = data.options;
1375
+ for (let option of this.originalOptions) {
1376
+ this.filteredOptions.push(option);
1377
+ this.originalOptionsFullTextSearch.push(StringUtils.formatForFullTextSearch(option));
1378
+ }
1379
+ }
1380
+ /**
1381
+ * Method to calculate the max possible height that the list items container is allowed to have
1382
+ */
1383
+ getListItemsContainerMaxheight() {
1384
+ return (this.browserService.getWindowHeight() * 0.6) + 'px';
1385
+ }
1386
+ /**
1387
+ * When the user types a value on the input element to filter the list, this method will perform
1388
+ * that filtering and refresh the list
1389
+ */
1390
+ onSearchChange(input) {
1391
+ this.selectedItemIndex = -1;
1392
+ let inputValue = StringUtils.formatForFullTextSearch(input.value);
1393
+ for (let i = 0; i < this.originalOptionsFullTextSearch.length; i++) {
1394
+ if (inputValue === '' ||
1395
+ this.originalOptionsFullTextSearch[i].indexOf(inputValue) >= 0) {
1396
+ this.filteredOptions[i] = this.originalOptions[i];
1397
+ }
1398
+ else {
1399
+ this.filteredOptions[i] = '';
1400
+ }
1401
+ }
1402
+ }
1403
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: DialogSingleSelectionListComponent, deps: [{ token: i1$1.MatDialogRef }, { token: BrowserService }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
1404
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: DialogSingleSelectionListComponent, selector: "tg-dialog-single-selection-list", usesInheritance: true, ngImport: i0, template: "<h3>\r\n {{data.texts[0]}}\r\n</h3>\r\n\r\n<p *ngIf=\"data.texts.length > 1 &amp;&amp; !stringUtils.isEmpty(data.texts[1])\">\r\n {{data.texts[1]}}\r\n</p>\r\n\r\n<mat-form-field *ngIf=\"data.texts.length > 2 &amp;&amp; !stringUtils.isEmpty(data.texts[2])\"\r\n class=\"searchItemInputContainer\">\r\n \r\n <mat-label>{{data.texts[2]}}</mat-label>\r\n <input matInput autoFocusOnDisplay\r\n (input)=\"onSearchChange($event.target)\">\r\n \r\n</mat-form-field>\r\n\r\n<div class=\"listItemsContainer\"\r\n [style.max-height]=\"getListItemsContainerMaxheight()\">\r\n\r\n <div class=\"listItemContainer\"\r\n [style.background-color]=\"selectedItemIndex === i ? '#90d1ffad' : (i % 2 === 0 ? 'initial' : '#00000009')\"\r\n *ngFor=\"let item of filteredOptions; let i = index; trackBy: trackByFn\"\r\n (click)=\"data.texts.length < 4 ? dialogRef.close(i) : selectedItemIndex = i\">\r\n \r\n <p *ngIf=\"item !== ''\">\r\n {{item}}\r\n </p>\r\n \r\n </div>\r\n\r\n</div>\r\n\r\n<button mat-raised-button color=\"primary\"\r\n [disabled]=\"selectedItemIndex < 0\"\r\n (click)=\"dialogRef.close(selectedItemIndex)\"\r\n *ngIf=\"data.texts.length > 3\">\r\n\r\n {{data.texts[3]}}\r\n \r\n</button>", styles: [":host{min-height:300px}h3{margin-top:0;margin-bottom:10px}p{margin-top:0;margin-bottom:5px}.searchItemInputContainer{width:100%;margin-top:0;margin-bottom:0}.listItemsContainer{overflow-y:auto;border:1px solid rgba(0,0,0,.2);border-radius:4px;margin-bottom:5px}.listItemContainer p{line-height:36px;width:calc(100% - 12px);margin:0 0 0 6px}button{float:right}\n"], dependencies: [{ kind: "directive", type: i3$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: AutoFocusOnDisplayDirective, selector: "[autoFocusOnDisplay]" }] }); }
1405
+ }
1406
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: DialogSingleSelectionListComponent, decorators: [{
1407
+ type: Component,
1408
+ args: [{ selector: 'tg-dialog-single-selection-list', template: "<h3>\r\n {{data.texts[0]}}\r\n</h3>\r\n\r\n<p *ngIf=\"data.texts.length > 1 &amp;&amp; !stringUtils.isEmpty(data.texts[1])\">\r\n {{data.texts[1]}}\r\n</p>\r\n\r\n<mat-form-field *ngIf=\"data.texts.length > 2 &amp;&amp; !stringUtils.isEmpty(data.texts[2])\"\r\n class=\"searchItemInputContainer\">\r\n \r\n <mat-label>{{data.texts[2]}}</mat-label>\r\n <input matInput autoFocusOnDisplay\r\n (input)=\"onSearchChange($event.target)\">\r\n \r\n</mat-form-field>\r\n\r\n<div class=\"listItemsContainer\"\r\n [style.max-height]=\"getListItemsContainerMaxheight()\">\r\n\r\n <div class=\"listItemContainer\"\r\n [style.background-color]=\"selectedItemIndex === i ? '#90d1ffad' : (i % 2 === 0 ? 'initial' : '#00000009')\"\r\n *ngFor=\"let item of filteredOptions; let i = index; trackBy: trackByFn\"\r\n (click)=\"data.texts.length < 4 ? dialogRef.close(i) : selectedItemIndex = i\">\r\n \r\n <p *ngIf=\"item !== ''\">\r\n {{item}}\r\n </p>\r\n \r\n </div>\r\n\r\n</div>\r\n\r\n<button mat-raised-button color=\"primary\"\r\n [disabled]=\"selectedItemIndex < 0\"\r\n (click)=\"dialogRef.close(selectedItemIndex)\"\r\n *ngIf=\"data.texts.length > 3\">\r\n\r\n {{data.texts[3]}}\r\n \r\n</button>", styles: [":host{min-height:300px}h3{margin-top:0;margin-bottom:10px}p{margin-top:0;margin-bottom:5px}.searchItemInputContainer{width:100%;margin-top:0;margin-bottom:0}.listItemsContainer{overflow-y:auto;border:1px solid rgba(0,0,0,.2);border-radius:4px;margin-bottom:5px}.listItemContainer p{line-height:36px;width:calc(100% - 12px);margin:0 0 0 6px}button{float:right}\n"] }]
1409
+ }], ctorParameters: () => [{ type: i1$1.MatDialogRef }, { type: BrowserService }, { type: undefined, decorators: [{
1410
+ type: Inject,
1411
+ args: [MAT_DIALOG_DATA]
1412
+ }] }] });
1413
1413
 
1414
- /**
1415
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1416
- *
1417
- * Website : -> http://www.turbogui.org
1418
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1419
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1420
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1421
- */
1422
- /**
1423
- * A dialog component that is designed to show more than one option buttons (usually more than two), to be used with dialog service
1424
- */
1425
- class DialogMultipleOptionComponent extends DialogOptionsBaseComponent {
1426
- constructor(dialogRef, data) {
1427
- super();
1428
- this.dialogRef = dialogRef;
1429
- this.data = data;
1430
- if (data.texts.length < 1) {
1431
- throw new Error('DialogMultipleOptionComponent expects 2 texts: The title and optionally a description');
1432
- }
1433
- }
1434
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DialogMultipleOptionComponent, deps: [{ token: i1$1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
1435
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DialogMultipleOptionComponent, selector: "tg-dialog-multiple-option", 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 *ngFor=\"let option of data.options; let i = index\"\r\n (click)=\"dialogRef.close(i)\">\r\n \r\n {{option}}\r\n \r\n</button>", styles: [":host{display:flex;flex-direction:column;min-height:193px}h3{margin-bottom:45px}button{margin-bottom:25px}\n"], dependencies: [{ kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
1436
- }
1437
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DialogMultipleOptionComponent, decorators: [{
1438
- type: Component,
1439
- args: [{ selector: 'tg-dialog-multiple-option', 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 *ngFor=\"let option of data.options; let i = index\"\r\n (click)=\"dialogRef.close(i)\">\r\n \r\n {{option}}\r\n \r\n</button>", styles: [":host{display:flex;flex-direction:column;min-height:193px}h3{margin-bottom:45px}button{margin-bottom:25px}\n"] }]
1440
- }], ctorParameters: function () { return [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
1441
- type: Inject,
1442
- args: [MAT_DIALOG_DATA]
1443
- }] }]; } });
1414
+ /**
1415
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1416
+ *
1417
+ * Website : -> http://www.turbogui.org
1418
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1419
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1420
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1421
+ */
1422
+ /**
1423
+ * A dialog component that is designed to show more than one option buttons (usually more than two), to be used with dialog service
1424
+ */
1425
+ class DialogMultipleOptionComponent extends DialogOptionsBaseComponent {
1426
+ constructor(dialogRef, data) {
1427
+ super();
1428
+ this.dialogRef = dialogRef;
1429
+ this.data = data;
1430
+ if (data.texts.length < 1) {
1431
+ throw new Error('DialogMultipleOptionComponent expects 2 texts: The title and optionally a description');
1432
+ }
1433
+ }
1434
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: DialogMultipleOptionComponent, deps: [{ token: i1$1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
1435
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.8", type: DialogMultipleOptionComponent, selector: "tg-dialog-multiple-option", 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 *ngFor=\"let option of data.options; let i = index\"\r\n (click)=\"dialogRef.close(i)\">\r\n \r\n {{option}}\r\n \r\n</button>", styles: [":host{display:flex;flex-direction:column;min-height:193px}h3{margin-bottom:45px}button{margin-bottom:25px}\n"], dependencies: [{ kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
1436
+ }
1437
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: DialogMultipleOptionComponent, decorators: [{
1438
+ type: Component,
1439
+ args: [{ selector: 'tg-dialog-multiple-option', 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 *ngFor=\"let option of data.options; let i = index\"\r\n (click)=\"dialogRef.close(i)\">\r\n \r\n {{option}}\r\n \r\n</button>", styles: [":host{display:flex;flex-direction:column;min-height:193px}h3{margin-bottom:45px}button{margin-bottom:25px}\n"] }]
1440
+ }], ctorParameters: () => [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
1441
+ type: Inject,
1442
+ args: [MAT_DIALOG_DATA]
1443
+ }] }] });
1444
1444
 
1445
- /**
1446
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1447
- *
1448
- * Website : -> http://www.turbogui.org
1449
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1450
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1451
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1452
- */
1453
- /** This directive is used to listen for onInit events on raw html elements */
1454
- /**
1455
- * This directive is used to listen for onInit events on raw html elements
1456
- * If we place (elementCreated)="someMethod()" on the element at the html template part, when the element
1457
- * that uses this directive is visually created, someMethod() will be called.
1458
- */
1459
- class ElementCreatedDirective {
1460
- constructor() {
1461
- /**
1462
- * Event that will be dispatched once element is created
1463
- */
1464
- this.elementCreated = new EventEmitter();
1465
- }
1466
- /**
1467
- * Listen for the on init event
1468
- */
1469
- ngOnInit() {
1470
- this.elementCreated.next(this);
1471
- }
1472
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ElementCreatedDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1473
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: ElementCreatedDirective, selector: "[elementCreated]", outputs: { elementCreated: "elementCreated" }, ngImport: i0 }); }
1474
- }
1475
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ElementCreatedDirective, decorators: [{
1476
- type: Directive,
1477
- args: [{
1478
- selector: '[elementCreated]'
1479
- }]
1480
- }], propDecorators: { elementCreated: [{
1481
- type: Output,
1482
- args: ['elementCreated']
1445
+ /**
1446
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1447
+ *
1448
+ * Website : -> http://www.turbogui.org
1449
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1450
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1451
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1452
+ */
1453
+ /** This directive is used to listen for onInit events on raw html elements */
1454
+ /**
1455
+ * This directive is used to listen for onInit events on raw html elements
1456
+ * If we place (elementCreated)="someMethod()" on the element at the html template part, when the element
1457
+ * that uses this directive is visually created, someMethod() will be called.
1458
+ */
1459
+ class ElementCreatedDirective {
1460
+ constructor() {
1461
+ /**
1462
+ * Event that will be dispatched once element is created
1463
+ */
1464
+ this.elementCreated = new EventEmitter();
1465
+ }
1466
+ /**
1467
+ * Listen for the on init event
1468
+ */
1469
+ ngOnInit() {
1470
+ this.elementCreated.next(this);
1471
+ }
1472
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ElementCreatedDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1473
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.8", type: ElementCreatedDirective, selector: "[elementCreated]", outputs: { elementCreated: "elementCreated" }, ngImport: i0 }); }
1474
+ }
1475
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ElementCreatedDirective, decorators: [{
1476
+ type: Directive,
1477
+ args: [{
1478
+ selector: '[elementCreated]'
1479
+ }]
1480
+ }], propDecorators: { elementCreated: [{
1481
+ type: Output,
1482
+ args: ['elementCreated']
1483
1483
  }] } });
1484
1484
 
1485
- /**
1486
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1487
- *
1488
- * Website : -> http://www.turbogui.org
1489
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1490
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1491
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1492
- */
1493
- /** This directive is used to listen for onDestroy events on raw html elements */
1494
- /**
1495
- * This directive is used to listen for onDestroy events on raw html elements
1496
- * If we place (elementDestroyed)="someMethod()" on the element at the html template part, when the element
1497
- * that uses this directive is visually destroyed from the screen, someMethod() will be called.
1498
- */
1499
- class ElementDestroyedDirective {
1500
- constructor() {
1501
- /**
1502
- * Event that will be dispatched once element is destroyed
1503
- */
1504
- this.elementDestroyed = new EventEmitter();
1505
- }
1506
- /**
1507
- * Listen for the on destroy event
1508
- */
1509
- ngOnDestroy() {
1510
- this.elementDestroyed.next(this);
1511
- }
1512
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ElementDestroyedDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1513
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: ElementDestroyedDirective, selector: "[elementDestroyed]", outputs: { elementDestroyed: "elementDestroyed" }, ngImport: i0 }); }
1514
- }
1515
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ElementDestroyedDirective, decorators: [{
1516
- type: Directive,
1517
- args: [{
1518
- selector: '[elementDestroyed]'
1519
- }]
1520
- }], propDecorators: { elementDestroyed: [{
1521
- type: Output,
1522
- args: ['elementDestroyed']
1485
+ /**
1486
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1487
+ *
1488
+ * Website : -> http://www.turbogui.org
1489
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1490
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1491
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1492
+ */
1493
+ /** This directive is used to listen for onDestroy events on raw html elements */
1494
+ /**
1495
+ * This directive is used to listen for onDestroy events on raw html elements
1496
+ * If we place (elementDestroyed)="someMethod()" on the element at the html template part, when the element
1497
+ * that uses this directive is visually destroyed from the screen, someMethod() will be called.
1498
+ */
1499
+ class ElementDestroyedDirective {
1500
+ constructor() {
1501
+ /**
1502
+ * Event that will be dispatched once element is destroyed
1503
+ */
1504
+ this.elementDestroyed = new EventEmitter();
1505
+ }
1506
+ /**
1507
+ * Listen for the on destroy event
1508
+ */
1509
+ ngOnDestroy() {
1510
+ this.elementDestroyed.next(this);
1511
+ }
1512
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ElementDestroyedDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1513
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.8", type: ElementDestroyedDirective, selector: "[elementDestroyed]", outputs: { elementDestroyed: "elementDestroyed" }, ngImport: i0 }); }
1514
+ }
1515
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ElementDestroyedDirective, decorators: [{
1516
+ type: Directive,
1517
+ args: [{
1518
+ selector: '[elementDestroyed]'
1519
+ }]
1520
+ }], propDecorators: { elementDestroyed: [{
1521
+ type: Output,
1522
+ args: ['elementDestroyed']
1523
1523
  }] } });
1524
1524
 
1525
- /**
1526
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1527
- *
1528
- * Website : -> http://www.turbogui.org
1529
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1530
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1531
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1532
- */
1533
- /** This directive is used to perform an automatic select all text on an element every time it is focused */
1534
- /**
1535
- * This directive is used to perform an an automatic select all text on an element every time it is focused.
1536
- * If we set the autoSelectTextOnFocus tag to the html element, its text will be automatically selected after it gets the focus.
1537
- */
1538
- class AutoSelectTextOnFocusDirective {
1539
- constructor(el, renderer) {
1540
- this.el = el;
1541
- this.renderer = renderer;
1542
- if (!el.nativeElement['select']) {
1543
- throw new Error('Element does not accept select');
1544
- }
1545
- }
1546
- onFocus() {
1547
- this.renderer.selectRootElement(this.el.nativeElement).select();
1548
- }
1549
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AutoSelectTextOnFocusDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
1550
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: AutoSelectTextOnFocusDirective, selector: "[autoSelectTextOnFocus]", host: { listeners: { "focus": "onFocus($event)" } }, ngImport: i0 }); }
1551
- }
1552
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AutoSelectTextOnFocusDirective, decorators: [{
1553
- type: Directive,
1554
- args: [{
1555
- selector: '[autoSelectTextOnFocus]'
1556
- }]
1557
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { onFocus: [{
1558
- type: HostListener,
1559
- args: ['focus', ['$event']]
1525
+ /**
1526
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1527
+ *
1528
+ * Website : -> http://www.turbogui.org
1529
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1530
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1531
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1532
+ */
1533
+ /** This directive is used to perform an automatic select all text on an element every time it is focused */
1534
+ /**
1535
+ * This directive is used to perform an an automatic select all text on an element every time it is focused.
1536
+ * If we set the autoSelectTextOnFocus tag to the html element, its text will be automatically selected after it gets the focus.
1537
+ */
1538
+ class AutoSelectTextOnFocusDirective {
1539
+ constructor(el, renderer) {
1540
+ this.el = el;
1541
+ this.renderer = renderer;
1542
+ if (!el.nativeElement['select']) {
1543
+ throw new Error('Element does not accept select');
1544
+ }
1545
+ }
1546
+ onFocus() {
1547
+ this.renderer.selectRootElement(this.el.nativeElement).select();
1548
+ }
1549
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AutoSelectTextOnFocusDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
1550
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.8", type: AutoSelectTextOnFocusDirective, selector: "[autoSelectTextOnFocus]", host: { listeners: { "focus": "onFocus($event)" } }, ngImport: i0 }); }
1551
+ }
1552
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AutoSelectTextOnFocusDirective, decorators: [{
1553
+ type: Directive,
1554
+ args: [{
1555
+ selector: '[autoSelectTextOnFocus]'
1556
+ }]
1557
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { onFocus: [{
1558
+ type: HostListener,
1559
+ args: ['focus', ['$event']]
1560
1560
  }] } });
1561
1561
 
1562
- /**
1563
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1564
- *
1565
- * Website : -> http://www.turbogui.org
1566
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1567
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1568
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1569
- */
1570
- /**
1571
- * This file contains the root module that contains all the library declarations and exports.
1572
- */
1573
- class TurboGuiAngularModule {
1574
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TurboGuiAngularModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1575
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: TurboGuiAngularModule, declarations: [BusyStateBaseComponent,
1576
- DialogErrorComponent,
1577
- DialogSingleOptionComponent,
1578
- DialogTwoOptionComponent,
1579
- DialogMultipleOptionComponent,
1580
- DialogSingleSelectionListComponent,
1581
- ViewsContainerComponent,
1582
- ButtonImageComponent,
1583
- ButtonContainerComponent,
1584
- ElementCreatedDirective,
1585
- ElementDestroyedDirective,
1586
- AutoFocusOnDisplayDirective,
1587
- AutoSelectTextOnFocusDirective], imports: [MatDialogModule,
1588
- MatSnackBarModule,
1589
- MatInputModule,
1590
- MatButtonModule,
1591
- MatFormFieldModule,
1592
- BrowserAnimationsModule], exports: [BusyStateBaseComponent,
1593
- ViewsContainerComponent,
1594
- ButtonImageComponent,
1595
- ButtonContainerComponent,
1596
- DialogErrorComponent,
1597
- DialogSingleOptionComponent,
1598
- DialogTwoOptionComponent,
1599
- DialogMultipleOptionComponent,
1600
- DialogSingleSelectionListComponent,
1601
- ElementCreatedDirective,
1602
- ElementDestroyedDirective,
1603
- AutoFocusOnDisplayDirective,
1604
- AutoSelectTextOnFocusDirective] }); }
1605
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TurboGuiAngularModule, providers: [
1606
- DialogService,
1607
- LocalizationService,
1608
- HTTPService,
1609
- NotificationService,
1610
- UserService,
1611
- ViewsService,
1612
- BrowserService
1613
- ], imports: [MatDialogModule,
1614
- MatSnackBarModule,
1615
- MatInputModule,
1616
- MatButtonModule,
1617
- MatFormFieldModule,
1618
- BrowserAnimationsModule] }); }
1619
- }
1620
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TurboGuiAngularModule, decorators: [{
1621
- type: NgModule,
1622
- args: [{
1623
- imports: [
1624
- MatDialogModule,
1625
- MatSnackBarModule,
1626
- MatInputModule,
1627
- MatButtonModule,
1628
- MatFormFieldModule,
1629
- BrowserAnimationsModule
1630
- ],
1631
- declarations: [
1632
- BusyStateBaseComponent,
1633
- DialogErrorComponent,
1634
- DialogSingleOptionComponent,
1635
- DialogTwoOptionComponent,
1636
- DialogMultipleOptionComponent,
1637
- DialogSingleSelectionListComponent,
1638
- ViewsContainerComponent,
1639
- ButtonImageComponent,
1640
- ButtonContainerComponent,
1641
- ElementCreatedDirective,
1642
- ElementDestroyedDirective,
1643
- AutoFocusOnDisplayDirective,
1644
- AutoSelectTextOnFocusDirective
1645
- ],
1646
- // Globally available singleton services are added here
1647
- providers: [
1648
- DialogService,
1649
- LocalizationService,
1650
- HTTPService,
1651
- NotificationService,
1652
- UserService,
1653
- ViewsService,
1654
- BrowserService
1655
- ],
1656
- exports: [
1657
- BusyStateBaseComponent,
1658
- ViewsContainerComponent,
1659
- ButtonImageComponent,
1660
- ButtonContainerComponent,
1661
- DialogErrorComponent,
1662
- DialogSingleOptionComponent,
1663
- DialogTwoOptionComponent,
1664
- DialogMultipleOptionComponent,
1665
- DialogSingleSelectionListComponent,
1666
- ElementCreatedDirective,
1667
- ElementDestroyedDirective,
1668
- AutoFocusOnDisplayDirective,
1669
- AutoSelectTextOnFocusDirective
1670
- ]
1671
- }]
1562
+ /**
1563
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1564
+ *
1565
+ * Website : -> http://www.turbogui.org
1566
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1567
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1568
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1569
+ */
1570
+ /**
1571
+ * This file contains the root module that contains all the library declarations and exports.
1572
+ */
1573
+ class TurboGuiAngularModule {
1574
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: TurboGuiAngularModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1575
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.8", ngImport: i0, type: TurboGuiAngularModule, declarations: [BusyStateBaseComponent,
1576
+ DialogErrorComponent,
1577
+ DialogSingleOptionComponent,
1578
+ DialogTwoOptionComponent,
1579
+ DialogMultipleOptionComponent,
1580
+ DialogSingleSelectionListComponent,
1581
+ ViewsContainerComponent,
1582
+ ButtonImageComponent,
1583
+ ButtonContainerComponent,
1584
+ ElementCreatedDirective,
1585
+ ElementDestroyedDirective,
1586
+ AutoFocusOnDisplayDirective,
1587
+ AutoSelectTextOnFocusDirective], imports: [MatDialogModule,
1588
+ MatSnackBarModule,
1589
+ MatInputModule,
1590
+ MatButtonModule,
1591
+ MatFormFieldModule,
1592
+ BrowserAnimationsModule], exports: [BusyStateBaseComponent,
1593
+ ViewsContainerComponent,
1594
+ ButtonImageComponent,
1595
+ ButtonContainerComponent,
1596
+ DialogErrorComponent,
1597
+ DialogSingleOptionComponent,
1598
+ DialogTwoOptionComponent,
1599
+ DialogMultipleOptionComponent,
1600
+ DialogSingleSelectionListComponent,
1601
+ ElementCreatedDirective,
1602
+ ElementDestroyedDirective,
1603
+ AutoFocusOnDisplayDirective,
1604
+ AutoSelectTextOnFocusDirective] }); }
1605
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: TurboGuiAngularModule, providers: [
1606
+ DialogService,
1607
+ LocalizationService,
1608
+ HTTPService,
1609
+ NotificationService,
1610
+ UserService,
1611
+ ViewsService,
1612
+ BrowserService
1613
+ ], imports: [MatDialogModule,
1614
+ MatSnackBarModule,
1615
+ MatInputModule,
1616
+ MatButtonModule,
1617
+ MatFormFieldModule,
1618
+ BrowserAnimationsModule] }); }
1619
+ }
1620
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: TurboGuiAngularModule, decorators: [{
1621
+ type: NgModule,
1622
+ args: [{
1623
+ imports: [
1624
+ MatDialogModule,
1625
+ MatSnackBarModule,
1626
+ MatInputModule,
1627
+ MatButtonModule,
1628
+ MatFormFieldModule,
1629
+ BrowserAnimationsModule
1630
+ ],
1631
+ declarations: [
1632
+ BusyStateBaseComponent,
1633
+ DialogErrorComponent,
1634
+ DialogSingleOptionComponent,
1635
+ DialogTwoOptionComponent,
1636
+ DialogMultipleOptionComponent,
1637
+ DialogSingleSelectionListComponent,
1638
+ ViewsContainerComponent,
1639
+ ButtonImageComponent,
1640
+ ButtonContainerComponent,
1641
+ ElementCreatedDirective,
1642
+ ElementDestroyedDirective,
1643
+ AutoFocusOnDisplayDirective,
1644
+ AutoSelectTextOnFocusDirective
1645
+ ],
1646
+ // Globally available singleton services are added here
1647
+ providers: [
1648
+ DialogService,
1649
+ LocalizationService,
1650
+ HTTPService,
1651
+ NotificationService,
1652
+ UserService,
1653
+ ViewsService,
1654
+ BrowserService
1655
+ ],
1656
+ exports: [
1657
+ BusyStateBaseComponent,
1658
+ ViewsContainerComponent,
1659
+ ButtonImageComponent,
1660
+ ButtonContainerComponent,
1661
+ DialogErrorComponent,
1662
+ DialogSingleOptionComponent,
1663
+ DialogTwoOptionComponent,
1664
+ DialogMultipleOptionComponent,
1665
+ DialogSingleSelectionListComponent,
1666
+ ElementCreatedDirective,
1667
+ ElementDestroyedDirective,
1668
+ AutoFocusOnDisplayDirective,
1669
+ AutoSelectTextOnFocusDirective
1670
+ ]
1671
+ }]
1672
1672
  }] });
1673
1673
 
1674
- /**
1675
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1676
- *
1677
- * Website : -> http://www.turbogui.org
1678
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1679
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1680
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1681
- */
1682
- /**
1683
- * Captures all the application exceptions and performs any required action.
1684
- * It also contains multiple general error management features.
1685
- *
1686
- * To define this class as your application error handler, you must add the following to your
1687
- * main app module providers:
1688
- * {
1689
- * provide: ErrorHandler,
1690
- * useClass: GlobalErrorService
1691
- * },
1692
- * GlobalErrorService
1693
- *
1694
- * You cannot access the error handler at runtime. If you need to modify any of the behaviours
1695
- * or implement your custom ones, you must extend this class and set your new one as the error
1696
- * handler provider.
1697
- */
1698
- class GlobalErrorService {
1699
- constructor() {
1700
- /**
1701
- * Enables or disables the error notification to user via an alert box
1702
- * Extend this class and override this value on your custom error handle to change it
1703
- */
1704
- this.showExceptionsToUser = true;
1705
- /**
1706
- * Enables or disables the error notification to user via an alert box
1707
- * Extend this class and override this value on your custom error handle to change it
1708
- */
1709
- this.showExceptionsOnConsole = true;
1710
- /**
1711
- * Defines the text that will be used for the alert that is shown to the user when an exception happens
1712
- * and showExceptionsToUser is true
1713
- * Extend this class and override this value on your custom error handle to change it
1714
- */
1715
- this.errorAlertMessage = 'Application exception:\n\n';
1716
- }
1717
- /**
1718
- * Show an alert with the received error detail and also log it to the js console.
1719
- *
1720
- * Angular expects at least this method to be implemented on any class that is used as a global exception handler.
1721
- *
1722
- * @param error An error instance
1723
- */
1724
- handleError(error) {
1725
- if (this.showExceptionsToUser) {
1726
- alert(this.errorAlertMessage + error);
1727
- }
1728
- if (this.showExceptionsOnConsole) {
1729
- console.log(error);
1730
- }
1731
- throw error;
1732
- }
1733
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GlobalErrorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1734
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GlobalErrorService }); }
1735
- }
1736
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: GlobalErrorService, decorators: [{
1737
- type: Injectable
1674
+ /**
1675
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1676
+ *
1677
+ * Website : -> http://www.turbogui.org
1678
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1679
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1680
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1681
+ */
1682
+ /**
1683
+ * Captures all the application exceptions and performs any required action.
1684
+ * It also contains multiple general error management features.
1685
+ *
1686
+ * To define this class as your application error handler, you must add the following to your
1687
+ * main app module providers:
1688
+ * {
1689
+ * provide: ErrorHandler,
1690
+ * useClass: GlobalErrorService
1691
+ * },
1692
+ * GlobalErrorService
1693
+ *
1694
+ * You cannot access the error handler at runtime. If you need to modify any of the behaviours
1695
+ * or implement your custom ones, you must extend this class and set your new one as the error
1696
+ * handler provider.
1697
+ */
1698
+ class GlobalErrorService {
1699
+ constructor() {
1700
+ /**
1701
+ * Enables or disables the error notification to user via an alert box
1702
+ * Extend this class and override this value on your custom error handle to change it
1703
+ */
1704
+ this.showExceptionsToUser = true;
1705
+ /**
1706
+ * Enables or disables the error notification to user via an alert box
1707
+ * Extend this class and override this value on your custom error handle to change it
1708
+ */
1709
+ this.showExceptionsOnConsole = true;
1710
+ /**
1711
+ * Defines the text that will be used for the alert that is shown to the user when an exception happens
1712
+ * and showExceptionsToUser is true
1713
+ * Extend this class and override this value on your custom error handle to change it
1714
+ */
1715
+ this.errorAlertMessage = 'Application exception:\n\n';
1716
+ }
1717
+ /**
1718
+ * Show an alert with the received error detail and also log it to the js console.
1719
+ *
1720
+ * Angular expects at least this method to be implemented on any class that is used as a global exception handler.
1721
+ *
1722
+ * @param error An error instance
1723
+ */
1724
+ handleError(error) {
1725
+ if (this.showExceptionsToUser) {
1726
+ alert(this.errorAlertMessage + error);
1727
+ }
1728
+ if (this.showExceptionsOnConsole) {
1729
+ console.log(error);
1730
+ }
1731
+ throw error;
1732
+ }
1733
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: GlobalErrorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1734
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: GlobalErrorService }); }
1735
+ }
1736
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: GlobalErrorService, decorators: [{
1737
+ type: Injectable
1738
1738
  }] });
1739
1739
 
1740
- /**
1741
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1742
- *
1743
- * Website : -> http://www.turbogui.org
1744
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1745
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1746
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1747
- */
1748
- /**
1749
- * Class that defines a GET http request, to be used by HttpService
1750
- */
1751
- class HTTPServiceGetRequest extends HTTPManagerGetRequest {
1740
+ /**
1741
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1742
+ *
1743
+ * Website : -> http://www.turbogui.org
1744
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1745
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1746
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1747
+ */
1748
+ /**
1749
+ * Class that defines a GET http request, to be used by HttpService
1750
+ */
1751
+ class HTTPServiceGetRequest extends HTTPManagerGetRequest {
1752
1752
  }
1753
1753
 
1754
- /**
1755
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1756
- *
1757
- * Website : -> http://www.turbogui.org
1758
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1759
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1760
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1761
- */
1762
- /**
1763
- * Defines the data that is contained inside a GUI notification
1764
- */
1765
- class GUINotification {
1766
- constructor(name, type = '', data = null) {
1767
- /**
1768
- * The name for this notification
1769
- */
1770
- this.name = '';
1771
- /**
1772
- * An optional type to categorize this notification in case the name is not enough
1773
- * to uniquely identify it
1774
- */
1775
- this.type = '';
1776
- /**
1777
- * Additional data to send with the notification
1778
- */
1779
- this.data = null;
1780
- this.name = name;
1781
- this.type = type;
1782
- this.data = data;
1783
- }
1754
+ /**
1755
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1756
+ *
1757
+ * Website : -> http://www.turbogui.org
1758
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1759
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1760
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1761
+ */
1762
+ /**
1763
+ * Defines the data that is contained inside a GUI notification
1764
+ */
1765
+ class GUINotification {
1766
+ constructor(name, type = '', data = null) {
1767
+ /**
1768
+ * The name for this notification
1769
+ */
1770
+ this.name = '';
1771
+ /**
1772
+ * An optional type to categorize this notification in case the name is not enough
1773
+ * to uniquely identify it
1774
+ */
1775
+ this.type = '';
1776
+ /**
1777
+ * Additional data to send with the notification
1778
+ */
1779
+ this.data = null;
1780
+ this.name = name;
1781
+ this.type = type;
1782
+ this.data = data;
1783
+ }
1784
1784
  }
1785
1785
 
1786
- /**
1787
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1788
- *
1789
- * Website : -> http://www.turbogui.org
1790
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1791
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1792
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1793
- */
1794
- /**
1795
- * Defines an application view.
1796
- * Our View components must extend this class so they can be manipulated via ViewsService
1797
- */
1798
- class View {
1799
- /**
1800
- * In order for the views service to know which model class must be created when setting a new active view,
1801
- * each view must specify the class for the view model at the overriden constructor super() call.
1802
- * All view models must also extend ViewModel. If we do not plan to attach a model to a view, we can pass a null value to
1803
- * the constructor super() call.
1804
- *
1805
- * A new model instance will be automatically created each time the view is added to the views container, and
1806
- * destroyed when the view is removed. So the view model will only live while the view is active on the views service.
1807
- */
1808
- constructor(modelClass) {
1809
- this._modelClass = null;
1810
- this._modelClass = modelClass;
1811
- }
1812
- /**
1813
- * Obtain the class type for the model that is linked to this view, or null if the view model is not yet instantiated.
1814
- */
1815
- get modelClass() {
1816
- return this._modelClass;
1817
- }
1786
+ /**
1787
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1788
+ *
1789
+ * Website : -> http://www.turbogui.org
1790
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1791
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1792
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1793
+ */
1794
+ /**
1795
+ * Defines an application view.
1796
+ * Our View components must extend this class so they can be manipulated via ViewsService
1797
+ */
1798
+ class View {
1799
+ /**
1800
+ * In order for the views service to know which model class must be created when setting a new active view,
1801
+ * each view must specify the class for the view model at the overriden constructor super() call.
1802
+ * All view models must also extend ViewModel. If we do not plan to attach a model to a view, we can pass a null value to
1803
+ * the constructor super() call.
1804
+ *
1805
+ * A new model instance will be automatically created each time the view is added to the views container, and
1806
+ * destroyed when the view is removed. So the view model will only live while the view is active on the views service.
1807
+ */
1808
+ constructor(modelClass) {
1809
+ this._modelClass = null;
1810
+ this._modelClass = modelClass;
1811
+ }
1812
+ /**
1813
+ * Obtain the class type for the model that is linked to this view, or null if the view model is not yet instantiated.
1814
+ */
1815
+ get modelClass() {
1816
+ return this._modelClass;
1817
+ }
1818
1818
  }
1819
1819
 
1820
- /**
1821
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1822
- *
1823
- * Website : -> http://www.turbogui.org
1824
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1825
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1826
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1827
- */
1828
- /**
1829
- * Defines the model base class for an application view
1830
- */
1831
- class ViewModel {
1820
+ /**
1821
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1822
+ *
1823
+ * Website : -> http://www.turbogui.org
1824
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1825
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1826
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1827
+ */
1828
+ /**
1829
+ * Defines the model base class for an application view
1830
+ */
1831
+ class ViewModel {
1832
1832
  }
1833
1833
 
1834
- /**
1835
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1836
- *
1837
- * Website : -> http://www.turbogui.org
1838
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1839
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1840
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1841
- */
1842
- /**
1843
- * Defines the service base class for a view service class. All services that are used by views must extend this.
1844
- * We must create the view services as an @Injectable() angular class which will be globally available at any time, but we must take
1845
- * into consideration that the view model will only be instantiated when the view is active.
1846
- */
1847
- class ViewService {
1848
- /**
1849
- * Class requires a views service instance
1850
- */
1851
- constructor(viewsService) {
1852
- this.viewsService = viewsService;
1853
- }
1854
- /**
1855
- * A reference to the currently active view model
1856
- */
1857
- get model() {
1858
- return this.viewsService.model;
1859
- }
1834
+ /**
1835
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1836
+ *
1837
+ * Website : -> http://www.turbogui.org
1838
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1839
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1840
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1841
+ */
1842
+ /**
1843
+ * Defines the service base class for a view service class. All services that are used by views must extend this.
1844
+ * We must create the view services as an @Injectable() angular class which will be globally available at any time, but we must take
1845
+ * into consideration that the view model will only be instantiated when the view is active.
1846
+ */
1847
+ class ViewService {
1848
+ /**
1849
+ * Class requires a views service instance
1850
+ */
1851
+ constructor(viewsService) {
1852
+ this.viewsService = viewsService;
1853
+ }
1854
+ /**
1855
+ * A reference to the currently active view model
1856
+ */
1857
+ get model() {
1858
+ return this.viewsService.model;
1859
+ }
1860
1860
  }
1861
1861
 
1862
- /**
1863
- * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1864
- *
1865
- * Website : -> http://www.turbogui.org
1866
- * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1867
- * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1868
- * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1869
- */
1870
- /**
1871
- * Sometimes it is necessary to apply some kind of buffer to the user input for certain operations that may be executed
1872
- * several times but we need to capture only the latest of them into a certain period of time. This class does exactly this:
1873
- * we can queue as many times as we want a specific method call and only the last one will be executed under a defined window of time.
1874
- * So for example if a user types keys on an input, we can buffer it for x seconds and perform a request only with the last of its changes.
1875
- * Lots of other UI interaction usages may be interesting with this class.
1876
- */
1877
- class DelayedMethodCallManager {
1878
- /**
1879
- * Sometimes it is necessary to apply some kind of buffer to the user input for certain operations that may be executed
1880
- * several times but we need to capture only the latest of them into a certain period of time. This class does exactly this:
1881
- * we can queue as many times as we want a specific method call and only the last one will be executed under a defined window of time.
1882
- * So for example if a user types keys on an input, we can buffer it for x seconds and perform a request only with the last of its changes.
1883
- * Lots of other UI interaction usages may be interesting with this class.
1884
- *
1885
- * @param delay Amount of time to wait before executing the operations . Defaults to 1000 miliseconds.
1886
- */
1887
- constructor(delay = 1000) {
1888
- this.delay = delay;
1889
- this._functionsToExecute = [];
1890
- this._timerIsRunning = false;
1891
- this._setTimeoutHandler = null;
1892
- }
1893
- /**
1894
- * Add a method to be called once the delay time is finished.
1895
- * Every time a new call to queue is performed, the delay timer is restarted. When the delay time finishes, only the
1896
- * last of the methods that have been pushed by call() will be executed.
1897
- *
1898
- * Use it to queue several user input operations that should be called only once in a period of time, while waiting
1899
- * for the user to finish his input.
1900
- *
1901
- * @param method The function that will be queued for execution after the delay time has passed
1902
- */
1903
- queue(method) {
1904
- this._functionsToExecute.push(method);
1905
- if (this._timerIsRunning) {
1906
- clearTimeout(this._setTimeoutHandler);
1907
- }
1908
- this._timerIsRunning = true;
1909
- this._setTimeoutHandler = setTimeout(() => { this.run(); }, this.delay);
1910
- }
1911
- /**
1912
- * Abort all methods that may have been pushed to this class and are waiting to be executed, so none of them
1913
- * is executed when the delay time finishes. Basically everything is cleared and stoped when this method is called.
1914
- */
1915
- cancel() {
1916
- if (this._setTimeoutHandler !== null) {
1917
- clearTimeout(this._setTimeoutHandler);
1918
- }
1919
- this._functionsToExecute = [];
1920
- this._timerIsRunning = false;
1921
- }
1922
- /**
1923
- * Auxiliary function that performs the call to the latest queued method
1924
- */
1925
- run() {
1926
- this._functionsToExecute.pop()();
1927
- this._functionsToExecute = [];
1928
- this._timerIsRunning = false;
1929
- }
1862
+ /**
1863
+ * TurboGUI is A library that helps with the most common and generic UI elements and functionalities
1864
+ *
1865
+ * Website : -> http://www.turbogui.org
1866
+ * License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
1867
+ * License Url : -> http://www.apache.org/licenses/LICENSE-2.0
1868
+ * CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
1869
+ */
1870
+ /**
1871
+ * Sometimes it is necessary to apply some kind of buffer to the user input for certain operations that may be executed
1872
+ * several times but we need to capture only the latest of them into a certain period of time. This class does exactly this:
1873
+ * we can queue as many times as we want a specific method call and only the last one will be executed under a defined window of time.
1874
+ * So for example if a user types keys on an input, we can buffer it for x seconds and perform a request only with the last of its changes.
1875
+ * Lots of other UI interaction usages may be interesting with this class.
1876
+ */
1877
+ class DelayedMethodCallManager {
1878
+ /**
1879
+ * Sometimes it is necessary to apply some kind of buffer to the user input for certain operations that may be executed
1880
+ * several times but we need to capture only the latest of them into a certain period of time. This class does exactly this:
1881
+ * we can queue as many times as we want a specific method call and only the last one will be executed under a defined window of time.
1882
+ * So for example if a user types keys on an input, we can buffer it for x seconds and perform a request only with the last of its changes.
1883
+ * Lots of other UI interaction usages may be interesting with this class.
1884
+ *
1885
+ * @param delay Amount of time to wait before executing the operations . Defaults to 1000 miliseconds.
1886
+ */
1887
+ constructor(delay = 1000) {
1888
+ this.delay = delay;
1889
+ this._functionsToExecute = [];
1890
+ this._timerIsRunning = false;
1891
+ this._setTimeoutHandler = null;
1892
+ }
1893
+ /**
1894
+ * Add a method to be called once the delay time is finished.
1895
+ * Every time a new call to queue is performed, the delay timer is restarted. When the delay time finishes, only the
1896
+ * last of the methods that have been pushed by call() will be executed.
1897
+ *
1898
+ * Use it to queue several user input operations that should be called only once in a period of time, while waiting
1899
+ * for the user to finish his input.
1900
+ *
1901
+ * @param method The function that will be queued for execution after the delay time has passed
1902
+ */
1903
+ queue(method) {
1904
+ this._functionsToExecute.push(method);
1905
+ if (this._timerIsRunning) {
1906
+ clearTimeout(this._setTimeoutHandler);
1907
+ }
1908
+ this._timerIsRunning = true;
1909
+ this._setTimeoutHandler = setTimeout(() => { this.run(); }, this.delay);
1910
+ }
1911
+ /**
1912
+ * Abort all methods that may have been pushed to this class and are waiting to be executed, so none of them
1913
+ * is executed when the delay time finishes. Basically everything is cleared and stoped when this method is called.
1914
+ */
1915
+ cancel() {
1916
+ if (this._setTimeoutHandler !== null) {
1917
+ clearTimeout(this._setTimeoutHandler);
1918
+ }
1919
+ this._functionsToExecute = [];
1920
+ this._timerIsRunning = false;
1921
+ }
1922
+ /**
1923
+ * Auxiliary function that performs the call to the latest queued method
1924
+ */
1925
+ run() {
1926
+ this._functionsToExecute.pop()();
1927
+ this._functionsToExecute = [];
1928
+ this._timerIsRunning = false;
1929
+ }
1930
1930
  }
1931
1931
 
1932
- /*
1933
- * Public API Surface of turbogui-angular
1932
+ /*
1933
+ * Public API Surface of turbogui-angular
1934
1934
  */
1935
1935
 
1936
- /**
1937
- * Generated bundle index. Do not edit.
1936
+ /**
1937
+ * Generated bundle index. Do not edit.
1938
1938
  */
1939
1939
 
1940
1940
  export { AutoFocusOnDisplayDirective, AutoSelectTextOnFocusDirective, BrowserService, BusyStateBaseComponent, ButtonContainerComponent, ButtonImageComponent, DelayedMethodCallManager, DialogErrorComponent, DialogMultipleOptionComponent, DialogOptionsBaseComponent, DialogService, DialogSingleOptionComponent, DialogSingleSelectionListComponent, DialogTwoOptionComponent, ElementCreatedDirective, ElementDestroyedDirective, FadeAnimationClass, GUINotification, GlobalErrorService, HTTPService, HTTPServiceGetRequest, HTTPServicePostRequest, LocalizationService, NotificationService, TurboGuiAngularModule, UserService, View, ViewModel, ViewService, ViewsContainerComponent, ViewsService };