mat-table-ext 0.0.7 → 0.0.9

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 (89) hide show
  1. package/.editorconfig +16 -0
  2. package/.vscode/extensions.json +4 -0
  3. package/.vscode/launch.json +20 -0
  4. package/.vscode/tasks.json +42 -0
  5. package/LICENSE +21 -0
  6. package/angular.json +150 -0
  7. package/package.json +46 -58
  8. package/projects/mat-table-ext/.browserslistrc +16 -0
  9. package/projects/mat-table-ext/README.md +57 -0
  10. package/projects/mat-table-ext/karma.conf.js +44 -0
  11. package/projects/mat-table-ext/ng-package.json +9 -0
  12. package/projects/mat-table-ext/package.json +38 -0
  13. package/projects/mat-table-ext/src/lib/components/column-pinning/column-pinning.component.html +7 -0
  14. package/projects/mat-table-ext/src/lib/components/column-pinning/column-pinning.component.scss +9 -0
  15. package/projects/mat-table-ext/src/lib/components/column-pinning/column-pinning.component.spec.ts +23 -0
  16. package/projects/mat-table-ext/src/lib/components/column-pinning/column-pinning.component.ts +48 -0
  17. package/projects/mat-table-ext/src/lib/components/editing/editing.component.html +55 -0
  18. package/projects/mat-table-ext/src/lib/components/editing/editing.component.scss +19 -0
  19. package/projects/mat-table-ext/src/lib/components/editing/editing.component.spec.ts +23 -0
  20. package/projects/mat-table-ext/src/lib/components/editing/editing.component.ts +110 -0
  21. package/projects/mat-table-ext/src/lib/components/filter-columns-component/filter-columns-component.component.html +26 -0
  22. package/projects/mat-table-ext/src/lib/components/filter-columns-component/filter-columns-component.component.scss +0 -0
  23. package/projects/mat-table-ext/src/lib/components/filter-columns-component/filter-columns-component.component.spec.ts +23 -0
  24. package/projects/mat-table-ext/src/lib/components/filter-columns-component/filter-columns-component.component.ts +54 -0
  25. package/projects/mat-table-ext/src/lib/directives/resize-column.directive.ts +103 -0
  26. package/projects/mat-table-ext/src/lib/mat-table-ext.component.html +285 -0
  27. package/projects/mat-table-ext/src/lib/mat-table-ext.component.spec.ts +25 -0
  28. package/projects/mat-table-ext/src/lib/mat-table-ext.component.ts +985 -0
  29. package/projects/mat-table-ext/src/lib/mat-table-ext.module.ts +127 -0
  30. package/projects/mat-table-ext/src/lib/mat-table-ext.scss +181 -0
  31. package/projects/mat-table-ext/src/lib/mat-table-ext.service.spec.ts +16 -0
  32. package/projects/mat-table-ext/src/lib/mat-table-ext.service.ts +12 -0
  33. package/projects/mat-table-ext/src/lib/models/tableExtModels.ts +85 -0
  34. package/{public-api.d.ts → projects/mat-table-ext/src/public-api.ts} +5 -1
  35. package/projects/mat-table-ext/src/test.ts +27 -0
  36. package/projects/mat-table-ext/tsconfig.lib.json +15 -0
  37. package/projects/mat-table-ext/tsconfig.lib.prod.json +10 -0
  38. package/projects/mat-table-ext/tsconfig.spec.json +17 -0
  39. package/projects/mat-table-ext-example/.browserslistrc +16 -0
  40. package/projects/mat-table-ext-example/karma.conf.js +44 -0
  41. package/projects/mat-table-ext-example/src/app/app.component.html +576 -0
  42. package/projects/mat-table-ext-example/src/app/app.component.scss +0 -0
  43. package/projects/mat-table-ext-example/src/app/app.component.spec.ts +31 -0
  44. package/projects/mat-table-ext-example/src/app/app.component.ts +173 -0
  45. package/projects/mat-table-ext-example/src/app/app.module.ts +40 -0
  46. package/projects/mat-table-ext-example/src/app/service/custom-table.service.spec.ts +16 -0
  47. package/projects/mat-table-ext-example/src/app/service/custom-table.service.ts +18 -0
  48. package/projects/mat-table-ext-example/src/assets/.gitkeep +0 -0
  49. package/projects/mat-table-ext-example/src/assets/data.json +100003 -0
  50. package/projects/mat-table-ext-example/src/environments/environment.prod.ts +3 -0
  51. package/projects/mat-table-ext-example/src/environments/environment.ts +16 -0
  52. package/projects/mat-table-ext-example/src/favicon.ico +0 -0
  53. package/projects/mat-table-ext-example/src/index.html +14 -0
  54. package/projects/mat-table-ext-example/src/main.ts +12 -0
  55. package/projects/mat-table-ext-example/src/polyfills.ts +53 -0
  56. package/projects/mat-table-ext-example/src/styles.scss +23 -0
  57. package/projects/mat-table-ext-example/src/test.ts +26 -0
  58. package/projects/mat-table-ext-example/tsconfig.app.json +15 -0
  59. package/projects/mat-table-ext-example/tsconfig.spec.json +18 -0
  60. package/tsconfig.json +38 -0
  61. package/esm2020/lib/components/column-pinning/column-pinning.component.mjs +0 -58
  62. package/esm2020/lib/components/editing/editing.component.mjs +0 -122
  63. package/esm2020/lib/components/filter-columns-component/filter-columns-component.component.mjs +0 -68
  64. package/esm2020/lib/directives/resize-column.directive.mjs +0 -99
  65. package/esm2020/lib/mat-table-ext.component.mjs +0 -1021
  66. package/esm2020/lib/mat-table-ext.module.mjs +0 -237
  67. package/esm2020/lib/mat-table-ext.service.mjs +0 -20
  68. package/esm2020/lib/models/tableExtModels.mjs +0 -2
  69. package/esm2020/mat-table-ext.mjs +0 -5
  70. package/esm2020/public-api.mjs +0 -11
  71. package/fesm2015/mat-table-ext.mjs +0 -1585
  72. package/fesm2015/mat-table-ext.mjs.map +0 -1
  73. package/fesm2020/mat-table-ext.mjs +0 -1582
  74. package/fesm2020/mat-table-ext.mjs.map +0 -1
  75. package/index.d.ts +0 -5
  76. package/lib/components/column-pinning/column-pinning.component.d.ts +0 -27
  77. package/lib/components/editing/editing.component.d.ts +0 -42
  78. package/lib/components/filter-columns-component/filter-columns-component.component.d.ts +0 -26
  79. package/lib/directives/resize-column.directive.d.ts +0 -27
  80. package/lib/mat-table-ext.component.d.ts +0 -348
  81. package/lib/mat-table-ext.module.d.ts +0 -58
  82. package/lib/mat-table-ext.service.d.ts +0 -11
  83. package/lib/models/tableExtModels.d.ts +0 -76
  84. /package/{assets → projects/mat-table-ext/assets}/_theming.scss +0 -0
  85. /package/{assets → projects/mat-table-ext/assets}/pinIcon.svg +0 -0
  86. /package/{assets → projects/mat-table-ext/assets}/pinLeft.svg +0 -0
  87. /package/{assets → projects/mat-table-ext/assets}/pinNone.svg +0 -0
  88. /package/{assets → projects/mat-table-ext/assets}/pinRight.svg +0 -0
  89. /package/{assets → projects/mat-table-ext/assets}/pinned.svg +0 -0
