mat-table-ext 0.0.11 → 1.0.0-beta.0

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