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