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