@memberjunction/ng-explorer-core 2.0.0 → 2.1.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 (52) hide show
  1. package/dist/generic/Events.types.d.ts +13 -0
  2. package/dist/generic/Events.types.d.ts.map +1 -1
  3. package/dist/generic/Events.types.js +6 -0
  4. package/dist/lib/app-view/application-view.component.d.ts +3 -0
  5. package/dist/lib/app-view/application-view.component.d.ts.map +1 -1
  6. package/dist/lib/app-view/application-view.component.js +8 -5
  7. package/dist/lib/auth-button/auth-button.component.js +1 -1
  8. package/dist/lib/dashboard-browser-component/dashboard-browser.component.d.ts +3 -0
  9. package/dist/lib/dashboard-browser-component/dashboard-browser.component.d.ts.map +1 -1
  10. package/dist/lib/dashboard-browser-component/dashboard-browser.component.js +7 -4
  11. package/dist/lib/data-browser-component/data-browser.component.js +1 -1
  12. package/dist/lib/expansion-panel-component/expansion-panel-component.js +1 -1
  13. package/dist/lib/favorites/favorites.component.js +1 -1
  14. package/dist/lib/files/files.component.js +1 -1
  15. package/dist/lib/generic/form-toolbar.js +1 -1
  16. package/dist/lib/generic/resource-container-component.js +1 -1
  17. package/dist/lib/generic-browse-list/generic-browse-list.component.js +1 -1
  18. package/dist/lib/generic-browser-list/generic-browser-list.component.d.ts +8 -4
  19. package/dist/lib/generic-browser-list/generic-browser-list.component.d.ts.map +1 -1
  20. package/dist/lib/generic-browser-list/generic-browser-list.component.js +21 -21
  21. package/dist/lib/header/header.component.d.ts.map +1 -1
  22. package/dist/lib/header/header.component.js +4 -14
  23. package/dist/lib/home-component/home.component.js +1 -1
  24. package/dist/lib/list-view/list-view.component.js +1 -1
  25. package/dist/lib/navigation/navigation.component.d.ts.map +1 -1
  26. package/dist/lib/navigation/navigation.component.js +15 -13
  27. package/dist/lib/query-browser-component/query-browser.component.js +1 -1
  28. package/dist/lib/report-browser-component/report-browser.component.js +1 -1
  29. package/dist/lib/resource-wrappers/dashboard-resource.component.js +1 -1
  30. package/dist/lib/resource-wrappers/query-resource.component.js +1 -1
  31. package/dist/lib/resource-wrappers/record-resource.component.js +1 -1
  32. package/dist/lib/resource-wrappers/report-resource.component.js +1 -1
  33. package/dist/lib/resource-wrappers/search-results-resource.component.js +1 -1
  34. package/dist/lib/resource-wrappers/view-resource.component.js +1 -1
  35. package/dist/lib/single-application/single-application.component.js +1 -1
  36. package/dist/lib/single-dashboard/Components/add-item/add-item.component.js +1 -1
  37. package/dist/lib/single-dashboard/Components/delete-item/delete-item.component.js +1 -1
  38. package/dist/lib/single-dashboard/Components/edit-dashboard/edit-dashboard.component.js +1 -1
  39. package/dist/lib/single-dashboard/single-dashboard.component.js +2 -2
  40. package/dist/lib/single-entity/single-entity.component.js +1 -1
  41. package/dist/lib/single-list-detail/single-list-detail.component.js +1 -1
  42. package/dist/lib/single-query/single-query.component.js +1 -1
  43. package/dist/lib/single-record/single-record.component.js +1 -1
  44. package/dist/lib/single-report/single-report.component.js +1 -1
  45. package/dist/lib/single-search-result/single-search-result.component.js +2 -2
  46. package/dist/lib/single-view/single-view.component.js +1 -1
  47. package/dist/lib/user-notifications/user-notifications.component.js +2 -2
  48. package/dist/lib/user-profile/user-profile.component.js +1 -1
  49. package/package.json +18 -18
  50. package/dist/lib/join-grid/join-grid.component.d.ts +0 -31
  51. package/dist/lib/join-grid/join-grid.component.d.ts.map +0 -1
  52. package/dist/lib/join-grid/join-grid.component.js +0 -222
@@ -322,4 +322,4 @@ SingleListDetailComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: S
322
322
  type: Component,
