@memberjunction/ng-explorer-core 1.0.4 → 1.0.7-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/lib/app-view/application-view.component.js +3 -3
  2. package/dist/lib/auth-button/auth-button.component.js +2 -2
  3. package/dist/lib/dashboard-browser-component/dashboard-browser.component.js +3 -3
  4. package/dist/lib/data-browser-component/data-browser.component.js +3 -3
  5. package/dist/lib/expansion-panel-component/expansion-panel-component.js +3 -3
  6. package/dist/lib/favorites/favorites.component.js +3 -3
  7. package/dist/lib/files/files.component.js +3 -3
  8. package/dist/lib/generic/form-toolbar.js +10 -10
  9. package/dist/lib/generic/resource-container-component.js +1 -1
  10. package/dist/lib/generic/section-loader-component.js +1 -1
  11. package/dist/lib/generic-browse-list/generic-browse-list.component.js +3 -3
  12. package/dist/lib/generic-browser-list/generic-browser-list.component.js +4 -4
  13. package/dist/lib/header/header.component.js +3 -3
  14. package/dist/lib/home-component/home.component.js +3 -3
  15. package/dist/lib/join-grid/join-grid.component.js +2 -2
  16. package/dist/lib/navigation/navigation.component.js +3 -3
  17. package/dist/lib/query-browser-component/query-browser.component.js +3 -3
  18. package/dist/lib/report-browser-component/report-browser.component.js +3 -3
  19. package/dist/lib/resource-wrappers/dashboard-resource.component.js +1 -1
  20. package/dist/lib/resource-wrappers/query-resource.component.js +1 -1
  21. package/dist/lib/resource-wrappers/record-resource.component.js +1 -1
  22. package/dist/lib/resource-wrappers/report-resource.component.js +1 -1
  23. package/dist/lib/resource-wrappers/search-results-resource.component.js +1 -1
  24. package/dist/lib/resource-wrappers/view-resource.component.js +6 -6
  25. package/dist/lib/single-application/single-application.component.js +3 -3
  26. package/dist/lib/single-dashboard/Components/add-item/add-item.component.js +3 -3
  27. package/dist/lib/single-dashboard/Components/delete-item/delete-item.component.js +3 -3
  28. package/dist/lib/single-dashboard/Components/edit-dashboard/edit-dashboard.component.js +3 -3
  29. package/dist/lib/single-dashboard/single-dashboard.component.js +3 -3
  30. package/dist/lib/single-entity/single-entity.component.js +3 -3
  31. package/dist/lib/single-query/single-query.component.js +1 -1
  32. package/dist/lib/single-record/single-record.component.js +2 -2
  33. package/dist/lib/single-report/single-report.component.js +2 -2
  34. package/dist/lib/single-search-result/single-search-result.component.js +2 -2
  35. package/dist/lib/single-view/single-view.component.js +3 -3
  36. package/dist/lib/user-notifications/user-notifications.component.js +3 -3
  37. package/dist/lib/user-profile/user-profile.component.js +2 -2
  38. package/package.json +59 -59
  39. package/dist/lib/ask-skip/ask-skip.component.d.ts +0 -87
  40. package/dist/lib/ask-skip/ask-skip.component.js +0 -626
  41. package/dist/lib/ask-skip/skip-dynamic-report-wrapper.d.ts +0 -12
  42. package/dist/lib/ask-skip/skip-dynamic-report-wrapper.js +0 -50
  43. package/dist/lib/expansion-panel-component/components/expansion-panel-item-component.d.ts +0 -14
  44. package/dist/lib/expansion-panel-component/components/expansion-panel-item-component.d.ts.map +0 -1
  45. package/dist/lib/expansion-panel-component/components/expansion-panel-item-component.js +0 -33
  46. package/dist/lib/generic/base-form-component.d.ts +0 -77
  47. package/dist/lib/generic/base-form-component.d.ts.map +0 -1
  48. package/dist/lib/generic/base-form-component.js +0 -436
  49. package/dist/lib/generic/base-form-section-component.d.ts +0 -7
  50. package/dist/lib/generic/base-form-section-component.d.ts.map +0 -1
  51. package/dist/lib/generic/base-form-section-component.js +0 -9
  52. package/dist/lib/generic/base-record-component.d.ts +0 -7
  53. package/dist/lib/generic/base-record-component.d.ts.map +0 -1
  54. package/dist/lib/generic/base-record-component.js +0 -15
  55. package/dist/lib/generic/base-resource-component.d.ts +0 -34
  56. package/dist/lib/generic/base-resource-component.js +0 -75
  57. package/dist/lib/generic/dynamic-chart.d.ts +0 -33
  58. package/dist/lib/generic/dynamic-chart.js +0 -252
  59. package/dist/lib/generic/dynamic-grid.d.ts +0 -25
  60. package/dist/lib/generic/dynamic-grid.js +0 -142
  61. package/dist/lib/generic/dynamic-report.d.ts +0 -38
  62. package/dist/lib/generic/dynamic-report.js +0 -405
  63. package/dist/lib/generic-browser-list/components/resource/resource.d.ts +0 -1
  64. package/dist/lib/generic-browser-list/components/resource/resource.d.ts.map +0 -1
  65. package/dist/lib/generic-browser-list/components/resource/resource.js +0 -1
  66. package/dist/lib/settings/settings.component.d.ts +0 -8
  67. package/dist/lib/settings/settings.component.d.ts.map +0 -1
  68. package/dist/lib/settings/settings.component.js +0 -64
  69. package/dist/lib/user-view-properties/view-properties-dialog.component.d.ts +0 -72
  70. package/dist/lib/user-view-properties/view-properties-dialog.component.d.ts.map +0 -1
  71. package/dist/lib/user-view-properties/view-properties-dialog.component.js +0 -605
  72. package/dist/shared/shared.service.d.ts +0 -94
  73. package/dist/shared/shared.service.js +0 -324
  74. package/dist/shared/urlPipe.d.ts +0 -7
  75. package/dist/shared/urlPipe.js +0 -16
