@memberjunction/ng-explorer-core 1.3.3 → 1.4.1

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 (48) hide show
  1. package/dist/app-routing.module.d.ts +8 -2
  2. package/dist/app-routing.module.d.ts.map +1 -1
  3. package/dist/app-routing.module.js +29 -6
  4. package/dist/lib/app-view/application-view.component.d.ts.map +1 -1
  5. package/dist/lib/app-view/application-view.component.js +34 -24
  6. package/dist/lib/base-browser-component/base-browser-component.d.ts +3 -2
  7. package/dist/lib/base-browser-component/base-browser-component.d.ts.map +1 -1
  8. package/dist/lib/base-browser-component/base-browser-component.js +5 -4
  9. package/dist/lib/generic/resource-container-component.d.ts.map +1 -1
  10. package/dist/lib/generic-browser-list/generic-browser-list.component.d.ts +4 -0
  11. package/dist/lib/generic-browser-list/generic-browser-list.component.d.ts.map +1 -1
  12. package/dist/lib/generic-browser-list/generic-browser-list.component.js +104 -74
  13. package/dist/lib/header/header.component.d.ts +1 -1
  14. package/dist/lib/header/header.component.js +2 -2
  15. package/dist/lib/home-component/home.component.js +11 -5
  16. package/dist/lib/list-view/list-view.component.d.ts +36 -0
  17. package/dist/lib/list-view/list-view.component.d.ts.map +1 -0
  18. package/dist/lib/list-view/list-view.component.js +189 -0
  19. package/dist/lib/navigation/navigation.component.d.ts +32 -6
  20. package/dist/lib/navigation/navigation.component.d.ts.map +1 -1
  21. package/dist/lib/navigation/navigation.component.js +123 -46
  22. package/dist/lib/resource-wrappers/record-resource.component.d.ts +2 -2
  23. package/dist/lib/resource-wrappers/record-resource.component.d.ts.map +1 -1
  24. package/dist/lib/resource-wrappers/record-resource.component.js +15 -11
  25. package/dist/lib/single-list-detail/single-list-detail.component.d.ts +26 -0
  26. package/dist/lib/single-list-detail/single-list-detail.component.d.ts.map +1 -0
  27. package/dist/lib/single-list-detail/single-list-detail.component.js +213 -0
  28. package/dist/lib/single-record/single-record.component.d.ts +7 -4
  29. package/dist/lib/single-record/single-record.component.d.ts.map +1 -1
  30. package/dist/lib/single-record/single-record.component.js +83 -29
  31. package/dist/lib/single-view/single-view.component.d.ts +2 -0
  32. package/dist/lib/single-view/single-view.component.d.ts.map +1 -1
  33. package/dist/lib/single-view/single-view.component.js +27 -26
  34. package/dist/lib/user-notifications/user-notifications.component.d.ts.map +1 -1
  35. package/dist/lib/user-notifications/user-notifications.component.js +2 -1
  36. package/dist/module.d.ts +38 -37
  37. package/dist/module.d.ts.map +1 -1
  38. package/dist/module.js +18 -14
  39. package/dist/public-api.d.ts +2 -2
  40. package/dist/public-api.d.ts.map +1 -1
  41. package/dist/public-api.js +2 -2
  42. package/package.json +17 -16
  43. package/dist/lib/generic/section-loader-component.d.ts +0 -18
  44. package/dist/lib/generic/section-loader-component.d.ts.map +0 -1
  45. package/dist/lib/generic/section-loader-component.js +0 -66
  46. package/dist/lib/join-grid/join-grid.component.d.ts +0 -31
  47. package/dist/lib/join-grid/join-grid.component.d.ts.map +0 -1
  48. package/dist/lib/join-grid/join-grid.component.js +0 -222
