@schneideress/dashboardframework 0.0.278 → 13.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/README.md +8 -8
  2. package/esm2020/lib/custom.notifier.options.mjs +41 -0
  3. package/esm2020/lib/ra-dashboard-area/ra.dashboard.area.mjs +445 -0
  4. package/esm2020/lib/ra-widget-container/lock-tooltip/lock.tooltip.component.mjs +43 -0
  5. package/esm2020/lib/ra-widget-container/ra.widget.container.component.mjs +767 -0
  6. package/esm2020/lib/ra.base.dashboard.filter.mjs +44 -0
  7. package/esm2020/lib/ra.base.dashboard.template.mjs +36 -0
  8. package/esm2020/lib/ra.dashbard.event.bus.mjs +46 -0
  9. package/esm2020/lib/ra.dashboard.module.mjs +64 -0
  10. package/esm2020/lib/ra.dashboard.responsive.service.mjs +136 -0
  11. package/esm2020/lib/ra.dashboard.service.mjs +77 -0
  12. package/esm2020/lib/ra.event.enum.mjs +60 -0
  13. package/esm2020/lib/ra.gridster.config.mjs +56 -0
  14. package/esm2020/public-api.mjs +15 -0
  15. package/esm2020/schneideress-dashboardframework.mjs +5 -0
  16. package/fesm2015/schneideress-dashboardframework.mjs +1800 -0
  17. package/fesm2015/schneideress-dashboardframework.mjs.map +1 -0
  18. package/fesm2020/schneideress-dashboardframework.mjs +1790 -0
  19. package/fesm2020/schneideress-dashboardframework.mjs.map +1 -0
  20. package/lib/ra-dashboard-area/ra.dashboard.area.d.ts +5 -2
  21. package/lib/ra-widget-container/lock-tooltip/lock.tooltip.component.d.ts +3 -0
  22. package/lib/ra-widget-container/ra.widget.container.component.d.ts +6 -4
  23. package/lib/ra.base.dashboard.filter.d.ts +3 -1
  24. package/lib/ra.base.dashboard.template.d.ts +3 -0
  25. package/lib/ra.dashbard.event.bus.d.ts +3 -0
  26. package/lib/ra.dashboard.module.d.ts +15 -0
  27. package/lib/ra.dashboard.responsive.service.d.ts +8 -5
  28. package/lib/ra.dashboard.service.d.ts +4 -2
  29. package/lib/ra.gridster.config.d.ts +1 -1
  30. package/package.json +26 -20
  31. package/schneideress-dashboardframework.d.ts +1 -6
  32. package/bundles/schneideress-dashboardframework.umd.js +0 -5091
  33. package/bundles/schneideress-dashboardframework.umd.js.map +0 -1
  34. package/bundles/schneideress-dashboardframework.umd.min.js +0 -16
  35. package/bundles/schneideress-dashboardframework.umd.min.js.map +0 -1
  36. package/esm2015/gridster/index.js +0 -14
  37. package/esm2015/gridster/lib/gridster.component.js +0 -471
  38. package/esm2015/gridster/lib/gridster.interface.js +0 -3
  39. package/esm2015/gridster/lib/gridster.module.js +0 -25
  40. package/esm2015/gridster/lib/gridsterCompact.service.js +0 -162
  41. package/esm2015/gridster/lib/gridsterConfig.constant.js +0 -104
  42. package/esm2015/gridster/lib/gridsterConfig.interface.js +0 -27
  43. package/esm2015/gridster/lib/gridsterConfigS.interface.js +0 -1
  44. package/esm2015/gridster/lib/gridsterDraggable.service.js +0 -351
  45. package/esm2015/gridster/lib/gridsterEmptyCell.service.js +0 -216
  46. package/esm2015/gridster/lib/gridsterItem.component.js +0 -141
  47. package/esm2015/gridster/lib/gridsterItem.interface.js +0 -1
  48. package/esm2015/gridster/lib/gridsterItemComponent.interface.js +0 -3
  49. package/esm2015/gridster/lib/gridsterPreview.component.js +0 -45
  50. package/esm2015/gridster/lib/gridsterPush.service.js +0 -296
  51. package/esm2015/gridster/lib/gridsterPushResize.service.js +0 -225
  52. package/esm2015/gridster/lib/gridsterRenderer.service.js +0 -208
  53. package/esm2015/gridster/lib/gridsterResizable.service.js +0 -368
  54. package/esm2015/gridster/lib/gridsterResizeEventType.interface.js +0 -1
  55. package/esm2015/gridster/lib/gridsterScroll.service.js +0 -119
  56. package/esm2015/gridster/lib/gridsterSwap.service.js +0 -85
  57. package/esm2015/gridster/lib/gridsterUtils.service.js +0 -89
  58. package/esm2015/lib/custom.notifier.options.js +0 -41
  59. package/esm2015/lib/ra-dashboard-area/ra.dashboard.area.js +0 -488
  60. package/esm2015/lib/ra-widget-container/lock-tooltip/lock.tooltip.component.js +0 -48
  61. package/esm2015/lib/ra-widget-container/ra.widget.container.component.js +0 -829
  62. package/esm2015/lib/ra.base.dashboard.filter.js +0 -47
  63. package/esm2015/lib/ra.base.dashboard.template.js +0 -32
  64. package/esm2015/lib/ra.dashbard.event.bus.js +0 -46
  65. package/esm2015/lib/ra.dashboard.module.js +0 -44
  66. package/esm2015/lib/ra.dashboard.responsive.service.js +0 -140
  67. package/esm2015/lib/ra.dashboard.service.js +0 -82
  68. package/esm2015/lib/ra.event.enum.js +0 -60
  69. package/esm2015/lib/ra.gridster.config.js +0 -56
  70. package/esm2015/public-api.js +0 -13
  71. package/esm2015/schneideress-dashboardframework.js +0 -11
  72. package/esm5/gridster/index.js +0 -14
  73. package/esm5/gridster/lib/gridster.component.js +0 -474
  74. package/esm5/gridster/lib/gridster.interface.js +0 -7
  75. package/esm5/gridster/lib/gridster.module.js +0 -28
  76. package/esm5/gridster/lib/gridsterCompact.service.js +0 -163
  77. package/esm5/gridster/lib/gridsterConfig.constant.js +0 -104
  78. package/esm5/gridster/lib/gridsterConfig.interface.js +0 -27
  79. package/esm5/gridster/lib/gridsterConfigS.interface.js +0 -1
  80. package/esm5/gridster/lib/gridsterDraggable.service.js +0 -356
  81. package/esm5/gridster/lib/gridsterEmptyCell.service.js +0 -220
  82. package/esm5/gridster/lib/gridsterItem.component.js +0 -142
  83. package/esm5/gridster/lib/gridsterItem.interface.js +0 -1
  84. package/esm5/gridster/lib/gridsterItemComponent.interface.js +0 -7
  85. package/esm5/gridster/lib/gridsterPreview.component.js +0 -46
  86. package/esm5/gridster/lib/gridsterPush.service.js +0 -297
  87. package/esm5/gridster/lib/gridsterPushResize.service.js +0 -226
  88. package/esm5/gridster/lib/gridsterRenderer.service.js +0 -209
  89. package/esm5/gridster/lib/gridsterResizable.service.js +0 -373
  90. package/esm5/gridster/lib/gridsterResizeEventType.interface.js +0 -1
  91. package/esm5/gridster/lib/gridsterScroll.service.js +0 -119
  92. package/esm5/gridster/lib/gridsterSwap.service.js +0 -86
  93. package/esm5/gridster/lib/gridsterUtils.service.js +0 -93
  94. package/esm5/lib/custom.notifier.options.js +0 -41
  95. package/esm5/lib/ra-dashboard-area/ra.dashboard.area.js +0 -499
  96. package/esm5/lib/ra-widget-container/lock-tooltip/lock.tooltip.component.js +0 -50
  97. package/esm5/lib/ra-widget-container/ra.widget.container.component.js +0 -891
  98. package/esm5/lib/ra.base.dashboard.filter.js +0 -50
  99. package/esm5/lib/ra.base.dashboard.template.js +0 -35
  100. package/esm5/lib/ra.dashbard.event.bus.js +0 -47
  101. package/esm5/lib/ra.dashboard.module.js +0 -47
  102. package/esm5/lib/ra.dashboard.responsive.service.js +0 -151
  103. package/esm5/lib/ra.dashboard.service.js +0 -85
  104. package/esm5/lib/ra.event.enum.js +0 -60
  105. package/esm5/lib/ra.gridster.config.js +0 -56
  106. package/esm5/public-api.js +0 -13
  107. package/esm5/schneideress-dashboardframework.js +0 -11
  108. package/fesm2015/schneideress-dashboardframework.js +0 -4737
  109. package/fesm2015/schneideress-dashboardframework.js.map +0 -1
  110. package/fesm5/schneideress-dashboardframework.js +0 -4871
  111. package/fesm5/schneideress-dashboardframework.js.map +0 -1
  112. package/gridster/index.d.ts +0 -11
  113. package/gridster/lib/gridster.component.d.ts +0 -67
  114. package/gridster/lib/gridster.interface.d.ts +0 -46
  115. package/gridster/lib/gridster.module.d.ts +0 -2
  116. package/gridster/lib/gridsterCompact.service.d.ts +0 -15
  117. package/gridster/lib/gridsterConfig.constant.d.ts +0 -2
  118. package/gridster/lib/gridsterConfig.interface.d.ts +0 -133
  119. package/gridster/lib/gridsterConfigS.interface.d.ts +0 -93
  120. package/gridster/lib/gridsterDraggable.service.d.ts +0 -59
  121. package/gridster/lib/gridsterEmptyCell.service.d.ts +0 -29
  122. package/gridster/lib/gridsterItem.component.d.ts +0 -32
  123. package/gridster/lib/gridsterItem.interface.d.ts +0 -21
  124. package/gridster/lib/gridsterItemComponent.interface.d.ts +0 -25
  125. package/gridster/lib/gridsterPreview.component.d.ts +0 -10
  126. package/gridster/lib/gridsterPush.service.d.ts +0 -33
  127. package/gridster/lib/gridsterPushResize.service.d.ts +0 -26
  128. package/gridster/lib/gridsterRenderer.service.d.ts +0 -38
  129. package/gridster/lib/gridsterResizable.service.d.ts +0 -67
  130. package/gridster/lib/gridsterResizeEventType.interface.d.ts +0 -6
  131. package/gridster/lib/gridsterScroll.service.d.ts +0 -4
  132. package/gridster/lib/gridsterSwap.service.d.ts +0 -13
  133. package/gridster/lib/gridsterUtils.service.d.ts +0 -16
  134. package/schneideress-dashboardframework.metadata.json +0 -1