@@ -1,7 +0,0 @@
1
- import { BaseEntity, EntityFieldInfo } from "@memberjunction/core";
2
- export declare abstract class BaseRecordComponent {
3
- abstract record: BaseEntity;
4
- FormatField(entityFieldInfo: EntityFieldInfo, value: any, decimals?: number, currency?: string): string;
5
- FormatValue(fieldName: string, decimals?: number, currency?: string): string;
6
- }
7
- //# sourceMappingURL=base-record-component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base-record-component.d.ts","sourceRoot":"","sources":["../../../src/lib/generic/base-record-component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEnE,8BAAsB,mBAAmB;IACrC,SAAgB,MAAM,EAAE,UAAU,CAAA;IAE3B,WAAW,CAAC,eAAe,EAAE,eAAe,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,GAAE,MAAU,EAAE,QAAQ,GAAE,MAAc;IAIxG,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAU,EAAE,QAAQ,GAAE,MAAc;CAYvF"}
@@ -1,15 +0,0 @@
1
- export class BaseRecordComponent {
2
- FormatField(entityFieldInfo, value, decimals = 2, currency = 'USD') {
3
- return entityFieldInfo.FormatValue(value, decimals, currency);
4
- }
5
- FormatValue(fieldName, decimals = 2, currency = 'USD') {
6
- if (!this.record)
7
- throw new Error('this.record not set');
8
- const r = this.record;
9
- const f = r.Fields.find(f => f.Name.trim().toLowerCase() === fieldName.trim().toLowerCase() ||
10
- f.CodeName.trim().toLowerCase() === fieldName.trim().toLowerCase());
11
- if (!f)
12
- throw new Error(`Field ${fieldName} not found in entity ${r.EntityInfo.Name}`);
13
- return f.FormatValue(decimals, currency);
14
- }
15
- }
@@ -1,34 +0,0 @@
1
- import { BaseEntity } from "@memberjunction/core";
2
- export declare abstract class BaseResourceComponent {
3
- Data: ResourceData;
4
- private _loadComplete;
5
- get LoadComplete(): boolean;
6
- private _loadStarted;
7
- get LoadStarted(): boolean;
8
- private _loadCompleteEvent;
9
- get LoadCompleteEvent(): any;
10
- set LoadCompleteEvent(value: any);
11
- private _loadStartedEvent;
12
- get LoadStartedEvent(): any;
13
- set LoadStartedEvent(value: any);
14
- private _resourceRecordSavedEvent;
15
- get ResourceRecordSavedEvent(): any;
16
- set ResourceRecordSavedEvent(value: any);
17
- protected NotifyLoadComplete(): void;
18
- protected NotifyLoadStarted(): void;
19
- protected ResourceRecordSaved(resourceRecordEntity: BaseEntity): void;
20
- abstract GetResourceDisplayName(data: ResourceData): Promise<string>;
21
- }
22
- export declare class ResourceData {
23
- constructor(data?: any);
24
- ID: number;
25
- Name: string;
26
- ResourceTypeID: number;
27
- ResourceRecordID: any;
28
- Configuration: any;
29
- /**
30
- * Returns the name of the resource type based on the ResourceTypeID
31
- */
32
- get ResourceType(): string;
33
- get ResourceIcon(): string;
34
- }
@@ -1,75 +0,0 @@
1
- import { SharedService } from "../../shared/shared.service";
2
- export class BaseResourceComponent {
3
- constructor() {
4
- this.Data = new ResourceData();
5
- this._loadComplete = false;
6
- this._loadStarted = false;
7
- this._loadCompleteEvent = null;
8
- this._loadStartedEvent = null;
9
- this._resourceRecordSavedEvent = null;
10
- }
11
- get LoadComplete() {
12
- return this._loadComplete;
13
- }
14
- get LoadStarted() {
15
- return this._loadStarted;
16
- }
17
- get LoadCompleteEvent() {
18
- return this._loadCompleteEvent;
19
- }
20
- set LoadCompleteEvent(value) {
21
- this._loadCompleteEvent = value;
22
- }
23
- get LoadStartedEvent() {
24
- return this._loadStartedEvent;
25
- }
26
- set LoadStartedEvent(value) {
27
- this._loadStartedEvent = value;
28
- }
29
- get ResourceRecordSavedEvent() {
30
- return this._resourceRecordSavedEvent;
31
- }
32
- set ResourceRecordSavedEvent(value) {
33
- this._resourceRecordSavedEvent = value;
34
- }
35
- NotifyLoadComplete() {
36
- this._loadComplete = true;
37
- if (this._loadCompleteEvent) {
38
- this._loadCompleteEvent();
39
- }
40
- }
41
- NotifyLoadStarted() {
42
- this._loadStarted = true;
43
- if (this._loadStartedEvent) {
44
- this._loadStartedEvent();
45
- }
46
- }
47
- ResourceRecordSaved(resourceRecordEntity) {
48
- this.Data.ResourceRecordID = resourceRecordEntity.PrimaryKey.Value;
49
- if (this._resourceRecordSavedEvent) {
50
- this._resourceRecordSavedEvent(resourceRecordEntity);
51
- }
52
- }
53
- }
54
- export class ResourceData {
55
- constructor(data = null) {
56
- if (data) {
57
- this.ID = data.ID;
58
- this.Name = data.Name;
59
- this.ResourceTypeID = data.ResourceTypeID;
60
- this.ResourceRecordID = data.ResourceRecordID;
61
- this.Configuration = data.Configuration;
62
- }
63
- }
64
- /**
65
- * Returns the name of the resource type based on the ResourceTypeID
66
- */
67
- get ResourceType() {
68
- const rt = SharedService.Instance.ResourceTypes.find(rt => rt.ID === this.ResourceTypeID);
69
- return rt ? rt.Name : '';
70
- }
71
- get ResourceIcon() {
72
- const rt = SharedService.Instance.ResourceTypes.find(rt => rt.ID === this.ResourceTypeID);
73
- return rt ? rt.Icon : '';
74
- }
75
- }
@@ -1,33 +0,0 @@
1
- import { SeriesType, CategoryAxisTitle } from '@progress/kendo-angular-charts';
2
- import { SkipColumnInfo, SkipData } from '../ask-skip/ask-skip.component';
3
- import { SeriesClickEvent } from '@progress/kendo-angular-charts';
4
- import * as i0 from "@angular/core";
5
- export declare class DynamicChartComponent {
6
- private _data;
7
- get data(): any[];
8
- set data(value: any[]);
9
- chartTitle: string;
10
- chartType: string;
11
- xAxis: string | string[] | null;
12
- yAxis: string | string[] | null;
13
- xLabel: string;
14
- yLabel: string;
15
- columns: SkipColumnInfo[];
16
- private _skipData;
17
- get SkipData(): SkipData | undefined;
18
- set SkipData(d: SkipData | undefined);
19
- get kendoSeriesType(): SeriesType;
20
- private _axes;
21
- get chartCategoryAxes(): {
22
- categories: string[];
23
- title: CategoryAxisTitle;
24
- }[];
25
- protected convertAxisToArray(axis: string | string[] | null): string[];
26
- private _series;
27
- get chartSeries(): any[];
28
- private colors;
29
- getSeriesColor(item: any): string;
30
- onChartSeriesClick(e: SeriesClickEvent): void;
31
- static ɵfac: i0.ɵɵFactoryDeclaration<DynamicChartComponent, never>;
32
- static ɵcmp: i0.ɵɵComponentDeclaration<DynamicChartComponent, "app-dynamic-chart", never, { "data": { "alias": "data"; "required": false; }; "chartTitle": { "alias": "chartTitle"; "required": false; }; "chartType": { "alias": "chartType"; "required": false; }; "xAxis": { "alias": "xAxis"; "required": false; }; "yAxis": { "alias": "yAxis"; "required": false; }; "xLabel": { "alias": "xLabel"; "required": false; }; "yLabel": { "alias": "yLabel"; "required": false; }; "columns": { "alias": "columns"; "required": false; }; "SkipData": { "alias": "SkipData"; "required": false; }; }, {}, never, never, false, never>;
33
- }
@@ -1,252 +0,0 @@
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
- template: `
216
- <kendo-chart mjFillContainer
217
- (seriesClick)="onChartSeriesClick($event)"
218
- >
219
- <kendo-chart-title [text]="chartTitle"></kendo-chart-title>
220
- <kendo-chart-category-axis>
221
- <kendo-chart-category-axis-item *ngFor="let axis of chartCategoryAxes" [title]="axis.title" [categories]="axis.categories"></kendo-chart-category-axis-item>
222
- </kendo-chart-category-axis>
223
- <kendo-chart-series>
224
- <kendo-chart-series-item *ngFor="let item of chartSeries"
225
- [color]="getSeriesColor(item)"
226
- [type]="kendoSeriesType"
227
- [data]="item.data"
228
- [name]="item.name"></kendo-chart-series-item>
229
- </kendo-chart-series>
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
- }] }); })();
252
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(DynamicChartComponent, { className: "DynamicChartComponent", filePath: "src\\lib\\generic\\dynamic-chart.ts", lineNumber: 30 }); })();
@@ -1,25 +0,0 @@
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
- }
@@ -1,142 +0,0 @@
1
- import { Component, Input } from '@angular/core';
2
- import { DecimalPipe, DatePipe } from '@angular/common';
3
- import { LogStatus } from '@memberjunction/core';
4
- import * as i0 from "@angular/core";
5
- import * as i1 from "@angular/common";
6
- import * as i2 from "@progress/kendo-angular-grid";
7
- function DynamicGridComponent_ng_container_1_ng_template_2_Template(rf, ctx) { if (rf & 1) {
8
- i0.ɵɵtext(0);
9
- } if (rf & 2) {
10
- const dataItem_r3 = ctx.$implicit;
11
- const col_r1 = i0.ɵɵnextContext().$implicit;
12
- const ctx_r2 = i0.ɵɵnextContext();
13
- i0.ɵɵtextInterpolate1(" ", ctx_r2.formatData(col_r1.DataType, dataItem_r3[col_r1.FieldName]), " ");
14
- } }
15
- const _c0 = () => ({ "font-weight": "bold", "background-color": "#cyan" });
16
- function DynamicGridComponent_ng_container_1_Template(rf, ctx) { if (rf & 1) {
17
- i0.ɵɵelementContainerStart(0);
18
- i0.ɵɵelementStart(1, "kendo-grid-column", 2);
19
- i0.ɵɵtemplate(2, DynamicGridComponent_ng_container_1_ng_template_2_Template, 1, 1, "ng-template", 3);
20
- i0.ɵɵelementEnd();
21
- i0.ɵɵelementContainerEnd();
22
- } if (rf & 2) {
23
- const col_r1 = ctx.$implicit;
24
- i0.ɵɵadvance();
25
- i0.ɵɵpropertyInterpolate("field", col_r1.FieldName);
26
- i0.ɵɵpropertyInterpolate("title", col_r1.DisplayName);
27
- i0.ɵɵproperty("headerStyle", i0.ɵɵpureFunction0(3, _c0));
28
- } }
29
- export class DynamicGridComponent {
30
- get SkipData() {
31
- return this._skipData ? this._skipData : undefined;
32
- }
33
- set SkipData(d) {
34
- this._skipData = d;
35
- if (d) {
36
- this.data = d.SQLResults.results;
37
- this.columns = d.SQLResults.columns;
38
- this.loadGridView();
39
- }
40
- }
41
- constructor(decimalPipe, datePipe) {
42
- this.decimalPipe = decimalPipe;
43
- this.datePipe = datePipe;
44
- this.data = [];
45
- this.columns = [];
46
- this.pageSize = 30;
47
- this.startingRow = 0;
48
- }
49
- formatData(dataType, data) {
50
- switch (dataType) {
51
- case 'bigint':
52
- case 'smallint':
53
- case 'int':
54
- case 'tinyint':
55
- return data; // No specific formatting for integer types
56
- case 'decimal':
57
- case 'numeric':
58
- case 'smallmoney':
59
- case 'money':
60
- return this.decimalPipe.transform(data, '1.2-2'); // Format as decimal with 2 digits after the decimal point
61
- case 'date':
62
- case 'datetime':
63
- case 'datetime2':
64
- case 'smalldatetime':
65
- return this.datePipe.transform(data, 'short'); // Format as short date
66
- // Add more cases as needed for other SQL Server datatypes
67
- default:
68
- return data; // For data types not handled, return data as is
69
- }
70
- }
71
- ngAfterViewInit() {
72
- if (this.data) {
73
- this.loadGridView();
74
- }
75
- }
76
- pageChange(event) {
77
- this.startingRow = event.skip;
78
- this.loadGridView();
79
- }
80
- loadGridView() {
81
- this.gridView = {
82
- data: this.data.slice(this.startingRow, this.startingRow + this.pageSize),
83
- total: this.data.length,
84
- };
85
- }
86
- cellClick(event) {
87
- LogStatus(`Cell clicked in DynamicGrid`, undefined, event);
88
- LogStatus('Need to implement cellClick in DynamicGridComponent like DyanmicChartComponent to do drill down!');
89
- }
90
- }
91
- DynamicGridComponent.ɵfac = function DynamicGridComponent_Factory(t) { return new (t || DynamicGridComponent)(i0.ɵɵdirectiveInject(i1.DecimalPipe), i0.ɵɵdirectiveInject(i1.DatePipe)); };
92
- DynamicGridComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: DynamicGridComponent, selectors: [["app-dynamic-grid"]], inputs: { data: "data", columns: "columns", pageSize: "pageSize", startingRow: "startingRow", SkipData: "SkipData" }, features: [i0.ɵɵProvidersFeature([DecimalPipe, DatePipe])], decls: 2, vars: 8, consts: [["scrollable", "virtual", 3, "data", "skip", "pageSize", "rowHeight", "reorderable", "resizable", "navigable", "pageChange", "cellClick"], [4, "ngFor", "ngForOf"], [3, "field", "title", "headerStyle"], ["kendoGridCellTemplate", ""]], template: function DynamicGridComponent_Template(rf, ctx) { if (rf & 1) {
93
- i0.ɵɵelementStart(0, "kendo-grid", 0);
94
- i0.ɵɵlistener("pageChange", function DynamicGridComponent_Template_kendo_grid_pageChange_0_listener($event) { return ctx.pageChange($event); })("cellClick", function DynamicGridComponent_Template_kendo_grid_cellClick_0_listener($event) { return ctx.cellClick($event); });
95
- i0.ɵɵtemplate(1, DynamicGridComponent_ng_container_1_Template, 3, 4, "ng-container", 1);
96
- i0.ɵɵelementEnd();
97
- } if (rf & 2) {
98
- i0.ɵɵproperty("data", ctx.gridView)("skip", ctx.startingRow)("pageSize", ctx.pageSize)("rowHeight", 36)("reorderable", true)("resizable", true)("navigable", true);
99
- i0.ɵɵadvance();
100
- i0.ɵɵproperty("ngForOf", ctx.columns);
101
- } }, dependencies: [i1.NgForOf, i2.GridComponent, i2.ColumnComponent, i2.CellTemplateDirective], encapsulation: 2 });
102
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DynamicGridComponent, [{
103
- type: Component,
104
- args: [{
105
- selector: 'app-dynamic-grid',
106
- template: `
107
- <kendo-grid [data]="gridView"
108
- [skip]="startingRow"
109
- [pageSize]="pageSize"
110
- scrollable="virtual"
111
- [rowHeight]="36"
112
- [reorderable]="true"
113
- [resizable]="true"
114
- (pageChange)="pageChange($event)"
115
- (cellClick)="cellClick($event)"
116
- [navigable]="true">
117
- <ng-container *ngFor="let col of columns">
118
- <kendo-grid-column
119
- field="{{col.FieldName}}"
120
- title="{{col.DisplayName}}"
121
- [headerStyle]="{ 'font-weight' : 'bold', 'background-color': '#cyan' }">
122
- <ng-template kendoGridCellTemplate let-dataItem>
123
- {{ formatData(col.DataType, dataItem[col.FieldName]) }}
124
- </ng-template>
125
- </kendo-grid-column>
126
- </ng-container>
127
- </kendo-grid>
128
- `,
129
- providers: [DecimalPipe, DatePipe]
130
- }]
131
- }], () => [{ type: i1.DecimalPipe }, { type: i1.DatePipe }], { data: [{
132
- type: Input
133
- }], columns: [{
134
- type: Input
135
- }], pageSize: [{
136
- type: Input
137
- }], startingRow: [{
138
- type: Input
139
- }], SkipData: [{
140
- type: Input
141
- }] }); })();
142
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(DynamicGridComponent, { className: "DynamicGridComponent", filePath: "src\\lib\\generic\\dynamic-grid.ts", lineNumber: 34 }); })();
@@ -1,38 +0,0 @@
1
- import { Router } from '@angular/router';
2
- import { SkipColumnInfo, SkipData } from '../ask-skip/ask-skip.component';
3
- import { SharedService } from '../../shared/shared.service';
4
- import { DynamicGridComponent } from './dynamic-grid';
5
- import { DynamicChartComponent } from './dynamic-chart';
6
- import { SelectEvent, TabStripComponent } from '@progress/kendo-angular-layout';
7
- import * as i0 from "@angular/core";
8
- export declare class DynamicReportComponent {
9
- sharedService: SharedService;
10
- private router;
11
- ShowDetailsTab: boolean;
12
- ShowCreateReportButton: boolean;
13
- ConversationID: number | null;
14
- ConversationName: string | null;
15
- ConversationDetailID: number | null;
16
- private _skipData;
17
- get SkipData(): SkipData | undefined;
18
- set SkipData(d: SkipData | undefined);
19
- theGrid: DynamicGridComponent;
20
- theChart: DynamicChartComponent;
21
- tabStrip: TabStripComponent;
22
- constructor(sharedService: SharedService, router: Router);
23
- matchingReportID: number | null;
24
- matchingReportName: string | null;
25
- private _loaded;
26
- ngAfterViewInit(): Promise<void>;
27
- clickMatchingReport(): void;
28
- activeTabIndex: number;
29
- onTabSelect(e: SelectEvent): void;
30
- isTabSelected(index: number): boolean;
31
- get Columns(): SkipColumnInfo[];
32
- get IsChart(): boolean;
33
- get IsTable(): boolean;
34
- createAnalysisHtml(): string;
35
- doCreateReport(): Promise<void>;
36
- static ɵfac: i0.ɵɵFactoryDeclaration<DynamicReportComponent, never>;
37
- static ɵcmp: i0.ɵɵComponentDeclaration<DynamicReportComponent, "app-dynamic-report", never, { "ShowDetailsTab": { "alias": "ShowDetailsTab"; "required": false; }; "ShowCreateReportButton": { "alias": "ShowCreateReportButton"; "required": false; }; "ConversationID": { "alias": "ConversationID"; "required": false; }; "ConversationName": { "alias": "ConversationName"; "required": false; }; "ConversationDetailID": { "alias": "ConversationDetailID"; "required": false; }; "SkipData": { "alias": "SkipData"; "required": false; }; }, {}, never, never, false, never>;
38
- }