@memberjunction/ng-explorer-core 0.9.79 → 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.
- package/dist/lib/ask-skip/ask-skip.component.d.ts +87 -86
- package/dist/lib/ask-skip/ask-skip.component.js +615 -580
- package/dist/lib/ask-skip/skip-dynamic-report-wrapper.d.ts +12 -12
- package/dist/lib/ask-skip/skip-dynamic-report-wrapper.js +40 -39
- package/dist/lib/auth-button/auth-button.component.d.ts +12 -12
- package/dist/lib/auth-button/auth-button.component.js +44 -43
- package/dist/lib/dashboard-browser-component/dashboard-browser.component.d.ts +18 -18
- package/dist/lib/dashboard-browser-component/dashboard-browser.component.js +117 -117
- package/dist/lib/data-browser-component/data-browser.component.d.ts +16 -14
- package/dist/lib/data-browser-component/data-browser.component.js +96 -91
- package/dist/lib/favorites/favorites.component.d.ts +14 -14
- package/dist/lib/favorites/favorites.component.js +114 -114
- package/dist/lib/generic/base-form-component.d.ts +76 -76
- package/dist/lib/generic/base-form-component.js +436 -436
- package/dist/lib/generic/base-form-section-component.d.ts +6 -6
- package/dist/lib/generic/base-form-section-component.js +9 -9
- package/dist/lib/generic/base-record-component.d.ts +6 -6
- package/dist/lib/generic/base-record-component.js +15 -15
- package/dist/lib/generic/base-resource-component.d.ts +34 -34
- package/dist/lib/generic/base-resource-component.js +75 -75
- package/dist/lib/generic/dynamic-chart.d.ts +33 -33
- package/dist/lib/generic/dynamic-chart.js +236 -235
- package/dist/lib/generic/dynamic-grid.d.ts +25 -25
- package/dist/lib/generic/dynamic-grid.js +120 -119
- package/dist/lib/generic/dynamic-report.d.ts +38 -38
- package/dist/lib/generic/dynamic-report.js +353 -347
- package/dist/lib/generic/form-toolbar.d.ts +7 -7
- package/dist/lib/generic/form-toolbar.js +85 -89
- package/dist/lib/generic/resource-container-component.d.ts +25 -25
- package/dist/lib/generic/resource-container-component.js +104 -103
- package/dist/lib/generic/section-loader-component.d.ts +17 -17
- package/dist/lib/generic/section-loader-component.js +66 -65
- package/dist/lib/generic-browse-list/generic-browse-list.component.d.ts +26 -24
- package/dist/lib/generic-browse-list/generic-browse-list.component.js +145 -143
- package/dist/lib/guards/auth-guard.service.d.ts +11 -11
- package/dist/lib/guards/auth-guard.service.js +24 -24
- package/dist/lib/guards/entities.guard.d.ts +3 -3
- package/dist/lib/guards/entities.guard.js +38 -38
- package/dist/lib/header/MSFT_UserImageService.d.ts +11 -11
- package/dist/lib/header/MSFT_UserImageService.js +23 -23
- package/dist/lib/header/header.component.d.ts +51 -51
- package/dist/lib/header/header.component.js +220 -208
- package/dist/lib/home-component/home.component.d.ts +11 -9
- package/dist/lib/home-component/home.component.js +77 -54
- package/dist/lib/join-grid/join-grid.component.d.ts +30 -30
- package/dist/lib/join-grid/join-grid.component.js +222 -225
- package/dist/lib/navigation/navigation.component.d.ts +104 -103
- package/dist/lib/navigation/navigation.component.js +1026 -1004
- package/dist/lib/query-browser-component/query-browser.component.d.ts +14 -0
- package/dist/lib/query-browser-component/query-browser.component.js +55 -0
- package/dist/lib/report-browser-component/report-browser.component.d.ts +14 -14
- package/dist/lib/report-browser-component/report-browser.component.js +55 -55
- package/dist/lib/resource-wrappers/dashboard-resource.component.d.ts +8 -8
- package/dist/lib/resource-wrappers/dashboard-resource.component.js +51 -50
- package/dist/lib/resource-wrappers/query-resource.component.d.ts +10 -0
- package/dist/lib/resource-wrappers/query-resource.component.js +55 -0
- package/dist/lib/resource-wrappers/record-resource.component.d.ts +10 -10
- package/dist/lib/resource-wrappers/record-resource.component.js +71 -70
- package/dist/lib/resource-wrappers/report-resource.component.d.ts +10 -10
- package/dist/lib/resource-wrappers/report-resource.component.js +55 -54
- package/dist/lib/resource-wrappers/resource-wrappers-loader.d.ts +1 -1
- package/dist/lib/resource-wrappers/resource-wrappers-loader.js +14 -12
- package/dist/lib/resource-wrappers/search-results-resource.component.d.ts +10 -10
- package/dist/lib/resource-wrappers/search-results-resource.component.js +52 -51
- package/dist/lib/resource-wrappers/view-resource.component.d.ts +8 -8
- package/dist/lib/resource-wrappers/view-resource.component.js +61 -60
- package/dist/lib/settings/settings.component.d.ts +5 -5
- package/dist/lib/settings/settings.component.js +15 -14
- package/dist/lib/single-application/single-application.component.d.ts +20 -20
- package/dist/lib/single-application/single-application.component.js +113 -113
- package/dist/lib/single-dashboard/Components/add-item/add-item.component.d.ts +28 -28
- package/dist/lib/single-dashboard/Components/add-item/add-item.component.js +210 -212
- package/dist/lib/single-dashboard/Components/delete-item/delete-item.component.d.ts +13 -13
- package/dist/lib/single-dashboard/Components/delete-item/delete-item.component.js +60 -59
- package/dist/lib/single-dashboard/Components/edit-dashboard/edit-dashboard.component.d.ts +26 -26
- package/dist/lib/single-dashboard/Components/edit-dashboard/edit-dashboard.component.js +170 -169
- package/dist/lib/single-dashboard/single-dashboard.component.d.ts +75 -75
- package/dist/lib/single-dashboard/single-dashboard.component.js +464 -456
- package/dist/lib/single-entity/single-entity.component.d.ts +33 -33
- package/dist/lib/single-entity/single-entity.component.js +258 -252
- package/dist/lib/single-query/single-query.component.d.ts +16 -0
- package/dist/lib/single-query/single-query.component.js +70 -0
- package/dist/lib/single-record/single-record.component.d.ts +21 -21
- package/dist/lib/single-record/single-record.component.js +95 -95
- package/dist/lib/single-report/single-report.component.d.ts +22 -22
- package/dist/lib/single-report/single-report.component.js +88 -87
- package/dist/lib/single-search-result/single-search-result.component.d.ts +15 -15
- package/dist/lib/single-search-result/single-search-result.component.js +61 -60
- package/dist/lib/single-view/single-view.component.d.ts +38 -38
- package/dist/lib/single-view/single-view.component.js +201 -201
- package/dist/lib/user-notifications/user-notifications.component.d.ts +32 -32
- package/dist/lib/user-notifications/user-notifications.component.js +282 -282
- package/dist/lib/user-profile/user-profile.component.d.ts +10 -10
- package/dist/lib/user-profile/user-profile.component.js +42 -41
- package/dist/lib/user-view-properties/view-properties-dialog.component.d.ts +71 -71
- package/dist/lib/user-view-properties/view-properties-dialog.component.js +591 -581
- package/dist/module.d.ts +69 -65
- package/dist/module.js +356 -338
- package/dist/public-api.d.ts +46 -47
- package/dist/public-api.js +49 -50
- package/dist/shared/shared.service.d.ts +94 -92
- package/dist/shared/shared.service.js +324 -318
- package/dist/shared/urlPipe.d.ts +7 -7
- package/dist/shared/urlPipe.js +16 -16
- package/package.json +23 -15
|
@@ -1,217 +1,217 @@
|
|
|
1
|
-
import { Component, Input } from '@angular/core';
|
|
2
|
-
import { EntityFieldTSType, LogError, LogStatus, Metadata } from '@memberjunction/core';
|
|
3
|
-
import { MJEventType, MJGlobal } from '@memberjunction/global';
|
|
4
|
-
import { EventCodes, SharedService } from '../../shared/shared.service';
|
|
5
|
-
import { ResourceData } from './base-resource-component';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
import * as i1 from "@angular/common";
|
|
8
|
-
import * as i2 from "@progress/kendo-angular-charts";
|
|
9
|
-
import * as i3 from "@memberjunction/ng-container-directives";
|
|
10
|
-
function DynamicChartComponent_kendo_chart_category_axis_item_3_Template(rf, ctx) { if (rf & 1) {
|
|
11
|
-
i0.ɵɵelement(0, "kendo-chart-category-axis-item", 4);
|
|
12
|
-
} if (rf & 2) {
|
|
13
|
-
const axis_r2 = ctx.$implicit;
|
|
14
|
-
i0.ɵɵproperty("title", axis_r2.title)("categories", axis_r2.categories);
|
|
15
|
-
} }
|
|
16
|
-
function DynamicChartComponent_kendo_chart_series_item_5_Template(rf, ctx) { if (rf & 1) {
|
|
17
|
-
i0.ɵɵelement(0, "kendo-chart-series-item", 5);
|
|
18
|
-
} if (rf & 2) {
|
|
19
|
-
const item_r3 = ctx.$implicit;
|
|
20
|
-
const ctx_r1 = i0.ɵɵnextContext();
|
|
21
|
-
i0.ɵɵproperty("color", ctx_r1.getSeriesColor(item_r3))("type", ctx_r1.kendoSeriesType)("data", item_r3.data)("name", item_r3.name);
|
|
22
|
-
} }
|
|
23
|
-
export class DynamicChartComponent {
|
|
24
|
-
constructor() {
|
|
25
|
-
this._data = [];
|
|
26
|
-
this.chartTitle = 'Chart Title';
|
|
27
|
-
this.chartType = 'column';
|
|
28
|
-
this.xAxis = null;
|
|
29
|
-
this.yAxis = null;
|
|
30
|
-
this.xLabel = '';
|
|
31
|
-
this.yLabel = '';
|
|
32
|
-
this.columns = [];
|
|
33
|
-
this._axes = [];
|
|
34
|
-
this._series = [];
|
|
35
|
-
// simple default colors
|
|
36
|
-
this.colors = [
|
|
37
|
-
'#e6194b', '#3cb44b', '#ffe119', '#4363d8', '#f58231', '#911eb4', '#46f0f0', '#f032e6', '#bcf60c', '#fabebe',
|
|
38
|
-
'#008080', '#e6beff', '#9a6324', '#fffac8', '#800000', '#aaffc3', '#808000', '#ffd8b1', '#000075', '#808080',
|
|
39
|
-
'#000000', '#7cb9e8', '#c9ffe5', '#b284be', '#5d8aa8', '#00308f', '#72a0c1', '#e32636', '#c46210', '#efdecd'
|
|
40
|
-
];
|
|
41
|
-
}
|
|
42
|
-
get data() {
|
|
43
|
-
return this._data;
|
|
44
|
-
}
|
|
45
|
-
set data(value) {
|
|
46
|
-
// reset the series and axes when the data changes
|
|
47
|
-
this._series = [];
|
|
48
|
-
this._axes = [];
|
|
49
|
-
this._data = value;
|
|
50
|
-
}
|
|
51
|
-
get SkipData() {
|
|
52
|
-
return this._skipData ? this._skipData : undefined;
|
|
53
|
-
}
|
|
54
|
-
set SkipData(d) {
|
|
55
|
-
this._skipData = d;
|
|
56
|
-
if (d) {
|
|
57
|
-
this.data = d.SQLResults.results;
|
|
58
|
-
this.columns = d.SQLResults.columns;
|
|
59
|
-
this.xAxis = d.ChartOptions.xAxis;
|
|
60
|
-
this.xLabel = d.ChartOptions.xLabel;
|
|
61
|
-
this.yLabel = d.ChartOptions.yLabel;
|
|
62
|
-
this.yAxis = d.ChartOptions.yAxis;
|
|
63
|
-
this.chartType = d.DisplayType;
|
|
64
|
-
this.chartTitle = d.ReportTitle;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
get kendoSeriesType() {
|
|
68
|
-
return this.chartType;
|
|
69
|
-
}
|
|
70
|
-
get chartCategoryAxes() {
|
|
71
|
-
if (this._axes.length === 0) {
|
|
72
|
-
const result = [];
|
|
73
|
-
if (this.xAxis) {
|
|
74
|
-
const xArray = this.convertAxisToArray(this.xAxis);
|
|
75
|
-
for (let i = 0; i < xArray.length; i++) {
|
|
76
|
-
const xItem = xArray[i];
|
|
77
|
-
if (xItem !== null && xItem !== undefined && xItem.length > 0)
|
|
78
|
-
result.push({
|
|
79
|
-
categories: this.data.map(x => x[xItem]),
|
|
80
|
-
title: { text: this.xLabel }
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
this._axes = result;
|
|
85
|
-
return result;
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
return this._axes;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
convertAxisToArray(axis) {
|
|
92
|
-
if (Array.isArray(axis)) {
|
|
93
|
-
return axis;
|
|
94
|
-
}
|
|
95
|
-
else if (axis !== null && axis !== undefined && axis.length > 0) {
|
|
96
|
-
if (!axis.includes(',')) {
|
|
97
|
-
return [axis];
|
|
98
|
-
}
|
|
99
|
-
else
|
|
100
|
-
return axis.split(',');
|
|
101
|
-
}
|
|
102
|
-
else
|
|
103
|
-
return [];
|
|
104
|
-
}
|
|
105
|
-
get chartSeries() {
|
|
106
|
-
var _a;
|
|
107
|
-
if (this._series.length === 0) {
|
|
108
|
-
const result = [];
|
|
109
|
-
if (this.yAxis) {
|
|
110
|
-
const yArray = this.convertAxisToArray(this.yAxis);
|
|
111
|
-
for (let i = 0; i < yArray.length; i++) {
|
|
112
|
-
const yItem = yArray[i];
|
|
113
|
-
if (yItem !== null && yItem !== undefined && yItem.length > 0) {
|
|
114
|
-
const colDisplayName = ((_a = this.columns.find(col => col.FieldName === yItem)) === null || _a === void 0 ? void 0 : _a.DisplayName) || yItem;
|
|
115
|
-
result.push({ data: this.data.map(x => x[yItem]), name: colDisplayName });
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
this._series = result;
|
|
120
|
-
return result;
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
return this._series;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
getSeriesColor(item) {
|
|
127
|
-
var _a;
|
|
128
|
-
try {
|
|
129
|
-
const c = (_a = this.SkipData) === null || _a === void 0 ? void 0 : _a.ChartOptions.color;
|
|
130
|
-
if (c && c.length > 0) {
|
|
131
|
-
// use the configured color since it was provided
|
|
132
|
-
return c;
|
|
133
|
-
}
|
|
134
|
-
else {
|
|
135
|
-
const index = this.chartSeries.indexOf(item);
|
|
136
|
-
return this.colors[index % this.colors.length];
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
catch (ex) {
|
|
140
|
-
LogError(ex);
|
|
141
|
-
return '#000000';
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
onChartSeriesClick(e) {
|
|
145
|
-
var _a, _b;
|
|
146
|
-
try {
|
|
147
|
-
const drillDownValue = e.category; // contains the category for the clicked series item
|
|
148
|
-
const ddBaseViewField = (_a = this.SkipData) === null || _a === void 0 ? void 0 : _a.DrillDownBaseViewField;
|
|
149
|
-
const ddV = (_b = this.SkipData) === null || _b === void 0 ? void 0 : _b.DrillDownView;
|
|
150
|
-
if (ddBaseViewField && ddV && ddBaseViewField.length > 0 && ddV.length > 0 && drillDownValue && drillDownValue.length > 0) {
|
|
151
|
-
// we have a valid situation to drill down where we have the configuration and we have a drill down value.
|
|
152
|
-
const md = new Metadata();
|
|
153
|
-
const e = md.Entities.find(x => x.BaseView.trim().toLowerCase() === ddV.trim().toLowerCase());
|
|
154
|
-
if (e) {
|
|
155
|
-
// we have a valid entity for the drill down view
|
|
156
|
-
// now that we've validated all of this, we can navigate to the drill down view
|
|
157
|
-
// which is simply a dynamic view for a given entity with a filter applied
|
|
158
|
-
const rd = new ResourceData();
|
|
159
|
-
const ef = e.Fields.find(ef => ef.Name.trim().toLowerCase() === ddBaseViewField.trim().toLowerCase());
|
|
160
|
-
// next, fix up the drill down value to wrap with quotes if we need if we are a string or date, and also if a string, escape any single quotes
|
|
161
|
-
let filterVal = drillDownValue;
|
|
162
|
-
if ((ef === null || ef === void 0 ? void 0 : ef.TSType) === EntityFieldTSType.String) {
|
|
163
|
-
filterVal = `'${filterVal.replace(/'/g, "''")}'`;
|
|
164
|
-
}
|
|
165
|
-
else if ((ef === null || ef === void 0 ? void 0 : ef.TSType) === EntityFieldTSType.Date) {
|
|
166
|
-
filterVal = `'${filterVal}'`;
|
|
167
|
-
}
|
|
168
|
-
rd.ResourceTypeID = SharedService.Instance.ViewResourceType.ID;
|
|
169
|
-
rd.ResourceRecordID = 0;
|
|
170
|
-
rd.Configuration = {
|
|
171
|
-
Entity: e.Name,
|
|
172
|
-
ExtraFilter: `${ddBaseViewField} = ${filterVal}`,
|
|
173
|
-
};
|
|
174
|
-
// now we've built up our ResourceData object, we can raise the event to navigate to the drill down view
|
|
175
|
-
LogStatus(`drilling down to ${ddV} with filter ${ddBaseViewField} = ${drillDownValue}`);
|
|
176
|
-
MJGlobal.Instance.RaiseEvent({
|
|
177
|
-
component: this,
|
|
178
|
-
event: MJEventType.ComponentEvent,
|
|
179
|
-
eventCode: EventCodes.ViewClicked,
|
|
180
|
-
args: rd
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
else
|
|
184
|
-
LogError(`Could not find entity for the specified DrillDownView: ${ddV}`);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
catch (e) {
|
|
188
|
-
LogError(e);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
DynamicChartComponent.ɵfac = function DynamicChartComponent_Factory(t) { return new (t || DynamicChartComponent)(); };
|
|
193
|
-
DynamicChartComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: DynamicChartComponent, selectors: [["app-dynamic-chart"]], inputs: { data: "data", chartTitle: "chartTitle", chartType: "chartType", xAxis: "xAxis", yAxis: "yAxis", xLabel: "xLabel", yLabel: "yLabel", columns: "columns", SkipData: "SkipData" }, decls: 6, vars: 3, consts: [["mjFillContainer", "", 3, "seriesClick"], [3, "text"], [3, "title", "categories", 4, "ngFor", "ngForOf"], [3, "color", "type", "data", "name", 4, "ngFor", "ngForOf"], [3, "title", "categories"], [3, "color", "type", "data", "name"]], template: function DynamicChartComponent_Template(rf, ctx) { if (rf & 1) {
|
|
194
|
-
i0.ɵɵelementStart(0, "kendo-chart", 0);
|
|
195
|
-
i0.ɵɵlistener("seriesClick", function DynamicChartComponent_Template_kendo_chart_seriesClick_0_listener($event) { return ctx.onChartSeriesClick($event); });
|
|
196
|
-
i0.ɵɵelement(1, "kendo-chart-title", 1);
|
|
197
|
-
i0.ɵɵelementStart(2, "kendo-chart-category-axis");
|
|
198
|
-
i0.ɵɵtemplate(3, DynamicChartComponent_kendo_chart_category_axis_item_3_Template, 1, 2, "kendo-chart-category-axis-item", 2);
|
|
199
|
-
i0.ɵɵelementEnd();
|
|
200
|
-
i0.ɵɵelementStart(4, "kendo-chart-series");
|
|
201
|
-
i0.ɵɵtemplate(5, DynamicChartComponent_kendo_chart_series_item_5_Template, 1, 4, "kendo-chart-series-item", 3);
|
|
202
|
-
i0.ɵɵelementEnd()();
|
|
203
|
-
} if (rf & 2) {
|
|
204
|
-
i0.ɵɵadvance(
|
|
205
|
-
i0.ɵɵproperty("text", ctx.chartTitle);
|
|
206
|
-
i0.ɵɵadvance(2);
|
|
207
|
-
i0.ɵɵproperty("ngForOf", ctx.chartCategoryAxes);
|
|
208
|
-
i0.ɵɵadvance(2);
|
|
209
|
-
i0.ɵɵproperty("ngForOf", ctx.chartSeries);
|
|
210
|
-
} }, dependencies: [i1.NgForOf, i2.ChartComponent, i2.CategoryAxisComponent, i2.CategoryAxisItemComponent, i2.SeriesComponent, i2.SeriesItemComponent, i2.TitleComponent, i3.FillContainer], encapsulation: 2 });
|
|
211
|
-
(
|
|
212
|
-
type: Component,
|
|
213
|
-
args: [{
|
|
214
|
-
selector: 'app-dynamic-chart',
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
import { EntityFieldTSType, LogError, LogStatus, Metadata } from '@memberjunction/core';
|
|
3
|
+
import { MJEventType, MJGlobal } from '@memberjunction/global';
|
|
4
|
+
import { EventCodes, SharedService } from '../../shared/shared.service';
|
|
5
|
+
import { ResourceData } from './base-resource-component';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
import * as i1 from "@angular/common";
|
|
8
|
+
import * as i2 from "@progress/kendo-angular-charts";
|
|
9
|
+
import * as i3 from "@memberjunction/ng-container-directives";
|
|
10
|
+
function DynamicChartComponent_kendo_chart_category_axis_item_3_Template(rf, ctx) { if (rf & 1) {
|
|
11
|
+
i0.ɵɵelement(0, "kendo-chart-category-axis-item", 4);
|
|
12
|
+
} if (rf & 2) {
|
|
13
|
+
const axis_r2 = ctx.$implicit;
|
|
14
|
+
i0.ɵɵproperty("title", axis_r2.title)("categories", axis_r2.categories);
|
|
15
|
+
} }
|
|
16
|
+
function DynamicChartComponent_kendo_chart_series_item_5_Template(rf, ctx) { if (rf & 1) {
|
|
17
|
+
i0.ɵɵelement(0, "kendo-chart-series-item", 5);
|
|
18
|
+
} if (rf & 2) {
|
|
19
|
+
const item_r3 = ctx.$implicit;
|
|
20
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
21
|
+
i0.ɵɵproperty("color", ctx_r1.getSeriesColor(item_r3))("type", ctx_r1.kendoSeriesType)("data", item_r3.data)("name", item_r3.name);
|
|
22
|
+
} }
|
|
23
|
+
export class DynamicChartComponent {
|
|
24
|
+
constructor() {
|
|
25
|
+
this._data = [];
|
|
26
|
+
this.chartTitle = 'Chart Title';
|
|
27
|
+
this.chartType = 'column';
|
|
28
|
+
this.xAxis = null;
|
|
29
|
+
this.yAxis = null;
|
|
30
|
+
this.xLabel = '';
|
|
31
|
+
this.yLabel = '';
|
|
32
|
+
this.columns = [];
|
|
33
|
+
this._axes = [];
|
|
34
|
+
this._series = [];
|
|
35
|
+
// simple default colors
|
|
36
|
+
this.colors = [
|
|
37
|
+
'#e6194b', '#3cb44b', '#ffe119', '#4363d8', '#f58231', '#911eb4', '#46f0f0', '#f032e6', '#bcf60c', '#fabebe',
|
|
38
|
+
'#008080', '#e6beff', '#9a6324', '#fffac8', '#800000', '#aaffc3', '#808000', '#ffd8b1', '#000075', '#808080',
|
|
39
|
+
'#000000', '#7cb9e8', '#c9ffe5', '#b284be', '#5d8aa8', '#00308f', '#72a0c1', '#e32636', '#c46210', '#efdecd'
|
|
40
|
+
];
|
|
41
|
+
}
|
|
42
|
+
get data() {
|
|
43
|
+
return this._data;
|
|
44
|
+
}
|
|
45
|
+
set data(value) {
|
|
46
|
+
// reset the series and axes when the data changes
|
|
47
|
+
this._series = [];
|
|
48
|
+
this._axes = [];
|
|
49
|
+
this._data = value;
|
|
50
|
+
}
|
|
51
|
+
get SkipData() {
|
|
52
|
+
return this._skipData ? this._skipData : undefined;
|
|
53
|
+
}
|
|
54
|
+
set SkipData(d) {
|
|
55
|
+
this._skipData = d;
|
|
56
|
+
if (d) {
|
|
57
|
+
this.data = d.SQLResults.results;
|
|
58
|
+
this.columns = d.SQLResults.columns;
|
|
59
|
+
this.xAxis = d.ChartOptions.xAxis;
|
|
60
|
+
this.xLabel = d.ChartOptions.xLabel;
|
|
61
|
+
this.yLabel = d.ChartOptions.yLabel;
|
|
62
|
+
this.yAxis = d.ChartOptions.yAxis;
|
|
63
|
+
this.chartType = d.DisplayType;
|
|
64
|
+
this.chartTitle = d.ReportTitle;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
get kendoSeriesType() {
|
|
68
|
+
return this.chartType;
|
|
69
|
+
}
|
|
70
|
+
get chartCategoryAxes() {
|
|
71
|
+
if (this._axes.length === 0) {
|
|
72
|
+
const result = [];
|
|
73
|
+
if (this.xAxis) {
|
|
74
|
+
const xArray = this.convertAxisToArray(this.xAxis);
|
|
75
|
+
for (let i = 0; i < xArray.length; i++) {
|
|
76
|
+
const xItem = xArray[i];
|
|
77
|
+
if (xItem !== null && xItem !== undefined && xItem.length > 0)
|
|
78
|
+
result.push({
|
|
79
|
+
categories: this.data.map(x => x[xItem]),
|
|
80
|
+
title: { text: this.xLabel }
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
this._axes = result;
|
|
85
|
+
return result;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
return this._axes;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
convertAxisToArray(axis) {
|
|
92
|
+
if (Array.isArray(axis)) {
|
|
93
|
+
return axis;
|
|
94
|
+
}
|
|
95
|
+
else if (axis !== null && axis !== undefined && axis.length > 0) {
|
|
96
|
+
if (!axis.includes(',')) {
|
|
97
|
+
return [axis];
|
|
98
|
+
}
|
|
99
|
+
else
|
|
100
|
+
return axis.split(',');
|
|
101
|
+
}
|
|
102
|
+
else
|
|
103
|
+
return [];
|
|
104
|
+
}
|
|
105
|
+
get chartSeries() {
|
|
106
|
+
var _a;
|
|
107
|
+
if (this._series.length === 0) {
|
|
108
|
+
const result = [];
|
|
109
|
+
if (this.yAxis) {
|
|
110
|
+
const yArray = this.convertAxisToArray(this.yAxis);
|
|
111
|
+
for (let i = 0; i < yArray.length; i++) {
|
|
112
|
+
const yItem = yArray[i];
|
|
113
|
+
if (yItem !== null && yItem !== undefined && yItem.length > 0) {
|
|
114
|
+
const colDisplayName = ((_a = this.columns.find(col => col.FieldName === yItem)) === null || _a === void 0 ? void 0 : _a.DisplayName) || yItem;
|
|
115
|
+
result.push({ data: this.data.map(x => x[yItem]), name: colDisplayName });
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
this._series = result;
|
|
120
|
+
return result;
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
return this._series;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
getSeriesColor(item) {
|
|
127
|
+
var _a;
|
|
128
|
+
try {
|
|
129
|
+
const c = (_a = this.SkipData) === null || _a === void 0 ? void 0 : _a.ChartOptions.color;
|
|
130
|
+
if (c && c.length > 0) {
|
|
131
|
+
// use the configured color since it was provided
|
|
132
|
+
return c;
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
const index = this.chartSeries.indexOf(item);
|
|
136
|
+
return this.colors[index % this.colors.length];
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
catch (ex) {
|
|
140
|
+
LogError(ex);
|
|
141
|
+
return '#000000';
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
onChartSeriesClick(e) {
|
|
145
|
+
var _a, _b;
|
|
146
|
+
try {
|
|
147
|
+
const drillDownValue = e.category; // contains the category for the clicked series item
|
|
148
|
+
const ddBaseViewField = (_a = this.SkipData) === null || _a === void 0 ? void 0 : _a.DrillDownBaseViewField;
|
|
149
|
+
const ddV = (_b = this.SkipData) === null || _b === void 0 ? void 0 : _b.DrillDownView;
|
|
150
|
+
if (ddBaseViewField && ddV && ddBaseViewField.length > 0 && ddV.length > 0 && drillDownValue && drillDownValue.length > 0) {
|
|
151
|
+
// we have a valid situation to drill down where we have the configuration and we have a drill down value.
|
|
152
|
+
const md = new Metadata();
|
|
153
|
+
const e = md.Entities.find(x => x.BaseView.trim().toLowerCase() === ddV.trim().toLowerCase());
|
|
154
|
+
if (e) {
|
|
155
|
+
// we have a valid entity for the drill down view
|
|
156
|
+
// now that we've validated all of this, we can navigate to the drill down view
|
|
157
|
+
// which is simply a dynamic view for a given entity with a filter applied
|
|
158
|
+
const rd = new ResourceData();
|
|
159
|
+
const ef = e.Fields.find(ef => ef.Name.trim().toLowerCase() === ddBaseViewField.trim().toLowerCase());
|
|
160
|
+
// next, fix up the drill down value to wrap with quotes if we need if we are a string or date, and also if a string, escape any single quotes
|
|
161
|
+
let filterVal = drillDownValue;
|
|
162
|
+
if ((ef === null || ef === void 0 ? void 0 : ef.TSType) === EntityFieldTSType.String) {
|
|
163
|
+
filterVal = `'${filterVal.replace(/'/g, "''")}'`;
|
|
164
|
+
}
|
|
165
|
+
else if ((ef === null || ef === void 0 ? void 0 : ef.TSType) === EntityFieldTSType.Date) {
|
|
166
|
+
filterVal = `'${filterVal}'`;
|
|
167
|
+
}
|
|
168
|
+
rd.ResourceTypeID = SharedService.Instance.ViewResourceType.ID;
|
|
169
|
+
rd.ResourceRecordID = 0;
|
|
170
|
+
rd.Configuration = {
|
|
171
|
+
Entity: e.Name,
|
|
172
|
+
ExtraFilter: `${ddBaseViewField} = ${filterVal}`,
|
|
173
|
+
};
|
|
174
|
+
// now we've built up our ResourceData object, we can raise the event to navigate to the drill down view
|
|
175
|
+
LogStatus(`drilling down to ${ddV} with filter ${ddBaseViewField} = ${drillDownValue}`);
|
|
176
|
+
MJGlobal.Instance.RaiseEvent({
|
|
177
|
+
component: this,
|
|
178
|
+
event: MJEventType.ComponentEvent,
|
|
179
|
+
eventCode: EventCodes.ViewClicked,
|
|
180
|
+
args: rd
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
else
|
|
184
|
+
LogError(`Could not find entity for the specified DrillDownView: ${ddV}`);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
catch (e) {
|
|
188
|
+
LogError(e);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
DynamicChartComponent.ɵfac = function DynamicChartComponent_Factory(t) { return new (t || DynamicChartComponent)(); };
|
|
193
|
+
DynamicChartComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: DynamicChartComponent, selectors: [["app-dynamic-chart"]], inputs: { data: "data", chartTitle: "chartTitle", chartType: "chartType", xAxis: "xAxis", yAxis: "yAxis", xLabel: "xLabel", yLabel: "yLabel", columns: "columns", SkipData: "SkipData" }, decls: 6, vars: 3, consts: [["mjFillContainer", "", 3, "seriesClick"], [3, "text"], [3, "title", "categories", 4, "ngFor", "ngForOf"], [3, "color", "type", "data", "name", 4, "ngFor", "ngForOf"], [3, "title", "categories"], [3, "color", "type", "data", "name"]], template: function DynamicChartComponent_Template(rf, ctx) { if (rf & 1) {
|
|
194
|
+
i0.ɵɵelementStart(0, "kendo-chart", 0);
|
|
195
|
+
i0.ɵɵlistener("seriesClick", function DynamicChartComponent_Template_kendo_chart_seriesClick_0_listener($event) { return ctx.onChartSeriesClick($event); });
|
|
196
|
+
i0.ɵɵelement(1, "kendo-chart-title", 1);
|
|
197
|
+
i0.ɵɵelementStart(2, "kendo-chart-category-axis");
|
|
198
|
+
i0.ɵɵtemplate(3, DynamicChartComponent_kendo_chart_category_axis_item_3_Template, 1, 2, "kendo-chart-category-axis-item", 2);
|
|
199
|
+
i0.ɵɵelementEnd();
|
|
200
|
+
i0.ɵɵelementStart(4, "kendo-chart-series");
|
|
201
|
+
i0.ɵɵtemplate(5, DynamicChartComponent_kendo_chart_series_item_5_Template, 1, 4, "kendo-chart-series-item", 3);
|
|
202
|
+
i0.ɵɵelementEnd()();
|
|
203
|
+
} if (rf & 2) {
|
|
204
|
+
i0.ɵɵadvance();
|
|
205
|
+
i0.ɵɵproperty("text", ctx.chartTitle);
|
|
206
|
+
i0.ɵɵadvance(2);
|
|
207
|
+
i0.ɵɵproperty("ngForOf", ctx.chartCategoryAxes);
|
|
208
|
+
i0.ɵɵadvance(2);
|
|
209
|
+
i0.ɵɵproperty("ngForOf", ctx.chartSeries);
|
|
210
|
+
} }, dependencies: [i1.NgForOf, i2.ChartComponent, i2.CategoryAxisComponent, i2.CategoryAxisItemComponent, i2.SeriesComponent, i2.SeriesItemComponent, i2.TitleComponent, i3.FillContainer], encapsulation: 2 });
|
|
211
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DynamicChartComponent, [{
|
|
212
|
+
type: Component,
|
|
213
|
+
args: [{
|
|
214
|
+
selector: 'app-dynamic-chart',
|
|
215
215
|
template: `
|
|
216
216
|
<kendo-chart mjFillContainer
|
|
217
217
|
(seriesClick)="onChartSeriesClick($event)"
|
|
@@ -228,24 +228,25 @@ DynamicChartComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: Dynam
|
|
|
228
228
|
[name]="item.name"></kendo-chart-series-item>
|
|
229
229
|
</kendo-chart-series>
|
|
230
230
|
</kendo-chart>
|
|
231
|
-
`
|
|
232
|
-
}]
|
|
233
|
-
}], null, { data: [{
|
|
234
|
-
type: Input
|
|
235
|
-
}], chartTitle: [{
|
|
236
|
-
type: Input
|
|
237
|
-
}], chartType: [{
|
|
238
|
-
type: Input
|
|
239
|
-
}], xAxis: [{
|
|
240
|
-
type: Input
|
|
241
|
-
}], yAxis: [{
|
|
242
|
-
type: Input
|
|
243
|
-
}], xLabel: [{
|
|
244
|
-
type: Input
|
|
245
|
-
}], yLabel: [{
|
|
246
|
-
type: Input
|
|
247
|
-
}], columns: [{
|
|
248
|
-
type: Input
|
|
249
|
-
}], SkipData: [{
|
|
250
|
-
type: Input
|
|
251
|
-
}] }); })();
|
|
231
|
+
`
|
|
232
|
+
}]
|
|
233
|
+
}], null, { data: [{
|
|
234
|
+
type: Input
|
|
235
|
+
}], chartTitle: [{
|
|
236
|
+
type: Input
|
|
237
|
+
}], chartType: [{
|
|
238
|
+
type: Input
|
|
239
|
+
}], xAxis: [{
|
|
240
|
+
type: Input
|
|
241
|
+
}], yAxis: [{
|
|
242
|
+
type: Input
|
|
243
|
+
}], xLabel: [{
|
|
244
|
+
type: Input
|
|
245
|
+
}], yLabel: [{
|
|
246
|
+
type: Input
|
|
247
|
+
}], columns: [{
|
|
248
|
+
type: Input
|
|
249
|
+
}], SkipData: [{
|
|
250
|
+
type: Input
|
|
251
|
+
}] }); })();
|
|
252
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(DynamicChartComponent, { className: "DynamicChartComponent", filePath: "src\\lib\\generic\\dynamic-chart.ts", lineNumber: 30 }); })();
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { AfterViewInit } from '@angular/core';
|
|
2
|
-
import { SkipColumnInfo, SkipData } from '../ask-skip/ask-skip.component';
|
|
3
|
-
import { DecimalPipe, DatePipe } from '@angular/common';
|
|
4
|
-
import { GridDataResult, PageChangeEvent } from '@progress/kendo-angular-grid';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class DynamicGridComponent implements AfterViewInit {
|
|
7
|
-
private decimalPipe;
|
|
8
|
-
private datePipe;
|
|
9
|
-
data: any[];
|
|
10
|
-
columns: SkipColumnInfo[];
|
|
11
|
-
pageSize: number;
|
|
12
|
-
startingRow: number;
|
|
13
|
-
private _skipData;
|
|
14
|
-
get SkipData(): SkipData | undefined;
|
|
15
|
-
set SkipData(d: SkipData | undefined);
|
|
16
|
-
gridView: GridDataResult;
|
|
17
|
-
constructor(decimalPipe: DecimalPipe, datePipe: DatePipe);
|
|
18
|
-
formatData(dataType: string, data: any): any;
|
|
19
|
-
ngAfterViewInit(): void;
|
|
20
|
-
pageChange(event: PageChangeEvent): void;
|
|
21
|
-
private loadGridView;
|
|
22
|
-
cellClick(event: any): void;
|
|
23
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicGridComponent, never>;
|
|
24
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DynamicGridComponent, "app-dynamic-grid", never, { "data": "data"; "columns": "columns"; "pageSize": "pageSize"; "startingRow": "startingRow"; "SkipData": "SkipData"; }, {}, never, never, false, never>;
|
|
25
|
-
}
|
|
1
|
+
import { AfterViewInit } from '@angular/core';
|
|
2
|
+
import { SkipColumnInfo, SkipData } from '../ask-skip/ask-skip.component';
|
|
3
|
+
import { DecimalPipe, DatePipe } from '@angular/common';
|
|
4
|
+
import { GridDataResult, PageChangeEvent } from '@progress/kendo-angular-grid';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class DynamicGridComponent implements AfterViewInit {
|
|
7
|
+
private decimalPipe;
|
|
8
|
+
private datePipe;
|
|
9
|
+
data: any[];
|
|
10
|
+
columns: SkipColumnInfo[];
|
|
11
|
+
pageSize: number;
|
|
12
|
+
startingRow: number;
|
|
13
|
+
private _skipData;
|
|
14
|
+
get SkipData(): SkipData | undefined;
|
|
15
|
+
set SkipData(d: SkipData | undefined);
|
|
16
|
+
gridView: GridDataResult;
|
|
17
|
+
constructor(decimalPipe: DecimalPipe, datePipe: DatePipe);
|
|
18
|
+
formatData(dataType: string, data: any): any;
|
|
19
|
+
ngAfterViewInit(): void;
|
|
20
|
+
pageChange(event: PageChangeEvent): void;
|
|
21
|
+
private loadGridView;
|
|
22
|
+
cellClick(event: any): void;
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicGridComponent, never>;
|
|
24
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DynamicGridComponent, "app-dynamic-grid", never, { "data": { "alias": "data"; "required": false; }; "columns": { "alias": "columns"; "required": false; }; "pageSize": { "alias": "pageSize"; "required": false; }; "startingRow": { "alias": "startingRow"; "required": false; }; "SkipData": { "alias": "SkipData"; "required": false; }; }, {}, never, never, false, never>;
|
|
25
|
+
}
|