@@ -0,0 +1,1800 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Component, EventEmitter, ViewChild, Input, Output, NgModule } from '@angular/core';
3
+ import { of, Subject } from 'rxjs';
4
+ import * as i3 from '@schneideress/ra-common';
5
+ import { BaseService, RACommonModule } from '@schneideress/ra-common';
6
+ import * as i2$1 from 'ngx-ui-loader';
7
+ import { NgxUiLoaderModule } from 'ngx-ui-loader';
8
+ import * as i4 from 'angular-notifier';
9
+ import { NotifierModule } from 'angular-notifier';
10
+ import * as i6 from 'angular-gridster2';
11
+ import { GridsterModule } from 'angular-gridster2';
12
+ import { __awaiter } from 'tslib';
13
+ import { RaWidgetlockStatus, WidgetViewState, RADownloadType, RADownloadOption } from '@schneideress/widgetframework';
14
+ import * as i2 from '@angular/common';
15
+ import * as i5 from '@schneideress/common-controls';
16
+ import { RACommonControlsModule } from '@schneideress/common-controls';
17
+ import { BrowserModule } from '@angular/platform-browser';
18
+ import { HttpClientModule } from '@angular/common/http';
19
+ import { RAUserControlModule } from '@schneideress/user-controls';
20
+ import { filter, map } from 'rxjs/operators';
21
+
22
+ class RaDashboardService extends BaseService {
23
+ constructor(injector) {
24
+ super(injector, '');
25
+ this.loadedScripts = [];
26
+ }
27
+ /*
28
+ * To load external scripts in the dom
29
+ */
30
+ loadExternalScript(scriptPath, callback) {
31
+ if (this.loadedScripts.indexOf(scriptPath) == -1) {
32
+ const script = document.createElement('script');
33
+ script.src = scriptPath;
34
+ // script.addEventListener("load", callback(), true);
35
+ script.onload = function () {
36
+ callback();
37
+ };
38
+ document.body.appendChild(script);
39
+ this.loadedScripts.push(scriptPath);
40
+ }
41
+ else {
42
+ callback();
43
+ }
44
+ }
45
+ /*
46
+ * To retrieve the list of widgets based on dashboard id & areaId
47
+ */
48
+ getWidgetsByDashboardArea(widgetInfo, appConfig) {
49
+ this.baseUrl = appConfig.apiBaseUrl;
50
+ return this.post('widget/GetWidgetByArea', widgetInfo);
51
+ }
52
+ updateWidgets(widgetList, appConfig) {
53
+ this.baseUrl = appConfig.apiBaseUrl;
54
+ return this.post('widget/UpdateAreaWidgets', widgetList);
55
+ }
56
+ getWidgetConfigInfo(widgetInfo) {
57
+ return of();
58
+ }
59
+ /*
60
+ * To update the configuration of a widget.
61
+ */
62
+ updateConfig(config, widgetInstanceId) {
63
+ }
64
+ /**To add widget to the database */
65
+ addWidget(widgetInfo, appConfig) {
66
+ this.baseUrl = appConfig.apiBaseUrl;
67
+ return this.post('widget/AddWidgetUser', widgetInfo);
68
+ }
69
+ /** To Delete current widget from DOM*/
70
+ deleteWidget(widgetInfo, appConfig) {
71
+ this.baseUrl = appConfig.apiBaseUrl;
72
+ return this.delete('widget/DeleteWidgetUser?widgetInstanceId=' + widgetInfo.widgetInstanceId);
73
+ }
74
+ /**To Update widgetInfo in database */
75
+ updateWidget(widgetInfo, appConfig) {
76
+ this.baseUrl = appConfig.apiBaseUrl;
77
+ return this.post('widget/UpdateUserWidget', widgetInfo);
78
+ }
79
+ /** To Move or change position if current widget container*/
80
+ moveWidget(widgetInfo) {
81
+ }
82
+ /** To Copy Current widget with same configuration*/
83
+ copyWidget(widgetInfo) {
84
+ }
85
+ }
86
+ RaDashboardService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: RaDashboardService, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
87
+ RaDashboardService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: RaDashboardService, providedIn: 'root' });
88
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: RaDashboardService, decorators: [{
89
+ type: Injectable,
90
+ args: [{
91
+ providedIn: 'root'
92
+ }]
93
+ }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
94
+
95
+ var RAEvent;
96
+ (function (RAEvent) {
97
+ /** widget selection click on widget library */
98
+ RAEvent["WidgetSelected"] = "widgetSelected";
99
+ /** triggers when user click on the edit link in widget container */
100
+ RAEvent["WidgetEditClicked"] = "widgetEditClicked";
101
+ /** triggers when user clicks the cancel button on widget configuration window */
102
+ RAEvent["ConfigCancelClick"] = "configCancelClick";
103
+ /** triggers when user click on the close button on widget configuration window */
104
+ RAEvent["ConfigCloseClick"] = "configCloseClick";
105
+ /** add button click on widget configuration window */
106
+ RAEvent["ConfigAddClick"] = "configAddClick";
107
+ /** triggers when a user click on the save button in widget configuration window */
108
+ RAEvent["ConfigChanged"] = "configChanged";
109
+ /**To rearrange widgets in a dashboard */
110
+ RAEvent["RearrangeClicked"] = "rearrangeClicked";
111
+ /**dashboard customize button click */
112
+ RAEvent["DashboardCustomizeClick"] = "dashboardCustomizeClick";
113
+ /**triggers when user clicks on the dashboard change icon in header section */
114
+ RAEvent["DashboardChanged"] = "dashboardChanged";
115
+ /** triggers when user clicks the close button on library */
116
+ RAEvent["WidgetLibraryCloseBtnClicked"] = "WidgetLibraryCloseBtnClicked";
117
+ /** triggers when user clicks on view dashboard*/
118
+ RAEvent["LoadDashboard"] = "LoadDashboard";
119
+ /** triggers when user clicks on copywidget */
120
+ RAEvent["CopyWidget"] = "CopyWidget";
121
+ /**triggers when user clicks on Move widget */
122
+ RAEvent["MoveWidget"] = "MoveWidget";
123
+ /**triggers when user raise delete widget event */
124
+ RAEvent["WidgetDelete"] = "WidgetDelete";
125
+ /** used to add widget to widgetlist when user copies a widget to current dashboard */
126
+ RAEvent["AddWidget"] = "AddWidget";
127
+ /** done button click on widget library flyout */
128
+ RAEvent["widgetLibraryDoneClick"] = "widgetLibraryDoneClick";
129
+ /**refresh favorite icon after srtting and resetting favorites */
130
+ RAEvent["favoriteIconRefresh"] = "favoriteIconRefresh";
131
+ /**to refresh menu content */
132
+ RAEvent["QuickLinkRefresh"] = "QuickLinkRefresh";
133
+ /**To raise widget added event */
134
+ RAEvent["WidgetAdded"] = "WidgetAdded";
135
+ /**To update global filter site from map widget selected site */
136
+ RAEvent["UpdateGlobalFilterFromMapWidget"] = "UpdateGlobalFilterFromMapWidget";
137
+ /**To add widget on empty dashboard */
138
+ RAEvent["AddWidgetEmptyDashboard"] = "AddWidgetEmptyDashboard";
139
+ /**To raise new widget add click event */
140
+ RAEvent["AddNewWidgetToDashboard"] = "AddNewWidgetToDashboard";
141
+ RAEvent["HideDashboardBanner"] = "HideDashboardBanner";
142
+ /**To launch flyout from custom widget library */
143
+ RAEvent["LaunchCustomWidgetFlyout"] = "LaunchCustomWidgetFlyout";
144
+ /**update applied filter badge for inaplicable filters */
145
+ RAEvent["UpdateAppledFiterForInapplicableFilter"] = "UpdateAppledFiterForInapplicableFilter";
146
+ /**show inapplicable filter message in global filter flyout */
147
+ RAEvent["ShowInapplicableFilterMessage"] = "ShowInapplicableFilterMessage";
148
+ })(RAEvent || (RAEvent = {}));
149
+ var RAEventKey;
150
+ (function (RAEventKey) {
151
+ /** on edit widget click */
152
+ RAEventKey["WidgetInstanceId"] = "widgetInstanceId";
153
+ })(RAEventKey || (RAEventKey = {}));
154
+
155
+ const GridsterConfigDefaultSettings = {
156
+ gridType: 'scrollVertical',
157
+ compactType: 'none',
158
+ margin: 10,
159
+ outerMargin: true,
160
+ outerMarginTop: 10,
161
+ outerMarginRight: 10,
162
+ outerMarginBottom: 30,
163
+ outerMarginLeft: 10,
164
+ useTransformPositioning: true,
165
+ mobileBreakpoint: 640,
166
+ minCols: 10,
167
+ maxCols: 10,
168
+ minRows: 1,
169
+ maxRows: 100,
170
+ maxItemCols: 10,
171
+ minItemCols: 1,
172
+ maxItemRows: 1000,
173
+ minItemRows: 1,
174
+ maxItemArea: 1000,
175
+ minItemArea: 1,
176
+ defaultItemCols: 1,
177
+ defaultItemRows: 1,
178
+ keepFixedHeightInMobile: false,
179
+ keepFixedWidthInMobile: false,
180
+ scrollSensitivity: 10,
181
+ scrollSpeed: 20,
182
+ enableEmptyCellClick: false,
183
+ enableEmptyCellContextMenu: false,
184
+ enableEmptyCellDrop: false,
185
+ enableEmptyCellDrag: false,
186
+ emptyCellDragMaxCols: 50,
187
+ emptyCellDragMaxRows: 50,
188
+ ignoreMarginInRow: true,
189
+ draggable: {
190
+ enabled: true,
191
+ dragHandleClass: 'widget-move',
192
+ ignoreContent: true
193
+ },
194
+ resizable: {
195
+ enabled: true,
196
+ },
197
+ swap: true,
198
+ pushItems: true,
199
+ disablePushOnDrag: false,
200
+ disablePushOnResize: false,
201
+ pushDirections: { north: true, east: true, south: true, west: true },
202
+ pushResizeItems: false,
203
+ displayGrid: 'none',
204
+ disableWindowResize: false,
205
+ disableWarnings: false,
206
+ scrollToNewItems: true,
207
+ autoResizeonDrag: false,
208
+ setGridSize: false
209
+ };
210
+
211
+ class RADashboardResponsiveService {
212
+ constructor() {
213
+ this.resized = new Subject();
214
+ this.maxColsDesktop = 8;
215
+ this.resInfo = [
216
+ { 'id': 1, 'start': 0, 'end': 767, 'minCols': 1, 'maxCols': 1 },
217
+ { 'id': 2, 'start': 768, 'end': 1024, 'minCols': 1, 'maxCols': 2 },
218
+ { 'id': 3, 'start': 1025, 'end': 1366, 'minCols': 1, 'maxCols': 6 },
219
+ { 'id': 4, 'start': 1367, 'end': 9999999999, 'minCols': 1, 'maxCols': this.maxColsDesktop }
220
+ ];
221
+ this.setScreenWidth();
222
+ window.addEventListener('resize', () => {
223
+ var context = this;
224
+ if (this.screenWidthAdjusted)
225
+ clearTimeout(this.screenWidthAdjusted);
226
+ this.screenWidthAdjusted = setTimeout(() => {
227
+ context.setScreenWidth();
228
+ }, 500);
229
+ });
230
+ }
231
+ setScreenWidth() {
232
+ this.screenWidth = window.outerWidth;
233
+ if (this.IsDesktopView) {
234
+ this.currentResInfo = this.resInfo[3];
235
+ this.resized.next(true);
236
+ }
237
+ else {
238
+ let resInfo = this.resInfo.filter((item) => {
239
+ return item.end >= this.screenWidth && item.start <= this.screenWidth;
240
+ })[0];
241
+ if (!this.currentResInfo || this.currentResInfo.id != resInfo.id) {
242
+ this.currentResInfo = resInfo;
243
+ this.resized.next(this.currentResInfo);
244
+ }
245
+ }
246
+ }
247
+ get IsDesktopView() {
248
+ let agent = navigator.userAgent || navigator.vendor || window.opera;
249
+ if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|realme|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(agent) ||
250
+ /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(agent))
251
+ return false;
252
+ return true;
253
+ }
254
+ get IsMobile() {
255
+ let check = false;
256
+ let agent = navigator.userAgent || navigator.vendor || window.opera;
257
+ if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(agent)
258
+ || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(agent))
259
+ check = true;
260
+ return check;
261
+ }
262
+ getGridsterConfig(isWidgetMgmnt) {
263
+ let config = GridsterConfigDefaultSettings;
264
+ config.minCols = this.currentResInfo.maxCols;
265
+ config.maxCols = this.currentResInfo.maxCols;
266
+ config.minRows = this.currentResInfo.minCols;
267
+ config.maxItemCols = this.currentResInfo.maxCols;
268
+ config.minItemCols = this.currentResInfo.minCols;
269
+ config.minItemRows = this.currentResInfo.minCols;
270
+ config.minItemArea = this.currentResInfo.minCols * this.currentResInfo.minCols;
271
+ config.defaultItemCols = this.currentResInfo.minCols;
272
+ config.defaultItemRows = this.currentResInfo.minCols;
273
+ if (!this.IsDesktopView || !isWidgetMgmnt) {
274
+ if (config.resizable)
275
+ config.resizable.enabled = false;
276
+ config.swap = false;
277
+ if (config.draggable)
278
+ config.draggable.enabled = false;
279
+ }
280
+ else {
281
+ if (config.resizable)
282
+ config.resizable.enabled = true;
283
+ config.swap = true;
284
+ if (config.draggable)
285
+ config.draggable.enabled = true;
286
+ }
287
+ return config;
288
+ }
289
+ /**To map IwidgetInfo object to gridsterItem */
290
+ getGridsterItem(widget) {
291
+ if (widget.widgetSettings) {
292
+ widget.settings = JSON.parse(widget.widgetSettings);
293
+ }
294
+ let gridsterItem = {
295
+ cols: this.getWidth(widget.width),
296
+ rows: this.getHeight(widget.height),
297
+ x: this.IsDesktopView ? widget.position_x : 0,
298
+ y: this.IsDesktopView ? widget.position_y : 0,
299
+ widgetInfo: widget,
300
+ minItemRows: this.getMinItemRows(widget),
301
+ minItemCols: this.getMinItemCols(widget)
302
+ };
303
+ return gridsterItem;
304
+ }
305
+ getWidth(width) {
306
+ if (!this.IsDesktopView) {
307
+ width = Math.floor(width / this.maxColsDesktop * this.currentResInfo.maxCols);
308
+ if (width < this.currentResInfo.minCols)
309
+ width = this.currentResInfo.minCols;
310
+ }
311
+ return width;
312
+ }
313
+ getMinItemRows(widget) {
314
+ if (this.IsDesktopView) {
315
+ if (widget.settings && widget.settings.minRows) {
316
+ return widget.settings.minRows;
317
+ }
318
+ }
319
+ }
320
+ getMinItemCols(widget) {
321
+ if (this.IsDesktopView) {
322
+ if (widget.settings && widget.settings.minCols) {
323
+ return widget.settings.minCols;
324
+ }
325
+ }
326
+ }
327
+ getHeight(height) {
328
+ if (!this.IsDesktopView) {
329
+ height = Math.floor(height / this.maxColsDesktop * this.currentResInfo.maxCols);
330
+ if (height < this.currentResInfo.minCols)
331
+ height = this.currentResInfo.minCols;
332
+ }
333
+ return height;
334
+ }
335
+ }
336
+ RADashboardResponsiveService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: RADashboardResponsiveService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
337
+ RADashboardResponsiveService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: RADashboardResponsiveService, providedIn: 'root' });
338
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: RADashboardResponsiveService, decorators: [{
339
+ type: Injectable,
340
+ args: [{ providedIn: 'root' }]
341
+ }], ctorParameters: function () { return []; } });
342
+
343
+ class LockTooltip {
344
+ constructor(domService) {
345
+ this.domService = domService;
346
+ }
347
+ ngOnInit() {
348
+ if (this.element) {
349
+ this.setPopupPosition();
350
+ }
351
+ }
352
+ setPopupPosition() {
353
+ let rect = this.element.getBoundingClientRect();
354
+ if ((rect.left + 250) > window.innerWidth) {
355
+ this.containerLeft = (rect.left - ((rect.left + 270) - window.innerWidth)) + 'px';
356
+ }
357
+ else {
358
+ this.containerLeft = rect.left + 'px';
359
+ }
360
+ if (rect.bottom + 100 < window.innerHeight) {
361
+ this.containerTop = (rect.bottom) + 'px';
362
+ this.containerBottom = null;
363
+ }
364
+ else {
365
+ this.containerTop = null;
366
+ this.containerBottom = (window.innerHeight - rect.top) + 'px';
367
+ }
368
+ }
369
+ removeMe(comp) {
370
+ setTimeout(() => {
371
+ this.domService.removeComponent(comp);
372
+ });
373
+ }
374
+ }
375
+ LockTooltip.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: LockTooltip, deps: [{ token: i3.DomService }], target: i0.ɵɵFactoryTarget.Component });
376
+ LockTooltip.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.3", type: LockTooltip, selector: "ra-lock-tooltip", ngImport: i0, template: "<div class=\"lock-popup-content light widget-config-item\"\r\n [ngStyle]=\"{'top': containerTop,'bottom':containerBottom,'position':'fixed','left':containerLeft,'z-index': '9999','width':'250px','min-height':'fit-content'}\">\r\n <div *ngIf=\"data && !template\">\r\n <label style=\"color: #D9F0FA;\">\r\n {{title}}:\r\n </label>\r\n <div style=\"color: white;\">\r\n <label class=\"bold\" style=\"margin-bottom: 0px;width: 100%;\" *ngFor=\"let item of data\">\r\n {{item}}\r\n </label>\r\n </div>\r\n <hr style=\"background-color: white;\">\r\n <div style=\"color: #D9F0FA;\">\r\n <label>{{footer}}</label>\r\n </div>\r\n </div>\r\n <div *ngIf=\"!data && template\">\r\n <ng-container *ngTemplateOutlet=\"template\">\r\n </ng-container>\r\n </div>\r\n</div>", styles: [".lock-popup-content{margin-top:8px;position:absolute;right:0;top:79%;box-shadow:0 8px 16px 8px #0003;z-index:899;font-size:12px;min-width:220px!important;min-height:112px;background-color:#219bfd;opacity:.9;padding:15px;color:#fff}.widget-config-item i{font-size:17px;color:#42b4e6}.widget-config-item span{font-size:12px;font:inherit;padding-left:12px;color:#42b4e6}\n"], directives: [{ type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
377
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: LockTooltip, decorators: [{
378
+ type: Component,
379
+ args: [{ selector: 'ra-lock-tooltip', template: "<div class=\"lock-popup-content light widget-config-item\"\r\n [ngStyle]=\"{'top': containerTop,'bottom':containerBottom,'position':'fixed','left':containerLeft,'z-index': '9999','width':'250px','min-height':'fit-content'}\">\r\n <div *ngIf=\"data && !template\">\r\n <label style=\"color: #D9F0FA;\">\r\n {{title}}:\r\n </label>\r\n <div style=\"color: white;\">\r\n <label class=\"bold\" style=\"margin-bottom: 0px;width: 100%;\" *ngFor=\"let item of data\">\r\n {{item}}\r\n </label>\r\n </div>\r\n <hr style=\"background-color: white;\">\r\n <div style=\"color: #D9F0FA;\">\r\n <label>{{footer}}</label>\r\n </div>\r\n </div>\r\n <div *ngIf=\"!data && template\">\r\n <ng-container *ngTemplateOutlet=\"template\">\r\n </ng-container>\r\n </div>\r\n</div>", styles: [".lock-popup-content{margin-top:8px;position:absolute;right:0;top:79%;box-shadow:0 8px 16px 8px #0003;z-index:899;font-size:12px;min-width:220px!important;min-height:112px;background-color:#219bfd;opacity:.9;padding:15px;color:#fff}.widget-config-item i{font-size:17px;color:#42b4e6}.widget-config-item span{font-size:12px;font:inherit;padding-left:12px;color:#42b4e6}\n"] }]
380
+ }], ctorParameters: function () { return [{ type: i3.DomService }]; } });
381
+
382
+ class RAWidgetContainer {
383
+ constructor(dashboardService, ngxService, translateService, ngZone, notifier, renderer, raPermissionService, domService) {
384
+ this.dashboardService = dashboardService;
385
+ this.ngxService = ngxService;
386
+ this.translateService = translateService;
387
+ this.ngZone = ngZone;
388
+ this.notifier = notifier;
389
+ this.renderer = renderer;
390
+ this.raPermissionService = raPermissionService;
391
+ this.domService = domService;
392
+ this.showPanel = true;
393
+ this.isWidgetLoaded = false;
394
+ this.lockClass = "unlocked";
395
+ this.lockStatus = RaWidgetlockStatus.Unlocked;
396
+ this.isDownloadIconVisible = false;
397
+ this.isChartDownloadVisible = false;
398
+ this.isGridDownloadVisible = false;
399
+ this.enableTitleLine = false;
400
+ this.isGlobalFilterApplied = false;
401
+ this.toolTipValue = ' ';
402
+ this.toolTipWidth = '0px';
403
+ this.editToolTipValue = ' ';
404
+ this.copyToolTipValue = ' ';
405
+ this.moveToolTipValue = ' ';
406
+ this.excelToolTipValue = ' ';
407
+ this.deleteToolTipValue = ' ';
408
+ this.editText = '';
409
+ this.copyText = '';
410
+ this.moveText = '';
411
+ this.excelText = '';
412
+ this.deleteText = '';
413
+ this.editToolTipWidth = '0px';
414
+ this.copyToolTipWidth = '0px';
415
+ this.moveToolTipWidth = '0px';
416
+ this.excelToolTipWidth = '0px';
417
+ this.deleteToolTipWidth = '0px';
418
+ this.noPadding = false;
419
+ this.isMouseHover = false;
420
+ this.showSettingsLink = true;
421
+ this.isKpiView = false;
422
+ this.showExcell = true;
423
+ this.hideTitle = false;
424
+ this.inapplicableFilters = [];
425
+ this.widgetDeleted = new EventEmitter();
426
+ this.updateAppliedFilters = new EventEmitter();
427
+ this.isWidgetStateApplicable = false;
428
+ this.widgetEmptyState = '';
429
+ this.lockVisible = false;
430
+ this.isWidgetMgmnt = false;
431
+ this.enableTitleLineActual = false;
432
+ this.renderer.listen('window', 'click', (e) => {
433
+ if (e.target.className) {
434
+ if (e.target.className != 'fal fa-ellipsis-v widget-menu-ellipse') {
435
+ this.removeMenu();
436
+ }
437
+ }
438
+ else {
439
+ this.removeMenu();
440
+ }
441
+ });
442
+ }
443
+ set setResized(resized) {
444
+ this.invokeWidgetResizedEvent();
445
+ }
446
+ ngOnInit() {
447
+ this.WidgetDisplayName = this.translateService.translate('Common.' + this.data.widgetInfo.widgetTitle, true);
448
+ this.lockIconTitle = this.translateService.translate('Common.lockedfields');
449
+ this.lockIconFooter = this.translateService.translate('Common.lockedfieldseditinfo');
450
+ this.inapplicableIconTitle = this.translateService.translate('Common.InapplicableFilters');
451
+ this.inapplicableIconFooter = this.translateService.translate('Common.InapplicableFiltersDesc');
452
+ }
453
+ get widgetViewState() { return WidgetViewState; }
454
+ ngOnChanges(changes) {
455
+ this.isWidgetMgmnt = this.raPermissionService.hasPermission('ra.widgetmanagement');
456
+ if (changes['raDashboardEventBus'] && changes['raDashboardEventBus'].currentValue != changes['raDashboardEventBus'].previousValue) {
457
+ this.configChanged = this.raDashboardEventBus.subscribeWithKey(RAEvent.ConfigChanged, RAEventKey.WidgetInstanceId, this.data.widgetInfo.widgetInstanceId.toString()).subscribe((e) => {
458
+ this.ngZone.run(() => {
459
+ this.configChangeEventHandler(e);
460
+ });
461
+ });
462
+ }
463
+ if (this.widgetElement && changes['globalFilter'] && changes['globalFilter'].currentValue != changes['globalFilter'].previousValue) {
464
+ let filterObj = this.getParsedConfig(this.globalFilter);
465
+ if (filterObj.WidgetInstanceId) {
466
+ if (this.data.widgetInfo.widgetInstanceId != filterObj.WidgetInstanceId)
467
+ this.refreshWidget(this.data.widgetInfo);
468
+ }
469
+ else {
470
+ this.refreshWidget(this.data.widgetInfo);
471
+ }
472
+ }
473
+ if (changes['width'] && changes['width'].currentValue != changes['width'].previousValue ||
474
+ (changes['height'] && changes['height'].currentValue != changes['height'].previousValue)) {
475
+ this.invokeWidgetResizedEvent();
476
+ }
477
+ }
478
+ invokeWidgetResizedEvent() {
479
+ if (this.widgetElement) {
480
+ if (typeof this.widgetElement.widgetResized === "function") {
481
+ let size = {};
482
+ size.height = this.height;
483
+ size.width = this.width;
484
+ size.cellHeight = this.gridCellHeight;
485
+ this.widgetElement.widgetResized(size);
486
+ if (this.height == 1 || this.width == 1)
487
+ this.isKpiView = true;
488
+ else
489
+ this.isKpiView = false;
490
+ }
491
+ }
492
+ }
493
+ mouseHover(isHover = true) {
494
+ this.isMouseHover = isHover;
495
+ if (this.widgetElement) {
496
+ if (typeof this.widgetElement.hoverStatus === "function") {
497
+ this.widgetElement.hoverStatus(isHover);
498
+ }
499
+ else {
500
+ console.warn('widget framework outdated, please update to version 0.0.96');
501
+ }
502
+ }
503
+ }
504
+ ngAfterViewInit() {
505
+ setTimeout(() => {
506
+ this.loadWidget(this.data.widgetInfo);
507
+ });
508
+ document.addEventListener("scroll", () => {
509
+ this.removeMenu();
510
+ this.closePopup();
511
+ });
512
+ setTimeout(() => {
513
+ let item = jQuery(this.wcWrapper.nativeElement).closest('gridster-item');
514
+ item.bind('mouseenter', () => {
515
+ window.gridsterItemEnter = true;
516
+ });
517
+ item.bind('mouseleave', () => {
518
+ window.gridsterItemEnter = false;
519
+ setTimeout(() => {
520
+ if (!window.mouseOverWidgetMenu) {
521
+ this.removeMenu();
522
+ }
523
+ });
524
+ });
525
+ });
526
+ }
527
+ ngOnDestroy() {
528
+ if (this.configChanged)
529
+ this.configChanged.unsubscribe();
530
+ if (this.widgetElementHandler && this.data && this.data.widgetInfo && this.data.widgetInfo.widgetInstanceId) {
531
+ document.body.removeEventListener('widgetinitiated' + this.data.widgetInfo.widgetInstanceId, this.widgetElementHandler);
532
+ }
533
+ }
534
+ /** To Edit current widget configuration*/
535
+ editWidget() {
536
+ let widgetConfigFilter = null;
537
+ if (this.widgetElement && typeof (this.widgetElement.getConfigFilter) == 'function') {
538
+ let configData = this.widgetElement.getConfigFilter();
539
+ if (configData) {
540
+ widgetConfigFilter = configData;
541
+ }
542
+ }
543
+ if (widgetConfigFilter) {
544
+ this.raDashboardEventBus.publish(RAEvent.WidgetEditClicked, widgetConfigFilter);
545
+ }
546
+ else {
547
+ let widgetConfigFilterData = this.generateConfigFilter(false);
548
+ this.raDashboardEventBus.publish(RAEvent.WidgetEditClicked, widgetConfigFilterData);
549
+ }
550
+ }
551
+ /** To Delete current widget from DOM*/
552
+ deleteWidget() {
553
+ let widgetContainerContext = this;
554
+ widgetContainerContext.ngxService.start();
555
+ widgetContainerContext.dashboardService.deleteWidget(this.data.widgetInfo, this.appConfig).subscribe(status => {
556
+ widgetContainerContext.ngxService.stop();
557
+ if (status) {
558
+ widgetContainerContext.widgetDeleted.emit(this.data.widgetInfo.widgetInstanceId);
559
+ this.setInapplicableFilters(undefined, this.data.widgetInfo.widgetInstanceId);
560
+ }
561
+ else {
562
+ widgetContainerContext.notifier.notify('error', " " + this.translateService.translate('FailedToRemoveWidget') + " (" + this.translateService.translate('Common.' + this.data.widgetInfo.widgetTitle, true) + ")!");
563
+ }
564
+ });
565
+ }
566
+ /** To Move or change position if current widget container*/
567
+ moveWidget() {
568
+ this.raDashboardEventBus.publish(RAEvent.MoveWidget, this.data.widgetInfo);
569
+ this.setInapplicableFilters(undefined, this.data.widgetInfo.widgetInstanceId);
570
+ // this.dashboardService.moveWidget(widgetInfo);
571
+ }
572
+ /** To Copy Current widget with same configuration*/
573
+ copyWidget() {
574
+ this.raDashboardEventBus.publish(RAEvent.CopyWidget, this.data.widgetInfo);
575
+ //this.dashboardService.copyWidget(widgetInfo);
576
+ }
577
+ visitPage() {
578
+ this.baseUrl = this.getHostUrl();
579
+ let url = this.baseUrl + this.detailPageUrl;
580
+ if (this.data.widgetInfo && this.data.widgetInfo.widgetSettings) {
581
+ this.widgetSettings = this.getParsedConfig(this.data.widgetInfo.widgetSettings);
582
+ if (this.widgetSettings.customPageParams || this.widgetSettings.customPageURL) {
583
+ let params = this.widgetElement.getPageParamsClicked();
584
+ if (params) {
585
+ if (this.data.widgetInfo.widgetType == 'AV Widget' || this.widgetSettings.customPageURL)
586
+ url = url + params;
587
+ else
588
+ url = url + '?' + params;
589
+ }
590
+ }
591
+ }
592
+ window.open(url, '_blank');
593
+ }
594
+ getHostUrl() {
595
+ return window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '');
596
+ }
597
+ configChangeEventHandler(widgetInfo) {
598
+ this.data.widgetInfo = widgetInfo;
599
+ if (this.gridCellHeight > 0) {
600
+ this.data.widgetInfo.rowHeight = this.gridCellHeight;
601
+ }
602
+ if (this.widgetElement && typeof (this.widgetElement.setConfigFilter) == 'function') {
603
+ this.widgetElement.setConfigFilter(this.generateConfigFilter(true));
604
+ }
605
+ else {
606
+ console.warn('widget framework outdated, please update to version 0.0.98');
607
+ }
608
+ this.refreshWidget(this.data.widgetInfo, true);
609
+ }
610
+ generateConfigFilter(configChanged = false) {
611
+ let widgetConfigFilterData = {
612
+ appConfig: this.appConfig,
613
+ globalFilter: this.globalFilter,
614
+ widgetInfo: this.data.widgetInfo,
615
+ config: this.data.widgetInfo.widgetConfigInfo.config,
616
+ configChanges: this.getConfigChanges(configChanged)
617
+ };
618
+ return widgetConfigFilterData;
619
+ }
620
+ /** To load external custom element to the widget container*/
621
+ loadWidget(widgetInfo) {
622
+ return __awaiter(this, void 0, void 0, function* () {
623
+ widgetInfo.rowHeight = this.gridCellHeight;
624
+ let widgetConfigFilter = {
625
+ config: widgetInfo.widgetConfigInfo.config,
626
+ globalFilter: this.globalFilter,
627
+ configChanges: this.getConfigChanges(false)
628
+ };
629
+ if (widgetInfo.widgetSettings) {
630
+ this.widgetSettings = this.getParsedConfig(widgetInfo.widgetSettings);
631
+ this.applayWidgetSettings(this.widgetSettings);
632
+ }
633
+ this.detailPageUrl = widgetInfo.detailPageUrl;
634
+ let me = this;
635
+ this.dashboardService.loadExternalScript(widgetInfo.scriptUrl, () => {
636
+ this.setNotConfiguredState(widgetInfo);
637
+ let appModule = this.data.widgetInfo.widgetName;
638
+ if (this.data.widgetInfo.applicationModule && this.data.widgetInfo.applicationModule.length > 0) {
639
+ appModule = this.data.widgetInfo.applicationModule;
640
+ }
641
+ this.translateService.loadTranslations(this.appConfig.appManagementBaseUrl, appModule, false).then(() => {
642
+ me.widgetElement = document.createElement(widgetInfo.customTag);
643
+ me.widgetElement.setAttribute("widget-instance-id", widgetInfo.widgetInstanceId);
644
+ let handler = (event) => {
645
+ setTimeout(() => __awaiter(this, void 0, void 0, function* () {
646
+ this.widgetElement.addEventListener('on-widget-respond', (e) => {
647
+ var type = e.detail.type;
648
+ switch (type) {
649
+ case 'onDataLoad':
650
+ if (e.detail.data)
651
+ this.showPanel = true;
652
+ else
653
+ this.showPanel = false;
654
+ break;
655
+ case 'onConfigEditClicked':
656
+ this.editWidget();
657
+ break;
658
+ case 'onEnableDefaultState':
659
+ this.setEmptyState(e.detail.data);
660
+ break;
661
+ case 'onSetTitleUnderline':
662
+ if (e.detail.data == true)
663
+ this.enableTitleLine = true;
664
+ else
665
+ this.enableTitleLine = this.enableTitleLineActual;
666
+ break;
667
+ case 'onWidgetTitleHidden':
668
+ if (e.detail.data == true)
669
+ this.hideTitle = true;
670
+ else
671
+ this.hideTitle = false;
672
+ break;
673
+ case 'onUpdateLockData':
674
+ this.setLock(e.detail.data);
675
+ break;
676
+ case 'onGlobalFilterApplicableCheck':
677
+ this.setInapplicableFilters(e.detail.data, widgetInfo.widgetInstanceId);
678
+ break;
679
+ default:
680
+ break;
681
+ }
682
+ });
683
+ if (typeof (this.widgetElement.titleLineEnabled) != 'undefined') {
684
+ let titleLineEnabled = this.widgetElement.titleLineEnabled();
685
+ if (titleLineEnabled) {
686
+ this.enableTitleLine = titleLineEnabled;
687
+ this.enableTitleLineActual = titleLineEnabled;
688
+ }
689
+ }
690
+ this.editText = this.translateService.translate('Common.edit');
691
+ if (this.translateService.translate('Common.edit').length > 6) {
692
+ this.editText = (this.translateService.translate('Common.edit').substring(0, 6) + '...');
693
+ this.editToolTipValue = this.translateService.translate('Common.edit');
694
+ this.editToolTipWidth = "300px";
695
+ }
696
+ this.copyText = this.translateService.translate('Common.copy');
697
+ if (this.translateService.translate('Common.copy').length > 6) {
698
+ this.copyText = (this.translateService.translate('Common.copy').substring(0, 6) + '...');
699
+ this.copyToolTipValue = this.translateService.translate('Common.copy');
700
+ this.copyToolTipWidth = "300px";
701
+ }
702
+ this.moveText = this.translateService.translate('Common.move');
703
+ if (this.translateService.translate('Common.move').length > 6) {
704
+ this.moveText = (this.translateService.translate('Common.move').substring(0, 6) + '...');
705
+ this.moveToolTipValue = this.translateService.translate('Common.move');
706
+ this.moveToolTipWidth = "300px";
707
+ }
708
+ this.excelText = this.translateService.translate('Common.excel');
709
+ if (this.translateService.translate('Common.excel').length > 6) {
710
+ this.excelText = (this.translateService.translate('Common.excel').substring(0, 6) + '...');
711
+ this.excelToolTipValue = this.translateService.translate('Common.excel');
712
+ this.excelToolTipWidth = "300px";
713
+ }
714
+ this.deleteText = this.translateService.translate('Common.delete');
715
+ if (this.translateService.translate('Common.delete').length > 6) {
716
+ this.deleteText = (this.translateService.translate('Common.delete').substring(0, 6) + '...');
717
+ this.deleteToolTipValue = this.translateService.translate('Common.delete');
718
+ this.deleteToolTipWidth = "300px";
719
+ }
720
+ this.isWidgetLoaded = true;
721
+ widgetConfigFilter.appConfig = this.appConfig;
722
+ widgetConfigFilter.widgetInfo = widgetInfo;
723
+ widgetConfigFilter.configChanges = this.getConfigChanges(false);
724
+ widgetConfigFilter.widgetInfo.widgetName = widgetInfo.widgetName;
725
+ widgetConfigFilter.globalFilter = this.globalFilter;
726
+ this.widgetElement.loadContent(widgetConfigFilter);
727
+ yield this.setLock(widgetConfigFilter.config);
728
+ yield this.setDownloadIcon();
729
+ }));
730
+ };
731
+ this.widgetElementHandler = handler;
732
+ document.body.addEventListener('widgetinitiated' + widgetInfo.widgetInstanceId, handler);
733
+ this.ctlWidget.nativeElement.appendChild(this.widgetElement);
734
+ });
735
+ });
736
+ });
737
+ }
738
+ /**To set Default State for the widget when it is not configured */
739
+ setNotConfiguredState(widgetInfo, forceEnable = false) {
740
+ if ((widgetInfo.showDefaultState && (widgetInfo.widgetConfigInfo.config == "" || Object.keys(JSON.parse(widgetInfo.widgetConfigInfo.config)).length == 0)) || (forceEnable)) {
741
+ this.isWidgetStateApplicable = true;
742
+ this.widgetEmptyState = WidgetViewState.emptyConfig.toString();
743
+ }
744
+ else {
745
+ this.widgetEmptyState = '';
746
+ this.isWidgetStateApplicable = false;
747
+ }
748
+ }
749
+ /**To configure empty state for the widget */
750
+ setEmptyState(widgetState) {
751
+ if (this.height == 1 || this.width == 1)
752
+ this.isKpiView = true;
753
+ else
754
+ this.isKpiView = false;
755
+ this.widgetEmptyState = widgetState.widgetViewState;
756
+ this.isGlobalFilterApplied = widgetState.isGlobalFilterApplied;
757
+ if (widgetState != WidgetViewState.normal) {
758
+ this.isWidgetStateApplicable = true;
759
+ this.isDownloadIconVisible = false;
760
+ }
761
+ else {
762
+ this.isWidgetStateApplicable = false;
763
+ }
764
+ switch (widgetState) {
765
+ case WidgetViewState.emptyConfig:
766
+ this.setNotConfiguredState(this.data.widgetInfo, true);
767
+ break;
768
+ case WidgetViewState.emptyData:
769
+ break;
770
+ case WidgetViewState.error:
771
+ break;
772
+ }
773
+ }
774
+ getConfigChanges(configChanged = false) {
775
+ let configChanges = {
776
+ isConfigUpdated: configChanged,
777
+ updatedConfigProperty: []
778
+ };
779
+ return configChanges;
780
+ }
781
+ /** To refresh widget on input config changes */
782
+ refreshWidget(widgetInfo, configChanged = false) {
783
+ return __awaiter(this, void 0, void 0, function* () {
784
+ this.WidgetDisplayName = this.translateService.translate('Common.' + this.data.widgetInfo.widgetTitle, true);
785
+ widgetInfo.rowHeight = this.gridCellHeight;
786
+ this.setNotConfiguredState(widgetInfo);
787
+ let widgetContainerContext = this;
788
+ let widgetConfigFilter = {
789
+ config: widgetInfo.widgetConfigInfo.config,
790
+ globalFilter: this.globalFilter,
791
+ appConfig: this.appConfig,
792
+ widgetInfo: widgetInfo,
793
+ configChanges: this.getConfigChanges(configChanged)
794
+ };
795
+ if (widgetContainerContext.isWidgetLoaded) {
796
+ if (this.widgetElement && typeof (this.widgetElement.setConfigFilter) == 'function') {
797
+ widgetContainerContext.widgetElement.setConfigFilter(widgetConfigFilter);
798
+ }
799
+ widgetContainerContext.widgetElement.loadContent(widgetConfigFilter);
800
+ yield this.setLock(widgetConfigFilter.config);
801
+ yield this.setDownloadIcon();
802
+ }
803
+ });
804
+ }
805
+ mouseOver(event) {
806
+ this.toolTipValue = ' ';
807
+ this.toolTipWidth = '0px';
808
+ let element = this.searchInput.nativeElement;
809
+ if (element.offsetWidth < element.scrollWidth) {
810
+ this.toolTipValue = element.innerHTML;
811
+ this.toolTipWidth = '300px';
812
+ }
813
+ else {
814
+ this.toolTipWidth = '0px';
815
+ }
816
+ }
817
+ setLock(config) {
818
+ return __awaiter(this, void 0, void 0, function* () {
819
+ this.lockTemplateInfo = this.widgetElement.loadLockInfo();
820
+ var configObj;
821
+ if (config) {
822
+ configObj = JSON.parse(config);
823
+ if (configObj && configObj.Locks != undefined) {
824
+ if (configObj.Locks.IsDateLocked || configObj.Locks.IsDatesLocked || configObj.Locks.IsParticipantLocked || configObj.Locks.IsSourceLocked) {
825
+ this.lockDetails = [];
826
+ if (configObj.Locks.IsDateLocked || configObj.Locks.IsDatesLocked)
827
+ this.lockDetails.push(this.translateService.translate('Common.DateRange'));
828
+ if (configObj.Locks.IsParticipantLocked) {
829
+ this.lockDetails.push(this.translateService.translate('Common.DivisionOrGrouporSite'));
830
+ }
831
+ if (configObj.Locks.IsSourceLocked)
832
+ this.lockDetails.push(this.translateService.translate('Common.DataStream'));
833
+ }
834
+ else {
835
+ this.lockDetails = undefined;
836
+ }
837
+ }
838
+ else {
839
+ this.lockDetails = undefined;
840
+ }
841
+ }
842
+ });
843
+ }
844
+ setDownloadIcon() {
845
+ return __awaiter(this, void 0, void 0, function* () {
846
+ let downloadType = yield this.widgetElement.getDownloadType();
847
+ this.downloadIconType = downloadType;
848
+ this.isDownloadIconVisible = false;
849
+ this.isChartDownloadVisible = false;
850
+ this.isGridDownloadVisible = false;
851
+ this.showExcell = true;
852
+ if (downloadType != RADownloadType.None) {
853
+ this.isDownloadIconVisible = true;
854
+ }
855
+ else {
856
+ if (!this.isWidgetMgmnt && !this.detailPageUrl) {
857
+ this.showSettingsLink = false;
858
+ }
859
+ }
860
+ if (downloadType == RADownloadType.Chart) {
861
+ this.isChartDownloadVisible = true;
862
+ }
863
+ if (downloadType == RADownloadType.Grid) {
864
+ this.isGridDownloadVisible = true;
865
+ }
866
+ if (downloadType == RADownloadType.Statistics) {
867
+ this.isGridDownloadVisible = true;
868
+ this.showExcell = false;
869
+ }
870
+ });
871
+ }
872
+ downloadIconClicked(type) {
873
+ switch (type) {
874
+ case "CSV":
875
+ this.widgetElement.downloadClicked(this.downloadIconType, RADownloadOption.CSV);
876
+ break;
877
+ case "PNG":
878
+ this.widgetElement.downloadClicked(this.downloadIconType, RADownloadOption.PNG);
879
+ break;
880
+ case "PDF":
881
+ this.widgetElement.downloadClicked(this.downloadIconType, RADownloadOption.PDF);
882
+ break;
883
+ case "SVG":
884
+ this.widgetElement.downloadClicked(this.downloadIconType, RADownloadOption.SVG);
885
+ break;
886
+ case "JPEG":
887
+ this.widgetElement.downloadClicked(this.downloadIconType, RADownloadOption.JPEG);
888
+ break;
889
+ }
890
+ }
891
+ removeMenu() {
892
+ jQuery('#ra-db-widget-menu').remove();
893
+ }
894
+ checkVisitLinkVisiblity() {
895
+ let isVisitApplicable = true;
896
+ if (this.widgetElement && typeof this.widgetElement.getVisitLinkVisibilityStatus === "function") {
897
+ isVisitApplicable = this.widgetElement.getVisitLinkVisibilityStatus();
898
+ }
899
+ return isVisitApplicable;
900
+ }
901
+ /**Show dropdown on gear icon click */
902
+ showDropDown(e) {
903
+ this.setDownloadIcon();
904
+ this.removeMenu();
905
+ setTimeout(() => {
906
+ var _a, _b;
907
+ let targetPos = e.target.getBoundingClientRect();
908
+ let style = "position:fixed;top:" + (targetPos.y + 15) + 'px' + ';left:' + (e.pageX - 122) + 'px;z-index:1000;';
909
+ let html = this.getContenxtHtml(style);
910
+ jQuery(html).appendTo('body');
911
+ if (this.isWidgetMgmnt) {
912
+ this.addEventListener('wcEditWidget', this.editWidget);
913
+ this.addEventListener('wcCopyWidget', this.copyWidget);
914
+ this.addEventListener('wcMoveWidget', this.moveWidget);
915
+ this.addEventListener('wcWidgetDelete', this.deleteWidget);
916
+ }
917
+ let customPageParams = false;
918
+ if (this.data.widgetInfo && this.data.widgetInfo.widgetSettings) {
919
+ this.widgetSettings = this.getParsedConfig(this.data.widgetInfo.widgetSettings);
920
+ if (this.widgetSettings.customPageParams || this.widgetSettings.customPageURL) {
921
+ customPageParams = true;
922
+ }
923
+ }
924
+ if ((this.detailPageUrl || customPageParams) && this.checkVisitLinkVisiblity()) {
925
+ this.addEventListener('wcVisitWidget', this.visitPage);
926
+ }
927
+ if (this.isChartDownloadVisible) {
928
+ this.addEventListener('wcDownloadPng', this.downloadIconClicked, 'PNG');
929
+ this.addEventListener('wcDownloadJpg', this.downloadIconClicked, 'JPEG');
930
+ this.addEventListener('wcDownloadPdf', this.downloadIconClicked, 'PDF');
931
+ this.addEventListener('wcDownloadSvg', this.downloadIconClicked, 'SVG');
932
+ }
933
+ if (this.isGridDownloadVisible && this.showExcell) {
934
+ this.addEventListener('wcDownloadExcel', this.downloadIconClicked, 'CSV');
935
+ }
936
+ (_a = document.getElementById('ra-db-widget-menu')) === null || _a === void 0 ? void 0 : _a.addEventListener('mouseenter', () => {
937
+ window.mouseOverWidgetMenu = true;
938
+ });
939
+ (_b = document.getElementById('ra-db-widget-menu')) === null || _b === void 0 ? void 0 : _b.addEventListener('mouseleave', () => {
940
+ window.mouseOverWidgetMenu = false;
941
+ setTimeout(() => {
942
+ if (!window.gridsterItemEnter) {
943
+ this.removeMenu();
944
+ }
945
+ });
946
+ });
947
+ });
948
+ }
949
+ addEventListener(id, event, params) {
950
+ let element = document.getElementById(id);
951
+ if (element) {
952
+ element.addEventListener('click', () => {
953
+ event.call(this, params);
954
+ });
955
+ }
956
+ }
957
+ getContenxtHtml(style) {
958
+ let html = '<div id="ra-db-widget-menu"' + 'style="' + style + '" class="download-content dropdown-content widget-config-item dropdown-click" style="z-index: 1002;">';
959
+ let settings = '';
960
+ if (this.isWidgetMgmnt) {
961
+ settings += this.getHtmlForButton('wcEditWidget', 'fal fa-edit', this.editText);
962
+ settings += this.getHtmlForButton('wcCopyWidget', 'fal fa-copy', this.copyText);
963
+ settings += this.getHtmlForButton('wcMoveWidget', 'fal fa-arrows-alt', this.moveText);
964
+ }
965
+ let customPageParams = false;
966
+ if (this.data.widgetInfo && this.data.widgetInfo.widgetSettings) {
967
+ this.widgetSettings = this.getParsedConfig(this.data.widgetInfo.widgetSettings);
968
+ if (this.widgetSettings.customPageParams || this.widgetSettings.customPageURL) {
969
+ customPageParams = true;
970
+ }
971
+ }
972
+ if ((this.detailPageUrl || customPageParams) && this.checkVisitLinkVisiblity()) {
973
+ settings += '<a style="max-height: 30px;align-items: center;align-content: center; display: flex;" id="wcVisitWidget">';
974
+ settings += '<i style="padding-left: 4px;font-size: 27px !important;" class="fal fa-angle-right"></i> ';
975
+ settings += '<span style="padding-left: 11px;margin-top: 2px;" style="padding-left: 6px;">';
976
+ settings += this.translateService.translate('Common.visitpage');
977
+ settings += '</span></a>';
978
+ }
979
+ if ((this.detailPageUrl && this.checkVisitLinkVisiblity()) || this.isWidgetMgmnt) {
980
+ html += '<div style="color: #9FA0A4;font-size: 12px;padding-top: 8px;padding-left: 12px;">';
981
+ html += this.translateService.translate('Common.settings') + '</div>';
982
+ html += settings;
983
+ html += this.getHr();
984
+ }
985
+ if (this.isDownloadIconVisible) {
986
+ if (this.showExcell) {
987
+ if (this.detailPageUrl || this.isWidgetMgmnt)
988
+ html += '<span style="color: #9FA0A4;font-size: 12px;">';
989
+ else
990
+ html += '<span style="color: #9FA0A4;font-size: 12px;padding-top:5px;display:block;">';
991
+ html += this.translateService.translate('Common.downloads');
992
+ html += '</span>';
993
+ }
994
+ if (this.isChartDownloadVisible) {
995
+ html += '<div style="padding-top: 10px;" class="chartDownload">';
996
+ html += this.getHtmlForButton('wcDownloadPng', 'fal fa-file-image', this.translateService.translate('Common.png'));
997
+ html += this.getHtmlForButton('wcDownloadJpg', 'fal fa-file-image', this.translateService.translate('Common.jpeg'));
998
+ html += this.getHtmlForButton('wcDownloadPdf', 'fal fa-file-pdf', this.translateService.translate('Common.pdf'));
999
+ html += this.getHtmlForButton('wcDownloadSvg', 'fal fa-file-alt', this.translateService.translate('Common.svg'));
1000
+ html += '</div>';
1001
+ }
1002
+ if (this.isGridDownloadVisible && this.showExcell) {
1003
+ html += '<div class="gridDownload">';
1004
+ html += this.getHtmlForButton('wcDownloadExcel', 'fal fa-download', this.excelText);
1005
+ html += '</div>';
1006
+ }
1007
+ }
1008
+ if (this.isDownloadIconVisible && this.isWidgetMgmnt && this.showExcell) {
1009
+ html += this.getHr();
1010
+ }
1011
+ if (this.isWidgetMgmnt) {
1012
+ html += '<a id="wcWidgetDelete"><i class="fal fa-times" style="padding-left: 3px;color: red;"></i><span>';
1013
+ html += this.deleteText;
1014
+ html += '</span></a>';
1015
+ }
1016
+ html += '</div>';
1017
+ return html;
1018
+ }
1019
+ getHr() {
1020
+ return '<hr class="hr" style="margin-top: 5px;margin-bottom: 5px;">';
1021
+ }
1022
+ getHtmlForButton(id, fontClass, text) {
1023
+ let html = '<a id="' + id + '"><i style="width:16px" class="' + fontClass + '"></i> <span style="padding-left: 6px;">';
1024
+ html += text;
1025
+ html += '</span></a>';
1026
+ return html;
1027
+ }
1028
+ getParsedConfig(config) {
1029
+ let parsedConfig;
1030
+ if (config) {
1031
+ if (typeof config === 'string') {
1032
+ try {
1033
+ parsedConfig = JSON.parse(config);
1034
+ }
1035
+ catch (_a) {
1036
+ parsedConfig = {};
1037
+ }
1038
+ return parsedConfig;
1039
+ }
1040
+ }
1041
+ return config;
1042
+ }
1043
+ applayWidgetSettings(settings) {
1044
+ if (settings.NoPadding)
1045
+ this.noPadding = true;
1046
+ else
1047
+ this.noPadding = false;
1048
+ }
1049
+ setInapplicableFilters(data, instanceId) {
1050
+ var widgetData = {};
1051
+ this.inapplicableFilters = [];
1052
+ widgetData.instanceId = instanceId;
1053
+ if (data && data.length > 0) {
1054
+ data.forEach((element) => {
1055
+ if (element == 'dateRange')
1056
+ this.inapplicableFilters.push(this.translateService.translate('Common.DateRange'));
1057
+ else if (element == 'participant') {
1058
+ this.inapplicableFilters.push(this.translateService.translate('Common.DivisionGroup'));
1059
+ }
1060
+ else if (element == 'source')
1061
+ this.inapplicableFilters.push(this.translateService.translate('Common.DataStream'));
1062
+ else
1063
+ this.inapplicableFilters.push(element);
1064
+ });
1065
+ widgetData.data = data;
1066
+ }
1067
+ else {
1068
+ widgetData.data = undefined;
1069
+ }
1070
+ this.updateAppliedFilters.emit(widgetData);
1071
+ }
1072
+ openPopup(title, data, footer, type, template = undefined) {
1073
+ let props = {};
1074
+ if (type == 'innaplicable' && this.banPopupDiv)
1075
+ props.element = this.banPopupDiv.nativeElement;
1076
+ if (type == 'lock' && this.lockPopupDiv)
1077
+ props.element = this.lockPopupDiv.nativeElement;
1078
+ props.title = title;
1079
+ props.data = data;
1080
+ props.footer = footer;
1081
+ if (template)
1082
+ props.template = template;
1083
+ this.currentComponent = this.domService.appendComponent(LockTooltip, document.body, props);
1084
+ this.popupInstance = this.currentComponent.instance;
1085
+ }
1086
+ closePopup() {
1087
+ if (this.currentComponent)
1088
+ this.popupInstance.removeMe(this.currentComponent);
1089
+ }
1090
+ }
1091
+ RAWidgetContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: RAWidgetContainer, deps: [{ token: RaDashboardService }, { token: i2$1.NgxUiLoaderService }, { token: i3.RATranslateService }, { token: i0.NgZone }, { token: i4.NotifierService }, { token: i0.Renderer2 }, { token: i3.RAPermissionService }, { token: i3.DomService }], target: i0.ɵɵFactoryTarget.Component });
1092
+ RAWidgetContainer.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.3", type: RAWidgetContainer, selector: "ra-widget-container", inputs: { widgetInstanceId: ["widget-instance-id", "widgetInstanceId"], globalFilter: ["global-filter", "globalFilter"], data: "data", raDashboardEventBus: ["event-bus", "raDashboardEventBus"], appConfig: ["app-config", "appConfig"], width: ["widget-width", "width"], height: ["widget-height", "height"], gridCellHeight: ["grid-cell-height", "gridCellHeight"], setResized: ["dom-resized", "setResized"] }, outputs: { widgetDeleted: "widgetDeleted", updateAppliedFilters: "updateAppliedFilters" }, viewQueries: [{ propertyName: "ctlWidget", first: true, predicate: ["ctlWidget"], descendants: true }, { propertyName: "widgetDropdown", first: true, predicate: ["widgetDropdown"], descendants: true }, { propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true }, { propertyName: "wcWrapper", first: true, predicate: ["wcWrapper"], descendants: true }, { propertyName: "banPopupDiv", first: true, predicate: ["banPopupDiv"], descendants: true }, { propertyName: "lockPopupDiv", first: true, predicate: ["lockPopupDiv"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div #wcWrapper class=\"wc-wrapper\" (mouseenter)=\"mouseHover(true)\" (mouseleave)=\"mouseHover(false)\"\r\n [ngStyle]=\"{'margin-left': noPadding?'0px':'15px','margin-right': noPadding?'0px':'15px'}\">\r\n <div class=\"wcheader widget-move\" *ngIf=\"!hideTitle\"\r\n [ngClass]=\"{'underLine': enableTitleLine || isWidgetStateApplicable}\">\r\n <div class=\"col-md-12 wc-mover\" style=\"padding-left: 0px;height:inherit;padding-right: 0px;\">\r\n <div style=\"display:flex;margin-top:10px;\"\r\n [ngStyle]=\"{'margin-left': noPadding?'15px':'0px','margin-right': noPadding?'15px':'0px'}\">\r\n <div class=\"col-9 float-left title-label\">\r\n <ra-tooltip [value]=\"toolTipValue\" [width]=\"toolTipWidth\">\r\n <div [hidden]=\"hideTitle\" style=\"text-overflow: ellipsis;white-space: nowrap;overflow: hidden;\"\r\n (mouseover)=\"mouseOver($event)\" #searchInput>{{WidgetDisplayName}}</div>\r\n </ra-tooltip>\r\n </div>\r\n <div class=\"col-3\" style=\"cursor:default;padding-right: 0px;\"> \r\n <div class=\"float-right\" style=\"display: flex;\">\r\n <div #banPopupDiv (mouseover)=\"openPopup(inapplicableIconTitle,inapplicableFilters,inapplicableIconFooter,'innaplicable')\" (mouseout)=\"closePopup()\" class=\"title-bar-lock-icon lock-dropdown\" [hidden]=\"!inapplicableFilters || inapplicableFilters.length == 0 || !globalFilter || globalFilter == '{}'\">\r\n <i class=\"fal fa-ban lock\"></i> \r\n </div>\r\n <div #lockPopupDiv (mouseover)=\"openPopup(lockIconTitle,lockDetails,lockIconFooter,'lock',lockTemplateInfo)\" (mouseout)=\"closePopup()\" class=\"title-bar-lock-icon lock-dropdown\" [hidden]=\"!lockDetails && !lockTemplateInfo\">\r\n <i class=\"fal fa-lock lock\"></i> \r\n </div>\r\n <div class=\"widget-menu\" style=\"width:10px;\"\r\n [ngClass]=\"{'widget-menu-show': isMouseHover && showSettingsLink}\">\r\n <div class=\"dropbtn title-bar-icon\">\r\n <i (click)=\"showDropDown($event)\" #widgetDropdown class=\"fal fa-ellipsis-v widget-menu-ellipse\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div *ngIf=\"hideTitle\" class=\"wcheader widget-move\"\r\n style=\"height: 45px;width: 95%;cursor: move;z-index: 99;opacity: 0;\">\r\n </div>\r\n <div *ngIf=\"hideTitle\" class=\"widget-menu widget-menu-title-hidden\" [ngClass]=\"{'widget-menu-show': isMouseHover && showSettingsLink}\">\r\n <div class=\"dropbtn title-bar-icon\">\r\n <i (click)=\"showDropDown($event)\" class=\"fal fa-ellipsis-v\" style=\"text-align: center;\"></i>\r\n </div>\r\n </div>\r\n <div class=\"wcBody\" [ngStyle]=\"{'bottom': noPadding?'0px':'10px','top':hideTitle?'10px':'46px'}\">\r\n <div [hidden]=\"isWidgetStateApplicable\" class=\"m-fadeOut widget-overlay\" [ngClass]=\"{'m-fadeIn': showPanel}\">\r\n <div class=\"lds-roller\">\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n </div>\r\n </div>\r\n <div class=\"wc\" [hidden]=\"isWidgetStateApplicable\">\r\n <div #ctlWidget></div>\r\n </div>\r\n <div *ngIf=\"isWidgetStateApplicable\" class=\"defaultConfig\">\r\n <ra-widget-state style=\"width: 100%;height: 100%;\" [isWidgetStateApplicable]=\"isWidgetStateApplicable\"\r\n [isGlobalFilterApplied]=\"isGlobalFilterApplied\" [widgetEmptyState]=\"widgetEmptyState\"\r\n (editWidgetClicked)=editWidget() [widthCol]=\"width\" [heightCol]=\"height\">\r\n </ra-widget-state>\r\n </div>\r\n <div>\r\n </div>\r\n </div>\r\n</div>", components: [{ type: i5.TooltipControl, selector: "ra-tooltip", inputs: ["data", "url", "value", "key", "dataField", "position", "width", "count", "moreItemText", "reset", "disable-tooltip", "set-top-padding"], outputs: ["dataLoaded"] }, { type: i5.WidgetStateControl, selector: "ra-widget-state", inputs: ["isWidgetStateApplicable", "isGlobalFilterApplied", "widgetEmptyState", "widgetEmptyDataText", "widthCol", "heightCol"], outputs: ["editWidgetClicked"] }], directives: [{ type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
1093
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: RAWidgetContainer, decorators: [{
1094
+ type: Component,
1095
+ args: [{ selector: 'ra-widget-container', template: "<div #wcWrapper class=\"wc-wrapper\" (mouseenter)=\"mouseHover(true)\" (mouseleave)=\"mouseHover(false)\"\r\n [ngStyle]=\"{'margin-left': noPadding?'0px':'15px','margin-right': noPadding?'0px':'15px'}\">\r\n <div class=\"wcheader widget-move\" *ngIf=\"!hideTitle\"\r\n [ngClass]=\"{'underLine': enableTitleLine || isWidgetStateApplicable}\">\r\n <div class=\"col-md-12 wc-mover\" style=\"padding-left: 0px;height:inherit;padding-right: 0px;\">\r\n <div style=\"display:flex;margin-top:10px;\"\r\n [ngStyle]=\"{'margin-left': noPadding?'15px':'0px','margin-right': noPadding?'15px':'0px'}\">\r\n <div class=\"col-9 float-left title-label\">\r\n <ra-tooltip [value]=\"toolTipValue\" [width]=\"toolTipWidth\">\r\n <div [hidden]=\"hideTitle\" style=\"text-overflow: ellipsis;white-space: nowrap;overflow: hidden;\"\r\n (mouseover)=\"mouseOver($event)\" #searchInput>{{WidgetDisplayName}}</div>\r\n </ra-tooltip>\r\n </div>\r\n <div class=\"col-3\" style=\"cursor:default;padding-right: 0px;\"> \r\n <div class=\"float-right\" style=\"display: flex;\">\r\n <div #banPopupDiv (mouseover)=\"openPopup(inapplicableIconTitle,inapplicableFilters,inapplicableIconFooter,'innaplicable')\" (mouseout)=\"closePopup()\" class=\"title-bar-lock-icon lock-dropdown\" [hidden]=\"!inapplicableFilters || inapplicableFilters.length == 0 || !globalFilter || globalFilter == '{}'\">\r\n <i class=\"fal fa-ban lock\"></i> \r\n </div>\r\n <div #lockPopupDiv (mouseover)=\"openPopup(lockIconTitle,lockDetails,lockIconFooter,'lock',lockTemplateInfo)\" (mouseout)=\"closePopup()\" class=\"title-bar-lock-icon lock-dropdown\" [hidden]=\"!lockDetails && !lockTemplateInfo\">\r\n <i class=\"fal fa-lock lock\"></i> \r\n </div>\r\n <div class=\"widget-menu\" style=\"width:10px;\"\r\n [ngClass]=\"{'widget-menu-show': isMouseHover && showSettingsLink}\">\r\n <div class=\"dropbtn title-bar-icon\">\r\n <i (click)=\"showDropDown($event)\" #widgetDropdown class=\"fal fa-ellipsis-v widget-menu-ellipse\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div *ngIf=\"hideTitle\" class=\"wcheader widget-move\"\r\n style=\"height: 45px;width: 95%;cursor: move;z-index: 99;opacity: 0;\">\r\n </div>\r\n <div *ngIf=\"hideTitle\" class=\"widget-menu widget-menu-title-hidden\" [ngClass]=\"{'widget-menu-show': isMouseHover && showSettingsLink}\">\r\n <div class=\"dropbtn title-bar-icon\">\r\n <i (click)=\"showDropDown($event)\" class=\"fal fa-ellipsis-v\" style=\"text-align: center;\"></i>\r\n </div>\r\n </div>\r\n <div class=\"wcBody\" [ngStyle]=\"{'bottom': noPadding?'0px':'10px','top':hideTitle?'10px':'46px'}\">\r\n <div [hidden]=\"isWidgetStateApplicable\" class=\"m-fadeOut widget-overlay\" [ngClass]=\"{'m-fadeIn': showPanel}\">\r\n <div class=\"lds-roller\">\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n </div>\r\n </div>\r\n <div class=\"wc\" [hidden]=\"isWidgetStateApplicable\">\r\n <div #ctlWidget></div>\r\n </div>\r\n <div *ngIf=\"isWidgetStateApplicable\" class=\"defaultConfig\">\r\n <ra-widget-state style=\"width: 100%;height: 100%;\" [isWidgetStateApplicable]=\"isWidgetStateApplicable\"\r\n [isGlobalFilterApplied]=\"isGlobalFilterApplied\" [widgetEmptyState]=\"widgetEmptyState\"\r\n (editWidgetClicked)=editWidget() [widthCol]=\"width\" [heightCol]=\"height\">\r\n </ra-widget-state>\r\n </div>\r\n <div>\r\n </div>\r\n </div>\r\n</div>" }]
1096
+ }], ctorParameters: function () { return [{ type: RaDashboardService }, { type: i2$1.NgxUiLoaderService }, { type: i3.RATranslateService }, { type: i0.NgZone }, { type: i4.NotifierService }, { type: i0.Renderer2 }, { type: i3.RAPermissionService }, { type: i3.DomService }]; }, propDecorators: { ctlWidget: [{
1097
+ type: ViewChild,
1098
+ args: ['ctlWidget', { static: false }]
1099
+ }], widgetDropdown: [{
1100
+ type: ViewChild,
1101
+ args: ['widgetDropdown', { static: false }]
1102
+ }], searchInput: [{
1103
+ type: ViewChild,
1104
+ args: ['searchInput', { static: false }]
1105
+ }], wcWrapper: [{
1106
+ type: ViewChild,
1107
+ args: ['wcWrapper', { static: false }]
1108
+ }], banPopupDiv: [{
1109
+ type: ViewChild,
1110
+ args: ['banPopupDiv', { static: false }]
1111
+ }], lockPopupDiv: [{
1112
+ type: ViewChild,
1113
+ args: ['lockPopupDiv', { static: false }]
1114
+ }], widgetInstanceId: [{
1115
+ type: Input,
1116
+ args: ['widget-instance-id']
1117
+ }], globalFilter: [{
1118
+ type: Input,
1119
+ args: ['global-filter']
1120
+ }], data: [{
1121
+ type: Input,
1122
+ args: ['data']
1123
+ }], raDashboardEventBus: [{
1124
+ type: Input,
1125
+ args: ['event-bus']
1126
+ }], appConfig: [{
1127
+ type: Input,
1128
+ args: ['app-config']
1129
+ }], width: [{
1130
+ type: Input,
1131
+ args: ['widget-width']
1132
+ }], height: [{
1133
+ type: Input,
1134
+ args: ['widget-height']
1135
+ }], gridCellHeight: [{
1136
+ type: Input,
1137
+ args: ['grid-cell-height']
1138
+ }], widgetDeleted: [{
1139
+ type: Output
1140
+ }], updateAppliedFilters: [{
1141
+ type: Output
1142
+ }], setResized: [{
1143
+ type: Input,
1144
+ args: ['dom-resized']
1145
+ }] } });
1146
+
1147
+ class RADashboardArea {
1148
+ constructor(dashboardService, ngZone, ngxService, translateService, notifier, responsiveService, permissionService) {
1149
+ this.dashboardService = dashboardService;
1150
+ this.ngZone = ngZone;
1151
+ this.ngxService = ngxService;
1152
+ this.translateService = translateService;
1153
+ this.notifier = notifier;
1154
+ this.responsiveService = responsiveService;
1155
+ this.permissionService = permissionService;
1156
+ this.widgetList = Array();
1157
+ this.gridheight = 300;
1158
+ this.gridcellHeight = 0;
1159
+ this.userWidgets = [];
1160
+ this.PAMWidgets = [];
1161
+ this.isWidgetLoaded = false;
1162
+ this.domResized = false;
1163
+ this.showEmptyDashboard = false;
1164
+ this.isWidgetMgmnt = false;
1165
+ this.widgetHeight = 2;
1166
+ this.widgetWidth = 4;
1167
+ this.hideDashboardBanner = new EventEmitter();
1168
+ }
1169
+ ngOnInit() {
1170
+ this.isWidgetMgmnt = this.permissionService.hasPermission('ra.widgetmanagement');
1171
+ this.initiateGridsterConfig();
1172
+ this.lastViewType = this.responsiveService.IsDesktopView ? 'desktop' : 'mobile';
1173
+ this.responsiveService.resized.subscribe((isDesktop) => {
1174
+ if (this.lastViewType != (isDesktop ? 'desktop' : 'mobile') || !isDesktop) {
1175
+ this.lastViewType = (isDesktop ? 'desktop' : 'mobile');
1176
+ this.widgetList = [];
1177
+ setTimeout(() => {
1178
+ this.initiateGridsterConfig();
1179
+ if (this.options && this.options.api && this.options.api.optionsChanged)
1180
+ this.options.api.optionsChanged();
1181
+ if (this.userWidgets) {
1182
+ this.widgetList = this.mapObjectListToGridsterItemList(this.userWidgets);
1183
+ setTimeout(() => {
1184
+ this.setAreaHeight();
1185
+ });
1186
+ }
1187
+ else {
1188
+ this.loadWidgets(this.userDashboardId, this.areaKey);
1189
+ }
1190
+ this.domResized = !this.domResized;
1191
+ });
1192
+ }
1193
+ else {
1194
+ setTimeout(() => {
1195
+ this.domResized = !this.domResized;
1196
+ this.setAreaHeight();
1197
+ }, 100);
1198
+ }
1199
+ });
1200
+ }
1201
+ ngOnChanges(changes) {
1202
+ this.isWidgetMgmnt = this.permissionService.hasPermission('ra.widgetmanagement');
1203
+ if (this.raDashboardEventBus && this.appConfig && !this.isWidgetLoaded) {
1204
+ this.isWidgetLoaded = true;
1205
+ this.loadWidgets(this.userDashboardId, this.areaKey);
1206
+ }
1207
+ if (changes['raDashboardEventBus'] && changes['raDashboardEventBus'].currentValue != changes['raDashboardEventBus'].previousValue) {
1208
+ this.inititateEventBusSubscritions();
1209
+ }
1210
+ }
1211
+ /**To set GridsterConfig */
1212
+ initiateGridsterConfig() {
1213
+ /**To override default configuration values to the gridster control */
1214
+ this.options = this.responsiveService.getGridsterConfig(this.isWidgetMgmnt);
1215
+ this.options.initCallback = (gridster) => {
1216
+ if (gridster && gridster.curColWidth) {
1217
+ this.gridcellHeight = gridster.curColWidth;
1218
+ }
1219
+ };
1220
+ this.options.itemChangeCallback = (item) => {
1221
+ if (this.responsiveService.IsDesktopView) {
1222
+ // if (item.widgetInfo && item.widgetInfo.widgetInstanceId) {
1223
+ // this.updateWidgetPosition(item.widgetInfo.widgetInstanceId);
1224
+ // }
1225
+ }
1226
+ this.setAreaHeight();
1227
+ };
1228
+ }
1229
+ /** To initiate eventbus subsctiptions */
1230
+ inititateEventBusSubscritions() {
1231
+ this.widgetDeleteEvent = this.raDashboardEventBus.subscribe(RAEvent.WidgetDelete).subscribe((instanceId) => {
1232
+ this.ngZone.run(() => {
1233
+ this.deleteWidget(instanceId, true);
1234
+ });
1235
+ });
1236
+ this.widgetAddEvent = this.raDashboardEventBus.subscribe(RAEvent.AddWidget).subscribe((widgetInfo) => {
1237
+ this.ngZone.run(() => {
1238
+ this.copyWidget(widgetInfo);
1239
+ });
1240
+ });
1241
+ this.conifgAddClick = this.raDashboardEventBus.subscribe(RAEvent.ConfigAddClick).subscribe((e) => {
1242
+ this.ngZone.run(() => {
1243
+ this.addWidget(e);
1244
+ });
1245
+ });
1246
+ this.rearrangeWidgetClick = this.raDashboardEventBus.subscribe(RAEvent.RearrangeClicked).subscribe((e) => {
1247
+ this.ngZone.run(() => {
1248
+ this.rearrangeWidgets();
1249
+ });
1250
+ });
1251
+ this.widgetLibraryDoneClick = this.raDashboardEventBus.subscribe(RAEvent.widgetLibraryDoneClick).subscribe((widgetList) => {
1252
+ this.ngZone.run(() => {
1253
+ if (widgetList) {
1254
+ this.addWidgetListToGridster(widgetList, 0);
1255
+ }
1256
+ });
1257
+ });
1258
+ }
1259
+ /**
1260
+ * temp fix- recursive method to iterate over the list of items
1261
+ * and add them to gridster in the given order
1262
+ * @param widgetList -list of widgets
1263
+ * @param index -index of the current value to be added
1264
+ */
1265
+ addWidgetListToGridster(widgetList, index) {
1266
+ let areaContext = this;
1267
+ let indexVal = index + 1;
1268
+ if (index > widgetList.length - 1)
1269
+ return;
1270
+ else {
1271
+ if (index == 0) {
1272
+ areaContext.addWidget(widgetList[index]);
1273
+ areaContext.addWidgetListToGridster(widgetList, indexVal);
1274
+ }
1275
+ else {
1276
+ setTimeout(() => {
1277
+ areaContext.addWidget(widgetList[index]);
1278
+ areaContext.addWidgetListToGridster(widgetList, indexVal);
1279
+ }, 1000);
1280
+ }
1281
+ }
1282
+ }
1283
+ ngOnDestroy() {
1284
+ if (this.conifgAddClick)
1285
+ this.conifgAddClick.unsubscribe();
1286
+ if (this.widgetAddEvent)
1287
+ this.widgetAddEvent.unsubscribe();
1288
+ if (this.widgetDeleteEvent)
1289
+ this.widgetDeleteEvent.unsubscribe();
1290
+ if (this.widgetLibraryDoneClick)
1291
+ this.widgetLibraryDoneClick.unsubscribe();
1292
+ if (this.rearrangeWidgetClick)
1293
+ this.rearrangeWidgetClick.unsubscribe();
1294
+ }
1295
+ /**To update position/dimention of all widgets in the area */
1296
+ updateWidgets() {
1297
+ this.dashboardService.updateWidgets(this.formatWidgetDataForPositionDetails(this.mapGridsterListToObject(this.widgetList)), this.appConfig).subscribe(widgets => {
1298
+ });
1299
+ return true;
1300
+ }
1301
+ /**To update widget dimensions */
1302
+ updateWidgetPosition(widgetInstanceId) {
1303
+ let widgetFilteredList = [];
1304
+ let widget = this.widgetList.filter(filtered => filtered['widgetInfo'] && filtered['widgetInfo'].widgetInstanceId == widgetInstanceId);
1305
+ if (widget && widget.length > 0) {
1306
+ widgetFilteredList.push(widget[0]);
1307
+ let widgetList = this.mapGridsterListToObject(widgetFilteredList);
1308
+ this.dashboardService.updateWidgets(this.formatWidgetDataForPositionDetails(widgetList), this.appConfig).subscribe(widgets => {
1309
+ });
1310
+ }
1311
+ return true;
1312
+ }
1313
+ /**To restrict request payload to be of min size (position & size details) */
1314
+ formatWidgetDataForPositionDetails(widgetItemList) {
1315
+ let itemList = [];
1316
+ widgetItemList.forEach(function (widgetItem) {
1317
+ let item = {};
1318
+ item.widgetInstanceId = widgetItem.widgetInstanceId;
1319
+ item.position_x = widgetItem.position_x;
1320
+ item.position_y = widgetItem.position_y;
1321
+ item.width = widgetItem.width;
1322
+ item.height = widgetItem.height;
1323
+ itemList.push(item);
1324
+ });
1325
+ return itemList;
1326
+ }
1327
+ /** To retrieve widgets based on userDashboardid and area name */
1328
+ loadWidgets(userDashboarId, areaKey) {
1329
+ let widgetInfo = {
1330
+ dashboardId: userDashboarId.toString(),
1331
+ dashboardAreaKey: areaKey
1332
+ };
1333
+ this.widgetList = [];
1334
+ this.dashboardService.getWidgetsByDashboardArea(widgetInfo, this.appConfig).subscribe(widgets => {
1335
+ this.userWidgets = widgets;
1336
+ this.PAMWidgets = [];
1337
+ widgets.forEach((element) => {
1338
+ var settings = undefined;
1339
+ if (element.widgetSettings) {
1340
+ settings = JSON.parse(element.widgetSettings);
1341
+ if (settings && settings.isPAMWidget)
1342
+ this.PAMWidgets.push(element.widgetInstanceId);
1343
+ }
1344
+ });
1345
+ this.checkPAMWidgets();
1346
+ if (widgets && widgets.length > 0) {
1347
+ this.widgetList = this.mapObjectListToGridsterItemList(widgets);
1348
+ this.setAreaHeight();
1349
+ this.raDashboardEventBus.publish(RAEvent.HideDashboardBanner, false);
1350
+ }
1351
+ else {
1352
+ this.showEmptyDashboard = true;
1353
+ this.raDashboardEventBus.publish(RAEvent.HideDashboardBanner, this.showEmptyDashboard);
1354
+ }
1355
+ });
1356
+ }
1357
+ /** To set Area(Gridster) height dynamically as widgets are added/removed */
1358
+ setAreaHeight() {
1359
+ setTimeout(() => {
1360
+ let isMobile = false;
1361
+ if (this.options.mobileBreakpoint && (this.options.mobileBreakpoint > this.gridWrapper.nativeElement.clientWidth)) {
1362
+ isMobile = true;
1363
+ }
1364
+ let areaScrollHeight = 0;
1365
+ let areaHeight = 0;
1366
+ this.showEmptyDashboard = this.userWidgets.length > 0 ? false : true;
1367
+ this.widgetList.forEach((t) => {
1368
+ let currentHeight = t.y + t.rows;
1369
+ if (currentHeight > areaScrollHeight) {
1370
+ areaScrollHeight = currentHeight;
1371
+ }
1372
+ t['widgetInfo'].rowHeight = this.gridcellHeight;
1373
+ });
1374
+ if (this.gridcellHeight > 0) {
1375
+ areaHeight = areaScrollHeight * this.gridcellHeight + 100;
1376
+ }
1377
+ let areaScrollHeightMob = 0;
1378
+ if (isMobile) {
1379
+ areaScrollHeightMob = this.widgetList.length * 300 + 200;
1380
+ areaHeight = areaScrollHeightMob;
1381
+ }
1382
+ if (areaHeight < 600) {
1383
+ areaHeight = 600;
1384
+ }
1385
+ this.gridheight = areaHeight;
1386
+ });
1387
+ }
1388
+ /** To remove a widget instance from dashboard and to save info in database */
1389
+ deleteWidget(widgetInstanceId, isalertDisabled = false) {
1390
+ let gridsterItem = this.widgetList.filter((item) => {
1391
+ return item['widgetInfo'].widgetInstanceId === widgetInstanceId;
1392
+ });
1393
+ if (gridsterItem.length > 0) {
1394
+ let widget = this.userWidgets.filter((item) => {
1395
+ return item.widgetInstanceId === widgetInstanceId;
1396
+ });
1397
+ if (widget.length > 0) {
1398
+ this.userWidgets.splice(this.userWidgets.indexOf(widget[0]), 1);
1399
+ }
1400
+ if (this.PAMWidgets.length > 0) {
1401
+ var indx = this.PAMWidgets.indexOf(widgetInstanceId);
1402
+ if (indx > -1)
1403
+ this.PAMWidgets.splice(indx, 1);
1404
+ this.checkPAMWidgets();
1405
+ }
1406
+ this.widgetList.splice(this.widgetList.indexOf(gridsterItem[0]), 1);
1407
+ this.setAreaHeight();
1408
+ if (!isalertDisabled) {
1409
+ this.notifier.notify('success', " " + this.translateService.translate('Common.Widgettext') + " " + gridsterItem[0]['widgetInfo'].widgetTitle + " " + this.translateService.translate('Common.deletedSuccesfully') + " ");
1410
+ }
1411
+ }
1412
+ this.showEmptyDashboard = this.userWidgets.length > 0 ? false : true;
1413
+ if (this.showEmptyDashboard == true) {
1414
+ this.raDashboardEventBus.publish(RAEvent.HideDashboardBanner, this.showEmptyDashboard);
1415
+ }
1416
+ }
1417
+ /**To rearrange widgets position in the dashboard, compactLeft&Up,compactLeft,compactUp,etc*/
1418
+ rearrangeWidgets() {
1419
+ for (let i = 0; i < this.userWidgets.length; i++) {
1420
+ this.userWidgets[i].position_x = 0;
1421
+ this.userWidgets[i].position_y = 0;
1422
+ }
1423
+ this.widgetList = this.mapObjectListToGridsterItemList(this.userWidgets);
1424
+ if (this.widgetList.length > 0)
1425
+ this.updateWidgetPosition(this.widgetList[0]['widgetInfo'].widgetInstanceId);
1426
+ setTimeout(() => {
1427
+ this.setAreaHeight();
1428
+ });
1429
+ }
1430
+ /**To add widget instance to the database with the next available position and to make changes in
1431
+ * dashboard area.
1432
+ */
1433
+ addWidget(data) {
1434
+ data.height = this.widgetHeight;
1435
+ data.width = this.widgetWidth;
1436
+ this.raDashboardEventBus.publish(RAEvent.HideDashboardBanner, false);
1437
+ if (data.widgetSettings) {
1438
+ if (typeof data.widgetSettings === 'string')
1439
+ data.widgetSettings = JSON.parse(data.widgetSettings);
1440
+ if (data.widgetSettings.defaultCols) {
1441
+ data.width = data.widgetSettings.defaultCols;
1442
+ }
1443
+ if (data.widgetSettings.defaultRows) {
1444
+ data.height = data.widgetSettings.defaultRows;
1445
+ }
1446
+ data.widgetSettings = null;
1447
+ }
1448
+ data = this.setPositions(data);
1449
+ /** to find the available position in gridster, temp commenting the code-returning higher y value than normal */
1450
+ data.dashboardAreaKey = this.areaKey;
1451
+ data.dashboardId = this.userDashboardId;
1452
+ this.ngxService.start();
1453
+ this.dashboardService.addWidget(data, this.appConfig).subscribe(widget => {
1454
+ this.userWidgets.push(widget);
1455
+ let gridsterItem = this.responsiveService.getGridsterItem(widget);
1456
+ this.widgetList.push(gridsterItem);
1457
+ this.setAreaHeight();
1458
+ widget.rowHeight = this.gridcellHeight;
1459
+ var widgetInstanceId = 0;
1460
+ if (widget && widget.widgetInstanceId) {
1461
+ widgetInstanceId = widget.widgetInstanceId;
1462
+ /**To save added widget position in db */
1463
+ if (this.responsiveService.IsDesktopView) {
1464
+ setTimeout(() => {
1465
+ this.updateWidgetPosition(widgetInstanceId);
1466
+ });
1467
+ }
1468
+ }
1469
+ if (widget.settings && widget.settings.isPAMWidget) {
1470
+ this.PAMWidgets.push(widget.widgetInstanceId);
1471
+ this.checkPAMWidgets();
1472
+ }
1473
+ this.raDashboardEventBus.publish(RAEvent.WidgetAdded, widget);
1474
+ });
1475
+ }
1476
+ setPositions(data) {
1477
+ data.position_x = 0;
1478
+ data.position_y = 0;
1479
+ if (!this.responsiveService.IsDesktopView) {
1480
+ if (this.userWidgets.length > 0) {
1481
+ let widget = this.userWidgets[this.userWidgets.length - 1];
1482
+ if (widget.position_x + widget.width > (this.responsiveService.maxColsDesktop / 2)) {
1483
+ data.position_y = widget.position_y + 1;
1484
+ }
1485
+ else {
1486
+ data.position_y = widget.position_y;
1487
+ data.position_x = this.responsiveService.maxColsDesktop - (widget.position_x + widget.width);
1488
+ }
1489
+ }
1490
+ }
1491
+ return data;
1492
+ }
1493
+ /** To add widget to current widget list ,invoked from copy widget window*/
1494
+ copyWidget(data) {
1495
+ data = this.setPositions(data);
1496
+ if (!this.responsiveService.IsDesktopView) {
1497
+ this.dashboardService.updateWidgets(this.formatWidgetDataForPositionDetails([data]), this.appConfig).subscribe(widgets => {
1498
+ });
1499
+ }
1500
+ this.userWidgets.push(data);
1501
+ let gridsterItem = this.responsiveService.getGridsterItem(data);
1502
+ this.widgetList.push(gridsterItem);
1503
+ this.setAreaHeight();
1504
+ if (data.settings && data.settings.isPAMWidget) {
1505
+ this.PAMWidgets.push(data.widgetInstanceId);
1506
+ this.checkPAMWidgets();
1507
+ }
1508
+ }
1509
+ mapObjectListToGridsterItemList(widgetList) {
1510
+ let widgetArray = Array();
1511
+ widgetList.forEach(widget => {
1512
+ widgetArray.push(this.responsiveService.getGridsterItem(widget));
1513
+ });
1514
+ return widgetArray;
1515
+ }
1516
+ mapGridsterItemToObject(widgetItem) {
1517
+ let widget;
1518
+ widget = widgetItem['widgetInfo'];
1519
+ widget.height = widgetItem.rows;
1520
+ widget.width = widgetItem.cols;
1521
+ widget.position_x = widgetItem.x;
1522
+ widget.position_y = widgetItem.y;
1523
+ //widget.rowHeight = <any>widgetItem.curRowHeight;
1524
+ return widget;
1525
+ }
1526
+ mapGridsterListToObject(widgetItemList) {
1527
+ let widgetListArray = Array();
1528
+ widgetItemList.forEach(widget => {
1529
+ widgetListArray.push(this.mapGridsterItemToObject(widget));
1530
+ });
1531
+ return widgetListArray;
1532
+ }
1533
+ addNewWidget() {
1534
+ this.raDashboardEventBus.publish(RAEvent.AddNewWidgetToDashboard, null);
1535
+ }
1536
+ updateAppliedFilters(data) {
1537
+ this.raDashboardEventBus.publish(RAEvent.UpdateAppledFiterForInapplicableFilter, data);
1538
+ }
1539
+ checkPAMWidgets() {
1540
+ if (this.PAMWidgets.length > 0) {
1541
+ this.raDashboardEventBus.publish(RAEvent.ShowInapplicableFilterMessage, true);
1542
+ }
1543
+ else {
1544
+ this.raDashboardEventBus.publish(RAEvent.ShowInapplicableFilterMessage, false);
1545
+ }
1546
+ }
1547
+ }
1548
+ RADashboardArea.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: RADashboardArea, deps: [{ token: RaDashboardService }, { token: i0.NgZone }, { token: i2$1.NgxUiLoaderService }, { token: i3.RATranslateService }, { token: i4.NotifierService }, { token: RADashboardResponsiveService }, { token: i3.RAPermissionService }], target: i0.ɵɵFactoryTarget.Component });
1549
+ RADashboardArea.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.3", type: RADashboardArea, selector: "ra-dashboard-area", inputs: { userDashboardId: ["user-dashboard-id", "userDashboardId"], areaKey: ["area-key", "areaKey"], globalFilter: ["global-filter", "globalFilter"], raDashboardEventBus: ["event-bus", "raDashboardEventBus"], widgetHeight: ["widget-height", "widgetHeight"], widgetWidth: ["widget-width", "widgetWidth"], appConfig: ["app-config", "appConfig"] }, outputs: { hideDashboardBanner: "hideDashboardBanner" }, viewQueries: [{ propertyName: "gridWrapper", first: true, predicate: ["gridWrapper"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div #gridWrapper class=\"wrap gridster gridster-mobile\" [ngStyle]=\"{'height': userWidgets.length > 0 ? (gridheight + 'px') : 'unset'}\">\r\n <!-- <div #gridWrapper class=\"wrap gridster\"> -->\r\n <gridster [options]=\"options\" style=\"height:100%;\" *ngIf=\"userWidgets.length > 0\">\r\n <gridster-item [item]=\"item\" *ngFor=\"let item of widgetList\">\r\n <ra-widget-container [app-config]=\"appConfig\" [event-bus]=\"raDashboardEventBus\"\r\n (widgetDeleted)=\"deleteWidget($event)\" [data]=\"item\" [global-filter]=\"globalFilter\"\r\n [grid-cell-height]=\"gridcellHeight\" *ngIf=\"gridcellHeight && gridcellHeight > 0\" [widget-width]=\"item.cols\"\r\n [widget-height]=\"item.rows\" [widget-instance-id]=\"item['widgetInstanceId']\" [dom-resized]=\"domResized\"\r\n (updateAppliedFilters)=\"updateAppliedFilters($event)\">\r\n </ra-widget-container>\r\n </gridster-item>\r\n </gridster>\r\n\r\n <div class=\"empty-padding kiosk-hide\" *ngIf=\"showEmptyDashboard\">\r\n <div class=\"empty-wrapper\">\r\n <div></div>\r\n <div class=\"m-1 empty-prefix\">\r\n <i class=\"fal fa-edit edit-icon\"></i>\r\n <span class=\"empty-title\">{{'dashboard.emptydashboard'|translate}}</span>\r\n </div>\r\n <div class=\"empty-content light\">\r\n <div>\r\n <div class=\"col-sm-12 empty-msg\">\r\n {{'dashboard.emptydashboardmessage'|translate}} <br />\r\n {{'dashboard.emptydashboardmessage2'|translate}}\r\n </div>\r\n <button *ngIf=\"isWidgetMgmnt\" class=\"btn btnLib btn-sm m-1 dashboard-button light\" (click)=\"addNewWidget()\">\r\n <i class=\"fal fa-plus m-1\"></i>{{'dashboard.addawidgets'|translate}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <notifier-container></notifier-container>\r\n</div>", styles: ["gridster{width:inherit;resize:height;display:flex;background-color:#ededed;overflow-y:hidden!important}.dvheader{width:100%;height:35px;background:black;color:#fff;padding:7px 3px 5px 6px;text-transform:uppercase}gridster-item{box-sizing:border-box;z-index:1;position:absolute;overflow:hidden;transition:.3s;display:none;background:#fff;-webkit-user-select:text;user-select:text;box-shadow:0 1px 10px #0000000d}gridster-item:hover{box-shadow:0 1px 10px #00000026}@media screen and (max-width: 685px){.gridster-mobile{height:auto!important;margin-bottom:50px!important}}@media screen and (max-width: 350px){.gridster-mobile{min-height:330px!important;margin-bottom:0!important}}.empty-padding{padding:40px 20px 20px;background-color:#ededed;display:flex;justify-content:center;align-content:center}.empty-wrapper{display:flex;background-color:#fff;border-radius:8px;min-height:125px;width:72%}.empty-prefix{color:#32ad3c;font-size:18px;display:flex;align-items:center;padding:10px 30px;min-width:max-content;min-width:-moz-max-content}.empty-content{color:#333;border-left:solid 1px #a9afb1;width:100%;display:flex;align-items:center;padding:15px 30px 10px 40px}.empty-msg{padding:0 0 5px;font-size:16px}.dashboard-button{padding:5px 10px 5px 5px!important}.btnLib{background-color:#ededed;color:#333!important}.btn-sm,.btn-group-sm>.btn{padding:5px 20px 5px 5px}.edit-icon{color:#32ad3c;font-size:24px;margin-right:15px}.empty-title{margin-top:10px}@media screen and (max-width: 600px){.empty-padding{padding:10px;background-color:#ededed;width:100%;display:block}.empty-wrapper{display:flex;background-color:#fff;border-radius:8px;min-height:125px;width:100%}.empty-prefix{color:#32ad3c;font-size:16px;display:flex;height:40px;padding:6px 10px 8px}.empty-content{color:#333;display:flex;padding:5px 10px 10px;margin-top:44px;margin-left:-185px;border-left:none}.empty-msg{padding:12px 10px 10px 5px;font-size:14px;border-top:solid 1px #a9afb1}.edit-icon{color:#32ad3c;font-size:20px;margin-right:6px}.empty-title{margin-top:6px}}\n"], components: [{ type: i6.GridsterComponent, selector: "gridster", inputs: ["options"] }, { type: i6.GridsterItemComponent, selector: "gridster-item", inputs: ["item"], outputs: ["itemInit", "itemChange", "itemResize"] }, { type: RAWidgetContainer, selector: "ra-widget-container", inputs: ["widget-instance-id", "global-filter", "data", "event-bus", "app-config", "widget-width", "widget-height", "grid-cell-height", "dom-resized"], outputs: ["widgetDeleted", "updateAppliedFilters"] }, { type: i4.NotifierContainerComponent, selector: "notifier-container" }], directives: [{ type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "translate": i3.RATranslatePipe } });
1550
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: RADashboardArea, decorators: [{
1551
+ type: Component,
1552
+ args: [{ selector: 'ra-dashboard-area', template: "<div #gridWrapper class=\"wrap gridster gridster-mobile\" [ngStyle]=\"{'height': userWidgets.length > 0 ? (gridheight + 'px') : 'unset'}\">\r\n <!-- <div #gridWrapper class=\"wrap gridster\"> -->\r\n <gridster [options]=\"options\" style=\"height:100%;\" *ngIf=\"userWidgets.length > 0\">\r\n <gridster-item [item]=\"item\" *ngFor=\"let item of widgetList\">\r\n <ra-widget-container [app-config]=\"appConfig\" [event-bus]=\"raDashboardEventBus\"\r\n (widgetDeleted)=\"deleteWidget($event)\" [data]=\"item\" [global-filter]=\"globalFilter\"\r\n [grid-cell-height]=\"gridcellHeight\" *ngIf=\"gridcellHeight && gridcellHeight > 0\" [widget-width]=\"item.cols\"\r\n [widget-height]=\"item.rows\" [widget-instance-id]=\"item['widgetInstanceId']\" [dom-resized]=\"domResized\"\r\n (updateAppliedFilters)=\"updateAppliedFilters($event)\">\r\n </ra-widget-container>\r\n </gridster-item>\r\n </gridster>\r\n\r\n <div class=\"empty-padding kiosk-hide\" *ngIf=\"showEmptyDashboard\">\r\n <div class=\"empty-wrapper\">\r\n <div></div>\r\n <div class=\"m-1 empty-prefix\">\r\n <i class=\"fal fa-edit edit-icon\"></i>\r\n <span class=\"empty-title\">{{'dashboard.emptydashboard'|translate}}</span>\r\n </div>\r\n <div class=\"empty-content light\">\r\n <div>\r\n <div class=\"col-sm-12 empty-msg\">\r\n {{'dashboard.emptydashboardmessage'|translate}} <br />\r\n {{'dashboard.emptydashboardmessage2'|translate}}\r\n </div>\r\n <button *ngIf=\"isWidgetMgmnt\" class=\"btn btnLib btn-sm m-1 dashboard-button light\" (click)=\"addNewWidget()\">\r\n <i class=\"fal fa-plus m-1\"></i>{{'dashboard.addawidgets'|translate}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <notifier-container></notifier-container>\r\n</div>", styles: ["gridster{width:inherit;resize:height;display:flex;background-color:#ededed;overflow-y:hidden!important}.dvheader{width:100%;height:35px;background:black;color:#fff;padding:7px 3px 5px 6px;text-transform:uppercase}gridster-item{box-sizing:border-box;z-index:1;position:absolute;overflow:hidden;transition:.3s;display:none;background:#fff;-webkit-user-select:text;user-select:text;box-shadow:0 1px 10px #0000000d}gridster-item:hover{box-shadow:0 1px 10px #00000026}@media screen and (max-width: 685px){.gridster-mobile{height:auto!important;margin-bottom:50px!important}}@media screen and (max-width: 350px){.gridster-mobile{min-height:330px!important;margin-bottom:0!important}}.empty-padding{padding:40px 20px 20px;background-color:#ededed;display:flex;justify-content:center;align-content:center}.empty-wrapper{display:flex;background-color:#fff;border-radius:8px;min-height:125px;width:72%}.empty-prefix{color:#32ad3c;font-size:18px;display:flex;align-items:center;padding:10px 30px;min-width:max-content;min-width:-moz-max-content}.empty-content{color:#333;border-left:solid 1px #a9afb1;width:100%;display:flex;align-items:center;padding:15px 30px 10px 40px}.empty-msg{padding:0 0 5px;font-size:16px}.dashboard-button{padding:5px 10px 5px 5px!important}.btnLib{background-color:#ededed;color:#333!important}.btn-sm,.btn-group-sm>.btn{padding:5px 20px 5px 5px}.edit-icon{color:#32ad3c;font-size:24px;margin-right:15px}.empty-title{margin-top:10px}@media screen and (max-width: 600px){.empty-padding{padding:10px;background-color:#ededed;width:100%;display:block}.empty-wrapper{display:flex;background-color:#fff;border-radius:8px;min-height:125px;width:100%}.empty-prefix{color:#32ad3c;font-size:16px;display:flex;height:40px;padding:6px 10px 8px}.empty-content{color:#333;display:flex;padding:5px 10px 10px;margin-top:44px;margin-left:-185px;border-left:none}.empty-msg{padding:12px 10px 10px 5px;font-size:14px;border-top:solid 1px #a9afb1}.edit-icon{color:#32ad3c;font-size:20px;margin-right:6px}.empty-title{margin-top:6px}}\n"] }]
1553
+ }], ctorParameters: function () { return [{ type: RaDashboardService }, { type: i0.NgZone }, { type: i2$1.NgxUiLoaderService }, { type: i3.RATranslateService }, { type: i4.NotifierService }, { type: RADashboardResponsiveService }, { type: i3.RAPermissionService }]; }, propDecorators: { userDashboardId: [{
1554
+ type: Input,
1555
+ args: ['user-dashboard-id']
1556
+ }], areaKey: [{
1557
+ type: Input,
1558
+ args: ['area-key']
1559
+ }], globalFilter: [{
1560
+ type: Input,
1561
+ args: ['global-filter']
1562
+ }], raDashboardEventBus: [{
1563
+ type: Input,
1564
+ args: ['event-bus']
1565
+ }], widgetHeight: [{
1566
+ type: Input,
1567
+ args: ['widget-height']
1568
+ }], widgetWidth: [{
1569
+ type: Input,
1570
+ args: ['widget-width']
1571
+ }], appConfig: [{
1572
+ type: Input,
1573
+ args: ['app-config']
1574
+ }], hideDashboardBanner: [{
1575
+ type: Output
1576
+ }], gridWrapper: [{
1577
+ type: ViewChild,
1578
+ args: ['gridWrapper', { static: false }]
1579
+ }] } });
1580
+
1581
+ const customNotifierOptions = {
1582
+ position: {
1583
+ horizontal: {
1584
+ position: 'right',
1585
+ distance: 12
1586
+ },
1587
+ vertical: {
1588
+ position: 'top',
1589
+ distance: 12,
1590
+ gap: 10
1591
+ }
1592
+ },
1593
+ theme: 'material',
1594
+ behaviour: {
1595
+ autoHide: 5000,
1596
+ onClick: 'hide',
1597
+ onMouseover: 'pauseAutoHide',
1598
+ showDismissButton: true,
1599
+ stacking: 4
1600
+ },
1601
+ animations: {
1602
+ enabled: true,
1603
+ show: {
1604
+ preset: 'slide',
1605
+ speed: 300,
1606
+ easing: 'ease'
1607
+ },
1608
+ hide: {
1609
+ preset: 'fade',
1610
+ speed: 300,
1611
+ easing: 'ease',
1612
+ offset: 50
1613
+ },
1614
+ shift: {
1615
+ speed: 300,
1616
+ easing: 'ease'
1617
+ },
1618
+ overlap: 150
1619
+ }
1620
+ };
1621
+
1622
+ class DashboardFrameworkModule {
1623
+ }
1624
+ DashboardFrameworkModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DashboardFrameworkModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1625
+ DashboardFrameworkModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DashboardFrameworkModule, bootstrap: [RADashboardArea], declarations: [RADashboardArea,
1626
+ RAWidgetContainer,
1627
+ LockTooltip], imports: [BrowserModule,
1628
+ GridsterModule,
1629
+ HttpClientModule,
1630
+ NgxUiLoaderModule, i4.NotifierModule, RACommonModule,
1631
+ RAUserControlModule,
1632
+ RACommonControlsModule], exports: [RADashboardArea] });
1633
+ DashboardFrameworkModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DashboardFrameworkModule, imports: [[
1634
+ BrowserModule,
1635
+ GridsterModule,
1636
+ HttpClientModule,
1637
+ NgxUiLoaderModule,
1638
+ NotifierModule.withConfig(customNotifierOptions),
1639
+ RACommonModule,
1640
+ RAUserControlModule,
1641
+ RACommonControlsModule
1642
+ ]] });
1643
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: DashboardFrameworkModule, decorators: [{
1644
+ type: NgModule,
1645
+ args: [{
1646
+ declarations: [
1647
+ RADashboardArea,
1648
+ RAWidgetContainer,
1649
+ LockTooltip
1650
+ ],
1651
+ imports: [
1652
+ BrowserModule,
1653
+ GridsterModule,
1654
+ HttpClientModule,
1655
+ NgxUiLoaderModule,
1656
+ NotifierModule.withConfig(customNotifierOptions),
1657
+ RACommonModule,
1658
+ RAUserControlModule,
1659
+ RACommonControlsModule
1660
+ ],
1661
+ exports: [
1662
+ RADashboardArea
1663
+ ],
1664
+ bootstrap: [RADashboardArea],
1665
+ entryComponents: [
1666
+ LockTooltip
1667
+ ]
1668
+ }]
1669
+ }] });
1670
+
1671
+ class RADashboardEventBus {
1672
+ constructor() {
1673
+ this.eventQueue = new Subject();
1674
+ }
1675
+ /**
1676
+ * To emit an event with the name & data
1677
+ */
1678
+ publish(eventName, data) {
1679
+ this.eventQueue.next({ eventName, data });
1680
+ }
1681
+ /**
1682
+ * To emit an event with the name, data, key & value
1683
+ */
1684
+ publishWithKey(eventName, data, key, value) {
1685
+ this.eventQueue.next({ eventName, data, key, value });
1686
+ }
1687
+ /**
1688
+ * To subscribe to an event with the name
1689
+ */
1690
+ subscribe(eventName) {
1691
+ return this.eventQueue.asObservable().pipe(filter((event) => {
1692
+ return event.eventName == eventName;
1693
+ }), map(event => event.data));
1694
+ }
1695
+ /**
1696
+ * To subscribe to an event with the name key & value
1697
+ */
1698
+ subscribeWithKey(eventName, key, value) {
1699
+ return this.eventQueue.asObservable().pipe(filter((event) => {
1700
+ return event.eventName == eventName && event.key == key && event.value == value;
1701
+ }), map(event => event.data));
1702
+ }
1703
+ }
1704
+ RADashboardEventBus.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: RADashboardEventBus, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1705
+ RADashboardEventBus.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: RADashboardEventBus, providedIn: 'root' });
1706
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: RADashboardEventBus, decorators: [{
1707
+ type: Injectable,
1708
+ args: [{
1709
+ providedIn: 'root'
1710
+ }]
1711
+ }] });
1712
+
1713
+ class RaBaseDashboardTemplate {
1714
+ constructor(ngZone) {
1715
+ this.ngZone = ngZone;
1716
+ this.initialize = (eventBus, userDashboardId, appConfig) => {
1717
+ this.ngZone.run(() => {
1718
+ this.userDashboardId = userDashboardId;
1719
+ this.appConfig = appConfig;
1720
+ this.raDashboardEventBus = eventBus;
1721
+ });
1722
+ this.init();
1723
+ };
1724
+ }
1725
+ ngOnInit() {
1726
+ var myEvent = new CustomEvent("event-template-initiated");
1727
+ document.body.dispatchEvent(myEvent);
1728
+ }
1729
+ }
1730
+ RaBaseDashboardTemplate.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: RaBaseDashboardTemplate, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
1731
+ RaBaseDashboardTemplate.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.3", type: RaBaseDashboardTemplate, selector: "ng-component", inputs: { dashboardId: ["dashboard-id", "dashboardId"], globalFilter: ["global-filter", "globalFilter"], initialize: "initialize" }, ngImport: i0, template: '', isInline: true });
1732
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: RaBaseDashboardTemplate, decorators: [{
1733
+ type: Component,
1734
+ args: [{
1735
+ template: ''
1736
+ }]
1737
+ }], ctorParameters: function () { return [{ type: i0.NgZone }]; }, propDecorators: { dashboardId: [{
1738
+ type: Input,
1739
+ args: ['dashboard-id']
1740
+ }], globalFilter: [{
1741
+ type: Input,
1742
+ args: ['global-filter']
1743
+ }], initialize: [{
1744
+ type: Input
1745
+ }] } });
1746
+
1747
+ class RaBaseDashboardFilter {
1748
+ constructor() {
1749
+ this.getAllFilterConfig = (async) => {
1750
+ return this.getFilterConfig();
1751
+ };
1752
+ this.setInapplicableFilterMsg = (status) => {
1753
+ this.showHideInapplicableMsg(status);
1754
+ };
1755
+ this.isValidEntry = () => {
1756
+ return this.isValid();
1757
+ };
1758
+ this.clearAllData = () => {
1759
+ this.clearData();
1760
+ };
1761
+ this.setAllFilterConfig = (globalFilter, appConfig) => {
1762
+ this.setFilterConfig(globalFilter, appConfig);
1763
+ };
1764
+ }
1765
+ ngOnInit() {
1766
+ var myEvent = new CustomEvent("global-filter-initiated");
1767
+ document.body.dispatchEvent(myEvent);
1768
+ }
1769
+ }
1770
+ RaBaseDashboardFilter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: RaBaseDashboardFilter, deps: [], target: i0.ɵɵFactoryTarget.Component });
1771
+ RaBaseDashboardFilter.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.3", type: RaBaseDashboardFilter, selector: "ng-component", inputs: { getAllFilterConfig: "getAllFilterConfig", setInapplicableFilterMsg: "setInapplicableFilterMsg", isValidEntry: "isValidEntry", clearAllData: "clearAllData", setAllFilterConfig: "setAllFilterConfig" }, ngImport: i0, template: '', isInline: true });
1772
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.3", ngImport: i0, type: RaBaseDashboardFilter, decorators: [{
1773
+ type: Component,
1774
+ args: [{
1775
+ template: ''
1776
+ }]
1777
+ }], propDecorators: { getAllFilterConfig: [{
1778
+ type: Input
1779
+ }], setInapplicableFilterMsg: [{
1780
+ type: Input
1781
+ }], isValidEntry: [{
1782
+ type: Input
1783
+ }], clearAllData: [{
1784
+ type: Input
1785
+ }], setAllFilterConfig: [{
1786
+ type: Input
1787
+ }] } });
1788
+
1789
+ /*
1790
+ * Public API Surface of ra-dashboard-framework
1791
+ */
1792
+ // export * from './gridster/lib/gridster.component';
1793
+ // export * from './gridster/lib/gridsterPreview.component';
1794
+
1795
+ /**
1796
+ * Generated bundle index. Do not edit.
1797
+ */
1798
+
1799
+ export { DashboardFrameworkModule, RADashboardArea, RADashboardEventBus, RADashboardResponsiveService, RAEvent, RAEventKey, RAWidgetContainer, RaBaseDashboardFilter, RaBaseDashboardTemplate, RaDashboardService };
1800
+ //# sourceMappingURL=schneideress-dashboardframework.mjs.map