@memberjunction/ng-user-view-grid 0.9.2 → 0.9.5

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,4 +1,4 @@
1
- import { ElementRef, EventEmitter, OnInit, OnDestroy, AfterViewInit } from '@angular/core';
1
+ import { ElementRef, EventEmitter, OnInit, AfterViewInit } from '@angular/core';
2
2
  import { FormBuilder, FormGroup } from '@angular/forms';
3
3
  import { Router } from '@angular/router';
4
4
  import { BaseEntity, RunViewParams, EntityFieldInfo, EntityInfo, ViewColumnInfo, UserViewEntityBase } from '@memberjunction/core';
@@ -20,7 +20,7 @@ export type GridPendingRecordItem = {
20
20
  row: number;
21
21
  dataItem: any;
22
22
  };
23
- export declare class UserViewGridComponent implements OnInit, OnDestroy, AfterViewInit {
23
+ export declare class UserViewGridComponent implements OnInit, AfterViewInit {
24
24
  private formBuilder;
25
25
  private router;
26
26
  title: string;
@@ -49,7 +49,6 @@ export declare class UserViewGridComponent implements OnInit, OnDestroy, AfterVi
49
49
  isLoading: boolean;
50
50
  gridView: GridDataResult;
51
51
  gridHeight: number;
52
- private resizeSub;
53
52
  _viewEntity: UserViewEntityBase | undefined;
54
53
  _entityInfo: EntityInfo | undefined;
55
54
  private _newGridState;
@@ -84,8 +83,6 @@ export declare class UserViewGridComponent implements OnInit, OnDestroy, AfterVi
84
83
  RevertPendingChanges(): void;
85
84
  ngOnInit(): void;
86
85
  ngAfterViewInit(): void;
87
- ngOnDestroy(): void;
88
- ResizeGrid(): void;
89
86
  private _deferLoadCount;
90
87
  private _allowLoad;
91
88
  get AllowLoad(): boolean;
@@ -22,6 +22,7 @@ import * as i4 from "@progress/kendo-angular-grid";
22
22
  import * as i5 from "@progress/kendo-angular-dialog";
23
23
  import * as i6 from "@progress/kendo-angular-excel-export";
24
24
  import * as i7 from "@progress/kendo-angular-buttons";
25
+ import * as i8 from "@memberjunction/ng-container-directives";
25
26
  const _c0 = ["kendoGrid"];
26
27
  const _c1 = ["excelExport"];
27
28
  function UserViewGridComponent_ng_template_3_button_2_Template(rf, ctx) { if (rf & 1) {
@@ -231,7 +232,6 @@ export class UserViewGridComponent {
231
232
  this.isLoading = false;
232
233
  this.gridView = { data: [], total: 0 };
233
234
  this.gridHeight = 750;
234
- this.resizeSub = null;
235
235
  this._newGridState = {};
236
236
  this.editModeEnded = new Subject();
237
237
  this.compareMode = false;
@@ -513,14 +513,6 @@ export class UserViewGridComponent {
513
513
  if (this.Params)
514
514
  this.Refresh(this.Params);
515
515
  }
516
- ngOnDestroy() {
517
- if (this.resizeSub) {
518
- this.resizeSub.unsubscribe();
519
- }
520
- }
521
- ResizeGrid() {
522
- // doesn't do anything now, handled by mjFillContainer directive
523
- }
524
516
  get AllowLoad() {
525
517
  return this._allowLoad;
526
518
  }
@@ -737,7 +729,7 @@ UserViewGridComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: UserV
737
729
  i0.ɵɵproperty("ngForOf", ctx.exportColumns);
738
730
  i0.ɵɵadvance(1);
739
731
  i0.ɵɵproperty("ngIf", ctx.isDialogOpened);
740
- } }, dependencies: [i3.NgForOf, i3.NgIf, i4.GridComponent, i4.ToolbarTemplateDirective, i4.SelectionDirective, i4.ColumnComponent, i4.FooterTemplateDirective, i4.CheckboxColumnComponent, i5.WindowComponent, i6.ExcelExportComponent, i6.ColumnComponent, i7.Button, i3.DecimalPipe], styles: [".user-view-grid-wrap[_ngcontent-%COMP%] {\r\n height: calc(100vh-20px);\r\n}\r\n\r\n.user-view-grid-column-header[_ngcontent-%COMP%] {\r\n background-color: #a9c2af;\r\n font-size: 20pt;\r\n font-weight: bold;\r\n}"] });
732
+ } }, dependencies: [i3.NgForOf, i3.NgIf, i4.GridComponent, i4.ToolbarTemplateDirective, i4.SelectionDirective, i4.ColumnComponent, i4.FooterTemplateDirective, i4.CheckboxColumnComponent, i5.WindowComponent, i6.ExcelExportComponent, i6.ColumnComponent, i7.Button, i8.FillContainer, i3.DecimalPipe], styles: [".user-view-grid-wrap[_ngcontent-%COMP%] {\r\n height: calc(100vh-20px);\r\n}\r\n\r\n.user-view-grid-column-header[_ngcontent-%COMP%] {\r\n background-color: #a9c2af;\r\n font-size: 20pt;\r\n font-weight: bold;\r\n}"] });
741
733
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UserViewGridComponent, [{
742
734
  type: Component,
743
735
  args: [{ selector: 'mj-user-view-grid', template: "<div class=\"user-view-grid-wrap\" mjFillContainer>\r\n <kendo-grid #kendoGrid\r\n mjFillContainer\r\n [resizable]=\"true\"\r\n [data]=\"gridView\" \r\n [skip]=\"skip\"\r\n [pageSize]=\"pageSize\"\r\n scrollable=\"virtual\"\r\n [rowHeight]=\"36\"\r\n (pageChange)=\"pageChange($event)\"\r\n [loading]=\"isLoading\"\r\n [height]=\"gridHeight\"\r\n [sortable]=\"true\"\r\n [sort]=\"sortSettings\" \r\n [resizable]=\"true\"\r\n [reorderable]=\"true\"\r\n [selectable]=\"true\"\r\n kendoGridSelectBy\r\n [(selectedKeys)]=\"selectedKeys\"\r\n (cellClick)=\"cellClickHandler($event)\"\r\n (cellClose)=\"cellCloseHandler($event)\"\r\n (columnReorder)=\"columnReorder($event)\"\r\n (columnResize)=\"columnResize($event)\"\r\n (selectionChange)=\"selectionChange($event)\"\r\n (sortChange)=\"sortChanged($event)\"\r\n >\r\n <ng-template kendoGridToolbarTemplate>\r\n <button kendoButton icon=\"file-excel\" [disabled]=\"compareMode\" (click)=\"doExcelExport()\" >Export to Excel</button>\r\n <button (click)=\"enableCompare(true)\" *ngIf=\"compareMode\" class=\"k-button k-button-md k-rounded-md k-button-solid-base k-button-solid\">Cancel</button>\r\n <button (click)=\"enableCompare()\" [disabled]=\"compareMode && compareRecords.length < 2\" class=\"k-button k-button-md k-rounded-md k-button-solid-base k-button-solid\">Compare</button>\r\n <button\r\n kendoButton\r\n [primary]=\"true\"\r\n icon=\"refresh\"\r\n *ngIf=\"showRefreshButton\"\r\n (click)=\"RefreshFromSavedParams()\">\r\n Refresh\r\n </button>\r\n </ng-template>\r\n\r\n <kendo-grid-checkbox-column \r\n *ngIf=\"compareMode\" \r\n [width]=\"50\" \r\n [headerStyle]=\"{ 'font-weight' : 'bold', 'background-color': '#a9c2af' }\" \r\n [style]=\"{'text-align': 'center', 'vertical-align': 'center'}\">\r\n </kendo-grid-checkbox-column>\r\n \r\n <kendo-grid-column \r\n *ngFor=\"let item of visibleColumns\" \r\n [field]=\"item.Name\" \r\n [title]=\"GetColumnTitle(item)\"\r\n [width]=\"item.width ? item.width : 100\"\r\n [editable]=\"item.EntityField.AllowUpdateAPI\"\r\n [editor]=\"getEditor(item.EntityField)\"\r\n [headerStyle]=\"{ 'font-weight' : 'bold', 'background-color': '#a9c2af' }\"\r\n [style]=\"this.GetColumnCellStyle(item)\"\r\n >\r\n <ng-template *ngIf=\"item===visibleColumns[0]\" kendoGridFooterTemplate >\r\n {{this.viewData.length | number}}{{this.totalRowCount > this.viewData.length ? ' of ' + (this.totalRowCount | number) : ' rows'}}<br/><span style=\"font-size: smaller; font-weight: normal;\">{{viewExecutionTime | number:'1.2-2'}} seconds</span>\r\n </ng-template>\r\n </kendo-grid-column>\r\n\r\n <kendo-excelexport #excelExport [data]=\"exportData\" [fileName]=\"(_viewEntity ? _viewEntity.Get('Name') : _entityInfo?.Name) + '.xlsx'\">\r\n <kendo-excelexport-column *ngFor=\"let exportCol of exportColumns\" [field]=\"exportCol.Name\" [title]=\"exportCol.Name\">\r\n </kendo-excelexport-column>\r\n </kendo-excelexport>\r\n </kendo-grid>\r\n</div>\r\n\r\n<div *ngIf=\"isDialogOpened\">\r\n <div class=\"k-overlay\"></div>\r\n <kendo-window\r\n [width]=\"900\"\r\n [minHeight]=\"300\"\r\n [minWidth]=\"400\"\r\n [resizable]=\"true\"\r\n (close)=\"closeDialog()\"\r\n title=\"Compare Records\"\r\n *ngIf=\"isDialogOpened\"\r\n >\r\n <div class=\"k-d-flex k-flex-col k-justify-content-between k-h-full\">\r\n <div>\r\n <mj-record-compare [recordsToCompare]=\"compareRecords\" [visibleColumns]=\"visibleColumns\" ></mj-record-compare>\r\n </div>\r\n </div>\r\n </kendo-window>\r\n</div>\r\n ", styles: [".user-view-grid-wrap {\r\n height: calc(100vh-20px);\r\n}\r\n\r\n.user-view-grid-column-header {\r\n background-color: #a9c2af;\r\n font-size: 20pt;\r\n font-weight: bold;\r\n}"] }]
@@ -8,8 +8,9 @@ import * as i6 from "@progress/kendo-angular-dialog";
8
8
  import * as i7 from "@progress/kendo-angular-excel-export";
9
9
  import * as i8 from "@progress/kendo-angular-buttons";
10
10
  import * as i9 from "@memberjunction/ng-compare-records";
11
+ import * as i10 from "@memberjunction/ng-container-directives";
11
12
  export declare class UserViewGridModule {
12
13
  static ɵfac: i0.ɵɵFactoryDeclaration<UserViewGridModule, never>;
13
- static ɵmod: i0.ɵɵNgModuleDeclaration<UserViewGridModule, [typeof i1.UserViewGridComponent], [typeof i2.CommonModule, typeof i3.FormsModule, typeof i3.ReactiveFormsModule, typeof i4.RouterModule, typeof i5.GridModule, typeof i6.DialogsModule, typeof i7.ExcelExportModule, typeof i8.ButtonsModule, typeof i9.CompareRecordsModule], [typeof i1.UserViewGridComponent]>;
14
+ static ɵmod: i0.ɵɵNgModuleDeclaration<UserViewGridModule, [typeof i1.UserViewGridComponent], [typeof i2.CommonModule, typeof i3.FormsModule, typeof i3.ReactiveFormsModule, typeof i4.RouterModule, typeof i5.GridModule, typeof i6.DialogsModule, typeof i7.ExcelExportModule, typeof i8.ButtonsModule, typeof i9.CompareRecordsModule, typeof i10.ContainerDirectivesModule], [typeof i1.UserViewGridComponent]>;
14
15
  static ɵinj: i0.ɵɵInjectorDeclaration<UserViewGridModule>;
15
16
  }
@@ -9,6 +9,7 @@ import { ExcelExportModule } from '@progress/kendo-angular-excel-export';
9
9
  import { DialogsModule } from "@progress/kendo-angular-dialog";
10
10
  import { ButtonsModule } from '@progress/kendo-angular-buttons';
11
11
  import { CompareRecordsModule } from '@memberjunction/ng-compare-records';
12
+ import { ContainerDirectivesModule } from '@memberjunction/ng-container-directives';
12
13
  import * as i0 from "@angular/core";
13
14
  export class UserViewGridModule {
14
15
  }
@@ -22,7 +23,8 @@ UserViewGridModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [Commo
22
23
  DialogsModule,
23
24
  ExcelExportModule,
24
25
  ButtonsModule,
25
- CompareRecordsModule] });
26
+ CompareRecordsModule,
27
+ ContainerDirectivesModule] });
26
28
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UserViewGridModule, [{
27
29
  type: NgModule,
28
30
  args: [{
@@ -38,7 +40,8 @@ UserViewGridModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [Commo
38
40
  DialogsModule,
39
41
  ExcelExportModule,
40
42
  ButtonsModule,
41
- CompareRecordsModule
43
+ CompareRecordsModule,
44
+ ContainerDirectivesModule
42
45
  ],
43
46
  exports: [
44
47
  UserViewGridComponent
@@ -53,4 +56,5 @@ UserViewGridModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [Commo
53
56
  DialogsModule,
54
57
  ExcelExportModule,
55
58
  ButtonsModule,
56
- CompareRecordsModule], exports: [UserViewGridComponent] }); })();
59
+ CompareRecordsModule,
60
+ ContainerDirectivesModule], exports: [UserViewGridComponent] }); })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-user-view-grid",
3
- "version": "0.9.2",
3
+ "version": "0.9.5",
4
4
  "description": "MemberJunction: Angular Grid to display dynamic and saved user views for any entity in MemberJunction.",
