ngx-st-tables 1.0.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 (32) hide show
  1. package/README.md +24 -0
  2. package/esm2020/lib/components/local-table/configurations/configurations.component.mjs +70 -0
  3. package/esm2020/lib/components/local-table/local-table.component.mjs +191 -0
  4. package/esm2020/lib/components/select-table/select-table.mjs +101 -0
  5. package/esm2020/lib/models/local-table/st-configurations-settings.model.mjs +2 -0
  6. package/esm2020/lib/models/local-table/st-global-search-settings.model.mjs +2 -0
  7. package/esm2020/lib/models/local-table/st-local-storage-configuration.model.mjs +2 -0
  8. package/esm2020/lib/models/local-table/st-local-table-column.model.mjs +2 -0
  9. package/esm2020/lib/models/local-table/st-local-table-columns.model.mjs +2 -0
  10. package/esm2020/lib/models/local-table/st-table-settings.model.mjs +2 -0
  11. package/esm2020/lib/services/local-table.service.mjs +33 -0
  12. package/esm2020/lib/st-tables.module.mjs +99 -0
  13. package/esm2020/ngx-st-tables.mjs +5 -0
  14. package/esm2020/public-api.mjs +15 -0
  15. package/fesm2015/ngx-st-tables.mjs +476 -0
  16. package/fesm2015/ngx-st-tables.mjs.map +1 -0
  17. package/fesm2020/ngx-st-tables.mjs +474 -0
  18. package/fesm2020/ngx-st-tables.mjs.map +1 -0
  19. package/lib/components/local-table/configurations/configurations.component.d.ts +27 -0
  20. package/lib/components/local-table/local-table.component.d.ts +56 -0
  21. package/lib/components/select-table/select-table.d.ts +37 -0
  22. package/lib/models/local-table/st-configurations-settings.model.d.ts +6 -0
  23. package/lib/models/local-table/st-global-search-settings.model.d.ts +4 -0
  24. package/lib/models/local-table/st-local-storage-configuration.model.d.ts +8 -0
  25. package/lib/models/local-table/st-local-table-column.model.d.ts +22 -0
  26. package/lib/models/local-table/st-local-table-columns.model.d.ts +4 -0
  27. package/lib/models/local-table/st-table-settings.model.d.ts +3 -0
  28. package/lib/services/local-table.service.d.ts +10 -0
  29. package/lib/st-tables.module.d.ts +24 -0
  30. package/ngx-st-tables.d.ts +5 -0
  31. package/package.json +33 -0
  32. package/public-api.d.ts +11 -0
