@memberjunction/ng-explorer-core 0.9.78 → 0.9.96

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 (105) hide show
  1. package/dist/lib/ask-skip/ask-skip.component.d.ts +87 -86
  2. package/dist/lib/ask-skip/ask-skip.component.js +615 -580
  3. package/dist/lib/ask-skip/skip-dynamic-report-wrapper.d.ts +12 -12
  4. package/dist/lib/ask-skip/skip-dynamic-report-wrapper.js +40 -39
  5. package/dist/lib/auth-button/auth-button.component.d.ts +12 -12
  6. package/dist/lib/auth-button/auth-button.component.js +44 -43
  7. package/dist/lib/dashboard-browser-component/dashboard-browser.component.d.ts +18 -18
  8. package/dist/lib/dashboard-browser-component/dashboard-browser.component.js +117 -117
  9. package/dist/lib/data-browser-component/data-browser.component.d.ts +16 -14
  10. package/dist/lib/data-browser-component/data-browser.component.js +96 -91
  11. package/dist/lib/favorites/favorites.component.d.ts +14 -14
  12. package/dist/lib/favorites/favorites.component.js +114 -114
  13. package/dist/lib/generic/base-form-component.d.ts +76 -76
  14. package/dist/lib/generic/base-form-component.js +436 -436
  15. package/dist/lib/generic/base-form-section-component.d.ts +6 -6
  16. package/dist/lib/generic/base-form-section-component.js +9 -9
  17. package/dist/lib/generic/base-record-component.d.ts +6 -6
  18. package/dist/lib/generic/base-record-component.js +15 -15
  19. package/dist/lib/generic/base-resource-component.d.ts +34 -34
  20. package/dist/lib/generic/base-resource-component.js +75 -75
  21. package/dist/lib/generic/dynamic-chart.d.ts +33 -33
  22. package/dist/lib/generic/dynamic-chart.js +236 -235
  23. package/dist/lib/generic/dynamic-grid.d.ts +25 -25
  24. package/dist/lib/generic/dynamic-grid.js +120 -119
  25. package/dist/lib/generic/dynamic-report.d.ts +38 -38
  26. package/dist/lib/generic/dynamic-report.js +353 -347
  27. package/dist/lib/generic/form-toolbar.d.ts +7 -7
  28. package/dist/lib/generic/form-toolbar.js +85 -89
  29. package/dist/lib/generic/resource-container-component.d.ts +25 -25
  30. package/dist/lib/generic/resource-container-component.js +104 -103
  31. package/dist/lib/generic/section-loader-component.d.ts +17 -17
  32. package/dist/lib/generic/section-loader-component.js +66 -65
  33. package/dist/lib/generic-browse-list/generic-browse-list.component.d.ts +26 -24
  34. package/dist/lib/generic-browse-list/generic-browse-list.component.js +145 -143
  35. package/dist/lib/guards/auth-guard.service.d.ts +11 -11
  36. package/dist/lib/guards/auth-guard.service.js +24 -24
  37. package/dist/lib/guards/entities.guard.d.ts +3 -3
  38. package/dist/lib/guards/entities.guard.js +38 -38
  39. package/dist/lib/header/MSFT_UserImageService.d.ts +11 -11
  40. package/dist/lib/header/MSFT_UserImageService.js +23 -23
  41. package/dist/lib/header/header.component.d.ts +51 -51
  42. package/dist/lib/header/header.component.js +220 -208
  43. package/dist/lib/home-component/home.component.d.ts +11 -9
  44. package/dist/lib/home-component/home.component.js +77 -54
  45. package/dist/lib/join-grid/join-grid.component.d.ts +30 -30
  46. package/dist/lib/join-grid/join-grid.component.js +222 -225
  47. package/dist/lib/navigation/navigation.component.d.ts +104 -103
  48. package/dist/lib/navigation/navigation.component.js +1026 -1004
  49. package/dist/lib/query-browser-component/query-browser.component.d.ts +14 -0
  50. package/dist/lib/query-browser-component/query-browser.component.js +55 -0
  51. package/dist/lib/report-browser-component/report-browser.component.d.ts +14 -14
  52. package/dist/lib/report-browser-component/report-browser.component.js +55 -55
  53. package/dist/lib/resource-wrappers/dashboard-resource.component.d.ts +8 -8
  54. package/dist/lib/resource-wrappers/dashboard-resource.component.js +51 -50
  55. package/dist/lib/resource-wrappers/query-resource.component.d.ts +10 -0
  56. package/dist/lib/resource-wrappers/query-resource.component.js +55 -0
  57. package/dist/lib/resource-wrappers/record-resource.component.d.ts +10 -10
  58. package/dist/lib/resource-wrappers/record-resource.component.js +71 -70
  59. package/dist/lib/resource-wrappers/report-resource.component.d.ts +10 -10
  60. package/dist/lib/resource-wrappers/report-resource.component.js +55 -54
  61. package/dist/lib/resource-wrappers/resource-wrappers-loader.d.ts +1 -1
  62. package/dist/lib/resource-wrappers/resource-wrappers-loader.js +14 -12
  63. package/dist/lib/resource-wrappers/search-results-resource.component.d.ts +10 -10
  64. package/dist/lib/resource-wrappers/search-results-resource.component.js +52 -51
  65. package/dist/lib/resource-wrappers/view-resource.component.d.ts +8 -8
  66. package/dist/lib/resource-wrappers/view-resource.component.js +61 -60
  67. package/dist/lib/settings/settings.component.d.ts +5 -5
  68. package/dist/lib/settings/settings.component.js +15 -14
  69. package/dist/lib/single-application/single-application.component.d.ts +20 -20
  70. package/dist/lib/single-application/single-application.component.js +113 -113
  71. package/dist/lib/single-dashboard/Components/add-item/add-item.component.d.ts +28 -28
  72. package/dist/lib/single-dashboard/Components/add-item/add-item.component.js +210 -212
  73. package/dist/lib/single-dashboard/Components/delete-item/delete-item.component.d.ts +13 -13
  74. package/dist/lib/single-dashboard/Components/delete-item/delete-item.component.js +60 -59
  75. package/dist/lib/single-dashboard/Components/edit-dashboard/edit-dashboard.component.d.ts +26 -26
  76. package/dist/lib/single-dashboard/Components/edit-dashboard/edit-dashboard.component.js +170 -169
  77. package/dist/lib/single-dashboard/single-dashboard.component.d.ts +75 -75
  78. package/dist/lib/single-dashboard/single-dashboard.component.js +464 -456
  79. package/dist/lib/single-entity/single-entity.component.d.ts +33 -33
  80. package/dist/lib/single-entity/single-entity.component.js +258 -252
  81. package/dist/lib/single-query/single-query.component.d.ts +16 -0
  82. package/dist/lib/single-query/single-query.component.js +70 -0
  83. package/dist/lib/single-record/single-record.component.d.ts +21 -21
  84. package/dist/lib/single-record/single-record.component.js +95 -95
  85. package/dist/lib/single-report/single-report.component.d.ts +22 -22
  86. package/dist/lib/single-report/single-report.component.js +88 -87
  87. package/dist/lib/single-search-result/single-search-result.component.d.ts +15 -15
  88. package/dist/lib/single-search-result/single-search-result.component.js +61 -60
  89. package/dist/lib/single-view/single-view.component.d.ts +38 -38
  90. package/dist/lib/single-view/single-view.component.js +201 -201
  91. package/dist/lib/user-notifications/user-notifications.component.d.ts +32 -32
  92. package/dist/lib/user-notifications/user-notifications.component.js +282 -282
  93. package/dist/lib/user-profile/user-profile.component.d.ts +10 -10
  94. package/dist/lib/user-profile/user-profile.component.js +42 -41
  95. package/dist/lib/user-view-properties/view-properties-dialog.component.d.ts +71 -71
  96. package/dist/lib/user-view-properties/view-properties-dialog.component.js +591 -581
  97. package/dist/module.d.ts +69 -65
  98. package/dist/module.js +356 -338
  99. package/dist/public-api.d.ts +46 -47
  100. package/dist/public-api.js +49 -50
  101. package/dist/shared/shared.service.d.ts +94 -92
  102. package/dist/shared/shared.service.js +324 -318
  103. package/dist/shared/urlPipe.d.ts +7 -7
  104. package/dist/shared/urlPipe.js +16 -16
  105. package/package.json +23 -15