5
5
  "main": "./dist/public-api.js",
6
6
  "typings": "./dist/public-api.d.ts",
@@ -21,8 +21,9 @@
21
21
  "@angular/forms": "^15.2.0",
22
22
  "@angular/router": "^15.2.0",
23
23
  "@memberjunction/core": "^0.9.14",
24
- "@progress/kendo-angular-grid": "^12.1.0",
25
- "@memberjunction/ng-compare-records": "^0.9.7"
24
+ "@memberjunction/ng-compare-records": "^0.9.7",
25
+ "@memberjunction/ng-container-directives": "^0.9.1",
26
+ "@progress/kendo-angular-grid": "^12.1.0"
26
27
  },
27
28
  "dependencies": {
28
29
  "tslib": "^2.3.0"
@@ -1,4 +1,4 @@
1
- import { Component, ViewChild, ElementRef, Output, EventEmitter, OnInit, Input, OnDestroy, AfterViewInit } from '@angular/core';
1
+ import { Component, ViewChild, ElementRef, Output, EventEmitter, OnInit, Input, AfterViewInit } from '@angular/core';
2
2
  import { FormBuilder, FormGroup } from '@angular/forms';
3
3
  import { Router } from '@angular/router'
4
4
 
@@ -10,7 +10,7 @@ import { CellClickEvent, GridDataResult, PageChangeEvent, GridComponent, CellClo
10
10
  import { Keys } from '@progress/kendo-angular-common';
11
11
 
12
12
 
13
- import { Subscription, Subject } from 'rxjs';
13
+ import { Subject } from 'rxjs';
14
14
  import { ExcelExportComponent } from '@progress/kendo-angular-excel-export';
15
15
  import { DisplaySimpleNotificationRequestData, MJEventType, MJGlobal } from '@memberjunction/global';
16
16
 
@@ -38,7 +38,7 @@ export type GridPendingRecordItem = {
38
38
  templateUrl: './ng-user-view-grid.component.html',
39
39
  styleUrls: ['./ng-user-view-grid.component.css']
40
40
  })
41
- export class UserViewGridComponent implements OnInit, OnDestroy, AfterViewInit {
41
+ export class UserViewGridComponent implements OnInit, AfterViewInit {
42
42
  title = 'UserViewGrid';
43
43
  @Input() Params: RunViewParams | undefined;
44
44
  @Input() BottomMargin: number = 0;
@@ -67,7 +67,6 @@ export class UserViewGridComponent implements OnInit, OnDestroy, AfterViewInit {
67
67
  public isLoading: boolean = false;
68
68
  public gridView: GridDataResult = { data: [], total: 0 };
69
69
  public gridHeight: number = 750;
70
- private resizeSub: Subscription | null = null;
71
70
 
72
71
  public _viewEntity: UserViewEntityBase | undefined
73
72
  public _entityInfo: EntityInfo | undefined;
@@ -462,17 +461,6 @@ export class UserViewGridComponent implements OnInit, OnDestroy, AfterViewInit {
462
461
  this.Refresh(this.Params)
463
462
  }
464
463
 
465
- ngOnDestroy(): void {
466
- if (this.resizeSub) {
467
- this.resizeSub.unsubscribe();
468
- }
469
- }
470
-
471
-
472
- public ResizeGrid(): void {
473
- // doesn't do anything now, handled by mjFillContainer directive
474
- }
475
-
476
464
  private _deferLoadCount: number = 0;
477
465
  private _allowLoad: boolean = true;
478
466
  @Input() public get AllowLoad(): boolean {
@@ -11,6 +11,7 @@ import { DialogsModule } from "@progress/kendo-angular-dialog";
11
11
  import { ButtonsModule } from '@progress/kendo-angular-buttons';
12
12
 
13
13
  import { CompareRecordsModule } from '@memberjunction/ng-compare-records';
14
+ import { ContainerDirectivesModule } from '@memberjunction/ng-container-directives';
14
15
 
15
16
  @NgModule({
16
17
  declarations: [
@@ -25,7 +26,8 @@ import { CompareRecordsModule } from '@memberjunction/ng-compare-records';
25
26
  DialogsModule,
26
27
  ExcelExportModule,
27
28
  ButtonsModule,
28
- CompareRecordsModule
29
+ CompareRecordsModule,
30
+ ContainerDirectivesModule
29
31
  ],
30
32
  exports: [
31
33
  UserViewGridComponent