323
323
  args: [{ selector: 'mj-list-detail', template: "<div class=\"app-container\">\n <div class=\"flex-display-row-header\">\n <h1>{{listName}}</h1>\n <button kendobutton class=\"add-btn\" (click)=\"toggleAddDialog(true)\" themeColor=\"info\">\n <span class=\"fa-solid fa-plus\"></span>\n Add More Records\n </button>\n </div>\n <div>\n <div class=\"title-wrapper\">\n <div class=\"search\">\n <kendo-textbox \n type=\"text\" \n #searchInput \n placeholder=\"Search in List\" \n (keyup)=\"onKeyup(searchInput.value)\"\n [clearButton]=\"true\"\n size=\"large\"\n rounded=\"large\"\n fillMode=\"solid\"\n >\n <ng-template kendoTextBoxPrefixTemplate [showSeparator]=\"true\">\n <span class=\"fa-solid fa-magnifying-glass margin-left-small\"></span>\n </ng-template>\n </kendo-textbox>\n </div>\n </div>\n </div>\n @if(showLoader){\n <kendo-loader type=\"converging-spinner\"></kendo-loader>\n }\n @else{\n <kendo-grid [data]=\"filteredGridData\"></kendo-grid>\n }\n</div>\n\n<kendo-dialog\nclass=\"dialog-wrapper\"\ntitle=\"Select Views to Add\"\n*ngIf=\"showAddDialog\"\n(close)=\"toggleAddDialog(false)\"\n[minWidth]=\"250\"\n[width]=\"650\"\n[height]=\"550\"\n>\n<div class=\"search-header\">\n <kendo-textbox\n id=\"listSearch\"\n placeholder=\"Search Views...\"\n kendoTextBox\n [clearButton]=\"true\"\n class=\"search-bar\"\n></kendo-textbox>\n<!--\n<button kendoButton class=\"btn-no-border btn-outline\">\n <span class=\"fa-solid fa-plus\"></span>\n New View\n</button>\n-->\n</div>\n<hr>\n<div class=\"overflow-y-scroll\">\n @if(showAddLoader){\n <kendo-loader type=\"converging-spinner\"></kendo-loader>\n }\n @else {\n @for(userView of userViews; track userView){\n <div class=\"list-item\">\n <div class=\"list-text\" [ngClass]=\"{'list-selected': userViewsToAdd.includes(userView)}\">\n {{userView.Name}}\n </div>\n @if(userViewsToAdd.includes(userView)){\n <button kendoButton class=\"btn-no-border btn-selected\" (click)=\"removeViewFromSelectedList(userView)\">\n <span class=\"fa-solid fa-minus\"></span>\n Remove\n </button>\n }\n @else {\n <button kendoButton class=\"btn-no-border\" (click)=\"addViewToSelectedList(userView)\">\n <div class=\"btn-margin-right\">\n <span class=\"fa-solid fa-plus\"></span>\n Add\n </div>\n </button>\n }\n </div>\n <hr>\n }\n }\n</div>\n<kendo-dialog-actions class=\"popup-actions-btn\">\n <button class=\"cancel-btn\" (click)=\"addTolist()\" [disabled]=\"showAddLoader\" kendoButton themeColor=\"info\">\n Done\n </button>\n <button class=\"yes-btn\" (click)=\"toggleAddDialog(false)\" [disabled]=\"showAddLoader\" kendoButton fillMode=\"outline\" themeColor=\"info\">\n Cancel\n </button>\n</kendo-dialog-actions>\n</kendo-dialog>", styles: [".app-container {\n padding: 20px;\n}\n\n.flex-display-row-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding-bottom: 10px;\n}\n\n.title-wrapper {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 14px 0;\n border-bottom: 1px solid var(--med-gray);\n}\n\n.title-wrapper h4 {\n margin: 0;\n font-size: 24px;\n line-height: 28px;\n}\n\n.title-wrapper .search input {\n width: 100%;\n height: 100%;\n font-size: 16px;\n background: transparent;\n border: none;\n box-sizing: border-box;\n padding-left: 40px;\n}\n\n .title-wrapper .search {\n background: var(--light-shade);\n width: 360px;\n height: 44px;\n position: relative;\n border-radius: 10px;\n}\n\n.title-wrapper .search svg {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n left: 12px;\n}\n\n.add-btn {\n padding: 10px 30px;\n border-radius: 10px;\n color: white;\n background-color: var(--border-blue);\n font-size: initial;\n cursor: pointer;\n}\n\n.add-btn:hover {\n filter: brightness(85%);\n}\n\n.margin-left-small {\n margin-left: 10px;\n}\n\n\n.overflow-y-scroll {\n overflow-y: auto;\n max-height: 300px;\n}\n\n.padding-bottom-small {\n padding-bottom: 10px;\n}\n\n.list-item {\n display: flex;\n justify-content: space-between;\n padding-bottom: 5px;\n align-items: center;\n}\n\n.btn-no-border {\n border: none;\n background: none;\n color: var(--border-blue);\n font-size: 16px;\n font-weight: 500;\n cursor: pointer;\n}\n\n.btn-selected {\n font-weight: bold;\n}\n\n.list-text {\n font-size: large;\n}\n.list-selected {\n font-weight: bold;\n color: var(--border-blue);\n}\n\n.btn-margin-right {\n margin-right: 35px;\n}\n\n.divider {\n color: lightgray\n}\n\n.search-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 10px 0;\n}\n\n.search-bar {\n width: 65%;\n padding-bottom: 10px;\n}\n\n.dialog-wrapper {\n padding: 15px 25px;\n}\n\n.btn-outline {\n border: 2px solid var(--border-blue);\n border-radius: 8px;\n padding: 5px 30px;\n\n background: none;\n color: var(--border-blue);\n font-size: 16px;\n font-weight: 500;\n cursor: pointer;\n}"] }]
