mat-table-ext 0.0.6 → 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,1582 +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 = { ...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 = { ...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 = { ...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 () { return [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
197
- type: Inject,
198
- args: [MAT_DIALOG_DATA]
199
- }] }, { type: MatTableExtService }]; } });
200
-
201
- class ResizeColumnDirective {
202
- constructor(renderer, el) {
203
- this.renderer = renderer;
204
- this.el = el;
205
- this.columnsResizable$ = false;
206
- this.onMouseDown = (event) => {
207
- this.pressed = true;
208
- this.startX = event.pageX;
209
- this.startWidth = this.column.offsetWidth;
210
- };
211
- this.onMouseMove = (event) => {
212
- const offset = 5;
213
- if (this.pressed && event.buttons) {
214
- this.renderer.addClass(this.table, "resizing");
215
- // Calculate width of column
216
- let width = this.startWidth + (event.pageX - this.startX - offset);
217
- const tableCells = Array.from(this.table.querySelectorAll(".mat-row")).map((row) => row.querySelectorAll(".mat-cell").item(this.index));
218
- // Set table header width
219
- this.renderer.setStyle(this.column, "width", `${width}px`);
220
- // Set table cells width
221
- for (const cell of tableCells) {
222
- if (cell && cell !== null)
223
- this.renderer.setStyle(cell, "width", `${width}px`);
224
- }
225
- }
226
- };
227
- this.onMouseUp = (event) => {
228
- if (this.pressed) {
229
- this.pressed = false;
230
- this.renderer.removeClass(this.table, "resizing");
231
- }
232
- };
233
- this.column = this.el.nativeElement;
234
- }
235
- set columnsResizable(val) {
236
- this.columnsResizable$ = val;
237
- }
238
- get columnsResizable() {
239
- return this.columnsResizable$;
240
- }
241
- ngOnInit() {
242
- if (this.columnsResizable$) {
243
- const row = this.renderer.parentNode(this.column);
244
- const thead = this.renderer.parentNode(row);
245
- this.table = this.renderer.parentNode(thead);
246
- const resizer = this.renderer.createElement("span");
247
- this.renderer.addClass(resizer, "resize-holder");
248
- this.renderer.setAttribute(resizer, 'id', "resizeHolderSpan");
249
- this.renderer.appendChild(this.column, resizer);
250
- this.renderer.listen(resizer, "mousedown", this.onMouseDown);
251
- this.renderer.listen(this.table, "mousemove", this.onMouseMove);
252
- this.renderer.listen("document", "mouseup", this.onMouseUp);
253
- }
254
- else {
255
- this.removeDragElementFromDom();
256
- }
257
- }
258
- ngOnChanges() {
259
- if (this.columnsResizable$) {
260
- const row = this.renderer.parentNode(this.column);
261
- const thead = this.renderer.parentNode(row);
262
- const resizer = this.renderer.createElement("span");
263
- this.table = this.renderer.parentNode(thead);
264
- this.renderer.addClass(resizer, "resize-holder");
265
- this.renderer.setAttribute(resizer, 'id', "resizeHolderSpan");
266
- this.renderer.appendChild(this.column, resizer);
267
- this.renderer.listen(resizer, "mousedown", this.onMouseDown);
268
- this.renderer.listen(this.table, "mousemove", this.onMouseMove);
269
- this.renderer.listen("document", "mouseup", this.onMouseUp);
270
- }
271
- else {
272
- this.removeDragElementFromDom();
273
- }
274
- }
275
- /**
276
- * @description This method is used remove resizing handlers from the table headers when column resizing is disabled.
277
- */
278
- removeDragElementFromDom() {
279
- let ele = document.getElementById('resizeHolderSpan');
280
- if (ele && ele !== null && ele !== undefined) {
281
- this.renderer.removeChild(this.column, ele);
282
- }
283
- }
284
- }
285
- 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 });
286
- 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 });
287
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ResizeColumnDirective, decorators: [{
288
- type: Directive,
289
- args: [{
290
- selector: "[columnsResizable]"
291
- }]
292
- }], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }]; }, propDecorators: { columnsResizable: [{
293
- type: Input
294
- }], index: [{
295
- type: Input
296
- }] } });
297
-
298
- class ColumnPinningComponent {
299
- constructor() {
300
- this.columnsChanged = new EventEmitter();
301
- this.icons = {
302
- left: 'pinLeft',
303
- right: 'pinRight',
304
- none: 'pinNone',
305
- };
306
- }
307
- ngOnInit() { }
308
- /**
309
- * @description This method is called when pin value changes for a column.
310
- * @param column column of which to set the pin value
311
- */
312
- changeValue(column) {
313
- if (column.pinned) {
314
- if (column.pinned == 'left') {
315
- this.setColumnPinValue(column, 'right');
316
- }
317
- else if (column.pinned == 'right') {
318
- this.setColumnPinValue(column, undefined);
319
- }
320
- }
321
- else {
322
- this.setColumnPinValue(column, 'left');
323
- }
324
- this.columnsChanged.emit(this.columns);
325
- }
326
- /**
327
- * @description This method is used to set the column pin value.
328
- * @param column column of which to set the pin value
329
- * @param value pin value to set
330
- */
331
- setColumnPinValue(column, value) {
332
- this.columns.forEach((col) => {
333
- if (column?.header == col.header) {
334
- col.pinned = value;
335
- }
336
- });
337
- }
338
- }
339
- ColumnPinningComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ColumnPinningComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
340
- 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" }] });
341
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ColumnPinningComponent, decorators: [{
342
- type: Component,
343
- 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"] }]
344
- }], ctorParameters: function () { return []; }, propDecorators: { columns: [{
345
- type: Input
346
- }], columnsChanged: [{
347
- type: Output
348
- }] } });
349
-
350
- class FilterColumnsComponentComponent {
351
- constructor() {
352
- this.filterOutput = new EventEmitter();
353
- this.stringCtrl = new FormControl();
354
- this.numberCtrl = new FormControl();
355
- this.dateCtrl = new FormControl();
356
- this.booleanCtrl = new FormControl();
357
- this.selectionCtrl = new FormControl();
358
- }
359
- ngOnInit() {
360
- this.stringCtrl.valueChanges.subscribe((value) => {
361
- this.checkValue(value);
362
- });
363
- this.dateCtrl.valueChanges.subscribe((value) => {
364
- this.checkValue(value);
365
- });
366
- this.numberCtrl.valueChanges.subscribe((value) => {
367
- this.checkValue(value);
368
- });
369
- this.booleanCtrl.valueChanges.subscribe((value) => {
370
- this.checkValue(value);
371
- });
372
- this.selectionCtrl.valueChanges.subscribe((value) => {
373
- this.checkValue(value);
374
- });
375
- }
376
- /**
377
- * @description This method is make value is valid and not null.
378
- * @param value value to check its type.
379
- */
380
- checkValue(value) {
381
- if (value || value == '') {
382
- this.emitOutput(value);
383
- }
384
- else if (value == null) {
385
- this.emitOutput('');
386
- }
387
- }
388
- /**
389
- * @description This method will emit seach value to parent component.
390
- * @param value value on which base table rows are filtered.
391
- */
392
- emitOutput(value) {
393
- let obj = { [this.obj.field]: value };
394
- this.filterOutput.emit(obj);
395
- }
396
- }
397
- FilterColumnsComponentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FilterColumnsComponentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
398
- 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"] }] });
399
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: FilterColumnsComponentComponent, decorators: [{
400
- type: Component,
401
- 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>" }]
402
- }], ctorParameters: function () { return []; }, propDecorators: { obj: [{
403
- type: Input
404
- }], filterOutput: [{
405
- type: Output
406
- }] } });
407
-
408
- class MatTableExtComponent {
409
- constructor(dialog, service, formBuildersService, domSanitizer, matIconRegistry, cdr) {
410
- this.dialog = dialog;
411
- this.service = service;
412
- this.formBuildersService = formBuildersService;
413
- this.domSanitizer = domSanitizer;
414
- this.matIconRegistry = matIconRegistry;
415
- this.cdr = cdr;
416
- this.columns = [];
417
- this.columnResizable = false;
418
- this.stripedRows = false;
419
- this.rowHover = false;
420
- this.inlineRowEditing = false;
421
- this.inCellEditing = false;
422
- this.popupRowEditing = false;
423
- this.enableDelete = false;
424
- this.rowSelection = false;
425
- this.multiRowSelection = false;
426
- this.stickyFooter = false;
427
- this.stickyHeader = false;
428
- this.showFooterRow = false;
429
- this.columnFilter = false;
430
- this.loadingIndicator = false;
431
- this.sorting = false;
432
- this.showToolbar = false;
433
- this.toolbarTitle = '';
434
- this.tableHeight = '';
435
- this.toolbarHeight = '50px';
436
- this.tableWidth = '100%';
437
- this.scrollbarH = false;
438
- this.columnHidable = false;
439
- this.columnPinnable = false;
440
- this.globalSearch = false;
441
- this.expandRows = false;
442
- this.dndColumns = false;
443
- this.showPaginator = true;
444
- this.showFirstLastButtons = false;
445
- this.exportButtonEnable = false;
446
- this.pageSizeOptions = [10, 50, 100];
447
- this.cellTemplateRefMap = {};
448
- // Table outputs
449
- this.inlineChange = new EventEmitter();
450
- this.cellChange = new EventEmitter();
451
- this.popupChange = new EventEmitter();
452
- this.rowDeleted = new EventEmitter();
453
- this.scroll = new EventEmitter();
454
- this.selectionChanged = new EventEmitter();
455
- this.expansionChange = new EventEmitter();
456
- this.tableID = new Date().getTime();
457
- this.columnPinningOptions = [];
458
- this.exportMenuCtrl = false;
459
- this.columnPinMenuCtrl = false;
460
- this.hideShowMenuCtrl = false;
461
- this.columnFilterBySelection = false;
462
- this.rowDataTemp = {};
463
- this.inlineEditingTemplateRefData = {};
464
- this.displayedColumns = [];
465
- this.showHideColumnsArray = [];
466
- this.columnsList = [];
467
- this.columnsArray = [];
468
- this.headersFiltersIds = [];
469
- this.columnsToDisplayWithExpand = [];
470
- this.selection = new SelectionModel(false, []);
471
- this.hiddenCtrl = new SelectionModel(true, []);
472
- this.tableData = [];
473
- this.filterValues = {};
474
- this.globalFilter = '';
475
- this.showHideFilter = '';
476
- this.individualFilter = '';
477
- this.toggleFilters = false;
478
- this.hideRows = false;
479
- this.currentRowIndex = -1;
480
- this.currentRow = {};
481
- this.cellEditing = {};
482
- this.menuX = 0;
483
- this.menuY = 0;
484
- this.dynamicDisplayedColumns = [
485
- { filter: false, name: 'select', show: false },
486
- { filter: false, name: 'edit', show: false },
487
- { filter: false, name: 'popup', show: false },
488
- { filter: false, name: 'delete', show: false },
489
- { filter: false, name: 'expand', show: false },
490
- ];
491
- this.inputPropertyKeys = [
492
- 'dataSource',
493
- 'columns',
494
- 'inlineRowEditing',
495
- 'popupRowEditing',
496
- 'enableDelete',
497
- 'rowSelection',
498
- 'multiRowSelection',
499
- 'stickyHeader',
500
- 'stickyFooter',
501
- 'columnFilter',
502
- 'globalSearch',
503
- 'expandRows',
504
- 'sorting',
505
- ];
506
- /**
507
- * @description This mapping is used to set and update changesin the table.
508
- */
509
- this.setPropertiesMap = {
510
- dataSource: (value) => this.setTableDataSource(value),
511
- columns: (value) => this.setColumnsData(value.currentValue),
512
- inlineRowEditing: (value) => this.showHideColumn('edit', value.currentValue),
513
- popupRowEditing: (value) => this.showHideColumn('popup', value.currentValue),
514
- enableDelete: (value) => this.showHideColumn('delete', value.currentValue),
515
- rowSelection: (value) => this.setRowSelection(value.currentValue),
516
- multiRowSelection: (value) => {
517
- this.selection = new SelectionModel(value.currentValue, []);
518
- },
519
- stickyHeader: (value) => {
520
- this.stickyHeader = value.currentValue;
521
- },
522
- stickyFooter: (value) => {
523
- this.stickyFooter = value.currentValue;
524
- },
525
- columnFilter: (value) => this.setColumnFilter(value.currentValue),
526
- globalSearch: (value) => (this.dataSource.filterPredicate = this.createFilter()),
527
- expandRows: (value) => {
528
- this.loadingIndicator = true;
529
- this.dataSource = new MatTableDataSource(this.tableData);
530
- if (value.currentValue == true) {
531
- if (!this.displayedColumns.includes('expand')) {
532
- this.displayedColumns.push('expand');
533
- this.columnsToDisplayWithExpand = [...this.displayedColumns];
534
- }
535
- }
536
- else {
537
- this.columnsToDisplayWithExpand = [...this.displayedColumns];
538
- if (this.displayedColumns.includes('expand')) {
539
- let index = this.displayedColumns.indexOf('expand');
540
- this.displayedColumns.splice(index, 1);
541
- }
542
- this.expandedElement = null;
543
- }
544
- setTimeout(() => {
545
- this.loadingIndicator = false;
546
- }, 200);
547
- },
548
- sorting: (value) => (this.dataSource.sort = this.sort),
549
- };
550
- /**
551
- * @description This method will take data from inline editing template and update in table data source.
552
- * @param row updated row from inline editing template.
553
- */
554
- this.updateInlineTemplateData = (row) => {
555
- this.service.selectedRow.next(row);
556
- };
557
- this.addIconsToRegistry();
558
- if (this.dataSource) {
559
- this.tableData = this.dataSource.data;
560
- }
561
- }
562
- /**
563
- *
564
- * @param changes changes captured each time user changes property value.
565
- */
566
- ngOnChanges(changes) {
567
- this.setPropertyValue(changes);
568
- }
569
- ngOnInit() {
570
- if (this.dataSource) {
571
- this.dataSource.filterPredicate = this.createFilter();
572
- }
573
- }
574
- ngAfterViewInit() {
575
- if (this.dataSource) {
576
- this.dataSource.paginator = this.paginator;
577
- this.dataSource.sort = this.sort;
578
- }
579
- }
580
- /**
581
- * @description checks and updates the the column's hide and show properties.
582
- */
583
- setColumnHideShow() {
584
- if (this.hideShowMenuGroup !== undefined &&
585
- this.hideShowMenuGroup !== null) {
586
- this.updateColumnsHideShow(this.hideShowMenuGroup.value);
587
- }
588
- }
589
- /**
590
- * @description set the properties of the table.
591
- * @param changes changes captured each time user changes property value.
592
- */
593
- setPropertyValue(changes) {
594
- let keys = Object.keys(changes);
595
- keys.forEach((property) => {
596
- if (this.inputPropertyKeys.includes(property)) {
597
- this.setPropertiesMap[property](changes[property]);
598
- }
599
- else if (property == 'showToolbar') {
600
- if (changes['columns']) {
601
- this.setToolbarMenuControls(changes['columns'].currentValue);
602
- }
603
- else {
604
- this.setToolbarMenuControls(this.columnsArray);
605
- }
606
- }
607
- });
608
- }
609
- /**
610
- * @description used set data source for table.
611
- * @param value data source value from user.
612
- */
613
- setTableDataSource(value) {
614
- if (value.currentValue) {
615
- this.tableData = value.currentValue.data;
616
- this.dataSource = value.currentValue;
617
- this.reCal();
618
- }
619
- else {
620
- this.dataSource = new MatTableDataSource([{}]);
621
- }
622
- }
623
- /**
624
- * @description used create seletion model and set selection column visibility.
625
- * @param value boolean value to show or hide selection Column from table.
626
- */
627
- setRowSelection(value) {
628
- this.selection = new SelectionModel(true, []);
629
- this.updateSelectionColumnVisibility(value);
630
- }
631
- /**
632
- * @description create filter header row and assigns filter predicate to table data source.
633
- * @param value boolean value to change visibility of column filter row.
634
- */
635
- setColumnFilter(value) {
636
- if (value) {
637
- let array = [];
638
- this.columnsArray.forEach((column, i) => {
639
- if (this.dynamicDisplayedColumns.filter((a) => a.name == column?.field)[0]
640
- .show) {
641
- array.push(column?.field + '_' + i);
642
- }
643
- });
644
- this.headersFiltersIds = array;
645
- this.dataSource.filterPredicate = this.createFilter();
646
- }
647
- else {
648
- this.headersFiltersIds = [];
649
- this.dataSource.filter = '';
650
- }
651
- this.toggleFilters = value;
652
- }
653
- /**
654
- * @description This method returns the list of visible column names.
655
- * @returns list of visible column names.
656
- */
657
- getDisplayedColumns() {
658
- let list = this.dynamicDisplayedColumns
659
- .filter((cd) => cd.show)
660
- .map((cd) => cd.name);
661
- return list;
662
- }
663
- /**
664
- * @param menuType type of menu to open from toolbar.
665
- * @param event mouse event to open menu on that location.
666
- */
667
- openMenu(menuType, event) {
668
- this.menuX = event.clientX;
669
- this.menuY = event.clientY;
670
- switch (menuType) {
671
- case 'export': {
672
- this.exportMenuCtrl = true;
673
- this.menuTrigger.openMenu();
674
- break;
675
- }
676
- case 'hideShow': {
677
- this.hideShowMenuCtrl = true;
678
- this.openHideShowMenu(this.columnsArray);
679
- break;
680
- }
681
- case 'columnPin': {
682
- this.columnPinMenuCtrl = true;
683
- this.openHideShowMenu(this.columnsArray);
684
- break;
685
- }
686
- }
687
- }
688
- /**
689
- * @description triggers when menu is closed and reset the required controls.
690
- */
691
- menuClosed() {
692
- this.exportMenuCtrl = false;
693
- }
694
- /**
695
- * @description set list of columns to display in table.
696
- * @param columns columns array from user input.
697
- */
698
- setColumnsData(columns) {
699
- if (columns.length) {
700
- this.columnsArray = [...columns];
701
- this.setColumnsList(columns);
702
- }
703
- }
704
- /**
705
- * @description set list of columns to display in table.
706
- * @param columns columns array from user input with configurations.
707
- */
708
- setColumnsList(columns) {
709
- this.columnsList = [];
710
- this.displayedColumns = ['select', 'edit', 'popup', 'delete'];
711
- let columnsArray = [];
712
- columns.forEach((col) => {
713
- if (typeof col?.header == 'string') {
714
- this.columnsList.push(col?.header);
715
- this.displayedColumns.push(col?.field);
716
- columnsArray.push({ filter: true, name: col?.field, show: !col.hide });
717
- }
718
- });
719
- this.dynamicDisplayedColumns = [
720
- { filter: false, name: 'select', show: false },
721
- { filter: false, name: 'edit', show: false },
722
- { filter: false, name: 'popup', show: false },
723
- { filter: false, name: 'delete', show: false },
724
- ];
725
- this.dynamicDisplayedColumns = columnsArray.concat(this.dynamicDisplayedColumns);
726
- }
727
- /**
728
- * @description Take boolean value and name column and update its visibility status in table.
729
- * @param name name of the column to set visibility.
730
- * @param value boolean value to set visibility of the column.
731
- */
732
- showHideColumn(name, value) {
733
- this.dynamicDisplayedColumns.filter((a) => a.name == name)[0].show = value;
734
- if (this.columnFilter) {
735
- this.setColumnFilter(true);
736
- }
737
- }
738
- /**
739
- * @description This method will position the selection column to first and also update its visibility.
740
- * @param value value used to set visibility of the selection column.
741
- */
742
- updateSelectionColumnVisibility(value) {
743
- let columnName = 'select';
744
- let column = this.dynamicDisplayedColumns.filter((a) => a.name == columnName)[0];
745
- let index = this.dynamicDisplayedColumns.findIndex((column) => column.name == columnName);
746
- if (index > -1) {
747
- this.dynamicDisplayedColumns.splice(index, 1);
748
- this.dynamicDisplayedColumns.unshift(column);
749
- this.dynamicDisplayedColumns.filter((column) => column.name == columnName)[0].show = value;
750
- }
751
- }
752
- /**
753
- * @description This method is used to update the position of column in columns array according to its dropped position.
754
- * @param event CdkDragDrop used to update column position in columns array.
755
- */
756
- onDrop(event) {
757
- if (this.dndColumns) {
758
- let adjustedValue = 0;
759
- if (this.dynamicDisplayedColumns[0].name == 'select' &&
760
- this.dynamicDisplayedColumns[0].show == false) {
761
- adjustedValue = 1;
762
- }
763
- moveItemInArray(this.dynamicDisplayedColumns, event.previousIndex + adjustedValue, event.currentIndex + adjustedValue);
764
- }
765
- }
766
- /**
767
- * @description This method create filter predicate function which will set search value to table filters
768
- * for both global and individual colum filtering.
769
- * @returns returns boolean value to filter rows in table.
770
- */
771
- createFilter() {
772
- const tableFilterPredicate = (data, filter) => {
773
- let result = true;
774
- // search all column fields
775
- if (this.globalFilter) {
776
- let expression = '';
777
- let keys = Object.keys(data);
778
- keys.forEach((key) => {
779
- expression =
780
- expression +
781
- `data.${key}.toString().trim().toLowerCase().indexOf(this.globalFilter.toLowerCase()) !== -1 ||`;
782
- });
783
- if (expression.charAt(expression.length - 2) +
784
- expression.charAt(expression.length - 1) ==
785
- '||') {
786
- expression = expression.substring(0, expression.length - 2);
787
- }
788
- result = eval(expression);
789
- }
790
- if (!result) {
791
- return false;
792
- }
793
- let searchString = JSON.parse(filter);
794
- //search single column field
795
- if (this.individualFilter) {
796
- return (data[this.individualFilter]
797
- .toString()
798
- .trim()
799
- .toLowerCase()
800
- .indexOf(searchString[this.individualFilter].toString().toLowerCase()) !== -1);
801
- }
802
- return true;
803
- };
804
- return tableFilterPredicate;
805
- }
806
- /**
807
- * @description assigns the search value to mat table data source to apply the filter.
808
- * @param searchValue value to be searched from table rows.
809
- */
810
- applyGlobalFilter(searchValue) {
811
- this.globalFilter = searchValue;
812
- let columns = {};
813
- this.columnsArray.forEach((column) => {
814
- if (column.field)
815
- columns[column.field] = searchValue;
816
- });
817
- this.dataSource.filter = JSON.stringify(columns);
818
- }
819
- /**
820
- * @description This method is used to apply column based filtering
821
- * @param searchValue value to be searched from table rows.
822
- * @param column filter will be applied based on this column field.
823
- */
824
- applyColumnFilter(searchValue, column) {
825
- this.individualFilter = column.field;
826
- this.filterValues[column.field] = searchValue[column.field];
827
- this.dataSource.filter = JSON.stringify(this.filterValues);
828
- }
829
- /**
830
- * @description This method will take row and its index enable inline editing tools on that row.
831
- * @param row row on which user wants to do edit.
832
- * @param index index of the row where inline editing will be enabled.
833
- */
834
- enableInlineEditing(row, index) {
835
- const rowData = {};
836
- rowData['e' + index] = { ...row };
837
- this.rowDataTemp = rowData;
838
- setTimeout(() => {
839
- this.tableData[index]['editable'] = !this.tableData[index]['editable'];
840
- }, 0);
841
- }
842
- /**
843
- * @description This method will create and return data to inline editing template.
844
- * @param row row on which user wants to do edit.
845
- * @param index index of the row where inline editing will be enabled.
846
- * @param column current column of the table.
847
- */
848
- getInlineEditingData(row, index, column) {
849
- this.inlineEditingTemplateRefData = {
850
- row: { ...row },
851
- column: { ...column },
852
- index: index,
853
- updateFunc: this.updateInlineTemplateData,
854
- };
855
- return this.inlineEditingTemplateRefData;
856
- }
857
- /**
858
- * @description This method set data for in-cell editing.
859
- * @param row row on which user wants to do edit.
860
- * @param index index of the row where inline editing will be enabled.
861
- */
862
- setCellData(row, index) {
863
- this.currentRow = { ...row };
864
- this.currentRowIndex = index;
865
- this.rowDataTemp['e' + index] = { ...row };
866
- }
867
- /**
868
- * @description This will restore the data and cencel the inline editing.
869
- * @param row row on which user wants to do edit.
870
- * @param index index of the row where inline editing will be enabled.
871
- */
872
- cancelInlineEditing(row, index) {
873
- this.tableData.filter((a, i) => i == index)[0]['editable'] =
874
- !this.tableData.filter((a, i) => i == index)[0]['editable'];
875
- this.dataSource = new MatTableDataSource(this.tableData);
876
- this.rowDataTemp['e' + index] = {};
877
- this.service.selectedRow.next(undefined);
878
- }
879
- /**
880
- * @description This method will save and update the inline editing data and emit the update row and index.
881
- * @param row row on which user wants to do edit.
882
- * @param index index of the row where inline editing will be enabled.
883
- */
884
- saveInlineEditing(row, index) {
885
- if (!this.inlineEditingTemplateRef) {
886
- this.tableData[index] = { ...this.rowDataTemp['e' + index] };
887
- row = { ...this.rowDataTemp['e' + index] };
888
- }
889
- else {
890
- let changedData = this.service.selectedRow.value;
891
- if (changedData) {
892
- this.tableData[index] = { ...changedData };
893
- }
894
- }
895
- this.dataSource = new MatTableDataSource(this.tableData);
896
- this.rowDataTemp['e' + index] = {};
897
- let data = {
898
- row: row,
899
- index: index,
900
- };
901
- this.inlineChange.emit(data);
902
- this.tableData[index]['editable'] = false;
903
- }
904
- /**
905
- * @description This method will save and update the cell editing data and emit the update row and index.
906
- */
907
- saveCellEditing() {
908
- this.cellEditing = {};
909
- let index = this.currentRowIndex;
910
- if (index > -1) {
911
- if (this.cellEditingTemplateRef) {
912
- let changedData = this.service.selectedRow.value;
913
- if (changedData) {
914
- this.tableData[index] = { ...changedData };
915
- }
916
- }
917
- else {
918
- this.tableData[index] = { ...this.rowDataTemp['e' + index] };
919
- }
920
- this.dataSource = new MatTableDataSource(this.tableData);
921
- this.rowDataTemp['e' + index] = {};
922
- let data = {
923
- row: { ...this.tableData[index] },
924
- index: index,
925
- };
926
- this.currentRowIndex = -1;
927
- this.cellChange.emit(data);
928
- }
929
- }
930
- /**
931
- * @description This method will delete the row from the given index and emit the deleted row and index.
932
- * @param row row to be deleted.
933
- * @param index index of the row to be deleted.
934
- */
935
- deleteRow(row, index) {
936
- this.tableData.splice(index, 1);
937
- this.dataSource = new MatTableDataSource(this.tableData);
938
- this.dataSource.paginator = this.paginator;
939
- this.dataSource.sort = this.sort;
940
- this.rowDeleted.emit({ removedRow: row, fromIndex: index });
941
- }
942
- /**
943
- * @description This method will expand or collapse the row and emit expand event.
944
- * @param row row to be expanded or collapsed.
945
- * @param expand value used to expand or collapse the row.
946
- * @param index index of the row.
947
- */
948
- expandRow(row, expand, index) {
949
- if (this.expandRows) {
950
- this.expansionChange.emit({ data: row, expanded: expand, index: index });
951
- this.expandedElement = this.expandedElement === row ? null : row;
952
- }
953
- }
954
- /**
955
- * @description This method is used to set data for popup component and open editing dialog.
956
- * @param row row which used want to edit.
957
- */
958
- openEditingDialog(row) {
959
- const dialogConfig = new MatDialogConfig();
960
- dialogConfig.disableClose = true;
961
- dialogConfig.width = '40%';
962
- dialogConfig.height = '70%';
963
- dialogConfig.maxWidth = '100%';
964
- let rowData = { ...row };
965
- dialogConfig.data = {
966
- row: rowData,
967
- columns: [...this.columnsArray],
968
- templateRef: this.popupEditingTemplateRef,
969
- };
970
- this.dialog
971
- .open(EditingComponent, dialogConfig)
972
- .afterClosed()
973
- .subscribe((data) => {
974
- let index = this.tableData.indexOf(row);
975
- if (data && index > -1) {
976
- this.tableData[index] = data;
977
- this.dataSource = new MatTableDataSource(this.tableData);
978
- let dataChange = {
979
- row: data,
980
- index: index,
981
- };
982
- this.popupChange.emit(dataChange);
983
- }
984
- });
985
- }
986
- /**
987
- * @description used to check whether all rows are selected.
988
- */
989
- isAllSelected() {
990
- const numSelected = this.selection.selected.length;
991
- const numRows = this.dataSource.data.length;
992
- return numSelected === numRows;
993
- }
994
- /**
995
- * @description this method is used to toggle the all and no rows selection.
996
- */
997
- toggleAllRows() {
998
- if (this.isAllSelected()) {
999
- this.selection.clear();
1000
- return;
1001
- }
1002
- this.selection.select(...this.dataSource.data);
1003
- }
1004
- /**
1005
- * @description This method is used return aria-label for selection column checkboxs.
1006
- * @param row row from table.
1007
- * @returns labels for selection column checkboxs.
1008
- */
1009
- checkboxLabel(row) {
1010
- if (!row) {
1011
- return `${this.isAllSelected() ? 'deselect' : 'select'} all`;
1012
- }
1013
- return `${this.selection.isSelected(row) ? 'deselect' : 'select'} row ${row.position + 1}`;
1014
- }
1015
- /**
1016
- * @description create form control for columns for hiding and and pinning purpose
1017
- * @param columns list of columns to be displayed
1018
- */
1019
- setToolbarMenuControls(columns) {
1020
- if (columns.length > 0 && this.showToolbar) {
1021
- const group = this.formBuildersService.group({});
1022
- columns.forEach((column) => {
1023
- const control = this.formBuildersService.control(true);
1024
- group.addControl(column.field, control);
1025
- });
1026
- this.hideShowMenuGroup = group;
1027
- }
1028
- }
1029
- /**
1030
- * @param column current column
1031
- * @param event mouse event used to set the menu position
1032
- */
1033
- openPinnablePropertyMenu(column, event) {
1034
- this.menuX = event.clientX;
1035
- this.menuY = event.clientY;
1036
- let options = [
1037
- {
1038
- label: 'Pin Left',
1039
- value: 'left',
1040
- selected: false,
1041
- field: column.field,
1042
- },
1043
- {
1044
- label: 'Pin Right',
1045
- value: 'right',
1046
- selected: false,
1047
- field: column.field,
1048
- },
1049
- { label: 'No Pin', value: null, selected: false, field: column.field },
1050
- ];
1051
- if (column.pinned && column.pinned !== null) {
1052
- options.forEach((opt) => {
1053
- if (opt.value === column.pinned) {
1054
- opt.selected = true;
1055
- }
1056
- });
1057
- }
1058
- else if (column.pinned == null || column.pinned == 'null') {
1059
- options[2].selected = true;
1060
- }
1061
- this.columnPinningOptions = options;
1062
- this.columnMenuTrigger.openMenu();
1063
- }
1064
- /**
1065
- * @description This method is used to reset menu checks when required.
1066
- */
1067
- resetMenuChecks() {
1068
- this.hideShowMenuCtrl = false;
1069
- this.showHideColumnsArray = [];
1070
- this.columnPinMenuCtrl = false;
1071
- this.columnPinningOptions = [];
1072
- }
1073
- /**
1074
- * @description This method is used to filter columns for menus like pinning or hide show menu.
1075
- * @param value search value to filter colunms
1076
- */
1077
- filterColumns(value) {
1078
- if (value !== '') {
1079
- this.showHideColumnsArray = this.columnsArray.filter((col) => {
1080
- return col.header.toLowerCase().includes(value.toLowerCase());
1081
- });
1082
- }
1083
- else {
1084
- this.showHideColumnsArray = this.columnsArray;
1085
- }
1086
- }
1087
- /**
1088
- * @description This method is used to open hide show column menu.
1089
- * @param columns columns array to display in hide show menu.
1090
- */
1091
- openHideShowMenu(columns) {
1092
- this.showHideColumnsArray = [...columns];
1093
- this.columnMenuTrigger.openMenu();
1094
- }
1095
- /**
1096
- * @param values columns
1097
- */
1098
- updateColumnsHideShow(values) {
1099
- let keys = Object.keys(values);
1100
- keys.forEach((key) => {
1101
- this.showHideColumn(key, values[key]);
1102
- });
1103
- }
1104
- /**
1105
- * @description This method is called when the table rows are scrolled.
1106
- * @param event scroll event
1107
- */
1108
- onScroll(event) {
1109
- this.scroll.emit(event);
1110
- }
1111
- /**
1112
- * @param row row to be toggled
1113
- * @param index index of toggled row
1114
- */
1115
- setSelectedRows(row, index) {
1116
- this.selection.toggle(row);
1117
- if (this.selection.isSelected(row)) {
1118
- this.selectionChanged.emit({ row: row, index: index, isSelected: true });
1119
- }
1120
- else {
1121
- this.selectionChanged.emit({ row: row, index: index, isSelected: false });
1122
- }
1123
- }
1124
- /**
1125
- * @description This method is used to display all hidden rows.
1126
- */
1127
- showHiddenRows() {
1128
- this.hideRows = false;
1129
- this.selection.clear();
1130
- this.hiddenCtrl.clear();
1131
- }
1132
- /**
1133
- * @description This method is used to hide all selected rows.
1134
- */
1135
- hideSelectedRows() {
1136
- if (!this.selection.isEmpty()) {
1137
- let values = [...this.selection.selected];
1138
- values.forEach((value) => {
1139
- if (!this.hiddenCtrl.isSelected(value)) {
1140
- this.hiddenCtrl.toggle(value);
1141
- }
1142
- });
1143
- this.selection.clear();
1144
- this.hideRows = true;
1145
- }
1146
- }
1147
- /**
1148
- * @description This method is used to recalculate the required values for table.
1149
- */
1150
- reCal() {
1151
- if (this.showPaginator) {
1152
- this.dataSource.paginator = this.paginator;
1153
- }
1154
- if (this.sorting) {
1155
- this.dataSource.sort = this.sort;
1156
- }
1157
- if (this.columnFilter) {
1158
- this.dataSource.filterPredicate = this.createFilter();
1159
- }
1160
- }
1161
- /**
1162
- * @description This method is called in constructor method to add SVGs into icon registration.
1163
- */
1164
- addIconsToRegistry() {
1165
- let y = this.domSanitizer.bypassSecurityTrustResourceUrl(`assets/pinRight.svg`);
1166
- let iconNames = ['pinLeft', 'pinRight', 'pinNone', 'pinned', 'pinIcon'];
1167
- iconNames.forEach((icon) => {
1168
- this.matIconRegistry.addSvgIcon(icon, this.domSanitizer.bypassSecurityTrustResourceUrl(`assets/${icon}.svg`));
1169
- });
1170
- }
1171
- /**
1172
- * @description This method is used to export table data.
1173
- * @param type type of file to be exported.
1174
- */
1175
- exportTable(type) {
1176
- var element = document.getElementById('matTableExt' + this.tableID);
1177
- var ws = XLSX.utils.table_to_sheet(element);
1178
- ws = this.writeSheetData(ws);
1179
- const wb = XLSX.utils.book_new();
1180
- XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
1181
- XLSX.writeFile(wb, `tablesheets.${type}`);
1182
- }
1183
- /**
1184
- * @description This method is used to split name of filter row header to get index.
1185
- * @param value value to be splited for index.
1186
- * @returns Will return index of column from value.
1187
- */
1188
- returnIndex(value) {
1189
- return Number(value.split('_')[1]);
1190
- }
1191
- /**
1192
- * @description This method is used to manage column filtering, expanded data for exporting.
1193
- * @param ws work sheet
1194
- * @returns custom generated worksheet to be used in export.
1195
- */
1196
- writeSheetData(ws) {
1197
- let displayedColumns = this.getDisplayedColumns();
1198
- var nMerges = this.getMergeIndex(ws['!merges'] || []);
1199
- var merges = ws['!merges'] || [];
1200
- let data = {
1201
- '!cols': [],
1202
- '!rows': [],
1203
- '!merges': nMerges,
1204
- };
1205
- var range = XLSX.utils.decode_range(ws['!ref'] || '');
1206
- let extracolumns = ['popup', 'delete', 'select', 'edit'];
1207
- let keys = Object.keys(ws);
1208
- let nKey = 'A';
1209
- keys.forEach((key, i) => {
1210
- if (ws[key]?.v && typeof ws[key]?.v === 'string') {
1211
- if (!extracolumns.includes(ws[key].v.toLowerCase()) &&
1212
- displayedColumns.includes(ws[key].v.toLowerCase())) {
1213
- let lastRowIndex = range?.e?.r;
1214
- data[key] = ws[key];
1215
- let chr = key.charAt(0);
1216
- for (let j = 2; j <= lastRowIndex; j++) {
1217
- if (ws[chr + (j + 1)] !== undefined &&
1218
- (typeof ws[chr + (j + 1)].v === 'string' ||
1219
- typeof ws[chr + (j + 1)].v === 'number')) {
1220
- data[nKey + j] = ws[chr + (j + 1)];
1221
- }
1222
- }
1223
- nKey = String.fromCharCode(nKey.charCodeAt(0) + 1);
1224
- }
1225
- }
1226
- });
1227
- if (this.rowSelection) {
1228
- let chr = 'A';
1229
- for (let i = 1; i < range.e.c + 1; i++) {
1230
- data[chr + 1] = data[String.fromCharCode(chr.charCodeAt(0) + 1) + 1];
1231
- chr = String.fromCharCode(chr.charCodeAt(0) + 1);
1232
- if (i == range.e.c) {
1233
- data[chr + 1] = undefined;
1234
- }
1235
- }
1236
- }
1237
- if (this.rowSelection && this.expandRows) {
1238
- merges.forEach((merge) => {
1239
- data['A' + merge.s.r] = ws['A' + (merge.s.r + 1)];
1240
- });
1241
- }
1242
- range.e.r--;
1243
- let nRef = XLSX.utils.encode_range(range);
1244
- data['!ref'] = nRef;
1245
- data['!fullref'] = nRef;
1246
- return data;
1247
- }
1248
- getMergeIndex(merges) {
1249
- var arr = [];
1250
- merges.forEach((element) => {
1251
- arr.push({
1252
- e: {
1253
- r: element.e.r == 0 ? element.e.r : element.e.r - 1,
1254
- c: element.e.c,
1255
- },
1256
- s: {
1257
- r: element.s.r == 0 ? element.s.r : element.s.r - 1,
1258
- c: element.s.c,
1259
- },
1260
- });
1261
- });
1262
- return arr;
1263
- }
1264
- }
1265
- 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 });
1266
- 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: [
1267
- trigger('detailExpand', [
1268
- state('collapsed', style({ height: '0px', minHeight: '0' })),
1269
- state('expanded', style({ height: '*' })),
1270
- transition('expanded <=> collapsed', animate('300ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
1271
- ]),
1272
- ], encapsulation: i0.ViewEncapsulation.None });
1273
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MatTableExtComponent, decorators: [{
1274
- type: Component,
1275
- args: [{ selector: 'mat-table-ext', encapsulation: ViewEncapsulation.None, animations: [
1276
- trigger('detailExpand', [
1277
- state('collapsed', style({ height: '0px', minHeight: '0' })),
1278
- state('expanded', style({ height: '*' })),
1279
- transition('expanded <=> collapsed', animate('300ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
1280
- ]),
1281
- ], 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"] }]
1282
- }], 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: [{
1283
- type: ViewChild,
1284
- args: [MatMenuTrigger]
1285
- }], columnMenuTrigger: [{
1286
- type: ViewChild,
1287
- args: ['columnMenuTrigger']
1288
- }], paginator: [{
1289
- type: ViewChild,
1290
- args: [MatPaginator]
1291
- }], sort: [{
1292
- type: ViewChild,
1293
- args: [MatSort]
1294
- }], dataSource: [{
1295
- type: Input
1296
- }], columns: [{
1297
- type: Input
1298
- }], columnResizable: [{
1299
- type: Input
1300
- }], stripedRows: [{
1301
- type: Input
1302
- }], rowHover: [{
1303
- type: Input
1304
- }], inlineRowEditing: [{
1305
- type: Input
1306
- }], inCellEditing: [{
1307
- type: Input
1308
- }], popupRowEditing: [{
1309
- type: Input
1310
- }], enableDelete: [{
1311
- type: Input
1312
- }], rowSelection: [{
1313
- type: Input
1314
- }], multiRowSelection: [{
1315
- type: Input
1316
- }], stickyFooter: [{
1317
- type: Input
1318
- }], stickyHeader: [{
1319
- type: Input
1320
- }], showFooterRow: [{
1321
- type: Input
1322
- }], columnFilter: [{
1323
- type: Input
1324
- }], loadingIndicator: [{
1325
- type: Input
1326
- }], sorting: [{
1327
- type: Input
1328
- }], showToolbar: [{
1329
- type: Input
1330
- }], toolbarTitle: [{
1331
- type: Input
1332
- }], tableHeight: [{
1333
- type: Input
1334
- }], toolbarHeight: [{
1335
- type: Input
1336
- }], tableWidth: [{
1337
- type: Input
1338
- }], scrollbarH: [{
1339
- type: Input
1340
- }], toolbarTemplate: [{
1341
- type: Input
1342
- }], columnHidable: [{
1343
- type: Input
1344
- }], columnPinnable: [{
1345
- type: Input
1346
- }], globalSearch: [{
1347
- type: Input
1348
- }], expandRows: [{
1349
- type: Input
1350
- }], dndColumns: [{
1351
- type: Input
1352
- }], showPaginator: [{
1353
- type: Input
1354
- }], showFirstLastButtons: [{
1355
- type: Input
1356
- }], exportButtonEnable: [{
1357
- type: Input
1358
- }], pageSizeOptions: [{
1359
- type: Input
1360
- }], toolbarTemplateRef: [{
1361
- type: Input
1362
- }], headerTemplateRef: [{
1363
- type: Input
1364
- }], cellTemplateRef: [{
1365
- type: Input
1366
- }], expansionTemplateRef: [{
1367
- type: Input
1368
- }], popupEditingTemplateRef: [{
1369
- type: Input
1370
- }], inlineEditingTemplateRef: [{
1371
- type: Input
1372
- }], cellEditingTemplateRef: [{
1373
- type: Input
1374
- }], cellTemplateRefMap: [{
1375
- type: Input
1376
- }], inlineChange: [{
1377
- type: Output
1378
- }], cellChange: [{
1379
- type: Output
1380
- }], popupChange: [{
1381
- type: Output
1382
- }], rowDeleted: [{
1383
- type: Output
1384
- }], scroll: [{
1385
- type: Output
1386
- }], selectionChanged: [{
1387
- type: Output
1388
- }], expansionChange: [{
1389
- type: Output
1390
- }] } });
1391
-
1392
- class MatTableExtModule {
1393
- }
1394
- MatTableExtModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MatTableExtModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1395
- MatTableExtModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: MatTableExtModule, declarations: [MatTableExtComponent,
1396
- ResizeColumnDirective,
1397
- ColumnPinningComponent,
1398
- EditingComponent,
1399
- FilterColumnsComponentComponent], imports: [CommonModule, i1$2.TranslateModule, MatTableModule,
1400
- FormsModule,
1401
- ReactiveFormsModule,
1402
- MatNativeDateModule,
1403
- A11yModule,
1404
- CdkAccordionModule,
1405
- ClipboardModule,
1406
- CdkStepperModule,
1407
- CdkTableModule,
1408
- CdkTreeModule,
1409
- DragDropModule,
1410
- MatAutocompleteModule,
1411
- MatBadgeModule,
1412
- MatBottomSheetModule,
1413
- MatButtonModule,
1414
- MatButtonToggleModule,
1415
- MatCardModule,
1416
- MatCheckboxModule,
1417
- MatChipsModule,
1418
- MatStepperModule,
1419
- MatDatepickerModule,
1420
- MatDialogModule,
1421
- MatDividerModule,
1422
- MatExpansionModule,
1423
- MatGridListModule,
1424
- MatIconModule,
1425
- MatInputModule,
1426
- MatListModule,
1427
- MatMenuModule,
1428
- MatNativeDateModule,
1429
- MatPaginatorModule,
1430
- MatProgressBarModule,
1431
- MatProgressSpinnerModule,
1432
- MatRadioModule,
1433
- MatRippleModule,
1434
- MatSelectModule,
1435
- MatSidenavModule,
1436
- MatSliderModule,
1437
- MatSlideToggleModule,
1438
- MatSnackBarModule,
1439
- MatSortModule,
1440
- MatTabsModule,
1441
- MatToolbarModule,
1442
- MatTooltipModule,
1443
- MatTreeModule,
1444
- PortalModule,
1445
- ScrollingModule,
1446
- MatFormFieldModule], exports: [MatTableExtComponent,
1447
- ResizeColumnDirective,
1448
- ColumnPinningComponent,
1449
- EditingComponent,
1450
- FilterColumnsComponentComponent] });
1451
- MatTableExtModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MatTableExtModule, imports: [CommonModule,
1452
- TranslateModule.forChild(),
1453
- MatTableModule,
1454
- FormsModule,
1455
- ReactiveFormsModule,
1456
- MatNativeDateModule,
1457
- A11yModule,
1458
- CdkAccordionModule,
1459
- ClipboardModule,
1460
- CdkStepperModule,
1461
- CdkTableModule,
1462
- CdkTreeModule,
1463
- DragDropModule,
1464
- MatAutocompleteModule,
1465
- MatBadgeModule,
1466
- MatBottomSheetModule,
1467
- MatButtonModule,
1468
- MatButtonToggleModule,
1469
- MatCardModule,
1470
- MatCheckboxModule,
1471
- MatChipsModule,
1472
- MatStepperModule,
1473
- MatDatepickerModule,
1474
- MatDialogModule,
1475
- MatDividerModule,
1476
- MatExpansionModule,
1477
- MatGridListModule,
1478
- MatIconModule,
1479
- MatInputModule,
1480
- MatListModule,
1481
- MatMenuModule,
1482
- MatNativeDateModule,
1483
- MatPaginatorModule,
1484
- MatProgressBarModule,
1485
- MatProgressSpinnerModule,
1486
- MatRadioModule,
1487
- MatRippleModule,
1488
- MatSelectModule,
1489
- MatSidenavModule,
1490
- MatSliderModule,
1491
- MatSlideToggleModule,
1492
- MatSnackBarModule,
1493
- MatSortModule,
1494
- MatTabsModule,
1495
- MatToolbarModule,
1496
- MatTooltipModule,
1497
- MatTreeModule,
1498
- PortalModule,
1499
- ScrollingModule,
1500
- MatFormFieldModule] });
1501
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MatTableExtModule, decorators: [{
1502
- type: NgModule,
1503
- args: [{
1504
- declarations: [
1505
- MatTableExtComponent,
1506
- ResizeColumnDirective,
1507
- ColumnPinningComponent,
1508
- EditingComponent,
1509
- FilterColumnsComponentComponent,
1510
- ],
1511
- imports: [
1512
- CommonModule,
1513
- TranslateModule.forChild(),
1514
- MatTableModule,
1515
- FormsModule,
1516
- ReactiveFormsModule,
1517
- MatNativeDateModule,
1518
- A11yModule,
1519
- CdkAccordionModule,
1520
- ClipboardModule,
1521
- CdkStepperModule,
1522
- CdkTableModule,
1523
- CdkTreeModule,
1524
- DragDropModule,
1525
- MatAutocompleteModule,
1526
- MatBadgeModule,
1527
- MatBottomSheetModule,
1528
- MatButtonModule,
1529
- MatButtonToggleModule,
1530
- MatCardModule,
1531
- MatCheckboxModule,
1532
- MatChipsModule,
1533
- MatStepperModule,
1534
- MatDatepickerModule,
1535
- MatDialogModule,
1536
- MatDividerModule,
1537
- MatExpansionModule,
1538
- MatGridListModule,
1539
- MatIconModule,
1540
- MatInputModule,
1541
- MatListModule,
1542
- MatMenuModule,
1543
- MatNativeDateModule,
1544
- MatPaginatorModule,
1545
- MatProgressBarModule,
1546
- MatProgressSpinnerModule,
1547
- MatRadioModule,
1548
- MatRippleModule,
1549
- MatSelectModule,
1550
- MatSidenavModule,
1551
- MatSliderModule,
1552
- MatSlideToggleModule,
1553
- MatSnackBarModule,
1554
- MatSortModule,
1555
- MatTabsModule,
1556
- MatToolbarModule,
1557
- MatTooltipModule,
1558
- MatTreeModule,
1559
- PortalModule,
1560
- ScrollingModule,
1561
- MatFormFieldModule
1562
- ],
1563
- exports: [
1564
- MatTableExtComponent,
1565
- ResizeColumnDirective,
1566
- ColumnPinningComponent,
1567
- EditingComponent,
1568
- FilterColumnsComponentComponent,
1569
- ],
1570
- }]
1571
- }] });
1572
-
1573
- /*
1574
- * Public API Surface of mat-table-ext
1575
- */
1576
-
1577
- /**
1578
- * Generated bundle index. Do not edit.
1579
- */
1580
-
1581
- export { ColumnPinningComponent, EditingComponent, FilterColumnsComponentComponent, MatTableExtComponent, MatTableExtModule, MatTableExtService, ResizeColumnDirective };
1582
- //# sourceMappingURL=mat-table-ext.mjs.map