@@ -1,1585 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable, Component, Inject, Directive, Input, EventEmitter, Output, ViewEncapsulation, ViewChild, NgModule } from '@angular/core';
3
- import * as i7$1 from '@angular/material/table';
4
- import { MatTableDataSource, MatTableModule } from '@angular/material/table';
5
- import * as i3$1 from '@angular/forms';
6
- import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
7
- import * as i5 from '@angular/material/core';
8
- import { MatNativeDateModule, MatRippleModule } from '@angular/material/core';
9
- import * as i9 from '@angular/material/form-field';
10
- import { MatFormFieldModule } from '@angular/material/form-field';
11
- import { trigger, state, style, transition, animate } from '@angular/animations';
12
- import { SelectionModel } from '@angular/cdk/collections';
13
- import * as i8 from '@angular/cdk/drag-drop';
14
- import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
15
- import * as i1$1 from '@angular/material/dialog';
16
- import { MAT_DIALOG_DATA, MatDialogConfig, MatDialogModule } from '@angular/material/dialog';
17
- import * as i15 from '@angular/material/menu';
18
- import { MatMenuTrigger, MatMenuModule } from '@angular/material/menu';
19
- import * as i16 from '@angular/material/paginator';
20
- import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
21
- import * as i19 from '@angular/material/sort';
22
- import { MatSort, MatSortModule } from '@angular/material/sort';
23
- import { BehaviorSubject } from 'rxjs';
24
- import * as i1 from '@angular/common/http';
25
- import * as i3 from '@angular/common';
26
- import { CommonModule } from '@angular/common';
27
- import * as i6 from '@angular/material/button';
28
- import { MatButtonModule } from '@angular/material/button';
29
- import * as i7 from '@angular/material/checkbox';
30
- import { MatCheckboxModule } from '@angular/material/checkbox';
31
- import * as i5$1 from '@angular/material/icon';
32
- import { MatIconModule } from '@angular/material/icon';
33
- import * as i10 from '@angular/material/input';
34
- import { MatInputModule } from '@angular/material/input';
35
- import * as i11 from '@angular/material/select';
36
- import { MatSelectModule } from '@angular/material/select';
37
- import * as XLSX from 'xlsx';
38
- import * as i4$1 from '@angular/platform-browser';
39
- import * as i11$1 from '@angular/material/card';
40
- import { MatCardModule } from '@angular/material/card';
41
- import * as i17 from '@angular/material/progress-bar';
42
- import { MatProgressBarModule } from '@angular/material/progress-bar';
43
- import * as i20 from '@angular/material/toolbar';
44
- import { MatToolbarModule } from '@angular/material/toolbar';
45
- import * as i4 from '@angular/material/tooltip';
46
- import { MatTooltipModule } from '@angular/material/tooltip';
47
- import * as i1$2 from '@ngx-translate/core';
48
- import { TranslateModule } from '@ngx-translate/core';
49
- import { A11yModule } from '@angular/cdk/a11y';
50
- import { CdkAccordionModule } from '@angular/cdk/accordion';
51
- import { ClipboardModule } from '@angular/cdk/clipboard';
52
- import { PortalModule } from '@angular/cdk/portal';
53
- import { ScrollingModule } from '@angular/cdk/scrolling';
54
- import { CdkStepperModule } from '@angular/cdk/stepper';
55
- import { CdkTableModule } from '@angular/cdk/table';
56
- import { CdkTreeModule } from '@angular/cdk/tree';
57
- import { MatAutocompleteModule } from '@angular/material/autocomplete';
58
- import { MatBadgeModule } from '@angular/material/badge';
59
- import { MatBottomSheetModule } from '@angular/material/bottom-sheet';
60
- import { MatButtonToggleModule } from '@angular/material/button-toggle';
61
- import { MatChipsModule } from '@angular/material/chips';
62
- import { MatStepperModule } from '@angular/material/stepper';
63
- import { MatDatepickerModule } from '@angular/material/datepicker';
64
- import { MatDividerModule } from '@angular/material/divider';
65
- import { MatExpansionModule } from '@angular/material/expansion';
66
- import { MatGridListModule } from '@angular/material/grid-list';
67
- import { MatListModule } from '@angular/material/list';
68
- import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
69
- import { MatRadioModule } from '@angular/material/radio';
70
- import { MatSidenavModule } from '@angular/material/sidenav';
71
- import { MatSliderModule } from '@angular/material/slider';
72
- import { MatSlideToggleModule } from '@angular/material/slide-toggle';
73
- import { MatSnackBarModule } from '@angular/material/snack-bar';
74
- import { MatTabsModule } from '@angular/material/tabs';
75
- import { MatTreeModule } from '@angular/material/tree';
76
-
77
- class MatTableExtService {
78
- constructor(http) {
79
- this.http = http;
80
- this.selectedRow = new BehaviorSubject(null);
81
- this.selectedRowIndex = new BehaviorSubject(null);
82
- }
83
- }
84
- MatTableExtService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MatTableExtService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
85
- MatTableExtService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MatTableExtService, providedIn: 'root' });
86
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MatTableExtService, decorators: [{
87
- type: Injectable,
88
- args: [{
89
- providedIn: 'root'
90
- }]
91
- }], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
92
-
93
- class EditingComponent {
94
- constructor(dialogRef, dialogData, service) {
95
- this.dialogRef = dialogRef;
96
- this.dialogData = dialogData;
97
- this.service = service;
98
- this.keys = [];
99
- this.templateKeys = [];
100
- this.types = {};
101
- this.templateTypes = {};
102
- this.columns = [];
103
- this.templateRow = {};
104
- }
105
- ngOnInit() {
106
- this.setData(this.dialogData);
107
- }
108
- /**
109
- * @description This method is used to set data for editing.
110
- * @param value dialog Data
111
- */
112
- setData(value) {
113
- let row = value.row;
114
- let types = {};
115
- this.keys = [];
116
- this.columns = value.columns;
117
- this.columns.forEach((column) => {
118
- this.keys.push(column.field);
119
- if (column.type == 'selection') {
120
- types[column.field] = column.type;
121
- let temp = row[column.field];
122
- row[column.field] = {
123
- value: temp,
124
- options: column.options,
125
- };
126
- }
127
- else {
128
- types[column.field] = column.type;
129
- }
130
- });
131
- this.types = types;
132
- this.setTemplateRef(value);
133
- }
134
- /**
135
- * @description This method is used to set the data when data comes in from cus template.
136
- * @param value template value
137
- */
138
- setTemplateRef(value) {
139
- if (value.templateRef !== undefined) {
140
- this.templateRow = Object.assign({}, value.row);
141
- let types = {};
142
- this.templateKeys = [];
143
- this.columns.forEach((column) => {
144
- this.templateKeys.push(column.field);
145
- if (column.type == 'selection') {
146
- types[column.field] = column.type;
147
- let temp = this.templateRow[column.field];
148
- this.templateRow[column.field] = {
149
- value: temp,
150
- options: column.options,
151
- };
152
- }
153
- else {
154
- types[column.field] = column.type;
155
- }
156
- });
157
- this.templateTypes = types;
158
- this.templateRef = value.templateRef;
159
- }
160
- }
161
- /**
162
- * @description This method is triggered when dialog is closed and also emits the dialog closed event data.
163
- */
164
- closeDialog() {
165
- let rowData = Object.assign({}, this.dialogData.row);
166
- this.keys.forEach((key) => {
167
- if (this.types[key] === 'selection') {
168
- let temp = rowData[key].value;
169
- rowData[key] = temp;
170
- }
171
- });
172
- this.dialogRef.close(rowData);
173
- }
174
- /**
175
- * @description This method is called when the dialog is closed custom template action.
176
- * @param row row to be edited.
177
- * @param keys keys of columns
178
- * @param types column types
179
- */
180
- closeTemplateDialog(row, keys, types) {
181
- let rowData = Object.assign({}, row);
182
- keys.forEach((key) => {
183
- if (types[key] === 'selection') {
184
- let temp = rowData[key].value;
185
- rowData[key] = temp;
186
- }
187
- });
188
- this.dialogRef.close(rowData);
189
- }
190
- }
191
- EditingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EditingComponent, deps: [{ token: i1$1.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: MatTableExtService }], target: i0.ɵɵFactoryTarget.Component });
192
- EditingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: EditingComponent, selector: "app-editing", ngImport: i0, template: "<div *ngIf=\"!templateRef\" style=\"height: 100%;\" class=\"main-dialog-container\">\r\n <div mat-dialog-title class=\"dialog-title-container\">\r\n <h2 style=\"margin: 0;\">Edit Row</h2>\r\n <span class=\"example-spacer\"></span>\r\n <button mat-icon-button aria-label=\"Example icon button with a vertical three dot icon\">\r\n <mat-icon mat-dialog-close style=\"cursor: pointer;\" fxFlex=\"5\">close</mat-icon>\r\n </button>\r\n </div>\r\n <mat-dialog-content style=\"margin-right: 20px;\">\r\n <div style=\"display: flex; flex-direction: column;\">\r\n <ng-container *ngFor=\"let key of keys\">\r\n <!-- Number Type -->\r\n <mat-form-field *ngIf=\"types[key] == 'number'\" appearance=\"outline\" class=\"inline-editing-field\">\r\n <mat-label>{{key | titlecase}}</mat-label>\r\n <input matInput type=\"number\" [(ngModel)]=\"dialogData['row'][key]\" [ngModelOptions]=\"{standalone: true}\">\r\n </mat-form-field>\r\n \r\n <!-- String Type -->\r\n \r\n <mat-form-field *ngIf=\"types[key] == 'string'\" appearance=\"outline\" class=\"inline-editing-field\">\r\n <mat-label>{{key | titlecase}}</mat-label>\r\n <input matInput type=\"text\" [(ngModel)]=\"dialogData['row'][key]\" [ngModelOptions]=\"{standalone: true}\">\r\n </mat-form-field>\r\n <mat-form-field *ngIf=\"types[key] == 'date'\" appearance=\"outline\" class=\"inline-editing-field\">\r\n <mat-label>{{key | titlecase}}</mat-label>\r\n <input matInput type=\"text\" [(ngModel)]=\"dialogData['row'][key]\" [ngModelOptions]=\"{standalone: true}\">\r\n </mat-form-field>\r\n <!-- Selection Type -->\r\n \r\n <mat-form-field *ngIf=\"types[key] == 'selection'\" appearance=\"outline\" class=\"inline-editing-field\">\r\n <mat-label>{{key | titlecase}}</mat-label>\r\n <mat-select [value]=\"dialogData['row'][key].value\" [(ngModel)]=\"dialogData['row'][key].value\">\r\n <mat-option *ngFor=\"let option of dialogData['row'][key].options\" [value]=\"option\">\r\n {{option}}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n <!-- Boolean Type -->\r\n <p>\r\n <mat-checkbox *ngIf=\"types[key] == 'boolean'\" color=\"primary\" [(ngModel)]=\"dialogData['row'][key]\">\r\n <mat-label>{{key | titlecase}}</mat-label>\r\n </mat-checkbox>\r\n </p>\r\n </ng-container>\r\n </div>\r\n </mat-dialog-content>\r\n <div class=\"spacer\"></div>\r\n <mat-dialog-actions style=\"margin-top: 20px;\" align=\"end\">\r\n <button mat-raised-button color=\"warn\" mat-dialog-close>\r\n Cancel\r\n </button>\r\n <button mat-raised-button color=\"primary\" (click)=\"closeDialog()\">Save</button>\r\n </mat-dialog-actions>\r\n</div>\r\n<ng-container *ngIf=\"templateRef\" [ngTemplateOutlet]=\"templateRef\" [ngTemplateOutletContext]=\"{data:{row:templateRow,columns:columns,columnKeys:templateKeys,columnTypes:templateTypes,closeDialog:closeTemplateDialog}}\"></ng-container>", styles: [".main-dialog-container{display:flex;flex-direction:column}.main-dialog-container mat-dialog-content{overflow-y:auto;margin:0;padding:0 0 0 20px}.dialog-title-container{display:flex;align-items:center}.spacer{flex-grow:1}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i6.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i7.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i1$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i9.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i9.MatLabel, selector: "mat-label" }, { kind: "directive", type: i10.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i11.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "pipe", type: i3.TitleCasePipe, name: "titlecase" }] });
193
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: EditingComponent, decorators: [{
194
- type: Component,
195
- args: [{ selector: 'app-editing', template: "<div *ngIf=\"!templateRef\" style=\"height: 100%;\" class=\"main-dialog-container\">\r\n <div mat-dialog-title class=\"dialog-title-container\">\r\n <h2 style=\"margin: 0;\">Edit Row</h2>\r\n <span class=\"example-spacer\"></span>\r\n <button mat-icon-button aria-label=\"Example icon button with a vertical three dot icon\">\r\n <mat-icon mat-dialog-close style=\"cursor: pointer;\" fxFlex=\"5\">close</mat-icon>\r\n </button>\r\n </div>\r\n <mat-dialog-content style=\"margin-right: 20px;\">\r\n <div style=\"display: flex; flex-direction: column;\">\r\n <ng-container *ngFor=\"let key of keys\">\r\n <!-- Number Type -->\r\n <mat-form-field *ngIf=\"types[key] == 'number'\" appearance=\"outline\" class=\"inline-editing-field\">\r\n <mat-label>{{key | titlecase}}</mat-label>\r\n <input matInput type=\"number\" [(ngModel)]=\"dialogData['row'][key]\" [ngModelOptions]=\"{standalone: true}\">\r\n </mat-form-field>\r\n \r\n <!-- String Type -->\r\n \r\n <mat-form-field *ngIf=\"types[key] == 'string'\" appearance=\"outline\" class=\"inline-editing-field\">\r\n <mat-label>{{key | titlecase}}</mat-label>\r\n <input matInput type=\"text\" [(ngModel)]=\"dialogData['row'][key]\" [ngModelOptions]=\"{standalone: true}\">\r\n </mat-form-field>\r\n <mat-form-field *ngIf=\"types[key] == 'date'\" appearance=\"outline\" class=\"inline-editing-field\">\r\n <mat-label>{{key | titlecase}}</mat-label>\r\n <input matInput type=\"text\" [(ngModel)]=\"dialogData['row'][key]\" [ngModelOptions]=\"{standalone: true}\">\r\n </mat-form-field>\r\n <!-- Selection Type -->\r\n \r\n <mat-form-field *ngIf=\"types[key] == 'selection'\" appearance=\"outline\" class=\"inline-editing-field\">\r\n <mat-label>{{key | titlecase}}</mat-label>\r\n <mat-select [value]=\"dialogData['row'][key].value\" [(ngModel)]=\"dialogData['row'][key].value\">\r\n <mat-option *ngFor=\"let option of dialogData['row'][key].options\" [value]=\"option\">\r\n {{option}}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n <!-- Boolean Type -->\r\n <p>\r\n <mat-checkbox *ngIf=\"types[key] == 'boolean'\" color=\"primary\" [(ngModel)]=\"dialogData['row'][key]\">\r\n <mat-label>{{key | titlecase}}</mat-label>\r\n </mat-checkbox>\r\n </p>\r\n </ng-container>\r\n </div>\r\n </mat-dialog-content>\r\n <div class=\"spacer\"></div>\r\n <mat-dialog-actions style=\"margin-top: 20px;\" align=\"end\">\r\n <button mat-raised-button color=\"warn\" mat-dialog-close>\r\n Cancel\r\n </button>\r\n <button mat-raised-button color=\"primary\" (click)=\"closeDialog()\">Save</button>\r\n </mat-dialog-actions>\r\n</div>\r\n<ng-container *ngIf=\"templateRef\" [ngTemplateOutlet]=\"templateRef\" [ngTemplateOutletContext]=\"{data:{row:templateRow,columns:columns,columnKeys:templateKeys,columnTypes:templateTypes,closeDialog:closeTemplateDialog}}\"></ng-container>", styles: [".main-dialog-container{display:flex;flex-direction:column}.main-dialog-container mat-dialog-content{overflow-y:auto;margin:0;padding:0 0 0 20px}.dialog-title-container{display:flex;align-items:center}.spacer{flex-grow:1}\n"] }]
196
- }], ctorParameters: function () {
197
- return [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
198
- type: Inject,
199
- args: [MAT_DIALOG_DATA]
200
- }] }, { type: MatTableExtService }];
201
- } });
202
-
203
- class ResizeColumnDirective {
204
- constructor(renderer, el) {
205
- this.renderer = renderer;
206
- this.el = el;
207
- this.columnsResizable$ = false;
208
- this.onMouseDown = (event) => {
209
- this.pressed = true;
210
- this.startX = event.pageX;
211
- this.startWidth = this.column.offsetWidth;
212
- };
213
- this.onMouseMove = (event) => {
214
- const offset = 5;
215
- if (this.pressed && event.buttons) {
216
- this.renderer.addClass(this.table, "resizing");
217
- // Calculate width of column
218
- let width = this.startWidth + (event.pageX - this.startX - offset);
219
- const tableCells = Array.from(this.table.querySelectorAll(".mat-row")).map((row) => row.querySelectorAll(".mat-cell").item(this.index));
220
- // Set table header width
221
- this.renderer.setStyle(this.column, "width", `${width}px`);
222
- // Set table cells width
223
- for (const cell of tableCells) {
224
- if (cell && cell !== null)
225
- this.renderer.setStyle(cell, "width", `${width}px`);
226
- }
227
- }
228
- };
229
- this.onMouseUp = (event) => {
230
- if (this.pressed) {
231
- this.pressed = false;
232
- this.renderer.removeClass(this.table, "resizing");
233
- }
234
- };
235
- this.column = this.el.nativeElement;
236
- }
237
- set columnsResizable(val) {
238
- this.columnsResizable$ = val;
239
- }
240
- get columnsResizable() {
241
- return this.columnsResizable$;
242
- }
243
- ngOnInit() {
244
- if (this.columnsResizable$) {
245
- const row = this.renderer.parentNode(this.column);
246
- const thead = this.renderer.parentNode(row);
247
- this.table = this.renderer.parentNode(thead);
248
- const resizer = this.renderer.createElement("span");
249
- this.renderer.addClass(resizer, "resize-holder");
250
- this.renderer.setAttribute(resizer, 'id', "resizeHolderSpan");
251
- this.renderer.appendChild(this.column, resizer);
252
- this.renderer.listen(resizer, "mousedown", this.onMouseDown);
253
- this.renderer.listen(this.table, "mousemove", this.onMouseMove);
254
- this.renderer.listen("document", "mouseup", this.onMouseUp);
255
- }
256
- else {
257
- this.removeDragElementFromDom();
258
- }
259
- }
260
- ngOnChanges() {
261
- if (this.columnsResizable$) {
262
- const row = this.renderer.parentNode(this.column);
263
- const thead = this.renderer.parentNode(row);
264
- const resizer = this.renderer.createElement("span");
265
- this.table = this.renderer.parentNode(thead);
266
- this.renderer.addClass(resizer, "resize-holder");
267
- this.renderer.setAttribute(resizer, 'id', "resizeHolderSpan");
268
- this.renderer.appendChild(this.column, resizer);
269
- this.renderer.listen(resizer, "mousedown", this.onMouseDown);
270
- this.renderer.listen(this.table, "mousemove", this.onMouseMove);
271
- this.renderer.listen("document", "mouseup", this.onMouseUp);
272
- }
273
- else {
274
- this.removeDragElementFromDom();
275
- }
276
- }
277
- /**
278
- * @description This method is used remove resizing handlers from the table headers when column resizing is disabled.
279
- */
280
- removeDragElementFromDom() {
281
- let ele = document.getElementById('resizeHolderSpan');
282
- if (ele && ele !== null && ele !== undefined) {
283
- this.renderer.removeChild(this.column, ele);
284
- }
285
- }
286
- }
287
- ResizeColumnDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ResizeColumnDirective, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
288
- ResizeColumnDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.12", type: ResizeColumnDirective, selector: "[columnsResizable]", inputs: { columnsResizable: "columnsResizable", index: "index" }, usesOnChanges: true, ngImport: i0 });
289
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ResizeColumnDirective, decorators: [{
290
- type: Directive,
291
- args: [{
292
- selector: "[columnsResizable]"
293
- }]
294
- }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }]; }, propDecorators: { columnsResizable: [{
295
- type: Input
296
- }], index: [{
297
- type: Input
298
- }] } });
299
-
300
- class ColumnPinningComponent {
301
- constructor() {
302
- this.columnsChanged = new EventEmitter();
303
- this.icons = {
304
- left: 'pinLeft',
305
- right: 'pinRight',
306
- none: 'pinNone',
307
- };
308
- }
309
- ngOnInit() { }
310
- /**
311
- * @description This method is called when pin value changes for a column.
312
- * @param column column of which to set the pin value
313
- */
314
- changeValue(column) {
315
- if (column.pinned) {
316
- if (column.pinned == 'left') {
317
- this.setColumnPinValue(column, 'right');
318
- }
319
- else if (column.pinned == 'right') {
320
- this.setColumnPinValue(column, undefined);
321
- }
322
- }
323
- else {
324
- this.setColumnPinValue(column, 'left');
325
- }
326
- this.columnsChanged.emit(this.columns);
327
- }
328
- /**
329
- * @description This method is used to set the column pin value.
330
- * @param column column of which to set the pin value
331
- * @param value pin value to set
332
- */
333
- setColumnPinValue(column, value) {
334
- this.columns.forEach((col) => {
335
- if ((column === null || column === void 0 ? void 0 : column.header) == col.header) {
336
- col.pinned = value;
337
- }
338
- });
339
- }
340
- }
341
- ColumnPinningComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ColumnPinningComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
342
- ColumnPinningComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ColumnPinningComponent, selector: "app-column-pinning", inputs: { columns: "columns" }, outputs: { columnsChanged: "columnsChanged" }, ngImport: i0, template: "<div class=\"pinning-list-item\" *ngFor=\"let column of columns\" style=\"display: flex; \">\r\n <button mat-icon-button >\r\n <mat-icon (click)=\"changeValue(column)\" matTooltip=\"{{column['pinned'] ? (column['pinned'] | titlecase):'None'}}\"\r\n svgIcon=\"{{column['pinned'] =='left'|| column['pinned'] =='right' ? icons[column['pinned']]:'pinNone'}}\" class=\"pinning-icon\"></mat-icon>\r\n </button>\r\n <span class=\"column-headers\">{{column.header}}</span>\r\n</div>", styles: [".pinning-list-item{display:flex;justify-content:flex-start;align-items:baseline;height:3em}.column-headers{font-family:Roboto,Helvetica Neue,sans-serif}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i6.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "pipe", type: i3.TitleCasePipe, name: "titlecase" }] });
343
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ColumnPinningComponent, decorators: [{
344
- type: Component,
345
- args: [{ selector: 'app-column-pinning', template: "<div class=\"pinning-list-item\" *ngFor=\"let column of columns\" style=\"display: flex; \">\r\n <button mat-icon-button >\r\n <mat-icon (click)=\"changeValue(column)\" matTooltip=\"{{column['pinned'] ? (column['pinned'] | titlecase):'None'}}\"\r\n svgIcon=\"{{column['pinned'] =='left'|| column['pinned'] =='right' ? icons[column['pinned']]:'pinNone'}}\" class=\"pinning-icon\"></mat-icon>\r\n </button>\r\n <span class=\"column-headers\">{{column.header}}</span>\r\n</div>", styles: [".pinning-list-item{display:flex;justify-content:flex-start;align-items:baseline;height:3em}.column-headers{font-family:Roboto,Helvetica Neue,sans-serif}\n"] }]
346
- }], ctorParameters: function () { return []; }, propDecorators: { columns: [{
347
- type: Input
348
- }], columnsChanged: [{
349
- type: Output
350
- }] } });
351
-
352
- class FilterColumnsComponentComponent {
353
- constructor() {
354
- this.filterOutput = new EventEmitter();
355
- this.stringCtrl = new FormControl();
356
- this.numberCtrl = new FormControl();
357
- this.dateCtrl = new FormControl();
358
- this.booleanCtrl = new FormControl();
359
- this.selectionCtrl = new FormControl();
360
- }
361
- ngOnInit() {
362
- this.stringCtrl.valueChanges.subscribe((value) => {
363
- this.checkValue(value);
364
- });
365
- this.dateCtrl.valueChanges.subscribe((value) => {
366
- this.checkValue(value);
367
- });
368
- this.numberCtrl.valueChanges.subscribe((value) => {
369
- this.checkValue(value);
370
- });
371
- this.booleanCtrl.valueChanges.subscribe((value) => {
372
- this.checkValue(value);
373
- });
374
- this.selectionCtrl.valueChanges.subscribe((value) => {
375
- this.checkValue(value);
376
- });
377
- }
378
- /**
379
- * @description This method is make value is valid and not null.
380
- * @param value value to check its type.
381
- */
382
- checkValue(value) {
383
- if (value || value == '') {
384
- this.emitOutput(value);
385
- }
386
- else if (value == null) {
387
- this.emitOutput('');
388
- }
389
- }
390
- /**
391
- * @description This method will emit seach value to parent component.
392
- * @param value value on which base table rows are filtered.
393
- */
394
- emitOutput(value) {
395
- let obj = { [this.obj.field]: value };
396
- this.filterOutput.emit(obj);
397
- }
398
- }
399
- FilterColumnsComponentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FilterColumnsComponentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
400
- FilterColumnsComponentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: FilterColumnsComponentComponent, selector: "app-filter-columns-component", inputs: { obj: "obj" }, outputs: { filterOutput: "filterOutput" }, ngImport: i0, template: "\r\n <ng-container *ngIf=\"obj\">\r\n <!-- Number Type -->\r\n <mat-form-field *ngIf=\"obj.type == 'number'\" appearance=\"outline\" class=\"inline-editing-field\" >\r\n <input matInput type=\"number\" [formControl]=\"numberCtrl\">\r\n </mat-form-field>\r\n \r\n <!-- String Type -->\r\n <mat-form-field *ngIf=\"obj.type == 'string'\" appearance=\"outline\" class=\"inline-editing-field\">\r\n <input matInput type=\"text\" [formControl]=\"stringCtrl\">\r\n </mat-form-field>\r\n <mat-form-field *ngIf=\"obj.type == 'date'\" appearance=\"outline\" class=\"inline-editing-field\">\r\n <input matInput type=\"date\" [formControl]=\"dateCtrl\">\r\n </mat-form-field>\r\n <!-- Selection Type -->\r\n <mat-form-field *ngIf=\"obj.type == 'selection'\" appearance=\"outline\" class=\"inline-editing-field\">\r\n <mat-select [value]=\"\" [formControl]=\"selectionCtrl\">\r\n <mat-option *ngFor=\"let option of obj.options\" [value]=\"option\">\r\n {{option}}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n <!-- Boolean Type -->\r\n <mat-checkbox (click)=\"$event.stopPropagation()\" *ngIf=\"obj.type == 'boolean'\" color=\"primary\" [formControl]=\"booleanCtrl\"></mat-checkbox>\r\n\r\n </ng-container>", styles: [""], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i7.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i9.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i10.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i11.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }] });
401
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FilterColumnsComponentComponent, decorators: [{
402
- type: Component,
403
- args: [{ selector: 'app-filter-columns-component', template: "\r\n <ng-container *ngIf=\"obj\">\r\n <!-- Number Type -->\r\n <mat-form-field *ngIf=\"obj.type == 'number'\" appearance=\"outline\" class=\"inline-editing-field\" >\r\n <input matInput type=\"number\" [formControl]=\"numberCtrl\">\r\n </mat-form-field>\r\n \r\n <!-- String Type -->\r\n <mat-form-field *ngIf=\"obj.type == 'string'\" appearance=\"outline\" class=\"inline-editing-field\">\r\n <input matInput type=\"text\" [formControl]=\"stringCtrl\">\r\n </mat-form-field>\r\n <mat-form-field *ngIf=\"obj.type == 'date'\" appearance=\"outline\" class=\"inline-editing-field\">\r\n <input matInput type=\"date\" [formControl]=\"dateCtrl\">\r\n </mat-form-field>\r\n <!-- Selection Type -->\r\n <mat-form-field *ngIf=\"obj.type == 'selection'\" appearance=\"outline\" class=\"inline-editing-field\">\r\n <mat-select [value]=\"\" [formControl]=\"selectionCtrl\">\r\n <mat-option *ngFor=\"let option of obj.options\" [value]=\"option\">\r\n {{option}}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n <!-- Boolean Type -->\r\n <mat-checkbox (click)=\"$event.stopPropagation()\" *ngIf=\"obj.type == 'boolean'\" color=\"primary\" [formControl]=\"booleanCtrl\"></mat-checkbox>\r\n\r\n </ng-container>" }]
404
- }], ctorParameters: function () { return []; }, propDecorators: { obj: [{
405
- type: Input
406
- }], filterOutput: [{
407
- type: Output
408
- }] } });
409
-
410
- class MatTableExtComponent {
411
- constructor(dialog, service, formBuildersService, domSanitizer, matIconRegistry, cdr) {
412
- this.dialog = dialog;
413
- this.service = service;
414
- this.formBuildersService = formBuildersService;
415
- this.domSanitizer = domSanitizer;
416
- this.matIconRegistry = matIconRegistry;
417
- this.cdr = cdr;
418
- this.columns = [];
419
- this.columnResizable = false;
420
- this.stripedRows = false;
421
- this.rowHover = false;
422
- this.inlineRowEditing = false;
423
- this.inCellEditing = false;
424
- this.popupRowEditing = false;
425
- this.enableDelete = false;
426
- this.rowSelection = false;
427
- this.multiRowSelection = false;
428
- this.stickyFooter = false;
429
- this.stickyHeader = false;
430
- this.showFooterRow = false;
431
- this.columnFilter = false;
432
- this.loadingIndicator = false;
433
- this.sorting = false;
434
- this.showToolbar = false;
435
- this.toolbarTitle = '';
436
- this.tableHeight = '';
437
- this.toolbarHeight = '50px';
438
- this.tableWidth = '100%';
439
- this.scrollbarH = false;
440
- this.columnHidable = false;
441
- this.columnPinnable = false;
442
- this.globalSearch = false;
443
- this.expandRows = false;
444
- this.dndColumns = false;
445
- this.showPaginator = true;
446
- this.showFirstLastButtons = false;
447
- this.exportButtonEnable = false;
448
- this.pageSizeOptions = [10, 50, 100];
449
- this.cellTemplateRefMap = {};
450
- // Table outputs
451
- this.inlineChange = new EventEmitter();
452
- this.cellChange = new EventEmitter();
453
- this.popupChange = new EventEmitter();
454
- this.rowDeleted = new EventEmitter();
455
- this.scroll = new EventEmitter();
456
- this.selectionChanged = new EventEmitter();
457
- this.expansionChange = new EventEmitter();
458
- this.tableID = new Date().getTime();
459
- this.columnPinningOptions = [];
460
- this.exportMenuCtrl = false;
461
- this.columnPinMenuCtrl = false;
462
- this.hideShowMenuCtrl = false;
463
- this.columnFilterBySelection = false;
464
- this.rowDataTemp = {};
465
- this.inlineEditingTemplateRefData = {};
466
- this.displayedColumns = [];
467
- this.showHideColumnsArray = [];
468
- this.columnsList = [];
469
- this.columnsArray = [];
470
- this.headersFiltersIds = [];
471
- this.columnsToDisplayWithExpand = [];
472
- this.selection = new SelectionModel(false, []);
473
- this.hiddenCtrl = new SelectionModel(true, []);
474
- this.tableData = [];
475
- this.filterValues = {};
476
- this.globalFilter = '';
477
- this.showHideFilter = '';
478
- this.individualFilter = '';
479
- this.toggleFilters = false;
480
- this.hideRows = false;
481
- this.currentRowIndex = -1;
482
- this.currentRow = {};
483
- this.cellEditing = {};
484
- this.menuX = 0;
485
- this.menuY = 0;
486
- this.dynamicDisplayedColumns = [
487
- { filter: false, name: 'select', show: false },
488
- { filter: false, name: 'edit', show: false },
489
- { filter: false, name: 'popup', show: false },
490
- { filter: false, name: 'delete', show: false },
491
- { filter: false, name: 'expand', show: false },
492
- ];
493
- this.inputPropertyKeys = [
494
- 'dataSource',
495
- 'columns',
496
- 'inlineRowEditing',
497
- 'popupRowEditing',
498
- 'enableDelete',
499
- 'rowSelection',
500
- 'multiRowSelection',
501
- 'stickyHeader',
502
- 'stickyFooter',
503
- 'columnFilter',
504
- 'globalSearch',
505
- 'expandRows',
506
- 'sorting',
507
- ];
508
- /**
509
- * @description This mapping is used to set and update changesin the table.
510
- */
511
- this.setPropertiesMap = {
512
- dataSource: (value) => this.setTableDataSource(value),
513
- columns: (value) => this.setColumnsData(value.currentValue),
514
- inlineRowEditing: (value) => this.showHideColumn('edit', value.currentValue),
515
- popupRowEditing: (value) => this.showHideColumn('popup', value.currentValue),
516
- enableDelete: (value) => this.showHideColumn('delete', value.currentValue),
517
- rowSelection: (value) => this.setRowSelection(value.currentValue),
518
- multiRowSelection: (value) => {
519
- this.selection = new SelectionModel(value.currentValue, []);
520
- },
521
- stickyHeader: (value) => {
522
- this.stickyHeader = value.currentValue;
523
- },
524
- stickyFooter: (value) => {
525
- this.stickyFooter = value.currentValue;
526
- },
527
- columnFilter: (value) => this.setColumnFilter(value.currentValue),
528
- globalSearch: (value) => (this.dataSource.filterPredicate = this.createFilter()),
529
- expandRows: (value) => {
530
- this.loadingIndicator = true;
531
- this.dataSource = new MatTableDataSource(this.tableData);
532
- if (value.currentValue == true) {
533
- if (!this.displayedColumns.includes('expand')) {
534
- this.displayedColumns.push('expand');
535
- this.columnsToDisplayWithExpand = [...this.displayedColumns];
536
- }
537
- }
538
- else {
539
- this.columnsToDisplayWithExpand = [...this.displayedColumns];
540
- if (this.displayedColumns.includes('expand')) {
541
- let index = this.displayedColumns.indexOf('expand');
542
- this.displayedColumns.splice(index, 1);
543
- }
544
- this.expandedElement = null;
545
- }
546
- setTimeout(() => {
547
- this.loadingIndicator = false;
548
- }, 200);
549
- },
550
- sorting: (value) => (this.dataSource.sort = this.sort),
551
- };
552
- /**
553
- * @description This method will take data from inline editing template and update in table data source.
554
- * @param row updated row from inline editing template.
555
- */
556
- this.updateInlineTemplateData = (row) => {
557
- this.service.selectedRow.next(row);
558
- };
559
- this.addIconsToRegistry();
560
- if (this.dataSource) {
561
- this.tableData = this.dataSource.data;
562
- }
563
- }
564
- /**
565
- *
566
- * @param changes changes captured each time user changes property value.
567
- */
568
- ngOnChanges(changes) {
569
- this.setPropertyValue(changes);
570
- }
571
- ngOnInit() {
572
- if (this.dataSource) {
573
- this.dataSource.filterPredicate = this.createFilter();
574
- }
575
- }
576
- ngAfterViewInit() {
577
- if (this.dataSource) {
578
- this.dataSource.paginator = this.paginator;
579
- this.dataSource.sort = this.sort;
580
- }
581
- }
582
- /**
583
- * @description checks and updates the the column's hide and show properties.
584
- */
585
- setColumnHideShow() {
586
- if (this.hideShowMenuGroup !== undefined &&
587
- this.hideShowMenuGroup !== null) {
588
- this.updateColumnsHideShow(this.hideShowMenuGroup.value);
589
- }
590
- }
591
- /**
592
- * @description set the properties of the table.
593
- * @param changes changes captured each time user changes property value.
594
- */
595
- setPropertyValue(changes) {
596
- let keys = Object.keys(changes);
597
- keys.forEach((property) => {
598
- if (this.inputPropertyKeys.includes(property)) {
599
- this.setPropertiesMap[property](changes[property]);
600
- }
601
- else if (property == 'showToolbar') {
602
- if (changes['columns']) {
603
- this.setToolbarMenuControls(changes['columns'].currentValue);
604
- }
605
- else {
606
- this.setToolbarMenuControls(this.columnsArray);
607
- }
608
- }
609
- });
610
- }
611
- /**
612
- * @description used set data source for table.
613
- * @param value data source value from user.
614
- */
615
- setTableDataSource(value) {
616
- if (value.currentValue) {
617
- this.tableData = value.currentValue.data;
618
- this.dataSource = value.currentValue;
619
- this.reCal();
620
- }
621
- else {
622
- this.dataSource = new MatTableDataSource([{}]);
623
- }
624
- }
625
- /**
626
- * @description used create seletion model and set selection column visibility.
627
- * @param value boolean value to show or hide selection Column from table.
628
- */
629
- setRowSelection(value) {
630
- this.selection = new SelectionModel(true, []);
631
- this.updateSelectionColumnVisibility(value);
632
- }
633
- /**
634
- * @description create filter header row and assigns filter predicate to table data source.
635
- * @param value boolean value to change visibility of column filter row.
636
- */
637
- setColumnFilter(value) {
638
- if (value) {
639
- let array = [];
640
- this.columnsArray.forEach((column, i) => {
641
- if (this.dynamicDisplayedColumns.filter((a) => a.name == (column === null || column === void 0 ? void 0 : column.field))[0]
642
- .show) {
643
- array.push((column === null || column === void 0 ? void 0 : column.field) + '_' + i);
644
- }
645
- });
646
- this.headersFiltersIds = array;
647
- this.dataSource.filterPredicate = this.createFilter();
648
- }
649
- else {
650
- this.headersFiltersIds = [];
651
- this.dataSource.filter = '';
652
- }
653
- this.toggleFilters = value;
654
- }
655
- /**
656
- * @description This method returns the list of visible column names.
657
- * @returns list of visible column names.
658
- */
659
- getDisplayedColumns() {
660
- let list = this.dynamicDisplayedColumns
661
- .filter((cd) => cd.show)
662
- .map((cd) => cd.name);
663
- return list;
664
- }
665
- /**
666
- * @param menuType type of menu to open from toolbar.
667
- * @param event mouse event to open menu on that location.
668
- */
669
- openMenu(menuType, event) {
670
- this.menuX = event.clientX;
671
- this.menuY = event.clientY;
672
- switch (menuType) {
673
- case 'export': {
674
- this.exportMenuCtrl = true;
675
- this.menuTrigger.openMenu();
676
- break;
677
- }
678
- case 'hideShow': {
679
- this.hideShowMenuCtrl = true;
680
- this.openHideShowMenu(this.columnsArray);
681
- break;
682
- }
683
- case 'columnPin': {
684
- this.columnPinMenuCtrl = true;
685
- this.openHideShowMenu(this.columnsArray);
686
- break;
687
- }
688
- }
689
- }
690
- /**
691
- * @description triggers when menu is closed and reset the required controls.
692
- */
693
- menuClosed() {
694
- this.exportMenuCtrl = false;
695
- }
696
- /**
697
- * @description set list of columns to display in table.
698
- * @param columns columns array from user input.
699
- */
700
- setColumnsData(columns) {
701
- if (columns.length) {
702
- this.columnsArray = [...columns];
703
- this.setColumnsList(columns);
704
- }
705
- }
706
- /**
707
- * @description set list of columns to display in table.
708
- * @param columns columns array from user input with configurations.
709
- */
710
- setColumnsList(columns) {
711
- this.columnsList = [];
712
- this.displayedColumns = ['select', 'edit', 'popup', 'delete'];
713
- let columnsArray = [];
714
- columns.forEach((col) => {
715
- if (typeof (col === null || col === void 0 ? void 0 : col.header) == 'string') {
716
- this.columnsList.push(col === null || col === void 0 ? void 0 : col.header);
717
- this.displayedColumns.push(col === null || col === void 0 ? void 0 : col.field);
718
- columnsArray.push({ filter: true, name: col === null || col === void 0 ? void 0 : col.field, show: !col.hide });
719
- }
720
- });
721
- this.dynamicDisplayedColumns = [
722
- { filter: false, name: 'select', show: false },
723
- { filter: false, name: 'edit', show: false },
724
- { filter: false, name: 'popup', show: false },
725
- { filter: false, name: 'delete', show: false },
726
- ];
727
- this.dynamicDisplayedColumns = columnsArray.concat(this.dynamicDisplayedColumns);
728
- }
729
- /**
730
- * @description Take boolean value and name column and update its visibility status in table.
731
- * @param name name of the column to set visibility.
732
- * @param value boolean value to set visibility of the column.
733
- */
734
- showHideColumn(name, value) {
735
- this.dynamicDisplayedColumns.filter((a) => a.name == name)[0].show = value;
736
- if (this.columnFilter) {
737
- this.setColumnFilter(true);
738
- }
739
- }
740
- /**
741
- * @description This method will position the selection column to first and also update its visibility.
742
- * @param value value used to set visibility of the selection column.
743
- */
744
- updateSelectionColumnVisibility(value) {
745
- let columnName = 'select';
746
- let column = this.dynamicDisplayedColumns.filter((a) => a.name == columnName)[0];
747
- let index = this.dynamicDisplayedColumns.findIndex((column) => column.name == columnName);
748
- if (index > -1) {
749
- this.dynamicDisplayedColumns.splice(index, 1);
750
- this.dynamicDisplayedColumns.unshift(column);
751
- this.dynamicDisplayedColumns.filter((column) => column.name == columnName)[0].show = value;
752
- }
753
- }
754
- /**
755
- * @description This method is used to update the position of column in columns array according to its dropped position.
756
- * @param event CdkDragDrop used to update column position in columns array.
757
- */
758
- onDrop(event) {
759
- if (this.dndColumns) {
760
- let adjustedValue = 0;
761
- if (this.dynamicDisplayedColumns[0].name == 'select' &&
762
- this.dynamicDisplayedColumns[0].show == false) {
763
- adjustedValue = 1;
764
- }
765
- moveItemInArray(this.dynamicDisplayedColumns, event.previousIndex + adjustedValue, event.currentIndex + adjustedValue);
766
- }
767
- }
768
- /**
769
- * @description This method create filter predicate function which will set search value to table filters
770
- * for both global and individual colum filtering.
771
- * @returns returns boolean value to filter rows in table.
772
- */
773
- createFilter() {
774
- const tableFilterPredicate = (data, filter) => {
775
- let result = true;
776
- // search all column fields
777
- if (this.globalFilter) {
778
- let expression = '';
779
- let keys = Object.keys(data);
780
- keys.forEach((key) => {
781
- expression =
782
- expression +
783
- `data.${key}.toString().trim().toLowerCase().indexOf(this.globalFilter.toLowerCase()) !== -1 ||`;
784
- });
785
- if (expression.charAt(expression.length - 2) +
786
- expression.charAt(expression.length - 1) ==
787
- '||') {
788
- expression = expression.substring(0, expression.length - 2);
789
- }
790
- result = eval(expression);
791
- }
792
- if (!result) {
793
- return false;
794
- }
795
- let searchString = JSON.parse(filter);
796
- //search single column field
797
- if (this.individualFilter) {
798
- return (data[this.individualFilter]
799
- .toString()
800
- .trim()
801
- .toLowerCase()
802
- .indexOf(searchString[this.individualFilter].toString().toLowerCase()) !== -1);
803
- }
804
- return true;
805
- };
806
- return tableFilterPredicate;
807
- }
808
- /**
809
- * @description assigns the search value to mat table data source to apply the filter.
810
- * @param searchValue value to be searched from table rows.
811
- */
812
- applyGlobalFilter(searchValue) {
813
- this.globalFilter = searchValue;
814
- let columns = {};
815
- this.columnsArray.forEach((column) => {
816
- if (column.field)
817
- columns[column.field] = searchValue;
818
- });
819
- this.dataSource.filter = JSON.stringify(columns);
820
- }
821
- /**
822
- * @description This method is used to apply column based filtering
823
- * @param searchValue value to be searched from table rows.
824
- * @param column filter will be applied based on this column field.
825
- */
826
- applyColumnFilter(searchValue, column) {
827
- this.individualFilter = column.field;
828
- this.filterValues[column.field] = searchValue[column.field];
829
- this.dataSource.filter = JSON.stringify(this.filterValues);
830
- }
831
- /**
832
- * @description This method will take row and its index enable inline editing tools on that row.
833
- * @param row row on which user wants to do edit.
834
- * @param index index of the row where inline editing will be enabled.
835
- */
836
- enableInlineEditing(row, index) {
837
- const rowData = {};
838
- rowData['e' + index] = Object.assign({}, row);
839
- this.rowDataTemp = rowData;
840
- setTimeout(() => {
841
- this.tableData[index]['editable'] = !this.tableData[index]['editable'];
842
- }, 0);
843
- }
844
- /**
845
- * @description This method will create and return data to inline editing template.
846
- * @param row row on which user wants to do edit.
847
- * @param index index of the row where inline editing will be enabled.
848
- * @param column current column of the table.
849
- */
850
- getInlineEditingData(row, index, column) {
851
- this.inlineEditingTemplateRefData = {
852
- row: Object.assign({}, row),
853
- column: Object.assign({}, column),
854
- index: index,
855
- updateFunc: this.updateInlineTemplateData,
856
- };
857
- return this.inlineEditingTemplateRefData;
858
- }
859
- /**
860
- * @description This method set data for in-cell editing.
861
- * @param row row on which user wants to do edit.
862
- * @param index index of the row where inline editing will be enabled.
863
- */
864
- setCellData(row, index) {
865
- this.currentRow = Object.assign({}, row);
866
- this.currentRowIndex = index;
867
- this.rowDataTemp['e' + index] = Object.assign({}, row);
868
- }
869
- /**
870
- * @description This will restore the data and cencel the inline editing.
871
- * @param row row on which user wants to do edit.
872
- * @param index index of the row where inline editing will be enabled.
873
- */
874
- cancelInlineEditing(row, index) {
875
- this.tableData.filter((a, i) => i == index)[0]['editable'] =
876
- !this.tableData.filter((a, i) => i == index)[0]['editable'];
877
- this.dataSource = new MatTableDataSource(this.tableData);
878
- this.rowDataTemp['e' + index] = {};
879
- this.service.selectedRow.next(undefined);
880
- }
881
- /**
882
- * @description This method will save and update the inline editing data and emit the update row and index.
883
- * @param row row on which user wants to do edit.
884
- * @param index index of the row where inline editing will be enabled.
885
- */
886
- saveInlineEditing(row, index) {
887
- if (!this.inlineEditingTemplateRef) {
888
- this.tableData[index] = Object.assign({}, this.rowDataTemp['e' + index]);
889
- row = Object.assign({}, this.rowDataTemp['e' + index]);
890
- }
891
- else {
892
- let changedData = this.service.selectedRow.value;
893
- if (changedData) {
894
- this.tableData[index] = Object.assign({}, changedData);
895
- }
896
- }
897
- this.dataSource = new MatTableDataSource(this.tableData);
898
- this.rowDataTemp['e' + index] = {};
899
- let data = {
900
- row: row,
901
- index: index,
902
- };
903
- this.inlineChange.emit(data);
904
- this.tableData[index]['editable'] = false;
905
- }
906
- /**
907
- * @description This method will save and update the cell editing data and emit the update row and index.
908
- */
909
- saveCellEditing() {
910
- this.cellEditing = {};
911
- let index = this.currentRowIndex;
912
- if (index > -1) {
913
- if (this.cellEditingTemplateRef) {
914
- let changedData = this.service.selectedRow.value;
915
- if (changedData) {
916
- this.tableData[index] = Object.assign({}, changedData);
917
- }
918
- }
919
- else {
920
- this.tableData[index] = Object.assign({}, this.rowDataTemp['e' + index]);
921
- }
922
- this.dataSource = new MatTableDataSource(this.tableData);
923
- this.rowDataTemp['e' + index] = {};
924
- let data = {
925
- row: Object.assign({}, this.tableData[index]),
926
- index: index,
927
- };
928
- this.currentRowIndex = -1;
929
- this.cellChange.emit(data);
930
- }
931
- }
932
- /**
933
- * @description This method will delete the row from the given index and emit the deleted row and index.
934
- * @param row row to be deleted.
935
- * @param index index of the row to be deleted.
936
- */
937
- deleteRow(row, index) {
938
- this.tableData.splice(index, 1);
939
- this.dataSource = new MatTableDataSource(this.tableData);
940
- this.dataSource.paginator = this.paginator;
941
- this.dataSource.sort = this.sort;
942
- this.rowDeleted.emit({ removedRow: row, fromIndex: index });
943
- }
944
- /**
945
- * @description This method will expand or collapse the row and emit expand event.
946
- * @param row row to be expanded or collapsed.
947
- * @param expand value used to expand or collapse the row.
948
- * @param index index of the row.
949
- */
950
- expandRow(row, expand, index) {
951
- if (this.expandRows) {
952
- this.expansionChange.emit({ data: row, expanded: expand, index: index });
953
- this.expandedElement = this.expandedElement === row ? null : row;
954
- }
955
- }
956
- /**
957
- * @description This method is used to set data for popup component and open editing dialog.
958
- * @param row row which used want to edit.
959
- */
960
- openEditingDialog(row) {
961
- const dialogConfig = new MatDialogConfig();
962
- dialogConfig.disableClose = true;
963
- dialogConfig.width = '40%';
964
- dialogConfig.height = '70%';
965
- dialogConfig.maxWidth = '100%';
966
- let rowData = Object.assign({}, row);
967
- dialogConfig.data = {
968
- row: rowData,
969
- columns: [...this.columnsArray],
970
- templateRef: this.popupEditingTemplateRef,
971
- };
972
- this.dialog
973
- .open(EditingComponent, dialogConfig)
974
- .afterClosed()
975
- .subscribe((data) => {
976
- let index = this.tableData.indexOf(row);
977
- if (data && index > -1) {
978
- this.tableData[index] = data;
979
- this.dataSource = new MatTableDataSource(this.tableData);
980
- let dataChange = {
981
- row: data,
982
- index: index,
983
- };
984
- this.popupChange.emit(dataChange);
985
- }
986
- });
987
- }
988
- /**
989
- * @description used to check whether all rows are selected.
990
- */
991
- isAllSelected() {
992
- const numSelected = this.selection.selected.length;
993
- const numRows = this.dataSource.data.length;
994
- return numSelected === numRows;
995
- }
996
- /**
997
- * @description this method is used to toggle the all and no rows selection.
998
- */
999
- toggleAllRows() {
1000
- if (this.isAllSelected()) {
1001
- this.selection.clear();
1002
- return;
1003
- }
1004
- this.selection.select(...this.dataSource.data);
1005
- }
1006
- /**
1007
- * @description This method is used return aria-label for selection column checkboxs.
1008
- * @param row row from table.
1009
- * @returns labels for selection column checkboxs.
1010
- */
1011
- checkboxLabel(row) {
1012
- if (!row) {
1013
- return `${this.isAllSelected() ? 'deselect' : 'select'} all`;
1014
- }
1015
- return `${this.selection.isSelected(row) ? 'deselect' : 'select'} row ${row.position + 1}`;
1016
- }
1017
- /**
1018
- * @description create form control for columns for hiding and and pinning purpose
1019
- * @param columns list of columns to be displayed
1020
- */
1021
- setToolbarMenuControls(columns) {
1022
- if (columns.length > 0 && this.showToolbar) {
1023
- const group = this.formBuildersService.group({});
1024
- columns.forEach((column) => {
1025
- const control = this.formBuildersService.control(true);
1026
- group.addControl(column.field, control);
1027
- });
1028
- this.hideShowMenuGroup = group;
1029
- }
1030
- }
1031
- /**
1032
- * @param column current column
1033
- * @param event mouse event used to set the menu position
1034
- */
1035
- openPinnablePropertyMenu(column, event) {
1036
- this.menuX = event.clientX;
1037
- this.menuY = event.clientY;
1038
- let options = [
1039
- {
1040
- label: 'Pin Left',
1041
- value: 'left',
1042
- selected: false,
1043
- field: column.field,
1044
- },
1045
- {
1046
- label: 'Pin Right',
1047
- value: 'right',
1048
- selected: false,
1049
- field: column.field,
1050
- },
1051
- { label: 'No Pin', value: null, selected: false, field: column.field },
1052
- ];
1053
- if (column.pinned && column.pinned !== null) {
1054
- options.forEach((opt) => {
1055
- if (opt.value === column.pinned) {
1056
- opt.selected = true;
1057
- }
1058
- });
1059
- }
1060
- else if (column.pinned == null || column.pinned == 'null') {
1061
- options[2].selected = true;
1062
- }
1063
- this.columnPinningOptions = options;
1064
- this.columnMenuTrigger.openMenu();
1065
- }
1066
- /**
1067
- * @description This method is used to reset menu checks when required.
1068
- */
1069
- resetMenuChecks() {
1070
- this.hideShowMenuCtrl = false;
1071
- this.showHideColumnsArray = [];
1072
- this.columnPinMenuCtrl = false;
1073
- this.columnPinningOptions = [];
1074
- }
1075
- /**
1076
- * @description This method is used to filter columns for menus like pinning or hide show menu.
1077
- * @param value search value to filter colunms
1078
- */
1079
- filterColumns(value) {
1080
- if (value !== '') {
1081
- this.showHideColumnsArray = this.columnsArray.filter((col) => {
1082
- return col.header.toLowerCase().includes(value.toLowerCase());
1083
- });
1084
- }
1085
- else {
1086
- this.showHideColumnsArray = this.columnsArray;
1087
- }
1088
- }
1089
- /**
1090
- * @description This method is used to open hide show column menu.
1091
- * @param columns columns array to display in hide show menu.
1092
- */
1093
- openHideShowMenu(columns) {
1094
- this.showHideColumnsArray = [...columns];
1095
- this.columnMenuTrigger.openMenu();
1096
- }
1097
- /**
1098
- * @param values columns
1099
- */
1100
- updateColumnsHideShow(values) {
1101
- let keys = Object.keys(values);
1102
- keys.forEach((key) => {
1103
- this.showHideColumn(key, values[key]);
1104
- });
1105
- }
1106
- /**
1107
- * @description This method is called when the table rows are scrolled.
1108
- * @param event scroll event
1109
- */
1110
- onScroll(event) {
1111
- this.scroll.emit(event);
1112
- }
1113
- /**
1114
- * @param row row to be toggled
1115
- * @param index index of toggled row
1116
- */
1117
- setSelectedRows(row, index) {
1118
- this.selection.toggle(row);
1119
- if (this.selection.isSelected(row)) {
1120
- this.selectionChanged.emit({ row: row, index: index, isSelected: true });
1121
- }
1122
- else {
1123
- this.selectionChanged.emit({ row: row, index: index, isSelected: false });
1124
- }
1125
- }
1126
- /**
1127
- * @description This method is used to display all hidden rows.
1128
- */
1129
- showHiddenRows() {
1130
- this.hideRows = false;
1131
- this.selection.clear();
1132
- this.hiddenCtrl.clear();
1133
- }
1134
- /**
1135
- * @description This method is used to hide all selected rows.
1136
- */
1137
- hideSelectedRows() {
1138
- if (!this.selection.isEmpty()) {
1139
- let values = [...this.selection.selected];
1140
- values.forEach((value) => {
1141
- if (!this.hiddenCtrl.isSelected(value)) {
1142
- this.hiddenCtrl.toggle(value);
1143
- }
1144
- });
1145
- this.selection.clear();
1146
- this.hideRows = true;
1147
- }
1148
- }
1149
- /**
1150
- * @description This method is used to recalculate the required values for table.
1151
- */
1152
- reCal() {
1153
- if (this.showPaginator) {
1154
- this.dataSource.paginator = this.paginator;
1155
- }
1156
- if (this.sorting) {
1157
- this.dataSource.sort = this.sort;
1158
- }
1159
- if (this.columnFilter) {
1160
- this.dataSource.filterPredicate = this.createFilter();
1161
- }
1162
- }
1163
- /**
1164
- * @description This method is called in constructor method to add SVGs into icon registration.
1165
- */
1166
- addIconsToRegistry() {
1167
- let y = this.domSanitizer.bypassSecurityTrustResourceUrl(`assets/pinRight.svg`);
1168
- let iconNames = ['pinLeft', 'pinRight', 'pinNone', 'pinned', 'pinIcon'];
1169
- iconNames.forEach((icon) => {
1170
- this.matIconRegistry.addSvgIcon(icon, this.domSanitizer.bypassSecurityTrustResourceUrl(`assets/${icon}.svg`));
1171
- });
1172
- }
1173
- /**
1174
- * @description This method is used to export table data.
1175
- * @param type type of file to be exported.
1176
- */
1177
- exportTable(type) {
1178
- var element = document.getElementById('matTableExt' + this.tableID);
1179
- var ws = XLSX.utils.table_to_sheet(element);
1180
- ws = this.writeSheetData(ws);
1181
- const wb = XLSX.utils.book_new();
1182
- XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
1183
- XLSX.writeFile(wb, `tablesheets.${type}`);
1184
- }
1185
- /**
1186
- * @description This method is used to split name of filter row header to get index.
1187
- * @param value value to be splited for index.
1188
- * @returns Will return index of column from value.
1189
- */
1190
- returnIndex(value) {
1191
- return Number(value.split('_')[1]);
1192
- }
1193
- /**
1194
- * @description This method is used to manage column filtering, expanded data for exporting.
1195
- * @param ws work sheet
1196
- * @returns custom generated worksheet to be used in export.
1197
- */
1198
- writeSheetData(ws) {
1199
- let displayedColumns = this.getDisplayedColumns();
1200
- var nMerges = this.getMergeIndex(ws['!merges'] || []);
1201
- var merges = ws['!merges'] || [];
1202
- let data = {
1203
- '!cols': [],
1204
- '!rows': [],
1205
- '!merges': nMerges,
1206
- };
1207
- var range = XLSX.utils.decode_range(ws['!ref'] || '');
1208
- let extracolumns = ['popup', 'delete', 'select', 'edit'];
1209
- let keys = Object.keys(ws);
1210
- let nKey = 'A';
1211
- keys.forEach((key, i) => {
1212
- var _a, _b, _c;
1213
- if (((_a = ws[key]) === null || _a === void 0 ? void 0 : _a.v) && typeof ((_b = ws[key]) === null || _b === void 0 ? void 0 : _b.v) === 'string') {
1214
- if (!extracolumns.includes(ws[key].v.toLowerCase()) &&
1215
- displayedColumns.includes(ws[key].v.toLowerCase())) {
1216
- let lastRowIndex = (_c = range === null || range === void 0 ? void 0 : range.e) === null || _c === void 0 ? void 0 : _c.r;
1217
- data[key] = ws[key];
1218
- let chr = key.charAt(0);
1219
- for (let j = 2; j <= lastRowIndex; j++) {
1220
- if (ws[chr + (j + 1)] !== undefined &&
1221
- (typeof ws[chr + (j + 1)].v === 'string' ||
1222
- typeof ws[chr + (j + 1)].v === 'number')) {
1223
- data[nKey + j] = ws[chr + (j + 1)];
1224
- }
1225
- }
1226
- nKey = String.fromCharCode(nKey.charCodeAt(0) + 1);
1227
- }
1228
- }
1229
- });
1230
- if (this.rowSelection) {
1231
- let chr = 'A';
1232
- for (let i = 1; i < range.e.c + 1; i++) {
1233
- data[chr + 1] = data[String.fromCharCode(chr.charCodeAt(0) + 1) + 1];
1234
- chr = String.fromCharCode(chr.charCodeAt(0) + 1);
1235
- if (i == range.e.c) {
1236
- data[chr + 1] = undefined;
1237
- }
1238
- }
1239
- }
1240
- if (this.rowSelection && this.expandRows) {
1241
- merges.forEach((merge) => {
1242
- data['A' + merge.s.r] = ws['A' + (merge.s.r + 1)];
1243
- });
1244
- }
1245
- range.e.r--;
1246
- let nRef = XLSX.utils.encode_range(range);
1247
- data['!ref'] = nRef;
1248
- data['!fullref'] = nRef;
1249
- return data;
1250
- }
1251
- getMergeIndex(merges) {
1252
- var arr = [];
1253
- merges.forEach((element) => {
1254
- arr.push({
1255
- e: {
1256
- r: element.e.r == 0 ? element.e.r : element.e.r - 1,
1257
- c: element.e.c,
1258
- },
1259
- s: {
1260
- r: element.s.r == 0 ? element.s.r : element.s.r - 1,
1261
- c: element.s.c,
1262
- },
1263
- });
1264
- });
1265
- return arr;
1266
- }
1267
- }
1268
- MatTableExtComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MatTableExtComponent, deps: [{ token: i1$1.MatDialog }, { token: MatTableExtService }, { token: i3$1.FormBuilder }, { token: i4$1.DomSanitizer }, { token: i5$1.MatIconRegistry }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1269
- MatTableExtComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: MatTableExtComponent, selector: "mat-table-ext", inputs: { dataSource: "dataSource", columns: "columns", columnResizable: "columnResizable", stripedRows: "stripedRows", rowHover: "rowHover", inlineRowEditing: "inlineRowEditing", inCellEditing: "inCellEditing", popupRowEditing: "popupRowEditing", enableDelete: "enableDelete", rowSelection: "rowSelection", multiRowSelection: "multiRowSelection", stickyFooter: "stickyFooter", stickyHeader: "stickyHeader", showFooterRow: "showFooterRow", columnFilter: "columnFilter", loadingIndicator: "loadingIndicator", sorting: "sorting", showToolbar: "showToolbar", toolbarTitle: "toolbarTitle", tableHeight: "tableHeight", toolbarHeight: "toolbarHeight", tableWidth: "tableWidth", scrollbarH: "scrollbarH", toolbarTemplate: "toolbarTemplate", columnHidable: "columnHidable", columnPinnable: "columnPinnable", globalSearch: "globalSearch", expandRows: "expandRows", dndColumns: "dndColumns", showPaginator: "showPaginator", showFirstLastButtons: "showFirstLastButtons", exportButtonEnable: "exportButtonEnable", pageSizeOptions: "pageSizeOptions", toolbarTemplateRef: "toolbarTemplateRef", headerTemplateRef: "headerTemplateRef", cellTemplateRef: "cellTemplateRef", expansionTemplateRef: "expansionTemplateRef", popupEditingTemplateRef: "popupEditingTemplateRef", inlineEditingTemplateRef: "inlineEditingTemplateRef", cellEditingTemplateRef: "cellEditingTemplateRef", cellTemplateRefMap: "cellTemplateRefMap" }, outputs: { inlineChange: "inlineChange", cellChange: "cellChange", popupChange: "popupChange", rowDeleted: "rowDeleted", scroll: "scroll", selectionChanged: "selectionChanged", expansionChange: "expansionChange" }, viewQueries: [{ propertyName: "menuTrigger", first: true, predicate: MatMenuTrigger, descendants: true }, { propertyName: "columnMenuTrigger", first: true, predicate: ["columnMenuTrigger"], descendants: true }, { propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<mat-card class=\"main-table-ext-container mat-elevation-z8\" [style.width]=\"tableWidth\">\r\n <mat-form-field class=\"global-search-field\" appearance=\"fill\" *ngIf=\"globalSearch\">\r\n <mat-label>Search</mat-label>\r\n <input matInput [ngModel]=\"globalFilter\" (ngModelChange)=\"applyGlobalFilter($event)\" placeholder=\"Ex. Mia\" #input>\r\n </mat-form-field>\r\n <mat-toolbar class=\"toolbar-container\" *ngIf=\"showToolbar\" [style.height]=\"toolbarHeight?toolbarHeight:'50px'\">\r\n <span class=\"toolbar-title\" *ngIf=\"toolbarTitle\">{{toolbarTitle}}</span>\r\n <ng-container *ngIf=\"toolbarTemplateRef\" [ngTemplateOutlet]=\"toolbarTemplateRef\"></ng-container>\r\n <span class=\"example-spacer\"></span>\r\n <ng-container *ngIf=\"rowSelection || multiRowSelection\">\r\n <button class=\"hide-button\" mat-stroked-button color=\"primary\" (click)=\"hideSelectedRows()\">\r\n Hide Rows\r\n </button>\r\n <button class=\"hide-button\" mat-stroked-button color=\"primary\" (click)=\"showHiddenRows()\">\r\n Show All Rows\r\n </button>\r\n </ng-container>\r\n <button *ngIf=\"columnHidable\" class=\"hide-button\" mat-stroked-button color=\"primary\"\r\n (click)=\"openMenu('hideShow',$event)\" matTooltip=\"Column Visibility\" matTooltipPosition=\"above\">\r\n <mat-icon>visibility</mat-icon>\r\n </button>\r\n <button *ngIf=\"columnPinnable\" class=\"pin-button\" mat-stroked-button color=\"primary\"\r\n (click)=\"openMenu('columnPin',$event)\" matTooltip=\"Column Pinning\">\r\n <mat-icon svgIcon=\"pinIcon\"></mat-icon>\r\n </button>\r\n <button *ngIf=\"exportButtonEnable\" class=\"export-button\" mat-stroked-button color=\"primary\"\r\n (click)=\"openMenu('export',$event)\" matTooltip=\"Table Data Export\">\r\n <mat-icon>import_export</mat-icon> <span>Export</span>\r\n <mat-icon>expand_more</mat-icon>\r\n </button>\r\n <div style=\"visibility: hidden; position:fixed\" [matMenuTriggerFor]=\"menu\" [style.left.px]=\"menuX\"\r\n [style.top.px]=\"menuY\"></div>\r\n </mat-toolbar>\r\n <mat-menu #menu=\"matMenu\" (closed)=\"menuClosed()\" id=\"exportMenu\">\r\n <ng-container *ngIf=\"exportMenuCtrl\">\r\n <mat-option (click)=\"exportTable('xlsx')\">Export to Excel</mat-option>\r\n <mat-option (click)=\"exportTable('csv')\">Export to CSV</mat-option>\r\n </ng-container>\r\n </mat-menu>\r\n <div style=\"visibility: hidden; position:fixed\" #columnMenuTrigger=\"matMenuTrigger\" [matMenuTriggerFor]=\"columnMenu\"\r\n [style.left.px]=\"menuX\" [style.top.px]=\"menuY\">\r\n </div>\r\n <mat-menu #columnMenu=\"matMenu\" (closed)=\"resetMenuChecks()\">\r\n <div class=\"toolbar-menu-container\" *ngIf=\"hideShowMenuCtrl\" [formGroup]=\"hideShowMenuGroup\"\r\n (click)=\"$event.stopPropagation()\">\r\n <h4 class=\"column-headers\">Visible Columns</h4>\r\n <mat-form-field appearance=\"fill\" style=\"width: -webkit-fill-available;\">\r\n <mat-label>Filter Columns</mat-label>\r\n <input matInput [(ngModel)]=\"showHideFilter\" (ngModelChange)=\"filterColumns($event)\"\r\n [ngModelOptions]=\"{standalone: true}\">\r\n </mat-form-field>\r\n <div class=\"showHide-menu-columns-list\">\r\n <div class=\"toolbar-menu-item\" *ngFor=\"let column of showHideColumnsArray\">\r\n <mat-checkbox color=\"primary\" class=\"toolbar-menu-checkbox\" style=\"width: max-content;\"\r\n [formControlName]=\"column.field\" (change)=\"setColumnHideShow()\">{{column.header}}</mat-checkbox>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"toolbar-menu-container\" *ngIf=\"columnPinMenuCtrl\" (click)=\"$event.stopPropagation()\">\r\n <h4 class=\"column-headers\">Pin Columns</h4>\r\n <form class=\"example-form\">\r\n <mat-form-field appearance=\"fill\" style=\"width: -webkit-fill-available;\">\r\n <mat-label>Filter Columns</mat-label>\r\n <input matInput [(ngModel)]=\"showHideFilter\" (ngModelChange)=\"filterColumns($event)\"\r\n [ngModelOptions]=\"{standalone: true}\">\r\n </mat-form-field>\r\n </form>\r\n <div class=\"showHide-menu-columns-list\">\r\n <app-column-pinning [columns]=\"showHideColumnsArray\"></app-column-pinning>\r\n </div>\r\n </div>\r\n </mat-menu>\r\n\r\n <mat-progress-bar *ngIf=\"loadingIndicator\" mode=\"indeterminate\"></mat-progress-bar>\r\n <section id=\"tableContainer\" class=\"mat-table-ext-container\" (scroll)=\"onScroll($event)\"\r\n [style.height]=\"tableHeight ? tableHeight :'max-content'\">\r\n <table mat-table [id]=\"'matTableExt'+tableID\" [dataSource]=\"dataSource\" matSort cdkDropList\r\n cdkDropListOrientation=\"horizontal\" multiTemplateDataRows (cdkDropListDropped)=\"onDrop($event)\"\r\n (click)=\"saveCellEditing()\" [style.width]=\"scrollbarH?'max-content':'100%'\">\r\n <!-- Row selection column -->\r\n <ng-container matColumnDef=\"select\">\r\n <th mat-header-cell *matHeaderCellDef cdkDragLockAxis=\"x\" cdkDrag [cdkDragDisabled]=\"!dndColumns\">\r\n <mat-checkbox (change)=\"$event ? toggleAllRows() : null\"\r\n [checked]=\"selection.hasValue() && isAllSelected()\"\r\n [indeterminate]=\"selection.hasValue() && !isAllSelected()\" [aria-label]=\"checkboxLabel()\">\r\n </mat-checkbox>\r\n </th>\r\n <td mat-cell *matCellDef=\"let row;let i = dataIndex\">\r\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? setSelectedRows(row,i) : null\"\r\n [checked]=\"selection.isSelected(row)\" [aria-label]=\"checkboxLabel(row)\">\r\n </mat-checkbox>\r\n </td>\r\n <ng-container *ngIf=\"showFooterRow\">\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n </ng-container>\r\n <!--dynamic columns are being generated here-->\r\n <div matColumnDef=\"{{column['field']}}\" [sticky]=\"column.pinned == 'left' ? true:false\"\r\n [stickyEnd]=\"column.pinned == 'right' ? true:false\" *ngFor=\"let column of columnsArray; let i = index\">\r\n <th mat-header-cell *matHeaderCellDef [style.width]=\"column.width\" [style.maxWidth]=\"column.maxWidth\"\r\n [style.minWidth]=\"column.minWidth\" cdkDragLockAxis=\"x\" cdkDrag [cdkDragDisabled]=\"!dndColumns\"\r\n [columnsResizable]=\"columnResizable\" [index]=\"i\">\r\n <span *ngIf=\"!headerTemplateRef\" matTooltip=\"{{column.headerTooltip?.value}}\"\r\n [matTooltipPosition]=\"column?.headerTooltip?.tooltipPosition!\" mat-sort-header\r\n [disabled]=\"!sorting || column.disabled === true\">{{column.header}}</span>\r\n <ng-container *ngIf=\"headerTemplateRef\" [ngTemplateOutlet]=\"headerTemplateRef\"\r\n [ngTemplateOutletContext]=\"{data:column}\"></ng-container>\r\n <ng-container *ngIf=\"column.headerTemplate\" [ngTemplateOutlet]=\"column.headerTemplate\"\r\n [ngTemplateOutletContext]=\"{data:column}\"></ng-container>\r\n </th>\r\n <td mat-cell *matCellDef=\"let row ;let i=dataIndex\">\r\n <div *ngIf=\"!row.editable && !cellEditing[i +'_'+column.field]\"\r\n (dblclick)=\"cellEditing[i +'_'+column.field] = inCellEditing;setCellData(row,i)\"\r\n matTooltip=\"{{column.cellTooltip?.value}}\"\r\n [matTooltipPosition]=\"column?.cellTooltip?.tooltipPosition!\">\r\n <span\r\n *ngIf=\"!cellTemplateRef && !column?.cellTemplate && !cellTemplateRefMap[column.field]\">{{row[column.field]}}</span>\r\n <ng-container *ngIf=\"cellTemplateRefMap[column.field]\"\r\n [ngTemplateOutlet]=\"cellTemplateRefMap[column.field]\"\r\n [ngTemplateOutletContext]=\"{row:row,column:column,index:i}\">\r\n </ng-container>\r\n <ng-container\r\n *ngIf=\"cellTemplateRef && column.cellTemplate && !cellTemplateRefMap[column.field]\"\r\n [ngTemplateOutlet]=\"column.cellTemplate\"\r\n [ngTemplateOutletContext]=\"{row:row,column:column,index:i}\">\r\n </ng-container>\r\n <ng-container\r\n *ngIf=\"!cellTemplateRef && column.cellTemplate && !cellTemplateRefMap[column.field]\"\r\n [ngTemplateOutlet]=\"column.cellTemplate\"\r\n [ngTemplateOutletContext]=\"{row:row,column:column,index:i}\">\r\n </ng-container>\r\n <ng-container\r\n *ngIf=\"cellTemplateRef && !column.cellTemplate && !cellTemplateRefMap[column.field]\"\r\n [ngTemplateOutlet]=\"cellTemplateRef\"\r\n [ngTemplateOutletContext]=\"{row:row,column:column,index:i}\">\r\n </ng-container>\r\n </div>\r\n <div *ngIf=\"row.editable || cellEditing[i +'_'+column.field]\" (click)=\"$event.stopPropagation()\">\r\n <ng-container *ngIf=\"inlineEditingTemplateRef && !cellEditing[i +'_'+column.field]\"\r\n [ngTemplateOutlet]=\"inlineEditingTemplateRef\"\r\n [ngTemplateOutletContext]=\"{data:getInlineEditingData(row,i,column)}\"></ng-container>\r\n <ng-container *ngIf=\"cellEditingTemplateRef && !(row.editable)\"\r\n [ngTemplateOutlet]=\"cellEditingTemplateRef\"\r\n [ngTemplateOutletContext]=\"{data:getInlineEditingData(row,i,column)}\"></ng-container>\r\n <ng-container *ngIf=\"!inlineEditingTemplateRef && (row.editable) && rowDataTemp['e'+i]\">\r\n <mat-form-field *ngIf=\"column.type == 'number'\" appearance=\"outline\"\r\n class=\"inline-editing-field\">\r\n <input matInput type=\"number\" [(ngModel)]=\"rowDataTemp['e'+i][column.field]\"\r\n [ngModelOptions]=\"{standalone: true}\">\r\n </mat-form-field>\r\n <mat-form-field style=\"width: 100%;\" *ngIf=\"column.type == 'string'\" appearance=\"outline\"\r\n class=\"inline-editing-field\">\r\n <input matInput type=\"text\" [(ngModel)]=\"rowDataTemp['e'+i][column.field]\"\r\n [ngModelOptions]=\"{standalone: true}\">\r\n </mat-form-field>\r\n <mat-form-field *ngIf=\"column.type == 'date'\" appearance=\"outline\"\r\n class=\"inline-editing-field\">\r\n <input matInput type=\"date\" [(ngModel)]=\"rowDataTemp['e'+i][column.field]\"\r\n [ngModelOptions]=\"{standalone: true}\">\r\n </mat-form-field>\r\n <mat-form-field *ngIf=\"column.type == 'selection'\" appearance=\"outline\"\r\n class=\"inline-editing-field\">\r\n <mat-select [value]=\"rowDataTemp['e'+i][column.field]\"\r\n [(ngModel)]=\"rowDataTemp['e'+i][column.field]\">\r\n <mat-option *ngFor=\"let option of column.options\" [value]=\"option\">\r\n {{option}}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n <mat-checkbox (click)=\"$event.stopPropagation()\" *ngIf=\"column.type == 'boolean'\"\r\n color=\"primary\" [(ngModel)]=\"row[column.field]\"></mat-checkbox>\r\n </ng-container>\r\n <ng-container *ngIf=\"!cellEditingTemplateRef && cellEditing[i +'_'+column.field]\">\r\n <mat-form-field *ngIf=\"column.type == 'number'\" appearance=\"outline\"\r\n class=\"inline-editing-field\">\r\n <input matInput type=\"number\" [(ngModel)]=\"rowDataTemp['e'+i][column.field]\"\r\n [ngModelOptions]=\"{standalone: true}\">\r\n </mat-form-field>\r\n <mat-form-field *ngIf=\"column.type == 'string'\" appearance=\"outline\"\r\n class=\"inline-editing-field\">\r\n <input matInput type=\"text\" [(ngModel)]=\"rowDataTemp['e'+i][column.field]\"\r\n [ngModelOptions]=\"{standalone: true}\">\r\n </mat-form-field>\r\n <mat-form-field *ngIf=\"column.type == 'date'\" appearance=\"outline\"\r\n class=\"inline-editing-field\">\r\n <input matInput type=\"date\" [(ngModel)]=\"rowDataTemp['e'+i][column.field]\"\r\n [ngModelOptions]=\"{standalone: true}\">\r\n </mat-form-field>\r\n <mat-form-field *ngIf=\"column.type == 'selection'\" appearance=\"outline\"\r\n class=\"inline-editing-field\">\r\n <mat-select [value]=\"rowDataTemp['e'+i][column.field]\"\r\n [(ngModel)]=\"rowDataTemp['e'+i][column.field]\">\r\n <mat-option *ngFor=\"let option of column.options\" [value]=\"option\">\r\n {{option}}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n <mat-checkbox (click)=\"$event.stopPropagation()\" *ngIf=\"column.type == 'boolean'\"\r\n color=\"primary\" [(ngModel)]=\"row[column.field]\"></mat-checkbox>\r\n </ng-container>\r\n </div>\r\n </td>\r\n <ng-container *ngIf=\"showFooterRow\">\r\n <td mat-footer-cell *matFooterCellDef> {{column.footerText}} </td>\r\n </ng-container>\r\n </div>\r\n <ng-container matColumnDef=\"edit\" stickyEnd=\"false\">\r\n <th mat-header-cell cdkDragLockAxis=\"x\" cdkDrag [cdkDragDisabled]=\"true\" *matHeaderCellDef\r\n class=\"action-column-cells\"> Edit </th>\r\n <td mat-cell *matCellDef=\"let row; let i = dataIndex\" class=\"inline-edit-column-cell\">\r\n <mat-icon class=\"edit-column-icons\" *ngIf=\"!row.editable && !row.editmodal\" aria-hidden=\"false\"\r\n (click)=\"enableInlineEditing(row,i)\" fontIcon=\"edit_note\">\r\n </mat-icon>\r\n <div class=\"inline-editing-controls\" *ngIf=\"row.editable && !row.editmodal\">\r\n <mat-icon class=\"edit-column-icons\" aria-hidden=\"false\" (click)=\"saveInlineEditing(row,i)\"\r\n fontIcon=\"done\"></mat-icon>\r\n <mat-icon class=\"edit-column-icons\" aria-hidden=\"false\" (click)=\"cancelInlineEditing(row,i)\"\r\n fontIcon=\"close\"></mat-icon>\r\n </div>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef> edit </td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"popup\" stickyEnd=\"false\">\r\n <th mat-header-cell cdkDragLockAxis=\"x\" cdkDrag [cdkDragDisabled]=\"true\" *matHeaderCellDef\r\n class=\"action-column-cells\"> Popup\r\n </th>\r\n <td mat-cell *matCellDef=\"let row; let i = index\">\r\n <mat-icon aria-hidden=\"false\" (click)=\"openEditingDialog(row)\" fontIcon=\"edit\">\r\n </mat-icon>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"delete\">\r\n <th mat-header-cell cdkDragLockAxis=\"x\" cdkDrag [cdkDragDisabled]=\"true\" *matHeaderCellDef\r\n class=\"action-column-cells\"> Delete\r\n </th>\r\n <td mat-cell *matCellDef=\"let row;let i=dataIndex\">\r\n <mat-icon (click)=\"deleteRow(row,i)\" aria-hidden=\"false\" aria-label=\"Example home icon\"\r\n fontIcon=\"delete\">\r\n </mat-icon>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <!-- Expanded Content Column - The detail row is made up of this one column that spans across all columns -->\r\n <ng-container *ngIf=\"expandRows\" matColumnDef=\"expandedDetail\">\r\n <td mat-cell *matCellDef=\"let element;let i=dataIndex \"\r\n [attr.colspan]=\"columnsToDisplayWithExpand.length\">\r\n <div class=\"example-element-detail\"\r\n [@detailExpand]=\"element == expandedElement ? 'expanded' : 'collapsed'\">\r\n <ng-container *ngIf=\"expansionTemplateRef\" [ngTemplateOutlet]=\"expansionTemplateRef\"\r\n [ngTemplateOutletContext]=\"{$explicit:element,row:element,index:i}\">\r\n </ng-container>\r\n </div>\r\n </td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let ids of headersFiltersIds; let i=index\" [matColumnDef]=\"ids\">\r\n <th mat-header-cell *matHeaderCellDef>\r\n <div class=\"filters-container\" [class.animate]=\"toggleFilters\">\r\n <app-filter-columns-component [obj]=\"columnsArray[returnIndex(ids)]\"\r\n (filterOutput)=\"applyColumnFilter($event,columnsArray[returnIndex(ids)])\"></app-filter-columns-component>\r\n </div>\r\n </th>\r\n </ng-container>\r\n <tr mat-header-row *matHeaderRowDef=\" getDisplayedColumns(); sticky: stickyHeader\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns:getDisplayedColumns(); let i=dataIndex;\" class=\"data-row\"\r\n [ngClass]=\"{'data-row':expandRows,'stripedRows':(stripedRows && i % 2 == 1),'hoverClass':rowHover, 'hidden':hiddenCtrl.isSelected(row) && hideRows,'example-expanded-row':expandedElement === row}\"\r\n (click)=\"expandRow(row, row !== expandedElement,i)\">\r\n </tr>\r\n <tr style=\"height: 0px;\" mat-header-row class=\"no-default-height\" *matHeaderRowDef=\"headersFiltersIds\">\r\n </tr>\r\n <ng-container *ngIf=\"expandRows\">\r\n <tr style=\"height: 0px;\" mat-row *matRowDef=\"let row; columns: ['expandedDetail']\"\r\n [ngClass]=\"{'example-detail-row': (expandRows && row === expandedElement),'expand-row':row !== expandedElement}\">\r\n </tr>\r\n </ng-container>\r\n <ng-container *ngIf=\"showFooterRow\">\r\n <tr mat-footer-row *matFooterRowDef=\"getDisplayedColumns(); sticky: stickyFooter\"></tr>\r\n </ng-container>\r\n </table>\r\n </section>\r\n <mat-paginator *ngIf=\"showPaginator\" [pageSizeOptions]=\"pageSizeOptions\"\r\n [showFirstLastButtons]=\"showFirstLastButtons\">\r\n </mat-paginator>\r\n</mat-card>", styles: ["table{min-width:100%}.mat-table-sticky-border-elem-right{border-left:1px solid #e0e0e0}.mat-table-sticky-border-elem-left{border-right:1px solid #e0e0e0}tr.example-detail-row{display:table-row!important}.example-element-detail{overflow:hidden;display:flex}.hidden{display:none}.stripedRows{background:#eaeaea!important}.hoverClass:hover{background:#dbdbdb!important}.filters-container{overflow:hidden;max-height:0px;transition:max-height .5s ease-in-out}.animate{max-height:50px!important}.resize-handle{display:inline-block;border-right:2px solid rgb(140,140,140);position:absolute;top:0;right:0;height:100%;cursor:col-resize;opacity:0}.resize-handle:hover{width:20px}table th:hover .resize-handle{opacity:1;transition:.3s ease-in-out}.mat-table.resizing{-webkit-user-select:none;user-select:none;cursor:col-resize}.mat-table .mat-header-cell{position:relative}.mat-table .mat-header-cell:not(:last-child) .resize-holder{cursor:col-resize;width:20px;height:100%;position:absolute;right:-10px;top:0;z-index:1}.toolbar-container{display:flex;padding:0 15px;gap:1rem;grid-auto-rows:10px;justify-content:flex-end;align-items:center}.mat-table-ext-container{width:100%;max-width:100%;overflow:auto}.column-headers{font-family:Roboto,Helvetica Neue,sans-serif}.example-spacer{flex:1 1 auto}.export-button .mat-button-wrapper{display:flex!important;width:8em;justify-content:space-around;align-items:center}.toolbar-menu-container{display:flex;flex-direction:column;margin:auto .8em;width:15em;height:20em}.toolbar-menu-item{display:flex;height:3em}.toolbar-menu-checkbox{margin-left:8%}.toolbar-menu-checkbox.mat-checkbox{width:max-content;display:flex;align-items:center}.hide-button .mat-button-wrapper,.pin-button .mat-button-wrapper{display:flex!important;width:5em;justify-content:space-around;align-items:center}.hide-button,.pin-button,.export-button{height:3em;border:2px solid currentColor!important}.showHide-menu-columns-list{height:10em;max-height:10em;overflow-y:auto}mat-card.main-table-ext-container{padding:0}.main-table-ext-container{margin:10px}.mat-column-select{width:50px!important}.data-row td,.example-expanded-row td{border-bottom-width:0!important}.action-column-cells{width:40px;height:inherit}.inline-editing-controls{display:flex}.global-search-field{width:-webkit-fill-available}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i7$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i7$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i7$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i7$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i7$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i7$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i7$1.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i7$1.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i7$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i7$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i7$1.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i7$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i7$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i7$1.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "directive", type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i8.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i8.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i6.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i11$1.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "component", type: i7.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i9.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i9.MatLabel, selector: "mat-label" }, { kind: "directive", type: i10.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i15.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "directive", type: i15.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: i16.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }, { kind: "component", type: i17.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: i11.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "directive", type: i19.MatSort, selector: "[matSort]", inputs: ["matSortDisabled", "matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i19.MatSortHeader, selector: "[mat-sort-header]", inputs: ["disabled", "mat-sort-header", "arrowPosition", "start", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: i20.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "directive", type: ResizeColumnDirective, selector: "[columnsResizable]", inputs: ["columnsResizable", "index"] }, { kind: "component", type: ColumnPinningComponent, selector: "app-column-pinning", inputs: ["columns"], outputs: ["columnsChanged"] }, { kind: "component", type: FilterColumnsComponentComponent, selector: "app-filter-columns-component", inputs: ["obj"], outputs: ["filterOutput"] }], animations: [
1270
- trigger('detailExpand', [
1271
- state('collapsed', style({ height: '0px', minHeight: '0' })),
1272
- state('expanded', style({ height: '*' })),
1273
- transition('expanded <=> collapsed', animate('300ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
1274
- ]),
1275
- ], encapsulation: i0.ViewEncapsulation.None });
1276
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MatTableExtComponent, decorators: [{
1277
- type: Component,
1278
- args: [{ selector: 'mat-table-ext', encapsulation: ViewEncapsulation.None, animations: [
1279
- trigger('detailExpand', [
1280
- state('collapsed', style({ height: '0px', minHeight: '0' })),
1281
- state('expanded', style({ height: '*' })),
1282
- transition('expanded <=> collapsed', animate('300ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
1283
- ]),
1284
- ], template: "<mat-card class=\"main-table-ext-container mat-elevation-z8\" [style.width]=\"tableWidth\">\r\n <mat-form-field class=\"global-search-field\" appearance=\"fill\" *ngIf=\"globalSearch\">\r\n <mat-label>Search</mat-label>\r\n <input matInput [ngModel]=\"globalFilter\" (ngModelChange)=\"applyGlobalFilter($event)\" placeholder=\"Ex. Mia\" #input>\r\n </mat-form-field>\r\n <mat-toolbar class=\"toolbar-container\" *ngIf=\"showToolbar\" [style.height]=\"toolbarHeight?toolbarHeight:'50px'\">\r\n <span class=\"toolbar-title\" *ngIf=\"toolbarTitle\">{{toolbarTitle}}</span>\r\n <ng-container *ngIf=\"toolbarTemplateRef\" [ngTemplateOutlet]=\"toolbarTemplateRef\"></ng-container>\r\n <span class=\"example-spacer\"></span>\r\n <ng-container *ngIf=\"rowSelection || multiRowSelection\">\r\n <button class=\"hide-button\" mat-stroked-button color=\"primary\" (click)=\"hideSelectedRows()\">\r\n Hide Rows\r\n </button>\r\n <button class=\"hide-button\" mat-stroked-button color=\"primary\" (click)=\"showHiddenRows()\">\r\n Show All Rows\r\n </button>\r\n </ng-container>\r\n <button *ngIf=\"columnHidable\" class=\"hide-button\" mat-stroked-button color=\"primary\"\r\n (click)=\"openMenu('hideShow',$event)\" matTooltip=\"Column Visibility\" matTooltipPosition=\"above\">\r\n <mat-icon>visibility</mat-icon>\r\n </button>\r\n <button *ngIf=\"columnPinnable\" class=\"pin-button\" mat-stroked-button color=\"primary\"\r\n (click)=\"openMenu('columnPin',$event)\" matTooltip=\"Column Pinning\">\r\n <mat-icon svgIcon=\"pinIcon\"></mat-icon>\r\n </button>\r\n <button *ngIf=\"exportButtonEnable\" class=\"export-button\" mat-stroked-button color=\"primary\"\r\n (click)=\"openMenu('export',$event)\" matTooltip=\"Table Data Export\">\r\n <mat-icon>import_export</mat-icon> <span>Export</span>\r\n <mat-icon>expand_more</mat-icon>\r\n </button>\r\n <div style=\"visibility: hidden; position:fixed\" [matMenuTriggerFor]=\"menu\" [style.left.px]=\"menuX\"\r\n [style.top.px]=\"menuY\"></div>\r\n </mat-toolbar>\r\n <mat-menu #menu=\"matMenu\" (closed)=\"menuClosed()\" id=\"exportMenu\">\r\n <ng-container *ngIf=\"exportMenuCtrl\">\r\n <mat-option (click)=\"exportTable('xlsx')\">Export to Excel</mat-option>\r\n <mat-option (click)=\"exportTable('csv')\">Export to CSV</mat-option>\r\n </ng-container>\r\n </mat-menu>\r\n <div style=\"visibility: hidden; position:fixed\" #columnMenuTrigger=\"matMenuTrigger\" [matMenuTriggerFor]=\"columnMenu\"\r\n [style.left.px]=\"menuX\" [style.top.px]=\"menuY\">\r\n </div>\r\n <mat-menu #columnMenu=\"matMenu\" (closed)=\"resetMenuChecks()\">\r\n <div class=\"toolbar-menu-container\" *ngIf=\"hideShowMenuCtrl\" [formGroup]=\"hideShowMenuGroup\"\r\n (click)=\"$event.stopPropagation()\">\r\n <h4 class=\"column-headers\">Visible Columns</h4>\r\n <mat-form-field appearance=\"fill\" style=\"width: -webkit-fill-available;\">\r\n <mat-label>Filter Columns</mat-label>\r\n <input matInput [(ngModel)]=\"showHideFilter\" (ngModelChange)=\"filterColumns($event)\"\r\n [ngModelOptions]=\"{standalone: true}\">\r\n </mat-form-field>\r\n <div class=\"showHide-menu-columns-list\">\r\n <div class=\"toolbar-menu-item\" *ngFor=\"let column of showHideColumnsArray\">\r\n <mat-checkbox color=\"primary\" class=\"toolbar-menu-checkbox\" style=\"width: max-content;\"\r\n [formControlName]=\"column.field\" (change)=\"setColumnHideShow()\">{{column.header}}</mat-checkbox>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"toolbar-menu-container\" *ngIf=\"columnPinMenuCtrl\" (click)=\"$event.stopPropagation()\">\r\n <h4 class=\"column-headers\">Pin Columns</h4>\r\n <form class=\"example-form\">\r\n <mat-form-field appearance=\"fill\" style=\"width: -webkit-fill-available;\">\r\n <mat-label>Filter Columns</mat-label>\r\n <input matInput [(ngModel)]=\"showHideFilter\" (ngModelChange)=\"filterColumns($event)\"\r\n [ngModelOptions]=\"{standalone: true}\">\r\n </mat-form-field>\r\n </form>\r\n <div class=\"showHide-menu-columns-list\">\r\n <app-column-pinning [columns]=\"showHideColumnsArray\"></app-column-pinning>\r\n </div>\r\n </div>\r\n </mat-menu>\r\n\r\n <mat-progress-bar *ngIf=\"loadingIndicator\" mode=\"indeterminate\"></mat-progress-bar>\r\n <section id=\"tableContainer\" class=\"mat-table-ext-container\" (scroll)=\"onScroll($event)\"\r\n [style.height]=\"tableHeight ? tableHeight :'max-content'\">\r\n <table mat-table [id]=\"'matTableExt'+tableID\" [dataSource]=\"dataSource\" matSort cdkDropList\r\n cdkDropListOrientation=\"horizontal\" multiTemplateDataRows (cdkDropListDropped)=\"onDrop($event)\"\r\n (click)=\"saveCellEditing()\" [style.width]=\"scrollbarH?'max-content':'100%'\">\r\n <!-- Row selection column -->\r\n <ng-container matColumnDef=\"select\">\r\n <th mat-header-cell *matHeaderCellDef cdkDragLockAxis=\"x\" cdkDrag [cdkDragDisabled]=\"!dndColumns\">\r\n <mat-checkbox (change)=\"$event ? toggleAllRows() : null\"\r\n [checked]=\"selection.hasValue() && isAllSelected()\"\r\n [indeterminate]=\"selection.hasValue() && !isAllSelected()\" [aria-label]=\"checkboxLabel()\">\r\n </mat-checkbox>\r\n </th>\r\n <td mat-cell *matCellDef=\"let row;let i = dataIndex\">\r\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? setSelectedRows(row,i) : null\"\r\n [checked]=\"selection.isSelected(row)\" [aria-label]=\"checkboxLabel(row)\">\r\n </mat-checkbox>\r\n </td>\r\n <ng-container *ngIf=\"showFooterRow\">\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n </ng-container>\r\n <!--dynamic columns are being generated here-->\r\n <div matColumnDef=\"{{column['field']}}\" [sticky]=\"column.pinned == 'left' ? true:false\"\r\n [stickyEnd]=\"column.pinned == 'right' ? true:false\" *ngFor=\"let column of columnsArray; let i = index\">\r\n <th mat-header-cell *matHeaderCellDef [style.width]=\"column.width\" [style.maxWidth]=\"column.maxWidth\"\r\n [style.minWidth]=\"column.minWidth\" cdkDragLockAxis=\"x\" cdkDrag [cdkDragDisabled]=\"!dndColumns\"\r\n [columnsResizable]=\"columnResizable\" [index]=\"i\">\r\n <span *ngIf=\"!headerTemplateRef\" matTooltip=\"{{column.headerTooltip?.value}}\"\r\n [matTooltipPosition]=\"column?.headerTooltip?.tooltipPosition!\" mat-sort-header\r\n [disabled]=\"!sorting || column.disabled === true\">{{column.header}}</span>\r\n <ng-container *ngIf=\"headerTemplateRef\" [ngTemplateOutlet]=\"headerTemplateRef\"\r\n [ngTemplateOutletContext]=\"{data:column}\"></ng-container>\r\n <ng-container *ngIf=\"column.headerTemplate\" [ngTemplateOutlet]=\"column.headerTemplate\"\r\n [ngTemplateOutletContext]=\"{data:column}\"></ng-container>\r\n </th>\r\n <td mat-cell *matCellDef=\"let row ;let i=dataIndex\">\r\n <div *ngIf=\"!row.editable && !cellEditing[i +'_'+column.field]\"\r\n (dblclick)=\"cellEditing[i +'_'+column.field] = inCellEditing;setCellData(row,i)\"\r\n matTooltip=\"{{column.cellTooltip?.value}}\"\r\n [matTooltipPosition]=\"column?.cellTooltip?.tooltipPosition!\">\r\n <span\r\n *ngIf=\"!cellTemplateRef && !column?.cellTemplate && !cellTemplateRefMap[column.field]\">{{row[column.field]}}</span>\r\n <ng-container *ngIf=\"cellTemplateRefMap[column.field]\"\r\n [ngTemplateOutlet]=\"cellTemplateRefMap[column.field]\"\r\n [ngTemplateOutletContext]=\"{row:row,column:column,index:i}\">\r\n </ng-container>\r\n <ng-container\r\n *ngIf=\"cellTemplateRef && column.cellTemplate && !cellTemplateRefMap[column.field]\"\r\n [ngTemplateOutlet]=\"column.cellTemplate\"\r\n [ngTemplateOutletContext]=\"{row:row,column:column,index:i}\">\r\n </ng-container>\r\n <ng-container\r\n *ngIf=\"!cellTemplateRef && column.cellTemplate && !cellTemplateRefMap[column.field]\"\r\n [ngTemplateOutlet]=\"column.cellTemplate\"\r\n [ngTemplateOutletContext]=\"{row:row,column:column,index:i}\">\r\n </ng-container>\r\n <ng-container\r\n *ngIf=\"cellTemplateRef && !column.cellTemplate && !cellTemplateRefMap[column.field]\"\r\n [ngTemplateOutlet]=\"cellTemplateRef\"\r\n [ngTemplateOutletContext]=\"{row:row,column:column,index:i}\">\r\n </ng-container>\r\n </div>\r\n <div *ngIf=\"row.editable || cellEditing[i +'_'+column.field]\" (click)=\"$event.stopPropagation()\">\r\n <ng-container *ngIf=\"inlineEditingTemplateRef && !cellEditing[i +'_'+column.field]\"\r\n [ngTemplateOutlet]=\"inlineEditingTemplateRef\"\r\n [ngTemplateOutletContext]=\"{data:getInlineEditingData(row,i,column)}\"></ng-container>\r\n <ng-container *ngIf=\"cellEditingTemplateRef && !(row.editable)\"\r\n [ngTemplateOutlet]=\"cellEditingTemplateRef\"\r\n [ngTemplateOutletContext]=\"{data:getInlineEditingData(row,i,column)}\"></ng-container>\r\n <ng-container *ngIf=\"!inlineEditingTemplateRef && (row.editable) && rowDataTemp['e'+i]\">\r\n <mat-form-field *ngIf=\"column.type == 'number'\" appearance=\"outline\"\r\n class=\"inline-editing-field\">\r\n <input matInput type=\"number\" [(ngModel)]=\"rowDataTemp['e'+i][column.field]\"\r\n [ngModelOptions]=\"{standalone: true}\">\r\n </mat-form-field>\r\n <mat-form-field style=\"width: 100%;\" *ngIf=\"column.type == 'string'\" appearance=\"outline\"\r\n class=\"inline-editing-field\">\r\n <input matInput type=\"text\" [(ngModel)]=\"rowDataTemp['e'+i][column.field]\"\r\n [ngModelOptions]=\"{standalone: true}\">\r\n </mat-form-field>\r\n <mat-form-field *ngIf=\"column.type == 'date'\" appearance=\"outline\"\r\n class=\"inline-editing-field\">\r\n <input matInput type=\"date\" [(ngModel)]=\"rowDataTemp['e'+i][column.field]\"\r\n [ngModelOptions]=\"{standalone: true}\">\r\n </mat-form-field>\r\n <mat-form-field *ngIf=\"column.type == 'selection'\" appearance=\"outline\"\r\n class=\"inline-editing-field\">\r\n <mat-select [value]=\"rowDataTemp['e'+i][column.field]\"\r\n [(ngModel)]=\"rowDataTemp['e'+i][column.field]\">\r\n <mat-option *ngFor=\"let option of column.options\" [value]=\"option\">\r\n {{option}}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n <mat-checkbox (click)=\"$event.stopPropagation()\" *ngIf=\"column.type == 'boolean'\"\r\n color=\"primary\" [(ngModel)]=\"row[column.field]\"></mat-checkbox>\r\n </ng-container>\r\n <ng-container *ngIf=\"!cellEditingTemplateRef && cellEditing[i +'_'+column.field]\">\r\n <mat-form-field *ngIf=\"column.type == 'number'\" appearance=\"outline\"\r\n class=\"inline-editing-field\">\r\n <input matInput type=\"number\" [(ngModel)]=\"rowDataTemp['e'+i][column.field]\"\r\n [ngModelOptions]=\"{standalone: true}\">\r\n </mat-form-field>\r\n <mat-form-field *ngIf=\"column.type == 'string'\" appearance=\"outline\"\r\n class=\"inline-editing-field\">\r\n <input matInput type=\"text\" [(ngModel)]=\"rowDataTemp['e'+i][column.field]\"\r\n [ngModelOptions]=\"{standalone: true}\">\r\n </mat-form-field>\r\n <mat-form-field *ngIf=\"column.type == 'date'\" appearance=\"outline\"\r\n class=\"inline-editing-field\">\r\n <input matInput type=\"date\" [(ngModel)]=\"rowDataTemp['e'+i][column.field]\"\r\n [ngModelOptions]=\"{standalone: true}\">\r\n </mat-form-field>\r\n <mat-form-field *ngIf=\"column.type == 'selection'\" appearance=\"outline\"\r\n class=\"inline-editing-field\">\r\n <mat-select [value]=\"rowDataTemp['e'+i][column.field]\"\r\n [(ngModel)]=\"rowDataTemp['e'+i][column.field]\">\r\n <mat-option *ngFor=\"let option of column.options\" [value]=\"option\">\r\n {{option}}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n <mat-checkbox (click)=\"$event.stopPropagation()\" *ngIf=\"column.type == 'boolean'\"\r\n color=\"primary\" [(ngModel)]=\"row[column.field]\"></mat-checkbox>\r\n </ng-container>\r\n </div>\r\n </td>\r\n <ng-container *ngIf=\"showFooterRow\">\r\n <td mat-footer-cell *matFooterCellDef> {{column.footerText}} </td>\r\n </ng-container>\r\n </div>\r\n <ng-container matColumnDef=\"edit\" stickyEnd=\"false\">\r\n <th mat-header-cell cdkDragLockAxis=\"x\" cdkDrag [cdkDragDisabled]=\"true\" *matHeaderCellDef\r\n class=\"action-column-cells\"> Edit </th>\r\n <td mat-cell *matCellDef=\"let row; let i = dataIndex\" class=\"inline-edit-column-cell\">\r\n <mat-icon class=\"edit-column-icons\" *ngIf=\"!row.editable && !row.editmodal\" aria-hidden=\"false\"\r\n (click)=\"enableInlineEditing(row,i)\" fontIcon=\"edit_note\">\r\n </mat-icon>\r\n <div class=\"inline-editing-controls\" *ngIf=\"row.editable && !row.editmodal\">\r\n <mat-icon class=\"edit-column-icons\" aria-hidden=\"false\" (click)=\"saveInlineEditing(row,i)\"\r\n fontIcon=\"done\"></mat-icon>\r\n <mat-icon class=\"edit-column-icons\" aria-hidden=\"false\" (click)=\"cancelInlineEditing(row,i)\"\r\n fontIcon=\"close\"></mat-icon>\r\n </div>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef> edit </td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"popup\" stickyEnd=\"false\">\r\n <th mat-header-cell cdkDragLockAxis=\"x\" cdkDrag [cdkDragDisabled]=\"true\" *matHeaderCellDef\r\n class=\"action-column-cells\"> Popup\r\n </th>\r\n <td mat-cell *matCellDef=\"let row; let i = index\">\r\n <mat-icon aria-hidden=\"false\" (click)=\"openEditingDialog(row)\" fontIcon=\"edit\">\r\n </mat-icon>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"delete\">\r\n <th mat-header-cell cdkDragLockAxis=\"x\" cdkDrag [cdkDragDisabled]=\"true\" *matHeaderCellDef\r\n class=\"action-column-cells\"> Delete\r\n </th>\r\n <td mat-cell *matCellDef=\"let row;let i=dataIndex\">\r\n <mat-icon (click)=\"deleteRow(row,i)\" aria-hidden=\"false\" aria-label=\"Example home icon\"\r\n fontIcon=\"delete\">\r\n </mat-icon>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <!-- Expanded Content Column - The detail row is made up of this one column that spans across all columns -->\r\n <ng-container *ngIf=\"expandRows\" matColumnDef=\"expandedDetail\">\r\n <td mat-cell *matCellDef=\"let element;let i=dataIndex \"\r\n [attr.colspan]=\"columnsToDisplayWithExpand.length\">\r\n <div class=\"example-element-detail\"\r\n [@detailExpand]=\"element == expandedElement ? 'expanded' : 'collapsed'\">\r\n <ng-container *ngIf=\"expansionTemplateRef\" [ngTemplateOutlet]=\"expansionTemplateRef\"\r\n [ngTemplateOutletContext]=\"{$explicit:element,row:element,index:i}\">\r\n </ng-container>\r\n </div>\r\n </td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let ids of headersFiltersIds; let i=index\" [matColumnDef]=\"ids\">\r\n <th mat-header-cell *matHeaderCellDef>\r\n <div class=\"filters-container\" [class.animate]=\"toggleFilters\">\r\n <app-filter-columns-component [obj]=\"columnsArray[returnIndex(ids)]\"\r\n (filterOutput)=\"applyColumnFilter($event,columnsArray[returnIndex(ids)])\"></app-filter-columns-component>\r\n </div>\r\n </th>\r\n </ng-container>\r\n <tr mat-header-row *matHeaderRowDef=\" getDisplayedColumns(); sticky: stickyHeader\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns:getDisplayedColumns(); let i=dataIndex;\" class=\"data-row\"\r\n [ngClass]=\"{'data-row':expandRows,'stripedRows':(stripedRows && i % 2 == 1),'hoverClass':rowHover, 'hidden':hiddenCtrl.isSelected(row) && hideRows,'example-expanded-row':expandedElement === row}\"\r\n (click)=\"expandRow(row, row !== expandedElement,i)\">\r\n </tr>\r\n <tr style=\"height: 0px;\" mat-header-row class=\"no-default-height\" *matHeaderRowDef=\"headersFiltersIds\">\r\n </tr>\r\n <ng-container *ngIf=\"expandRows\">\r\n <tr style=\"height: 0px;\" mat-row *matRowDef=\"let row; columns: ['expandedDetail']\"\r\n [ngClass]=\"{'example-detail-row': (expandRows && row === expandedElement),'expand-row':row !== expandedElement}\">\r\n </tr>\r\n </ng-container>\r\n <ng-container *ngIf=\"showFooterRow\">\r\n <tr mat-footer-row *matFooterRowDef=\"getDisplayedColumns(); sticky: stickyFooter\"></tr>\r\n </ng-container>\r\n </table>\r\n </section>\r\n <mat-paginator *ngIf=\"showPaginator\" [pageSizeOptions]=\"pageSizeOptions\"\r\n [showFirstLastButtons]=\"showFirstLastButtons\">\r\n </mat-paginator>\r\n</mat-card>", styles: ["table{min-width:100%}.mat-table-sticky-border-elem-right{border-left:1px solid #e0e0e0}.mat-table-sticky-border-elem-left{border-right:1px solid #e0e0e0}tr.example-detail-row{display:table-row!important}.example-element-detail{overflow:hidden;display:flex}.hidden{display:none}.stripedRows{background:#eaeaea!important}.hoverClass:hover{background:#dbdbdb!important}.filters-container{overflow:hidden;max-height:0px;transition:max-height .5s ease-in-out}.animate{max-height:50px!important}.resize-handle{display:inline-block;border-right:2px solid rgb(140,140,140);position:absolute;top:0;right:0;height:100%;cursor:col-resize;opacity:0}.resize-handle:hover{width:20px}table th:hover .resize-handle{opacity:1;transition:.3s ease-in-out}.mat-table.resizing{-webkit-user-select:none;user-select:none;cursor:col-resize}.mat-table .mat-header-cell{position:relative}.mat-table .mat-header-cell:not(:last-child) .resize-holder{cursor:col-resize;width:20px;height:100%;position:absolute;right:-10px;top:0;z-index:1}.toolbar-container{display:flex;padding:0 15px;gap:1rem;grid-auto-rows:10px;justify-content:flex-end;align-items:center}.mat-table-ext-container{width:100%;max-width:100%;overflow:auto}.column-headers{font-family:Roboto,Helvetica Neue,sans-serif}.example-spacer{flex:1 1 auto}.export-button .mat-button-wrapper{display:flex!important;width:8em;justify-content:space-around;align-items:center}.toolbar-menu-container{display:flex;flex-direction:column;margin:auto .8em;width:15em;height:20em}.toolbar-menu-item{display:flex;height:3em}.toolbar-menu-checkbox{margin-left:8%}.toolbar-menu-checkbox.mat-checkbox{width:max-content;display:flex;align-items:center}.hide-button .mat-button-wrapper,.pin-button .mat-button-wrapper{display:flex!important;width:5em;justify-content:space-around;align-items:center}.hide-button,.pin-button,.export-button{height:3em;border:2px solid currentColor!important}.showHide-menu-columns-list{height:10em;max-height:10em;overflow-y:auto}mat-card.main-table-ext-container{padding:0}.main-table-ext-container{margin:10px}.mat-column-select{width:50px!important}.data-row td,.example-expanded-row td{border-bottom-width:0!important}.action-column-cells{width:40px;height:inherit}.inline-editing-controls{display:flex}.global-search-field{width:-webkit-fill-available}\n"] }]
1285
- }], ctorParameters: function () { return [{ type: i1$1.MatDialog }, { type: MatTableExtService }, { type: i3$1.FormBuilder }, { type: i4$1.DomSanitizer }, { type: i5$1.MatIconRegistry }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { menuTrigger: [{
1286
- type: ViewChild,
1287
- args: [MatMenuTrigger]
1288
- }], columnMenuTrigger: [{
1289
- type: ViewChild,
1290
- args: ['columnMenuTrigger']
1291
- }], paginator: [{
1292
- type: ViewChild,
1293
- args: [MatPaginator]
1294
- }], sort: [{
1295
- type: ViewChild,
1296
- args: [MatSort]
1297
- }], dataSource: [{
1298
- type: Input
1299
- }], columns: [{
1300
- type: Input
1301
- }], columnResizable: [{
1302
- type: Input
1303
- }], stripedRows: [{
1304
- type: Input
1305
- }], rowHover: [{
1306
- type: Input
1307
- }], inlineRowEditing: [{
1308
- type: Input
1309
- }], inCellEditing: [{
1310
- type: Input
1311
- }], popupRowEditing: [{
1312
- type: Input
1313
- }], enableDelete: [{
1314
- type: Input
1315
- }], rowSelection: [{
1316
- type: Input
1317
- }], multiRowSelection: [{
1318
- type: Input
1319
- }], stickyFooter: [{
1320
- type: Input
1321
- }], stickyHeader: [{
1322
- type: Input
1323
- }], showFooterRow: [{
1324
- type: Input
1325
- }], columnFilter: [{
1326
- type: Input
1327
- }], loadingIndicator: [{
1328
- type: Input
1329
- }], sorting: [{
1330
- type: Input
1331
- }], showToolbar: [{
1332
- type: Input
1333
- }], toolbarTitle: [{
1334
- type: Input
1335
- }], tableHeight: [{
1336
- type: Input
1337
- }], toolbarHeight: [{
1338
- type: Input
1339
- }], tableWidth: [{
1340
- type: Input
1341
- }], scrollbarH: [{
1342
- type: Input
1343
- }], toolbarTemplate: [{
1344
- type: Input
1345
- }], columnHidable: [{
1346
- type: Input
1347
- }], columnPinnable: [{
1348
- type: Input
1349
- }], globalSearch: [{
1350
- type: Input
1351
- }], expandRows: [{
1352
- type: Input
1353
- }], dndColumns: [{
1354
- type: Input
1355
- }], showPaginator: [{
1356
- type: Input
1357
- }], showFirstLastButtons: [{
1358
- type: Input
1359
- }], exportButtonEnable: [{
1360
- type: Input
1361
- }], pageSizeOptions: [{
1362
- type: Input
1363
- }], toolbarTemplateRef: [{
1364
- type: Input
1365
- }], headerTemplateRef: [{
1366
- type: Input
1367
- }], cellTemplateRef: [{
1368
- type: Input
1369
- }], expansionTemplateRef: [{
1370
- type: Input
1371
- }], popupEditingTemplateRef: [{
1372
- type: Input
1373
- }], inlineEditingTemplateRef: [{
1374
- type: Input
1375
- }], cellEditingTemplateRef: [{
1376
- type: Input
1377
- }], cellTemplateRefMap: [{
1378
- type: Input
1379
- }], inlineChange: [{
1380
- type: Output
1381
- }], cellChange: [{
1382
- type: Output
1383
- }], popupChange: [{
1384
- type: Output
1385
- }], rowDeleted: [{
1386
- type: Output
1387
- }], scroll: [{
1388
- type: Output
1389
- }], selectionChanged: [{
1390
- type: Output
1391
- }], expansionChange: [{
1392
- type: Output
1393
- }] } });
1394
-
1395
- class MatTableExtModule {
1396
- }
1397
- MatTableExtModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MatTableExtModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1398
- MatTableExtModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: MatTableExtModule, declarations: [MatTableExtComponent,
1399
- ResizeColumnDirective,
1400
- ColumnPinningComponent,
1401
- EditingComponent,
1402
- FilterColumnsComponentComponent], imports: [CommonModule, i1$2.TranslateModule, MatTableModule,
1403
- FormsModule,
1404
- ReactiveFormsModule,
1405
- MatNativeDateModule,
1406
- A11yModule,
1407
- CdkAccordionModule,
1408
- ClipboardModule,
1409
- CdkStepperModule,
1410
- CdkTableModule,
1411
- CdkTreeModule,
1412
- DragDropModule,
1413
- MatAutocompleteModule,
1414
- MatBadgeModule,
1415
- MatBottomSheetModule,
1416
- MatButtonModule,
1417
- MatButtonToggleModule,
1418
- MatCardModule,
1419
- MatCheckboxModule,
1420
- MatChipsModule,
1421
- MatStepperModule,
1422
- MatDatepickerModule,
1423
- MatDialogModule,
1424
- MatDividerModule,
1425
- MatExpansionModule,
1426
- MatGridListModule,
1427
- MatIconModule,
1428
- MatInputModule,
1429
- MatListModule,
1430
- MatMenuModule,
1431
- MatNativeDateModule,
1432
- MatPaginatorModule,
1433
- MatProgressBarModule,
1434
- MatProgressSpinnerModule,
1435
- MatRadioModule,
1436
- MatRippleModule,
1437
- MatSelectModule,
1438
- MatSidenavModule,
1439
- MatSliderModule,
1440
- MatSlideToggleModule,
1441
- MatSnackBarModule,
1442
- MatSortModule,
1443
- MatTabsModule,
1444
- MatToolbarModule,
1445
- MatTooltipModule,
1446
- MatTreeModule,
1447
- PortalModule,
1448
- ScrollingModule,
1449
- MatFormFieldModule], exports: [MatTableExtComponent,
1450
- ResizeColumnDirective,
1451
- ColumnPinningComponent,
1452
- EditingComponent,
1453
- FilterColumnsComponentComponent] });
1454
- MatTableExtModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MatTableExtModule, imports: [CommonModule,
1455
- TranslateModule.forChild(),
1456
- MatTableModule,
1457
- FormsModule,
1458
- ReactiveFormsModule,
1459
- MatNativeDateModule,
1460
- A11yModule,
1461
- CdkAccordionModule,
1462
- ClipboardModule,
1463
- CdkStepperModule,
1464
- CdkTableModule,
1465
- CdkTreeModule,
1466
- DragDropModule,
1467
- MatAutocompleteModule,
1468
- MatBadgeModule,
1469
- MatBottomSheetModule,
1470
- MatButtonModule,
1471
- MatButtonToggleModule,
1472
- MatCardModule,
1473
- MatCheckboxModule,
1474
- MatChipsModule,
1475
- MatStepperModule,
1476
- MatDatepickerModule,
1477
- MatDialogModule,
1478
- MatDividerModule,
1479
- MatExpansionModule,
1480
- MatGridListModule,
1481
- MatIconModule,
1482
- MatInputModule,
1483
- MatListModule,
1484
- MatMenuModule,
1485
- MatNativeDateModule,
1486
- MatPaginatorModule,
1487
- MatProgressBarModule,
1488
- MatProgressSpinnerModule,
1489
- MatRadioModule,
1490
- MatRippleModule,
1491
- MatSelectModule,
1492
- MatSidenavModule,
1493
- MatSliderModule,
1494
- MatSlideToggleModule,
1495
- MatSnackBarModule,
1496
- MatSortModule,
1497
- MatTabsModule,
1498
- MatToolbarModule,
1499
- MatTooltipModule,
1500
- MatTreeModule,
1501
- PortalModule,
1502
- ScrollingModule,
1503
- MatFormFieldModule] });
1504
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MatTableExtModule, decorators: [{
1505
- type: NgModule,
1506
- args: [{
1507
- declarations: [
1508
- MatTableExtComponent,
1509
- ResizeColumnDirective,
1510
- ColumnPinningComponent,
1511
- EditingComponent,
1512
- FilterColumnsComponentComponent,
1513
- ],
1514
- imports: [
1515
- CommonModule,
1516
- TranslateModule.forChild(),
1517
- MatTableModule,
1518
- FormsModule,
1519
- ReactiveFormsModule,
1520
- MatNativeDateModule,
1521
- A11yModule,
1522
- CdkAccordionModule,
1523
- ClipboardModule,
1524
- CdkStepperModule,
1525
- CdkTableModule,
1526
- CdkTreeModule,
1527
- DragDropModule,
1528
- MatAutocompleteModule,
1529
- MatBadgeModule,
1530
- MatBottomSheetModule,
1531
- MatButtonModule,
1532
- MatButtonToggleModule,
1533
- MatCardModule,
1534
- MatCheckboxModule,
1535
- MatChipsModule,
1536
- MatStepperModule,
1537
- MatDatepickerModule,
1538
- MatDialogModule,
1539
- MatDividerModule,
1540
- MatExpansionModule,
1541
- MatGridListModule,
1542
- MatIconModule,
1543
- MatInputModule,
1544
- MatListModule,
1545
- MatMenuModule,
1546
- MatNativeDateModule,
1547
- MatPaginatorModule,
1548
- MatProgressBarModule,
1549
- MatProgressSpinnerModule,
1550
- MatRadioModule,
1551
- MatRippleModule,
1552
- MatSelectModule,
1553
- MatSidenavModule,
1554
- MatSliderModule,
1555
- MatSlideToggleModule,
1556
- MatSnackBarModule,
1557
- MatSortModule,
1558
- MatTabsModule,
1559
- MatToolbarModule,
1560
- MatTooltipModule,
1561
- MatTreeModule,
1562
- PortalModule,
1563
- ScrollingModule,
1564
- MatFormFieldModule
1565
- ],
1566
- exports: [
1567
- MatTableExtComponent,
1568
- ResizeColumnDirective,
1569
- ColumnPinningComponent,
1570
- EditingComponent,
1571
- FilterColumnsComponentComponent,
1572
- ],
1573
- }]
1574
- }] });
1575
-
1576
- /*
1577
- * Public API Surface of mat-table-ext
1578
- */
1579
-
1580
- /**
1581
- * Generated bundle index. Do not edit.
1582
- */
1583
-
1584
- export { ColumnPinningComponent, EditingComponent, FilterColumnsComponentComponent, MatTableExtComponent, MatTableExtModule, MatTableExtService, ResizeColumnDirective };
1585
- //# sourceMappingURL=mat-table-ext.mjs.map