@memberjunction/ng-record-changes 0.9.2 → 0.9.4
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.
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import { EventEmitter, OnInit } from '@angular/core';
|
|
1
|
+
import { EventEmitter, OnInit, Renderer2, ElementRef, AfterViewInit, OnDestroy } from '@angular/core';
|
|
2
2
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
3
3
|
import { SortDescriptor } from '@progress/kendo-data-query';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class RecordChangesComponent implements OnInit {
|
|
5
|
+
export declare class RecordChangesComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
6
6
|
private sanitizer;
|
|
7
|
+
private renderer;
|
|
7
8
|
showloader: boolean;
|
|
8
9
|
dialogClosed: EventEmitter<any>;
|
|
9
10
|
record: any;
|
|
11
|
+
wrapper: ElementRef;
|
|
10
12
|
viewData: any;
|
|
11
13
|
visibleColumns: any;
|
|
12
14
|
sortSettings: SortDescriptor[];
|
|
13
|
-
constructor(sanitizer: DomSanitizer);
|
|
15
|
+
constructor(sanitizer: DomSanitizer, renderer: Renderer2);
|
|
14
16
|
ngOnInit(): void;
|
|
17
|
+
ngAfterViewInit(): void;
|
|
18
|
+
ngOnDestroy(): void;
|
|
15
19
|
LoadRecordChanges(recordId: number, appName: string, entityName: string): Promise<void>;
|
|
16
20
|
prepareColumns(): void;
|
|
17
21
|
closePropertiesDialog(): void;
|
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
10
|
+
import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';
|
|
11
11
|
import { LogError, RunView } from '@memberjunction/core';
|
|
12
12
|
import * as i0 from "@angular/core";
|
|
13
13
|
import * as i1 from "@angular/platform-browser";
|
|
@@ -15,42 +15,44 @@ import * as i2 from "@angular/common";
|
|
|
15
15
|
import * as i3 from "@progress/kendo-angular-grid";
|
|
16
16
|
import * as i4 from "@progress/kendo-angular-dialog";
|
|
17
17
|
import * as i5 from "@progress/kendo-angular-indicators";
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
const _c0 = ["recordChangesWrapper"];
|
|
19
|
+
function RecordChangesComponent_kendo_loader_4_Template(rf, ctx) { if (rf & 1) {
|
|
20
|
+
i0.ɵɵelement(0, "kendo-loader", 5);
|
|
20
21
|
} }
|
|
21
|
-
function
|
|
22
|
-
i0.ɵɵelement(0, "span",
|
|
22
|
+
function RecordChangesComponent_div_5_kendo_grid_column_4_ng_template_1_Template(rf, ctx) { if (rf & 1) {
|
|
23
|
+
i0.ɵɵelement(0, "span", 13);
|
|
23
24
|
} if (rf & 2) {
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
i0.ɵɵproperty("innerHTML",
|
|
25
|
+
const dataItem_r8 = ctx.$implicit;
|
|
26
|
+
const item_r5 = i0.ɵɵnextContext().$implicit;
|
|
27
|
+
const ctx_r7 = i0.ɵɵnextContext(2);
|
|
28
|
+
i0.ɵɵproperty("innerHTML", ctx_r7.FormatColumnValue(item_r5, dataItem_r8[item_r5.field]), i0.ɵɵsanitizeHtml);
|
|
28
29
|
} }
|
|
29
|
-
const
|
|
30
|
-
function
|
|
31
|
-
i0.ɵɵelementStart(0, "kendo-grid-column",
|
|
32
|
-
i0.ɵɵtemplate(1,
|
|
30
|
+
const _c1 = function () { return { "font-weight": "bold", "background-color": "#a9c2af" }; };
|
|
31
|
+
function RecordChangesComponent_div_5_kendo_grid_column_4_Template(rf, ctx) { if (rf & 1) {
|
|
32
|
+
i0.ɵɵelementStart(0, "kendo-grid-column", 11);
|
|
33
|
+
i0.ɵɵtemplate(1, RecordChangesComponent_div_5_kendo_grid_column_4_ng_template_1_Template, 1, 1, "ng-template", 12);
|
|
33
34
|
i0.ɵɵelementEnd();
|
|
34
35
|
} if (rf & 2) {
|
|
35
|
-
const
|
|
36
|
-
i0.ɵɵpropertyInterpolate("field",
|
|
37
|
-
i0.ɵɵpropertyInterpolate("title",
|
|
38
|
-
i0.ɵɵproperty("width",
|
|
36
|
+
const item_r5 = ctx.$implicit;
|
|
37
|
+
i0.ɵɵpropertyInterpolate("field", item_r5.field);
|
|
38
|
+
i0.ɵɵpropertyInterpolate("title", item_r5.title);
|
|
39
|
+
i0.ɵɵproperty("width", item_r5.width)("headerStyle", i0.ɵɵpureFunction0(4, _c1));
|
|
39
40
|
} }
|
|
40
|
-
function
|
|
41
|
-
i0.ɵɵelementStart(0, "div",
|
|
42
|
-
i0.ɵɵtemplate(4,
|
|
41
|
+
function RecordChangesComponent_div_5_Template(rf, ctx) { if (rf & 1) {
|
|
42
|
+
i0.ɵɵelementStart(0, "div", 6, 7)(2, "div", 8)(3, "kendo-grid", 9);
|
|
43
|
+
i0.ɵɵtemplate(4, RecordChangesComponent_div_5_kendo_grid_column_4_Template, 2, 5, "kendo-grid-column", 10);
|
|
43
44
|
i0.ɵɵelementEnd()()();
|
|
44
45
|
} if (rf & 2) {
|
|
45
|
-
const
|
|
46
|
+
const ctx_r2 = i0.ɵɵnextContext();
|
|
46
47
|
i0.ɵɵadvance(3);
|
|
47
|
-
i0.ɵɵproperty("kendoGridBinding",
|
|
48
|
+
i0.ɵɵproperty("kendoGridBinding", ctx_r2.viewData)("pageSize", 100)("sortable", true)("sort", ctx_r2.sortSettings)("loading", ctx_r2.showloader)("resizable", true)("navigable", true);
|
|
48
49
|
i0.ɵɵadvance(1);
|
|
49
|
-
i0.ɵɵproperty("ngForOf",
|
|
50
|
+
i0.ɵɵproperty("ngForOf", ctx_r2.visibleColumns);
|
|
50
51
|
} }
|
|
51
52
|
export class RecordChangesComponent {
|
|
52
|
-
constructor(sanitizer) {
|
|
53
|
+
constructor(sanitizer, renderer) {
|
|
53
54
|
this.sanitizer = sanitizer;
|
|
55
|
+
this.renderer = renderer;
|
|
54
56
|
this.showloader = false;
|
|
55
57
|
this.dialogClosed = new EventEmitter();
|
|
56
58
|
this.record = {};
|
|
@@ -70,6 +72,16 @@ export class RecordChangesComponent {
|
|
|
70
72
|
this.prepareColumns();
|
|
71
73
|
}
|
|
72
74
|
}
|
|
75
|
+
ngAfterViewInit() {
|
|
76
|
+
// Move the wrapper to the body when the component is initialized
|
|
77
|
+
if (this.renderer && this.wrapper && this.wrapper.nativeElement)
|
|
78
|
+
this.renderer.appendChild(document.body, this.wrapper.nativeElement);
|
|
79
|
+
}
|
|
80
|
+
ngOnDestroy() {
|
|
81
|
+
// Remove the wrapper from the body when the component is destroyed
|
|
82
|
+
if (this.renderer && this.wrapper && this.wrapper.nativeElement)
|
|
83
|
+
this.renderer.removeChild(document.body, this.wrapper.nativeElement);
|
|
84
|
+
}
|
|
73
85
|
LoadRecordChanges(recordId, appName, entityName) {
|
|
74
86
|
return __awaiter(this, void 0, void 0, function* () {
|
|
75
87
|
// Perform any necessary actions with the ViewID, such as fetching data
|
|
@@ -144,16 +156,22 @@ export class RecordChangesComponent {
|
|
|
144
156
|
}
|
|
145
157
|
}
|
|
146
158
|
}
|
|
147
|
-
RecordChangesComponent.ɵfac = function RecordChangesComponent_Factory(t) { return new (t || RecordChangesComponent)(i0.ɵɵdirectiveInject(i1.DomSanitizer)); };
|
|
148
|
-
RecordChangesComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: RecordChangesComponent, selectors: [["mj-record-changes"]],
|
|
149
|
-
i0.ɵɵ
|
|
150
|
-
i0.ɵɵelementStart(1, "kendo-window", 1);
|
|
151
|
-
i0.ɵɵlistener("close", function RecordChangesComponent_Template_kendo_window_close_1_listener() { return ctx.closePropertiesDialog(); });
|
|
152
|
-
i0.ɵɵtemplate(2, RecordChangesComponent_kendo_loader_2_Template, 1, 0, "kendo-loader", 2);
|
|
153
|
-
i0.ɵɵtemplate(3, RecordChangesComponent_div_3_Template, 5, 8, "div", 3);
|
|
154
|
-
i0.ɵɵelementEnd();
|
|
159
|
+
RecordChangesComponent.ɵfac = function RecordChangesComponent_Factory(t) { return new (t || RecordChangesComponent)(i0.ɵɵdirectiveInject(i1.DomSanitizer), i0.ɵɵdirectiveInject(i0.Renderer2)); };
|
|
160
|
+
RecordChangesComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: RecordChangesComponent, selectors: [["mj-record-changes"]], viewQuery: function RecordChangesComponent_Query(rf, ctx) { if (rf & 1) {
|
|
161
|
+
i0.ɵɵviewQuery(_c0, 7);
|
|
155
162
|
} if (rf & 2) {
|
|
156
|
-
|
|
163
|
+
let _t;
|
|
164
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.wrapper = _t.first);
|
|
165
|
+
} }, inputs: { record: "record" }, outputs: { dialogClosed: "dialogClosed" }, decls: 6, vars: 7, consts: [["recordChangesWrapper", ""], [1, "k-overlay"], ["title", "Record Changes", 1, "kendo-window-custom", 3, "width", "height", "minHeight", "minWidth", "resizable", "close"], ["type", "converging-spinner", 4, "ngIf"], ["class", "k-d-flex k-flex-col k-justify-content-between k-h-full", 4, "ngIf"], ["type", "converging-spinner"], [1, "k-d-flex", "k-flex-col", "k-justify-content-between", "k-h-full"], ["dialogContainer", ""], [1, "kendo-grid-container"], ["scrollable", "virtual", 3, "kendoGridBinding", "pageSize", "sortable", "sort", "loading", "resizable", "navigable"], [3, "field", "title", "width", "headerStyle", 4, "ngFor", "ngForOf"], [3, "field", "title", "width", "headerStyle"], ["kendoGridCellTemplate", ""], [3, "innerHTML"]], template: function RecordChangesComponent_Template(rf, ctx) { if (rf & 1) {
|
|
166
|
+
i0.ɵɵelementStart(0, "div", null, 0);
|
|
167
|
+
i0.ɵɵelement(2, "div", 1);
|
|
168
|
+
i0.ɵɵelementStart(3, "kendo-window", 2);
|
|
169
|
+
i0.ɵɵlistener("close", function RecordChangesComponent_Template_kendo_window_close_3_listener() { return ctx.closePropertiesDialog(); });
|
|
170
|
+
i0.ɵɵtemplate(4, RecordChangesComponent_kendo_loader_4_Template, 1, 0, "kendo-loader", 3);
|
|
171
|
+
i0.ɵɵtemplate(5, RecordChangesComponent_div_5_Template, 5, 8, "div", 4);
|
|
172
|
+
i0.ɵɵelementEnd()();
|
|
173
|
+
} if (rf & 2) {
|
|
174
|
+
i0.ɵɵadvance(3);
|
|
157
175
|
i0.ɵɵproperty("width", 700)("height", 525)("minHeight", 300)("minWidth", 400)("resizable", true);
|
|
158
176
|
i0.ɵɵadvance(1);
|
|
159
177
|
i0.ɵɵproperty("ngIf", ctx.showloader);
|
|
@@ -162,9 +180,12 @@ RecordChangesComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: Reco
|
|
|
162
180
|
} }, dependencies: [i2.NgForOf, i2.NgIf, i3.GridComponent, i3.DataBindingDirective, i3.ColumnComponent, i3.CellTemplateDirective, i4.WindowComponent, i5.LoaderComponent] });
|
|
163
181
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RecordChangesComponent, [{
|
|
164
182
|
type: Component,
|
|
165
|
-
args: [{ selector: 'mj-record-changes', template: "<div class=\"k-overlay\"></div>\r\n<kendo-window \r\n
|
|
166
|
-
}], function () { return [{ type: i1.DomSanitizer }]; }, { dialogClosed: [{
|
|
183
|
+
args: [{ selector: 'mj-record-changes', template: "<div #recordChangesWrapper>\r\n <div class=\"k-overlay\"></div>\r\n <kendo-window \r\n class=\"kendo-window-custom\"\r\n [width]=\"700\"\r\n [height]=\"525\"\r\n [minHeight]=\"300\"\r\n [minWidth]=\"400\"\r\n [resizable]=\"true\"\r\n title=\"Record Changes\"\r\n (close)=\"closePropertiesDialog()\"\r\n >\r\n <kendo-loader *ngIf=\"showloader\" type=\"converging-spinner\" ></kendo-loader>\r\n <div class=\"k-d-flex k-flex-col k-justify-content-between k-h-full\" #dialogContainer *ngIf=\"!showloader\">\r\n <div class=\"kendo-grid-container\">\r\n <kendo-grid \r\n [kendoGridBinding]=\"viewData\" \r\n scrollable=\"virtual\" \r\n [pageSize]=\"100\" \r\n [sortable]=\"true\"\r\n [sort]=\"sortSettings\" \r\n [loading]=\"showloader\" \r\n [resizable]=\"true\" \r\n [navigable]=\"true\"\r\n >\r\n <kendo-grid-column \r\n *ngFor=\"let item of visibleColumns; let i = index\" \r\n field=\"{{item.field}}\"\r\n title=\"{{item.title}}\" \r\n [width]=\"item.width\"\r\n [headerStyle]=\"{ 'font-weight' : 'bold', 'background-color': '#a9c2af' }\"\r\n >\r\n <ng-template kendoGridCellTemplate let-dataItem>\r\n <span [innerHTML]=\"FormatColumnValue(item, dataItem[item.field])\"></span>\r\n </ng-template>\r\n </kendo-grid-column>\r\n </kendo-grid>\r\n </div>\r\n </div>\r\n </kendo-window>\r\n</div>" }]
|
|
184
|
+
}], function () { return [{ type: i1.DomSanitizer }, { type: i0.Renderer2 }]; }, { dialogClosed: [{
|
|
167
185
|
type: Output
|
|
168
186
|
}], record: [{
|
|
169
187
|
type: Input
|
|
188
|
+
}], wrapper: [{
|
|
189
|
+
type: ViewChild,
|
|
190
|
+
args: ['recordChangesWrapper', { static: true }]
|
|
170
191
|
}] }); })();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ng-record-changes",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.4",
|
|
4
4
|
"description": "MemberJunction: Angular pop-up window and grid to show changes made to a specific individual record",
|
|
5
5
|
"main": "./dist/public-api.js",
|
|
6
6
|
"typings": "./dist/public-api.d.ts",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"@progress/kendo-angular-grid": "^12.1.0"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@memberjunction/global": "^0.9.
|
|
30
|
-
"@memberjunction/core": "^0.9.
|
|
29
|
+
"@memberjunction/global": "^0.9.63",
|
|
30
|
+
"@memberjunction/core": "^0.9.60",
|
|
31
31
|
"tslib": "^2.3.0"
|
|
32
32
|
},
|
|
33
33
|
"sideEffects": false
|