324
324
  }], () => [{ type: i1.Router }, { type: i1.ActivatedRoute }, { type: i2.SharedService }], null); })();
325
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SingleListDetailComponent, { className: "SingleListDetailComponent" }); })();
325
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SingleListDetailComponent, { className: "SingleListDetailComponent", filePath: "src/lib/single-list-detail/single-list-detail.component.ts", lineNumber: 13 }); })();
@@ -67,4 +67,4 @@ SingleQueryComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: Single
67
67
  type: ViewChild,
68
68
  args: ['theQuery', { static: true }]
69
69
  }] }); })();
70
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SingleQueryComponent, { className: "SingleQueryComponent" }); })();
70
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SingleQueryComponent, { className: "SingleQueryComponent", filePath: "src/lib/single-query/single-query.component.ts", lineNumber: 11 }); })();
@@ -146,4 +146,4 @@ SingleRecordComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: Singl
146
146
  }], recordSaved: [{
147
147
  type: Output
148
148
  }] }); })();
149
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SingleRecordComponent, { className: "SingleRecordComponent" }); })();
149
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SingleRecordComponent, { className: "SingleRecordComponent", filePath: "src/lib/single-record/single-record.component.ts", lineNumber: 14 }); })();
@@ -83,4 +83,4 @@ SingleReportComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: Singl
83
83
  type: ViewChild,
84
84
  args: ['theReport', { static: true }]
85
85
  }] }); })();
86
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SingleReportComponent, { className: "SingleReportComponent" }); })();
86
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SingleReportComponent, { className: "SingleReportComponent", filePath: "src/lib/single-report/single-report.component.ts", lineNumber: 11 }); })();
@@ -21,7 +21,7 @@ export class SingleSearchResultComponent {
21
21
  get params() {
22
22
  const p = {
23
23
  EntityName: this.entity,
24
- ExtraFilter: "ID > 0", // temporary hack as ExtraFilter is required for dynamic views
24
+ ExtraFilter: "ID IS NOT NULL", // temporary hack as ExtraFilter is required for dynamic views
25
25
  UserSearchString: this.searchInput,
26
26
  };
27
27
  return p;
@@ -58,4 +58,4 @@ SingleSearchResultComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type:
58
58
  type: ViewChild,
59
59
  args: [UserViewGridComponent]
60
60
  }] }); })();
61
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SingleSearchResultComponent, { className: "SingleSearchResultComponent" }); })();
61
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SingleSearchResultComponent, { className: "SingleSearchResultComponent", filePath: "src/lib/single-search-result/single-search-result.component.ts", lineNumber: 10 }); })();
@@ -201,4 +201,4 @@ SingleViewComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SingleV
201
201
  }], loadComplete: [{
202
202
  type: Output
203
203
  }] }); })();