@@ -1,456 +1,464 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';
11
- import { ResourceData } from '../generic/base-resource-component';
12
- import { Metadata } from '@memberjunction/core';
13
- import { Subject, debounceTime } from 'rxjs';
14
- import * as i0 from "@angular/core";
15
- import * as i1 from "../../shared/shared.service";
16
- const _c0 = ["dashboardNameInput"];
17
- function SingleDashboardComponent_app_add_item_dialog_0_Template(rf, ctx) { if (rf & 1) {
18
- const _r11 = i0.ɵɵgetCurrentView();
19
- i0.ɵɵelementStart(0, "app-add-item-dialog", 14);
20
- i0.ɵɵlistener("onClose", function SingleDashboardComponent_app_add_item_dialog_0_Template_app_add_item_dialog_onClose_0_listener($event) { i0.ɵɵrestoreView(_r11); const ctx_r10 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r10.closeDialog($event)); });
21
- i0.ɵɵelementEnd();
22
- } if (rf & 2) {
23
- const ctx_r0 = i0.ɵɵnextContext();
24
- i0.ɵɵproperty("selectedResource", ctx_r0.selectedResource);
25
- } }
26
- function SingleDashboardComponent_div_1_Template(rf, ctx) { if (rf & 1) {
27
- const _r13 = i0.ɵɵgetCurrentView();
28
- i0.ɵɵelementStart(0, "div")(1, "app-edit-dashboard", 15);
29
- i0.ɵɵlistener("onClose", function SingleDashboardComponent_div_1_Template_app_edit_dashboard_onClose_1_listener($event) { i0.ɵɵrestoreView(_r13); const ctx_r12 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r12.closeDashboardDialog($event)); })("triggerAddItem", function SingleDashboardComponent_div_1_Template_app_edit_dashboard_triggerAddItem_1_listener($event) { i0.ɵɵrestoreView(_r13); const ctx_r14 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r14.addItem($event)); })("onSave", function SingleDashboardComponent_div_1_Template_app_edit_dashboard_onSave_1_listener($event) { i0.ɵɵrestoreView(_r13); const ctx_r15 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r15.saveChanges($event)); });
30
- i0.ɵɵelementEnd()();
31
- } if (rf & 2) {
32
- const ctx_r1 = i0.ɵɵnextContext();
33
- i0.ɵɵadvance(1);
34
- i0.ɵɵproperty("items", ctx_r1.items)("config", ctx_r1.config);
35
- } }
36
- function SingleDashboardComponent_app_delete_item_dialog_2_Template(rf, ctx) { if (rf & 1) {
37
- const _r17 = i0.ɵɵgetCurrentView();
38
- i0.ɵɵelementStart(0, "app-delete-item-dialog", 16);
39
- i0.ɵɵlistener("removeDashboardItem", function SingleDashboardComponent_app_delete_item_dialog_2_Template_app_delete_item_dialog_removeDashboardItem_0_listener($event) { i0.ɵɵrestoreView(_r17); const ctx_r16 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r16.deleteDashboardItem($event)); })("onClose", function SingleDashboardComponent_app_delete_item_dialog_2_Template_app_delete_item_dialog_onClose_0_listener() { i0.ɵɵrestoreView(_r17); const ctx_r18 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r18.closeDeleteItemComponent()); });
40
- i0.ɵɵelementEnd();
41
- } if (rf & 2) {
42
- const ctx_r2 = i0.ɵɵnextContext();
43
- i0.ɵɵproperty("dashboardItem", ctx_r2.selectedDashboardItem);
44
- } }
45
- function SingleDashboardComponent_div_6_Template(rf, ctx) { if (rf & 1) {
46
- const _r21 = i0.ɵɵgetCurrentView();
47
- i0.ɵɵelementStart(0, "div", 8)(1, "input", 17, 18);
48
- i0.ɵɵlistener("keydown.enter", function SingleDashboardComponent_div_6_Template_input_keydown_enter_1_listener() { i0.ɵɵrestoreView(_r21); const ctx_r20 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r20.saveDashboardName()); });
49
- i0.ɵɵelementEnd();
50
- i0.ɵɵelementStart(3, "kendo-button", 19);
51
- i0.ɵɵlistener("click", function SingleDashboardComponent_div_6_Template_kendo_button_click_3_listener() { i0.ɵɵrestoreView(_r21); const ctx_r22 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r22.saveDashboardName()); });
52
- i0.ɵɵelement(4, "span", 20);
53
- i0.ɵɵelementEnd();
54
- i0.ɵɵelementStart(5, "kendo-button", 19);
55
- i0.ɵɵlistener("click", function SingleDashboardComponent_div_6_Template_kendo_button_click_5_listener() { i0.ɵɵrestoreView(_r21); const ctx_r23 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r23.cancelNameChange()); });
56
- i0.ɵɵelement(6, "span", 21);
57
- i0.ɵɵelementEnd()();
58
- } }
59
- function SingleDashboardComponent_ng_template_7_Template(rf, ctx) { if (rf & 1) {
60
- const _r25 = i0.ɵɵgetCurrentView();
61
- i0.ɵɵelement(0, "span", 22);
62
- i0.ɵɵelementStart(1, "h3", 19);
63
- i0.ɵɵlistener("click", function SingleDashboardComponent_ng_template_7_Template_h3_click_1_listener() { i0.ɵɵrestoreView(_r25); const ctx_r24 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r24.toggleInlineNameEdit(true)); });
64
- i0.ɵɵtext(2);
65
- i0.ɵɵelementEnd();
66
- } if (rf & 2) {
67
- const ctx_r5 = i0.ɵɵnextContext();
68
- i0.ɵɵadvance(2);
69
- i0.ɵɵtextInterpolate(ctx_r5.dashboardEntity.Name);
70
- } }
71
- function SingleDashboardComponent_div_10_Template(rf, ctx) { if (rf & 1) {
72
- const _r27 = i0.ɵɵgetCurrentView();
73
- i0.ɵɵelementStart(0, "div")(1, "kendo-button", 19);
74
- i0.ɵɵlistener("click", function SingleDashboardComponent_div_10_Template_kendo_button_click_1_listener() { i0.ɵɵrestoreView(_r27); const ctx_r26 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r26.onClickSaveDashboard()); });
75
- i0.ɵɵelement(2, "span", 23);
76
- i0.ɵɵtext(3, " Save ");
77
- i0.ɵɵelementEnd();
78
- i0.ɵɵelementStart(4, "kendo-button", 19);
79
- i0.ɵɵlistener("click", function SingleDashboardComponent_div_10_Template_kendo_button_click_4_listener() { i0.ɵɵrestoreView(_r27); const ctx_r28 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r28.onclickCancelChanges()); });
80
- i0.ɵɵelement(5, "span", 21);
81
- i0.ɵɵtext(6, " Cancel ");
82
- i0.ɵɵelementEnd()();
83
- } }
84
- function SingleDashboardComponent_ng_template_11_Template(rf, ctx) { if (rf & 1) {
85
- const _r30 = i0.ɵɵgetCurrentView();
86
- i0.ɵɵelementStart(0, "kendo-button", 19);
87
- i0.ɵɵlistener("click", function SingleDashboardComponent_ng_template_11_Template_kendo_button_click_0_listener() { i0.ɵɵrestoreView(_r30); const ctx_r29 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r29.addItem()); });
88
- i0.ɵɵelement(1, "span", 24);
89
- i0.ɵɵtext(2, " Add Item ");
90
- i0.ɵɵelementEnd();
91
- i0.ɵɵelementStart(3, "kendo-button", 25);
92
- i0.ɵɵlistener("click", function SingleDashboardComponent_ng_template_11_Template_kendo_button_click_3_listener() { i0.ɵɵrestoreView(_r30); const ctx_r31 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r31.toggleEditDashboard(true)); });
93
- i0.ɵɵelement(4, "span", 26);
94
- i0.ɵɵtext(5, " Edit Dashboard ");
95
- i0.ɵɵelementEnd();
96
- } if (rf & 2) {
97
- i0.ɵɵadvance(3);
98
- i0.ɵɵproperty("primary", true);
99
- } }
100
- function SingleDashboardComponent_kendo_tilelayout_item_15_div_3_Template(rf, ctx) { if (rf & 1) {
101
- const _r35 = i0.ɵɵgetCurrentView();
102
- i0.ɵɵelementStart(0, "div")(1, "div", 30)(2, "button", 31);
103
- i0.ɵɵlistener("click", function SingleDashboardComponent_kendo_tilelayout_item_15_div_3_Template_button_click_2_listener() { i0.ɵɵrestoreView(_r35); const ctx_r34 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r34.toggleEditDashboard(true)); });
104
- i0.ɵɵelement(3, "span", 32);
105
- i0.ɵɵelementEnd();
106
- i0.ɵɵelementStart(4, "button", 31);
107
- i0.ɵɵlistener("click", function SingleDashboardComponent_kendo_tilelayout_item_15_div_3_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r35); const item_r32 = i0.ɵɵnextContext().$implicit; const ctx_r36 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r36.showConfirmDeleteDashboardItem(item_r32)); });
108
- i0.ɵɵelement(5, "span", 33);
109
- i0.ɵɵelementEnd()()();
110
- } }
111
- const _c1 = function (a1) { return ["dashboard-item-header", a1]; };
112
- const _c2 = function (a0) { return [a0]; };
113
- function SingleDashboardComponent_kendo_tilelayout_item_15_Template(rf, ctx) { if (rf & 1) {
114
- const _r39 = i0.ɵɵgetCurrentView();
115
- i0.ɵɵelementStart(0, "kendo-tilelayout-item", 27)(1, "kendo-tilelayout-item-header", 28);
116
- i0.ɵɵtext(2);
117
- i0.ɵɵtemplate(3, SingleDashboardComponent_kendo_tilelayout_item_15_div_3_Template, 6, 0, "div", 1);
118
- i0.ɵɵelementEnd();
119
- i0.ɵɵelementStart(4, "kendo-tilelayout-item-body", 28)(5, "app-resource", 29);
120
- i0.ɵɵlistener("ContentLoadingStarted", function SingleDashboardComponent_kendo_tilelayout_item_15_Template_app_resource_ContentLoadingStarted_5_listener($event) { i0.ɵɵrestoreView(_r39); const ctx_r38 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r38.loadingStarted($event)); })("ContentLoadingComplete", function SingleDashboardComponent_kendo_tilelayout_item_15_Template_app_resource_ContentLoadingComplete_5_listener($event) { i0.ɵɵrestoreView(_r39); const ctx_r40 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r40.loadingComplete($event)); });
121
- i0.ɵɵelementEnd()()();
122
- } if (rf & 2) {
123
- const item_r32 = ctx.$implicit;
124
- const ctx_r9 = i0.ɵɵnextContext();
125
- i0.ɵɵproperty("col", item_r32.col)("colSpan", item_r32.colSpan)("rowSpan", item_r32.rowSpan)("id", item_r32.uniqueId);
126
- i0.ɵɵadvance(1);
127
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(10, _c1, ctx_r9.getIsEditingItemHeaderStyle()));
128
- i0.ɵɵadvance(1);
129
- i0.ɵɵtextInterpolate1(" ", item_r32.title, " ");
130
- i0.ɵɵadvance(1);
131
- i0.ɵɵproperty("ngIf", !ctx_r9.isEditingDashboard);
132
- i0.ɵɵadvance(1);
133
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(12, _c2, ctx_r9.getIsEditingItemBodyStyle()));
134
- i0.ɵɵadvance(1);
135
- i0.ɵɵproperty("Data", item_r32.ResourceData)("isVisible", true);
136
- } }
137
- export class SingleDashboardComponent {
138
- get contentLoading() {
139
- for (const item of this.items) {
140
- if (item.contentLoading) {
141
- return true;
142
- }
143
- }
144
- return false;
145
- }
146
- constructor(sharedService) {
147
- this.sharedService = sharedService;
148
- this.dashboardSaved = new EventEmitter();
149
- this.loadComplete = new EventEmitter();
150
- this.loadStarted = new EventEmitter();
151
- this.items = [];
152
- this.config = new DashboardConfigDetails();
153
- this.isItemDialogOpened = false;
154
- this.isEditDialogOpened = false;
155
- this.isEditDashboardNameDialogOpened = false;
156
- this.isDeletingDashboardItem = false;
157
- this.allowResize = false;
158
- this.allowReorder = false;
159
- this.isEditingDashboard = false;
160
- this.saveChangesSubject = new Subject();
161
- this.saveChangesSubject
162
- .pipe(debounceTime(500))
163
- .subscribe(() => {
164
- this.SaveDashboard();
165
- });
166
- }
167
- ngOnInit() {
168
- return __awaiter(this, void 0, void 0, function* () {
169
- // load up the dashboard
170
- const d = this.ResourceData;
171
- const config = this.ResourceData.Configuration;
172
- if (this.ResourceData) {
173
- const md = new Metadata();
174
- let uiConfig = { items: [] };
175
- this.dashboardEntity = yield md.GetEntityObject('Dashboards');
176
- if (this.ResourceData.ResourceRecordID && this.ResourceData.ResourceRecordID > 0) {
177
- yield this.dashboardEntity.Load(this.ResourceData.ResourceRecordID);
178
- // now we have loaded and we need to get the UIConfigDetails
179
- const raw = this.dashboardEntity.UIConfigDetails;
180
- if (raw) {
181
- uiConfig = JSON.parse(raw);
182
- this.config.columns = uiConfig.columns;
183
- this.config.rowHeight = uiConfig.rowHeight;
184
- this.config.resizable = uiConfig.resizable;
185
- this.config.reorderable = uiConfig.reorderable;
186
- }
187
- }
188
- else {
189
- this.dashboardEntity.NewRecord(); // creating a new dashboard
190
- this.dashboardEntity.UserID = md.CurrentUser.ID;
191
- this.dashboardEntity.Name = 'New Dashboard';
192
- this.config.columns = this.config.columns || this.config.columns;
193
- this.config.rowHeight = this.config.rowHeight || this.config.rowHeight;
194
- this.config.resizable = this.config.resizable || this.config.resizable;
195
- this.config.reorderable = this.config.reorderable || this.config.reorderable;
196
- }
197
- // now we need to load up the items
198
- this.items = [];
199
- //const tempItems = uiConfig.items.sort((a: any, b: any) => a.order - b.order);
200
- for (const item of uiConfig.items) {
201
- const dashboardItem = this.CreateDashboardItem(item);
202
- this.items.push(dashboardItem);
203
- }
204
- }
205
- });
206
- }
207
- CreateDashboardItem(item) {
208
- const dashboardItem = new DashboardItem();
209
- if (item) {
210
- dashboardItem.title = item.title;
211
- dashboardItem.order = item.order ? item.order : 0;
212
- dashboardItem.col = item.col;
213
- dashboardItem.row = item.row;
214
- dashboardItem.rowSpan = item.rowSpan;
215
- dashboardItem.colSpan = item.colSpan;
216
- dashboardItem.ResourceData = new ResourceData(item.ResourceData);
217
- }
218
- return dashboardItem;
219
- }
220
- loadingStarted(resourceComponent) {
221
- // look up the copmonent in the
222
- const item = this.items.find(i => i.ResourceData === resourceComponent.Data);
223
- if (item) {
224
- item.contentLoading = true;
225
- this.loadStarted.emit();
226
- }
227
- }
228
- loadingComplete(resourceComponent) {
229
- // look up the copmonent in the
230
- const item = this.items.find(i => i.ResourceData === resourceComponent.Data);
231
- if (item) {
232
- item.contentLoading = false;
233
- if (!this.contentLoading) {
234
- this.loadComplete.emit();
235
- }
236
- }
237
- }
238
- addItem(resourceType = null) {
239
- this.selectedResource = resourceType;
240
- this.isItemDialogOpened = true;
241
- this.isEditDialogOpened = false;
242
- }
243
- closeDialog(data) {
244
- if (data) {
245
- const dashboardItem = this.CreateDashboardItem(data);
246
- this.items.push(dashboardItem);
247
- console.log(dashboardItem);
248
- this.saveChangesSubject.next(true);
249
- }
250
- this.selectedResource = null;
251
- this.isItemDialogOpened = false;
252
- }
253
- toggleEditDashboard(allowEdit) {
254
- this.allowReorder = allowEdit;
255
- this.allowResize = allowEdit;
256
- this.isEditingDashboard = allowEdit;
257
- this.toggleInlineNameEdit(false);
258
- }
259
- onClickSaveDashboard() {
260
- return __awaiter(this, void 0, void 0, function* () {
261
- this.toggleEditDashboard(false);
262
- let result = yield this.SaveDashboard();
263
- if (result) {
264
- this.sharedService.CreateSimpleNotification("Dashboard changes have been saved.", "success");
265
- yield this.ngOnInit();
266
- }
267
- else {
268
- this.sharedService.CreateSimpleNotification("An error occured saving the dashboard changes", "error");
269
- }
270
- });
271
- }
272
- onclickCancelChanges() {
273
- return __awaiter(this, void 0, void 0, function* () {
274
- this.toggleEditDashboard(false);
275
- yield this.ngOnInit();
276
- });
277
- }
278
- closeDashboardDialog(data = null) {
279
- this.isEditDialogOpened = false;
280
- }
281
- saveChanges(data) {
282
- if (data.config) {
283
- this.config = data.config;
284
- }
285
- if (data.itemsChanged && data.items) {
286
- this.items = data.items;
287
- this.sharedService.InvokeManualResize();
288
- }
289
- this.SaveDashboard();
290
- this.closeDashboardDialog();
291
- }
292
- SaveDashboard() {
293
- return __awaiter(this, void 0, void 0, function* () {
294
- if (this.dashboardEntity) {
295
- const configData = {
296
- columns: this.config.columns,
297
- rowHeight: this.config.rowHeight,
298
- resizable: this.config.resizable,
299
- reorderable: this.config.reorderable,
300
- items: this.items
301
- };
302
- const configJSON = JSON.stringify(configData);
303
- this.dashboardEntity.UIConfigDetails = configJSON;
304
- const result = yield this.dashboardEntity.Save();
305
- this.dashboardSaved.emit(this.dashboardEntity);
306
- return result;
307
- }
308
- else
309
- return false;
310
- });
311
- }
312
- dashboardSaveComplete(entity) {
313
- this.dashboardSaved.emit(entity);
314
- }
315
- toggleInlineNameEdit(visible) {
316
- var _a, _b;
317
- this.isEditDashboardNameDialogOpened = visible;
318
- if (this.isEditDashboardNameDialogOpened) {
319
- (_b = (_a = this.dashboardNameInput) === null || _a === void 0 ? void 0 : _a.nativeElement) === null || _b === void 0 ? void 0 : _b.focus();
320
- }
321
- }
322
- saveDashboardName() {
323
- this.toggleInlineNameEdit(true);
324
- const inputValue = this.dashboardNameInput.nativeElement.value;
325
- if (inputValue && inputValue.length > 3) {
326
- this.dashboardEntity.Name = inputValue;
327
- this.SaveDashboard();
328
- }
329
- else {
330
- this.sharedService.CreateSimpleNotification('Invalid dashboard name: Must be at least 3 characters.', 'warning');
331
- }
332
- }
333
- cancelNameChange() {
334
- this.toggleInlineNameEdit(false);
335
- }
336
- closeDeleteItemComponent() {
337
- this.selectedDashboardItem = null;
338
- this.isDeletingDashboardItem = false;
339
- }
340
- showConfirmDeleteDashboardItem(item) {
341
- this.selectedDashboardItem = item;
342
- this.isDeletingDashboardItem = true;
343
- }
344
- deleteDashboardItem(item) {
345
- return __awaiter(this, void 0, void 0, function* () {
346
- this.items = this.items.filter(i => i.uniqueId != item.uniqueId);
347
- let result = yield this.SaveDashboard();
348
- if (result) {
349
- this.sharedService.CreateSimpleNotification(`Dashboard item ${item.uniqueId} deleted successfully`, "success");
350
- }
351
- else {
352
- this.sharedService.CreateSimpleNotification(`Unable to delete dashboard item ${item.uniqueId}`, "error");
353
- }
354
- this.selectedDashboardItem = null;
355
- this.isDeletingDashboardItem = false;
356
- });
357
- }
358
- getIsEditingItemBodyStyle() {
359
- return this.isEditingDashboard ? "bg-light-grey" : "";
360
- }
361
- getIsEditingItemHeaderStyle() {
362
- return this.isEditingDashboard ? "bg-dark-grey" : "bg-blue";
363
- }
364
- onReorder(e) {
365
- const item = this.items.find(i => i.uniqueId === parseInt(e.item.elem.nativeElement.id));
366
- if (item) {
367
- // move the item in our config state to the new index
368
- if (e.oldIndex !== e.newIndex) {
369
- this.items.splice(e.oldIndex, 1);
370
- this.items.splice(e.newIndex, 0, item);
371
- }
372
- //item.order = e.item.order;
373
- item.col = e.newCol ? e.newCol : item.col;
374
- item.row = e.newRow ? e.newRow : item.row;
375
- }
376
- }
377
- onResize(e) {
378
- const item = this.items.find(i => i.uniqueId === parseInt(e.item.elem.nativeElement.id));
379
- if (item) {
380
- item.colSpan = e.newColSpan;
381
- item.rowSpan = e.newRowSpan;
382
- }
383
- }
384
- }
385
- SingleDashboardComponent.ɵfac = function SingleDashboardComponent_Factory(t) { return new (t || SingleDashboardComponent)(i0.ɵɵdirectiveInject(i1.SharedService)); };
386
- SingleDashboardComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SingleDashboardComponent, selectors: [["app-single-dashboard"]], viewQuery: function SingleDashboardComponent_Query(rf, ctx) { if (rf & 1) {
387
- i0.ɵɵviewQuery(_c0, 5);
388
- } if (rf & 2) {
389
- let _t;
390
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.dashboardNameInput = _t.first);
391
- } }, inputs: { ResourceData: "ResourceData" }, outputs: { dashboardSaved: "dashboardSaved", loadComplete: "loadComplete", loadStarted: "loadStarted" }, decls: 16, vars: 12, consts: [[3, "selectedResource", "onClose", 4, "ngIf"], [4, "ngIf"], [3, "dashboardItem", "removeDashboardItem", "onClose", 4, "ngIf"], [1, "dashboard-container"], [1, "main-head-dashboard"], [1, "dashboard-title"], ["class", "dashboard-header k-d-flex k-flex-row k-justify-content-flex-end", 4, "ngIf", "ngIfElse"], ["dashboard_name_header", ""], [1, "dashboard-header", "k-d-flex", "k-flex-row", "k-justify-content-flex-end"], [4, "ngIf", "ngIfElse"], ["edit_dashboard_buttons", ""], [1, "tile-resource-container"], [3, "columns", "rowHeight", "resizable", "reorderable", "reorder", "resize"], [3, "col", "colSpan", "rowSpan", "id", 4, "ngFor", "ngForOf"], [3, "selectedResource", "onClose"], [3, "items", "config", "onClose", "triggerAddItem", "onSave"], [3, "dashboardItem", "removeDashboardItem", "onClose"], ["type", "text", "placeholder", "Enter name here", "id", "txtDashboardName", 1, "k-textbox", "k-input", "k-input-md", "k-rounded-md", "k-input-solid", 3, "keydown.enter"], ["dashboardNameInput", ""], [3, "click"], [1, "k-i-check", "k-button-icon", "k-icon", "ng-star-inserted"], [1, "k-icon", "k-i-cancel"], [1, "k-icon", "k-i-star"], [1, "k-icon", "k-i-check"], [1, "k-icon", "k-i-plus"], [3, "primary", "click"], [1, "k-icon", "k-i-gear"], [3, "col", "colSpan", "rowSpan", "id"], [3, "ngClass"], [3, "Data", "isVisible", "ContentLoadingStarted", "ContentLoadingComplete"], [1, "btn-wrapper"], ["kendoButton", "", "fillMode", "flat", 3, "click"], [1, "k-icon", "k-i-edit"], [1, "k-icon", "k-i-delete"]], template: function SingleDashboardComponent_Template(rf, ctx) { if (rf & 1) {
392
- i0.ɵɵtemplate(0, SingleDashboardComponent_app_add_item_dialog_0_Template, 1, 1, "app-add-item-dialog", 0);
393
- i0.ɵɵtemplate(1, SingleDashboardComponent_div_1_Template, 2, 2, "div", 1);
394
- i0.ɵɵtemplate(2, SingleDashboardComponent_app_delete_item_dialog_2_Template, 1, 1, "app-delete-item-dialog", 2);
395
- i0.ɵɵelementStart(3, "div", 3)(4, "div", 4)(5, "div", 5);
396
- i0.ɵɵtemplate(6, SingleDashboardComponent_div_6_Template, 7, 0, "div", 6);
397
- i0.ɵɵtemplate(7, SingleDashboardComponent_ng_template_7_Template, 3, 1, "ng-template", null, 7, i0.ɵɵtemplateRefExtractor);
398
- i0.ɵɵelementEnd();
399
- i0.ɵɵelementStart(9, "div", 8);
400
- i0.ɵɵtemplate(10, SingleDashboardComponent_div_10_Template, 7, 0, "div", 9);
401
- i0.ɵɵtemplate(11, SingleDashboardComponent_ng_template_11_Template, 6, 1, "ng-template", null, 10, i0.ɵɵtemplateRefExtractor);
402
- i0.ɵɵelementEnd()();
403
- i0.ɵɵelementStart(13, "div", 11)(14, "kendo-tilelayout", 12);
404
- i0.ɵɵlistener("reorder", function SingleDashboardComponent_Template_kendo_tilelayout_reorder_14_listener($event) { return ctx.onReorder($event); })("resize", function SingleDashboardComponent_Template_kendo_tilelayout_resize_14_listener($event) { return ctx.onResize($event); });
405
- i0.ɵɵtemplate(15, SingleDashboardComponent_kendo_tilelayout_item_15_Template, 6, 14, "kendo-tilelayout-item", 13);
406
- i0.ɵɵelementEnd()()();
407
- } if (rf & 2) {
408
- const _r4 = i0.ɵɵreference(8);
409
- const _r7 = i0.ɵɵreference(12);
410
- i0.ɵɵproperty("ngIf", ctx.isItemDialogOpened);
411
- i0.ɵɵadvance(1);
412
- i0.ɵɵproperty("ngIf", ctx.isEditDialogOpened);
413
- i0.ɵɵadvance(1);
414
- i0.ɵɵproperty("ngIf", ctx.isDeletingDashboardItem);
415
- i0.ɵɵadvance(4);
416
- i0.ɵɵproperty("ngIf", ctx.isEditDashboardNameDialogOpened)("ngIfElse", _r4);
417
- i0.ɵɵadvance(4);
418
- i0.ɵɵproperty("ngIf", ctx.isEditingDashboard)("ngIfElse", _r7);
419
- i0.ɵɵadvance(4);
420
- i0.ɵɵproperty("columns", ctx.config.columns)("rowHeight", ctx.config.rowHeight)("resizable", ctx.allowResize)("reorderable", ctx.allowReorder);
421
- i0.ɵɵadvance(1);
422
- i0.ɵɵproperty("ngForOf", ctx.items);
423
- } }, styles: [".dashboard-title[_ngcontent-%COMP%] {\r\n display: flex;\r\n align-items: center;\r\n gap: 10px;\r\n}\r\n.dashboard-title[_ngcontent-%COMP%] .k-icon[_ngcontent-%COMP%] {\r\n color: #ff6358;\r\n font-size: 25px;\r\n}\r\n.dashboard-title[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] {\r\ncolor: #424242;\r\nfont-size: 28px;\r\nfont-style: normal;\r\nfont-weight: 300;\r\nline-height: 28px;\r\n}\r\n.dashboard-header[_ngcontent-%COMP%] {\r\n display: flex;\r\n gap: 10px;\r\n align-items: center;\r\n}\r\n .dashboard-header .btn-ref .k-button-text {\r\n display: flex;\r\n gap: 10px;\r\n}\r\n .dashboard-header[_ngcontent-%COMP%] .btn-ref[_ngcontent-%COMP%] {\r\n border: none;\r\n background: transparent;\r\n}\r\n.main-head-dashboard[_ngcontent-%COMP%] {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n margin-bottom: 20px;\r\n padding-bottom: 20px;\r\n border-bottom: 1px solid rgba(0, 0, 0, 0.08);\r\n}\r\n\r\n.tile-resource-container[_ngcontent-%COMP%] .k-tilelayout[_ngcontent-%COMP%] {\r\n background: #fff;\r\n}\r\n\r\n.bg-light-grey[_ngcontent-%COMP%] {\r\n background-color: lightgray;\r\n}\r\n\r\n.bg-dark-grey[_ngcontent-%COMP%] {\r\n background-color: darkgray;\r\n}\r\n\r\n.bg-blue[_ngcontent-%COMP%] {\r\n background-color: #4250AD;\r\n color: white;\r\n}\r\n\r\n.dashboard-item-header[_ngcontent-%COMP%] {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n}\r\n\r\n.button-spacing[_ngcontent-%COMP%] {\r\n margin-right: 8px\r\n}"] });
424
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SingleDashboardComponent, [{
425
- type: Component,
426
- args: [{ selector: 'app-single-dashboard', template: "<app-add-item-dialog *ngIf=\"isItemDialogOpened\" (onClose)=\"closeDialog($event)\" [selectedResource]=\"selectedResource\"></app-add-item-dialog>\r\n<div *ngIf=\"isEditDialogOpened\">\r\n <app-edit-dashboard (onClose)=\"closeDashboardDialog($event)\" (triggerAddItem)=\"addItem($event)\" [items]=\"items\" [config]=\"config\" (onSave)=\"saveChanges($event)\"></app-edit-dashboard>\r\n</div>\r\n\r\n<app-delete-item-dialog *ngIf=\"isDeletingDashboardItem\" [dashboardItem]=\"selectedDashboardItem\" (removeDashboardItem)=\"deleteDashboardItem($event)\" (onClose)=\"closeDeleteItemComponent()\"></app-delete-item-dialog>\r\n\r\n<div class=\"dashboard-container\">\r\n <div class=\"main-head-dashboard\">\r\n <div class=\"dashboard-title\">\r\n <div *ngIf=\"isEditDashboardNameDialogOpened; else dashboard_name_header\" class=\"dashboard-header k-d-flex k-flex-row k-justify-content-flex-end\">\r\n <input class=\"k-textbox k-input k-input-md k-rounded-md k-input-solid\" (keydown.enter)=\"saveDashboardName()\" type=\"text\" placeholder=\"Enter name here\" id=\"txtDashboardName\" #dashboardNameInput>\r\n <kendo-button (click)=\"saveDashboardName()\">\r\n <span class=\"k-i-check k-button-icon k-icon ng-star-inserted\"></span>\r\n </kendo-button>\r\n <kendo-button (click)=\"cancelNameChange()\" >\r\n <span class=\"k-icon k-i-cancel\"></span>\r\n </kendo-button>\r\n </div>\r\n <ng-template #dashboard_name_header>\r\n <span class=\"k-icon k-i-star\"></span>\r\n <h3 (click)=\"toggleInlineNameEdit(true)\">{{dashboardEntity.Name}}</h3>\r\n </ng-template>\r\n </div>\r\n <div class=\"dashboard-header k-d-flex k-flex-row k-justify-content-flex-end\">\r\n <div *ngIf=\"isEditingDashboard; else edit_dashboard_buttons\">\r\n <kendo-button (click)=\"onClickSaveDashboard()\">\r\n <span class=\"k-icon k-i-check\"></span>\r\n Save\r\n </kendo-button>\r\n <kendo-button (click)=\"onclickCancelChanges()\">\r\n <span class=\"k-icon k-i-cancel\"></span>\r\n Cancel\r\n </kendo-button>\r\n </div>\r\n <ng-template #edit_dashboard_buttons>\r\n <kendo-button (click)=\"addItem()\">\r\n <span class=\"k-icon k-i-plus\"></span>\r\n Add Item\r\n </kendo-button>\r\n <kendo-button (click)=\"toggleEditDashboard(true)\" [primary]=\"true\">\r\n <span class=\"k-icon k-i-gear\"></span>\r\n Edit Dashboard\r\n </kendo-button>\r\n </ng-template>\r\n </div>\r\n </div>\r\n <div class=\"tile-resource-container\">\r\n <kendo-tilelayout\r\n [columns]=\"config.columns\"\r\n [rowHeight]=\"config.rowHeight\"\r\n [resizable]=\"allowResize\"\r\n [reorderable]=\"allowReorder\"\r\n (reorder)=\"onReorder($event)\"\r\n (resize)=\"onResize($event)\"\r\n >\r\n <kendo-tilelayout-item *ngFor=\"let item of items\" [col]=\"item.col\" [colSpan]=\"item.colSpan\" [rowSpan]=\"item.rowSpan\" [id]=\"item.uniqueId\">\r\n <kendo-tilelayout-item-header [ngClass]=\"['dashboard-item-header', getIsEditingItemHeaderStyle()]\">\r\n {{item.title}}\r\n <div *ngIf=\"!isEditingDashboard\">\r\n <div class=\"btn-wrapper\">\r\n <button kendoButton fillMode=\"flat\" (click)=\"toggleEditDashboard(true)\">\r\n <span class=\"k-icon k-i-edit\"></span>\r\n </button>\r\n <button kendoButton fillMode=\"flat\" (click)=\"showConfirmDeleteDashboardItem(item)\"><span\r\n class=\"k-icon k-i-delete\"></span></button>\r\n </div>\r\n </div>\r\n </kendo-tilelayout-item-header>\r\n <kendo-tilelayout-item-body [ngClass]=\"[getIsEditingItemBodyStyle()]\">\r\n <app-resource [Data]=\"item.ResourceData\" [isVisible]=\"true\" (ContentLoadingStarted)=\"loadingStarted($event)\" (ContentLoadingComplete)=\"loadingComplete($event)\"></app-resource>\r\n </kendo-tilelayout-item-body>\r\n </kendo-tilelayout-item>\r\n </kendo-tilelayout>\r\n </div>\r\n</div>\r\n", styles: [".dashboard-title {\r\n display: flex;\r\n align-items: center;\r\n gap: 10px;\r\n}\r\n.dashboard-title .k-icon {\r\n color: #ff6358;\r\n font-size: 25px;\r\n}\r\n.dashboard-title h3 {\r\ncolor: #424242;\r\nfont-size: 28px;\r\nfont-style: normal;\r\nfont-weight: 300;\r\nline-height: 28px;\r\n}\r\n.dashboard-header {\r\n display: flex;\r\n gap: 10px;\r\n align-items: center;\r\n}\r\n::ng-deep .dashboard-header .btn-ref .k-button-text {\r\n display: flex;\r\n gap: 10px;\r\n}\r\n .dashboard-header .btn-ref {\r\n border: none;\r\n background: transparent;\r\n}\r\n.main-head-dashboard {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n margin-bottom: 20px;\r\n padding-bottom: 20px;\r\n border-bottom: 1px solid rgba(0, 0, 0, 0.08);\r\n}\r\n\r\n.tile-resource-container .k-tilelayout {\r\n background: #fff;\r\n}\r\n\r\n.bg-light-grey {\r\n background-color: lightgray;\r\n}\r\n\r\n.bg-dark-grey {\r\n background-color: darkgray;\r\n}\r\n\r\n.bg-blue {\r\n background-color: #4250AD;\r\n color: white;\r\n}\r\n\r\n.dashboard-item-header {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n}\r\n\r\n.button-spacing {\r\n margin-right: 8px\r\n}"] }]
427
- }], function () { return [{ type: i1.SharedService }]; }, { dashboardNameInput: [{
428
- type: ViewChild,
429
- args: ['dashboardNameInput']
430
- }], ResourceData: [{
431
- type: Input
432
- }], dashboardSaved: [{
433
- type: Output
434
- }], loadComplete: [{
435
- type: Output
436
- }], loadStarted: [{
437
- type: Output
438
- }] }); })();
439
- export class DashboardConfigDetails {
440
- constructor() {
441
- this.columns = 4;
442
- this.rowHeight = 150;
443
- this.resizable = true;
444
- this.reorderable = true;
445
- }
446
- }
447
- export class DashboardItem {
448
- getNextUniqueID() {
449
- return DashboardItem.nextUniqueId++;
450
- }
451
- constructor() {
452
- this.contentLoading = false;
453
- this.uniqueId = this.getNextUniqueID();
454
- }
455
- }
456
- DashboardItem.nextUniqueId = 1;
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';
11
+ import { ResourceData } from '../generic/base-resource-component';
12
+ import { Metadata } from '@memberjunction/core';
13
+ import { Subject, debounceTime } from 'rxjs';
14
+ import * as i0 from "@angular/core";
15
+ import * as i1 from "../../shared/shared.service";
16
+ const _c0 = ["dashboardNameInput"];
17
+ function SingleDashboardComponent_app_add_item_dialog_0_Template(rf, ctx) { if (rf & 1) {
18
+ const _r11 = i0.ɵɵgetCurrentView();
19
+ i0.ɵɵelementStart(0, "app-add-item-dialog", 14);
20
+ i0.ɵɵlistener("onClose", function SingleDashboardComponent_app_add_item_dialog_0_Template_app_add_item_dialog_onClose_0_listener($event) { i0.ɵɵrestoreView(_r11); const ctx_r10 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r10.closeDialog($event)); });
21
+ i0.ɵɵelementEnd();
22
+ } if (rf & 2) {
23
+ const ctx_r0 = i0.ɵɵnextContext();
24
+ i0.ɵɵproperty("selectedResource", ctx_r0.selectedResource);
25
+ } }
26
+ function SingleDashboardComponent_div_1_Template(rf, ctx) { if (rf & 1) {
27
+ const _r13 = i0.ɵɵgetCurrentView();
28
+ i0.ɵɵelementStart(0, "div")(1, "app-edit-dashboard", 15);
29
+ i0.ɵɵlistener("onClose", function SingleDashboardComponent_div_1_Template_app_edit_dashboard_onClose_1_listener($event) { i0.ɵɵrestoreView(_r13); const ctx_r12 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r12.closeDashboardDialog($event)); })("triggerAddItem", function SingleDashboardComponent_div_1_Template_app_edit_dashboard_triggerAddItem_1_listener($event) { i0.ɵɵrestoreView(_r13); const ctx_r14 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r14.addItem($event)); })("onSave", function SingleDashboardComponent_div_1_Template_app_edit_dashboard_onSave_1_listener($event) { i0.ɵɵrestoreView(_r13); const ctx_r15 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r15.saveChanges($event)); });
30
+ i0.ɵɵelementEnd()();
31
+ } if (rf & 2) {
32
+ const ctx_r1 = i0.ɵɵnextContext();
33
+ i0.ɵɵadvance();
34
+ i0.ɵɵproperty("items", ctx_r1.items)("config", ctx_r1.config);
35
+ } }
36
+ function SingleDashboardComponent_app_delete_item_dialog_2_Template(rf, ctx) { if (rf & 1) {
37
+ const _r17 = i0.ɵɵgetCurrentView();
38
+ i0.ɵɵelementStart(0, "app-delete-item-dialog", 16);
39
+ i0.ɵɵlistener("removeDashboardItem", function SingleDashboardComponent_app_delete_item_dialog_2_Template_app_delete_item_dialog_removeDashboardItem_0_listener($event) { i0.ɵɵrestoreView(_r17); const ctx_r16 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r16.deleteDashboardItem($event)); })("onClose", function SingleDashboardComponent_app_delete_item_dialog_2_Template_app_delete_item_dialog_onClose_0_listener() { i0.ɵɵrestoreView(_r17); const ctx_r18 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r18.closeDeleteItemComponent()); });
40
+ i0.ɵɵelementEnd();
41
+ } if (rf & 2) {
42
+ const ctx_r2 = i0.ɵɵnextContext();
43
+ i0.ɵɵproperty("dashboardItem", ctx_r2.selectedDashboardItem);
44
+ } }
45
+ function SingleDashboardComponent_div_6_Template(rf, ctx) { if (rf & 1) {
46
+ const _r21 = i0.ɵɵgetCurrentView();
47
+ i0.ɵɵelementStart(0, "div", 8)(1, "input", 17, 18);
48
+ i0.ɵɵlistener("keydown.enter", function SingleDashboardComponent_div_6_Template_input_keydown_enter_1_listener() { i0.ɵɵrestoreView(_r21); const ctx_r20 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r20.saveDashboardName()); });
49
+ i0.ɵɵelementEnd();
50
+ i0.ɵɵelementStart(3, "kendo-button", 19);
51
+ i0.ɵɵlistener("click", function SingleDashboardComponent_div_6_Template_kendo_button_click_3_listener() { i0.ɵɵrestoreView(_r21); const ctx_r22 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r22.saveDashboardName()); });
52
+ i0.ɵɵelement(4, "span", 20);
53
+ i0.ɵɵelementEnd();
54
+ i0.ɵɵelementStart(5, "kendo-button", 19);
55
+ i0.ɵɵlistener("click", function SingleDashboardComponent_div_6_Template_kendo_button_click_5_listener() { i0.ɵɵrestoreView(_r21); const ctx_r23 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r23.cancelNameChange()); });
56
+ i0.ɵɵelement(6, "span", 21);
57
+ i0.ɵɵelementEnd()();
58
+ } }
59
+ function SingleDashboardComponent_ng_template_7_Template(rf, ctx) { if (rf & 1) {
60
+ const _r25 = i0.ɵɵgetCurrentView();
61
+ i0.ɵɵelement(0, "span", 22);
62
+ i0.ɵɵelementStart(1, "h3", 19);
63
+ i0.ɵɵlistener("click", function SingleDashboardComponent_ng_template_7_Template_h3_click_1_listener() { i0.ɵɵrestoreView(_r25); const ctx_r24 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r24.toggleInlineNameEdit(true)); });
64
+ i0.ɵɵtext(2);
65
+ i0.ɵɵelementEnd();
66
+ } if (rf & 2) {
67
+ const ctx_r4 = i0.ɵɵnextContext();
68
+ i0.ɵɵadvance(2);
69
+ i0.ɵɵtextInterpolate(ctx_r4.dashboardEntity.Name);
70
+ } }
71
+ function SingleDashboardComponent_div_10_Template(rf, ctx) { if (rf & 1) {
72
+ const _r27 = i0.ɵɵgetCurrentView();
73
+ i0.ɵɵelementStart(0, "div")(1, "kendo-button", 19);
74
+ i0.ɵɵlistener("click", function SingleDashboardComponent_div_10_Template_kendo_button_click_1_listener() { i0.ɵɵrestoreView(_r27); const ctx_r26 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r26.onClickSaveDashboard()); });
75
+ i0.ɵɵelement(2, "kendo-svgicon", 23);
76
+ i0.ɵɵtext(3, " Save ");
77
+ i0.ɵɵelementEnd();
78
+ i0.ɵɵelementStart(4, "kendo-button", 19);
79
+ i0.ɵɵlistener("click", function SingleDashboardComponent_div_10_Template_kendo_button_click_4_listener() { i0.ɵɵrestoreView(_r27); const ctx_r28 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r28.onclickCancelChanges()); });
80
+ i0.ɵɵelement(5, "kendo-svgicon", 23);
81
+ i0.ɵɵtext(6, " Cancel ");
82
+ i0.ɵɵelementEnd()();
83
+ } if (rf & 2) {
84
+ const ctx_r6 = i0.ɵɵnextContext();
85
+ i0.ɵɵadvance(2);
86
+ i0.ɵɵproperty("icon", ctx_r6.sharedService.kendoSVGIcon("check"));
87
+ i0.ɵɵadvance(3);
88
+ i0.ɵɵproperty("icon", ctx_r6.sharedService.kendoSVGIcon("cancel"));
89
+ } }
90
+ function SingleDashboardComponent_ng_template_11_Template(rf, ctx) { if (rf & 1) {
91
+ const _r30 = i0.ɵɵgetCurrentView();
92
+ i0.ɵɵelementStart(0, "kendo-button", 19);
93
+ i0.ɵɵlistener("click", function SingleDashboardComponent_ng_template_11_Template_kendo_button_click_0_listener() { i0.ɵɵrestoreView(_r30); const ctx_r29 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r29.addItem()); });
94
+ i0.ɵɵelement(1, "kendo-svgicon", 23);
95
+ i0.ɵɵtext(2, " Add Item ");
96
+ i0.ɵɵelementEnd();
97
+ i0.ɵɵelementStart(3, "kendo-button", 24);
98
+ i0.ɵɵlistener("click", function SingleDashboardComponent_ng_template_11_Template_kendo_button_click_3_listener() { i0.ɵɵrestoreView(_r30); const ctx_r31 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r31.toggleEditDashboard(true)); });
99
+ i0.ɵɵelement(4, "kendo-svgicon", 23);
100
+ i0.ɵɵtext(5, " Edit Dashboard ");
101
+ i0.ɵɵelementEnd();
102
+ } if (rf & 2) {
103
+ const ctx_r7 = i0.ɵɵnextContext();
104
+ i0.ɵɵadvance();
105
+ i0.ɵɵproperty("icon", ctx_r7.sharedService.kendoSVGIcon("plus"));
106
+ i0.ɵɵadvance(2);
107
+ i0.ɵɵproperty("primary", true);
108
+ i0.ɵɵadvance();
109
+ i0.ɵɵproperty("icon", ctx_r7.sharedService.kendoSVGIcon("gear"));
110
+ } }
111
+ function SingleDashboardComponent_kendo_tilelayout_item_15_div_3_Template(rf, ctx) { if (rf & 1) {
112
+ const _r35 = i0.ɵɵgetCurrentView();
113
+ i0.ɵɵelementStart(0, "div")(1, "div", 28)(2, "button", 29);
114
+ i0.ɵɵlistener("click", function SingleDashboardComponent_kendo_tilelayout_item_15_div_3_Template_button_click_2_listener() { i0.ɵɵrestoreView(_r35); const ctx_r34 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r34.toggleEditDashboard(true)); });
115
+ i0.ɵɵelement(3, "span", 30);
116
+ i0.ɵɵelementEnd();
117
+ i0.ɵɵelementStart(4, "button", 29);
118
+ i0.ɵɵlistener("click", function SingleDashboardComponent_kendo_tilelayout_item_15_div_3_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r35); const item_r32 = i0.ɵɵnextContext().$implicit; const ctx_r36 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r36.showConfirmDeleteDashboardItem(item_r32)); });
119
+ i0.ɵɵelement(5, "span", 31);
120
+ i0.ɵɵelementEnd()()();
121
+ } }
122
+ const _c1 = a1 => ["dashboard-item-header", a1];
123
+ const _c2 = a0 => [a0];
124
+ function SingleDashboardComponent_kendo_tilelayout_item_15_Template(rf, ctx) { if (rf & 1) {
125
+ const _r39 = i0.ɵɵgetCurrentView();
126
+ i0.ɵɵelementStart(0, "kendo-tilelayout-item", 25)(1, "kendo-tilelayout-item-header", 26);
127
+ i0.ɵɵtext(2);
128
+ i0.ɵɵtemplate(3, SingleDashboardComponent_kendo_tilelayout_item_15_div_3_Template, 6, 0, "div", 1);
129
+ i0.ɵɵelementEnd();
130
+ i0.ɵɵelementStart(4, "kendo-tilelayout-item-body", 26)(5, "app-resource", 27);
131
+ i0.ɵɵlistener("ContentLoadingStarted", function SingleDashboardComponent_kendo_tilelayout_item_15_Template_app_resource_ContentLoadingStarted_5_listener($event) { i0.ɵɵrestoreView(_r39); const ctx_r38 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r38.loadingStarted($event)); })("ContentLoadingComplete", function SingleDashboardComponent_kendo_tilelayout_item_15_Template_app_resource_ContentLoadingComplete_5_listener($event) { i0.ɵɵrestoreView(_r39); const ctx_r40 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r40.loadingComplete($event)); });
132
+ i0.ɵɵelementEnd()()();
133
+ } if (rf & 2) {
134
+ const item_r32 = ctx.$implicit;
135
+ const ctx_r9 = i0.ɵɵnextContext();
136
+ i0.ɵɵproperty("col", item_r32.col)("colSpan", item_r32.colSpan)("rowSpan", item_r32.rowSpan)("id", item_r32.uniqueId);
137
+ i0.ɵɵadvance();
138
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(10, _c1, ctx_r9.getIsEditingItemHeaderStyle()));
139
+ i0.ɵɵadvance();
140
+ i0.ɵɵtextInterpolate1(" ", item_r32.title, " ");
141
+ i0.ɵɵadvance();
142
+ i0.ɵɵproperty("ngIf", !ctx_r9.isEditingDashboard);
143
+ i0.ɵɵadvance();
144
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(12, _c2, ctx_r9.getIsEditingItemBodyStyle()));
145
+ i0.ɵɵadvance();
146
+ i0.ɵɵproperty("Data", item_r32.ResourceData)("isVisible", true);
147
+ } }
148
+ export class SingleDashboardComponent {
149
+ get contentLoading() {
150
+ for (const item of this.items) {
151
+ if (item.contentLoading) {
152
+ return true;
153
+ }
154
+ }
155
+ return false;
156
+ }
157
+ constructor(sharedService) {
158
+ this.sharedService = sharedService;
159
+ this.dashboardSaved = new EventEmitter();
160
+ this.loadComplete = new EventEmitter();
161
+ this.loadStarted = new EventEmitter();
162
+ this.items = [];
163
+ this.config = new DashboardConfigDetails();
164
+ this.isItemDialogOpened = false;
165
+ this.isEditDialogOpened = false;
166
+ this.isEditDashboardNameDialogOpened = false;
167
+ this.isDeletingDashboardItem = false;
168
+ this.allowResize = false;
169
+ this.allowReorder = false;
170
+ this.isEditingDashboard = false;
171
+ this.saveChangesSubject = new Subject();
172
+ this.saveChangesSubject
173
+ .pipe(debounceTime(500))
174
+ .subscribe(() => {
175
+ this.SaveDashboard();
176
+ });
177
+ }
178
+ ngOnInit() {
179
+ return __awaiter(this, void 0, void 0, function* () {
180
+ // load up the dashboard
181
+ const d = this.ResourceData;
182
+ const config = this.ResourceData.Configuration;
183
+ if (this.ResourceData) {
184
+ const md = new Metadata();
185
+ let uiConfig = { items: [] };
186
+ this.dashboardEntity = yield md.GetEntityObject('Dashboards');
187
+ if (this.ResourceData.ResourceRecordID && this.ResourceData.ResourceRecordID > 0) {
188
+ yield this.dashboardEntity.Load(this.ResourceData.ResourceRecordID);
189
+ // now we have loaded and we need to get the UIConfigDetails
190
+ const raw = this.dashboardEntity.UIConfigDetails;
191
+ if (raw) {
192
+ uiConfig = JSON.parse(raw);
193
+ this.config.columns = uiConfig.columns;
194
+ this.config.rowHeight = uiConfig.rowHeight;
195
+ this.config.resizable = uiConfig.resizable;
196
+ this.config.reorderable = uiConfig.reorderable;
197
+ }
198
+ }
199
+ else {
200
+ this.dashboardEntity.NewRecord(); // creating a new dashboard
201
+ this.dashboardEntity.UserID = md.CurrentUser.ID;
202
+ this.dashboardEntity.Name = 'New Dashboard';
203
+ this.config.columns = this.config.columns || this.config.columns;
204
+ this.config.rowHeight = this.config.rowHeight || this.config.rowHeight;
205
+ this.config.resizable = this.config.resizable || this.config.resizable;
206
+ this.config.reorderable = this.config.reorderable || this.config.reorderable;
207
+ }
208
+ // now we need to load up the items
209
+ this.items = [];
210
+ //const tempItems = uiConfig.items.sort((a: any, b: any) => a.order - b.order);
211
+ for (const item of uiConfig.items) {
212
+ const dashboardItem = this.CreateDashboardItem(item);
213
+ this.items.push(dashboardItem);
214
+ }
215
+ }
216
+ });
217
+ }
218
+ CreateDashboardItem(item) {
219
+ const dashboardItem = new DashboardItem();
220
+ if (item) {
221
+ dashboardItem.title = item.title;
222
+ dashboardItem.order = item.order ? item.order : 0;
223
+ dashboardItem.col = item.col;
224
+ dashboardItem.row = item.row;
225
+ dashboardItem.rowSpan = item.rowSpan;
226
+ dashboardItem.colSpan = item.colSpan;
227
+ dashboardItem.ResourceData = new ResourceData(item.ResourceData);
228
+ }
229
+ return dashboardItem;
230
+ }
231
+ loadingStarted(resourceComponent) {
232
+ // look up the copmonent in the
233
+ const item = this.items.find(i => i.ResourceData === resourceComponent.Data);
234
+ if (item) {
235
+ item.contentLoading = true;
236
+ this.loadStarted.emit();
237
+ }
238
+ }
239
+ loadingComplete(resourceComponent) {
240
+ // look up the copmonent in the
241
+ const item = this.items.find(i => i.ResourceData === resourceComponent.Data);
242
+ if (item) {
243
+ item.contentLoading = false;
244
+ if (!this.contentLoading) {
245
+ this.loadComplete.emit();
246
+ }
247
+ }
248
+ }
249
+ addItem(resourceType = null) {
250
+ this.selectedResource = resourceType;
251
+ this.isItemDialogOpened = true;
252
+ this.isEditDialogOpened = false;
253
+ }
254
+ closeDialog(data) {
255
+ if (data) {
256
+ const dashboardItem = this.CreateDashboardItem(data);
257
+ this.items.push(dashboardItem);
258
+ console.log(dashboardItem);
259
+ this.saveChangesSubject.next(true);
260
+ }
261
+ this.selectedResource = null;
262
+ this.isItemDialogOpened = false;
263
+ }
264
+ toggleEditDashboard(allowEdit) {
265
+ this.allowReorder = allowEdit;
266
+ this.allowResize = allowEdit;
267
+ this.isEditingDashboard = allowEdit;
268
+ this.toggleInlineNameEdit(false);
269
+ }
270
+ onClickSaveDashboard() {
271
+ return __awaiter(this, void 0, void 0, function* () {
272
+ this.toggleEditDashboard(false);
273
+ let result = yield this.SaveDashboard();
274
+ if (result) {
275
+ this.sharedService.CreateSimpleNotification("Dashboard changes have been saved.", "success");
276
+ yield this.ngOnInit();
277
+ }
278
+ else {
279
+ this.sharedService.CreateSimpleNotification("An error occured saving the dashboard changes", "error");
280
+ }
281
+ });
282
+ }
283
+ onclickCancelChanges() {
284
+ return __awaiter(this, void 0, void 0, function* () {
285
+ this.toggleEditDashboard(false);
286
+ yield this.ngOnInit();
287
+ });
288
+ }
289
+ closeDashboardDialog(data = null) {
290
+ this.isEditDialogOpened = false;
291
+ }
292
+ saveChanges(data) {
293
+ if (data.config) {
294
+ this.config = data.config;
295
+ }
296
+ if (data.itemsChanged && data.items) {
297
+ this.items = data.items;
298
+ this.sharedService.InvokeManualResize();
299
+ }
300
+ this.SaveDashboard();
301
+ this.closeDashboardDialog();
302
+ }
303
+ SaveDashboard() {
304
+ return __awaiter(this, void 0, void 0, function* () {
305
+ if (this.dashboardEntity) {
306
+ const configData = {
307
+ columns: this.config.columns,
308
+ rowHeight: this.config.rowHeight,
309
+ resizable: this.config.resizable,
310
+ reorderable: this.config.reorderable,
311
+ items: this.items
312
+ };
313
+ const configJSON = JSON.stringify(configData);
314
+ this.dashboardEntity.UIConfigDetails = configJSON;
315
+ const result = yield this.dashboardEntity.Save();
316
+ this.dashboardSaved.emit(this.dashboardEntity);
317
+ return result;
318
+ }
319
+ else
320
+ return false;
321
+ });
322
+ }
323
+ dashboardSaveComplete(entity) {
324
+ this.dashboardSaved.emit(entity);
325
+ }
326
+ toggleInlineNameEdit(visible) {
327
+ var _a, _b;
328
+ this.isEditDashboardNameDialogOpened = visible;
329
+ if (this.isEditDashboardNameDialogOpened) {
330
+ (_b = (_a = this.dashboardNameInput) === null || _a === void 0 ? void 0 : _a.nativeElement) === null || _b === void 0 ? void 0 : _b.focus();
331
+ }
332
+ }
333
+ saveDashboardName() {
334
+ this.toggleInlineNameEdit(true);
335
+ const inputValue = this.dashboardNameInput.nativeElement.value;
336
+ if (inputValue && inputValue.length > 3) {
337
+ this.dashboardEntity.Name = inputValue;
338
+ this.SaveDashboard();
339
+ }
340
+ else {
341
+ this.sharedService.CreateSimpleNotification('Invalid dashboard name: Must be at least 3 characters.', 'warning');
342
+ }
343
+ }
344
+ cancelNameChange() {
345
+ this.toggleInlineNameEdit(false);
346
+ }
347
+ closeDeleteItemComponent() {
348
+ this.selectedDashboardItem = null;
349
+ this.isDeletingDashboardItem = false;
350
+ }
351
+ showConfirmDeleteDashboardItem(item) {
352
+ this.selectedDashboardItem = item;
353
+ this.isDeletingDashboardItem = true;
354
+ }
355
+ deleteDashboardItem(item) {
356
+ return __awaiter(this, void 0, void 0, function* () {
357
+ this.items = this.items.filter(i => i.uniqueId != item.uniqueId);
358
+ let result = yield this.SaveDashboard();
359
+ if (result) {
360
+ this.sharedService.CreateSimpleNotification(`Dashboard item ${item.uniqueId} deleted successfully`, "success");
361
+ }
362
+ else {
363
+ this.sharedService.CreateSimpleNotification(`Unable to delete dashboard item ${item.uniqueId}`, "error");
364
+ }
365
+ this.selectedDashboardItem = null;
366
+ this.isDeletingDashboardItem = false;
367
+ });
368
+ }
369
+ getIsEditingItemBodyStyle() {
370
+ return this.isEditingDashboard ? "bg-light-grey" : "";
371
+ }
372
+ getIsEditingItemHeaderStyle() {
373
+ return this.isEditingDashboard ? "bg-dark-grey" : "bg-blue";
374
+ }
375
+ onReorder(e) {
376
+ const item = this.items.find(i => i.uniqueId === parseInt(e.item.elem.nativeElement.id));
377
+ if (item) {
378
+ // move the item in our config state to the new index
379
+ if (e.oldIndex !== e.newIndex) {
380
+ this.items.splice(e.oldIndex, 1);
381
+ this.items.splice(e.newIndex, 0, item);
382
+ }
383
+ //item.order = e.item.order;
384
+ item.col = e.newCol ? e.newCol : item.col;
385
+ item.row = e.newRow ? e.newRow : item.row;
386
+ }
387
+ }
388
+ onResize(e) {
389
+ const item = this.items.find(i => i.uniqueId === parseInt(e.item.elem.nativeElement.id));
390
+ if (item) {
391
+ item.colSpan = e.newColSpan;
392
+ item.rowSpan = e.newRowSpan;
393
+ }
394
+ }
395
+ }
396
+ SingleDashboardComponent.ɵfac = function SingleDashboardComponent_Factory(t) { return new (t || SingleDashboardComponent)(i0.ɵɵdirectiveInject(i1.SharedService)); };
397
+ SingleDashboardComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SingleDashboardComponent, selectors: [["app-single-dashboard"]], viewQuery: function SingleDashboardComponent_Query(rf, ctx) { if (rf & 1) {
398
+ i0.ɵɵviewQuery(_c0, 5);
399
+ } if (rf & 2) {
400
+ let _t;
401
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.dashboardNameInput = _t.first);
402
+ } }, inputs: { ResourceData: "ResourceData" }, outputs: { dashboardSaved: "dashboardSaved", loadComplete: "loadComplete", loadStarted: "loadStarted" }, decls: 16, vars: 12, consts: [[3, "selectedResource", "onClose", 4, "ngIf"], [4, "ngIf"], [3, "dashboardItem", "removeDashboardItem", "onClose", 4, "ngIf"], [1, "dashboard-container"], [1, "main-head-dashboard"], [1, "dashboard-title"], ["class", "dashboard-header k-d-flex k-flex-row k-justify-content-flex-end", 4, "ngIf", "ngIfElse"], ["dashboard_name_header", ""], [1, "dashboard-header", "k-d-flex", "k-flex-row", "k-justify-content-flex-end"], [4, "ngIf", "ngIfElse"], ["edit_dashboard_buttons", ""], [1, "tile-resource-container"], [3, "columns", "rowHeight", "resizable", "reorderable", "reorder", "resize"], [3, "col", "colSpan", "rowSpan", "id", 4, "ngFor", "ngForOf"], [3, "selectedResource", "onClose"], [3, "items", "config", "onClose", "triggerAddItem", "onSave"], [3, "dashboardItem", "removeDashboardItem", "onClose"], ["type", "text", "placeholder", "Enter name here", "id", "txtDashboardName", 1, "k-textbox", "k-input", "k-input-md", "k-rounded-md", "k-input-solid", 3, "keydown.enter"], ["dashboardNameInput", ""], [3, "click"], [1, "k-i-check", "k-button-icon", "k-icon", "ng-star-inserted"], [1, "k-icon", "k-i-cancel"], [1, "k-icon", "k-i-star"], [3, "icon"], [3, "primary", "click"], [3, "col", "colSpan", "rowSpan", "id"], [3, "ngClass"], [3, "Data", "isVisible", "ContentLoadingStarted", "ContentLoadingComplete"], [1, "btn-wrapper"], ["kendoButton", "", "fillMode", "flat", 3, "click"], [1, "k-icon", "k-i-edit"], [1, "k-icon", "k-i-delete"]], template: function SingleDashboardComponent_Template(rf, ctx) { if (rf & 1) {
403
+ i0.ɵɵtemplate(0, SingleDashboardComponent_app_add_item_dialog_0_Template, 1, 1, "app-add-item-dialog", 0)(1, SingleDashboardComponent_div_1_Template, 2, 2, "div", 1)(2, SingleDashboardComponent_app_delete_item_dialog_2_Template, 1, 1, "app-delete-item-dialog", 2);
404
+ i0.ɵɵelementStart(3, "div", 3)(4, "div", 4)(5, "div", 5);
405
+ i0.ɵɵtemplate(6, SingleDashboardComponent_div_6_Template, 7, 0, "div", 6)(7, SingleDashboardComponent_ng_template_7_Template, 3, 1, "ng-template", null, 7, i0.ɵɵtemplateRefExtractor);
406
+ i0.ɵɵelementEnd();
407
+ i0.ɵɵelementStart(9, "div", 8);
408
+ i0.ɵɵtemplate(10, SingleDashboardComponent_div_10_Template, 7, 2, "div", 9)(11, SingleDashboardComponent_ng_template_11_Template, 6, 3, "ng-template", null, 10, i0.ɵɵtemplateRefExtractor);
409
+ i0.ɵɵelementEnd()();
410
+ i0.ɵɵelementStart(13, "div", 11)(14, "kendo-tilelayout", 12);
411
+ i0.ɵɵlistener("reorder", function SingleDashboardComponent_Template_kendo_tilelayout_reorder_14_listener($event) { return ctx.onReorder($event); })("resize", function SingleDashboardComponent_Template_kendo_tilelayout_resize_14_listener($event) { return ctx.onResize($event); });
412
+ i0.ɵɵtemplate(15, SingleDashboardComponent_kendo_tilelayout_item_15_Template, 6, 14, "kendo-tilelayout-item", 13);
413
+ i0.ɵɵelementEnd()()();
414
+ } if (rf & 2) {
415
+ const _r5 = i0.ɵɵreference(8);
416
+ const _r8 = i0.ɵɵreference(12);
417
+ i0.ɵɵproperty("ngIf", ctx.isItemDialogOpened);
418
+ i0.ɵɵadvance();
419
+ i0.ɵɵproperty("ngIf", ctx.isEditDialogOpened);
420
+ i0.ɵɵadvance();
421
+ i0.ɵɵproperty("ngIf", ctx.isDeletingDashboardItem);
422
+ i0.ɵɵadvance(4);
423
+ i0.ɵɵproperty("ngIf", ctx.isEditDashboardNameDialogOpened)("ngIfElse", _r5);
424
+ i0.ɵɵadvance(4);
425
+ i0.ɵɵproperty("ngIf", ctx.isEditingDashboard)("ngIfElse", _r8);
426
+ i0.ɵɵadvance(4);
427
+ i0.ɵɵproperty("columns", ctx.config.columns)("rowHeight", ctx.config.rowHeight)("resizable", ctx.allowResize)("reorderable", ctx.allowReorder);
428
+ i0.ɵɵadvance();
429
+ i0.ɵɵproperty("ngForOf", ctx.items);
430
+ } }, styles: [".dashboard-title[_ngcontent-%COMP%] {\r\n display: flex;\r\n align-items: center;\r\n gap: 10px;\r\n}\r\n.dashboard-title[_ngcontent-%COMP%] .k-icon[_ngcontent-%COMP%] {\r\n color: #ff6358;\r\n font-size: 25px;\r\n}\r\n.dashboard-title[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] {\r\ncolor: #424242;\r\nfont-size: 28px;\r\nfont-style: normal;\r\nfont-weight: 300;\r\nline-height: 28px;\r\n}\r\n.dashboard-header[_ngcontent-%COMP%] {\r\n display: flex;\r\n gap: 10px;\r\n align-items: center;\r\n}\r\n .dashboard-header .btn-ref .k-button-text {\r\n display: flex;\r\n gap: 10px;\r\n}\r\n .dashboard-header[_ngcontent-%COMP%] .btn-ref[_ngcontent-%COMP%] {\r\n border: none;\r\n background: transparent;\r\n}\r\n.main-head-dashboard[_ngcontent-%COMP%] {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n margin-bottom: 20px;\r\n padding-bottom: 20px;\r\n border-bottom: 1px solid rgba(0, 0, 0, 0.08);\r\n}\r\n\r\n.tile-resource-container[_ngcontent-%COMP%] .k-tilelayout[_ngcontent-%COMP%] {\r\n background: #fff;\r\n}\r\n\r\n.bg-light-grey[_ngcontent-%COMP%] {\r\n background-color: lightgray;\r\n}\r\n\r\n.bg-dark-grey[_ngcontent-%COMP%] {\r\n background-color: darkgray;\r\n}\r\n\r\n.bg-blue[_ngcontent-%COMP%] {\r\n background-color: #4250AD;\r\n color: white;\r\n}\r\n\r\n.dashboard-item-header[_ngcontent-%COMP%] {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n}\r\n\r\n.button-spacing[_ngcontent-%COMP%] {\r\n margin-right: 8px\r\n}"] });
431
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SingleDashboardComponent, [{
432
+ type: Component,
433
+ args: [{ selector: 'app-single-dashboard', template: "<app-add-item-dialog *ngIf=\"isItemDialogOpened\" (onClose)=\"closeDialog($event)\" [selectedResource]=\"selectedResource\"></app-add-item-dialog>\r\n<div *ngIf=\"isEditDialogOpened\">\r\n <app-edit-dashboard (onClose)=\"closeDashboardDialog($event)\" (triggerAddItem)=\"addItem($event)\" [items]=\"items\" [config]=\"config\" (onSave)=\"saveChanges($event)\"></app-edit-dashboard>\r\n</div>\r\n\r\n<app-delete-item-dialog *ngIf=\"isDeletingDashboardItem\" [dashboardItem]=\"selectedDashboardItem\" (removeDashboardItem)=\"deleteDashboardItem($event)\" (onClose)=\"closeDeleteItemComponent()\"></app-delete-item-dialog>\r\n\r\n<div class=\"dashboard-container\">\r\n <div class=\"main-head-dashboard\">\r\n <div class=\"dashboard-title\">\r\n <div *ngIf=\"isEditDashboardNameDialogOpened; else dashboard_name_header\" class=\"dashboard-header k-d-flex k-flex-row k-justify-content-flex-end\">\r\n <input class=\"k-textbox k-input k-input-md k-rounded-md k-input-solid\" (keydown.enter)=\"saveDashboardName()\" type=\"text\" placeholder=\"Enter name here\" id=\"txtDashboardName\" #dashboardNameInput>\r\n <kendo-button (click)=\"saveDashboardName()\">\r\n <span class=\"k-i-check k-button-icon k-icon ng-star-inserted\"></span>\r\n </kendo-button>\r\n <kendo-button (click)=\"cancelNameChange()\" >\r\n <span class=\"k-icon k-i-cancel\"></span>\r\n </kendo-button>\r\n </div>\r\n <ng-template #dashboard_name_header>\r\n <span class=\"k-icon k-i-star\"></span>\r\n <h3 (click)=\"toggleInlineNameEdit(true)\">{{dashboardEntity.Name}}</h3>\r\n </ng-template>\r\n </div>\r\n <div class=\"dashboard-header k-d-flex k-flex-row k-justify-content-flex-end\">\r\n <div *ngIf=\"isEditingDashboard; else edit_dashboard_buttons\">\r\n <kendo-button (click)=\"onClickSaveDashboard()\">\r\n <kendo-svgicon [icon]=\"sharedService.kendoSVGIcon('check')\"></kendo-svgicon>\r\n Save\r\n </kendo-button>\r\n <kendo-button (click)=\"onclickCancelChanges()\">\r\n <kendo-svgicon [icon]=\"sharedService.kendoSVGIcon('cancel')\"></kendo-svgicon>\r\n Cancel\r\n </kendo-button>\r\n </div>\r\n <ng-template #edit_dashboard_buttons>\r\n <kendo-button (click)=\"addItem()\">\r\n <kendo-svgicon [icon]=\"sharedService.kendoSVGIcon('plus')\"></kendo-svgicon>\r\n Add Item\r\n </kendo-button>\r\n <kendo-button (click)=\"toggleEditDashboard(true)\" [primary]=\"true\">\r\n <kendo-svgicon [icon]=\"sharedService.kendoSVGIcon('gear')\"></kendo-svgicon>\r\n Edit Dashboard\r\n </kendo-button>\r\n </ng-template>\r\n </div>\r\n </div>\r\n <div class=\"tile-resource-container\">\r\n <kendo-tilelayout\r\n [columns]=\"config.columns\"\r\n [rowHeight]=\"config.rowHeight\"\r\n [resizable]=\"allowResize\"\r\n [reorderable]=\"allowReorder\"\r\n (reorder)=\"onReorder($event)\"\r\n (resize)=\"onResize($event)\"\r\n >\r\n <kendo-tilelayout-item *ngFor=\"let item of items\" [col]=\"item.col\" [colSpan]=\"item.colSpan\" [rowSpan]=\"item.rowSpan\" [id]=\"item.uniqueId\">\r\n <kendo-tilelayout-item-header [ngClass]=\"['dashboard-item-header', getIsEditingItemHeaderStyle()]\">\r\n {{item.title}}\r\n <div *ngIf=\"!isEditingDashboard\">\r\n <div class=\"btn-wrapper\">\r\n <button kendoButton fillMode=\"flat\" (click)=\"toggleEditDashboard(true)\">\r\n <span class=\"k-icon k-i-edit\"></span>\r\n </button>\r\n <button kendoButton fillMode=\"flat\" (click)=\"showConfirmDeleteDashboardItem(item)\"><span\r\n class=\"k-icon k-i-delete\"></span></button>\r\n </div>\r\n </div>\r\n </kendo-tilelayout-item-header>\r\n <kendo-tilelayout-item-body [ngClass]=\"[getIsEditingItemBodyStyle()]\">\r\n <app-resource [Data]=\"item.ResourceData\" [isVisible]=\"true\" (ContentLoadingStarted)=\"loadingStarted($event)\" (ContentLoadingComplete)=\"loadingComplete($event)\"></app-resource>\r\n </kendo-tilelayout-item-body>\r\n </kendo-tilelayout-item>\r\n </kendo-tilelayout>\r\n </div>\r\n</div>\r\n", styles: [".dashboard-title {\r\n display: flex;\r\n align-items: center;\r\n gap: 10px;\r\n}\r\n.dashboard-title .k-icon {\r\n color: #ff6358;\r\n font-size: 25px;\r\n}\r\n.dashboard-title h3 {\r\ncolor: #424242;\r\nfont-size: 28px;\r\nfont-style: normal;\r\nfont-weight: 300;\r\nline-height: 28px;\r\n}\r\n.dashboard-header {\r\n display: flex;\r\n gap: 10px;\r\n align-items: center;\r\n}\r\n::ng-deep .dashboard-header .btn-ref .k-button-text {\r\n display: flex;\r\n gap: 10px;\r\n}\r\n .dashboard-header .btn-ref {\r\n border: none;\r\n background: transparent;\r\n}\r\n.main-head-dashboard {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n margin-bottom: 20px;\r\n padding-bottom: 20px;\r\n border-bottom: 1px solid rgba(0, 0, 0, 0.08);\r\n}\r\n\r\n.tile-resource-container .k-tilelayout {\r\n background: #fff;\r\n}\r\n\r\n.bg-light-grey {\r\n background-color: lightgray;\r\n}\r\n\r\n.bg-dark-grey {\r\n background-color: darkgray;\r\n}\r\n\r\n.bg-blue {\r\n background-color: #4250AD;\r\n color: white;\r\n}\r\n\r\n.dashboard-item-header {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n}\r\n\r\n.button-spacing {\r\n margin-right: 8px\r\n}"] }]
434
+ }], () => [{ type: i1.SharedService }], { dashboardNameInput: [{
435
+ type: ViewChild,
436
+ args: ['dashboardNameInput']
437
+ }], ResourceData: [{
438
+ type: Input
439
+ }], dashboardSaved: [{
440
+ type: Output
441
+ }], loadComplete: [{
442
+ type: Output
443
+ }], loadStarted: [{
444
+ type: Output
445
+ }] }); })();
446
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SingleDashboardComponent, { className: "SingleDashboardComponent", filePath: "src\\lib\\single-dashboard\\single-dashboard.component.ts", lineNumber: 15 }); })();
447
+ export class DashboardConfigDetails {
448
+ constructor() {
449
+ this.columns = 4;
450
+ this.rowHeight = 150;
451
+ this.resizable = true;
452
+ this.reorderable = true;
453
+ }
454
+ }
455
+ export class DashboardItem {
456
+ getNextUniqueID() {
457
+ return DashboardItem.nextUniqueId++;
458
+ }
459
+ constructor() {
460
+ this.contentLoading = false;
461
+ this.uniqueId = this.getNextUniqueID();
462
+ }
463
+ }
464
+ DashboardItem.nextUniqueId = 1;