@@ -1,222 +0,0 @@
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, Input } from '@angular/core';
11
- import { RunView } from '@memberjunction/core';
12
- import { debounceTime, fromEvent } from 'rxjs';
13
- import * as i0 from "@angular/core";
14
- import * as i1 from "@angular/common";
15
- import * as i2 from "@progress/kendo-angular-grid";
16
- import * as i3 from "@progress/kendo-angular-buttons";
17
- function JoinGridComponent_div_0_Template(rf, ctx) { if (rf & 1) {
18
- i0.ɵɵelementStart(0, "div", 2);
19
- i0.ɵɵtext(1);
20
- i0.ɵɵelementEnd();
21
- } if (rf & 2) {
22
- const ctx_r0 = i0.ɵɵnextContext();
23
- i0.ɵɵadvance();
24
- i0.ɵɵtextInterpolate1(" ", ctx_r0.ErrorMessage, "\n");
25
- } }
26
- function JoinGridComponent_div_1_3_ng_template_0_Template(rf, ctx) { if (rf & 1) {
27
- i0.ɵɵelementStart(0, "button", 9);
28
- i0.ɵɵtext(1, "Save");
29
- i0.ɵɵelementEnd();
30
- } }
31
- function JoinGridComponent_div_1_3_Template(rf, ctx) { if (rf & 1) {
32
- i0.ɵɵtemplate(0, JoinGridComponent_div_1_3_ng_template_0_Template, 2, 0, "ng-template", 8);
33
- } }
34
- function JoinGridComponent_div_1_kendo_grid_column_4_1_ng_template_0_Template(rf, ctx) { if (rf & 1) {
35
- i0.ɵɵtext(0);
36
- } if (rf & 2) {
37
- const dataItem_r12 = ctx.$implicit;
38
- const item_r6 = i0.ɵɵnextContext(2).$implicit;
39
- i0.ɵɵtextInterpolate1(" ", dataItem_r12[item_r6.field], " ");
40
- } }
41
- function JoinGridComponent_div_1_kendo_grid_column_4_1_Template(rf, ctx) { if (rf & 1) {
42
- i0.ɵɵtemplate(0, JoinGridComponent_div_1_kendo_grid_column_4_1_ng_template_0_Template, 1, 1, "ng-template", 11);
43
- } }
44
- function JoinGridComponent_div_1_kendo_grid_column_4_ng_template_2_Template(rf, ctx) { if (rf & 1) {
45
- i0.ɵɵelement(0, "input", 12);
46
- } if (rf & 2) {
47
- const dataItem_r14 = ctx.$implicit;
48
- const item_r6 = i0.ɵɵnextContext().$implicit;
49
- const ctx_r9 = i0.ɵɵnextContext(2);
50
- i0.ɵɵproperty("checked", dataItem_r14[item_r6.field])("disabled", !ctx_r9.EditMode);
51
- } }
52
- function JoinGridComponent_div_1_kendo_grid_column_4_3_ng_template_0_Template(rf, ctx) { if (rf & 1) {
53
- i0.ɵɵtext(0);
54
- } if (rf & 2) {
55
- const ctx_r16 = i0.ɵɵnextContext(4);
56
- i0.ɵɵtextInterpolate1(" ", ctx_r16.viewData.length, " records ");
57
- } }
58
- function JoinGridComponent_div_1_kendo_grid_column_4_3_Template(rf, ctx) { if (rf & 1) {
59
- i0.ɵɵtemplate(0, JoinGridComponent_div_1_kendo_grid_column_4_3_ng_template_0_Template, 1, 1, "ng-template", 13);
60
- } }
61
- const _c0 = () => ({ "font-weight": "bold", "background-color": "#a9c2af" });
62
- function JoinGridComponent_div_1_kendo_grid_column_4_Template(rf, ctx) { if (rf & 1) {
63
- i0.ɵɵelementStart(0, "kendo-grid-column", 10);
64
- i0.ɵɵtemplate(1, JoinGridComponent_div_1_kendo_grid_column_4_1_Template, 1, 0, null, 6)(2, JoinGridComponent_div_1_kendo_grid_column_4_ng_template_2_Template, 1, 2, "ng-template", 11)(3, JoinGridComponent_div_1_kendo_grid_column_4_3_Template, 1, 0, null, 6);
65
- i0.ɵɵelementEnd();
66
- } if (rf & 2) {
67
- const item_r6 = ctx.$implicit;
68
- const i_r7 = ctx.index;
69
- i0.ɵɵpropertyInterpolate("field", item_r6.field);
70
- i0.ɵɵpropertyInterpolate("title", item_r6.title);
71
- i0.ɵɵproperty("width", item_r6.width)("headerStyle", i0.ɵɵpureFunction0(6, _c0));
72
- i0.ɵɵadvance();
73
- i0.ɵɵproperty("ngIf", i_r7 === 0);
74
- i0.ɵɵadvance(2);
75
- i0.ɵɵproperty("ngIf", i_r7 === 0);
76
- } }
77
- function JoinGridComponent_div_1_Template(rf, ctx) { if (rf & 1) {
78
- i0.ɵɵelementStart(0, "div", 3)(1, "kendo-grid", 4, 5);
79
- i0.ɵɵtemplate(3, JoinGridComponent_div_1_3_Template, 1, 0, null, 6)(4, JoinGridComponent_div_1_kendo_grid_column_4_Template, 4, 7, "kendo-grid-column", 7);
80
- i0.ɵɵelementEnd()();
81
- } if (rf & 2) {
82
- const ctx_r1 = i0.ɵɵnextContext();
83
- i0.ɵɵadvance();
84
- i0.ɵɵproperty("resizable", true)("data", ctx_r1.viewData)("rowHeight", 36)("loading", ctx_r1.showloader)("height", ctx_r1.gridHeight)("sortable", true)("resizable", true)("reorderable", true)("selectable", true);
85
- i0.ɵɵadvance(2);
86
- i0.ɵɵproperty("ngIf", ctx_r1.EditMode);
87
- i0.ɵɵadvance();
88
- i0.ɵɵproperty("ngForOf", ctx_r1.visibleColumns);
89
- } }
90
- export class JoinGridComponent {
91
- constructor() {
92
- this.RowsEntity = '';
93
- this.ColumnsEntity = '';
94
- this.JoinEntity = '';
95
- this.JoinRowForeignKey = '';
96
- this.JoinColumunForeignKey = '';
97
- this.RowsFilter = '';
98
- this.ColumnsFilter = '';
99
- this.EditMode = false;
100
- this.showloader = false;
101
- this.viewData = [];
102
- this.visibleColumns = [];
103
- this.ShowError = false;
104
- this.ErrorMessage = '';
105
- this.gridHeight = 750;
106
- this.resizeSub = null;
107
- this._gridMargin = 150;
108
- }
109
- ngOnInit() {
110
- if (!this.RowsEntity || !this.ColumnsEntity || !this.JoinEntity || !this.JoinRowForeignKey || !this.JoinColumunForeignKey) {
111
- this.ShowError = true;
112
- this.ErrorMessage = 'Missing required parameters';
113
- }
114
- else {
115
- this.LoadData();
116
- }
117
- }
118
- ngAfterViewInit() {
119
- this.setGridHeight();
120
- }
121
- LoadData() {
122
- return __awaiter(this, void 0, void 0, function* () {
123
- const rv = new RunView();
124
- this.showloader = true;
125
- const promises = [];
126
- promises.push(rv.RunView({ EntityName: this.RowsEntity, ExtraFilter: this.RowsFilter }));
127
- promises.push(rv.RunView({ EntityName: this.ColumnsEntity, ExtraFilter: this.ColumnsFilter }));
128
- const responses = yield Promise.all(promises);
129
- if (responses[0].Success && responses[1].Success) {
130
- this.getJoinData(responses[0].Results, responses[1].Results);
131
- }
132
- else {
133
- this.ShowError = true;
134
- this.ErrorMessage = responses[0].ErrorMessage || responses[1].ErrorMessage;
135
- }
136
- });
137
- }
138
- getJoinData(rows, columns) {
139
- return __awaiter(this, void 0, void 0, function* () {
140
- const rv = new RunView();
141
- // getting the relations between rows and columns
142
- const res = yield rv.RunView({ EntityName: this.JoinEntity, ExtraFilter: `${this.JoinRowForeignKey} IN (${rows.map(obj => obj.ID).join(',')}) AND ${this.JoinColumunForeignKey} IN (${columns.map(obj => obj.ID).join(',')})` });
143
- if (res.Success) {
144
- this.prepareGridData(rows, columns, res.Results);
145
- }
146
- else {
147
- this.showloader = false;
148
- this.ShowError = true;
149
- this.ErrorMessage = res.ErrorMessage;
150
- }
151
- });
152
- }
153
- prepareGridData(rows, columns, joinEntities) {
154
- const gridData = [];
155
- this.visibleColumns = [{ field: 'first', title: '', width: 80 }];
156
- columns.forEach(column => {
157
- this.visibleColumns.push({ field: column.Name, title: column.Name, width: 80 });
158
- });
159
- rows.forEach(row => {
160
- let rowData = {
161
- first: row.Name
162
- };
163
- columns.forEach(column => {
164
- const join = joinEntities.find(j => j[this.JoinColumunForeignKey] === column.ID && j[this.JoinRowForeignKey] === row.ID);
165
- if (join) {
166
- rowData = Object.assign(Object.assign({}, rowData), { [column.Name]: true, [this.JoinColumunForeignKey]: join[this.JoinColumunForeignKey], [this.JoinRowForeignKey]: join[this.JoinRowForeignKey], [this.JoinEntity]: join[this.JoinEntity] });
167
- }
168
- else {
169
- rowData[column.Name] = false;
170
- }
171
- });
172
- gridData.push(rowData);
173
- });
174
- this.showloader = false;
175
- this.viewData = gridData;
176
- }
177
- setGridHeight() {
178
- // Subscribe to the window resize event
179
- this.resizeSub = fromEvent(window, 'resize').pipe(debounceTime(100) // Debounce the resize event to avoid frequent updates
180
- ).subscribe(() => {
181
- // Update the grid height when the window is resized
182
- this.ResizeGrid();
183
- });
184
- // Set the initial grid height with a slight delay to allow stuff to get set
185
- setTimeout(() => {
186
- this.ResizeGrid();
187
- }, 100);
188
- }
189
- ResizeGrid() {
190
- // this._gridMargin = this.getGridTopPosition();
191
- this.gridHeight = window.innerHeight - this._gridMargin;
192
- }
193
- }
194
- JoinGridComponent.ɵfac = function JoinGridComponent_Factory(t) { return new (t || JoinGridComponent)(); };
195
- JoinGridComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: JoinGridComponent, selectors: [["app-join-grid"]], inputs: { RowsEntity: "RowsEntity", ColumnsEntity: "ColumnsEntity", JoinEntity: "JoinEntity", JoinRowForeignKey: "JoinRowForeignKey", JoinColumunForeignKey: "JoinColumunForeignKey", RowsFilter: "RowsFilter", ColumnsFilter: "ColumnsFilter", EditMode: "EditMode" }, decls: 2, vars: 2, consts: [["class", "card-container", 4, "ngIf"], ["class", "user-view-grid-wrap", 4, "ngIf"], [1, "card-container"], [1, "user-view-grid-wrap"], ["scrollable", "virtual", 3, "resizable", "data", "rowHeight", "loading", "height", "sortable", "reorderable", "selectable"], ["kendoGrid", ""], [4, "ngIf"], [3, "field", "title", "width", "headerStyle", 4, "ngFor", "ngForOf"], ["kendoGridToolbarTemplate", ""], ["kendoButton", ""], [3, "field", "title", "width", "headerStyle"], ["kendoGridCellTemplate", ""], ["type", "checkbox", 3, "checked", "disabled"], ["kendoGridFooterTemplate", ""]], template: function JoinGridComponent_Template(rf, ctx) { if (rf & 1) {
196
- i0.ɵɵtemplate(0, JoinGridComponent_div_0_Template, 2, 1, "div", 0)(1, JoinGridComponent_div_1_Template, 5, 11, "div", 1);
197
- } if (rf & 2) {
198
- i0.ɵɵproperty("ngIf", ctx.ShowError);
199
- i0.ɵɵadvance();
200
- i0.ɵɵproperty("ngIf", !ctx.ShowError);
201
- } }, dependencies: [i1.NgForOf, i1.NgIf, i2.GridComponent, i2.ToolbarTemplateDirective, i2.ColumnComponent, i2.FooterTemplateDirective, i2.CellTemplateDirective, i3.ButtonComponent] });
202
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(JoinGridComponent, [{
203
- type: Component,
204
- args: [{ selector: 'app-join-grid', template: "<div class=\"card-container\" *ngIf=\"ShowError\">\n {{ErrorMessage}}\n</div>\n<div class=\"user-view-grid-wrap\" *ngIf=\"!ShowError\">\n <kendo-grid \n #kendoGrid \n [resizable]=\"true\" \n [data]=\"viewData\" \n scrollable=\"virtual\" \n [rowHeight]=\"36\"\n [loading]=\"showloader\"\n [height]=\"gridHeight\"\n [sortable]=\"true\"\n [resizable]=\"true\"\n [reorderable]=\"true\"\n [selectable]=\"true\">\n\n <ng-template kendoGridToolbarTemplate *ngIf=\"EditMode\">\n <button kendoButton>Save</button>\n </ng-template>\n\n <kendo-grid-column *ngFor=\"let item of visibleColumns; let i = index\" field=\"{{item.field}}\"\n title=\"{{item.title}}\" [width]=\"item.width\"\n [headerStyle]=\"{ 'font-weight' : 'bold', 'background-color': '#a9c2af' }\">\n <ng-template *ngIf=\"i === 0\" kendoGridCellTemplate let-dataItem>\n {{dataItem[item.field]}}\n </ng-template>\n <ng-template kendoGridCellTemplate let-dataItem>\n <input type=\"checkbox\" [checked]=\"dataItem[item.field]\" [disabled]=\"!EditMode\" />\n </ng-template>\n <ng-template *ngIf=\"i === 0\" kendoGridFooterTemplate>\n {{this.viewData.length}} records\n </ng-template>\n </kendo-grid-column>\n\n </kendo-grid>\n</div>" }]
205
- }], () => [], { RowsEntity: [{
206
- type: Input
207
- }], ColumnsEntity: [{
208
- type: Input
209
- }], JoinEntity: [{
210
- type: Input
211
- }], JoinRowForeignKey: [{
212
- type: Input
213
- }], JoinColumunForeignKey: [{
214
- type: Input
215
- }], RowsFilter: [{
216
- type: Input
217
- }], ColumnsFilter: [{
218
- type: Input
219
- }], EditMode: [{
220
- type: Input
221
- }] }); })();
222
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(JoinGridComponent, { className: "JoinGridComponent", filePath: "src/lib/join-grid/join-grid.component.ts", lineNumber: 10 }); })();