204
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SingleViewComponent, { className: "SingleViewComponent" }); })();
204
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SingleViewComponent, { className: "SingleViewComponent", filePath: "src/lib/single-view/single-view.component.ts", lineNumber: 16 }); })();
@@ -167,7 +167,7 @@ export class UserNotificationsComponent {
167
167
  var _a;
168
168
  let url = [];
169
169
  let queryString = '';
170
- if (notification.ResourceRecordID && notification.ResourceRecordID > 0 &&
170
+ if (notification.ResourceRecordID && notification.ResourceRecordID.length > 0 &&
171
171
  notification.ResourceTypeID && notification.ResourceTypeID.length > 0) {
172
172
  // we have a resource here, like a Report, Dashboard, etc
173
173
  // we can generate a url to navigate to it
@@ -397,4 +397,4 @@ UserNotificationsComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type:
397
397
  type: ViewChild,
398
398
  args: ['readRadio']
399
399
  }] }); })();
400
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UserNotificationsComponent, { className: "UserNotificationsComponent" }); })();
400
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UserNotificationsComponent, { className: "UserNotificationsComponent", filePath: "src/lib/user-notifications/user-notifications.component.ts", lineNumber: 12 }); })();
@@ -39,4 +39,4 @@ UserProfileComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: UserPr
39
39
  type: Component,
40
40
  args: [{ selector: 'app-user-profile', template: "<ul *ngIf=\"User | async\">\n <li>{{ User.name }}</li>\n <li>{{ User.email }}</li>\n <li>{{ JSON.stringify(User) }}</li>\n</ul>" }]
41
41
  }], () => [{ type: i1.MJAuthBase }], null); })();
42
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UserProfileComponent, { className: "UserProfileComponent" }); })();
42
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UserProfileComponent, { className: "UserProfileComponent", filePath: "src/lib/user-profile/user-profile.component.ts", lineNumber: 10 }); })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-explorer-core",
3
- "version": "2.0.0",
3
+ "version": "2.1.1",
4
4
  "description": "MemberJunction Explorer: Core Angular Components",
5
5
  "main": "./dist/public-api.js",
6
6
  "typings": "./dist/public-api.d.ts",
@@ -26,23 +26,23 @@
26
26
  "@angular/router": "18.0.2"
27
27
  },