@@ -0,0 +1,474 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, EventEmitter, Component, ChangeDetectionStrategy, Input, Output, ViewChild, NgModule } from '@angular/core';
3
+ import * as i8 from '@angular/material/table';
4
+ import { MatTableDataSource, MatTableModule } from '@angular/material/table';
5
+ import * as i10 from '@angular/material/paginator';
6
+ import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
7
+ import * as i9 from '@angular/material/sort';
8
+ import { MatSort, MatSortModule } from '@angular/material/sort';
9
+ import * as i4 from '@angular/material/button';
10
+ import { MatButtonModule } from '@angular/material/button';
11
+ import * as i3$1 from '@angular/material/menu';
12
+ import { MatMenuModule } from '@angular/material/menu';
13
+ import * as i4$1 from '@angular/material/checkbox';
14
+ import { MatCheckboxModule } from '@angular/material/checkbox';
15
+ import * as i6 from '@angular/material/form-field';
16
+ import { MatFormFieldModule } from '@angular/material/form-field';
17
+ import * as i2 from '@angular/material/select';
18
+ import { MatSelectModule } from '@angular/material/select';
19
+ import * as i3 from '@angular/material/core';
20
+ import * as i11 from '@angular/common';
21
+ import { CommonModule } from '@angular/common';
22
+ import * as i6$1 from '@angular/forms';
23
+ import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
24
+ import * as i7 from '@angular/material/input';
25
+ import { MatInputModule } from '@angular/material/input';
26
+ import * as i7$1 from '@angular/material/icon';
27
+ import { MatIconModule } from '@angular/material/icon';
28
+ import * as i14 from '@angular/material/tooltip';
29
+ import { MatTooltipModule } from '@angular/material/tooltip';
30
+ import * as i15 from '@angular/router';
31
+ import { RouterModule } from '@angular/router';
32
+ import * as i16 from 'ngx-st-date-format';
33
+ import { StDateFormatModule } from 'ngx-st-date-format';
34
+
35
+ class LocalTableService {
36
+ constructor() {
37
+ this.localStorageName = '';
38
+ }
39
+ getConfigs() {
40
+ if (this.checkLocalStorageName()) {
41
+ return JSON.parse(localStorage.getItem(this.localStorageName) || '[]');
42
+ }
43
+ return [];
44
+ }
45
+ saveConfigs(configs) {
46
+ if (this.checkLocalStorageName()) {
47
+ localStorage.setItem(this.localStorageName, JSON.stringify(configs));
48
+ }
49
+ }
50
+ checkLocalStorageName() {
51
+ if (this.localStorageName) {
52
+ return true;
53
+ }
54
+ else {
55
+ console.warn('YOu have to add configurationsSettings');
56
+ return false;
57
+ }
58
+ }
59
+ }
60
+ LocalTableService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: LocalTableService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
61
+ LocalTableService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: LocalTableService });
62
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: LocalTableService, decorators: [{
63
+ type: Injectable
64
+ }] });
65
+
66
+ class ConfigurationsComponent {
67
+ constructor() {
68
+ this.createNewConfig = new EventEmitter();
69
+ this.removeConfig = new EventEmitter();
70
+ this.changeConfig = new EventEmitter();
71
+ this.creatingConfiguration = false;
72
+ this.createConfigurationName = '';
73
+ this.removingConfiguration = false;
74
+ }
75
+ set initSelectedConfig(config) {
76
+ this.selectedConfig = config;
77
+ }
78
+ ngOnInit() {
79
+ }
80
+ showCreateConfiguration() {
81
+ this.creatingConfiguration = true;
82
+ this.createConfigurationName = '';
83
+ }
84
+ hideCreateConfiguration() {
85
+ this.creatingConfiguration = false;
86
+ this.createConfigurationName = '';
87
+ }
88
+ saveCreateConfiguration() {
89
+ this.creatingConfiguration = false;
90
+ this.selectedConfig = null;
91
+ this.createNewConfig.emit(this.createConfigurationName);
92
+ }
93
+ deleteConfiguration() {
94
+ this.removingConfiguration = true;
95
+ }
96
+ acceptDeleteConfiguration() {
97
+ this.removingConfiguration = false;
98
+ this.selectedConfig = null;
99
+ this.removeConfig.emit(this.selectedConfig.configId);
100
+ }
101
+ declineDeleteConfiguration() {
102
+ this.removingConfiguration = false;
103
+ }
104
+ selectedConfigChanged() {
105
+ this.changeConfig.emit(this.selectedConfig?.configId || null);
106
+ }
107
+ }
108
+ ConfigurationsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: ConfigurationsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
109
+ ConfigurationsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: ConfigurationsComponent, selector: "app-configurations[configurationsSettings]", inputs: { configurationsSettings: "configurationsSettings", configurations: "configurations", initSelectedConfig: "initSelectedConfig" }, outputs: { createNewConfig: "createNewConfig", removeConfig: "removeConfig", changeConfig: "changeConfig" }, ngImport: i0, template: "<div class=\"col-auto row align-items-center\" style=\"padding: 0;\">\n <ng-container *ngIf=\"!creatingConfiguration && !removingConfiguration\">\n <mat-form-field class=\"col-auto\" style=\"padding-right: 0;\">\n <mat-label>{{configurationsSettings.selectLabel}}</mat-label>\n <mat-select [(ngModel)]=\"selectedConfig\" (ngModelChange)=\"selectedConfigChanged()\">\n <mat-option [value]=\"null\"></mat-option>\n <mat-option *ngFor=\"let config of configurations\" [value]=\"config\">{{config.configName}}</mat-option>\n </mat-select>\n </mat-form-field>\n <button mat-icon-button class=\"col-auto green-icon\" (click)=\"showCreateConfiguration()\">\n <span class=\"material-icons-outlined\">\n add\n </span>\n </button>\n <button mat-icon-button class=\"col-auto red-icon\" [disabled]=\"!selectedConfig\" (click)=\"deleteConfiguration()\">\n <span class=\"material-icons-outlined\">\n delete\n </span>\n </button>\n </ng-container>\n\n <ng-container *ngIf=\"creatingConfiguration\">\n <mat-form-field class=\"col-auto\">\n <mat-label>{{configurationsSettings.createLabel}}</mat-label>\n <input matInput [(ngModel)]=\"createConfigurationName\">\n </mat-form-field>\n <button mat-icon-button class=\"col-auto green-icon\" (click)=\"saveCreateConfiguration()\" [disabled]=\"!createConfigurationName\">\n <span class=\"material-icons-outlined\">\n done\n </span>\n </button>\n <button mat-icon-button class=\"col-auto red-icon\" (click)=\"hideCreateConfiguration()\">\n <span class=\"material-icons-outlined\">\n close\n </span>\n </button>\n </ng-container>\n\n <ng-container *ngIf=\"removingConfiguration\">\n <p class=\"col-auto\" style=\"margin: 0; font-weight: bold;font-size: 16px;\">{{configurationsSettings.deleteWarningTitle}}</p>\n <button mat-icon-button class=\"col-auto green-icon\" (click)=\"acceptDeleteConfiguration()\">\n <span class=\"material-icons-outlined\">\n done\n </span>\n </button>\n <button mat-icon-button class=\"col-auto red-icon\" (click)=\"declineDeleteConfiguration()\">\n <span class=\"material-icons-outlined\">\n close\n </span>\n </button>\n </ng-container>\n</div>\n", styles: [".green-icon span{color:#2e7d32}.red-icon span{color:#c62828}\n"], components: [{ type: i6.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i3.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i4.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"] }], directives: [{ type: i11.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.MatLabel, selector: "mat-label" }, { type: i6$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i6$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i11.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7.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"] }, { type: i6$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]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
110
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: ConfigurationsComponent, decorators: [{
111
+ type: Component,
112
+ args: [{ selector: 'app-configurations[configurationsSettings]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"col-auto row align-items-center\" style=\"padding: 0;\">\n <ng-container *ngIf=\"!creatingConfiguration && !removingConfiguration\">\n <mat-form-field class=\"col-auto\" style=\"padding-right: 0;\">\n <mat-label>{{configurationsSettings.selectLabel}}</mat-label>\n <mat-select [(ngModel)]=\"selectedConfig\" (ngModelChange)=\"selectedConfigChanged()\">\n <mat-option [value]=\"null\"></mat-option>\n <mat-option *ngFor=\"let config of configurations\" [value]=\"config\">{{config.configName}}</mat-option>\n </mat-select>\n </mat-form-field>\n <button mat-icon-button class=\"col-auto green-icon\" (click)=\"showCreateConfiguration()\">\n <span class=\"material-icons-outlined\">\n add\n </span>\n </button>\n <button mat-icon-button class=\"col-auto red-icon\" [disabled]=\"!selectedConfig\" (click)=\"deleteConfiguration()\">\n <span class=\"material-icons-outlined\">\n delete\n </span>\n </button>\n </ng-container>\n\n <ng-container *ngIf=\"creatingConfiguration\">\n <mat-form-field class=\"col-auto\">\n <mat-label>{{configurationsSettings.createLabel}}</mat-label>\n <input matInput [(ngModel)]=\"createConfigurationName\">\n </mat-form-field>\n <button mat-icon-button class=\"col-auto green-icon\" (click)=\"saveCreateConfiguration()\" [disabled]=\"!createConfigurationName\">\n <span class=\"material-icons-outlined\">\n done\n </span>\n </button>\n <button mat-icon-button class=\"col-auto red-icon\" (click)=\"hideCreateConfiguration()\">\n <span class=\"material-icons-outlined\">\n close\n </span>\n </button>\n </ng-container>\n\n <ng-container *ngIf=\"removingConfiguration\">\n <p class=\"col-auto\" style=\"margin: 0; font-weight: bold;font-size: 16px;\">{{configurationsSettings.deleteWarningTitle}}</p>\n <button mat-icon-button class=\"col-auto green-icon\" (click)=\"acceptDeleteConfiguration()\">\n <span class=\"material-icons-outlined\">\n done\n </span>\n </button>\n <button mat-icon-button class=\"col-auto red-icon\" (click)=\"declineDeleteConfiguration()\">\n <span class=\"material-icons-outlined\">\n close\n </span>\n </button>\n </ng-container>\n</div>\n", styles: [".green-icon span{color:#2e7d32}.red-icon span{color:#c62828}\n"] }]
113
+ }], ctorParameters: function () { return []; }, propDecorators: { configurationsSettings: [{
114
+ type: Input
115
+ }], configurations: [{
116
+ type: Input
117
+ }], initSelectedConfig: [{
118
+ type: Input
119
+ }], createNewConfig: [{
120
+ type: Output
121
+ }], removeConfig: [{
122
+ type: Output
123
+ }], changeConfig: [{
124
+ type: Output
125
+ }] } });
126
+
127
+ class LocalTableComponent {
128
+ constructor(localTableService, changeDetector) {
129
+ this.localTableService = localTableService;
130
+ this.changeDetector = changeDetector;
131
+ this.pageSize = 10;
132
+ this.allowPickColumns = false;
133
+ this.localStorageName = '';
134
+ this.searchModel = '';
135
+ this.displayedColumns = [];
136
+ this.configurations = [];
137
+ this.initConfig = null;
138
+ this.activeConfig = null;
139
+ this._data = [];
140
+ this._columns = {};
141
+ }
142
+ set columns(columns) {
143
+ this._columns = columns;
144
+ this.columnsArray = this.getColumnsArray();
145
+ this.setDisplayedColumns();
146
+ }
147
+ get columns() {
148
+ return this._columns;
149
+ }
150
+ set data(data) {
151
+ this._data = data || [];
152
+ this.setTableSource();
153
+ }
154
+ get data() {
155
+ return this._data;
156
+ }
157
+ ngOnInit() {
158
+ if (this.localStorageName) {
159
+ const pageSize = localStorage.getItem(this.localStorageName);
160
+ if (pageSize) {
161
+ this.pageSize = parseInt(pageSize);
162
+ }
163
+ }
164
+ if (this.configurationsSettings) {
165
+ this.localTableService.localStorageName = this.configurationsSettings?.localStorageName || '';
166
+ this.loadConfigs();
167
+ }
168
+ }
169
+ ngAfterViewInit() {
170
+ if (this.configurationsSettings) {
171
+ this.paginator.page.subscribe(res => {
172
+ if (this.activeConfig) {
173
+ this.activeConfig.pageSize = res.pageSize;
174
+ this.updateConfigsToLocalStorage();
175
+ }
176
+ });
177
+ this.sort.sortChange.subscribe((res) => {
178
+ if (this.activeConfig) {
179
+ this.activeConfig.sortFieldName = res.active;
180
+ this.activeConfig.sortDirection = res.direction;
181
+ this.updateConfigsToLocalStorage();
182
+ }
183
+ });
184
+ }
185
+ this.paginator.pageSize = this.pageSize;
186
+ }
187
+ applySearch(event) {
188
+ const searchValue = event.target.value;
189
+ this.tableSource.filter = searchValue.trim().toLowerCase();
190
+ }
191
+ clearSearch() {
192
+ this.searchModel = '';
193
+ this.tableSource.filter = this.searchModel;
194
+ }
195
+ checkIfActionVisible(row, action) {
196
+ if (action.show) {
197
+ return action.show(row);
198
+ }
199
+ else {
200
+ return true;
201
+ }
202
+ }
203
+ columnVisibleChanged(column) {
204
+ this.setDisplayedColumns();
205
+ this.updateConfigsToLocalStorage();
206
+ }
207
+ newConfigCreated(name) {
208
+ const newConfig = this.generateNewConfig(name);
209
+ this.configurations.push(newConfig);
210
+ this.updateConfigsToLocalStorage();
211
+ this.initConfig = newConfig;
212
+ }
213
+ configRemoved(configId) {
214
+ this.configurations = this.configurations.filter(config => config.configId !== configId);
215
+ this.updateConfigsToLocalStorage();
216
+ }
217
+ configChanged(configId) {
218
+ this.activeConfig = (configId) ? this.configurations.find(config => config.configId === configId) : null;
219
+ if (this.activeConfig) {
220
+ this.setTableConfig(this.activeConfig.pageSize, this.activeConfig.columnsDisabled, this.activeConfig.sortFieldName, this.activeConfig.sortDirection);
221
+ }
222
+ else {
223
+ this.setTableConfig(this.pageSize, [], null, null);
224
+ this.clearSearch();
225
+ }
226
+ }
227
+ updateConfigsToLocalStorage() {
228
+ this.localTableService.saveConfigs(this.configurations);
229
+ }
230
+ setTableSource() {
231
+ this.tableSource = new MatTableDataSource(this._data);
232
+ this.tableSource.paginator = this.paginator;
233
+ this.tableSource.sort = this.sort;
234
+ this.clearSearch();
235
+ this.changeDetector.markForCheck();
236
+ }
237
+ setDisplayedColumns() {
238
+ this.displayedColumns = Object.keys(this.columns).filter((column) => {
239
+ return this._columns[column].visible;
240
+ });
241
+ }
242
+ getColumnsArray() {
243
+ return Object.keys(this._columns)
244
+ .map((column) => this._columns[column]);
245
+ }
246
+ loadConfigs() {
247
+ this.configurations = this.localTableService.getConfigs();
248
+ }
249
+ generateNewConfig(configName) {
250
+ return {
251
+ configId: Date.now().toString(),
252
+ configName: configName,
253
+ columnsDisabled: this.columnsArray.filter(column => !column.visible).map(column => column.translateColumnName),
254
+ pageSize: this.paginator.pageSize,
255
+ sortFieldName: (this.sort.direction && this.sort.active) ? this.sort.active : null,
256
+ sortDirection: this.sort.direction || null
257
+ };
258
+ }
259
+ setTableConfig(pageSize, disabledColumns, sortFieldName, sortDirection) {
260
+ this.paginator.pageSize = pageSize;
261
+ this.sort.sort({ id: sortFieldName || '', start: sortDirection || 'asc', disableClear: false });
262
+ this.columnsArray.forEach(column => {
263
+ column.visible = disabledColumns.indexOf(column.translateColumnName) === -1;
264
+ });
265
+ this.setDisplayedColumns();
266
+ }
267
+ }
268
+ LocalTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: LocalTableComponent, deps: [{ token: LocalTableService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
269
+ LocalTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: LocalTableComponent, selector: "ngx-st-local-table", inputs: { tableSettings: "tableSettings", globalSearchSettings: "globalSearchSettings", pageSize: "pageSize", allowPickColumns: "allowPickColumns", configurationsSettings: "configurationsSettings", localStorageName: "localStorageName", columns: "columns", data: "data" }, viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true }], ngImport: i0, template: "<div class=\"local-table\">\r\n <div class=\"row align-items-center\">\r\n <div class=\"col row align-items-center\" style=\"padding: 0;\" *ngIf=\"configurationsSettings || allowPickColumns\">\r\n <div class=\"col-auto\" style=\"padding: 0;\" *ngIf=\"allowPickColumns\">\r\n <button mat-icon-button class=\"col-auto\" [matMenuTriggerFor]=\"columnsMenu\">\r\n <span class=\"material-icons-outlined\">\r\n view_week\r\n </span>\r\n </button>\r\n <mat-menu #columnsMenu=\"matMenu\" xPosition=\"after\">\r\n <ng-container *ngFor=\"let column of columnsArray\">\r\n <div mat-menu-item *ngIf=\"!column.notShowInColumnPick\">\r\n <mat-checkbox\r\n [(ngModel)]=\"column.visible\"\r\n (ngModelChange)=\"columnVisibleChanged(column)\"\r\n style=\"margin-top: 5px;\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n {{column.translateColumnName}}\r\n </mat-checkbox>\r\n </div>\r\n </ng-container>\r\n </mat-menu>\r\n </div>\r\n\r\n <app-configurations\r\n *ngIf=\"configurationsSettings\"\r\n [configurationsSettings]=\"configurationsSettings\"\r\n [configurations]=\"configurations\"\r\n [initSelectedConfig]=\"initConfig\"\r\n (createNewConfig)=\"newConfigCreated($event)\"\r\n (removeConfig)=\"configRemoved($event)\"\r\n (changeConfig)=\"configChanged($event)\"\r\n ></app-configurations>\r\n </div>\r\n\r\n <div class=\"col\" style=\"padding: 0;\" *ngIf=\"globalSearchSettings?.show\">\r\n <mat-form-field class=\"col\">\r\n <mat-label>{{globalSearchSettings?.label || 'Search'}}</mat-label>\r\n <input matInput (keyup)=\"applySearch($event)\" [(ngModel)]=\"searchModel\">\r\n <button matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"clearSearch()\">\r\n <mat-icon style=\"font-size: 22px\">close</mat-icon>\r\n </button>\r\n </mat-form-field>\r\n </div>\r\n\r\n </div>\r\n\r\n <table [ngClass]=\"{'no-hover': !tableSettings?.rowClickAction}\" mat-table [dataSource]=\"tableSource\" matSort>\r\n\r\n <ng-container [matColumnDef]=\"column\" *ngFor=\"let column of displayedColumns\">\r\n <th\r\n mat-header-cell\r\n *matHeaderCellDef\r\n style=\"{{columns[column].width ? ('width:' + columns[column].width) : ''}}\"\r\n mat-sort-header\r\n [disabled]=\"!columns[column].sort\"\r\n >\r\n {{columns[column].translateColumnName }}\r\n <span class=\"material-icons search-icon\" [matMenuTriggerFor]=\"menu\" (click)=\"$event.stopPropagation()\"\r\n *ngIf=\"columns[column].search\">\r\n search\r\n </span>\r\n <mat-menu #menu=\"matMenu\" xPosition=\"before\">\r\n <mat-form-field class=\"col\">\r\n <mat-label>{{columns[column].searchLabel || 'Search'}}</mat-label>\r\n <input matInput (keyup)=\"applySearch($event)\" [(ngModel)]=\"searchModel\"\r\n (click)=\"$event.stopPropagation()\">\r\n <button matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"searchModel=''\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </mat-form-field>\r\n </mat-menu>\r\n </th>\r\n <td mat-cell *matCellDef=\"let element\"\r\n style=\"{{columns[column].width ? ('width:' + columns[column].width) : ''}}\">\r\n <div class=\"actions-container\" [ngClass]=\"{'justify-content-end': columns[column].flexRight}\"\r\n *ngIf=\"columns[column].actions && columns[column].actions!.length > 0\">\r\n <ng-container *ngFor=\"let action of columns[column].actions\">\r\n <ng-container *ngIf=\"checkIfActionVisible(element, action)\">\r\n <button class=\"col-auto\" mat-icon-button\r\n type=\"button\"\r\n *ngIf=\"!action.url && action.action\"\r\n matTooltip=\"{{(action.tooltipName || '') }}\"\r\n [matTooltipDisabled]=\"!!!(action.tooltipName)\"\r\n (click)=\"action.action(element)\"\r\n >\r\n <span class=\"material-icons\">{{action.iconName}}</span>\r\n </button>\r\n\r\n <a *ngIf=\"action.url\" [routerLink]=\"action.url\">\r\n <button class=\"col-auto\" mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"{{(action.tooltipName || '') }}\"\r\n [matTooltipDisabled]=\"!!!(action.tooltipName)\"\r\n >\r\n <span class=\"material-icons\">{{action.iconName}}</span>\r\n </button>\r\n </a>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n\r\n <ng-container *ngIf=\"!columns[column].actions\">\r\n <ng-container *ngIf=\"columns[column].translateValue\">\r\n <p style=\"margin:0;padding:0\">{{columns[column].translateValue![element[column]] || '' }}</p>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"!columns[column].translateValue\">\r\n <ng-container *ngIf=\"!columns[column].type || columns[column].type === 'string'\">\r\n <p style=\"margin:0;padding:0\">{{element[column]}}</p>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"columns[column].type === 'date'\">\r\n <p style=\"margin:0;padding:0\">{{element[column] | stDateTimeFormatPipe}}</p>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\" (click)=\"tableSettings?.rowClickAction ? tableSettings.rowClickAction(row) : null\"></tr>\r\n </table>\r\n <mat-paginator [pageSizeOptions]=\"[5, 10, 15, 20, 25]\" showFirstLastButtons></mat-paginator>\r\n</div>\r\n", styles: [".search-form button{height:40px}.search-form mat-form-field:first-child{padding-left:0}.search-form mat-form-field:last-child{padding-right:0}.search-form .clear{padding:0}.search-form .clear i{height:20px;width:20px;font-size:20px;cursor:pointer}table{width:100%}table::ng-deep thead tr{background-color:#fff9c4}table::ng-deep thead tr th{border-color:#fdd835}table::ng-deep thead tr th:hover .order-icon{display:none}table::ng-deep thead tr th .order-icon{opacity:.4;font-size:20px}table::ng-deep thead tr th .search-icon{position:absolute;top:3px;right:0;opacity:.5;font-size:20px;margin:0 5px;font-weight:600}table::ng-deep thead tr th .search-icon:hover{opacity:.8}table::ng-deep thead tr th .mat-sort-header-content{text-align:left}table::ng-deep tbody tr{cursor:pointer}table::ng-deep tbody tr.active{background-color:#a5d6a7}table::ng-deep tbody tr:hover{background-color:#a5d6a7}table::ng-deep tbody tr.disabled{cursor:not-allowed}table::ng-deep tbody tr.disabled:hover{background-color:inherit}table::ng-deep tbody tr td i.active-row{color:#1b5e20;font-weight:700;font-size:25px;height:25px;width:25px;margin-top:2px}table::ng-deep tbody tr td>div{max-height:200px;overflow:hidden;overflow-y:auto}table::ng-deep tbody tr td .actions-container{display:flex}table::ng-deep tbody tr td a button{color:#000}table::ng-deep tbody tr td a i{color:#333}table::ng-deep .mat-column-active{width:48px}table.no-hover::ng-deep tbody tr{cursor:default}table.no-hover::ng-deep tbody tr.active{background-color:transparent}table.no-hover::ng-deep tbody tr:hover{background-color:transparent}table.admin-table::ng-deep .actions-cell{width:100px}\n"], components: [{ type: i4.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"] }, { type: i3$1.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { type: i3$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { type: i4$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: ConfigurationsComponent, selector: "app-configurations[configurationsSettings]", inputs: ["configurationsSettings", "configurations", "initSelectedConfig"], outputs: ["createNewConfig", "removeConfig", "changeConfig"] }, { type: i6.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i7$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i8.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: i9.MatSortHeader, selector: "[mat-sort-header]", inputs: ["disabled", "mat-sort-header", "arrowPosition", "start", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { type: i8.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i8.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { type: i10.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }], directives: [{ type: i11.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { type: i11.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i6$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i6.MatLabel, selector: "mat-label" }, { type: i7.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"] }, { type: i6$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]" }, { type: i6.MatSuffix, selector: "[matSuffix]" }, { type: i9.MatSort, selector: "[matSort]", inputs: ["matSortDisabled", "matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { type: i11.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i8.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i8.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i8.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i8.MatCellDef, selector: "[matCellDef]" }, { type: i8.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i14.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i15.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i8.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i8.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }], pipes: { "stDateTimeFormatPipe": i16.DateTimeFormatPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
270
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: LocalTableComponent, decorators: [{
271
+ type: Component,
272
+ args: [{ selector: 'ngx-st-local-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"local-table\">\r\n <div class=\"row align-items-center\">\r\n <div class=\"col row align-items-center\" style=\"padding: 0;\" *ngIf=\"configurationsSettings || allowPickColumns\">\r\n <div class=\"col-auto\" style=\"padding: 0;\" *ngIf=\"allowPickColumns\">\r\n <button mat-icon-button class=\"col-auto\" [matMenuTriggerFor]=\"columnsMenu\">\r\n <span class=\"material-icons-outlined\">\r\n view_week\r\n </span>\r\n </button>\r\n <mat-menu #columnsMenu=\"matMenu\" xPosition=\"after\">\r\n <ng-container *ngFor=\"let column of columnsArray\">\r\n <div mat-menu-item *ngIf=\"!column.notShowInColumnPick\">\r\n <mat-checkbox\r\n [(ngModel)]=\"column.visible\"\r\n (ngModelChange)=\"columnVisibleChanged(column)\"\r\n style=\"margin-top: 5px;\"\r\n (click)=\"$event.stopPropagation()\"\r\n >\r\n {{column.translateColumnName}}\r\n </mat-checkbox>\r\n </div>\r\n </ng-container>\r\n </mat-menu>\r\n </div>\r\n\r\n <app-configurations\r\n *ngIf=\"configurationsSettings\"\r\n [configurationsSettings]=\"configurationsSettings\"\r\n [configurations]=\"configurations\"\r\n [initSelectedConfig]=\"initConfig\"\r\n (createNewConfig)=\"newConfigCreated($event)\"\r\n (removeConfig)=\"configRemoved($event)\"\r\n (changeConfig)=\"configChanged($event)\"\r\n ></app-configurations>\r\n </div>\r\n\r\n <div class=\"col\" style=\"padding: 0;\" *ngIf=\"globalSearchSettings?.show\">\r\n <mat-form-field class=\"col\">\r\n <mat-label>{{globalSearchSettings?.label || 'Search'}}</mat-label>\r\n <input matInput (keyup)=\"applySearch($event)\" [(ngModel)]=\"searchModel\">\r\n <button matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"clearSearch()\">\r\n <mat-icon style=\"font-size: 22px\">close</mat-icon>\r\n </button>\r\n </mat-form-field>\r\n </div>\r\n\r\n </div>\r\n\r\n <table [ngClass]=\"{'no-hover': !tableSettings?.rowClickAction}\" mat-table [dataSource]=\"tableSource\" matSort>\r\n\r\n <ng-container [matColumnDef]=\"column\" *ngFor=\"let column of displayedColumns\">\r\n <th\r\n mat-header-cell\r\n *matHeaderCellDef\r\n style=\"{{columns[column].width ? ('width:' + columns[column].width) : ''}}\"\r\n mat-sort-header\r\n [disabled]=\"!columns[column].sort\"\r\n >\r\n {{columns[column].translateColumnName }}\r\n <span class=\"material-icons search-icon\" [matMenuTriggerFor]=\"menu\" (click)=\"$event.stopPropagation()\"\r\n *ngIf=\"columns[column].search\">\r\n search\r\n </span>\r\n <mat-menu #menu=\"matMenu\" xPosition=\"before\">\r\n <mat-form-field class=\"col\">\r\n <mat-label>{{columns[column].searchLabel || 'Search'}}</mat-label>\r\n <input matInput (keyup)=\"applySearch($event)\" [(ngModel)]=\"searchModel\"\r\n (click)=\"$event.stopPropagation()\">\r\n <button matSuffix mat-icon-button aria-label=\"Clear\" (click)=\"searchModel=''\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </mat-form-field>\r\n </mat-menu>\r\n </th>\r\n <td mat-cell *matCellDef=\"let element\"\r\n style=\"{{columns[column].width ? ('width:' + columns[column].width) : ''}}\">\r\n <div class=\"actions-container\" [ngClass]=\"{'justify-content-end': columns[column].flexRight}\"\r\n *ngIf=\"columns[column].actions && columns[column].actions!.length > 0\">\r\n <ng-container *ngFor=\"let action of columns[column].actions\">\r\n <ng-container *ngIf=\"checkIfActionVisible(element, action)\">\r\n <button class=\"col-auto\" mat-icon-button\r\n type=\"button\"\r\n *ngIf=\"!action.url && action.action\"\r\n matTooltip=\"{{(action.tooltipName || '') }}\"\r\n [matTooltipDisabled]=\"!!!(action.tooltipName)\"\r\n (click)=\"action.action(element)\"\r\n >\r\n <span class=\"material-icons\">{{action.iconName}}</span>\r\n </button>\r\n\r\n <a *ngIf=\"action.url\" [routerLink]=\"action.url\">\r\n <button class=\"col-auto\" mat-icon-button\r\n type=\"button\"\r\n matTooltip=\"{{(action.tooltipName || '') }}\"\r\n [matTooltipDisabled]=\"!!!(action.tooltipName)\"\r\n >\r\n <span class=\"material-icons\">{{action.iconName}}</span>\r\n </button>\r\n </a>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n\r\n <ng-container *ngIf=\"!columns[column].actions\">\r\n <ng-container *ngIf=\"columns[column].translateValue\">\r\n <p style=\"margin:0;padding:0\">{{columns[column].translateValue![element[column]] || '' }}</p>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"!columns[column].translateValue\">\r\n <ng-container *ngIf=\"!columns[column].type || columns[column].type === 'string'\">\r\n <p style=\"margin:0;padding:0\">{{element[column]}}</p>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"columns[column].type === 'date'\">\r\n <p style=\"margin:0;padding:0\">{{element[column] | stDateTimeFormatPipe}}</p>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\" (click)=\"tableSettings?.rowClickAction ? tableSettings.rowClickAction(row) : null\"></tr>\r\n </table>\r\n <mat-paginator [pageSizeOptions]=\"[5, 10, 15, 20, 25]\" showFirstLastButtons></mat-paginator>\r\n</div>\r\n", styles: [".search-form button{height:40px}.search-form mat-form-field:first-child{padding-left:0}.search-form mat-form-field:last-child{padding-right:0}.search-form .clear{padding:0}.search-form .clear i{height:20px;width:20px;font-size:20px;cursor:pointer}table{width:100%}table::ng-deep thead tr{background-color:#fff9c4}table::ng-deep thead tr th{border-color:#fdd835}table::ng-deep thead tr th:hover .order-icon{display:none}table::ng-deep thead tr th .order-icon{opacity:.4;font-size:20px}table::ng-deep thead tr th .search-icon{position:absolute;top:3px;right:0;opacity:.5;font-size:20px;margin:0 5px;font-weight:600}table::ng-deep thead tr th .search-icon:hover{opacity:.8}table::ng-deep thead tr th .mat-sort-header-content{text-align:left}table::ng-deep tbody tr{cursor:pointer}table::ng-deep tbody tr.active{background-color:#a5d6a7}table::ng-deep tbody tr:hover{background-color:#a5d6a7}table::ng-deep tbody tr.disabled{cursor:not-allowed}table::ng-deep tbody tr.disabled:hover{background-color:inherit}table::ng-deep tbody tr td i.active-row{color:#1b5e20;font-weight:700;font-size:25px;height:25px;width:25px;margin-top:2px}table::ng-deep tbody tr td>div{max-height:200px;overflow:hidden;overflow-y:auto}table::ng-deep tbody tr td .actions-container{display:flex}table::ng-deep tbody tr td a button{color:#000}table::ng-deep tbody tr td a i{color:#333}table::ng-deep .mat-column-active{width:48px}table.no-hover::ng-deep tbody tr{cursor:default}table.no-hover::ng-deep tbody tr.active{background-color:transparent}table.no-hover::ng-deep tbody tr:hover{background-color:transparent}table.admin-table::ng-deep .actions-cell{width:100px}\n"] }]
273
+ }], ctorParameters: function () { return [{ type: LocalTableService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { paginator: [{
274
+ type: ViewChild,
275
+ args: [MatPaginator]
276
+ }], sort: [{
277
+ type: ViewChild,
278
+ args: [MatSort]
279
+ }], tableSettings: [{
280
+ type: Input
281
+ }], globalSearchSettings: [{
282
+ type: Input
283
+ }], pageSize: [{
284
+ type: Input
285
+ }], allowPickColumns: [{
286
+ type: Input
287
+ }], configurationsSettings: [{
288
+ type: Input
289
+ }], localStorageName: [{
290
+ type: Input
291
+ }], columns: [{
292
+ type: Input
293
+ }], data: [{
294
+ type: Input
295
+ }] } });
296
+
297
+ class SelectTable {
298
+ constructor() {
299
+ this.search = new FormControl('');
300
+ this.rowSelected = [];
301
+ this._validError = false;
302
+ this.required = false;
303
+ this.multiple = false;
304
+ this.searchLabel = 'Search';
305
+ this.selectedLabel = 'Selected';
306
+ this.returnRowSelected = new EventEmitter();
307
+ }
308
+ set setInitColumns(col) {
309
+ this.columns = ['active', ...Object.keys(col)];
310
+ this.initColumns = col;
311
+ }
312
+ set tableData(data) {
313
+ this.tableSource = new MatTableDataSource(data);
314
+ this.tableSource.paginator = this.paginator;
315
+ }
316
+ set validError(error) {
317
+ this._validError = error;
318
+ }
319
+ get validError() {
320
+ return this._validError;
321
+ }
322
+ ngOnInit() {
323
+ this.search.valueChanges.subscribe(res => {
324
+ this.tableSource.filter = res.trim().toLowerCase();
325
+ });
326
+ setTimeout(() => {
327
+ if (this.initSearchVal) {
328
+ this.search.setValue(this.initSearchVal);
329
+ this.rowClick(this.initSelected);
330
+ }
331
+ }, 1000);
332
+ }
333
+ clearSearch() {
334
+ this.search.setValue('');
335
+ }
336
+ rowClick(row) {
337
+ const found = this.rowSelected.find((tmpRow) => tmpRow === row);
338
+ if (found) {
339
+ this.rowSelected = this.rowSelected.filter((tmpRow) => tmpRow !== row);
340
+ }
341
+ else {
342
+ if (this.multiple) {
343
+ this.rowSelected.push(row);
344
+ }
345
+ else {
346
+ this.rowSelected = [row];
347
+ }
348
+ }
349
+ this.returnRowSelected.emit(this.rowSelected);
350
+ }
351
+ checkActiveRow(row) {
352
+ return !!(this.rowSelected.find(activeRow => activeRow === row));
353
+ }
354
+ }
355
+ SelectTable.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SelectTable, deps: [], target: i0.ɵɵFactoryTarget.Component });
356
+ SelectTable.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SelectTable, selector: "ngx-st-select-table", inputs: { title: "title", required: "required", multiple: "multiple", initSelected: "initSelected", initSearchVal: "initSearchVal", searchLabel: "searchLabel", selectedLabel: "selectedLabel", setInitColumns: "setInitColumns", tableData: "tableData", validError: "validError" }, outputs: { returnRowSelected: "returnRowSelected" }, viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }], ngImport: i0, template: "<div class=\"shared-table-selector\">\r\n <p class=\"title\" [ngClass]=\"{'error-text': validError}\">{{title}} {{required ? '*' : ''}}</p>\r\n\r\n <div class=\"search-form row align-items-center\">\r\n <div class=\"col-sm-12 col-md row align-items-center\">\r\n <mat-form-field class=\"col\">\r\n <input matInput placeholder=\"{{searchLabel}}\" [formControl]=\"search\">\r\n </mat-form-field>\r\n <div class=\"clear col-auto\">\r\n <i class=\"material-icons\" (click)=\"clearSearch()\">clear</i>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <table mat-table [dataSource]=\"tableSource\">\r\n <ng-container *ngFor=\"let col of columns\" [matColumnDef]=\"col\" >\r\n <th mat-header-cell *matHeaderCellDef> {{(col === 'active') ? selectedLabel : initColumns[col]}} </th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <ng-container *ngIf=\"col === 'active'\">\r\n <i *ngIf=\"checkActiveRow(element)\" class=\"material-icons active-row\">done</i>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"col !== 'active'\">\r\n {{element[col]}}\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"columns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: columns;\" (click)=\"rowClick(row)\" [ngClass]=\"{'active': checkActiveRow(row)}\"></tr>\r\n </table>\r\n <mat-paginator [pageSizeOptions]=\"[5]\"></mat-paginator>\r\n</div>\r\n", styles: [".title{margin-bottom:0;margin-top:1rem;font-weight:500}.title.error-text{color:#ef5350}\n", ".search-form button{height:40px}.search-form mat-form-field:first-child{padding-left:0}.search-form mat-form-field:last-child{padding-right:0}.search-form .clear{padding:0}.search-form .clear i{height:20px;width:20px;font-size:20px;cursor:pointer}table{width:100%}table::ng-deep thead tr{background-color:#fff9c4}table::ng-deep thead tr th{border-color:#fdd835}table::ng-deep tbody>tr{cursor:pointer}table::ng-deep tbody>tr.active{background-color:#a5d6a7}table::ng-deep tbody>tr:hover{background-color:#a5d6a7}table::ng-deep tbody>tr.disabled{cursor:not-allowed}table::ng-deep tbody>tr.disabled:hover{background-color:inherit}table::ng-deep tbody>tr.detail-row{height:0;cursor:default}table::ng-deep tbody>tr.detail-row:hover{background-color:transparent}table::ng-deep tbody>tr.detail-row .element-detail{overflow:hidden;display:flex}table::ng-deep tbody>tr.detail-row .element-detail p{padding:20px 0;margin-bottom:0;white-space:pre-wrap}table::ng-deep tbody>tr td i.active-row{color:#1b5e20;font-weight:700;font-size:25px;height:25px;width:25px;margin-top:2px}table::ng-deep tbody>tr td>div{max-height:200px;overflow:hidden;overflow-y:auto}table::ng-deep tbody>tr td a button{color:#000}table::ng-deep tbody>tr td a i{color:#333}table::ng-deep .mat-column-active{width:48px}table.no-hover::ng-deep tbody tr{cursor:default}table.no-hover::ng-deep tbody tr.active{background-color:transparent}table.no-hover::ng-deep tbody tr:hover{background-color:transparent}table.admin-table::ng-deep .actions-cell{width:100px}\n"], components: [{ type: i6.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i8.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: i8.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i8.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { type: i10.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }], directives: [{ type: i11.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i7.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"] }, { type: i6$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]" }, { type: i6$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i6$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i11.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i8.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i8.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i8.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i8.MatCellDef, selector: "[matCellDef]" }, { type: i8.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i11.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i8.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }] });
357
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SelectTable, decorators: [{
358
+ type: Component,
359
+ args: [{ selector: 'ngx-st-select-table', template: "<div class=\"shared-table-selector\">\r\n <p class=\"title\" [ngClass]=\"{'error-text': validError}\">{{title}} {{required ? '*' : ''}}</p>\r\n\r\n <div class=\"search-form row align-items-center\">\r\n <div class=\"col-sm-12 col-md row align-items-center\">\r\n <mat-form-field class=\"col\">\r\n <input matInput placeholder=\"{{searchLabel}}\" [formControl]=\"search\">\r\n </mat-form-field>\r\n <div class=\"clear col-auto\">\r\n <i class=\"material-icons\" (click)=\"clearSearch()\">clear</i>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <table mat-table [dataSource]=\"tableSource\">\r\n <ng-container *ngFor=\"let col of columns\" [matColumnDef]=\"col\" >\r\n <th mat-header-cell *matHeaderCellDef> {{(col === 'active') ? selectedLabel : initColumns[col]}} </th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <ng-container *ngIf=\"col === 'active'\">\r\n <i *ngIf=\"checkActiveRow(element)\" class=\"material-icons active-row\">done</i>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"col !== 'active'\">\r\n {{element[col]}}\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"columns\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: columns;\" (click)=\"rowClick(row)\" [ngClass]=\"{'active': checkActiveRow(row)}\"></tr>\r\n </table>\r\n <mat-paginator [pageSizeOptions]=\"[5]\"></mat-paginator>\r\n</div>\r\n", styles: [".title{margin-bottom:0;margin-top:1rem;font-weight:500}.title.error-text{color:#ef5350}\n", ".search-form button{height:40px}.search-form mat-form-field:first-child{padding-left:0}.search-form mat-form-field:last-child{padding-right:0}.search-form .clear{padding:0}.search-form .clear i{height:20px;width:20px;font-size:20px;cursor:pointer}table{width:100%}table::ng-deep thead tr{background-color:#fff9c4}table::ng-deep thead tr th{border-color:#fdd835}table::ng-deep tbody>tr{cursor:pointer}table::ng-deep tbody>tr.active{background-color:#a5d6a7}table::ng-deep tbody>tr:hover{background-color:#a5d6a7}table::ng-deep tbody>tr.disabled{cursor:not-allowed}table::ng-deep tbody>tr.disabled:hover{background-color:inherit}table::ng-deep tbody>tr.detail-row{height:0;cursor:default}table::ng-deep tbody>tr.detail-row:hover{background-color:transparent}table::ng-deep tbody>tr.detail-row .element-detail{overflow:hidden;display:flex}table::ng-deep tbody>tr.detail-row .element-detail p{padding:20px 0;margin-bottom:0;white-space:pre-wrap}table::ng-deep tbody>tr td i.active-row{color:#1b5e20;font-weight:700;font-size:25px;height:25px;width:25px;margin-top:2px}table::ng-deep tbody>tr td>div{max-height:200px;overflow:hidden;overflow-y:auto}table::ng-deep tbody>tr td a button{color:#000}table::ng-deep tbody>tr td a i{color:#333}table::ng-deep .mat-column-active{width:48px}table.no-hover::ng-deep tbody tr{cursor:default}table.no-hover::ng-deep tbody tr.active{background-color:transparent}table.no-hover::ng-deep tbody tr:hover{background-color:transparent}table.admin-table::ng-deep .actions-cell{width:100px}\n"] }]
360
+ }], ctorParameters: function () { return []; }, propDecorators: { paginator: [{
361
+ type: ViewChild,
362
+ args: [MatPaginator]
363
+ }], title: [{
364
+ type: Input
365
+ }], required: [{
366
+ type: Input
367
+ }], multiple: [{
368
+ type: Input
369
+ }], initSelected: [{
370
+ type: Input
371
+ }], initSearchVal: [{
372
+ type: Input
373
+ }], searchLabel: [{
374
+ type: Input
375
+ }], selectedLabel: [{
376
+ type: Input
377
+ }], returnRowSelected: [{
378
+ type: Output
379
+ }], setInitColumns: [{
380
+ type: Input
381
+ }], tableData: [{
382
+ type: Input
383
+ }], validError: [{
384
+ type: Input
385
+ }] } });
386
+
387
+ class StTablesModule {
388
+ }
389
+ StTablesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: StTablesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
390
+ StTablesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: StTablesModule, declarations: [LocalTableComponent,
391
+ ConfigurationsComponent,
392
+ SelectTable], imports: [CommonModule,
393
+ MatButtonModule,
394
+ MatIconModule,
395
+ MatTableModule,
396
+ MatPaginatorModule,
397
+ MatFormFieldModule,
398
+ MatInputModule,
399
+ MatTooltipModule,
400
+ FormsModule,
401
+ ReactiveFormsModule,
402
+ RouterModule,
403
+ StDateFormatModule,
404
+ MatSortModule,
405
+ MatMenuModule,
406
+ MatSelectModule,
407
+ MatCheckboxModule], exports: [LocalTableComponent,
408
+ SelectTable] });
409
+ StTablesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: StTablesModule, providers: [
410
+ LocalTableService
411
+ ], imports: [[
412
+ CommonModule,
413
+ MatButtonModule,
414
+ MatIconModule,
415
+ MatTableModule,
416
+ MatPaginatorModule,
417
+ MatFormFieldModule,
418
+ MatInputModule,
419
+ MatTooltipModule,
420
+ FormsModule,
421
+ ReactiveFormsModule,
422
+ RouterModule,
423
+ StDateFormatModule,
424
+ MatSortModule,
425
+ MatMenuModule,
426
+ MatSelectModule,
427
+ MatCheckboxModule
428
+ ]] });
429
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: StTablesModule, decorators: [{
430
+ type: NgModule,
431
+ args: [{
432
+ declarations: [
433
+ LocalTableComponent,
434
+ ConfigurationsComponent,
435
+ SelectTable
436
+ ],
437
+ exports: [
438
+ LocalTableComponent,
439
+ SelectTable
440
+ ],
441
+ imports: [
442
+ CommonModule,
443
+ MatButtonModule,
444
+ MatIconModule,
445
+ MatTableModule,
446
+ MatPaginatorModule,
447
+ MatFormFieldModule,
448
+ MatInputModule,
449
+ MatTooltipModule,
450
+ FormsModule,
451
+ ReactiveFormsModule,
452
+ RouterModule,
453
+ StDateFormatModule,
454
+ MatSortModule,
455
+ MatMenuModule,
456
+ MatSelectModule,
457
+ MatCheckboxModule
458
+ ],
459
+ providers: [
460
+ LocalTableService
461
+ ]
462
+ }]
463
+ }] });
464
+
465
+ /*
466
+ * Public API Surface of ngx-st-tables
467
+ */
468
+
469
+ /**
470
+ * Generated bundle index. Do not edit.
471
+ */
472
+
473
+ export { ConfigurationsComponent, LocalTableComponent, LocalTableService, SelectTable, StTablesModule };
474
+ //# sourceMappingURL=ngx-st-tables.mjs.map