28
28
  "dependencies": {
29
- "@memberjunction/global": "2.0.0",
30
- "@memberjunction/core": "2.0.0",
31
- "@memberjunction/ng-compare-records": "2.0.0",
32
- "@memberjunction/ng-file-storage": "2.0.0",
33
- "@memberjunction/ng-record-changes": "2.0.0",
34
- "@memberjunction/ng-container-directives": "2.0.0",
35
- "@memberjunction/ng-user-view-grid": "2.0.0",
36
- "@memberjunction/ng-query-grid": "2.0.0",
37
- "@memberjunction/ng-user-view-properties": "2.0.0",
38
- "@memberjunction/ng-shared": "2.0.0",
39
- "@memberjunction/ng-tabstrip": "2.0.0",
40
- "@memberjunction/ng-ask-skip": "2.0.0",
41
- "@memberjunction/ng-auth-services": "2.0.0",
42
- "@memberjunction/ng-explorer-settings": "2.0.0",
43
- "@memberjunction/ng-base-forms": "2.0.0",
44
- "@memberjunction/ng-entity-form-dialog": "2.0.0",
45
- "@memberjunction/ng-record-selector": "2.0.0",
29
+ "@memberjunction/global": "2.1.1",
30
+ "@memberjunction/core": "2.1.1",
31
+ "@memberjunction/ng-compare-records": "2.1.1",
32
+ "@memberjunction/ng-file-storage": "2.1.1",
33
+ "@memberjunction/ng-record-changes": "2.1.1",
34
+ "@memberjunction/ng-container-directives": "2.1.1",
35
+ "@memberjunction/ng-user-view-grid": "2.1.1",
36
+ "@memberjunction/ng-query-grid": "2.1.1",
37
+ "@memberjunction/ng-user-view-properties": "2.1.1",
38
+ "@memberjunction/ng-shared": "2.1.1",
39
+ "@memberjunction/ng-tabstrip": "2.1.1",
40
+ "@memberjunction/ng-ask-skip": "2.1.1",
41
+ "@memberjunction/ng-auth-services": "2.1.1",
42
+ "@memberjunction/ng-explorer-settings": "2.1.1",
43
+ "@memberjunction/ng-base-forms": "2.1.1",
44
+ "@memberjunction/ng-entity-form-dialog": "2.1.1",
45
+ "@memberjunction/ng-record-selector": "2.1.1",
46
46
  "@progress/kendo-angular-grid": "16.2.0",
47
47
  "@progress/kendo-angular-buttons": "16.2.0",
48
48
  "@progress/kendo-angular-listview": "16.2.0",
@@ -1,31 +0,0 @@
1
- import { AfterViewInit, OnInit } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- export declare class JoinGridComponent implements OnInit, AfterViewInit {
4
- RowsEntity: string;
5
- ColumnsEntity: string;
6
- JoinEntity: string;
7
- JoinRowForeignKey: string;
8
- JoinColumunForeignKey: string;
9
- RowsFilter: string;
10
- ColumnsFilter: string;
11
- EditMode: boolean;
12
- showloader: boolean;
13
- viewData: any[];
14
- visibleColumns: any[];
15
- ShowError: boolean;
16
- ErrorMessage: string;
17
- gridHeight: number;
18
- private resizeSub;
19
- constructor();
20
- ngOnInit(): void;
21
- ngAfterViewInit(): void;
22
- LoadData(): Promise<void>;
23
- getJoinData(rows: any[], columns: any[]): Promise<void>;
24
- prepareGridData(rows: any[], columns: any[], joinEntities: any[]): void;
25
- private _gridMargin;
26
- setGridHeight(): void;
27
- ResizeGrid(): void;
28
- static ɵfac: i0.ɵɵFactoryDeclaration<JoinGridComponent, never>;
29
- static ɵcmp: i0.ɵɵComponentDeclaration<JoinGridComponent, "app-join-grid", never, { "RowsEntity": { "alias": "RowsEntity"; "required": false; }; "ColumnsEntity": { "alias": "ColumnsEntity"; "required": false; }; "JoinEntity": { "alias": "JoinEntity"; "required": false; }; "JoinRowForeignKey": { "alias": "JoinRowForeignKey"; "required": false; }; "JoinColumunForeignKey": { "alias": "JoinColumunForeignKey"; "required": false; }; "RowsFilter": { "alias": "RowsFilter"; "required": false; }; "ColumnsFilter": { "alias": "ColumnsFilter"; "required": false; }; "EditMode": { "alias": "EditMode"; "required": false; }; }, {}, never, never, false, never>;
30
- }
31
- //# sourceMappingURL=join-grid.component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"join-grid.component.d.ts","sourceRoot":"","sources":["../../../src/lib/join-grid/join-grid.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAoB,MAAM,EAAE,MAAM,eAAe,CAAC;;AAIxE,qBAKa,iBAAkB,YAAW,MAAM,EAAE,aAAa;IACpD,UAAU,EAAE,MAAM,CAAM;IACxB,aAAa,EAAE,MAAM,CAAM;IAC3B,UAAU,EAAE,MAAM,CAAM;IACxB,iBAAiB,EAAE,MAAM,CAAM;IAC/B,qBAAqB,EAAE,MAAM,CAAM;IACnC,UAAU,EAAE,MAAM,CAAM;IACxB,aAAa,EAAE,MAAM,CAAM;IAC3B,QAAQ,EAAE,OAAO,CAAS;IAC5B,UAAU,EAAE,OAAO,CAAS;IAC5B,QAAQ,EAAE,GAAG,EAAE,CAAM;IACrB,cAAc,EAAE,GAAG,EAAE,CAAM;IAC3B,SAAS,EAAE,OAAO,CAAS;IAC3B,YAAY,EAAE,MAAM,CAAM;IAC1B,UAAU,EAAE,MAAM,CAAO;IAChC,OAAO,CAAC,SAAS,CAA6B;;IAI9C,QAAQ,IAAI,IAAI;IAShB,eAAe,IAAI,IAAI;IAIjB,QAAQ;IAeR,WAAW,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE;IAa7C,eAAe,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE;IA8BhE,OAAO,CAAC,WAAW,CAAO;IAC1B,aAAa,IAAI,IAAI;IAed,UAAU,IAAI,IAAI;yCA1Gd,iBAAiB;2CAAjB,iBAAiB;CA8G7B"}
@@ -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" }); })();